Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Unlink the selected entry from the current entry for a Reciprocal Association.
function deleteReciprocalAssociation(field, recip_obj_id) { var type = jQuery('#entry_form input[name=_type]').val(); jQuery.get( CMSScriptURI + '?__mode=unlink_reciprocal', { 'recip_field_basename': field, 'recip_entry_id': recip_obj_id, 'cur_entry_id': jQuery('input[name=id]').val(), 'recip_obj_type': type }, function(data) { jQuery('#'+field+'_status').html(data.message).show(500); // The association was successfully deleted from the database, // so delete the visible data. if (data.status == 1) { jQuery('input#'+field).val(''); jQuery('ul#custom-field-reciprocal-'+field).children().remove(); setTimeout(function() { jQuery('#'+field+'_status').hide(1000) }, 7000); } }, 'json' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unlink(kcLink) {\n let i = this.kcLinks.indexOf(kcLink);\n this.kcLinks.splice(i,1);\n if (this === kcLink.outPoint) {\n // this is a required docking point and someone just removed the link :(\n this.courseObject.requiredWasUnlinked(this);\n }\n }", "unlink(cell){\n if (this.linked(cell)){\n for(var i=0; i<this.noLinks; i++){\n if (cell.id == this._linkIds[i]){\n this.linkIds.splice(i,1) ;\n delete this.links[cell.tag] ;\n break ;\n }\n }\n cell.unlink(this) ;\n }\n }", "unregister(element) {\n const set = this.getSet(element.name);\n set.set.delete(element);\n set.ordered = null;\n if (set.selected == element) {\n set.selected = null;\n }\n }", "removeLinkedResourceFromState(resourceObj) {\n const linkedResources = _.reject(this.state.linkedResources, linkedResource => linkedResource.id === resourceObj.id);\n this.setState({ linkedResources });\n this.setSearchResultDisplay(resourceObj.id, true);\n }", "function removeAssocRow( table, r ){\n\tvar trs = table.getElementsByTagName( 'tr' );\n\tvar tr = trs[r];\n\ttable.removeChild( tr );\n\tfixAssocTable( table );\n}", "clearEntry() {\n this._operation.pop();\n this.setLastNumberToDisplay();\n }", "clearEntry() {\n this._operation.pop();\n this.lastNumberToDisplay();\n }", "function unjoinObject(table, primaryid, primaryobjectid, secondaryid, secondaryobjectid, callback) {\n\tpg.connect(connectionString,\n\t\tfunction (error, database, done) {\n\t\t\tif (error) return callback(error);\n\t\t\tvar condition = map(primaryid, primaryobjectid) + ' AND ' +\n\t\t\t\tmap(secondaryid, secondaryobjectid);\n\t\t\tvar querystring = deleteFrom(table, condition);\n\t\t\tquery(database, done, querystring,\n\t\t\t\tfunction (error, result) {\n\t\t\t\t\tif (error) return callback(error);\n\t\t\t\t\treturn callback(SUCCESS, secondaryobjectid);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n}", "unenroll() {\r\n return super._unenroll(new core.Credential(core.Credential.ProximityCard));\r\n }", "function removeLink(editor) {\n editor.focus();\n editor.addUndoSnapshot(function (start, end) {\n editor.queryElements('a[href]', 1 /* OnSelection */, roosterjs_editor_dom_1.unwrap);\n editor.select(start, end);\n }, \"Format\" /* Format */);\n}", "function unSetReference(searchList, repList)\n {\n if (repList.options.length > 0)\n {\n\t repList.options[0].selected = 1;\n\t moveOptions (repList, searchList);\n }\n }", "unsubscribe(instance) {\n if (this._relation.aggregationKind === histria_utils_1.AGGREGATION_KIND.composite) {\n this._value = undefined;\n }\n }", "removeCompletelyFromInverse() {\n if (!this.inverseKey) {\n return;\n }\n\n // we actually want a union of members and canonicalMembers\n // they should be disjoint but currently are not due to a bug\n var seen = Object.create(null);\n var internalModel = this.internalModel;\n\n var unload = inverseInternalModel => {\n var id = Ember.guidFor(inverseInternalModel);\n\n if (seen[id] === undefined) {\n var relationship = inverseInternalModel._relationships.get(this.inverseKey);\n relationship.removeCompletelyFromOwn(internalModel);\n seen[id] = true;\n }\n };\n\n this.members.forEach(unload);\n this.canonicalMembers.forEach(unload);\n\n if (!this.isAsync) {\n this.clear();\n }\n }", "function deletePerson2(link) {\n var person = link.parentNode.parentNode;\n document.getElementById('tblPerson').removeChild(person);\n}", "unLink() {\n if (!this.isValid()) {\n return;\n }\n const selection = window.getSelection();\n\n if (selection && !selection.toString()) {\n let elementToUnwrap;\n const baseNode = selection.baseNode;\n if (baseNode && baseNode.nodeType === 3 && baseNode.parentElement) {\n elementToUnwrap = baseNode.parentElement;\n }\n if (baseNode && baseNode.nodeType === 1) {\n elementToUnwrap = elementToUnwrap.__closest(\"a\");\n }\n if (elementToUnwrap) {\n elementToUnwrap.unwrap();\n }\n return null;\n }\n const linkElements = Object(_services_range_service__WEBPACK_IMPORTED_MODULE_0__[\"wrapRangeWithElement\"])();\n Array.from(linkElements).forEach(r => {\n const closestATag = r.__closest(\"a\");\n if (closestATag) {\n var a = Object(_utilis_splitHTML__WEBPACK_IMPORTED_MODULE_2__[\"splitHTML\"])(r, closestATag, {\n tag: \"a\"\n })\n if (a) {\n a.center.unwrap();\n }\n }\n Array.from(r.querySelectorAll(\"a\")).forEach(a => {\n a.unwrap();\n });\n r.unwrap();\n });\n const { firstFlag, lastFlag } = Object(_services_range_service__WEBPACK_IMPORTED_MODULE_0__[\"setSelectionFlags\"])(linkElements[0], linkElements[linkElements.length - 1]); //Set Flag at last\n Object(_services_range_service__WEBPACK_IMPORTED_MODULE_0__[\"setSelectionBetweenTwoNodes\"])(firstFlag, lastFlag);\n }", "revertContact() {\n this.getContact().restore();\n }", "function destroyRelationship(rel) {\n rel.internalModelDidDematerialize();\n\n if (rel._inverseIsSync()) {\n // disconnect the graph so that the sync inverse relationship does not\n // prevent us from cleaning up during `_cleanupOrphanedInternalModels`\n rel.removeAllInternalModelsFromOwn();\n rel.removeAllCanonicalInternalModelsFromOwn();\n }\n}", "unenroll() {\r\n return super._unenroll(new core.Credential(core.Credential.Face));\r\n }", "disassociateFrom (context, key) {\n return ideaAdapter.disassociateFromIdea(key)\n }", "unshareLink(kind, shareId) {\r\n return this.clone(SharePointQueryableShareable, null).unshareLink(kind, shareId);\r\n }", "function Ur(t){delete Gr[t]}", "unshareLink(kind, shareId) {\r\n const dependency = this.addBatchDependency();\r\n return this.getShareable().then(shareable => {\r\n dependency();\r\n return shareable.unshareLink(kind, shareId);\r\n });\r\n }", "unshareLink(kind, shareId = \"00000000-0000-0000-0000-000000000000\") {\r\n return this.clone(SharePointQueryableShareable, \"unshareLink\").postCore({\r\n body: jsS({ linkKind: kind, shareId: shareId }),\r\n });\r\n }", "function eraseOne (attraction) {\n\t\t\tattraction.eraseMarker().eraseItineraryItem();\n\t\t}", "unlink() {\n let pos;\n let inode = this.inputNode;\n let onode = this.outputNode;\n\n if (!(inode && onode)) {\n return;\n }\n\n (pos = inode.edges.indexOf(this)) > -1 && inode.edges.splice(pos, 1);\n (pos = onode.edges.indexOf(this)) > -1 && onode.edges.splice(pos, 1);\n (pos = inode.outputEdges.indexOf(this)) > -1 &&\n inode.outputEdges.splice(pos, 1);\n (pos = onode.inputEdges.indexOf(this)) > -1 &&\n onode.inputEdges.splice(pos, 1);\n\n if (this.duplex) {\n (pos = inode.inputEdges.indexOf(this)) > -1 &&\n inode.inputEdges.splice(pos, 1);\n (pos = onode.outputEdges.indexOf(this)) > -1 &&\n onode.outputEdges.splice(pos, 1);\n }\n\n this.inputNode = null;\n this.outputNode = null;\n\n this.duplex = false;\n\n return true;\n }", "detachFromRecurringEvent() {\n const\n me = this,\n // For access further down, breaking the link involves engine if trying to get the occurrenceDate later,\n // resulting in the wrong date\n { recurringTimeSpan, occurrenceDate, startDate } = me;\n\n // Break the link\n me.recurringTimeSpan = null;\n\n // The occurrenceDate is injected into the data when an occurrence is created.\n // the recurringTimeSpan's afterChange will remove any cache occurrence\n // for this date; see above\n recurringTimeSpan.addExceptionDate(occurrenceDate);\n\n // If we still have a recurrenceRule, we're being promoted to be a new recurring event.\n // The recurrence setter applies the rule immediately to occurrences, so this will\n // always be correct.\n if (me.recurrenceRule) {\n // The RecurrenceModel removes occurrences and exceptions after this date\n recurringTimeSpan.recurrence.endDate = DateHelper.add(startDate, -1, 'minute');\n }\n }", "function pop() {\n model.data.pop();\n $.update(model, model.__ref);\n }", "function detachFromAce(ace) {\n\n }", "function unmatch(row) {\n //Get info\n let leftInfo = getSelectedLeftInfo(row);\n let rightEmail = row[rightEmailColumn.key];\n //Get Cross indecies\n let rightInLeftIndex = leftInfo.value.indexOf(rightEmail);\n //Unmatch logic\n leftInfo.value.splice(rightInLeftIndex, 1)\n //Write to google sheets\n writeToLeftGoogleSheet(leftInfo)\n }", "removeCloneLinkFromSection() {\n const cloneLinkParentElem = this.cloneWrapperElem;\n cloneLinkParentElem.parentNode.removeChild(cloneLinkParentElem);\n }", "function undici () {}", "delink (record) {\n const extractLinkId = obj => {\n try {\n const url = obj.links.self\n const sid = url.match(/\\d+$/g)[0]\n return parseInt(sid, 10)\n } catch (e) {\n // Usually because of a bad attempt at regex\n return null\n }\n }\n\n let delinked = this.fields.reduce(function (rec, field) {\n let val = null\n\n // If this field has its own delinker, use that\n if (field.delinker) {\n val = field.delinker(rec[field.name])\n delete rec[field.name]\n } else if (rec.hasOwnProperty(field.name) && isArray(rec[field.name])) {\n // IN some cases, the 'link' property of a record is an array\n // of other links. If it is an array, we need to map each object\n // to our extractLinkId function. This results in an array of Ids\n val = rec[field.name].map(obj => extractLinkId(obj))\n delete rec[field.name]\n } else if (rec.hasOwnProperty(field.name)) {\n // If it's just an object, then extract the link id\n val = extractLinkId(rec[field.name])\n delete rec[field.name]\n }\n rec[field.rename] = val\n return rec\n }, record)\n\n // Stage 1 - remove link properties\n return Object.keys(delinked).reduce((rec, key) => {\n if (typeof rec[key] === 'object' && rec[key] !== null) {\n if (rec[key].hasOwnProperty('links') || rec[key].hasOwnProperty('self')) {\n delete rec[key]\n }\n }\n return rec\n }, delinked)\n }", "function decreaseCurrentEntryID() {\n\t\tcurrentIndex--;\n\t\tcurrentEntryID = indexes[currentIndex];\n\t\tif (currentIndex < 0) currentIndex = indexes.length-1;\n\t\tif (currentIndex < Math.floor(visibleSlides/2) && !allEntriesLoaded) {\n\t\t\tvar index = currentIndex - Math.floor(visibleSlides/2) - 1;\n\t\t\tloadEntries(indexes[0], visibleSlides, true);\n\t\t}\n\t}", "function removeAttribute(link) {\n link = jQuery(link);\n link.parent(\".attribute\").remove();\n}", "function removeAttribute(link) {\n link = jQuery(link);\n link.parent(\".attribute\").remove();\n}", "function rmvClick(){\n let li = this.parentNode.parentNode;\n let ul = li.parentNode;\n ul.removeChild(li);\n}", "declone() {\n\t\tthis.isClone = false;\n\n\t\tif (this.cache) {\n\t\t\tthis.cache.declone();\n\t\t}\n\t}", "function accessProfileLinkUnFormatterForExit(cellvalue, options, rowObject) {\n return;\n}", "function unpair() {\n pairOrUnpair(false, false);\n}", "doUnselectItem() {\n if (this.selected) {\n this.selected.set('selected', false);\n this.set('selected',null);\n }\n }", "function unlinkBarcode(stockitem) {\n\n var html = `<b>{% trans \"Unlink Barcode\" %}</b><br>`;\n\n html += \"{% trans 'This will remove the association between this stock item and the barcode' %}\";\n\n showQuestionDialog(\n \"{% trans 'Unlink Barcode' %}\",\n html,\n {\n accept_text: \"{% trans 'Unlink' %}\",\n accept: function() {\n inventreePut(\n `/api/stock/${stockitem}/`,\n {\n // Clear the UID field\n uid: '',\n },\n {\n method: 'PATCH',\n success: function(response, status) {\n location.reload();\n },\n },\n );\n },\n }\n );\n}", "function delRelation()\n{\n var button\t\t= this;\n var\tform\t\t= button.form;\n var\tname\t\t= this.id;\n var\trownum\t\t= '';\n var\tresult\t\t= /^([a-zA-Z_]+)(\\d+)$/.exec(name);\n if (result)\n {\n\t\tname\t\t= result[1];\n\t\trownum\t\t= result[2];\n } \n form.elements['Updated' + rownum].value\t= 1;\n form.elements['CPRelation' + rownum].value\t= '';\n form.elements['Used' + rownum].checked\t= false;\n form.elements['tag1' + rownum].checked\t= false;\n form.elements['qstag' + rownum].checked\t= false;\n}\t\t// delRelation", "_unsetCombination() {\n this.selectedCombinationId = null;\n }", "function removeLink(_seed_word, _target_word) {\nvar deferred = Q.defer();\nvar seed_word = _seed_word;\nvar target_word = _target_word;\n\nwaitAndCall(function(){\ndownloadFile();\n});\n\ndeleteEntry();\n\nfunction deleteEntry() {\n db.boards.update({ search_word: seed_word }, { $pull: { links: { target: target_word }}},\n function (err, doc) {\n if (err) deferred.reject(err.name + ': ' + err.message);\n deferred.resolve();\n });\n } // end of delete entry function\nreturn deferred.promise;\n}", "function undo() {\n window.annotationObjects.pop();\n }", "function removeEntry(entryId) {\n return Restangular.one(foodDiaryEndpoint, entryId).remove();\n }", "function unhighlight_cell(cellView,graph) {\n var model = graph.getCell(cellView.model.id);\n if(model.isLink()){\n cellView.unhighlight(null, {\n highlighter: {\n name: 'addClass',\n options: {\n className: 'pyro_edge_highlight'\n }\n }\n });\n } else {\n cellView.unhighlight();\n }\n}", "function hideStoryArcs(){\n $('#arcLink').attr('href',$( '.cellcontainer > .cell > .label:exact(\"'+StoryArcFolder+'\")' ).parent().find('a').attr('href'));\n $( '.cellcontainer > .cell > .label:exact(\"'+StoryArcFolder+'\")' ).parent().parent().remove();\n}", "function deselectObject() {\n\t\t\tconsole.log(\"deselectObject()\");\n\t\t\tvar newObject = angular.copy(vm.apiDomain);\n vm.apiDomain = newObject;\n\t\t\tvm.selectedIndex = -1;\n\t\t\tresetDataDeselect();\n\t\t\tsetFocus();\n\t\t}", "function deselectObject() {\n\t\t\tconsole.log(\"deselectObject()\");\n\t\t\tvar newObject = angular.copy(vm.apiDomain);\n vm.apiDomain = newObject;\n\t\t\tvm.selectedIndex = -1;\n\t\t\tresetDataDeselect();\n\t\t\tsetFocus();\n\t\t}", "function deselectObject() {\n\t\t\tconsole.log(\"deselectObject()\");\n\t\t\tvar newObject = angular.copy(vm.apiDomain);\n vm.apiDomain = newObject;\n\t\t\tvm.selectedIndex = -1;\n\t\t\tresetDataDeselect();\n\t\t\tsetFocus();\n\t\t}", "function removeMainLink(name)\n{\n\tvar link = getMainLink(name);\n\tnodeRemove(link);\n}", "function removeImage () {\n vis.selectAll('image').attr('xlink:href', null)\n vis2.selectAll('image').attr('xlink:href', null)\n }", "function cytoscapeContextMenuRemoveModelReference(ele) {\n var wsdlElementName = ele.data('name');\n var wsdlElementType = ele.data('node-type');\n var idWsdlElement = ele.data('id-wsdl-element');\n var idWsdlElementType = ele.data('id-node-type');\n var idServiceDescription = ele.data('id-service-description');\n\n modalRemoveModelReference(idWsdlElement, idWsdlElementType, wsdlElementType, wsdlElementName, idServiceDescription);\n}", "removeEdge(edge) {\n let index = this.links.indexOf(edge);\n //Prevent multiple deletion on the same element causing bugs\n if (index != -1) {\n this.links.splice(index, 1);\n this.svgsManager.edgeManager.update();\n }\n }", "deselectAll() {\n const me = this;\n me.recordCollection.clear();\n if (me._selectedCell) {\n me.deselectCell(me._selectedCell);\n }\n }", "removeNode(node){\n delete this.adjList[node];\n\n Object.keys(this.adjList).map(eachNode => {\n let currentNode = this.adjList[eachNode];\n let currentIndex = currentNode.edges.indexOf(node);\n if(currentIndex > -1){\n currentNode.edges.splice(currentIndex,1);\n }\n })\n }", "removeHyperlink() {\n if (this.owner.isReadOnlyMode) {\n return;\n }\n let selection = this.selection;\n let fieldBegin = selection.getHyperlinkField();\n if (isNullOrUndefined(fieldBegin)) {\n return;\n }\n let fieldEnd = fieldBegin.fieldEnd;\n let fieldSeparator = fieldBegin.fieldSeparator;\n let fieldStartPosition = new TextPosition(selection.owner);\n // tslint:disable-next-line:max-line-length\n fieldStartPosition.setPositionParagraph(fieldBegin.line, (fieldBegin.line).getOffset(fieldBegin, 0));\n let fieldSeparatorPosition = new TextPosition(selection.owner);\n // tslint:disable-next-line:max-line-length\n fieldSeparatorPosition.setPositionParagraph(fieldSeparator.line, (fieldSeparator.line).getOffset(fieldSeparator, fieldSeparator.length));\n this.initComplexHistory('RemoveHyperlink');\n selection.start.setPositionParagraph(fieldEnd.line, (fieldEnd.line).getOffset(fieldEnd, 0));\n selection.end.setPositionInternal(selection.start);\n this.onDelete();\n selection.start.setPositionInternal(fieldSeparatorPosition);\n this.initHistory('Underline');\n this.updateCharacterFormatWithUpdate(selection, 'underline', 'None', false);\n if (this.editorHistory) {\n this.editorHistory.updateHistory();\n }\n // Applies font color for field result.\n this.initHistory('FontColor');\n this.updateCharacterFormatWithUpdate(selection, 'fontColor', undefined, false);\n if (this.editorHistory) {\n this.editorHistory.updateHistory();\n }\n this.reLayout(selection, false);\n selection.end.setPositionInternal(selection.start);\n selection.start.setPositionInternal(fieldStartPosition);\n this.initHistory('Delete');\n this.deleteSelectedContents(selection, false);\n this.reLayout(selection, true);\n if (this.editorHistory && !isNullOrUndefined(this.editorHistory.currentHistoryInfo)) {\n this.editorHistory.updateComplexHistory();\n }\n }", "function removeTaskResource(link) {\n link = jQuery(link);\n var parent = link.parent(\".resource_no\");\n parent.remove();\n}", "function removeTaskResource(link) {\n link = jQuery(link);\n var parent = link.parent(\".resource_no\");\n parent.remove();\n}", "onRemove(){\n if (this.anchor.parentElement) {\n this.anchor.parentElement.removeChild(this.anchor);\n }\n }", "function removeSyncRow(row) {\n\tvar DB = new SQLite('_alloy_');\n\n\tDB.table(exports.config.syncTableName)\n\t.where(row)\n\t.delete()\n\t.run();\n}", "function releaseMapSelection() {\n\t\tif (this.selectedNetworkElements != null) {\n\t\t\tfor (var i = 0; i < this.selectedNetworkElements.getLength(); i++) {\n\t\t\t\tthis.selectedNetworkElements.get(i).unselect();\n\t\t\t}\n\t\t}\n\t\tif (this.dottedSelection != null) {\n\t\t\tthis.dottedSelection.release();\n\t\t}\n\t\tthis.selectedNetworkElements = null;\n\t\tthis.selection.release();\n\t\tthis.dottedSelection = null;\n\t}", "unbind() {\n if (this.parent) {\n const parent = childToParent.get(this);\n parent.removeChild(this);\n }\n }", "detachFromRecurringEvent() {\n const me = this,\n // For access further down, breaking the link involves engine if trying to get the occurrenceDate later,\n // resulting in the wrong date\n {\n recurringTimeSpan,\n occurrenceDate,\n startDate\n } = me; // Break the link\n\n me.recurringTimeSpan = null; // The occurrenceDate is injected into the data when an occurrence is created.\n // the recurringTimeSpan's afterChange will remove any cache occurrence\n // for this date; see above\n\n recurringTimeSpan.addExceptionDate(occurrenceDate); // If we still have a recurrenceRule, we're being promoted to be a new recurring event.\n // The recurrence setter applies the rule immediately to occurrences, so this will\n // always be correct.\n\n if (me.recurrenceRule) {\n // The RecurrenceModel removes occurrences and exceptions after this date\n recurringTimeSpan.recurrence.endDate = DateHelper.add(startDate, -1, 'minute');\n }\n }", "function removeElement(element) {\n _.pull(viewModel.row.elements, element);\n }", "remove(item) {\n // Relink the previous item\n if (item.prev) item.prev.next = item.next;\n if (item.next) item.next.prev = item.prev;\n if (item === this._last) this._last = item.prev;\n if (item === this._first) this._first = item.next; // Invalidate item\n\n item.prev = null;\n item.next = null;\n }", "function unselectAll() {\n d3.selectAll(\"#synoptic .selection\")\n .remove();\n }", "unSelectObject() {\n\n if (this.state.selectedObjectName) {\n\n const objectName = this.state.selectedObjectName;\n\n this.setState({\n selectedObjectName: null,\n selectedAnnotatedObject: null,\n showWindow: false\n }, () => {\n this._updateObjectAppearance(objectName);\n });\n }\n }", "unenroll() {\r\n return super._unenroll(new core.Credential(core.Credential.U2F));\r\n }", "function rem(a) {\n\n $(a).parent().remove();\n\n}", "unarchive () {\n try {\n this.state.unarchiveValue(this.boxedValue);\n this.emit('state changed', this.state, this.state);\n } catch (err) {\n this.emit('state change failed', err);\n throw err;\n }\n }", "revert() {\n this._cache = this._checkpoints.pop();\n }", "function remove(item, key) {\n key = key || 0;\n var itemLinks = item[_LINKS];\n var itemPrev = itemLinks[key];\n var itemNext = itemLinks[key+1];\n \n //printItem('remove: before item ===', item, key);\n \n if (itemNext) {\n itemNext[_LINKS][key] = itemPrev;\n }\n \n if (itemPrev) {\n itemPrev[_LINKS][key+1] = itemNext;\n }\n \n itemLinks[key] = null;\n itemLinks[key+1] = null;\n \n //printItem('remove: after item ===', item, key);\n //printNewLine();\n}", "function removeRelationType(type) {\r\n for (var int = 0; int < relationTypes.length; int++) {\r\n if (relationTypes[int] == type) {\r\n relationTypes.splice(int, 1);\r\n break;\r\n }\r\n }\r\n setOutcomePaths();\r\n update();\r\n }", "function deselect() {\n deselectTask(requireCursor());\n }", "function unhighlightOutboundInheritance(cellView, first=false){\n var links = graph.getConnectedLinks(cellView.model, {inbound: true, outbound: true})\n \n if (!first) {\n unhighlightCell(cellView)\n }\n\n links.forEach(function(link){\n if((link.prop('linkType') == 'inheritance') && (link.attributes.source.id == cellView.model.id)){\n unhighlightCell(paper.findViewByModel(link))\n }\n })\n}", "function removeLinks(){\n\tdojo.destroy('usgsLinks');\n}", "function remove (){\n match_list.pop();\n match_list.pop();\n }", "function removeSelection(item) {\n //reset this item's grabbed state\n item.setAttribute('aria-grabbed', 'false');\n\n //then find and remove this item from the existing items array\n for (var len = selections.items.length, i = 0; i < len; i++) {\n if (selections.items[i] == item) {\n selections.items.splice(i, 1);\n break;\n }\n }\n}", "unsync() {\n this._lfo.unsync();\n return this;\n }", "function UnlinkIdentityCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "function UnlinkIdentityCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "removeLinkedResourceFromTicket(resourceObj) {\n this\n .getResourcesArr()\n .then(resourcesArr => {\n resourcesArr = _.reject(resourcesArr, resource => resource.id === resourceObj.id); // remove the pertinent linked resource\n this.updateZendeskTicketCustomField(encodeLinkedResources(resourcesArr)); // save the new array of linked resources\n });\n }", "function removeElement(elem){if(elem.prev)elem.prev.next=elem.next;if(elem.next)elem.next.prev=elem.prev;if(elem.parent){var childs=elem.parent.children;childs.splice(childs.lastIndexOf(elem),1);}}", "function prefListRemove(event, ui){\n console.log($(ui.item).attr('data-id') + \" removed\");\n $.post( \"/people/delpreference/\"+ $($('.highlight').find(\"td:nth-child(1)\")).attr('data-id'),{pub: $(ui.item).attr('data-id')});\n}", "clearEntry() {\n this.destroyLastOperator();\n this.updateDisplay();\n }", "removeEdge(g, e) { }", "removeEdge(g, e) { }", "unselect() {\n this.selection = null;\n this.refreshSelection();\n return this;\n }", "function clearEntry () {\n\n nextValue = null;\n}", "function unPark(){\n setDetail(selected, 'lat', 0);\n setDetail(selected, 'lng', 0);\n setDetail(selected, 'adress', '');\n clearMarkers();\n }", "function unfollow(){\n\tif(!confirm(\"Are you sure you want to unfollow all selected athletes?\"))\n\t\treturn;\n\n\t// create an array of keys\n\tkeys = [];\n\t//loop through each line\n\t$(\".lineItem\").each(function(){\n\n\t\t// if it is checked, remove it from the list and the storage\n\t\tif($(this).find(\"input\").prop(\"checked\")){\n\t\t\tvar id = $(this).attr(\"value\");\n\t\t\t$(this).remove();\n\t\t\tkeys.push(id);\n\t\t\t//update the count\n\t\t\tfollowCount--;\n\t\t}\n\t});\n\n\t//remove from storage\n\tchrome.storage.sync.remove(keys);\n\t//update the page\n\t$(\"#follow-count\").text(\"(\"+followCount+\")\");\n\tchrome.tabs.reload();\n}", "detach() {\n invariant(this.parent, 'Node is not parented');\n this.parent.children.splice(this.parent.children.indexOf(this), 1);\n this.parent.el.removeChild(this.el);\n this.parent = null;\n }", "function removeMe(e){\r\n var linkToRemove = e.target.getAttribute(\"myid\");\r\n bookMarksArray.splice(linkToRemove,1)\r\n saveBookMarks();\r\n updateBookMarkList();\r\n}", "remove() {\n\t\tthis.active = false;\n\t\tthis.ctx.remove();\n\t\tthis.parent.removeDot(this.id);\n\t}", "delete(){\n let neighborList = this.neighbors.iterator();\n\n while(!neighborList.isEmpty()){\n neighborList.currItem().removeNeighbor(this); //remove this from its list\n\n neighborList.next();\n }\n\n }", "removeSelf() {\n // triggered by clicking the exit button\n this.holder.remove()\n // take self out of the filter list on the AltHolder ob\n // this is a function set by the AltHolder on each row it creates\n this.removeFromList(this)\n }", "unsee() {}", "function qr(e){delete Gr[e]}" ]
[ "0.5946615", "0.57622755", "0.55962974", "0.5592985", "0.5504511", "0.54269713", "0.5403657", "0.536653", "0.53381896", "0.5303855", "0.52463424", "0.5215935", "0.52037936", "0.5190934", "0.51818377", "0.5181754", "0.5165549", "0.5155353", "0.5128827", "0.5123988", "0.5067149", "0.50582546", "0.5048223", "0.50351655", "0.50326896", "0.50147283", "0.50007683", "0.4982292", "0.4980213", "0.49739078", "0.49560037", "0.49557555", "0.49490952", "0.49302524", "0.49302524", "0.492606", "0.491523", "0.49085593", "0.49046907", "0.4901692", "0.4895166", "0.48825115", "0.48812532", "0.48683223", "0.4862559", "0.4853236", "0.4851459", "0.48503998", "0.48498306", "0.48498306", "0.48498306", "0.48445788", "0.48395628", "0.48303926", "0.4828483", "0.48187914", "0.48162952", "0.48142797", "0.48123726", "0.48123726", "0.48101398", "0.480429", "0.4803801", "0.48035508", "0.47993717", "0.47959602", "0.47939378", "0.4793919", "0.47907028", "0.478877", "0.4788502", "0.47839335", "0.4782713", "0.4782149", "0.47811592", "0.47675824", "0.47668415", "0.47642595", "0.4760309", "0.47514296", "0.475124", "0.4749756", "0.4749756", "0.47440934", "0.47390303", "0.47362015", "0.47277164", "0.47258717", "0.47258717", "0.47240287", "0.47071943", "0.47041368", "0.47028306", "0.47005653", "0.46960112", "0.46892288", "0.46750706", "0.4670571", "0.46694964", "0.4668574" ]
0.58791316
1
Create the timestamp for the Timestamped Textarea CF.
function createDate() { var d = new Date(); var year = d.getFullYear(); var month = d.getMonth() + 1; if (month < 10) { month = 0 + month.toString(); } var date = d.getDate(); if (date < 10) { date = 0 + date.toString(); } var hours = d.getHours(); if (hours < 10) { hours = 0 + hours.toString(); } var min = d.getMinutes(); if (min < 10) { min = 0 + min.toString(); } var sec = d.getSeconds(); if (sec < 10) { sec = 0 + sec.toString(); } var ts = year.toString() + month.toString() + date.toString() + hours.toString() + min.toString() + sec.toString(); return ts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TimeStamp() {}", "function TimeStamp() {}", "_renderCardTimestamp() {\n if (this.card_timestamp && this.timestampLayer) {\n this.timestampLayer.innerHTML = localDatetime(new Date().toISOString())\n }\n }", "_renderCardTimestamp() {\n if (this.card_timestamp && this.timestampLayer) {\n this.timestampLayer.innerHTML = localDatetime(new Date().toISOString())\n }\n }", "function create_timestamp() {\n const now = new Date();\n\n const hours = now.getHours().toString().padStart(2, '0');\n const minutes = now.getMinutes().toString().padStart(2, '0');\n const seconds = now.getSeconds().toString().padStart(2, '0');\n const millis = now.getMilliseconds().toString().padStart(3, '0');\n\n return `${hours}:${minutes}:${seconds}.${millis}`;\n }", "function timestamp()\r\n {\r\n return this.format(\"dd.MM.yyyy hh:mm:ss.ffffff\");\r\n }", "function render_timestamp(data, type, row, meta) {\r\n if (type == \"display\") return gui.date.timestamp_difference(gui.date.now(), data)\r\n else return data\r\n }", "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 }", "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 var date = [ now.getMonth() + 1, now.getDate(), now.getFullYear() ];\n\n// Create an array with the current hour, minute and second\n var time = [ now.getHours(), now.getMinutes(), now.getSeconds() ];\n\n// Determine AM or PM suffix based on the hour\n var suffix = ( time[0] < 12 ) ? \"AM\" : \"PM\";\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 var currentDate= date.join(\"/\") + \" \" + time.join(\":\") + \" \" + suffix;\n console.log(currentDate);\n document.getElementById('currentDate').innerHTML= currentDate\n}", "function timestampCellRenderer(params) {\n return params.value + ' <span style=\"font-size: 10px; color: grey;\">' + new Date().getTime() + '</span>';\n}", "function getTimestamp() {\n return moment().format(\"LLLL\") + \" --------------------------------------------------- \\n\";\n}", "static get timestamp() {\n return `[${moment().format('MM/DD/YYYY HH:mm:ss')}]`;\n }", "function draw_timestamp(step, t) {\n\tsvg.append('text')\n\t\t.text(t)\n\t\t.attr('x', get_text_x(step))\n\t\t.attr('y', 55)\n\t\t.attr('font-family', 'sans-serif')\n\t\t.attr('font-size', '18')\n\t\t.attr('text-anchor', 'middle');\n}", "function makeTimestamp() {\n var timestamp = (new Date()).toLocaleString();\n return timestamp;\n}", "function Unix_timestamp(t) {\n var timeMer = \"\";\n var dhr = \"\";\n var dt = new Date(t * 1000);\n var hr = dt.getHours();\n if (hr < 12) { //custom js added by developer\n timeMer = \"AM\";\n if (hr == 0) {\n dhr = 12;\n } else {\n dhr = hr;\n }\n } else {\n timeMer = \"PM\";\n if (hr == 12) {\n dhr = 12;\n } else {\n dhr = hr - 12;\n }\n }\n\n var m = \"0\" + dt.getMinutes();\n\n //custom js added by developer; create and return timestamp object\n let currentTimeObj = {\n fulltime: dhr + ':' + m.substr(-2) + ' ' + timeMer,\n hours: hr\n };\n return currentTimeObj;\n }", "function displayTimestamp(timestamp) {\r\n function zero(dig) {\r\n return ('0' + dig).slice(-2);\r\n }\r\n let locTimestamp = new Date(timestamp);\r\n locTimestamp = locTimestamp.getTime() + locTimestamp.getTimezoneOffset()*60000;\r\n locTimestamp = new Date(locTimestamp);\r\n let d = locTimestamp.getDate();\r\n let m = locTimestamp.getMonth() + 1;\r\n let y = locTimestamp.getFullYear();\r\n let h = locTimestamp.getHours();\r\n let min = locTimestamp.getMinutes();\r\n let dispTimestamp = zero(d) + '.' + zero(m) + '.' + y + ' ' + zero(h) + ':' + zero(min);\r\n return dispTimestamp;\r\n }", "function SetStartTime(custid) {\n\n\n //TimeStamp - Capture Start Time\n var currentTime = new Date();\n var month = currentTime.getMonth() + 1;\n var day = currentTime.getDate();\n var year = currentTime.getFullYear();\n\n var hours = currentTime.getHours();\n var minutes = currentTime.getMinutes();\n\n if (minutes < 10) {\n minutes = '0' + minutes\n }\n\n var seconds = currentTime.getSeconds();\n if (seconds < 10) {\n seconds = '0' + seconds\n }\n\n var daTime = (month + \"/\" + day + \"/\" + year + \" \" + hours + \":\" + minutes + \":\" + seconds);\n\n //alert(\"Start Time \"+ daTime);\n document.forms[0].timestamp.value = daTime;\n\n\n //saveReport (custid, \"timestamp\", document.forms[0].timestamp.value);\n saveReport(custid, \"StartTime\", daTime);\n\n //\n\n}", "function timestamp()\r\n{\r\n\treturn new Date().toLocaleTimeString();\r\n}", "function addTimestamp(timedate) {\n //var date = timedate.substr(0,10);\n //var time = timedate.substr(11,8);\n date = new Date(timedate);\n legend.onAdd = function (map) {\n var div = L.DomUtil.create('div', 'info legend');\n div.innerHTML = date.toLocaleString()+'<br>';\n return div;\n };\n legend.addTo(map);\n}", "function buildTimeStamp() {\n\tconst date = (new Date()) + ''\n\n\treturn date.split(' ')[4]\n}", "formatTimeStamp (stamp) {\n this.ctatdebug (\"formatTimeStamp (\" + stamp + \")\");\n\n var s=\"\";\n var year= stamp.getUTCFullYear();\n s += year+\"-\";\n\n var month=stamp.getUTCMonth();\n month++;\n s += ((month<10) ? (\"0\"+month) : month)+\"-\";\n\n var date = stamp.getUTCDate();\n s += ((date<10) ? (\"0\"+date) : date)+\" \";\n\n var hours = stamp.getUTCHours();\n s += ((hours<10) ? (\"0\"+hours) : hours)+\":\";\n\n var mins = stamp.getUTCMinutes();\n s += ((mins<10) ? (\"0\"+mins) : mins)+\":\";\n\n var secs = stamp.getUTCSeconds();\n s += ((secs<10) ? (\"0\"+secs) : secs);\n\n var msec = stamp.getUTCMilliseconds ();\n s+=\".\";\n s+=(msec<10?\"00\":(msec<100?\"0\":\"\"))+msec;\n\n //s+=\" UTC\";\n\n return s;\n }", "function timestampCellFormatter(row, cell, value, columnDef, dataContext){\n\t\tif(value == null || value === \"\" || value==0)return \"\";\n\t\tvar dataRow = getDataRow(row);\n\n\t\t//Re-calculate timestamp based on time_start entry for row\n\t\t//Ensures stacking order is correct in grid\n\t\tvar timeArr = dataRow.time_start.split(\":\"),\n\t\t\ttotalMins = 0;\n\t\tif(timeArr[0])totalMins = (timeArr[0]*60)+timeArr[1]*1; //Get number of seconds from time string\n\n\t\t//Update value by adding minutes from time_start to 00:00 of day from timestamp\n\t\tvalue = getDayStartTimestamp(value) + totalMins;\n\t\tdataRow.date_timestamp = value; //Overwrite timestamp in data ob\n\n\t\tvar thedate = $.datepicker.parseDate(\"@\", value * 1000);\n\t\treturn $.datepicker.formatDate(\"dd/mm/yy\", thedate);\n\t}", "function renderTimeStamp(date) {\n\tvar time = document.createElement('time')\n\tvar d = parseDate(date)\n\ttime.setAttribute('datetime',date)\n\ttime.setAttribute('title',timeString(d))\n\ttime.textContent = timeAgo(d)\n\ttime.className = \"textItem time\"\n\treturn time\n}", "function formattedDispalyTime() {\n \n // Build current date \n let currentDate = new Date();\n let currentYear = currentDate.getYear();\n if (currentYear < 1000) {\n currentYear += 1900;\n }\n let currentDay = currentDate.getDay();\n let currentMonth = currentDate.getMonth();\n let currentDayOfMonth = currentDate.getDate();\n \n let dayOfWeekArray = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n let monthArray = [];\n monthArray[0] = \"January\";\n monthArray[1] = \"February\";\n monthArray[2] = \"March\";\n monthArray[3] = \"April\";\n monthArray[4] = \"May\";\n monthArray[5] = \"June\";\n monthArray[6] = \"July\";\n monthArray[7] = \"August\";\n monthArray[8] = \"September\";\n monthArray[9] = \"October\";\n monthArray[10] = \"November\";\n monthArray[11] = \"December\";\n\n // Build current time \n let currentTime = new Date();\n let hour = currentTime.getHours();\n let minutes = currentTime.getMinutes();\n let seconds = currentTime.getSeconds(); \n if (hour === 24) {\n hour = 0;\n } else if (hour > 12) {\n hour = hour - 0;\n }\n\n if (hour < 10) {\n hour = \"0\" + hour;\n }\n\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n // Assign a variable to the element id where timestamp will appear \n let postTimeId = document.getElementById(\"comments__posts__name--time\");\n \n // Display newly formatted timestamp\n // let timeStamp = \"\" + seconds;\n // let timeStamp = postTimeId.innerHTML = \"\" + currentYear + \" \" + currentMonth + \" \" + currentDay + \"T\" + hour + \":\" + minutes + \":\" + seconds +\"Z\"\n // let timeStamp = postTimeId.innerHTML = \"\" + dayOfWeekArray[currentDay]+ \" \" + currentDayOfMonth + \" \" + monthArray[currentMonth] + \" \" + currentYear + \" | \" + hour + \":\" + minutes + \":\" + seconds;\n let timeStamp = postTimeId.innerHTML = \"\" + dayOfWeekArray[currentDay]+ \" \" + currentDayOfMonth + \" \" + monthArray[currentMonth] + \" \" + currentYear;\n \n return timeStamp; \n}", "function Util_timestamp() { return Date.now(); }", "static _timestamp(){\n if(!Logger.timestamps){\n return \"\";\n }\n var date = new Date()\n var dateString = date.toLocaleString();\n return colors.dim.cyan(\"[\"+dateString+\", \"+date.getMilliseconds().toString().padStart(3)+\"] \");\n }", "generateTimeStamp() {\n var m = new Date();\n var dateString =\n m.getUTCFullYear() +\n \"/\" +\n (\"0\" + (m.getUTCMonth() + 1)).slice(-2) +\n \"/\" +\n (\"0\" + m.getUTCDate()).slice(-2) +\n \" \" +\n (\"0\" + m.getUTCHours()).slice(-2) +\n \":\" +\n (\"0\" + m.getUTCMinutes()).slice(-2) +\n \":\" +\n (\"0\" + m.getUTCSeconds()).slice(-2);\n return dateString;\n }", "function getTimeStamp(){\n d = new Date();\n return d.getFullYear()+(\"0\"+(d.getMonth()+1)).slice(-2)+(\"0\"+d.getDate()).slice(-2)+ (\"0\" + d.getHours()).slice(-2)+ (\"0\" + d.getMinutes()).slice(-2)+(\"0\" + d.getSeconds()).slice(-2);\n}", "function newScreenMsg(text){\r\n let newTextBox = document.createElement(\"div\");\r\n let newTextContent = document.createElement(\"p\"); \r\n $(newTextBox).addClass(\"bubble user\").append(newTextContent);\r\n $(newTextContent).append(text);\r\n\r\n let screenSpace = document.getElementById(\"screen\"); \r\n $(screenSpace).append(newTextBox);\r\n\r\n \r\n //add time\r\n let timeStamp = new Date().toLocaleTimeString();\r\n let timeSpace = document.createElement(\"p\");\r\n $(timeSpace).addClass(\"time\");\r\n $(newTextBox).append(timeSpace)\r\n $(timeSpace).append(timeStamp);\r\n console.log(timeStamp);\r\n}", "formatTimestamp(timestamp) {\n const date = new Date(timestamp);\n\n return `${date.getDate()}/${\n date.getMonth() + 1\n }/${date.getFullYear()} ${date.getHours()}:${date.getMinutes()}`;\n }", "function retrieveTimestamp(){\n var DT_obj=new Date();\n // var date_string=DT_obj.getFullYear()+\"-\"+(padSingleDigits(10)+1)+\"-\"+padSingleDigits(DT_obj.getDate());\n var date_string=DT_obj.getFullYear()+\"-\"+(padSingleDigits(DT_obj.getMonth()+1))+\"-\"+padSingleDigits(DT_obj.getDate());\n \n var time_string=padSingleDigits(DT_obj.getHours())+\":\"+padSingleDigits(DT_obj.getMinutes())+\":\"+padSingleDigits(DT_obj.getSeconds());\n\n var date_time_string=date_string+\" \"+time_string;\n // console.log(date_time_string);\n\n return date_time_string;\n }", "getCurrentTimestampSQL(length) {\n return 'current_timestamp' + (length ? `(${length})` : '');\n }", "function datetime(f){var k=function(n){if(n<10){n=\"0\"+n}return n};var m=function(){var o=new Date();var q=o.getHours();var n=o.getMinutes();var p=o.getSeconds();q=k(q);n=k(n);p=k(p);f(\"#jamskrng\").text(q+\":\"+n+\":\"+p);setTimeout(m,1000)};m();var a=document.getElementById(\"tglskrngx\");function b(){for(i=0;i<b.arguments.length;i++){this[i+1]=b.arguments[i]}}var c=new b(\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");var e=new Date();var l=e.getDate();var g=e.getMonth()+1;var h=e.getYear();var j=(h<1000)?h+1900:h;var d=c[g]+\" \"+l+\", \"+j;a.innerHTML=d}", "function getTimeStamp() {\r\n let d = new Date();\r\n let day = String(d.getDate()).padStart(2, '0'); \r\n let month = String(d.getMonth()+1).padStart(2, '0');\r\n let year = String(d.getFullYear());\r\n return `${day}-${month}-${year}` ;\r\n}", "function TimerFormatter() {\n }", "function timestamp(){\n\tconst msg_datetime=new Date(Date.now());\n\tconst msg_hour=msg_datetime.getHours();\n\tconst msg_mins=msg_datetime.getMinutes();\n\tif (msg_hour<10){\n\t\tvar hour=\"0\"+msg_hour;\n\t}else{\n\t\thour=msg_hour;\n\t};\n\tif (msg_mins<10){\n\t\tvar mins=\"0\"+msg_mins;\n\t}else{\n\t\tmins=msg_mins;\n\t};\n\tconst msg_timestamp=hour+\":\"+mins;\n\treturn [msg_timestamp,msg_datetime];\n}", "function timestamp(str) {\r\n var dateOut = kendo.parseDate(str, 'yyyy-MM-dd');\r\n if (!dateOut) return 0;\r\n return dateOut.getTime();\r\n }", "function createTimeStamp(timeStamp) {\n let date = new Date(timeStamp * 1000);\n let hours = date.getHours();\n let minutes = \"0\" + date.getMinutes();\n\n let calculatedTime = ((hours-2) * 60) + minutes;\n console.log(calculatedTime);\n return calculatedTime; \n // determineSetting(calculatedTime); \n}", "function stamp(data) {\r\n if ((!data || data < (new Date().getTime() - (__sco.config.mintimeout * 1000))) && __scd.t > 0) {\r\n var timestamp = __sco.clone(__sco.config.timestamptemplate);\r\n timestamp.t = __scd.t; timestamp.i = __sco.config.doc.i; timestamp.i1 = __sco.config.doc.i1; timestamp.s.i = __scd.s.i; timestamp.s.m = __scd.s.m;\r\n __sco.management.timestampapi(timestamp);\r\n }\r\n }", "function TimestampParams() {\n var _this = _super.call(this) || this;\n _this.handle = new native.CMS.TimestampParams();\n return _this;\n }", "function getTime() {\n\tOutput('<span>It\\'s the 21st century man! Get a SmartWatch</span></br>');\n}", "function FormatTimeStamp(inputDate) {\r\n if (inputDate == null) return (new Date());\r\n inputDate = Number(inputDate).toString()\r\n var year = inputDate.substring(0, 4);\r\n var month = inputDate.substring(4, 6);\r\n var day = inputDate.substring(6, 8);\r\n var hour = inputDate.substring(8, 10);\r\n var minutes = inputDate.substring(10, 12);\r\n var seconds = inputDate.substring(12, 14);\r\n\r\n return (new Date(year, month, day, hour, minutes, seconds, 0));\r\n\r\n}", "function formatTimestamp(timestamp)\r\n{\r\n\tvar a = new Date(timestamp * 1000);\r\n\tvar months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\r\n\tvar year = a.getFullYear();\r\n\tvar month = months[a.getMonth()];\r\n\tvar date = a.getDate();\r\n\tvar hour = a.getHours() % 12;\r\n\tvar min = a.getMinutes().toString().length == 1 ? \"0\" + a.getMinutes(): a.getMinutes();\r\n\tvar sec = a.getSeconds();\r\n\tvar time = month + ' ' + date + ', ' + year + ' ' + hour + ':' + min;\r\n\r\n\treturn time;\r\n}", "createTimer() {\n\n // for the text showing game time left\n let timeTextConfig = {\n fontFamily: 'Courier',\n fontSize: '23px',\n backgroundColor: '#D8D7D7',\n color: '#000000',\n align: 'right',\n padding: {\n top: 5,\n bottom: 5,\n },\n }\n \n this.timeLabel = this.add.text(314, 444, game.settings.gameTimer/1000, timeTextConfig);\n }", "function timestamp() {\n let aux = new Date(Date.now());\n return aux.toDateString() + ' ' + aux.toLocaleTimeString();\n}", "function getTimestamp() {\n return new Date().getTime();\n}", "extractTimestamp(ciphertext) {\n return this.module.extract_timestamp(ciphertext);\n }", "function getTimeStamp(){\n var t = moment().format('Do MMM YYYY [|] HH:mm [|] ');\n return t;\n}", "function getTimestampText(ts){\n\t \tvar dateTime = new Date(ts)\n\n\t \tvar month = dateTime.getMonth(),\n\t \t\tdate = dateTime.getDate(),\n\t \t\thours = dateTime.getHours(),\n\t \t\tminutes = dateTime.getMinutes();\n\n\t \tvar monthName = utils.getMonthName(month).substring(0,3);\n\t \tif(hours<10){\n\t \t\thours = \"0\"+ hours.toLocaleString();\n\t \t}else{\n\t \t\thours = hours.toLocaleString()\n\t \t}\n\t \tif(minutes<10){\n\t \t\tminutes = \"0\"+ minutes.toLocaleString();\n\t \t}else{\n\t \t\tminutes = minutes.toLocaleString()\n\t \t}\n\n\t \tvar tsText = date.toLocaleString() + \" \" + monthName + \"(\" + hours +\":\" + minutes + \")\";\n\n\t \treturn tsText;\n\t }", "toTimeStamp() {\n return TimeStamp.from(this);\n }", "function timestamp(unix) { //BORROWED FROM STACKOVERFLOW\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*1000);\n// Hours part from the timestamp\n let hours = date.getHours();\n// Minutes part from the timestamp\n let minutes = \"0\" + date.getMinutes();\n// Seconds part from the timestamp\n let seconds = \"0\" + date.getSeconds();\n// Will display time in 10:30:23 format\n let formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);\n return formattedTime;\n}", "getCurrentTimeStamp() {\n return new Date().getTime() * 1e6;\n }", "addTimestamp (state, {videoId, timestamp, label=\"\"}) {\n Vue.set(state.videos[videoId].timestamps, timestamp, label);\n }", "function getTimeStamp() {\n var currentTime = new Date();\n var hours = currentTime.getHours();\n var minutes = currentTime.getMinutes();\n var seconds = currentTime.getSeconds();\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n var timeStamp = hours + \":\" + minutes;\n return timeStamp;\n }", "get _timestamp() {\n\t\tlet timestamp = this.timestamp !== undefined ? this.timestamp : getTodayUTCTimestamp(this._primaryCalendarType);\n\t\tif (timestamp < this._minTimestamp || timestamp > this._maxTimestamp) {\n\t\t\ttimestamp = this._minTimestamp;\n\t\t}\n\t\treturn timestamp;\n\t}", "function timestamp(value) {\n var sec_num = value;\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) {hours = \"0\"+hours;}\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n return hours+':'+minutes+':'+seconds;\n }", "function timetrans(timestamp){\n\tvar pub_time = new Date(timestamp);\n\tlet year = pub_time.getFullYear();\n\tlet month = (pub_time.getMonth()+1 < 10 ? '0'+(pub_time.getMonth()+1) : pub_time.getMonth()+1);\n\tlet day = (pub_time.getDate() < 10 ? '0'+pub_time.getDate() : pub_time.getDate());\n\tlet hour = (pub_time.getHours() < 10 ? '0'+pub_time.getHours() : pub_time.getHours());\n\tlet minute = (pub_time.getMinutes() < 10 ? '0'+pub_time.getMinutes() : pub_time.getMinutes());\n\tlet sec = (pub_time.getSeconds() < 10 ? '0'+pub_time.getSeconds() : pub_time.getSeconds());\n\treturn year+\"-\"+month+\"-\"+day+\" \"+hour+\":\"+minute+\":\"+sec;\n}", "function localizedCreatedTimestamp() {\n if (vm.course) {\n return moment(vm.course.Created).format(\"M/D/YYYY h:mm A\");\n } else {\n return '';\n }\n }", "formatTime(timestamp) {\r\n const d = new Date(timestamp);\r\n const time = `${d.getDate()}/${(d.getMonth()+1)}/${d.getFullYear()} ${d.getHours()}:${d.getMinutes()}`;\r\n return time;\r\n }", "function vistaGetTimeStamp() {\n var d = new Date();\n var yearString = d.getFullYear();\n \n // Milliseconds can be derived from the getTime function\n var milliString = vistaPadNumber(d.getTime() % 1000, '0', 3);\n var dateString;\n\n dateString = yearString + vistaPadNumber(d.getMonth() + 1, '0', 2) + vistaPadNumber(d.getDate(), '0', 2);\n dateString = dateString + '.' + vistaPadNumber(d.getHours(), '0', 2) + ':' + vistaPadNumber(d.getMinutes(), '0', 2);\n dateString = dateString + ':' + vistaPadNumber(d.getSeconds(), '0', 2) + '.' + milliString;\n return dateString;\n}", "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}", "function extractTimestamp(parent)\n{\n var timestamp = null;\n\n if (parent && parent.lastChild)\n {\n if (3 == parent.lastChild.nodeType)\n {\n var arr = rxTs.exec(parent.lastChild.textContent);\n if (null != arr)\n {\n var dateObj = new Date(arr[1]);\n timestamp = dateObj.getTime();\n //GM_log (\"extractTimestamp: timestamp is\" + timestamp + \", input was: \" + arr[1]);\n }\n else\n GM_log (\"extractTimestamp: didn't match rxTs \" + parent.lastChild.textContent);\n }\n else\n GM_log (\"extractTimestamp: not a text node \" + parent.lastChild.nodeType);\n }\n else\n GM_log (\"extractTimestamp: parent or last child null, \" + parent);\n\n return timestamp;\n}", "function setup_plot_timestamps(timestamps)\n{\n\tvar prev = \"\";\n\tvar length = timestamps.length;\n\n\tfor (let i = 0; i < length; i++)\n\t{\n\t\tvar ts = timestamps[i];\n\t\tvar current = get_date_from_timestamp(ts);\n\t\tvar time = get_time_from_timestamp(ts);\n\n\t\t// Clear label depending on how much data is going to be shown\n\t\t//if (!should_show_timestamp_label(time, length))\n\t\t//{\n\t\t//\ttimestamps[i] = \"\";\n\t\t//}\n\n\t\t// On a new date, put the timestamp on two lines\n\t\t//else if (!prev || current.localeCompare(prev) != 0)\n\t\tif (!prev || current.localeCompare(prev) != 0)\n\t\t{\n\t\t\ttimestamps[i] = [current, time];\n\t\t\tprev = current;\n\t\t}\n\n\t\t// On the same date, just use the hour\n\t\telse\n\t\t{\n\t\t\ttimestamps[i] = time;\n\t\t\tprev = current;\n\t\t}\n\n\t}\n\n\treturn timestamps;\n}", "function createSection(timestamp){\n // Given the timestamp we create a section with the given docKey\n // and get a refernece to it.\n var newSectionRef = fcon.setSection(timestamp, videoKey, docKey);\n\n // Use this section reference to setup a new firepad\n var codeMirror = CodeMirror(document.getElementById('firepad-container'), { lineWrapping: true });\n var firepad = Firepad.fromCodeMirror(newSectionRef, codeMirror, {\n richTextToolbar: true,\n richTextShortcuts: true\n });\n firepad.on('ready', function() {\n if (firepad.isHistoryEmpty()) {\n firepad.setHtml(\n '<headertimestamp timestamp=\"' + timestamp + '\">Header Element</headertimestamp>'\n );\n }\n });\n\n firepad.registerEntity('headertimestamp', {\n\n /**\n Renders the element given the info with listener on click.\n */\n render: function(info, entityHandler) {\n console.log('render')\n console.log(entityHandler)\n\n // Create a header with h2 tag\n var headerWithTimestamp = document.createElement('span');\n headerWithTimestamp.style['fontsize'] = '24px';\n\n if (info.timestamp){\n headerWithTimestamp.timestamp = info.timestamp;\n }\n\n headerWithTimestamp.textContent = info.textContent;\n headerWithTimestamp.addEventListener('click', function(){\n console.log('Clicked with timestamp ' + info.timestamp);\n });\n\n return headerWithTimestamp;\n\n }.bind(this),\n\n /**\n Sets default info with timestamp and the actual text inside from the\n actual element inserted.\n */\n fromElement: function(element){\n // Sets a timestamp or a provided with from the element from the\n // provided attribute. As well, gets the text in between the tag and\n // provides it in info.\n // TODO Set the timestamp attribute\n var timestampEle = element.attributes.timestamp\n console.log(timestampEle)\n var info = {timestamp: '7000', textContent: element.textContent};\n return info;\n },\n /**\n On update from firebase, we update it on the element.\n */\n update: function(info, element) {\n // TODO Change the text if changed.\n if (info.timestamp){\n element.timestamp = info.timestamp\n } else {\n element.timestamp = '0:00'\n }\n }\n\n });\n }", "function getCurrentdate() {\n document.getElementById('timeStamp').textContent = date;\n document.getElementById('currentTime').textContent = time;\n }", "function getTimestamp(timestamp) {\n return (timestamp || Date.now()) + config_1.default.getTimeDiff();\n}", "function t(f) {\n var f = f || 'MM/dd/yyyy@h:mm:ss.S', o = {'M+':this.getMonth()+1, 'd+':this.getDate(),\n 'h+':this.getHours(), 'm+':this.getMinutes(),'s+':this.getSeconds(),'S':this.getMilliseconds()}\n if(/(y+)/.test(f))f=f.replace(RegExp.$1,(this.getFullYear()+'').substr(4 - RegExp.$1.length))\n for(var k in o)if(new RegExp('('+ k +')').test(f))\n f = f.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ('00'+o[k]).substr((''+o[k]).length))\n return f\n}", "getLogStamp() {\r\n const date = new Date();\r\n return `[${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()} ${this.name}:${this.serial}]`;\r\n }", "function creatTimeRow(time) {\r\n const row = document.createElement('div');\r\n row.setAttribute('class', 'row');\r\n row.setAttribute(\"id\", time);\r\n\r\n const timeCol = document.createElement('div');\r\n timeCol.setAttribute('class', 'col col-2');\r\n timeCol.textContent = time;\r\n //console.log(time)\r\n\r\n const textAreaCol = document.createElement('div')\r\n textAreaCol.setAttribute('class', 'col col-8');\r\n\r\n const textArea = document.createElement('textarea');\r\n textArea.setAttribute(\"id\", \"textarea-\" + time);\r\n textAreaCol.appendChild(textArea);\r\n\r\n const buttonCol = document.createElement('div');\r\n buttonCol.setAttribute('class', 'col col-2 nopadding');\r\n const button = document.createElement('button');\r\n button.setAttribute('id', 'button-' + time);\r\n buttonCol.appendChild(button);\r\n button.innerHTML = \"<i class='fas fa-save size=5x' onClick='saveNote'> </i>\";\r\n button.addEventListener('click', saveNote);\r\n \r\n\r\n row.appendChild(timeCol);\r\n row.appendChild(textAreaCol);\r\n row.appendChild(buttonCol);\r\n\r\n return row;\r\n\r\n}", "function timestamp() {\n var ts = new Date(); // for now\n h = (ts.getHours()<10?'0':'') + ts.getHours(); // => 9\n m = (ts.getMinutes()<10?'0':'') + ts.getMinutes(); // => 30\n s = (ts.getSeconds()<10?'0':'') + ts.getSeconds(); // => 51\n var timestamp = h+':'+m+':'+s\n return timestamp;\n}", "function timeStamp() {\n var time = new Date();\n\n year = time.getFullYear();\n month = time.getMonth() + 1; //getMonth() -> Jan = 0, Dec = 11\n day = time.getDate();\n hour = time.getHours();\n minutes = time.getMinutes();\n\n if (minutes < 10)\n minutes = \"0\" + minutes;\n if (month < 10)\n month = \"0\" + month;\n if (day < 10)\n day = \"0\" + day;\n if(minutes < 10)\n minutes = \"0\" + minutes\n if(hour < 10)\n hour = \"0\" + hour\n \n time = year + \"-\" + month + \"-\" + day + \"T\" + hour + \":\" + minutes;\n return(time);\n}", "displayTime() {\n this.inputs.forEach( (input, i) => input.value = this.twoDigitNum(this[\"v\" + (i+1)]) );\n }", "function get_current_timestamp() {\n\n var ts = new Date();\n var ts_arr=[];\n ts_arr[0] = ts.getFullYear();\n ts_arr[1] = ts.getMonth()+1;\n ts_arr[2] = ts.getDate();\n ts_arr[3] = ts.getHours();\n ts_arr[4] = ts.getMinutes();\n ts_arr[5] = ts.getSeconds();\n //\n for (var i = 0; i < ts_arr.length; i++) {\n if (ts_arr[i] < 10) {ts_arr[i] = '0'+ts_arr[i]}\n }\n //\n ts = ts_arr[0]+\"-\"+ts_arr[1]+\"-\"+ts_arr[2]+\" \"+ts_arr[3]+\":\"+ts_arr[4]+\":\"+ts_arr[5];\n return(ts);\n}", "get timestamp() {\n\t\treturn this.__timestamp;\n\t}", "function timeStamp() {\n\t// Return current date, in Unix time, milliseconds since Jan 1, 1970\n return new Date().getTime();\n}", "function timeStamp() {\n let today = new Date()\n let seconds = (\"0\" + today.getSeconds()).slice(-2);\n let timeSync = \"Time Stamp: \" + today.getDate() + \"/\"\n + (today.getMonth()+1) + \"/\"\n + today.getFullYear() + \" @ \" \n + today.getHours() + \":\" \n + today.getMinutes() + \":\" \n + seconds + \" \";\n\n return timeSync\n}", "function populate_timebox()\n{\n var locale = global_configdata.boxes.timebox.hasOwnProperty(\"locale\") ? global_configdata.boxes.timebox.locale : \"en-US\";\n var options = global_configdata.boxes.timebox.hasOwnProperty(\"options\") ? global_configdata.boxes.timebox.options : {};\n document.getElementById(\"timetext\").textContent = ((new Date()).toLocaleString(locale, options));\n}", "function getTimeStamp() {\n\treturn Date.now();\n}", "function setTime(value,tagID){\n document.getElementById(tagID).innerText = value;\n}", "function formatTimeStamp() {\n var sendTime = Date().slice(16,21)\n var sendHour = sendTime.slice(0, 2)\n var pm = sendHour > 11 && sendHour < 24 ? true : false\n\n if (sendHour > 12) {\n sendHour = sendHour % 12\n }\n return sendHour + sendTime.slice(2) + (pm ? \" PM\" : \" AM\");\n}", "formatTime(timestamp) {\n const d = new Date(timestamp);\n const time = `${d.getMonth()}/${\n d.getDate() + 1\n }/${d.getFullYear()} ${d.getHours()}:${d.getMinutes()}`;\n return time;\n }", "function timestamp() {\n return Math.floor((new Date()).getTime() / 1000); \n}", "function newBotMsg(text){\r\n let newTextBox = document.createElement(\"div\");\r\n let newTextContent = document.createElement(\"p\"); \r\n $(newTextBox).addClass(\"bubble bot\").append(newTextContent);\r\n $(newTextContent).append(text);\r\n\r\n let screenSpace = document.getElementById(\"screen\"); \r\n $(screenSpace).append(newTextBox);\r\n\r\n addTime();\r\n\r\n function addTime() {\r\n\r\n //add time\r\n let timeStamp = new Date().toLocaleTimeString();\r\n let timeSpace = document.createElement(\"p\");\r\n $(timeSpace).addClass(\"time\");\r\n $(newTextBox).append(timeSpace)\r\n $(timeSpace).append(timeStamp);\r\n console.log(timeStamp);\r\n }\r\n //add time\r\n // let timeStamp = new Date().toLocaleTimeString();\r\n // let timeSpace = document.createElement(\"p\");\r\n // $(timeSpace).addClass(\"time\");\r\n // $(newTextBox).append(timeSpace)\r\n // $(timeSpace).append(timeStamp);\r\n // console.log(timeStamp);\r\n}", "get timestamp() { return this._timestamp; }", "get timestamp() { return this._timestamp; }", "get timestamp() { return this._timestamp; }", "function setAt(e) {\r\n var at = document.getElementById(\"at\");\r\n if (at) {\r\n // d = 'top of the timeline time' \r\n var n = new Date();\r\n n.setTime(tl_t_time.getTime() + (tl_unwarp(e.pageY) - tl_scroll_offset) *60*1000);\r\n s=(n.getFullYear())+\"/\"+(n.getMonth()+1)+\"/\"+n.getDate()+\" \"+n.getHours()+\":\"+pad2(n.getMinutes())+\":\"+pad2(n.getSeconds());\r\n at.value=s;\r\n }\r\n }", "function time() {\r\nvar d = new Date();\r\ndocument.getElementById(\"tx\").innerHTML = d.toLocaleTimeString();\r\n document.getElementById(\"ti\").innerHTML = d.toLocaleDateString();\r\n}", "function datestamp() {\n\tvar currentDate \t= new Date();\n\treturn currentDate.getFullYear() + \"-\" + completeDateVals(currentDate.getMonth()+1) + \"-\"\n\t + completeDateVals(currentDate.getDate()) + \",\" + completeDateVals(currentDate.getHours())\n\t + \":\" + completeDateVals(currentDate.getMinutes())\n\t + \":\" + completeDateVals(currentDate.getSeconds())\n\t + \":\" + completeDateValsMilliseconds(currentDate.getMilliseconds());\n\t \n}", "function currentTimestamp() {\n return new Date().getTime();\n}", "timestamp() {\n return new Date().toISOString();\n }", "function setUpdated(timestamp) {\n\t\tvar dateOptions = {\n\t\t\t//weekday: 'long',\n\t\t\tyear: 'numeric',\n\t\t\tmonth: 'long',\n\t\t\tday: '2-digit',\n\t\t\thour: '2-digit',\n\t\t\tminute: '2-digit',\n\t\t\tsecond: '2-digit'\n\t\t};\n\t\tvar date = new Date(timestamp);\n\t\tvar timeString = date.toLocaleTimeString('en-us', dateOptions);\n\n\t\t$('.last-update').html('Last updated: ' + timeString);\n\t}", "function datetimestamp()\n{\n daynight();\n\n if (hours < 12 && minutes < 10)\n {\n console.log(\"\\x1b[0m \" + realhours + \":0\" + minutes + \"AM \" + month + \"-\" + date + \"-\" + year + \" \" + \"\\x1b[40m %s \\x1b[0m\", dn);\n return;\n }\n \n if (hours < 12 && minutes > 10)\n {\n console.log(\"\\x1b[0m \" + realhours + \":\" + minutes + \"AM \" + month + \"-\" + date + \"-\" + year + \" \" + \"\\x1b[40m %s \\x1b[0m\", dn);\n return;\n }\n \n if (hours > 12 && minutes < 10)\n {\n console.log(\"\\x1b[0m \" + realhoursPM + \":0\" + minutes + \"PM \" + month + \"-\" + date + \"-\" + year + \" \" + \"\\x1b[40m %s \\x1b[0m\", dn);\n return;\n }\n\n if (hours > 12 && minutes > 10)\n {\n console.log(\"\\x1b[0m \" + realhoursPM + \":\" + minutes + \"PM \" + month + \"-\" + date + \"-\" + year + \" \" + \"\\x1b[40m %s \\x1b[0m\", dn);\n return;\n }\n return;\n}", "function fedtime(data){\r\n time = data.val();\r\n}", "function opentimestamps_stamp(n) {\n RED.nodes.createNode(this, n);\n this.status({\n fill: \"grey\",\n shape: \"dot\",\n text: \"Create new timestamp ...\"\n });\n var msg = {};\n var node = this;\n this.on(\"input\", function(msg) {\n // import the file content like Buffer\n const stampResultPromise = OpenTimestamps.stamp(msg.fileArray);\n stampResultPromise.then(stampResult => {\n // convert the stampResult in a Buffer\n var ots = new Buffer(stampResult);\n msg.otsArray = ots;\n this.status({\n fill: \"green\",\n shape: \"dot\",\n text: \"Done\"\n });\n node.send(msg);\n });\n });\n }", "function localizedCreatedTimestamp() {\n if (vm.learningItem) {\n return moment(vm.learningItem.Created).format(\"M/D/YYYY h:mm A\");\n } else {\n return '';\n }\n }", "function getTimeStamp() {\n return Date.now();\n}", "function convertTimestamp(requestTimestamp) {\n\tlet ts = new Date(requestTimestamp);\n\tlet year = ts.getYear() + 1900;\n\tlet mon = ts.getMonth() + 1;\n\tlet day = ts.getUTCDate();\n\tlet h = ts.getHours();\n\tlet m = ts.getMinutes();\n\tlet s = ts.getSeconds();\n\tlet ms = ts.getMilliseconds();\n\n\tif (mon < 10) {\n\t\tmon = '0' + mon\n\t}\n\n\tif (day < 10) {\n\t\tday = '0' + day\n\t}\n\n\tif (h < 10) {\n\t\th = '0' + h\n\t}\n\n\tif (m < 10) {\n\t\tm = '0' + m\n\t}\n\n\tif (s < 10) {\n\t\ts = '0' + s\n\t}\n\n\treturn (`${year}-${mon}-${day} ${h}:${m}:${s}.${ms}`);\n}", "function updateTime() {\r\n element.text(dateFilter(new Date(), format));\r\n }", "function timestamp() {\n\tvar pickedDate = $(\"#datepicker-tourist\").val()\n\tvar pickedTime = $('#dtimepicker-tourist').val()\n\tvar x = (pickedDate + ' ' + pickedTime)\n\tvar departureTime;\n\n\t// making sure the date chosen isnt less than the current date \n\tif (Date.parse(x) < Date.now()) {\n\t\tdepartureTime = Date.now();\n\t} else {\n\t\tdepartureTime = Date.parse(x);\n\t}\n\n\treturn departureTime\n\t// return departureTime + 3600000; // 1 hour time zoon difference \n\n}", "function currTime() {\n var dt = dateFilter(new Date(), format,'-0800');\n element.text(dt);\n // element point to line 11 span element\n }" ]
[ "0.6479102", "0.6479102", "0.617965", "0.617965", "0.6027368", "0.59835774", "0.5972732", "0.5959247", "0.5950676", "0.591248", "0.5899696", "0.5898191", "0.5874724", "0.5860661", "0.57271403", "0.57209414", "0.571951", "0.5700783", "0.56880176", "0.56764305", "0.5623398", "0.56086594", "0.56061715", "0.5605766", "0.55984426", "0.55851406", "0.5576874", "0.5576335", "0.55667347", "0.55652004", "0.5555153", "0.5536988", "0.5510181", "0.5495075", "0.548147", "0.54808104", "0.5474837", "0.5462264", "0.546063", "0.5447499", "0.5446159", "0.54298574", "0.5421514", "0.54117036", "0.5411266", "0.53781956", "0.537666", "0.5354082", "0.53523254", "0.5341881", "0.53395164", "0.533855", "0.5336025", "0.53354937", "0.5329238", "0.53226495", "0.5318232", "0.5316886", "0.5314049", "0.5303911", "0.5284924", "0.5275197", "0.5273268", "0.52732575", "0.52718145", "0.5269527", "0.52588993", "0.52545536", "0.5251172", "0.5249373", "0.52473986", "0.5242842", "0.5241636", "0.52376163", "0.52367014", "0.52325743", "0.52241373", "0.5222879", "0.5218792", "0.52186406", "0.5217235", "0.52077925", "0.52069455", "0.5197946", "0.5197946", "0.5197946", "0.51897645", "0.5187822", "0.5186892", "0.5178266", "0.51718163", "0.51702225", "0.51696783", "0.5169106", "0.5159332", "0.51567227", "0.5153469", "0.51485735", "0.5142956", "0.5142758", "0.5141182" ]
0.0
-1
MultiUse SingleLine Text Group
function addSingleLineTextGroup(parent,field_name) { var num = jQuery('#' + parent + ' ul').size(); jQuery('#'+field_name+'_multiusesinglelinetextgroupcf_invisible-field').clone().appendTo('#' + parent); // Switch to display:block so that the field is visible. jQuery('#' + parent + ' .cf-text-group').css('display', 'block'); // The text input field has "_invisible" appended so that it isn't // inadvertently saved. Remove that trailing identifier so that the // field can be properly used. jQuery('#' + parent + ' ul.cf-text-group input[type=text]').each(function(index) { var name = jQuery(this).attr('name'); name = name.replace(/_invisible$/, ''); var name = jQuery(this).attr('name', name); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addGroupText() {\n\tif (groupText) { groupText.destroy(); }\n\tgroupText = game.add.group();\n\treturn groupText;\n}", "function multiLineText(text, x, y, width, height) {\n return '<switch>\\n' +\n '<foreignObject x=\"' + x + '\" y=\"' + y + '\" width=\"' + width + '\" height=\"' + height + '\">\\n' +\n '<p xmlns=\"http://www.w3.org/1999/xhtml\">' + text + '</p>\\n' +\n '</foreignObject>\\n' +\n '<text x=\"' + x + '\" y=\"' + y + '\">' + text + '</text>\\n' +\n '</switch>\\n'\n}", "function drawText$1(element) {\n\t var group = new Group();\n\t nodeInfo._clipbox = false;\n\t nodeInfo._matrix = Matrix.unit();\n\t nodeInfo._stackingContext = {\n\t element: element,\n\t group: group\n\t };\n\t pushNodeInfo(element, getComputedStyle$1(element), group);\n\t if (element.firstChild.nodeType == 3 /* Text */) {\n\t // avoid the penalty of renderElement\n\t renderText(element, element.firstChild, group);\n\t } else {\n\t _renderElement(element, group);\n\t }\n\t popNodeInfo();\n\t return group;\n\t}", "generateMultilineHTMLfromString(text) {\n if (isNullOrUndefined(text)) {\n return \"\";\n }\n\n let spl = text.split(\"\\n\");\n if (spl.length == 1) {\n return text;\n } else {\n let output = \"\";\n for (let i = 0; i < spl.length; i++) {\n output += \"<div>\" + spl[i] + \"</div>\";\n }\n return output;\n }\n }", "function breakLines(text){\n let multiLineName = {\n first : \"\",\n second : \"\"\n };\n\n let splitedText = text.split(\" \");\n if (splitedText.length > 2) {\n for (var i = 0; i < 2; i++) {\n if (i > splitedText.length) { //??\n break;\n }\n multiLineName.first = multiLineName.first+splitedText[i]+\" \";\n }\n multiLineName.first = multiLineName.first.slice(0, -1);\n\n for (i = 2; i < splitedText.length; i++) {\n multiLineName.second = multiLineName.second+splitedText[i]+\" \";\n }\n multiLineName.second = multiLineName.second.slice(0, -1);\n\n }\n else {\n multiLineName.first = text;\n multiLineName.second = \"\";\n }\n return multiLineName;\n }", "function joinText() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.All,\n pat: /\\n/g,\n repl: '',\n });\n }", "function renderEachLine() {\n return _.map(textArray, (eachLine, i) => {\n return <span key={i} >{eachLine}<br/></span>;\n });\n }", "function wrap(textObj, width) {\n textObj.each(function() {\n var textLineObj = d3.select(this);\n var text = textLineObj.text().replace(\"\\n\",\" **newline** \");\n var words = text.split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.1, // ems\n y = textLineObj.attr(\"y\"),\n dy = parseFloat(textLineObj.attr(\"dy\")),\n tspan = textLineObj.text(null).append(\"tspan\").attr(\"x\", textLineObj.attr(\"x\")).attr(\"y\", y);\n while (word = words.pop()) {\n var newline = (word != \"**newline**\");\n if(newline) line.push(word);\n else word = \"\";\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width || word == \"**newline**\") {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = textLineObj.append(\"tspan\").attr(\"x\", textLineObj.attr(\"x\")).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n //console.log(tspan);\n }\n }\n //console.log(\"wrap done: \"+text.text());\n });\n}", "function NewlineText(props) {\n const text = props.text;\n return text.split('\\n').map(str => <p>{str}</p>);\n }", "function wrapText(circles, labeller) {\n return function() {\n var text = d3Selection.select(this),\n data = text.datum(),\n width = circles[data.sets[0]].radius || 50,\n label = labeller(data) || '';\n\n var words = label.split(/\\s+/).reverse(),\n maxLines = 3,\n minChars = (label.length + words.length) / maxLines,\n word = words.pop(),\n line = [word],\n joined,\n lineNumber = 0,\n lineHeight = 1.1, // ems\n tspan = text.text(null).append(\"tspan\").text(word);\n\n while (true) {\n word = words.pop();\n if (!word) break;\n line.push(word);\n joined = line.join(\" \");\n tspan.text(joined);\n if (joined.length > minChars && tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").text(word);\n lineNumber++;\n }\n }\n\n var initial = 0.35 - lineNumber * lineHeight / 2,\n x = text.attr(\"x\"),\n y = text.attr(\"y\");\n\n text.selectAll(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", function(d, i) {\n return (initial + i * lineHeight) + \"em\";\n });\n };\n}", "function wrapText(circles, labeller) {\n return function () {\n var text = d3Selection.select(this),\n data = text.datum(),\n width = circles[data.sets[0]].radius || 50,\n label = labeller(data) || '';\n var words = label.split(/\\s+/).reverse(),\n maxLines = 3,\n minChars = (label.length + words.length) / maxLines,\n word = words.pop(),\n line = [word],\n joined,\n lineNumber = 0,\n lineHeight = 1.1,\n // ems\n tspan = text.text(null).append(\"tspan\").text(word);\n\n while (true) {\n word = words.pop();\n if (!word) break;\n line.push(word);\n joined = line.join(\" \");\n tspan.text(joined);\n\n if (joined.length > minChars && tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").text(word);\n lineNumber++;\n }\n }\n\n var initial = 0.35 - lineNumber * lineHeight / 2,\n x = text.attr(\"x\"),\n y = text.attr(\"y\");\n text.selectAll(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", function (d, i) {\n return initial + i * lineHeight + \"em\";\n });\n };\n }", "function wrap(text) {\n text.each(function() {\n let text = d3.select(this),\n words = text.text().trim().split(/[\\s\\/\\\\]+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.5, // ems\n dy = text.attr(\"dy\"),\n dx = text.attr(\"dx\"),\n width = text.attr(\"box-width\")-padding,\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"dy\", lineHeight + \"em\");\n while (word = words.pop()) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width && line.length > 1) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").attr(\"x\", 5).attr(\"dy\", lineHeight + \"em\").text(word);\n }\n }\n });\n}", "function wrapText(circles, labeller) {\n return function() {\n var text = d3Selection.select(this),\n data = text.datum(),\n width = circles[data.sets[0]].radius || 50,\n label = labeller(data) || '';\n\n var words = label.split(/\\s+/).reverse(),\n maxLines = 3,\n minChars = (label.length + words.length) / maxLines,\n word = words.pop(),\n line = [word],\n joined,\n lineNumber = 0,\n lineHeight = 1.1, // ems\n tspan = text.text(null).append(\"tspan\").text(word);\n\n while (true) {\n word = words.pop();\n if (!word) break;\n line.push(word);\n joined = line.join(\" \");\n tspan.text(joined);\n if (joined.length > minChars && tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").text(word);\n lineNumber++;\n }\n }\n\n var initial = 0.35 - lineNumber * lineHeight / 2,\n x = text.attr(\"x\"),\n y = text.attr(\"y\");\n\n text.selectAll(\"tspan\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"dy\", function(d, i) {\n return (initial + i * lineHeight) + \"em\";\n });\n };\n }", "function linebreak(text) {\n text.each(function() {\n var text = d3.select(this),\n words = text.text().split(/\\n/).reverse(),\n word,\n lineNumber = 0,\n lineHeight = 1.1, // ems\n y = text.attr(\"y\"),\n x = text.attr(\"x\"),\n dx = text.attr(\"dx\"),\n dy = 0.3 - (words.length-1)*lineHeight*0.5; //ems\n text.text(null);\n while (word = words.pop()) {\n tspan = text.append(\"tspan\").attr(\"dx\",dx).attr(\"x\", x).attr(\"y\", y).attr(\"dy\", lineNumber++ * lineHeight + dy + \"em\").text(word);\n }\n });\n }", "function wrap(text, width, heightLine) {\n text.each(function() {\n var text = d3.select(this);\n var words = text.text().split(/\\s+/).reverse();\n var word;\n var line = [];\n var lineNumber = 0;\n var lineHeight = (typeof heightLine === 'undefined' ? 1.6 : heightLine);\n var y = text.attr('y');\n var x = text.attr('x');\n var dy = parseFloat(text.attr('dy'));\n var tspan = text.text(null).append('tspan').attr('x', x).attr('y', y).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.append('tspan').attr('x', x).attr('y', y).attr('dy', ++lineNumber * lineHeight + dy + 'em').text(word);\n }\n }\n });\n}", "function wrapText(circles, labeller) {\n return function () {\n var text = d3Selection.select(this),\n data = text.datum(),\n width = circles[data.sets[0]].radius || 50,\n label = labeller(data) || '';\n\n var words = label.split(/\\s+/).reverse(),\n maxLines = 3,\n minChars = (label.length + words.length) / maxLines,\n word = words.pop(),\n line = [word],\n joined,\n lineNumber = 0,\n lineHeight = 1.1,\n // ems\n tspan = text.text(null).append(\"tspan\").text(word);\n\n while (true) {\n word = words.pop();\n if (!word) break;\n line.push(word);\n joined = line.join(\" \");\n tspan.text(joined);\n if (joined.length > minChars && tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").text(word);\n lineNumber++;\n }\n }\n\n var initial = 0.35 - lineNumber * lineHeight / 2,\n x = text.attr(\"x\"),\n y = text.attr(\"y\");\n\n text.selectAll(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", function (d, i) {\n return initial + i * lineHeight + \"em\";\n });\n };\n }", "function wrapText(circles, labeller) {\n return function () {\n var text = d3Selection.select(this),\n data = text.datum(),\n width = circles[data.sets[0]].radius || 50,\n label = labeller(data) || '';\n\n var words = label.split(/\\s+/).reverse(),\n maxLines = 3,\n minChars = (label.length + words.length) / maxLines,\n word = words.pop(),\n line = [word],\n joined,\n lineNumber = 0,\n lineHeight = 1.1,\n // ems\n tspan = text.text(null).append(\"tspan\").text(word);\n\n while (true) {\n word = words.pop();\n if (!word) break;\n line.push(word);\n joined = line.join(\" \");\n tspan.text(joined);\n if (joined.length > minChars && tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text.append(\"tspan\").text(word);\n lineNumber++;\n }\n }\n\n var initial = 0.35 - lineNumber * lineHeight / 2,\n x = text.attr(\"x\"),\n y = text.attr(\"y\");\n\n text.selectAll(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", function (d, i) {\n return initial + i * lineHeight + \"em\";\n });\n };\n }", "function wrap(text, baseline) {\n text.each(function() {\n var text = d3.select(this);\n var lines = text.text().split(/\\n/);\n\n var y = text.attr('y');\n var x = text.attr('x');\n var dy = parseFloat(text.attr('dy'));\n\n text\n .text(null)\n .append('tspan')\n .attr('x', x)\n .attr('y', y)\n .attr('dy', dy + 'em')\n .attr('dominant-baseline', baseline)\n .text(lines[0]);\n\n for (var lineNum = 1; lineNum < lines.length; lineNum++) {\n text\n .append('tspan')\n .attr('x', x)\n .attr('y', y)\n .attr('dy', lineNum * 1.1 + dy + 'em')\n .attr('dominant-baseline', baseline)\n .text(lines[lineNum]);\n }\n });\n }", "expandText(begin, end, lengthInterpolate, pointsThroughLine, alreadyAdded, signe, sketchLines, distance){\n \n // var point = interpolate(begin, end, lengthInterpolate);\n var that = this;\n var angle = Math.atan2(end.y-begin.y, end.x-begin.x)\n var point = createPositionAtLengthAngle(end, angle, 100);\n // console.log('GO')\n // drawCircle(point.x, point.y, 5, 'red');\n\n // drawLine(begin.x, begin.y, point.x, point.y, 'red');\n\n\n d3.select('.standAloneLines').selectAll('.parentLine').each(function(){\n var id = d3.select(this).attr('id').split('-')[1];\n \n var insideandWhichGroup = that.props.groupLines.find(group => group.lines.find((arrayEntry)=> arrayEntry.indexOf(id) > -1))//.indexOf(idSImple) > -1);//x.id == this.guideTapped.item)\n \n // console.log(insideandWhichGroup)\n\n \n if (alreadyAdded.indexOf(id) == -1 && insideandWhichGroup == undefined){\n \n var BB = _getBBox('item-'+id);\n var originalBB = JSON.parse(JSON.stringify(BB));\n if (distance != 0){\n BB.x -= 2;\n BB.y -= 2;\n BB.width +=2;\n BB.height += 2\n } else {\n BB.x -= 15;\n BB.y -= 15;\n BB.width +=30;\n BB.height += 30\n }\n var oobbNew = [\n {'x': BB.x, 'y':BB.y},\n {'x': BB.x+ BB.width, 'y':BB.y},\n {'x': BB.x+ BB.width, 'y':BB.y + BB.height},\n {'x': BB.x, 'y':BB.y + BB.height}\n ]\n var isIntersect = lineIntersectsPolygone(begin, point, oobbNew);\n if ((originalBB.width > 400 && originalBB.height < 50) || (originalBB.height > 400 && originalBB.width <50)){\n }\n else if (isIntersect){\n // showBboxBB(BB, 'red')\n // showBbox('item-'+id, 'blue');\n alreadyAdded.push(id)\n lengthInterpolate = lengthInterpolate *2;\n\n var centerPolygon = getCenterPolygon(oobbNew);\n var rightSide = {'x': BB.x+ BB.width, 'y':BB.y+ (BB.height/2)}\n // var result = that.increasePrecisionLine(begin, end, oobbNew, pointsThroughLine,)\n if (signe == 1) that.expandText(centerPolygon, rightSide, lengthInterpolate, pointsThroughLine, alreadyAdded, signe, sketchLines, distance)//, arraySorted,oobb, iteration)\n else that.expandText(rightSide, centerPolygon, lengthInterpolate, pointsThroughLine, alreadyAdded, signe, sketchLines, distance)\n }\n }\n })\n }", "function splitLineText() {\r\n\t\t\t\t\t$('.nectar-recent-posts-single_featured.multiple_featured').each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $slideClass = ($(this).find('.project-slides').length > 0) ? '.project-slide' : '.nectar-recent-post-slide',\r\n\t\t\t\t\t\t$slideInfoClass = ($(this).find('.project-slides').length > 0) ? '.project-info h1' : '.inner-wrap h2 a';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).find($slideClass).each(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).find($slideInfoClass).each(function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar textArr = $(this).text();\r\n\t\t\t\t\t\t\t\ttextArr = textArr.trim();\r\n\t\t\t\t\t\t\t\ttextArr = textArr.split(' ');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this)[0].innerHTML = '';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < textArr.length; i++) {\r\n\t\t\t\t\t\t\t\t\t$(this)[0].innerHTML += '<span>' + textArr[i] + '</span> ';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).find($slideInfoClass + ' > span').wrapInner('<span class=\"inner\" />');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function textWrap (text) {\n var getText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (d) {\n return d.label;\n };\n var getCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity;\n var getAnchor = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'start';\n getText = functor(getText);\n getCount = functor(getCount);\n getAnchor = functor(getAnchor);\n text.each(function (d, i) {\n var text = d3Selection.select(this),\n words = \"\".concat(getText.call(this, d, i)).split(/\\s+/).reverse(),\n word,\n lines = [],\n line = [words.pop()],\n lineHeight = 1.1,\n count = getCount.call(this, d, i),\n anchor = getAnchor.call(this, d, i),\n x = +text.attr('x'),\n y = +text.attr('y'),\n dy = parseFloat(text.attr('dy')) || 0; // clear text if the wrapper is being run for the first time\n\n if (oreq(text.html(), '').indexOf('tspan') === -1) text.text('');\n word = words.pop();\n\n while (word) {\n if (line.join(' ').length + word.length > count) {\n lines.push(line);\n line = [];\n }\n\n line.push(word);\n word = words.pop();\n }\n\n lines.push(line);\n var tspan = text.selectAll('tspan').data(lines),\n height = (lines.length - 1) * lineHeight,\n offset = anchor === 'end' ? height : anchor === 'middle' ? height / 2 : 0;\n tspan.merge(tspan.enter().append('tspan')).text(function (d) {\n return d.join(' ');\n }).attr('x', x).attr('y', y).attr('dy', function (d, i) {\n return \"\".concat(dy + i * lineHeight - offset, \"em\");\n });\n });\n}", "function wrap(text, width, heightLine) {\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 = (typeof heightLine === \"undefined\" ? 1.6 : heightLine), // ems\n y = text.attr(\"y\"),\n x = 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 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 });\n}//wrap", "function armour_cg_outgroup() {\r\n if (acgcl.length > maxLineLength) {\r\n acgt += acgcl + \"\\n\";\r\n acgcl = \"\";\r\n }\r\n if (acgcl.length > 0) {\r\n acgcl += \" \";\r\n }\r\n acgcl += acgg;\r\n acgg = \"\";\r\n}", "function wrap(d){\n var sel = d3.select(this),\n tokens = sel.text().split(\"\\n\");\n\n if(tokens.length > 1) {\n var h = sel.node().getBBox().height,\n x = sel.attr('x'),\n y = sel.attr('y');\n\n sel.text(null);\n\n for(var i = 0, l = tokens.length; i < l; i++) {\n sel.append('tspan').attr('x', x).attr('y', y).attr('dy', h * i).text(tokens[i].trim());\n }\n }\n }", "wrapText(textTextureRender, text, wordWrapWidth) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n let lines = text.split(/\\r?\\n/g);\n let allLines = [];\n let realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n let resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth;\n let words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n let wordWidth = textTextureRender._context.measureText(words[j]).width;\n let wordWidthWithSpace = wordWidth + textTextureRender._context.measureText(' ').width;\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth;\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ' ' + words[j];\n }\n }\n\n if (result) {\n resultLines.push(result);\n result = '';\n }\n\n allLines = allLines.concat(resultLines);\n\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n\n return {l: allLines, n: realNewlines};\n }", "function wrap_text(text, width, token, tspanAttrs) {\n text.each(function() {\n var text = d3.select(this),\n words = text.text().split(token || /\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.1, // ems\n y = text.attr(\"y\"),\n dy = 0,\n tspan = text.text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"y\", dy + \"em\")\n .attr(tspanAttrs || {});\n\n while (!!(word = words.pop())) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (width === null || tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"y\", ++lineNumber * lineHeight + dy + \"em\")\n .attr(tspanAttrs || {})\n .text(word);\n }\n }\n });\n}", "addText(text) {\n let nodes = this.top().content, last = nodes[nodes.length - 1]\n let node = this.schema.text(text, this.marks), merged\n if (last && (merged = maybeMerge(last, node))) nodes[nodes.length - 1] = merged\n else nodes.push(node)\n }", "function wrap_text(text, width, token, tspanAttrs) {\n text.each(function() {\n var text = d3.select(this),\n words = text.text().split(token || /\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.1, // ems\n y = text.attr(\"y\"),\n dy = 0,\n tspan = text.text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"y\", dy + \"em\")\n .attr(tspanAttrs || {});\n\n while (!!(word = words.pop())) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (width === null || tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"y\", ++lineNumber * lineHeight + dy + \"em\")\n .attr(tspanAttrs || {})\n .text(word);\n }\n }\n });\n}", "function wrap(text,width){text.each(function(){var text=d3.select(this),words=text.text().split(/\\s+/).reverse(),word,line=[],lineNumber=0,lineHeight=1.1, // ems\n\ty=text.attr(\"y\"),dy=parseFloat(text.attr(\"dy\")),tspan=text.text(null).append(\"tspan\").attr(\"x\",0).attr(\"y\",y).attr(\"dy\",dy+\"em\");while(word=words.pop()){line.push(word);tspan.text(line.join(\" \"));if(tspan.node().getComputedTextLength()>width){line.pop();tspan.text(line.join(\" \"));line=[word];tspan=text.append(\"tspan\").attr(\"x\",0).attr(\"y\",y).attr(\"dy\",++lineNumber*lineHeight+dy+\"em\").text(word);}}});}", "wrap(text, width) {\n text.each(function () {\n const text2 = d3.select(this);\n const words = text2.text().split(/\\s+/).reverse();\n let word;\n let line = [];\n const y = text2.attr('y');\n const dy = parseFloat(text2.attr('dy'));\n\n let tspan = text2\n .text(null)\n .append('tspan')\n .attr('x', -10)\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\n if (tspan.node().getComputedTextLength() > width) {\n line.pop();\n tspan.text(line.join(' '));\n line = [word];\n tspan = text2\n .append('tspan')\n .attr('x', -10)\n .attr('y', y)\n .attr('dy', `${1 + dy}em`)\n .text(word);\n }\n }\n });\n }", "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, button\n lineHeight = 1.4, // ems\n y = text.attr(\"y\"),\n x = 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\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 });\n }", "function MultiLine(str)\n{\n\tvar holder = str.toString().replace(\"function (){/*\",\"\").replace(\"*/}\",\"\").replace(\"function(){/*\",\"\");\n\treturn holder;\n\t\n}", "function makeText(data, numInstances) {\n\t\tvar lineMaterial = new THREE.LineBasicMaterial({ color: 0xFFB2BD, linewidth: 1 });\n\t\tvar lineGeometry = new THREE.Geometry();\n\t\tvar text = new THREE.Object3D();\n\t\tvar index = 0;\n\t\tvar numCharacters = data[index++];\n\t\tvar characterWidth = 1.4;\n\t\tvar x = 0;\n\n\t\t// Build geometry first\n\t\tfor(var i = 0; i < numCharacters; i++) {\n\t\t\tvar numSegments = data[index++];\n\n\t\t\tfor(var j = 0; j < numSegments; j++) {\n\t\t\t\tvar absX1 = data[index++];\n\t\t\t\tvar absY1 = data[index++];\n\t\t\t\tvar absX2 = data[index++];\n\t\t\t\tvar absY2 = data[index++];\n\t\t\t\t\n\t\t\t\tlineGeometry.vertices.push(new THREE.Vector3(x + absX1, absY1, 0));\n\t\t\t\tlineGeometry.vertices.push(new THREE.Vector3(x + absX2, absY2, 0));\n\n\t\t\t}\n\t\t\t\tx += characterWidth;\n\n\t\t}\n\n\t\tTHREE.GeometryUtils.center(lineGeometry);\n\n\t\t// and numInstances lines later\n\t\tfor(var k = 0; k < numInstances; k++) {\n\t\t\tvar line = new THREE.Line(lineGeometry, lineMaterial, THREE.LinePieces);\n\t\t\ttext.add( line );\n\t\t}\n\n\t\treturn text;\n\n\t}", "wrapText(textElement, cWidth) {\n // Allow 'function' and 'this', for D3...\n /* eslint-disable func-names, no-invalid-this */\n textElement.each(function () {\n const thisText = Dthree.select(this);\n // Extract properties from D3 bound data, since they\n // don't seem to survive the call...\n thisText.attr({\n 'content': (ddd) => ddd.content,\n 'class': (ddd) => ddd.class,\n 'wrapwidth': (ddd) => ddd.wrapwidth,\n 'leading': (ddd) => ddd.leading,\n 'x': (ddd) => {\n let xVal = ddd.x;\n // Right-aligned?\n if (xVal < 0) {\n xVal += cWidth;\n }\n return xVal;\n },\n });\n const wrapWidth = thisText.attr('wrapwidth');\n // String content as reversed array, by word\n const content = thisText.attr('content');\n const words = content.split(/\\s+/).reverse();\n // X pos for tspans\n const xPos = `${ thisText.attr('x') }px`;\n // Bostock's original had a linecounter, but I don't seem to need that...\n let line = [];\n const leading = `${ thisText.attr('leading') }px`;\n let tspan = thisText.text(null).append('tspan').attr('x', xPos).attr('dy', 0);\n while (words.length > 0) {\n const word = words.pop();\n line.push(word);\n tspan.text(line.join(' '));\n if (tspan.node().getComputedTextLength() > wrapWidth) {\n // debugger;\n line.pop();\n tspan.text(line.join(' '));\n line = [ word ];\n tspan = thisText.append('tspan').attr('x', xPos).attr('dy', leading).text(word);\n }\n }\n });\n }", "function blockText([text]: $ReadOnlyArray<string>) {\n const tabSize = 2;\n\n return text.slice(1, text.length - 1)\n .split('\\n')\n .map(line => line.slice(tabSize))\n .join('\\n');\n}", "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\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 }", "function wrap(text, width) {\n text.each(function() {\n var text = d3.select(this),\n words = text\n .text()\n .split(/\\s+/)\n .reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.1,\n y = text.attr(\"y\"),\n dy = parseFloat(text.attr(\"dy\")),\n tspan = text\n .text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\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\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"y\", y)\n .attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\")\n .text(word);\n }\n }\n });\n }", "function wrap(text, width) {\n text.each(function () {\n let 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 = 1.1,\n tspan = text.text(null).append(\"tspan\").attr(\"x\", x).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\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n }\n }\n });\n }", "function wrap(text, width) {\r\n text.each(function() {\r\n var text = d3.select(this),\r\n words = text.text().split(/\\s+/).reverse(),\r\n word,\r\n line = [],\r\n lineNumber = 0,\r\n lineHeight = 1.1, // ems\r\n y = text.attr(\"y\"),\r\n dy = parseFloat(text.attr(\"dy\")),\r\n tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", dy + \"em\");\r\n while (word = words.pop()) {\r\n line.push(word);\r\n tspan.text(line.join(\" \"));\r\n if (tspan.node().getComputedTextLength() > width) {\r\n line.pop();\r\n tspan.text(line.join(\" \"));\r\n line = [word];\r\n tspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\r\n }\r\n }\r\n });\r\n } //end of wrap function ", "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}", "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}", "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 y = parseInt(text.attr(\"y\")),\n dy = 0,\n tspan = text.text(null).append(\"tspan\")\n .attr(\"x\", 2 * margin.preview)\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\", 2 * margin.preview)\n .attr(\"y\", parseInt(y) + ++lineNumber * (preview_fontsize + 5))\n .text(word);\n }\n }\n });\n }", "function wrap(text, width) {\n\t\tvar text = d3.select(this)[0][0],\n\t\t\twords = text.text().split(/\\s+/).reverse(),\n\t\t\tword,\n\t\t\tline = [],\n\t\t\tlineNumber = 0,\n\t\t\tlineHeight = 1.4, \n\t\t\ty = text.attr('y'),\n\t\t\tx = text.attr('x'),\n\t\t\tdy = parseFloat(text.attr('dy')),\n\t\t\ttspan = text.text(null).append('tspan').attr('x', x).attr('y', y).attr('dy', dy + 'em')\n\t\t\t\n\t\twhile (word = words.pop()) {\n\t\t\tline.push(word)\n\t\t\ttspan.text(line.join(' '))\n\t\t\tif (tspan.node().getComputedTextLength() > width) {\n\t\t\t\tline.pop()\n\t\t\t\ttspan.text(line.join(' '))\n\t\t\t\tline = [word]\n\t\t\t\ttspan = text.append('tspan').attr('x', x).attr('y', y).attr('dy', ++lineNumber * lineHeight + dy + 'em').text(word)\n\t\t\t}\n\t\t}\n\t}", "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 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 }", "function chunkText(context, text)\n\t{\n\t\tvar tag = text.ctor;\n\t\tif (tag === 'Text:Append')\n\t\t{\n\t\t\tvar leftChunks = chunkText(context, text._0);\n\t\t\tvar rightChunks = chunkText(context, text._1);\n\t\t\treturn leftChunks.concat(rightChunks);\n\t\t}\n\t\tif (tag === 'Text:Text')\n\t\t{\n\t\t\treturn [{\n\t\t\t\ttext: text._0,\n\t\t\t\tcolor: context.color,\n\t\t\t\theight: context['font-size'].slice(0,-2) | 0,\n\t\t\t\tfont: toFont(context)\n\t\t\t}];\n\t\t}\n\t\tif (tag === 'Text:Meta')\n\t\t{\n\t\t\tvar newContext = freshContext(text._0, context);\n\t\t\treturn chunkText(newContext, text._1);\n\t\t}\n\t}", "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.text(null).append(\"tspan\").attr(\"x\", x).attr(\"y\", y).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 && line.length > 1) {\n // second condition in previous line was needed to avoid empty lines when first word is too long\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 });\n}", "function wrap(text, width) { // 240\n\t\ttext.each(function () { // 241\n\t\t\tvar text = d3.select(this), // 242\n\t\t\t words = text.text().split(/\\s+/).reverse(), // 242\n\t\t\t word, // 242\n\t\t\t line = [], // 242\n\t\t\t lineNumber = 0, // 242\n\t\t\t lineHeight = 1.4, // 242\n\t\t\t // ems // 242\n\t\t\ty = text.attr(\"y\"), // 248\n\t\t\t x = text.attr(\"x\"), // 242\n\t\t\t dy = parseFloat(text.attr(\"dy\")), // 242\n\t\t\t tspan = text.text(null).append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", dy + \"em\"); // 242\n //\n\t\t\twhile (word = words.pop()) { // 253\n\t\t\t\tline.push(word); // 254\n\t\t\t\ttspan.text(line.join(\" \")); // 255\n //\n\t\t\t\tif (tspan.node().getComputedTextLength() > width) { // 256\n\t\t\t\t\tline.pop(); // 257\n\t\t\t\t\ttspan.text(line.join(\" \")); // 258\n\t\t\t\t\tline = [word]; // 259\n\t\t\t\t\ttspan = text.append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n\t\t\t\t} // 261\n\t\t\t} // 262\n\t\t}); // 263\n\t}", "function wrap(text, width) {\n\t\t\t\ttext.each(function() {\n\t\t\t\t\tvar text = d3.select(this),\n\t\t\t\t\t\twords = text.text().split(/\\s+/).reverse(),\n\t\t\t\t\t\tword,\n\t\t\t\t\t\tline = [],\n\t\t\t\t\t\tlineNumber = 0,\n\t\t\t\t\t\tlineHeight = 1.1, // ems\n\t\t\t\t\t\ty = text.attr(\"y\"),\n\t\t\t\t\t\tdy = parseFloat(text.attr(\"dy\")),\n\t\t\t\t\t\ttspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n\t\t\t\t\twhile (word = words.pop()) {\n\t\t\t\t\t\tline.push(word);\n\t\t\t\t\t\ttspan.text(line.join(\" \"));\n\t\t\t\t\t\tif (tspan.node().getComputedTextLength() > width) {\n\t\t\t\t\t\t\tline.pop();\n\t\t\t\t\t\t\ttspan.text(line.join(\" \"));\n\t\t\t\t\t\t\tline = [word];\n\t\t\t\t\t\t\ttspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "function wrap(text, width) {\n\t\t\t\ttext.each(function() {\n\t\t\t\t\tvar text = d3.select(this),\n\t\t\t\t\t\twords = text.text().split(/\\s+/).reverse(),\n\t\t\t\t\t\tword,\n\t\t\t\t\t\tline = [],\n\t\t\t\t\t\tlineNumber = 0,\n\t\t\t\t\t\tlineHeight = 1.1, // ems\n\t\t\t\t\t\ty = text.attr(\"y\"),\n\t\t\t\t\t\tdy = parseFloat(text.attr(\"dy\")),\n\t\t\t\t\t\ttspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n\t\t\t\t\twhile (word = words.pop()) {\n\t\t\t\t\t\tline.push(word);\n\t\t\t\t\t\ttspan.text(line.join(\" \"));\n\t\t\t\t\t\tif (tspan.node().getComputedTextLength() > width) {\n\t\t\t\t\t\t\tline.pop();\n\t\t\t\t\t\t\ttspan.text(line.join(\" \"));\n\t\t\t\t\t\t\tline = [word];\n\t\t\t\t\t\t\ttspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "function wrap(text, width) {\n\t\t text.each(function() {\n\t\t\tlet text = d3.select(this),\n\t\t\t\twords = text.text().split(/\\s+/).reverse(),\n\t\t\t\tword,\n\t\t\t\tline = [],\n\t\t\t\tlineNumber = 0,\n\t\t\t\tlineHeight = 1.4, // ems\n\t\t\t\ty = text.attr(\"y\"),\n\t\t\t\tx = text.attr(\"x\"),\n\t\t\t\tdy = parseFloat(text.attr(\"dy\")),\n\t\t\t\ttspan = text.text(null).append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n\t\t\t\t\n\t\t\twhile (word = words.pop()) {\n\t\t\t line.push(word);\n\t\t\t tspan.text(line.join(\" \"));\n\t\t\t if (tspan.node().getComputedTextLength() > width) {\n\t\t\t\tline.pop();\n\t\t\t\ttspan.text(line.join(\" \"));\n\t\t\t\tline = [word];\n\t\t\t\ttspan = text.append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n\t\t\t }\n\t\t\t}\n\t\t });\n\t\t}", "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.text(null).append(\"tspan\").attr(\"x\", x).attr(\"y\", y).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.append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n }\n }\n });\n }//wrap\t", "function chunkText(context, text)\n\t{\n\t\tvar tag = text.ctor;\n\t\tif (tag === 'Text:Append')\n\t\t{\n\t\t\tvar leftChunks = chunkText(context, text._0);\n\t\t\tvar rightChunks = chunkText(context, text._1);\n\t\t\treturn leftChunks.concat(rightChunks);\n\t\t}\n\t\tif (tag === 'Text:Text')\n\t\t{\n\t\t\treturn [{\n\t\t\t\ttext: text._0,\n\t\t\t\tcolor: context.color,\n\t\t\t\theight: context['font-size'].slice(0, -2) | 0,\n\t\t\t\tfont: toFont(context)\n\t\t\t}];\n\t\t}\n\t\tif (tag === 'Text:Meta')\n\t\t{\n\t\t\tvar newContext = freshContext(text._0, context);\n\t\t\treturn chunkText(newContext, text._1);\n\t\t}\n\t}", "text(text) {\n // act as getter\n if (text === undefined) {\n var children = this.node.childNodes;\n var firstLine = 0;\n text = '';\n\n for (var i = 0, len = children.length; i < len; ++i) {\n // skip textPaths - they are no lines\n if (children[i].nodeName === 'textPath') {\n if (i === 0) firstLine = 1;\n continue;\n } // add newline if its not the first child and newLined is set to true\n\n\n if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) {\n text += '\\n';\n } // add content of this node\n\n\n text += children[i].textContent;\n }\n\n return text;\n } // remove existing content\n\n\n this.clear().build(true);\n\n if (typeof text === 'function') {\n // call block\n text.call(this, this);\n } else {\n // store text and make sure text is not blank\n text = text.split('\\n'); // build new lines\n\n for (var j = 0, jl = text.length; j < jl; j++) {\n this.tspan(text[j]).newLine();\n }\n } // disable build mode and rebuild lines\n\n\n return this.build(false).rebuild();\n }", "function wrap(text, width) {\n text.each(function() {\n var text = d3.select(this),\n words = text\n .text()\n .split(/\\s+/)\n .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\n .text(null)\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"y\", y)\n .attr(\"dy\", dy + \"em\");\n console.log(\"tspan: \" + tspan);\n while ((word = words.pop())) {\n line.push(word);\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > 90) {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = text\n .append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"y\", y)\n .attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\")\n .text(word);\n }\n }\n });\n }", "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.text(null).append(\"tspan\").attr(\"x\", x).attr(\"y\", y).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_r) {\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 });\n }", "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}", "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 x = 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 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 });\n}", "function textWrapPX (text) {\n var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;\n text.each(function () {\n var text = d3Selection.select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.1,\n // ems\n y = parseFloat(text.attr('y')) || 0,\n dy = parseFloat(text.attr('dy')) || 0,\n tspan = text.text(null).append('tspan').attr('x', 0).attr('y', y).attr('dy', dy + 'em');\n word = words.pop();\n\n while (word) {\n line.push(word);\n tspan.text(line.join(' '));\n\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 word = words.pop();\n }\n });\n}", "function wrap(text, content_width, ttmargin) {\r\n text.each(function () {\r\n var text = d3.select(this),\r\n words = text.text().split(/\\s+/).reverse(),\r\n word,\r\n line = [],\r\n lineNumber = 0,\r\n lineHeight = 10 /*1.1*/, // ems\r\n y = text.attr(\"y\"),\r\n dy = 1,\r\n tspan = text\r\n .text(null)\r\n .append(\"tspan\")\r\n .attr(\"x\", ttmargin)\r\n .attr(\"y\", y)\r\n .attr(\"dy\", dy /* + \"em\"*/);\r\n\r\n while ((word = words.pop())) {\r\n line.push(word);\r\n\r\n tspan.text(line.join(\" \"));\r\n if (tspan.node().getComputedTextLength() > content_width) {\r\n line.pop();\r\n tspan.text(line.join(\" \"));\r\n line = [word];\r\n tspan = text\r\n .append(\"tspan\")\r\n .attr(\"x\", ttmargin)\r\n .attr(\"y\", y)\r\n .attr(\"dy\", ++lineNumber * lineHeight + dy)\r\n .text(word);\r\n\r\n vis.lineCount++;\r\n }\r\n }\r\n });\r\n\r\n return;\r\n} // end function wrap()", "function wrap(text, width) {\n\t text.each(function() {\n\t var text = d3.select(this),\n\t words = text.text().split(/\\s+/).reverse(),\n\t word,\n\t line = [],\n\t lineNumber = 0,\n\t lineHeight = 1.1, // ems\n\t y = text.attr(\"y\"),\n\t dy = parseFloat(text.attr(\"dy\")),\n\t tspan = text.text(null).append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", dy + \"em\")\n\t while (word = words.pop()) {\n\t line.push(word)\n\t tspan.text(line.join(\" \"))\n\t if (tspan.node().getComputedTextLength() > width/2+30) {\n\t line.pop()\n\t tspan.text(line.join(\" \"))\n\t line = [word]\n\t tspan = text.append(\"tspan\").attr(\"x\", 0).attr(\"y\", y).attr(\"dy\", `${++lineNumber * lineHeight + dy}em`).text(word)\n\t }\n\t }\n\t })\n\t}", "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, // 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}", "function MultiLine(name) {\n var _this = _super.call(this, name) || this;\n _this.name = name;\n _this._lineWidth = 1;\n /** Function called when a point is updated */\n _this.onPointUpdate = function () {\n _this._markAsDirty();\n };\n _this._automaticSize = true;\n _this.isHitTestVisible = false;\n _this._horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\n _this._verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\n _this._dash = [];\n _this._points = [];\n return _this;\n }", "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 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 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}", "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}", "function displayText1() {\n let t1 = createElement('span', 'Logic for Visualizing Seismic Events');\n t1.parent('text1');\n t1.class('large'); \n}", "function wrap(text, width) {\r\n text.each(function () {\r\n var text = d3.select(this),\r\n words = text.text().split(/\\s+/).reverse(),\r\n word,\r\n line = [],\r\n lineNumber = 0,\r\n lineHeight = 1.1, // ems\r\n x = text.attr(\"x\"),\r\n y = text.attr(\"y\"),\r\n dy = 0, //parseFloat(text.attr(\"dy\")),\r\n tspan = text.text(null)\r\n .append(\"tspan\")\r\n .attr(\"x\", x)\r\n .attr(\"y\", y)\r\n .attr(\"dy\", dy + \"em\");\r\n while (word = words.pop()) {\r\n line.push(word);\r\n tspan.text(line.join(\" \"));\r\n if (tspan.node().getComputedTextLength() > width) {\r\n line.pop();\r\n tspan.text(line.join(\" \"));\r\n line = [word];\r\n tspan = text.append(\"tspan\")\r\n .attr(\"x\", x)\r\n .attr(\"y\", y)\r\n .attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\")\r\n .text(word);\r\n }\r\n }\r\n });\r\n}", "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', 'hanging');\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', 'hanging')\n .text(word);\n }\n }\n });\n}", "format(text) {\n if (!text) {\n return null;\n }\n return (\n <span style={{ whiteSpace: 'pre-wrap' }}>\n {text.replace(/\\\\r*\\\\n/g, <br />)}\n </span>\n );\n }", "function singleLineSyntax(regexp, string, color){\n\tvar reg = regexp;\n\tvar result = reg.exec(string);\n\treturn result ? createSpanString(string, color) : string;\n}", "function wrap(text, width) {\n text.each(function() {\n var text = d3.select(this),\n words = text.text().split(/\\s+/).reverse(),\n word,\n allTspans = [],\n line = [],\n lineNumber = 0,\n lineHeight = 1.2, // 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);\n word = words.pop();\n allTspans.push(tspan);\n while (word) {\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).text(word);\n allTspans.push(tspan);\n }\n word = words.pop();\n }\n allTspans.forEach(function(d, i) {\n d.attr(\"dy\", -(allTspans.length - 1) / 2.0 * lineHeight + i * lineHeight + dy + \"em\");\n });\n });\n }", "function addTextLabel(root,node){var domNode=root.append(\"text\");var lines=processEscapeSequences(node.label).split(\"\\n\");for(var i=0;i<lines.length;i++){domNode.append(\"tspan\").attr(\"xml:space\",\"preserve\").attr(\"dy\",\"1em\").attr(\"x\",\"1\").text(lines[i])}util.applyStyle(domNode,node.labelStyle);return domNode}", "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 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 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(\"dy\", 1 + dy + \"em\") // modified by Alvin\n .text(word);\n }\n }\n });\n }", "function parseControlResponse(text) {\n const lines = text.split(/\\r?\\n/).filter(isNotBlank);\n const messages = [];\n let startAt = 0;\n let tokenRegex;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n // No group has been opened.\n if (!tokenRegex) {\n if (isMultiline(line)) {\n // Open a group by setting an expected token.\n const token = line.substr(0, 3);\n tokenRegex = new RegExp(`^${token}(?:$| )`);\n startAt = i;\n }\n else if (isSingleLine(line)) {\n // Single lines can be grouped immediately.\n messages.push(line);\n }\n }\n // Group has been opened, expect closing token.\n else if (tokenRegex.test(line)) {\n tokenRegex = undefined;\n messages.push(lines.slice(startAt, i + 1).join(LF));\n }\n }\n // The last group might not have been closed, report it as a rest.\n const rest = tokenRegex ? lines.slice(startAt).join(LF) + LF : \"\";\n return { messages, rest };\n}", "function TextRenderer(){}// no need for block level renderers", "function joinLineGroup(items) {\n const itemsOrderByX = items.sort((a, b) => (a.x < b.x ? -1 : 1));\n // console.log(itemsOrderByX);\n let lastX = 0;\n let line = itemsOrderByX.reduce((s, i) => {\n // console.log(i);\n // eyeballing spaces from the data!\n const xdiff = i.x - lastX;\n // console.log(`xdiff: ${xdiff}`);\n const separator = xdiff < 1 ? '' : ' ';\n lastX = i.x;\n\n return s + separator + i.text;\n }, '');\n\n // Comma separator.\n line = line.replace(/%2C/g, ',');\n\n // PDF xdiff seems to be off when separating numbers from text.\n line = line.replace(/(\\d)([a-zA-Z])/g, function(m, a, b) {\n return `${a} ${b}`;\n });\n line = line.replace(/([a-zA-Z])(\\d)/g, function(m, a, b) {\n return `${a} ${b}`;\n });\n\n // Remove comma separator between numbers.\n line = line.replace(/(\\d),(\\d)/g, function(m, a, b) {\n return `${a}${b}`;\n });\n\n return line;\n }", "function wrap(text, width) {\n text.each(function() {\n var text = d3.select(this),\n words = text.text().match(/.{1,95}/g).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 0.02, // ems\n y = text.attr(\"y\"),\n x = text.attr(\"x\"),\n dy = parseFloat(text.attr(\"dy\")),\n dx = parseFloat(text.attr(\"dx\")),\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}", "function renderText(textGroup, newXScale, chosenXAxis, newYScale, chosenYAxis) {\n textGroup.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[chosenXAxis]))\n .attr(\"y\", d => newYScale(d[chosenYAxis]))\n .attr(\"text-anchor\", \"middle\");\n return textGroup;\n }", "splitTextForClientArea(lineWidget, element, text, width, characterFormat) {\n let paragraph = lineWidget.paragraph;\n let isSplitByWord = true;\n let index = -1;\n if (!(text.substring(0, 1) === ' ')) {\n let textWidth = width;\n let characterUptoWS = 0;\n characterUptoWS = HelperMethods.trimEnd(text).indexOf(' ') + 1;\n index = characterUptoWS;\n //Checks whether text not starts with white space. If starts with white space, no need to check previous text blocks.\n if (index > 0) {\n textWidth = this.viewer.textHelper.measureTextExcludingSpaceAtEnd(text.slice(0, index), characterFormat);\n }\n if (this.viewer.clientActiveArea.width < textWidth) {\n //Check and split the previous text elements to next line. \n isSplitByWord = this.checkPreviousElement(lineWidget, lineWidget.children.indexOf(element), characterFormat);\n if (isSplitByWord) {\n //lineWidget = paragraph.childWidgets[paragraph.childWidgets.indexOf(lineWidget) + 1] as LineWidget;\n //isSplitByWord = textWidth <= this.viewer.clientActiveArea.width;\n return;\n }\n }\n }\n else {\n index = 1;\n }\n if (width <= this.viewer.clientActiveArea.width) {\n //Fits the text in current line.\n this.addElementToLine(paragraph, element);\n }\n else if (isSplitByWord && (index > 0 || text.indexOf(' ') !== -1)) {\n this.splitByWord(lineWidget, paragraph, element, text, width, characterFormat);\n }\n else {\n this.splitByCharacter(lineWidget, element, text, width, characterFormat);\n }\n }", "linksToLines() {\n let gs = [];\n for (let i = 0, len = this._cs.length; i < len; i++) {\n let ln = this._cs[i];\n gs.push(new Pt_1.Group(this[ln[0]], this[ln[1]]));\n }\n return gs;\n }", "getText () {\n const textArr = this.getHeader();\n [...textArr, ...this.lines].join('\\n')\n }", "function wrap(text, width) {\r\n text.each(function() {\r\n\tvar text = d3.select(this),\r\n\t\tdeaths = text.text().split(/\\s+/).reverse(),\r\n\t\tdeath,\r\n\t\tline = [],\r\n\t\tlineNumber = 0,\r\n\t\tlineHeight = 1.2, // ems\r\n\t\ty = parseFloat(text.attr(\"y\")),\r\n\t\tx = parseFloat(text.attr(\"x\")),\r\n\t\tdy = parseFloat(text.attr(\"dy\")),\r\n\t\ttspan = text.text(null).append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", dy + \"em\");\r\n\r\n\twhile (death = deaths.pop()) {\r\n\t line.push(death);\r\n\t tspan.text(line.join(\" \"));\r\n\t if (tspan.node().getComputedTextLength() > width) {\r\n\t\tline.pop();\r\n\t\ttspan.text(line.join(\" \"));\r\n\t\tline = [death];\r\n\t\ttspan = text.append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(death);\r\n\t }\r\n\t}\r\n });\r\n}//wrap", "function TextRenderer() {} // no need for block level renderers", "function TextRenderer() {} // no need for block level renderers", "function chunks(chunks) {\n let prefix = '\\t ';\n chunks.forEach((chunk, i) => {\n let groupLn = colors.underline(`Group ${i + 1}:`)\n console.log('\\n\\t' + groupLn);\n console.log(`${prefix}${chunk.join('\\n' + prefix)}`);\n });\n console.log();\n}", "function insertLineBreaks() {\n var el = d3.select(this);\n var words=d3.select(this).text().split('#');\n \n el.text('');\n \n for (var i = 0; i < words.length; i++) {\n var tspan = el.append('tspan').text(words[i]);\n if (i > 0) {\n tspan.attr('x', 0).attr('dy', '15');\n }\n };\n }", "function formatText() {\r\n\tlet textFromClipboard = getClipboardData();\r\n\r\n\tif (!isSimpleText) {\r\n\t\tlet formatedText = buildText(textFromClipboard);\r\n\t\tglobalText = (globalText != \"\") ? globalText + \"\\n\\n\" + formatedText : formatedText;\r\n\t}\r\n\r\n\tif (isSimpleText) {\r\n\t\tlet newText = textFromClipboard;\r\n\t\tnewText = newText.replace(/\\n{3,20}/g, \"\\n\");\r\n\t\tnewText = newText.replace(/\\t{1,20}/g, TAB_RPLC);\r\n\t\tglobalText = (globalText != \"\") ? globalText + \"\\n\\n\" + newText : newText;\r\n\t}\r\n\tcopyToClipBoard(globalText);\r\n}", "function wrap( text, width, yheight, lineheight ) {\n\ttext.each( function () {\n\t\tvar text = d3.select( this ),\n\t\t\twords = text.text().split( /\\s+/ ).reverse(),\n\t\t\tword,\n\t\t\tline = [],\n\t\t\tlineNumber = 0,\n\t\t\tlineHeight = /*1.1*/ lineheight, // ems\n\t\t\ty = 0 /*text.attr( \"y\" )*/ ,\n\t\t\tdy = parseFloat( yheight ),\n\t\t\ttspan = text.text( null ).append( \"tspan\" ).attr( \"x\", 0 ).attr( \"y\", y ).attr( \"dy\", dy + \"em\" );\n\t\twhile ( word = words.pop() ) {\n\t\t\tline.push( word );\n\t\t\t// console.log( \"wrap\", line, y, yheight );\n\t\t\ttspan.text( line.join( \" \" ) );\n\t\t\t// console.log( line, \"comp text length\", tspan.node().getComputedTextLength(), width );\n\t\t\t//console.log( y );\n\t\t\tif ( tspan.node().getComputedTextLength() > width ) {\n\t\t\t\tline.pop();\n\t\t\t\ttspan.text( line.join( \" \" ) );\n\t\t\t\tline = [ word ];\n\t\t\t\ttspan = text.append( \"tspan\" ).attr( \"x\", 0 ).attr( \"y\", y ).attr( \"dy\", dy + ( lineHeight * ++lineNumber ) + \"em\" ).text( word );\n\t\t\t\t// console.log( dy + ( lineHeight * lineNumber ) );\n\t\t\t\t// console.log( tspan );\n\t\t\t}\n\t\t}\n\t} );\n\n\t// This is calling an updated height.\n\tif ( pymChild ) {\n\t\tpymChild.sendHeight();\n\t}\n}", "function formatAppendTextRectText(appends) {\n var padding = 5;\n var prevWidth = 0;\n var groupBBox = {\n x: 0,\n y: 0,\n height: 0,\n width: 0\n };\n\n appends.select('rect').attr('height', 0);\n groupBBox = appends.node().getBBox();\n\n\n /*jshint -W083 */\n for (var i = 0; i < appends.node().childNodes.length; i++) {\n var element = appends.node().childNodes[i];\n\n if (i % 2 === 0) {\n //text\n appends.select('text:nth-child(' + (i + 1) + ')')\n .attr({\n dy: function () {\n return getCentralPosition(this);\n },\n x: (prevWidth + (padding * i) + 1),\n y: groupBBox.height / 2\n });\n\n prevWidth += element.getBBox().width;\n\n } else {\n //rect\n appends.select('rect:nth-child(' + (i + 1) + ')')\n .attr({\n x: (prevWidth + (padding * i)),\n y: 0,\n width: 1,\n height: groupBBox.height\n });\n }\n }\n\n appends.selectAll('tspan')\n .attr({\n transform: function () {\n return 'translate(0, ' + getCentralPosition(this) + ')';\n },\n y: groupBBox.height / 2\n });\n }", "addMultilineText(title, numberOfLines = 6, richText = true, restrictedMode = false, appendOnly = false, allowHyperlink = true, properties) {\r\n const props = {\r\n AllowHyperlink: allowHyperlink,\r\n AppendOnly: appendOnly,\r\n FieldTypeKind: 3,\r\n NumberOfLines: numberOfLines,\r\n RestrictedMode: restrictedMode,\r\n RichText: richText,\r\n };\r\n return this.add(title, \"SP.FieldMultiLineText\", extend(props, properties));\r\n }", "function wrap(text, width) {\n text.each(function() {\n\tvar text = d3.select(this),\n\t\twords = text.text().split(/\\s+/).reverse(),\n\t\tword,\n\t\tline = [],\n\t\tlineNumber = 0,\n\t\tlineHeight = 1.2, // ems\n\t\ty = parseFloat(text.attr(\"y\")),\n\t\tx = parseFloat(text.attr(\"x\")),\n\t\tdy = parseFloat(text.attr(\"dy\")),\n\t\ttspan = text.text(null).append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", dy + \"em\");\n\n\twhile (word = words.pop()) {\n\t line.push(word);\n\t tspan.text(line.join(\" \"));\n\t if (tspan.node().getComputedTextLength() > width) {\n\t\tline.pop();\n\t\ttspan.text(line.join(\" \"));\n\t\tline = [word];\n\t\ttspan = text.append(\"tspan\").attr(\"x\", x).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n\t }\n\t}\n });\n}//wrap", "static reduceConsecutiveSameStyleBlocksToOne(groups) {\n var newLineOp = DeltaInsertOp.createNewLineOp();\n return groups.map(function (elm) {\n if (!Array.isArray(elm)) {\n if (elm instanceof BlockGroup && !elm.ops.length) {\n elm.ops.push(newLineOp);\n }\n return elm;\n }\n var groupsLastInd = elm.length - 1;\n elm[0].ops = flatten(elm.map((g, i) => {\n if (!g.ops.length) {\n return [newLineOp];\n }\n return g.ops.concat(i < groupsLastInd ? [newLineOp] : []);\n }));\n return elm[0];\n });\n }", "_justify() {\n let hIx = 0;\n let left = 0;\n let minx = 0;\n let maxx = 0;\n let lvl = 0;\n let maxwidth = 0;\n let runningWidth = 0;\n let runningHeight = 0;\n if (!this.inlineBlocks.length) {\n return;\n }\n minx = this.inlineBlocks[0].text.startX;\n // We justify relative to first block x/y.\n const initialX = this.inlineBlocks[0].text.startX;\n const initialY = this.inlineBlocks[0].text.startY;\n const vert = {};\n this.inlineBlocks.forEach((inlineBlock) => {\n const block = inlineBlock.text;\n const blockBox = block.getLogicalBox();\n // If this is a horizontal positioning, reset to first blokc position\n //\n if (hIx > 0) {\n block.startX = initialX;\n block.startY = initialY;\n }\n minx = block.startX < minx ? block.startX : minx;\n maxx = (block.startX + blockBox.width) > maxx ? block.startX + blockBox.width : maxx;\n\n lvl = inlineBlock.position === SmoTextGroup.relativePositions.ABOVE ? lvl + 1 : lvl;\n lvl = inlineBlock.position === SmoTextGroup.relativePositions.BELOW ? lvl - 1 : lvl;\n if (inlineBlock.position === SmoTextGroup.relativePositions.RIGHT) {\n block.startX += runningWidth;\n if (hIx > 0) {\n block.startX += this.spacing;\n }\n }\n if (inlineBlock.position === SmoTextGroup.relativePositions.LEFT) {\n if (hIx > 0) {\n block.startX = minx - blockBox.width;\n minx = block.startX;\n block.startX -= this.spacing;\n }\n }\n if (inlineBlock.position === SmoTextGroup.relativePositions.BELOW) {\n block.startY += runningHeight;\n if (hIx > 0) {\n block.startY += this.spacing;\n }\n }\n if (inlineBlock.position === SmoTextGroup.relativePositions.ABOVE) {\n block.startY -= runningHeight;\n if (hIx > 0) {\n block.startY -= this.spacing;\n }\n }\n if (!vert[lvl]) {\n vert[lvl] = {};\n vert[lvl].blocks = [block];\n vert[lvl].minx = block.startX;\n vert[lvl].maxx = block.startX + blockBox.width;\n maxwidth = vert[lvl].width = blockBox.width;\n } else {\n vert[lvl].blocks.push(block);\n vert[lvl].minx = vert[lvl].minx < block.startX ? vert[lvl].minx : block.startX;\n vert[lvl].maxx = vert[lvl].maxx > (block.startX + blockBox.width) ?\n vert[lvl].maxx : (block.startX + blockBox.width);\n vert[lvl].width += blockBox.width;\n maxwidth = maxwidth > vert[lvl].width ? maxwidth : vert[lvl].width;\n }\n runningWidth += blockBox.width;\n runningHeight += blockBox.height;\n hIx += 1;\n block.updatedMetrics = false;\n });\n\n const levels = Object.keys(vert);\n\n // Horizontal justify the vertical blocks\n levels.forEach((level) => {\n const vobj = vert[level];\n if (this.justification === SmoTextGroup.justifications.LEFT) {\n left = minx - vobj.minx;\n } else if (this.justification === SmoTextGroup.justifications.RIGHT) {\n left = maxx - vobj.maxx;\n } else {\n left = (maxwidth / 2) - (vobj.width / 2);\n left += minx - vobj.minx;\n }\n vobj.blocks.forEach((block) => {\n block.offsetStartX(left);\n });\n });\n }", "function writeText() {\n let outputText = \n ['g', getText().map(textData => ['g', {'attrs': {'transform': 'translate(-0.5 -0.5)'}},\n ['switch',\n ['foreignObject', {'attrs': {'style': 'overflow: visible; text-align: left;', 'pointer-events': 'none', 'width': '100%', 'height': '100%', 'requiredFeatures': 'http://www.w3.org/TR/SVG11/feature#Extensibility'}},\n ['div', {'attrs': {'style': `display: flex; align-items: unsafe center; justify-content: unsafe ${textData[\"justify\"]}; width: ${textData[\"width\"]}px; height: 1px; padding-top: ${textData[\"padding\"]}px; margin-left: ${textData[\"margin\"]}px;`}},\n ['div', {'attrs': {'style': 'box-sizing: border-box; font-size: 0; text-align: center;'}},\n ['div', {'attrs': {'style': `display: inline-block; font-size: 12px; font-family: Helvetica; color: ${textData[\"color-fill\"]}; line-height: 1.2; pointer-events: none; white-space: normal; word-wrap: normal; `}}, `${textData[\"text\"]}`]]]],\n ['text', {'attrs': {'x': `${textData[\"x\"]}`, 'y': `${textData[\"padding\"]+4}`, 'fill': `${textData[\"color-fill\"]}`, 'font-family': 'Helvetica', 'font-size': '12px', 'text-anchor': 'middle'}}, `${textData[\"text\"]}`]]])];\n \n return outputText;\n}", "function renderText(textGroup, newXScale, chosenXAxis, newYScale, chosenYAxis) {\n \n textGroup.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[chosenXAxis]))\n .attr(\"y\", d => newYScale(d[chosenYAxis]))\n .attr(\"text-anchor\", \"middle\");\n \n return textGroup;\n}", "function plainGroupFromIdentifiedItems( identifiedItems ) {\n\treturn group( 'plain', {\n\t\titems: identifiedItems\n\t});\n}", "drawTextMultiLine (lines, [x, y], size, { stroke, stroke_width = 0, transform, align, supersample }, type) {\n let line_height = size.line_height;\n let height = y;\n for (let line_num=0; line_num < lines.length; line_num++) {\n let line = lines[line_num];\n this.drawTextLine(line, [x, height], size, { stroke, stroke_width, transform, align, supersample }, type);\n height += line_height;\n }\n\n // Draw bounding boxes for debugging\n if (debugSettings.draw_label_collision_boxes) {\n this.context.save();\n\n let dpr = Utils.device_pixel_ratio * supersample;\n let horizontal_buffer = dpr * (this.horizontal_text_buffer + stroke_width);\n let vertical_buffer = dpr * this.vertical_text_buffer;\n let collision_size = size.collision_size;\n let lineWidth = 2;\n\n this.context.strokeStyle = 'blue';\n this.context.lineWidth = lineWidth;\n this.context.strokeRect(x + horizontal_buffer, y + vertical_buffer, dpr * collision_size[0], dpr * collision_size[1]);\n if (type === 'curved'){\n this.context.strokeRect(x + size.texture_size[0] + horizontal_buffer, y + vertical_buffer, dpr * collision_size[0], dpr * collision_size[1]);\n }\n\n this.context.restore();\n }\n\n if (debugSettings.draw_label_texture_boxes) {\n this.context.save();\n\n let texture_size = size.texture_size;\n let lineWidth = 2;\n\n this.context.strokeStyle = 'green';\n this.context.lineWidth = lineWidth;\n // stroke is applied internally, so the outer border is the edge of the texture\n this.context.strokeRect(x + lineWidth, y + lineWidth, texture_size[0] - 2 * lineWidth, texture_size[1] - 2 * lineWidth);\n\n if (type === 'curved'){\n this.context.strokeRect(x + lineWidth + size.texture_size[0], y + lineWidth, texture_size[0] - 2 * lineWidth, texture_size[1] - 2 * lineWidth);\n }\n\n this.context.restore();\n }\n }", "function renderText(circleTextGroup, newXScale, newYScale, selected_X, selected_Y) {\n circleTextGroup.transition()\n .duration(1000)\n .attr(\"x\", d => newXScale(d[selected_X]))\n .attr(\"y\", d => newYScale(d[selected_Y]));\n \n return circleTextGroup;\n}", "htmlBuilder(group, options) {\n if (group.newRow) {\n throw new ParseError(\n \"\\\\cr valid only within a tabular/array environment\");\n }\n const span = buildCommon.makeSpan([\"mspace\"], [], options);\n if (group.newLine) {\n span.classes.push(\"newline\");\n if (group.size) {\n span.style.marginTop =\n calculateSize(group.size, options) + \"em\";\n }\n }\n return span;\n }", "function createTagline(text) {\n var span = $(\"span#tagline\");\n span.append(text);\n span.css(\"font-family: Courier, monospace; font-size: 100%;\");\n }", "function ensureBlock(text) {\n\treturn `\\n\\n${text}\\n\\n`\n}" ]
[ "0.6478826", "0.6269797", "0.62565714", "0.5962304", "0.5921791", "0.57596415", "0.57466376", "0.5706988", "0.5638568", "0.56331825", "0.5615477", "0.5566478", "0.55554104", "0.5538422", "0.5508039", "0.5506424", "0.5506424", "0.5470638", "0.5463635", "0.5440184", "0.54318166", "0.54220617", "0.54097444", "0.539637", "0.53935874", "0.5373579", "0.53649145", "0.5355985", "0.535307", "0.53489876", "0.5347105", "0.5342553", "0.53407323", "0.53221816", "0.53221035", "0.5318926", "0.530304", "0.5301645", "0.5301429", "0.5298465", "0.5298465", "0.5298307", "0.5292705", "0.52836025", "0.528318", "0.5282625", "0.5282158", "0.52812445", "0.52812445", "0.5278443", "0.5274628", "0.52721876", "0.52682495", "0.5261234", "0.5250396", "0.5235021", "0.52242184", "0.522345", "0.5219924", "0.5219157", "0.5212368", "0.5210193", "0.52082413", "0.5207863", "0.5206228", "0.5206164", "0.52048755", "0.51916033", "0.5191274", "0.5183966", "0.5181644", "0.5177375", "0.51765406", "0.5159588", "0.5148468", "0.5140924", "0.513608", "0.51205933", "0.5119528", "0.5114626", "0.5098448", "0.50979507", "0.50979507", "0.5095613", "0.50873196", "0.5084868", "0.5069536", "0.50691456", "0.50685763", "0.5064962", "0.50427216", "0.5042619", "0.5041964", "0.50125945", "0.50113237", "0.5005686", "0.49932057", "0.49931872", "0.49925023", "0.49920803" ]
0.6793016
0
160000 = 1 minute => 246060000 = 1 day
function getCategories(success, fail) { var key = 'ow-news-lists', target = 'categories', cache = cacheFactory.check({key:key,target:target,lifetime:lifetime}); if(!cache) { newsFactory.categories().then(function (data) { if(cacheFactory.set({key:key,target:target,value:data,method:'override'})) { success(data); } }, fail); } else { success(cacheFactory.get({key:key,target:target})); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTimeStamp8pm(){\n let today = new Date();\n \n var ms = today.getTime();\n var msPerDay = 86400 * 1000;\n var msto8pm = 72000000;\n let eightPMToday = ms - (ms % msPerDay) + msto8pm;\n return eightPMToday; \n }", "function gigasecond(date) {\n let mydate = new Date(date)\n mydate.setUTCSeconds(date.getUTCSeconds() + 1000000000);\n return (mydate);\n}", "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]}", "function createTimeStamp9am(){\n let today = new Date();\n \n var ms = today.getTime();\n var msPerDay = 86400 * 1000;\n var msto9am = 32400000;\n let nineAMToday = ms - (ms % msPerDay) + msto9am;\n return nineAMToday; \n }", "function e(t,e,n){var r=\" \";return(t%100>=20||t>=100&&t%100==0)&&(r=\" de \"),t+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,r){var n=\" \";return(t%100>=20||t>=100&&t%100==0)&&(n=\" de \"),t+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[r]}", "function moveOneDay(date) {date.setTime((date.getTime() + 24 * 60 * 60 * 1000)); }", "function a(e,a,t){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[t]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(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\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(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\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,r){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[r]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "ss (date) {\n return pad(date.getSeconds())\n }", "function calculate(diff)\r\n {\r\n var d = data;\r\n miliseconds = diff % 1000;\r\n diff -= miliseconds;\r\n diff /= 1000;\r\n seconds = diff % 60;\r\n diff -= seconds;\r\n diff /= 60;\r\n minutes = diff % 60;\r\n if(d.minutesId === null)\r\n seconds += minutes * 60;\r\n diff -= minutes;\r\n diff /= 60;\r\n hours = diff % 24;\r\n if(d.hoursId === null)\r\n minutes += hours * 60;\r\n diff -= hours;\r\n diff /= 24;\r\n days = diff;\r\n if(d.daysId === null)\r\n hours += days * 24;\r\n\r\n dateNow += 1000;\r\n }", "function dl(e,t,n){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[n]}", "function timestamp(day, hour, minute) {\n return day*24*60 + hour*60 + minute\n}", "SS (date) {\n return pad(Math.floor(date.getMilliseconds() / 10))\n }", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(t%100>=20||t>=100&&t%100===0)&&(i=\" de \"),t+i+r[n]}", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(t%100>=20||t>=100&&t%100===0)&&(i=\" de \"),t+i+r[n]}", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(t%100>=20||t>=100&&t%100===0)&&(i=\" de \"),t+i+r[n]}", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(t%100>=20||t>=100&&t%100===0)&&(i=\" de \"),t+i+r[n]}", "function e(t,e,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";if(t%100>=20||t>=100&&t%100===0){a=\" de \"}return t+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";if(e%100>=20||e>=100&&e%100===0){a=\" de \"}return e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";if(e%100>=20||e>=100&&e%100===0){o=\" de \"}return e+o+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+r[n]}", "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]}", "function e(t,e,n){var r=\" \";return(t%100>=20||t>=100&&t%100==0)&&(r=\" de \"),t+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+r[n]}", "function get15dayFromNow() {\n return new Date(new Date().valueOf() + 7 * 24 * 60 * 60 * 1000);\n }", "function loop() {\n\tconst time = new Date();\n\tconsole.log(\n\t\t(time.getHours() >>> 0).toString(2).toBit(6), // calc hours\n\t\t(time.getMinutes() >>> 0).toString(2).toBit(6), // calc minutes\n\t\t(time.getSeconds() >>> 0).toString(2).toBit(6)); // calc seconds\n}", "function t(e,t,n){var a={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+a[n]}", "function t(e,t,n){var a={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+a[n]}", "function o(e){var t=0,n=0,r=0;return e<=0?\"00:00:00\":e<60?\"00:00:\"+(t=(t=e)<10?\"0\"+t:t):e<3600?\"00:\"+(n=(n=parseInt(\"\"+e/60))<10?\"0\"+n:n)+\":\"+(t=(t=e%60)<10?\"0\"+t:t):(r=(r=parseInt(\"\"+e/3600))<10?\"0\"+r:r)+\":\"+(n=(n=parseInt(\"\"+e%3600/60))<10?\"0\"+n:n)+\":\"+(t=(t=parseInt(\"\"+e%3600%60%60))<10?\"0\"+t:t)}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100===0)&&(i=\" de \"),e+i+r[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";if(e%100>=20||e>=100&&e%100===0){r=\" de \"}return e+r+i[n]}", "function t(e,t,n){var a={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+a[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";return(e%100>=20||e>=100&&e%100===0)&&(a=\" de \"),e+a+i[n]}", "function get15dayFromNow() {\n return new Date(new Date().valueOf() + 15 * 24 * 60 * 60 * 1000);\n }", "function t(e,t,a){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[a]}", "function e(t,e,n){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function e(t,e,r){var i=\" \";return(t%100>=20||t>=100&&t%100==0)&&(i=\" de \"),t+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[r]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function t(e,t,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+i[n]}", "function getTime2() {\r\n // Don't delete this.\r\n const xmasDay = new Date(\"2021/12/24:00:00:00\");\r\n const today = new Date();\r\n\r\n // total raw value\r\n const totalSec = (xmasDay - today) / 1000;\r\n const totalMin = totalSec / 60;\r\n const totalHour = totalMin / 60;\r\n const totalDay = totalHour / 24;\r\n\r\n const time2 = {\r\n s: totalSec, \r\n m: totalMin, \r\n h: totalHour, \r\n d: totalDay,\r\n };\r\n \r\n // total rounded value\r\n const keys = Object.keys(time2);\r\n const rounded = Object.values(time2).map((v) => Math.floor(v));\r\n\r\n for(i = 0; i < rounded.length; i++) {\r\n time2[keys[i]] = rounded[i];\r\n }\r\n\r\n const {s, m, h, d} = time2;\r\n\r\n // actual value\r\n const sec = s > 60 ? s % 60 : s;\r\n const min = m > 60 ? m % 60 : m;\r\n const hour = h > 24 ? h % 24 : h;\r\n const day = d; \r\n\r\n return `d-day ${day} days ${hour} hrs ${min} mins ${sec} sec`;\r\n}", "function secondAdd(startDate, numSeconds)\r\n{\r\n return dateAdd(startDate,0,0,0,0,0,numSeconds);\r\n}", "function e(t,e,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(t%100>=20||t>=100&&t%100===0)&&(r=\" de \"),t+r+i[n]}", "function e(t,e,n){var i={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},r=\" \";return(t%100>=20||t>=100&&t%100===0)&&(r=\" de \"),t+r+i[n]}", "function t(e,t,n){var o=\" \";return(e%100>=20||e>=100&&e%100==0)&&(o=\" de \"),e+o+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,a){var i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[a]}", "function wrapper(){\nconst date = new Date();\nlet hour = date.getHours();\nconst min = date.getMinutes();\ntoday.textContent = date.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit'\n \n});\nconsole.log(hour);\n\nsetInterval(wrapper, 1000)\n}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}", "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100==0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"}[n]}" ]
[ "0.6154012", "0.6112224", "0.6008657", "0.6002835", "0.5970197", "0.5941444", "0.5928127", "0.59280276", "0.5884373", "0.5884373", "0.5884373", "0.5884373", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58582634", "0.58527863", "0.58527863", "0.5844803", "0.58216166", "0.58216166", "0.58216166", "0.58216166", "0.58041376", "0.576861", "0.57599515", "0.57527196", "0.57476217", "0.5718856", "0.5718856", "0.5718856", "0.5718856", "0.57125884", "0.5706358", "0.57002324", "0.5695502", "0.5695502", "0.5695502", "0.5695502", "0.5695502", "0.56954557", "0.5673293", "0.5670737", "0.5670737", "0.56652457", "0.56629705", "0.5660979", "0.5660979", "0.5660152", "0.56598943", "0.56598943", "0.56598943", "0.56598943", "0.56580275", "0.5656405", "0.56535953", "0.56502986", "0.5619964", "0.56153214", "0.56077313", "0.5607188", "0.5607188", "0.5607188", "0.56009984", "0.5589781", "0.55816966", "0.55816966", "0.5578625", "0.55763566", "0.5570504", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315", "0.55639315" ]
0.0
-1
SOLO PERMITE NUMEROS Y LETRAS
function soloNumerosYLetras(e) { key=e.keyCode || e.which; teclado=String.fromCharCode(key).toLowerCase(); letras="0123456789aábcdeéfghiíjklmnñoópqrstuúvwxyz"; especiales="8-37-38-46-164"; teclado_especial=false; for(var i in especiales) { if(key==especiales[i]) { teclado_especial=true; break; } } if(letras.indexOf(teclado)==-1 && !teclado_especial) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prueba (cuenta){\n\tlet count = cuenta\n\tfor (let i = 0; i < Math.floor(count/2); i++){\n\t\tconsole.log(i)\n\t}\n}", "static calcularPersonas(num){\n for (let i = 0; i < num; i++) {\n personas[i] = new Persona();\n personas[i].getNumero(i + 1);\n }\n }", "function obtenerMenorNumero(numeros){\n let menorNumero = numeros[0];\n for (let i = 0; i<numeros.length ; i++){\n if( numeros[i] < menorNumero){\n menorNumero = numeros[i];\n }\n }\n\n return menorNumero;\n}", "function getPelnas22(pajamos, islaidos){\n var pelnas = pajamos - islaidos;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + pelnas + \"<br>\";\n return pelnas;\n}", "function aleatorios(limite = 1) {\n let r = []\n for (let i = 0; i < limite; i++) {\n r[i] = numeroAlAzar100()\n }\n\n return r\n \n }", "function nbPersMineures (array){\n\t// declaration de la variable personne\t\n\tlet personne = 0;\n\t// pour chaque element au sein du tableau passe en parametre\t\n\tfor (let i =0; i< array.length; i ++){\n\t\t// si l'element < 18 : incrementer personne d'une unite\t\t\n\t\tif (array[i] < 18) {\n\t\t\tpersonne = personne + 1;\n\t\t}\n \n\t} \n\t// sortie de la boucle ...\n\t// on retourne le nb de personnes\n\treturn personne;\n}", "function cantidad_pares_arreglo() {\n\tvar pares = new Number();\n\tvar i = new Number();\n\tvar cantidad = new Number();\n\tvar cantidadpares = new Number();\n\tvar cantidadimpares = new Number();\n\ti = 0;\n\tdocument.write(\"Digite el limete del arreglo: \",'<BR/>');\n\tcantidad = Number(prompt());\n\tvar pares = new Array(cantidad);\n\tfor (i=0;i<=cantidad-1;i++) {\n\t\t// Escribir i+1,\". Digita un numero: \";\n\t\t// Leer pares[i];\n\t\t// numero azar para asignar valores y no pedirlos al usuario\n\t\tpares[i] = Math.floor(Math.random()*100);\n\t\tif (pares[i]%2==0) {\n\t\t\tcantidadpares = cantidadpares+1;\n\t\t} else {\n\t\t\tcantidadimpares = cantidadimpares+1;\n\t\t}\n\t\t// Escribir pares[i];\n\t}\n\tdocument.write(\"Hay un total de: \",cantidadpares,\" numeros pares\",'<BR/>');\n\tdocument.write(\"Hay un total de: \",cantidadimpares,\" numeros impares\",'<BR/>');\n}", "function getPelnas() {\n var pajamos = 12500;\n var islaidos = 7500;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + (pajamos-islaidos) + \"<br>\";\n return pajamos-islaidos;\n}", "function getPelnas() {\nvar pajamos = 12500;\nvar islaidos = 18500;\nvar pelnas = pajamos - islaidos;\nreturn pelnas;\n}", "function pokemones(numeros) {\n for (let i = 1; i <= numeros; i++) {\n traerPokemon(i)\n }\n}", "function soma(nnumero){\r\n let cont = 0;\r\n for (let num of numeros){\r\n cont = cont +num\r\n }\r\n return soma \r\n }", "function Rola(numero, limite) {\n var resultado = 0;\n for (var i = 0; i < numero; ++i) {\n resultado += Math.floor(Math.random() * limite) + 1;\n }\n return resultado;\n}", "function arretNumber() {\n if (this.enCours) {\n this.sonMatricule.stop();\n this.sonAmbiance.fade(0.8 , 1) //Volume son ambiance\n this.sonAmbiance.loop();\n numPrecedent = 10;\n this.enCours = false;\n clearInterval(this.changeNumber);\n // On se bloque sur un matricule connu\n selectMatricule = (this.recupererMatriculeAlea()).toString();\n ordre = (tabMatricule.indexOf(selectMatricule))+1;\n afficherMatricule(selectMatricule);\n }\n}", "Nr(){\n return this.Lj*12/6+1\n }", "function listPrimeNumbers(number){\n const aqui = document.querySelector('.primos');\n const para = document.createElement('p');\n aqui.appendChild(para);\n const dentro = document.querySelector('p');\n dentro.id = \"dentro\";\n for(let i= number; i>1 ; i--){\n \n //const dentro= document.querySelector('.pimos);\n if (isPrime(i)){\n console.log(i);\n \n dentro.textContent += \" \"+i;\n \n \n }\n } \n}", "factorizar(numero){\n let total = 1\n for (let i = 1; i <= numero; i++){\n total = total * i\n }\n return total;\n }", "function calculaRespeito(i){\n let rr = roubosGrupo[i].respeitoR;\n rr = parseInt(rr);\n jogador1.respeito += rr;\n}", "function moyenne (n) {\n\tfor (var i = 0; i < n; i++) {\n\t\tnote = parseInt(prompt(\"Entrez vos notes\"));\n\t\tmoyenne_total = moyenne_total + note;\n\t\tmoyenne_general = moyenne_total/i;\n\t\t\n\t}\n\talert(\"Votre moyenne est de :\" + \" \"+ moyenne_general);\n}", "function potDois(n){\n let potencia = 1\n for(let i=0; i< n;i++){\n potencia = potencia*2\n }\n return potencia\n}", "function descuentoPersonas(precio, personas){\n var descuentoTotal = 0;\n \n if (personas >= 4 && personas <= 6) {\n descuentoTotal = precio * 5;\n }\n if (personas >= 7 && personas <= 8) {\n descuentoTotal = precio * 10;\n \n }\n if (personas > 8) {\n descuentoTotal = precio * 15;\n }\n return descuentoTotal / 100;\n}", "function numbers() {\n //Minimum 5, 2 each side of index...\n var i, min, max, res, cnt = pageCount;\n\n min = $scope.options.index - 4;\n max = $scope.options.index + 4;\n\n if (min < 0) {\n max = max - min;\n min = 0;\n } else if (max >= cnt) {\n min = min - (max - cnt + 1);\n max = cnt - 1;\n }\n if (min < 0) {\n min = 0;\n }\n if (max >= cnt) {\n max = cnt - 1;\n }\n\n res = [];\n for (i = min; i <= max; i++) {\n res.push(i + 1);\n }\n return res;\n }", "function funcion() {\n return numeracion;\n}", "function pasanganTerbesar(num) {\n // you can only write your code here!\n let a = [];\n let b = 0;\n\n for (let i = 0; i <= num.toString().length-1; i++) {\n a.push(num.toString()[i] + num.toString()[i+1]);\n \n }\n b = a.reduce(function(x,y){\n return (x > y) ? x : y;\n });\n\n return Number(b);\n\n}", "function amelioration(){\n return nbMultiplicateurAmelioAutoclick +9;\n}", "function nota_promedio(){\n\t\tvar sum = 0;\n\t\tvar pro = 0;\n\t\tfor(num = 0; num < alumnos.length; num ++){\n\t\t\tsum += (alumnos[num].nota);\n\t\t}\n\t\tpro = sum / 10;\n\t\tdocument.getElementById(\"promedio\").innerHTML = \"El Promedio es: <b>\" + pro.toFixed(2) + \"</b>\";\n\t}", "function sequencia4(num) {\n return 0\n}", "function persistence(num) {\n let points = String(num)\n let result = 0\n let arrForAddAtPoints = []\n let newNumber = 1\n for (let i = 0; i < 10; i++) {\n arrForAddAtPoints = points.split('')\n if (arrForAddAtPoints.length > 1) {\n result++\n for (let j = 0; j < arrForAddAtPoints.length; j++) {\n arrForAddAtPoints = arrForAddAtPoints.map(n => +n)\n newNumber += arrForAddAtPoints[i]\n console.log(newNumber)\n }\n }\n console.log(arrForAddAtPoints)\n }\n\n\n }", "piquesAleatoire() {\n\t\t// position y aleatoire pour 4 piques\n\t\tlet tirage = [];\n\t\twhile (tirage.length < 4) {\n\t\t\tlet nombreAleatoire = Math.round(Utl.aleatoire(4, 12));\n\t\t\tif (tirage.indexOf(nombreAleatoire) === -1) {\n\t\t\t\ttirage.push(nombreAleatoire);\n\t\t\t}\n\t\t}\n\t\treturn tirage;\n\t}", "function marcoPolo(num) {\n for (let i = 1; i < 40; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(`${i} marco polo`);\n } else if (i % 3 === 0) {\n console.log(`${i} marco`)\n } else if (i % 5 === 0) {\n console.log(`${i} polo`);\n } else {\n console.log(`${i} I'm not playing.`)\n }\n }\n }", "function numero(xx) { //recoge el n&uacute;mero pulsado en el argumento.\r\n if (x==\"0\" || xi==1 ) { // inicializar un n&uacute;mero, \r\n pantalla.innerHTML=xx; //mostrar en pantalla\r\n x=xx; //guardar n&uacute;mero\r\n if (xx==\".\") { //si escribimos una coma al principio del n&uacute;mero\r\n pantalla.innerHTML=\"0.\"; //escribimos 0.\r\n x=xx; //guardar n&uacute;mero\r\n coma=1; //cambiar estado de la coma\r\n }\r\n }\r\n else { //continuar escribiendo un n&uacute;mero\r\n if (xx==\".\" && coma==0) { //si escribimos una coma decimal pòr primera vez\r\n pantalla.innerHTML+=xx;\r\n x+=xx;\r\n coma=1; //cambiar el estado de la coma \r\n }\r\n //si intentamos escribir una segunda coma decimal no realiza ninguna acci&oacute;n.\r\n else if (xx==\".\" && coma==1) {} \r\n //Resto de casos: escribir un n&uacute;mero del 0 al 9: \r\n else {\r\n pantalla.innerHTML+=xx;\r\n x+=xx\r\n }\r\n }\r\n xi=0 //el n&uacute;mero est&aacute; iniciado y podemos ampliarlo.\r\n }", "function perimetroCuadrado(lado) {\n return lado * 4; \n}", "function dobro(numero) {\n return numero * 2;\n}", "function perimetroCuadrado(lado) {\n return lado * 4 ;\n}", "function generarAleatorio(valor)\r\n{\r\n return numIdentificacion = Math.floor(Math.random() * ((valor+1) - 0) + 0); \r\n}", "function perimetrocuadrado(lado) {\n return lado * 4;\n}", "function paridispari(numpass) {\n var parDisprisult;\n // dichiaro le condizioni\n if (numpass % 2 === 0) {\n parDisprisult = \"pari\";\n // console.log(somma + \" è pari\");\n } else {\n parDisprisult = \"dispari\"\n // console.log(somma + \" è dispari\");\n }\n return parDisprisult;\n}", "function somaPrimos(num) {\n return 0\n}", "function sequencia3(num) {\n return 0\n}", "function nthNumber(number) {\n let dots = 1\n for (let i = 2; i <= number; i++) {\n dots += i;\n }\n return dots;\n }", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function perimetroCuadrado(lado){\n return lado * 4\n}", "function perimetroCuadrado(lado) {\n return lado * 4; \n}", "function elevar_al_cuadrado(numero)\n{\n return numero * numero;\n}", "function utilizacionDeInstalacion(po, numServ, cadena){\n let cuerpo = po\n for(let i = 0; i < cadena.length; i++){\n let base = ((numServ - (i+1))/numServ) * cadena[i]\n cuerpo += base\n }\n return 1 - cuerpo\n}", "function getPelnas(pajamos, mokesciai, mokesciai2){\nvar pelnas = (pajamos - (pajamos * mokesciai)) - (pajamos - (pajamos * mokesciai)) * mokesciai2;\n return pelnas;\n}", "function sequencia2(num) {\n return 0\n}", "function test06_8(){\n var nb = parseInt(prompt(\"Entrez le nombre de valeurs\"));\n var tab = [];\n var ntf = 0;\n var ptf = 0;\n for (let i = 0; i < nb; i++) {\n var n = parseInt(prompt(\"Entrez une valeur\"));\n tab[i] = n;\n }\n for (let i = 0; i < tab.length; i++) {\n if (tab[i] > 0) {\n ptf ++;\n } else if (tab[i] < 0) {\n ntf ++;\n }\n }\n console.log(\"Nombre de valeurs positives : \" + ptf);\n console.log(\"Nombre de valeurs négatives : \" + ntf);\n}", "function fatorial(numero) {\n return 0\n}", "function sequencia1(num) {\n return 0\n}", "function selecaoLivro(i, livros) {\n\n\n //Variavel para armazenar a quantidade de incones de estrelas de acordo com a nota do livro \n let qntEstrelas = ''\n //Quantas estrelas inteiras o livro tem \n for (var j = 1; j < livros[i][2]; j++) {\n console.log(j)\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n console.log(qntEstrelas)\n }\n\n //Se a nota do livro tiver parte decimal...\n if (livros[i][2] % 1 != 0) {\n //Se a parte decimal for maior do que 0,5 o livro ganha uma estrela completa(arredonda pra cima)\n if (livros[i][2] % 1 > 0.5) {\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n //Se não o livro ganha meia estrela\n } else {\n qntEstrelas += `\n <img src=\"icones/star-half-full.svg\" alt=\"icone de strela quase cheia\">\n `\n console.log(qntEstrelas)\n }\n } else {\n //Atribuindo a estrela caso livro não tenha parte decimal\n //A ultima estrela é atribuida depois para que caso o livro tenha parte decimal ela não seja atribuida 2 vezes\n //Uma pela parte decimal no for\n //E outra na validação se a parte decimal é maior que 0.5(Estrela interia), ou menor ou igual(Meia estrela)\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n }\n\n //Pagina do livro pra detalhes\n //Não troca de pagina para entrar em detalher a pagina apenas alteras suas infos\n let paginaCompleta = `\n\n <div class=\"root\">\n <div class=\"livroEscolido\">\n <div>\n <img src=${livros[i][6]}>\n </div>\n <div class=\"centralize\">\n <div>\n <div>\n <h3>${livros[i][0]}</h3>\n <h3>${livros[i][1]}</h3>\n </div>\n <p>\n ${livros[i][5]}\n </p>\n <h4>${livros[i][4]}</h4>\n\n <div class=\"addLista\">\n <button id=\"${i}\" onclick=\"inserirLivro(this.id, minhaLista)\">Adicionar á minha lista</button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"detalhes\">\n <header class=\"titulo\">\n <a href=\"index.html\">\n <img class=\"retorno\" src=\"icones/arrow-left-circle.svg\">\n </a>\n <img class=\"logo\" src=\"imagens/logotipo.png\">\n </header>\n\n <div>\n <div>\n <h1>${livros[i][0]} - ${livros[i][1]}</h1>\n </div>\n <div>\n <div class=\"areaAvaliacao\">\n `\n //Definindo cor do quadrado de avaliação \n if (livros[i][2] >= 3.5) {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota verde\">${livros[i][2]}</div>\n `} else if (livros[i][2] > 1.5 && livros[i][2] < 3.5) {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota amarelo\">${livros[i][2]}</div>\n `} else {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota vermelho\">${livros[i][2]}</div>\n `}\n\n paginaCompleta = paginaCompleta + `\n <div class=\"avaliacao\">\n <div>\n ${qntEstrelas}\n </div>\n <p>\n ${livros[i][3]} avaliações\n </p>\n </div>\n </div>\n\n <div class=\"resenha\">\n <h3>Resenha</h3>\n <p>\n ${livros[i][7]}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n <script type=\"text/javascript\" src=\"funcoes.js\"></script>\n </script>\n\n \n `\n //Esperando transição de tela\n setTimeout(function () {\n //Chamando função reponsavel pela atualização dos dados da pagina \n criarPagina(paginaCompleta)\n }, 1000);\n}", "function genera_parametros(){\r\n\tx_0=103;\r\n\tm=1001;\r\n\tprimos.forEach(a=>{\r\n\t\tprimos.forEach(c=>{\r\n\t\t\tnum_ale = generador_mixto(a,c,x_0,m)\r\n\t\t\tif(num_ale.length == m){ //tambien deberia revisar si hay numeros repetidos\r\n\t\t\t\timprimir_configuracion_parametros_a_pantalla\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function prix() {\n return 50 * (nbMultiplicateur * nbMultiplicateur * 0.2);\n}", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function calcularPromedio() {\n const notas = [];\n let suma = 0;\n const notaParcial1 = prompt('Ingrese nota del primer parcial');\n const notaParcial2 = prompt('Ingrese nota del segundo parcial');\n const notaProyectoFinal = prompt('Ingrese nota del proyecto final');\n\n notas.push(notaParcial1);\n notas.push(notaParcial2);\n notas.push(notaProyectoFinal);\n\n for (let indice = 0; indice < notas.length; indice++) {\n // const element = notas[indice];\n suma = suma + parseInt(notas[indice]);\n }\n\n const promedio = suma / notas.length;\n\n if (promedio >= 6) {\n console.log('Aprobó la materia');\n } else {\n console.log('Desaprobó la materia 😣');\n }\n\n console.log(notas);\n\n}", "function perimetroCuad(lado){\n return lado * 4;\n}", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }", "function perimetroCuadrado(lado){\n return lado*4;\n}", "function CalcularDigito(strGrupo) {\n var arrPeso = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2];\n var intSoma = 0;\n var intDigito = 0;\n\n for (x = strGrupo.length - 1, intDigito; x >= 0; x--) {\n intDigito = parseInt(strGrupo.substring(x, x + 1));\n intSoma += intDigito * arrPeso[arrPeso.length - strGrupo.length + x];\n }\n\n intSoma = 11 - intSoma % 11;\n return intSoma > 9 ? 0 : intSoma;\n}", "function calculadora() {\n for (let i = 0; i < resultados.length; i++) {\n if (num.length > 1) {\n switch (i) {\n case 0:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 + num[j] * 1;\n }\n // Suma\n console.log(`El valor de la suma es: ${resultados[i]}`);\n break;\n case 1:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 - num[j] * 1;\n }\n // Resta\n console.log(`El valor de la resta es ${resultados[i]}`);\n break;\n case 2:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] *= num[j];\n }\n // Multiplicación\n console.log(`El valor de la multiplicación es ${resultados[i]}`);\n break;\n case 3:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] /= num[j];\n }\n // División\n console.log(`El valor de la división es ${resultados[i].toFixed(2)}`);\n break;\n case 4:\n resultados[i] = \"Sin Raiz cuadrada.\";\n // Sin raiz cuadrada\n console.log(\n `Al introducir dos o más valores numericos correctos la Raiz cuadrada no se ha calculado`\n );\n break;\n default:\n break;\n }\n } else if (num.length === 1) {\n resultados[4] = Math.sqrt(num[0]);\n // Raiz cuadrada\n console.log(`Solo se ha introducido un valor valido.`);\n console.log(\n `El valor de la raiz cuadrada es ${resultados[4].toFixed(2)}`\n );\n\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n } else {\n console.log(`No se han introducido numeros validos`);\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n }\n }\n}", "function perimetroTriangulo(ladoTriangulo){\n return ladoTriangulo * 3;\n}", "function celNumbers() {\n let cant = document.getElementById('numero').value;\n var txt = document.getElementById('txt');\n var numeros = [];\n txt.value = \"\";\n\n for(let x = 0; x < cant; x++){\n numeros[x] = \"9\" + lada[aleatorio(22)];\n for(let y = 0; y < 6; y++){\n numeros[x] += \"\" + aleatorio(9);\n }\n txt.value += numeros[x] + \"\\n\";\n }\n}", "function porEstuSupePuntos(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n var sumaHse=0;\n var sumaTech=0;\n var total=0;\n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n var tech=generacion.students[i]['sprints'][j]['score']['tech'];\n var hse=generacion.students[i]['sprints'][j]['score']['hse'];\n\n sumaTech+=tech;\n sumaHse+=hse;\n }\n\n if((sumaHse/j)>840 && (sumaTech/j) >1260){\n sumaScore++;\n }\n var porcentaje=parseInt((sumaScore*100)/generacion.students.length);\n \n }\n return (porcentaje);\n}", "function NumPar(par){\n \n for (let i = 1; i <= par; i++){ \n console.log(i) \n }\n return 'Done!'\n }", "function agregaNumerosArreglo(cadenaNumeros){//Recibe nuestra cadena de numeros\n let contador = 0;\n let par_num = \"\";\n let longuitud_cadena = 0;\n const lengthC = cadenaNumeros.length;//longuitud de nuestra cadena recibida\n \n for (let numero of cadenaNumeros) {//recorremos nuestro mensaje \n if(contador === 2){//si mi contador es === 2 ya tenemos un par de numeros asi que lo agregamos a nuestro arreglo\n contador = 1;//inicializamos el contador en 1 porque si no se salta 1 numero\n arr_numeros.push(par_num);//agregamos el par de numeros que tenemos a nuestro arreglo\n par_num = \"\" + numero; //le damos a nuestra variable el valor de la letra actual \n longuitud_cadena ++;\n }else{//contador menor a 2\n longuitud_cadena++\n par_num = par_num + numero;//concatenamos lo que tenemos en par_num con nuestro numero actual\n contador++;\n //para evitar que no agregue el ultimo par de numeros nos apoyamos de longuitud_cadena\n //al final de todo el recorrido tendremos longuitudes iguales por lo que el ultimo numero se agregara\n if (longuitud_cadena === lengthC) {\n arr_numeros.push(par_num);\n }\n }\n }\n \n return arr_numeros;//regresamso nuestro arreglo de numeros\n}", "function porSupePuntosTech(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n \n var sumaTech=0;\n \n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n var tech=generacion.students[i]['sprints'][j]['score']['tech']; \n\n sumaTech+=tech;\n \n }\n\n if((sumaTech/j) >1260){\n sumaScore++;\n }\n var porcentaje=parseInt((sumaScore*100)/generacion.students.length);\n \n }\n return (porcentaje);\n}", "function montaConjuntos(){\r\n\treturn quantidadeDeLinha() / valorDeN();\r\n}", "function ordenadaPorPropiedadNumerica(lista,propiedad) {\n\treturn lista.sort(function (a,b) { return a[propiedad]-b[propiedad]; })\n}", "function AjPoFo() {\r\n \r\n if (perso.Por < 2) { //Test si assez d'argent\r\n alert(\"Vous n'avez pas assez d'argent\");\r\n console.log(\"Pas assez d'argent / nombre de potion = \"+ perso.Pinv[0]);\r\n } else {\r\n perso.Por -= 2; //Or du perso -2\r\n perso.Pinv[0] += 1; //Nombre de potion +1 \r\n document.getElementById('or').value = perso.Por; //affiche Or du perso dans la div caracteristique\r\n document.getElementById('nbPoFo').value = perso.Pinv[0]; //affiche le nombre de potion\r\n console.log(\"Achat d'une potion de force / nombre de potion = \"+ perso.Pinv[0]);\r\n }\r\n\r\n}", "function supePuntosTech(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n \n var sumaTech=0;\n \n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n var tech=generacion.students[i]['sprints'][j]['score']['tech']; \n\n sumaTech+=tech;\n \n }\n\n if((sumaTech/j) >1260){\n sumaScore++;\n }\n //var porcentaje=parseInt((sumaScore*100)/i);\n \n }\n return (sumaScore);\n}", "function ejercicio2(){\n let numero3=prompt(\"Ingresa un número entre 10 y 100\")\n if (numero3>9 && numero3<101 ){\n if (numero3==10)\n console.log(\"Debe ingresar un número mayor a 10 para que tenga pares\")\n else{\n console.log(`Número ingresado: ${numero3}`)\n for (let x=10; x<numero3;x++){\n if (x%2==0){\n console.log(x)\n }\n }\n }\n }\n else\n console.log(\"El número ingresado fue erroneo\")\n}", "function numeroPerfecto(numero){\n let divisores = 0;\n\n if (numero < 0) {\n alert(\"no se admiten numeros negativos\");\n return;\n }\n\n if (numero.length >= 9) {\n alert(\"este numero es muy largo y demora mucho en procesar, te recomiendo mirar los otros ejemplos\")\n return;\n }\n // al agregar el diferente de nulo si se ingresa la letra (E) valida el campo numerico\n // al quitar esta comparacion no valida el campo numerico\n if (divisores == 0 && numero == null || numero == \"\") {\n alert(\"valor no permitido\");\n return;\n }\n for (let i = 1; i <= numero / 2; i++) {\n if (numero % i == 0) {\n //captura los divisores\n divisores +=i;\n }\n if (divisores == numero) {\n alert(`el numero ${numero} es perfecto`);\n return;\n\n }\n }\n if (numero != divisores) {\n alert(`el numero ${numero} no es perfecto`);\n return;\n\n }\n}", "function numProFilas(intesidad, numServ, po){\n return ((intesidad**(numServ+1)) * po)/(factorial(numServ - 1) * (numServ - intesidad)**2)\n}", "function dans_sequence(number) {\n var array = [];\n var newNumber;\n for(var i = number * 2; i < number + 38; i += 2){\n if(i > number * 10){\n var newNumber = i / 4;\n } else {\n newNumber = i;\n }\n array.push(newNumber);\n }\n return array;\n}", "function calculaPotencia(base, expoente){\n let acumulador = 1;\n for(let i= 1; i<=expoente; i++){\n acumulador = acumulador * base;\n }\n return acumulador;\n}", "function calcNiveau(){\r\n var ancienNiveau = perso.niveau\r\n while (perso.exp > perso.levelLimit){\r\n perso.exp = perso.exp - perso.levelLimit\r\n perso.levelLimit = Math.round(perso.levelLimit * 1.5)\r\n perso.niveau++\r\n niveauPlus = true\r\n gainDeNiveau()\r\n }\r\n\r\n if (niveauPlus){\r\n var message = \"Aurora a gagné \" + (perso.niveau - ancienNiveau) + \" niveau !!!\"\r\n niveauPlus = false\r\n }else {\r\n var message = \"aurora a gagné \" + perso.exp + \" pts d'experience\"\r\n }\r\n return message\r\n}", "LanzarBomba(num){\n return this.bomba[num];\n\n }", "function promedioAndMedia(list){\n let sum = 0;\n let numbers = list.length;\n //orden\n for(i=0;i<numbers-1; i++){\n for(j=i+1;j<numbers; j++){\n if(list[i]>list[j]){\n let temp = list[i];\n list[i]=list[j];\n list[j]=temp;\n }\n }\n }\n console.log('Lista ordenada');\n console.log(list);\n \n //media\n console.log('Media');\n if(list%2!=0){\n console.log(list[parseInt(numbers/2)]);\n }else{\n console.log(list[parseInt(numbers/2)-1]+list[parseInt(numbers/2)]/2)\n }\n\n console.log('Promedio');\n //Promedio\n for(i=0;i<list.length;i++){\n sum += list[i];\n }\n console.log(sum/numbers);\n}", "function incrementwood()\n{\n\tif(nbwood>=princrementwood)\n\t{\n\t\tinbwood++; /*incrément compteur*/\n\t\tnbwood=nbwood-princrementwood; /*déduit le prix*/\n\t\tprincrementwood=princrementwood+(nb*2);\n\t\tprincrementwood10=princrementwood*10;\n\t\tprincrementwood100=princrementwood*100;\n\t\tgestionwood.innerHTML=nbwood;\n\t\tincrementationwood.innerHTML=princrementwood;\n\t\tincrementationwood10.innerHTML=princrementwood*10;\n\t\tincrementationwood100.innerHTML=princrementwood*100;\n\t\tconsole.log(princrementwood);\n\t}\n\telse\n\t{\n\t\talert(\"La maison fait pas crédit\");\n\t}\n}", "function calcTabuada(numero) {\n console.log(\"===========================\");\n if (isNaN(numero)) { //tratamento para o input, se for NaN, o código nao executará\n console.log(\"ERRO! Por favor, digite apenas números inteiros.\");\n } else {\n for (numeroEscolhido = 1; numeroEscolhido <= numero; numeroEscolhido++) {\n console.log(`A tabuada do número ${numeroEscolhido} é: `);\n\n for (index = 1; index <= 10; index++) {\n\n console.log(`${index} * ${numeroEscolhido} é igual a: ${index*numeroEscolhido}`);\n }\n\n console.log(\"===========================\");\n }\n }\n}", "function pariDispari(totale){\n let pari = null;\n if (totale % 2 === 0){\n pari = true;\n }else pari = false;\n console.log('la somma è pari? ',pari);\n return pari;\n}", "function perimetroTiangulo(lado1,lado2,base) { \n return lado1+lado2+base; \n }", "function arreglar(numero){\n var numeroo=\"\";\n numero=\"\"+numero;\n partes=numero.split(separadorDecimalesInicial);\n entero=partes[0];\n if(partes.length>1)\n {\n decimal=partes[1];\n }\n cifras=entero.length;\n cifras2=cifras\n for(a=0;a<cifras;a++){\n cifras2-=1;\n numeroo+=entero.charAt(a);\n if(cifras2%3==0 &&cifras2!=0){\n numeroo+=separadorMiles;\n }\n }\n if(partes.length>1){\n numeroo+=separadorDecimales+decimal;\n }\n return numeroo\n }", "function aleatorio(minimo, maximo){\n\tvar Numero= Math.floor(Math.random() * (maximo - minimo + 1) + minimo );\n\treturn Numero;\n}", "function auxNaipes(promedio) {\n let simbolo;\n\n if(promedio > 0 && promedio <= 19) \n simbolo = 'A';\n else if(promedio >= 20 && promedio <= 38) \n simbolo = 'B';\n else if(promedio >= 39 && promedio <= 57) \n simbolo = 'C';\n else if(promedio >= 58 && promedio <= 76) \n simbolo = 'D';\n else if(promedio >= 77 && promedio <= 95) \n simbolo = 'E';\n else if(promedio >= 96 && promedio <= 114) \n simbolo = 'F';\n else if(promedio >= 115 && promedio <= 133) \n simbolo = 'G';\n else if(promedio >= 134 && promedio <= 152) \n simbolo = 'H';\n else if(promedio >= 153 && promedio <= 171) \n simbolo = 'I';\n else if(promedio >= 172 && promedio <= 190) \n simbolo = 'J';\n else if(promedio >= 191 && promedio <= 209) \n simbolo = 'K';\n else if(promedio >= 210 && promedio <= 228) \n simbolo = 'L';\n else if(promedio >= 229 && promedio <= 256) \n simbolo = 'M';\n return simbolo;\n\n}", "function tenList(list, p, valor) {\n var list = sendMap(list, p, valor);\n var N = list.length;\n var last = list[0];\n for (var i = 1; i <= N; i++) {\n if ((i / N) <= p) {\n last = list[i - 1];\n }\n }\n\n return last;\n }", "function numero (x){\n\n\tvar x1 = x%10;\n\tx = Math.floor(x/10);\n\tvar x2 = x%10;\n\tx = Math.floor(x/10);\n\tvar x3 = x%10;\n\tx = Math.floor(x/10);\n\n\tconsole.debug(x1*1000+x2*100+x3*10+x);\n\t\n}", "function calcularNotaMenor(){\n var indiceNotaMenor = 0;\n var notaMenor = estudiantes[indiceNotaMenor].nota;\n\n for(var i = 1; i < estudiantes.length; ++i){\n if(estudiantes[i].nota < notaMenor){\n notaMenor = estudiantes[i].nota;\n indiceNotaMenor = i;\n }\n }\n\n alert(\"El estudiante \" + estudiantes[indiceNotaMenor].nombre + \" tiene la nota menor: \" + notaMenor);\n}", "vendingMachine(amount){\n var notes_arr = [1000, 500, 100, 50, 20, 10, 5, 2, 1];\n var notes_counters =[];\n\n for (let i = 0; i < 9; i++) {\n if (amount>=notes_arr[i]) {\n notes_counters[i] = Math.floor(amount/notes_arr[i]);\n if (notes_counters[i]!=0) {\n console.log('Number of notes of ', notes_arr[i], 'RS are ', notes_counters[i]);\n }\n amount = amount - (notes_counters[i] * notes_arr[i]); \n }\n \n }\n }", "function main() {\n var n = parseInt(readLine());\n arr = readLine().split(' ');\n arr = arr.map(Number);\n\n let neg = 0;\n let pos = 0;\n let zero = 0;\n\n arr.forEach(ele => {\n if (ele < 0) {\n neg++\n } else if (ele > 0){\n pos++\n } else {\n zero++\n }\n })\n neg = (neg / n)\n pos = (pos / n)\n zero = (zero / n )\n\n console.log( pos.toFixed(6) )\n console.log( neg.toFixed(6) )\n console.log( zero.toFixed(6) )\n\n}", "function print_don() {\n // quando il metodo mi deve ritornare qualcosa per prima cosa inizializzo la variabile e in fondo\n // metto il \"return nomevariabile;\"\n let text = \"\";\n\n //let miosaldo = 0;\n\n //let maxver = 0;\n\n\n for (i = 0; i < ar_numeri.length; i++) {\n // In questo modo tutte le linee vengono generate con uno span con un id univoco, quindi possono essere gestiti anche singolarmenti\n text += \"<span id'don\" + i + \"'>\" + ar_numeri[i]+\"</span><br/>\";\n\n }\n\n\n return text;\n}", "function lastpris (n, m, s) {\n\treturn (m + s - 2) % n + 1;\n}", "function getNumberFour (valor){ \n let posiciones = []; \n for(let i in valor){\n if(valor[i]===4) posiciones.push(i)\n }\n return posiciones\n }", "function presionarNumero(numero){\n console.log(\"numero\",numero)\n\n calculadora.agregarNumero(numero)\n actualizarDisplay()\n}", "getNumber(i, j){\r\n return this.numbers[(i-1)*9 + (j-1)];\r\n }", "function porEstuSupePuntosHse(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n var sumaHse=0;\n \n \n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n \n var hse=generacion.students[i]['sprints'][j]['score']['hse'];\n\n sumaHse+=hse;\n }\n\n if((sumaHse/j)>840){\n sumaScore++;\n }\n var porcentaje=parseInt((sumaScore*100)/generacion.students.length);\n \n }\n return (porcentaje);\n}", "function promedio_uno(){\n\tfor(i=0;i<8;i++){\n\t\tnumero = Number(prompt(\" ingresa tu número \" + (i+1)));\n\t\tsumaUno = sumaUno + numero; // Se almacena la sumaUno\n\t\tdocument.getElementById(\"p4_1\").innerHTML = \"el promedio de tus números es \" + (sumaUno/8);\n\t}\n}", "function sommaAndCheck(randomNumberUtente, randomNumberPc) {\n\n const sommaNumbers = randomNumberUtente + randomNumberPc;\n\n console.log(sommaNumbers);\n\n return sommaNumbers;\n}", "function listajDugme(n) {\n prikaziSliku(brojac += n);\n}" ]
[ "0.6312876", "0.6282274", "0.6221495", "0.6188213", "0.61739534", "0.6153155", "0.61523765", "0.61437905", "0.61432016", "0.61420697", "0.61256427", "0.6095237", "0.60733646", "0.6068727", "0.60428715", "0.60334027", "0.5999061", "0.59936327", "0.5982467", "0.5975057", "0.59591275", "0.5957463", "0.5951932", "0.5950826", "0.5944143", "0.5920915", "0.5918866", "0.5908946", "0.5895918", "0.58770347", "0.5869173", "0.5852278", "0.58507884", "0.5836971", "0.5833546", "0.583012", "0.582966", "0.5828676", "0.5826704", "0.58224237", "0.5814424", "0.5813332", "0.5811114", "0.58048713", "0.5801621", "0.57845414", "0.57838863", "0.5771859", "0.57653904", "0.5755737", "0.57517606", "0.5745756", "0.57444984", "0.57444984", "0.57444984", "0.57444984", "0.57395375", "0.5736919", "0.5731457", "0.5728879", "0.57270646", "0.5724705", "0.57222956", "0.5711685", "0.5711672", "0.5703664", "0.57015365", "0.5698401", "0.56881154", "0.5686276", "0.5681679", "0.56741357", "0.56673926", "0.56651175", "0.5637979", "0.56368405", "0.5633194", "0.5632202", "0.5630912", "0.5629532", "0.5626525", "0.5624963", "0.56246597", "0.56237596", "0.5623227", "0.5618393", "0.561271", "0.5610132", "0.5609179", "0.5608695", "0.5599468", "0.55929923", "0.5574084", "0.55735075", "0.5572762", "0.55681163", "0.5564245", "0.5554057", "0.5552708", "0.5546663", "0.5546427" ]
0.0
-1
SOLO PERMITE LETRAS CON ESPACIOS
function letrasYEspacios(e) { key=e.keyCode || e.which; teclado=String.fromCharCode(key).toLowerCase(); letras=" aábcdeéfghiíjklmnñoópqrstuúvwxyz"; especiales="8-37-38-46-164"; teclado_especial=false; for(var i in especiales) { if(key==especiales[i]) { teclado_especial=true; break; } } if(letras.indexOf(teclado)==-1 && !teclado_especial) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quitaEspacios(mensaje){\n mensaje = mensaje.toUpperCase();//hacemos que nuestra frase solo este en mayusculas\n let mensajeSinESpacio = \"\";\n for (letra of mensaje){//recorremos todo nuestro string\n if (letra !== \" \") {//si el caracter en esa iteracion no es un espacio en blanco \n mensajeSinESpacio = mensajeSinESpacio + letra;//se agrega a nuestra variable mensajeSinEspacio\n }\n }\n\n return mensajeSinESpacio;//REGRESA LA ORACION SIN ESPACIOS\n}", "function partes_relacion(expresion) {\n\tvar objeto = [];\n\tvar text = \"\";\n\tvar partes = \"\";\n\tvar hacer = false;\n\n\tfor (var i = 0; i < expresion.length; i++) \n\t{\n\t\t/*\n\t\t\tcuando encuentra un partesis derecho parte por comas el text acomulado\n\t\t\ty guarda en el arreglo un object con atributo izquierda y derecha y vacia el text\n \t\t*/\n\t\tif(expresion.charAt(i)===')')\n\t\t{\n\t\t\thacer = false;\n\t\t\tpartes = text.split(\",\");\n\t\t\tobjeto.push({izquierda:partes[0],derecha:partes[1],valor:partes[2]});\n\t\t\ttext = \"\";\n\n\t\t}\n\t\t//cuando encuentra parentesis izquierdo habilita hacer para guardar el acomulado de string\n\t\tif(expresion.charAt(i)==='(')\n\t\t{\n\t\t\ti++;\n\t\t\thacer = true;\n\t\t}\n\t\t//guarda texto acomulado\n\t\tif(hacer)\n\t\t{\n\t\t\ttext = text + expresion.charAt(i);\n\t\t}\n\t}\t \n\t return objeto; \n}", "separarCaracteres(){\r\n let cadena = this.objetoExpresion();\r\n for(let i = 0; i <= cadena.length-1; i++){\r\n this._operacion.addObjeto(new Dato(cadena.charAt(i)));\r\n }\r\n //Hace el arbol mediante la lista ya hecha \r\n this._operacion.armarArbol();\r\n //Imprime el orden normal \r\n this.printInfoInOrder();\r\n }", "function mostrarPista(espacio){\n\tvar pista = document.getElementById('pista');\n\tvar texto = '';\n\n\tfor (var i = 0; i < espacio.length; i++) {\n\t\tif (espacio[i] !== undefined){\n\t\t\ttexto += espacio[i] + ' ';\n\t\t} else {\n\t\t\ttexto += '_ ';\n\t\t}\n\t}\n\n\tpista.innerText = texto;\n}", "function coisar() {\n var nome = document.getElementById(\"nomao\").value;\n var pos = 0;\n var primPalavra;\n var pNomes = [];\n var posVetor = 0;\n console.log(\"Li o nome = \" + nome);\n console.log(\"Tamanho da palavra = \" + nome.length);\n\n\n console.log(\"O primeiro espaco em branco esta na posicao \"+pos);\n while (pos >= 0){\n primPalavra = nome.slice(0, pos);\n console.log(\"Extraida a palavra = \"+primPalavra);\n nome = nome.slice(pos+1);\n pos = nome.indexOf(\" \");\n }\n primPalavra = nome;\n console.log(\"Extraida a palavra = \"+primPalavra);\n\n console.log(palavras);\n}", "function getImonesPelnas( ) {\n let ats = imonesPajamos - imonesIslaidos - tomoAtlyginimas - antanoAtlyginimas - poviloAtlyginimas;\n return ats;\n}", "function partes_relacion(f,g) {\n\tvar objeto = [];\n\tvar text = \"\";\n\tvar hacer = false;\n\tfor (var i = 0; i < f.length; i++){\n\t\tif(f.charAt(i)==')')\n\t\t{\n\t\t\thacer = false;\n\t\t\tvar partes = text.split(\",\");\n\t\t\tobjeto.push({de:partes[0],a:partes[2],entrada:partes[1],salida:\"n\"});\n\t\t\ttext = \"\";\n\n\t\t}\n\t\tif(f.charAt(i)=='(')\n\t\t{\n\t\t\ti++;\n\t\t\thacer = true;\n\t\t}\n\t\tif(hacer)\n\t\t{\n\t\t\ttext = text + f.charAt(i);\n\t\t}\n\t}\n\tfor (var i = 0; i < g.length; i++){\n\t\tif(g.charAt(i)==')')\n\t\t{\n\t\t\thacer = false;\n\t\t\tvar partes = text.split(\",\");\n\t\t\tobjeto[buscar(objeto,partes[0],partes[1])].salida = partes[2];\n\t\t\ttext = \"\";\n\t\t}\n\t\tif(g.charAt(i)=='(')\n\t\t{\n\t\t\ti++;\n\t\t\thacer = true;\n\t\t}\n\t\tif(hacer)\n\t\t{\n\t\t\ttext = text + g.charAt(i);\n\t\t}\n\t}\n \treturn objeto; \n\n\tfunction buscar(arr,de,entrada){\n\t\tfor (var i=0;i<arr.length;i++) {\n\t\t\tif(arr[i].de==de && arr[i].entrada==entrada)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn -1;\n\t}\n}", "function nombre_mes(mes) {\r\n let m_l = meses[mes].length;\r\n let linea = ' '.repeat(11 - Math.floor(m_l / 2)) + meses[mes];\r\n linea = linea + ' '.repeat(22 - linea.length) + '|';\r\n return linea;\r\n}", "function escolta () {\r\n text = this.ant;\r\n if(this.validate) {\r\n \tthis.capa.innerHTML=\"\";\r\n index = cerca (this.paraules, text); \r\n if (index == -1) {\r\n this.capa.innerHTML=this.putCursor(\"black\");\r\n }\r\n else {\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula;\r\n this.putSound (this.paraules[index].so);\r\n }\r\n }\r\n \r\n\r\n}", "gEspacio(palabra){\n if(palabra==\" \"){\n palabra=\"_\"\n }\n return palabra\n }", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n \n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n \n return string;\n }", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n \n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n \n return string;\n }", "function retroceso(e) {\n\n\n let tamano = campoDatos.value.length;\n let borrado = campoDatos.value.slice(0, tamano - 1);\n campoDatos.value = borrado;\n\n /**VALIDAMOS QUE CUANDO BORREMOS CON EL BOTON RETROCESO DE LA \n * CALCULADORA LA CANTIDAD DE PARENTESIS SE VAYA SUMANDO O RESTANDO PARA QUE \n * SIGA EL FLUJO NORMAL DE LA ESCRITURA DE PARENTESIS*/\n let listOpenParent = [];\n let listCloseParent = [];\n\n for (let i = 0; i < campoDatos.value.length; i++) {\n\n if (campoDatos.value[i] == \"(\") {\n listOpenParent.push(i);\n } else if (campoDatos.value[i] == \")\") {\n listCloseParent.push(i);\n }\n\n }\n aperturaParen = listOpenParent.length;\n cierreParen = listCloseParent.length;\n /**----------------------------------------------------------\n * CIERRE DE VALIDACION DE PARENTESIS \n * ---------------------------------------------------------*/\n}", "function pintarGuiones(num) {\r\n for (var i = 0; i < num; i++) {\r\n oculta[i] = \"_\";\r\n }\r\n console.log(oculta)\r\n hueco.innerHTML = oculta.join(\"\"); //me escribe en el html la cadena la cual contiene las lineas azules depende de la palabra\r\n}", "function ocultaPalabra() \n{ \n var _cadenas = \"\"; // creamos un string vacio\n for (var i=0 ; i<palabra.length ; i++) // recorremos la palabra secreta\n _cadenas += \"*\"; // por cada elemento lo cambia por el *\n return _cadenas;// retornamos\n}", "function comprueba(letra){\n document.getElementById(letra).setAttribute(\"style\",\"visibility: hidden;\");\n var letraAcertada=false;\n for (var i = 0; i < secreta.length; i++) {\n if (letra==secreta.charAt(i)) {\n letraAcertada=true;\n muestra = muestra.substring(0, i) + secreta.charAt(i) + muestra.substring(i+1, muestra.length);\n document.getElementById(\"secreta\").innerHTML=muestra;\n }\n }\n if (!letraAcertada) {\n intentos--;\n }\n dibujaMuerto();\n finalizaPartida();\n}", "function listaEstados(){\n\tvar estados = document.getElementsByName('perfil')[0];\n\tfor(i=0;i<estados.options.length;i++){\n\t\testados.options[i].innerHTML.split(\"PRIMARIO_\")[1];\n\t\tards[i]\n\t}\n}", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n\n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n\n return string;\n }", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n\n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n\n return string;\n }", "function aviso_CEP(campo, escolha){\r\r\n\r\r\n //TEXTO SIMPLES\r\r\n var label = document.createElement(\"label\")\r\r\n\r\r\n //ESCOLHENDO O TIPO DE AVISO\r\r\n if (escolha == 1 ){ \r\r\n\r\r\n //TEXTO DE AVISO DE OBRIGATORIO\r\r\n var text = document.createTextNode(\"Preenchimento Obrigatório\")\r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep\"\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n else if (escolha == 2){ \r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep1\"\r\r\n\r\r\n //TEXTO DE AVISO DE INVÁLIDO\r\r\n var text = document.createTextNode(\"CEP inválido!\")\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n\r\r\n //REFERENCIA DE ONDE SERA COLOCADO O ITEM\r\r\n var lista = document.getElementsByTagName(\"p\")[5]\r\r\n var itens = document.getElementsByTagName(\"/p\") \r\r\n\r\r\n //INSERINDO O AVISO EM VERMELHO\r\r\n lista.insertBefore( label, itens[0]);\r\r\n label.style.color = \"red\";\r\r\n\r\r\n //MUDANDO O BACKGROUND\r\r\n erro(campo)\r\r\n}", "function Cpalabras (cadena){\n var numerop = cadena.split(\" \").length;\n return (\"2.- Palabras: \"+numerop);\n}", "function Cletras (cadena){\n var numeroL = eliminarespacios(cadena).length;\n return (\"3.- Numero de Letras: \"+numeroL);\n}", "function segitiga(n, posisi){\n\n\n let deret = ''\n\n if(posisi == 'bawah'){\n\n for(let i = 1 ; i <= n ; i++){\n for(let j = 0 ; j < i ; j++){\n\n deret += '*'\n\n }\n\n if( i !== n ){\n\n \n deret += '\\n'\n\n\n }\n }\n\n\n }\n\n\n\n else if(posisi == 'atas'){\n\n\n for(let i = 1 ; i <= n ; i++){\n \n for(let j = 1 ; j <= i ; j++){\n\n deret += ' '\n\n }\n \n for(let k = n ; k >= i ; k--){\n\n deret += '*'\n\n }\n\n if( i !== n ){\n\n \n deret += '\\n'\n\n\n }\n\n }\n\n\n }\n\n\n\n return deret\n\n\n\n}", "function ir_para( direcao, seletor ){\n\t\tif( ( seletor.find( '.sub-section' ).length > 0 ) ){\n\t\t\t// Se for pai de uma sub-section\n\t\t\t// percorre a subsection ao invez da section pai\n\t\t\tseletor = seletor.find( '.sub-section.ativo' );\n\t\t\tir_para( direcao, seletor );\n\t\t}else {\n\t\t\t// remove as classes de controle de animação\n\t\t\tjQuery( '.forward, .backward ,.reverse' ).removeClass( 'forward' ).removeClass( 'backward' ).removeClass( 'reverse' );\n\t\t\tif( direcao == 'seguinte' ){\n\t\t\t\tif( seletor.hasClass( 'sub-section' ) && ( seletor.next().length == 0 ) ){\n\t\t\t\t\t// se for o último item avança para a proxima section\n\t\t\t\t\tseletor = seletor.parents( 'section' );\n\t\t\t\t}\n\t\t\t\tseletor.addClass( 'forward' ).removeClass( 'ativo' ).next().addClass( 'ativo' );\n\n\t\t\t\tif ($('.resultado').hasClass('ativo')) {\n\n\t\t\t\t\t$('.page-calculadora-btu__container').addClass('is--active');\n\t\t\t\t}\n\n\t\t\t}else if( direcao == 'anterior' ){\n\t\t\t\t// 1- verificamos se existe um palco antes\n\t\t\t\t// caso tenha, voltamos para a section anterior\n\t\t\t\t// 2 - caso não tenha palco, verificamos\n\t\t\t\t// se é o primeiro item da sub-section\n\t\t\t\t// se for, voltamos para a section anterior\n\t\t\t\tif( seletor.prev().not( '.palco' ).length == 0 ||\n\t\t\t\t\t( seletor.hasClass( 'sub-section' ) && ( seletor.prev().length == 0 ) ) ){\n\t\t\t\t\tseletor = seletor.parents( 'section' );\n\t\t\t\t}\n\t\t\t\tseletor.addClass( 'backward' ).removeClass( 'ativo' ).prev().addClass( 'ativo reverse' );\n\n\t\t\t}\n\t\t}\n\t}", "function auxLetras(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 15)\n simbolo = 'M';\n else if (promedio >= 16 && promedio <= 31)\n simbolo = 'N';\n else if (promedio >= 32 && promedio <= 47)\n simbolo = 'H';\n else if (promedio >= 48 && promedio <= 63)\n simbolo = '#';\n else if (promedio >= 64 && promedio <= 79)\n simbolo = 'Q';\n else if (promedio >= 80 && promedio <= 95)\n simbolo = 'U';\n else if (promedio >= 96 && promedio <= 111)\n simbolo = 'A';\n else if (promedio >= 112 && promedio <= 127)\n simbolo = 'D';\n else if (promedio >= 128 && promedio <= 143)\n simbolo = '0';\n else if (promedio >= 144 && promedio <= 159)\n simbolo = 'Y';\n else if (promedio >= 160 && promedio <= 175)\n simbolo = '2';\n else if (promedio >= 176 && promedio <= 191)\n simbolo = '$';\n else if (promedio >= 192 && promedio <= 209)\n simbolo = '%';\n else if (promedio >= 210 && promedio <= 225)\n simbolo = '+';\n else if (promedio >= 226 && promedio <= 239)\n simbolo = '.';\n else if (promedio >= 240 && rgbPromedio <= 255)\n simbolo = ' ';\n return simbolo;\n\n}", "function posicionaNaviosJogador(){\r\n for (var i = 0; i < 10; i++){\r\n console.error(\"\\nNavio n.º \"+(i+1));\r\n linhaJogador = (pegarNumero(\"Linha: \", 1, 10)-1);\r\n colunaJogador = (pegarNumero(\"Coluna: \", 1, 10)-1);\r\n if (tabuleiro[linhaJogador][colunaJogador] == \" ~~~~ \"){\r\n tabuleiro[linhaJogador][colunaJogador] = \" <^^> \";\r\n contadorJogador++;\r\n }\r\n else {\r\n console.log(\"Espaço já ocupado. Você perdeu um navio. \")\r\n }\r\n }\r\n naviosJogador = contadorJogador;\r\n}", "function iniciarListaBusqueda(){\n var ciclos = selectDatoErasmu();\n for(var aux = 0, help = 0 ; aux < erasmu.length ; aux++){\n if(ciclos.indexOf(erasmu[aux].ciclo) != -1){\n crearListErasmu(erasmu[aux]);\n }\n }\n}", "function mostrarEstAlumnosParaDocente(){\r\n let contadorEjXNivel = 0;//variable para contar cuantos ejercicios planteo el docente para el nivel del alumno\r\n let contadorEntXNivel = 0;//variable para contar cuantos ejercicios de su nivel entrego el alumno\r\n let alumnoSeleccionado = document.querySelector(\"#selEstAlumnos\").value;\r\n let posicionUsuario = alumnoSeleccionado.charAt(1);\r\n let usuario = usuarios[posicionUsuario];\r\n let nivelAlumno = usuario.nivel;\r\n for (let i = 0; i < ejercicios.length; i++){\r\n const element = ejercicios[i].Docente.nombreUsuario;\r\n if(element === usuarioLoggeado){\r\n if(ejercicios[i].nivel === nivelAlumno){\r\n contadorEjXNivel ++;\r\n }\r\n }\r\n }\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.nombreUsuario;\r\n if(element === usuario.nombreUsuario){\r\n if(entregas[i].Ejercicio.nivel === nivelAlumno){\r\n contadorEntXNivel++;\r\n }\r\n }\r\n }\r\n document.querySelector(\"#pMostrarEstAlumnos\").innerHTML = `El alumno ${usuario.nombre} tiene ${contadorEjXNivel} ejercicios planteados para su nivel (${nivelAlumno}) sobre los cuales a realizado ${contadorEntXNivel} entrega/s. `;\r\n}", "function valorEntreMedio(_texto, _inicio, _termino) {\n var parte = \"\";\n var parteTexto = _texto.indexOf(_inicio);\n \n if (parteTexto == -1) { return \"\"};\n parteTexto += _inicio.length;\n\n var terminaTexto = _texto.indexOf(_termino, parteTexto);\n if (terminaTexto == -1) { return \"\"};\n\n return _texto.substring(parteTexto, terminaTexto);\n}", "function paz(){\n\tDepartamento = new Array('<p>La Paz</p>');\n\tHistoria = new Array('<p class=\"text-justify\">La Paz es un departamento de El Salvador ubicado en la zona oriental del país. Limita al Norte con la república de Honduras; al Sur y al Oeste con el departamento de San Miguel, y al Sur y al Este con el departamento de La Unión. Su cabecera departamental es San Francisco. Morazán comprende un territorio de 1 447 km² y cuenta con una población de 181 285 habitantes.</p>');\n\t/*Declaracion de Variable Interna para recorrer el arreglo de Municipios,\n\tde la Misma manera para recorrer los elementos de otros arreglos*/\n\tvar Municipioss, Municipioss2, rios, lagos, volcanes, centertour, personaje;\n\tMunicipioss = \"\";\n\tMunicipios = new Array('<ol><span class=\"glyphicon glyphicon-home\"></span> La Union</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Yucuaiquin</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Intipuca</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> El Carmen</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Bolivar</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Santa Rosa de Lima</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Anamoros</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Concepcion de Oriente</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Lislique </ol>');\n\tfor(i = 0; i < Municipios.length; i++){\n\t\tMunicipioss += Municipios[i];\n\t}\n\tMuniciipios2 = new Array('<ol><span class=\"glyphicon glyphicon-home\"></span> San Alejo</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Conchagua</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> San Jose</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Yayantique</ol>','<ol><span class=\"glyphicon glyphicon-home\"></span> Meanguera del Golfo</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Pasaquina</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Nueva Esparta</ol>', '<ol><span class=\"glyphicon glyphicon-home\"></span> Poloros</ol>');\n\tfor(m = 0; m< Municiipios2.length; m++){\n\t\tMunicipioss2 += Municiipios2[m];\n\t}\n\tRios = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> PLaya El Jaguey</ol>', '<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Playa Blanca</ol>');\n\trios = \"\";\n\tfor(j = 0; j < Rios.length; j++){\n\t\trios += Rios[j];\n\t}\n\tVolcanes = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Volcan Conchagua</ol>');\n\tPersonajes = new Array('<ol><span class=\"glyphicon glyphicon-ok\"></span> Antonio Grau Mora</ol>', '<ol><span class=\"glyphicon glyphicon-ok\"></span> Maria Cegarra Salcedo</ol>', '<ol><span class=\"glyphicon glyphicon-ok\"></span> Asensio Saez</ol>');\n\tpersonaje = \"\";\n\tfor(k = 0; k < Personajes.length; k++){\n\t\tpersonaje += Personajes[k];\n\t}\n\tCentroTour = new Array('<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Parque de la Familia</ol>', '<ol class=\"text-center\"><span class=\"glyphicon glyphicon-ok\"></span> Bosque Conchagua</ol>');\n\tcentertour = \"\";\n\tfor(c = 0; c < CentroTour.length; c++){\n\t\tcentertour += CentroTour[c];\n\t}\n\n\tdocument.getElementById(\"Departament\").innerHTML = Departamento[0];\n\tdocument.getElementById(\"History\").innerHTML = Historia[0];\n\tdocument.getElementById(\"Municipio\").innerHTML = Municipioss;\n\tdocument.getElementById(\"Municipio2\").innerHTML = Municipioss2;\n\tdocument.getElementById(\"centro\").innerHTML = centertour;\n\tdocument.getElementById(\"Persons\").innerHTML = personaje;\n\tdocument.getElementById(\"river\").innerHTML = rios;\n\tdocument.getElementById(\"volca\").innerHTML = Volcanes[0];\n}", "function inicializaContadores(){\n campo.on(\"input\", function(){\n var conteudo = campo.val();\n \n // contador de palavras\n var qtdPalavras = conteudo.split(/\\S+/).length -1; \n $(\"#contador-palavras\").text(qtdPalavras);\n // >> /\\S+/ = expressão regular que busca espço vazio\n \n // contador de letras\n var qtdCaracteres = conteudo.length\n $(\"#contador-caracteres\").text(qtdCaracteres);\n });\n }", "function _CarregaPericias() {\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var achou = false;\n for (var i = 0; i < pericia.classes.length; ++i) {\n // Aplica as pericias de mago a magos especialistas tambem.\n if (pericia.classes[i] == 'mago') {\n achou = true;\n break;\n }\n }\n if (!achou) {\n continue;\n }\n for (var chave_classe in tabelas_classes) {\n var mago_especialista = chave_classe.search('mago_') != -1;\n if (mago_especialista) {\n pericia.classes.push(chave_classe);\n }\n }\n }\n var span_pericias = Dom('span-lista-pericias');\n // Ordenacao.\n var divs_ordenados = [];\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var habilidade = pericia.habilidade;\n var prefixo_id = 'pericia-' + chave_pericia;\n var div = CriaDiv(prefixo_id);\n var texto_span = Traduz(pericia.nome) + ' (' + Traduz(tabelas_atributos[pericia.habilidade]).toLowerCase() + '): ';\n if (tabelas_pericias[chave_pericia].sem_treinamento) {\n texto_span += 'ϛτ';\n }\n div.appendChild(\n CriaSpan(texto_span, null, 'pericias-nome'));\n\n var input_complemento =\n CriaInputTexto('', prefixo_id + '-complemento', 'input-pericias-complemento',\n {\n chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n AtualizaGeral();\n evento.stopPropagation();\n }\n });\n input_complemento.placeholder = Traduz('complemento');\n div.appendChild(input_complemento);\n\n var input_pontos =\n CriaInputNumerico('0', prefixo_id + '-pontos', 'input-pericias-pontos',\n { chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n ClickPericia(this.chave_pericia);\n evento.stopPropagation(); } });\n input_pontos.min = 0;\n input_pontos.maxlength = input_pontos.size = 2;\n div.appendChild(input_pontos);\n\n div.appendChild(CriaSpan(' ' + Traduz('pontos') + '; '));\n div.appendChild(CriaSpan('0', prefixo_id + '-graduacoes'));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total-bonus'));\n div.appendChild(CriaSpan(' = '));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total'));\n\n // Adiciona as gEntradas\n gEntradas.pericias.push({ chave: chave_pericia, pontos: 0 });\n // Adiciona ao personagem.\n gPersonagem.pericias.lista[chave_pericia] = {\n graduacoes: 0, bonus: new Bonus(),\n };\n // Adiciona aos divs.\n divs_ordenados.push({ traducao: texto_span, div_a_inserir: div});\n }\n divs_ordenados.sort(function(lhs, rhs) {\n return lhs.traducao.localeCompare(rhs.traducao);\n });\n divs_ordenados.forEach(function(trad_div) {\n if (span_pericias != null) {\n span_pericias.appendChild(trad_div.div_a_inserir);\n }\n });\n}", "piquesAleatoire() {\n\t\t// position y aleatoire pour 4 piques\n\t\tlet tirage = [];\n\t\twhile (tirage.length < 4) {\n\t\t\tlet nombreAleatoire = Math.round(Utl.aleatoire(4, 12));\n\t\t\tif (tirage.indexOf(nombreAleatoire) === -1) {\n\t\t\t\ttirage.push(nombreAleatoire);\n\t\t\t}\n\t\t}\n\t\treturn tirage;\n\t}", "function parolaAlcontrario(parola) {\r\n var parolaAlDritto = [];\r\n for (var i = 0; i < parola.length; i++) {\r\n parolaAlDritto.push(parola[i]);\r\n }\r\n var parolaContraria = \"\";\r\n for (var i = parola.length - 1; i >= 0; i--) {\r\n parolaContraria += parolaAlDritto[i];\r\n\r\n }\r\n return parolaContraria\r\n}", "function nouvellePartie() {\n\tdefinirNombreIa();\n\tresultat = \"Une nouvelle partie commence, choisissez entre 1 et 100.\";\n\tnombreEssai = 0\n\tafficher();\n\t}", "function divideInArray(elenco){\n return parola=elenco.split(\" \");\n}", "getPersonasPorSala(sala) {\n\n }", "function print_don() {\n // quando il metodo mi deve ritornare qualcosa per prima cosa inizializzo la variabile e in fondo\n // metto il \"return nomevariabile;\"\n let text = \"\";\n\n //let miosaldo = 0;\n\n //let maxver = 0;\n\n\n for (i = 0; i < ar_numeri.length; i++) {\n // In questo modo tutte le linee vengono generate con uno span con un id univoco, quindi possono essere gestiti anche singolarmenti\n text += \"<span id'don\" + i + \"'>\" + ar_numeri[i]+\"</span><br/>\";\n\n }\n\n\n return text;\n}", "function escoltaPregunta ()\r\n{\r\n if(this.validate) {\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML+=\"<br>\"+this.paraules[index].paraula.toUpperCase();\r\n this.putSound (this.paraules[index].so);\r\n }\r\n else {\r\n this.capa.innerHTML = \"\"\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.putSound (this.paraules[index].so);\r\n this.capa.innerHTML += \"<br>\" + this.actual+this.putCursor ('black');\r\n }\r\n}", "function auxNaipes(promedio) {\n let simbolo;\n\n if(promedio > 0 && promedio <= 19) \n simbolo = 'A';\n else if(promedio >= 20 && promedio <= 38) \n simbolo = 'B';\n else if(promedio >= 39 && promedio <= 57) \n simbolo = 'C';\n else if(promedio >= 58 && promedio <= 76) \n simbolo = 'D';\n else if(promedio >= 77 && promedio <= 95) \n simbolo = 'E';\n else if(promedio >= 96 && promedio <= 114) \n simbolo = 'F';\n else if(promedio >= 115 && promedio <= 133) \n simbolo = 'G';\n else if(promedio >= 134 && promedio <= 152) \n simbolo = 'H';\n else if(promedio >= 153 && promedio <= 171) \n simbolo = 'I';\n else if(promedio >= 172 && promedio <= 190) \n simbolo = 'J';\n else if(promedio >= 191 && promedio <= 209) \n simbolo = 'K';\n else if(promedio >= 210 && promedio <= 228) \n simbolo = 'L';\n else if(promedio >= 229 && promedio <= 256) \n simbolo = 'M';\n return simbolo;\n\n}", "function CeSe(){\n\tif (seccionMostrando != ''){\n\t\tnodoSeparador = document.getElementById('separador');\n\t\tnodoSeparador.innerHTML = '';\n\t}\n}", "function NumeroLetras (frase){\n //var frase = \"El mundo es tan cruel\";\nvar vacio = frase.split (\" \");\n\nconsole.log(\"La frase tiene \" + vacio.length + \" caracteres.\")\n\n}", "function Estiliza_menu_itens()\n{\n //PARA CADA ITEM DO MENU, BASTA CHAMAR A FUNÇÃO ABAIXO, ESPECIFICANDO\n //SEU INDICE(NUMERO), SUA COR(STRING), SEU CONTEUDO(STRING), SEU LABEL(STRING)\n //Estiliza_item(Indice, Cor, Conteudo, Texto Lateral);\n Estiliza_item(0,\"blue\",\"+\",\"Adicionar\");\n Estiliza_item(1,\"red\",\"Botão\");\n}", "function mostrarMovimientosEnPantalla() {\n let cartel = document.getElementById('movimientos');\n let limite = document.getElementById('movimientos-restantes');\n cartel.innerText = movimientos.length;\n limite.innerText = `Movimientos restantes: ${limiteMovimientos}`;\n}", "function menu (data) {\n texte = \"\"\n for (var i = 0; i <= data.length - 1; i++) {\n ligne = data[i]\n console.log(ligne)\n if (i == 0 || (ligne.dossier != data[i-1].dossier) ) {\n texte = titre2(texte, ligne.dossier)\n }\n \n if ( (i == 0 || (ligne.dossierSS != data[i-1].dossierSS)) && ligne.dossierSS != '' ) {\n texte = titre3(texte, ligne.dossierSS)\n }\n\n texte = file(texte, ligne.fichier, ligne.dossierSS )\n } \n document.getElementById(\"menu\").innerHTML = texte\n}", "function etapa3() {\n countListaNomeCrianca = 0; //count de quantas vezes passou na lista de crianças\n\n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"3º Etapa - Colaborador\";\n\n document.getElementById('selecionarFuncionarios').style.display = ''; //habilita a etapa 3\n document.getElementById('selecionarAniversariantes').style.display = 'none'; //desabilita a etapa 2\n \n //seta a quantidade de criança que foi definida no input de controle \"qtdCrianca\"\n document.getElementById('qtdCrianca').value = quantidadeCrianca2;\n \n //percorre a lista de nomes das crianças e monta o texto de confirmação para as crianças\n var tamanhoListaNomeCrianca = listaNomeCrianca.length; //recebe o tamanho da lista em uma variavel\n\n listaNomeCrianca.forEach((valorAtualLista) => {\n if(countListaNomeCrianca == 0){\n textoConfirmacaoCrianca = \"Aniversariantes: \";\n }\n countListaNomeCrianca++;\n \n if(countListaNomeCrianca == tamanhoListaNomeCrianca){\n textoConfirmacaoCrianca = textoConfirmacaoCrianca + valorAtualLista;\n }else{\n textoConfirmacaoCrianca = textoConfirmacaoCrianca + valorAtualLista + \" / \";\n }\n \n }); \n countListaNomeCrianca = 0;\n \n if(tamanhoListaNomeCrianca == 0){\n textoConfirmacaoCrianca = \"Evento não possui aniversariante.\";\n }\n \n //seta o texto informação da crianças na ultima etapa\n var confirmacaoInfCrianca = document.querySelector(\"#criancasInf\");\n confirmacaoInfCrianca.textContent = textoConfirmacaoCrianca; \n \n }", "getEleccionPaquete(){\r\n\r\n if( eleccion == \"IGZ\" ){\r\n //Igz - descuento del 15\r\n console.log(\"Elegiste Iguazú y tiene el 15% de decuento\");\r\n return this.precio - (this.precio*0.15);\r\n }\r\n else if (eleccion == \"MDZ\"){\r\n //mdz - descuento del 10\r\n console.log(\"Elegiste Mendoza y tiene el 10% de descuento\");\r\n return this.precio - (this.precio*0.10);\r\n }\r\n else if (eleccion == \"FTE\"){\r\n //fte - no tiene descuento \r\n console.log(\"Elegiste El Calafate, lamentablemente no tiene descuento\");\r\n return \"\";\r\n }\r\n \r\n }", "function Seleziona(pimo, colp, colturno, pos)\n{\n\tswitch(primo)\n\t{\n\t\tcase '<img src=\"imm/pedone_n.png\">': //pedone nero\n\t\t\tif(document.getElementById(parseInt(pos)+9)!=null && document.getElementById(parseInt(pos)+9).innerHTML!='<img src=\"imm/vuota.png\">')//diagonale sinistra\n\t\t\t{\n\t\t\t\t\tvar lenstr2=(document.getElementById(parseInt(pos)+9).innerHTML).length;\n\t\t\t\t\tvar col2=(document.getElementById(parseInt(pos)+9).innerHTML).charAt(lenstr2-7);//colore pedina raggiungibile\n\t\t\t\t\t//controllo non mangi pedina amica\n\t\t\t\t\tif(colp!=col2)\n\t\t\t\t\t\tdocument.getElementById(parseInt(pos)+9).className=\"selezionato\";\n\t\t\t}\n\t\t\tif(document.getElementById(parseInt(pos)+11)!=null && document.getElementById(parseInt(pos)+11).innerHTML!='<img src=\"imm/vuota.png\">')//diagonale destra\n\t\t\t{\n\t\t\t\tvar lenstr2=(document.getElementById(parseInt(pos)+11).innerHTML).length;\n\t\t\t\tvar col2=(document.getElementById(parseInt(pos)+11).innerHTML).charAt(lenstr2-7);//colore pedina raggiungibile\n\t\t\t\t//controllo non mangi pedina amica\n\t\t\t\tif(colp!=col2)\n\t\t\t\t\tdocument.getElementById(parseInt(pos)+11).className=\"selezionato\";\n\t\t\t}\n\n\t\t\tif(document.getElementById(parseInt(pos)+10)!=null&&document.getElementById(parseInt(pos)+10).innerHTML=='<img src=\"imm/vuota.png\">')\n\t\t\t{\n\t\t\t\tdocument.getElementById(parseInt(pos)+10).className=\"selezionato\";\n\t\t\t\tif(parseInt(pos)>=20&&parseInt(pos)<=28 && document.getElementById(parseInt(pos)+20).innerHTML=='<img src=\"imm/vuota.png\">')\n\t\t\t\t\tdocument.getElementById(parseInt(pos)+20).className=\"selezionato\";\n\t\t\t}\n\t\tbreak;\n\t\t//pedone bianco\n\t\tcase '<img src=\"imm/pedone_b.png\">':\n\t\t\tif(document.getElementById(parseInt(pos)-9)!=null && document.getElementById(parseInt(pos)-9).innerHTML!='<img src=\"imm/vuota.png\">')//diagonale sinistra\n\t\t\t{\n\t\t\t\tvar lenstr2=(document.getElementById(parseInt(pos)-9).innerHTML).length;\n\t\t\t\tvar col2=(document.getElementById(parseInt(pos)-9).innerHTML).charAt(lenstr2-7);//colore pedina raggiungibile\n\t\t\t\t//controllo non mangi pedina amica\n\t\t\t\tif(colp!=col2)\n\t\t\t\t\tdocument.getElementById(parseInt(pos)-9).className=\"selezionato\";\n\t\t\t}\n\n\t\t\tif(document.getElementById(parseInt(pos)-11)!=null && document.getElementById(parseInt(pos)-11).innerHTML!='<img src=\"imm/vuota.png\">')//diagonale destra\n\t\t\t{\n\t\t\t\tvar lenstr2=(document.getElementById(parseInt(pos)-11).innerHTML).length;\n\t\t\t\tvar col2=(document.getElementById(parseInt(pos)-11).innerHTML).charAt(lenstr2-7);//colore pedina raggiungibile\n\t\t\t\t//controllo non mangi pedina amica\n\t\t\t\tif(colp!=col2)\n\t\t\t\t\tdocument.getElementById(parseInt(pos)-11).className=\"selezionato\";\n\t\t\t}\n\n\t\t\tif(document.getElementById(parseInt(pos)-10)!=null&&document.getElementById(parseInt(pos)-10).innerHTML=='<img src=\"imm/vuota.png\">')\n\t\t\t{\n\t\t\t\tdocument.getElementById(parseInt(pos)-10).className=\"selezionato\";\n\t\t\t\tif(parseInt(pos)>=70&&parseInt(pos)<=78 && document.getElementById(parseInt(pos)-20).innerHTML=='<img src=\"imm/vuota.png\">')\n\t\t\t\t\tdocument.getElementById(parseInt(pos)-20).className=\"selezionato\";\n\t\t\t}\n\t\tbreak;\n\t\t//torri nere e bianche\n\t\tcase '<img src=\"imm/torre_n.png\">':\n\t\tcase '<img src=\"imm/torre_b.png\">':\n\t\t var i=0;\n\t\t var sum=[10, 1, -1, -10];\n\t\t for(var k=0; k<4; k++)\n\t\t {\n\t\t\tfor(var j=1; j<8; j++)\n\t\t\t{\n\t\t\t i+=sum[k];\n\t\t\t if(document.getElementById(parseInt(pos+i))!=null && document.getElementById(parseInt(pos+i)).innerHTML=='<img src=\"imm/vuota.png\">')\n\t\t\t\tdocument.getElementById(parseInt(pos+i)).className=\"selezionato\";\n\t\t\t else if(document.getElementById(parseInt(pos+i))!=null)\n\t\t\t {\n\t\t\t\tvar lenstr2=(document.getElementById(parseInt(pos+i)).innerHTML).length;\n\t\t\t\tvar col2=(document.getElementById(parseInt(pos+i)).innerHTML).charAt(lenstr2-7);//colore pedina raggiungibile\n\t\t\t\t//controllo non mangi pedina amica\n\t\t\t\tif(colp!=col2)\n\t\t\t\t\tdocument.getElementById(parseInt(pos+i)).className=\"selezionato\";\n\t\t\t\tbreak;\n\t\t\t }\n\t\t\t else\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\ti=0;\n\t\t }\n\t\t break;\n\n\t\t\t//alfieri neri e bianchi\n\t\t\tcase '<img src=\"imm/alfiere_n.png\">':\n\t\t\tcase '<img src=\"imm/alfiere_b.png\">':\n\t\t\t var i=0;\n\t\t\t var sum=[11, 9, -9, -11];\n\t\t\t for(var k=0; k<4; k++)\n\t\t\t {\n\t\t\t\tfor(var j=1; j<8; j++)\n\t\t\t\t{\n\t\t\t\t\ti+=sum[k];\n\t\t\t\t\tif(document.getElementById(parseInt(pos+i))!=null&&document.getElementById(parseInt(pos+i)).innerHTML=='<img src=\"imm/vuota.png\">')\n\t\t\t\t\t\tdocument.getElementById(parseInt(pos+i)).className=\"selezionato\";\n\t\t\t\t\t\telse if(document.getElementById(parseInt(pos+i))!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar lenstr2=(document.getElementById(parseInt(pos+i)).innerHTML).length;\n\t\t\t\t\t\tvar col2=(document.getElementById(parseInt(pos+i)).innerHTML).charAt(lenstr2-7);//colore pedina raggiungibile\n\t\t\t\t\t\t//controllo non mangi pedina amica\n\t\t\t\t\t\tif(colp!=col2)\n\t\t\t\t\t\t\tdocument.getElementById(parseInt(pos+i)).className=\"selezionato\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti=0;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t//regine nere e bianche\n\t\t\tcase '<img src=\"imm/regina_n.png\">':\n\t\t\tcase '<img src=\"imm/regina_b.png\">':\n\t\t\tvar sum=[10, 1, -1, -10, 11, 9, -9, -11];\n\t\t\tvar i=0;\n\t\t\tfor(var k=0; k<8; k++)\n\t\t\t{\n\t\t\t\tfor(var j=0; j<8; j++)\n\t\t\t\t{\n\t\t\t\t\ti+=sum[k];\n\t\t\t\t\tif(document.getElementById(parseInt(pos+i))!=null && document.getElementById(parseInt(pos+i)).innerHTML=='<img src=\"imm/vuota.png\">')\n\t\t\t\t\t\tdocument.getElementById(parseInt(pos+i)).className=\"selezionato\";\n\t\t\t\t\telse if(document.getElementById(parseInt(pos+i))!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar lenstr2=(document.getElementById(parseInt(pos+i)).innerHTML).length;\n\t\t\t\t\t\tvar col2=(document.getElementById(parseInt(pos+i)).innerHTML).charAt(lenstr2-7);//colore pedina raggiungibile\n\t\t\t\t\t\t//controllo non mangi pedina amica\n\t\t\t\t\t\tif(colp!=col2)\n\t\t\t\t\t\t\tdocument.getElementById(parseInt(pos+i)).className=\"selezionato\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti=0;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t//re neri e bianchi\n\t\t\tcase '<img src=\"imm/re_n.png\">':\n\t\t\tcase '<img src=\"imm/re_b.png\">':\n\t\t\tcontrolloArrocco(colp);\n\t\t\tvar sum=[10, 1, -1, -10, 11, 9, -9, -11];\n\t\t\tvar i=0;\n\t\t\tfor(var k=0; k<8; k++)\n\t\t\t{\n\t\t\t\tfor(var j=0; j<8; j++)\n\t\t\t\t{\n\t\t\t\t\ti=sum[k];\n\t\t\t\t\tif(document.getElementById(parseInt(pos+i))!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar lenstr2=(document.getElementById(parseInt(pos+i)).innerHTML).length;\n\t\t\t\t\t\tvar col2=(document.getElementById(parseInt(pos+i)).innerHTML).charAt(lenstr2-7);//colore pedina raggiungibile\n\t\t\t\t\t\t//controllo non mangi pedina amica\n\t\t\t\t\t\tif(colp!=col2)\n\t\t\t\t\t\t\tdocument.getElementById(parseInt(pos+i)).className=\"selezionato\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t\t//cavallo nero e bianco\n\t\t\tcase '<img src=\"imm/cavallo_n.png\">':\n\t\t\tcase '<img src=\"imm/cavallo_b.png\">':\n\t\t\tsum=[10, -10, 1, -1];\n\t\t\tsum1=[1, -1];\n\t\t\tsum2=[10, -10];\n\t\t\tfor(var k=0; k<4; k++)\n\t\t\t{\n\t\t\t\tfor(var j=0; j<2; j++)\n\t\t\t\t{\n\t\t\t\t\ti=sum[k];\n\t\t\t\t\tif(k<2)\n\t\t\t\t\t\tz=sum1[j];\n\t\t\t\t\telse\n\t\t\t\t\t\tz=sum2[j];\n\t\t\t\t\tif(document.getElementById(parseInt(pos+i+i+z))!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar lenstr2=(document.getElementById(parseInt(pos+i+i+z)).innerHTML).length;\n\t\t\t\t\t\tvar col2=(document.getElementById(parseInt(pos+i+i+z)).innerHTML).charAt(lenstr2-7);//colore pedina raggiungibile\n\t\t\t\t\t\t//controllo non mangi pedina amica\n\t\t\t\t\t\tif(colp!=col2)\n\t\t\t\t\t\t\tdocument.getElementById(parseInt(pos+i+i+z)).className=\"selezionato\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t}//fine switch\t\n}", "function pegasecoes(codigopai, acao) {\n\t\t\tdb.transaction(function(tx) {\n\t\t\t\ttx.executeSql(\"select codigo, ifnull(entidade,0) entidade from checklist_gui cg where token=? and secaopai=? and tipo='secao' \", [$scope.token, codigopai],\n\t\t\t\tfunction(tx, results) {\n\t\t\t\t\tfor (var i=0; i < results.rows.length; i++) {\n\t\t\t\t\t\tvar codigosecao = results.rows.item(i).codigo;\n\t\t\t\t\t\tvar entidadesecao = results.rows.item(i).entidade;\n\t\t\t\t\t\tpegasecoes(codigosecao, entidadesecao, acao);\n\t\t\t\t\t\tif (acao == 'contar') {\n\t\t\t\t\t\t\tcontaItensSecao(codigosecao,entidadesecao);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (acao == 'deletar') {\n\t\t\t\t\t\t\tapagaItensSecao(codigosecao, entidadesecao)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfunction(a,b) {\n\t\t\t\t\talert(b.message);\n\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t}", "function listando_todos_os_contatos_001(){ \n try{ \n \n var linha_recebida = lista_de_contatos.split(\"@\"); \n for( var i = ( linha_recebida.length - 1 ); i >= 0; i-- ) {\n if( linha_recebida[i].includes(\"-\") ){\n var web_id;\n var web_comando;\n var web_usuario_logado;\n \n var web_contato_email;\n var web_contato_nome;\n var web_contato_nome_meio;\n var web_contato_ultimo_nome;\n\n var argumentos = linha_recebida[i].split(\"j\");\n for( var j = 0; j < argumentos.length; j++ ) {\n if(j === 0){ \n web_id = argumentos[j];\n }\n else if(j === 1){\n web_comando = argumentos[j];\n }\n else if(j === 2){\n web_usuario_logado = argumentos[j];\n }\n else if(j === 3){\n web_contato_email = argumentos[j];\n }\n else if(j === 4){\n web_contato_nome = argumentos[j];\n }\n else if(j === 5){\n web_contato_nome_meio = argumentos[j];\n }\n else if(j === 6){\n web_contato_ultimo_nome = argumentos[j];\n }\n }\n\n //Verificar se este contato é deste usuário\n var nome_principal = \"\"; try{ nome_principal = converter_base64(web_contato_nome).trim(); }catch(Exception){}\n var web_contato_email_str = importar_Para_Alfabeto_JM( web_contato_email ).trim().toUpperCase();\n \n percorrer_todas_as_conversas( web_id, web_contato_email_str, nome_principal );\n }\n } \n }catch(Exception){\n \n document.getElementById(\"ul_meus_contatos\").innerHTML = \"consultar_contato_antes_de_cadastrar_003 -- \" + Exception;\n }finally { \n \n //alert(\"Acabou\");\n setTimeout(function(){ \n \n //alert(\"Reiniciando\");\n if( carregado === 1 ){\n \n _01_controle_loop_sem_fim();\n }\n else if( carregado === 0 ){\n \n carregado = 0;\n document.getElementById(\"ul_meus_contatos\").style.display = 'block';\n \n document.getElementById(\"contato_tabela_xy_01\").style.display = 'none';\n document.getElementById(\"contato_tabela_xy_01\").innerHTML = \"\";\n \n _01_controle_loop_sem_fim();\n }\n \n }, 1000);\n }\n \n }", "function mese(key) {\n // Saltiamo se è undefined\n if ( key !== undefined ) {\n // Aggiorno il path\n path_mese = \"./php_files/\" + key + '/';\n mese_ricordo = key;\n // Aggiorno il codice\n codice += \"<li>\" + key.split(\"_\")[1];\n // Se abbiamo dei dati dentro il nostro mese\n if ( data[key].length !== 0 ) {\n // Inserisco la lista\n codice += \"<ol>\";\n /// Itero dentro i progetti\n Object.keys(data[key]).forEach(progetti);\n // Finisco la lista\n codice += \"</ol>\"\n }\n }\n // Finisco il mese\n codice += \"</li>\"\n }", "function pintarGuiones(palabra) {\n for (var i = 0; i < palabra.length; i++) {\n if(palabra[i] != \" \"){\n oculta[i] = \"_\";\n }\n else{\n oculta[i] = \" \";\n }\n }\n\n //Juntamos el array de la palabra oculta(guiones) en un string y lo mostramos en el hueco de la palabra oculta\n //que hay en el html. Utilizamos 'join(\"\")' por que por defecto el separador de esta funcion es la coma (,) y \n //nosotros lo queremos en blanco (nada).\n hueco.innerHTML = oculta.join(\"\");\n}", "function getCuponesPorIndustria(idIndustria){\n\t\n}", "function caricaElencoScrittureIniziale() {\n caricaElencoScrittureFromAction(\"_ottieniListaContiIniziale\");\n }", "function dibujarArbol (altura) {\n console.log(altura)\n let Arbol = \"\";\n Arbol += \"<p>\";\n for(let i=0; i<altura; i++) {\n for(let j=0; j<=i; j++) {\n Arbol +=\"*\";\n }\n Arbol += \"</p>\";\n }\n\n\n document.getElementById('Arbol').innerHTML = Arbol;\n}", "colocarNaves(ejercito) {\n ejercito.listadoNaves.forEach(element => {\n this.poscionNaves.push(element);\n });\n }", "function cuenta(){\n var _frase = prompt('Introduce frase');\n var _letras = _frase.split('');\n var _tamano = 0;\n var _cantidadDeCadaLetra = '';\n\n while(_letras.length != 0){\n \n var _cantidad = 0;\n var _letra = _letras[0];\n for (var i = 0; i < _letras.length; i++) {\n \n if(_letras[i]==_letra){\n \n if (_letra == \" \"){\n _letras.splice(i,1);\n --i;}\n else{\n ++_tamano;\n ++_cantidad;\n _letras.splice(i,1);\n --i;\n } \n } \n }\n if (_letra != \" \") {\n \n if(_cantidad > 1){\n _cantidadDeCadaLetra += 'La letra \"'+_letra+'\" se repite '+_cantidad+' veces.\\n';\n }\n else{\n _cantidadDeCadaLetra += 'La letra \"'+_letra+'\" se repite una vez.\\n';\n }\n }\n }\n //Se imprime\n console.log(_tamano);\n console.log(_cantidadDeCadaLetra);\n alert('La frase \"'+_frase+'\" contiene '+_tamano+' caracteres. \\nSus caracteres se repiten:\\n'+_cantidadDeCadaLetra);\n}", "function escreveTexto(vetor){\n for (const v of vetor){\n console.log(\n \"O \"+ v.nome + \" possui as habilidades:\" + v.habilidades.join(', ')\n )\n }\n}", "function aumentarTamanhoTexto() {\n document.documentElement.classList.contains('textoMaior')\n ? (aumentarTexto.textContent = 'A+')\n : (aumentarTexto.textContent = 'A-');\n\n document.documentElement.classList.toggle('textoMaior');\n }", "function irsozinho() {\n\tvar inst = document.getElementById(\"manobraunicabox\").value.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '\\n');\n\tvar inst = inst.split ('Telefone')[1];\n\tvar inst = inst.split ('\\n')[1];\n\tvar inst = inst.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '');\n\t\n\tvar estado = document.getElementById(\"manobraunicabox\").value.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '\\n');\n\tvar estado = estado.split('Localidade\\nEsta')[1];\n\tvar estado = estado.split('\\n')[7];\n\tvar estado = estado.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '');\t\n\n\tvar cidade = document.getElementById(\"manobraunicabox\").value.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '\\n');\n\tvar cidade = cidade.split('Localidade\\nEsta')[1];\n\tvar cidade = cidade.split('\\n')[8];\n\tvar cidade = cidade.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '');\n\t\n\tvar ard = document.getElementById(\"manobraunicabox\").value.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '\\n');\n\tvar ard = ard.split('alimentador')[1];\n\tvar ard = ard.split ('rio')[1];\n\tvar ard = ard.split ('Porta')[0];\n\tvar ard = ard.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '');\n\t//utilizar indexOf para encontrar este trecho do ard no select\n\t\n\t\n\tvar rin = document.getElementById(\"manobraunicabox\").value.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '\\n');\n\tvar rin = rin.split('alimentador')[1];\n\tvar rin = rin.split ('Rin')[1];\n\tvar rin = rin.split ('\\n')[1];\n\tvar rin = rin.split('Encapsulamento')[0];\n\tvar rin = rin.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '');\n\t\n\tvar contagem = document.getElementById(\"manobraunicabox\").value.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '\\n');\n\tvar contagem = contagem.split('alimentador')[1];\n\tvar contagem = contagem.split ('Voz')[1];\n\tvar contagem = contagem.split ('Prim')[0];\n\tvar contagem = contagem.split ('-');\n\tvar contagemA = contagem[0];\n\tvar contagemB = contagem[1];\n\tvar contagemF = contagemA+'-'+contagemB;\n\tvar contagemF = contagemF.replace(/(?:\\r\\n|\\r|\\n|\\t)/g, '');\n\t\n\tsessionStorage.setItem('texto',document.getElementById(\"manobraunicabox\").value);\n\tsessionStorage.setItem('inst',inst);\n\tsessionStorage.setItem('estado',estado);\n\tsessionStorage.setItem('cidade',cidade);\n\tsessionStorage.setItem('ard',ard);\n\tsessionStorage.setItem('rin',rin);\n\tsessionStorage.setItem('contagem',contagemF);\n\t\n\t\n\t//console.log ('Instância: '+inst+'\\nCidade: '+cidade+'\\nArmário: '+ard+'\\nContagem: '+contagemF+'\\nRin: '+rin);\n\t\n\t\n\t\n\tsetTimeout(function (){\n\t\t//MASSIVA_PRIMARIO_AC\n\t\tif(typeof(document.getElementsByName('perfil')[0]) !== 'undefined' && document.getElementsByName('perfil')[0] !== null) {\n\t\t\tvar perfil = document.getElementsByName('perfil')[0].options.selectedIndex;\n\t\t\tif (perfil==0|perfil==null){\n\t\t\t\tfor (p=0;p<document.getElementsByName('perfil')[0].options.length;p++){\n\t\t\t\t\tif(document.getElementsByName('perfil')[0].options[p].text=='MASSIVA_PRIMARIO_'+sessionStorage.getItem('estado')){\n\t\t\t\t\t\t//console.log(document.getElementsByName('perfil')[0].options[i].text+'-'+i);\n\t\t\t\t\t\tdocument.getElementsByName('perfil')[0].options[p].selected=true;\n\t\t\t\t\t\tsessionStorage.setItem ('continuar', 'sim');\n\t\t\t\t\t\tdocument.initForm.submit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\t\n\t\tvar cidadeOrigem = document.getElementsByName('cidadeOrigem.cityName')[0].options.selectedIndex;\n\t\tvar armarioOrigem = document.getElementsByName('armarioOrigem.locationId')[0].options.selectedIndex;\n\t\tvar shelfOrigem = document.getElementsByName('shelfOrigem.equipmentId')[0].options.selectedIndex;\n\n\t\tif ((cidadeOrigem==0|cidadeOrigem==null)&sessionStorage.getItem('setCidade')!='ok'){\n\t\t\tfor (i=0;i<document.getElementsByName('cidadeOrigem.cityName')[0].options.length;i++){\n\t\t\t\tif(document.getElementsByName('cidadeOrigem.cityName')[0].options[i].text==sessionStorage.getItem('cidade')){\n\t\t\t\t\t//console.log(document.getElementsByName('cidadeOrigem.cityName')[0].options[i].text+'-'+i);\n\t\t\t\t\tdocument.getElementsByName('cidadeOrigem.cityName')[0].options[i].selected=true;\n\t\t\t\t\tsessionStorage.setItem ('continuar', 'sim');\n\t\t\t\t\tsessionStorage.setItem ('setCidade','ok');\n\t\t\t\t\tVerificaCidade('Cidade');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if((armarioOrigem==0|armarioOrigem!=null)&sessionStorage.getItem('setOrigem')!='ok'){\n\t\t\tfor (j=0;j<document.getElementsByName('armarioOrigem.locationId')[0].options.length;j++){\n\t\t\t\tif (document.getElementsByName('armarioOrigem.locationId')[0].options[j].text.indexOf(sessionStorage.getItem('ard'))> -1){\n\t\t\t\t\tdocument.getElementsByName('armarioOrigem.locationId')[0].options[j].selected=true;\n\t\t\t\t\tsessionStorage.setItem ('continuar', 'sim');\n\t\t\t\t\tsessionStorage.setItem ('setOrigem','ok');\n\t\t\t\t\tverificaOrigemDestinoArmario('origem');\n\t\t\t\t}\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\telse if ((shelfOrigem==0|shelfOrigem!=null)&sessionStorage.getItem('setRin')!='ok') {\n\t\t\tfor (l=0;l<document.getElementsByName('shelfOrigem.equipmentId')[0].options.length;l++){\n\t\t\t\tif (document.getElementsByName('shelfOrigem.equipmentId')[0].options[l].text.indexOf(sessionStorage.getItem('rin'))> -1){\n\t\t\t\t\tdocument.getElementsByName('shelfOrigem.equipmentId')[0].options[l].selected=true;\n\t\t\t\t\tsessionStorage.setItem ('continuar', 'sim');\n\t\t\t\t\tsessionStorage.setItem ('setRin','ok');\n\t\t\t\t\tatualizaValorTecnologia('origem');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsessionStorage.setItem ('continuar', 'nao');\n\t\t}\t\n\t}, 1000);\n\tdocument.getElementsByName('instancias')[0].value=sessionStorage.getItem('inst');\n}", "function solucioPanell( numpagines )\r\n {\r\n \t// creem fons de motor\r\n \tthis.fons = new createjs.Shape();\r\n \tthis.fons.graphics.beginFill(\"#0D3158\").drawRect(0, 0, 950, 51);\r\n \t// creem contenidor\r\n \tthis.contenedor = new createjs.Container();\r\n \tthis.contenedor.x = 0;\r\n\tthis.contenedor.y = 558;\r\n\t// configuremm dades de paginació\r\n\tthis.currentPag= Motor.currentNumPag;\r\n\tthis.numPagines = numpagines;\r\n \t//creem botons del panell\r\n \tthis.reintentar = new Boton( 146, 29, pppPreloader.from(\"module\", 'motor/images/btnRestaurar.png'), LangRes.lang[ LangRes.REINTENTAR ],\"left\");\r\n \tthis.solucio = new Boton( 148, 29, pppPreloader.from(\"module\", 'motor/images/btnSolucio.png'), LangRes.lang[ LangRes.SOLUCION ],\"left\");\r\n \t\r\n \tthis.solucio.contenedor.x = 786;\r\n \tthis.solucio.contenedor.y = 12;\r\n \t\r\n \tthis.reintentar.contenedor.x = 15; \r\n \tthis.reintentar.contenedor.y = 12;\r\n \t// afegim components al contenidor principal\r\n \tthis.contenedor.addChild( this.fons );\r\n \tthis.contenedor.addChild( this.text );\r\n \tthis.contenedor.addChild( this.solucio.contenedor );\r\n \t\r\n \tif( Scorm.modo != Scorm.MODO_REVISAR )\r\n \t\tthis.contenedor.addChild( this.reintentar.contenedor );\r\n \t\r\n \t\r\n \tthis.pagines =\"\";\r\n\r\n\tif( this.numPagines > 1 ){ // si tenim més d'una pagina mostrem la paginacio\r\n \t\t//creem paginador\r\n \t\tthis.pagines = new Paginador(this.numPagines);\r\n \t\tthis.pagines.contenedor.x =315;\r\n \t\tthis.pagines.contenedor.y = 11;\r\n \t\t// creem boto seguent pagina\r\n \t\tthis.seguent = new Boton(144,28,pppPreloader.from(\"module\", 'motor/images/btnSeguent.png'), LangRes.lang[ LangRes.SIGUIENTE ],\"left\");\r\n \t\tthis.seguent.contenedor.x = 285 + this.numPagines*31 + 40; \r\n \t\tthis.seguent.contenedor.y = 12;\r\n \t\t// afegim components a contenidor principal\r\n \t\tthis.contenedor.addChild( this.pagines.contenedor );\r\n \t\tthis.contenedor.addChild( this.seguent.contenedor );\r\n \t\t//seleccionem pagina actual\r\n \t\tthis.pagines.pags[this.currentPag].state(\"select\"); \r\n \t\tif(this.currentPag == this.numPagines - 1) this.seguent.contenedor.visible = false;\r\n \t}\r\n \t//posem contenidor al canvas amb transició\r\n \tMain.stage.removeChild(Contenedor.missatge.contenedor);\r\n\tMain.stage.addChild( this.contenedor );\r\n\tthis.contenedor.alpha =0;\r\n\tcreatejs.Tween.get(this.contenedor).to({alpha:1}, 1250, createjs.Ease.circOut);\r\n\t\r\n\tif(this.numPagines > 1)\r\n \t{\r\n \t\t//validació de estat de pagina (correcte / incorrecte)\r\n\t\tthis.validaPags();\r\n\t\t// seleccionem pagina actual\r\n\t\tthis.selectPag(this.currentPag+1);\r\n\t}\r\n }", "function Nivel1Ejercicio1() {\n document.getElementById('text').innerHTML='';\n let nombre = prompt('Su nombre?:')\n let noNumberName = nombre.replace(expRegular1,\"\");\n var arrNoNumber = noNumberName.split('')\n for (let i = 0; i < arrNoNumber.length; i++) {\n //document.getElementById('text').innerHTML+=\"${arrNoNumberName[i]}\" + '</br>';\n //document.getElementById('text').innerHTML+= '\"' + noNumberName[i] + '\"' + '\\r\\n';\n document.getElementById('text').innerHTML+= arrNoNumber[i] +' </br>';\n}\n}", "function idiomaingles() {\n alert('Nivel Alto. Título Superior de la Escuela Oficial de Idiomas');\n }", "function auxDomino(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 25)\n simbolo = '1';\n else if (promedio >= 26 && promedio <= 50)\n simbolo = '2';\n else if (promedio >= 51 && promedio <= 75)\n simbolo = '3';\n else if (promedio >= 76 && promedio <= 100)\n simbolo = '4';\n else if (promedio >= 101 && promedio <= 125)\n simbolo = '5';\n else if (promedio >= 126 && promedio <= 150)\n simbolo = '6';\n else if (promedio >= 151 && promedio <= 175)\n simbolo = '7';\n else if (promedio >= 176 && promedio <= 200)\n simbolo = '8';\n else if (promedio >= 201 && promedio <= 225)\n simbolo = '9';\n else if (promedio >= 226 && promedio <= 256)\n simbolo = '0';\n return simbolo;\n\n}", "function puntosDePartida(){\n var h1puntuacion = document.getElementById(\"puntos\");\n pintarLog(\"\"+ puntuacion+ \"velo\"+velocidad+\"nivel\"+level);\n var texto = document.createTextNode(\"\"+ puntuacion);\n while(h1puntuacion.firstChild){\n h1puntuacion.removeChild(h1puntuacion.firstChild);\n }\n h1puntuacion.appendChild(texto);\n}", "function melhorEco(dados) {\n return dados;\n}", "function maisProdutos(){\n rl.question(\"Deseja acrescentar mais produtos a sacola?\\n 1 - Sim\\n 2 - Não\\n\", (opcao) =>{\n if(opcao === \"1\"){\n procurandoPedido();\n }else{\n listarSacola();\n }\n })\n}", "function infor_pessoa(pessoa) {\n pessoa.dados.forEach(function (item) { return console.log(item); });\n}", "function comprovarEscriu () {\r\n this.validate=1;\r\n index=cerca(this.paraules,this.actual);\r\n this.capa.innerHTML=\"\";\r\n if (index != -1) {\r\n paraula = this.paraules[index];\r\n this.putImg (this.dirImg+\"/\"+paraula.imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula.toUpperCase();\r\n this.putSound (paraula.so);\r\n this.ant = this.actual;\r\n this.actual = \"\";\r\n }\r\n else {\r\n this.putImg (\"imatges/error.gif\");\r\n this.putSound (\"so/error.wav\");\r\n this.actual = \"\";\r\n }\r\n}", "function opcionMenuSuperior(texto){\r\n\t\tvar a = find(\"//p[@class='txt_menue']\", XPFirst);\r\n\t\tif (a) {\r\n\t\t\ta.innerHTML += texto;\r\n\t\t}\r\n\t}", "function contarElementosImpares(String){\n\n}", "constructor() {\r\n super();\r\n this.addPart.push(new NormalPart(\"j'en ai conclu que la mousse au chocolat n'était mon fort, \"));\r\n this.addPart.push(new NormalPart(\"j'ai appellé les Avengers pour m'aider dans ma quête, \"));\r\n this.addPart.push(new NormalPart(\"j'ai crié après le perroquet \"));\r\n this.addPart.push(new NormalPart(\"j'ai toujours voulu devenir un super-héros \"));\r\n this.addPart.push(new NormalPart(\"mon copain a acheté des champignons hallucinogènes \"));\r\n this.addPart.push(new NormalPart(\"j'ai acheté des nouvelles épées kikoodelamortquitue \"));\r\n this.addPart.push(new NormalPart(\"Nina mon perroquet a crié son mécontentement \"));\r\n this.addPart.push(new NormalPart(\"ma copine m'a dit : Lui c'est un mec facile !, \"));\r\n this.addPart.push(new NormalPart(\"je me suis mise à écouter Rammstein \"));\r\n this.addPart.push(new NormalPart(\"j'ai ressorti ma vieille Nintendo DS \"));\r\n this.addPart.push(new NormalPart(\"le père Noël est sorti de sous la cheminée \"));\r\n this.addPart.push(new NormalPart(\"ma mère m'a dit : Rien ne vaut les gâteaux !, \"));\r\n this.addPart.push(new NormalPart(\"je me suis poussée à me remettre au sport \"));\r\n this.addPart.push(new NormalPart(\"un castor est sorti de la rivière \"));\r\n this.addPart.push(new NormalPart(\"Jean-pierre Pernault à parlé du Coronavirus au 20h çà m'a fait réfléchir, \"));\r\n }", "function marcar_puente(contexto, dient_1, dient_2, color_pas){\n var ctx = contexto;\n console.log('Puente de Diente Numero '+dient_1+' a '+dient_2);\n // Definiendo puntos de dibujo\n med = medida;\n num_diente1 = dient_1 - 1;\n num_diente2 = dient_2 - 1;\n color_line = color_pas;\n if (num_diente1<16){\n inicio_y = 80;\n }\n else{\n num_diente1 = num_diente1 - 16;\n num_diente2 = num_diente2 - 16;\n inicio_y = med + 160;\n }\n //alert(num_diente);\n inicio_x = (num_diente1*med) + (separacion_x*num_diente1) + separacion_x + (med/2);\n fin_x = (num_diente2*med) + (separacion_x*num_diente2) + separacion_x + (med/2);\n ctx.fillStyle = color_line;\n ctx.beginPath();\n ctx.lineWidth = 4;\n ctx.moveTo(inicio_x,inicio_y);\n ctx.lineTo(fin_x,inicio_y);\n //ctx.moveTo(inicio_x+40,inicio_y);\n //ctx.lineTo(inicio_x,inicio_y+40);\n ctx.stroke();\n ctx.lineWidth = 1;\n }", "function experiencia(anos) {\n\t\n\tif (anos >= 0 && anos < 1) {\n\t\t// De 0-1 ano: Iniciante\n\t\tconsole.log('Iniciante')\n\t} else if (anos >= 1 && anos < 3) {\n\t\t// De 1-3 anos: Intermediário\t\n\t\tconsole.log('Intermediário')\n\t} else if (anos >= 3 && anos <= 6) {\n\t\t// De 3-6 anos: Avançado\n\t\tconsole.log('Intermediário')\n\t} else {\n\t\t// De 7 acima: Jedi Master\n\t\tconsole.log('Jedi Master')\n\t}\t\n}", "function obtenerData(paul, pos) {\n switch (paul[pos]) {\n case \"Amigable\":\n console.log(\"Paul es Amigable :)\");\n break;\n case \"Rencoroso\":\n console.log(\"Paul es Una #@$!a! -.-\");\n break;\n default:\n console.log(\"Probablemente Paul sea \", paul[pos]);\n break;\n }\n}", "function subStringAsientos() {\n usuarioJson = sessionStorage.getItem('user');\n var usuariofinal=\"\";\n if(usuarioJson!==null){\n usuario= JSON.parse(JSON.stringify(usuarioJson));\n usuariofinal=usuario.id;\n }\n \n var cadena = postoS.innerHTML,\n separador = \" -\",\n asientos = cadena.split(separador);\n console.log(asientos);\n for (var i = 0; i < asientos.length-1; i++){\n purchase(asientos[i], usuariofinal);\n console.log(asientos[i]);\n }\n}", "function ContieneEspaciosVacios(cadena) {\n\n let contiene;\n const listaFinal = [];\n const listaCaracteresCadena = cadena.split('');\n \n listaCaracteresCadena.forEach(element => {\n if(element !== ' '){\n listaFinal.push(element);\n }\n \n });\n \n if(listaFinal.length !== listaCaracteresCadena.length ){\n contiene = true;\n }else{\n contiene = false;\n }\n \n return contiene;\n }", "function etapa5() {\n \n msgTratamentoEtapa4.innerHTML = \"\";\n \n //recebe\n var pacoteSelecionado = document.getElementById('jsPacote').value;\n \n if(pacoteSelecionado !== \"\"){\n \n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"5º Etapa - Valores Adicionais & Desconto\";\n\n document.getElementById('inserirValorAdicional').style.display = ''; //habilita a etapa 5\n document.getElementById('selecionarPacotes').style.display = 'none'; //desabilita a etapa 4 \n \n //recebe a string de pacote selecionado e faz um split e salva em uma lista\n resultado = pacoteSelecionado.split(\"¬\");\n\n //variavel utilizada para percorrer a lista\n var countResultado = 0;\n var idPacoteSelecionado = 0; \n\n //percorre essa lista\n resultado.forEach((valorAtual) => {\n countResultado++;\n\n //se é a primeira vez que passa na lista, pega o valorAtual e adiciona na variavel idPacoteSelecionado\n if (countResultado == 1) {\n idPacoteSelecionado = valorAtual;\n }\n //se é a segunda vez que passa na lista, pega o valorAtual e adiciona na variavel nomePacote\n if (countResultado == 2) {\n nomePacote = valorAtual;\n }\n //se é a terceira vez que passa na lista, pega o valorAtual e adiciona na variavel valorPacote\n if (countResultado == 3) {\n valorPacote = valorAtual;\n countResultado = 0;\n }\n\n }); \n\n //define o texto informação do pacote na ultima etapa\n var confirmacaoInfPacote = document.querySelector(\"#pacoteInf\");\n confirmacaoInfPacote.textContent = \"Pacote: \"+nomePacote+\" - Valor: R$\"+valorPacote; \n\n //SETA O ID DO PACOTE NO INPUT DO CADASTRO DE FESTA\n document.getElementById('idPacoteF').value = idPacoteSelecionado;\n \n }else{\n \n msgTratamentoEtapa4.innerHTML = \"É necessario informar o campo \\\"Pacote\\\" antes de seguir para a 5° Etapa!\";\n\n }\n \n }", "function pipotron(texte){\n\tlet pipotron=true;\n\t\twhile(pipotron){\n\t\t// Affichage du menu\n\t\tconsole.log(\"\\n1 : Nombre de citations\");\n\t\tconsole.log(\"0 : Retour\");\n\t\toptionPipotron=prompt(\"Choisissez une option\");\n\t\t\tif (optionPipotron===\"1\"){\n\t\t\t\tnombreCitations=Number(prompt(\"Combien de citations ? (entre 1 et 5)\"));\n\t\t\t\tif (nombreCitations>=1&&nombreCitations<=5){\n\t\t\t\t\tfor (i=1;i<=nombreCitations;i++){\n\t\t\t\t\t\tconsole.log(phraseAleatoire(texte));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(\"Ce choix n'est pas valide\");\n\t\t\t\t};\n\t\t\t}\n\t\t\telse if (optionPipotron===\"0\"){\n\t\t\t\tpipotron=false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Un autre choix indique de saisir un choix valide\n\t\t\t\tconsole.log(\"\\nMerci de choisir une option valide !\");\n\t\t\t}\n\t\t};\n}", "function exercici02() {\n let vocals = \"aeiou\"\n motRix.forEach(e=>{\n // Esbrinar si és un número\n if (/[0123456789]/.test(e)) {\n console.log(\"Els noms no contenen números\");\n }\n\n // Esbrinar si aquell caracter és vocal\n if (/[AEIOU]/.test(e)) {\n console.log(\"He trobat la vocal: \"+e);\n }\n\n // Esbrinar si aquell caracter és consonant\n // Esbrinar si aquell caracter és vocal\n if (/[BCDFGHJKLMNPQRSTVWXYZ]/.test(e)) {\n console.log(\"He trobat la consonant: \"+e);\n }\n });\n}", "function IndicadorRangoEdad () {}", "function retangulo(largura, altura) {\n for (i = 0; i < altura; i++) {\n var desenho = \"\";\n for (x = 0; x < largura; x++) {\n desenho += \"*\";\n }\n console.log(desenho);\n }\n}", "function Titulo(pares, dom) {\n var titulo = '';\n for (var i = 0; i < pares.length; ++i) {\n var parcial = pares[i];\n for (var chave in parcial) {\n titulo += chave + ': ' + StringSinalizada(parcial[chave]) + '\\n';\n }\n }\n if (titulo.length > 0) {\n titulo = titulo.slice(0, -1);\n }\n dom.title = titulo;\n}", "function formatarMenu(paginas) {\n // inicializa o menu formatado\n let menu = { path: 'menu', subpath: [] };\n\n // varre todas as paginas da lista\n paginas.forEach(function (pagina) {\n // quebra cada item da hierarquia\n let hierarquia = pagina.path.split('/');\n\n // varre toda a hierarquia da pagina (inicializa o diretoria atual com o menu root)\n for (let i = 0, atual = menu; i < hierarquia.length; i++) {\n\n // popula verificando se é uma pagina, root ou uma pasta\n let item;\n\n // pagina\n if (i == hierarquia.length - 1)\n item = pagina;\n // root\n else if (i == 0)\n item = { path: hierarquia[i], subpath: [], imagem: pagina.imagem, root: 1 };\n // pasta\n else\n item = { path: hierarquia[i], subpath: [] };\n\n // procura este item dentro da hierarquia\n let find = atual.subpath.find(f => f.path === item.path);\n\n // se não encontrar adiciona\n if (find === undefined)\n atual.subpath.push(item);\n\n // seta o diretorio atual de pesquisa para o item adicionado (ou ja existente)\n atual = atual.subpath.find(f => f.path === item.path);\n }\n });\n // retorna\n return menu;\n }", "function ligne(nombreMax, caractere) {\n\tvar resultat= \"\";\n\tfor (i = 0; i < nombreMax; i ++) {\n\t\tresultat += caractere;\n\t}\n console.log(resultat);\n}", "function pintarGuiones(num) {\r\n for (var i = 0; i < num; i++) {\r\n oculta[i] = \"_\";\r\n }\r\n hueco.innerHTML = oculta.join(\"\");//join() une todos los elementos de un array formando una cadena y separándolos con aquel argumento que definamos\r\n}", "function mostrarEstrellas(puntaje) {\r\n let estrellaVacia = '<span class=\"fa fa-star>\"</span>'\r\n let estrellaLlena = '<span class=\"fa fa-star\"checked></span>'\r\n \r\n \r\n let puntajeEstrella = \"\"\r\n \r\n for(let i = 0; i < puntaje ; i++){\r\n puntajeEstrella += estrellaLlena\r\n }\r\n for(let i = 0; i < (5-puntaje) ; i++){\r\n puntajeEstrella += estrellaVacia\r\n }\r\n return puntajeEstrella\r\n}", "function desenhaTriangulos(altura) {\n linha = '*';\n for (i = 0; i < altura; i++) {\n console.log(linha);\n linha+='*';\n }\n}", "function printProperlyIndex (){\n estructurProperly = \"\"\n for (propiedades in carrito[0]){\n estructurProperly += '<div id=\"indexItem-'+ propiedades +'\" class=\"index-item\">' + propiedades.toUpperCase() + '</div>';\n }\n estructurProperly += '<div id=\"indexItem-eliminar\" class=\"index-item\"></div>';\n document.getElementById(\"chopping-properly\").innerHTML = estructurProperly;\n}", "get historialCapitalizado(){\n\n return this.historial.map(lugar => {\n // partimos por los espacions\n let palabras = lugar.split (' ')\n // en cada palabra la primera la pasamos a mayuscula\n palabras = palabras.map( p => p[0].toUpperCase() + p.substring(1));\n // retornamos todo unido\n return palabras.join(' ');\n })\n }", "function asigna_lentes () {\n var filas = obtener_valor('filPLANT');\n var i = 1;\n for (i = 1; i <= filas; i++) {\n asignar_valorM('PLANT',\"<a href=javascript:abrir_archivo(\" + i + \",'\"+ 'PLANT' +\"',\" + 6 + \") ><img src=images/verexp.png border=0></a>\",i,5); \n }\n}", "function pintarDeportes(deporte = \"\") {\n let eventos = listaDeportes(data, deporte);\n let logosDeportes = document.getElementById(\"logosDeportes\");\n if (logosDeportes) {\n logosDeportes.innerHTML = \"\";\n eventos.forEach(function (disciplina) {\n const imagen = document.createElement(\"img\");\n imagen.setAttribute(\"src\", `./assets/depOlimpicos/${disciplina}.svg`);\n const cajaDisciplina = document.createElement(\"div\");\n cajaDisciplina.classList.add(\"tipoDeporte\");\n const titulo = document.createElement(\"h3\");\n titulo.innerHTML = disciplina.replace(\"_\", \" \");\n cajaDisciplina.insertAdjacentElement(\"beforeend\", imagen);\n cajaDisciplina.insertAdjacentElement(\"beforeend\", titulo);\n logosDeportes.insertAdjacentElement(\"beforeend\", cajaDisciplina);\n });\n }\n}", "function getSectionsOf(item){\n let sl = []\n console.log(\"on renvoie deja \"+item.name)\n sl.push(item.name)\n if (typeof item.sections != 'undefined'){\n for (l=0;l<item.sections.length;l++){\n var ti = l;\n console.log(\"on traite l'enfant numero \"+l+\" soit \"+item.sections[l].name)\n for (const s of getSectionsOf(item.sections[l])){\n sl.push(s);\n } \n l=ti;\n console.log(\"...le \"+l+\" ieme est fini pass au suivant\")\n }\n }\n return sl\n}", "function quitarEspacios (arrayWithLether) { \r\n const arrayNoSpaces = [];\r\n for(let i = 0; i < arrayWithLether.length; i++) {\r\n //convertir siguiente letra al espacio detectado en Mayus \r\n if (arrayWithLether[i] === \" \") { \r\n let j = i + 1;\r\n let nextLetter = arrayWithLether[j];\r\n let mayus = nextLetter.toUpperCase(); \r\n arrayWithLether[j] = mayus;\r\n } else {\r\n arrayNoSpaces.push(arrayWithLether[i]);\r\n }\r\n }\r\n return arrayNoSpaces;\r\n}", "function caricaElencoScritture() {\n var selectCausaleEP = $(\"#uidCausaleEP\");\n caricaElencoScrittureFromAction(\"_ottieniListaConti\", {\"causaleEP.uid\": selectCausaleEP.val()});\n }", "function posicionaNaviosAdversario(){\r\n for (var i = 0; i < 10; i++){\r\n linhaRandom = Math.floor(Math.random()*10);\r\n colunaRandom = Math.floor(Math.random()*10);\r\n if (tabuleiro[linhaRandom][colunaRandom] == ' ~~~~ '){\r\n tabuleiro[linhaRandom][colunaRandom] = \" OOOO \";\r\n contadorComputador++;\r\n }\r\n }\r\n naviosComputador = contadorComputador;\r\n}", "function agregarCompra1(){\r\n let compra = document.getElementById('producto1')\r\n let precio = document.getElementById('txt1')\r\n let vendedor = document.getElementById('vend1')\r\n let modelo = document.getElementById('modelo1')\r\n let orden = `\r\n <div id=\"tit1\" class=\"fs-4 fw-bold\">${compra.textContent}</div>\r\n <p class=\"mt-1 fw-bold\" >Precio: <div id=\"pre1\" class=\"fs-5\">${precio.textContent}</div></p>\r\n <p class=\"mt-1 fw-bold\" >Año: <div id=\"mod1\" class=\"fs-5\">${modelo.textContent}</div></p>\r\n <p class=\"mt-1 fw-bold\" >Vendedor: <div id=\"ven1\" class=\"fs-5\">${vendedor.textContent}</div></p>\r\n `\r\n document.getElementById('compras').innerHTML = orden;\r\n}", "formularioUno(contPar,formPar,filPar){/* avisoCuatro.css*/\n\t\tlet txt,fil;\n\t\t//contenedor\n\t\tconst contenedor = document.createElement('div');\n\t\tcontenedor.setAttribute('class',contPar[1]);\n\t\tcontenedor.setAttribute('id',contPar[2]);\n\t\t//titulo\n\t\tconst titulo = document.createElement('p');\n\t\ttxt = document.createTextNode(contPar[0]);\n\t\ttitulo.appendChild(txt);\n\t\tcontenedor.appendChild(titulo);\n\t\t// form\n\t\tconst formul = document.createElement('form');\n\t\tformul.setAttribute('class',formPar[0]);\n\t\tformul.setAttribute('id',formPar[1]);\n\t\t//filas\n\t\tfilPar.forEach((item,index) =>{\n\t\t\tfil = document.createElement('div');\n\t\t\tfil.setAttribute('class',formPar[2]);\n\t\t\tfil.setAttribute('id',`${formPar[2]}-${index}`);\n\t\t\titem.forEach(it => {fil.appendChild(it);});\n\t\t\tformul.appendChild(fil);\n\t\t});\n\t\tcontenedor.appendChild(formul);\n\t\treturn contenedor;\n\t}", "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "function triangulo(altura) {\n var desenho = \"\";\n for (i = 0; i < altura; i++) {\n desenho += \"*\";\n console.log(desenho);\n }\n}", "function imprimirEdad(n,e){\n console.log(`${n} tiene ${e} años`)\n}" ]
[ "0.6574808", "0.6530099", "0.6444351", "0.6123187", "0.6042969", "0.5998561", "0.59914553", "0.5956192", "0.59134245", "0.58650947", "0.5848309", "0.5848309", "0.58188474", "0.5801435", "0.57717395", "0.57565117", "0.57544017", "0.5710903", "0.5710903", "0.56141084", "0.56066823", "0.5605154", "0.5579854", "0.5547415", "0.5522106", "0.55217683", "0.5511355", "0.54927903", "0.5482122", "0.5481277", "0.5473169", "0.5472082", "0.54699254", "0.54617363", "0.5443752", "0.54299814", "0.54101306", "0.53990793", "0.5394279", "0.5381172", "0.5378259", "0.5359913", "0.53589904", "0.53520775", "0.53356", "0.5321418", "0.53206867", "0.5300917", "0.5300058", "0.5291955", "0.52855825", "0.5284686", "0.5280189", "0.5272926", "0.5270647", "0.5270451", "0.5270144", "0.5266897", "0.5261212", "0.52590024", "0.5256231", "0.5256075", "0.5253766", "0.5244054", "0.52430445", "0.523855", "0.5230199", "0.5228909", "0.5228715", "0.52262366", "0.5224698", "0.52126", "0.52116185", "0.5211562", "0.5208762", "0.5206855", "0.51894253", "0.51843214", "0.51807237", "0.51762146", "0.517129", "0.5165647", "0.51597726", "0.5157213", "0.5155471", "0.51493126", "0.5148818", "0.5148353", "0.51473707", "0.5146497", "0.51462203", "0.5140523", "0.5139722", "0.5139589", "0.51295173", "0.5124337", "0.5122865", "0.5112607", "0.51121235", "0.5105485", "0.5104219" ]
0.0
-1
SOLO PERMITE NUMEROS, lETRAS Y ESPACIOS
function soloNumerosLetrasYEspacios(e) { key=e.keyCode || e.which; teclado=String.fromCharCode(key).toLowerCase(); letras=" .,-_*/aábcdeéfghiíjklmnñoópqrstuúvwxyz0123456789"; especiales="8-37-38-46-164"; teclado_especial=false; for(var i in especiales) { if(key==especiales[i]) { teclado_especial=true; break; } } if(letras.indexOf(teclado)==-1 && !teclado_especial) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arreglar(numero){\n var numeroo=\"\";\n numero=\"\"+numero;\n partes=numero.split(separadorDecimalesInicial);\n entero=partes[0];\n if(partes.length>1)\n {\n decimal=partes[1];\n }\n cifras=entero.length;\n cifras2=cifras\n for(a=0;a<cifras;a++){\n cifras2-=1;\n numeroo+=entero.charAt(a);\n if(cifras2%3==0 &&cifras2!=0){\n numeroo+=separadorMiles;\n }\n }\n if(partes.length>1){\n numeroo+=separadorDecimales+decimal;\n }\n return numeroo\n }", "function numero(xx) { //recoge el n&uacute;mero pulsado en el argumento.\r\n if (x==\"0\" || xi==1 ) { // inicializar un n&uacute;mero, \r\n pantalla.innerHTML=xx; //mostrar en pantalla\r\n x=xx; //guardar n&uacute;mero\r\n if (xx==\".\") { //si escribimos una coma al principio del n&uacute;mero\r\n pantalla.innerHTML=\"0.\"; //escribimos 0.\r\n x=xx; //guardar n&uacute;mero\r\n coma=1; //cambiar estado de la coma\r\n }\r\n }\r\n else { //continuar escribiendo un n&uacute;mero\r\n if (xx==\".\" && coma==0) { //si escribimos una coma decimal pòr primera vez\r\n pantalla.innerHTML+=xx;\r\n x+=xx;\r\n coma=1; //cambiar el estado de la coma \r\n }\r\n //si intentamos escribir una segunda coma decimal no realiza ninguna acci&oacute;n.\r\n else if (xx==\".\" && coma==1) {} \r\n //Resto de casos: escribir un n&uacute;mero del 0 al 9: \r\n else {\r\n pantalla.innerHTML+=xx;\r\n x+=xx\r\n }\r\n }\r\n xi=0 //el n&uacute;mero est&aacute; iniciado y podemos ampliarlo.\r\n }", "function auxLetras(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 15)\n simbolo = 'M';\n else if (promedio >= 16 && promedio <= 31)\n simbolo = 'N';\n else if (promedio >= 32 && promedio <= 47)\n simbolo = 'H';\n else if (promedio >= 48 && promedio <= 63)\n simbolo = '#';\n else if (promedio >= 64 && promedio <= 79)\n simbolo = 'Q';\n else if (promedio >= 80 && promedio <= 95)\n simbolo = 'U';\n else if (promedio >= 96 && promedio <= 111)\n simbolo = 'A';\n else if (promedio >= 112 && promedio <= 127)\n simbolo = 'D';\n else if (promedio >= 128 && promedio <= 143)\n simbolo = '0';\n else if (promedio >= 144 && promedio <= 159)\n simbolo = 'Y';\n else if (promedio >= 160 && promedio <= 175)\n simbolo = '2';\n else if (promedio >= 176 && promedio <= 191)\n simbolo = '$';\n else if (promedio >= 192 && promedio <= 209)\n simbolo = '%';\n else if (promedio >= 210 && promedio <= 225)\n simbolo = '+';\n else if (promedio >= 226 && promedio <= 239)\n simbolo = '.';\n else if (promedio >= 240 && rgbPromedio <= 255)\n simbolo = ' ';\n return simbolo;\n\n}", "function auxNaipes(promedio) {\n let simbolo;\n\n if(promedio > 0 && promedio <= 19) \n simbolo = 'A';\n else if(promedio >= 20 && promedio <= 38) \n simbolo = 'B';\n else if(promedio >= 39 && promedio <= 57) \n simbolo = 'C';\n else if(promedio >= 58 && promedio <= 76) \n simbolo = 'D';\n else if(promedio >= 77 && promedio <= 95) \n simbolo = 'E';\n else if(promedio >= 96 && promedio <= 114) \n simbolo = 'F';\n else if(promedio >= 115 && promedio <= 133) \n simbolo = 'G';\n else if(promedio >= 134 && promedio <= 152) \n simbolo = 'H';\n else if(promedio >= 153 && promedio <= 171) \n simbolo = 'I';\n else if(promedio >= 172 && promedio <= 190) \n simbolo = 'J';\n else if(promedio >= 191 && promedio <= 209) \n simbolo = 'K';\n else if(promedio >= 210 && promedio <= 228) \n simbolo = 'L';\n else if(promedio >= 229 && promedio <= 256) \n simbolo = 'M';\n return simbolo;\n\n}", "function nombre_mes(mes) {\r\n let m_l = meses[mes].length;\r\n let linea = ' '.repeat(11 - Math.floor(m_l / 2)) + meses[mes];\r\n linea = linea + ' '.repeat(22 - linea.length) + '|';\r\n return linea;\r\n}", "function setNumberFormat(numero, decimales, sep_decimales, sep_millares) {\r\n\tvar monto = new String(numero);\r\n\tvar partes = monto.split(\".\");\r\n\tvar parte_entera = new String(partes[0]);\r\n\tif (partes[1] == undefined) var parte_decimal = new String(\"\"); else var parte_decimal = new String(partes[1]);\r\n\tvar parte_derecha = new String(\"\");\r\n\tvar parte_izquierda = new String(\"\");\r\n\tvar ceros = new String(\"\");\r\n\t\r\n\tif (partes.length <= 2) {\r\n\t\t//\tAgrego la separacion de los millares...\r\n\t\tvar con = 0;\r\n\t\tfor (i = parte_entera.length-1; i>=0; i--) {\r\n\t\t\tcon++;\r\n\t\t\tif (con % 3 == 0 && i != 0) parte_derecha = sep_millares + parte_entera.charAt(i) + parte_derecha;\r\n\t\t\telse parte_derecha = parte_entera.charAt(i) + parte_derecha;\r\n\t\t}\r\n\t\t\r\n\t\t//\tObtengo los decimales...\r\n\t\tif (decimales == parte_decimal.length) parte_izquierda = sep_decimales + parte_decimal; \r\n\t\telse if (decimales < parte_decimal.length) {\r\n\t\t\tvar redondear_1 = parte_decimal.substr(0, decimales);\r\n\t\t\tvar redondear_2 = parte_decimal.substr(decimales, 1);\t\t\t\r\n\t\t\tif (redondear_2 >= 5) redondear_1++;\r\n\t\t\tvar aredondear = new String(redondear_1);\r\n\t\t\t\r\n\t\t\tif (decimales > aredondear.length) {\r\n\t\t\t\tvar num_ceros = decimales - aredondear.length;\r\n\t\t\t\tfor (i=0; i<num_ceros; i++) ceros += \"0\";\r\n\t\t\t\t\r\n\t\t\t\tparte_izquierda = sep_decimales + ceros + aredondear;\r\n\t\t\t\t\r\n\t\t\t} else parte_izquierda = sep_decimales + redondear_1;\r\n\t\t}\r\n\t\telse if (decimales > parte_decimal.length) {\r\n\t\t\tvar num_ceros = decimales - parte_decimal.length;\r\n\t\t\tfor (i=0; i<num_ceros; i++) ceros += \"0\";\r\n\t\t\t\r\n\t\t\tparte_izquierda = sep_decimales + parte_decimal + ceros;\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn parte_derecha + parte_izquierda;\r\n}", "function pintarGuiones(num) {\r\n for (var i = 0; i < num; i++) {\r\n oculta[i] = \"_\";\r\n }\r\n console.log(oculta)\r\n hueco.innerHTML = oculta.join(\"\"); //me escribe en el html la cadena la cual contiene las lineas azules depende de la palabra\r\n}", "function Cletras (cadena){\n var numeroL = eliminarespacios(cadena).length;\n return (\"3.- Numero de Letras: \"+numeroL);\n}", "function celNumbers() {\n let cant = document.getElementById('numero').value;\n var txt = document.getElementById('txt');\n var numeros = [];\n txt.value = \"\";\n\n for(let x = 0; x < cant; x++){\n numeros[x] = \"9\" + lada[aleatorio(22)];\n for(let y = 0; y < 6; y++){\n numeros[x] += \"\" + aleatorio(9);\n }\n txt.value += numeros[x] + \"\\n\";\n }\n}", "function Cpalabras (cadena){\n var numerop = cadena.split(\" \").length;\n return (\"2.- Palabras: \"+numerop);\n}", "function oNumero(numero) {\n\t//Propiedades\n\tthis.valor = numero || 0\n\tthis.dec = -1;\n\t// Metodos\n\tthis.formato = numFormat;\n\tthis.ponValor = ponValor;\n\t// Definicion de los metodos\n\tfunction ponValor(cad) {\n\t\tif (cad == '-' || cad == '+')\n\t\t\treturn\n\n\t\tif (cad.length == 0)\n\t\t\treturn\n\n\t\tif (cad.indexOf('.') >= 0)\n\t\t\tthis.valor = parseFloat(cad);\n\t\telse\n\t\t\tthis.valor = parseInt(cad);\n\t}\n\tfunction numFormat(dec, miles) {\n\t\tvar num = this.valor, signo = 3, expr;\n\t\tvar cad = \"\" + this.valor;\n\t\tvar ceros = \"\", pos, pdec, i;\n\t\tfor (i = 0; i < dec; i++)\n\t\t\tceros += '0';\n\t\tpos = cad.indexOf('.');\n\t\tif (pos < 0) {\n\t\t\tif (ceros != \"\") {\n\t\t\t\tcad = cad + \".\" + ceros;\n\t\t\t}\n\t\t} else {\n\t\t\tpdec = cad.length - pos - 1;\n\t\t\tif (pdec <= dec) {\n\t\t\t\tfor (i = 0; i < (dec - pdec); i++)\n\t\t\t\t\tcad += '0';\n\t\t\t} else {\n\t\t\t\tnum = num * Math.pow(10, dec);\n\t\t\t\tnum = Math.round(num);\n\t\t\t\tnum = num / Math.pow(10, dec);\n\t\t\t\tcad = new String(num);\n\t\t\t}\n\t\t}\n\t\tpos = cad.indexOf('.');\n\t\tif (pos < 0)\n\t\t\tpos = cad.lentgh;\n\n\t\tif (cad.substr(0, 1) == '-' || cad.substr(0, 1) == '+')\n\t\t\tsigno = 4;\n\n\t\tif (miles && pos > signo)\n\t\t\tdo {\n\t\t\t\texpr = /([+-]?\\d)(\\d{3}[\\.\\,]\\d*)/;\n\t\t\t\tcad.match(expr);\n\t\t\t\tcad = cad.replace(expr, RegExp.$1 + '' + RegExp.$2);\n\t\t\t} while (cad.indexOf(',') > signo);\n\n\t\tif (dec < 0)\n\t\t\tcad = cad.replace(/\\./, '');\n\n\t\treturn cad;\n\t}\n}", "function auxDomino(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 25)\n simbolo = '1';\n else if (promedio >= 26 && promedio <= 50)\n simbolo = '2';\n else if (promedio >= 51 && promedio <= 75)\n simbolo = '3';\n else if (promedio >= 76 && promedio <= 100)\n simbolo = '4';\n else if (promedio >= 101 && promedio <= 125)\n simbolo = '5';\n else if (promedio >= 126 && promedio <= 150)\n simbolo = '6';\n else if (promedio >= 151 && promedio <= 175)\n simbolo = '7';\n else if (promedio >= 176 && promedio <= 200)\n simbolo = '8';\n else if (promedio >= 201 && promedio <= 225)\n simbolo = '9';\n else if (promedio >= 226 && promedio <= 256)\n simbolo = '0';\n return simbolo;\n\n}", "function nota_promedio(){\n\t\tvar sum = 0;\n\t\tvar pro = 0;\n\t\tfor(num = 0; num < alumnos.length; num ++){\n\t\t\tsum += (alumnos[num].nota);\n\t\t}\n\t\tpro = sum / 10;\n\t\tdocument.getElementById(\"promedio\").innerHTML = \"El Promedio es: <b>\" + pro.toFixed(2) + \"</b>\";\n\t}", "function soma(nnumero){\r\n let cont = 0;\r\n for (let num of numeros){\r\n cont = cont +num\r\n }\r\n return soma \r\n }", "function operacion(){\r\n if (numeros.segundo === null || numeros.segundo === \"\" || Number.isNaN(numeros.segundo)){ \r\n return raiz(); // Si hay un solo número, llamar a la funcion raiz\r\n } else {\r\n return aritmetica(); // Si hay dos a la función aritmética\r\n }\r\n }", "function presionarNumero(numero){\n console.log(\"numero\",numero)\n\n calculadora.agregarNumero(numero)\n actualizarDisplay()\n}", "function comprobacion(e) {\n\t var numeros=\"0123456789\";\n\nfunction tiene_numeros(texto){\n for(i=0; i<texto.length; i++){\n if (numeros.indexOf(texto.charAt(i),0)!=-1){\n \t//si retorna 1 es que encontro numeros en el texto\n return 1;\n }\n }\n //si retorna 0 solo contiene letras\n return 0;\n}\n}", "function pintarGuiones(num) {\r\n for (var i = 0; i < num; i++) {\r\n oculta[i] = \"_\";\r\n }\r\n hueco.innerHTML = oculta.join(\"\");//join() une todos los elementos de un array formando una cadena y separándolos con aquel argumento que definamos\r\n}", "function RellenaTexto(aux, TotalDigitos, TipoCaracter) {\r\n\tvar Numero = aux.toString();\r\n\tvar mon_len = parseInt(TotalDigitos) - Numero.length;\r\n\t\r\n\tif (mon_len<0) { \r\n\t\tmon_len = mon_len * -1;\r\n\t}\r\n\t// Solo para el tipo caracter\r\n\tif (TipoCaracter == 'C') {\r\n\t\tmon_len = parseInt(mon_len) + 1;\r\n\t}\r\n\t\r\n\tif (Numero == null || Numero == '') {\r\n\t\tNumero = '';\r\n\t} \r\n\r\n\tvar pd = '';\r\n\tif (TipoCaracter == 'N') {\r\n\t\tpd = repitechar(TotalDigitos,'0');\r\n\t} else {\r\n\t\tpd = repitechar(TotalDigitos,' ');\r\n\t}\r\n\tif (TipoCaracter == 'N') {\r\n\t\t// Numero = pd.substring(0, mon_len) + Numero;\r\n\t\tTotalDigitos = parseFloat(TotalDigitos) * -1;\r\n\t\tNumero = (pd + Numero).slice(TotalDigitos);\r\n\t\treturn Numero;\r\n\t} else {\r\n\t\tNumero = Numero + pd;\r\n\t\treturn Numero.substring(0, parseInt(TotalDigitos));\r\n\t}\r\n}", "function print_don() {\n // quando il metodo mi deve ritornare qualcosa per prima cosa inizializzo la variabile e in fondo\n // metto il \"return nomevariabile;\"\n let text = \"\";\n\n //let miosaldo = 0;\n\n //let maxver = 0;\n\n\n for (i = 0; i < ar_numeri.length; i++) {\n // In questo modo tutte le linee vengono generate con uno span con un id univoco, quindi possono essere gestiti anche singolarmenti\n text += \"<span id'don\" + i + \"'>\" + ar_numeri[i]+\"</span><br/>\";\n\n }\n\n\n return text;\n}", "function addPoints(nombre) // il s'agit d'un séparateur de millier ==> by Vulca <==\r\n\t\t{\r\n\t\t\tvar signe = '';\r\n\t\t\tif (nombre<0)\r\n\t\t\t{\r\n\t\t\t\tnombre = Math.abs(nombre);\r\n\t\t\t\tsigne = '-';\r\n\t\t\t}\r\n\t\t\tnombre=parseInt(nombre);\r\n\t\t\tvar str = nombre.toString(), n = str.length;\r\n\t\t\tif (n <4) {return signe + nombre;}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\treturn signe + (((n % 3) ? str.substr(0, n % 3) + '.' : '') + str.substr(n % 3).match(new RegExp('[0-9]{3}', 'g')).join('.'));\r\n\t\t\t}\r\n\t\t}", "tratarDigito() {\n let numero = \"\";\n\n numero = numero.concat(this.caracter);\n this.lerCaracter();\n\n while (/[0-9]/g.test(this.caracter) === true) {\n numero = numero.concat(this.caracter);\n this.lerCaracter();\n }\n this.token.lexema = +numero\n this.token.simbolo = \"snumero\"\n this.token.linha = this.numLinha\n }", "function moedaPadrao(valor){\r\n\tvar valor2 = \"\";\r\n\tif(valor.length <= 6){\r\n\t\t\tvalor2 = valor.replace(\",\",\".\");\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tvalor = valor.replace(\",\",\".\");\r\n\t\t\tvalor = valor.split(\".\");\r\n\t\t\tvar tam = valor.length;\r\n\t\t\tfor(var x = 0; x <= tam-1; x++){\r\n\t\t\t\tif(x == tam-1)\r\n\t\t\t\t\tvalor2 = valor2+\".\"+valor[x];\r\n\t\t\t\telse\r\n\t\t\t\t\tvalor2 = valor2+valor[x];\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvalor = Number(valor2);\r\n\t\treturn valor\r\n}", "function getNumeroFormatado(numero){ \r\n if (numero == \"-\"){\r\n return \"\";\r\n } \r\n let n = Number(numero);\r\n let valor = n.toLocaleString(\"pt-br\");\r\n return valor;\r\n}", "function getPelnas() {\n var pajamos = 12500;\n var islaidos = 7500;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + (pajamos-islaidos) + \"<br>\";\n return pajamos-islaidos;\n}", "function CalcularDigito(strGrupo) {\n var arrPeso = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2];\n var intSoma = 0;\n var intDigito = 0;\n\n for (x = strGrupo.length - 1, intDigito; x >= 0; x--) {\n intDigito = parseInt(strGrupo.substring(x, x + 1));\n intSoma += intDigito * arrPeso[arrPeso.length - strGrupo.length + x];\n }\n\n intSoma = 11 - intSoma % 11;\n return intSoma > 9 ? 0 : intSoma;\n}", "function numeros(caracter) {\n lugarDeColocacion = input.value.length + ultimoIndice; \n input.value = insertarCaracter(lugarDeColocacion,input.value,caracter);\n}", "function agregaNumerosArreglo(cadenaNumeros){//Recibe nuestra cadena de numeros\n let contador = 0;\n let par_num = \"\";\n let longuitud_cadena = 0;\n const lengthC = cadenaNumeros.length;//longuitud de nuestra cadena recibida\n \n for (let numero of cadenaNumeros) {//recorremos nuestro mensaje \n if(contador === 2){//si mi contador es === 2 ya tenemos un par de numeros asi que lo agregamos a nuestro arreglo\n contador = 1;//inicializamos el contador en 1 porque si no se salta 1 numero\n arr_numeros.push(par_num);//agregamos el par de numeros que tenemos a nuestro arreglo\n par_num = \"\" + numero; //le damos a nuestra variable el valor de la letra actual \n longuitud_cadena ++;\n }else{//contador menor a 2\n longuitud_cadena++\n par_num = par_num + numero;//concatenamos lo que tenemos en par_num con nuestro numero actual\n contador++;\n //para evitar que no agregue el ultimo par de numeros nos apoyamos de longuitud_cadena\n //al final de todo el recorrido tendremos longuitudes iguales por lo que el ultimo numero se agregara\n if (longuitud_cadena === lengthC) {\n arr_numeros.push(par_num);\n }\n }\n }\n \n return arr_numeros;//regresamso nuestro arreglo de numeros\n}", "function cantidad_pares_arreglo() {\n\tvar pares = new Number();\n\tvar i = new Number();\n\tvar cantidad = new Number();\n\tvar cantidadpares = new Number();\n\tvar cantidadimpares = new Number();\n\ti = 0;\n\tdocument.write(\"Digite el limete del arreglo: \",'<BR/>');\n\tcantidad = Number(prompt());\n\tvar pares = new Array(cantidad);\n\tfor (i=0;i<=cantidad-1;i++) {\n\t\t// Escribir i+1,\". Digita un numero: \";\n\t\t// Leer pares[i];\n\t\t// numero azar para asignar valores y no pedirlos al usuario\n\t\tpares[i] = Math.floor(Math.random()*100);\n\t\tif (pares[i]%2==0) {\n\t\t\tcantidadpares = cantidadpares+1;\n\t\t} else {\n\t\t\tcantidadimpares = cantidadimpares+1;\n\t\t}\n\t\t// Escribir pares[i];\n\t}\n\tdocument.write(\"Hay un total de: \",cantidadpares,\" numeros pares\",'<BR/>');\n\tdocument.write(\"Hay un total de: \",cantidadimpares,\" numeros impares\",'<BR/>');\n}", "function funcion() {\n return numeracion;\n}", "function numberFormat(numero,decimais) {\n tmpNum = String(numero+\"\");\n \n //aTMP = new Array(2);\n aTMP = tmpNum.split(\".\");\n \n retorno = aTMP[0]+\",\";\n \n if( aTMP[1] == undefined ) \n retorno += \"00\";\n else {\n retorno += rpad(aTMP[1],2,\"0\");\n }\n \n return(retorno);\n\n}", "function calcular() {\r\n var NUMEROYSIGNO = document.micalcu.display.value; //ME CREO UNA VARIABLE QUE ES IGUAL=document.nombreformulario.dondesemuestra.value -->\r\n document.micalcu.display.value = eval(NUMEROYSIGNO); // y digo que los datos metidos me lo cualcule la funcion eval(NUMEROYSIGNO) -->\r\n}", "function calculaPontos(jogador) {\n var pontos = jogador.vitorias * 3 + jogador.empates;\n return pontos;\n }", "function NumeroLetras (frase){\n //var frase = \"El mundo es tan cruel\";\nvar vacio = frase.split (\" \");\n\nconsole.log(\"La frase tiene \" + vacio.length + \" caracteres.\")\n\n}", "function paridispari(numpass) {\n var parDisprisult;\n // dichiaro le condizioni\n if (numpass % 2 === 0) {\n parDisprisult = \"pari\";\n // console.log(somma + \" è pari\");\n } else {\n parDisprisult = \"dispari\"\n // console.log(somma + \" è dispari\");\n }\n return parDisprisult;\n}", "function agregarNumero(num) {\n // llevandolo a texto para concatenar (para unir), recordar que la pantalla es in input text\n opeActual = opeActual.toString() + num.toString();\n actualizarPantalla();\n\n}", "function getPelnas22(pajamos, islaidos){\n var pelnas = pajamos - islaidos;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + pelnas + \"<br>\";\n return pelnas;\n}", "function ArrondirAu(Nombre, Seuil) {\n Multiple = Math.round(Nombre / Seuil);\n return Multiple * Seuil;\n}", "function descuentoPersonas(precio, personas){\n var descuentoTotal = 0;\n \n if (personas >= 4 && personas <= 6) {\n descuentoTotal = precio * 5;\n }\n if (personas >= 7 && personas <= 8) {\n descuentoTotal = precio * 10;\n \n }\n if (personas > 8) {\n descuentoTotal = precio * 15;\n }\n return descuentoTotal / 100;\n}", "function calcTabuada(numero) {\n console.log(\"===========================\");\n if (isNaN(numero)) { //tratamento para o input, se for NaN, o código nao executará\n console.log(\"ERRO! Por favor, digite apenas números inteiros.\");\n } else {\n for (numeroEscolhido = 1; numeroEscolhido <= numero; numeroEscolhido++) {\n console.log(`A tabuada do número ${numeroEscolhido} é: `);\n\n for (index = 1; index <= 10; index++) {\n\n console.log(`${index} * ${numeroEscolhido} é igual a: ${index*numeroEscolhido}`);\n }\n\n console.log(\"===========================\");\n }\n }\n}", "function calculaParcelaFinanciamento (valor,meses){\n var parcela={parcela:0, seguro:0, txadm:0}; \n //caso o prazo seja menor que 12 meses, não há incidência de juros\n if (meses<=12){\n parcela[\"parcela\"]=valor/meses;\n \n return parcela;\n }else{\n //caso contrário, procede ao cálculo financeiro \n var i=0.009488793;\n var numerador= i*Math.pow(1+i,meses);\n var denominador= Math.pow(1+i,meses)-1; \n var valorparcela=valor*(numerador/denominador);\n \n parcela[\"parcela\"]=valorparcela;\n parcela[\"seguro\"]=0.00019*valor;\n parcela[\"txadm\"]=25.00;\n \n return parcela;\n \n }//fim do else\n}//fim da função calculaParcelaFinanciamento ", "function getPelnas(pajamos, mokesciai, mokesciai2){\nvar pelnas = (pajamos - (pajamos * mokesciai)) - (pajamos - (pajamos * mokesciai)) * mokesciai2;\n return pelnas;\n}", "function calculaPontos(jogador) {\n var pontos = jogador.vitorias * 3 + jogador.empates;\n return pontos;\n}", "function repeticao (texto){\n let texto = \"Essa sentença se repetirá 10 vezes\";\n return (texto*10)\n}", "function procesoPrecio(){\n\n var getMinimo = minimo.slice(-1);\n var getMaximo = maximo.slice(-1);\n \nif(getMinimo != 0 && getMaximo != 0){\n formdata.append(\"minimo\",getMinimo);\n formdata.append(\"maximo\",getMaximo);\n}\n}", "function promedio_uno(){\n\tfor(i=0;i<8;i++){\n\t\tnumero = Number(prompt(\" ingresa tu número \" + (i+1)));\n\t\tsumaUno = sumaUno + numero; // Se almacena la sumaUno\n\t\tdocument.getElementById(\"p4_1\").innerHTML = \"el promedio de tus números es \" + (sumaUno/8);\n\t}\n}", "function AjPoFo() {\r\n \r\n if (perso.Por < 2) { //Test si assez d'argent\r\n alert(\"Vous n'avez pas assez d'argent\");\r\n console.log(\"Pas assez d'argent / nombre de potion = \"+ perso.Pinv[0]);\r\n } else {\r\n perso.Por -= 2; //Or du perso -2\r\n perso.Pinv[0] += 1; //Nombre de potion +1 \r\n document.getElementById('or').value = perso.Por; //affiche Or du perso dans la div caracteristique\r\n document.getElementById('nbPoFo').value = perso.Pinv[0]; //affiche le nombre de potion\r\n console.log(\"Achat d'une potion de force / nombre de potion = \"+ perso.Pinv[0]);\r\n }\r\n\r\n}", "function getFormatDocumentum(pObjeto){\n\n\t//18 ENERO 2016\n\tvar vSrc = pObjeto.value;\n\tvSrc = vSrc.replace(/ /g, ''); //Quitar espacios en cadena\n\tvSrc = vSrc.trim();\t\n\tpObjeto.value = vSrc; \n\t\n\tvar vSeparador = '-';\n\tvar vPatron = new Array(3,3,3,4,4,5,2,2,3);\n\tvar vNumerico = true;\n\n\tif(pObjeto.valant != pObjeto.value){\n\t\tval = pObjeto.value\n\t\tlargo = val.length\n\t\tval = val.split(vSeparador)\n\t\tval2 = ''\n\n\t\tfor(r=0;r<val.length;r++){\n\t\t\tval2 += val[r]\t\n\t\t}\n\n\t\tif(vNumerico){\n\t\t\tfor(z=0;z<val2.length;z++){\n\t\t\t\tif(isNaN(val2.charAt(z))){\n\t\t\t\t\tletra = new RegExp(val2.charAt(z),\"g\")\n\t\t\t\t\tval2 = val2.replace(letra,\"\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tval = ''\n\t\tval3 = new Array()\n\n\t\tfor(s=0; s<vPatron.length; s++){\n\t\t\tval3[s] = val2.substring(0,vPatron[s])\n\t\t\tval2 = val2.substr(vPatron[s])\n\t\t}\n\n\t\tfor(q=0;q<val3.length; q++){\n\t\t\tif(q ==0){\n\t\t\t\tval = val3[q]\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(val3[q] != \"\"){\n\t\t\t\t\tval += vSeparador + val3[q]\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpObjeto.value = val\n\t\tpObjeto.valant = val\n\n\t\t}\n\n}", "function primero() {\n $('.char').attr('src', 'svgs/chars/primero.svg');\n $('.row1 .number').text(\"50\");\n $('.row2 .number').text(\"25\");\n $('.row3 .number').text(\"10\");\n $('.row1 .bar').css(\"width\", \"100%\");\n $('.row2 .bar').css(\"width\", \"50%\");\n $('.row3 .bar').css(\"width\", \"20%\");\n }", "function experiencia(anos) {\n\t\n\tif (anos >= 0 && anos < 1) {\n\t\t// De 0-1 ano: Iniciante\n\t\tconsole.log('Iniciante')\n\t} else if (anos >= 1 && anos < 3) {\n\t\t// De 1-3 anos: Intermediário\t\n\t\tconsole.log('Intermediário')\n\t} else if (anos >= 3 && anos <= 6) {\n\t\t// De 3-6 anos: Avançado\n\t\tconsole.log('Intermediário')\n\t} else {\n\t\t// De 7 acima: Jedi Master\n\t\tconsole.log('Jedi Master')\n\t}\t\n}", "function agregar_miles(numero)\n{\n\t\n\tvar partes=numero.toString().split('.');\n\tvar miles=new RegExp(\"(-?[0-9]+)([0-9]{3})\"),separador_miles=',';\n while(miles.test(partes[0])) {\n partes[0]=partes[0].replace(miles, \"$1\" + separador_miles + \"$2\");\n }\n\tif(partes.length>1)\t\n\t\treturn partes[0]+'.'+partes[1];\n\t if(partes.length==1)\n\t return partes[0];\n}", "function valida_numeros(e){\n tecla = (document.all) ? e.keyCode : e.which;\n //Tecla de retroceso para borrar, siempre la permite\n if (tecla == 8 ){ return true; }\n if (tecla == 9 ){ return true; }\n if (tecla == 0 ){ return true; }\n if (tecla == 13 ){ return true; }\n \n // Patron de entrada, en este caso solo acepta numeros\n patron =/[0-9-.]/;\n tecla_final = String.fromCharCode(tecla);\n return patron.test(tecla_final);\n }", "function renumera_opcao_grade_linha(key){\n $('div#div_pergunta_'+key).find('div#div_op_grade_linha').find('label#label_op_grade_linha').each(function(i, label){\n $(this).find('span').html('Marcador da Linha '+(i+1)+'&nbsp;');\n });\n }", "function esPar(numerito) { \n //Si se hace una division para dos se recibe un entero o decimal\n if (numerito % 2 === 0) { //=== 0 quiere decir que no da reciduo\n return true;\n } else {\n return false;\n }\n}", "function aleatorios(limite = 1) {\n let r = []\n for (let i = 0; i < limite; i++) {\n r[i] = numeroAlAzar100()\n }\n\n return r\n \n }", "function LePeso(peso) {\n var peso_minusculo = peso.toLowerCase();\n var indice_unidade = peso_minusculo.indexOf('kg');\n var unidade_gramas = false;\n if (indice_unidade == -1) {\n indice_unidade = peso_minusculo.indexOf('g');\n unidade_gramas = true;\n }\n // Não encontrei a unidade.\n if (indice_unidade == -1) {\n return null;\n }\n\n var peso_sem_unidade = peso_minusculo.substr(0, indice_unidade).replace(',', '.');\n var peso = parseFloat(peso_sem_unidade);\n\n return unidade_gramas ? peso / 1000.0 : peso;\n}", "function botonPrecionado(peso) {\n\n switch (peso) {\n case 10:\n addPeso(peso);\n break;\n case 7.5://6.6\n addPeso(peso);\n break;\n case 4.3://3.3\n addPeso(peso);\n break;\n case 0:\n addPeso(peso);\n break;\n default:\n }\n indicePregunta++;\n if(indicePregunta < preguntas.length){\n cambiarPregunta();\n }\n else {\n analizarAptitudes();\n // document.getElementById(\"con1\").value = 1\n // document.getElementById(\"con2\").value = 1\n // document.getElementById(\"con3\").value = 1\n // document.getElementById(\"con4\").value = 1\n // document.getElementById(\"con5\").value = 1\n // document.getElementById(\"con6\").value = 1\n\n //enviar resultados a\n document.getElementById(\"voc-form\").submit();\n\n }\n }", "function conParametros(name, numero) {\n console.log(`mi nombre es ${name} y edad de ${numero} años`);\n}", "function getPelnas() {\nvar pajamos = 12500;\nvar islaidos = 18500;\nvar pelnas = pajamos - islaidos;\nreturn pelnas;\n}", "function Depurar(pe_valor,pe_sepdec)\n//funcion que depura el numero para realizar operaciones\n//matematicas\n//Parametros:\n// pe_valor: Valor del Numero a depurar\n// pe_sepdec: Indica el separador de decimal\n//Retorna:\n//El numero depurado\n//Desarrollado por: Elis Velasquez. Fecha: 13/10/1999.\n//Modificado por: Elis Velasquez. Fecha: 29/04/2000\n{\n valor = pe_valor;\n if (valor!=\"\")\n {\n if (pe_sepdec == \",\")\n \t{ while (valor.indexOf(\".\")>=0)\n\t { valor = valor.replace(\".\",\"\");\n\t }\n\t //valor = valor.replace(\",\",\".\");\n\t }\n else if (pe_sepdec== \".\")\n \t {\n\t while (valor.indexOf(\",\")>=0)\n\t {\n \t valor = valor.replace(\",\",\"\");\n\t }\n\t }\n }\n else\n valor = \"0\";\n return(valor)\n}", "separarCaracteres(){\r\n let cadena = this.objetoExpresion();\r\n for(let i = 0; i <= cadena.length-1; i++){\r\n this._operacion.addObjeto(new Dato(cadena.charAt(i)));\r\n }\r\n //Hace el arbol mediante la lista ya hecha \r\n this._operacion.armarArbol();\r\n //Imprime el orden normal \r\n this.printInfoInOrder();\r\n }", "function calculate(numeros){\n let valores = document.getElementsByName(numeros);\n soma(parseInt(valores[0].value),parseInt(valores[1].value));\n}", "function aumentarPrecio(){\n let disney=385;\n let inflacion = 150;\n\n document.write('El valor total del servicio de disnes plus $'+(disney+inflacion));\n}", "function moedaReal(valor){\r\n\tvar valor2 = \"\";\r\n\tif(valor.length <= 6){\r\n\t\t\tvalor2 = valor.replace(\".\",\",\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tvalor = valor.replace(\".\",\",\");\r\n\t\t\tvalor = valor.split(\".\");\r\n\t\t\tvar tam = valor.length;\r\n\t\t\tfor(var x = 0; x <= tam-1; x++){\r\n\t\t\t\tif(x == tam-1)\r\n\t\t\t\t\tvalor2 = valor2+\".\"+valor[x];\r\n\t\t\t\telse\r\n\t\t\t\t\tvalor2 = valor2+valor[x];\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvalor = Number(valor2);\r\n\t\treturn valor\r\n}", "function armarCajas(e) {\n\te.preventDefault();\n\tlet div = \"\";\n\tnumero = document.getElementById(\"numero\").value;\n\tif (numero === \"\") {\n\t alert(\"Introduzca un numero\");\n\t} else {\n\t for (let i = 0; i < numero; i++) {\n\t\tdiv += `<input type=\"number\" id=\"numero${i}\"><br><br>`;//i para que se lo asisge un id desferente en cada imput\n\t }\n\t div += `<input type=\"button\" class=\"btn btn-primary\" value=\"+\" onclick=\"sumar(${numero})\">`;//concatena a elementos de tipo id\n\t document.getElementById(\"contenido\").innerHTML = div; //asignai la variable div al contenido\n\t}\n }", "function calcoloRisultato(nPc, nUt, sclt) {\n // Inizializzo una variabile che contenga la somma dei due numeri giocati\n var somma = nPc + nUt;\n console.log(\"La somma dei valori é: \" + somma);\n // Calcolo incrociato tra risultato numerico e la scelta del giocatore\n if(somma % 2 != 0 && sclt == pari ){\n console.log(\"Hai perso...\")\n }\n else{\n console.log(\"Hai vinto\")\n }\n\n }", "function clasificacion(numero) {\n let salida = \"hola\";\n switch (numero) {\n case \"0\":\n salida = \" Personal \"\n break;\n case \"1\":\n salida = \" Hipotecario \"\n break;\n case \"2\":\n salida = \" Prendario \"\n break;\n\n }\n return (salida);\n}", "getEleccionPaquete(){\r\n\r\n if( eleccion == \"IGZ\" ){\r\n //Igz - descuento del 15\r\n console.log(\"Elegiste Iguazú y tiene el 15% de decuento\");\r\n return this.precio - (this.precio*0.15);\r\n }\r\n else if (eleccion == \"MDZ\"){\r\n //mdz - descuento del 10\r\n console.log(\"Elegiste Mendoza y tiene el 10% de descuento\");\r\n return this.precio - (this.precio*0.10);\r\n }\r\n else if (eleccion == \"FTE\"){\r\n //fte - no tiene descuento \r\n console.log(\"Elegiste El Calafate, lamentablemente no tiene descuento\");\r\n return \"\";\r\n }\r\n \r\n }", "function calculadora() {\n for (let i = 0; i < resultados.length; i++) {\n if (num.length > 1) {\n switch (i) {\n case 0:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 + num[j] * 1;\n }\n // Suma\n console.log(`El valor de la suma es: ${resultados[i]}`);\n break;\n case 1:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 - num[j] * 1;\n }\n // Resta\n console.log(`El valor de la resta es ${resultados[i]}`);\n break;\n case 2:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] *= num[j];\n }\n // Multiplicación\n console.log(`El valor de la multiplicación es ${resultados[i]}`);\n break;\n case 3:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] /= num[j];\n }\n // División\n console.log(`El valor de la división es ${resultados[i].toFixed(2)}`);\n break;\n case 4:\n resultados[i] = \"Sin Raiz cuadrada.\";\n // Sin raiz cuadrada\n console.log(\n `Al introducir dos o más valores numericos correctos la Raiz cuadrada no se ha calculado`\n );\n break;\n default:\n break;\n }\n } else if (num.length === 1) {\n resultados[4] = Math.sqrt(num[0]);\n // Raiz cuadrada\n console.log(`Solo se ha introducido un valor valido.`);\n console.log(\n `El valor de la raiz cuadrada es ${resultados[4].toFixed(2)}`\n );\n\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n } else {\n console.log(`No se han introducido numeros validos`);\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n }\n }\n}", "function calcularPromedio() {\n const notas = [];\n let suma = 0;\n const notaParcial1 = prompt('Ingrese nota del primer parcial');\n const notaParcial2 = prompt('Ingrese nota del segundo parcial');\n const notaProyectoFinal = prompt('Ingrese nota del proyecto final');\n\n notas.push(notaParcial1);\n notas.push(notaParcial2);\n notas.push(notaProyectoFinal);\n\n for (let indice = 0; indice < notas.length; indice++) {\n // const element = notas[indice];\n suma = suma + parseInt(notas[indice]);\n }\n\n const promedio = suma / notas.length;\n\n if (promedio >= 6) {\n console.log('Aprobó la materia');\n } else {\n console.log('Desaprobó la materia 😣');\n }\n\n console.log(notas);\n\n}", "trasformaVoto (voto){\r\n return parseInt(voto / 2);\r\n }", "function potencia(base, expoente) {\n return 0\n}", "function marcoPolo(num) {\n for (let i = 1; i < 40; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(`${i} marco polo`);\n } else if (i % 3 === 0) {\n console.log(`${i} marco`)\n } else if (i % 5 === 0) {\n console.log(`${i} polo`);\n } else {\n console.log(`${i} I'm not playing.`)\n }\n }\n }", "function agregarCeros(tiempo){\n if(tiempo < 10){\n tiempo = \"0\"+tiempo\n }\n return tiempo\n}", "function Mostrar()\n{\n\tvar numero;\n\tvar letra;\n\tvar promedio;\n\tvar sumaNumeros=0;\n\tvar contadorNumero=0;\n\tvar opcion=\"si\";\n\tvar numerosImpares=0;\n\tvar sumaNumerosConVocal=0;\n\tvar maximo=0;\n\tvar letraMaxima;\n\n\twhile (opcion!=\"no\")\n\t{\n\t\tnumero =prompt (\"ingrese un numero\");\n\t\tnumero=parseInt(numero);\n\n\t\twhile (isNaN(numero))\n\t\t{\n\t\t\tnumero =prompt (\"ingrese un numero VALIDO\");\n\t\t\tnumero=parseInt(numero);\n\t\t}\n\n\t\tif (numero>-50 && numero<50)\n\t\t{\n\t\t\tcontadorNumero++;\n\t\t\tsumaNumeros=sumaNumeros+numero;\n\t\t}\n\n\t\tletra=prompt(\"ingrese una letra\");\n\n\t\twhile (!isNaN(letra))\n\t\t{\n\t\t\tletra=prompt(\"ingrese una letra VALIDA\");\n\t\t}\n\n\t\tif (numero%2!=0 && numero!=0)\n\t\t{\n\t\t\tnumerosImpares++;\n\t\t}\n\n\t\tif (letra==\"a\" || letra==\"e\" ||letra==\"i\" ||letra==\"o\" ||letra==\"u\" )\n\t\t{\n\t\t\tsumaNumerosConVocal=numero+sumaNumerosConVocal;\n\t\t}\n\n\t\tif (maximo<numero)\n\t\t{\n\t\t\tmaximo=numero;\n\t\t\tletraMaxima=letra;\n\t\t}\n\n\topcion=prompt (\"NO para salir\")\n\n\t}\n\n\tpromedio=sumaNumeros/contadorNumero;\n\n\tdocument.write (\"<br> la letra es \"+letra);\n\tdocument.write (\"<br> el numero es \"+numero);\n\tdocument.write (\"<br> El promedio es \"+promedio);\n\tdocument.write (\"<br> Hay \"+numerosImpares+\" numeros impares\");\n\tdocument.write (\"<br> la suma de numeros cuya letra es una vocal es \"+sumaNumerosConVocal);\n\tdocument.write (\"<br> El numero maximo es \"+maximo+ \" y su letra es \"+letraMaxima);\n\n}", "function arretNumber() {\n if (this.enCours) {\n this.sonMatricule.stop();\n this.sonAmbiance.fade(0.8 , 1) //Volume son ambiance\n this.sonAmbiance.loop();\n numPrecedent = 10;\n this.enCours = false;\n clearInterval(this.changeNumber);\n // On se bloque sur un matricule connu\n selectMatricule = (this.recupererMatriculeAlea()).toString();\n ordre = (tabMatricule.indexOf(selectMatricule))+1;\n afficherMatricule(selectMatricule);\n }\n}", "function AtrazoBoco (mês, valorAnuidade) {\n switch(mês) {\n case 1:\n return `Valor da Anuidade: ${valorAnuidade}`\n break\n\n case 2:\n const juroscomposto1 = valorAnuidade * ((1 + 0.05)**1)\n return `Valor da Anuidade com Juros: ${juroscomposto1.toFixed(2)}`\n break\n\n case 3:\n const juroscomposto2 = valorAnuidade * ((1 + 0.05)**2)\n return `Valor da Anuidade com Juros: ${juroscomposto2.toFixed(2)}`\n break\n\n case 4:\n const juroscomposto3 = valorAnuidade * ((1 + 0.05)**3)\n return `Valor da Anuidade com Juros: ${juroscomposto3.toFixed(2)}`\n break\n\n case 5:\n const juroscomposto4 = valorAnuidade * ((1 + 0.05)**4)\n return `Valor da Anuidade com Juros: ${juroscomposto4.toFixed(2)}`\n break\n\n case 6:\n const juroscomposto5 = valorAnuidade * ((1 + 0.05)**5)\n return `Valor da Anuidade com Juros: ${juroscomposto5.toFixed(2)}`\n break\n\n case 7:\n const juroscomposto6 = valorAnuidade * ((1 + 0.05)**6)\n return `Valor da Anuidade com Juros: ${juroscomposto6.toFixed(2)}`\n break\n\n case 8:\n const juroscomposto7 = valorAnuidade * ((1 + 0.05)**7)\n return `Valor da Anuidade com Juros: ${juroscomposto7.toFixed(2)}`\n break\n\n case 9:\n const juroscomposto8 = valorAnuidade * ((1 + 0.05)**8)\n return `Valor da Anuidade com Juros: ${juroscomposto8.toFixed(2)}`\n break\n\n case 10:\n const juroscomposto9 = valorAnuidade * ((1 + 0.05)**9)\n return `Valor da Anuidade com Juros: ${juroscomposto9.toFixed(2)}` \n break\n\n case 11:\n const juroscomposto10 = valorAnuidade * ((1 + 0.05)**10)\n return `Valor da Anuidade com Juros: ${juroscomposto10.toFixed(2)}`\n break\n\n case 12:\n const juroscomposto11 = valorAnuidade * ((1 + 0.05)**11)\n return `Valor da Anuidade com Juros: ${juroscomposto11.toFixed(2)}`\n break\n }\n }", "function Nivel1Ejercicio1() {\n document.getElementById('text').innerHTML='';\n let nombre = prompt('Su nombre?:')\n let noNumberName = nombre.replace(expRegular1,\"\");\n var arrNoNumber = noNumberName.split('')\n for (let i = 0; i < arrNoNumber.length; i++) {\n //document.getElementById('text').innerHTML+=\"${arrNoNumberName[i]}\" + '</br>';\n //document.getElementById('text').innerHTML+= '\"' + noNumberName[i] + '\"' + '\\r\\n';\n document.getElementById('text').innerHTML+= arrNoNumber[i] +' </br>';\n}\n}", "function compasso(NumCompasso, idDiv) {\n //variavel responsavel por comtrolar o espacamento dos compassos...\n var EspaCompasso = 100 / NumCompasso;\n //para garantir o mesmo espacamento...\n var TamCompasso = EspaCompasso;\n\n let y1 = 40;\n let y2 = 60;\n\n let id = 0;\n id++;\n for (let i = 1; i < NumCompasso; i++, EspaCompasso += TamCompasso, id++) {\n createLine(EspaCompasso, y1, EspaCompasso, y2, \"compasso\" + id, idDiv, \"compasso\");\n }\n createLine(98.2, y1, 98.2, y2, \"compasso\" + id, idDiv, \"compasso\");\n}", "function elevar_al_cuadrado(numero)\n{\n return numero * numero;\n}", "static calcularPersonas(num){\n for (let i = 0; i < num; i++) {\n personas[i] = new Persona();\n personas[i].getNumero(i + 1);\n }\n }", "function Tablas(numero, rango){\n // aqui iran los numeros por los cuales se va a multiplicar las tablas\n var indiceGeneral = 0;\n var tablas = [];\n var ejemplos = [];\n var respuestas = [];\n // this converts the input to an integral\n var rangoReal = parseInt(rango) + 1\n\n for (var i = 0; i < rangoReal ; i++) {\n tablas.push(indiceGeneral)\n indiceGeneral++\n }\n\n\n for (var i = 0; i < tablas.length; i++) {\n ejemplos.push(`${numero} times ${tablas[i]} equals?`);\n respuestas.push(numero * tablas[i]);\n }\n\n return {ejemplos, respuestas, indiceGeneral, rango};\n\n\n }", "function escogerValorMasGrande(elemetos){\n\n}", "function holamundo(texto){\n var hola_mundo=\"Texto dentro de una funcion\";\n console.log(texto);\n // metodo toString permite convertir un numero en un string \n console.log(numero.toString());\n console.log(hola_mundo);\n}", "function floatParaText(valor) {\n var text = (valor < 1 ? \"0\" : \"\") + Math.floor(valor * 100);\n text = \"R$ \" + text;\n return text.substr(0, text.length - 2) + \",\" + text.substr(-2);\n}", "function parantezlerDengelimi(metin){\n const dizi=metin.split('');\n console.log(dizi);\n const result=dizi.reduce((pre,current) => {\n if(pre<0){\n return pre;\n }\n if(current==='('){\n return ++pre;\n } \n if(current===')') {\n return --pre;\n }\n return pre;\n \n \n },0);\n console.log(result);\n if(!result){\n console.log(metin+ \" Veri Dengelidir\");\n }\n else {\n console.log(metin+ \" Veri Dengeli Değil\")\n }\n}", "function dobro(numero) {\n return numero * 2;\n}", "function numeroPerfecto(numero){\n let divisores = 0;\n\n if (numero < 0) {\n alert(\"no se admiten numeros negativos\");\n return;\n }\n\n if (numero.length >= 9) {\n alert(\"este numero es muy largo y demora mucho en procesar, te recomiendo mirar los otros ejemplos\")\n return;\n }\n // al agregar el diferente de nulo si se ingresa la letra (E) valida el campo numerico\n // al quitar esta comparacion no valida el campo numerico\n if (divisores == 0 && numero == null || numero == \"\") {\n alert(\"valor no permitido\");\n return;\n }\n for (let i = 1; i <= numero / 2; i++) {\n if (numero % i == 0) {\n //captura los divisores\n divisores +=i;\n }\n if (divisores == numero) {\n alert(`el numero ${numero} es perfecto`);\n return;\n\n }\n }\n if (numero != divisores) {\n alert(`el numero ${numero} no es perfecto`);\n return;\n\n }\n}", "function calculaPromedioDeTresNumeros(num1, num2, num3){\r\n let promedio = (num1 + num2 +num3)/3;\r\n // return 'El promedio es: ' + promedio + ' dolares';\r\n return `El promedio es: ${promedio} dolares`;\r\n}", "function notas() {\n var num = Number(document.getElementById(\"num\").value);\n var media = 0;\n var notaP = 0;\n var notaA = 0;\n var array = [];\n\n if (num > 0) {\n for (var i = 0; i < num; i++) {\n let nota = Number(prompt(\"Introduce la nota del examen \" + (i + 1)));\n if (!isNaN(nota)) {\n array.push(nota);\n } else {\n i--;\n alert(\"Solo numeros\");\n }\n }\n\n media = calcularMedia(array);\n notaP = notaBaja(array);\n notaA = notaAlta(array);\n let felicitacion = \"\";\n\n if (media >= 89 && media <= 100) {\n felicitacion = \"A+\";\n } else {\n felicitacion = \"Trabaja mas duro amigo\";\n }\n\n document.getElementById(\"return\").innerHTML =\n \"Nota media = \" +\n media +\n \" \" +\n felicitacion +\n \"<br>Nota mas baja - \" +\n notaP[1] +\n \" del examen \" +\n notaP[0] +\n \"<br>Nota mas alta - \" +\n notaA[1] +\n \" del examen \" +\n notaA[0];\n }\n console.log(array);\n}", "function agregarNumero(num){\n opActual = opActual + num; \n actualizarDisplay();\n}", "function posicionaNaviosJogador(){\r\n for (var i = 0; i < 10; i++){\r\n console.error(\"\\nNavio n.º \"+(i+1));\r\n linhaJogador = (pegarNumero(\"Linha: \", 1, 10)-1);\r\n colunaJogador = (pegarNumero(\"Coluna: \", 1, 10)-1);\r\n if (tabuleiro[linhaJogador][colunaJogador] == \" ~~~~ \"){\r\n tabuleiro[linhaJogador][colunaJogador] = \" <^^> \";\r\n contadorJogador++;\r\n }\r\n else {\r\n console.log(\"Espaço já ocupado. Você perdeu um navio. \")\r\n }\r\n }\r\n naviosJogador = contadorJogador;\r\n}", "function processa_letra()\n{\n let letra = document.getElementById(\"entrada\").value; //le o valor da entrada\n alert(\"voce digitou mais de um caracter\")\n //verifica se a entrada e valida\n if (letra.length > 1)\n {\n alert(\"voce digitou mais de um caracter\")\n }\n //processa a letra\n else \n {\n //coloca em minusculo\n letra = letra.toLowercase();\n //vefica se esta na palavra\n let j = 0;\n for(let i = 0; i < jogo.palavra.length; i++)\n {\n if (jogo.palavra[i] == letra)\n {\n jogo.acertos++;\n jogo.try_cor[i] = letra;\n }\n else\n {\n j++;\n }\n }\n\n if(i == j)\n {\n try_err = try_err + letra;\n jogo.erros++;\n }\n\n verifica_jogo(jogo);\n }\n\n\n}", "function _CarregaPericias() {\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var achou = false;\n for (var i = 0; i < pericia.classes.length; ++i) {\n // Aplica as pericias de mago a magos especialistas tambem.\n if (pericia.classes[i] == 'mago') {\n achou = true;\n break;\n }\n }\n if (!achou) {\n continue;\n }\n for (var chave_classe in tabelas_classes) {\n var mago_especialista = chave_classe.search('mago_') != -1;\n if (mago_especialista) {\n pericia.classes.push(chave_classe);\n }\n }\n }\n var span_pericias = Dom('span-lista-pericias');\n // Ordenacao.\n var divs_ordenados = [];\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var habilidade = pericia.habilidade;\n var prefixo_id = 'pericia-' + chave_pericia;\n var div = CriaDiv(prefixo_id);\n var texto_span = Traduz(pericia.nome) + ' (' + Traduz(tabelas_atributos[pericia.habilidade]).toLowerCase() + '): ';\n if (tabelas_pericias[chave_pericia].sem_treinamento) {\n texto_span += 'ϛτ';\n }\n div.appendChild(\n CriaSpan(texto_span, null, 'pericias-nome'));\n\n var input_complemento =\n CriaInputTexto('', prefixo_id + '-complemento', 'input-pericias-complemento',\n {\n chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n AtualizaGeral();\n evento.stopPropagation();\n }\n });\n input_complemento.placeholder = Traduz('complemento');\n div.appendChild(input_complemento);\n\n var input_pontos =\n CriaInputNumerico('0', prefixo_id + '-pontos', 'input-pericias-pontos',\n { chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n ClickPericia(this.chave_pericia);\n evento.stopPropagation(); } });\n input_pontos.min = 0;\n input_pontos.maxlength = input_pontos.size = 2;\n div.appendChild(input_pontos);\n\n div.appendChild(CriaSpan(' ' + Traduz('pontos') + '; '));\n div.appendChild(CriaSpan('0', prefixo_id + '-graduacoes'));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total-bonus'));\n div.appendChild(CriaSpan(' = '));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total'));\n\n // Adiciona as gEntradas\n gEntradas.pericias.push({ chave: chave_pericia, pontos: 0 });\n // Adiciona ao personagem.\n gPersonagem.pericias.lista[chave_pericia] = {\n graduacoes: 0, bonus: new Bonus(),\n };\n // Adiciona aos divs.\n divs_ordenados.push({ traducao: texto_span, div_a_inserir: div});\n }\n divs_ordenados.sort(function(lhs, rhs) {\n return lhs.traducao.localeCompare(rhs.traducao);\n });\n divs_ordenados.forEach(function(trad_div) {\n if (span_pericias != null) {\n span_pericias.appendChild(trad_div.div_a_inserir);\n }\n });\n}", "function printMetinisPajamuDydis() {\n var metinesPajamos = atlyginimas * 12;\n console.log(\"per metus uzdirbu:\", metinesPajamos);\n\n}", "function numberLine(data){\n\tline = data.nb;\n\tdocument.getElementById(\"NombreTournage\").innerHTML=line;\n}", "transformar(numero) {\n switch (numero) {\n case 0:\n return 'celeste'\n case 1:\n return 'violeta'\n case 2:\n return 'naranja'\n case 3:\n return 'verde'\n }\n }", "function idadePessoa(ano, mes, dias) {\n //return ano + \" \" + mes\n const diasAno = 365;\n const diasMes = 30;\n\n const idadeEmAnos = ano * diasAno\n //console.log(idadeEmAnos)\n\n const idadeEmMeses = mes * diasMes\n //console.log (idadeEmMeses)\n\n const idadeEmDias = idadeEmAnos + idadeEmMeses + dias;\n \n return `Você possui ${idadeEmDias} dias de vida`\n //return idadeEmDias;\n\n}", "function prueba (cuenta){\n\tlet count = cuenta\n\tfor (let i = 0; i < Math.floor(count/2); i++){\n\t\tconsole.log(i)\n\t}\n}", "function ejercicio1 (a) {\r\n var numeros = \"\",\r\n i;\r\n //This \"for\" is responsible for going through the list to multiply the other values.\r\n for (i = 0; i < a.length; i++) {\r\n var multiplicando = 1;\r\n //This \"for\" searches for the other values other than the position to multiply and add them to the result.\r\n for (j = 0; j < a.length; j++) { \r\n //This \"if\" prevents the same value that we are in from multiplying\r\n if (i != j) \r\n multiplicando = multiplicando * a[j];\r\n }\r\n //This “if” is in charge of concatenating the texts, and if it is the last one, it gives it a different format.\r\n if (i == a.length - 1){\r\n numeros = numeros + multiplicando;\r\n } else {\r\n numeros = numeros + multiplicando + \", \";\r\n } \r\n }\r\n return numeros;\r\n}", "function selecaoLivro(i, livros) {\n\n\n //Variavel para armazenar a quantidade de incones de estrelas de acordo com a nota do livro \n let qntEstrelas = ''\n //Quantas estrelas inteiras o livro tem \n for (var j = 1; j < livros[i][2]; j++) {\n console.log(j)\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n console.log(qntEstrelas)\n }\n\n //Se a nota do livro tiver parte decimal...\n if (livros[i][2] % 1 != 0) {\n //Se a parte decimal for maior do que 0,5 o livro ganha uma estrela completa(arredonda pra cima)\n if (livros[i][2] % 1 > 0.5) {\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n //Se não o livro ganha meia estrela\n } else {\n qntEstrelas += `\n <img src=\"icones/star-half-full.svg\" alt=\"icone de strela quase cheia\">\n `\n console.log(qntEstrelas)\n }\n } else {\n //Atribuindo a estrela caso livro não tenha parte decimal\n //A ultima estrela é atribuida depois para que caso o livro tenha parte decimal ela não seja atribuida 2 vezes\n //Uma pela parte decimal no for\n //E outra na validação se a parte decimal é maior que 0.5(Estrela interia), ou menor ou igual(Meia estrela)\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n }\n\n //Pagina do livro pra detalhes\n //Não troca de pagina para entrar em detalher a pagina apenas alteras suas infos\n let paginaCompleta = `\n\n <div class=\"root\">\n <div class=\"livroEscolido\">\n <div>\n <img src=${livros[i][6]}>\n </div>\n <div class=\"centralize\">\n <div>\n <div>\n <h3>${livros[i][0]}</h3>\n <h3>${livros[i][1]}</h3>\n </div>\n <p>\n ${livros[i][5]}\n </p>\n <h4>${livros[i][4]}</h4>\n\n <div class=\"addLista\">\n <button id=\"${i}\" onclick=\"inserirLivro(this.id, minhaLista)\">Adicionar á minha lista</button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"detalhes\">\n <header class=\"titulo\">\n <a href=\"index.html\">\n <img class=\"retorno\" src=\"icones/arrow-left-circle.svg\">\n </a>\n <img class=\"logo\" src=\"imagens/logotipo.png\">\n </header>\n\n <div>\n <div>\n <h1>${livros[i][0]} - ${livros[i][1]}</h1>\n </div>\n <div>\n <div class=\"areaAvaliacao\">\n `\n //Definindo cor do quadrado de avaliação \n if (livros[i][2] >= 3.5) {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota verde\">${livros[i][2]}</div>\n `} else if (livros[i][2] > 1.5 && livros[i][2] < 3.5) {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota amarelo\">${livros[i][2]}</div>\n `} else {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota vermelho\">${livros[i][2]}</div>\n `}\n\n paginaCompleta = paginaCompleta + `\n <div class=\"avaliacao\">\n <div>\n ${qntEstrelas}\n </div>\n <p>\n ${livros[i][3]} avaliações\n </p>\n </div>\n </div>\n\n <div class=\"resenha\">\n <h3>Resenha</h3>\n <p>\n ${livros[i][7]}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n <script type=\"text/javascript\" src=\"funcoes.js\"></script>\n </script>\n\n \n `\n //Esperando transição de tela\n setTimeout(function () {\n //Chamando função reponsavel pela atualização dos dados da pagina \n criarPagina(paginaCompleta)\n }, 1000);\n}" ]
[ "0.6941278", "0.69173896", "0.6682775", "0.6546764", "0.64804053", "0.64278364", "0.64190567", "0.6409729", "0.63893515", "0.6347284", "0.63382107", "0.63155377", "0.6299086", "0.62860584", "0.62399644", "0.61815965", "0.6119917", "0.611513", "0.60884166", "0.6086822", "0.60635436", "0.60626125", "0.6060356", "0.60506743", "0.6045412", "0.60338396", "0.6027039", "0.6006583", "0.60001016", "0.5995255", "0.5963776", "0.5946284", "0.59122366", "0.5903984", "0.5885691", "0.5885223", "0.58777106", "0.58433604", "0.5817115", "0.58133495", "0.5810641", "0.57997143", "0.57908356", "0.57876205", "0.5782581", "0.57807374", "0.5778363", "0.57741344", "0.577064", "0.57613206", "0.5760023", "0.5758826", "0.575805", "0.5749583", "0.5748614", "0.5744544", "0.5740904", "0.57402575", "0.57348037", "0.57282305", "0.57234484", "0.5722766", "0.57216465", "0.5720978", "0.571833", "0.5717737", "0.57157403", "0.5709699", "0.57082886", "0.5704928", "0.57041204", "0.5697449", "0.5695737", "0.56933427", "0.56898314", "0.5682739", "0.56788045", "0.5671057", "0.5669346", "0.5668947", "0.566682", "0.5666144", "0.5663928", "0.5662941", "0.56598043", "0.5658161", "0.5656649", "0.5656381", "0.5653787", "0.5650039", "0.5648299", "0.5639237", "0.5629598", "0.5629573", "0.5626734", "0.5624216", "0.56232053", "0.56183666", "0.5617054", "0.5616353", "0.56150997" ]
0.0
-1
SOLO PERMITE NUMEROS, lETRAS Y ESPACIOS
function contrasenas(e) { key=e.keyCode || e.which; teclado=String.fromCharCode(key).toLowerCase(); letras=".-~^_/\|abcdefghijklmnoñpqrstuvwxyz0123456789()[]{}*+<>"; especiales="8-37-38-46-164"; teclado_especial=false; for(var i in especiales) { if(key==especiales[i]) { teclado_especial=true; break; } } if(letras.indexOf(teclado)==-1 && !teclado_especial) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arreglar(numero){\n var numeroo=\"\";\n numero=\"\"+numero;\n partes=numero.split(separadorDecimalesInicial);\n entero=partes[0];\n if(partes.length>1)\n {\n decimal=partes[1];\n }\n cifras=entero.length;\n cifras2=cifras\n for(a=0;a<cifras;a++){\n cifras2-=1;\n numeroo+=entero.charAt(a);\n if(cifras2%3==0 &&cifras2!=0){\n numeroo+=separadorMiles;\n }\n }\n if(partes.length>1){\n numeroo+=separadorDecimales+decimal;\n }\n return numeroo\n }", "function numero(xx) { //recoge el n&uacute;mero pulsado en el argumento.\r\n if (x==\"0\" || xi==1 ) { // inicializar un n&uacute;mero, \r\n pantalla.innerHTML=xx; //mostrar en pantalla\r\n x=xx; //guardar n&uacute;mero\r\n if (xx==\".\") { //si escribimos una coma al principio del n&uacute;mero\r\n pantalla.innerHTML=\"0.\"; //escribimos 0.\r\n x=xx; //guardar n&uacute;mero\r\n coma=1; //cambiar estado de la coma\r\n }\r\n }\r\n else { //continuar escribiendo un n&uacute;mero\r\n if (xx==\".\" && coma==0) { //si escribimos una coma decimal pòr primera vez\r\n pantalla.innerHTML+=xx;\r\n x+=xx;\r\n coma=1; //cambiar el estado de la coma \r\n }\r\n //si intentamos escribir una segunda coma decimal no realiza ninguna acci&oacute;n.\r\n else if (xx==\".\" && coma==1) {} \r\n //Resto de casos: escribir un n&uacute;mero del 0 al 9: \r\n else {\r\n pantalla.innerHTML+=xx;\r\n x+=xx\r\n }\r\n }\r\n xi=0 //el n&uacute;mero est&aacute; iniciado y podemos ampliarlo.\r\n }", "function auxLetras(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 15)\n simbolo = 'M';\n else if (promedio >= 16 && promedio <= 31)\n simbolo = 'N';\n else if (promedio >= 32 && promedio <= 47)\n simbolo = 'H';\n else if (promedio >= 48 && promedio <= 63)\n simbolo = '#';\n else if (promedio >= 64 && promedio <= 79)\n simbolo = 'Q';\n else if (promedio >= 80 && promedio <= 95)\n simbolo = 'U';\n else if (promedio >= 96 && promedio <= 111)\n simbolo = 'A';\n else if (promedio >= 112 && promedio <= 127)\n simbolo = 'D';\n else if (promedio >= 128 && promedio <= 143)\n simbolo = '0';\n else if (promedio >= 144 && promedio <= 159)\n simbolo = 'Y';\n else if (promedio >= 160 && promedio <= 175)\n simbolo = '2';\n else if (promedio >= 176 && promedio <= 191)\n simbolo = '$';\n else if (promedio >= 192 && promedio <= 209)\n simbolo = '%';\n else if (promedio >= 210 && promedio <= 225)\n simbolo = '+';\n else if (promedio >= 226 && promedio <= 239)\n simbolo = '.';\n else if (promedio >= 240 && rgbPromedio <= 255)\n simbolo = ' ';\n return simbolo;\n\n}", "function auxNaipes(promedio) {\n let simbolo;\n\n if(promedio > 0 && promedio <= 19) \n simbolo = 'A';\n else if(promedio >= 20 && promedio <= 38) \n simbolo = 'B';\n else if(promedio >= 39 && promedio <= 57) \n simbolo = 'C';\n else if(promedio >= 58 && promedio <= 76) \n simbolo = 'D';\n else if(promedio >= 77 && promedio <= 95) \n simbolo = 'E';\n else if(promedio >= 96 && promedio <= 114) \n simbolo = 'F';\n else if(promedio >= 115 && promedio <= 133) \n simbolo = 'G';\n else if(promedio >= 134 && promedio <= 152) \n simbolo = 'H';\n else if(promedio >= 153 && promedio <= 171) \n simbolo = 'I';\n else if(promedio >= 172 && promedio <= 190) \n simbolo = 'J';\n else if(promedio >= 191 && promedio <= 209) \n simbolo = 'K';\n else if(promedio >= 210 && promedio <= 228) \n simbolo = 'L';\n else if(promedio >= 229 && promedio <= 256) \n simbolo = 'M';\n return simbolo;\n\n}", "function nombre_mes(mes) {\r\n let m_l = meses[mes].length;\r\n let linea = ' '.repeat(11 - Math.floor(m_l / 2)) + meses[mes];\r\n linea = linea + ' '.repeat(22 - linea.length) + '|';\r\n return linea;\r\n}", "function setNumberFormat(numero, decimales, sep_decimales, sep_millares) {\r\n\tvar monto = new String(numero);\r\n\tvar partes = monto.split(\".\");\r\n\tvar parte_entera = new String(partes[0]);\r\n\tif (partes[1] == undefined) var parte_decimal = new String(\"\"); else var parte_decimal = new String(partes[1]);\r\n\tvar parte_derecha = new String(\"\");\r\n\tvar parte_izquierda = new String(\"\");\r\n\tvar ceros = new String(\"\");\r\n\t\r\n\tif (partes.length <= 2) {\r\n\t\t//\tAgrego la separacion de los millares...\r\n\t\tvar con = 0;\r\n\t\tfor (i = parte_entera.length-1; i>=0; i--) {\r\n\t\t\tcon++;\r\n\t\t\tif (con % 3 == 0 && i != 0) parte_derecha = sep_millares + parte_entera.charAt(i) + parte_derecha;\r\n\t\t\telse parte_derecha = parte_entera.charAt(i) + parte_derecha;\r\n\t\t}\r\n\t\t\r\n\t\t//\tObtengo los decimales...\r\n\t\tif (decimales == parte_decimal.length) parte_izquierda = sep_decimales + parte_decimal; \r\n\t\telse if (decimales < parte_decimal.length) {\r\n\t\t\tvar redondear_1 = parte_decimal.substr(0, decimales);\r\n\t\t\tvar redondear_2 = parte_decimal.substr(decimales, 1);\t\t\t\r\n\t\t\tif (redondear_2 >= 5) redondear_1++;\r\n\t\t\tvar aredondear = new String(redondear_1);\r\n\t\t\t\r\n\t\t\tif (decimales > aredondear.length) {\r\n\t\t\t\tvar num_ceros = decimales - aredondear.length;\r\n\t\t\t\tfor (i=0; i<num_ceros; i++) ceros += \"0\";\r\n\t\t\t\t\r\n\t\t\t\tparte_izquierda = sep_decimales + ceros + aredondear;\r\n\t\t\t\t\r\n\t\t\t} else parte_izquierda = sep_decimales + redondear_1;\r\n\t\t}\r\n\t\telse if (decimales > parte_decimal.length) {\r\n\t\t\tvar num_ceros = decimales - parte_decimal.length;\r\n\t\t\tfor (i=0; i<num_ceros; i++) ceros += \"0\";\r\n\t\t\t\r\n\t\t\tparte_izquierda = sep_decimales + parte_decimal + ceros;\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn parte_derecha + parte_izquierda;\r\n}", "function pintarGuiones(num) {\r\n for (var i = 0; i < num; i++) {\r\n oculta[i] = \"_\";\r\n }\r\n console.log(oculta)\r\n hueco.innerHTML = oculta.join(\"\"); //me escribe en el html la cadena la cual contiene las lineas azules depende de la palabra\r\n}", "function Cletras (cadena){\n var numeroL = eliminarespacios(cadena).length;\n return (\"3.- Numero de Letras: \"+numeroL);\n}", "function celNumbers() {\n let cant = document.getElementById('numero').value;\n var txt = document.getElementById('txt');\n var numeros = [];\n txt.value = \"\";\n\n for(let x = 0; x < cant; x++){\n numeros[x] = \"9\" + lada[aleatorio(22)];\n for(let y = 0; y < 6; y++){\n numeros[x] += \"\" + aleatorio(9);\n }\n txt.value += numeros[x] + \"\\n\";\n }\n}", "function Cpalabras (cadena){\n var numerop = cadena.split(\" \").length;\n return (\"2.- Palabras: \"+numerop);\n}", "function oNumero(numero) {\n\t//Propiedades\n\tthis.valor = numero || 0\n\tthis.dec = -1;\n\t// Metodos\n\tthis.formato = numFormat;\n\tthis.ponValor = ponValor;\n\t// Definicion de los metodos\n\tfunction ponValor(cad) {\n\t\tif (cad == '-' || cad == '+')\n\t\t\treturn\n\n\t\tif (cad.length == 0)\n\t\t\treturn\n\n\t\tif (cad.indexOf('.') >= 0)\n\t\t\tthis.valor = parseFloat(cad);\n\t\telse\n\t\t\tthis.valor = parseInt(cad);\n\t}\n\tfunction numFormat(dec, miles) {\n\t\tvar num = this.valor, signo = 3, expr;\n\t\tvar cad = \"\" + this.valor;\n\t\tvar ceros = \"\", pos, pdec, i;\n\t\tfor (i = 0; i < dec; i++)\n\t\t\tceros += '0';\n\t\tpos = cad.indexOf('.');\n\t\tif (pos < 0) {\n\t\t\tif (ceros != \"\") {\n\t\t\t\tcad = cad + \".\" + ceros;\n\t\t\t}\n\t\t} else {\n\t\t\tpdec = cad.length - pos - 1;\n\t\t\tif (pdec <= dec) {\n\t\t\t\tfor (i = 0; i < (dec - pdec); i++)\n\t\t\t\t\tcad += '0';\n\t\t\t} else {\n\t\t\t\tnum = num * Math.pow(10, dec);\n\t\t\t\tnum = Math.round(num);\n\t\t\t\tnum = num / Math.pow(10, dec);\n\t\t\t\tcad = new String(num);\n\t\t\t}\n\t\t}\n\t\tpos = cad.indexOf('.');\n\t\tif (pos < 0)\n\t\t\tpos = cad.lentgh;\n\n\t\tif (cad.substr(0, 1) == '-' || cad.substr(0, 1) == '+')\n\t\t\tsigno = 4;\n\n\t\tif (miles && pos > signo)\n\t\t\tdo {\n\t\t\t\texpr = /([+-]?\\d)(\\d{3}[\\.\\,]\\d*)/;\n\t\t\t\tcad.match(expr);\n\t\t\t\tcad = cad.replace(expr, RegExp.$1 + '' + RegExp.$2);\n\t\t\t} while (cad.indexOf(',') > signo);\n\n\t\tif (dec < 0)\n\t\t\tcad = cad.replace(/\\./, '');\n\n\t\treturn cad;\n\t}\n}", "function auxDomino(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 25)\n simbolo = '1';\n else if (promedio >= 26 && promedio <= 50)\n simbolo = '2';\n else if (promedio >= 51 && promedio <= 75)\n simbolo = '3';\n else if (promedio >= 76 && promedio <= 100)\n simbolo = '4';\n else if (promedio >= 101 && promedio <= 125)\n simbolo = '5';\n else if (promedio >= 126 && promedio <= 150)\n simbolo = '6';\n else if (promedio >= 151 && promedio <= 175)\n simbolo = '7';\n else if (promedio >= 176 && promedio <= 200)\n simbolo = '8';\n else if (promedio >= 201 && promedio <= 225)\n simbolo = '9';\n else if (promedio >= 226 && promedio <= 256)\n simbolo = '0';\n return simbolo;\n\n}", "function nota_promedio(){\n\t\tvar sum = 0;\n\t\tvar pro = 0;\n\t\tfor(num = 0; num < alumnos.length; num ++){\n\t\t\tsum += (alumnos[num].nota);\n\t\t}\n\t\tpro = sum / 10;\n\t\tdocument.getElementById(\"promedio\").innerHTML = \"El Promedio es: <b>\" + pro.toFixed(2) + \"</b>\";\n\t}", "function soma(nnumero){\r\n let cont = 0;\r\n for (let num of numeros){\r\n cont = cont +num\r\n }\r\n return soma \r\n }", "function operacion(){\r\n if (numeros.segundo === null || numeros.segundo === \"\" || Number.isNaN(numeros.segundo)){ \r\n return raiz(); // Si hay un solo número, llamar a la funcion raiz\r\n } else {\r\n return aritmetica(); // Si hay dos a la función aritmética\r\n }\r\n }", "function presionarNumero(numero){\n console.log(\"numero\",numero)\n\n calculadora.agregarNumero(numero)\n actualizarDisplay()\n}", "function comprobacion(e) {\n\t var numeros=\"0123456789\";\n\nfunction tiene_numeros(texto){\n for(i=0; i<texto.length; i++){\n if (numeros.indexOf(texto.charAt(i),0)!=-1){\n \t//si retorna 1 es que encontro numeros en el texto\n return 1;\n }\n }\n //si retorna 0 solo contiene letras\n return 0;\n}\n}", "function pintarGuiones(num) {\r\n for (var i = 0; i < num; i++) {\r\n oculta[i] = \"_\";\r\n }\r\n hueco.innerHTML = oculta.join(\"\");//join() une todos los elementos de un array formando una cadena y separándolos con aquel argumento que definamos\r\n}", "function RellenaTexto(aux, TotalDigitos, TipoCaracter) {\r\n\tvar Numero = aux.toString();\r\n\tvar mon_len = parseInt(TotalDigitos) - Numero.length;\r\n\t\r\n\tif (mon_len<0) { \r\n\t\tmon_len = mon_len * -1;\r\n\t}\r\n\t// Solo para el tipo caracter\r\n\tif (TipoCaracter == 'C') {\r\n\t\tmon_len = parseInt(mon_len) + 1;\r\n\t}\r\n\t\r\n\tif (Numero == null || Numero == '') {\r\n\t\tNumero = '';\r\n\t} \r\n\r\n\tvar pd = '';\r\n\tif (TipoCaracter == 'N') {\r\n\t\tpd = repitechar(TotalDigitos,'0');\r\n\t} else {\r\n\t\tpd = repitechar(TotalDigitos,' ');\r\n\t}\r\n\tif (TipoCaracter == 'N') {\r\n\t\t// Numero = pd.substring(0, mon_len) + Numero;\r\n\t\tTotalDigitos = parseFloat(TotalDigitos) * -1;\r\n\t\tNumero = (pd + Numero).slice(TotalDigitos);\r\n\t\treturn Numero;\r\n\t} else {\r\n\t\tNumero = Numero + pd;\r\n\t\treturn Numero.substring(0, parseInt(TotalDigitos));\r\n\t}\r\n}", "function print_don() {\n // quando il metodo mi deve ritornare qualcosa per prima cosa inizializzo la variabile e in fondo\n // metto il \"return nomevariabile;\"\n let text = \"\";\n\n //let miosaldo = 0;\n\n //let maxver = 0;\n\n\n for (i = 0; i < ar_numeri.length; i++) {\n // In questo modo tutte le linee vengono generate con uno span con un id univoco, quindi possono essere gestiti anche singolarmenti\n text += \"<span id'don\" + i + \"'>\" + ar_numeri[i]+\"</span><br/>\";\n\n }\n\n\n return text;\n}", "function addPoints(nombre) // il s'agit d'un séparateur de millier ==> by Vulca <==\r\n\t\t{\r\n\t\t\tvar signe = '';\r\n\t\t\tif (nombre<0)\r\n\t\t\t{\r\n\t\t\t\tnombre = Math.abs(nombre);\r\n\t\t\t\tsigne = '-';\r\n\t\t\t}\r\n\t\t\tnombre=parseInt(nombre);\r\n\t\t\tvar str = nombre.toString(), n = str.length;\r\n\t\t\tif (n <4) {return signe + nombre;}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\treturn signe + (((n % 3) ? str.substr(0, n % 3) + '.' : '') + str.substr(n % 3).match(new RegExp('[0-9]{3}', 'g')).join('.'));\r\n\t\t\t}\r\n\t\t}", "tratarDigito() {\n let numero = \"\";\n\n numero = numero.concat(this.caracter);\n this.lerCaracter();\n\n while (/[0-9]/g.test(this.caracter) === true) {\n numero = numero.concat(this.caracter);\n this.lerCaracter();\n }\n this.token.lexema = +numero\n this.token.simbolo = \"snumero\"\n this.token.linha = this.numLinha\n }", "function moedaPadrao(valor){\r\n\tvar valor2 = \"\";\r\n\tif(valor.length <= 6){\r\n\t\t\tvalor2 = valor.replace(\",\",\".\");\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tvalor = valor.replace(\",\",\".\");\r\n\t\t\tvalor = valor.split(\".\");\r\n\t\t\tvar tam = valor.length;\r\n\t\t\tfor(var x = 0; x <= tam-1; x++){\r\n\t\t\t\tif(x == tam-1)\r\n\t\t\t\t\tvalor2 = valor2+\".\"+valor[x];\r\n\t\t\t\telse\r\n\t\t\t\t\tvalor2 = valor2+valor[x];\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvalor = Number(valor2);\r\n\t\treturn valor\r\n}", "function getNumeroFormatado(numero){ \r\n if (numero == \"-\"){\r\n return \"\";\r\n } \r\n let n = Number(numero);\r\n let valor = n.toLocaleString(\"pt-br\");\r\n return valor;\r\n}", "function getPelnas() {\n var pajamos = 12500;\n var islaidos = 7500;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + (pajamos-islaidos) + \"<br>\";\n return pajamos-islaidos;\n}", "function CalcularDigito(strGrupo) {\n var arrPeso = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2];\n var intSoma = 0;\n var intDigito = 0;\n\n for (x = strGrupo.length - 1, intDigito; x >= 0; x--) {\n intDigito = parseInt(strGrupo.substring(x, x + 1));\n intSoma += intDigito * arrPeso[arrPeso.length - strGrupo.length + x];\n }\n\n intSoma = 11 - intSoma % 11;\n return intSoma > 9 ? 0 : intSoma;\n}", "function numeros(caracter) {\n lugarDeColocacion = input.value.length + ultimoIndice; \n input.value = insertarCaracter(lugarDeColocacion,input.value,caracter);\n}", "function agregaNumerosArreglo(cadenaNumeros){//Recibe nuestra cadena de numeros\n let contador = 0;\n let par_num = \"\";\n let longuitud_cadena = 0;\n const lengthC = cadenaNumeros.length;//longuitud de nuestra cadena recibida\n \n for (let numero of cadenaNumeros) {//recorremos nuestro mensaje \n if(contador === 2){//si mi contador es === 2 ya tenemos un par de numeros asi que lo agregamos a nuestro arreglo\n contador = 1;//inicializamos el contador en 1 porque si no se salta 1 numero\n arr_numeros.push(par_num);//agregamos el par de numeros que tenemos a nuestro arreglo\n par_num = \"\" + numero; //le damos a nuestra variable el valor de la letra actual \n longuitud_cadena ++;\n }else{//contador menor a 2\n longuitud_cadena++\n par_num = par_num + numero;//concatenamos lo que tenemos en par_num con nuestro numero actual\n contador++;\n //para evitar que no agregue el ultimo par de numeros nos apoyamos de longuitud_cadena\n //al final de todo el recorrido tendremos longuitudes iguales por lo que el ultimo numero se agregara\n if (longuitud_cadena === lengthC) {\n arr_numeros.push(par_num);\n }\n }\n }\n \n return arr_numeros;//regresamso nuestro arreglo de numeros\n}", "function cantidad_pares_arreglo() {\n\tvar pares = new Number();\n\tvar i = new Number();\n\tvar cantidad = new Number();\n\tvar cantidadpares = new Number();\n\tvar cantidadimpares = new Number();\n\ti = 0;\n\tdocument.write(\"Digite el limete del arreglo: \",'<BR/>');\n\tcantidad = Number(prompt());\n\tvar pares = new Array(cantidad);\n\tfor (i=0;i<=cantidad-1;i++) {\n\t\t// Escribir i+1,\". Digita un numero: \";\n\t\t// Leer pares[i];\n\t\t// numero azar para asignar valores y no pedirlos al usuario\n\t\tpares[i] = Math.floor(Math.random()*100);\n\t\tif (pares[i]%2==0) {\n\t\t\tcantidadpares = cantidadpares+1;\n\t\t} else {\n\t\t\tcantidadimpares = cantidadimpares+1;\n\t\t}\n\t\t// Escribir pares[i];\n\t}\n\tdocument.write(\"Hay un total de: \",cantidadpares,\" numeros pares\",'<BR/>');\n\tdocument.write(\"Hay un total de: \",cantidadimpares,\" numeros impares\",'<BR/>');\n}", "function funcion() {\n return numeracion;\n}", "function numberFormat(numero,decimais) {\n tmpNum = String(numero+\"\");\n \n //aTMP = new Array(2);\n aTMP = tmpNum.split(\".\");\n \n retorno = aTMP[0]+\",\";\n \n if( aTMP[1] == undefined ) \n retorno += \"00\";\n else {\n retorno += rpad(aTMP[1],2,\"0\");\n }\n \n return(retorno);\n\n}", "function calcular() {\r\n var NUMEROYSIGNO = document.micalcu.display.value; //ME CREO UNA VARIABLE QUE ES IGUAL=document.nombreformulario.dondesemuestra.value -->\r\n document.micalcu.display.value = eval(NUMEROYSIGNO); // y digo que los datos metidos me lo cualcule la funcion eval(NUMEROYSIGNO) -->\r\n}", "function calculaPontos(jogador) {\n var pontos = jogador.vitorias * 3 + jogador.empates;\n return pontos;\n }", "function NumeroLetras (frase){\n //var frase = \"El mundo es tan cruel\";\nvar vacio = frase.split (\" \");\n\nconsole.log(\"La frase tiene \" + vacio.length + \" caracteres.\")\n\n}", "function paridispari(numpass) {\n var parDisprisult;\n // dichiaro le condizioni\n if (numpass % 2 === 0) {\n parDisprisult = \"pari\";\n // console.log(somma + \" è pari\");\n } else {\n parDisprisult = \"dispari\"\n // console.log(somma + \" è dispari\");\n }\n return parDisprisult;\n}", "function agregarNumero(num) {\n // llevandolo a texto para concatenar (para unir), recordar que la pantalla es in input text\n opeActual = opeActual.toString() + num.toString();\n actualizarPantalla();\n\n}", "function getPelnas22(pajamos, islaidos){\n var pelnas = pajamos - islaidos;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + pelnas + \"<br>\";\n return pelnas;\n}", "function ArrondirAu(Nombre, Seuil) {\n Multiple = Math.round(Nombre / Seuil);\n return Multiple * Seuil;\n}", "function descuentoPersonas(precio, personas){\n var descuentoTotal = 0;\n \n if (personas >= 4 && personas <= 6) {\n descuentoTotal = precio * 5;\n }\n if (personas >= 7 && personas <= 8) {\n descuentoTotal = precio * 10;\n \n }\n if (personas > 8) {\n descuentoTotal = precio * 15;\n }\n return descuentoTotal / 100;\n}", "function calcTabuada(numero) {\n console.log(\"===========================\");\n if (isNaN(numero)) { //tratamento para o input, se for NaN, o código nao executará\n console.log(\"ERRO! Por favor, digite apenas números inteiros.\");\n } else {\n for (numeroEscolhido = 1; numeroEscolhido <= numero; numeroEscolhido++) {\n console.log(`A tabuada do número ${numeroEscolhido} é: `);\n\n for (index = 1; index <= 10; index++) {\n\n console.log(`${index} * ${numeroEscolhido} é igual a: ${index*numeroEscolhido}`);\n }\n\n console.log(\"===========================\");\n }\n }\n}", "function calculaParcelaFinanciamento (valor,meses){\n var parcela={parcela:0, seguro:0, txadm:0}; \n //caso o prazo seja menor que 12 meses, não há incidência de juros\n if (meses<=12){\n parcela[\"parcela\"]=valor/meses;\n \n return parcela;\n }else{\n //caso contrário, procede ao cálculo financeiro \n var i=0.009488793;\n var numerador= i*Math.pow(1+i,meses);\n var denominador= Math.pow(1+i,meses)-1; \n var valorparcela=valor*(numerador/denominador);\n \n parcela[\"parcela\"]=valorparcela;\n parcela[\"seguro\"]=0.00019*valor;\n parcela[\"txadm\"]=25.00;\n \n return parcela;\n \n }//fim do else\n}//fim da função calculaParcelaFinanciamento ", "function getPelnas(pajamos, mokesciai, mokesciai2){\nvar pelnas = (pajamos - (pajamos * mokesciai)) - (pajamos - (pajamos * mokesciai)) * mokesciai2;\n return pelnas;\n}", "function calculaPontos(jogador) {\n var pontos = jogador.vitorias * 3 + jogador.empates;\n return pontos;\n}", "function repeticao (texto){\n let texto = \"Essa sentença se repetirá 10 vezes\";\n return (texto*10)\n}", "function procesoPrecio(){\n\n var getMinimo = minimo.slice(-1);\n var getMaximo = maximo.slice(-1);\n \nif(getMinimo != 0 && getMaximo != 0){\n formdata.append(\"minimo\",getMinimo);\n formdata.append(\"maximo\",getMaximo);\n}\n}", "function promedio_uno(){\n\tfor(i=0;i<8;i++){\n\t\tnumero = Number(prompt(\" ingresa tu número \" + (i+1)));\n\t\tsumaUno = sumaUno + numero; // Se almacena la sumaUno\n\t\tdocument.getElementById(\"p4_1\").innerHTML = \"el promedio de tus números es \" + (sumaUno/8);\n\t}\n}", "function AjPoFo() {\r\n \r\n if (perso.Por < 2) { //Test si assez d'argent\r\n alert(\"Vous n'avez pas assez d'argent\");\r\n console.log(\"Pas assez d'argent / nombre de potion = \"+ perso.Pinv[0]);\r\n } else {\r\n perso.Por -= 2; //Or du perso -2\r\n perso.Pinv[0] += 1; //Nombre de potion +1 \r\n document.getElementById('or').value = perso.Por; //affiche Or du perso dans la div caracteristique\r\n document.getElementById('nbPoFo').value = perso.Pinv[0]; //affiche le nombre de potion\r\n console.log(\"Achat d'une potion de force / nombre de potion = \"+ perso.Pinv[0]);\r\n }\r\n\r\n}", "function getFormatDocumentum(pObjeto){\n\n\t//18 ENERO 2016\n\tvar vSrc = pObjeto.value;\n\tvSrc = vSrc.replace(/ /g, ''); //Quitar espacios en cadena\n\tvSrc = vSrc.trim();\t\n\tpObjeto.value = vSrc; \n\t\n\tvar vSeparador = '-';\n\tvar vPatron = new Array(3,3,3,4,4,5,2,2,3);\n\tvar vNumerico = true;\n\n\tif(pObjeto.valant != pObjeto.value){\n\t\tval = pObjeto.value\n\t\tlargo = val.length\n\t\tval = val.split(vSeparador)\n\t\tval2 = ''\n\n\t\tfor(r=0;r<val.length;r++){\n\t\t\tval2 += val[r]\t\n\t\t}\n\n\t\tif(vNumerico){\n\t\t\tfor(z=0;z<val2.length;z++){\n\t\t\t\tif(isNaN(val2.charAt(z))){\n\t\t\t\t\tletra = new RegExp(val2.charAt(z),\"g\")\n\t\t\t\t\tval2 = val2.replace(letra,\"\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tval = ''\n\t\tval3 = new Array()\n\n\t\tfor(s=0; s<vPatron.length; s++){\n\t\t\tval3[s] = val2.substring(0,vPatron[s])\n\t\t\tval2 = val2.substr(vPatron[s])\n\t\t}\n\n\t\tfor(q=0;q<val3.length; q++){\n\t\t\tif(q ==0){\n\t\t\t\tval = val3[q]\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(val3[q] != \"\"){\n\t\t\t\t\tval += vSeparador + val3[q]\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpObjeto.value = val\n\t\tpObjeto.valant = val\n\n\t\t}\n\n}", "function primero() {\n $('.char').attr('src', 'svgs/chars/primero.svg');\n $('.row1 .number').text(\"50\");\n $('.row2 .number').text(\"25\");\n $('.row3 .number').text(\"10\");\n $('.row1 .bar').css(\"width\", \"100%\");\n $('.row2 .bar').css(\"width\", \"50%\");\n $('.row3 .bar').css(\"width\", \"20%\");\n }", "function experiencia(anos) {\n\t\n\tif (anos >= 0 && anos < 1) {\n\t\t// De 0-1 ano: Iniciante\n\t\tconsole.log('Iniciante')\n\t} else if (anos >= 1 && anos < 3) {\n\t\t// De 1-3 anos: Intermediário\t\n\t\tconsole.log('Intermediário')\n\t} else if (anos >= 3 && anos <= 6) {\n\t\t// De 3-6 anos: Avançado\n\t\tconsole.log('Intermediário')\n\t} else {\n\t\t// De 7 acima: Jedi Master\n\t\tconsole.log('Jedi Master')\n\t}\t\n}", "function agregar_miles(numero)\n{\n\t\n\tvar partes=numero.toString().split('.');\n\tvar miles=new RegExp(\"(-?[0-9]+)([0-9]{3})\"),separador_miles=',';\n while(miles.test(partes[0])) {\n partes[0]=partes[0].replace(miles, \"$1\" + separador_miles + \"$2\");\n }\n\tif(partes.length>1)\t\n\t\treturn partes[0]+'.'+partes[1];\n\t if(partes.length==1)\n\t return partes[0];\n}", "function valida_numeros(e){\n tecla = (document.all) ? e.keyCode : e.which;\n //Tecla de retroceso para borrar, siempre la permite\n if (tecla == 8 ){ return true; }\n if (tecla == 9 ){ return true; }\n if (tecla == 0 ){ return true; }\n if (tecla == 13 ){ return true; }\n \n // Patron de entrada, en este caso solo acepta numeros\n patron =/[0-9-.]/;\n tecla_final = String.fromCharCode(tecla);\n return patron.test(tecla_final);\n }", "function renumera_opcao_grade_linha(key){\n $('div#div_pergunta_'+key).find('div#div_op_grade_linha').find('label#label_op_grade_linha').each(function(i, label){\n $(this).find('span').html('Marcador da Linha '+(i+1)+'&nbsp;');\n });\n }", "function esPar(numerito) { \n //Si se hace una division para dos se recibe un entero o decimal\n if (numerito % 2 === 0) { //=== 0 quiere decir que no da reciduo\n return true;\n } else {\n return false;\n }\n}", "function aleatorios(limite = 1) {\n let r = []\n for (let i = 0; i < limite; i++) {\n r[i] = numeroAlAzar100()\n }\n\n return r\n \n }", "function LePeso(peso) {\n var peso_minusculo = peso.toLowerCase();\n var indice_unidade = peso_minusculo.indexOf('kg');\n var unidade_gramas = false;\n if (indice_unidade == -1) {\n indice_unidade = peso_minusculo.indexOf('g');\n unidade_gramas = true;\n }\n // Não encontrei a unidade.\n if (indice_unidade == -1) {\n return null;\n }\n\n var peso_sem_unidade = peso_minusculo.substr(0, indice_unidade).replace(',', '.');\n var peso = parseFloat(peso_sem_unidade);\n\n return unidade_gramas ? peso / 1000.0 : peso;\n}", "function botonPrecionado(peso) {\n\n switch (peso) {\n case 10:\n addPeso(peso);\n break;\n case 7.5://6.6\n addPeso(peso);\n break;\n case 4.3://3.3\n addPeso(peso);\n break;\n case 0:\n addPeso(peso);\n break;\n default:\n }\n indicePregunta++;\n if(indicePregunta < preguntas.length){\n cambiarPregunta();\n }\n else {\n analizarAptitudes();\n // document.getElementById(\"con1\").value = 1\n // document.getElementById(\"con2\").value = 1\n // document.getElementById(\"con3\").value = 1\n // document.getElementById(\"con4\").value = 1\n // document.getElementById(\"con5\").value = 1\n // document.getElementById(\"con6\").value = 1\n\n //enviar resultados a\n document.getElementById(\"voc-form\").submit();\n\n }\n }", "function conParametros(name, numero) {\n console.log(`mi nombre es ${name} y edad de ${numero} años`);\n}", "function getPelnas() {\nvar pajamos = 12500;\nvar islaidos = 18500;\nvar pelnas = pajamos - islaidos;\nreturn pelnas;\n}", "function Depurar(pe_valor,pe_sepdec)\n//funcion que depura el numero para realizar operaciones\n//matematicas\n//Parametros:\n// pe_valor: Valor del Numero a depurar\n// pe_sepdec: Indica el separador de decimal\n//Retorna:\n//El numero depurado\n//Desarrollado por: Elis Velasquez. Fecha: 13/10/1999.\n//Modificado por: Elis Velasquez. Fecha: 29/04/2000\n{\n valor = pe_valor;\n if (valor!=\"\")\n {\n if (pe_sepdec == \",\")\n \t{ while (valor.indexOf(\".\")>=0)\n\t { valor = valor.replace(\".\",\"\");\n\t }\n\t //valor = valor.replace(\",\",\".\");\n\t }\n else if (pe_sepdec== \".\")\n \t {\n\t while (valor.indexOf(\",\")>=0)\n\t {\n \t valor = valor.replace(\",\",\"\");\n\t }\n\t }\n }\n else\n valor = \"0\";\n return(valor)\n}", "separarCaracteres(){\r\n let cadena = this.objetoExpresion();\r\n for(let i = 0; i <= cadena.length-1; i++){\r\n this._operacion.addObjeto(new Dato(cadena.charAt(i)));\r\n }\r\n //Hace el arbol mediante la lista ya hecha \r\n this._operacion.armarArbol();\r\n //Imprime el orden normal \r\n this.printInfoInOrder();\r\n }", "function calculate(numeros){\n let valores = document.getElementsByName(numeros);\n soma(parseInt(valores[0].value),parseInt(valores[1].value));\n}", "function aumentarPrecio(){\n let disney=385;\n let inflacion = 150;\n\n document.write('El valor total del servicio de disnes plus $'+(disney+inflacion));\n}", "function moedaReal(valor){\r\n\tvar valor2 = \"\";\r\n\tif(valor.length <= 6){\r\n\t\t\tvalor2 = valor.replace(\".\",\",\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tvalor = valor.replace(\".\",\",\");\r\n\t\t\tvalor = valor.split(\".\");\r\n\t\t\tvar tam = valor.length;\r\n\t\t\tfor(var x = 0; x <= tam-1; x++){\r\n\t\t\t\tif(x == tam-1)\r\n\t\t\t\t\tvalor2 = valor2+\".\"+valor[x];\r\n\t\t\t\telse\r\n\t\t\t\t\tvalor2 = valor2+valor[x];\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvalor = Number(valor2);\r\n\t\treturn valor\r\n}", "function armarCajas(e) {\n\te.preventDefault();\n\tlet div = \"\";\n\tnumero = document.getElementById(\"numero\").value;\n\tif (numero === \"\") {\n\t alert(\"Introduzca un numero\");\n\t} else {\n\t for (let i = 0; i < numero; i++) {\n\t\tdiv += `<input type=\"number\" id=\"numero${i}\"><br><br>`;//i para que se lo asisge un id desferente en cada imput\n\t }\n\t div += `<input type=\"button\" class=\"btn btn-primary\" value=\"+\" onclick=\"sumar(${numero})\">`;//concatena a elementos de tipo id\n\t document.getElementById(\"contenido\").innerHTML = div; //asignai la variable div al contenido\n\t}\n }", "function calcoloRisultato(nPc, nUt, sclt) {\n // Inizializzo una variabile che contenga la somma dei due numeri giocati\n var somma = nPc + nUt;\n console.log(\"La somma dei valori é: \" + somma);\n // Calcolo incrociato tra risultato numerico e la scelta del giocatore\n if(somma % 2 != 0 && sclt == pari ){\n console.log(\"Hai perso...\")\n }\n else{\n console.log(\"Hai vinto\")\n }\n\n }", "function clasificacion(numero) {\n let salida = \"hola\";\n switch (numero) {\n case \"0\":\n salida = \" Personal \"\n break;\n case \"1\":\n salida = \" Hipotecario \"\n break;\n case \"2\":\n salida = \" Prendario \"\n break;\n\n }\n return (salida);\n}", "getEleccionPaquete(){\r\n\r\n if( eleccion == \"IGZ\" ){\r\n //Igz - descuento del 15\r\n console.log(\"Elegiste Iguazú y tiene el 15% de decuento\");\r\n return this.precio - (this.precio*0.15);\r\n }\r\n else if (eleccion == \"MDZ\"){\r\n //mdz - descuento del 10\r\n console.log(\"Elegiste Mendoza y tiene el 10% de descuento\");\r\n return this.precio - (this.precio*0.10);\r\n }\r\n else if (eleccion == \"FTE\"){\r\n //fte - no tiene descuento \r\n console.log(\"Elegiste El Calafate, lamentablemente no tiene descuento\");\r\n return \"\";\r\n }\r\n \r\n }", "function calculadora() {\n for (let i = 0; i < resultados.length; i++) {\n if (num.length > 1) {\n switch (i) {\n case 0:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 + num[j] * 1;\n }\n // Suma\n console.log(`El valor de la suma es: ${resultados[i]}`);\n break;\n case 1:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 - num[j] * 1;\n }\n // Resta\n console.log(`El valor de la resta es ${resultados[i]}`);\n break;\n case 2:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] *= num[j];\n }\n // Multiplicación\n console.log(`El valor de la multiplicación es ${resultados[i]}`);\n break;\n case 3:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] /= num[j];\n }\n // División\n console.log(`El valor de la división es ${resultados[i].toFixed(2)}`);\n break;\n case 4:\n resultados[i] = \"Sin Raiz cuadrada.\";\n // Sin raiz cuadrada\n console.log(\n `Al introducir dos o más valores numericos correctos la Raiz cuadrada no se ha calculado`\n );\n break;\n default:\n break;\n }\n } else if (num.length === 1) {\n resultados[4] = Math.sqrt(num[0]);\n // Raiz cuadrada\n console.log(`Solo se ha introducido un valor valido.`);\n console.log(\n `El valor de la raiz cuadrada es ${resultados[4].toFixed(2)}`\n );\n\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n } else {\n console.log(`No se han introducido numeros validos`);\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n }\n }\n}", "function calcularPromedio() {\n const notas = [];\n let suma = 0;\n const notaParcial1 = prompt('Ingrese nota del primer parcial');\n const notaParcial2 = prompt('Ingrese nota del segundo parcial');\n const notaProyectoFinal = prompt('Ingrese nota del proyecto final');\n\n notas.push(notaParcial1);\n notas.push(notaParcial2);\n notas.push(notaProyectoFinal);\n\n for (let indice = 0; indice < notas.length; indice++) {\n // const element = notas[indice];\n suma = suma + parseInt(notas[indice]);\n }\n\n const promedio = suma / notas.length;\n\n if (promedio >= 6) {\n console.log('Aprobó la materia');\n } else {\n console.log('Desaprobó la materia 😣');\n }\n\n console.log(notas);\n\n}", "trasformaVoto (voto){\r\n return parseInt(voto / 2);\r\n }", "function potencia(base, expoente) {\n return 0\n}", "function marcoPolo(num) {\n for (let i = 1; i < 40; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(`${i} marco polo`);\n } else if (i % 3 === 0) {\n console.log(`${i} marco`)\n } else if (i % 5 === 0) {\n console.log(`${i} polo`);\n } else {\n console.log(`${i} I'm not playing.`)\n }\n }\n }", "function agregarCeros(tiempo){\n if(tiempo < 10){\n tiempo = \"0\"+tiempo\n }\n return tiempo\n}", "function Mostrar()\n{\n\tvar numero;\n\tvar letra;\n\tvar promedio;\n\tvar sumaNumeros=0;\n\tvar contadorNumero=0;\n\tvar opcion=\"si\";\n\tvar numerosImpares=0;\n\tvar sumaNumerosConVocal=0;\n\tvar maximo=0;\n\tvar letraMaxima;\n\n\twhile (opcion!=\"no\")\n\t{\n\t\tnumero =prompt (\"ingrese un numero\");\n\t\tnumero=parseInt(numero);\n\n\t\twhile (isNaN(numero))\n\t\t{\n\t\t\tnumero =prompt (\"ingrese un numero VALIDO\");\n\t\t\tnumero=parseInt(numero);\n\t\t}\n\n\t\tif (numero>-50 && numero<50)\n\t\t{\n\t\t\tcontadorNumero++;\n\t\t\tsumaNumeros=sumaNumeros+numero;\n\t\t}\n\n\t\tletra=prompt(\"ingrese una letra\");\n\n\t\twhile (!isNaN(letra))\n\t\t{\n\t\t\tletra=prompt(\"ingrese una letra VALIDA\");\n\t\t}\n\n\t\tif (numero%2!=0 && numero!=0)\n\t\t{\n\t\t\tnumerosImpares++;\n\t\t}\n\n\t\tif (letra==\"a\" || letra==\"e\" ||letra==\"i\" ||letra==\"o\" ||letra==\"u\" )\n\t\t{\n\t\t\tsumaNumerosConVocal=numero+sumaNumerosConVocal;\n\t\t}\n\n\t\tif (maximo<numero)\n\t\t{\n\t\t\tmaximo=numero;\n\t\t\tletraMaxima=letra;\n\t\t}\n\n\topcion=prompt (\"NO para salir\")\n\n\t}\n\n\tpromedio=sumaNumeros/contadorNumero;\n\n\tdocument.write (\"<br> la letra es \"+letra);\n\tdocument.write (\"<br> el numero es \"+numero);\n\tdocument.write (\"<br> El promedio es \"+promedio);\n\tdocument.write (\"<br> Hay \"+numerosImpares+\" numeros impares\");\n\tdocument.write (\"<br> la suma de numeros cuya letra es una vocal es \"+sumaNumerosConVocal);\n\tdocument.write (\"<br> El numero maximo es \"+maximo+ \" y su letra es \"+letraMaxima);\n\n}", "function arretNumber() {\n if (this.enCours) {\n this.sonMatricule.stop();\n this.sonAmbiance.fade(0.8 , 1) //Volume son ambiance\n this.sonAmbiance.loop();\n numPrecedent = 10;\n this.enCours = false;\n clearInterval(this.changeNumber);\n // On se bloque sur un matricule connu\n selectMatricule = (this.recupererMatriculeAlea()).toString();\n ordre = (tabMatricule.indexOf(selectMatricule))+1;\n afficherMatricule(selectMatricule);\n }\n}", "function AtrazoBoco (mês, valorAnuidade) {\n switch(mês) {\n case 1:\n return `Valor da Anuidade: ${valorAnuidade}`\n break\n\n case 2:\n const juroscomposto1 = valorAnuidade * ((1 + 0.05)**1)\n return `Valor da Anuidade com Juros: ${juroscomposto1.toFixed(2)}`\n break\n\n case 3:\n const juroscomposto2 = valorAnuidade * ((1 + 0.05)**2)\n return `Valor da Anuidade com Juros: ${juroscomposto2.toFixed(2)}`\n break\n\n case 4:\n const juroscomposto3 = valorAnuidade * ((1 + 0.05)**3)\n return `Valor da Anuidade com Juros: ${juroscomposto3.toFixed(2)}`\n break\n\n case 5:\n const juroscomposto4 = valorAnuidade * ((1 + 0.05)**4)\n return `Valor da Anuidade com Juros: ${juroscomposto4.toFixed(2)}`\n break\n\n case 6:\n const juroscomposto5 = valorAnuidade * ((1 + 0.05)**5)\n return `Valor da Anuidade com Juros: ${juroscomposto5.toFixed(2)}`\n break\n\n case 7:\n const juroscomposto6 = valorAnuidade * ((1 + 0.05)**6)\n return `Valor da Anuidade com Juros: ${juroscomposto6.toFixed(2)}`\n break\n\n case 8:\n const juroscomposto7 = valorAnuidade * ((1 + 0.05)**7)\n return `Valor da Anuidade com Juros: ${juroscomposto7.toFixed(2)}`\n break\n\n case 9:\n const juroscomposto8 = valorAnuidade * ((1 + 0.05)**8)\n return `Valor da Anuidade com Juros: ${juroscomposto8.toFixed(2)}`\n break\n\n case 10:\n const juroscomposto9 = valorAnuidade * ((1 + 0.05)**9)\n return `Valor da Anuidade com Juros: ${juroscomposto9.toFixed(2)}` \n break\n\n case 11:\n const juroscomposto10 = valorAnuidade * ((1 + 0.05)**10)\n return `Valor da Anuidade com Juros: ${juroscomposto10.toFixed(2)}`\n break\n\n case 12:\n const juroscomposto11 = valorAnuidade * ((1 + 0.05)**11)\n return `Valor da Anuidade com Juros: ${juroscomposto11.toFixed(2)}`\n break\n }\n }", "function Nivel1Ejercicio1() {\n document.getElementById('text').innerHTML='';\n let nombre = prompt('Su nombre?:')\n let noNumberName = nombre.replace(expRegular1,\"\");\n var arrNoNumber = noNumberName.split('')\n for (let i = 0; i < arrNoNumber.length; i++) {\n //document.getElementById('text').innerHTML+=\"${arrNoNumberName[i]}\" + '</br>';\n //document.getElementById('text').innerHTML+= '\"' + noNumberName[i] + '\"' + '\\r\\n';\n document.getElementById('text').innerHTML+= arrNoNumber[i] +' </br>';\n}\n}", "function compasso(NumCompasso, idDiv) {\n //variavel responsavel por comtrolar o espacamento dos compassos...\n var EspaCompasso = 100 / NumCompasso;\n //para garantir o mesmo espacamento...\n var TamCompasso = EspaCompasso;\n\n let y1 = 40;\n let y2 = 60;\n\n let id = 0;\n id++;\n for (let i = 1; i < NumCompasso; i++, EspaCompasso += TamCompasso, id++) {\n createLine(EspaCompasso, y1, EspaCompasso, y2, \"compasso\" + id, idDiv, \"compasso\");\n }\n createLine(98.2, y1, 98.2, y2, \"compasso\" + id, idDiv, \"compasso\");\n}", "function elevar_al_cuadrado(numero)\n{\n return numero * numero;\n}", "static calcularPersonas(num){\n for (let i = 0; i < num; i++) {\n personas[i] = new Persona();\n personas[i].getNumero(i + 1);\n }\n }", "function Tablas(numero, rango){\n // aqui iran los numeros por los cuales se va a multiplicar las tablas\n var indiceGeneral = 0;\n var tablas = [];\n var ejemplos = [];\n var respuestas = [];\n // this converts the input to an integral\n var rangoReal = parseInt(rango) + 1\n\n for (var i = 0; i < rangoReal ; i++) {\n tablas.push(indiceGeneral)\n indiceGeneral++\n }\n\n\n for (var i = 0; i < tablas.length; i++) {\n ejemplos.push(`${numero} times ${tablas[i]} equals?`);\n respuestas.push(numero * tablas[i]);\n }\n\n return {ejemplos, respuestas, indiceGeneral, rango};\n\n\n }", "function escogerValorMasGrande(elemetos){\n\n}", "function holamundo(texto){\n var hola_mundo=\"Texto dentro de una funcion\";\n console.log(texto);\n // metodo toString permite convertir un numero en un string \n console.log(numero.toString());\n console.log(hola_mundo);\n}", "function floatParaText(valor) {\n var text = (valor < 1 ? \"0\" : \"\") + Math.floor(valor * 100);\n text = \"R$ \" + text;\n return text.substr(0, text.length - 2) + \",\" + text.substr(-2);\n}", "function parantezlerDengelimi(metin){\n const dizi=metin.split('');\n console.log(dizi);\n const result=dizi.reduce((pre,current) => {\n if(pre<0){\n return pre;\n }\n if(current==='('){\n return ++pre;\n } \n if(current===')') {\n return --pre;\n }\n return pre;\n \n \n },0);\n console.log(result);\n if(!result){\n console.log(metin+ \" Veri Dengelidir\");\n }\n else {\n console.log(metin+ \" Veri Dengeli Değil\")\n }\n}", "function dobro(numero) {\n return numero * 2;\n}", "function numeroPerfecto(numero){\n let divisores = 0;\n\n if (numero < 0) {\n alert(\"no se admiten numeros negativos\");\n return;\n }\n\n if (numero.length >= 9) {\n alert(\"este numero es muy largo y demora mucho en procesar, te recomiendo mirar los otros ejemplos\")\n return;\n }\n // al agregar el diferente de nulo si se ingresa la letra (E) valida el campo numerico\n // al quitar esta comparacion no valida el campo numerico\n if (divisores == 0 && numero == null || numero == \"\") {\n alert(\"valor no permitido\");\n return;\n }\n for (let i = 1; i <= numero / 2; i++) {\n if (numero % i == 0) {\n //captura los divisores\n divisores +=i;\n }\n if (divisores == numero) {\n alert(`el numero ${numero} es perfecto`);\n return;\n\n }\n }\n if (numero != divisores) {\n alert(`el numero ${numero} no es perfecto`);\n return;\n\n }\n}", "function calculaPromedioDeTresNumeros(num1, num2, num3){\r\n let promedio = (num1 + num2 +num3)/3;\r\n // return 'El promedio es: ' + promedio + ' dolares';\r\n return `El promedio es: ${promedio} dolares`;\r\n}", "function notas() {\n var num = Number(document.getElementById(\"num\").value);\n var media = 0;\n var notaP = 0;\n var notaA = 0;\n var array = [];\n\n if (num > 0) {\n for (var i = 0; i < num; i++) {\n let nota = Number(prompt(\"Introduce la nota del examen \" + (i + 1)));\n if (!isNaN(nota)) {\n array.push(nota);\n } else {\n i--;\n alert(\"Solo numeros\");\n }\n }\n\n media = calcularMedia(array);\n notaP = notaBaja(array);\n notaA = notaAlta(array);\n let felicitacion = \"\";\n\n if (media >= 89 && media <= 100) {\n felicitacion = \"A+\";\n } else {\n felicitacion = \"Trabaja mas duro amigo\";\n }\n\n document.getElementById(\"return\").innerHTML =\n \"Nota media = \" +\n media +\n \" \" +\n felicitacion +\n \"<br>Nota mas baja - \" +\n notaP[1] +\n \" del examen \" +\n notaP[0] +\n \"<br>Nota mas alta - \" +\n notaA[1] +\n \" del examen \" +\n notaA[0];\n }\n console.log(array);\n}", "function agregarNumero(num){\n opActual = opActual + num; \n actualizarDisplay();\n}", "function posicionaNaviosJogador(){\r\n for (var i = 0; i < 10; i++){\r\n console.error(\"\\nNavio n.º \"+(i+1));\r\n linhaJogador = (pegarNumero(\"Linha: \", 1, 10)-1);\r\n colunaJogador = (pegarNumero(\"Coluna: \", 1, 10)-1);\r\n if (tabuleiro[linhaJogador][colunaJogador] == \" ~~~~ \"){\r\n tabuleiro[linhaJogador][colunaJogador] = \" <^^> \";\r\n contadorJogador++;\r\n }\r\n else {\r\n console.log(\"Espaço já ocupado. Você perdeu um navio. \")\r\n }\r\n }\r\n naviosJogador = contadorJogador;\r\n}", "function processa_letra()\n{\n let letra = document.getElementById(\"entrada\").value; //le o valor da entrada\n alert(\"voce digitou mais de um caracter\")\n //verifica se a entrada e valida\n if (letra.length > 1)\n {\n alert(\"voce digitou mais de um caracter\")\n }\n //processa a letra\n else \n {\n //coloca em minusculo\n letra = letra.toLowercase();\n //vefica se esta na palavra\n let j = 0;\n for(let i = 0; i < jogo.palavra.length; i++)\n {\n if (jogo.palavra[i] == letra)\n {\n jogo.acertos++;\n jogo.try_cor[i] = letra;\n }\n else\n {\n j++;\n }\n }\n\n if(i == j)\n {\n try_err = try_err + letra;\n jogo.erros++;\n }\n\n verifica_jogo(jogo);\n }\n\n\n}", "function _CarregaPericias() {\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var achou = false;\n for (var i = 0; i < pericia.classes.length; ++i) {\n // Aplica as pericias de mago a magos especialistas tambem.\n if (pericia.classes[i] == 'mago') {\n achou = true;\n break;\n }\n }\n if (!achou) {\n continue;\n }\n for (var chave_classe in tabelas_classes) {\n var mago_especialista = chave_classe.search('mago_') != -1;\n if (mago_especialista) {\n pericia.classes.push(chave_classe);\n }\n }\n }\n var span_pericias = Dom('span-lista-pericias');\n // Ordenacao.\n var divs_ordenados = [];\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var habilidade = pericia.habilidade;\n var prefixo_id = 'pericia-' + chave_pericia;\n var div = CriaDiv(prefixo_id);\n var texto_span = Traduz(pericia.nome) + ' (' + Traduz(tabelas_atributos[pericia.habilidade]).toLowerCase() + '): ';\n if (tabelas_pericias[chave_pericia].sem_treinamento) {\n texto_span += 'ϛτ';\n }\n div.appendChild(\n CriaSpan(texto_span, null, 'pericias-nome'));\n\n var input_complemento =\n CriaInputTexto('', prefixo_id + '-complemento', 'input-pericias-complemento',\n {\n chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n AtualizaGeral();\n evento.stopPropagation();\n }\n });\n input_complemento.placeholder = Traduz('complemento');\n div.appendChild(input_complemento);\n\n var input_pontos =\n CriaInputNumerico('0', prefixo_id + '-pontos', 'input-pericias-pontos',\n { chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n ClickPericia(this.chave_pericia);\n evento.stopPropagation(); } });\n input_pontos.min = 0;\n input_pontos.maxlength = input_pontos.size = 2;\n div.appendChild(input_pontos);\n\n div.appendChild(CriaSpan(' ' + Traduz('pontos') + '; '));\n div.appendChild(CriaSpan('0', prefixo_id + '-graduacoes'));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total-bonus'));\n div.appendChild(CriaSpan(' = '));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total'));\n\n // Adiciona as gEntradas\n gEntradas.pericias.push({ chave: chave_pericia, pontos: 0 });\n // Adiciona ao personagem.\n gPersonagem.pericias.lista[chave_pericia] = {\n graduacoes: 0, bonus: new Bonus(),\n };\n // Adiciona aos divs.\n divs_ordenados.push({ traducao: texto_span, div_a_inserir: div});\n }\n divs_ordenados.sort(function(lhs, rhs) {\n return lhs.traducao.localeCompare(rhs.traducao);\n });\n divs_ordenados.forEach(function(trad_div) {\n if (span_pericias != null) {\n span_pericias.appendChild(trad_div.div_a_inserir);\n }\n });\n}", "function printMetinisPajamuDydis() {\n var metinesPajamos = atlyginimas * 12;\n console.log(\"per metus uzdirbu:\", metinesPajamos);\n\n}", "function numberLine(data){\n\tline = data.nb;\n\tdocument.getElementById(\"NombreTournage\").innerHTML=line;\n}", "transformar(numero) {\n switch (numero) {\n case 0:\n return 'celeste'\n case 1:\n return 'violeta'\n case 2:\n return 'naranja'\n case 3:\n return 'verde'\n }\n }", "function idadePessoa(ano, mes, dias) {\n //return ano + \" \" + mes\n const diasAno = 365;\n const diasMes = 30;\n\n const idadeEmAnos = ano * diasAno\n //console.log(idadeEmAnos)\n\n const idadeEmMeses = mes * diasMes\n //console.log (idadeEmMeses)\n\n const idadeEmDias = idadeEmAnos + idadeEmMeses + dias;\n \n return `Você possui ${idadeEmDias} dias de vida`\n //return idadeEmDias;\n\n}", "function prueba (cuenta){\n\tlet count = cuenta\n\tfor (let i = 0; i < Math.floor(count/2); i++){\n\t\tconsole.log(i)\n\t}\n}", "function ejercicio1 (a) {\r\n var numeros = \"\",\r\n i;\r\n //This \"for\" is responsible for going through the list to multiply the other values.\r\n for (i = 0; i < a.length; i++) {\r\n var multiplicando = 1;\r\n //This \"for\" searches for the other values other than the position to multiply and add them to the result.\r\n for (j = 0; j < a.length; j++) { \r\n //This \"if\" prevents the same value that we are in from multiplying\r\n if (i != j) \r\n multiplicando = multiplicando * a[j];\r\n }\r\n //This “if” is in charge of concatenating the texts, and if it is the last one, it gives it a different format.\r\n if (i == a.length - 1){\r\n numeros = numeros + multiplicando;\r\n } else {\r\n numeros = numeros + multiplicando + \", \";\r\n } \r\n }\r\n return numeros;\r\n}", "function selecaoLivro(i, livros) {\n\n\n //Variavel para armazenar a quantidade de incones de estrelas de acordo com a nota do livro \n let qntEstrelas = ''\n //Quantas estrelas inteiras o livro tem \n for (var j = 1; j < livros[i][2]; j++) {\n console.log(j)\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n console.log(qntEstrelas)\n }\n\n //Se a nota do livro tiver parte decimal...\n if (livros[i][2] % 1 != 0) {\n //Se a parte decimal for maior do que 0,5 o livro ganha uma estrela completa(arredonda pra cima)\n if (livros[i][2] % 1 > 0.5) {\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n //Se não o livro ganha meia estrela\n } else {\n qntEstrelas += `\n <img src=\"icones/star-half-full.svg\" alt=\"icone de strela quase cheia\">\n `\n console.log(qntEstrelas)\n }\n } else {\n //Atribuindo a estrela caso livro não tenha parte decimal\n //A ultima estrela é atribuida depois para que caso o livro tenha parte decimal ela não seja atribuida 2 vezes\n //Uma pela parte decimal no for\n //E outra na validação se a parte decimal é maior que 0.5(Estrela interia), ou menor ou igual(Meia estrela)\n qntEstrelas += `\n <img src=\"icones/star.svg\" alt=\"icone de strela\">\n `\n }\n\n //Pagina do livro pra detalhes\n //Não troca de pagina para entrar em detalher a pagina apenas alteras suas infos\n let paginaCompleta = `\n\n <div class=\"root\">\n <div class=\"livroEscolido\">\n <div>\n <img src=${livros[i][6]}>\n </div>\n <div class=\"centralize\">\n <div>\n <div>\n <h3>${livros[i][0]}</h3>\n <h3>${livros[i][1]}</h3>\n </div>\n <p>\n ${livros[i][5]}\n </p>\n <h4>${livros[i][4]}</h4>\n\n <div class=\"addLista\">\n <button id=\"${i}\" onclick=\"inserirLivro(this.id, minhaLista)\">Adicionar á minha lista</button>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"detalhes\">\n <header class=\"titulo\">\n <a href=\"index.html\">\n <img class=\"retorno\" src=\"icones/arrow-left-circle.svg\">\n </a>\n <img class=\"logo\" src=\"imagens/logotipo.png\">\n </header>\n\n <div>\n <div>\n <h1>${livros[i][0]} - ${livros[i][1]}</h1>\n </div>\n <div>\n <div class=\"areaAvaliacao\">\n `\n //Definindo cor do quadrado de avaliação \n if (livros[i][2] >= 3.5) {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota verde\">${livros[i][2]}</div>\n `} else if (livros[i][2] > 1.5 && livros[i][2] < 3.5) {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota amarelo\">${livros[i][2]}</div>\n `} else {\n paginaCompleta = paginaCompleta + `\n <div class=\"quadradoNota vermelho\">${livros[i][2]}</div>\n `}\n\n paginaCompleta = paginaCompleta + `\n <div class=\"avaliacao\">\n <div>\n ${qntEstrelas}\n </div>\n <p>\n ${livros[i][3]} avaliações\n </p>\n </div>\n </div>\n\n <div class=\"resenha\">\n <h3>Resenha</h3>\n <p>\n ${livros[i][7]}\n </p>\n </div>\n </div>\n </div>\n </div>\n </div>\n <script type=\"text/javascript\" src=\"funcoes.js\"></script>\n </script>\n\n \n `\n //Esperando transição de tela\n setTimeout(function () {\n //Chamando função reponsavel pela atualização dos dados da pagina \n criarPagina(paginaCompleta)\n }, 1000);\n}" ]
[ "0.6941278", "0.69173896", "0.6682775", "0.6546764", "0.64804053", "0.64278364", "0.64190567", "0.6409729", "0.63893515", "0.6347284", "0.63382107", "0.63155377", "0.6299086", "0.62860584", "0.62399644", "0.61815965", "0.6119917", "0.611513", "0.60884166", "0.6086822", "0.60635436", "0.60626125", "0.6060356", "0.60506743", "0.6045412", "0.60338396", "0.6027039", "0.6006583", "0.60001016", "0.5995255", "0.5963776", "0.5946284", "0.59122366", "0.5903984", "0.5885691", "0.5885223", "0.58777106", "0.58433604", "0.5817115", "0.58133495", "0.5810641", "0.57997143", "0.57908356", "0.57876205", "0.5782581", "0.57807374", "0.5778363", "0.57741344", "0.577064", "0.57613206", "0.5760023", "0.5758826", "0.575805", "0.5749583", "0.5748614", "0.5744544", "0.5740904", "0.57402575", "0.57348037", "0.57282305", "0.57234484", "0.5722766", "0.57216465", "0.5720978", "0.571833", "0.5717737", "0.57157403", "0.5709699", "0.57082886", "0.5704928", "0.57041204", "0.5697449", "0.5695737", "0.56933427", "0.56898314", "0.5682739", "0.56788045", "0.5671057", "0.5669346", "0.5668947", "0.566682", "0.5666144", "0.5663928", "0.5662941", "0.56598043", "0.5658161", "0.5656649", "0.5656381", "0.5653787", "0.5650039", "0.5648299", "0.5639237", "0.5629598", "0.5629573", "0.5626734", "0.5624216", "0.56232053", "0.56183666", "0.5617054", "0.5616353", "0.56150997" ]
0.0
-1
Method for adding a track to the playlist on the right / below
addTrack(track) { let tracks = this.state.playlistTracks; // Don't let users add a song more than once. if (!tracks.includes(track)) { tracks.push(track); this.setState({playlistTracks: tracks}); } else { console.log('Duplicate. Track not added.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTrack(track) {\n\t\tconst addingTrack = (track) => this.setState({playlistTracks: [...this.state.playlistTracks, track]});\n\t\taddingTrack(track);\n\t\tthis.removeTrack(track, false);\n\t}", "addSongToPlaylist (e) {\n if (this.props.canAddDirectly) {\n this.props.addSong(this.props.activePlaylistID, this.props.trackInfo.uri);\n } else {\n this.props.addSongToDB(this.props.session.connected_session.data.joinCode, this.props.trackInfo, this.props.userId);\n }\n notify.show(\"Added song \" + this.props.trackInfo.name, \"success\", 2000);\n }", "addTrack(track) {\n let playlistTracks = this.state.playlistTracks;\n if (playlistTracks.find(savedTrack => savedTrack.id === track.id)) {\n return;\n }\n playlistTracks.unshift(track);\n this.setState({ playlistTracks: playlistTracks });\n }", "function addTrack(track) {\n\ttracks[nextFreeIndexTracks] = track;\n\tnextFreeIndexTracks++;\n\t// Refresh the dropdownMenu\n\tgenerateDropdownMenu();\n}", "add(url, track) {\n this.queue.push(url);\n this.trackInfo.push(track);\n return this.emit('song added', url, track);\n }", "addTrack() {\n\t\tthis.props.onAdd(this.props.track);\n\t}", "addTracks() {\n let { playlistId, tracks } = this.state;\n spotifyApi.addTracksToPlaylist(playlistId, tracks);\n }", "function addToPlaylist(trackId, playlist) {\n spotifyApi.addTracksToPlaylist(playlist, [`spotify:track:${trackId}`])\n .then(function (data) {\n console.log('Added tracks to playlist!');\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "function addNewTrack() {\n\tlet filename = document.getElementById('newTrack').value.split('\\\\');\n\tfilename = filename[filename.length - 1];\n\tsound.trackInfo.push({fileName: filename, trackName: filename.split('.')[0], input: null, reversed: false, gain: null, min: 0, max: 1, pinToData: true},)\n\n\n\tconst mixer = document.getElementById('mixerBox');\n\tmixer.insertAdjacentHTML('beforeend', `\n\t\t\t<td id='Track${sound.trackInfo.length - 1}' class='mixerTrack'>Track ${sound.trackInfo.length - 1}</td>\n\t\t\t`)\n\n\tsetUpTrack(sound.trackInfo.length - 1);\n}", "addTrack(track){\r\n this.tracks.push(track);\r\n \r\n }", "addTrack(track) {\n let tracks = this.state.playlistTracks;\n if (tracks.find((currentTrack) => currentTrack.id === track.id)) {\n return;\n }\n tracks.push(track);\n this.setState({ playlistTracks: tracks });\n }", "addTrack() {\n this.props.onAdd(this.props.track);\n }", "function addTracksToPlaylist(data, callback){\n\tsessionStorage.songs = JSON.stringify(MASTER_TRACKLIST); \n\tsessionStorage.spotifyUserId = JSON.stringify(spotifyUserId);\n\n\tplaylistId = data.id;\n\tsessionStorage.playlistId = JSON.stringify(playlistId);\n\tvar tracks = [];\n\tfor(var i = 0; i < MASTER_TRACKLIST.length; i++){\n\t\ttracks.push(MASTER_TRACKLIST[i].id);\n\t}\n\tvar tracksString = tracks.join(\",spotify:track:\");\n\t\n\tvar url = 'https://api.spotify.com/v1/users/' + spotifyUserId +\n\t'/playlists/' + playlistId +\n\t'/tracks?uris='+encodeURIComponent(\"spotify:track:\"+tracksString);\n\t$.ajax(url, {\n\t\tmethod: 'POST',\n\t\tdataType: 'text',\n\t\theaders: {\n\t\t\t'Authorization': 'Bearer ' + AUTHORIZATION_CODE,\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tsuccess: function(d) {\n\t\t\tcallback(d, data.external_urls.spotify);\n\t\t},\n\t\terror: function(r) {\n\t\t\tcallback(null, null);\n\t\t}\n\t});\n}", "addTrack(track) {\n/* if (!this.state.playlistTracks.includes(track)) { // Step 41\n this.setState({playlistTracks: this.state.playlistTracks.splice(this.state.playlistTracks.count,0,track.id)}); //add a track at the end of the playlist\n*/\n if (this.state.playlistTracks.indexOf(track) === -1) {\n const newPlayList = this.state.playlistTracks;\n newPlayList.push(track);\n this.setState({playListTracks: newPlayList})\n // this.setState({playlistTracks: this.state.playlistTracks.push(track)});\n }\n }", "addTrack() {\n this.props.onAdd(this.props.track);\n }", "function addTrack(ID) {\n var query = \" SELECT concat('file://','/', u.rpath)\";\n query += \" FROM tracks t, urls u\";\n query += \" where t.id=\"+ID;\n query += \" and t.url=u.id\";\n var result = sql(query);\n Amarok.Playlist.addMedia(new QUrl(result[0]));\n}", "handleAdd(image,name,title,link){\n this.props.addTrackToPlaylist(spotifyApi,[link],this.props.playlist.id);\n // Assigning the track to a variable so it can be shown\n let newObj = {};\n let songObj = {};\n newObj = Object.assign({},newObj,{\n image:image,\n name:name,\n title:title,\n uri:link,\n })\n newItems.push(newObj);\n songs = newItems;\n songObj = Object.assign({},songObj,{\n items:newItems\n })\n songs = songObj\n }", "function addTracksPlaylist(playlistId, tracks, accessToken) {\n // curl -i -X POST \"https://api.spotify.com/v1/playlists/7oi0w0SLbJ4YyjrOxhZbUv/tracks?uris=spotify%3Atrack%3A4iV5W9uYEdYUVa79Axb7Rh,spotify%3Atrack%3A1301WleyT98MSxVHPZCA6M\" -H \"Authorization: Bearer {your access token}\" -H \"Accept: application/json\"\n const uris = tracks.map(t => t.uri).join(',');\n\n return axios({\n method: 'post',\n baseURL: 'https://api.spotify.com/v1',\n url: `/playlists/${playlistId}/tracks`,\n headers: {\n Authorization: 'Bearer ' + accessToken\n },\n params: {\n uris\n }\n });\n}", "function _createPlaylistTrack(cover, title) {\n\n\t\t\tif(!options.playlist) { return false; }\n var coverDom = cover ? '<img src=\"'+cover+'\" style=\"border: 1px solid '+options.strokeColor+';\" />' : '<div class=\"fap-cover-replace-small\" style=\"background: '+options.wrapperColor+'; border: 1px solid '+options.strokeColor+';\"></div>';\n\n\t\t\t$playlistWrapper.append('<li class=\"clearfix\">'+coverDom+'<span>'+title+'</span><div class=\"fap-remove-track\">&times;</div></li>');\n\t\t\tvar listItem = $playlistWrapper.children('li').last().css({'marginBottom': 0, 'height': 'auto'});\n\n\t\t\tif(navigator.appVersion.indexOf(\"MSIE 7.\")==-1) {\n\t\t\t\tif(!cover) { _createCoverReplacement(listItem.children('.fap-cover-replace-small').get(0), 20, 20); }\n\t\t\t}\n\n\t\t\t//Playlist Item Event Handlers\n\t\t\tif($elem.jquery >= \"1.7\"){\n\t\t\t\tlistItem.on('click', 'span', _selectTrackFromPlaylist);\n\t\t\t\tlistItem.on('click', '.fap-remove-track', _removeTrackFromPlaylist);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlistItem.delegate('span', 'click', _selectTrackFromPlaylist);\n\t\t\t\tlistItem.delegate('.fap-remove-track', 'click', _removeTrackFromPlaylist);\n\t\t\t}\n\n\t\t\tfunction _selectTrackFromPlaylist() {\n\t\t\t\tvar $listItem = $(this).parent();\n\t\t\t\tif($listItem.hasClass('fap-prevent-click')) {\n\t\t\t\t\t$listItem.removeClass('fap-prevent-click');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar index = $playlistWrapper.children('li').index($listItem);\n\t\t\t\t\t$.fullwidthAudioPlayer.selectTrack(index, true);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tfunction _removeTrackFromPlaylist() {\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tindex = $this.parent().parent().children('li').index($this.parent());\n\n\t\t\t\ttracks.splice(index, 1);\n\t\t\t\t$this.parent().remove();\n\n\t\t\t\tif(index == currentIndex) {\n\t\t\t\t\tcurrentIndex--;\n\t\t\t\t\tindex = index == tracks.length ? 0 : index;\n\t\t\t\t $.fullwidthAudioPlayer.selectTrack(index, paused ? false : true);\n\t\t\t\t}\n\t\t\t\telse if(index < currentIndex) {\n\t\t\t\t\tcurrentIndex--;\n\t\t\t\t}\n\n\t\t\t\t$playlistWrapper.getNiceScroll().resize();\n\t\t\t\tif(options.storePlaylist) { amplify.store('fap-playlist', JSON.stringify(tracks)); }\n\t\t\t};\n\n\t\t\t$playlistWrapper.getNiceScroll().resize();\n\n\t\t}", "addTrack(track) {\n const alreadyInPlaylist = this.state.playlistTracks.some((el) => {\n return el.id === track.id;\n });\n if (!alreadyInPlaylist) {\n const newPlaylist = this.state.playlistTracks.concat(track);\n this.setState({ playlistTracks : newPlaylist });\n }\n }", "onAddToPlaylist(index) {\n const { addToPlaylist, addClipToPlaylist, clip } = this.props;\n\n // Add the clip to playlist.list\n addToPlaylist(clip.list[index]);\n\n // Set in the clip that is part of the playlist\n addClipToPlaylist(clip.list[index].id);\n }", "function addTracksSC( url, playnow ){\n\t//var hardUrl = '/deep-house-amsterdam/jay-west-deep-house-amsterdam';\n\t//scplayer.add_tracks(hardUrl);\n\tvar found_at_index = scplayer.add_tracks(url);\n\t\n\tif ( found_at_index == 'current_track'){\n\t\t//alert(\"it's the current track!\");\n\t}\n\t\n\tif ( found_at_index != 'current_track'){\n\n\t\tvar $pl = $(\"#playlist\");\t\t\n\t\t\n\t\tif ( found_at_index > 0 ){\n\t\t\t$pl.find( 'li:nth-child(' + ( found_at_index + 1 ) + ')' ).remove();\n\t\t}\n\t\t//if ( found_at_index == 0 ) {\n\t\t\t//var x=0;\n\t\t\tvar playlist = scplayer.playlist();\n\t\t\tvar l= playlist.length;\n\t\t\tl = l-1;\n\n\t\t\tvar $li = jQuery(\"<li/>\", {\"html\": \"<span>loading..</span>\"}).data('index', l).appendTo($pl);\n\n\t\t\t//lookup the track info\n\t\t\tscplayer.track_info(l).done(function(track){\n\t\t\t\t//console.log(track);\n\t\t\t\t$li.html('<span><div class=\"playlist-track-wrapper\"><img class=\\\"playlist_artwork\\\" src=\\\"' + track.artwork_url + '\\\"/>' + track.title + '</span><a href=\"' + track.permalink_url + '\" target=\"_blank\" class=\"soundcloud-logo-small\">View on Soundcloud</a></div>');\n\t\t\t\t//scplayer.goto(jQuery(this).data('index', l) ).play();\n\t\t\t\t//scplayer.goto(jQuery(this).data('index', l)).play();\n\t\t\t});\n\t\t//}\n\n\t\t//else {\n\t\t\t/* Remove n-th li (where the track was found, since we append to the end )*/\n\t\t\t//$pl.find( 'li:nth-child(' + ( found_at_index + 1 ) + ')').clone().appendTo($pl);\n\t\t\t//$pl.find( 'li:nth-child(' + ( found_at_index + 1 ) + ')' ).remove();\n\t\t//}\n\n\t\tif ( playnow == true ){\n\t\t\t$(\"#playlist li:last\").find('span').click();\n\t\t\t//alert('clicked');\n\t\t\t//var track = scplayer.current_track;\n\t\t\t//$(\"#now_playing\").html(track.title);\n\t\t}\t\n\t}\n}", "function addTrack() {\r\n const albumTrackList = document.getElementById(\"albumTrackList\");\r\n const newLi = document.createElement(\"li\");\r\n newLi.className = \"trackContainer\";\r\n\r\n const titleContainer = document.createElement('div');\r\n titleContainer.className = \"titleContainer\";\r\n const titleLabel = document.createElement(\"label\");\r\n const titleLabelText = document.createTextNode(\"Title: \");\r\n titleLabel.appendChild(titleLabelText);\r\n const titleInput = document.createElement(\"input\")\r\n titleInput.type = \"text\";\r\n titleInput.className = \"trackTitleInput\";\r\n titleContainer.appendChild(titleLabel);\r\n titleContainer.appendChild(titleInput);\r\n\r\n const trackRuntimeContainer = document.createElement('div');\r\n trackRuntimeContainer.className = \"trackRuntimeContainer\";\r\n const runtimeLabel = document.createElement(\"label\");\r\n const runtimeLabelText = document.createTextNode(\"Running time:\");\r\n runtimeLabel.appendChild(runtimeLabelText);\r\n const runtimeInput = document.createElement(\"input\")\r\n runtimeInput.type = \"text\";\r\n runtimeInput.className = \"trackRuntimeInput\";\r\n trackRuntimeContainer.appendChild(runtimeLabel);\r\n trackRuntimeContainer.appendChild(runtimeInput);\r\n\r\n newLi.appendChild(titleContainer);\r\n newLi.appendChild(trackRuntimeContainer);\r\n\r\n const plusButton = document.getElementById(\"addTrackButton\");\r\n albumTrackList.insertBefore(newLi, plusButton);\r\n\r\n const minusButton = document.createElement(\"button\");\r\n minusButton.type=\"button\";\r\n minusButton.class=\"removeTrackButton\";\r\n const minusButtonText = document.createTextNode(\"-\");\r\n minusButton.appendChild(minusButtonText);\r\n newLi.appendChild(minusButton);\r\n minusButton.addEventListener(\"click\", removeField);\r\n}", "addPlaylist(playlist)\n {\n if(this.name === null) {\n this.name = playlist.name;\n }\n for (let song of playlist.songs) {\n let newSong = new Song('', '', song);\n this.songs.push(newSong);\n }\n }", "addSong(songInfo, position) {\n if (position == \"start\")\n {\n //this.songs.unshift(songInfo);\n //Adds song to right after the currently playing song\n this.songs.splice( this.position + 1, 0, songInfo);\n }\n else if (position == \"end\")\n {\n this.songs.push(songInfo);\n }\n\n //Probably tries to update for everyone too\n }", "addTrack(albumName, params) {\n let aTrack = new track.Track( params.name, params.duration, params.genres);\n let aAlbum = this.getAlbumByName(albumName);\n aAlbum.tracks.push( aTrack );\n /* El objeto track creado debe soportar (al menos) las propiedades:\n name (string),\n duration (number),\n genres (lista de strings)\n */\n }", "savePlaylist() {\n\t\tlet trackURIs = [];\n\t\tfor(let i = 0; i < this.state.playlistTracks.length; i++) {\n\t\t\ttrackURIs.push(this.state.playlistTracks[i].uri);\n\t\t}\n\t\tSpotify.savePlaylist(this.state.playlistName, trackURIs);\n\t\tthis.setState({playlistName: 'New Playlist', playlistTracks: []});\n\t}", "addTrack(){\n this.props.onAdd(this.props.track);\n }", "function addSongToPlayList(obj){\r\n PlayList.push(obj);\r\n ShowSongs(obj);\r\n}", "addTrack(track) {\n if (!this.state.playlistTracks.find(playlistTrack => playlistTrack.id === track.id)) {\n this.setState(prevState => ({\n playlistTracks: [...prevState.playlistTracks, track]\n }));\n }\n }", "addTrack(track) {\n let tracks = this.state.playlistTracks;\n if(tracks.find( savedTrack => \n savedTrack.id === track.id)) {\n return;\n } \n\n tracks.push(track);\n this.setState({ playlistTracks: tracks });\n }", "function appendToSongDisplay(song, index) {\n /*\n Grabs the playlist element we will be appending to.\n */\n var playlistElement = document.querySelector('.white-player-playlist');\n\n /*\n Creates the playlist song element\n */\n var playlistSong = document.createElement('div');\n playlistSong.setAttribute('class', 'white-player-playlist-song amplitude-song-container amplitude-play-pause');\n playlistSong.setAttribute('data-amplitude-song-index', index);\n\n /*\n Creates the playlist song image element\n */\n var playlistSongImg = document.createElement('img');\n playlistSongImg.setAttribute('src', song.cover_art_url);\n\n /*\n Creates the playlist song meta element\n */\n var playlistSongMeta = document.createElement('div');\n playlistSongMeta.setAttribute('class', 'playlist-song-meta');\n\n /*\n Creates the playlist song name element\n */\n var playlistSongName = document.createElement('span');\n playlistSongName.setAttribute('class', 'playlist-song-name');\n playlistSongName.innerHTML = song.name;\n\n /*\n Creates the playlist song artist album element\n */\n var playlistSongArtistAlbum = document.createElement('span');\n playlistSongArtistAlbum.setAttribute('class', 'playlist-song-artist');\n playlistSongArtistAlbum.innerHTML = song.artist + ' &bull; ' + song.album;\n\n /*\n Appends the name and artist album to the playlist song meta.\n */\n playlistSongMeta.appendChild(playlistSongName);\n playlistSongMeta.appendChild(playlistSongArtistAlbum);\n\n /*\n Appends the song image and meta to the song element\n */\n playlistSong.appendChild(playlistSongImg);\n playlistSong.appendChild(playlistSongMeta);\n\n /*\n Appends the song element to the playlist\n */\n playlistElement.appendChild(playlistSong);\n}", "function playlistAdd(songName) {\r\n if (songButtons[songName] != undefined) {\r\n return false;\r\n }\r\n \r\n var songButton = document.createElement(\"button\");\r\n var songButtonText = document.createElement(\"span\");\r\n\r\n songButtonText.appendChild(document.createTextNode(songName));\r\n songButtonText.classList.add(\"songText\");\r\n\r\n songButton.appendChild(songButtonText);\r\n songButton.classList.add(\"btn\", \"btn-lg\", \"song\");\r\n songButton.setAttribute(\"type\", \"button\");\r\n songButton.addEventListener(\"click\", function() {\r\n streamSong(songName);\r\n });\r\n\r\n songPlaylist.appendChild(songButton);\r\n songButtons[songName] = {\r\n button: songButton,\r\n index: songs.length\r\n }\r\n\r\n return true;\r\n }", "function handlePlaylistSongAdded(songIndex){\n // first Song added\n if(songIndex==0){\n\td3.select(\"#playlistPlayButton\")\n\t .attr(\"disabled\",null);\n\tvar song = playlist.getSong(songIndex);\n\tvar releaseIndex = song.releaseIndex;\n\tvar release = playlist.getRelease(releaseIndex);\n\tvar videoId = release.videoId;\n\ttry{\n\t player.cueVideoById(videoId);\n\t}catch(error){\n\t console.log(error);\n\t playlist.list=[];\n\t}\n }\n displayPlaylist();\n}", "addTrack(track)\n {if (this.state.playlistTracks.find(savedTrack =>\n savedTrack.id === track.id)) {return;}\n else { this.state.playlistTracks.push(track) };\n let playlistTracks = this.state.playlistTracks;\n this.setState({playlistTracks:playlistTracks});\n}", "addTrack(albumId, trackData) {\n return this.artistManager.createTrack(trackData, undefined, albumId);\n }", "function createSpotifyPlaylist(message) {\n spotifyApi.createPlaylist('MaeshBot\\'s Playlist', { 'description': 'Playlist converted from YouTube by MaeshBot :)', 'public': true })\n .then(function (data) {\n var spotifyPlaylistId = data.body.id;\n titles.forEach((title) => {\n // search for title\n searchAndAdd(title, spotifyPlaylistId);\n // add first track to playlist\n })\n message.channel.send(\"Here's the link to the playlist: \" + String(data.body.external_urls.spotify));\n console.log('Created playlist!', data.body);\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "function updatePlaylist(playlist, artistName, songTitle)\n{\n playlist[artistName] = songTitle\n}", "function mashlistChangeTrack() {\n var $_mashlist = $('.mashlist[data-playing=\"1\"]');\n models.player.load(['context', 'playing', 'track']).done(function (player) {\n if (player.playing && player.context.uri == $_mashlist.attr('data-uri')) {\n models.Playlist.fromURI(playHistory).load(['tracks']).done(function (history) {\n history.tracks.add(player.track);\n listHistory.refresh();\n $('.sp-list-item').on('dblclick', function (e) {\n e.stopImmediatePropagation();\n });\n });\n }\n });\n }", "pushTrack() {\n console.log('pushing a song to the local DB')\n }", "async function addToNext(uri){\n \tconst newTrack = {\n \turi: uri[0],\n \tprovider: \"queue\",\n metadata: {\n is_queued: true, \n }\n }\n const currentQueue = Spicetify.Queue?.next_tracks\n currentQueue.unshift(newTrack)\n await Spicetify.CosmosAsync.put(\"sp://player/v2/main/queue\", {\n revision: Spicetify.Queue?.revision,\n next_tracks: currentQueue,\n prev_tracks: Spicetify.Queue?.prev_tracks\n }).catch( (err) => {\n \tconsole.error(\"Failed to add to queue\",err);\n \t Spicetify.showNotification(\"Unable to Add\");\n \t})\n \tSpicetify.showNotification(\"Added to Play Next\");\n }", "addTrack(track){\n // set variables\n let trackMatch = false;\n let tempPlaylist = this.state.playlistTracks;\n\n // loop through the playlist and test in the track\n // being added is already in the playlist\n for(let i=0; i < tempPlaylist.length; i++){\n if(track.id === tempPlaylist[i].id){\n trackMatch = true;\n }\n }\n\n // add the track if it isn't already in the PlayList\n if(!trackMatch){\n tempPlaylist.push(track);\n // update the state with the tempPlaylist\n this.setState({ playlistTracks:tempPlaylist });\n }\n }", "addTrack(albumId, trackData) {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n const album = this.getAlbumById(albumId);\n return album.addTrack(trackData);\n }", "function doPlaylist() {\n var size = playlist = findAll('.playlist li');\n itemOnClick = function () {\n currentTrackID = this.getAttribute('data-trackid');\n find('h1').innerHTML = find('strong', this).textContent;\n find('h2').innerHTML = find('span', this).textContent;\n size = getTitleFontSize(find('h2').textContent, find('.controls').getBoundingClientRect().width - 160);\n find('h2').style.fontSize = size + 'px';\n find('.currentTrack img').src = find('img', this).getAttribute('src');\n find('.play-pause').style.top = size / 4 + 'px';\n find('figcaption').innerHTML = find('strong', this).textContent + '<br>' + this.getAttribute('data-album');\n SC.get('/tracks/' + currentTrackID).then(function (track) {\n disablePlay();\n clearInterval(scTimer);\n if (scPlayer) {\n scPlayer.pause();\n }\n find('.loaded').style.width = 0;\n find('.fa-pause').style.display = 'none';\n find('.fa-play').style.display = 'block';\n currentTrackInfo = track;\n find('.duration').innerHTML = toMMSS(currentTrackInfo.duration);\n find('.played').innerHTML = toMMSS(0);\n doPlay(true);\n\n });\n scrollAnimation.setEndValue(0);\n buildUI();\n }\n for (var i = 0, l = playlist.length; i < l; i++) {\n playlist[i].addEventListener('click', itemOnClick);\n }\n }", "function searchAndAdd(title, playlistToAdd) {\n spotifyApi.searchTracks(title)\n .then(function (data) {\n var firstTrack = data.body.tracks.items[0].id;\n addToPlaylist(firstTrack, playlistToAdd);\n console.log('Searched for track', data.body);\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "addSong(){\n const url = urlInput.value\n const id = url.substr(url.indexOf(\"=\") + 1)\n const title = titleInput.value\n \n var validate = validation()\n if(!validate.isValidInput(playList, id, url, title)){\n return validate.render()\n }\n \n const song = {\n id: id,\n title: title\n }\n \n selectedVideo = id \n playList.push(song)\n this.render()\n }", "function updatePlaylist(playlist, artist, song) {\n //var playlist = {artist: song};\n playlist[artist] = song\n return\n}", "savePlaylist() {\n const playlistUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, playlistUris).then(response => {\n if (response) {\n this.setState({ playlistName: \"New Playlist\",\n playlistTracks : [] });\n }});\n }", "function nextTrack() {\n if(track_index < track_list.length -1) track_index += 1;\n else track_index = 0;\n\n // Load and play the new track\n loadTrack(track_index);\n playTrack();\n}", "function createPlaylist() {\n\t\t// create request\n\t\tvar request = {};\n\t\trequest[\"artistPool\"] = artistPool;\n\t\t\n\t\tvar requestBuilder = new SpotifyRequestBuilder();\n\t\trequestBuilder.postRequest(common.generatePlaylistURL, onCreatePlaylist, JSON.stringify(request));\n\t}", "function updatePlaylist(playlist, artistName, songTitle){\n \n playlist[artistName] = \"songTitle\";\n \n}", "addTrack(albumId, trackData) {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n let track = this.getAlbumById(albumId).addTrack(this.generateID(), trackData);\n this.notificationObserver.update(this);\n return track;\n }", "addSong(input) {\n this.songs.push(input);\n }", "function add_item_to_track_list(track_list_container, item_text, control_id, control_type) {\n var new_item = $('<li class=\"track-item\">' + item_text + '</li>');\n new_item.data('control_id', control_id);\n\n // Add an id for easy finding of the item.\n new_item.attr('id', control_id + '_list');\n\n // Process radio controls - only one item can be selected.\n if ( control_type == 'radio') {\n // Find the existing element on the track list, if there is one.\n var current_items = track_list_container.find('li');\n\n // If there are no items on the track list, add the new item.\n if ( current_items.size() == 0 ) {\n track_list_container.append(new_item);\n }\n else {\n // There is an item on the list.\n var current_item = $(current_items.get(0));\n\n // Is the item we want to add different from what is there?\n if ( current_item.data('control_id') != control_id ) {\n // Remove exiting element from track list, and add the new one.\n current_item.remove();\n track_list_container.append(new_item);\n }\n }\n return;\n }\n\n // Using checkboxes, so there can be more than one selected item.\n // Find the right place to put the new item, to match the order of the\n // checkboxes.\n var list_items = track_list_container.find('li');\n var item_comparing_to;\n\n // Flag to tell whether the item was inserted.\n var inserted_flag = false;\n list_items.each(function(index){\n item_comparing_to = $(list_items[index]);\n\n // If item is already on the track list, do nothing.\n if ( control_id == item_comparing_to.data('control_id') ) {\n inserted_flag = true;\n // Returning false stops the loop.\n return false;\n }\n else if ( control_id < item_comparing_to.data('control_id') ) {\n // Add it here.\n item_comparing_to.before(new_item);\n inserted_flag = true;\n // Returning false stops the loop.\n return false;\n }\n });\n\n // If not inserted yet, add new item at the end of the track list.\n if ( ! inserted_flag ) {\n track_list_container.append(new_item);\n }\n }", "savePlaylist() {\n const trackUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, trackUris).then(() => {\n this.setState({ \n playlistName: 'New playlist',\n playlistTracks: []\n })\n })\n }", "function addToPlaylist(songsList){\n for(var i=0; i<songsList.length; i++){\n // Getting metadata for the audio file\n id3({ file: songsList[i].toString(), type: id3.OPEN_LOCAL }, function(err, tags) {\n if(tags){\n tableRow = document.createElement(\"tr\")\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.title)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.album)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.artist)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n tableRow.setAttribute(\"id\", i)\n document.getElementById('playlist-body').appendChild(tableRow)\n }\n });\n }\n}", "addTrack(albumId, trackData) {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n const trackID = this._idManager.nextIdForTrack();\n const newTrack = new Track(trackID,trackData.name,trackData.duration,trackData.genres);\n this.addTrackToAlbum(albumId,newTrack);\n return newTrack;\n\n }", "function setPlaylist(p) {\n\tplaylist = p;\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "setPlayList(track){\n //Store both lists to make changes (change +- and add or remove track from playlist)\n let statePlayList = this.state.playList;\n let stateTrackList = this.state.trackList;\n //Get index to change the + and -\n const trackIndexPlayList = this.addOrRemove(track.id, statePlayList);\n const trackIndexTrackList = this.addOrRemove(track.id, stateTrackList);\n // Is in PlayList, let's remove it\n if(trackIndexPlayList > -1 ){\n statePlayList.splice(trackIndexPlayList,1);\n this.setState({playList: statePlayList});\n // Additional check if remove after a new search. TrackList doest not need an update\n if(trackIndexTrackList > -1 ){\n stateTrackList[trackIndexTrackList].addRemove = '+';\n this.setState({trackList: stateTrackList});\n }\n } else {\n // Is not in PlayList, let's add it\n statePlayList.push(track);\n stateTrackList[trackIndexTrackList].addRemove = '-';\n this.setState({trackList: stateTrackList,playList: statePlayList});\n }\n }", "function addToPlaying(){\n Chord.audio.playing.push(this);\n }", "function playFirstSong() {\n setTrack(tempPlaylist[0], tempPlaylist, true);\n}", "function changeTrack(url) {\r\n\t// Remove any existing instances of the Stratus player\r\n\t$('#stratus').remove();\r\n\r\n\t// Create a new Stratus player using the clicked song's permalink URL\r\n\t$.stratus({\r\n key: \"b3179c0738764e846066975c2571aebb\",\r\n auto_play: true,\r\n align: \"bottom\",\r\n links: search[url].permalink_url\r\n });\r\n}", "function playTrack(track) {\n\t// Get the file extention and set the current media\n\tvar trInfo = track.split(\".\");\n\tvar ext = trInfo[(trInfo.length - 1)];\n\tif(track.indexOf(\"file:\") === -1) {\n\t\tif(ext == \"mp3\")\n\t\t\t$(\"#jPlayer_instance\").jPlayer( \"setMedia\", {mp3: backend_url+\"/\"+track} );\n\t\telse if(ext == \"m4a\")\n\t\t\t$(\"#jPlayer_instance\").jPlayer( \"setMedia\", {m4a: backend_url+\"/\"+track} );\n\t}\n\telse {\n\t\twindow.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {\n\t\t\tconsole.log('playTrack() successfully accessed filesystem: ' + fs.name);\n\t\t\ttrackFile = track.replace(\"file:///persistent/\", \"\");\n\t\t\tfs.root.getFile(trackFile, { create: false, exclusive: false }, function (fileEntry) {\n\t\t\t\tif(ext == \"mp3\")\n\t\t\t\t\t$(\"#jPlayer_instance\").jPlayer( \"setMedia\", {mp3: fileEntry.fullPath} );\n\t\t\t\telse if(ext == \"m4a\")\n\t\t\t\t\t$(\"#jPlayer_instance\").jPlayer( \"setMedia\", {m4a: fileEntry.fullPath} );\n\t\t\t},\n\t\t\tfunction(createFileError) {\n\t\t\t\tconsole.log(createFileError);\n\t\t\t});\n\t\t},\n\t\tfunction(fileSystemError) {\n\t\t\tconsole.log(fileSystemError);\n\t\t});\n\t}\n\t\n\t// Remove old play indicator from the main page playlist (if it exists)\n\t$(\"#songPlaylistPlaying\").remove();\n\t// Add the play indicator to the currect main page playlist row\n\tvar newHtml = '<div id=\"songPlaylistPlaying\"></div>'+$(\"#playlistSongsRow\"+currentSong).html();\t\n\t$(\"#playlistSongsRow\"+currentSong).html(newHtml);\n\t// If the user hasnt paused playing, play the track\n\tif(player_playing || !controlsVisible) {\n\t\t$(\"#jPlayer_instance\").jPlayer( \"play\" );\n\t\tplayer_playing = true;\n\t}\n}", "async function addSong(type, id, title, artist, album, duration, data = null) {\n const song = {\n type,\n id,\n title,\n artist,\n album,\n duration,\n dateAdded: Date.now(),\n data\n };\n\n let songs = await getSongs();\n songs.push(song);\n await set('pwamp-songs', songs);\n}", "function addPlaylist(playlist_name){\n console.log('creating playlist',playlist_name);\n\n var data = {\n playlist_name: playlist_name\n };\n\n requests.createPlaylist(data, (x) => {\n if (x['status'] === 200){\n console.log('-- DONE: createPlaylist');\n\n // remove <html> for playlists and refetch playlists.\n $('#playlists > ul').empty();\n showMyPlaylists();\n }\n else {\n alert('Error while creating playlist');\n }\n });\n}", "async savePlaylist(bot, message, settings, msg) {\n\t\t// Get songs to add to playlist\n\t\tlet res;\n\t\ttry {\n\t\t\tres = await bot.manager.search(message.args[1], message.author);\n\t\t} catch (err) {\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/ERROR', err.message);\n\t\t}\n\n\t\t// Workout what to do with the results\n\t\tif (res.loadType == 'NO_MATCHES') {\n\t\t\t// An error occured or couldn't find the track\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/NO_SONG');\n\t\t} else if (res.loadType == 'PLAYLIST_LOADED' || res.loadType == 'TRACK_LOADED') {\n\t\t\t// Save playlist to database\n\t\t\tconst newPlaylist = new PlaylistSchema({\n\t\t\t\tname: message.args[0],\n\t\t\t\tsongs: res.tracks.slice(0, message.author.premium ? 200 : 100),\n\t\t\t\ttimeCreated: Date.now(),\n\t\t\t\tthumbnail: res.playlist?.selectedTrack.thumbnail ?? res.tracks[0].thumbnail,\n\t\t\t\tcreator: message.author.id,\n\t\t\t\tduration: res.playlist?.duration ?? res.tracks[0].duration,\n\t\t\t});\n\t\t\tnewPlaylist.save().catch(err => bot.logger.error(err.message));\n\n\t\t\t// Show that playlist has been saved\n\t\t\tconst embed = new MessageEmbed()\n\t\t\t\t.setAuthor(newPlaylist.name, message.author.displayAvatarURL())\n\t\t\t\t.setDescription([\t`Created a playlist with name: **${message.args[0]}**.`,\n\t\t\t\t\t`Playlist duration: ${bot.timeFormatter.getReadableTime(parseInt(newPlaylist.duration))}.`,\n\t\t\t\t\t`Added **${(res.loadType == 'PLAYLIST_LOADED') ? res.playlist.name : res.tracks[0].title}** (${res.tracks.length} tracks) to **${message.args[0]}**.`].join('\\n'))\n\t\t\t\t.setFooter(`ID: ${newPlaylist._id} • Songs: ${newPlaylist.songs.length}/${(message.author.premium) ? '200' : '100'}`)\n\t\t\t\t.setTimestamp();\n\t\t\tmsg.edit('', embed);\n\t\t} else {\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.send(`\\`${message.args[1]}\\` is not a playlist`);\n\t\t}\n\t}", "function switchTrack(){\n if(audio.paused){\n player.innerHTML = hdlPause;\n audio.currentTime = 0;\n }else if(index === (playList.length - 1)){\n index = 0\n }else {\n index++\n }\n\n box.innerHTML = `Track ${index + 1} - ${playList[index]}${ext}`;\n audio.src = dir + playList[index] + ext;\n audio.play()\n }", "function writePlayListToPanel(playListTracks){\n playListTracks.map(function(track) {\n var t = track.track;\n var list = \"<li id=\\\"\" + t.id + \"\\\" class='playlistItem'>\" + t.name + \"<br><span class=\\\"trackArtist\\\"> by \" + t.artists[0].name + \"</span></li>\"\n document.getElementById('trackList').innerHTML += list;\n });\n initTrackListener(playListTracks);\n console.log(playListTracks[0].track.name);\n}", "function changeTrack(url) {\r\n\t// Remove any existing instances of the Stratus player\r\n\t$('#stratus').remove();\r\n\r\n\t// Create a new Stratus player using the clicked song's permalink URL\r\n\t$.stratus({\r\n key: \"b3179c0738764e846066975c2571aebb\",\r\n auto_play: true,\r\n align: \"bottom\",\r\n links: url\r\n });\r\n}", "function changeTrack(url) {\r\n\t// Remove any existing instances of the Stratus player\r\n\t$('#stratus').remove();\r\n\r\n\t// Create a new Stratus player using the clicked song's permalink URL\r\n\t$.stratus({\r\n key: \"b3179c0738764e846066975c2571aebb\",\r\n auto_play: true,\r\n align: \"bottom\",\r\n links: url\r\n });\r\n}", "function addSong(){\r\n var song = {};\r\n \r\n // prompt user for data\r\n song.title = prompt(\"please enter the title of the song\");\r\n song.artist = prompt(\"please enter the name of the artist of the song\");\r\n song.videoId = prompt(\"please enter the video id\");\r\n data.songs.push(song);\r\n\r\n // if the current playist isnt also the all songs playlist\r\n if(current_playlist.songs != data.songs){\r\n // add song to data\r\n var songCopy = {};\r\n songCopy.title = song.title;\r\n songCopy.artist = song.artist;\r\n songCopy.videoId = song.videoId;\r\n current_playlist.songs.push(songCopy);\r\n }\r\n updateSongPane();\r\n}", "function play_track_from_playlist()\n{\n\tvar selected_track_index = $('#radio_song_list').attr(\"selectedIndex\");\n\t\n\t// play the selected track from playlist...\n\tradio_playlist.play(selected_track_index);\n}", "addSelectedTrack(track) {\n let tracks = this.state.searchResults;\n if (tracks.find((currentTrack) => currentTrack.id === track.id)) {\n return;\n }\n tracks.unshift(track);\n this.setState({ searchResults: tracks });\n }", "function gLyphsAddCustomTrack(glyphsGB) {\n //the purpose of this method is to convert the \"add track\" div\n //into a new glyphTrack, create the glyphTrack object\n //and setup the track for configuration\n\n console.log(\"gLyphsAddCustomTrack\");\n //var trackDiv = document.getElementById(trackID);\n //if(!trackDiv) { return; }\n //trackDiv.setAttribute(\"class\", \"gLyphTrack\");\n\n var glyphTrack = new ZenbuGlyphsTrack(glyphsGB);\n glyphsGB.tracks_hash[glyphTrack.trackID] = glyphTrack;\n //glyphTrack.title = \"new track \"+glyphTrack.trackID;\n\n //glyphTrack.trackDiv.innerHTML = \"<h3>this is a new track, is it working?</h3>\";\n \n //configureNewTrack(glyphTrack);\n\n glyphsGB.gLyphTrackSet.appendChild(glyphTrack.trackDiv);\n createAddTrackTool(glyphsGB); //so it moves to end\n \n gLyphsRenderTrack(glyphTrack);\n gLyphsDrawTrack(glyphTrack.trackID);\n gLyphsTrackToggleSubpanel(glyphTrack.trackID, 'reconfig');\n gLyphsChangeActiveTrack(glyphTrack);\n}", "function utilsCreateTrack(track) {\n\t\tvar track = utilsSanitizeObj(track);\n\t\treturn `<li ${ (track.id && track.id.innerHTML !== '') ? `id='${track.id.innerHTML}'` : \"\"} data-track-url=\"${track.url.innerHTML}\" ${ (track.album && track.album.innerHTML !== '') ? `data-album='${track.album.innerHTML}'` : \"\"} onclick=\"Apls.play(this)\">\n\t\t ${ (track.artist && track.artist.innerHTML !== '') ? `<span class=\"artist\">${track.artist.innerHTML}</span>` : \"\"} ${ (track.song && track.song.innerHTML !== '') ? ` | <span class=\"song\">${track.song.innerHTML}</span>` : \"\"}\n\t\t\t\t </li>`\n\t}", "async function syncPlaylist (playlist, tracks) {\n try {\n const results = { added: 0, removed: 0 }\n // Exit early on empty tracks.\n if (!tracks.length) return results\n const spotify = createSpotify()\n const uid = playlist.user\n const name = playlist.name\n\n // Search for user playlist.\n const result = await searchUserPlaylists(uid, name)\n\n // Store playlist ID if available.\n let pid = result[0] ? result[0].id : null\n\n if (!pid) {\n // Create user playlist if it doesn't exist.\n pid = await spotify.createPlaylist(uid, name)\n .then(response => response.body.id)\n .catch(e => console.log(e))\n }\n\n // Exit early if playlist couldn't be created.\n if (!pid) return\n\n // Get all track IDs from user playlist.\n const playlistTracks = await getAllUserPlaylistTracks(uid, pid)\n .then(response => response.map(item => item.track.id))\n .catch(e => console.log(e))\n\n if (playlistTracks) {\n // Build remove array to store tracks in playlist that are not included\n // within tracks argument.\n const remove = playlistTracks.reduce((items, item) => {\n const index = tracks.indexOf(item)\n if (index < 0) {\n results.removed = results.removed + 1\n tracks.splice(index, 1)\n items.push({ uri: `spotify:track:${item}` })\n }\n return items\n }, [])\n\n if (remove) {\n // Remove tracks from playlist.\n await removeAllTracksFromPlaylist(uid, pid, remove)\n .catch(e => console.log(e))\n }\n }\n\n if (tracks.length) {\n // Build tracks to add that are not present in playlist, so duplicated\n // tracks aren't added.\n const add = tracks.reduce((items, item) => {\n const index = playlistTracks.indexOf(item)\n if (index < 0) {\n results.added = results.added + 1\n items.push(`spotify:track:${item}`)\n }\n return items\n }, [])\n\n if (add.length) {\n // Add tracks to playlist.\n await addAllTracksToPlaylist(uid, pid, add)\n .catch(e => console.log(e))\n }\n }\n\n return results\n } catch (e) {\n throw e\n }\n}", "addTrack(albumId, trackData) {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n const album = this.getAlbumById(albumId);\n const newTrack = new Track(this.idGenerator.generateId(), trackData.name, trackData.duration, trackData.genres);\n album.addTrack(newTrack);\n return newTrack;\n }", "function changeTrack(url) {\n\t// Remove any existing instances of the Stratus player\n\t$('#stratus').remove();\n\n\t// Create a new Stratus player using the clicked song's permalink URL\n\t$.stratus({\n key: \"b3179c0738764e846066975c2571aebb\",\n auto_play: true,\n align: \"bottom\",\n links: url\n });\n}", "async function addSong(song){\n \n}", "function addTrack(id) {\n State.Adding.Set(true);\n document.getElementById('edit_input').value = \"\";\n if (id == 'new') {\n State.Editing.Set(Data.Tracks.length+1);\n }\n else {\n State.Editing.Set(id);\n }\n DOM.Modal.Open('edit_modal');\n document.getElementById('edit_input').focus();\n}", "addTrack(albumId, trackData) \n {\n /* Crea un track y lo agrega al album con id albumId.\n El objeto track creado debe tener (al menos):\n - una propiedad name (string),\n - una propiedad duration (number),\n - una propiedad genres (lista de strings)\n */\n const album = this.getAlbumById(albumId);\n if (album!= undefined && !(this.trackExists(trackData.name)) )\n {\n const track = new Track(trackData);\n track.id = this.idManager.getIdCancion();\n album.addTrack(track);\n this.tracks.push(track);\n console.log('Se agregó el track ', track.name);\n this.save('data.json')\n notificador.notificarElementoAgregado(track);\n return track\n }\n else\n {\n notificador.notificarError(ElementAlreadyExistsError)\n console.log(\"No se completó la operación, controle que la canción no haya sido ingresada anteriormente\");\n throw(ElementAlreadyExistsError) \n \n }\n \n }", "function add_to_playlist(genre, link) {\n\tif (genre.length > 0 && link.length > 0) {\n\t\tif (link.startsWith('https://www.youtube.com')) {\n\t\t\tplaylist_dict[genre] = link;\n\t\t\t// Update text file to reflect addition\n\t\t\tvar fs = require(\"fs\");\n\t\t\tfs.appendFile(\"./playlist.txt\", genre + \";\" + link + \";\\r\\n\", function (err) {\n\t\t\tif (err) throw err;\n\t\t\t});\n\t\t\treturn true;\n\t\t}\n\t} \n return false;\n}", "function emitPlaylist(event){ if (event.which == 13) {addPlaylist();}}", "function changeTrack(url) {\r\n\t// Remove any existing instances of the Stratus player\r\n\t$('#stratus').remove();\r\n\r\n\t// Create a new Stratus player using the clicked song's permalink URL\r\n\t$.stratus({\r\n\t\tkey: \"b3179c0738764e846066975c2571aebb\",\r\n\t\tauto_play: true,\r\n\t\talign: \"bottom\",\r\n\t\tlinks: url\r\n\t});\r\n}", "handleNewSong(event) {\n console.log('New song: ');\n console.log(event)\n\n const added = this.state.playlist.slice();\n added.push(event);\n\n this.setState({ playlist: added });\n }", "function changeTrack(url) {\n\t// Remove any existing instances of the Stratus player\n $('#stratus').remove();\n\n\t// Create a new Stratus player using the clicked song's permalink URL\n\t$.stratus({\n key: \"b3179c0738764e846066975c2571aebb\",\n auto_play: true,\n align: \"bottom\",\n links: url\n });\n}", "function addNewArtist() {\n var $artist = $(\"#newArtist\");\n var $song = $(\"#newSong\");\n var $album = $(\"#newAlbum\");\n var newObj = { \"Song\": $song.val(), \"Artist\": $artist.val(), \"Album\": $album.val()};\n\n musicProgram.songData.unshift(newObj);\n musicProgram.songPrint(musicProgram.songData);\n addDeleteButtons();\n}", "function addTracks(urls) {\n tdInstance.addTracks(urls);\n playerParameters.urls = tdInstance.playlist();\n\n return playerParameters.urls;\n }", "_autoplayAddTitle() {\n\t\tif (this._sCurrentTitleUrl) {\n\t\t\tytDownload.getBasicInfo(this._sCurrentTitleUrl).then(oInfo => {\n\t\t\t\tlet iRandomRelatedVideo = Math.floor(Math.random() * oInfo.related_videos.length);\n\t\t\t\tlet oSuggestion = oInfo.related_videos[iRandomRelatedVideo];\n\n\t\t\t\tthis._aPlaylist.push({\n\t\t\t\t\tname: oSuggestion.title ? oSuggestion.title : \"track\",\n\t\t\t\t\turl: \"https://www.youtube.com/watch?v=\" + oSuggestion.id\n\t\t\t\t});\n\t\t\t}).catch(err => {\n\t\t\t\tlogger.warn(\"Could not add suggested title: \", err);\n\t\t\t});\n\t\t} else {\n\t\t\tlogger.warn(\"Could not add suggested title, due to missing current title.\");\n\t\t}\n\t}", "function populatePlaylist() {\n\n for (i in playlist) {\n // Display the search results and an add button to vote section\n var playlistContainer = document.createElement('div');\n playlistContainer.className = \"current\";\n\n var playlistTitle = document.createElement('h4');\n playlistTitle.innerHTML = playlist[i].title;\n\n var playlistThumbnail = document.createElement('img');\n playlistThumbnail.src = playlist[i].imgSrc;\n\n $('#playback-bar').append(playlistContainer);\n playlistContainer.append(playlistThumbnail);\n playlistContainer.append(playlistTitle);\n\n playlistContainer.id = playlist[i].songId;\n\n // console.log(playlistContainer.id);\n }\n }", "function Playlist(name) {\n this.name = name;\n this.tracks = [];\n}", "function playTracks(url) {\n\tif (!document.getElementById('frame-songs')) {\n\t\tvar songDiv = document.createElement('div')\n\t\tvar songFrame = document.createElement('IFRAME')\n\t\tsongDiv.id = 'frame-songs'\n\t\tsongFrame.src = url\n\t\tsongDiv.appendChild(songFrame)\n\t\tcontainer.appendChild(songDiv)\n\t}\n\n\telse {\n\t\tvar songDiv = document.getElementById('frame-songs')\n\t\tsongDiv.innerHTML = ''\n\t\tvar songFrame = document.createElement('IFRAME')\n\t\tsongFrame.src = url\n\t\tsongDiv.appendChild(songFrame)\n\n\t}\n}", "async setNewTrackList(playlistID) {\n const playlist = await this.getPlaylistWithTracks(playlistID);\n console.log(\"----\", playlist.tracks.items);\n //Setting the tracks taken from the playlist to the \n //variable in the state newTrackList\n this.setState({\n newTrackList: playlist.tracks.items\n })\n }", "function addToPlaylist(userId, playlistId, uris) {\n return axios({\n method: \"post\",\n url: `https://api.spotify.com/v1/users/${userId}/playlists/${playlistId}/tracks`,\n data: { uris }\n });\n}", "function addTrackPlaylist(_this,objectId){\r\n\t//chiama il controller per aggiungere la song alla playlist\r\n\tvar json_playlist = {};\r\n\t\r\n\ttypeOpt = $(_this).text();\r\n\tswitch(typeOpt){\r\n\t\tcase ' add to playlist':\r\n\t\t\tjson_playlist.request = \"addSong\";\r\n\t\t\tbreak;\r\n\t\tcase ' remove':\r\n\t\t\tjson_playlist.request = \"removeSong\";\r\n\t\t\tbreak;\r\n\t}\r\n\tjson_playlist.songId = objectId;\r\n\t$.ajax({\r\n data: json_playlist,\r\n type: \"POST\",\r\n url: \"../controllers/request/playlistRequest.php\"\r\n })\r\n .done(function(response, status, xhr) {\r\n if (typeOpt === ' add to playlist') {\r\n\t\t\tloadBoxPlayList();\r\n\t\t\t$(_this).text(' remove');\r\n } else {\r\n\t\t\tplaylist = myPlaylist.playlist;\r\n\t\t\tjQuery.each(playlist, function (index, obj){\r\n\t if (obj.objectId == objectId){\r\n\t myPlaylist.remove(index);\r\n\t\r\n\t } // if condition end\r\n\t $(_this).text(' add to playlist');\r\n\t });\r\n\t\t\t\r\n\t\t\t\r\n }\r\n code = xhr.status;\r\n message = $.parseJSON(xhr.responseText).status;\r\n console.log(\"Code: \" + code + \" | Message: \" + message);\r\n })\r\n .fail(function(xhr) {\r\n message = $.parseJSON(xhr.responseText).status;\r\n code = xhr.status;\r\n console.log(\"Code: \" + code + \" | Message: \" + message);\r\n });\r\n\t\r\n\t\r\n\t//controllare il risultato dal controller\r\n\t\r\n\t//aggiungere alla playlist\r\n\t\r\n}", "function nextTrack(){\n\t\t$scope.currentTrack = $scope.tracks[$scope.currentTrackIndex + 1]\n\t\tvar trackUri = $scope.tracks[$scope.currentTrackIndex + 1].uri;\n\t\twidget.load(trackUri, { auto_play: true });\n\t\t$scope.currentTrackIndex = $scope.currentTrackIndex + 1;\n\t\t$scope.artworkUrl = $scope.currentTrack.artwork_url\n\t\t// .replace(\"large\", \"t300x300\");\n\t}", "function addSongToDatabase(song) {\nsongDatabase.push(song);\n}", "function addSong(song) {\n if (!store.getItem('songs')) createStore()\n var songArray = JSON.parse(store.getItem('songs'))\n songArray.push(song)\n store.setItem('songs', JSON.stringify(songArray))\n}", "function PlaylistTrack(data, client) {\n return {\n addedAt: data.added_at,\n local: data.is_local,\n get addedBy() {\n return data.added_by ? new User_1.default(data.added_by, client) : null;\n },\n get track() {\n if(data.track){\n return data.track.type == 'track' ? new Track_1.default(data.track, client) : new Episode_1.default(data.track, client);\n }\n return null\n }\n };\n}" ]
[ "0.74449885", "0.72289485", "0.7224767", "0.7193722", "0.71851355", "0.7162063", "0.71615535", "0.7152372", "0.7052449", "0.7032878", "0.7029627", "0.69909394", "0.69847685", "0.69845486", "0.6900456", "0.6865774", "0.68341404", "0.68079543", "0.67920667", "0.67663676", "0.6755439", "0.6715325", "0.67098844", "0.66939414", "0.66672665", "0.66304755", "0.6627408", "0.6619691", "0.6602917", "0.65986145", "0.65851396", "0.6563941", "0.65372574", "0.65323657", "0.6504363", "0.649348", "0.64556324", "0.64545316", "0.6436717", "0.6423162", "0.64185476", "0.64057815", "0.63824826", "0.63775134", "0.63738185", "0.6364306", "0.6288845", "0.62831306", "0.62709737", "0.6235402", "0.6234943", "0.62339056", "0.6222262", "0.6210895", "0.61978215", "0.6193991", "0.6183036", "0.61827344", "0.61827344", "0.61607265", "0.6157061", "0.61349607", "0.61273026", "0.61264455", "0.61245704", "0.6123509", "0.61224526", "0.6122188", "0.6121816", "0.611266", "0.611266", "0.6112497", "0.61051416", "0.61040914", "0.6093373", "0.60925955", "0.60910136", "0.6087991", "0.6085936", "0.6079154", "0.6078887", "0.60752136", "0.6074679", "0.6070771", "0.60696024", "0.605265", "0.60522676", "0.6051299", "0.6036194", "0.603559", "0.60347104", "0.60221773", "0.60214996", "0.6015018", "0.60137147", "0.6006787", "0.6003335", "0.5988187", "0.5971905", "0.5970724" ]
0.63476396
46
Method for removing a track.
removeTrack(track) { // Remove the track instance from the playlistTracks array by filtering the ID. let trackList = this.state.playlistTracks.filter(playlistTrack => { return playlistTrack.id !== track.id; }) this.setState({playlistTracks: trackList}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeTrack() {\n\t\tthis.props.onRemove(this.props.track, true);\n\t}", "removeTrack() {\n this.props.onRemove(this.props.track);\n }", "removeTrack() {\n this.props.onRemove(this.props.track);\n }", "removeTrackId(id){\r\n const index = this.getTracks().findIndex((track) => track.id === id);\r\n if(index > -1){\r\n this.getTracks().splice(index, 1);\r\n }\r\n }", "deleteTrack(artistName, albumName, trackName){\n let artistFromTheTrack = this.getArtistByName(artistName);\n let albumFromTheArtist = this.getAlbumInArtist(artistFromTheTrack, albumName);\n let trackToDelete = this.deleteTrackFromAlbum(albumFromTheArtist, trackName);\n this.deleteTrackFromPlaylists(trackToDelete);\n this.notificationObserver.update(this);\n trackToDelete = null;\n }", "async remove(\n id,\n trackId\n ) {\n await this.removeHandler.remove(\n id,\n trackId\n );\n }", "function handleRemoveTrack() {\n\t\t\tmap.clearMarkers(map.TRACK);\n\t\t}", "removeTrack(track, removePlaylist) {\n\t\tif(removePlaylist) {\n\t\t\tconst ids = this.collectIds(true);\n\t\t\tlet trackIndex = -1;\n\t\t\tfor(let i = 0; i < ids.length; i++) {\n\t\t\t\tif (ids[i] === track.id) {\n\t\t\t\t\ttrackIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (trackIndex !== -1) {\n\t\t\t\tconst newPlaylist = this.state.playlistTracks;\n\t\t\t\tnewPlaylist.splice(trackIndex, 1);\n\t\t\t\tthis.setState({playlistTracks: newPlaylist});\n\t\t\t\tthis.search(this.state.term);\n\t\t\t}\n\t\t} else {\n\t\t\tconst ids = this.collectIds(false);\n\t\t\tlet trackIndex = -1;\n\t\t\tfor(let i = 0; i < ids.length; i++) {\n\t\t\t\tif (ids[i] === track.id) {\n\t\t\t\t\ttrackIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (trackIndex !== -1) {\n\t\t\t\tconst newResults = this.state.searchResults;\n\t\t\t\tnewResults.splice(trackIndex, 1);\n\t\t\t\tthis.setState({searchResults: newResults});\n\t\t\t}\n\t\t}\n\t\t\n\t}", "removeTrack(){\n this.props.onRemove(this.props.track);\n }", "function removeTrack(trackID) {\n var glyphTrack = gLyphTrack_array[trackID];\n if(glyphTrack == null) { return; }\n\n var trackDiv = glyphTrack.trackDiv;\n if(!trackDiv) return;\n\n var glyphset = document.getElementById(\"gLyphTrackSet\");\n if(glyphset) { glyphset.removeChild(trackDiv); }\n\n if(glyphTrack.trackID == current_region.active_trackID) {\n current_region.active_trackID = undefined;\n }\n\n gLyphTrack_array[trackID] = null;\n active_track_XHRs[trackID] = null;\n pending_track_XHRs[trackID] = null;\n delete gLyphTrack_array[trackID];\n delete active_track_XHRs[trackID];\n delete pending_track_XHRs[trackID];\n\n gLyphsDrawExpressionPanel();\n //displayProbeInfo(); //old system not used anymore\n gLyphsAutosaveConfig();\n}", "function onRemoteTrackRemove(track) {\n console.log(`INFO: Track removed!${track}`);\n const participant = track.getParticipantId();\n if (participant in changeList) {\n var remoteVideo = \"#remoteVideo\" +changeList[participant];\n var remoteAudio = \"#remoteAudio\" +changeList[participant];\n switch (changeList[participant]) {\n\tcase 1:\n\t $(remoteVideo).replaceWith(\n\t\t`<div id='remoteVideo${changeList[participant]}'><img src=\"resources/top-left.png\"/></div>`);\n\t break;\n\tcase 2:\n\t $(remoteVideo).replaceWith(\n\t\t`<div id='remoteVideo${changeList[participant]}'><img src=\"resources/top-right.png\"/></div>`);\n\t break;\n\tcase 3:\n\t $(remoteVideo).replaceWith(\n\t `<div id='remoteVideo${changeList[participant]}'><img src=\"resources/bottom-left.png\"/></div>`);\n\t break;\n\tcase 4:\n\t $(remoteVideo).replaceWith(\n\t `<div id='remoteVideo${changeList[participant]}'><img src=\"resources/bottom-right.png\"/></div>`);\n\t break;\n\t}\n /*\n $(remoteVideo).replaceWith(\n `<div id='remoteVideo${changeList[participant]}'><img src=\"resources/conference-chair.png\"/></div>`);\n */\n $(remoteAudio).replaceWith(\n `<div id='remoteAudio${changeList[participant]}'></div>`);\n frameArray.push(changeList[participant]);\n delete changeList[participant];\n }\n}", "removeTrack(track){\nlet playlistTracks = this.state.playlistTracks;\nlet index = playlistTracks.findIndex(track => track.id = playlistTracks.id);\nplaylistTracks.splice(index,1);\nthis.setState({playlistTracks:playlistTracks});\n}", "function detachTrack(track) {\n track.detach().forEach(function(element) {\n element.remove();\n });\n}", "async remove(\n id,\n trackId\n ) {\n // Local variables\n let result,\n logger = Logger.create(\"remove\", trackId);\n\n logger.info(\"enter\", {id: id});\n\n // Try to remove the room\n try {\n result = await this.collection.findOneAndUpdate({\n _id: Mongo.toObjectID(id),\n deletedAt: {$type: \"null\"}\n }, {$set: {deletedAt: moment().toISOString()}}, {returnOriginal: false});\n\n logger.info(\"collection findOneAndUpdate success\", result);\n }\n catch(error) {\n logger.error(\"collection findOneAndUpdate error\", error);\n\n throw new Types.TagError({\n code: Types.ErrorCode.DB_ERROR,\n message: error.message\n });\n }\n }", "function detachTrack(track) {\n\ttrack.detach().forEach(function (element) {\n\t\telement.remove();\n\t});\n}", "removeTrack(track) {\n let tracks = this.state.playlistTracks;\n tracks.splice(tracks.indexOf(track), 1);\n //tracks = tracks.filter(currentTrack => currentTrack.id !== track.id);\n this.setState({ playlistTracks: tracks });\n }", "removeTrack(track) {\n let tracks = this.state.playlistTracks;\n tracks = tracks.filter(currentTrack => currentTrack.id !== track.id);\n\n this.setState({ playlistTracks: tracks });\n }", "removeTrack(track) {\n let tracks = this.state.playlistTracks;\n tracks = tracks.filter((currentTrack) => currentTrack.id !== track.id);\n this.setState({ playlistTracks: tracks });\n }", "removeTrack(track) {\n this.setState({\n playlistTracks: this.state.playlistTracks.filter(\n playlistTrack => playlistTrack.id !== track.id)\n });\n }", "function deleteTrack(trackID, playlistID) {\n var track = $(this).parent();\n var playlist = $('[data-playlistid=\"'+playlistID+'\"]');\n var currentCount = parseInt(playlist.find('.trackCount').text());\n\n $.post(domain+'includes/ajax/handleTrack.php', \n { \n trackID: trackID,\n playlistID: playlistID,\n task:'delete'\n }, \n function(response) {\n\n if(response == 1) {\n playlist.find('.trackCount').text(currentCount-1);\n triggerNotification(\"Track removed.\");\n track.slideUp(250).delay(250).remove();\n }\n else\n triggerNotification(\"Track wasn't removed.\");\n\n });\n}", "function removeInstrumentTrack(evt) {\n const parent = evt.srcElement.parentElement.parentElement;\n parent.remove();\n if (CORMonitorApp.SavedInstruments[parent.id]) {\n delete CORMonitorApp.SavedInstruments[parent.id];\n saveInstrumentList(CORMonitorApp.SavedInstruments);\n }\n}", "remove(id) {\n var index;\n index = this.trackInfo.map(function(info) {\n return info.id;\n }).indexOf(parseInt(id, 10));\n this.trackInfo.splice(index, 1);\n return this.queue.splice(index, 1);\n }", "removeTrack(track) {\n if (this.state.playlistTracks.indexOf(track) > -1) { //step 49\n const newPlayList = this.state.playListTracks;\n newPlayList.splice(newPlayList.indexOf(track),1);\n// newPlayList.filter(this.playlistTracks.indexOf(track));\n// this.setState({playListTracks: his.playlistTracks.splice(this.playListTracks.indexOf(track),1)}) //remove the track from playlist at index of given track\n this.setState({playListTracks: newPlayList});\n }\n }", "deleteTrackFromAlbum(album, trackName){\n let track = this.returnIfExists(album.tracks.find((t)=>t.name===trackName), \"track \" + trackName);\n album.tracks.splice(album.tracks.indexOf(track), 1);\n return track;\n }", "function remove(q, cb) {\n mongodb.collections['track']\n .deleteOne(q)\n .then(cb, (error) => console.trace('track.remove() error:', error));\n}", "function handleImportTrackRemove() {\n\t\t\t//remove the track from the map\n\t\t\ttheInterface.emit('ui:removeTrack');\n\t\t}", "deleteTrackFromPlaylists(track){\n let playlistsWithTrack = this.playlists.filter((pl)=> pl.tracks.includes(track));\n playlistsWithTrack.forEach((pl)=>pl.tracks.splice(pl.tracks.indexOf(track), 1));\n }", "function unTrack(tag){\n \tif (tracking.tags[tag] == 1){\n \tdelete tracking.tags[tag];\n \tclient.untrack(tag);\n \t} else {\n \ttracking.tags[tag]--;\n \t}\n }", "deleteTrack(id) {\n /* Elimina de unqfy el track con el id indicado */\n const tracks = this.getAlbumById(id).deleteTrack(id);\n return tracks;\n }", "removeTrack(track){\n // set variables\n let tempPlaylist = this.state.playlistTracks;\n\n // loop through the PlayList until a match is found\n // for the track to be removed and remove it\n for(let i=0; i < tempPlaylist.length; i++){\n if(track.id === tempPlaylist[i].id){\n tempPlaylist.splice(i,1);\n }\n }\n // update the state with the tempPlaylist\n this.setState({ playlistTracks:tempPlaylist });\n }", "removeTrack(track) {\n const newPlaylist = this.state.playlistTracks.filter((el) => {\n return el.id !== track.id;\n })\n this.setState({ playlistTracks : newPlaylist });\n }", "function removeSong() {\n}", "function removeFromPlaylist(playlist, artistName){\n delete playlist[artistName];\n}", "removeSelectedTrack(track) {\n let tracks = this.state.searchResults;\n tracks = tracks.filter((currentTrack) => currentTrack.id !== track.id);\n this.setState({ searchResults: tracks });\n }", "function removeFromPlaylist(playlist, artistName)\n{\n delete playlist[artistName]\n}", "function removeFromPlaylist(playlist, artistName) {\n// delete playlist.artist;\n delete playlist[artistName];\n return\n}", "async function removeAllTracksFromPlaylist (uid, pid, tracks) {\n try {\n const spotify = createSpotify()\n // Batch size.\n const limit = 100\n while (tracks.length) {\n const batch = tracks.splice(0, limit)\n // Remove tracks.\n await spotify.removeTracksFromPlaylist(uid, pid, batch)\n .catch(e => console.log(e))\n }\n } catch (e) {\n throw e\n }\n}", "function removeFromTrack(name) {\n var cookies = document.cookie.split(\";\");\n for (i of cookies) {\n if (i.indexOf(name) != -1) {\n var match = i.replace(\" \", \"\");\n var tName = match.substr(0, match.indexOf(\"=\"));\n setCookie(tName, \"\", -1);\n }\n }\n\n var Track = document.getElementById(\"fullTrack\");\n while (Track.firstChild) {\n Track.removeChild(Track.firstChild);\n }\n\n var TrackRow = document.createElement('div');\n TrackRow.classList.add('fullTrackrow');\n var Track = document.getElementById('fullTrack');\n var TrackContent = '<h2>Item</h2>\\\n <h2> Time </h2>\\\n <h2>Name</h2>\\\n <h2>Quantity</h2>\\\n <h2>Price</h2>';\n\n TrackRow.innerHTML = TrackContent;\n Track.append(TrackRow);\n\n putItemsToTrack();\n}", "removeSong(selectedSong){\r\n this.userSetlist.pop(selectedSong);\r\n }", "function deletetracker(name) {\n\tdelete trackers[name];\n\tremoveFromList(name);\n\tsaveToStorage()\n}", "remove() {\n player.dispose();\n }", "function removeTracks(index, howMany) {\n if(typeof index !== 'number') {\n log('Index argument is not a number.', 'error');\n return [];\n }\n\n playerParameters.urls.splice(index, howMany);\n var tracksRemoved = tdInstance.removeTracks(index, howMany);\n\n tdInstance.tracks(function(tracks) {\n rerender({\n feed: playerParameters.feed,\n loading: false,\n mini: playerParameters.mini,\n nowPlaying: tdInstance.track(),\n shrink: playerParameters.shrink,\n single: playerParameters.single,\n skin: playerParameters.skin,\n tracks: tracks,\n tracksPerArtist: playerParameters.tracksPerArtist,\n visualizerType: playerParameters.visualizerType\n });\n\n tdInstance.pause(true);\n });\n\n return tracksRemoved;\n }", "function removeFromPlaylist(playlist, artistName) {\n delete playlist[artistName];\n return playlist\n}", "handleRemove(key,link){\n // Removing the item from songs object so it can render the correct tracks\n let songObj = {}\n let songsItems = [];\n for(let i=0;i!==songs.items.length;i++){\n if(key!==i){\n let obj = {};\n obj = Object.assign({},obj,{\n image:songs.items[i].image,\n name:songs.items[i].name,\n title:songs.items[i].title,\n uri:songs.items[i].uri\n })\n songsItems.push(obj);\n }\n }\n newItems.splice(key,1);\n songObj=Object.assign({},songObj,{\n items:songsItems\n })\n songs = songObj;\n // For making the remove\n let items = []\n let tracks = {};\n let obj = {};\n obj = Object.assign({},obj,{\n uri:link,\n positions:[key]\n })\n items.push(obj)\n tracks = Object.assign({},tracks,{\n tracks:items\n })\n // Calling remove\n this.props.removeTrackFromPlaylist(spotifyApi,this.props.playlist.id,tracks.tracks);\n }", "function remove(speaker) {\n return $http.delete('/api/speakers/' + speaker.id);\n }", "remove(video) {\n\t\tthis.videos = this.videos.filter(v => v !== video);\n\t\tthis.emit('change');\n\t}", "function remove_from_playlist(genre) {\n playlist_dict.delete(genre);\n}", "function detachTrack(track, participant) {\n // Detach the Participant's Track from the thumbnail.\n const $media = $(`div#${participant.sid} > ${track.kind}`, $participants);\n const mediaEl = $media.get(0);\n $media.css('opacity', '0');\n track.detach(mediaEl);\n mediaEl.srcObject = null;\n\n // If the detached Track is a VideoTrack that is published by the active\n // Participant, then detach it from the main video as well.\n if (track.kind === 'video' && participant === activeParticipant) {\n const activeVideoEl = $activeVideo.get(0);\n track.detach(activeVideoEl);\n activeVideoEl.srcObject = null;\n $activeVideo.css('opacity', '0');\n }\n}", "function removeSong(song) {\n if (!store.getItem('songs')) createStore()\n var songArray = JSON.parse(store.getItem('songs'))\n var index = songArray.indexOf(song)\n songArray.splice(index, 1)\n store.setItem('songs', JSON.stringify(songArray))\n}", "removeSpeech() {\n delete this._response.speech;\n }", "function onRemove(event) {\n\t\tvar self = getSelf($(this));\n\n\t\tonButton.call(this, event, services.tag.del, {\n\t\t\tsel: \"Delete this tag from SELECTED videos?\",\n\t\t\tall: \"Delete ALL tags of this kind?\",\n\t\t\thits: \"Delete this tag from SEARCH results?\"\n\t\t}, function (mediaids, tag) {\n\t\t\tdata.media.removeTag(mediaids, tag);\n\t\t\tif (mediaids.length > 1) {\n\t\t\t\tcontrols.media.refreshTags();\n\t\t\t} else {\n\t\t\t\tself.refresh();\n\t\t\t}\n\t\t});\n\t\treturn false;\n\t}", "deleteArtist(artistName){\n let artistToDelete = this.getArtistByName(artistName);\n let artistAlbums = artistToDelete.albums;\n let artistTracks = this.collecTracks(artistAlbums);\n artistTracks.forEach((t)=> this.deleteTrackFromPlaylists(t));\n artistAlbums.forEach((a)=> a.tracks.forEach((t)=> this.deleteTrackFromAlbum(a, t.name)));\n artistToDelete.albums.forEach((a)=> this.deleteAlbumFromArtist(artistToDelete, a.name));\n this.artists.splice(this.artists.indexOf(artistToDelete), 1);\n this.notificationObserver.update(this);\n artistToDelete = null;\n }", "function disLikeTrack(){\n\tvar removeLikexhrq = new XMLHttpRequest();\n\tvar songId = event.target.id.substring(16);\n\tconsole.log(songId);\n\tvar removeLikeURL = 'http://127.0.0.1:3000/removeLikeSong?songID=' + songId + '&userID=' + sessionStorage.getItem('user_id');\n\tremoveLikexhrq.open('get', removeLikeURL, true);\n\n\tremoveLikexhrq.onreadystatechange = function(){\n\t\tif(removeLikexhrq.readyState === XMLHttpRequest.DONE){\n\t\t\tvar responseStatus = JSON.parse(removeLikexhrq.responseText);\n\t\t\tif(responseStatus['message'] === 'bad'){\n\t\t\t\talert('update failed!');\n\t\t\t}else{\n\t\t\t\talert('remove the song from your favorite collection');\n\t\t\t\t// remove the DOM of current song\n\t\t\t\tvar removeLi = document.getElementById('ripple-music-like-li-' + songId);\n\t\t\t\tvar parentUl = document.getElementById('sub-content-content');\n\t\t\t\tparentUl.removeChild(removeLi);\n\t\t\t}\n\t\t}\n\t};\n\tremoveLikexhrq.send(null);\n}", "function detachParticipantTracks(participant) {\r\n var tracks = Array.from(participant.tracks.values());\r\n detachTracks(tracks);\r\n}", "remove() {\n if (this._removable) {\n this.removed.next(this.file);\n }\n }", "removeArtwork(artworkId, options) {\n if (options == null) { options = {}; }\n return this.defaultArtworkCollection().unsaveArtwork(artworkId, options);\n }", "remove(){\n //\n }", "Remove() {}", "onRemove(id) {\n const { removeVideo, removeClipFromPlaylist, playlist } = this.props;\n\n // find the index of the clip to remove by its ID\n const index = playlist.list.map(e => e.id).indexOf(id);\n\n // Check if the next clip in the list is playing\n if (playlist.now === index + 1) {\n removeVideo(id, true);\n } else {\n removeVideo(id, false);\n }\n // Set in the clip.list that the actual clip is not in the playlist\n removeClipFromPlaylist(id);\n }", "remove() {\n if (this.div) {\n this.div.parentNode.removeChild(this.div);\n this.div = null;\n }\n }", "unloadTrack () {\n if (this.howlHandler) {\n this.howlHandler.unload();\n }\n }", "function deleteRecording() {\n\tstrokeRecording = new Track(\"Recording\", []);\n\tresetTime();\n}", "function removeTorrent(req, res) {\n var hash = req.params.hash;\n rtorrentcontroller.removeTorrent(hash, function(status) {\n res.send(status);\n });\n}", "dispose() {\n this.trackView = undefined\n }", "function removeCurrentTrackClass(){\n $('.play_song').removeClass(current_playing_track_class);\n }", "async removeFavoriteStory(story){\n console.debug(\"removeFavoriteStory input\", story);\n //Find story in favoriteStory array and remove\n \n this.favorites = (this.favorites.filter(favoriteStory => { \n return favoriteStory.storyId !== story.storyId}));\n \n // Update un-favorite story in API\n await axios.delete(\n `${BASE_URL}/users/${this.username}/favorites/${story.storyId}`, \n {params: {token: this.loginToken}});\n \n }", "function detachParticipantTracks(participant) {\n var tracks = getTracks(participant);\n tracks.forEach(detachTrack);\n}", "function removeFromPlaylist(playlist, artistName){\n a = {playlist:artistName};\n delete a.playlist;\n return a;\n}", "function detachParticipantTracks(participant) {\n\tvar tracks = getTracks(participant);\n\ttracks.forEach(detachTrack);\n}", "removeOwnStory(story) {\n\n if (this.isOwnStory(story)) {\n this.ownStories.splice(this.indexOfOwnStory(story), 1)\n }\n \n }", "function detachTracks(tracks) {\r\n tracks.forEach(function(track) {\r\n track.detach().forEach(function(detachedElement) {\r\n $(detachedElement)\r\n .closest(\".trackTag\")\r\n .remove();\r\n detachedElement.remove();\r\n });\r\n });\r\n fixRemoteVideoWidth(window.room.participants.size);\r\n}", "untrack() {\n return Promise.map(arguments, jid => this.call('track', 'untrack', jid).thenReturn(jid));\n }", "remove() {\n this.target.removeEventListener(this.eventType, this.fn, false);\n }", "function deleteVideo(ctx) {\n /* Current window.timeline item */\n const targetNode = window.references[ctx.target.id]\n\n /* Linking the previous node */\n if (targetNode.prev) {\n targetNode.prev.next = targetNode.next\n }\n\n /* Linking the next node */\n if (targetNode.next) {\n targetNode.next.prev = targetNode.prev\n }\n\n /* Edge case when the deleted item is the head */\n if (window.timeline === targetNode) {\n window.timeline = targetNode.next\n }\n\n /* Updating the overall video duration */\n window.timelineDuration -= targetNode.data.metadata.duration\n \n /* Forcing the memory cleanup */\n delete targetNode\n \n /* UI removing animation */\n ctx.target.style.animation = 'disappear 0.5s'\n setTimeout(() => {\n $(ctx.target).remove()\n renderPreviousTimelineDimensions()\n }, 400)\n}", "removePlayer(player){\n this.roster.splice(roster.indexOf(player), roster.lastIndesOf(player));\n }", "removeTag(tag) {\r\n this.tags.splice(this.tags.indexOf(tag), 1);\r\n }", "remove() {\n\n }", "remove(){\n\n }", "stop(){\n this._tracks.forEach(track => {\n track.stop();\n });\n }", "deleteAlbum(artistName, albumName){\n let artistWithAlbum = this.getArtistByName(artistName);\n let albumToDelete = this.getAlbumInArtist(artistWithAlbum, albumName);\n let tracksFromAlbumToDelete = albumToDelete.tracks;\n tracksFromAlbumToDelete.forEach((t)=> this.deleteTrackFromPlaylists(t));\n albumToDelete.tracks.forEach((t)=> this.deleteTrackFromAlbum(albumToDelete, t.name));\n this.deleteAlbumFromArtist(artistWithAlbum, albumToDelete.name);\n this.notificationObserver.update(this);\n albumToDelete =null;\n }", "function remove_(self, a) {\n return self.remove(a);\n}", "remove() {\n stopSound(this.throwSound);\n this.isShot = false;\n this.player.hookNumber ++;\n this.size = this.player.totalHeight;\n }", "function stopTrack() {\n\treturn source.mediaElement.stop();\n}", "remove() {\n if (this.removable) {\n this.removed.emit({ chip: this });\n }\n }", "remove() {\n this.removeRecordFn(this)\n return Promise.resolve()\n }", "function rf(id) { tagger.remove(asInt(id)); }", "async deleteSoundtrack(ctx, soundtrack) {\n let list = [];\n let obj = [];\n let number = 0;\n await ctx.getters.getSoundtrackList.forEach(album => {\n if(album[1].soundtrackTitle == soundtrack.soundtrackTitle && \n album[1].soundtrackImg == soundtrack.soundtrackImg && \n album[1].soundtrackFormat == soundtrack.soundtrackFormat && number == 0) {\n number = 1;\n } else {\n list.push(album[1])\n }\n })\n obj = Object.assign({}, list, {'soundtracks': true});\n db.collection(auth.currentUser.uid).doc(ctx.getters.getSoundtracksId).set(obj);\n ctx.dispatch('fetchYourSoundtracks');\n }", "remove({\n records\n }) {\n if (me.usesSingleAssignment) {\n records.forEach(assignment => {\n var _me$getById;\n\n // With engine link to event is already broken when we get here, hence the lookup\n (_me$getById = me.getById(assignment.eventId)) === null || _me$getById === void 0 ? void 0 : _me$getById.set('resourceId', null);\n });\n }\n }", "function remove({uri, id}) {\n\turi = uri || arguments[0]\n\tid = id || arguments[1].id || arguments[1]\n\treturn postCount({uri, command:'remove', id})\n}", "remove () {\n }", "remove(player) {\n this.players = this.players.filter(p => p.id !== player.id);\n }", "handleSoundPlaying(that,instrument, note){\n var i = instrument.lastPlayedNotes.indexOf(note);\n instrument.lastPlayedNotes.splice(i,1);\n }", "remove() {\n this.project.removeAsset(this);\n }", "remove() {\n this.target.removeListener(this.event, this.callback, {\n context: this.context,\n remaining: this.remaining\n });\n }", "function removeCard(id){\n //console.log('handRef', handRef);\n\n // Remove visual element\n var elem = handRef[id];\n elem.remove();\n\n // Remove virtual data\n delete handRef[id];\n}", "async onPlayerRemoved(player) {}", "async removeFavoriteStory(storyId) {\n // this function should return the newly created story so it can be used in\n // the script.js file where it will be appended to the DOM\n // remove story from list\n\n try {\n const response = await axios.delete(\n `${BASE_URL}/users/${this.username}/favorites/${storyId}`,\n { data: {token: this.loginToken} }\n );\n this.favorites.splice(\n this.favorites.findIndex((item) => item.storyId == storyId), 1\n );\n } catch (error) {\n axiosErrorHandler(error);\n }\n }", "removeFigure(){\n\n this[figure] = null;\n }", "remove(id, params) {}", "cleanup() {\n const { stream } = this;\n stream.getTracks().forEach(track => {\n track.stop();\n stream.removeTrack(track);\n });\n }" ]
[ "0.78392756", "0.7643007", "0.74788874", "0.72723264", "0.7204533", "0.7147144", "0.70424175", "0.70037615", "0.6995839", "0.6778167", "0.6740914", "0.6702746", "0.66788083", "0.66759473", "0.66730416", "0.66646606", "0.66269594", "0.6589125", "0.65661496", "0.6537951", "0.6522996", "0.6521898", "0.6511566", "0.6497689", "0.6479856", "0.638677", "0.6362093", "0.63260263", "0.6321659", "0.6321574", "0.63054913", "0.6249949", "0.61213857", "0.6113938", "0.6113469", "0.601584", "0.59457046", "0.5911761", "0.589951", "0.5842688", "0.58417946", "0.5825263", "0.5796333", "0.57875174", "0.5762213", "0.5741231", "0.5735523", "0.5708791", "0.56455415", "0.5612628", "0.56026816", "0.55904794", "0.5586234", "0.5568726", "0.55680674", "0.5549988", "0.55136836", "0.5487446", "0.54780096", "0.5476951", "0.5466417", "0.5455542", "0.54550123", "0.54121405", "0.5412117", "0.5395671", "0.53952944", "0.5391692", "0.5381604", "0.53808784", "0.5375923", "0.5371337", "0.53638214", "0.536318", "0.53506947", "0.53482586", "0.5345673", "0.5339737", "0.5333101", "0.53322566", "0.5329371", "0.5312165", "0.53112125", "0.5306602", "0.5301709", "0.52778757", "0.5267395", "0.5262194", "0.5255945", "0.5254107", "0.5249291", "0.5235233", "0.5234167", "0.52338564", "0.52337337", "0.5225075", "0.52244127", "0.52211046", "0.52185076", "0.52169305" ]
0.6659781
16
Method for setting the playlist name
updatePlaylistName(name) { this.setState({playlistName: name}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePlaylist(playlist, artistName, songTitle){\n \n playlist[artistName] = \"songTitle\";\n \n}", "function updatePlaylist(playlist, artistName, songTitle)\n{\n playlist[artistName] = songTitle\n}", "updatePlaylistName(name) {\n\t\tthis.setState({playlistName: name});\n\t}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "updatePlaylistName(name) {\n this.setState( { playlistName : name });\n }", "updatePlaylistName(name){\n this.setState({playlistName: name});\n }", "updatedPlaylistName(name) {\n this.setState({ playlistName: name });\n }", "function rename_current_playlist_title(site_url, playlist_caption, playlist_id)\n{\n\tvar result = $.ajax({\n\t\tasync:false,\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"playlist_caption=\"+playlist_caption+\"&playlist_id=\"+playlist_id,\n\t\turl: site_url+\"video/rename_playlist_title/\"\t\t\n\t}).responseText;\t\n\treturn result;\n}", "updatePlaylistName(name) {\n this.setState({playlistname: name}) //step 57\n }", "_autoplayAddTitle() {\n\t\tif (this._sCurrentTitleUrl) {\n\t\t\tytDownload.getBasicInfo(this._sCurrentTitleUrl).then(oInfo => {\n\t\t\t\tlet iRandomRelatedVideo = Math.floor(Math.random() * oInfo.related_videos.length);\n\t\t\t\tlet oSuggestion = oInfo.related_videos[iRandomRelatedVideo];\n\n\t\t\t\tthis._aPlaylist.push({\n\t\t\t\t\tname: oSuggestion.title ? oSuggestion.title : \"track\",\n\t\t\t\t\turl: \"https://www.youtube.com/watch?v=\" + oSuggestion.id\n\t\t\t\t});\n\t\t\t}).catch(err => {\n\t\t\t\tlogger.warn(\"Could not add suggested title: \", err);\n\t\t\t});\n\t\t} else {\n\t\t\tlogger.warn(\"Could not add suggested title, due to missing current title.\");\n\t\t}\n\t}", "function showPlaylist(name, url) {\n $('#loggedin').hide();\n $('#songlist').show();\n $('#playlist_title').append('<h3>' + name + '</h3>');\n apiHelper(url, function(items) {\n items.forEach(function(i) {\n $('#playlist_title').append('<li id=' + i + '> <a href=\"#\">' + i.track.name + '</a> </li>');\n $('#playlist_title').append(generateStars());\n })\n })\n }", "function updatePlaylist(playlist, artist, song) {\n //var playlist = {artist: song};\n playlist[artist] = song\n return\n}", "function addPlaylistsName() {\n let listEle = document.getElementById('playlistNames');\n let listName = playlistsArr[playlistsArr.length - 1].name;\n let option = document.createElement('option');\n option.setAttribute('value', listName);\n option.innerHTML = listName;\n listEle.appendChild(option);\n}", "function updateMusicUI(artist_name,song_title) {\n\n\tvar playlist_name = \"\";\n\tswitch(current_mood) {\n\tcase mood.HAPPY:\n\t\tplaylist_name = \"Happy Playlist\"\n\n\t\tbreak;\n\tcase mood.SAD:\n\t\tplaylist_name = \"Sad Playlist\"\n\t\tbreak;\n\tcase mood.ANGRY:\n\t\tplaylist_name = \"Angry Playlist\"\n\t\tbreak;\n\tdefault: // default is happy\n\t\tplaylist_name = \"Happy Playlist\"\t\t\t\n\t}\n\t\n\t$(\"#div_artistname\").text(artist_name);\n\t$(\"#div_songtitle\").text(song_title);\n\t$(\"#div_playlist\").text(playlist_name);\n\t\n}", "function updatePlaylist(playlist, artistName, songTitle){\n return Object.assign( playlist, {[artistName]: songTitle});\n}", "setName (name) {\n this._player.name = name;\n }", "function setSong(name, inter, songUrl, title) {\r\n\t$(name).jPlayer({\r\n\t\tready: function(event) {\r\n\t\t\t$(this).jPlayer(\"setMedia\", {\r\n\t\t\t\ttitle: title,\r\n\t\t\t\tmp3: songUrl\r\n\t\t\t});\r\n\t\t},\r\n\t\tswfPath: \"js\",\r\n\t\tcssSelectorAncestor: inter,\r\n\t\tsupplied: \"mp3\",\r\n\t\twmode: \"window\",\r\n\t\tsmoothPlayBar: true,\r\n\t\tkeyEnabled: true,\r\n\t\tuseStateClassSkin: true,\r\n\t\tremainingDuration: true,\r\n\t\ttoggleDuration: true\r\n\t});\r\n}", "addPlaylist(playlist)\n {\n if(this.name === null) {\n this.name = playlist.name;\n }\n for (let song of playlist.songs) {\n let newSong = new Song('', '', song);\n this.songs.push(newSong);\n }\n }", "function ChangeArtist() {\n \t\tvar SelectedArtist = document.getElementById('FolderListId');\n\t\tCreateSongList(encodeURI(SelectedArtist.value));\n \t\treturn;\n \t}", "function customizePlayer(input) {\n\tplayer.name = input;\n}", "function Playlist(name) {\n this.name = name;\n this.tracks = [];\n}", "function playlist(id, fname, lname, status)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.id = id;\n\t\t\t\t\t\tthis.first_name=fname;\n\t\t\t\t\t\tthis.last_name=lname;\n\t\t\t\t\t\tthis.status = status;\n\t\t\t\t\t}", "function updatePlaylist(obj , artistName , songTitle)\n{\n obj[artistName] = songTitle;\n return obj;\n}", "function changePlaylist() {\n\t\t// clear track specific data\n\t\t$(\"#trackName\").empty();\n\t\t$(\"#trackRating\").val(\"(Rate track)\");\n\t\n\t\tvar playlistIndex = $(\"#playlist\").val();\n\t\tif (playlistIndex == \"select\") {\n\t\t\t$(\"#playlistPlayer\").empty();\n\t\t} else {\n\t\t\t// load selected playlist on page\n\t\t\tvar userLib = Library.forCurrentUser();\n\t\t\tuserLib.playlists.snapshot().done(function (snapshot) {\n\t\t\t\tvar playlist = snapshot.get(playlistIndex);\n\t\t\t\tlist = List.forPlaylist(playlist);\n\t\t\t\t$(\"#playlistPlayer\")\n\t\t\t\t\t.empty()\n\t\t\t\t\t.append(list.node);\n\t\t\t\tlist.init();\n\t\t\t});\n\t\t}\n\t}", "function setPlaylist(mood) {\n if (mood === \"Happy\") {\n var userPlaylists = happyPlaylistIDs;\n } else if (mood === \"Sad\") {\n var userPlaylists = sadPlaylistIDs;\n } else if (mood === \"Party\" || mood === \"Excited\") {\n var userPlaylists = excitedPlaylistIDs;\n } else if (mood === \"Chill\") {\n var userPlaylists = chillPlaylistIDs;\n } else if (mood === \"Classy\") {\n var userPlaylists = classyPlaylistIDs;\n }\n console.log(\"Playlists\");\n var randomID = Math.floor(Math.random() * userPlaylists.length);\n var playlistID = userPlaylists[randomID];\n var embedURL = `https://open.spotify.com/embed/playlist/${playlistID}`;\n console.log(randomID);\n $(spotifyPlayer).attr(\"src\", embedURL);\n }", "set playerName(value) {\n console.log('set playerName Method '+ value)\n this._playerName = value;\n }", "function Playlist_modifTitle(element) {\r\n if(element.id && (element.id.indexOf('playnav-play-playlist-')==0) || (element.id.indexOf('playnav-grid-playlist-')==0)) {\r\n var divs=null; try { divs=document.evaluate(\".//div[starts-with(@id,'playnav-playlist-') and contains(@id,'-title')]\",element,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); } catch(err) { divs=null; }\r\n if(divs) {\r\n var divs_lg=divs.snapshotLength;\r\n for(var h=0;h<divs_lg;h++) {\r\n var elem=divs.snapshotItem(h);\r\n if(elem.parentNode.nodeName.toUpperCase()!=\"A\") {\r\n var res=elem.getAttribute('id').match(/^playnav\\-playlist\\-(.*?)\\-title$/i);\r\n if(res) {\r\n res=res[1];\r\n var aelem=document.createElement('a');\r\n aelem.setAttribute('href',window.location.protocol+'//'+window.location.host+'/view_play_list?p='+res);\r\n aelem.setAttribute('target','_blank');\r\n aelem.appendChild(elem.cloneNode(true));\r\n elem.parentNode.replaceChild(aelem,elem);\r\n } } } } } }", "function createPlaylist() {\n var name = prompt(\"What do you want to call your playlist?\");\n if ((name == null) || (name == \"\")) {\n name = \"default\";\n };\n\n var playlist = {\"name\": name, \"songs\":[]};\n user_playlists.push(playlist);\n showLocalPlaylists();\n}", "play() {\n\t\tlet oCurrentTitle = {},\n\t\t\tiRandomTitleIndex = 0;\n\n\t\tif (this._aPlaylist.length > 0) {\n\t\t\t//Prevent event from being registered twice\n\t\t\tthis._oConnection.removeAllListeners(\"end\");\n\t\t\tthis._oConnection.end();\n\n\t\t\tif (this._bShuffleMode && !this._bOverrideShuffleMode) {\n\t\t\t\tiRandomTitleIndex = Math.floor(Math.random() * this._aPlaylist.length);\n\t\t\t\toCurrentTitle = this.removeTitle(iRandomTitleIndex);\n\t\t\t} else {\n\t\t\t\toCurrentTitle = this._aPlaylist.shift();\n\t\t\t\tthis._bOverrideShuffleMode = false;\n\t\t\t}\n\n\t\t\tthis._sCurrentTitleUrl = oCurrentTitle.url;\n\t\t\tthis._sCurrentTitleName = oCurrentTitle.name;\n\t\t\tthis._oClient.setPresence(oCurrentTitle.name);\n\n\t\t\tthis._oConnection.play(ytDownload(this._sCurrentTitleUrl, {\n\t\t\t\tquality: \"highest\",\n\t\t\t\thighWaterMark: ONE_MEGABYTE\n\t\t\t}));\n\n\t\t\tif (!this._bErrorEventAttached) {\n\t\t\t\tthis._attachErrorEvent();\n\t\t\t}\n\n\t\t\t//Plays the next title when the previous one ended\n\t\t\tthis._oConnection.onEvent(\"end\", this.play.bind(this));\n\t\t} else {\n\t\t\tthis._sCurrentTitleUrl = \"\";\n\t\t\tthis._sCurrentTitleName = \"\";\n\t\t\tthis._oClient.setPresence(\"\");\n\t\t}\n\n\t\tif (this._bAutoplay && this._aPlaylist.length === 0) {\n\t\t\tthis._autoplayAddTitle();\n\t\t}\n\t}", "setName(state, name) {\n state.player.name = name\n }", "function renamePlaylist() {\r\n if(!brw.inputbox.text || brw.inputbox.text == \"\" || brw.inputboxID == -1) brw.inputbox.text = brw.rows[brw.inputboxID].name;\r\n if (brw.inputbox.text.length > 1 || (brw.inputbox.text.length == 1 && (brw.inputbox.text >= \"a\" && brw.inputbox.text <= \"z\") || (brw.inputbox.text >= \"A\" && brw.inputbox.text <= \"Z\") || (brw.inputbox.text >= \"0\" && brw.inputbox.text <= \"9\"))) {\r\n brw.rows[brw.inputboxID].name = brw.inputbox.text;\r\n plman.RenamePlaylist(brw.rows[brw.inputboxID].idx, brw.inputbox.text);\r\n brw.repaint();\r\n };\r\n brw.inputboxID = -1;\r\n}", "function setName(data) {\n if (!player) {\n player = new Player();\n player.name = data.name;\n players.add(player);\n playerSetData();\n } else {\n player.name = data.name;\n }\n publish('player.set.name', { name: player.name });\n \n //console.log( \"| player \" , player);\n }", "updatePlaylistName(event){\n // update the state with the new PlayList name\n this.setState({ playlistName:event.target.value });\n }", "function removeFromPlaylist(playlist, artistName)\n{\n delete playlist[artistName]\n}", "function removeFromPlaylist(playlist, artistName){\n delete playlist[artistName];\n}", "function addPlaylist(playlist_name){\n console.log('creating playlist',playlist_name);\n\n var data = {\n playlist_name: playlist_name\n };\n\n requests.createPlaylist(data, (x) => {\n if (x['status'] === 200){\n console.log('-- DONE: createPlaylist');\n\n // remove <html> for playlists and refetch playlists.\n $('#playlists > ul').empty();\n showMyPlaylists();\n }\n else {\n alert('Error while creating playlist');\n }\n });\n}", "function getPlaylistName(userid, playlistid) {\n $.ajax({\n type: 'GET',\n url:'https://api.spotify.com/v1/users/' + userid + '/playlists/' + playlistid,\n headers: {'Authorization': \"Bearer \" + access_token},\n success: function(data) {\n playlistListPlaceholder.innerHTML = playlistListTemplate({ playlistname: data.name });\n }\n });\n}", "function getPlaylist(info) {\n $http.get(\"/playlist/\" + $rootScope.userLog).then(function (response) {\n if (response.status == 200) {\n $scope.playlist = response.data.playlist;\n username.innerHTML = response.data.username;\n }\n });\n }", "setChannelName (callback) {\n\t\tthis.channelName = `team-${this.team.id}`;\n\t\tcallback();\n\t}", "function user_change_song(){\n\t\t$('#play').hide();\n\t\t$('#stop').show();\n\t\t//Each track in the playlist has correlating data attributes from the front-end.\n\t\t//The song attribute loads the song file, while the rel keeps the playlist array\n\t\t//index in line properly.\n\t\tvar track = $(this).attr('song');\n\t\tplaylist_index = $(this).attr('rel');\n\t\t//Display track info in the correct location, change which song is 'active', play track!\n\t\ttrack_info.innerHTML = $(this).text();\n\t\t$(playlist_track).removeClass('active');\n\t\t$(this).addClass('active');\n\t\taudio.src=dir+track;\n\t\taudio.play();\n\t}", "function mediaPlayerOpeningHandler() {\r\n\tinsertText(\"playingSongTitle\", currentPlayFileName);\r\n}", "function addSongToExistingPlaylist(sname, surl, playlistName) {\n let reqPlaylist = playlistsArr.find((list) => list.name == playlistName);\n reqPlaylist.song.push({ songName: sname, songurl: surl });\n}", "function removeFromPlaylist(playlist, artistName) {\n// delete playlist.artist;\n delete playlist[artistName];\n return\n}", "function show_playlist(playlist) {\n\t\tvar list = '';\n\t\tplaylist.forEach(function(song) {\n\t\t\tlist += '<li>' + song.songname + '</li>';\n\t\t});\n\t\t$('#songlist').append(list);\n\t}", "setChannelName (callback) {\n\t\t// when posted to a team stream, it is the team channel\n\t\tthis.channelName = `team-${this.team.id}`;\n\t\tcallback();\n\t}", "updateSignUpPlayerFname(state, value) {\n state.signUp.player.DisplayName = value;\n }", "function setName(newName) {\n bot.name = newName;\n rl.question(''\n + 'Please enter a steam account username.\\n'\n , setUserName\n );\n}", "function createPlaylist() {\n\tvar html = '<li data-i=\"all\">All</li>';\n\t$.each(playlistsData, function(k, v){\n\t\thtml += '<li data-i=\"'+ k +'\">'+ v.title +'</li>';\n\t});\n\t$playlist.html(html);\n}", "function update_folder_tab_title() {\n\t\tif ( ! $associated_group_selector.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $associated_group_selector.val().length ) {\n\t\t\tfolder_tab_name = BP_Docs_Folders.folders_tab_label_groups;\n\t\t} else {\n\t\t\tfolder_tab_name = BP_Docs_Folders.folders_tab_label;\n\t\t}\n\n\t\t$( '#doc-folders .toggle-title' ).html( folder_tab_name );\n\t}", "function createPlaylist(targetName) {\n\n //Whatever name in that div is cleared out.\n targetDiv.innerHTML = \"\";\n\n //What ever name is passed through the argument is converted to lowercase, in case the name at the end of the URL is typed in a weird way: pAtriCk GaRvIn, etc.\n targetName = targetName.toLowerCase();\n\n //This sorts the setlists array by the \"Number.\" This number refers to which song this was in the series. Our first song — \"Tears Of A Clown\" — will be 1 under \"Number.\" The 100th post, \"Thank You For Being A Friend,\" will be 100 under \"Number.\"\n setlists.sort(function(a, b) {\n\n var aConcat = Number(a[\"Number\"]);\n var bConcat = Number(b[\"Number\"]);\n\n if (aConcat > bConcat) {\n return 1;\n } else if (aConcat < bConcat) {\n return -1;\n } else {\n return 0;\n }\n });\n\n for (var i in setlists) {\n\n\n //For each song in the list, there might be multiple names in the Person field. We separate those by splitting with a \", \".\n var names = setlists[i].Person.split(\", \");\n\n //The Javascript then checks to see if the name is a proper match with what's in the array.\n for (var j in names) {\n var match = names[j];\n var matchName = \"\" + names[j] + \"\"\n match = match.split(\" \").join(\"\").split(\".\").join(\"\").split(\"-\").join(\"\");\n match = match.toLowerCase();\n\n if (personNames.indexOf(matchName) < 0) {\n if (matchName !== \"XXXXXXX\" && matchName !== \"\" && matchName !== \"each of you fine folks\") {\n personNames.push(matchName);\n }\n\n }\n\n //The JavaScript then creates divs of the songs based picked for that person.\n if (targetName === match) {\n var holder, songinfo, bandName, bandNameText, songName, songNameText, songLink, songLinkDiv, songLinkDivText, audioLinks;\n instancesOfTarget++;\n document.getElementById('name').innerHTML = '';\n\n document.getElementById('name').innerHTML = 'Cover songs picked especially for ' + matchName + ' to <a href=\"https://popcultureexperiment.com/2018/04/02/thank-you-for-being-a-friend-cover-songs-uncovered/\" target=\"_blank\">thank you for being a friend</a> and thank you for supporting the <a href=\"https://popcultureexperiment.com/cover-songs-uncovered/\" target=\"_blank\">first 100 Cover Songs Uncovered</a> posts';\n\n //This makes the holder.\n holder = document.createElement('div');\n holder.classList.add('holder');\n holder.classList.add('clearboth');\n targetDiv.appendChild(holder);\n\n //This makes the elements with the band name.\n songinfo = document.createElement('div');\n songinfo.setAttribute('class', 'songinfo');\n holder.appendChild(songinfo);\n bandName = document.createElement('div');\n bandName.setAttribute('class', 'bandname');\n bandNameText = document.createTextNode(setlists[i].Band);\n bandName.appendChild(bandNameText);\n songinfo.appendChild(bandName)\n\n //This makes the elements with the song name.\t\n songName = document.createElement('div');\n songName.setAttribute('class', 'songname');\n songNameText = document.createTextNode(setlists[i].Song);\n songName.appendChild(songNameText);\n songinfo.appendChild(songName);\n\n //This makes the elements with the link to the post.\t\n songLink = document.createElement('a');\n songLink.href = setlists[i].Link;\n songLink.setAttribute('target', '_blank');\n songLinkDiv = document.createElement('div');\n songLinkDiv.setAttribute('class', 'visitPost');\n songLinkDivText = document.createTextNode('VIEW POST');\n songLinkDiv.appendChild(songLinkDivText);\n songLink.appendChild(songLinkDiv);\n songinfo.appendChild(songLink);\n\n //This makes the div for the audio links.\n audioLinks = document.createElement('div');\n audioLinks.setAttribute('class', 'audiolinks');\n holder.appendChild(audioLinks);\n\n //If the song has a YouTube link, this creates a div for the link with an image of the YouTube logo.\t\n if (setlists[i].Youtube !== \"\" && setlists[i].Youtube !== 0) {\n var Youtube, YoutubeImg;\n\n Youtube = document.createElement('a');\n Youtube.href = setlists[i].Youtube;\n Youtube.setAttribute(\"target\", \"_blank\");\n\n YoutubeImg = document.createElement(\"img\");\n YoutubeImg.src = \"http://patrickgarvin.com/images/youtubelogo.jpg\"\n YoutubeImg.setAttribute('class', 'buttons');\n\n Youtube.appendChild(YoutubeImg);\n audioLinks.appendChild(Youtube);\n\n }\n\n //If the song has a Spotify link, this creates a div for the link with an image of the Spotify logo.\n\n if (setlists[i].Spotify !== \"\" && setlists[i].Spotify !== 0) {\n var Spotify, SpotifyImg;\n\n Spotify = document.createElement('a');\n Spotify.href = setlists[i].Spotify;\n Spotify.setAttribute(\"target\", \"_blank\");\n\n SpotifyImg = document.createElement(\"img\");\n SpotifyImg.src = \"http://patrickgarvin.com/images/spotify.png\"\n SpotifyImg.setAttribute('class', 'buttons');\n\n Spotify.appendChild(SpotifyImg);\n audioLinks.appendChild(Spotify);\n\n }\n\n //If the song has an Apple link, this creates a div for the link with an image of the Apple logo.\n if (setlists[i].AppleMusic !== \"\" && setlists[i].AppleMusic !== 0) {\n var appleMusic, appleMusicImg;\n\n appleMusic = document.createElement('a');\n appleMusic.href = setlists[i].AppleMusic;\n appleMusic.setAttribute(\"target\", \"_blank\");\n\n appleMusicImg = document.createElement(\"img\");\n appleMusicImg.src = \"http://patrickgarvin.com/images/appleMusic.png\"\n appleMusicImg.setAttribute('class', 'buttons');\n\n appleMusic.appendChild(appleMusicImg);\n audioLinks.appendChild(appleMusic);\n\n }\n\n\n\n }\n }\n }\n\n socialHolder = document.createElement('div');\n socialHolder.setAttribute('class', 'socialHolder');\n targetDiv.appendChild(socialHolder);\n\n Facebook = document.createElement('a');\n Facebook.href = 'https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fpatrickgarvin.com%2Fcsu100%2F%23_' + targetName + '&amp;src=sdkpreparse'\n Facebook.setAttribute(\"target\", \"_blank\");\n FacebookImg = document.createElement(\"img\");\n FacebookImg.src = \"http://patrickgarvin.com/images/facebook.jpg\"\n FacebookImg.setAttribute('class', 'buttons');\n Facebook.appendChild(FacebookImg);\n socialHolder.appendChild(Facebook);\n FacebookImg.style.margin = \"20px\";\n\n\n TwitterURL = \"%23_\" + targetName\n Twitter = document.createElement('a');\n Twitter.href = 'http://twitter.com/share?text=To mark 100 Cover Songs Uncovered posts, @popexperiment made a special best-of playlist http://patrickgarvin.com/csu100/' + TwitterURL;\n Twitter.setAttribute(\"target\", \"_blank\");\n TwitterImg = document.createElement(\"img\");\n TwitterImg.src = \"http://patrickgarvin.com/images/twitter.jpg\"\n TwitterImg.setAttribute('class', 'buttons');\n Twitter.appendChild(TwitterImg);\n socialHolder.appendChild(Twitter);\n TwitterImg.style.margin = \"20px\";\n\n }", "function setPlayer(name) {\n window.localStorage.setItem('currentPlayer', name);\n renderPlayer();\n }", "handleNameChange(event){\n this.props.updatePlaylistName(event.target);\n }", "function setAssignName()\n\t{\n\t\tvar name = 'Student and Overall Grade Report';\n\n\t\tvw.drawList.setParam('aName', 'text', name);\n\t}", "function setName(value) {\n\tplayer.name = value;\n\tmessage = \"Oh, brave <b><b>\" + player.name + \"</b></b>, the princess needs your help! \\nShe has been kidnapped by the evil oger and trapped in a castle deep in the woods. No one has dared to go after her, for fear of the oger. Will you help save the princess and defeat the oger? <br/><br/>Type 'yes' or 'no'. This is how you will interact with game.\";\n\toperation = operations[++opIndex];\n\tdisplayText(message);\n}", "set name(value) {\n\t\tthis._name = value;\n\t}", "function setSongInfo(current, next) {\n document.querySelector(\"#currentSongTitle\").innerHTML = current;\n document.querySelector(\"#commingUpSongTitle\").innerHTML = next;\n console.log(current, next);\n}", "function setCurrentPlayerArtist_Song(){\n\t\t//A volte dice null, altre dice empty, who knows.\n\t\t$.get('/artist_title',{\n \ttitle: getCurrentPlayerTitle()\n \t}).done((data)=>{\n \t\tconsole.log('artist data: ', data);\n \t\tif(data[0] != null){\n\t\t\t\tcurrentPlayerArtist = data[0];\n\t\t\t\tcurrentPlayerSong = data[1];\n\t\t\t\tsetContentBrano();\n\t\t\t\tsetArtistSimilarity();\n \tsetGenreSimilarity();\n }else{\n \t//nel caso ritorni NULL, l'artista è il channelTitle.\n \tcurrentPlayerArtist = currentPlayerVideo.snippet.channelTitle;\n \t//nel caso ritorni NULL, la canzone è il nome del video.\n \tcurrentPlayerSong = currentPlayerVideo.snippet.title;\n\t\t\t\tsetContentBrano();\n\t\t\t\tsetArtistSimilarity();\n \tsetGenreSimilarity();\n }\n\t\t}).fail((data)=>{\n\t\t\t//Risposta empty o errore, assegno default.\n\t\t\tcurrentPlayerArtist = currentPlayerVideo.snippet.channelTitle;\n currentPlayerSong = currentPlayerVideo.snippet.title;\n\t\t\tsetContentBrano();\n\t\t\tsetArtistSimilarity();\n setGenreSimilarity();\n\t\t})\n\t}", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function DisplayCurrentTrackName( objectHTMLAudioElement ) {\n // file path\n var addressbar = objectHTMLAudioElement.src;\n var dirUrl = addressbar.split( \"html/audio\" );\n var urlIp = addressbar.split( \":\" );\n urlIp = urlIp[1];\n urlIp = urlIp.split( \"//\" );\n urlIp = urlIp[1];\n\n var audioUrl = dirUrl[0] + \"html/audio\";\n\n $( \".urlIp\" ).text( urlIp );\n\n $( \".serverUrl\" ).text( audioUrl );\n\n var streamUrl = dirUrl[0] + \"html/M3U/playlist.m3u\"\n $( \".m3uUrl\" ).text( streamUrl );\n $( \"#m3uUrl\" ).attr( \"href\", streamUrl );\n\n // basae name\n var linkText = addressbar.substring( addressbar.lastIndexOf( '/' )+1 );\n\n\n linkText = linkText.replace( /%20/g, \" \" );\n linkText = decodeURI( linkText );\n linkText = unescape( linkText );\n\n if ( linkText == \"f-s-path0-fx.mp3\" ) { linkText = \"( splash sound ) 🌊\"; } // decorate splash intro track\n $( \"#trackName\" ).text( linkText );\n}", "function setStreamTitle(text) {\r\n\t\t\tself.bbgCss.jq.streamTitle.text(text);\r\n\t\t}", "function selectSong(id){\n\t\tvar nameSong = document.getElementById('nameSong');\n\t\taudio.setAttribute('src', playList[id].src);\n\t\tsong = id;\n\t\taudio.play();\n\t\trotateAnimation();\n\t\tvar showNameSong = \"\";\n\t\tshowNameSong += '<h2 class=\"currentSong\">' + playList[id].name + '</h2>' +\n\t\t'<h3>' + playList[id].artist + '</h3>';\n\t\tnameSong.innerHTML = showNameSong;\n\t}", "setChannelName (/*callback*/) {\n\t\tthrow 'stream channels are deprecated';\n\t\t/*\n\t\t// listening on the stream channel for this stream\n\t\tthis.channelName = 'stream-' + this.stream.id;\n\t\tcallback();\n\t\t*/\n\t}", "setChannelName (callback) {\n\t\t// marker location messages come to us on the team channel\n\t\tthis.channelName = `team-${this.team.id}`;\n\t\tcallback();\n\t}", "function streamSong(songName) {\r\n audio.src = \"song/\" + songName;\r\n audio.load();\r\n\r\n // Highlight the song the playlist and remove old highlight\r\n if (playlistIndex >= 0) {\r\n songButtons[songs[playlistIndex]].button.classList.remove(\"active\");\r\n }\r\n playlistIndex = songButtons[songName].index;\r\n songButtons[songName].button.classList.add(\"active\");\r\n }", "function displaySong(name, inter, data) {\r\n\tvar obj = JSON.parse(data);\r\n\tvar cssSelector = {\r\n\t\tjPlayer: name,\r\n\t\tcssSelectorAncestor: inter\r\n\t};\r\n\t/*An Empty Playlist*/\r\n\tvar playlist = [];\r\n\tvar options = {\r\n\t\tswfPath: \"js\",\r\n\t\tuseStateClassSkin: true,\r\n\t\tsupplied: \"mp3\"\r\n\t};\r\n\tvar myPlaylist = new jPlayerPlaylist(cssSelector, playlist, options);\r\n\t/*Loop through the JSon array and add it to the playlist*/\r\n\tvar l=obj.length;\r\n\tfor (var i=0;i<l; i++) {\r\n \tmyPlaylist.add({\r\n\t\t\ttitle: obj[i].title,\r\n\t\t\tmp3: obj[i].mp3\r\n\t\t});\r\n\t}\r\n}", "setChannelName (callback) {\n\t\t// since posting to streams other than the team stream is no longer allowed,\n\t\t// just listen on the team channel\n\t\tthis.channelName = `team-${this.team.id}`;\n\n\t\t/*\n\t\tif (!this.isTeamStream) {\n\t\t\tthrow 'stream channels are deprecated';\n\t\t}\n\t\tthis.channelName = `team-${this.team.id}`;\n\t\t//this.channelName = this.isTeamStream ? `team-${this.team.id}` : `stream-${this.stream.id}`;\n\t\t*/\n\t\t\n\t\tcallback();\n\t}", "playTitleMusic() {\n if (!this.music_muted) {\n this.titlemusic.play();\n }\n }", "set setName(name){\n _name=name;\n }", "async setName(name) {\n // window.APP.store.update({\n // activity: {\n // hasChangedName: true,\n // hasAcceptedProfile: true\n // },\n // profile: {\n // // Prepend (bot) to the name so other users know it's a bot\n // displayName: \"bot - \" + name\n // }})\n }", "savePlaylist() {\n // Get a list of track URIs provided by Spotify, these are needed for defining the playlist\n let tracks = this.state.playlistTracks.map(track => track.uri);\n // savePlaylist is Promise based. Once the playlist is saved, reset the application state.\n Spotify.savePlaylist(this.state.playlistName, tracks).then(() => {\n //Reset the state when done saving.\n this.setState({\n searchResults: [],\n playlistTracks: []\n })\n // Set the playlist name to empty.\n document.getElementsByClassName(\"Playlist-name\")[0].value = 'New Playlist';\n });\n }", "function setName(n) {\n\tname = n;\n}", "function setStation(station) {\n var chaninfo = getChanInfo(station);\n //$('#jPlayer').jPlayer('setMedia', {\n //\tmp3: chaninfo.streams[quality]\n //});\n $('#pltitle').text(chaninfo.title + \" - Zuletzt gespielt\");\n restartPlaylist();\n }", "function openPlaylist(id) {\n playlist = document.querySelector('#'+id + \"_name\").innerHTML;\n document.querySelector('#navigator').pushPage('playlist.html');\n}", "function updatePlaylist(){\n\tvar songs = JSON.parse(sessionStorage.getItem(\"songs\"));\n\t$(renderPlaylist(songs));\n}", "function removeFromPlaylist(playlist, artistName) {\n delete playlist[artistName];\n return playlist\n}", "setName(value){\n\t\tthis.name = value;\n\t}", "setName() {\n\n // get the nickname from the input.\n const name = $('#name-input').val();\n\n // set the name to a cookie\n Utils.setCookie('nickname', name, 14);\n\n // update the app state\n\t\tApp.state.name = name;\n\n\t\t// update the chat title\n\t\tApp.dom.updateName();\n\n // destroy the editor\n App.dom.destoryEditor();\n }", "function openPlaylist(name) {\n var playlistJSON = JSON.parse(localStorage.getItem(name));\n songs = [];\n var html = '<ol>';\n var counter = 0;\n playlistJSON.songs.forEach(song => {\n if (song) {\n html += \"<li>\" + song.url + '<button onclick=\"loadSong('+counter+')\">Play</button><br></li>';\n songs.push({\n id: counter,\n name: song.name,\n url: song.url\n });\n counter++;\n }\n });\n html += \"</ol>\"\n var mainContent = document.getElementById(\"playlist-content\");\n if (mainContent) {\n mainContent.innerHTML = html;\n console.log(\"opened playlist: \" + name);\n }\n}", "setName(name) { }", "function playSelectedSong(guid, title) {\r\n\twindow.chosenMusic = guid;\r\n\twindow.title = title;\r\n\t//initialize jplayer\r\n\tvar player = $(\"#jquery_jplayer_1\");\r\n\tplayer.jPlayer(\"destroy\");\r\n\tplayer.jPlayer({\r\n\t\tready: function(event) {\r\n\t\t\t$(this).jPlayer(\"setMedia\", {\r\n\t\t\t\ttitle: title,\r\n\t\t\t\tmp3: guid\r\n\t\t\t}).jPlayer(\"play\");\r\n\t\t},\r\n\t\tswfPath: \"js\",\r\n\t\tsupplied: \"mp3\",\r\n\t\twmode: \"window\",\r\n\t\tsmoothPlayBar: true,\r\n\t\tkeyEnabled: true,\r\n\t\tuseStateClassSkin: true,\r\n\t\tremainingDuration: true,\r\n\t\ttoggleDuration: true\r\n\t});\r\n}", "function playSong(){\n song.src = songs[currentSong]; //set the source of 0th song \n songTitle.textContent = songs[currentSong].replace('./assets/audio/',''); // set the title of song\n songTitle.textContent = songTitle.textContent.replace('.mp3',''); // set the title of song\n song.play(); // play the song\n}", "set HoverAudioName(value) {\n this._hoverAudioName = value;\n }", "function getPlaylist() {\n\t\treturn pls.id;\n\t}", "setChannelName (callback) {\n\t\t// since posting to any stream other than the team stream is no longer allowed,\n\t\t// just listen on the team channel\n\t\tthis.channelName = `team-${this.team.id}`;\n\n\t\t/*\n\t\t// team channel for file-type streams, or team-streams, otherwise the stream channel\n\t\tif (this.type === 'file' || this.isTeamStream) {\n\t\t\tthis.channelName = `team-${this.team.id}`;\n\t\t}\n\t\telse {\n\t\t\tthrow 'stream channels are deprecated';\n\t\t\t//this.channelName = `stream-${this.stream.id}`;\n\t\t}\n\t\t*/\n\t\t\n\t\tcallback();\n\t}", "function playFirstSong() {\n setTrack(tempPlaylist[0], tempPlaylist, true);\n}", "async onChangePlaylist(id) {\n if(id !== null){\n await Spotify.getPlaylist(id).then(data => {\n let playlistName = data[0].playlistName;\n data.shift();\n this.setState({playlistName: playlistName, playlistTracks: data, playlistTracksOriginal: data, selectedPlaylistId: id});\n });\n } else {\n this.setState({\n playlistTracks: [],\n playlistTracksOriginal: [],\n selectedPlaylistId: null\n });\n }\n }", "createNewPlaylist (name, json, key = false) {\n // Create new playlist reference with id.\n let nameRef\n if (key) {\n this.playlistsRefs.child(key).set({'name': name, name_lower: name.toLowerCase()})\n nameRef = key\n } else {\n nameRef = this.playlistsRefs.push({'name': name, name_lower: name.toLowerCase()}).ref.key\n }\n // Using ID + name push new song.\n this.playlists.child(nameRef).set({'name': name, name_lower: name.toLowerCase()})\n\n this.playlistSongAdd(nameRef, json)\n }", "set name(value) {\n if (typeof value !== \"string\") throw new Error(\"Name must be a string\");\n _name.set(this, value);\n }", "function loadPlaylistData(player, result) {\n player_playlist[player].remove();\n\n var playlistItems = [];\n for (var i = 0; i < result.length; i++) {\n playlistItems.push({\n title: (result[i].name.length > 50 ? (result[i].name.substring(0, 50) + \"...\") : result[i].name),\n name: result[i].name,\n mp3: result[i].path,\n id: result[i].id\n });\n }\n player_playlist[player].setPlaylist(playlistItems);\n}", "function playlistAdd(songName) {\r\n if (songButtons[songName] != undefined) {\r\n return false;\r\n }\r\n \r\n var songButton = document.createElement(\"button\");\r\n var songButtonText = document.createElement(\"span\");\r\n\r\n songButtonText.appendChild(document.createTextNode(songName));\r\n songButtonText.classList.add(\"songText\");\r\n\r\n songButton.appendChild(songButtonText);\r\n songButton.classList.add(\"btn\", \"btn-lg\", \"song\");\r\n songButton.setAttribute(\"type\", \"button\");\r\n songButton.addEventListener(\"click\", function() {\r\n streamSong(songName);\r\n });\r\n\r\n songPlaylist.appendChild(songButton);\r\n songButtons[songName] = {\r\n button: songButton,\r\n index: songs.length\r\n }\r\n\r\n return true;\r\n }", "setName(name) {\n\t\tthis.name = name;\n\t}", "function playSong(){\n song.src = songs[currentSong]; //set the source of 0th song \n songTitle.textContent = songs[currentSong].slice(6, -4); // set the title of song\n song.play(); // play the song\n}", "set name(x) { this._name = x; }", "function PickSong(song){\n title.innerText=song;\n //document.getElementById(\"title\").innerHTML = title;\n audio.src=`songs/${song}.mp3`\n \n}", "function play_track_from_playlist()\n{\n\tvar selected_track_index = $('#radio_song_list').attr(\"selectedIndex\");\n\t\n\t// play the selected track from playlist...\n\tradio_playlist.play(selected_track_index);\n}", "getPlaylist() {\n return this.playlist;\n }", "_updateTitlePanelTitle() {\n let current = this.currentWidget;\n const inputElement = this._titleHandler.inputElement;\n inputElement.value = current ? current.title.label : '';\n inputElement.title = current ? current.title.caption : '';\n }", "function rename() {\n clearInterval(timer);\n var timer = setTimeout(function() {\n var Name = document.getElementById(\"title\").value;\n chrome.storage.sync.set({Name});\n }, 500);\n}" ]
[ "0.77863026", "0.7558173", "0.7423637", "0.71672237", "0.71672237", "0.7146054", "0.6977724", "0.6953739", "0.6706719", "0.6686497", "0.66017616", "0.6514253", "0.649085", "0.6451153", "0.644364", "0.64109504", "0.63495296", "0.6328236", "0.6325498", "0.62932813", "0.62670344", "0.62639046", "0.62541294", "0.6243162", "0.6230022", "0.6208776", "0.6189437", "0.6150848", "0.61505497", "0.61411285", "0.61400855", "0.61400133", "0.6124606", "0.60862553", "0.602998", "0.6019281", "0.594588", "0.5939896", "0.59232146", "0.5922265", "0.59065", "0.59044594", "0.5857409", "0.58553755", "0.58399665", "0.5835904", "0.58333415", "0.5826875", "0.5818792", "0.58186847", "0.5803456", "0.58015734", "0.5791622", "0.5777668", "0.576626", "0.57653457", "0.5741086", "0.5739114", "0.57352346", "0.57352346", "0.5730606", "0.5708466", "0.5704556", "0.56919", "0.56917685", "0.56882614", "0.56828165", "0.56815636", "0.56773424", "0.5675335", "0.5664617", "0.5658083", "0.56559986", "0.56542444", "0.5628921", "0.5628355", "0.56278986", "0.56274086", "0.5620988", "0.56131953", "0.5610838", "0.5609218", "0.55944914", "0.5594085", "0.5590049", "0.5585182", "0.55743104", "0.5571817", "0.55548215", "0.5554063", "0.5545675", "0.55442476", "0.5542398", "0.55344045", "0.55332017", "0.55317587", "0.5524462", "0.54977477", "0.5494504", "0.54747874" ]
0.707359
6
Method for searching the spotify library. See util/Spotify.js
search(term) { // search is Promise based (thenable), set the state when the Promise is fulfilled Spotify.search(term).then(results => { this.setState({searchResults: results}); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchSpotify (input) {\n // If nothing is searched, The Sign will be used\n if (input == \"\") {\n input = \"The Sign Ace of Base\"\n };\n // Searching Spotify for track information\n spotify.search({type: \"track\", query: input}, function(error, data) {\n if (error) {\n console.log(\"An error occurred: \" + error);\n } else {\n console.log(\n \"Song title: \" + data.tracks.items[0].name +\n \"\\nArtist: \" + data.tracks.items[0].artists[0].name +\n \"\\nAlbum: \" + data.tracks.items[0].album.name +\n \"\\nSong preview: \" + data.tracks.items[0].href\n );\n };\n });\n}", "function spotifySearch() {\n\tsearchTerm = '\"' + process.argv.slice(3).join(\" \") + '\"';\n\tconsole.log(\"Searching for \" + searchTerm + \"...\\n\");\n\tspotify\n .search({ type: 'track', query: searchTerm, limit: 1 })\n .then(function(response) {\n console.log(`\n----------------------------------------------------------------------------------------\n\t\t\tYou searched for the song: ${response.tracks.items[0].name} \n\t\t\tThe Artist is: ${response.tracks.items[0].album.artists[0].name}\n\t\t\tThe Album is: ${response.tracks.items[0].album.name}\n\t\t\tClick here to hear a clip: ${response.tracks.items[0].external_urls.spotify}\n \t`);\n\n })\n .catch(function(err) {\n return console.log('Error occurred: ' + err);\n });\n }", "function spotifySearch(){\n spotify.search({ type: 'track', query: songToSearch}, function(error, data){\n if(!error){\n for(var i = 0; i < data.tracks.items.length; i++){\n var song = data.tracks.items[i];\n console.log(\"Artist: \" + song.artists[0].name);\n console.log(\"Song: \" + song.name);\n console.log(\"Preview: \" + song.preview_url);\n console.log(\"Album: \" + song.album.name);\n console.log(\"-----------------------\");\n }\n } else{\n console.log('Error occurred.');\n }\n });\n }", "function spotifySearch() {\n spotify.search({ type: 'track', query: searchName }, function(err, data) {\n\tif ( err ) {\n console.log('Error occurred: ' + err);\n return;\n\t} else {\n\t console.log(JSON.stringify(data.tracks.items[0].artists, null, 2));\n\t //artists\n\t console.log(\"Artitst(s): \" + data.tracks.items[0].artists[0].name);\n\t // song name\n\t console.log(\"Song Name: \" + data.tracks.items[0].name);\n\t // spotify link\n\t console.log(\"Spotify Link: \" + data.tracks.items[0].href);\n\t // album\n\t console.log(\"Album: \" + data.tracks.items[0].album.name);\n\t}\n });\n} // close spotify function", "function searchSpotify(search){\n\tvar Spotify = require('node-spotify-api');\n \n\tvar spotify = new Spotify({\n\t\tid: 'da97b33e9f4640e08420c513eed1b7e2',\n\t\tsecret: '7fc8dcaebc8a40cb9f47b20f9f9f2e43'\n\t});\n\t \n\tspotify.search({ type: 'track', query: search }, function(err, data) {\n\t\tif (err) {\n\t \treturn searchSpotify(\"The Sign Ace\");\n\t\t}else{ \n\t\t\tconsole.log(\"Band Name: \" + data.tracks.items[0].artists[0].name); \n\t\t\tconsole.log(\"Song Name: \"+ data.tracks.items[0].name);\n\t\t\tconsole.log(\"Album Name: \" + data.tracks.items[0].album.name);\n\t\t\tconsole.log(\"Spotify Link: \" + data.tracks.href);\n\t\t\tlog(\"Band Name: \" + data.tracks.items[0].artists[0].name);\n\t\t\tlog(\"Song Name: \"+ data.tracks.items[0].name);\n\t\t\tlog(\"Album Name: \" + data.tracks.items[0].album.name);\n\t\t\tlog(\"Spotify Link: \" + data.tracks.href);\n\t \t}\n\t});\n}", "function spotify(){\n spotify = new Spotify({\n id: spotifyKeys.id,\n secret: spotifyKeys.secret,\n });\n //console.log(spotSearch);\n if(spotSearch !== \"\"){\n spotify.search({\n type:'track',\n query: spotSearch,\n }, function(err, data){\n if (!err){\n var trackInfo = data.tracks.items[0];\n //console.log(data);\n //console.log(spotSearch);\n console.log('Title: ' + trackInfo.name + '\\nAlbum: ' + trackInfo.album.name + '\\nArtists: ');\n for (i = 0; i < trackInfo.album.artists.length; i++){\n console.log(trackInfo.artists[i].name)\n }\n console.log('Preview Link: ' + trackInfo.href)\n }\n })\n }\n else {\n spotify.search({type:'track', query:'The Sign Ace of Base'}, function(err, data){\n if (!err){\n var trackInfo = data.tracks.item[0];\n cconsole.log(\"Title: \" + trackInfo.name + '\\nAlbum: ' + trackInfo.album.name + '\\nArtists: ');\n for (i = 0; i < trackInfo.album.artists.length; i++){\n console.log(trackInfo.artists[i].name)\n }\n console.log('Preview Link: ' + trackInfo.href)\n }\n })\n }\n // spotify.search({type:'artist', query: spotSearch}, function(err, data){\n // if (err){\n // return console.log('Error occured: ' + err);\n // }\n // console.log(data);\n}", "function spotifySearch() {\n // console.log(\"This is the spotify search\");\n if(process.argv.length === 3){\n searchTerm = \"The Sign\";\n }\n spotify.search({\n type: \"track\",\n query: searchTerm,\n limit: 10,\n }, function(err,data) {\n if(err) {\n return console.log(\"Error occurred: \" + err);\n }\n for (var i = 0; i < data.tracks.items.length; i++) {\n \n console.log(`Artist: ${data.tracks.items[i].artists[0].name}\\nSong Name: ${data.tracks.items[i].name}\\nSpotify Preview Link: ${data.tracks.items[i].preview_url}\\nAlbum: ${data.tracks.items[i].album.name}\\n\\n`);\n }\n })\n trackInfo(action, searchTerm);\n }", "function spotifySearch(search) {\n var song;\n\n if (search === null || search === undefined || search === \"\") {\n song = \"I Want It That Way\";\n } else {\n song = search;\n }\n spotify.search({ type: 'track', query: song }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n // console.log(data);\n var spotifySearchResult = data.tracks.items[0];\n // console.log(spotifySearchResult);\n for (i = 0; i < spotifySearchResult.artists.length; i++) {\n console.log(\"\\n----------Song Info----------\\n\")\n console.log(\"\\033[38;5;6m\" + \"Artist(s): \" + \"\\033[0m\" + spotifySearchResult.artists[i].name);\n console.log(\"\\033[38;5;6m\" + \"Song Name: \" + \"\\033[0m\" + spotifySearchResult.name);\n console.log(\"\\033[38;5;6m\" + \"Preview Link: \" + \"\\033[0m\" + spotifySearchResult.preview_url);\n console.log(\"\\033[38;5;6m\" + \"Album: \" + \"\\033[0m\" + spotifySearchResult.album.name + \"\\n\");\n console.log(\"---------------------------------\");\n }\n });\n\n}", "function searchSpotify(song){\n spotify.search({ type: 'track', query: song }, function(err, data) {\n if ( err ) {\n console.log('Error occurred: ' + err);\n return;\n }\n console.log(\"_______________________________________________________\");\n var artist = data.tracks.items[0].album.artists[0].name;\n console.log(\"Artist: \" + artist);\n var songName = data.tracks.items[0].name;\n console.log(\"Song Name: \" + songName);\n var songLink = data.tracks.items[0].external_urls.spotify;\n console.log(\"Link: \" + songLink);\n var album = data.tracks.items[0].album.name;\n console.log(\"Album: \" + album);\n console.log(\"_______________________________________________________\");\n});\n}", "function librarySearch() {\n var deferred = Q.defer();\n\n that._getCachedLibrary(function(cb) {\n var parsedTracks = cb.map(function(track) {\n return that._parseTrackObject(track, track.id);\n });\n var fuse = new Fuse(parsedTracks, {includeScore: true, threshold: 0.5, keys: [\"artist\", \"album\", \"title\"]});\n var result = fuse.search(query);\n\n var foundTracks = result.map(function(item) {\n var track = item.item;\n return {\n type: \"track\",\n score: (1 - item.score) * 100,\n track: that._parseTrackObject(track, track.id)\n };\n });\n\n deferred.resolve(foundTracks);\n }, deferred.reject);\n\n return deferred.promise;\n }", "function spotifySearch() {\n\n console.log(\"initializing funciton\");\n var spotify = new Spotify(keys.spotify);\n\n if(!value) {\n value = \"The Sign by Ace of Base\";\n }\n\n \n\n spotify.search({ type: 'track', query: value }, function(error, data, response) {\n if (error) {\n\n console.log('Error occurred: ' + error);\n return;\n }\n var songInfo = data.tracks.items[0];\n var songData =\n \"\\r\\n Artist: \" + songInfo.artists[0].name +\n \"\\r\\n Song Title: \" + songInfo.name +\n \"\\r\\n Song Preview: \" + songInfo.preview_url ;\n\n console.log(songData);\n }); \n \n }", "search(term) {\n // get access token\n accessToken = Spotify.getAccessToken();\n return fetch(`https://api.spotify.com/v1/search?type=track&q=${term}`, {\n headers: {\n Authorization: `Bearer ${accessToken}`\n }\n }).then(response => {\n // check if the response is successful for the API call\n debugger\n if (response.ok) {\n return response.json();\n }\n throw new Error('Request failed!');\n }).then(jsonResponse => {\n // get tracks from item list\n debugger\n if (!jsonResponse.tracks.items){\n // if nothing is returned, return an empty array\n return [];\n }\n else {\n // get search results back and map them to track structure for later display\n return jsonResponse.tracks.items.map(track => ({\n id: track.id,\n name: track.name,\n artist: track.artists[0].name,\n album: track.album.name,\n uri: track.uri,\n preview: track.preview_url,\n }));\n }\n });\n }", "function searchSpotify() {\n inquirer.prompt([{\n type: 'input',\n name: 'song',\n message: \"Name a song:\"\n }, {\n type: 'input',\n name: 'artist',\n message: \"Name the artist:\"\n }\n ]).then(answers => {\n spotify.search({ type: 'track', query: (answers.song + \", \" + answers.artist) }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n console.log(\"Here is '\" + data.tracks.items[0].name + \"' from the album, \" + data.tracks.items[0].album.name + \", by \" + data.tracks.items[0].album.artists[0].name);\n console.log(\"Spotify Link: \" + data.tracks.items[0].preview_url);\n });\n });\n}", "function searchTrack() {\n if (searchQuery.length === 0) {\n searchQuery = \"The Sign Ace of Base\"\n }\n spotify.search({ type: 'track', query: searchQuery }, function (err, data) {\n if (err) {\n return console.log('Error: ' + err);\n }\n console.log(`Artist: ${data.tracks.items[0].artists[0].name}`);\n console.log(`Song: ${data.tracks.items[0].name}`);\n console.log(`Album: ${data.tracks.items[0].album.name}`);\n console.log(`Preview Link: ${data.tracks.items[0].preview_url}`);\n });\n}", "function spotifyAPI(){\n\tvar Spotify = require(\"node-spotify-api\");\n\n\tvar spotify = new Spotify(keys.spotify);\n\n\tif (argument){\n\t\tspotify.search({ \n\t\t\ttype: 'track', \n\t\t\tquery: argument \n\t\t}, function(error, data) {\n \t\t\tif (!error) {\n \t\t\t\tconsole.log(\"----------------\");\n \t\t\t\tconsole.log(\"Artist Name: \" + data.tracks.artists.name); \n \t\t\t\tconsole.log(\"Song Name: \" + data.tracks.name);\n \t\t\t\tconsole.log(\"Album Name: \" + data.tracks.album.name);\n \t\t\t\tconsole.log(\"Song Preview Link :\" + data.body.tracks.external_urls);\n \t\t}\n \t});\t\n\t}\n else {\n \tspotify.search({ \n\t\t\ttype: 'track', \n\t\t\tquery: 'The Sign' \n\t\t}, function(error, data) {\n \t\t\tif (!error) {\n \t\t\t\tconsole.log(\"----------------\");\n \t\t\t\tconsole.log(\"Artist Name: \" + data.tracks.artists.name); \n \t\t\t\tconsole.log(\"Song Name: \" + data.tracks.name);\n \t\t\t\tconsole.log(\"Album Name: \" + data.tracks.album.name);\n \t\t\t\tconsole.log(\"Song Preview Link :\" + data.body.tracks.external_urls);\n \t\t}\n \t});\t\t\n }\t\n}", "function songSearch(searchTerm) {\n \n spotify.search({ type: \"track\", query: searchTerm}, function(err, data) {\n if (err) {\n return console.log(\"Error occurred: \" + err);\n }\n console.log(\"Song Name : \" + data.tracks.items[0].name);\n console.log(\"Album Name : \" + data.tracks.items[0].album.name);\n console.log(\"Song Preview : \" + data.tracks.items[0].preview_url);\n });\n}", "function spotifySearch(search) {\n console.log(\"Give it a second...\");\n if(search == undefined) {\n search = \"what's my age again\";\n }\n spotify.search({ type: 'track', query: search }, function(error, response) {\n if ( error ) {\n console.log('Error occurred: ' + error);\n return;\n }\n console.log('--------------------------------------------------------------');\n console.log('Artist(s): ' + response.tracks.items[0].artists[0].name);\n console.log('--------------------------------------------------------------');\n console.log('Song Name: ' + response.tracks.items[0].name);\n console.log('--------------------------------------------------------------');\n console.log('Preview Link: ' + response.tracks.items[0].preview_url);\n console.log('--------------------------------------------------------------');\n console.log('Album: ' + response.tracks.items[0].album.name);\n console.log('--------------------------------------------------------------');\n \n var spotifyData = {\n 'Artist(s)': response.tracks.items[0].artists[0].name,\n 'Song Name': response.tracks.items[0].name,\n 'Preview Link': response.tracks.items[0].preview_url,\n 'Album': response.tracks.items[0].album.name\n }\n appendToLog(spotifyData, 'spotify');\n});\n}", "function findSong(searchTerm) {\n // spotify package\n var spotify = require('spotify');\n // search for track\n spotify.search({ type: 'track', query: searchTerm }, function(err, data) {\n\n if (err || searchTerm == null) {\n\n console.log('Because this error occurred: ' + err + \" you will be hearing Ace of Base!\");\n console.log(\"=======================\");\n // I use lookup instead of seach because I know the unique id of the song that is required in the instructions\n spotify.lookup({ type: 'track', id: '0hrBpAOgrt8RXigk83LLNE' }, function(err, data) {\n // name of song and its artists\n console.log(\"Song name: \" + data.name);\n console.log(\"Band: \" + data.artists[0].name);\n })\n return;\n }\n\n if (!err) {\n\n console.log(\"========================\");\n // name of artist\n console.log(\"Name of artist: \" + JSON.stringify(data.tracks.items[0].artists[0].name, null, 2));\n // name of song\n console.log(\"Song name: \" + JSON.stringify(data.tracks.items[0].name, null, 2));\n // preview of song\n console.log(\"Use this link for a song preview: \" + JSON.stringify(data.tracks.items[0].preview_url, null, 2));\n // Album where the songs come from\n console.log(\"Album name: \" + JSON.stringify(data.tracks.items[0].album.name, null, 2));\n console.log(\"========================\");\n }\n });\n}", "function spot(b) {\n console.log(\"*******SPOTIFY*********\");\n\n var spotify = new Spotify({\n id: spotID,\n secret: spotSecret\n });\n\n var song = \"\";\n if (b == \"\") {\n // default song\n if (term.length == 3)\n song = \"All The Small Things\";\n else {\n // get console song input\n for (var i = 2; i < term.length; i++) {\n if (i > 2 && i < term.length)\n song = song + \"+\" + term[i];\n }\n }\n } else\n song = b;\n // api call\n spotify.search({ type: 'track', query: song }).then(function(response) {\n //array containing show info\n var showme = [];\n //console.log(response);\n var find = response.tracks.items[0];\n //console.log(find);\n //artist\n showme.push(find.album.artists[0].name);\n //name of song\n showme.push(find.name);\n //preview link \n showme.push(find.external_urls.spotify);\n //album name\n showme.push(find.album.name);\n\n //display information\n console.log(\"Artist: \" + showme[0]);\n console.log(\"Song Name: \" + showme[1]);\n console.log(\"Link: \" + showme[2]);\n console.log(\"Album Name: \" + showme[3]);\n console.log(\"******END SPOTIFY******\");\n }).catch(function(err) {\n console.log(err);\n });\n\n} //end spot", "function callSpotify() {\n var spotify = new Spotify(keys.spotify);\n spotify.search({ type: 'track', query: searchParams }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n console.log(` -============= Song Results =========================-\n Artist(s): ${data.tracks.items[0].artists[0].name}\n Song Name: ${data.tracks.items[0].name}\n Spotify Preview Link: ${data.tracks.items[0].artists[0].external_urls.spotify}\n Album: ${data.tracks.items[0].album.name}\n -=====================================================-`);\n });\n}", "function songfind() {\n\nvar spotify = new Spotify(\n keys.spotify\n);\n var songTitle = process.argv.slice(2);\nspotify.search({ type: 'track', query: songTitle, limit: 1 }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n // console.log(\"Artist: \" + \"\");\n console.log(\"Song: \" + data.tracks.items[0].name);\n console.log(\"Spotify URL: \" + data.tracks.items[0].preview_url);\n console.log(\"Album Name:\" + data.tracks.items[0].album.name)\n\t\n})}", "function getSpotifyInfo() {\n if (searchTerm === \"\") {\n searchTerm = \"the sign ace of base\"; // default search\n }\n spotify.search({ type: \"track\", query: searchTerm }, function(err, data) {\n if (err) {\n logString += \"Error occurred: \" + err;\n return console.log(logString);\n }\n logString += \"\\n\\n\\nYou Searched For: \" + searchTerm;\n logString += \"\\n******** Results *********\\n\\n\";\n logString += \"\\nSong Name - \" + data.tracks.items[0].name;\n logString +=\n \"\\nArtist Name - \" + data.tracks.items[0].album.artists[0].name;\n logString += \"\\nAlbum Name - \" + data.tracks.items[0].album.name;\n if (data.tracks.items[0].preview_url) {\n logString += \"\\nPreview URL - \" + data.tracks.items[0].preview_url;\n } else {\n logString += '\\nPreview URL - Unavailable for \"' + searchTerm + '\"';\n }\n logString += \"\\n\\n******** End *********\\n\\n\\n\";\n console.log(logString);\n logResults();\n });\n}", "function searchSpotify(query, options, callback) {\r\n if(options == null)\r\n options = {};\r\n options.query = query;\r\n let url = 'https://api.spotify.com/v1/search';\r\n return callSpotify(url, options, callback);\r\n}", "function spotifyThis() {\n //default input if there is no input from user\n if (!input) {\n input = \"the sign ace of base\"\n };\n\n //searching spotify with the user input for 1 track\n spotify.search({type: 'track', query: input, limit: 1}, function(error, data) {\n //error catch and console.log\n if (error) {\n console.log('Error occurred: ' + error);\n }\n\n //console.log results\n var songSearched = data.tracks.items;\n console.log(\"========================\");\n console.log(\"Artist: \" + songSearched[0].artists[0].name);\n console.log(\"Song Title: \" + songSearched[0].name);\n console.log(\"Link to Song: \" + songSearched[0].preview_url);\n console.log(\"Album: \" + songSearched[0].album.name);\n console.log(\"========================\");\n });\n}", "function searchSpotify() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"query\",\n message: \"Search Spotify:\"\n }\n ]).then(function(input) {\n var query = input.query;\n if (input.query == \"\") {\n query = \"The Sign Ace of Base\"\n }\n var spotify = new Spotify({\n id: spotifyKeys.id,\n secret: spotifyKeys.secret\n });\n spotify.search({ type: \"track\", query: query }, function (error, data) {\n if(error) {\n console.log(error)\n } else {\n var title = data.tracks.items[0].name;\n var artist = data.tracks.items[0].artists[0].name;\n var album = data.tracks.items[0].album.name;\n var previewLink = data.tracks.items[0].preview_url;\n if(!previewLink) {\n previewLink = \"No preview available :(\"\n }\n console.log(\"~Siri~ Here is some information about \" + title + \".\")\n console.log(\"...\");\n console.log(\"Title: \" + title);\n console.log(\"Artist: \" + artist);\n console.log(\"Album: \" + album);\n console.log(\"Preview: \" + previewLink); \n console.log(\"...\");\n logData(\"Searched Spotify for \" + title + \" by \" + artist);\n }\n })\n \n })\n}", "function getSpotify(){\t\n\t\n\tvar params = {\n\t\ttype: 'track',\n\t\tquery: userInput,\n\t\tlimit: 1\n\t}\n\n// If no song is provided then your program will default to \"The Sign\" by Ace of Base\n\tif (userInput === undefined){\n\t\tparams.query = \"Ace of Base The Sign\";\n\t}\n\n\tspotify.search(params, function(error, data) {\n\t\tif (error) {\n\t \t\treturn console.log('Error occurred: ' + err);\n\t\t}\n\t \tvar track = data.tracks.items[0]\n\t\tconsole.log(\"Artist name(s): \" + track.artists[0].name); \n\t\tconsole.log(\"Song name: \" + track.name); \n\t\tconsole.log(\"Preview link: \" + track.preview_url); \n\t\tconsole.log(\"Album name: \" + track.album.name); \n\t});\n}", "function spotifyAPI(userFavorites){\r\n const spotifyID = {\r\n id: \"520a7273452546879b3b85f62e8b9939\",\r\n secret: \"2d59e1d6dd5a40b3a291fe29a18aaa3c\"\r\n };\r\n\r\n let spotify = new spotify(spotifyID);\r\n\r\n spotify.search( {type: \"artist\", query: userFavorites,} ).then(function(response){\r\n console.log(response);\r\n });\r\n}", "async search(term) {\n const accessToken = this.accessToken || this.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n // GET method\n try {\n const response = await fetch(\n `https://api.spotify.com/v1/search?type=track&limit=50&q=${term}`,\n { headers: headers }\n );\n if (response.ok) {\n const jsonResponse = await response.json();\n if (jsonResponse && jsonResponse !== {}) {\n return jsonResponse.tracks.items.map(track => {\n return {\n id: track.id,\n name: track.name,\n artist: track.artists[0].name,\n album: track.album.name,\n uri: track.uri,\n preview: track.preview_url,\n };\n });\n }\n } else {\n throw new Error('Search Request Failed!');\n }\n } catch (err) {\n this.authFailed();\n console.log(err);\n }\n }", "function searchSpotify(query) {\n $.ajax({\n url: \"https://api.spotify.com/v1/search\" + \"?type=album,artist,track,playlist\" + \"&limit=8\" + \"&q=\" + query,\n type: \"GET\",\n dataType: \"json\",\n headers: {\n \"Authorization\": \"Bearer \" + accessToken\n },\n success: function success(result) {\n searchSpotifyResponse(result);\n },\n error: function error(_error) {\n alert(\"An error occured while searching.\");\n console.log(_error);\n }\n });\n} // Play a track", "function spotifyThis() {\n // console.log(searchQuery);\n if (!searchQuery) {\n searchQuery = \"The Sign by Ace of Base\"\n // console.log(searchQuery);\n }\n spotify.search({\n type: 'track',\n query: searchQuery\n }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n // console.log(JSON.stringify(data.tracks))\n console.log(\"Artist: \" + data.tracks.items[0].album.artists[0].name);\n console.log(\"Song Title: \" + data.tracks.items[0].name);\n console.log(\"Album Name: \" + data.tracks.items[0].album.name);\n console.log(\"Spotify Preview link: \" + data.tracks.items[0].preview_url);\n\n\n\n });\n}", "function getSpotify(b){\n\n // Test to see if Spotify works\n // console.log(\"Spotify works!\");\n\n // Paste the sample code from npm\n spotify.search({ type: 'track', query: b }, function(err, data) {\n\n if ( err ) {\n \n console.log('Error occurred: ' + err);\n \n return;\n \n }\n\n // console.log(\"The raw data: \" + JSON.stringify(data, null, 3));\n \n for(var i = 0; i < data.tracks.items.length; i++) {\n\n // Do something with 'data' \n console.log(\"=================================================================\");\n\n console.log(\"Potential Song Origin ~ \" + i);\n \n for(var j = 0; j < data.tracks.items[i].artists.length; j++) {\n\n console.log(\"Artist involved: \" + data.tracks.items[i].artists[j].name);\n \n }\n\n console.log(\"Album Name: \" + data.tracks.items[i].album.name);\n\n console.log(\"Song Name: \" + value);\n\n console.log(\"=================================================================\");\n\n console.log(\"\");\n\n console.log(\"\");\n\n }\n\n checkConfirm();\n \n });\n\n}", "function search() {\n var keyword = escape($('#search-keyword').val());\n var searchType = $(\"#search-type\").val();\n var apiPath = 'http://ws.spotify.com/search/1/' + searchType + '.json?q=' + keyword;\n\n $.getJSON(apiPath).then(function(results) {\n var html = '';\n\n for (var i=0; i < results[searchType + 's'].length; i++) {\n html += '<li>' + results[searchType + 's'][i].name + '</li>';\n }\n\n $(\"#results\").html(html);\n });\n}", "search(term) {\n const accessToken = Spotify.getAccessToken();\n const baseRequestUrl = 'https://api.spotify.com/v1/search?';\n const queryParams = `type=track&q=${term}`;\n const requestUrl = baseRequestUrl + queryParams;\n return fetch(requestUrl, {\n headers: {\n Authorization: `Bearer ${accessToken}`\n }\n })\n .then(response => response.json())\n .then(jsonData => {\n if (!jsonData.tracks) {\n return [];\n }\n return jsonData.tracks.items.map(track => ({\n id: track.id,\n name: track.name,\n artists: track.artists[0].name,\n album: track.album.name,\n uri: track.uri\n }))\n });\n }", "function spotSearch(song){\n\n if(!song){\n var daSong = \"The Sign\";\n } else{\n daSong = song\n }\n spotify.search({type: 'track', query: daSong, limit: \"1\"}, function(err, data){\n \n if(err){\n console.log(err);\n }\n \n let artist = data.tracks.items[0].album.artists[0].name;\n let songName = data.tracks.items[0].name;\n let album = data.tracks.items[0].album.name;\n let release = data.tracks.items[0].album.release_date;\n\n \n console.log(\"Artist: \" + artist);\n console.log(\"Album: \" + album);\n console.log(\"Release date: \" + release);\n console.log(\"Song name: \" + songName);\n\n\n });\n}", "function getSpotify(){\n\n\tlet searchTerm;\n\tif(userParameters === undefined){\n searchTerm = \"The Sign Ace of Base\";\n console.log(\"no search term was detected, searching for The Sign by Ace of Base\");\n\t}else{\n // if there are search terms, use the userParameter that was formatted by our for loop\n\t\tsearchTerm = userParameters;\n\t}\n\t//execute the spotify search using the searchTerm\n\tspot.search({type:'track', query:searchTerm}, function(error,data){\n\t if(error){\n\t console.log(`The call to Spotify encountered an error: ${error}`);\n\t return;\n\t }else{\n // if no error was encountered, print the return data: \n\t \t\tconsole.log(\"Artist Name: \" + data.tracks.items[0].artists[0].name);\n console.log(\"Song Name: \" + data.tracks.items[0].name);\n\n // check to see if the preview URL returned is null. Spotify returns null for preview URL \n // when you query a song that is not available to stream in your region. If it is null, return \n // some information to that effect. If it's not null, return the preview URL\n if (data.tracks.items[0].preview_url == null){\n console.log(\"Preview URL is not available - song is not available to stream in your region\")\n }\n else{\n console.log(\"Preview URL: \" + data.tracks.items[0].preview_url);\n };\n console.log(\"Album Name: \" + data.tracks.items[0].album.name);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW SONG SEARCH EVENT:\\nArtist Name: ${data.tracks.items[0].artists[0].name}\\nSong Name: ${data.tracks.items[0].name}\\nPreview URL: ${data.tracks.items[0].preview_url}\\nAlbum Name:${data.tracks.items[0].album.name}\\n------\\n`,function(err) {\n });\n\t }\n\t});\n}", "function spofityPlay() {\n spotify\n .search({ type: 'track', query: \"\\\" \" + input + \"\\\" \" })\n .then(function (data) {\n console.log(\n \"\\n ========== Spotify Search ==========\\n\"\n )\n\n // console.log(data);\n // The song's name\n // A preview link of the song from Spotify\n // The album that the song is from\n //Artist(s)\n // console.log(data.tracks.items[1])\n var song = data.tracks.items[1];\n console.log(\"Song Search: \" + song.album.name);\n console.log(\"Want a quick listen, click here: \" + song.external_urls.spotify)\n console.log(\"The Song is in Album: \" + song.album.name);\n console.log(\"Artist(s): \" + song.artists[0].name + \"\\n\");\n\n // ARTISTS VS ALBUM\n // ALBUM: given to us as an object allows us to call on it normally\n // ARISTS: looks like an object but its really an array with an object\n // nested inside (sneaky bitch.)\n // for the artist name you have to call the array FIRST then the object\n\n })\n .catch(function (err) {\n console.log('Error occurred: '+ err);\n \n\n });\n\n\n}", "function search(accessToken, term) {\n console.log(term);\n return $.ajax({\n url: 'https://api.spotify.com/v1/search',\n data: {\n q: term,\n type: 'track'\n },\n headers: {\n 'Authorization': 'Bearer ' + accessToken\n }\n });\n}", "function spotifyNow(){\n console.log(\"Now time for some music!\");\n\n var searchMusic;\n if(search === undefined){\n console.log(\"Please try again\"); //Cannot find user input\n }\n else{\n searchMusic = search; //Finds user input\n }\n\n spotify.search({type: \"track\", query: searchMusic}, function(err , data){\n if(err){\n console.log(\"Error occurred: \" + err);\n return;\n } else if (data.error) {\n console.log(\"Error occurred: \" + data);\n return;\n }\n\n else{\n console.dir(data);\n // console.log(\"Artist: \" + data.tracks.items[0].artists[0].name);\n // console.log(\"Song: \" + data.tracks.items[0].name);\n // console.log(\"Album: \" + data.tracks.items[0].album.name);\n // console.log(\"Preview here: \" + data.tracks.items[0].preview_url);\n }\n\n })\n\n}", "search(term) {\n const accessToken = Spotify.getAccessToken();\n //start promise chain be returning GET request using fetch()\n return fetch(`https://api.spotify.com/v1/search?type=track&q=${term}`,\n //pass 2nd argument to fetch and add authorization header to the request and pass in accessToken\n //in implicit grant flow request format\n {\n headers: {\n Authorization: `Bearer ${accessToken}`\n }\n }\n //convert the response to JSON\n ).then(response => {\n return response.json();\n }).then(jsonResponse => {\n //make sure that some tracks actually exist\n if (!jsonResponse.tracks) {\n return [];\n }\n // return a mapped array with a list of track objects to pass to states in App.js\n return jsonResponse.tracks.items.map(track => ({\n id: track.id,\n name: track.name,\n artist: track.artists[0].name,\n album: track.album.name,\n uri: track.uri\n }));\n });\n }", "function songLookup() {\n let song = indicator[3];\n //Check if Search Song is not empty\n if (song != undefined) {\n //Loop thru and build query for more than one word\n for (let i = 3; i < indicator.length; i++) {\n if (i > 3 && i < indicator.length) {\n song = song + \" \" + indicator[i];\n } else {\n song = indicator[3];\n }\n }\n //Give user song \"The Sign\" if left empty \n } else {\n console.log(\"You didn't enter a song. Here's your sign!\");\n song = \"Ace of base\", \"The Sign\";\n }\n\n spotify.search({ type: 'track', query: song, limit: 1 }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n //If no results are found\n if (data.tracks.total == 0) {\n console.log(\"Sorry, no results found!..Try another song\");\n }\n\n let TrackSearchResult = data.tracks.items\n for (let i = 0; i < TrackSearchResult.length; i++) {\n console.log(\"*************************************************\")\n console.log(\"Artist: \" + JSON.stringify(TrackSearchResult[i].artists[0].name));\n console.log(\"Song: \" + JSON.stringify(TrackSearchResult[i].name));\n console.log(\"Preview Link: \" + JSON.stringify(TrackSearchResult[i].preview_url));\n console.log(\"Album: \" + JSON.stringify(TrackSearchResult[i].album.name));\n console.log(\"*************************************************\")\n }\n });\n}", "function searchSong(songQuery) {\n console.log(\"searching song\");\n\n var keys = require(\"./keys.js\");\n //console.log(keys);\n\n var Spotify = require(\"node-spotify-api\");\n var spotify = new Spotify(keys.spotify);\n\n //searching for song with spotify api\n spotify.search({ type: 'track', query: songQuery }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n //console.log(data);\n\n var results = data.tracks.items;\n //console.log(results);\n\n //creating regular expression in order to improve search results\n var words = (songQuery.replace(/\"/g, \"\")).split(\" \");\n\n //setting up words for regular expression\n for (var i = 0; i < words.length; i++) {\n var word = words[i];\n\n var lower = word[0].toLowerCase();\n var upper = word[0].toUpperCase();\n\n words[i] = \"[\" + lower + upper + \"]\" + (word.substring(1)).toLowerCase();\n }\n\n //a regular expression that matches a title containing same substring of words. not case-sensitive\n var re = new RegExp(words.join(\" \"));\n //console.log(words.join(\" \"));\n\n //displaying search results\n for (var i = 0; i < results.length; i++) {\n var result = results[i];\n var artists = [];\n var song = result.name;\n var link = result.preview_url;\n var album = result.album.name;\n\n //console.log(result.artists);\n //console.log(re);\n\n //making sure song matches query reasonably\n if (re.test(song)) {\n //extracting artist names\n for (var j = 0; j < result.artists.length; j++) {\n artists.push(result.artists[j].name);\n }\n\n console.log(\"\\n\");\n console.log(\"Artist(s): \" + artists.join(\", \"));\n console.log(\"Song: \" + song);\n console.log(\"Preview: \" + link);\n console.log(\"Album: \" + album);\n }\n }\n });\n}", "function spotifythissong(name) {\n var spotify = require('node-spotify-api');\n var spotify = new spotify({\n id: keys.spotify.id,\n secret: keys.spotify.secret\n });\n\n spotify.search({ type: 'track', query: 'All the small things', artists: \"artist\" }, function (err, data) {\n if (err) {\n\n return console.log('there is an error' + err);\n }\n console.log(data.tracks.items[0]);\n\n\n });//End of the spotify function\n}", "function spotify(){\n\n\tvar spotify = require('spotify');\n\n\tvar nodeArgs = process.argv;\n\n\tvar songName = \"\";\n\n\tfor (var i=3; i<nodeArgs.length; i++){\n\n\tif (i>3 && i < nodeArgs.length){\n\n\t\tsongName = songName + \" \" + nodeArgs[i];\n\t}\n\n\telse{\n\n\t\tsongName = songName + nodeArgs[i];\n\t}\n\t\n}\n\n\tspotify.search({ type: 'track', query: songName }, function(err, data) {\n \t\n \tif ( err ) {\n console.log('Error occurred: ' + err);\n return;\n \t}else {\n \t\t//console.log(JSON.stringify(data, null, 2));\n \t\tconsole.log( \"Artist: \")\n \t\tconsole.log( data.tracks.items[0].artists[0].name);\n \t\tconsole.log( \"URL: \")\n \t\tconsole.log( data.tracks.items[0].artists[0].uri);\n \t}\n\t});\n}", "function showSpotifySong() {\n\n //variable for search term, test if defined.\n\n\n var searchTrack;\n\n if (secondCommand === undefined) {\n\n searchTrack = \"The Sign\";\n\n } else {\n\n searchTrack = secondCommand;\n\n }\n\n //launch spotify search\n\n spotify.search({ type: 'track', query: searchTrack }, function(err, data) {\n\n if (err) {\n\n console.log('Error occurred: ' + err);\n\n return;\n\n } else {\n\n\n console.log(\"Artist: \" + data.tracks.items[0].artists[0].name);\n\n console.log(\"Song: \" + data.tracks.items[0].name);\n\n console.log(\"Album: \" + data.tracks.items[0].album.name);\n\n\n\n }\n\n });\n\n}", "function mySpotify(functionParameters) {\n\tvar spotify = new Spotify({\n \t\tid: \"0888876dd4e746b69a275d3c58cd021c\",\n \t\tsecret: \"4afc6e98cbf6417996aa4beb038144c3\"\n});\n \tif(functionParameters < 1) {\n \t\tfunctionParameters = \"The Sign Ace of Base\";\n \t}\nspotify.search({ type: 'track', query: functionParameters }, function(err, data) {\n if (err) {\n \tconsole.log('Error occurred: ' + err);\n return;\n } else {\n \tvar songData = data.tracks.items[0];\n \tvar songResult = console.log(songData.artists[0].name)\n \t\tconsole.log(songData.name)\n \t\tconsole.log(songData.preview_url)\n \t\tconsole.log(songData.album.name)\n \t}\n \n// console.log(data); \n});\n}", "function spotifyThisSong(){\n\n var spotify = new spotify({\n \tid: keys.spotify.id,\n \tsecret: keys.spotify.secret\n });\n\n\tvar searchSong;\n\tif(userInput2 === undefined){\n\t\tsearchSong = \"What's My Age Again?\";\n\t}else{\n\t\tsearchSong = userInput2;\n\t}\n\n\tspotify.search({type:'track', query:searchSong}, function(err,data){\n\t if(err){\n\t console.log('Error: ' + err);\n\t return;\n\t }else{\n\t \n\t \t\tconsole.log(\"Artist: \" + data.tracks.items[0].artists[0].name);\n\t console.log(\"Song: \" + data.tracks.items[0].name);\n\t console.log(\"Album: \" + data.tracks.items[0].album.name);\n\t console.log(\"Preview: \" + data.tracks.items[0].preview_url);\n\t }\n\t});\n}", "function spot() {\n\tvar Spotify = require('node-spotify-api');\n\n\tvar spotify = new Spotify(keys.spotifyKeys);\n\n\tif (process.argv[3] === undefined) {\n\t\tprocess.argv[3] = 'The Sign Ace of Base'\n\t};\n\n\tspotify.search({ type: 'track', query: process.argv[3] }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n\tvar artistName = data.tracks.items[0].artists[0].name;\n\tvar songName = data.tracks.items[0].name;\n\tvar link = data.tracks.items[0].href;\n\tvar album = data.tracks.items[0].album.name;\n\t \n\tconsole.log(\"Artist Name:\", artistName); \n\tconsole.log(\"Song Name:\", songName);\n\tconsole.log(\"Song Link:\", link);\n\tconsole.log(\"Album Name:\", album);\n});\n\n}", "searchIt(term) {\n const accessToken = Spotify.getAccessToken();\n return fetch(`${spotifyURIBase}search?type=track&q=${term}`, { // retrival of the info for the term supplied.\n headers: {\n Authorization: `Bearer ${accessToken}`\n }\n }\n ).then(response => { return response.json(); }\n ).then(jsonResponse => { // parsing of the retreived data into json objects.\n if (!jsonResponse.tracks) {\n return [];\n }\n/* picking of the json data and assigning to track object. */\n return jsonResponse.tracks.items.map(track => ({\n id: track.id,\n name: track.name,\n length: track.duration_ms,\n image: track.album.images[2],\n artist: track.artists[0].name,\n album: track.album.name,\n uri: track.uri\n }));\n });\n }", "function spotifySong(input) {\n\n var songTitle;\n if (input === undefined) {\n songTitle = \"The Sign - Ace of Base\";\n } else {\n songTitle = input;\n }\n\n spotify.search({\n type: 'track',\n query: songTitle\n }, function (error, data) {\n if (error) {\n logged('Error occurred: ' + error);\n return;\n } else {\n logged(\"\\n---------\\n\");\n logged(\"Artist: \" + data.tracks.items[0].artists[0].name);\n logged(\"Song: \" + data.tracks.items[0].name);\n logged(\"Preview: \" + data.tracks.items[3].preview_url);\n logged(\"Album: \" + data.tracks.items[0].album.name);\n logged(\"\\n---------\\n\");\n }\n });\n}", "async search(term) {\n const accessToken = this.getAccessToken();\n let response = await fetch(\n `https://api.spotify.com/v1/search?type=track&q=${term || ''}`,\n {\n headers: { 'Authorization': `Bearer ${accessToken}` }\n }\n );\n\n let json;\n try {\n json = await response.json();\n } catch(e) {\n return Promise.reject(e);\n }\n\n if (json && json['tracks'] && json['tracks']['items']) {\n return Promise.all(\n json.tracks.items.map(track => {\n return new Track(\n track.name,\n track.artists[0].name,\n track.album.name,\n track.id,\n track.uri\n );\n })\n );\n } else {\n return Promise.resolve([]);\n }\n }", "function spotifySong(){\n var songTitle =\"\"; \n if (userInput[3] === undefined){\n songTitle = \"The Sign Ace of Base\"\n } else {\n songTitle = userInput[3];\n }; \n spotify.search({type:'track', query:songTitle, limit:1},\nfunction (err,data){\n \n if(err){\n console.log(\"Oops. Something unexpected happened\" + err);\n return false;\n }\n console.log(\"\\n====== Spotify: '\" + songTitle + \"' ==========\");\n console.log(\"Artist(s): \"+ data.tracks.items[0].album.artists[0].name);\n console.log(\"Song: \"+data.tracks.items[0].name);\n console.log(\"Preview URL: \"+data.tracks.items[0].preview_url);\n console.log(\"Album: \"+data.tracks.items[0].album.name);\n console.log(\"\\n\" );\n })\n }", "searchSpotify () {\n spotifyApi.searchTracks(this.state.queryTerm)\n .then((response) => {\n this.setState({\n results: response.tracks.items\n })\n });\n }", "function lookupSpecificSong() {\n\n//sets spotify equal to the key info to call the spotify API\nvar spotify = new Spotify(SpotifyKeys.spotify);\n\n//searches the spotify API by track name \nspotify\n .request( 'https://api.spotify.com/v1/tracks/3DYVWvPh3kGwPasp7yjahc' )\n .then(function(response) {\n //Console.logs the response from the Spotify API for Artist, Song title, URL, and Album name\n logOutput(\"Command: spotify-this-song \" + response.name);\n logOutput(\"Artist: \" + response.artists[0].name);\n logOutput(\"Song: \" + response.name);\n logOutput(\"Spotify preview URL: \" + response.preview_url);\n logOutput(\"Album name: \" + response.album.name);\n logOutput(\"------------\");\n })\n .catch(function(err) {\n //console.logs any caught errors\n console.log(err);\n logOutput(err);\n });\n}", "function searchSpotifyPlaylist(playlistID, message) {\n spotifyApi.getPlaylist(playlistID)\n .then(function (data) {\n data.body.tracks.items.forEach((track) => {\n var title = track.track.artists[0].name + \" - \" + track.track.name;\n //console.log(title);\n titles.push(title);\n })\n sendPlaylistEmbed(message);\n searching = true;\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "function spotifyThisSong() {\n var songName = \"\";\n\n //move over all of the entered words to \n for (var i = 3; i < input.length; i++) {\n if (i > 3 && i < input.length) {\n songName = songName + \"+\" + input[i];\n } else {\n songName += input[i];\n }\n }\n if (songName === \"\") {\n songName = \"The Sign Ace of Base\";\n }\n\n // console.log(keys.spotify);\n spotify.search({ type: 'track', query: songName }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n // console.log(data);\n var track = data.tracks.items[0];\n console.log(\"Song Name: \" + track.artists[0].name);\n console.log(\"Song Name: \" + track.name);\n console.log(\"External Link: \" + track.external_urls.spotify);\n console.log(\"Album Name: \" + track.album.name);\n });\n}", "function spotifySong(){\n if(!title){\n title = \"The Sign\"\n }\n spotify.search({type: 'track', query: title, limit: 10}, function(err, data){\n if(err){\n return console.log(err);\n }\n for(var i = 0; i < data.tracks.items.length; i++){\n console.log(\"Artist(s): \" + data.tracks.items[i].album.artists[0].name);\n console.log(\"The song name: \" + data.tracks.items[i].name);\n console.log(\"The preview link from Spotify: \" + data.tracks.items[i].album.external_urls.spotify);\n console.log(\"The album that the song is from: \" + data.tracks.items[i].album.name);\n console.log(\"-----------------------------------------\\n\")\n }\n });\n}", "function spotifyThisSong() {\n let song = \"The Sign Ace of Base\";\n if (searchTerm) {\n song = searchTerm;\n }\n spotify.request('https://api.spotify.com/v1/search?q=track:' + song + '&type=track&limit=10', function (error, response) {\n for (i = 0; i < 3; i++) {\n if (error) {\n return console.log(error);\n }\n console.log(\"\\nArtist: \" + response.tracks.items[i].artists[0].name + \"\\nSong: \" + response.tracks.items[i].name + \"\\nPreview: \" + response.tracks.items[i].preview_url + \"\\nAlbum: \" + response.tracks.items[i].album.name);\n };\n });\n}", "function searchSpotify() {\n\n var songTitle = \"\"; // var to be set by user input and submitted to the search method\n\n var spotify = new Spotify(keys.spotify); //new instance of Spotify via constructor functionality included in the node-spotify-api package\n \n // if-else setup to use a default song if nothing is input after the song-this command\n if (input[1] === undefined) {\n songTitle = \"The Sign Ace\"; //viable string for returning \"The Sign\" by Ace Of Base\n } else {\n songTitle = input.slice(1).join(' '); //otherwise the title will be built by joining the rest of the inputs into a string with each item separated by a space\n }\n \n spotify\n .search({ type: 'track', query: songTitle})\n .then(function(response) {\n\n if (response.tracks.items[0] === undefined) \n {\n console.log(songBumpers);\n console.log(\"\\n\" + beginBold + songTitle + endBold + \"? Sorry, I don't know that song! Maybe if I heard it....\"); \n console.log(songBumpers); \n return;\n } \n else \n {\n console.log(songBumpers);\n console.log(beginBold + \"Song title: \" + endBold + response.tracks.items[0].name);\n console.log(beginBold + \"Artist: \" + endBold + response.tracks.items[0].album.artists[0].name);\n console.log(beginBold + \"Album: \" + endBold + response.tracks.items[0].album.name);\n console.log(beginBold + \"Listen on Spotify at: \" + endBold + \"https://open.spotify.com/track/\" + response.tracks.items[0].uri.substring(14,36)); //substring method used to target specific 22-char id part of link-object, which is concat'd into a URL the user can copy/paste into a browser\n console.log(songBumpers);\n\n logFile(\"\\nSpotify search returned: \" + response.tracks.items[0].name + \", \" + response.tracks.items[0].album.artists[0].name);\n }\n })\n}", "function searchSpotify (trackName, itemNum) {\n\n\tspotify.search({ type: 'track', query: trackName }, function(err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Error occurred: ' + err);\n\t\treturn;\n\t\t}\n\n\t// extract the desired song details from the spotify json object\n\n\t\tconsole.log(\"\\nMy Song:\");\n\t\tconsole.log(\"\\nArtist Name: \" + data.tracks.items[itemNum].album.artists[0].name);\n\t \tconsole.log(\"Song Name: \" + data.tracks.items[itemNum].name);\n\t \tconsole.log(\"Preview URL: \" + data.tracks.items[itemNum].preview_url);\n\t \tconsole.log(\"Album Name: \" + data.tracks.items[itemNum].album.name);\n\n\t }); // end function to search Spotify\n\n} // function to search OMDB using the request package", "function searchMusic(name){\n if(!name){\n name = \"The sigin\";\n }\n spotify.search({ type: 'track', query: name }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n for (var i = 0; i < 5; i++) {\n console.log(\"Artist Name: \"+data.tracks.items[i].artist[0].name); \n console.log(\"Song name: \"+data.tracks.items[i].name);\n console.log(\"Link: \"+data.tracks.items[i].album.name);\n console.log(\"Album\"+data.tracks.items[i].preview_url);\n console.log(\"-------------------------------------\");\n }\n });\n}", "function spotify_this(){\n // console.log(\"spotify_this works\")\n //make sure keys are accessible\n // console.log(spotify)\n\n //spotify search track\n spotify.search({ \n type: 'track', \n query: `${input}` }, \n function(err, data) {\n \n if (err) {\n return console.log('Error occurred: ' + err);\n }\n // console.log(data.tracks.items[0]); \n console.log(\"__________________________\")\n console.log(`Artist Name: ${data.tracks.items[0].artists[0].name}`);\n console.log(`Track Name: ${data.tracks.items[0].name}`);\n console.log(`Preview URL: ${data.tracks.items[0].preview_url}`);\n console.log(`Album Title: ${data.tracks.items[0].album.name}`)\n console.log(\"__________________________\")\n });\n}", "function spotify(){\n //Spotifiy API keys\n var spot = keys.spotifyKeys;\n //Argument for song query\n var song = process.argv[3];\n //Spotify Node Construct\n var spotify = require('spotify');\n\n //Spotify search NPM\n spotify.search({type:'track', query: song}, function(err, data){\n if(!error){\n var artist = data.tracks.items[0].artists[0].name;\n var title = data.tracks.items[0].name;\n var album = data.tracks.items[0].album.name;\n console.log(' ');\n console.log('================ Spotify This ================');\n console.log(\"Artist: \" + artist);\n console.log(\"Song: \" + title);\n console.log(\"Album: \" + album);\n console.log('===========================================');\n console.log(' ');\n }else{console.log(\"Spotify Error or No Track Found\")}\n })\n}", "function spotifyThis(option1) {\n if (typeof option1 === \"undefined\") {\n option1 = \"The Sign\"\n }\n querySong = option1.split(\" \").join(\"+\");\n\n spotify.search({ type: 'track', query: querySong })\n .then(function(response) {\n tracks = response[\"tracks\"];\n\n tracks.items.forEach(song => {\n\n if (song.type === \"track\" && song.name.toLowerCase() === option1.toLowerCase()) {\n\n console.log();\n // The song's name \n console.log(\"Song: \" + song.name);\n // The album that the song is from\n console.log(\"Album: \" + song.album.name);\n // A preview link of the song from Spotify\n console.log(\"Preview: \" + song.preview_url);\n\n // Artist(s)\n console.log(\"Artist(s)\");\n song.artists.forEach(artist => {\n console.log(\" \" + artist.name);\n })\n }\n\n })\n\n })\n .catch(function(err) {\n console.log(err);\n });\n\n}", "search(term){\n // fetch a token from Spotify and perform the track search\n Spotify.getAccessToken();\n Spotify.search(term).then(searchResults =>{\n\n // update the state with the searchResults\n this.setState({ SearchResults:searchResults });\n });\n\n }", "function mySpotify() {\n console.log(\"Here's The Song Info!\")\n\n\n var searchTrack = '';\n\n var spotify = new Spotify({\n id: 'c4f36b57f5e74a6b858c77acfaf184e5',\n secret: '81b5017ea23848bd85953b8ab0f8e612'\n })\n // if the secondCommand input is not recognized, will automatically search \"The Sign\"\n console.log(spotify);\n if (secondCommand === undefined) {\n searchTrack = \"The Sign\";\n } else {\n searchTrack = secondCommand;\n }\n // searches spotify for requested song\n spotify.search({ type: 'track', query: searchTrack }, function(err, data) {\n if (err) {\n return console.log(\"Error Occurred: \" + err);\n } else {\n\n \t// Dot chain within the object to retrive the desired information\n // console.log(data.tracks.items[0].url);\n console.log(\"Artist: \" + data.tracks.items[0].artists[0].name);\n console.log(\"Song: \" + data.tracks.items[0].name);\n console.log(\"Preview: \" + data.tracks.items[0].preview_url);\n console.log(\"Album: \" + data.tracks.items[0].album.name);\n }\n });\n\n //end of mySpotify\t\n}", "function searchRecommendations(searchVal) {\n if (searchVal !== \"\") {\n let resultArray = [];\n if (props.title === \"Song\")\n {\n const testParams = {\n limit: 5\n }\n props.spotify.search(searchVal, [\"track\"], testParams)\n .then((response) => {\n console.log(response)\n response.tracks.items.map((item, index) => {\n resultArray.push(item.name + \" By: \" + item.artists[0].name + \";\" + item.id + \";\" + (item.album.images.length > 0 ? item.album.images[0].url : \"\"))\n })\n props.setRecs(resultArray)\n })\n }\n else if (props.title === \"Artist\")\n {\n const testParams = {\n limit: 5\n }\n props.spotify.search(searchVal, [\"artist\"], testParams)\n .then((response) => {\n console.log(response)\n response.artists.items.map((item, index) => {\n resultArray.push(item.name + ';' + item.id + ';' + (item.images.length > 0 ? item.images[0].url : \"\"))\n })\n props.setRecs(resultArray)\n })\n }\n else if (props.title === \"Genre\")\n {\n props.spotify.getAvailableGenreSeeds()\n .then((response) => {\n let genres = response.genres.filter((genre) => genre.includes(searchVal))\n if (genres.length > 5) {\n props.setRecs(genres.slice(0, 5))\n }\n else props.setRecs(genres)\n })\n }\n }\n }", "function spotifySong(){\n\tspotify.search({type: 'track', query: term}, function(err, data) {\n\t if (err) {\n\t console.log('Error occurred: ' + err);\n\t return;\n\t } else{\n\t \tvar results = data.tracks;\n\t \tfor (var i = 0; i < 20; i++) {\n\t \t\tconsole.log(\" \");\n\t \t\tconsole.log(\"Song Title: \" + results.items[i].name +\n\t \t\t\t\"\\nArtist: \" + results.items[i].artists[0].name + \"\\nPreview: \" + \n\t \t\t\tresults.items[i].preview_url + \"\\nAlbum Name: \" \n\t \t\t\t+ results.items[i].album.name + \n\t \t\t\t\"\\n-------------------------------------------------------------------------------------------------------\");\n\t \t}\n\t }\n\t});\n\tfs.appendFile(\"log.txt\", \" (%) Find song: \" + term);\n}", "async function spotifySearch (query = '', offset, limit) {\n const apiUrl = `https://api.spotify.com/v1/search?type=track&limit=${limit}&offset=${offset}&q=${encodeURIComponent(query)}`\n const response = await fetch(apiUrl)\n const { tracks } = await response.json()\n return tracks.items\n}", "function spotifyAPI(parsedInput) {\n var spotify = new Spotify(keys.spotifyKeys);\n\n if (!parsedInput.length) { // Define a default search if the user does not enter a track title\n parsedInput = '\"The sign\"';\n }\n else {\n parsedInput = '\"' + parsedInput + '\"'; // Add double quotes per spotify API docs to search keywords in the specific order entered by user\n }\n\n spotify.search({ type: 'track', query: parsedInput, market: \"from_token\", limit: \"1\" }, function(error, data) {\n var dataShort = data.tracks.items[0]; // Stores common path into JSON response\n\n if (error) {\n console.log('Error occurred:\\n' + error);\n }\n else if (data.tracks.total === 0) {\n console.log('No Song Found!\\n');\n }\n else {\n console.log('Top Result for: ' + parsedInput + '\\n');\n console.log(\n 'Artist: ' + dataShort.artists[0].name +\n '\\nSong Name: ' + dataShort.name +\n '\\nPreview: ' + dataShort.preview_url +\n '\\nAlbum: ' + dataShort.album.name + '\\n'\n );\n }\n });\n}", "function spotifyThisSong() {\n const spotify = new Spotify(keys.spotify);\n if (!userInput) {\n userInput = 'The Sign, Ace of Base';\n spotifyThisSong();\n }\n else {\n spotify.search({ type: 'track', query: userInput })\n .then(function (songResponse) {\n console.group('Song Name: ' + songResponse.tracks.items[0].name);\n console.log('Artist Name: ' + songResponse.tracks.items[0].artists[0].name)\n console.log('Album Name: ' + songResponse.tracks.items[0].album.name);\n console.log('Preview Link: ' + songResponse.tracks.items[0].artists[0].external_urls.spotify)\n });\n };\n}", "function spotifySongSearch(songTitle){\n // Replace any spaces with a plus sign for query\n songTitle = songTitle.trim().replace(/ /g, \"+\");\n\n // Run an initial search to identify the song's (track) unique Spotify ID\n var queryURL1 = \"https://api.spotify.com/v1/search?q=\" + songTitle + \"&type=track\";\n\n $.ajax({url: queryURL1, method: 'GET'}).done(function(songResponse) {\n\n // Globally store the Song Search Response\n spotifySongResult = songResponse;\n });\n }", "function getSpotify(song='The Sign', artist='Ace of Base') {\n\t// console.log(\"Spotify function ran\");\n\t// console.log(\"spotifyClient: \", spotifyClient);\n\n\tspotifyClient.search({type: 'track', query: song, artist: artist, limit: 1})\n\t\t.then(function(data) {\n\t\t\tvar firstItem=data.tracks.items[0];\n\t\t console.log(\"\\n\\n\" + \"SPOTIFY SONG RESULTS\".black.bgMagenta);\t\t\t\n\t\t\t// console.log (JSON.stringify(firstItem, null, 2));\n\t\t\tconsole.log(`Artist ${firstItem.album.artists[0].name.underline} | Song name ${firstItem.name} | Album name is ${firstItem.album.name}`);\n\t\t\tconsole.log(`Preview url ${firstItem.preview_url}`.white);\n\n\t\t}, function(err) {\n\t\t\tconsole.log('Sorry, I had a problem. ', err);\n\t\t});\n}", "function spotifyThisSong() {\n var spotify = new Spotify(keys.spotify);\n // If no track is entered, it will default to 'The Sign' by Ace of Base\n if (!liriSearchTerm) {\n var songTitle = \"The Sign, Ace of Base\";\n }\n else {\n var songTitle = liriSearchTerm;\n }\n // search: function({ type: 'artist OR album OR track', query: 'My search query', limit: 20 }, callback);\n spotify.search({ type: 'track', query: songTitle }, function (err, response) {\n // Create a variable to store the first song in the response\n var spotifyData = response.tracks.items[0];\n // console.log (spotifyData);\n\n // Create an array to store the information about the song, that will be written to the log.txt\n var spotifyData = [\n \"Artist: \" + spotifyData.artists[0].name,\n \"Song Link: \" + spotifyData.name,\n \"Song Preview: \" + spotifyData.preview_url,\n \"Album: \" + spotifyData.album.name,\n ].join(\"\\n\");\n\n // Write the data from the response to the terminal window\n console.log(spotifyData);\n // Write the data to log.txt\n updateLogFile(spotifyData);\n })\n}", "function spotifyThisSong(value) {\n if (value == null) {\n value = \"The Sign\";\n }\n spotify.search({\n type: 'track',\n query: value\n }, function (err, data) {\n if (err) {\n return outputAndLog('Error occurred: ' + err);\n }\n var artist = data.tracks.items[0].album.artists[0].name;\n outputAndLog(\"Artist: \" + artist);\n var song = data.tracks.items[0].name;\n outputAndLog(\"Song: \" + song);\n var link = data.tracks.items[0].external_urls.spotify;\n outputAndLog(\"Link: \" + link);\n var album = data.tracks.items[0].album.name;\n outputAndLog(\"Album: \" + album);\n\n });\n\n}", "function search(searchTerm) {\n\tSC.get('/tracks', { q: searchTerm}, function(tracks) {\n\t\tdisplay(tracks);\n\t});\n}", "function runSpotify(songTitle) {\n //check for user input\n if (songTitle === null || typeof songTitle === 'undefined' || songTitle === undefined) {\n songTitle = \"The+Sign\";\n }\n\n console.log(\"spotify this \" + songTitle);\n console.log(\"==========================\");\n\n spotify.search({ type: 'track', query: songTitle }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n for (i = 0; i < data.tracks.items.length; i++) {\n console.log(\"---------------------------------------------\")\n console.log(data.tracks.items[i].album.artists[0].name);\n console.log(data.tracks.items[i].album.name);\n console.log(data.tracks.items[i].external_urls.spotify);\n };\n });\n}", "function spotifyThisSong(){\n var songArg = process.argv;\n input = input+\"+\";\n if(input===undefined){\n artist = \"The Sign\"\n } else {\n for(var i=4; i < songArg.length; i++){\n input += songArg[i]+\"+\";\n }\n } \n\n spotify.search({ type: 'track', query: input, limit:1 }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n console.log(input);\n var quick = data.tracks.items;\n console.log(\"Artist: \"+quick[0].artists[0].name)\n console.log(\"Song Name: \"+quick[0].name);\n console.log(\"Check out a Preview: \"+JSON.stringify(quick[0].external_urls));\n console.log(\"Album: \"+quick[0].album.name); \n }\n );\n }", "function callSpotify() {\n //Requires the .env file where the API Key and Secret are hidden.\n require(\"dotenv\").config();\n //Requires Loads Spotify API module and Spotify API Key.\n var keys = require(\"./keys.js\");\n var Spotify = require('node-spotify-api');\n var spotify = new Spotify(keys.spotify);\n var spotifyNodeArgs = process.argv;\n var songTitle = \"\";\n //If the user does not enter a search term it will search for \"The Sign\" by Ace of Bass as default.\n if (spotifyNodeArgs.length === 3){\n songTitle = \"The Sign US Remastered\";\n };\n //For Loop that checks the entire process.argv for the users term and combines the terms into \"songTitle\" variable.\n for (var i = 3; i < spotifyNodeArgs.length; i++) {\n if (i > 3 && i < spotifyNodeArgs.length) {\n songTitle = songTitle + \"+\" + spotifyNodeArgs[i];\n }\n else {\n songTitle += spotifyNodeArgs[i];\n }\n };\n //Spotify API call. Uses the \"songTitle\" variable to search for a song. The Artist, song, album, and a preview are logged to the terminal.\n spotify.search({ type: 'track', query: songTitle }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n console.log(\"\\nArtist: \" + data.tracks.items[0].album.artists[0].name, \"\\nSong: \" + data.tracks.items[0].name, \"\\nPreview: \" + data.tracks.items[0].preview_url, \"\\nAlbum: \" + data.tracks.items[0].album.name);\n });\n}", "function findSong(term, response) {\r\n if (!term) {\r\n term = 'The Sign';\r\n }\r\n // console.log(term);\r\n spotify.search({ type: 'track', query: term })\r\n .then(function (response) {\r\n\r\n // console.log(\"B: \" + JSON.stringify(response));\r\n\r\n // Print info to consolelog\r\n //console.log(JSON.stringify(response));\r\n console.log(\"\\n*************SONG INFO**************\\n\");\r\n // Append in log.txt file\r\n fs.appendFileSync(\"log.txt\", \"***************SONG INFO*****************\\n\");\r\n console.log(\"Artist(s): \" + JSON.stringify(response.tracks.items[0].album.artists[0].name));\r\n fs.appendFileSync(\"log.txt\", \"Artist(s): \" + JSON.stringify(response.tracks.items[0].artists[0].name) + \"\\n\");\r\n console.log(\"Song Name: \" + JSON.stringify(response.tracks.items[0].name));\r\n fs.appendFileSync(\"log.txt\", \"Song Name: \" + JSON.stringify(response.tracks.items[0].name) + \"\\n\");\r\n console.log(\"Preview URL: \" + JSON.stringify(response.tracks.items[0].preview_url));\r\n fs.appendFileSync(\"log.txt\", \"Preview URL: \" + (JSON.stringify(response.tracks.items[0].preview_url)) + \"\\n\");\r\n console.log(\"Album: \" + JSON.stringify(response.tracks.items[0].album.name));\r\n fs.appendFileSync(\"log.txt\", \"Album: \" + (JSON.stringify(response.tracks.items[0].album.name)) + \"\\n\");\r\n console.log(divider);\r\n fs.appendFileSync(\"log.txt\", \"-----------------------------------------\\n\");\r\n })\r\n .catch(function (err) {\r\n console.log(err);\r\n });\r\n\r\n //Append songData and the divider to log.txt, print songData to the console\r\n fs.appendFile(\"log.txt\", response + divider, function (err) {\r\n if (err) throw err;\r\n });\r\n}", "function runSpotify(query) {\n spotify.search({\n type: 'track',\n query: query,\n }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n // loging resuts\n console.log(\"Artist: \", data.tracks.items[0].album.artists[0].name);\n console.log(\"Song Name: \", data.tracks.items[0].name);\n console.log(\"link to song: \", data.tracks.items[0].preview_url)\n console.log(\"This song is from: \", data.tracks.items[0].album.name)\n\n // end spotify\n });\n}", "function spotifyThisSong() {\n\n\tvar spotifyInput = process.argv[3];\n\n\t// If there is no input provided by the user,\n\tif (spotifyInput === undefined) {\n\n\t\t// Return information for \"The Sign\" by Ace of Base! :)\n\t\t// Got specific song reference, as searching for \"The Sign\" gave way different results than the \n\t\t// song asked for\n\t\tspotify.lookup({type: \"track\", id: \"3DYVWvPh3kGwPasp7yjahc\"}, function(err, data) {\n\n\t\t\t// If there's an error..\n\t\t\tif (err) {\n\t\t\t\tconsole.log('Error occurred: ' + err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If no error..\n\t\t\telse {\n\n\t \t\t\t// Console log header\n\t \t\t\tconsole.log(\"--------------------------------------------------------------------\");\n\n\t\t\t\t// Artist(s) Name\n\t\t \t\tconsole.log(\"Artist(s) Name(s): \" + data.album.artists[0].name);\n\n\t\t\t\t// Song Name\n\t\t\t\tconsole.log(\"Song Name: \" + data.name);\n\n\t\t\t\t// Preview Link to the song on Spotify\n\t\t\t\tconsole.log(\"Preview Link: \" + data.preview_url);\n\n\t\t\t\t// Album Name\n\t\t\t\tconsole.log(\"Album Name: \" + data.album.name);\n\n\t\t\t\t// Console log footer\n\t\t\t\tconsole.log(\"--------------------------------------------------------------------\");\n\n\t \t\t}\n\t\t});\n\t}\n\n\t// If Spotify input is defined/has a value\n\telse if (spotifyInput !== undefined) {\n\n\t// Search for a track with input search term\n\tspotify.search({type: \"track\", query: spotifyInput}, function(err, data) {\n\n\t\t// If there's an error..\n\t if (err) {\n\t console.log('Error occurred: ' + err);\n\t return;\n\t }\n\n\t // If no error..\n\t \telse {\n\n\t\t\t// Console log header\n\t\t\tconsole.log(\"----- Top 3 Results ---------------------------------------------------------------\");\n\n\t \t\t// Display top three song results\n\t \t\tfor (var i = 0; i < 3; i++) {\n\n\t \t\t\t// Create/empty blank array\n\t\t\t\tvar multArtists = [];\n\n\t\t\t\t\t// Display all artists for track (some have one, some have multiple)\n\t\t \t\t\tfor (var j = 0; j < data.tracks.items[j].artists.length; j++) {\n\n\t\t \t\t\t\t// Push all artists on track to blank array\n\t\t \t\t\t\tmultArtists.push(data.tracks.items[i].artists[j].name);\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t// Artist(s) Name(s)\n\t\t\t\tconsole.log(\"Artist(s) Name(s): \" + multArtists.join(\", \"));\n\n\t\t\t\t// Song Name\n\t\t\t\tconsole.log(\"Song Name: \" + data.tracks.items[i].name);\n\n\t\t\t\t// Preview Link to the song on Spotify\n\t\t\t\tconsole.log(\"Preview Link: \" + data.tracks.items[i].preview_url);\n\n\t\t\t\t// Album Name\n\t\t\t\tconsole.log(\"Album Name: \" + data.tracks.items[i].album.name);\n\n\t\t\t\t// Line break between songs\n\t\t\t\tconsole.log(\"-----\");\n\n\t\t\t}\n\n\t\t\t// Console log footer\n\t\t\tconsole.log(\"--------------------------------------------------------------------\");\n\t \t}\n\t});\n\t}\n}", "function spotifyIt(song) {\n // set up new spotify object for node-spotify-api\n var spotify = new Spotify({\n id: keys.spotify.id,\n secret: keys.spotify.secret\n });\n\n // search spotify using the api\n spotify.search({ type: 'track', query: song }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n } else if (data.tracks.items[0] != undefined) {\n // console loge out the results from the first item in the array\n console.log(`Artist: ${data.tracks.items[0].artists[0].name}`);\n console.log(`Title: ${data.tracks.items[0].name}`);\n console.log(`Album: ${data.tracks.items[0].album.name}`);\n console.log(`Preview: ${data.tracks.items[0].preview_url}`);\n } else {\n console.log(`Track: '${song}' not found`)\n\n }\n });\n}", "function songIt(song) {\n //sets up the key\n var spotify = new Spotify(keys.spotify);\n //if there is are other arguments in the terminal line, it searches for that given string\n if (song != \"\") {\n spotify.search({ type: 'track', query: song }, function (error, data) {\n if (!error) {\n console.log(divider);\n //prints artist, song name, preview url, and album name\n for (var i = 0; i < data.tracks.items.length; i++) {\n var songData = data.tracks.items[i];\n console.log(\"Artist: \" + songData.artists[0].name + \"\\nSong: \" + songData.name + \"\\nURL: \" + songData.preview_url + \"\\nAlbum: \" + songData.album.name);\n console.log(divider);\n }\n }\n else {\n console.log(\"You have issues.\");\n }\n });\n }\n //default to given song\n else {\n var special = { type: 'track', id: '3DYVWvPh3kGwPasp7yjahc' };\n spotify.lookup(special, function (error, data) {\n if (!error) {\n console.log(divider);\n for (var i = 0; i < data.tracks.items.length; i++) {\n var songData = data.tracks.items[i];\n console.log(\"Artist: \" + songData.artists[0].name + \"\\nSong: \" + songData.name + \"\\nURL: \" + songData.preview_url + \"\\nAlbum: \" + songData.album.name);\n console.log(divider);\n }\n }\n else {\n console.log(\"You have issues.\");\n }\n });\n }\n}", "async function spotifyThisSong(searchFor) {\n\n // console.log(\"Inside spotifyThisSong()\");\n\n //Store artist name taken from file\n let artist = searchFor;\n\n //If 'artist' is null then prompt user for artist/song name\n if (artist === \"\") {\n\n // Prompt to get artist name from user input\n const artistOrBandNameResp = await getArtistName();\n\n //Extract artist/band name from user input\n artist = artistOrBandNameResp.artistOrBandName;\n }\n\n //Spotify API call\n spotify\n .search({\n type: 'track',\n query: artist,\n limit: 10\n })\n .then(function (response) {\n\n // console.log(\"response.tracks.items.length: \" + response.tracks.items.length);\n\n console.log(\"\\n-------------------------------------------------------\");\n\n for (let trackCount = 0; trackCount < response.tracks.items.length; trackCount++) {\n\n console.log(\"\\n\");\n\n //Show Artist(s)\n let getArtists = response.tracks.items[trackCount].artists;\n let artistsName = [];\n for (let j = 0; j < getArtists.length; j++) {\n artistsName += getArtists[j].name + \" \";\n }\n console.log(\"Artist/s: \" + artistsName);\n\n // The song's name\n console.log(\"Song's name: \" + response.tracks.items[trackCount].name);\n\n // A preview link of the song from Spotify\n console.log(\"Preview URL: \" + response.tracks.items[trackCount].preview_url);\n\n // The album that the song is from\n console.log(\"Album name: \" + response.tracks.items[trackCount].album.name);\n\n }\n\n //Call restartApp() to restart the app if user wishes to\n restartApp();\n })\n .catch(function (err) {\n console.log(err);\n });\n\n} //End of spotifyThisSong()", "function spotifyThisSong(song){\n //console.log(\"Spotify This Song\");\n\n if (song === undefined){\n song = \"The Sign Ace of Base\";\n }\n //else song = inputs[3];\n\n spotify\n .search({\n type: \"track\",\n query: song,\n limit: 3\n })\n .then(results => {\n console.log(\"Song name: \" + results.tracks.items[0].name);\n console.log(\"Artists names: \" + results.tracks.items[0].artists[0].name);\n console.log(\"Preview link: \" + results.tracks.items[0].preview_url);\n console.log(\"Album name: \" + results.tracks.items[0].album.name);\n })\n .catch(err => {\n console.log(err);\n });\n}", "function spotifyThis(userSearch) {\n var spotify = new Spotify(keys.spotify);\n\n if (!userSearch) {\n userSearch = \"Uptown Girl\";\n }\n\n spotify\n .search({ type: \"track\", query: userSearch })\n .then(function(response) {\n var spotifyResult = response.tracks.items;\n for (var i = 0; i < spotifyResult.length && i < 3; i++) {\n console.log(\"\\n======================\");\n console.log(\n \"\\nArtist name: \" +\n spotifyResult[i].album.artists[0].name +\n \"\\nSong title: \" +\n spotifyResult[i].name +\n \"\\nSong preview: \" +\n spotifyResult[i].preview_url +\n \"\\nAlbum name: \" +\n spotifyResult[i].album.name\n );\n }\n })\n .catch(function(err) {\n console.log(\"Error: \" + err);\n });\n}", "function getSpotify(songName) {\n\n var spotify = new Spotify(keys.spotify)\n // console.log(\"Spotify Key: \" + spotify);\n\n //HA-HA, I'm sorry. I just couldn't bring myself to put \"The Sign\"\n if(!songName){\n songName =\"Overkill\";\n }\n\n spotify.search({type:'track', query: songName}, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n console.log(\"***************************************************************\")\n //console.log(\"Data.Tracks.items is \" + JSON.stringify(data.tracks.items[0]))\n\n console.log(\"Song Searched For: \" + userSearch+\"\\r\\n\");\n console.log(\"Artist(s): \", data.tracks.items[0].album.artists[0].name + \"\\r\\n\")\n console.log(\"Album Name: \", data.tracks.items[0].album.name + \"\\r\\n\")\n console.log(\"Relase Date: \", data.tracks.items[0].album.release_date +\"\\r\\n\")\n console.log(\"Preview Link: \", data.tracks.items[0].preview_url+ \"\\r\\n\")\n\n //Appends the search results to a text file name \"log\"\n var logSong = (\"***** Spotify Log Entry *****\" + \n \"\\nSong: \" + userSearch +\n \"\\nArtist: - \" + data.tracks.items[0].album.artists[0].name +\n \"\\nAlbum Name: \"+ data.tracks.items[0].album.name +\n \"\\mRelase Date: \"+ data.tracks.items[0].album.release_date+\n \"\\nPreview Link: \" +data.tracks.items[0].preview_url+\"\\n\" +\"\\r\\n\");\n fs.appendFile(\"log.txt\", logSong, function (err){\n if(err) throw err\n });\n\n });\n\n }", "function spotifyThisSong(){\n console.log(\"Getting the information you requested\");\n if (!userQuery) {\n userQuery = \"the sign ace of base\"\n };\n spotify.search({ type: 'track', query: userQuery, limit: 1 }, function (error, data) {\n if (error) {\n return console.log(\"Error occurred \");\n }\n let spotifyArr = data.tracks.items;\n// console.log(spotifyArr);\n for (var i=0; i < spotifyArr.length; i++){\n\n // display artist\n console.log(\"Artist: \"+JSON.stringify(spotifyArr[i].artists[0].name));\n // display song name\n console.log(\"Song name: \" +spotifyArr[i].name);\n // display a preview link of the song from Spotify\n console.log(\"Song preview: \"+spotifyArr[i].preview_url);\n // display the album that the song is from\n console.log(\"Album name: \"+spotifyArr[i].album.name);\n };\n});\n\n}", "function getTheSongInfo (spot, thisSong)\n{\n spot.search({ type: 'track', query: thisSong }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n if (data.tracks.items.length === 0) {\n console.log(\"I'm sorry. We could not find [\" + thisSong + \"]. Let's try THE SIGN\");\n getTheSongInfo(spot, \"The Sign\");\n }\n\n var l = data.tracks.items.length;\n // console.log(\"The number of results ar: \" + l);\n for (var i = 0; i<l; i++){\n console.log(\"The Artist is \" + data.tracks.items[i].album.artists[0].name);\n console.log(\"The Album is \" + data.tracks.items[i].album.name);\n console.log(\"The Song's name is: \" + thisSong);\n console.log(\"The Song's Spotify link is: \" + data.tracks.items[i].href);\n console.log(\"\\n\");\n }\n\n // console.log(JSON.stringify(data, null, 2));\n });\n}", "function spotifyThis(term) {\n console.log(\"Running spotify-this-song...\");\n \n if (process.argv[3]) { \n var songName = process.argv.slice(3).join(\" \");\n }\n else if (term) {\n var songName = term;\n }\n else {\n var songName = \"The Sign, Ace of Base\";\n }\n\n spotify.search({ type: 'track', query: songName }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n console.log(\"\\n\" + \"Track: \" + data.tracks.items[0].name); \n console.log(\"Artist: \" + data.tracks.items[0].artists[0].name); \n console.log(\"Album: \" + data.tracks.items[0].album.name); \n console.log(\"Preview: \" + data.tracks.items[0].preview_url + \"\\n\"); \n\n });\n}", "function spotify(song) {\n var spotify = new Spotify(keys.spotify);\n spotify.search({ type: 'track', query: song }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n console.log(\"Artist: \" + data.tracks.items[0].artists[0].name);\n console.log(\"Song name: \" + data.tracks.items[0].name);\n console.log(\"Preview link: \" + data.tracks.items[0].external_urls.spotify);\n console.log(\"Album: \" + data.tracks.items[0].album.name);\n });\n}", "spotifyThisSong() {\n const spotify = new SpotifyAPI(KEYS.spotify);\n let songName = \"The Sign Ace of Base\";\n\n if (this.cmdArgs.length > 0) {\n songName = this.cmdArgs.join(\" \");\n }\n spotify.searchSong(songName);\n }", "function spotifyThis(checkThis) {\n \t\tspotify.search({ type:\"track\", query:checkThis }, function(err, data) {\n\t\t\tvar songInfo = data.tracks.items[0];\n\t\t\tconsole.log(songInfo.artists[0].name);\n\t\t\tconsole.log(songInfo.name);\n\t\t\tconsole.log(songInfo.preview_url);\n\t\t\tconsole.log(songInfo.album.name);\n\t\t});\n\t}", "function spotifySearch(){\n outPutForLog = [];\n outPutForLog.unshift(outputText);\n outPutForLog.unshift(\"\\n\");\n\n //if there is no song typed into the CLI then 'The Sign' by Ace of Base will be searched\n if(process.argv.length === 3){\n userQuestion = \"The Sign\"\n spotify.search({ type: 'track', query: userQuestion ,limit: 10 })\n .then(function(response) {\n console.log(\"\\r\\n\\r\\n\\r\\n\");\n \n //artist name\n console.log(\"Artists: \" + response.tracks.items[9].album.artists[0].name);\n outPutForLog.push(\"Artists: \" + response.tracks.items[9].album.artists[0].name);\n //song name\n console.log(\"Song Title: \" + response.tracks.items[9].name);\n outPutForLog.push(\"Song Title: \" + response.tracks.items[9].name);\n //preview link\n console.log(\"Preview Url: \" + response.tracks.items[9].preview_url);\n outPutForLog.push(\"Preview Url: \" + response.tracks.items[9].preview_url);\n //album name\n console.log(\"Album Title: \" + response.tracks.items[9].album.name);\n outPutForLog.push(\"Album Title: \" + response.tracks.items[9].album.name);\n \n console.log(\"\\r\\n\\r\\n\\r\\n\");\n displayForLog = outPutForLog.join(\"\\n \");\n appendOutput();\n })\n .catch(function(err) {\n console.log(err);\n });\n } else {\n spotify.search({ type: 'track', query: userQuestion ,limit: 1 })\n .then(function(response) {\n console.log(\"\\r\\n\\r\\n\\r\\n\");\n\n //artist name\n console.log(\"Artists: \" + response.tracks.items[0].album.artists[0].name);\n outPutForLog.push(\"Artists: \" + response.tracks.items[0].album.artists[0].name);\n //song name\n console.log(\"Song Title: \" + response.tracks.items[0].name);\n outPutForLog.push(\"Song Title: \" + response.tracks.items[0].name);\n //preview link\n console.log(\"Preview Url: \" + response.tracks.items[0].preview_url);\n outPutForLog.push(\"Preview Url: \" + response.tracks.items[0].preview_url);\n //album name\n console.log(\"Album Title: \" + response.tracks.items[0].album.name);\n outPutForLog.push(\"Album Title: \" + response.tracks.items[0].album.name);\n\n console.log(\"\\r\\n\\r\\n\\r\\n\");\n displayForLog = outPutForLog.join(\"\\n \");\n appendOutput();\n\n })\n .catch(function(err) {\n console.log(err);\n });\n}\n}", "function search(searchTerm) {\n\tSC.get('/tracks', {\n\t\tq: searchTerm,\n\t}).then(function(tracks) {\n\t\tplaylist = tracks;\n\t\trenderPlaylist(tracks);\n\t\tplayFirstTrack(); // plays the first song.\n\t});\n}", "function spotifySong(data) {\n\tvar Spotify=require('node-spotify-api');\n\n\tvar spotify = new Spotify({\n \t\tid: \"c8f9c16590344e52958c43c6c66267e4\",\n \t\tsecret: \"01323ed470fe4a0eb339120d5591dd38\"\n\t});\n\n\t// if (y === null) {\n // y = \"The Sign Ace of Base\";\n // console.log(y);\n // };\n\n\tspotify.search({type:'track',query:data},function(err,data){\n\t\tif(err) {\n\t\t\tconsole.log('Error occurred: ' + err);\n \treturn;\n\t\t// } else {\n\t\t// \ty == \"I+saw+the+sign\"\n\t\t// };\n \t\t // console.log(JSON.stringify(data, null, 2));\n\t\t}\n // Do something with 'data'\n \t\tfor (var i=0; i < data.tracks.items.length || i<19; i++) {\n\t\t\tconsole.log(\"Artist: \"+data.tracks.items[i].artists[0].name);\n\t\t\tconsole.log(\"Song Name: \"+data.tracks.items[i].name);\n\t\t\tconsole.log(\"Album: \"+data.tracks.items[i].album.name);\n\t\t\tconsole.log(\"Preview Link: \"+data.tracks.items[i].preview_url);\n\t\t\tconsole.log(\"\");\n\t\t\tconsole.log(\"-------------------------\");\n\t\t\tconsole.log(\"\");}\n\t\t});\n}", "function spotifyThisSong(){\n var spotify = new Spotify({\n id: keyz.spotifyKeys.clientId,\n secret: keyz.spotifyKeys.clientSecret\n });\nvar userinput = process.argv.slice(3);\n//console.log(userinput);\n if(userinput.length === 0){\n var userQuery = \"ace of base\";\n }else{\n var userQuery = userinput.join(\" \");\n }\n//console.log(userinput);\n//console.log(userQuery);\n\n spotify.search({ type: 'track', query: userQuery}, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n } \n console.log(\"artist: \" + data.tracks.items[0].artists[0].name);\n console.log(\"song's name: \" + data.tracks.items[0].name); \n console.log(\"preview link: \" + data.tracks.items[0].external_urls.spotify);\n console.log(\"album name: \" + data.tracks.items[0].album.name); \n \n });\n \n }", "function spotify(song) {\n\n//this song is a default if user did not request the song\nsong = \"The Sign by Ace of Base\"\nif (parameter ==\"\"){\n parameter = song;\n}\n\n//send request to spotify queryURL\nvar spotify = require ('spotify');\n\n//run the request to spotify with specific song the user entered\nspotify.search({ type: 'track', query: parameter }, function(err, data) {\n if ( err ) {\n //console.log('Error occurred: ' + err);\n return;\n }\n\n\n //loop through all the data requested\n //for (var i=0; i<11; i++) {\n\n //console.log(JSON.stringify(data, null, 2));\n //log all necessary information of the song user requested\n ////console.log(\"----------------------------------------------------------------\");\n ////console.log(\"Artist: \" + data.tracks.items[i].artists[0].name);\n ////console.log(\"Song Name: \" + data.tracks.items[i].name);\n ////console.log(\"Spotify Link: \" + data.tracks.items[i].external_urls.spotify);\n ////console.log(\"Album Name: \" + data.tracks.items[i].album.name);\n ////console.log(\"----------------------------------------------------------------\");\n // };\n });\n}", "function song() {\n spotify.search({\n type: 'track',\n query: search\n }, function (err, data) {\n if (err) {\n return console.log('ERROR! Search could not find results for: ' + err);\n } else {\n var results = data.tracks.items\n for (i = 0; i < results.length; i++) {\n console.log(\"================================================\");\n console.log(\"Artist: \" + results[i].artists[0].name);\n console.log(\"Song Name: \" + results[i].name);\n console.log(\"Follow this Spotify Link: \" + results[i].external_urls.spotify);\n console.log(\"Album Name: \" + results[i].album.name);\n };\n };\n });\n}", "function spotify(song) {\nvar spotify = new Spotify({\n id: \"569b986909fb40db838262de1380d393\",\n secret: \"f5b7b55801464dd3bc672665bd685f57\"\n });\n // console.log(\"TEXT TEXT TEXT TEXT\",text);\n var nodeArgsSong = process.argv;\n var songName = song;\n // if(argumentInput == \"spotify-this-song\"){\n for (var i = 3; i < nodeArgsSong.length; i++){\n if(i > 3 && i < nodeArgsSong.length){\n songName = songName + \"+\" + nodeArgsSong[i];\n } \n else{\n songName += nodeArgsSong[i];\n }\n }\n\n if (songName === \"\") {\n songName = 'ace+of+base+sign';\n };\n\n spotify.search({ type: 'track', query: songName, limit: 1 }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n if (!err) {\n var spotifyData = data.tracks.items;\n // for (var i = 0; i < spotifyData.length; i++){\n \n console.log(spotifyData[0].album.name); \n console.log(spotifyData[0].artists[0].name); \n console.log(spotifyData[0].name); \n console.log(spotifyData[0].external_urls);\n // };\n }\n });\n}", "function lookupSpecificSong() {\n\n // Calls Spotify API to retrieve a specific track, The Sign, Ace of Base\n spotify.lookup({type: 'track', id }, function(err, data) {\n if (err) {\n logOutput.error(err);\n return\n }\n\n // Prints the artist, track name, preview url and album name\n logOutput(\"Artist: \" + data.artists[0].name);\n logOutput(\"Song: \" + data.name);\n logOutput(\"Spotify Preview URL: \" + data.preview_url);\n logOutput(\"Album Name: \" + data.album.name);\n });\n}" ]
[ "0.7590375", "0.7489351", "0.74626887", "0.741358", "0.73905444", "0.72338945", "0.7231475", "0.7206957", "0.7177629", "0.7127097", "0.7125345", "0.70811284", "0.70621544", "0.7041589", "0.7036563", "0.7027181", "0.7010469", "0.70030034", "0.6990089", "0.6984239", "0.69663167", "0.69525623", "0.69400436", "0.6939933", "0.6939312", "0.6934599", "0.69195944", "0.69089484", "0.6894926", "0.689031", "0.68637973", "0.68378896", "0.68360937", "0.68163896", "0.6811065", "0.6800769", "0.6795029", "0.678852", "0.67872274", "0.6766724", "0.6761477", "0.67538136", "0.672367", "0.67124766", "0.6697157", "0.66954744", "0.66951746", "0.66939884", "0.6685831", "0.6680212", "0.6644839", "0.66385806", "0.6632914", "0.6631644", "0.660928", "0.6605969", "0.6590951", "0.65895176", "0.6582656", "0.6579804", "0.6552628", "0.6549953", "0.65402895", "0.6538583", "0.6536973", "0.6514925", "0.6495163", "0.64919543", "0.6481997", "0.6473109", "0.6465862", "0.6462924", "0.64560705", "0.64427644", "0.6426302", "0.64191276", "0.6403338", "0.6397095", "0.6386558", "0.6382086", "0.63765484", "0.63667923", "0.63656306", "0.63459754", "0.63418615", "0.6341116", "0.6333227", "0.6317806", "0.630609", "0.63034755", "0.62958896", "0.6295765", "0.6294771", "0.62915605", "0.62868446", "0.6276938", "0.6271324", "0.62707794", "0.6248221", "0.62404525", "0.62379843" ]
0.0
-1
Method for saving the playlist to spotify. See util/Spotify.js
savePlaylist() { // Get a list of track URIs provided by Spotify, these are needed for defining the playlist let tracks = this.state.playlistTracks.map(track => track.uri); // savePlaylist is Promise based. Once the playlist is saved, reset the application state. Spotify.savePlaylist(this.state.playlistName, tracks).then(() => { //Reset the state when done saving. this.setState({ searchResults: [], playlistTracks: [] }) // Set the playlist name to empty. document.getElementsByClassName("Playlist-name")[0].value = 'New Playlist'; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "savePlaylist() {\n\t\tlet trackURIs = [];\n\t\tfor(let i = 0; i < this.state.playlistTracks.length; i++) {\n\t\t\ttrackURIs.push(this.state.playlistTracks[i].uri);\n\t\t}\n\t\tSpotify.savePlaylist(this.state.playlistName, trackURIs);\n\t\tthis.setState({playlistName: 'New Playlist', playlistTracks: []});\n\t}", "savePlaylist() {\n const playlistUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, playlistUris).then(response => {\n if (response) {\n this.setState({ playlistName: \"New Playlist\",\n playlistTracks : [] });\n }});\n }", "savePlaylist() {\n let trackURIs = this.state.playlistTracks.map( track => track.uri);\n //console.log(trackURIs);\n spotify.savePlaylistToSpotify(this.state.playlistName, trackURIs);\n this.setState({\n playlistTracks: [],\n playlistName: 'New Playlist'\n });\n }", "function savePlaylists() {\n localStorage.setItem('playlist', JSON.stringify(playlists));\n}", "savePlaylist() {\n const trackUris = this.state.playlistTracks.map(playlistTrack => playlistTrack.uri);\n Spotify.savePlaylist(this.state.playlistName, trackUris);\n // Once the playlist is save set the state back to empty\n this.setState({\n playlistName: \"Dan's Playlist\",\n searchResults: [],\n playlistTracks: []\n });\n }", "savePlaylist() {\n const trackUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, trackUris).then(() => {\n this.setState({ \n playlistName: 'New playlist',\n playlistTracks: []\n })\n })\n }", "savePlaylist(name, trackUris) {\n //first make sure name and trackuris actually have values saved to them\n if (!name || !trackUris.length) return;\n //variables: for current user's access token (grabbed from the method above)\n const accessToken = Spotify.getAccessToken();\n //for Authorization parameter in implicit grant flow request format\n const headers = {\n Authorization: `Bearer ${accessToken}`\n };\n //empty variable for user's ID\n let userId;\n //make request that returns user's Spotify username\n return fetch(`https://api.spotify.com/v1/me`, {\n headers: headers\n }\n //convert response to JSON\n ).then(response => response.json()\n //save the response id to the user's ID variable\n ).then(jsonResponse => {\n userId = jsonResponse.id;\n //Use the returned userId to make POST request with Spotify endpoint\n //to request creation of new playlist\n return fetch(`https://api.spotify.com/v1/users/${userId}/playlists`, {\n headers: headers,\n method: 'POST',\n //key value for name is one of the parameters for this method\n body: JSON.stringify({\n name: name\n })\n }).then(response => response.json()\n ).then(jsonResponse => {\n //get the playlist with the response id\n const playlistId = jsonResponse.id;\n return fetch(`https://api.spotify.com/v1/users/${userId}/playlists/${playlistId}/tracks`, {\n headers: headers,\n method: 'POST',\n body: JSON.stringify({\n uris: trackUris\n })\n });\n });\n });\n }", "saveplaylist(playlistName, trackURIs) {\n // get access token\n const accessToken = Spotify.getAccessToken();\n const headers = {Authorization: `Bearer ${accessToken}`};\n let userID = '';\n let playlistID ='';\n let snapshotID = '';\n\n// only call spotify API if playlist name and the tracks to save are available\n if (playlistName !=='' && trackURIs!=='') {\n //get userID from spotify through spotify API\n return fetch(`https://api.spotify.com/v1/me`, {headers: headers}\n ).then(response => {\n// debugger\n if (response.ok) {\n return response.json();\n }\n else {\n console.log('failed get userID');\n }\n }).then(jsonResponse => {\n // get the userID from current session in order to save the list for the user\n if (jsonResponse.id) {\n userID = jsonResponse.id;\n }\n // create a new playlist through spotify API\n return fetch(`https://api.spotify.com/v1/users/${userID}/playlists`,\n {headers: headers, method: 'POST', body: JSON.stringify({name: playlistName})}\n ).then(response => {\n// debugger\n // verify if the playlist is created successfully on Spotify\n if (response.ok) {\n return response.json();\n }\n else {\n console.log('failed create new playlist');\n }\n }).then(jsonResponse => {\n// debugger\n // get the newly created list ID from response\n if (jsonResponse.id) {\n playlistID = jsonResponse.id;\n }\n // add playlist to the newly created spotify playlist\n return fetch(`https://api.spotify.com/v1/users/${userID}/playlists/${playlistID}/tracks`,\n {headers: headers, method: 'POST', body: JSON.stringify({uris: trackURIs})});\n });\n });\n }\n }", "savePlaylist() {\n let tracks = this.state.playlistTracks;\n const trackUris = tracks.map((track) => track.uri);\n trackPromise(\n Spotify.savePlaylist(this.state.playlistName, trackUris).then(\n (httpStatus) => {\n if (httpStatus === \"Request successful\") {\n this.setState({\n playlistName: \"New Playlist\",\n playlistTracks: [],\n httpStatus: \"Success! Your playlist has been saved.\",\n });\n } else {\n this.setState({ httpStatus: \"Failed to save your playlist!\" });\n }\n setTimeout(() => {\n this.setState({ httpStatus: \"\" });\n }, 5000);\n }\n )\n );\n }", "savePlaylist(name, arrayURIs) {\n if (!name || !arrayURIs.length) {\n return;\n }\n\n const accessToken = Spotify.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n let userId; \n \n // GET user's spotify id/username\n return fetch('https://api.spotify.com/v1/me', {\n headers: headers\n })\n .then(response => response.json())\n .then(jsonData => {\n userId = jsonData.id;\n //using the userId, POST request to create new playlist to user's Spotify account, & return playlist ID\n return fetch(`https://api.spotify.com/v1/users/${userId}/playlists`, {\n method: 'POST',\n headers: headers,\n body: JSON.stringify({ name: name })\n })\n .then(response => response.json())\n .then(jsonData => {\n const playlistID = jsonData.id;\n // using userId and playlistID, POST request to add track URIs to playlist\n return fetch(`https://api.spotify.com/v1/users/${userId}/playlists/${playlistID}/tracks`, {\n method: 'POST',\n headers: headers,\n body: JSON.stringify({ uris: arrayURIs})\n });\n });\n });\n }", "async savePlaylist(bot, message, settings, msg) {\n\t\t// Get songs to add to playlist\n\t\tlet res;\n\t\ttry {\n\t\t\tres = await bot.manager.search(message.args[1], message.author);\n\t\t} catch (err) {\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/ERROR', err.message);\n\t\t}\n\n\t\t// Workout what to do with the results\n\t\tif (res.loadType == 'NO_MATCHES') {\n\t\t\t// An error occured or couldn't find the track\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/NO_SONG');\n\t\t} else if (res.loadType == 'PLAYLIST_LOADED' || res.loadType == 'TRACK_LOADED') {\n\t\t\t// Save playlist to database\n\t\t\tconst newPlaylist = new PlaylistSchema({\n\t\t\t\tname: message.args[0],\n\t\t\t\tsongs: res.tracks.slice(0, message.author.premium ? 200 : 100),\n\t\t\t\ttimeCreated: Date.now(),\n\t\t\t\tthumbnail: res.playlist?.selectedTrack.thumbnail ?? res.tracks[0].thumbnail,\n\t\t\t\tcreator: message.author.id,\n\t\t\t\tduration: res.playlist?.duration ?? res.tracks[0].duration,\n\t\t\t});\n\t\t\tnewPlaylist.save().catch(err => bot.logger.error(err.message));\n\n\t\t\t// Show that playlist has been saved\n\t\t\tconst embed = new MessageEmbed()\n\t\t\t\t.setAuthor(newPlaylist.name, message.author.displayAvatarURL())\n\t\t\t\t.setDescription([\t`Created a playlist with name: **${message.args[0]}**.`,\n\t\t\t\t\t`Playlist duration: ${bot.timeFormatter.getReadableTime(parseInt(newPlaylist.duration))}.`,\n\t\t\t\t\t`Added **${(res.loadType == 'PLAYLIST_LOADED') ? res.playlist.name : res.tracks[0].title}** (${res.tracks.length} tracks) to **${message.args[0]}**.`].join('\\n'))\n\t\t\t\t.setFooter(`ID: ${newPlaylist._id} • Songs: ${newPlaylist.songs.length}/${(message.author.premium) ? '200' : '100'}`)\n\t\t\t\t.setTimestamp();\n\t\t\tmsg.edit('', embed);\n\t\t} else {\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.send(`\\`${message.args[1]}\\` is not a playlist`);\n\t\t}\n\t}", "savePlaylist(){\n // new array to hold the uris for each track provided from Spotify\n let trackURIs=[];\n\n // add each uri to the trackURIs array\n for (let i=0; i < this.state.playlistTracks.length; i++){\n trackURIs.push(this.state.playlistTracks[i].uri);\n }\n\n // call the savePlaylist function to save the playlist\n Spotify.savePlaylist(this.state.playlistName, trackURIs).then(() => {\n\n // reset the state back to defaults\n this.setState({\n playlistName: \"New Playlist\",\n playlistTracks: [],\n });\n });\n }", "async savePlayList(user, playListName, playList){\n // if one of the params is not defined, abort the process\n if(typeof user == 'undefined' || typeof playListName == 'undefined' || typeof playList == 'undefined'){\n console.log('missing save criteria, save aborted!');\n return;\n }\n\n // check if there is no access token => first login\n if(typeof accessToken === 'undefined'){\n accessToken();\n }\n\n //createPL and return playlist\n const pl = await fetch(`${apiURL}users/${user.id}/playlists`, {\n headers: {Authorization: `Bearer ${accessToken}`, 'Content-Type': 'application/json'},\n method: 'POST',\n body: JSON.stringify({\n name: playListName,\n public: false\n })\n }).then(res => res.json())\n .then(response => {\n console.log('Success:', JSON.stringify(response))\n return response;\n })\n .catch(error => console.error('Error:', error));\n \n \n // create an array of track uris\n const uris = playList.map(track => {\n return `spotify:track:${track.id}`;\n });\n\n // save tracks to PL(ID)\n await fetch(`${apiURL}playlists/${pl.id}/tracks`, {\n headers: {Authorization: `Bearer ${accessToken}`, 'Content-Type': 'application/json'},\n method: 'POST',\n body: JSON.stringify({\n uris: uris\n })\n }).then(res => res.json())\n .then(response => console.log('Success:', JSON.stringify(response)))\n .catch(error => console.error('Error:', error));\n }", "savePlaylist(playlistName, playlistTracks){\n if(!playlistName && !playlistTracks){\n //console.log(`Aborting save as cannot find playlistName (${playlistName}) or playlistTracks (${playlistTracks})`)\n return\n }\n const myAccessToken = this.getAccessToken();\n const headers = {headers:{Authorization:`Bearer ${myAccessToken}`}}\n //console.log(`me headers set to ${JSON.stringify(headers)}`)\n let userId =''\n\n const meEndpoint = `${corsAnywhere}https://api.spotify.com/v1/me`\n return fetch(meEndpoint,headers).then(response=>{\n return response.json()\n }).then(jsonResponse=>{\n //console.log(`**********Me Response contains ${JSON.stringify(jsonResponse)}` );\n userId = jsonResponse.id;\n //console.log(`Saved ${userId} to userId`);\n\n const newPlaylistEndpoint = `${corsAnywhere}https://api.spotify.com/v1/users/${userId}/playlists`\n //POST TO CREATE THE PLAYLIST\n return fetch(newPlaylistEndpoint, {\n method: 'POST',\n body: JSON.stringify({name:playlistName}),\n headers:{Authorization:`Bearer ${myAccessToken}`}\n }).then(response=>{\n return response.json()\n }).then(jsonResponse=>{\n //console.log(`**********Playlist Response contains ${JSON.stringify(jsonResponse)}` );\n let playlistID = jsonResponse.id;\n //console.log(`Saved ${playlistID} to playlistID`);\n\n //POST TO CREATE THE PLAYLIST\n const addTracksEndpoint = `${corsAnywhere}https://api.spotify.com/v1/playlists/${playlistID}/tracks`\n //console.log('About to post the following body to add tracks' + JSON.stringify({uris:playlistTracks}))\n return fetch(addTracksEndpoint, {\n method: 'POST',\n body: JSON.stringify({uris:playlistTracks}),\n headers:{Authorization:`Bearer ${myAccessToken}`}\n }).then(response=>{\n return response.json()\n }).then(jsonResponse=>{\n //console.log(`**********Add Tracks Response contains ${JSON.stringify(jsonResponse)}` );\n\n })\n })\n })\n }", "function addTracksToPlaylist(data, callback){\n\tsessionStorage.songs = JSON.stringify(MASTER_TRACKLIST); \n\tsessionStorage.spotifyUserId = JSON.stringify(spotifyUserId);\n\n\tplaylistId = data.id;\n\tsessionStorage.playlistId = JSON.stringify(playlistId);\n\tvar tracks = [];\n\tfor(var i = 0; i < MASTER_TRACKLIST.length; i++){\n\t\ttracks.push(MASTER_TRACKLIST[i].id);\n\t}\n\tvar tracksString = tracks.join(\",spotify:track:\");\n\t\n\tvar url = 'https://api.spotify.com/v1/users/' + spotifyUserId +\n\t'/playlists/' + playlistId +\n\t'/tracks?uris='+encodeURIComponent(\"spotify:track:\"+tracksString);\n\t$.ajax(url, {\n\t\tmethod: 'POST',\n\t\tdataType: 'text',\n\t\theaders: {\n\t\t\t'Authorization': 'Bearer ' + AUTHORIZATION_CODE,\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tsuccess: function(d) {\n\t\t\tcallback(d, data.external_urls.spotify);\n\t\t},\n\t\terror: function(r) {\n\t\t\tcallback(null, null);\n\t\t}\n\t});\n}", "function savePlaylist(playListName){\n if(storage.getItem('playlists')){\n savedPlaylists = JSON.parse(storage.getItem('playlists'))\n }\n newPlaylist = {\n 'name': playListName,\n 'songs': songQueue\n }\n savedPlaylists.push(newPlaylist)\n storage.setItem('playlists', JSON.stringify(savedPlaylists))\n tableRow = document.createElement(\"tr\")\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(newPlaylist.name)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(newPlaylist.songs.length)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(\"1000\")\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n tableRow.setAttribute(\"id\", i)\n document.getElementById('saved-playlist-body').appendChild(tableRow)\n}", "handleSavePlaylist(event){\n SpotifySave.makePlaylist(this.state.playListName,this.state.playList).then(\n this.setState({playList: [],\n playListName: '',\n saveClass:'hidden'\n }),\n document.getElementById('PlayListName').value=''\n )\n }", "function saveFile() {\n // console.log(playList);\n var data = JSON.stringify(playlist);\n\n // console.log(\"The data being weritting is\" + data);\n console.log(\"The data being weritting!\" );\n\n //Write data to a file\n fs.writeFile('schedule/playList.json', data, function (err) {\n if (err) {\n console.log(err.message);\n return;\n }\n console.log('Saved the new playList profile.');\n });\n}", "function createPlaylist() {\n\t\t// create request\n\t\tvar request = {};\n\t\trequest[\"artistPool\"] = artistPool;\n\t\t\n\t\tvar requestBuilder = new SpotifyRequestBuilder();\n\t\trequestBuilder.postRequest(common.generatePlaylistURL, onCreatePlaylist, JSON.stringify(request));\n\t}", "addTracks() {\n let { playlistId, tracks } = this.state;\n spotifyApi.addTracksToPlaylist(playlistId, tracks);\n }", "function createPlaylist(callback){\n\t\tvar url = 'https://api.spotify.com/v1/users/' + spotifyUserId + '/playlists';\n\t\t$.ajax(url, {\n\t\t\tmethod: 'POST',\n\t\t\tdata: JSON.stringify({\n\t\t\t\t'name': 'Metly: A ' + desiredMood + \" Journey to \" + toStation,\n\t\t\t\t'public': false\n\t\t\t}),\n\t\t\tdataType: 'json',\n\t\t\theaders: {\n\t\t\t\t'Authorization': 'Bearer ' + AUTHORIZATION_CODE,\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\tcallback(data, openPlaylist);\n\t\t\t},\n\t\t\terror: function(data) {\n\t\t\t\tcallback(null);\n\t\t\t}\n\t\t});\n}", "saveTrackForNextTime() {\n\t\tif (PlayerUi.hasFailed()) {\n\t\t\treturn;\n\t\t}\n\n\t\tlocalStorage.setItem(this.lastTrack.title, `${this.currentTrack}`);\n\t\tlocalStorage.setItem(this.lastTrack.playTime, `${timeToSeconds(PlayerUi.getCurrentTime())}`);\n\t}", "function createSpotifyPlaylist(message) {\n spotifyApi.createPlaylist('MaeshBot\\'s Playlist', { 'description': 'Playlist converted from YouTube by MaeshBot :)', 'public': true })\n .then(function (data) {\n var spotifyPlaylistId = data.body.id;\n titles.forEach((title) => {\n // search for title\n searchAndAdd(title, spotifyPlaylistId);\n // add first track to playlist\n })\n message.channel.send(\"Here's the link to the playlist: \" + String(data.body.external_urls.spotify));\n console.log('Created playlist!', data.body);\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "function updatePlaylist(playlist, artistName, songTitle)\n{\n playlist[artistName] = songTitle\n}", "function App(props) {\n const [isSaving, setIsSaving] = useState(false);\n const [searchResults, setSearchResults] = useState([]);\n\n const [playlist, setPlayList] = useState({\n name: \"New Playlist\",\n tracks: [],\n });\n\n const filteredSearchResults = searchResults.filter(\n (result) => !playlist.tracks.some((track) => track.id === result.id)\n );\n\n useEffect(() => {\n // Restore search results\n const resultData = window.sessionStorage.getItem(\"searchResults\");\n const result = JSON.parse(resultData);\n if (result) {\n setSearchResults(result);\n }\n }, []);\n\n useEffect(() => {\n // Search if user returned from spotify auth page and has a search term\n const searchTerm = window.sessionStorage.getItem(\"search-term\");\n const executeSearch = window.sessionStorage.getItem(\"search\");\n if (executeSearch === \"true\" || searchTerm) {\n searchTerm(searchTerm);\n }\n }, []);\n\n useEffect(() => {\n // Save current searchResults\n if (searchResults) {\n window.sessionStorage.setItem(\n \"searchResults\",\n JSON.stringify(searchResults)\n );\n }\n }, [searchResults]);\n\n // Add track\n function addTrack(track) {\n if (!playlist.tracks.some((e) => e.id === track.id)) {\n setPlayList((playlist) => {\n return { ...playlist, tracks: [track, ...playlist.tracks] };\n });\n }\n }\n // Remove track from\n function removeTrackFromPlaylist(id) {\n setPlayList((prev) => {\n return {\n ...prev,\n tracks: prev.tracks.filter((track) => track.id !== id),\n };\n });\n }\n\n function setPlaylistName(name) {\n setPlayList((prev) => {\n return { ...prev, name };\n });\n }\n\n function savePlaylistToSpotify() {\n setIsSaving(true);\n const trackURIs = playlist.tracks.map((track) => track.uri);\n // TODO UPDATE PLAYLIST\n\n Spotify.savePlaylist(playlist.name, trackURIs)\n .then(resetPlaylist())\n .then(setIsSaving(false));\n }\n\n function resetPlaylist() {\n // TODOS\n // Set playlist name to new playlist\n setPlayList({ name: \"\", tracks: [] });\n // Set playlistTracks to an empty array\n }\n\n function resetSearchResults() {\n setSearchResults([]);\n }\n\n function searchTrack(term) {\n window.sessionStorage.setItem(\"search\", \"true\");\n Spotify.search(term).then((results) => {\n const filteredResults = results.filter(\n (track) =>\n !playlist.tracks.some(\n (playListTrack) => track.id === playListTrack.id\n )\n );\n setSearchResults(filteredResults);\n });\n window.sessionStorage.setItem(\"search\", \"false\");\n }\n\n return (\n <div>\n <header>\n <div className=\"UserTitle\">\n <a href={window.location.href}>\n <h1>\n Ja<span className=\"highlight\">mmm</span>ing\n </h1>\n </a>\n <SearchBar\n onSearch={searchTrack}\n onReset={resetSearchResults}\n ></SearchBar>\n </div>\n </header>\n\n <div className=\"App\">\n <div className=\"App-playlist\">\n <SearchResults\n searchResults={filteredSearchResults}\n onAdd={addTrack}\n ></SearchResults>\n <Playlist\n playlist={playlist}\n onRemove={removeTrackFromPlaylist}\n onNameChange={setPlaylistName}\n onSave={savePlaylistToSpotify}\n isSaving={isSaving}\n ></Playlist>\n </div>\n </div>\n </div>\n );\n}", "function updatePlaylist(){\n\tvar songs = JSON.parse(sessionStorage.getItem(\"songs\"));\n\t$(renderPlaylist(songs));\n}", "savePlayList(name, trackUris) {\n if (!name || !trackUris.length) {\n return;\n }\n // using the POST method send the id of the tracks in a list to the users Spotify account.\n const accessToken = Spotify.getAccessToken();\n const headers = {\n Authorization: `Bearer ${accessToken}`\n };\n let userId;\n return\n fetch(`${spotifyURIBase}me`, {headers: headers}).then(response => response.json()).then(jsonResponse => {\n userId = jsonResponse.id;\n return\n fetch(`${spotifyURIBase}users/${userId}/playlists`, {\n headers: headers,\n method: 'POST',\n body: JSON.stringify({name: name})\n }).then(response => response.json()).then(jsonResponse => {\n const playListId = jsonResponse.id;\n return\n fetch(`${spotifyURIBase}users/${userId}/playlists/${playListId}/tracks`, {\n headers: headers,\n method: 'POST',\n body: JSON.stringify({uris: trackUris})\n });\n });\n });\n }", "function spotifyThisSong(song) {\n\n var description;\n\n // In case of empty music, it will use this one as default\n if (song === \"\") {\n song = \"the sign ace of base\"; //just the sign is returning another artist\n description = \"The information about the music THE SIGN is here:\\n\\n\";\n } else {\n description = \"The information about the music \" + song.toUpperCase() + \" is here:\\n\\n\";\n }\n\n spotify\n .search({ type: 'track', query: song })\n .then(function (response) {\n\n var divider = \"\\n------------------------------------------------------------\\n\\n\";\n var data = response.tracks.items;\n var songData;\n\n if (data == 0) { //need to review this one\n songData = \"\\tThere's no music like this.\\n\";\n } else {\n\n // Creating a variable with all data required to use on print/save\n songData = [\n \"\\tArtists: \" + data[0].artists[0].name,\n \"\\tSong Name: \" + data[0].name,\n \"\\tAlbum Name: \" + data[0].album.name,\n \"\\tSong Preview Link: \" + data[0].external_urls.spotify\n ].join(\"\\n\");\n }\n\n // Saving data in file\n fs.appendFile(\"log.txt\", divider + description + songData + \"\\n\", function (err) {\n console.log(divider + description + songData + \"\\n\");\n if (err) throw err;\n });\n\n })\n .catch(function (err) {\n console.log(err);\n });\n\n}", "async createPlaylist(playlistId) {\n if (!this._auth()) return;\n let playlist = ss.Playlist.findById(playlistId);\n if (!playlist.youtubeId) {\n try {\n let response = await this._createPlaylist(playlist);\n console.info('Successfully created YouTube playlist ' + playlist.name);\n playlist.youtubeId = response.data.id;\n playlist.update();\n } catch (err) {\n this.addAlert('Unable to create YouTube playlist ' + playlist.name);\n console.error(err);\n if (err.message == 'invalid_grant') {\n this.service = undefined;\n const settings = new ss.SoulSifterSettings();\n settings.putString('google.oauthRefreshToken', '');\n settings.save();\n }\n return;\n }\n }\n try {\n await this._updatePlaylistEntries(playlist);\n // if (!!playlist.query) {\n // let songs = ss.SearchUtil.searchSongs(playlist.query,\n // /* bpm */ 0,\n // /* key */ '',\n // playlist.styles,\n // /* songsToOmit */ [],\n // /* limit */ 200,\n // /* energy */ 0,\n // /* musicVideoMode */ false,\n // /* orderBy */ 0,\n // /* errorCallack */ (msg) => { this.addAlert(msg, 5); });\n // for (let i = 0; i < songs.length; ++i) {\n // await this._addSongToPlaylist(songs[i], playlist);\n // await this.sleep();\n // }\n // }\n } catch (err) {\n this.addAlert('Unable to add song to YouTube playlist ' + playlist.name);\n console.error(err);\n return;\n }\n }", "function addToPlaylist(trackId, playlist) {\n spotifyApi.addTracksToPlaylist(playlist, [`spotify:track:${trackId}`])\n .then(function (data) {\n console.log('Added tracks to playlist!');\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "static addPlaylist(playlist) {\n return fetch('http://localhost:8888/insertplaylist/', {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(playlist)\n })\n }", "function generatePlaylist() {\n $.ajax({\n method: \"PUT\",\n url: `/api/playlists/${getPlaylistID()}`,\n data: { completed: true },\n }).then(window.location.replace(\"/complete\"));\n }", "function updatePlaylist(playlist, artistName, songTitle){\n \n playlist[artistName] = \"songTitle\";\n \n}", "function updatePlaylist(playlist, artist, song) {\n //var playlist = {artist: song};\n playlist[artist] = song\n return\n}", "function saveSessionStorage(data) {\n sessionStorage.setItem(\"songID\", data);\n }", "function setPlaylist(p) {\n\tplaylist = p;\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "saveSong (path) {\n const data = {\n patterns: this.sequencer.tracks,\n scaler: this.scaler.getConfig(),\n channels: this.channels.map((ch) => ch.getConfig()),\n settings: {\n tempo: this.sequencer.tempo,\n syncOuts: this.sequencer.syncOuts,\n swing: this.sequencer.swing,\n accent: this.matrixView.accent\n },\n version: '2.0'\n }\n const fs = require('fs')\n fs.writeFile(path, JSON.stringify(data, null, 2), (err) => {\n if (err) {\n console.log('Error saving Song', err)\n } else {\n console.log('Song saved')\n localStorage.setItem('currentFile', path)\n this.adjustSaveAsMenu()\n }\n })\n }", "function saveItemInStorage() {\r\n\t\tconst items = getItems();\r\n\t\titems.push({\r\n\t\t\t'id': items.length,\r\n\t\t\t'task': getTask(),\r\n\t\t\t'date': getDate(),\r\n\t\t\t'time': getTime(),\r\n\t\t\t'completed': false\r\n\t\t});\r\n\t\tsessionStorage.setItem('items', JSON.stringify(items)); // gives a string\r\n\t}", "function saveFavorite(itemUrl) {\n // console.log(itemUrl)\n // Loop through Results Array to select Favorite\n resultsArray.forEach((item) => { // for every item in the array\n if (item.url.includes(itemUrl) && !favorites[itemUrl]) { // if the url that the user clicks (Add To Fav) matches the url of the item that we're looping through\n favorites[itemUrl] = item // add the whole of the itemUrl to the favorites object\n console.log(JSON.stringify(favorites))\n // Show Save Confirmation message\n saveConfirmed.hidden = false\n setTimeout(() => {\n saveConfirmed.hidden = true\n }, 2000)\n // Set Favorites in localStorage\n localStorage.setItem('nasaFavorites', JSON.stringify(favorites))\n }\n })\n}", "savePlaylist(songs){\n const playlistDatabase = this.database.ref('/playlist');\n\n playlistDatabase.set({\n songs: songs\n });\n }", "function openPlaylist(data, link){\n\tspotifyLink = link;\n\tsessionStorage.link = JSON.stringify(spotifyLink);\n\tsessionStorage.access = JSON.stringify(AUTHORIZATION_CODE);\n\t$(\"#js-journey-form\").unbind().submit();\n}", "function saveFavourite(itemUrl) {\n resultsArray.forEach((item) => {\n if (item.url.includes(itemUrl) && !favorites[itemUrl]) {\n favorites[itemUrl] = item;\n\n //Show Save Confirmation for two seconds\n saveConfirmed.hidden = false;\n setTimeout(() => {\n saveConfirmed.hidden = true;\n }, 2000);\n //Set Favourites in local storage\n localStorage.setItem('nasaFavorites', JSON.stringify(favorites));\n }\n })\n}", "saveToLocalStorage() {\n\t\tthis.subscribers.push(() => {\n\t\t\tlocalStorage.setItem(\n\t\t\t\t\"queueifyModel\",\n\t\t\t\tJSON.stringify({\n\t\t\t\t\t//Conversion from object to String (serialization)\n\t\t\t\t\tcurrentSession: this.currentSession,\n\t\t\t\t\tcurrentSessionName: this.currentSessionName,\n\t\t\t\t\tcurrentSessionPin: this.currentSessionPin,\n\t\t\t\t\tcurrentPlaylistID: this.currentPlaylistID,\n\t\t\t\t})\n\t\t\t);\n\t\t});\n\t}", "function renderPlaylist(songs){\n\tAUTHORIZATION_CODE = JSON.parse(sessionStorage.access);\n\tspotifyUserId = JSON.parse(sessionStorage.spotifyUserId);\n\tspotifyLink = JSON.parse(sessionStorage.link);\n\tfirstPlaylist = JSON.parse(sessionStorage.firstPlaylist);\n\tif(firstPlaylist){\n\t\tfirstPlaylist = false;\n\t\tsessionStorage.firstPlaylist = JSON.stringify(firstPlaylist);\n\t}\n\n\tplaylistId = JSON.parse(sessionStorage.playlistId);\n\t//spotifyUserId = JSON.parse(sessionStorage.spotifyUserId);\n\tfromStation = JSON.parse(sessionStorage.fromStation);\n\ttoStation = JSON.parse(sessionStorage.toStation);\n\tmood = JSON.parse(sessionStorage.mood);\n\n\t$('.js-playlist-title').html(`<p><span class=\"subtle\" style=\"font-size: 30px;\">A</span> <span style=\"text-transform: capitalize;\">${mood}</span> <span class=\"subtle\" style=\"font-size: 30px\">journey from</span><br> ${fromStation} <span class=\"subtle\" style=\"font-size: 30px\">to<br></span> ${toStation}</span></p>`);\n\t$('.js-playlist').html(`\n\t\t<div id=\"cover\"></div><iframe id=\"iframe\" src=\"https://open.spotify.com/embed?uri=spotify:user:${spotifyUserId}:playlist:${playlistId}\"\n width=\"100%\" height=\"80\" frameborder=\"0\" style=\"border-radius: 10px\" allowtransparency=\"true\"></iframe>\n `);\n\t$('#cover').on('click', function(event) {\n window.open(`https://open.spotify.com/user/${spotifyUserId}/playlist/${playlistId}`);\n\n\t});\n\n\tsongs.forEach(item => {\n\t\tvar duration = convertTrackTime(item.duration_ms);\n\t\t$(\".js-playlist\").append(`\n\t\t\t<div class=\"js-playlist-entry\">\n\t\t\t\t<p class=\"js-song-name\">${item.name} <span class=\"subtle\">by ${item.artist}</span></p>\n\t\t\t<p class=\"js-song-time\">${duration}</p>\n\t\t\t</div>\t\n\t\t`);\n\t});\n}", "store() {\n localStorage.setItem(FAVORITES_STORAGE_KEY, JSON.stringify(this.favorites));\n }", "playSong(){\n spotifyApi.play({});\n }", "async _saveData()\n {\n try{\n await AsyncStorage.setItem(\"@JapQuiz:list\",\n JSON.stringify({score: this._currentPoint,\n wrong_list: this._wrong_list,}));\n }\n catch(error)\n {\n console.log(error.toString());\n }\n }", "function saveToStorage() {\n\tlocalStorage.setItem(\"trackers\", JSON.stringify(trackers));\n}", "function addTracksPlaylist(playlistId, tracks, accessToken) {\n // curl -i -X POST \"https://api.spotify.com/v1/playlists/7oi0w0SLbJ4YyjrOxhZbUv/tracks?uris=spotify%3Atrack%3A4iV5W9uYEdYUVa79Axb7Rh,spotify%3Atrack%3A1301WleyT98MSxVHPZCA6M\" -H \"Authorization: Bearer {your access token}\" -H \"Accept: application/json\"\n const uris = tracks.map(t => t.uri).join(',');\n\n return axios({\n method: 'post',\n baseURL: 'https://api.spotify.com/v1',\n url: `/playlists/${playlistId}/tracks`,\n headers: {\n Authorization: 'Bearer ' + accessToken\n },\n params: {\n uris\n }\n });\n}", "pauseSong(){\n spotifyApi.pause({});\n }", "function save_current_playlist_form(site_url, playlist_caption)\n{\n\tvar result = $.ajax({\n\t\tasync:false,\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"playlist_caption=\"+playlist_caption,\t\t\n\t\turl: site_url+\"video/save_new_playlist_form_data/\"\t\t\n\t}).responseText;\n\t\n\treturn result;\n}", "addPlaylist(playlist)\n {\n if(this.name === null) {\n this.name = playlist.name;\n }\n for (let song of playlist.songs) {\n let newSong = new Song('', '', song);\n this.songs.push(newSong);\n }\n }", "function submit_save_playlist_form(site_url)\n{\n\tvar playlist_caption = $('#playlist_caption').val();\n\t\n\tif (playlist_caption.length<=0){\n\t\topen_messagebox(\"Alert\", \"<span style=\\\"color:#F00;\\\">Enter Playlist Name!</span>\");\n\t\tsetTimeout(\"closeBox()\", 4000);\n\t}else{\n\t\tvar total_videos = $('#total_videos').val();\n\t\tif (total_videos<=0)\n\t\t{\n\t\t\t//alert(total_videos);\n\t\t\topen_messagebox(\"Alert\", \"<span style=\\\"color:#F00;\\\">No videos in the playlist!</span>\");\n\t\t\tsetTimeout(\"closeBox()\", 4000);\n\t\t}else{\n\t\t\t//alert(total_videos);\n\t\t\t\n\t\t\tvar result = check_if_playlist_exist(site_url, playlist_caption);\n\t\t\tif (result==1){\n\t\t\t\topen_messagebox(\"Alert\", \"<span style=\\\"color:#F00;\\\">Playlist Name Already Exist!</span>\");\n\t\t\t\tsetTimeout(\"closeBox()\", 4000);\n\t\t\t}else{\n\t\t\t\tvar save = save_current_playlist_form(site_url, playlist_caption);\n\t\t\t\t$('#playlist_id').val(save);\n\t\t\t\t$('#playlist_type').val('playlist');\n\t\t\t\t$('#playlist_title').html(playlist_caption);\n\t\t\t\t$('#playlist_title_save').css('display', 'block');\n\t\t\t\t$('#playlist_rename_button').css('display', 'block');\n\t\t\t\t$('#playlist_title').css('display', 'none');\t\n\t\t\t\t$('#playlist_title').html(playlist_caption);\n\t\t\t\t$('#playlist_save_button').css('display', 'none');\n\t\t\t\t$('#playlist_cancel_button').css('display', 'none');\n\t\t\t\t$('#playlist_rename_button').css('display', 'block');\n\t\t\t\t$('#create_new_playlist_span').css('display', 'block');\n\t\t\t\topen_messagebox(\"Alert\", \"<span style=\\\"color:#F00;\\\">Playlist Saved!</span>\");\n\t\t\t\tsetTimeout(\"closeBox()\", 3000);\n\t\t\t}\n\t\t}\n\t}\n\t/*var flag = 0;\n\tvar result = check_if_playlist_exist(site_url, playlist_caption);\n\t\n\tif (result==1)\n\t{\n\t\t$('#errPlaylist').hide();\n\t\t$('#errPlaylist').html('Playlist Name Already Exist');\n\t\t$('#errPlaylist').fadeIn('slow');\n\t}else{\n\t\t//alert('Playlist Saved');\n\t\t$('#errPlaylist').hide();\n\t\t$('#errPlaylist').html('Playlist Saved');\n\t\t$('#errPlaylist').fadeIn('slow');\n\t\t$('#playlist_title').html(playlist_caption);\n\t\tvar save = save_current_playlist_form(site_url, playlist_caption);\t\t\n\t\t$('#playlist_id').val(save);\n\t\t$('#playlist_type').val('playlist');\n\t\t\n\t}*/\n\t\n}", "function agregarPlaylist(id) {\n console.log(\"clickeaste en la cancion de id: \"+id);\n //PRIMERO reviso si existe el array de cancion cancionesPlaylist\n var arrayDePlaylist = JSON.parse(window.sessionStorage.getItem(\"arrayDePlaylist\"))\n if (arrayDePlaylist != null && arrayDePlaylist.length>0) {\n // console.log(\"existe y no esta vacio\");\n //antes de agregarlo a favoritos, tengo que verificar si ya esta en el array\n if (arrayDePlaylist.indexOf(id)!= -1) {\n document.querySelector(\"button.boton-favoritos\").innerText = \"Agregar a Playlist\"\n //ya está como playlist, entonces la borro\n arrayDePlaylist.splice(arrayDePlaylist.indexOf(id),1)\n window.sessionStorage.setItem(\"arrayDePlaylist\", JSON.stringify(arrayDePlaylist));\n } else {\n document.querySelector(\"button.boton-favoritos\").innerText = \"Eliminar de Playlist\"\n // no está como playlist, entonces la agrego en el array\n arrayDePlaylist.push(id)\n window.sessionStorage.setItem(\"arrayDePlaylist\", JSON.stringify(arrayDePlaylist));\n }\n // console.log(arrayDePlaylist);\n } else {\n document.querySelector(\"button.boton-favoritos\").innerText = \"Eliminar de Playlist\"\n arrayDePlaylist = []\n arrayDePlaylist.push(id)\n window.sessionStorage.setItem(\"arrayDePlaylist\", JSON.stringify(arrayDePlaylist));\n // console.log(\"no existe o esta vacio\");\n // console.log(arrayDePlaylist);\n }\n console.log(JSON.parse(window.sessionStorage.getItem(\"arrayDePlaylist\")));\n}", "function saveShows() {\n if(fileOps.saveFile(FILENAME, showList)) {\n emitMessage('Show list saved to file successfully');\n }\n else {\n emitMessage('Error saving show list to file');\n toaster.showToast('Error saving show list to file');\n }\n}", "function addPlaylist(playlist_name){\n console.log('creating playlist',playlist_name);\n\n var data = {\n playlist_name: playlist_name\n };\n\n requests.createPlaylist(data, (x) => {\n if (x['status'] === 200){\n console.log('-- DONE: createPlaylist');\n\n // remove <html> for playlists and refetch playlists.\n $('#playlists > ul').empty();\n showMyPlaylists();\n }\n else {\n alert('Error while creating playlist');\n }\n });\n}", "function getPlaylistTracks(callback, playlistID){\n\tsettings = {\n\t\turl: `https://api.spotify.com/v1/users/Spotify/playlists/${playlistID}/tracks`,\n\t\theaders: {'Authorization': \"Bearer \"+ AUTHORIZATION_CODE},\n\t\tsuccess: callback,\n\t};\n\t$.ajax(settings);\n}", "function addSongToExistingPlaylist(sname, surl, playlistName) {\n let reqPlaylist = playlistsArr.find((list) => list.name == playlistName);\n reqPlaylist.song.push({ songName: sname, songurl: surl });\n}", "function spotifySong(parameter) {\n // If no song is provided then your program will default to \"The Sign\" by Ace of Base.\n if (parameter === undefined || null) {\n parameter = \"The Sign\";\n };\n\n spotify.search({\n type: 'track',\n query: parameter\n }, function (error, data) {\n if (error) {\n console.log('Error occurred: ' + error);\n return;\n };\n var song = data.tracks.items;\n for (var i = 0; i < song.length; i++) {\n console.log(\"Song Info - \" + [i + 1]);\n fs.appendFileSync(\"log.txt\", \"Song Info - \" + [i + 1] + \"\\n\");\n\n // Artist(s)\n console.log(\"Artist(s): \" + song[i].artists[0].name);\n fs.appendFileSync(\"log.txt\", \"artist(s): \" + song[i].artists[0].name + \"\\n\");\n\n // The song's name\n console.log(\"Song name: \" + song[i].name);\n fs.appendFileSync(\"log.txt\", \"song name: \" + song[i].name + \"\\n\");\n\n // A preview link of the song from Spotify\n console.log(\"Preview song: \" + song[i].preview_url);\n fs.appendFileSync(\"log.txt\", \"preview song: \" + song[i].preview_url + \"\\n\");\n\n // The album that the song is from\n console.log(\"Album: \" + song[i].album.name);\n fs.appendFileSync(\"log.txt\", \"album: \" + song[i].album.name + \"\\n\");\n\n console.log(\"-----------------------------------------------------------\")\n fs.appendFileSync(\"log.txt\", \"-----------------------------------------------------\");\n }\n });\n}", "update() {\n localStorage.setItem('favorites', JSON.stringify(this.items))\n }", "function spotifyThisSong() {\n // To include the spotify-api\n var Spotify = require('node-spotify-api');\n var spotify = new Spotify(liriKeys.spotify);\n\n // To search for the song name entered by user\n spotify.search({ type: 'track', query: songName, limit: 1 }, function (error, data) {\n if (!error) {\n // For loop to go through all the data items\n for (var i = 0; i < data.tracks.items.length; i++) {\n var songData = data.tracks.items[i];\n // To log all the information required for the assignment\n console.log(\"* Artist: \" + songData.artists[0].name);\n console.log(\"* Song: \" + songData.name);\n console.log(\"* Preview URL: \" + songData.preview_url);\n console.log(\"* Album: \" + songData.album.name);\n console.log(\"-----------------------\");\n }\n }\n else {\n // To log an error message if error occurs\n console.log(\"Error occurred\" + error);\n }\n });\n}", "createPlaylist() {\n if (this.state.modalInput === \"\") {\n alert(\"Name your playlist\");\n }\n spotifyApi\n .createPlaylist({ name: this.state.modalInput })\n .then(res => this.setState({ playlistId: res.id }));\n // Wait 1 second to addTracks() while setting state\n setTimeout(() => this.addTracks(), 1000);\n this.setState({ modalInput: \"\" });\n }", "function save() {\n let title = titleTask.value.trimStart().replace(/(<([^>]+)>)/ig,\"\");\n let description = descriptionTask.value.trimStart().replace(/(<([^>]+)>)/ig,\"\");\n let priority = priorityTask.value.replace(/(<([^>]+)>)/ig,\"\");\n\n if (title === null || title === '') return;\n\n if (createTask.getAttribute('task-id') && createTask.getAttribute('task-done')) {\n let isdone = createTask.getAttribute('task-done') === 'false'?false:true;\n let id = createTask.getAttribute('task-id');\n list = list.map((item) => {\n if (item.id === id) {\n item = { id: id, title: title, description: description, priority: priority, done: isdone };\n }\n return item;\n });\n saveToLocalStorage(list);\n createTask.removeAttribute('task-id');\n createTask.removeAttribute('task-done');\n changeFilter();\n } else {\n let saveList = saveToList(title, description, priority);\n list.push(saveList);\n saveToLocalStorage(list);\n }\n}", "function convertYouTubePlaylist(playlistID, message) {\n google.youtube('v3').playlistItems.list({\n key: process.env.YOUTUBE_TOKEN,\n part: 'snippet',\n playlistId: playlistID,\n maxResults: 50,\n }).then((response) => {\n const { data } = response;\n data.items.forEach((item) => {\n var title = item.snippet.title;\n title = title.replace(/f(ea)?t.|Lyrics|((Official )?(Lyric )?(Music )?(Video|Audio))|MV|M\\/V/gi, ' ');\n var newTitle = \"\";\n for (i = 0; i < title.length; i++) {\n var currChar = title.charAt(i);\n var letterNumber = /^[0-9a-zA-Z]+$/;\n if (letterNumber.test(String(currChar))) {\n newTitle = newTitle.concat(\"\", String(currChar));\n } else {\n newTitle = newTitle.concat(\"\", \" \");\n }\n }\n titles.push(newTitle);\n //message.channel.send(newTitle);\n //console.log(newTitle);\n })\n createSpotifyPlaylist(message);\n \n\n }).catch((err) => console.log(err));\n}", "async save() {\n const { newPosytText, saving } = this.state;\n if (saving || !newPosytText.length) return;\n // this.setState({ saving: true });\n // this.playSavingAnimation();\n const attrs = {};\n attrs.content = newPosytText.trim();\n const location = await this.currentLocation();\n if (location && location.coords) {\n attrs.location = [location.coords.latitude, location.coords.longitude].join(',');\n }\n this.close('up');\n segment.track('Posyt Create - Saving 1 - Request');\n ddp.call(\"posyts/create\", [attrs]).then(() => {\n // this.setState({ saving: false });\n segment.track('Posyt Create - Saving 2 - Success');\n }).catch((err) => {\n // this.setState({ saving: false });\n // Alert.alert('Error', err.reason, [{ text: 'OK' }]);\n segment.track('Posyt Create - Saving 2 - Error', { error: err.reason });\n bugsnag.notify(err);\n });\n }", "function _storeTrackDatas(data) {\n\t\t\t//search if a track with a same title already exists\n\t\t\tvar trackIndex = tracks.length;\n\t\t\tfor(var i= 0; i < tracks.length; ++i) {\n\t\t\t\tif(data.title == tracks[i].title) {\n\t\t\t\t\ttrackIndex = i;\n\t\t\t\t\treturn trackIndex;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttracks.push(data);\n\t\t\t_createPlaylistTrack(data.artwork_url, data.title);\n\n\t\t\tif(options.storePlaylist) { amplify.store('fap-playlist', JSON.stringify(tracks)); }\n\n\t\t\treturn trackIndex;\n\t\t}", "function saveGame() {\n _curr.gameArray = createGameArray();\n console.log(\"current object\");\n console.log(_curr.songFile);\n\n var postParameters = {\n title: _curr.songTitle,\n artist: _curr.artistName,\n length: _curr.songLength,\n mp3File: _curr.songFile.name,\n imgFile: _curr.songImage.name,\n keyStrokes: JSON.stringify(_curr.gameArray)\n };\n\n $.post(\"/storesong\", postParameters, function(responseJSON){\n _newSongID = responseJSON;\n console.log(_newSongID);\n\n $(\"#overLayMessage\").text(\"SAVED\");\n $(\"#recordButt\").css (\"visibility\", \"hidden\");\n $(\"#restartButt\").css(\"visibility\", \"hidden\");\n $(\"#saveNowButt\").css(\"visibility\", \"hidden\");\n $(\"#restartButt2\").css(\"display\", \"none\");\n $(\"#saveButt\").css(\"display\", \"none\");\n $(\"#playButt\").css(\"display\", \"block\");\n $(\"#createButt\").css(\"display\", \"block\");\n })\n }", "function playlist(id, fname, lname, status)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.id = id;\n\t\t\t\t\t\tthis.first_name=fname;\n\t\t\t\t\t\tthis.last_name=lname;\n\t\t\t\t\t\tthis.status = status;\n\t\t\t\t\t}", "update() {\n localStorage.setItem('favoritesList', JSON.stringify(this.items))\n }", "function postNowPlaying(self, song, sk, callback) {\nif (sk && self.sessionKey == null) {\n self.sessionKey = sk\n}\nvar dur = (song.duration) ? 'duration' + song.duration : ''\n , apiSig = makeHash('api_key' + self.apiKey + 'artist' + song.artist + dur + 'methodtrack.updateNowPlayingsk' + self.sessionKey + 'track' + song.track + self.apiSecret)\n , post_data = querystring.stringify({\n method: 'track.updateNowPlaying',\n artist: song.artist,\n track: song.track,\n duration: song.duration,\n api_key: self.apiKey,\n api_sig: apiSig,\n sk: self.sessionKey\n })\nsendPost(post_data, callback)\n}", "function create_new_playlist(site_url)\n{\n\t$.ajax({\n\t\tcache: false,\n\t\turl: site_url+\"video/create_new_playlist/\",\t\t\n\t\ttype: 'GET',\n\t\tdata: '',\n\t\tsuccess: function(data){\n\t\t\t//alert(data);\n\t\t\t//location.reload(true);\n\t\t\t/*if (call=='redirect'){\n\t\t\t\twindow.location=site_url+\"home/index/playlist\";\n\t\t\t}*/\n\t\t\t\n\t\t\t$('#user_playlist_section').html(data);\t\t\t\n\t\t\t$('#playlist_title').css('display', 'none');\n\t\t\t$('#playlist_caption').val('');\n\t\t\t$('#playlist_title_save').css('display', 'block');\t\n\t\t\t$('#playlist_save_button').css('display', 'block');\n\t\t\t$('#playlist_cancel_button').css('display', 'none');\n\t\t\t$('#playlist_rename_button').css('display', 'none');\n\t\t\t$('#create_new_playlist_span').css('display', 'none');\n\t\t\tvar js = 'submit_save_playlist_form(\"'+site_url+'\")';\n\t\t\t$('#playlist_save_link').attr('onclick', js);\t\t\t\n\t\t\t$('#total_videos').val(0);\n\t\t\t$('#count_video').html(0);\n\t\t\t$('#video_duration').html('00:00:00');\n\t\t\t$('#playlist_controls').css('display', 'none');\n\t\t}\n\t});\t\n}", "addSongToPlaylist (e) {\n if (this.props.canAddDirectly) {\n this.props.addSong(this.props.activePlaylistID, this.props.trackInfo.uri);\n } else {\n this.props.addSongToDB(this.props.session.connected_session.data.joinCode, this.props.trackInfo, this.props.userId);\n }\n notify.show(\"Added song \" + this.props.trackInfo.name, \"success\", 2000);\n }", "async function getPlaylistInfo() {\n var playlistInfo = await queryDbOnce('/Playlists/' + vue.playlist);\n var info = playlistInfo.val();\n vue.currentSongId = info.Current;\n vue.allowExplicit = info.Settings['Allow Explicit Songs'];\n vue.allowSpotify = info.Settings.Spotify;\n vue.allowYoutube = info.Settings.Youtube;\n}", "async function syncPlaylist (playlist, tracks) {\n try {\n const results = { added: 0, removed: 0 }\n // Exit early on empty tracks.\n if (!tracks.length) return results\n const spotify = createSpotify()\n const uid = playlist.user\n const name = playlist.name\n\n // Search for user playlist.\n const result = await searchUserPlaylists(uid, name)\n\n // Store playlist ID if available.\n let pid = result[0] ? result[0].id : null\n\n if (!pid) {\n // Create user playlist if it doesn't exist.\n pid = await spotify.createPlaylist(uid, name)\n .then(response => response.body.id)\n .catch(e => console.log(e))\n }\n\n // Exit early if playlist couldn't be created.\n if (!pid) return\n\n // Get all track IDs from user playlist.\n const playlistTracks = await getAllUserPlaylistTracks(uid, pid)\n .then(response => response.map(item => item.track.id))\n .catch(e => console.log(e))\n\n if (playlistTracks) {\n // Build remove array to store tracks in playlist that are not included\n // within tracks argument.\n const remove = playlistTracks.reduce((items, item) => {\n const index = tracks.indexOf(item)\n if (index < 0) {\n results.removed = results.removed + 1\n tracks.splice(index, 1)\n items.push({ uri: `spotify:track:${item}` })\n }\n return items\n }, [])\n\n if (remove) {\n // Remove tracks from playlist.\n await removeAllTracksFromPlaylist(uid, pid, remove)\n .catch(e => console.log(e))\n }\n }\n\n if (tracks.length) {\n // Build tracks to add that are not present in playlist, so duplicated\n // tracks aren't added.\n const add = tracks.reduce((items, item) => {\n const index = playlistTracks.indexOf(item)\n if (index < 0) {\n results.added = results.added + 1\n items.push(`spotify:track:${item}`)\n }\n return items\n }, [])\n\n if (add.length) {\n // Add tracks to playlist.\n await addAllTracksToPlaylist(uid, pid, add)\n .catch(e => console.log(e))\n }\n }\n\n return results\n } catch (e) {\n throw e\n }\n}", "update() {\n localStorage.setItem('favorites', JSON.stringify(this.items))\n app.store.faves = this.getItems();\n }", "handleAdd(image,name,title,link){\n this.props.addTrackToPlaylist(spotifyApi,[link],this.props.playlist.id);\n // Assigning the track to a variable so it can be shown\n let newObj = {};\n let songObj = {};\n newObj = Object.assign({},newObj,{\n image:image,\n name:name,\n title:title,\n uri:link,\n })\n newItems.push(newObj);\n songs = newItems;\n songObj = Object.assign({},songObj,{\n items:newItems\n })\n songs = songObj\n }", "function save() {\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(tasks));\n localStorage.setItem(LOCAL_STORAGE_SELECTED_LIST_ID, selectedListId);\n}", "function spotifyThisSong() {\n var spotify = new Spotify(keys.spotify);\n // If no track is entered, it will default to 'The Sign' by Ace of Base\n if (!liriSearchTerm) {\n var songTitle = \"The Sign, Ace of Base\";\n }\n else {\n var songTitle = liriSearchTerm;\n }\n // search: function({ type: 'artist OR album OR track', query: 'My search query', limit: 20 }, callback);\n spotify.search({ type: 'track', query: songTitle }, function (err, response) {\n // Create a variable to store the first song in the response\n var spotifyData = response.tracks.items[0];\n // console.log (spotifyData);\n\n // Create an array to store the information about the song, that will be written to the log.txt\n var spotifyData = [\n \"Artist: \" + spotifyData.artists[0].name,\n \"Song Link: \" + spotifyData.name,\n \"Song Preview: \" + spotifyData.preview_url,\n \"Album: \" + spotifyData.album.name,\n ].join(\"\\n\");\n\n // Write the data from the response to the terminal window\n console.log(spotifyData);\n // Write the data to log.txt\n updateLogFile(spotifyData);\n })\n}", "function mashlistCreatePlaylist($_mashlist) {\n models.Playlist.create($_mashlist.find('h3').text()).done(function (playlist) {\n playlist.load(['tracks']).done(function (_playlist) {\n models.Playlist.fromURI($_mashlist.attr('data-uri')).load(['tracks']).done(function (templist) {\n templist.tracks.snapshot(0, 1000).done(function(snapshot) {\n _playlist.tracks.add(snapshot.toArray());\n });\n });\n });\n });\n }", "function redirect_to_play_option(site_url, playlist_id)\n{\n\twindow.location.href = site_url+'video/play_option/'+playlist_id+'/playlist/';\n}", "persistData() {\n localStorage.setItem('favorites', JSON.stringify(this.favorites));\n }", "function attachPlaylistToScreen(screen_id, playlist_id) {\n return $.post('/api/screen/playlist', {\n screen: {\n screenId: screen_id,\n playlistId: playlist_id\n }\n });\n }", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function spotifySong() {\n\n let spotify = new Spotify({\n id: \"0b69126503894401b9000caef1c6e58b\",\n secret: \"f282337b81514df4ac49a20cb6d4fbb2\",\n });\n\n let songName = userINPUT;\n let space = \"\\n\" + \"\\n\" + \"\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\";\n if (!songName) {\n songName = \"What's my age again\";\n }\n\n params = songName;\n spotify.search({ type: 'track', query: params }, function (err, data) {\n if (err) {\n console.log('Error occurred: ' + err);\n return;\n }\n else {\n output = \"**********************************************************************\" +\n space + \"Song Name: \" + \"'\" + songName.toUpperCase() + \"'\" +\n space + \"Album Name: \" + data.tracks.items[0].album.name +\n space + \"Artist Name: \" + data.tracks.items[0].album.artists[0].name +\n space + \"URL: \" + data.tracks.items[0].album.external_urls.spotify + \"\\n\\n\"\n + \"**********************************************************************\";\n console.log(output);\n\n fs.appendFile(\"log.txt\", output, function (err) {\n if (err) throw err;\n });\n };\n });\n\n}", "function doSpotify(name) {\n\n if (name == null) {\n name = 'The Sign';\n }\n // Search tracks\n spotify.search({\n type: 'track',\n query: name\n }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n } else {\n for (i = 0; i < data.tracks.items.length && i < 5; i++) {\n\n var song = data.tracks.items[i];\n\n //Artist(s)\n console.log(\"\\nArtist: \" + song.artists[0].name +\n //The song's name\n \"\\nSong Name: \" + song.name +\n //A preview link of the song\n \"\\nLink to Song: \" + song.preview_url +\n //The album that the song is from\n \"\\nAlbum Name: \" + song.album.name);\n\n appendFile(\"\\nArtist: \" + song.artists[0].name +\n //The song's name\n \"\\nSong Name: \" + song.name +\n //A preview link of the song\n \"\\nLink to Song: \" + song.preview_url +\n //The album that the song is from\n \"\\nAlbum Name: \" + song.album.name);\n }\n };\n\n\n });\n\n}", "save() {\n // Create a JSON string of the tasks\n const tasksJson = JSON.stringify(this.tasks);\n\n // Store the JSON string in localStorage\n localStorage.setItem(\"tasks\", tasksJson);\n\n // Convert the currentId to a string;\n const currentId = String(this.currentId);\n\n // Store the currentId in localStorage\n localStorage.setItem(\"currentId\", currentId);\n }", "save() {\n // Create a JSON string of the tasks\n const tasksJson = JSON.stringify(this.tasks);\n\n // Store the JSON string in localStorage\n localStorage.setItem(\"tasks\", tasksJson);\n\n // Convert the currentId to a string;\n const currentId = String(this.currentId);\n\n // Store the currentId in localStorage\n localStorage.setItem(\"currentId\", currentId);\n }", "async setNewTrackList(playlistID) {\n const playlist = await this.getPlaylistWithTracks(playlistID);\n console.log(\"----\", playlist.tracks.items);\n //Setting the tracks taken from the playlist to the \n //variable in the state newTrackList\n this.setState({\n newTrackList: playlist.tracks.items\n })\n }", "function putCurrentSong() {\n console.log('putCurrentSong');\n c.put(key, currentSong, function(err) {\n console.log('saved to cache',key,currentSong,arguments);\n });\n}", "function SaveItem() {\n\t\t\t\n\tvar name = document.forms.ShoppingList.name.value;\n\tvar data = document.forms.ShoppingList.data.value;\n\twindow.localStorage.setItem(name,data);\n\tdoShowAll();\n\t\n}", "function setPlaylist(mood) {\n if (mood === \"Happy\") {\n var userPlaylists = happyPlaylistIDs;\n } else if (mood === \"Sad\") {\n var userPlaylists = sadPlaylistIDs;\n } else if (mood === \"Party\" || mood === \"Excited\") {\n var userPlaylists = excitedPlaylistIDs;\n } else if (mood === \"Chill\") {\n var userPlaylists = chillPlaylistIDs;\n } else if (mood === \"Classy\") {\n var userPlaylists = classyPlaylistIDs;\n }\n console.log(\"Playlists\");\n var randomID = Math.floor(Math.random() * userPlaylists.length);\n var playlistID = userPlaylists[randomID];\n var embedURL = `https://open.spotify.com/embed/playlist/${playlistID}`;\n console.log(randomID);\n $(spotifyPlayer).attr(\"src\", embedURL);\n }", "function addTracksSC( url, playnow ){\n\t//var hardUrl = '/deep-house-amsterdam/jay-west-deep-house-amsterdam';\n\t//scplayer.add_tracks(hardUrl);\n\tvar found_at_index = scplayer.add_tracks(url);\n\t\n\tif ( found_at_index == 'current_track'){\n\t\t//alert(\"it's the current track!\");\n\t}\n\t\n\tif ( found_at_index != 'current_track'){\n\n\t\tvar $pl = $(\"#playlist\");\t\t\n\t\t\n\t\tif ( found_at_index > 0 ){\n\t\t\t$pl.find( 'li:nth-child(' + ( found_at_index + 1 ) + ')' ).remove();\n\t\t}\n\t\t//if ( found_at_index == 0 ) {\n\t\t\t//var x=0;\n\t\t\tvar playlist = scplayer.playlist();\n\t\t\tvar l= playlist.length;\n\t\t\tl = l-1;\n\n\t\t\tvar $li = jQuery(\"<li/>\", {\"html\": \"<span>loading..</span>\"}).data('index', l).appendTo($pl);\n\n\t\t\t//lookup the track info\n\t\t\tscplayer.track_info(l).done(function(track){\n\t\t\t\t//console.log(track);\n\t\t\t\t$li.html('<span><div class=\"playlist-track-wrapper\"><img class=\\\"playlist_artwork\\\" src=\\\"' + track.artwork_url + '\\\"/>' + track.title + '</span><a href=\"' + track.permalink_url + '\" target=\"_blank\" class=\"soundcloud-logo-small\">View on Soundcloud</a></div>');\n\t\t\t\t//scplayer.goto(jQuery(this).data('index', l) ).play();\n\t\t\t\t//scplayer.goto(jQuery(this).data('index', l)).play();\n\t\t\t});\n\t\t//}\n\n\t\t//else {\n\t\t\t/* Remove n-th li (where the track was found, since we append to the end )*/\n\t\t\t//$pl.find( 'li:nth-child(' + ( found_at_index + 1 ) + ')').clone().appendTo($pl);\n\t\t\t//$pl.find( 'li:nth-child(' + ( found_at_index + 1 ) + ')' ).remove();\n\t\t//}\n\n\t\tif ( playnow == true ){\n\t\t\t$(\"#playlist li:last\").find('span').click();\n\t\t\t//alert('clicked');\n\t\t\t//var track = scplayer.current_track;\n\t\t\t//$(\"#now_playing\").html(track.title);\n\t\t}\t\n\t}\n}", "function showPlaylist(name, url) {\n $('#loggedin').hide();\n $('#songlist').show();\n $('#playlist_title').append('<h3>' + name + '</h3>');\n apiHelper(url, function(items) {\n items.forEach(function(i) {\n $('#playlist_title').append('<li id=' + i + '> <a href=\"#\">' + i.track.name + '</a> </li>');\n $('#playlist_title').append(generateStars());\n })\n })\n }", "function doPlaylist() {\n var size = playlist = findAll('.playlist li');\n itemOnClick = function () {\n currentTrackID = this.getAttribute('data-trackid');\n find('h1').innerHTML = find('strong', this).textContent;\n find('h2').innerHTML = find('span', this).textContent;\n size = getTitleFontSize(find('h2').textContent, find('.controls').getBoundingClientRect().width - 160);\n find('h2').style.fontSize = size + 'px';\n find('.currentTrack img').src = find('img', this).getAttribute('src');\n find('.play-pause').style.top = size / 4 + 'px';\n find('figcaption').innerHTML = find('strong', this).textContent + '<br>' + this.getAttribute('data-album');\n SC.get('/tracks/' + currentTrackID).then(function (track) {\n disablePlay();\n clearInterval(scTimer);\n if (scPlayer) {\n scPlayer.pause();\n }\n find('.loaded').style.width = 0;\n find('.fa-pause').style.display = 'none';\n find('.fa-play').style.display = 'block';\n currentTrackInfo = track;\n find('.duration').innerHTML = toMMSS(currentTrackInfo.duration);\n find('.played').innerHTML = toMMSS(0);\n doPlay(true);\n\n });\n scrollAnimation.setEndValue(0);\n buildUI();\n }\n for (var i = 0, l = playlist.length; i < l; i++) {\n playlist[i].addEventListener('click', itemOnClick);\n }\n }", "function updatePlaylist(){\n /*\n Get all checked checkboxes.\n This can be done in this case, because the only checkboxes in the UI are tracks, the user wants to replace.\n It would be better to search by a better selector.\n\n TODO: Use a better selector - Getting all inputs could break the whole thing at one point. Using a class would be better\n\n Also, an empty body array will be created.\n This body will be the body of the POST request to the backend by the SpotifyUpdater bridge class.\n\n Then the script will iterate over the checked tracks\n\n The Spotify API needs a snapshot ID of a playlist to be able to delete local tracks.\n This ID is stored as a data attribute with the original track and added to the body of the request.\n */\n\n\n let originalTracks = document.querySelectorAll(\"input[type='checkbox']:checked\")\n\n let body = {\n \"snapshot\": originalTracks[0].dataset.snapshot,\n \"playlist\": originalTracks[0].dataset.playlist,\n \"tracklist\": []\n };\n\n originalTracks.forEach(function(originalTrack){\n /*\n A data-something-something attribute is accessible via JavaScript as dataset.somethingSomething.\n The line below extracts the original URI from the checkbox attribute.\n */\n\n let track = originalTrack.dataset.originalUri;\n let position = originalTrack.dataset.position;\n\n /*\n The following lines select all the checked radio boxes which have the original URI as their name,\n and extract the replacement URIs\n Since this can only be one, we can safely just take element 0 of the resulting array.\n */\n\n let replacement = document.querySelectorAll(\"input[type='radio'][name='\"+track+\"']:checked\");\n let replacementUri = replacement[0].dataset.replacementUri;\n\n /*\n Now the original URI and the replacement URI are added to the result object.\n This result object will then be pushed (appended) to the body array.\n The backend will later be able to send the result to the API\n */\n\n let result = {\n position: position,\n original: track,\n replacement: replacementUri\n };\n body.tracklist.push(result);\n });\n\n spotupdtr.replaceSongs(body);\n}", "function playList() {\n $.ajax({\n url: 'https://cors-anywhere.herokuapp.com/https://api.spotify.com/v1/browse/categories',\n method: 'GET',\n headers: { \"Authorization\": \"Bearer \" + token },\n success: function (result) {\n var newArr = result.categories.items\n spotifyPlayList = newArr\n // console.log(spotifyPlayList)\n // console.log(emotionArr[0].emotion);\n playLists[emotionArr[0].emotion];\n\n for (var i = 0; i < spotifyPlayList.length; i++) {\n if (spotifyPlayList[i].id == playLists[emotionArr[0].emotion]) {\n console.log(spotifyPlayList[i].id);\n // AJAX call to get the Spotify play list \n $.ajax({\n url: \"https://api.spotify.com/v1/browse/categories/\" + spotifyPlayList[i].id + \"/playlists\",\n method: \"GET\",\n headers: { \"Authorization\": \"Bearer \" + token }\n }).then(function (response) {\n console.log(response);\n var playlistID = response.playlists.items[0].id\n console.log(playlistID);\n // Display the playlist\n var showPlaylist = $(\"<iframe>\");\n showPlaylist.attr({ id: \"playlist\", src: \"https://open.spotify.com/embed?uri=spotify:user:spotify:playlist:\" + playlistID, width: \"300\", height: \"380\", frameborder: \"0\", allowtransparency: \"true\" });\n $(\"#main-content\").append(showPlaylist);\n });\n }\n }\n },\n error: function (error) {\n console.log(error);\n }\n });\n}", "function writePlayListToPanel(playListTracks){\n playListTracks.map(function(track) {\n var t = track.track;\n var list = \"<li id=\\\"\" + t.id + \"\\\" class='playlistItem'>\" + t.name + \"<br><span class=\\\"trackArtist\\\"> by \" + t.artists[0].name + \"</span></li>\"\n document.getElementById('trackList').innerHTML += list;\n });\n initTrackListener(playListTracks);\n console.log(playListTracks[0].track.name);\n}", "generateNewPlaylist(){\n var currentdate = new Date(); \n var datetime = (currentdate.getMonth()+1) + \"/\"\n + currentdate.getDate() + \"/\" \n + currentdate.getFullYear() + \"-\" \n + currentdate.getHours() + \":\" \n + currentdate.getMinutes() + \":\" \n + currentdate.getSeconds();\n\n const playlistName = \"Super Spotify Playlist \" + datetime;\n const _this = this;\n //Using the Spotify API to generate a playlist\n //so that songs can be added to it \n _this.props.spotifyAPI.createPlaylist(playlistName,{ 'description': 'This is the Generated Playlist', 'public': true })\n .then(function(data) {\n console.log('Created playlist!');\n //setting the generate playlist ID to the \n //variable in this state\n _this.setState({\n GenPlaylistID: data.body.id,\n })\n }, function(err) { \n console.log('Something went wrong in creating a new playlist', err);\n });\n }" ]
[ "0.81201774", "0.74345654", "0.7272796", "0.72552574", "0.7216011", "0.7179581", "0.6931424", "0.6923377", "0.6922792", "0.6836265", "0.68291163", "0.67468446", "0.66890347", "0.66640407", "0.66563326", "0.6606905", "0.65823245", "0.652154", "0.64808947", "0.6383788", "0.6337596", "0.63169205", "0.6300591", "0.628338", "0.6233267", "0.62189853", "0.6151867", "0.6124136", "0.610964", "0.60740095", "0.6063523", "0.605632", "0.60560125", "0.5999536", "0.59864014", "0.5975466", "0.5975466", "0.5908963", "0.5896293", "0.58717924", "0.5855778", "0.58419997", "0.58323026", "0.5787885", "0.5777197", "0.57762253", "0.57744867", "0.5768164", "0.57528424", "0.5735563", "0.5733486", "0.57334286", "0.5717534", "0.5698855", "0.56761247", "0.5659574", "0.56449383", "0.5627617", "0.5619094", "0.56162184", "0.5615727", "0.56130666", "0.5612468", "0.5608483", "0.5601035", "0.56000024", "0.55856943", "0.5582325", "0.55793846", "0.55779725", "0.55674934", "0.55671537", "0.5565936", "0.5560211", "0.5551162", "0.55506504", "0.5540038", "0.55367935", "0.55145", "0.5503784", "0.55017084", "0.54982597", "0.5497861", "0.54958946", "0.54958946", "0.54923725", "0.54802597", "0.54755", "0.54755", "0.5472949", "0.54642504", "0.5463224", "0.54625404", "0.545685", "0.5456333", "0.5452777", "0.5451622", "0.54452354", "0.5444857", "0.5438336" ]
0.73485094
2
Jaden Smith Case Make a `jadenCase` function that takes a string as parameter and return the string with each words capitilized. Example : "How are you ?" > "How Are You ?"
function jadenCase(stringToUp){ let recupTable =[]; recupTable = stringToUp.split(' '); for(let i = 0; i< recupTable.length; i++){ recupTable[i] = recupTable[i].charAt(0).toUpperCase() + recupTable[i].slice(1); } return recupTable.join(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jadenCase(s) {\n let arr = s.toLowerCase().split(' ');\n\n for (let i = 0; i < arr.length; i++) {\n let word = arr[i].split(\"\");\n word[0] = word[0].toUpperCase();\n arr[i] = word.join(\"\");\n }\n return arr.join(\" \");\n}", "function jadenCase(string) {\n let array = string.split(\" \");\n\n for (let i = 0; i < array.length; i++) {\n let word = array[i].split('');\n word[0] = word[0].toUpperCase();\n array[i] = word.join('');\n\n }\n\n return array.join(' ');\n}", "function jadenCase(string) {\n return string.replace(/\\b./g , function(a) {return a.toUpperCase();});\n}", "function jadenCase (str) {\n var strTemp = str.split(\" \");\n var strResult = [];\n for (let i = 0; i < strTemp.length; i++) {\n strResult.push(strTemp[i].charAt(0).toUpperCase() + strTemp[i].slice(1).toLowerCase());\n }\n return strResult.join(\" \");\n}", "function jadenCase(x){\n\treturn x.split('').map((v,i,t)=>i==0||t[i-1]===' '?v.toUpperCase():v).join('');\n}", "function staggeredCase(input) {\n\n}", "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "function titleCase(str) {\n //The map() method creates a new array with the results of calling a provided function on every element in the calling array.\n return str.toLowerCase().split(\" \").map(function(word) {\n //The replace() method returns a new string with some or all matches of a pattern replaced by a replacement.\n return word.replace(word[0], word[0].toUpperCase());\n}).join(\" \");\n }", "function toTitleCase(str)\n //Make string words start with caps. hello world = Hello World.\n{\n return str.replace(/\\w\\S*/g,\n function(txt){\n return txt.charAt(0).toUpperCase() +\n txt.substr(1).toLowerCase();\n });\n}", "function jadenCase(str)\n{\n let tab = str.split(\" \");\n let chaine = \"\";\n let max = tab.length;\n for(let i=0; i<max; i++)\n if(i===max-1)\n chaine += mettreMaj(tab[i]);\n else\n chaine += mettreMaj(tab[i])+\" \";\n return chaine;\n}", "function change_case(words) {\n let string = \"\";\n for (let i = 0; i < words.length; i++) {\n if (/[A-Z]/.test(words[i])) string += words[i].toLowerCase();\n else string += words[i].toUpperCase();\n }\n return string;\n}", "function toTitleCase(x) {\n var smalls = [];\n var articles = [\"A\", \"An\", \"The\"].forEach(function(d){ smalls.push(d); })\n var conjunctions = [\"And\", \"But\", \"Or\", \"Nor\", \"So\"].forEach(function(d){ smalls.push(d); })\n var prepositions = [\"As\", \"At\", \"By\", \"Into\", \"It\", \"In\", \"For\", \"From\", \"Of\", \"Onto\", \"On\", \"Out\", \"Per\", \"To\", \"Up\", \"Upon\", \"With\"].forEach(function(d){ smalls.push(d); });\n \n x = x.split(\"\").reverse().join(\"\") + \" \"\n\n x = x.replace(/['\"]?[a-z]['\"]?(?= )/g, function(match){return match.toUpperCase();})\n\n x = x.split(\"\").slice(0, -1).reverse().join(\"\")\n\n x = x.replace(/ .*?(?= )/g, function(match){\n if(smalls.indexOf(match.substr(1)) !== -1)\n return match.toLowerCase()\n return match\n })\n\n x = x.replace(/: .*?(?= )/g, function(match){return match.toUpperCase()})\n\n //smalls at the start of sentences shouldbe capitals. Also includes when the sentence ends with an abbreviation.\n x = x.replace(/(([^\\.]\\w\\. )|(\\.[\\w]*?\\.\\. )).*?(?=[ \\.])/g, function(match) {\n var word = match.split(\" \")[1]\n var letters = word.split(\"\");\n\n letters[0] = letters[0].toUpperCase();\n word = letters.join(\"\");\n\n if(smalls.indexOf(word) !== -1) {\n return match.split(\" \")[0] + \" \" + word;\n }\n\n return match\n })\n \n return x\n }", "function titleCase(str) {\n var wordsCap = str.split(\" \");\n var newArr = wordsCap.map(function(x){\n var ltrs = x.split('');\n var newWord = \"\"\n for (var i = 0; i < ltrs.length; i++){\n if (i==0){\n newWord += ltrs[i].toUpperCase()\n } else {\n newWord += ltrs[i].toLowerCase();\n }\n\n }\n return newWord;\n });\n return newArr.join(\" \");\n}", "function jadenCase(key) {\n const a = key.toLowerCase().split(' ')\n\n for (let i = 0; i < a.length; i++) {\n a[i] = a[i].charAt(0).toUpperCase() + a[i].substring(1)\n }\n\n return a.join(' ')\n}", "function DifferentCases(str) {\n str = str\n .replace(/[\\W\\d]/gi, ' ')\n .toLowerCase()\n .split(' ');\n\n str = str.map((word) =>\n word.length > 1\n ? word[0].toUpperCase() + word.slice(1).toLowerCase()\n : word[0].toUpperCase()\n );\n\n return str.join('');\n}", "function titleCase(str) {\n var arr = str.split(' ');\n \n for (var i = 0; i < arr.length; i++) {\n arr[i] = arr[i].toLowerCase();\n var upper = arr[i].charAt(0);\n arr[i] = arr[i].replace(upper, upper.toUpperCase());\n }\n \n jaydenSpeak = arr.join(' ');\n \n return jaydenSpeak;\n}", "function titleCase(str) { console.log('IN ZERO-0: ' + str); // \"IN ZERO-0: i'M a lITtlE teA pOt\"\n words = str.toLowerCase().split(' '); console.log('IN ONE-1: ' + words); // \"IN ONE-1: i'm,a,little,tea,pot\"\n\n for(var i = 0; i < words.length; i++) {\n var letters = words[i].split(''); console.log('IN TWO-2: ' + letters); // \"IN TWO-2: (1) i,',m\" \"(2) a\" \"(3) l,i,t,t,l,e\" \"(4) t,e,a\" \"(5) p,o,t\"\n letters[0] = letters[0].toUpperCase(); console.log('IN THREE-3: ' + letters); // \"IN THREE-3: (1) I,',m\" \"(2) A\" \"(3) L,i,t,t,l,e\" \"(4) T,e,a\" \"(5) P,o,t\"\n words[i] = letters.join(''); console.log('IN FOUR-4: ' + words); // \"IN FOUR-4: (1) I'm,a,little,tea,pot\" \"(2) I'm,A,little,tea,pot\"\n } // \"(3) I'm,A,Little,tea,pot\" \"(4) I'm,A,Little,Tea,pot\" \"(5) I'm,A,Little,Tea,Pot\"\n return words.join(' ');\n}", "function titlecase(str){\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function camelCase(text){\n let words = text.split(\" \");\n var ans=\"\";\n for(var j=0;j<words.length;j++){\n ans += words[j].substr(0,1).toUpperCase();\n ans += words[j].substr(1,)\n ans += \" \";\n }\n return ans;\n}", "function titleCase(str) {\n var words = str.toLowerCase().split(' ');\n //console.log(words);\n var caps = words.map(function(word) {\n return word.charAt(0).toUpperCase() + word.substring(1, word.length);\n }).join(' ');\n\n return caps;\n}", "function titleCase(str) {return str.toLowerCase().replace(/^[a-z]|\\s[a-z]/g,\nfunction(m){return m.toUpperCase();\n });\n }", "function toTitleCaseStrong(str) {\n if (!str) {\n return str;\n }\n var allCaps = (str === str.toUpperCase());\n \n \n str = str.replace(/\\b([^\\W_\\d][^\\s-\\/]*) */g, function(txt) {\n return ((txt === txt.toUpperCase()) && !allCaps) ? txt : txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n // Cap O'Reilley's, L'Amour, D'Artagnan as long as 5+ letters\n str = str.replace(/[oOlLdD]'[A-Za-z']{3,}/g, function(txt) {\n return ((txt === txt.toUpperCase()) && !allCaps) ? txt : txt.charAt(0).toUpperCase() + txt.charAt(1) + txt.charAt(2).toUpperCase() + txt.substr(3).toLowerCase();\n });\n // Cap McFarley's, as long as 5+ letters long\n str = str.replace(/[mM][cC][A-Za-z']{3,}/g, function(txt) {\n return ((txt === txt.toUpperCase()) && !allCaps) ? txt : txt.charAt(0).toUpperCase() + txt.charAt(1).toLowerCase() + txt.charAt(2).toUpperCase() + txt.substr(3).toLowerCase();\n });\n // anything sith an \"&\" sign, cap the word after &\n str = str.replace(/&\\w+/g, function(txt) {\n return ((txt === txt.toUpperCase()) && !allCaps) ? txt : txt.charAt(0) + txt.charAt(1).toUpperCase() + txt.substr(2);\n });\n \n str = str.replace(/[^ ]+/g, function(txt) {\n var txtLC = txt.toLowerCase();\n return (ignoreWords.indexOf(txtLC) > -1) ? txtLC : txt;\n });\n str = str.replace(/[^ ]+/g, function(txt) {\n var txtLC = txt.toUpperCase();\n return (capWords.indexOf(txtLC) > -1) ? txtLC : txt;\n });\n str = str.charAt(0).toUpperCase() + str.substr(1);\n return str;\n }", "function f(str) {\n const words = str.split(' ');\n let capitalizedWords = [];\n for (let i = 0; i < words.length; i++) {\n const capitalizedWord = words[i].charAt(0).toUpperCase() + words[i].slice(1).toLowerCase();\n capitalizedWords.push(capitalizedWord);\n }\n return capitalizedWords.join(' ');\n}", "function titlecase(str) {\n return str.split(' ').map((word) => word[0].toUpperCase() + word.slice(1)).join(' ');\n}", "function titleCase(str){\n\n var titlecased=str.split(\" \");\n \n for(var i=0;i<titlecased.length;i++){\n \n titlecased[i]=titlecased[i].toLowerCase().replace(titlecased[i][0].toLowerCase(),titlecased[i][0].toUpperCase());\n \n }\n\n titlecased=titlecased.join(' ');\n\n return titlecased;\n}", "toTitleCase(phrase) {\n return phrase\n .toLowerCase()\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n }", "function wordToUpper(strSentence) {\r\n return strSentence.toLowerCase().replace(/\\b[a-z]/g, convertToUpper);\r\n\r\n function convertToUpper() { \r\n\t\treturn arguments[0].toUpperCase(); \r\n\t} \r\n}", "function everyWordCapitalized(aPhrase) {\n var becomeAnArray = aPhrase.split(\" \");\n \n for (var i=0; i<becomeAnArray.length; i++){\n var firstChar = becomeAnArray[i].charAt(0);\n var rest = becomeAnArray[i].substring(1);\n \n \n \n firstChar = firstChar.toUpperCase();\n rest = rest.toLowerCase();\n becomeAnArray[i] = firstChar + rest;\n \n }\n \n return becomeAnArray.join(\" \");\n}", "function jadenCase(string) {\n var capitalized_array = [];\n var capitalized_string = \"\";\n var array = string.split(' ');\n array.forEach(element => {\n var elt = element.charAt(0).toUpperCase() + element.slice(1,element.lenght);\n capitalized_string = capitalized_string + \" \" + elt;\n });\n capitalized_array = capitalized_array + [capitalized_string];\n return capitalized_array;\n}", "titleCase(string) {\n var sentence = string.toLowerCase().split(\" \");\n for(var i = 0; i< sentence.length; i++){\n sentence[i] = sentence[i][0].toUpperCase() + sentence[i].slice(1);\n }\n \n return sentence.join(\" \");\n }", "function LetterCapitalize(str) {\n\nlet words = str.split(' ')\n\nfor ( i = 0 ; i < words.length ; i++) {\n\n words[i] = words[i].substring(0,1).toUpperCase() + words[i].substring(1)\n\n}\n\nwords = words.join(' ')\nreturn words\n\n}", "function f(str) {\n let split = str.split('');\n let cap = [];\n cap.push(str.charAt(0).toUpperCase());\n for (l = 1; l < str.length; l++) {\n cap.push(split[l].toLowerCase());\n }\n return(cap.join(''));\n}", "function Capitaliser(input) {\n const eachWord = input.split(\" \");\n for (let index = 0; index < eachWord.length; index++) {\n eachWord[index] = eachWord[index][0].toUpperCase() + eachWord[index].substr(1);\n }\n return eachWord.join(\" \");\n}", "function titleCase(s){\n s=s.toLowerCase().trim();\n \n l = s.split(\" \");\n for(i=0; i<l.length; i++){\n l[i] = l[i][0].toUpperCase() + l[i].slice(1);\n };\n s = l.join(\" \");\n return s;\n}", "function capitalizeAllWords(string) {\n// will use .toLower case and .split to lowercase and put in an array\nvar myArr = string.toLowerCase().split(\" \")\n// will use for loop to itterate over array\nfor(var i = 0; i < myArr.length; i++){\n // Will use charAt to return the character in string\n // will use toUpperCase to uppercase the first characters\n //will use .slice to add remaing array\n myArr[i] = myArr[i].charAt(0).toUpperCase() + myArr[i].slice(1);\n}\n // use join() to turn array to string and return\n return myArr.join(\" \");\n}", "function titleCase(str) {\n words = str.toLowerCase().split(' '); // Converts the string to lower case and splits it into an array of substrings\n\n for(var i = 0; i < words.length; i++) { // Loops the number of words in the array using str.length\n var letters = words[i].split(''); // Loops throuch each word and splits it into an array of letters\n letters[0] = letters[0].toUpperCase(); // Converts the first letter of each word to uppercase\n words[i] = letters.join(''); // Converts the array of letters back into a string of words\n }\n return words.join(' '); // Converts the array of words back into a string of words separated by spaces\n}", "function toTitleCase(str)\n{\nreturn str.replace(/\\w\\S*/g, function(txt){ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });\n}", "function titleCase(str) {\nreturn str.replace(/\\w\\S*/g, function(txt) { // Checks for a character then zero or more non-white space\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); // replaces the first char with a CAP letter\n}", "function titleCases(arg){\n return arg.charAt(0).toUpperCase() + arg.substring(1);\n }", "function titleCase(str) {\nreturn str.replace(/\\w\\S*/g, function(txt) { // Checks for a character then zero or more non-white space\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); // Replaces the first char with a CAP letter\n}", "function titleCase(str) {\n var arr = str.split(' ');\n var newArr = arr.map(function(word) {\n \t return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); \n });\n strNew = newArr.join(' ');\n return strNew;\n}", "function titleCase(str) {\n return str.split(/\\s+/).map(function(word) {\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n }).join(\" \");\n}", "function caps(a) {return a.substring(0,1).toUpperCase() + a.substring(1,a.length);}", "function titleCase(str) {\n //put each word in array\n let lowerCase = str.toLowerCase().split(' ');\n //capitalize each word in array\n let capitalized = lowerCase.map(function(value) {\n return value.substring(0,1).toUpperCase() + value.substring(1);\n });\n //convert array back to string\n return capitalized.join(' ');\n \n}", "function caseAdapter(before, after) {\n var beforeCase = before.split(\"\");\n var afterCase = after.split(\"\");\n\n for(var i = 0; i < Math.min(before.length, after.length); i++) {\n if(before.charAt(i) === before.charAt(i).toUpperCase())\n afterCase[i] = afterCase[i].toUpperCase();\n else\n afterCase[i] = afterCase[i].toLowerCase();\n }\n\n return afterCase.join(\"\");\n}", "function capSentence(text) {\n let wordsArray = text.toLowerCase().split(\" \");\n let capsArray = wordsArray.map((word) => {\n //We use .map() function to loop through every word in the array and execute the same function as before to create capsArray.\n return word[o].toUpperCase() + word.slice(1);\n });\n\n return capsArray.join(\" \");\n}", "function capitalizeAllWords(string) {\n return string.replace(/\\b\\w/g, function(string){ \n return string.toUpperCase(); \n });\n}", "function titleCase(str) {\n return str.split(' ').map(word => word[0].toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n}", "function wordCase(str) {\n // can use _.chain _.words _.map _.upperFirst _.join _.value\n str = str.replace(/([A-Z]+)/g, ' $1')\n .replace(/([A-Z][a-z])/g, ' $1')\n .replace(/(^|\\s)[a-z]/g, function upperCase(str) {\n return str.toUpperCase();\n });\n return str;\n }", "function caseFix(str) {\n str = str.toLowerCase().split(' ');\n var newTitle = [];\n for (var i = 0; i < str.length; i++) {\n newTitle.push(str[i][0].toUpperCase() + str[i].slice(1));\n title = newTitle.join(' ');\n }\n //console.log(title);\n return title;\n} //End caseFix stored function", "function f(str) {\n if ( typeof(str) !== \"string\" )\n return undefined;\n let strArr = str.split(\" \");\n for (let i = 0; i < strArr.length; i++)\n {\n strArr[i] = strArr[i].toLowerCase();\n let fLetter = strArr[i].charAt(0).toUpperCase();\n strArr[i] = fLetter + strArr[i].slice(1);\n\n // // capiitalized.push(\n // words[i].charAt(0).toUpperCase() + words[i].slice(1).toLowerCase()\n // );\n // //\n \n }\n return strArr.join(\" \");\n}", "function titleCase(str) {\n // Mutating str (oh no!) to an array of lowercase words using split() by a space \n str = str.toLowerCase().split(' ');\n // Iterating through str\n for (var i = 0; i < str.length; i++){\n // capitalLetter is first letter of current word -> made uppercase \n capitalLetter = str[i].charAt(0).toUpperCase();\n // replacing the first letter in current word with capitalLetter\n str[i] = str[i].replace(/[a-z]/, capitalLetter);\n }\n // str = str array joined into a single string\n str = str.join('');\n return str;\n }", "function titleCase(str) {\r\n var words = str.toLowerCase().split(' ');\r\n var charToCapitalize;\r\n\r\n for (var i = 0; i < words.length; i++) {\r\n charToCapitalize = words[i].charAt(0);\r\n // words[i] = words[i].replace(charToCapitalize, charToCapitalize.toUpperCase()); // works only if first letter is not present elsewhere in word\r\n words[i] = words[i].charAt(0).toUpperCase().concat(words[i].substr(1));\r\n }\r\n\r\n return words.join(' ');\r\n}", "function camelizingStrings ( strInput ){\n var strToArr = strInput.split(' ');\n var firstLetterUpperNoSpaces = strToArr.map( elem => \n elem[0].toUpperCase() + elem.slice(1)\n ).join('');\n return `The camelcase version of ${strInput} is :${firstLetterUpperNoSpaces}`;\n}", "function capitalizeLetters(str) {\r\n\r\n let strArr = str.toLowerCase().split(' '); //lowercase all the words and store it in an array.\r\n console.log(\"outside: \" + strArr); //Testing use for checking\r\n //iterate through the array\r\n //Add the first letter of each word from the array with the rest of the letter following each word\r\n //Ex) L + ove = Love;\r\n for(let i = 0; i < strArr.length; i++){\r\n strArr[i] = strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\r\n }\r\n return strArr.join(\" \"); //put the string back together.\r\n\r\n // const upper = str.charAt(0).toUpperCase() + str.substring(1);\r\n // return upper;\r\n}", "function changeCase() {\n let text = 'This IS a Sample TeXt';\n var newtext = \"\";\n for(var i = 0; i<text.length; i++){\n if(text[i] === text[i].toLowerCase()){\n newtext += text[i].toUpperCase();\n }else {\n newtext += text[i].toLowerCase();\n }\n }\n return newtext;\n}", "function capitalizeAllWords(string) {\n var splitStr = string.toLowerCase().split(' ');\n \nfor (var i = 0; i < splitStr.length; i++){\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n}\nreturn splitStr.join(' ');\n}", "function capitalize_Words(str) {\n return str.replace(/\\w\\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });\n}", "function capitalizeAllWords(words){\n return words.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function f(str) {\n let phrase = str.split(\" \");\n let newPhrase = [];\n for (i=0; i < phrase.length; i++) {\n let word = phrase[i];\n let newWord = [];\n for (j=0; j < word.length; j++) {\n if (j === 0) newWord.push(word[j].toUpperCase());\n if (j !== 0) newWord.push(word[j].toLowerCase());\n };\n newWord = newWord.join('');\n newPhrase.push(newWord);\n };\n console.log(newPhrase.join(' '));\n return newPhrase.join(' ');\n}", "function capitalizeLetters(str) {\n// const strArr = str.toLowerCase().split(' ');\n\n// for(let i = 0; i< strArr.length; i++){\n// strArr[i] = strArr[i].substr(0,1).toUpperCase() + strArr[i].substr(1);\n// }\n\n// return strArr.join(' ');\n\n///////////////////////////////////////////////////////////\n\n return str\n .toLowerCase()\n .split(' ')\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(' ');\n}", "function whisper(string){ return string.toLowerCase() }", "function toCamelCase(str){\n // if empty string, return an empty string\n if(str === '') return ''\n // Using Regex it will replace all Non-characters with whitespace to keep the words separate\n str = str.replace(/[^a-zA-Z]+/ig, ' ')\n // split the string into an array of words\n let split = str.split(' ')\n let cap = [];\n // Loop through array and capitalize every first letter of each word\n for(let i = 0; i < split.length; i++) {\n cap.push(split[i][0].toUpperCase()+split[i].slice(1))\n }\n // check if first letter of first work in original str was lowercase and if so make that letter \n // lowercase, otherwise leave it as is\n if(str[0] === str[0].toLowerCase()) {\n cap = cap[0][0].toLowerCase()+cap[0].slice(1)+cap.slice(1)\n return cap.replace(/[^a-zA-Z]+/ig, '')\n } else {\n return cap.join('') \n }\n}", "function wordCap(string) {\n return string.split(' ')\n .map((word) => word[0].toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n}", "function titleCase(str) {\n str = str.toLowerCase().split(' '); // will split the string delimited by space into an array of words\n\n for(var i = 0; i < str.length; i++){ // str.length holds the number of occurrences of the array...\n str[i] = str[i].split(''); // splits the array occurrence into an array of letters\n str[i][0] = str[i][0].toUpperCase(); // converts the first occurrence of the array to uppercase\n str[i] = str[i].join(''); // converts the array of letters back into a word\n }\n return str.join(' '); // converts the array of words back to a sentence\n}", "function applyCase(wordA, wordB) {\n\t// Exception to avoid words like \"I\" being converted to \"ME\"\n\tif (wordA.length === 1 && wordB.length !== 1) return wordB;\n\t// Uppercase\n\tif (wordA === wordA.toUpperCase()) return wordB.toUpperCase();\n\t// Lowercase\n\tif (wordA === wordA.toLowerCase()) return wordB.toLowerCase();\n\t// Capitialized\n\tvar firstChar = wordA.slice(0, 1);\n\tvar otherChars = wordA.slice(1);\n\tif (firstChar === firstChar.toUpperCase() && otherChars === otherChars.toLowerCase()) {\n\t\treturn wordB.slice(0, 1).toUpperCase() + wordB.slice(1).toLowerCase();\n\t}\n\t// Other cases\n\treturn wordB;\n}", "function toTitleCase(str)\n{\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1);});//useto be+ txt.substr(1).toLowerCase()\n}", "function toTitleCase(str)\n{\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function toTitleCase(str)\n{\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function toTitleCase(str)\n{\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function toTitleCase(str)\n{\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function toTitleCase(str)\n{\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function titleCase(str) {\n var arrayOfStrings = str.split(' ');\n //Splits one string into an array separated by spaces\n for(var i = 0; i < arrayOfStrings.length; i++) {\n var placeholder = arrayOfStrings[i];\n //Placeholder for original string\n var upperLetter = placeholder.charAt(0).toUpperCase();\n //Selects first letter and uppercases it\n placeholder = placeholder.slice(1, placeholder.length).toLowerCase();\n //Selects 2nd letter to end of the word and lowercases it\n arrayOfStrings[i] = upperLetter.concat(placeholder);\n //Concats uppercase letter with rest of lowercase word\n }\n\n str = arrayOfStrings.join(' ');\n //Takes array and sets str to a single string\n return str;\n}", "function inName(name){\n name = name.trim().split(' ');\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n return name[0] + ' ' + name[1];\n}", "function capLettersA(str) {\n return str\n .toLowerCase()\n .split(' ')\n .map( word => word[0].toUpperCase() + word.substr(1))\n .join(' ');\n}", "function titlecase(val, conjunctions) {\n if (!is_1.isValue(val))\n return null;\n // conjunctions\n var conj = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\\.?|via)$/i;\n return val.replace(/[A-Za-z0-9\\u00C0-\\u00FF]+[^\\s-]*/g, function (m, i, t) {\n if (i > 0 && i + m.length !== t.length &&\n m.search(conj) > -1 && t.charAt(i - 2) !== ';' &&\n (t.charAt(i + m.length) !== '-' || t.charAt(i - 1) === '-') &&\n t.charAt(i - 1).search(/[^\\s-]/) < 0) {\n if (conjunctions === false)\n return capitalize(m);\n return m.toLowerCase();\n }\n if (m.substr(1).search(/[A-Z]|\\../) > -1)\n /* istanbul ignore next */\n return m;\n return m.charAt(0).toUpperCase() + m.substr(1);\n });\n}", "function titleCase(str) {\n\treturn str.toLowerCase().split(' ').map((word) => word.replace(word[0], word[0].toUpperCase())).join(' ');\n\t}", "function titleCase(s) {\n let temp = s.toLowerCase()\n temp = s.split(\" \");\n for (let i = 0; i < temp.length; i++) {\n temp [i]= temp[i][0].toUpperCase()+temp[i].substring(1,temp[i].length)\n } \n return temp;\n}", "function titleCase(str) {\r\n return str.toLowerCase().split(\" \").map(function(str){return str.replace(str[0],str[0].toUpperCase());}).join(\" \");\r\n}", "function CapitalizeWord(str)\n {\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n }", "function inName(name) {\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n}", "function inName(name) {\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n}", "function toTitleCase(str){\n\treturn str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function inName(name) {\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n}", "function inName(name){\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n return name[0] + \" \" + name[1];\n\n}", "function sentenceCase (str) {\n return str.replace(/[a-z]/i, letter => letter.toUpperCase()).trim()\n }", "function camelCase(str) {\n return str.replace(/\\W+(.)/g, function(str)\n {\n return str.toUpperCase();\n });\n}", "function sc_string_capitalize(s) {\n return s.replace(/\\w+/g, function (w) {\n\t return w.charAt(0).toUpperCase() + w.substr(1).toLowerCase();\n });\n}", "function titleCase(str){\n var arr=str.split(\" \");\n var result=arr.map(\n function(val){\n return val.toLowerCase();\n });\n return result;\n }", "function slowercase(s) {\n return s.toLowerCase()\n}", "function capitalizeAllWords(string) {\n //I-string of words\n //O-each word capitalized\n //C-\n //E-\n \n //Ok, I should split the strings by spaces, then do the individual words.\n let arrayWords = string.split(\" \");\n //Now I have an array of strings. So loop through the array to cap\n for(let i = 0; i <= arrayWords.length-1; i++) {\n let arrayInd = [];\n arrayInd = arrayWords[i].split(\"\");\n arrayInd[0] = arrayInd[0].toUpperCase();\n arrayWords[i] = arrayInd.join(\"\");\n }\n string = arrayWords.join(\" \");\n return string;\n}", "function titleCase(str) {\n console.log(str);\n let arr = str.split(\" \");\n let c = [];\n\n for (let i = 0; i < arr.length; i++) {\n let letters = arr[i].split(\"\");\n let a = [];\n for (let j = 0; j < letters.length; j++) {\n if (j === 0) {\n let capital = letters[j].toUpperCase();\n a.unshift(capital);\n } else {\n let lower = letters[j].toLowerCase();\n a.push(lower);\n }\n }\n let b = a.join(\"\");\n c.push(b);\n }\n\n let d = c.join(\" \");\n console.log(d);\n return d;\n}", "function titleize(str) {\n let split = str.split(' ');\n let lowerCase = [\"a\", \"and\", \"of\", \"over\", \"the\"];\n let results = [];\n\n for (let i = 0; i < split.length; i++) {\n let capitolized = split[i][0].toUpperCase() + split[i].slice(1);\n\n if (!lowerCase.includes(split[i])) {\n results.push(capitolized)\n } else if (lowerCase.includes(split[i]) && i == 0) {\n results.push(capitolized)\n } else {\n results.push(split[i])\n }\n }\n\n return results.join(' ')\n}", "function capitalize( str , echo){\n var words = str.toLowerCase().split(\" \");\n for ( var i = 0; i < words.length; i++ ) {\n var j = words[i].charAt(0).toUpperCase();\n words[i] = j + words[i].substr(1);\n }\n if(typeof echo =='undefined')\n return words.join(\" \");\n else\n return str;\n}", "function titleCase(str) {\n\n // convert str to lowercase\n let strLower = str.toLowerCase();\n \n // split strLower into array of words\n let arrLowerStr = strLower.split(' ');\n\n // loop through array, title case each word\n // first letter use .charAt(0).toUpperCase()\n // rest of word to end use .slice(1)\n for (let i=0; i<arrLowerStr.length; i++) {\n arrLowerStr[i] = arrLowerStr[i].charAt(0).toUpperCase() + arrLowerStr[i].slice(1); \n }\n\n // join array to strResult\n let strResult = arrLowerStr.join(' ')\n \n return strResult;\n}", "function LetterCapitalize(str) { \n let words = str.split(' ');\n for (let i = 0; i < words.length; i++) {\n let word = words[i][0].toUpperCase() + words[i].slice(1);\n words[i] = word;\n }\n return words.join(' ');\n}", "function capitalise(s){\n let ns = [];\n for(let w of s.split(\" \")){\n ns.push(w[0].toUpperCase() + w.slice(1));\n }\n return ns.join(\" \");\n}", "function capitalizeWords(input) {\n\n let wordInput = input.split(' ');\n\n for (let i = 0; i < wordInput.length; i++) {\n var lettersUp = ((wordInput[i])[0]).toUpperCase();\n wordInput[i] = wordInput[i].replace((wordInput[i])[0], lettersUp);\n }\n return console.log(wordInput.join(\" \"));\n}", "function LetterCapitalize(str) { \n return str\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}" ]
[ "0.76919526", "0.75028086", "0.7464632", "0.7378544", "0.73091507", "0.72941816", "0.71504396", "0.71504396", "0.7107428", "0.7106955", "0.7092398", "0.70483035", "0.70457613", "0.7027449", "0.70124775", "0.69962806", "0.69912964", "0.6988485", "0.6967147", "0.69617444", "0.69498885", "0.6927985", "0.69266176", "0.6896786", "0.6853786", "0.68323004", "0.681812", "0.6808297", "0.6804648", "0.6800568", "0.6794073", "0.67861414", "0.67640233", "0.67628604", "0.67478883", "0.6736324", "0.6731975", "0.67235625", "0.67210764", "0.6720319", "0.66974556", "0.66950756", "0.6692165", "0.6689714", "0.66832906", "0.66771156", "0.6672468", "0.6672392", "0.6664877", "0.66635925", "0.66560304", "0.66518784", "0.66441333", "0.66409564", "0.6640066", "0.66389453", "0.66384727", "0.6634178", "0.66236424", "0.66228426", "0.66137344", "0.6609038", "0.6605775", "0.66016835", "0.66013306", "0.6598698", "0.65958697", "0.65956396", "0.6594151", "0.6594151", "0.6594151", "0.6594151", "0.6594151", "0.65933007", "0.65830326", "0.6579946", "0.65763766", "0.65759295", "0.65738636", "0.65677464", "0.6564925", "0.65648943", "0.65648943", "0.65645754", "0.6561867", "0.65550137", "0.65546745", "0.6547308", "0.6546361", "0.6541579", "0.6535842", "0.6535163", "0.6531548", "0.65315235", "0.65252787", "0.6522937", "0.652199", "0.65216553", "0.6519306", "0.651672" ]
0.7361831
4
Add all cities to the list console.log(CITIES[0]);
function appendCity(city, resultDate, result, resultShorthand) { let cityHTML = ` <tr class="${result === 'Clear' ? 'positive' : 'negative'}"> <td> ${resultShorthand ? `<img src="https://www.metaweather.com/static/img/weather/${resultShorthand}.svg" class="ui mini centered image">` : '' } </td> <td data-label="City">${city.name}</td> <td data-label="City ID">${city.cityId}</td> <td data-label="Weather State" class="result">${result === 'Clear' ? 'Sunny' : result}</td> <td data-label="Weather Date">${resultDate}</td> </tr> `; // Update progress $('#load-status').text(`Loading ${city.cityIndex+1}/${city.total}`) if (city.cityIndex >= city.total-2) { $('#load-status').text('') } // Add the city result $('#city-list').append(cityHTML); // sort the table sortTable(3, 'text'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCitiesList() {\n var self = this\n var cities = indianCitiesDatabase.cities\n self.json(cities)\n}", "function getCities(){\n //if there are items in a stored 'cities' key, grab them and push to cities arr\n if (localStorage.getItem(\"cities\")) {\n const savedCities = JSON.parse(localStorage.getItem(\"cities\"))\n cities.push(...savedCities)\n }\n }", "function loadCityList(r) {\n if (r && r.value) {\n autocomp.savedCities = r.value;\n } else{\n autocomp.initializeCities();\n }\n }", "setCities(cities) {\n let result = [];\n cities.forEach((city) => {\n result.push(city.city)\n //console.log(this.state)\n });\n return this.setState({ justCities: result })\n }", "setCities(cities) {\n let result = [];\n cities.forEach((city) => {\n result.push(city.city)\n //console.log(this.state)\n });\n return this.setState({ justCities: result })\n }", "function getCities() {\n var storedCities = localStorage.getItem(\"storeCity\");\n\n //this will give back cities array\n return JSON.parse(storedCities) || [];\n }", "function initCityList() {\n var storedCities = JSON.parse(localStorage.getItem(\"cities\"));\n \n if (storedCities !== null) {\n cityList = storedCities;\n }\n \n renderCities();\n }", "function createCitiesArray() {\n\tfor (var i = 0; i < $('.bay').length; i++) {\n\tcitiesOnMap.push($('.bay').eq(i).attr('data'));\n\t}\n\tfetchData(citiesOnMap);\n}", "function getCities() {\n\n var storedCities = JSON.parse(localStorage.getItem(\"cityArray\"));\n\n if (storedCities !== null) {\n cityArray = storedCities;\n }\n //render array to the dom\n renderCityList();\n}", "function initialize(){\n cities();\n}", "function initialize(){\n cities();\n}", "function initialize(){\n cities();\n}", "function initialize(){\n cities();\n}", "function listCities(req, res, next) {\n // add city\n cityService.listCities().then(function (data) {\n res.status(200).json({\n status: 'success',\n data: data,\n message: 'Retrieved City List'\n })\n }).catch(function (err) {\n return next(err);\n })\n}", "static addCity(city) {\n\t\tdestinationCities.push(city);\n\t}", "function displayCities() {\n var citiesInStorage = getCities();\n var citiesList = citiesInStorage.map(function (city) {\n var div = $(`<div class=\"cityChoice\">${city}</div>`);\n div.on(\"click\", cityClicked);\n return div;\n });\n //console.log(citiesList)\n $(\"#searchedCities\").html(citiesList);\n return citiesInStorage;\n }", "function renderCitiesList() {\n pastCities.innerHTML = \"\";\n for (var i = 0; i < cities.length; i++) {\n var li = document.createElement(\"li\");\n li.textContent = cities[i];\n pastCities.appendChild(li);\n li.setAttribute(\n \"class\",\n \"list-group-item bg-warning text-white justify-content-center\"\n );\n \n }\n}", "function initialize() {\n\tcities();\n}", "function populateCities() {\n let list = fetch(citiesUrl)\n .then((res) => res.json())\n .then((json) => {\n json.forEach((item, i) => {\n let infos = item.nom + \" - \" + item.codesPostaux[0];\n let option = new Option(infos, infos);\n document.querySelector(\"#cities\").appendChild(option);\n });\n });\n}", "function recentCitiesList() {\n for (var i = 0; i < 8; i++) {\n index = i + 1;\n $(\"#city-\" + index).text(savedCities[i]);\n };\n }", "function loadCities() {\n\tvar request = new XMLHttpRequest();\n\tvar url = \"/cities\";\n\n\trequest.open(\"GET\", url, true);\n\trequest.onreadystatechange = function() {\n\t\tif (request.readyState === 4 && request.status === 200) {\n\t\t\tvar select = document.getElementById(\"city_selector\");\n\t\t\tvar cities = JSON.parse(request.responseText);\n\t\t\tfor(i in cities) {\n\t\t\t\tvar opt = document.createElement(\"option\");\n\t\t\t\topt.innerHTML = cities[i]\n\t\t\t\tselect.appendChild(opt);\n\t\t\t}\n\t\t}\n\t};\n\trequest.send();\n}", "function initialize(){\r\n\tcities();\r\n}", "function storeCityArray() {\n localStorage.setItem(\"cities\", JSON.stringify(cityList));\n }", "showAllCities (items) {\n let containsName = items.filter(item => item.name.toLocaleLowerCase().includes(this.searching.toLocaleLowerCase()) && item.fcodeName !== 'airport')\n\n containsName.forEach(place => {\n if (place.bbox) {\n let places = {\n 'key': place.name,\n 'value': place.countryName,\n 'north': place.bbox.north,\n 'south': place.bbox.south,\n 'west': place.bbox.west,\n 'east': place.bbox.east,\n 'lat': place.lat,\n 'lng': place.lng\n }\n this.cityPlace.push(places)\n }\n }\n )\n }", "function storedCityArray() {\n localStorage.setItem(\"cities\", JSON.stringify(cityList));\n }", "function addNewCity() {\n checkIfExists();\n cities.unshift(searchInput.value);\n cityLimit();\n}", "function storeCities() {\n var cityToBeAdded = inputCityEl.value;\n console.log(cityToBeAdded);\n\n // confirm there are no duplicates\n if (cityList.indexOf(cityToBeAdded) === -1) {\n cityList.push(cityToBeAdded);\n localStorage.setItem(\"cities\", JSON.stringify(cityList));\n }\n\n // Add the recently searched cities to the CityList\n renderCities();\n\n // Make the forecast request\n searchWeather(cityToBeAdded);\n}", "function displayCities() {\n // Emptying previous array\n $('#searchedCities').empty();\n // Taking the searched cities in the array and parsing them into a string\n let arrayStorage = JSON.parse(localStorage.getItem('inputCities')) || [];\n // Searched cities array length\n let arrayLength = arrayStorage.length;\n\n // Loop through the array with searched cities\n for (let i = 0; i < arrayLength; i++) {\n // Variable with city names from the array\n let cityName = arrayStorage[i];\n // Appending searched cities\n $('#searchedCities').append (\n // Appending a city list\n \"<div class= 'list-group'>\"\n // Appending every searched city as a call-back button\n + \"<button class='list-group-item'>\" + cityName + \"</button>\"\n );\n };\n }", "function populateCities(cities) {\n let cityDropdown = document.getElementById(\"cityDropdown\"),\n businessList = document.getElementById('businessList');\n\n cityDropdown.innerHTML = ''; // Delete Children\n businessList.innerHTML = ''; // Reset Business List\n console.log(cities);\n\n for (let i = 0; i < cities.length; i++) {\n let s = document.createElement('option');\n s.innerHTML = cities[i].business_city;\n s.value = cities[i].business_city;\n cityDropdown.appendChild(s);\n }\n document.getElementById(\"cityDropdown\").selectedIndex = -1; // Default city is set to empty\n}", "printPlacesLived() {\n console.log(this.name);\n console.log(this.cities);\n return this.cities.map(city => this.name + \" has lived in \" + city + \"!\");\n }", "function addCitiesLS(citySearch) {\n\n // adding to local storage, taking key to get items\n namesCity = localStorage.getItem(\"cityNames\");\n // taking string from local storage and putting back in original form\n namesCity = JSON.parse(namesCity) || [];\n namesCity.push(citySearch);\n // setting item from array to local storage\n localStorage.setItem(\"cityNames\", JSON.stringify(namesCity));\n\n //adds list item to unordered list and adds city names to screen\n let listItem = $(\"<li class='cityNameinList'>\");\n //adds data-info attribute\n let buttonItem = $(`<button class='buttonCity ${citySearch}'>`);\n \n\n //adds most recent city name and today's date to the dashboard\n mainCity.html(`${citySearch} &nbsp (${todaysDate})`);\n \n listofCities.append(listItem);\n listItem.append(buttonItem);\n buttonItem.html(citySearch);\n }", "addCity(city) {\n // If we already have the city in our map, nothing needs to be done.\n if (this.cities[city.text]) {\n return;\n }\n this._getWeather(city).then(data => {\n this.cities[city.text] = data;\n });\n }", "function saveList(city){\n cityList.push(city);\n localStorage.setItem('cities', JSON.stringify(cityList));\n}", "function creationCitylist() {\n let listSelectedCities = document.querySelector('.selected-city');\n let selectedCities = JSON.parse(localStorage[\"city-name\"])\n let tempCityList = \"\"\n for (let i = 0; i < selectedCities.length; i++) {\n selectedCities[i] = selectedCities[i].charAt(0).toUpperCase() + selectedCities[i].substr(1)\n tempCityList += `<li class=\"your-cities\">${selectedCities[i]}<span></span></li>`\n }\n listSelectedCities.innerHTML = tempCityList;\n selectCities()\n}", "function insertCitiesInDataList(input, event) {\n var inputValue = input.value;\n var dataList = document.querySelector(\"#city-list\");\n emptyCityList();\n var _loop_1 = function (city) {\n if ((inputValue.toLowerCase()) === (allCitiesList[city].locality.slice(0, inputValue.length).toLowerCase())) {\n var li_1 = document.createElement(\"li\");\n if (allCitiesList[city].locality !== allCitiesList[city].municipality) {\n li_1.innerHTML = allCitiesList[city].locality + \", \" + allCitiesList[city].municipality;\n }\n else {\n li_1.innerHTML = allCitiesList[city].locality;\n }\n li_1.setAttribute(\"index\", city);\n dataList.append(li_1);\n li_1.addEventListener(\"click\", function () {\n presentCityInInput(li_1);\n setCity(li_1.getAttribute(\"index\"));\n goToForecast();\n });\n }\n };\n for (var city in allCitiesList) {\n _loop_1(city);\n }\n transformInputField(event);\n}", "function storeCity(citySearch) {\n const cityDataObj = {\n city: citySearch\n \n }\n \n cities.push(cityDataObj);\n console.log(cities);\n window.localStorage.setItem('cityList', JSON.stringify(cities));\n window.localStorage.getItem('cityList');\n JSON.parse(window.localStorage.getItem('cityList'));\n displayCities();\n \n}", "function renderCities () {\n $(\"#cityList\").empty();\n for (i=0; i<cities.length; i++) {\n var cityDiv = $(\"<li>\");\n cityDiv.addClass(\"list-group-item savedCity\");\n cityDiv.attr(\"value\", cities[i]);\n cityDiv.text(cities[i]);\n // needed to re-establish the on-click event listener\n cityDiv.click(savedCityClick);\n $(\"#cityList\").prepend(cityDiv);\n }; \n}", "function getCities(){\n return $http.get('/cities')\n .then(handleResponse)\n .catch(handleError);\n }", "function addToList(){\n var inputField = document.getElementById(\"city\");\n var textValue = inputField.value;\n var indexOfSearch = dataObj.ponudjene.findIndex(item => textValue.toLowerCase() === item.toLowerCase());\n var indexOfData = (cities.length > 0) ? cities.findIndex(item => textValue.toLowerCase() === item.toLowerCase()) : -1;\n if(indexOfData === -1 && indexOfSearch !== -1){\n textValue = dataObj.ponudjene[indexOfSearch];\n createDomForCity(textValue);\n cities.push(textValue);\n inputField.value = '';\n }\n}", "function getCities() {\n var query = breeze.EntityQuery.from('Cities');\n // filter by country\n if (vm.searchCountry() !== '') {\n var pCountry = new breeze.Predicate('CountryName', '==', vm.searchCountry());\n }\n // filter by city\n if (vm.searchCity() !== '') {\n var pCity = new breeze.Predicate('CityName', '==', vm.searchCity());\n }\n // append filters to query\n var predicates = [];\n if (pCountry) {\n predicates.push(pCountry);\n }\n if (pCity) {\n predicates.push(pCity);\n }\n var filter = breeze.Predicate.and(predicates);\n query = query.where(filter);\n // Order by\n if (vm.selOrderBy() !== '') {\n query = query.orderBy(vm.selOrderBy() + ' ' + vm.selOrderType());\n }\n // execute query\n return manager\n .executeQuery(query)\n .then(querySucceeded)\n .fail(queryFailed);\n // reload vm.countries with the results \n function querySucceeded(data) {\n vm.cities(data.results);\n vm.show(true); // show the view\n }\n // error getting data\n function queryFailed(error) {\n alert(\"Query failed: \" + error.message);\n }\n }", "function renderCities(){\n $(\"#cityList\").empty();\n $(\"#cityInput\").val(\"\");\n \n for (i=0; i<cityList.length; i++){\n var a = $(\"<a>\");\n a.addClass(\"list-group-item list-group-item-action list-group-item-primary city\");\n a.attr(\"data-name\", cityList[i]);\n a.text(cityList[i]);\n $(\"#cityList\").prepend(a);\n } \n}", "async fetchCities() {\n // API call for get cities\n await axios\n .get(`${this.host}/cities/all`)\n .then((res) => {\n let data = \"\";\n res.data.forEach((city) => {\n data += `\n <option value=\"${city.name}\">${city._id}</option>\n `;\n });\n this._qs(\".area\") != null\n ? (this._qs(\n \".area\"\n ).innerHTML += `<data-list id=\"city-list\"> ${data} </data-list>`)\n : null;\n\n this.quiz[2].input += `<datalist id=\"city-list\"> ${data} </datalist>`;\n })\n .catch((err) => this.popup(err, \"error\"));\n }", "function loadDefaultCities() {\n for (var i = 0; i < cities.length; i++) {\n // console.log(cities.length)\n var newDiv = $(\"<button>\");\n newDiv.text(cities[i]);\n newDiv.addClass(\"list-group-item hvr-shutter-out-horizontal\");\n newDiv.attr(\"data-name\", cities[i])\n newDiv.appendTo($(\"#search-cities\"))\n }\n }", "async function getCityWithSmallerNameOfEachState() {\n try {\n let allStatesAccounts = [];\n let allCities = [];\n let data = [];\n\n const allStates = await returnAllStates();\n \n allStatesAccounts = allStates.map((state) => state.Sigla);\n\n for (let state of allStatesAccounts) {\n data = JSON.parse(\n await fs.readFile(`${CitiesByStatesJsonOutput}${state}.json`)\n );\n\n data.Cities.sort();\n data.Cities.sort((a, b) => {return a.length - b.length;});\n allCities.push({ uf: state, cities: data.Cities[0] });\n }\n\n console.log('CIDADES COM O MENOR NOME DE CADA ESTADO--------------------->')\n console.log(allCities);\n console.log('');\n\n } catch (err) {\n console.log('ERRO: ' + err);\n }\n}", "function addCity(city) {\n var storedCities = JSON.parse(localStorage.getItem(\"cities\"));\n for (i=0; i<cities.length; i++) {\n if (storedCities[i] === city) {\n return\n }\n }\n cities.push(city);\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n renderCities();\n}", "function renderCities() {\n var cities = JSON.parse(localStorage.getItem(\"cities\")) || [];\n savedCityContainerEl.innerHTML = \"\";\n for (var i = 0; i < cities.length; i++) {\n var savedCityListItem = document.createElement(\"LI\");\n savedCityListItem.addEventListener('click', e => {\n if (e.target.tagName == 'LI') {\n searchWeather(e.target.innerText)\n }\n })\n savedCityListItem.className = 'list-group-item savedCityListItem role=\"button\"';\n savedCityListItem.innerText = cities[i];\n savedCityContainerEl.appendChild(savedCityListItem);\n }\n}", "function addNewCities(){\n\t$.aceOverWatch.field.grid.addNewRecord(objCities.grid);\n}", "function fillWeatherAndPushCity(weatherData) {\n city.weather = weatherData\n // AngularJS usando el ng-repeat agregará una ciudad y su clima a la interfaz\n vm.city_list.push(city);\n }", "function weatherData(city) {\n $(\"#addCity\").val(\"\");\n if (cities.includes(city) === false) {\n cities.push(city);\n saveCity(); \n }\n citySearchList();\n weatherToday(city);\n forecastDeck(city);\n }", "function AutocompleteCitiesReset() {\n _AutocompleteCities = new Array();\n}", "function renderCity() {\n $(\".newCityList\").empty();\n for (var i = 0; i < getCity.length; i++) {\n var a = $(\"<a>\");\n a.addClass(\"city-link\");\n a.attr(\"data-name\", getCity[i]);\n a.text(getCity[i]);\n $(\".newCityList\").append(a);\n };\n }", "function generateCities(){\n var queryURL = \"https://developers.teleport.org/assets/urban_areas.json\"\n var cityArray = Object.keys(cities);\n console.log(cityArray);\n cityArray.sort(function(a,b){\n if (a < b )return -1\n else if (a === b)return 0\n else return 1\n })\n \n for (var i = 0; i < cityArray.length; i++){\n var option = $(`<option value=\"${cityArray[i]}\" data-reactid=\"${i+1}\">${cityArray[i]}</option>`)\n $(\"#inputGroupSelect03\").append(option);\n }\n }", "function getCitiesFromLocalStorage() {\n // Parse the string version of the array from local storage back into an array of objects and set the myCities array equal to this array\n myCities = JSON.parse(localStorage.getItem(\"myCities\"));\n // Add the methods back onto the objects because they are not stored in local storage\n myCities.forEach(function(city) {\n city.getCityInfo = getCityInfo;\n city.getCurrentTime = getCurrentTime;\n city.getCurrentWeather = getCurrentWeather;\n });\n}", "function storeCities(){\n localStorage.setItem(\"cities\", JSON.stringify(citiesArray));\n }", "displayCities() {\n const cities = [];\n const numberCities = this.citiesData.length;\n\n if (numberCities > 0) {\n for (let i = 0; i < numberCities; i++) {\n const city = this.citiesData[i];\n const cityName = city.section; // the city name in camel-case\n cities.push(<CityItem \n cityID={cityName}\n cityClassName={cityName}\n cityClicked={this.state.city}\n cityLabel={city.label}\n key={`city-${i}`}\n onClick={() => {\n this.cityOnClick(cityName); \n this.setState({cityTimeZone : city.label});}\n } />) \n }\n }\n return cities;\n }", "function fetchCities() {\n\t\tcheckError(this);\n\t\tvar text = this.responseText.split(\"\\n\");\n\t\tfor (var i = 0; i < text.length; i++) {\n\t\t\tvar option = document.createElement(\"option\");\n\t\t\toption.innerHTML = text[i];\n\t\t\tdocument.getElementById(\"cities\").appendChild(option);\n\t\t}\n\t\tdocument.getElementById(\"loadingnames\").style.display = \"none\";\n\t\tdocument.getElementById(\"citiesinput\").disabled = false;\n\t}", "function getCitiesFromLocalStorage() {\n if (localStorage.getItem(\"cities\")) {\n citySearches = JSON.parse(localStorage.getItem(\"cities\"));\n }\n}", "function populateCities(data) {\n var selector = document.getElementById('selector-city');\n\n data.forEach(function (item) {\n var option = document.createElement('option');\n option.text = item;\n option.value = item;\n selector.appendChild(option);\n });\n}", "function kata18() {\r\n // Your Code Here\r\n lotrCitiesArray.push(\"Deadest Marshes\")\r\n\r\n createAnELement(18);\r\n let newELement = document.createElement(\"div\");\r\n newELement.textContent = JSON.stringify(lotrCitiesArray);\r\n document.body.append(newELement);\r\n\r\n return lotrCitiesArray;\r\n}", "function populatePageFromArray() {\n // Clear the current cities display\n $(\"#results\").empty();\n destroyMap();\n // Hide map if there are no cities currently\n if (myCities.length === 0) {\n $(\"#my-map\").attr(\"style\", \"display: none\");\n }\n else {\n $(\"#my-map\").attr(\"style\", \"display: auto\");\n }\n // Get current time and weather for all cities and then display info for all cities\n getCurrentTimeAndWeatherForAll(function() {\n myCities.forEach(function(city) {\n displayCityInfo(city);\n });\n });\n}", "function citiesReducer(state = initialState, action) {\n switch (action.type) {\n case \"FETCH_CITIES_SUCCESS\":\n return { ...state, cities: action.payload, err: \"\" };\n\n case \"FETCH_CITIES_ERROR\":\n return { ...state, err: action.payload };\n\n case \"ADD_CITY\":\n return { ...state, cities: [...state.cities, action.payload] };\n\n default:\n return state;\n }\n}", "function makeCityList(city){\n var newLiEls = $(\"<li>\");\n newLiEls.text(city);\n newLiEls.addClass(\"list-group-item\");\n $(\"#ul-element\").append(newLiEls)\n //Adding event listeners to each of the list items so we can bring up a city's info if the list item with the city's name gets clicked\n $(newLiEls).on(\"click\", function(e){\n // console.log(e.target.innerText);\n // var cityClickedOn = \"\" + e.target.innerText;\n // var oldCities = JSON.parse(localStorage.getItem(\"cityList\"));\n // oldCities.push(cityClickedOn);\n // cityArray.push(cityClickedOn);\n // console.log(cityArray);\n // citySearch(e.target.innerText);\n // var oldCities = JSON.parse(localStorage.getItem(\"cityList\"));\n // oldCities.push(cityClickedOn);\n // cityArray = oldCities;\n // cityInput = oldCities[oldCities.length-1];\n // return cityInput;\n // citySearch();\n // location.reload();\n })\n }", "function cityList(){\n $cityListArray.push($city);\n window.localStorage.setItem(\"city\", JSON.stringify($cityListArray));\n $(\"#city-list\").append($(\"<h5>\").text($city)); \n}", "function availableCities() {\n let cities = [];\n Object.values(tdata).forEach(value => {\n let city = value.city.split(\" \");\n let city_name = \"\"\n for (let i=0; i < city.length; i++){\n let temp = city[i];\n city_name = city_name + temp[0].toUpperCase() + temp.substring(1) + \" \";\n };\n if(cities.indexOf(city_name) !== -1) {\n\n }\n else {\n cities.push(city_name);\n console.log(\"city_name\");\n };\n });\n return cities;\n}", "function kata20() {\r\n // Your Code Here\r\n lotrCitiesArray.unshift(\"Mordor\");\r\n\r\n createAnELement(20);\r\n let newELement = document.createElement(\"div\");\r\n newELement.textContent = JSON.stringify(lotrCitiesArray);\r\n document.body.append(newELement);\r\n\r\n return lotrCitiesArray;\r\n}", "getTourNames(cityName){\n var result = [];\n Database.routeNames.forEach((rN)=>{\n result.push(rN);\n });\n return result;\n }", "function storeCityList(){\n //this initializes the cityList array\n let cityList = [];\n //this grabs each li element innerText which should be city names and pushes them to the cityList array\n $(\"li\").each(function(){\n cityList.push($(this)[0].innerText);\n });\n //store cityList array to local storage\n localStorage.setItem(\"cities\", cityList);\n}", "function addToCityList() {\n if (searchHistory) {\n searchHistory = JSON.parse(localStorage.getItem(PLACEHOLDER_KEY));\n $('#searchedCityList').append(searchHistory.city);\n console.log(searchHistory);\n }\n}", "function displaySavedCities() {\n // use a for loop to iterate through all the values in cityNames array, append a new list item for each of those values\n for (var i = 0; i < cityNames.length; i++) {\n searchedCities.append($(\"<li>\").text(cityNames[i]).addClass(\"btn\"))\n }\n}", "function addCityFn() {\n addCity();\n}", "function addNewCity(city) {\n if (cities.indexOf(city) === -1) {\n cities.push(city);\n localStorage.setItem(cacheKey, JSON.stringify(cities));\n }\n renderCitiesButton(cities);\n}", "renderCities(cities, country) {\n const container = document.querySelector(\"#cities-list\");\n const header = document.querySelector(\".results-header\");\n //use lodash map iterate through objects collection\n header.innerHTML = `Cities with the most polluted air in ${country}:`\n //hide loader\n this.toggleLoader(\"#loader\");\n\n map(cities, city => {\n const { title, extract } = city;\n const item = document.createElement(\"li\");\n const desc = extract ? extract.replace(/<(?:.|\\n)*?>/gm, '') \n : \"Here is no description about this place\";\n item.innerHTML = `\n <div class=\"collapsible-header light-blue darken-1 white-text\">\n <i class=\"material-icons\">location_city</i>${title}\n </div>\n <div class=\"collapsible-body \">\n <span>${desc}</span>\n </div>\n `\n container.appendChild(item);\n })\n }", "function loadCity() {\n cities = JSON.parse(localStorage.getItem(\"lscity\"));\n if (cities) {\n weatherData(cities[cities.length - 1])\n } else {\n cities = [];\n }\n }", "retrieveCities() {\n return call(`${this.__url__}/cities`, {\n headers: {\n 'Content-Type': 'application/json'\n },\n timeout: this.__timeout__\n })\n }", "function clearSavedCities() {\n searchedCities.empty()\n}", "function load_citys() {\n\n $.get(\"http://www.pm25.in/api/querys.json?token=FydAKx5y1BBbqXeLcxyi\", \n function(result, statusText, jqXHR){\n\n for(var i=0; i<result['cities'].length; i++){\n var city = result['cities'][i];\n $(\"#citys\").append(\"<option value='\"+city+\"'>\"+city+\"</option>\")\n }\n\n });\n\n}", "function loadCities() {\n $(\"#lastCities\").empty();\n for (var i = 0; i < city.length; i++) {\n var cityNewDiv = $(\"<button class= 'btn btn-dark load'>\");\n cityNewDiv.text(city[i]);\n $(\"#lastCities\").append(cityNewDiv);\n }\n}", "static all () {\n return [{\n ids: ['CITY OF TAMPA'],\n name: 'City of Tampa',\n // address: '',\n phone: '8132748811',\n // fax: '',\n // email: '',\n website: 'https://www.tampagov.net/solid-waste/programs'\n },\n {\n ids: ['TEMPLE TERRACE'],\n name: 'City of Temple Terrace',\n // address: '',\n phone: '8135066570',\n // fax: '',\n email: '[email protected]',\n website: 'http://templeterrace.com/188/Sanitation/'\n },\n {\n ids: ['CITY OF PLANT CITY'],\n name: 'City of Plant City',\n address: '1802 Spooner Drive, Plant City, FL 33563',\n phone: '8137579208',\n fax: '8137579049',\n email: '[email protected]',\n website: 'https://www.plantcitygov.com/64/Solid-Waste'\n }]\n }", "printPlacesLived() {\n return this.cities.map((city) => `A message from ${city}!`);\n }", "function storeCities() {\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n }", "function displayCitySearchHistory() {\n var citiesStored = JSON.parse(localStorage.getItem(\"citiesserched\"));\n if (citiesStored) {\n $(\"#cityList\").empty();\n var cityArray = citiesStored.cities;\n\n // This loop will go through cityArray and populate the #cityList div\n for (var i = 0; i < cityArray.length; i++) {\n var pEl = $(\"<p class='cities border mt-0 mb-0 p-2'>\").text(cityArray[i]);\n $(\"#cityList\").append(pEl);\n }\n }\n}", "get cityList() {\n return JSON.parse(window.localStorage.getItem('cityList'));\n }", "function savCities() {\n localStorage.setItem(\"saveCity\", JSON.stringify(cities));\n }", "function printCities(cit_JSON) {\n for(var i = 0; i < cit_JSON.length; i++){\n // chalk.<color>() for coloring the font\n\n console.log(CHALK_MOD.blue(\"name: \" + cit_JSON[i].name));\n console.log(CHALK_MOD.red(\"country: \" + cit_JSON[i].country));\n console.log(CHALK_MOD.green(\"population: \" + formatNumberToGerman(cit_JSON[i].population)));\n console.log(\"-----------------------------\");\n }\n}", "function listCities($target, citiesJson) {\n if (citiesJson) // If the data is provided, save it as global variable\n cities = citiesJson; // for later use, maybe\n\n $target.empty(); // empty the target div before we (re-)popualte it\n\n // Iterate through each city provided in the JSON\n for (var i = 0; i < cities.length; i += 1) {\n // add h3 element for each city name to city section (target)\n $target.append('<h3>' + citiesJson[i].name + '</h3>');\n // get that last added h3 and add click event listener\n $('h3:last').on('click', function(e) {\n if (clicks % 2 === 0) {\n $('#cities h3').removeClass('selected'); // deselect the cities on the bottom\n }\n $(this).toggleClass('selected');\n // setContender(this.);\n // console.log(this.innerHTML); // show what city was clicked\n clicks += 1;\n setContender(this.innerHTML);\n });\n }\n}", "function getListOfPoints() {\n var coordinates = []\n\n GeoCities.forEach(function(city) {\n coordinates.push(city.location.reverse())\n })\n return coordinates;\n}", "static getSavedCitiesIds(cities) {\n return cities.map(city => city.id);\n }", "function renderCities() {\n cityHistory.innerHTML = \"\";\n \n const cityNames = JSON.parse(localStorage.getItem(\"cityNames\")) || [];\n for (let i = 0; i < cityNames.length; i++) {\n const city = cityNames[i];\n const li = document.createElement(\"li\");\n li.setAttribute('class', 'clickable' )\n li.setAttribute('class', 'd-flex align-items-center text-capitalize')\n li.textContent = city;\n\n li.addEventListener('click', function(event){\n event.preventDefault();\n\n // run the main query\n queryWeatherDashboard(city);\n })\n\n cityHistory.appendChild(li);\n }\n}", "function loadStates(something) {\n console.log(something.City.Id);\n var states = something;\n return states.map(function (repo) {\n repo.value = repo.Name.toLowerCase();\n return repo;\n });\n }", "function getCities() {\n let url = 'http://127.0.0.1:8000/api/cities';\n\n $.ajax({\n url: url,\n type: 'GET',\n success: function(data) {\n populateCitiesDataList(data);\n //attaching listener for search options\n attachListeners();\n const STARTING_PAGE = 1;\n readSearchValues(false, STARTING_PAGE);\n },\n error: function(errore) {\n console.log(errore);\n }\n });\n}", "recoverCities () {\n this.cities = localStorage.cities ? JSON.parse(localStorage.cities) : []\n }", "function saveCities(city) {\n // use an if statement to make sure the list doesn't populate the same city more than once\n if (!cityNames.includes(city)) {\n // if the city the user typed in isn't already in the cityNames array, use unshift to inject it at the 0 index of the array\n cityNames.unshift(city)\n }\n // if there are more than 5 items in cityNames array, get rid of the last one\n if (cityNames.length === 6){\n cityNames.splice(5, 1)\n }\n // set cityNames array in local storage\n localStorage.setItem(\"Cities\", JSON.stringify(cityNames)) \n}", "function renderCityList(){\n //empty out the list-group class which contains all the city names\n $(\".list-group\").empty();\n //this grabs a string of city names from local storage\n let cityList = localStorage.getItem(\"cities\");\n //this stores the city names into septate indexes in cityArr\n let cityArr = cityList.split(\",\");\n //this adds each city to a new li element in the city list ul\n cityArr.forEach(function(city){\n addCityToList(city);\n });\n}", "function cityList(hList) {\n $(\"#cityDump\").empty();\n for (var i = 0; i < hList.length; i++) {\n var cities = $(\"<button>\");\n cities.addClass(\"list\");\n cities.attr(\"data-name\", hList[i]);\n cities.text(hList[i]);\n $(\"#cityDump\").append(cities);\n }\n }", "function appendcitylist(state_selection) {\n\n // Select city dropdown menu and remove all cities\n d3.select(\"#selDataset2\").selectAll(\"option\").remove();\n\n // Read in city data\n d3.json(city_predict_url).then(function(city_data) {\n\n // Select the city dropdown menu\n var select = d3.select(\"#selDataset2\");\n\n // Append the list of cities to the dropdown menu\n for (var i=0; i<city_data.length; i++) {\n if (state_selection === city_data[i].state) {\n select.append(\"option\").text(city_data[i].city)\n }\n };\n });\n }", "function fetchCities() {\n return fetch(\"./places.json\").then((d) => d.json());\n}", "function kata10() {\r\n // Your Code Here\r\n lotrCitiesArray.splice(1,0,'Rohan')\r\n\r\n createAnELement(10);\r\n let newElement = document.createElement(\"div\");\r\n newElement.textContent =JSON.stringify(lotrCitiesArray);\r\n document.body.append(newElement);\r\n\r\n \r\n return lotrCitiesArray;\r\n}", "function add_10_CA_Cities() {\n //Only show the 10 Largest Cities;\n for (var i = 0; i< CA_cities_json.features.length; i++) {\n for (var j = 0; j <CA_cities_array.length; j++) {\n if (CA_cities_json.features[i].properties.name === CA_cities_array[j]) {\n //How to Add geoJson on leaflet: https://leafletjs.com/examples/geojson/\n var myCityPolyLines = {\n \"type\": \"MultiPolygon\",\n \"coordinates\": CA_cities_json.features[i].geometry.coordinates \n }\n //List of distinctive color\n var cityColorArr = ['#e6194B', '#f58231', '#ffe119', '#bfef45', \n '#3cb44b', '#42d4f4', '#4363d8', '#911eb4',\n '#f032e6', '#e6beff' ];\n function cityStyle(j) {\n return {\n fillColor: cityColorArr[j],\n weight: 1,\n opacity: 1,\n color: cityColorArr[j],\n // dashArray: '3',\n fillOpacity: 0.7\n };\n }\n\n L.geoJSON(myCityPolyLines, {\n style: cityStyle(j)\n }).addTo(mymap);\n //\n console.log(\"My city is \" + CA_cities_array[j]);\n }\n }\n }\n}", "function employeesByCity (id) {\n var i;\n var employeesInCity = [];\n for (i = 0; i < employees.length; i++) {\n\n if (employees[i].city === id) {\n employeesInCity.push(employees[i])\n }\n }\n\n return employeesInCity;\n}", "function getStoredCities() {\n storedCities = JSON.parse(localStorage.getItem(\"Recent Cities\"))\n if (storedCities !== null) {\n renderCities();\n } else {\n storedCities = [];\n }\n}", "createUpdatedCitiesList(city) {\n let citiesData = this.state.cities;\n let yandex = this.state.source.yandexFlag;\n let gismeteo = this.state.source.gismeteoFlag;\n let weather = this.state.source.weatherFlag;\n let source = [];\n let cities = [];\n let citiesAndSource = {};\n if (citiesData.length !== 0) {\n for (let i = 0; i < citiesData.length; i++) {\n let cityAndData = citiesData[i];\n cities.push(cityAndData.city)\n }\n } else {\n cities.push(city)\n }\n if (yandex) {\n source.push(\"yandex\")\n }\n if (gismeteo) {\n source.push(\"gismeteo\")\n }\n if (weather) {\n source.push(\"weatherCom\")\n }\n for (let k = 0; k < cities.length; k++) {\n if (cities[k] !== city) {\n cities.push(city)\n }\n }\n citiesAndSource[\"cities\"] = cities;\n citiesAndSource[\"source\"] = source;\n return citiesAndSource\n }" ]
[ "0.7094029", "0.6942377", "0.66305536", "0.6439533", "0.6439533", "0.63984233", "0.6382852", "0.63291824", "0.6323746", "0.6309452", "0.6309452", "0.6309452", "0.6309452", "0.627969", "0.62707734", "0.62682", "0.6246773", "0.62356347", "0.62152857", "0.6206136", "0.613385", "0.6117749", "0.60913897", "0.60699695", "0.606449", "0.6056785", "0.60342234", "0.60323447", "0.6026217", "0.6014172", "0.59796596", "0.5977584", "0.595945", "0.5955892", "0.5954822", "0.5927442", "0.5899686", "0.5872863", "0.58717006", "0.58685815", "0.5863569", "0.58617467", "0.5861136", "0.5857027", "0.5856785", "0.58560365", "0.5846813", "0.5838335", "0.58379996", "0.58373743", "0.5836612", "0.58214164", "0.5816708", "0.5813332", "0.5812167", "0.5810842", "0.58059144", "0.5797959", "0.5792835", "0.5781475", "0.57783926", "0.5778289", "0.57749146", "0.5761874", "0.57549244", "0.5752533", "0.57467335", "0.5744238", "0.5741101", "0.57398987", "0.5735454", "0.57296485", "0.57277375", "0.57217854", "0.5716518", "0.57101977", "0.57095087", "0.56939024", "0.5685932", "0.5682644", "0.5672754", "0.56670743", "0.5661725", "0.56418216", "0.5629801", "0.56275964", "0.5626058", "0.5626001", "0.56134284", "0.56131315", "0.5612269", "0.559908", "0.55933625", "0.55917704", "0.55881155", "0.5587756", "0.55856097", "0.55848163", "0.5581643", "0.55791706", "0.557794" ]
0.0
-1
from cities.js // Sort Table
function sortTable(column, type) { //Sort the table $('.table tbody tr').sort(function(a, b) { // a and b are the 2 parameters being compared. // Since you are sorting rows, a and b are <tr> //Find the <td> using the column number and get the text value. //Now, the a and b are the text of the <td> a = $(a).find('td:eq(' + column + ')').text(); b = $(b).find('td:eq(' + column + ')').text(); switch (type) { case 'text': //Proper way to compare text in js is using localeCompare //If order is ascending you can - a.localeCompare(b) //If order is descending you can - b.localeCompare(a); return b.localeCompare(a); break; case 'number': //You can use deduct to compare if number. //If order is ascending you can -> a - b. //Which means if a is bigger. It will return a positive number. b will be positioned first //If b is bigger, it will return a negative number. a will be positioned first return b - a; break; } }).appendTo('.table tbody'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortCountry(n) {\n var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;\n table = document.querySelector(\".tbl-list\");\n switching = true;\n dir = \"asc\"; \n while (switching) {\n switching = false;\n rows = table.rows;\n for (i = 1; i < (rows.length - 1); i++) {\n shouldSwitch = false;\n x = rows[i].getElementsByTagName(\"td\")[n];\n y = rows[i + 1].getElementsByTagName(\"td\")[n];\n if (dir == \"asc\") {\n if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {\n shouldSwitch= true;\n break;\n }\n } else if (dir == \"desc\") {\n if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {\n shouldSwitch = true;\n break;\n }\n }\n }\n if (shouldSwitch) {\n rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);\n switching = true;\n switchcount ++; \n } else {\n if (switchcount == 0 && dir == \"asc\") {\n dir = \"desc\";\n switching = true;\n }\n }\n }\n}", "function sortSunnyDistance(column) {\n // https://stackoverflow.com/a/49956577\n //Sort the table\n $('#sunny-city-list tr').sort(function(a, b) {\n // a and b are the 2 parameters being compared. \n // Since you are sorting rows, a and b are <tr> \n\n //Find the <td> using the column number and get the attribute value.\n a = $(a).find('td:eq(' + column + ')').attr('data-miles');\n b = $(b).find('td:eq(' + column + ')').attr('data-miles');\n // compare them to see which is bigger\n // switching the a and the b's order changes the sort direction\n return a - b;\n })\n .appendTo('#sunny-city-list');\n}", "function SortByCity()\n{\n let sortedArray = contactsArray;\n sortedArray.sort((a,b) => a.city.toLowerCase().localeCompare(b.city.toLowerCase()));\n console.log(\"\\n\\nPrinting sorted array by city : \");\n sortedArray.forEach(p => console.log(\"\\n\"+p.toString()));\n}", "function sortTable(column){\n\n}", "function Sort() {}", "function sortByCity() {\n AddressBookArr.sort((a, b) => a.city.localeCompare(b.city));\n AddressBookArr.forEach(addresBook => console.log(addresBook.toString()));\n}", "function sortRows(){\n sortRowsAlphabeticallyUpwards();\n}", "function sortTable() {\n $(\"#instances\").tablesorter({\n });\n}", "function sortFruitMarketTableByFruitNameAndPrice() {\n\n}", "function sort(table, key) {\n\temptyTable(table);\n\t_($.indexedDB(\"PlateSlateDB\").objectStore(table).index(key).each(\n\t\t\tfunction(elem) {\n\t\t\t\taddRowInHTMLTable(table, elem.key, elem.value);\n\t\t\t}));\n}", "render(table) {\n console.log('Applying 3rd partys better sort.');\n }", "function sortChartData(cities, indicator) {\n const sortedCities = cities.slice(); // clone so we're not mutating state\n\n sortedCities.sort((a, b) => (\n Number(b.indices[indicator]) - Number(a.indices[indicator])\n ));\n\n return sortedCities;\n}", "function sortByCity() {\n for (let details in detailsArray) {\n detailssArray.sort(details.city);\n }\n detailsArray.forEach((contact) => console.log(contact.toString()));\n }", "function sortResults(){\n return sort.sortCustomerRecords(result);\n}", "function sortTable() {\n const col = this.dataset.colname;\n const order = this.dataset.order;\n const nameCapi = col.charAt(0).toUpperCase() + col.slice(1);\n\n if (col == 'birthdate') {\n // for date sorting\n\n if (order == 'desc') {\n this.dataset.order = 'asc';\n this.innerHTML = `${nameCapi} &#9660`;\n tableData = tableData.sort((a, b) =>\n new Date(a[col]) > new Date(b[col]) ? 1 : -1\n );\n } else {\n this.dataset.order = 'desc';\n this.innerHTML = `${nameCapi} &#9650`;\n tableData = tableData.sort((a, b) =>\n new Date(a[col]) < new Date(b[col]) ? 1 : -1\n );\n }\n }\n // string & number sorting\n else if (order == 'desc') {\n this.dataset.order = 'asc';\n this.innerHTML = `${nameCapi} &#9660`;\n tableData = tableData.sort((a, b) => (a[col] > b[col] ? 1 : -1));\n } else {\n this.dataset.order = 'desc';\n this.innerHTML = `${nameCapi} &#9650`;\n tableData = tableData.sort((a, b) => (a[col] < b[col] ? 1 : -1));\n }\n\n buildTable(tableData);\n}", "async function TopologicalSort(){}", "function generateCities(){\n var queryURL = \"https://developers.teleport.org/assets/urban_areas.json\"\n var cityArray = Object.keys(cities);\n console.log(cityArray);\n cityArray.sort(function(a,b){\n if (a < b )return -1\n else if (a === b)return 0\n else return 1\n })\n \n for (var i = 0; i < cityArray.length; i++){\n var option = $(`<option value=\"${cityArray[i]}\" data-reactid=\"${i+1}\">${cityArray[i]}</option>`)\n $(\"#inputGroupSelect03\").append(option);\n }\n }", "function sortTableAlphabeticallyAscending(){\n sortAlphabeticallyAscending();\n}", "Sort() {\n\n }", "function sortTable(type) {\r\n let data = window.value.data;\r\n data = sortData(data, type);\r\n populateDataSource(data);\r\n}", "function sortJson() {\r\n\t \r\n}", "function sorttable(p) {\n let table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;\n table = document.getElementById(\"record_contant\");\n switching = true;\n dir = \"asc\";\n while (switching) {\n switching = false;\n rows = table.rows;\n for (i = 1; i < (rows.length - 1); i++) {\n shouldSwitch = false;\n x = rows[i].getElementsByTagName(\"TD\")[p];\n y = rows[i + 1].getElementsByTagName(\"TD\")[p];\n if (dir == \"asc\") {\n if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {\n shouldSwitch = true;\n break;\n }\n } else if (dir == \"desc\") {\n if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {\n shouldSwitch = true;\n break;\n }\n }\n }\n if (shouldSwitch) {\n rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);\n switching = true;\n switchcount++;\n } else {\n if (switchcount == 0 && dir == \"asc\") {\n dir = \"desc\";\n switching = true;\n }\n }\n }\n}", "function parseCities(response){\n var result = [];\n if (response){\n \n\n Object.keys(response).forEach(function(key) {\n var val = response[key];\n for (var i=0; i<val.length;i++){\n console.log()\n var data = {\n \"region\": key,\n \"cityName\": val[i].cityName\n }\n if(val[i].shortName != null){\n data.shortName = val[i].shortName;\n }\n if(val[i].coordinates != null){\n if(isFloat(val[i].coordinates.longitude) && isFloat(val[i].coordinates.latitude)){\n data.longitude = val[i].coordinates.longitude; \n data.latitude = val[i].coordinates.latitude;\n }\n \n } \n result.push(data);\n }\n //console.log(val);\n ;});\n var final= sortByKey(result, 'cityName');\n return ((final));\n }\n}", "function sortTable() {\r\n\tvar table, rows, switching, i, x, y, shouldSwitch;\r\n \ttabley = document.getElementById(\"customers\");\r\n \tswitching = true;\r\n \twhile (switching) {\r\n \tswitching = false;\r\n \trows = tabley.rows;\r\n \tfor (i = 1; i < (rows.length - 1); i++) {\r\n \t\tshouldSwitch = false;\r\n \t\tx = rows[i].getElementsByTagName(\"td\")[2];\r\n \t\ty = rows[i + 1].getElementsByTagName(\"td\")[2];\r\n \t\tif (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {\r\n \t\tshouldSwitch = true;\r\n \t\tbreak;\r\n \t}\r\n }\r\n if (shouldSwitch)\r\n {\r\n \trows[i].parentNode.insertBefore(rows[i + 1], rows[i]);\r\n \tswitching = true;\r\n }\r\n }\r\n}", "function sortCollegeNames(){\n return fetchedData.sort((x,y)=>x.college.name.localeCompare(y.college.name))\n }", "function sortResults() {\n results.sort(compareTwoRegions);\n}", "sortBy() {\n // YOUR CODE HERE\n }", "sort(){\n\n }", "function sortByCityOrName(AddressBook) {\n let choice = prompt(\"1.Sort by City 2.Sort by State\");\n let first, second;\n switch (Number(choice)) {\n case 1:\n const sortCity = AddressBook.sort((a, b) => {\n first = a.city.toLowerCase();\n second = b.city.toLowerCase();\n if (first < second) {\n return -1;\n }\n if (first > second) {\n return 1;\n }\n });\n console.log(sortCity);\n break;\n case 2:\n const sortState = AddressBook.sort((a, b) => {\n first = a.state.toLowerCase();\n second = b.state.toLowerCase();\n if (first < second) {\n return -1;\n }\n if (first > second) {\n return 1;\n }\n });\n console.log(sortState);\n break;\n }\n}", "function loadTowns(url = 'https://raw.githubusercontent.com/smelukov/citiesTest/master/cities2.json') {\n console.log('пытаемся загрузить города, ' + url)\n return new Promise ((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.send();\n xhr.addEventListener('load', () => {\n\n if (xhr.status !== 200) {\n console.log('всё пошло по пизде');\n reject(xhr.status);\n }\n\n var result = JSON.parse(xhr.response);\n result.sort(function(a, b) {\n\n var c = a.name,\n d = b.name;\n\n if( c < d ){\n return -1;\n }else if( c > d ){\n return 1;\n }\n\n return 0;\n });\n\n console.log('после сортировки');\n console.log(result);\n resolve(result);\n });\n\n });\n}", "function sortData (data) {\n ...\n}", "function sortFlights() {\n handleSelect();\n }", "renderLocations(cities) {\n // Sort the cities alphabetically\n cities.sort();\n return cities.map((city) => {\n return (\n <Link key={city} to={`/location/${city}`} className=\"list-group-item capitalize\">\n {city}\n </Link>\n );\n });\n }", "function sortByNameHandler() {\n let sorted = sortByName(myData);\n showData(sorted, document.getElementById(\"display\"));\n}", "function setSort(x) { //these 3 functions are connected to the event of the buttons\n sortby = x;\n updateDoctorsList(); //they then invoke updatedoctorslist, that is meant to access the doctors on the server with the current criteria, the fetch..\n}", "function sortTable(n, tableName) {\n\t var table,\n\t rows,\n\t switching,\n\t i,\n\t x,\n\t y,\n\t shouldSwitch,\n\t dir,\n\t switchcount = 0;\n\t table = document.getElementById(tableName);\n\t switching = true;\n\t dir = \"asc\";\n\t while (switching) {\n\t switching = false;\n\t rows = table.getElementsByTagName(\"TR\");\n\t for (i = 1; i < rows.length - 1; i++) {\n\t shouldSwitch = false;\n\t x = rows[i].getElementsByTagName(\"TD\")[n];\n\t y = rows[i + 1].getElementsByTagName(\"TD\")[n];\n\t if (dir == \"asc\") {\n\t if (parseInt(x.innerHTML) < parseInt(y.innerHTML)) {\n\t shouldSwitch = true;\n\t break;\n\t }\n\t } else if (dir == \"desc\") {\n\t if (parseInt(x.innerHTML) > parseInt(y.innerHTML)) {\n\t shouldSwitch = true;\n\t break;\n\t }\n\t }\n\t }\n\t if (shouldSwitch) {\n\t rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);\n\t switching = true;\n\t switchcount++;\n\t } else {\n\t if (switchcount == 0 && dir == \"asc\") {\n\t dir = \"desc\";\n\t switching = true;\n\t }\n\t }\n\t }\n\t}", "apply(table) {\n this.betterSort.init();\n this.betterSort.render(table);\n }", "sort() {\n\t}", "sort() {\n\t}", "function sortByCityStateOrZip(){\n addressBookArray.sort((a,b) => a.city.localeCompare(b.city));\n console.log(\"Sorted Array By City: \")\n addressBookArray.forEach(contact => console.log(contact.toString()));\n addressBookArray.sort((a, b) => a.state.localeCompare(b.state));\n console.log(\"Sorted Array By State: \")\n addressBookArray.forEach(contact => console.log(contact.toString()));\n ddressBookArray.sort((a, b) => a.zip.localeCompare(b.zip));\n console.log(\"Sorted Array By Zip: \")\n addressBookArray.forEach(contact => console.log(contact.toString()));\n}", "function sortTable(tableId, cellId) {\n let table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0\n table = document.getElementById(tableId)\n switching = true\n dir = 'asc'\n while (switching) {\n switching = false\n rows = table.rows\n for (i = 0; i < (rows.length - 1); i++) {\n shouldSwitch = false\n x = rows[i].getElementsByTagName('TD')[cellId]\n y = rows[i + 1].getElementsByTagName('TD')[cellId]\n let nameCell = rows[i + 1].getElementsByTagName('TD')[1]\n if (dir == 'asc') {\n if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase() && nameCell.innerHTML != '') {\n shouldSwitch = true\n break\n }\n } else if (dir == 'desc') {\n if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase() && nameCell.innerHTML != '') {\n shouldSwitch = true\n break\n }\n }\n }\n if (shouldSwitch) {\n rows[i].parentNode.insertBefore(rows[i + 1], rows[i])\n switching = true\n switchcount++\n } else {\n if (switchcount == 0 && dir == 'asc') {\n dir = 'desc'\n switching = true\n }\n }\n }\n}", "function sortTable() {\n\n var rows = $('.mytable tbody tr').get();\n rows.sort(function(a, b) {\n\n var A = $(a).children('td').eq(0).text().toUpperCase();\n var B = $(b).children('td').eq(0).text().toUpperCase();\n console.log(A);\n\n if (A > B) {\n return -1;\n }\n\n if (A < B) {\n return 1;\n }\n\n return 0;\n\n });\n\n $.each(rows, function(index, row) {\n $('.mytable').children('tbody').append(row);\n });\n\n }", "function sortTable_by_jan(table_bodys, jan_code, coll_num) {\n var rows = $('.' + table_bodys + ' tr').get();\n rows.sort(function(a, b) {\n\n var A = $(a).children('td').eq(coll_num).text();\n A = A.substr(A.length - 13);\n if (A == jan_code) {\n return -1;\n }\n return 0;\n\n });\n $.each(rows, function(index, row) {\n $('.' + table_bodys).append(row);\n });\n}", "sort(key) {\n //used JavaScript sort method\n const sortedContacts = this.state.contacts.sort((contactA, contactB) => {\n return contactA[key] >= contactB[key] ? 1 : -1;\n });\n this.setState({ contacts: sortedContacts, reset: true })\n }", "sortProducts() {}", "function sortByName(c1,c2) {\n var c1Label = data.maps.columnIdToLabel[c1],\n c2Label = data.maps.columnIdToLabel[c2];\n\n return d3.ascending(c1Label, c2Label);\n //return d3.ascending(data.labels.columns[c1],data.labels.columns[c2]);\n }", "function sortColumns() {\n return $('.collections-flex-container-map').sortable({\n axis: 'x',\n handle: '.handle',\n update: function() {\n return $.post($(this).data('update-url'),\n $(this).sortable('serialize'));\n }\n });\n}", "function makeAllTablesSortable(table) {\n\n th = document.getElementsByTagName(\"th\");\n\n th[0].onclick = function() {\n sortTable(0);\n }\n th[1].onclick = function() {\n sortTable(1);\n }\n th[2].onclick = function() {\n sortTable(2);\n }\n th[3].onclick = function() {\n sortTable(3);\n }\n th[4].onclick = function() {\n sortTable(4);\n }\n th[5].onclick = function() {\n sortTable(5);\n }\n\n}", "function onClickLastNameTableHeader(event)\n{\n document.isAscendingOrder = !document.isAscendingOrder;\n sortTableElementsBy(\"last_name\");\n}", "function orderAlphabetically(tab){\n var tab2= tab.map(function(elt){\n return elt.title;\n })\n\n console.log(tab2);\n var res= tab2.sort();\n return res.slice(0,20);\n}", "function sortByPlace() {\n console.log(\"Which sorting do you want to apply \\n 1 city \\n 2 state \\n 3 zip\");\n let choice = prompt(\"Enter your choice \")\n switch (choice) {\n case \"1\":\n addressBook.sort(function (contact1,contact2){\n let a = contact1.city.toUpperCase()\n let b = contact2.city.toUpperCase()\n return a == b ? 0 : a > b ? 1: -1;\n })\n console.log(addressBook.toString());\n break;\n case \"2\":\n addressBook.sort(function (contact1,contact2){\n let a = contact1.state.toUpperCase()\n let b = contact2.state.toUpperCase()\n return a == b ? 0 : a > b ? 1: -1;\n })\n console.log(addressBook.toString());\n break\n case \"3\":\n addressBook.sort(function (contact1,contact2){\n let a = contact1.firstName.toUpperCase()\n let b = contact2.firstName.toUpperCase()\n return a == b ? 0 : a > b ? 1: -1;\n })\n console.log(addressBook.toString());\n break\n default:\n console.log(\"Invalid choice\");\n break;\n }\n}", "renderCities(cities, country) {\n const container = document.querySelector(\"#cities-list\");\n const header = document.querySelector(\".results-header\");\n //use lodash map iterate through objects collection\n header.innerHTML = `Cities with the most polluted air in ${country}:`\n //hide loader\n this.toggleLoader(\"#loader\");\n\n map(cities, city => {\n const { title, extract } = city;\n const item = document.createElement(\"li\");\n const desc = extract ? extract.replace(/<(?:.|\\n)*?>/gm, '') \n : \"Here is no description about this place\";\n item.innerHTML = `\n <div class=\"collapsible-header light-blue darken-1 white-text\">\n <i class=\"material-icons\">location_city</i>${title}\n </div>\n <div class=\"collapsible-body \">\n <span>${desc}</span>\n </div>\n `\n container.appendChild(item);\n })\n }", "sortData(type, column) {\n if (type !== \"none\" && type !== false) {\n let temp = this.tbody.slice();\n for (let i = 0; i < temp.length; i++) {\n temp[i].unshift(temp[i][column]);\n }\n if (type === \"asc\") {\n temp.sort();\n } else {\n temp.reverse();\n }\n for (let i = 0; i < temp.length; i++) {\n this.set(\"tbody.\" + i, []);\n this.set(\"tbody.\" + i, temp[i].slice(1));\n }\n } else {\n let temp = this.tbody.slice();\n for (let i = 0; i < temp.length; i++) {\n this.set(\"data.\" + (i + 1), []);\n this.set(\"data.\" + (i + 1), temp[i].slice());\n }\n }\n }", "function SortByState()\n{\n let sortedArray = contactsArray;\n sortedArray.sort((a,b) => a.state.toLowerCase().localeCompare(b.state.toLowerCase()));\n console.log(\"\\n\\nPrinting sorted array by State : \");\n sortedArray.forEach(p => console.log(\"\\n\"+p.toString()));\n}", "function getPosts() {\n \n $(\"#title\").text(\"Select a City:\")\n\n $.get(\"/api/posts/\", function (all) {\n // all = all posts in database\n\n var map = new Map();\n var len = all.length;\n\n newArr = [];\n\n for (i = 0; i < len; i++) {\n var obj = all[i];\n\n if (map[obj.place] === undefined || map[obj.place] === null) {\n map[obj.place] = [];\n map[obj.place].push(obj.begin_date);\n newArr.push(obj);\n }\n else if (!map[obj.place].includes(obj.begin_date)) {\n map[obj.place].push(obj.begin_date);\n newArr.push(obj);\n }\n }\n // console.log(newArr) == \n // contains a city with a unique begin_data \n // this will be displayed in the table below\n\n // creates the table header - \n\n var row5 = $(\"<th>\").text(\"#\")\n var row6 = $(\"<th>\").text(\"Main Destination\")\n var row7 = $(\"<th>\").text(\"Begin Date\")\n $(\"#header_row\").append(row5, row6, row7)\n // table_creator(newArr);\n // }); just removed this\n\n // }\n //--------------------------\n // 2. newArr is displayed in the body of the table - \n // a list of cities and begin-dates \n // if user choses one, the 'begin date' param is passed\n // to holler function\n\n\n // function table_creator(newArr) {\n\n\n\n //loop through the representative objects\n\n newArr.map(function (item, index, array) {\n\n // body for table 1\n\n row8 = $(\"<tr>\").attr(\"id\", index).on(\"click\", { param: item.begin_date }, holler)\n row9 = $(\"<td>\").text(item.id);\n row10 = $(\"<td>\").text(item.place);\n row11 = $(\"<td>\").text(item.begin_date);\n table_body.append(row8)\n $(\"#\" + index).append(row9, row10, row11)\n })\n\n })\n}", "function sorter(columna){\n\t\t$(\".tablesorter\").tablesorter({\n \t sortList: [[columna,0]] \n });\n\t}", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "function cities(){\n\t//define two arrays for cities and population\n\tvar cityPop = [\n\t\t{\n\t\t\tcity: 'Madison',\n\t\t\tpopulation: 233209\n\t\t},\n\t\t{\n\t\t\tcity: 'Milwaukee',\n\t\t\tpopulation: 594833\n\t\t},\n\t\t{\n\t\t\tcity: 'Green Bay',\n\t\t\tpopulation: 104057\n\t\t},\n\t\t{\n\t\t\tcity: 'Superior',\n\t\t\tpopulation: 27244\n\t\t}\n\t];\n\n\t//append the table element to the div\n\t$(\"#mydiv\").append(\"<table>\");\n\n\t//append a header row to the table\n\t$(\"table\").append(\"<tr>\");\n\n\t//add the \"City\" and \"Population\" columns to the header row\n\t$(\"tr\").append(\"<th>City</th><th>Population</th>\");\n\n\t//loop to add a new row for each city\n for (var i = 0; i < cityPop.length; i++){\n //assign longer html strings to a variable\n var rowHtml = \"<tr><td>\" + cityPop[i].city + \"</td><td>\" + cityPop[i].population + \"</td></tr>\";\n //add the row's html string to the table\n $(\"table\").append(rowHtml);\n };\n\n addColumns(cityPop);\n}", "async function sortByPopulation() {\n const API = await axios.get(\"https://restcountries.eu/rest/v2/all\");\n const arrayPopulations = API.data.map(country => {\n const {name, flag, population, region} = country;\n return {name, flag, population, region}\n });\n arrayPopulations.sort((a,b) => a.population-b.population);\n return arrayPopulations;\n}", "getOrderBy() {}", "function sortInfo() {\n info.sort((a, b) => {\n return (sortReverse ? -1 : 1) * compareTableItem(sortKey, a, b);\n });\n}", "function alphabetique(){\n entrepreneurs.sort.year\n }", "function sortByPopulation() {\n if (clickState == 0) {\n let test = storedCountries.sort((a, b) => {\n if (a.population > b.population) {\n return -1\n }\n })\n showCountries(search(test, searchBox.value.toUpperCase()))\n clickState = 1\n } else {\n test = storedCountries.sort((a, b) => {\n if (a.population < b.population) {\n return -1\n }\n })\n showCountries(search(test, searchBox.value.toUpperCase()))\n clickState = 0\n }\n}", "function sortTable() {\n let i, shouldSwitch;\n const table = document.getElementById('results');\n let switching = true;\n while (switching) {\n switching = false;\n let rows = table.rows;\n\n for (i = 1; i < (rows.length - 1); i++) {\n shouldSwitch = false;\n let x = rows[i].getElementsByTagName('td')[2];\n let y = rows[i + 1].getElementsByTagName('td')[2];\n\n if (parseInt(x.innerHTML) < parseInt(y.innerHTML)) {\n shouldSwitch = true;\n break;\n }\n }\n if (shouldSwitch) {\n rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);\n switching = true;\n }\n }\n}", "function getCitiesList() {\n var self = this\n var cities = indianCitiesDatabase.cities\n self.json(cities)\n}", "static DEFAULT_SORT_BY_FIELD(){ return \"description\"}", "function onClickFirstNameTableHeader(event)\n{\n document.isAscendingOrder = !document.isAscendingOrder;\n sortTableElementsBy(\"first_name\");\n}", "function askaron_sort(){\n\t$(\".sort__abc, sort__cba\").click(function(){\n\t\tvar ths = $(this);\n\t\tvar c = ths.closest(\".sort\");\n\t\tvar inx_col = ths.index();\n\t\tvar list = c.find(\".sort__list > td:nth-child(\"+(inx_col+1)+\")\").get();\n\t\t\n\t\t// Arrows\n\t\tths.toggleClass(\"sort__abc\").toggleClass(\"sort__cba\");\n\t\t\n\t\t// Sort\n\t\tlist.sort(function(a, b) {\n\t\t var compA = $(a).text().toUpperCase();\n\t\t var compB = $(b).text().toUpperCase();\n\t\t \n\t\t if(ths.hasClass(\"sort__abc\")){\n\t\t\t\treturn (compA < compB) ? -1 : (compA > compB) ? 1 : 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (compA > compB) ? -1 : (compA < compB) ? 1 : 0;\n\t\t\t}\n\t\t \n\t\t});\n\t\t\n\t\t// Output\n\t\tvar prev_tr = false;\n\t\t$.each(list, function(idx, itm){\n\t\t\tvar tr_n = c.find(\".sort__list\").length;\n\t\t\tvar q = 0;\n\t\t\twhile(tr_n >= q){\n\t\t\t\tvar tr_c = c.find(\".sort__list:nth-child(\"+(q+2)+\")\");\n\t\t\t\tif(itm == tr_c.find(\"td\").get(inx_col)){\n\t\t\t\t\tif (prev_tr.length>0) {\n\t\t\t\t\t\tprev_tr.after(tr_c); \n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tc.find(\"th:last\").closest(\"tr\").after(tr_c); \n\t\t\t\t\t}\n\t\t\t\t\tprev_tr = tr_c;\n\t\t\t\t}\n\t\t\t\tq++;\n\t\t\t}\n\t\t});\n\t});\n}", "function sortByMathAsc()\n{\n let tBody = document.getElementById(\"tBody\");\n tBody.innerHTML = \"\"\n sortBySubjectAsc(dataBase, \"maths\")\n // sortBySubjectDsc(dataBase, \"maths\")\n createTable(dataBase)\n}", "function sortTable(sortid){\n\t$.get('/hs', {'hostSiteID':'*', 'staticTable':'false', 'sortid':sortid}, function(response){\n\t\tvar filtertext = $(\"#filterbox\").val()\n\t\t$(\"#allHS\").html(response);\n\t\taddRowHandlers(\"hsTable\", sortTable, load_hs);\n\t\tsetupFilter();\n\t\t$(\"#filterbox\").val(filtertext);\n\t\t$(\"#filterbox\").keyup();\n\t});\n}", "function sortArtistName()\n{\n\tartists.sort( function(a,b) { if (a.name < b.name) return -1; else return 1; } );\n\tclearTable();\n\tfillArtistsTable();\n}", "function sortByType(){\n var sortColumn = 4;\n var tableData = document.getElementById(\"bookdata\").getElementsByTagName('tbody').item(0);\n var rowData = tableData.getElementsByTagName('tr'); \n for(var i = 0; i < rowData.length - 1; i++){\n for(var j = 0; j < rowData.length - (i + 1); j++){\n if(Number(rowData.item(j).getElementsByTagName('td').item(sortColumn).innerHTML === 'Y')){\n tableData.insertBefore(rowData.item(j+1),rowData.item(j));\n }\n }\n }\n }", "function sortTable(table, col) {\n var tb = table.tBodies[0];\n var tr = Array.prototype.slice.call(tb.rows, 0);\n var i;\n global_col = col;\n tr = tr.sort(compare);\n for (i = 0; i < tr.length; ++i){\n tb.appendChild(tr[i]);\n }\n}", "function sortData(field,type){\n let tableData = JSON.parse(localStorage.getItem(database));\n let data = []; \n let index = []; \n for(let i = 0;i<tableData.length;i++){\n data.push([tableData[i][field].value,i]);\n }\n let sortedData = data.sort();\n for( i =0;i<tableData.length;i++){\n index.push(sortedData[i][1]);\n }\n let newData = [];\n if(type === 'ascending'){\n for( i =0 ; i<tableData.length ; i++){\n newData.push(tableData[index[i]]);\n }\n }\n else{\n for( i =0 ; i<tableData.length ; i++){\n newData.unshift(tableData[index[i]]);\n } \n }\n \n loadTable(newData);\n localStorage.setItem(database,JSON.stringify(newData));\n }", "function cities(){\n\t//define two arrays for cities and population\n\tvar cityPop = [\n\t\t{\n\t\t\tcity: 'Madison',\n\t\t\tpopulation: 233209\n\t\t},\n\t\t{\n\t\t\tcity: 'Milwaukee',\n\t\t\tpopulation: 594833\n\t\t},\n\t\t{\n\t\t\tcity: 'Green Bay',\n\t\t\tpopulation: 104057\n\t\t},\n\t\t{\n\t\t\tcity: 'Superior',\n\t\t\tpopulation: 27244\n\t\t}\n\t];\n\n\t//append the table element to the div\n\t$(\"#mydiv\").append(\"<table>\");\n\n\t//append a header row to the table\n\t$(\"table\").append(\"<tr>\");\n\n\t//add the \"City\" and \"Population\" columns to the header row\n\t$(\"tr\").append(\"<th>City</th><th>Population</th>\");\n\n\t//loop to add a new row for each city\n for (var i = 0; i < cityPop.length; i++){\n //assign longer html strings to a variable\n var rowHtml = \"<tr><td>\" + cityPop[i].city + \"</td><td>\" + cityPop[i].population + \"</td></tr>\";\n //add the row's html string to the table\n $(\"table\").append(rowHtml);\n };\n\n addColumns(cityPop);\n addEvents();\n}", "function cities(){\r\n var cities = [\r\n 'Madison',\r\n 'Milwaukee',\r\n 'Green Bay',\r\n 'Superior'\r\n ];\r\n var population = [\r\n 233209,\r\n 594833,\r\n 104057,\r\n 27244\r\n ];\r\n// Creation of html table element\r\n var table = document.createElement(\"table\"); //<table>\r\n// Creation of html row element\r\n var headerRow = document.createElement(\"tr\"); //<tr> (Table Row)\r\n// Creation of heml cell elemtn and assigns value, adds to row\r\n var cityHeader = document.createElement(\"th\"); //<th> (Table Cell Header)\r\n cityHeader.innerHTML = \"City\"; //<th>City</th>\r\n headerRow.appendChild(cityHeader); //<tr><th><City</th></tr>\r\n// Creates another cell and adds to header row.\r\n var popHeader = document.createElement(\"th\");\r\n popHeader.innerHTML = \"Population\";\r\n headerRow.appendChild(popHeader);\r\n// Addition of headerRow\r\n table.appendChild(headerRow);\r\n\r\n// Creation of new row for each city with city name population values.\r\n// Syntax: for(Count Variable, Stop Variable, )\r\n for (var i = 0; i < cities.length; i++){\r\n var tr = document.createElement(\"tr\");\r\n\r\n var city = document.createElement(\"td\");\r\n city.innerHTML = cities[i];\r\n tr.appendChild(city);\r\n\r\n var pop = document.createElement(\"td\");\r\n pop.innerHTML = population[i];\r\n tr.appendChild(pop);\r\n\r\n table.appendChild(tr);\r\n };\r\n// Get mydiv element and append table\r\n var mydiv = document.getElementById(\"mydiv\");\r\n mydiv.appendChild(table);\r\n}", "function sortedPlanets(Planets) {\n\treturn Planets.sort();\n}", "function sortData(searches){\r\n var sorters = document.getElementsByName(\"sorter\");\r\n var sorted = 0;\r\n for(var x=0; x<4;x++){\r\n if(sorters[x].checked){\r\n sorted=x; break;\r\n }\r\n }\r\n /*\r\n sorted : \r\n 0 -> id\r\n 1 -> Name\r\n 2 -> Height\r\n 3 -> Weight\r\n */\r\n searches.sort(function (a,b){\r\n switch(sorted){\r\n case 0:\r\n return a.id - b.id;\r\n\r\n case 1:\r\n return a.name.localeCompare(b.name);\r\n \r\n case 2:\r\n return a.height-b.height;\r\n\r\n case 3:\r\n return a.weight - b.weight;\r\n }\r\n });\r\n return searches;\r\n}", "function orderAlphabetically(movie){\nvar movies = movie.map()\n}", "function groupSort(country1, country2) {\n return country1.id - country2.id;\n}", "sortedTasks(state){\n //criar uma variavel para ordernar nossas tarefas sem alterar o estado original(state)\n let sorted = state.tasks\n return sorted.sort((a,b) => {\n //se o a for menor então ele retorna para corrigir a ordenação\n if(a.name.toLowerCase() < b.name.toLowerCase()) return -1\n //mesma inversa se for o inverso da primeira situação\n if(a.name.toLowerCase() > b.name.toLowerCase()) return 1\n\n return 0\n }) \n }", "function sortTable(num){\r\n var astro = JSON.parse(localStorage.getItem('astro'));\r\n if(num === 0){\r\n for(var i=0; i<astro.length; i++){\r\n var index = i;\r\n var name = astro[i].name.toLowerCase();\r\n for(var j=i+1; j<astro.length; j++){\r\n if(astro[j].name.toLowerCase()<name){\r\n index = j;\r\n name = astro[j].name.toLowerCase();\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n else if(num === 1){\r\n for(var i=0; i<astro.length; i++){\r\n var index = i;\r\n var name = astro[i].surname.toLowerCase();\r\n for(var j=i+1; j<astro.length; j++){\r\n if(astro[j].surname.toLowerCase()<name){\r\n index = j;\r\n name = astro[j].surname.toLowerCase();\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n\r\n else if(num===2){\r\n for(var i=0; i<astro.length; i++){\r\n var dob = astro[i].dob.split('-');\r\n var index = i;\r\n for(var j=i+1; j<astro.length; j++){\r\n var bod = astro[j].dob.split('-');\r\n if(bod[0]<dob[0]){\r\n index = j;\r\n dob = bod;\r\n } else if(bod[0]==dob[0] && bod[1]<dob[1]){\r\n index = j;\r\n dob = bod;\r\n } else if(bod[0]==dob[0] && bod[1]==dob[1] && bod[2]<dob[2]){\r\n index = j;\r\n dob = bod;\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n\r\n else if(num === 3){\r\n for(var i=0; i<astro.length; i++){\r\n var index = i;\r\n var name = astro[i].power.toLowerCase();\r\n for(var j=i+1; j<astro.length; j++){\r\n if(astro[j].power.toLowerCase()<name){\r\n index = j;\r\n name = astro[j].power.toLowerCase();\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n console.log(astro);\r\n localStorage.setItem('astro', JSON.stringify(astro));\r\n addAstronaut();\r\n}", "function changeSort() {\n window.location.href = loc.origin + '/?sk=h_chr';\n }", "set sortingOrder(value) {}", "async function getCityWithSmallerNameOfEachState() {\n try {\n let allStatesAccounts = [];\n let allCities = [];\n let data = [];\n\n const allStates = await returnAllStates();\n \n allStatesAccounts = allStates.map((state) => state.Sigla);\n\n for (let state of allStatesAccounts) {\n data = JSON.parse(\n await fs.readFile(`${CitiesByStatesJsonOutput}${state}.json`)\n );\n\n data.Cities.sort();\n data.Cities.sort((a, b) => {return a.length - b.length;});\n allCities.push({ uf: state, cities: data.Cities[0] });\n }\n\n console.log('CIDADES COM O MENOR NOME DE CADA ESTADO--------------------->')\n console.log(allCities);\n console.log('');\n\n } catch (err) {\n console.log('ERRO: ' + err);\n }\n}", "sortedListings() {\n return this.state.data.sort((a, b) => {\n return b.id - a.id\n })\n }", "function tableSort(key) {\n let sortBy = key;\n let sortOrder = null;\n if (this_Obj.state.sortBy !== key) {\n sortOrder = 'ASC';\n } else if (this_Obj.state.sortBy === key && this_Obj.state.sortOrder === 'ASC') {\n sortOrder = 'DESC';\n } else if (this_Obj.state.sortBy === key && this_Obj.state.sortOrder === 'DESC') {\n sortBy = sortOrder = null;\n }\n\n let { spectatorPageSize } = this_Obj.props.userState;\n spectatorPageSize = spectatorPageSize ? spectatorPageSize : 10;\n let filterData = {\n organisationUniqueKey: this_Obj.state.organisationId,\n yearRefId: this_Obj.state.yearRefId,\n paging: {\n limit: spectatorPageSize,\n offset: this_Obj.state.pageNo ? spectatorPageSize * (this_Obj.state.pageNo - 1) : 0,\n },\n };\n\n this_Obj.setState({ sortBy, sortOrder });\n this_Obj.props.getSpectatorListAction(filterData, sortBy, sortOrder);\n}", "function loadCityList(r) {\n if (r && r.value) {\n autocomp.savedCities = r.value;\n } else{\n autocomp.initializeCities();\n }\n }", "function sortTableview(type,index){\r\n var rows=$('#result_2 #'+type).find('tr').has('td').get();\r\n //alert(rows);\r\n rows.sort(function(a,b){\r\n var key_a=$(a).children('td').eq(index-1).text();\r\n key_a=$.trim(key_a);\r\n var key_b=$(b).children('td').eq(index-1).text();\r\n key_b=$.trim(key_b);\r\n if(key_a > key_b) return 1;\r\n if(key_a < key_b) return -1;\r\n return 0\r\n });\r\n $.each(rows,function(i,e){\r\n $('#result_2 #'+type).append(e);\r\n // if(i%2==1){\r\n // $(e).css('background','#ECECEC');\r\n // }else{\r\n // $(e).css('background','#FFFFFF'); \r\n // }\r\n });\r\n //setStyle(type); \r\n var page=$('#'+type).attr('index');\r\n $('#'+type+' tr').show();\r\n $('#'+type+' tr:lt('+parseInt((page-1)*50+1)+')').hide();\r\n $('#'+type+' tr:gt('+parseInt(page*50)+')').hide();\r\n $('#'+type+' tr:eq(0)').show();\r\n}", "function sort($p) {\n /* create ($rows) a variable to hold the group of rows\n ** to be displayed on the selected page,\n ** ($s) the start point .. the first row in each page, Do The Math\n */\n var $rows = $th, $s = (($n * $p) - $n);\n for ($i = $s; $i < ($s + $n) && $i < $tr.length; $i++)\n $rows += $tr[$i];\n\n // now the table has a processed group of rows ..\n $table.innerHTML = $rows;\n // create the pagination buttons\n document.getElementById(\"buttons\").innerHTML = pageButtons($pageCount, $p);\n // CSS Stuff\n document.getElementById(\"id\" + $p).setAttribute(\"class\", \"active\");\n}", "function cities(){\n //define two arrays for cities and population\n var cityPop = [\n { \n city: 'Madison',\n population: 255214\n },\n {\n city: 'St. Louis',\n population: 308626\n },\n {\n city: 'Kirksville',\n population: 17536\n },\n {\n city: 'Estes Park',\n population: 6339\n },\n\t{\n\t city: 'Fort Collins',\n\t population: 165080\n\t}\n ];\n\n //append the table element to the div\n $(\"#mydiv\").append(\"<table>\");\n\n //append a header row to the table\n $(\"table\").append(\"<tr>\");\n\n //add the \"City\" and \"Population\" columns to the header row\n $(\"tr\").append(\"<th>City</th><th>Population</th>\");\n\n //loop to add a new row for each city, should account for additional city due to using cityPop.length\n for (var i = 0; i < cityPop.length; i++){\n //assign longer html strings to a variable\n var rowHtml = \"<tr><td>\" + cityPop[i].city + \"</td><td>\" + cityPop[i].population + \"</td></tr>\";\n //add the row's html string to the table\n $(\"table\").append(rowHtml);\n };\n}", "function cityLinks(){\n\t\t// Localiza la lista de aldeas\n var cities = find(\"//div[preceding-sibling::div[@class='div4']]//table[@class='f10']\", XPFirst);\n if (!cities) return;\n\n\t\tcities = cities.firstChild;\n\t\tfor (var i = 0; i < cities.childNodes.length; i++){\n\t\t\t// Utiliza el texto de las coordenadas para averiguar el ID necesario para los enlaces\n\t\t\tvar city = cities.childNodes[i];\n\t\t\tcity.textContent.search(/\\((.*)\\n?\\|\\n?(.*)\\)/);\n\t\t\tvar id = xy2id(RegExp.$1, RegExp.$2);\n\t\t\tcity.appendChild(elem(\"TD\", \"<a href='a2b.php?z=\" + id + \"'><img src='\" + img('a/def1.gif') + \"' width='12' border='0' title='\" + T('ENV_TROPAS') + \"'></a>\"));\n\t\t\tcity.appendChild(elem(\"TD\", \"<a href='build.php?z=\" + id + \"&gid=17'><img src='\" + img('r/4.gif') + \"' height='12' border='0' title='\" + T('ENVIAR') + \"'></a>\"));\n\t\t}\n\t}", "sorting(addressData) {\n console.log(addressData.Person.sort(this.compare1));\n }", "function cities(){\n //define two arrays for cities and population\n var cityPop = [\n { \n city: 'Lilongwe',\n population: 646750\n },\n {\n city: 'Lusaka',\n population: 1700000\n },\n {\n city: 'Maputo',\n population: 1101170\n },\n {\n city: 'Johannesburg',\n population: 49320000\n }\n ];\n\n //append the table element to the div\n $(\"#mydiv\").append(\"<table>\");\n\n //append a header row to the table\n $(\"table\").append(\"<tr>\");\n\n //add the \"City\" and \"Population\" columns to the header row\n $(\"tr\").append(\"<th>City</th><th>Population</th>\");\n\n //loop to add a new row for each city\n for (var i = 0; i < cityPop.length; i++){\n //assign longer html strings to a variable\n var rowHtml = \"<tr><td>\" + cityPop[i].city + \"</td><td>\" + cityPop[i].population + \"</td></tr>\";\n //add the row's html string to the table\n $(\"table\").append(rowHtml);\n };\n}", "function sortTable(n) {\n console.log(n);\n let res = [];\n let heading = document.querySelectorAll(\"th\");\n let title = [];\n for (let i = 0; i < heading.length; i++) {\n title.push(heading[i].innerText);\n }\n console.log(title);\n let rows = document.querySelectorAll(\"tr\");\n console.log(rows);\n for (let i = 0; i < rows.length; i++) {\n let column = [];\n let cells = rows[i].querySelectorAll(\"td\");\n for (let j = 0; j < cells.length; j++) {\n column.push(cells[j].innerText);\n }\n res.push(column);\n }\n\n res = sortByColumn(res, n);\n let table = document.getElementById(\"table\");\n let tableData = \"\";\n tableData += \"<tr>\";\n for (let i = 0; i < title.length; i++) {\n tableData += `<th onclick=\"sortTable(${i})\">${title[i]}</th>`;\n }\n tableData += `</tr>`;\n for (let i = 1; i < res.length; i++) {\n tableData += '<tr class=\"items\">';\n for (let j = 0; j < res[i].length; j++) {\n tableData += `<td>${res[i][j]}</td>`;\n }\n tableData += `</tr>`;\n }\n table.innerHTML = tableData;\n}", "function theQwertyGrid_sortInt(key) {\n\t\t\tif(_theQwertyGrid_sortInAsc) {\n\t\t\t\t_theQwertyGrid_sortInAsc = false;\n\t\t\t\t_theQwertyGrid_displayData.sort(function(a,b) {\n\t\t\t\t\treturn a[key] - b[key];\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\t_theQwertyGrid_sortInAsc = true;\n\t\t\t\t_theQwertyGrid_displayData.sort(function(b,a) {\n\t\t\t\t\treturn a[key] - b[key];\n\t\t\t\t});\n\t\t\t}\n\t\t\ttheQwertyGrid_reFillTable(_theQwertyGrid_displayData);\n\t\t\t\n\t\t}", "function sortChanged(){\n\tconst url2 = url+`&q=${name.val()}&t=${type.val()}&color=${color.val()}&s=${sort.val()}`;\n\tloadData(url2, displayData);\n}", "function cities(){\n // object to hold cities and populations\n var cityObj = {\n 'Madison' : 233209,\n 'Milwaukee' : 594833,\n 'Green Bay' : 104057,\n 'Superior' : 27244\n }\n\n var table = $('#mydiv').append(\"<table>\");\n var headerRow = $('table').append(\"<tr>\");\n var cityHeader = $('tr').append(\"<th>\");\n\n console.log(cityHeader);\n cityHeader.html(\"City\");\n headerRow.append(cityHeader);\n table.append(headerRow);\n\n // create table element\n var table = document.createElement(\"table\");\n\n // create a header row\n var headerRow = document.createElement(\"tr\");\n\n // add the \"city\" column\n var cityHeader = document.createElement(\"th\"); //<th>\n cityHeader.innerHTML = \"City\"; // <th>City<th>\n headerRow.appendChild(cityHeader);\n\n // add the \"Population\" column\n var popHeader = document.createElement(\"th\");\n popHeader.innerHTML = \"Population\";\n headerRow.appendChild(popHeader);\n\n // add header row to the table\n table.appendChild(headerRow);\n\n // loop to add a new row for each city\n for (var cityKey in cityObj){\n if (cityKey === 'Madison') {\n console.log(cityObj[cityKey]);\n } else if (cityKey === 'Milwaukee') {\n console.log('Lake Michigan!');\n }\n\n // create table row element\n var tr = document.createElement(\"tr\");\n // create cell element for city\n var city = document.createElement(\"td\");\n city.innerHTML = cityKey;\n tr.appendChild(city);\n\n var pop = document.createElement(\"td\");\n pop.innerHTML = cityObj[cityKey];\n tr.appendChild(pop);\n\n table.appendChild(tr);\n };\n\n // add the table to the div in index.html\n var mydiv = document.getElementById(\"mydiv\");\n mydiv.appendChild(table);\n}", "function cities() {\n//defines cityPop as an array populated by 4 objects, each being a city:population pair\n\tvar cityPop = [ \n\t\t{ \n\t\t\tcity: 'Madison', //creates city name as the first key in the object\n\t\t\tpopulation: 233209 //creates population as second key in object\n\t\t},\n\t\t{\n\t\t\tcity: 'Milwaukee',\n\t\t\tpopulation: 594833\n\t\t},\n\t\t{\n\t\t\tcity: 'Green Bay',\n\t\t\tpopulation: 104057\n\t\t},\n\t\t{\n\t\t\tcity: 'Superior',\n\t\t\tpopulation: 27244 \n\t\t}\n\t];\n\n\t//append the table element to the div -- this creates a table to be populated\n\t$(\"#mydiv\").append(\"<table>\");\n\n\t//append a header row to the table - <tr> indicates a table row\n\t$(\"table\").append(\"<tr>\");\n\t\n\t//adds the \"City\" and \"Population\" columns to the header row\n\t$(\"tr\").append(\"<th>City</th><th>Population</th>\"); //<th> stands for 'table header'\n\t\n\t//loop to add a new row for each city\n for (var i = 0; i < cityPop.length; i++){\n //assign longer html strings to a variable\n var rowHtml = \"<tr><td>\" + cityPop[i].city + \"</td><td>\" + cityPop[i].population + \"</td></tr>\"; // <td> indicates table data. The cell is populated as a standard cell rather than a header cell\n //add the row's html string to the table\n $(\"table\").append(rowHtml);\n };\n\n addColumns(cityPop); //calls addColumns(cityPop) as defined below\n addEvents(); //calls addEvents() as defined below\n debugAjax()\n}", "handleSortClick() {\n this.props.sortTable();\n }", "function sortByDistanceAndRenderHTML() {\n\tdocument.getElementById(\"sort__distance\").classList.add('sort__button--active');\n\tdocument.getElementById(\"sort__price\").classList.remove('sort__button--active');\n\n\tcoffeeShops.sort(function(a,b) {\n\t\treturn a.distance - b.distance;\n\t});\n\n\tdocument.getElementById(\"coffee-shops-list\").innerHTML = \"\";\n\tcoffeeShops.forEach(function(shop){\n\t\taddCoffeeShopToList(shop);\n\t});\n}" ]
[ "0.66447794", "0.66079265", "0.65423095", "0.65228385", "0.6452466", "0.64207315", "0.63531286", "0.6342895", "0.6316144", "0.6256683", "0.62367994", "0.6231205", "0.62276167", "0.6062672", "0.60544074", "0.60519296", "0.6036094", "0.60267305", "0.59951866", "0.59783036", "0.5977441", "0.59723526", "0.5966754", "0.5940745", "0.5899572", "0.58966744", "0.5866511", "0.5835476", "0.5826957", "0.58245546", "0.5813559", "0.5813088", "0.5796991", "0.5786433", "0.5764649", "0.57644683", "0.57591265", "0.5729998", "0.5729998", "0.5720422", "0.57085145", "0.57044894", "0.56985044", "0.56978106", "0.56773597", "0.566446", "0.5654723", "0.56428593", "0.5640793", "0.56308687", "0.56290483", "0.5625958", "0.56155324", "0.56095463", "0.56056076", "0.56015867", "0.55868113", "0.5577765", "0.5573994", "0.5556088", "0.55558234", "0.55465156", "0.5545108", "0.5545028", "0.55336595", "0.5529639", "0.55264235", "0.55236775", "0.5511605", "0.55082", "0.5506985", "0.5505933", "0.55040264", "0.5503744", "0.5503435", "0.5502649", "0.54988354", "0.54974526", "0.54950553", "0.54946643", "0.5492994", "0.54903924", "0.5487376", "0.5484997", "0.548003", "0.5472802", "0.54640716", "0.54625076", "0.5462227", "0.54578584", "0.5448876", "0.5443938", "0.5443662", "0.54433614", "0.5434297", "0.54311293", "0.5426269", "0.54237664", "0.5423485", "0.5423064", "0.5420171" ]
0.0
-1
Decamelizes a string with/without a custom separator (hyphen by default). from:
function decamelize(str, separator = '-') { return str .replace(/([a-z\d])([A-Z])/g, '$1' + separator + '$2') .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + separator + '$2') .toLowerCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _dasherize(str){return _decamelize(str).replace(/[ _]/g, '-')}", "function unhyphenate(str){\n\t str = toString(str);\n\t return str.replace(/(\\w)(-)(\\w)/g, '$1 $3');\n\t }", "function toHyphenDelimited (string) {\n return string.replace(/([a-z][A-Z])/g, function (g) {\n return g[0] + '-' + g[1];\n }).toLowerCase();\n}", "_deCamelize(_str) {\n return _str.replace(/(([A-Z])(\\w))/g, ($0, $1, $2, $3) => {\n return '-' + $2.toLowerCase() + $3;\n });\n }", "_deCamelize(_str) {\n return _str.replace(/(([A-Z])(\\w))/g, ($0, $1, $2, $3) => {\n return '-' + $2.toLowerCase() + $3;\n });\n }", "function dashify(str){\n return str.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n}", "function uncamelizeString(str, separator) {\n if (typeof separator == \"undefined\") {\n separator = \" \";\n }\n\n return str.replace(/[A-Z]/g, function (char) {\n return separator + char.toLowerCase();\n });\n}", "function hyphenate(str) {\n str = toString_1[\"default\"](str);\n str = unCamelCase_1[\"default\"](str);\n return slugify_1[\"default\"](str, '-');\n}", "function hyphenate(str){\n\t str = toString(str);\n\t str = unCamelCase(str);\n\t return slugify(str, \"-\");\n\t }", "function hyphenate(str) {\n\t return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n\t }", "function camelCaseToDash(string) {\n\treturn string.replace(/([\\w])([A-Z])/g,'$1-$2').toLowerCase();\n}", "function getAlphaNumericDash(s) {\n return s.replace(/[\\W_]+/g,'-')\n}", "function string_string(str) {\n\n\t//hello_word = \"hello world\", hello-world=>hello-word\n\t//hello--worlf=\n\tconsole.log(str);\n\t\n\nreturn str.replace(/^[-]/,'')\n\t\t\treplace(/--/g,\",\")\n\t\t\t.replace(/_/g,\" \");\n\n \n\n // let result = \"\";\n\n // str.split('--').forEach((each) => {\n\n // if (each.match(/[_]/)) {\n // result += '\"'+ each.replace(/[_]/g, \" \") + '\"';\n // } else {\n // result += \" \"+each;\n // }\n // })\n\n // return result.replace(/[\\s]dot/g, \" . \");\n\n}", "function camelToDash(str) {\n if (!str) return '';\n\n return str.replace(/\\W+/g, '-')\n .replace(/([a-z\\d])([A-Z])/g, '$1-$2');\n }", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function camelToDashed(str) {\n return str.replace(/\\W+/g, '-').replace(/([a-z\\d])([A-Z])/g, '$1-$2').toLowerCase();\n}", "function denormalize(str) {\n return str.replace(/\\W+/g, '-')\n .replace(/([a-z\\d])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function hyphenate(str){\n str = toString(str);\n str = unCamelCase(str);\n return slugify(str, \"-\");\n }", "function hyphenateString(string) {\n return string.toLowerCase().replace(/ /g,\"-\");\n}", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "function hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "function spaceToDash(text) {\n return text.trim().replace(/\\s/g, '-');\n }", "function unCamelCase(str, delimiter){\n\t if (delimiter == null) {\n\t delimiter = ' ';\n\t }\n\n\t function join(str, c1, c2) {\n\t return c1 + delimiter + c2;\n\t }\n\n\t str = toString(str);\n\t str = str.replace(CAMEL_CASE_BORDER, join);\n\t str = str.toLowerCase(); //add space between camelCase text\n\t return str;\n\t }", "function doDashes2(str) {\n return replaceNonChar(str, '-');\n}", "function camelCaseToDash(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}", "function camel2dash(str) {\n\t\treturn str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n\t}", "function removeDashes(string) {\n string = string.replace(/-/g, ' ');\n string = string.replace(/_/g, ' ');\n\n return string;\n }", "function slugify(str, delimeter){\n\t str = toString(str);\n\n\t if (delimeter == null) {\n\t delimeter = \"-\";\n\t }\n\t str = replaceAccents(str);\n\t str = removeNonWord(str);\n\t str = trim(str) //should come after removeNonWord\n\t .replace(/ +/g, delimeter) //replace spaces with delimeter\n\t .toLowerCase();\n\t return str;\n\t }", "function dasherize(strText)\n{\n var intPos = 0;\n while (intPos < strText.length) {\n var strCarac = strText[intPos];\n var intAscii = ord(strCarac);\n if ((!empty(strCarac)) && (strCarac == strCarac.toUpperCase()) && (((intAscii >= 48) && (intAscii <= 57)) || ((intAscii >= 65) && (intAscii <= 90)) || ((intAscii >= 97) && (intAscii <= 122)))) {\n strText = strText.substr(0, intPos) + strCarac.toLowerCase() + strText.substr(intPos + 1);\n if (intPos !== 0)\n strText = strText.substr(0, intPos) + '-' + strText.substr(intPos);\n }\n ++intPos;\n }\n strText = replaceAll(strText, new Array('_', ' ', '--'), '-');\n return strText.toLowerCase();\n}", "function unformat(x)\n\t\t{\n\t\t\tvar x = x.split('/').reverse().join('-');\n\t\t\treturn x;\n\t\t}", "function camelize(str) {\r\n var rmv = str.split('-');\r\n for (var i = 0; i < rmv.length; i++) {\r\n rmv[i] = rmv[i].charAt(0).toUpperCase() + rmv[i].slice(1);\r\n }\r\n return rmv.join('');\r\n}", "function toDashedAll(str) {\n return str.replace(/([A-Z])/g, function ($1) {\n return '-' + $1.toLowerCase();\n });\n }", "function toDashedAll(str) {\n return str.replace(/([A-Z])/g, function ($1) {\n return '-' + $1.toLowerCase();\n });\n }", "function removeDashSeparators(songName) {\n let parts = songName.split(' - ');\n if (parts.length > 0) {\n let name = parts[0];\n return name;\n }\n // doesnt contain any '-' separators.\n return songName;\n}", "function _decamelize(str){return str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase()}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll( str ) {\n return str.replace( /([A-Z])/g, function( $1 ) {\n return '-' + $1.toLowerCase();\n });\n}", "function toDashedAll(str) {\n return str.replace(/([A-Z])/g, function ($1) {\n return '-' + $1.toLowerCase();\n });\n }", "function toDashCase(str) {\n return str.toLowerCase().replace(\" \", \"-\");\n}", "function toDashedAll(str) {\n return str.replace(/([A-Z])/g, function($1) {\n return '-' + $1.toLowerCase();\n });\n }", "function camelCaseToDash(key) {\n return key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function camelCaseToDash(key) {\n return key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n }", "function thunk(str){return str.replace(/-/g,'_').toUpperCase();}", "function dash (name) {\n return varname.split(name).join('-');\n}", "function dash (name) {\n return varname.split(name).join('-');\n}", "function rep(s) {\n return s.replace(' ', '-');\n}", "function dashedToCamel(str) {\n return str.replace(/-([a-z])/g, function (m, w) {\n return w.toUpperCase();\n });\n}", "function UnquoteSplicing() {\r\n}", "function replaceHyphonsWithSpace(str){\r\n return str.replace(/-/g, ' ');\r\n}", "function reverseBySeparator(string, separator) {\n return string\n .split(separator)\n .reverse()\n .join(separator)\n .replace(/[^A-Za-z 0-9]/gi, \"\");\n}", "function camelize(string) {\n\t\t\tstring = StringUtils.trim(string).replace(/[-\\s]+(.)?/g, function (match, c) {\n\t\t\t\treturn c ? c.toUpperCase() : '';\n\t\t\t});\n\t\t\treturn StringUtils.decap(string);\n\t\t}", "function hyphenCase(input) {\n input = splitString(input, ' ');\n for (var i = 0; i < input.length; i++) {\n input[i] = lowerCase(input[i]);\n }\n return joinArray(input, '-');\n}", "static _cleanString(str){\n\t\treturn str.trim().toLowerCase().split(\" \").join(\"-\").replace(/[^a-z0-9\\-]+/gi, \"\");\n\t}", "function stripTail(str){var arr=str.match(/(.+)(-[^-]+)$/);var st='';if(arr&&arr.length===3){st=arr[1];}return st;}", "function stripTail(str){var arr=str.match(/(.+)(-[^-]+)$/);var st='';if(arr&&arr.length===3){st=arr[1];}return st;}", "dasherize(str) {\n str = str || this.str;\n\n str = str.replace(this.spaceOrUnderbar, '-');\n str = str.toLowerCase();\n\n // set str\n this.str = str;\n\n if (this.chain === true) {\n return this;\n }\n\n // return result\n return str;\n }", "function urlify(string) {\n return string.toLowerCase().split(/\\s+/).join(\"-\");\n}", "function urlify (string) {\n return string.toLowerCase().split(/\\s+/).join(\"-\");\n}", "function tambahDash(str) {\n var string = \"\";\n for (let i = 0; i < str.length; i++) {\n if (str.charAt(i) % 2 == 1 && str.charAt(i+1) % 2 == 1) {\n string+=str.charAt(i) + \"-\"\n } else {\n string+=str.charAt(i)\n }\n }\n return string\n}", "function camelize(str) {\n var wordParts = str.split('-');\n var newString = wordParts[0];\n for (var i = 1; i < wordParts.length; i++) {\n newString += wordParts[i].charAt(0).toUpperCase() + wordParts[i].slice(1);\n }\n return newString;\n}", "function dashToCamel( str ) {\n\treturn str.replace( /-(.)?/g , ( match , letter ) => letter ? letter.toUpperCase() : '' ) ;\n}", "function dashCase() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Word,\n pat: /\\b(\\w+)\\b/g,\n repl: function (_match, p1) { return p1\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase()\n .replace(/_/g, '-'); },\n });\n }", "function urlify(string) {\n return string.toLowerCase().split(/\\s+/).join(\"-\")\n}", "function r(t){return t.toLowerCase().split(\"-\").map(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}).join(\"-\")}", "function urlify(string) {\n return string.toLowerCase().split(/\\s+/).join(\"-\");\n}", "divider(str) {\n return str.replace(new RegExp('-{3,}', 'g'), '<hr>')\n }", "function camelize(str) {\n var arr = str.split('-');\n\n for (var i = 1; i < arr.length; i++) {\n arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);\n }\n\n return arr.join('');\n\n}", "function hyphenateStyleName(string) {\n return uppercaseCheck.test(string) && !string.startsWith('--')\n ? string.replace(uppercasePattern, prefixAndLowerCase).replace(msPattern, '-ms-')\n : string;\n }", "function tambahDash(str) {\n var string = \"\";\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] % 2 == 1 && str[i - 1] % 2 == 1) {\n string += \"-\" + str[i];\n } else {\n string += str[i];\n }\n }\n\n return string;\n}", "function camelize(str) {\n // when you met '-' change to UpperCase\n let tempArr = str.split('-').map((word, index) => {\n // console.log(word, index) -webkit- : webkit index 1\n index == 0 ? word : word[0].toUpperCase() + word.slice(1)\n });\n return tempArr.join('');\n}", "function normalizeOption(str) {\n str = str.replace(/_/g, \" \");\n return str;\n }", "function camelize(strText)\n{\n strText = replaceAll(ucfirst(strText), new Array('_', ' '), '-');\n var intPos = strText.indexOf('-');\n while (intPos != -1) {\n strText = strText.substr(0, intPos) + strText.substr(intPos + 1);\n var strCarac = strText[intPos];\n if (!empty(strCarac))\n strText = strText.substr(0, intPos) + strCarac.toUpperCase() + strText.substr(intPos + 1);\n intPos = strText.indexOf('-');\n }\n return strText;\n}", "function camelize(str) {\n return str.split('-')\n .map((word, index) => index == 0 ? word.toLowerCase() : word[0].toUpperCase() + word.slice(1))\n .join('');\n}" ]
[ "0.7354994", "0.68960834", "0.65580666", "0.65105164", "0.65105164", "0.6434672", "0.63976294", "0.63621306", "0.63453674", "0.63419646", "0.6294325", "0.6270401", "0.62457764", "0.6242554", "0.6231834", "0.6231834", "0.6231834", "0.6231834", "0.6231834", "0.6231834", "0.6225177", "0.6211138", "0.62110156", "0.6191575", "0.6167839", "0.6167839", "0.6167839", "0.6167839", "0.6164094", "0.61435413", "0.6139546", "0.6116521", "0.60557985", "0.6027998", "0.600989", "0.59519017", "0.594045", "0.5933811", "0.59294766", "0.59034574", "0.5902998", "0.5893862", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58760434", "0.58613837", "0.58521676", "0.5833089", "0.5823287", "0.5823287", "0.58209234", "0.5815911", "0.5815911", "0.57716405", "0.57676333", "0.57658124", "0.5748185", "0.57461506", "0.5734632", "0.5731709", "0.5730476", "0.57211417", "0.57211417", "0.5713702", "0.569213", "0.5684381", "0.5677732", "0.5677505", "0.567468", "0.5671775", "0.5671253", "0.5666548", "0.5666343", "0.5648545", "0.5639277", "0.562996", "0.562145", "0.5620393", "0.56188256", "0.56161374", "0.561536" ]
0.7090734
1
remember me filesystem error callback
function errorCB(error) { console.log('An error occurred during media capture'); console.log('An error occurred during media capture: ' + error.code); var msg = 'An error occurred during media capture: ' + error.code; // Display notification if this is a real error and user did not just exit without recordihng anything if ( error.code != 3 ) { navigator.notification.alert(msg, null, 'Capture error'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onError(e) {\n console.log(`Filer filesystem error: ${e}`);\n }", "function onFileSystemFail(err) {\n console.log('deleteFileFromPersistentStorage file system fail: ' + fileName);\n console.log('error code = ' + err.code);\n }", "function onFileSystemFail(error) {\n console.log('moveFileToPersistentStorage file system fail code ' + error.code);\n var msg = 'An error occurred during file copy: ' + error.code;\n navigator.notification.alert(msg, null, 'File copy error in moveFileToPersistentStorage()');\n }", "function failFileRestoreRing(error) {\n\tvar restorefavringsfailed = $.t('restorefavringsfailed');\n\twindow.ringRestoreFailed = true;\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Restore - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(restorefavringsfailed, 'short');\n}", "onReadError(err, fileId, file) {\n console.error(`ufs: cannot read file \"${ fileId }\" (${ err.message })`);\n }", "onWriteError(err, fileId, file) {\n console.error(`ufs: cannot write file \"${ fileId }\" (${ err.message })`);\n }", "onerror() {}", "onerror() {}", "function fileShareError(event) {\n // cleanup\n receiveBuffer = [];\n incomingFileData = [];\n receivedSize = 0;\n // error\n if (sendInProgress) {\n console.error(\"fileShareError\", event);\n alert(\"error: File Sharing \" + event.error);\n sendInProgress = false;\n }\n}", "function error (err) {\n if(error.err) return;\n callback(error.err = err);\n }", "function failFileRestoreWall(error) {\n\tvar restorefavwallsfailed = $.t('restorefavwallsfailed');\n\twindow.wallRestoreFailed = true;\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Restore - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(restorefavwallsfailed, 'short');\n}", "function onTransferError() {\n isFileTransferInProgress = false;\n msg(\"File transfer error\");\n eventHandler.dispatchEvent('error', new Error('File transfer failed'));\n}", "function errorReadingFiles(error) {\n logger(error);\n bootstrap.errorCallback();\n}", "onError() {}", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function handleFileUploadError(_data) {\r\n\tcheckError(_data.response().jqXHR, '_folderMessage');\r\n}", "function fnInitFileSystem() {\n\t\t// Compatibilidad con navegadores para que no se genere errores\n\t\tif (self.requestFileSystemSync) fs = fs || self.requestFileSystemSync(TEMPORARY, constFs.SIZEFILES);\n\t\tself.tools.factoryError(fnHandleMessagesError); \n\t}", "function errorHandler(e) {\n var msg = '';\n\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg = 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg = 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg = 'INVALID_STATE_ERR';\n break;\n default:\n msg = 'Unknown Error';\n break;\n };\n\n console.log('Error: ' + msg);\n document.getElementById('download').style.display = '';\n document.getElementById('status').innerHTML = '<b>Error</b> '+msg;\n}", "function fileUploadFailed() {\n console.log(\"Failed to upload file\");\n}", "_onError(event) {\n const span = document.createElement(\"span\");\n span.innerHTML = \"\" + \"Upload failed. Retrying in 5 seconds.\";\n this.node.appendChild(span);\n this.retry = setTimeout(() => this.callbackUpload(), 5000, this.data);\n\n TheFragebogen.logger.error(this.constructor.name + \".callbackUpload()\", \"Upload failed with HTTP code: \" + this.request.status + \". Retrying in 5 seconds.\");\n }", "function loaderErrback(error, url) {\n//console.error(\"in loaderErrback\", error);\n\t\t\tLoader._error(\"Error loading url '\"+url+\"'\");\n\t\t\tif (errback) {\n\t\t\t\terrback(error, url);\n\t\t\t\tloadNext();\n\t\t\t} else {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "function errorHandler(e) {\n\tif(e.target.error.name == \"NotReadableError\") {\n\t\talert(\"Cannot read file !\");\n\t}\n}", "function loading_error(error, filename, lineno) {\n console.log(\"Error when loading files: \" + error);\n res.send(error);\n }", "onError_() {\n this.switchScreen_(Screens.ERROR);\n getParentAccessUIHandler().onParentAccessDone(ParentAccessResult.kError);\n }", "function failFileBackup(error) {\n\tvar backupfailed = $.t('backupfailed');\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Backup - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(backupfailed, 'short');\n}", "function errorHandler(e) {\n var msg = '';\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n\t\t \tprint('Error: QUOTA_EXCEEDED_ERR');\n break;\n case FileError.NOT_FOUND_ERR:\n\t\t \tprint('Error: NOT_FOUND_ERR');\n break;\n case FileError.SECURITY_ERR:\n\t\t \tprint('Error: SECURITY_ERR');\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n\t\t \tprint('Error: INVALID_MODIFICATION_ERR');\n break;\n case FileError.INVALID_STATE_ERR:\n\t\t \tprint('Error: INVALID_STATE_ERR');\n break;\n default:\n\t\t \tprint('Error: Unknown Error\\n(Check console for details)');\n\t\t \tconsole.log(e);\n break;\n };\n}", "function readFailureCallback(e) {\n if (this._readyState === FileReader.DONE) {\n return;\n }\n\n this._readyState = FileReader.DONE;\n this._result = null;\n this._error = new FileError(e);\n\n if (typeof this.onerror === \"function\") {\n this.onerror(new ProgressEvent(\"error\", {target:this}));\n }\n\n if (typeof this.onloadend === \"function\") {\n this.onloadend(new ProgressEvent(\"loadend\", {target:this}));\n }\n}", "function readFailureCallback(e) {\n if (this._readyState === FileReader.DONE) {\n return;\n }\n\n this._readyState = FileReader.DONE;\n this._result = null;\n this._error = new FileError(e);\n\n if (typeof this.onerror === \"function\") {\n this.onerror(new ProgressEvent(\"error\", {target:this}));\n }\n\n if (typeof this.onloadend === \"function\") {\n this.onloadend(new ProgressEvent(\"loadend\", {target:this}));\n }\n}", "function errorHandler(e) {\n var msg = '';\n\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg = 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg = 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg = 'INVALID_STATE_ERR';\n break;\n default:\n msg = 'Unknown Error';\n break;\n }\n console.log('Error: ' + msg);\n }", "function fileReadFail(data){\n console.log(data);\n}", "logErrorToFile(callback) {\n if (!options.JSONFilePath)\n return callback(null, null)\n\n require('../Utils/ErrorUtils').errToJson(options.JSONFilePath, {\n error: err,\n errorType: err.errType,\n errorMessage: err.message,\n flightRequest: result.findFlightRequest.id,\n user: result.findFlightRequest.user\n }, {\n useBase: true\n }, function done (err) {\n if (err) {\n err.errType = 'SaveJsonFailiure'\n return callback(err, null)\n } else {\n return callback(null, true)\n }\n })\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "function handleError(err) {\n\t\t\toptions.lastError = err;\n\t\t\tif (options.onError) {\n\t\t\t\tif (options.onError.length > 1)\n\t\t\t\t\toptions.onError(err, runAgain);\n\t\t\t\telse {\n\t\t\t\t\toptions.onError(err);\n\t\t\t\t\trunAgain(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\trunAgain(true);\n\t\t}", "function errorHandler(error) {\n console.error(`There was a problem connecting to ${urlRoot}.Error was <${error.message}>. Please check \"${directory}${errorFileName}\" for more details on the issue.`);\n fs.appendFile(directoryRoot + directory + errorFileName, `${createErrDate()} <${error}>\\n`);\n}", "function OnErr() {\r\n}", "function failureCB(){}", "function onError (err) {\n socket.removeListener('connect', onConnect);\n socket.destroy();\n\n return ~['ENOENT', 'ECONNREFUSED'].indexOf(err.code)\n ? callback(null, options.path)\n : callback(err);\n }", "function failureCB() { }", "function fsErr(err) {\n if (typeof err === \"object\" && \"errno\" in err)\n return -err.errno;\n return -JSMIPS.ENOTSUP;\n}", "function ErrorHandler() {}", "function createNotFoundDirectoryListener(){return function notFound(){this.error(404);};}", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)errorOrDestroy(dest,er);}// Make sure our error handler is attached before userland ones.", "checkedEmitError(error) {\n if (!isIgnorableFileError(error)) {\n this.emit('error', error);\n }\n }", "onCopyError(err, fileId, file){\n console.error(`ufs: cannot copy file \"${ fileId }\" (${ err.message })`);\n }", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n requestPhotos(fallBackLocation)\n \n}", "function statusError()\n\t{\n\t\tcallback();\n\t}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function errorHandler(error) {\n var message = '';\n switch (error.code) {\n case FileError.SECURITY_ERR:\n message = 'Security Error';\n break;\n case FileError.NOT_FOUND_ERR:\n message = 'Not Found Error';\n break;\n case FileError.QUOTA_EXCEEDED_ERR:\n message = 'Quota Exceeded Error';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n message = 'Invalid Modification Error';\n break;\n case FileError.INVALID_STATE_ERR:\n message = 'Invalid State Error';\n break;\n default:\n message = 'Unknown Error UAY';\n break;\n }\n alert(message);\n }", "errorCallback(callback) {\n\t\tthis._cbError = callback\n\t}", "function onUploadError(event) {\r\n\t\t\tthis.progressReport.innerHTML = \"上传失败\";\r\n\t\t}", "onUploadError(item, response) {\n this.errorQueue.push({item: item, response: response});\n this.artifactoryNotifications.create(response);\n this.deploySingleUploader.removeFileFromQueue(item);\n }", "error (listener) { this.errorListener = listener }", "function onErrorItem(response) {\n vm.fileSelected = false;\n $scope.mixins.havingProgressBar.reset();\n // Show error message\n Notification.error({\n message: response.message,\n title: '<i class=\"glyphicon glyphicon-remove\"></i> Failed to upload file'\n });\n }", "onError(task, err) {\n this.progress.updateAndStop();\n this.ftp.socket.setTimeout(this.ftp.timeout);\n this.ftp.dataSocket = undefined;\n task.reject(err);\n }", "function errorHandler(error) {\n var message = \"\";\n\n switch (error.code) {\n case FileError.SECURITY_ERR:\n message = \"Security Error\";\n break;\n case FileError.NOT_FOUND_ERR:\n message = \"Not Found Error\";\n break;\n case FileError.QUOTA_EXCEEDED_ERR:\n message = \"Quota Exceeded Error\";\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n message = \"Invalid Modification Error\";\n break;\n case FileError.INVALID_STATE_ERR:\n message = \"Invalid State Error\";\n break;\n default:\n message = \"Unknown Error\";\n break;\n }\n\n console.log(message);\n}", "function windowOnError(msg, file, line, col, error) {\n // resolve the stack trace\n StackTrace.fromError(error, { offline: config.offline })\n // then try to send it up to the server\n .then(function (stackFrames) {\n return reactotron.error(msg, stackFrames);\n })\n // can't resolve, well, let the user know, but still upload something sane\n .catch(function (resolvingError) {\n return reactotron.error({\n message: CANNOT_RESOLVE_ERROR,\n original: { msg: msg, file: file, line: line, col: col, error: error },\n resolvingError: resolvingError\n });\n });\n\n // call back the previous window.onerror if we have one\n if (swizzledOnError) {\n swizzledOnError(msg, file, line, col, error);\n }\n }", "function onError(error) { handleError.call(this, 'error', error);}", "error(error) {}", "function loading_error(error, filename, lineno) {\n console.log(\"Dosyaları yüklerken hata meydana geldi: \" + error);\n}", "function onFailed(error) {\n console.log(`Download failed: ${error}`);\n}", "function fsCallback(err) {\n\t\tif (err) {\n\t\t\tModule.printErr('FS sync error:', err);\n\t\t}\n\t\tif (fsStatus == FS_PENDING) {\n\t\t\tfsSyncInner();\n\t\t} else {\n\t\t\tfsStatus = FS_IDLE;\n\t\t\tModule.setStatus(\"\");\n\t\t}\n\t}", "_onError(error) {\n values(this._watcherMap).forEach(watcherInfo =>\n watcherInfo.watchmanWatcher.handleErrorEvent(error)\n );\n }", "_renameCheck () {\n fs.stat(this.filePath, (err, stats) => {\n if (err) {\n // Don't emit an error event here because it is reasonable for the\n // file to not exist anymore if it has been renamed.\n debug(\"Error from fs.stat. %j\", err)\n return this._renamed()\n }\n\n if (stats && stats.ino !== this._tailInode) {\n return this._renamed()\n }\n })\n }", "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "function errorHandler(evt) {\n switch (evt.target.error.code) {\n case evt.target.error.NOT_FOUND_ERR:\n alert('File Not Found!');\n break;\n case evt.target.error.NOT_READABLE_ERR:\n alert('File is not readable');\n break;\n case evt.target.error.ABORT_ERR:\n break;\n default:\n alert('An error occurred reading this file.');\n }\n evt.target.abort();\n}", "function onError(e) { console.log(e); }", "function onErrorItem(response) {\n vm.fileSelected = false;\n vm.progress = 0;\n\n // Show error message\n Notification.error({ message: response.message, title: '<i class=\"glyphicon glyphicon-remove\"></i> Failed to change profile picture' });\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onUploadFailed(e) {\n alert(\"Error uploading file\");\n }", "function error(err) {\n if (err !== 'cancelled') { //We don't care about cancelled.\n //TODO: It may be useful in some cases to display the error. Which cases?\n console.error(err);\n }\n }", "function done ( error ) {\n if (error) {\n that.error = error\n }\n if ( cb ) cb( error )\n }", "function handleError(err) {\n if (err) {\n console.log('\\nError Creating File');\n console.log(err.stack);\n process.exit(1);\n }\n}", "function error(err) {\n myAlert({\n type: 'danger',\n title: 'Upload failed',\n content: err || ''\n });\n }", "static isFileDoesNotExistError(error) {\n return FileSystem.isErrnoException(error) && error.code === 'ENOENT';\n }", "function handleError( error){\n console.log( \"!!!!! \" + error + \" !!!!!\");\n if(error.code && error.code.indexOf(\"ER_DUP_ENTRY\") >= 0) {\n console.log(\"redirecting to user exists page\");\n socket.emit('redirect', userExistsErrorPage);\n } else {\n socket.emit('redirect', errorPage);\n }\n\n //Save message to error.log with client ip and error message\n var clientAddr = socket.request.connection.remoteAddress;\n var logMsg = clientAddr + \"\\n\" + error + \"\\n\\n\";\n fs.appendFile('error.log', logMsg, function( err){\n if( err) console.log( \"!!!!! Couldnt write Error to error.log: \" + err);\n });\n }", "function onUploadFailed(e) {\r\n\talert(\"Error uploading file\");\r\n}", "onUploadFail() {\n $(this.options.progressBar)\n .removeClass(\"progress-bar-animated progress-bar-striped\")\n .addClass(\"bg-danger\");\n\n new Noty({\n timeout: 5000,\n text: $(this.options.fileInput).attr(\"data-upload-fail-message\"),\n type: \"error\"\n }).show();\n\n this.enableAddFileButton();\n }", "error(error) {\n this.__processEvent('error', error);\n }", "function faildownload(error) {\r\n\t\t console.log(error.code);\r\n\t\t}", "function NodeFsHandler() {}", "function NodeFsHandler() {}", "function errorHandler(error) {\n var message = '';\n switch (error.code) {\n case FileError.SECURITY_ERR:\n message = 'Security Error';\n break;\n case FileError.NOT_FOUND_ERR:\n message = 'Not Found Error';\n break;\n case FileError.QUOTA_EXCEEDED_ERR:\n message = 'Quota Exceeded Error';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n message = 'Invalid Modification Error';\n break;\n case FileError.INVALID_STATE_ERR:\n message = 'Invalid State Error';\n break;\n default:\n message = 'Unknown Error UAY';\n break;\n }\n alert(message);\n}", "function handleError(err) {\n\t\t\t\t\t\t// Log\n\t\t\t\t\t\tme.log('warn', 'Feedr === fetching [' + feed.url + '] to [' + feed.path + '], failed', err.stack);\n\n\t\t\t\t\t\t// Exit\n\t\t\t\t\t\tif (feed.cache) {\n\t\t\t\t\t\t\tviaCache(next);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tviaRequestComplete(err, opts.data, requestOptions.headers);\n\t\t\t\t\t}", "onRequestError(err) {\n log('request error', err)\n this.emit('error', err)\n if (err.status === 401) this.onUnauthorized()\n else this.reopen()\n }", "error() {}", "function onMediaError() {\n onRequestError(this);\n onRequestComplete(this);\n }", "function _errorHandler(request, errorText) {\n console.error((errorText || 'asyncStorage error') + ': ',\n request.error.name);\n }", "onerror(err) {\n this.emitReserved(\"error\", err);\n }", "handleImageError_() {\n this.state = TileState.ERROR;\n this.unlistenImage_();\n this.image_ = getBlankImage();\n this.changed();\n }", "handleImageError_() {\n this.state = TileState.ERROR;\n this.unlistenImage_();\n this.image_ = getBlankImage();\n this.changed();\n }", "function _requestErrorHandler(error, response, file) {\n if (error) {\n return error;\n } else if (response.statusCode >= 300) {\n return true;\n }\n return false;\n}", "function onErrorItem(fileItem, response, status, headers) {\n console.log(response);\n\n // Clear upload buttons\n cancelUpload();\n\n // Show error message\n vm.error = response.message;\n }", "onError(fn) {\n\n this.eventEmitter.on(settings.socket.error, (data) => {\n\n fn(data)\n });\n }", "function error(error) {\n host.active--;\n if (++load.attempt < maxAttempts) {\n host.queued.push(load);\n } else {\n callback(null);\n }\n process(host);\n }" ]
[ "0.72554994", "0.7226927", "0.66934705", "0.6610243", "0.65259564", "0.6524504", "0.6513491", "0.6513491", "0.6494794", "0.6473751", "0.63636255", "0.6363519", "0.63607943", "0.63425595", "0.6320642", "0.6320642", "0.6320642", "0.6320471", "0.62975293", "0.6293553", "0.6258914", "0.6235397", "0.6222745", "0.6217266", "0.6210113", "0.6185677", "0.61502814", "0.6134899", "0.61276454", "0.61166406", "0.61166406", "0.6114653", "0.61028075", "0.60924566", "0.6087065", "0.6087065", "0.6060512", "0.6026207", "0.60004485", "0.59981716", "0.5968327", "0.59531635", "0.59374803", "0.5933722", "0.5916515", "0.5883883", "0.5860307", "0.58431673", "0.58390963", "0.58370024", "0.5836854", "0.5829964", "0.5823554", "0.58223045", "0.5811147", "0.58036023", "0.57985824", "0.5796936", "0.5787654", "0.5782251", "0.57786435", "0.57742506", "0.57681996", "0.57668185", "0.5764651", "0.5756261", "0.5751579", "0.5750957", "0.57444525", "0.5730777", "0.57211155", "0.571914", "0.5717763", "0.5717763", "0.5717763", "0.5716132", "0.57068133", "0.5705244", "0.5698006", "0.5695941", "0.56927794", "0.5691576", "0.5688814", "0.5683816", "0.5680123", "0.56798524", "0.5678799", "0.5678799", "0.5677684", "0.56714815", "0.5660387", "0.56592876", "0.56575745", "0.5646853", "0.563926", "0.563159", "0.563159", "0.5628201", "0.56159276", "0.5608664", "0.5602091" ]
0.0
-1
file copy error callback
function onFileSystemFail(error) { console.log('moveFileToPersistentStorage file system fail code ' + error.code); var msg = 'An error occurred during file copy: ' + error.code; navigator.notification.alert(msg, null, 'File copy error in moveFileToPersistentStorage()'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCopyError(err, fileId, file){\n console.error(`ufs: cannot copy file \"${ fileId }\" (${ err.message })`);\n }", "function postProcess(fullPath, err, callback) {\r\n\t\tif (err) {\r\n\t\t\tconsole.log(fullPath + \" :: \" + err);\r\n\t\t\tstats.notCopied++;\r\n\t\t} else {\r\n\t\t\tstats.copied++;\r\n\t\t}\r\n\t\tcallback(err);\r\n\t\treturn;\r\n\t}", "function copyDone (error)\n {\n if (!done) {\n done = true;\n copyCallback(error);\n }\n }", "function onTransferError() {\n isFileTransferInProgress = false;\n msg(\"File transfer error\");\n eventHandler.dispatchEvent('error', new Error('File transfer failed'));\n}", "function fileShareError(event) {\n // cleanup\n receiveBuffer = [];\n incomingFileData = [];\n receivedSize = 0;\n // error\n if (sendInProgress) {\n console.error(\"fileShareError\", event);\n alert(\"error: File Sharing \" + event.error);\n sendInProgress = false;\n }\n}", "function failFileBackup(error) {\n\tvar backupfailed = $.t('backupfailed');\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Backup - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(backupfailed, 'short');\n}", "onWriteError(err, fileId, file) {\n console.error(`ufs: cannot write file \"${ fileId }\" (${ err.message })`);\n }", "function copyFile(item, cb) {\n item.val.copy(item.parent, item.val.name, function(err) {\n if(err) return cb(err);\n\n // run processStack again\n return processStack();\n });\n }", "function copyNextFile(err) {\n if (err) {\n cb(err);\n }\n else if (i < files.length) {\n copyItem(path.join(p, files[i]), copyNextFile);\n i++;\n }\n else {\n cb();\n }\n }", "function _validateFiles() {\r\n fs.stat(src, function(err, stat) {\r\n\r\n if (err) {\r\n callback(err);\r\n return;\r\n }\r\n\r\n if (stat.isDirectory()) {\r\n callback('Source ' + src + ' is a directory. It must be a file');\r\n return;\r\n }\r\n\r\n if (src === dst) {\r\n callback('Source ' + src + ' and destination ' + dst + ' are identical');\r\n return;\r\n }\r\n\r\n if (stat.isFile()) {\r\n _openInputFile();\r\n } else {\r\n callback('Copying of sockets, pipes, and devices is not supported: ' + src);\r\n }\r\n });\r\n }", "function _validateSource() {\r\n path.exists(src, function(src_exists) {\r\n if (!src_exists) {\r\n callback('Source ' + src + ' does not exist. Nothing to be copied');\r\n return;\r\n }\r\n\r\n _validateDest();\r\n });\r\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function readFailureCallback(e) {\n if (this._readyState === FileReader.DONE) {\n return;\n }\n\n this._readyState = FileReader.DONE;\n this._result = null;\n this._error = new FileError(e);\n\n if (typeof this.onerror === \"function\") {\n this.onerror(new ProgressEvent(\"error\", {target:this}));\n }\n\n if (typeof this.onloadend === \"function\") {\n this.onloadend(new ProgressEvent(\"loadend\", {target:this}));\n }\n}", "function readFailureCallback(e) {\n if (this._readyState === FileReader.DONE) {\n return;\n }\n\n this._readyState = FileReader.DONE;\n this._result = null;\n this._error = new FileError(e);\n\n if (typeof this.onerror === \"function\") {\n this.onerror(new ProgressEvent(\"error\", {target:this}));\n }\n\n if (typeof this.onloadend === \"function\") {\n this.onloadend(new ProgressEvent(\"loadend\", {target:this}));\n }\n}", "function postCopyCallback(err, newDoc) {\n if (err) return; // Nothing else we can do if there's an error\n \n appendJson(newDoc);\n\n nextIndex++;\n\n // See if we've done copying all the source docs\n if(nextIndex === listLength) {\n appendFeedback(`Done copying ${listLength} of ${listLength} files`);\n setSpinnerDisplay(false);\n return;\n }\n else {\n // otherwise, call the iterator on the next item\n showProgress()\n copyDoc(docList[nextIndex], postCopyCallback);\n }\n }", "function onerror(er){debug(\"onerror\",er);unpipe();dest.removeListener(\"error\",onerror);if(EElistenerCount(dest,\"error\")===0)dest.emit(\"error\",er)}", "function fileUploadFailed() {\n console.log(\"Failed to upload file\");\n}", "function fileReadFail(data){\n console.log(data);\n}", "_onError(e) {\n console.log(`Filer filesystem error: ${e}`);\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)errorOrDestroy(dest,er);}// Make sure our error handler is attached before userland ones.", "checkedEmitError(error) {\n if (!isIgnorableFileError(error)) {\n this.emit('error', error);\n }\n }", "function failFileRestoreWall(error) {\n\tvar restorefavwallsfailed = $.t('restorefavwallsfailed');\n\twindow.wallRestoreFailed = true;\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Restore - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(restorefavwallsfailed, 'short');\n}", "withSuccess() {\n return Object.freeze(\n new FileCopyResult(this.from, this.to, {success: true})\n );\n }", "function handleFileUploadError(_data) {\r\n\tcheckError(_data.response().jqXHR, '_folderMessage');\r\n}", "function onFileSystemFail(err) {\n console.log('deleteFileFromPersistentStorage file system fail: ' + fileName);\n console.log('error code = ' + err.code);\n }", "function errorHandler(e) {\n var msg = '';\n\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg = 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg = 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg = 'INVALID_STATE_ERR';\n break;\n default:\n msg = 'Unknown Error';\n break;\n };\n\n console.log('Error: ' + msg);\n document.getElementById('download').style.display = '';\n document.getElementById('status').innerHTML = '<b>Error</b> '+msg;\n}", "function errorHandler(e) {\n\tif(e.target.error.name == \"NotReadableError\") {\n\t\talert(\"Cannot read file !\");\n\t}\n}", "saveFile (filename, callback) {\n let tmp_filepath = this.filedir + '.' + filename\n let filepath = this.filedir + filename\n fs.copyFile(tmp_filepath, filepath, fs.constants.COPYFILE_FICLONE, (err) => {\n callback(err)\n })\n }", "function copyFile(oldFilePath, newFilePath, callback) {\r\n fs.readFile(oldFilePath, (error, fileContent) => {\r\n if (error) {\r\n console.log(error);\r\n callback(error);\r\n }\r\n\r\n fs.writeFile(newFilePath, fileContent, (error) => {\r\n if (error) {\r\n console.error(error);\r\n callback(error);\r\n return;\r\n }\r\n\r\n callback(null);\r\n })\r\n })\r\n}", "function copyFile(item,cb) {\n request(item.url+item.file, function (err, response, body) {\n if (err) return cb(item,err);\n\n fs.ensureDirSync(item.path);\n fs.writeFile(item.path+item.file,body);\n return cb(item);\n });\n}", "function uploadFile(err, url){\n\n instance.publishState('created_file', url);\n instance.triggerEvent('has_created_your_file')\n\n if (err){\n\n console.log('error '+ err);\n\n }\n\n }", "function copySelectedFile() {\n\t// Nur etwas tun, wenn ein File selektiert ist\n\tif (selectedType == 'file') {\n\t\t// Request absetzen\n\t\tnew Ajax.Request('ajax/copyFile.php?'+url+'&file='+selectedFile, {\n\t\t\tmethod: 'get',\n\t\t\tonSuccess: function (transport) {\n\t\t\t\t// Reload, wenn Directory gewechselt wurde\n\t\t\t\tif (transport.responseText == 'true') {\n\t\t\t\t\tEffect.Pulsate(icoCopy.id, { pulses: 3, duration: 1.0 });\n\t\t\t\t\ticoPaste.src = '/images/icons/paste_plain.png';\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "copyBaseFiles(name, filePath) {\n /*NO-OP*/\n }", "_onError(event) {\n const span = document.createElement(\"span\");\n span.innerHTML = \"\" + \"Upload failed. Retrying in 5 seconds.\";\n this.node.appendChild(span);\n this.retry = setTimeout(() => this.callbackUpload(), 5000, this.data);\n\n TheFragebogen.logger.error(this.constructor.name + \".callbackUpload()\", \"Upload failed with HTTP code: \" + this.request.status + \". Retrying in 5 seconds.\");\n }", "onCopy() {\n this.commands.exec(\"copy\", this);\n }", "function addDefferedFileAction(success, error) {\n actions.success.push(success);\n actions.error.push(error); \n}", "function errorHandler(evt) {\n switch (evt.target.error.code) {\n case evt.target.error.NOT_FOUND_ERR:\n alert('File Not Found!');\n break;\n case evt.target.error.NOT_READABLE_ERR:\n alert('File is not readable');\n break;\n case evt.target.error.ABORT_ERR:\n break;\n default:\n alert('An error occurred reading this file.');\n }\n evt.target.abort();\n}", "function onUploadFailed(e) {\n alert(\"Error uploading file\");\n }", "function onUploadError(event) {\r\n\t\t\tthis.progressReport.innerHTML = \"上传失败\";\r\n\t\t}", "function transferErrors(transferObject, eventCode, eventMsg, propertyName) {\n //alert(\"Sample Upload Transfer Error \" + eventCode + \", \" + eventMsg);\n}", "function xhrTransferError(xhrEvent) {\n // console.log(\"An error occured while transferring the data\");\n}", "onItemError(src) {\r\n this.runCallbacks(this.onItemErrorCallbacks, [src]);\r\n this.runCallbacks(this.onAfterItemCallbacks, [src]);\r\n this.errors.push(src);\r\n this.cleanUp();\r\n this.start();\r\n }", "function error (err) {\n if(error.err) return;\n callback(error.err = err);\n }", "onReadError(err, fileId, file) {\n console.error(`ufs: cannot read file \"${ fileId }\" (${ err.message })`);\n }", "function onUploadFailed(e) {\r\n\talert(\"Error uploading file\");\r\n}", "function onerror(er) {\n $Fj4k$var$debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if ($Fj4k$var$EElistenerCount(dest, 'error') === 0) $Fj4k$var$errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onWritten(writeErr) {\n var flags = fo.getFlags({\n overwrite: optResolver.resolve('overwrite', file),\n append: optResolver.resolve('append', file),\n });\n if (fo.isFatalOverwriteError(writeErr, flags)) {\n return callback(writeErr);\n }\n\n callback(null, file);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function loading_error(error, filename, lineno) {\n console.log(\"Error when loading files: \" + error);\n res.send(error);\n }", "function failFileRestoreRing(error) {\n\tvar restorefavringsfailed = $.t('restorefavringsfailed');\n\twindow.ringRestoreFailed = true;\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Restore - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(restorefavringsfailed, 'short');\n}", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "_finishCopy(srcFolder, isMove, result, srcMessages, destMessages) { try {\n this.enableNotifications(Ci.nsIMsgFolder.allMessageCountNotifications, true, false);\n\n if (CS(result)) {\n this.updateSummaryTotals(false);\n // xxx todo - why are we doing a folder loaded here?\n this._notifyFolderLoaded();\n let isTB68 = this.msgDatabase.deleteMessages.length == 3; // COMPAT for TB 68\n MailServices.mfn.notifyMsgsMoveCopyCompleted(isMove, isTB68 ? srcMessages : /* COMPAT for TB 78 */toArray(srcMessages, Ci.nsIMsgDBHdr), this.delegator, isTB68 ? destMessages : /* COMPAT for TB 78 */toArray(destMessages, Ci.nsIMsgDBHdr));\n if (isMove)\n srcFolder.NotifyFolderEvent(\"DeleteOrMoveMsgCompleted\");\n }\n else {\n log.info(\"Move/Copy failed\");\n let activityListener = this.nativeMailbox.activityListener;\n if (activityListener)\n activityListener.showFailed();\n if (isMove)\n srcFolder.NotifyFolderEvent(\"DeleteOrMoveMsgFailed\");\n }\n executeSoon(() => {\n if (MailServices.copy.NotifyCompletion) { // COMPAT for TB 78 (bug 1715433)\n MailServices.copy.NotifyCompletion(srcFolder, this.delegator, result); // COMPAT for TB 78 (bug 1715433)\n } else { // COMPAT for TB 78 (bug 1715433)\n MailServices.copy.notifyCompletion(srcFolder, this.delegator, result);\n } // COMPAT for TB 78 (bug 1715433)\n });\n } catch (e) { e.code = \"error-finish-copy\"; log.error(\"_finishCopy error\", e);}}", "onerror() {}", "onerror() {}", "function errorReadingFiles(error) {\n logger(error);\n bootstrap.errorCallback();\n}", "onCopyCompleted(src, aResult) {\n let srcSupports = src.QueryInterface(Ci.nsISupports);\n log.debug(\"ewsMsgFolderComponent onCopyCompleted\");\n if (aResult != Cr.NS_OK) {\n log.error(\"Copy failed for folder \" + this.prettyName);\n }\n\n // When the copy proceeds without async intermediary, then the base code crashes in nsMsgFilterService here:\n // for (PRUint32 msgIndex = 0; msgIndex < m_searchHits.Length(); msgIndex++)\n // (for base code that I added :(\n // prevent that by forcing async\n // copyService->NotifyCompletion(srcSupport, dstFolder, result);\n executeSoon( () => {\n //let dstFolder = this.QueryInterface(Ci.nsIMsgFolder);\n // the copy service does a direct compare of msgFolder, so we have\n // to pass the C++ delegator here\n if (MailServices.copy.NotifyCompletion) { // COMPAT for TB 78 (bug 1715433)\n MailServices.copy.NotifyCompletion(srcSupports, this.delegator, aResult); // COMPAT for TB 78 (bug 1715433)\n } else { // COMPAT for TB 78 (bug 1715433)\n MailServices.copy.notifyCompletion(srcSupports, this.delegator, aResult);\n } // COMPAT for TB 78 (bug 1715433)\n });\n }", "addOnProgressListener(callback) {\n this.on(FILE_TRANSFER_PROGRESS, callback);\n }", "function onerror(er) {\n $SYhk$var$debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if ($SYhk$var$EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n } // Make sure our error handler is attached before userland ones.", "async copyTo(destFolder, destName, deep, multistatus) {\n const targetFolder = destFolder;\n if (targetFolder == null || !await util_1.promisify(fs_1.exists)(targetFolder.fullPath)) {\n throw new DavException_1.DavException(\"Target directory doesn't exist\", undefined, DavStatus_1.DavStatus.CONFLICT);\n }\n const newFilePath = path_1.join(targetFolder.fullPath, destName);\n const targetPath = (targetFolder.path + EncodeUtil_1.EncodeUtil.encodeUrlPart(destName));\n // If an item with the same name exists - remove it.\n try {\n const item = await this.context.getHierarchyItem(targetPath);\n if (item != null) {\n await item.delete(multistatus);\n }\n }\n catch (ex) {\n // Report error with other item to client.\n multistatus.addInnerException(targetPath, undefined, ex);\n return;\n }\n // Copy the file togather with all extended attributes (custom props and locks).\n try {\n await util_1.promisify(fs_1.copyFile)(this.fullPath, newFilePath);\n this.context.socketService.notifyRefresh(targetFolder.path.replace(/\\\\/g, '/').replace(/\\/$/, \"\"));\n }\n catch (err) {\n /*if(err.errno && err.errno === EACCES) {\n const ex = new NeedPrivilegesException(\"Not enough privileges\");\n const parentPath: string = System.IO.Path.GetDirectoryName(Path);\n ex.AddRequiredPrivilege(parentPath, Privilege.Bind);\n\n throw ex;\n }*/\n throw err;\n }\n }", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones." ]
[ "0.8021209", "0.69921285", "0.6665508", "0.65991473", "0.648742", "0.6280451", "0.62238395", "0.62135863", "0.61942846", "0.6138471", "0.59483486", "0.59406954", "0.59406954", "0.59406954", "0.59281695", "0.59281695", "0.5923248", "0.5918593", "0.5889227", "0.58815074", "0.58799326", "0.5862595", "0.5804165", "0.57577604", "0.57526165", "0.5740202", "0.5724476", "0.5719502", "0.5706562", "0.5685842", "0.5680757", "0.5679109", "0.5667049", "0.564381", "0.56379676", "0.5636982", "0.5608719", "0.56056255", "0.5595184", "0.558745", "0.55770135", "0.5557442", "0.5546525", "0.5546418", "0.55456656", "0.55424935", "0.5534409", "0.55330753", "0.55297065", "0.5514342", "0.55092734", "0.55069065", "0.5500617", "0.549986", "0.549986", "0.549986", "0.5483643", "0.5482826", "0.5482826", "0.5480467", "0.5472992", "0.54606897", "0.545354", "0.5445834", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416" ]
0.6478855
5
show image as icon on button
function showImageOnButton(uri) { //me.getAddImageButtonRef().setHtml('<div class="addPhotoButtonHolder"><img src="' + uri + '" class="addPhotoButtonImage"/></div>'); me.getAddImageButtonRef().setHtml('<div class="addPhotoButtonHolder" style="background:url(' + uri + '); background-size:cover; background-repeat:no-repeat; background-position:center;">&nbsp;</div>'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function penguinIcon() {\n iconType = image[0];\n $('#status').html(\"Selected place icon is \"+'<img src=\"'+iconType+'\">');\n}", "function displayIcon(id, imgSrc){\n var elem = document.getElementById(id);\n if (elem) \n elem.src = imgSrc;\n }", "function createButton(icon) {\n const image = document.createElement('img')\n image.src = icon.src\n image.classList.add(CLASSES.ICON_IMG)\n if (icon.spinning) {\n image.classList.add(CLASSES.ICON_IMG_SPINNING)\n }\n const container = document.createElement('div')\n container.title = icon.title\n container.classList.add(CLASSES.ICON_CONTAINER)\n container.classList.add(CLASSES.ICON_CONTAINER_BUTTON)\n container.appendChild(image)\n return container\n}", "getIcon() {\n return \"document-cook\";\n }", "function showIcons() {\n\t$(this).find(\".upload_button\").show();\n\t$(this).find(\".close_button\").show();\n}", "function TB_image() {\n\tvar t = this.title || this.name ;\n\tTB_show(t,this.href,'image');\n\treturn false;\n}", "function addIcon(element){\n var image_path = \"/archibus/schema/ab-core/graphics/icons/tick-white.png\";\n var src = image_path;\n \n var img = document.createElement(\"img\");\n img.setAttribute(\"src\", src);\n img.setAttribute(\"border\", \"0\");\n \n img.setAttribute(\"align\", \"middle\");\n img.setAttribute(\"valign\", \"right\");\n \n element.appendChild(img);\n}", "function setUserLocationRequestButtonIcon(iconName) {\r\n $('#searchLocationButton').css('background-image', 'url(/static/img/ic_location_' + iconName + '.svg)');\r\n}", "function iconShow(el) {\r\n eyeIcon.style.display = \"inline-block\";\r\n}", "set type(type) {\n this.setIcon(type);\n }", "setIcon(icon){\r\n\t\tvar c = this.vc()\r\n\t\tthis.icon = icon\r\n\t\tc.innerHTML = this.inner_html()\r\n\t}", "function setIconImage(info, key) {\n var value, iconDiv, iconDivUrl, iconName;\n value = weatherMethods[info]();\n iconDiv = document.getElementById('iconDiv' + key);\n if (action.savedElements.iconName) {\n iconName = action.savedElements.iconName;\n } else {\n iconName = 'simply';\n }\n if (iconDiv) {\n iconDivUrl = 'http://junesiphone.com/weather/IconSets/' + iconName + '/' + value + '.png';\n if (iconDiv.src != iconDivUrl) {\n iconDiv.src = iconDivUrl;\n }\n }\n}", "get imageButton() {\n return {\n type: \"rich-text-editor-image\",\n };\n }", "function setIcon () {\n if ( oauth.hasToken() ) {\n chrome.browserAction.setIcon( { 'path': 'img/icon-19-on.png' } );\n } else {\n chrome.browserAction.setIcon( { 'path': 'img/icon-19-off.png' } );\n }\n}", "function attachIcon (){ \n var iconID= data.current.weather[0].icon;\n\n var iconURL= \"https://api.openweathermap.org/img/w/\" + iconID + \".png\"\n \n $('#weather-icon').attr('src', iconURL);\n $('#weather-icon').attr('alt', data.current.weather.description);\n}", "function showEditIcon() {\n $(this).append('<span class=\"glyphicon glyphicon-wrench edit\"' +\n 'aria-hidden=\"true\"></span>');\n $(this).children().last().click(editRes);\n}", "set cxIcon(type) {\n this.setIcon(type);\n }", "function setIconImage(info, key) {\n var value, iconDiv, iconDivUrl, iconName;\n value = weatherMethods[info]();\n iconDiv = document.getElementById('iconDiv' + key);\n if (action.savedElements.iconName) {\n iconName = action.savedElements.iconName;\n } else {\n iconName = 'simply';\n }\n if (iconDiv) {\n iconDivUrl = 'https://junesiphone.com/weather/IconSets/' + iconName + '/' + value + '.png';\n if (iconDiv.src != iconDivUrl) {\n var img = new Image();\n img.onload = function(){\n iconDiv.src = iconDivUrl;\n //set opacity to 1 after loaded\n iconDiv.style.opacity = 1;\n }; \n img.src = iconDivUrl;\n }\n }\n}", "setIcon(i) {\n this.icon = i;\n }", "function installImage(name, img) {\n RichTextView[name].iconUrl = '/images/' + img + '.svg';\n RichTextView[name].label = '';\n}", "get iconButton() {\n return {\n type: \"rich-text-editor-icon-picker\",\n };\n }", "setIcon (Icon) {\n _Icon = Icon\n }", "function MatIconLocation() {}", "GetTemplateActionImagesButton(){\n // Bouton Logout sous forme d'image\n const LogoutSvg = \"PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAwMCAxMDAwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMDAwIDEwMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8bWV0YWRhdGE+IFN2ZyBWZWN0b3IgSWNvbnMgOiBodHRwOi8vd3d3Lm9ubGluZXdlYmZvbnRzLmNvbS9pY29uIDwvbWV0YWRhdGE+CjxnPjxwYXRoIGQ9Ik03NTcuNSwxNTIuMWMzMC4xLDIyLDU2LjksNDYuOCw4MC4zLDc0LjZjMjMuNCwyNy44LDQzLjUsNTcuOCw2MC4yLDkwLjFjMTYuNywzMi4zLDI5LjQsNjYuNCwzOC4xLDEwMi40YzguNywzNiwxMy4xLDcyLjYsMTMuMSwxMDkuNmMwLDYzLjgtMTEuOSwxMjMuNy0zNS42LDE3OS42Yy0yMy43LDU1LjktNTUuOSwxMDQuNy05Ni40LDE0Ni4yYy00MC41LDQxLjUtODgsNzQuNS0xNDIuNSw5OC44QzYyMC4xLDk3Ny44LDU2MS43LDk5MCw0OTkuNSw5OTBjLTYxLjYsMC0xMTkuNi0xMi4yLTE3NC4xLTM2LjVjLTU0LjUtMjQuNC0xMDIuMi01Ny4zLTE0My05OC44Yy00MC44LTQxLjUtNzIuOS05MC4zLTk2LjQtMTQ2LjJjLTIzLjQtNTUuOS0zNS4xLTExNS44LTM1LjEtMTc5LjZjMC0zNi40LDQuMi03Mi4xLDEyLjYtMTA3LjFjOC40LTM1LDIwLjItNjguMywzNS42LTk5LjhjMTUuNC0zMS42LDM0LjUtNjEuMSw1Ny4yLTg4LjVjMjIuOC0yNy41LDQ4LjItNTIuMiw3Ni4zLTc0LjFjMTQuNy0xMSwzMC42LTE1LjEsNDcuNy0xMi40YzE3LjEsMi43LDMwLjksMTEuMyw0MS43LDI1LjdjMTAuNywxNC40LDE0LjcsMzAuNSwxMiw0OC40Yy0yLjcsMTcuOC0xMSwzMi4zLTI1LjEsNDMuMmMtNDIuMiwzMS42LTc0LjQsNzAuMy05Ni45LDExNi4zYy0yMi40LDQ2LTMzLjYsOTUuNC0zMy42LDE0OC4yYzAsNDUuMyw4LjQsODgsMjUuMSwxMjguMmMxNi43LDQwLjEsMzkuNiw3NS4xLDY4LjgsMTA1YzI5LjEsMjkuOSw2My4yLDUzLjUsMTAyLjQsNzFjMzkuMSwxNy41LDgwLjgsMjYuMywxMjUsMjYuM2M0NC4yLDAsODUuOC04LjgsMTI1LTI2LjNjMzkuMS0xNy41LDczLjMtNDEuMiwxMDIuNC03MWMyOS4xLTI5LjksNTIuMi02NC45LDY5LjMtMTA1YzE3LjEtNDAuMiwyNS42LTgyLjksMjUuNi0xMjguMmMwLTUzLjUtMTItMTA0LjEtMzYuMS0xNTEuOGMtMjQuMS00Ny43LTU3LjktODctMTAxLjQtMTE3LjljLTE0LjctMTAuMy0yMy42LTI0LjQtMjYuNi00Mi4yYy0zLTE3LjksMC41LTM0LjMsMTAuNS00OS40YzEwLTE0LjQsMjMuOC0yMy4yLDQxLjItMjYuMkM3MjYuNywxMzguMiw3NDIuNywxNDEuOCw3NTcuNSwxNTIuMUw3NTcuNSwxNTIuMXogTTQ5OS41LDUzMS45Yy0xNy40LDAtMzIuMy02LjMtNDQuNy0xOWMtMTIuNC0xMi43LTE4LjYtMjgtMTguNi00NS44Vjc1LjljMC0xNy44LDYuMi0zMy4zLDE4LjYtNDYuM2MxMi40LTEzLDI3LjMtMTkuNiw0NC43LTE5LjZjMTguMSwwLDMzLjMsNi41LDQ1LjcsMTkuNmMxMi40LDEzLDE4LjYsMjguNSwxOC42LDQ2LjN2MzkxLjJjMCwxNy44LTYuMiwzMy4xLTE4LjYsNDUuOEM1MzIuOCw1MjUuNiw1MTcuNiw1MzEuOSw0OTkuNSw1MzEuOUw0OTkuNSw1MzEuOXoiLz48L2c+Cjwvc3ZnPg==\"\n const UserConfigSvg = \"PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaWQ9IkxheWVyXzEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEyOCAxMjg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAxMjggMTI4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM0RjRGNEY7fQoJLnN0MXtmaWxsOiNGRkZGRkY7fQo8L3N0eWxlPjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjY0IiBjeT0iNjQiIHI9IjY0Ii8+PHBhdGggY2xhc3M9InN0MSIgZD0iTTc3LjQsNzUuM2MtMi0wLjMtMy40LTEuOS0zLjQtMy45di01LjhjMi4xLTIuMywzLjUtNS4zLDMuOC04LjdsMC4yLTMuMmMxLjEtMC42LDIuMi0yLDIuNy0zLjggIGMwLjctMi41LDAuMS00LjctMS41LTQuOWMtMC4yLDAtMC40LDAtMC43LDBsMC40LTUuOUM3OS42LDMwLjksNzMuMywyNCw2NS4zLDI0aC0yLjVjLTgsMC0xNC4zLDYuOS0xMy44LDE1LjFsMC40LDYgIEM0OS4yLDQ1LDQ5LDQ1LDQ4LjgsNDVjLTEuNiwwLjItMi4yLDIuNC0xLjUsNC45YzAuNSwxLjksMS43LDMuMywyLjgsMy45bDAuMiwzLjFjMC4yLDMuNCwxLjYsNi40LDMuNyw4Ljd2NS44YzAsMi0xLjQsMy42LTMuNCwzLjkgIEM0MS44LDc2LjgsMjcsODMuMiwyNyw5MHYxNGg3NFY5MEMxMDEsODMuMiw4Ni4yLDc2LjgsNzcuNCw3NS4zeiIvPjwvc3ZnPg==\"\n const GoToAppAdminSvg = \"PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMTIwMC4wMDAwMDBwdCIgaGVpZ2h0PSIxMjgwLjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMTIwMC4wMDAwMDAgMTI4MC4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KPG1ldGFkYXRhPgpDcmVhdGVkIGJ5IHBvdHJhY2UgMS4xNSwgd3JpdHRlbiBieSBQZXRlciBTZWxpbmdlciAyMDAxLTIwMTcKPC9tZXRhZGF0YT4KPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsMTI4MC4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiCmZpbGw9IiMwMDAwMDAiIHN0cm9rZT0ibm9uZSI+CjxwYXRoIGQ9Ik04NTAwIDEyNzkzIGMtMjAzIC0xOSAtMjUyIC0yNCAtMjY0IC0yOSAtMjEgLTggLTY3IC00MDEgLTg0IC03MTgKbC03IC0xMjkgLTExMCAtMjcgYy02MCAtMTUgLTE0NCAtNDEgLTE4NSAtNTggLTEwNSAtNDMgLTMzNyAtMTU0IC0zOTcgLTE5MQotMjggLTE3IC01MyAtMzEgLTU1IC0zMSAtMyAwIC0xNTEgMTIwIC0zMjkgMjY2IC0xNzggMTQ2IC0zMzAgMjY4IC0zMzYgMjcxCi0yNCAxMCAtMjI5IC0xNjQgLTM4MiAtMzIzIC0xNDcgLTE1MiAtMzE1IC0zNjIgLTMwMyAtMzc3IDQzIC01NyAyMDcgLTI1OQozNDcgLTQyNyA5NCAtMTEzIDE3NSAtMjExIDE3OSAtMjE4IDQgLTggLTkgLTM4IC0zNCAtNzggLTY3IC0xMDYgLTE0NSAtMjcxCi0xODAgLTM3OSAtMTggLTU1IC00MyAtMTMyIC01NiAtMTcyIC0xMyAtMzkgLTI0IC03OCAtMjQgLTg2IDAgLTExIC0xOSAtMTYKLTcyIC0yMSAtMzkwIC0zNiAtNzY1IC03OSAtNzc1IC05MCAtMzEgLTMwIC01MSAtNDMyIC0zNCAtNjQ5IDEyIC0xNTEgMzUKLTMxNSA0NiAtMzI1IDQgLTUgMjk5IC0zNCA3NTcgLTc3IGw3NyAtNyA2IC00MSBjNCAtMjMgMTUgLTYyIDI1IC04NyAxMCAtMjUKMzQgLTk3IDU0IC0xNjEgMzkgLTEyMSAxMjAgLTI5MyAxODcgLTM5MyAyMiAtMzMgMzggLTY1IDM1IC03MyAtMyAtNyAtODMKLTEwNiAtMTc5IC0yMjAgLTI2NCAtMzE2IC0zNDggLTQyMyAtMzQwIC00MzYgMzQgLTYwIDE5NSAtMjQ5IDMwOCAtMzYzIDE0OQotMTUwIDM4MiAtMzQ0IDM5MyAtMzI4IDQgNiA5OSA4NiAyMTIgMTc5IDExMyA5MyAyNTAgMjA3IDMwNSAyNTQgNTUgNDggMTA3CjkyIDExNyA5OSAxNCAxMSAzMyA0IDEzMCAtNTEgMTM0IC03NiAyOTkgLTE0NCA0NTkgLTE4NyA2MyAtMTcgMTIxIC0zNSAxMjcKLTM5IDggLTUgMjMgLTEwOSA0MiAtMzAyIDMwIC0yOTMgNTcgLTUyNCA2NCAtNTQ1IDggLTIxIDMxMCAtMzcgNTY5IC0zMSAyMDYKNSA0MDcgMjQgNDIzIDM5IDIgMyAyMCAxODAgMzkgMzk0IDIwIDIxNCAzOCA0MDQgNDEgNDIyIDYgMzggNCAzNyAxNzcgODggMTQ1CjQzIDMzOCAxMjggNDU1IDIwMSA0NyAzMCA5MCA1MiA5NiA0OSA2IC0yIDY3IC01MiAxMzYgLTExMSAyMzIgLTIwMCA1MjIgLTQyNgo1MzcgLTQyMSAyNyAxMSAxMzggOTYgMjAwIDE1MyAxMjkgMTIwIDQ4MyA1MjEgNDgzIDU0NyAwIDMgLTExNCAxNDEgLTI1MiAzMDcKLTEzOSAxNjUgLTI2MyAzMTMgLTI3NSAzMjggbC0yMiAyNyA1OSAxMTQgYzc5IDE1MSAxNTYgMzQ0IDE4OSA0NzEgbDI2IDEwNAoxODUgMTcgYzEwMiA5IDI5NCAyNyA0MjcgMzkgbDI0MiAyMyA2IDI2IGMxMyA2MyAyNiAyMTkgMzEgMzgwIDkgMjM3IC0xNyA1ODIKLTQ0IDU5OSAtNyA0IC0xOTcgMjQgLTQyNCA0NSAtMjI3IDIxIC00MTYgNDAgLTQyMCA0MiAtNCAyIC0xMiAzMCAtMTggNjIgLTI3CjEzNyAtMTE1IDM2NCAtMjA2IDUzMyBsLTY1IDEyMSAzOCA0NiBjMjEgMjYgMTM5IDE3MSAyNjQgMzIzIDEyNCAxNTIgMjI5IDI4MQoyMzMgMjg4IDggMTIgLTcxIDExMyAtMjAzIDI2MCAtMTQ2IDE2MiAtNDgxIDQ1MSAtNTA0IDQzNCAtODMgLTYzIC0zODIgLTMwNQotNDg3IC0zOTQgLTc1IC02MiAtMTQyIC0xMTkgLTE1MSAtMTI2IC0xMiAtMTAgLTU0IDcgLTIyOSA5NiAtMTUzIDc2IC0yNDcKMTE2IC0zMjUgMTM5IC02MCAxOCAtMTIwIDMyIC0xMzIgMzIgLTI1IDAgLTI1IC0zIC00OSAyNTUgLTE3IDE5MSAtNjQgNjA4Ci02OCA2MTIgLTggOCAtMTI2IDIzIC0yNTIgMzIgLTEzMCAxMCAtMzcyIDEyIC00NTQgNHogbTQ1NSAtMjA5NCBjMjE3IC0zNgo0MjcgLTE1MSA2MTAgLTMzMyAxNzkgLTE3OCAyODkgLTM3NCAzMzUgLTYwMSAxMDQgLTUwMSAtOTkgLTk5OCAtNTIwIC0xMjc2Ci0xOTIgLTEyNyAtMzc4IC0xODYgLTYxNiAtMTk2IC0yMjIgLTEwIC0zODggMjQgLTU3OSAxMTcgLTIzOSAxMTcgLTQxOSAyOTMKLTU0NiA1MzQgLTk2IDE4MyAtMTM0IDM0MyAtMTMzIDU3MSAxIDI4MSA3NyA1MDcgMjQ0IDcyMyAyMTIgMjc1IDUwMCA0NDYgNzk1CjQ3MSAxMTEgOSAzMjkgNCA0MTAgLTEweiIvPgo8cGF0aCBkPSJNODUwMCAxMDUyMSBjLTM2NSAtODAgLTY2MyAtMzU5IC03NzcgLTcyNyAtMjUgLTgzIC0yNyAtMTAxIC0yNwotMjc5IC0xIC0yMDcgNCAtMjM4IDY1IC0zOTYgNjUgLTE2OSAyMzUgLTM3OCAzOTggLTQ4OCA5MCAtNjEgMjE0IC0xMTcgMzE3Ci0xNDMgMTI4IC0zMiAzNzIgLTMyIDQ5MCAwIDE0MCAzOCAyNDEgODYgMzU0IDE3MCAzMjAgMjM4IDQ3MyA1ODMgNDMwIDk3MAotMjcgMjUwIC0xMjQgNDQ4IC0zMDEgNjE3IC0xMzQgMTI4IC0yNzQgMjEwIC00NDggMjYyIC0xMTkgMzUgLTM3MSA0MyAtNTAxCjE0eiBtMzgyIC0yNTYgYzIyOCAtNDggNDQwIC0yMDkgNTM3IC00MDcgMTcgLTM1IDQxIC0xMDEgNTIgLTE0NyAxOCAtNzMgMjEKLTEwNSAxNyAtMjM1IC00IC0xMzIgLTggLTE2MSAtMzQgLTIzNiAtNzYgLTIyNyAtMjk4IC00MjkgLTU0NiAtNDk2IC03NiAtMjEKLTI5MCAtMjQgLTM1OCAtNSAtMTQ3IDQwIC0yNjcgMTEwIC0zNzQgMjE3IC00NSA0NCAtOTYgMTA2IC0xMTUgMTM3IC0yMjIgMzczCi0xMDUgODYyIDI1OSAxMDc4IDc0IDQzIDE4NiA4NyAyNjAgOTkgNzUgMTMgMjMxIDEwIDMwMiAtNXoiLz4KPHBhdGggZD0iTTQ3MTYgODQ0OCBjLTc1IC0xOTEgLTE2MiAtNDI4IC0yNTEgLTY4MCBsLTk4IC0yNzggLTEyMiAwIGMtMjMxIDAKLTU4MyAtNDcgLTc4OCAtMTA2IC03MCAtMjAgLTEyOSAtMzUgLTEzMSAtMzMgLTEgMiAtMzYgNTEgLTc3IDEwOSAtMTQwIDIwMAotNTcwIDc5MCAtNTc1IDc5MCAtMTAgMCAtMTgxIC02OCAtMjE5IC04OCAtMjIgLTExIC03NCAtMzYgLTExNSAtNTYgLTQxIC0xOQotMTIwIC02MSAtMTc1IC05NCAtNTUgLTMyIC0xNDggLTg3IC0yMDcgLTEyMiAtMTA1IC02MiAtMjUwIC0xNjYgLTM0MiAtMjQ1CmwtNDYgLTQxIDEyMCAtMjU5IGM2NyAtMTQzIDE3MSAtMzY3IDIzMiAtNDk4IGwxMTEgLTIzOCAtNzYgLTc3IGMtMTk2IC0yMDAKLTQzMyAtNTExIC01MTMgLTY3NSAtMTYgLTMyIC0zMiAtNTcgLTM3IC01NyAtNCAwIC0xNDYgMjQgLTMxNSA1NCAtMzI5IDU4Ci03NzMgMTI5IC03NzcgMTI0IC04IC04IC0xMDMgLTI0OCAtMTQwIC0zNTMgLTUxIC0xNDYgLTEzNSAtNTU4IC0xNzAgLTg0MApsLTYgLTUwIDUwOCAtMTk1IDUwOCAtMTk1IDIgLTk1IGM0IC0xNzEgMjMgLTM4MSA0NCAtNDg5IDExIC01OCAyNyAtMTQxIDM1Ci0xODMgOCAtNDMgMjYgLTExNiAzOSAtMTYzIDE0IC00NyAyNSAtOTIgMjUgLTEwMCAwIC03IC05MyAtODAgLTIwNyAtMTYxCi0xMTUgLTgxIC0zMTMgLTIyNCAtNDQxIC0zMTggLTIwOCAtMTUyIC0yMzIgLTE3MyAtMjI3IC0xOTMgMjIgLTg4IDIxNiAtNDY0CjM0NiAtNjcyIDc0IC0xMTYgMjIzIC0zMzAgMjY0IC0zNzggbDMwIC0zNCAxNzUgODEgYzE3MiA4MSA3MzYgMzM5IDc5NiAzNjUKbDMwIDE0IDEzNSAtMTI1IGMxNjkgLTE1OCAyNTMgLTIyMSA0ODIgLTM2MSAxMzggLTg0IDE4MiAtMTE2IDE4MCAtMTMwIC0xCi0xMCAtMjIgLTE0MiAtNDcgLTI5MyAtNDQgLTI2NiAtMTE2IC03NDggLTExNiAtNzczIDAgLTcgMTUgLTE4IDMzIC0yNiAyMjUKLTkwIDQyNiAtMTUyIDcxNSAtMjIwIDE5MyAtNDYgNDczIC05NCA0ODMgLTgzIDE4IDIwIDI2MSA2NTkgMzU1IDkyOSBsMzggMTEzCjE1MiAwIGMyNjIgMCA0NDcgMjYgNzEyIDEwMiAxMjIgMzQgMTQ2IDM4IDE1NyAyNyA3IC04IDE1MyAtMjEyIDMyNSAtNDU0IDE3MgotMjQyIDMxNCAtNDQyIDMxNiAtNDQzIDMgLTQgOTEgMzcgMzYxIDE3MCAxMTIgNTUgMjQzIDEzMCAzNDUgMTk3IDE0NSA5NiAzMzEKMjMzIDM4MSAyODEgMTggMTYgMTUgMjUgLTgxIDI0MSAtNTUgMTIzIC0xNTkgMzUwIC0yMzAgNTA0IGwtMTMwIDI3OSAxMTcgMTI2CmMxNjAgMTcwIDMwNSAzNjggNDA1IDU1MiAyNSA0OCA1MCA4OSA1NCA5MSA0IDIgOTUgLTExIDIwMiAtMjkgNTU5IC05NCA4ODMKLTE0NSA4OTQgLTE0MSAyMiA5IDE3OCA0NTMgMjIxIDYyNyA4IDM2IDIwIDc1IDI1IDg3IDkgMjEgNzMgMzgyIDg0IDQ3NSBsNgo0NyAtNDggMjEgYy02MiAyOCAtNDgwIDE4NiAtNzY0IDI5MCBsLTIyOCA4MyAwIDE1NiBjMCAxNzkgLTEwIDI4MSAtNDEgNDQ4Ci0xOCA5OSAtNjcgMzE0IC04NSAzNzUgLTQgMTIgNDQgNTEgMTg4IDE1NCAyMTcgMTU1IDY5NSA1MTEgNzAzIDUyNSA3IDExIC02MQoxNzEgLTE0MyAzMzQgLTExNiAyMzMgLTI2NiA0NjggLTQyNCA2NjcgbC03NyA5NyAtMTMzIC01OCBjLTE4NCAtODEgLTQ4MAotMjE3IC02ODcgLTMxNyBsLTE3MyAtODQgLTEzNCAxMjcgYy0xNDIgMTM0IC0zMTQgMjY4IC00MjkgMzM2IC02MCAzNSAtMTgzCjExNiAtMjA4IDEzNyAtNCA0IDExIDEyMyAzMyAyNjYgMTEyIDcxNCAxMzEgODM2IDEyOCA4MzkgLTIgMSAtNzMgMjkgLTE1OCA2MgotMTgwIDcwIC0zOTkgMTQzIC00MzEgMTQzIC0xMiAwIC00NyA5IC03OCAxOSAtODAgMjggLTQ4OCAxMTAgLTU0NiAxMTEgLTE2IDAKLTI2IC0xNiAtNDkgLTcyeiBtLTE4MSAtMjYyMyBjMjc2IC00OSA1NjQgLTE4NCA3NzIgLTM2MyAyNDYgLTIxMiA0NjAgLTU5OQo1MTggLTkzNiAyMiAtMTI3IDIwIC0zNDcgLTQgLTQ4OCAtNDQgLTI1NSAtMTU0IC01MjUgLTI4NSAtNjk4IC0yMzEgLTMwNwotNjMxIC01NDggLTEwMjAgLTYxNSAtMTE0IC0xOSAtMzM0IC0xOSAtNDU0IDAgLTIyOCAzNyAtNDg2IDEzMCAtNjQ2IDIzMwotMzU2IDIzMCAtNjIwIDYyNSAtNzAyIDEwNTIgLTI0IDEyNyAtMjQgMzU4IDAgNDk1IDkwIDUwOSAzMjkgODYyIDc2MSAxMTI2CjExNCA3MCAyOTMgMTQyIDQzMCAxNzUgMTkzIDQ2IDQzOSA1MyA2MzAgMTl6Ii8+CjxwYXRoIGQ9Ik00MTc1IDU2MjMgYy0yMTUgLTI1IC0zMzcgLTYyIC01MTUgLTE1NCAtMzUwIC0xODEgLTU1OSAtNDQ0IC02NjUKLTgzOCAtNTAgLTE4NCAtNTggLTI0MSAtNTkgLTM5MSAwIC0xNDIgMTYgLTI1MiA1NSAtMzcxIDI0IC03NCAxMDkgLTI1OSAxMTkKLTI1OSAzIDAgMzQgLTQyIDY3IC05MiAxNDggLTIyMyAzNTUgLTM4OSA2MDkgLTQ4OCA1MDYgLTE5OCAxMDM3IC05NCAxNDM3CjI4MCAxODAgMTY4IDMyOCA0MzYgMzc4IDY4MiA2OSAzNDMgMTIgNjY0IC0xNzMgOTc0IC0xOTkgMzM1IC00NTkgNTI0IC04NTgKNjIzIC0xMzQgMzMgLTI5MiA0NyAtMzk1IDM0eiBtMzQ1IC0zNzQgYzMxMiAtNzggNTMyIC0yNjEgNjgxIC01NjUgNjggLTE0MQo4MyAtMjE0IDgzIC00MDkgMCAtMTk5IC0xNSAtMjcwIC05MCAtNDI0IC01NSAtMTE1IC0xMTIgLTE5NiAtMTk1IC0yNzkgLTI5MAotMjg1IC02MjcgLTM2OCAtMTAyNCAtMjUyIC0yNTggNzUgLTQ2MiAyNTMgLTU5NSA1MTkgLTEyNyAyNTQgLTEzOSA1NzMgLTMzCjgxNiAxMDUgMjM2IDI4OSA0MjQgNTI1IDUzNSAyMTcgMTAyIDQwOCAxMTkgNjQ4IDU5eiIvPgo8L2c+Cjwvc3ZnPgo=\"\n const GoToHomeSvg = \"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE4LjEuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMjcuMDIgMjcuMDIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI3LjAyIDI3LjAyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBzdHlsZT0iZmlsbDojMDMwMTA0OyIgZD0iTTMuNjc0LDI0Ljg3NmMwLDAtMC4wMjQsMC42MDQsMC41NjYsMC42MDRjMC43MzQsMCw2LjgxMS0wLjAwOCw2LjgxMS0wLjAwOGwwLjAxLTUuNTgxDQoJCWMwLDAtMC4wOTYtMC45MiwwLjc5Ny0wLjkyaDIuODI2YzEuMDU2LDAsMC45OTEsMC45MiwwLjk5MSwwLjkybC0wLjAxMiw1LjU2M2MwLDAsNS43NjIsMCw2LjY2NywwDQoJCWMwLjc0OSwwLDAuNzE1LTAuNzUyLDAuNzE1LTAuNzUyVjE0LjQxM2wtOS4zOTYtOC4zNThsLTkuOTc1LDguMzU4QzMuNjc0LDE0LjQxMywzLjY3NCwyNC44NzYsMy42NzQsMjQuODc2eiIvPg0KCTxwYXRoIHN0eWxlPSJmaWxsOiMwMzAxMDQ7IiBkPSJNMCwxMy42MzVjMCwwLDAuODQ3LDEuNTYxLDIuNjk0LDBsMTEuMDM4LTkuMzM4bDEwLjM0OSw5LjI4YzIuMTM4LDEuNTQyLDIuOTM5LDAsMi45MzksMA0KCQlMMTMuNzMyLDEuNTRMMCwxMy42MzV6Ii8+DQoJPHBvbHlnb24gc3R5bGU9ImZpbGw6IzAzMDEwNDsiIHBvaW50cz0iMjMuODMsNC4yNzUgMjEuMTY4LDQuMjc1IDIxLjE3OSw3LjUwMyAyMy44Myw5Ljc1MiAJIi8+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8L3N2Zz4NCg==\"\n const GoToAppSvg =\"PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCAxNzIgMTcyIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9Im5vbnplcm8iIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0iYnV0dCIgc3Ryb2tlLWxpbmVqb2luPSJtaXRlciIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBzdHJva2UtZGFzaGFycmF5PSIiIHN0cm9rZS1kYXNob2Zmc2V0PSIwIiBmb250LWZhbWlseT0ibm9uZSIgZm9udC13ZWlnaHQ9Im5vbmUiIGZvbnQtc2l6ZT0ibm9uZSIgdGV4dC1hbmNob3I9Im5vbmUiIHN0eWxlPSJtaXgtYmxlbmQtbW9kZTogbm9ybWFsIj48cGF0aCBkPSJNMCwxNzJ2LTE3MmgxNzJ2MTcyeiIgZmlsbD0ibm9uZSI+PC9wYXRoPjxnIGZpbGw9IiMwMDAwMDAiPjxwYXRoIGQ9Ik04NiwxNC4zMzMzM2MtMzkuNDk1NTIsMCAtNzEuNjY2NjcsMzIuMTcxMTUgLTcxLjY2NjY3LDcxLjY2NjY3YzAsMzkuNDk1NTIgMzIuMTcxMTUsNzEuNjY2NjcgNzEuNjY2NjcsNzEuNjY2NjdjMzkuNDk1NTIsMCA3MS42NjY2NywtMzIuMTcxMTUgNzEuNjY2NjcsLTcxLjY2NjY3YzAsLTM5LjQ5NTUyIC0zMi4xNzExNSwtNzEuNjY2NjcgLTcxLjY2NjY3LC03MS42NjY2N3pNODYsMjguNjY2NjdjMzEuNzQ5MjEsMCA1Ny4zMzMzMywyNS41ODQxMiA1Ny4zMzMzMyw1Ny4zMzMzM2MwLDMxLjc0OTIxIC0yNS41ODQxMiw1Ny4zMzMzMyAtNTcuMzMzMzMsNTcuMzMzMzNjLTMxLjc0OTIxLDAgLTU3LjMzMzMzLC0yNS41ODQxMiAtNTcuMzMzMzMsLTU3LjMzMzMzYzAsLTMxLjc0OTIxIDI1LjU4NDEyLC01Ny4zMzMzMyA1Ny4zMzMzMywtNTcuMzMzMzN6TTcxLjY2NjY3LDYxLjE2ODYydjQ5LjY2Mjc2bDQzLC0yNC44MzEzOHoiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==\"\n \n var Div = document.createElement(\"div\")\n Div.setAttribute(\"style\",\"display: flex; flex-direction: row; align-items: center; justify-content: space-around; align-content: center;\")\n var ButtonLogout = document.createElement(\"button\")\n ButtonLogout.setAttribute(\"title\", \"Logout\")\n ButtonLogout.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n ButtonLogout.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); GlobalLogout()})\n ButtonLogout.innerHTML = '<img src=\"data:image/svg+xml;base64,' + LogoutSvg + '\" height=\"100%\" width=\"100%\">'\n Div.appendChild(ButtonLogout)\n\n var ButtonUserConfig = document.createElement(\"button\")\n ButtonUserConfig.setAttribute(\"title\", \"User\")\n ButtonUserConfig.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n ButtonUserConfig.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); CoreXWindowUserConfig.BuildWindow()})\n ButtonUserConfig.innerHTML = '<img src=\"data:image/svg+xml;base64,' + UserConfigSvg + '\" height=\"100%\" width=\"100%\">'\n Div.appendChild(ButtonUserConfig)\n\n var ButtonHome = document.createElement(\"button\")\n ButtonHome.setAttribute(\"title\", \"Home\")\n ButtonHome.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n ButtonHome.addEventListener(\"click\", ()=>{CoreXWindow.DeleteWindow(); this._ClickOnHomeFct()})\n ButtonHome.innerHTML = '<img src=\"data:image/svg+xml;base64,' + GoToHomeSvg + '\" height=\"100%\" width=\"100%\">'\n Div.appendChild(ButtonHome)\n\n if(GlobalIsAdminUser()){\n var ButtonGoToApp = document.createElement(\"button\")\n ButtonGoToApp.setAttribute(\"class\", \"CoreXActionButtonImageButton\")\n let LocalStorageApp = localStorage.getItem(\"CoreXApp\")\n if(LocalStorageApp == \"App\"){\n ButtonGoToApp.setAttribute(\"title\", \"Go to Admin App\")\n ButtonGoToApp.addEventListener(\"click\", ()=>{this.GoToApp.bind(this, false)()})\n ButtonGoToApp.innerHTML = '<img src=\"data:image/svg+xml;base64,' + GoToAppAdminSvg + '\" height=\"100%\" width=\"100%\">'\n } else {\n ButtonGoToApp.setAttribute(\"title\", \"Go to App\")\n ButtonGoToApp.addEventListener(\"click\", ()=>{this.GoToApp.bind(this, true)()})\n ButtonGoToApp.innerHTML = '<img src=\"data:image/svg+xml;base64,' + GoToAppSvg + '\" height=\"100%\" width=\"100%\">'\n }\n Div.appendChild(ButtonGoToApp)\n }\n return Div\n }", "function backToIconHome(){\n $(this).text(\"\");\n $(this).append(\"<img src=\\'../icons/homeicon.png\\' alt=\\'circleicon\\'>\");\n}", "onImageClick() {\n console.log('Clicked Image')\n }", "function Icon(props){\n return <img src={props.name} width=\"auto\" height=\"20px\"/>; \n }", "function replaceMagnet() { \n var newMagImgUrl = chrome.extension.getURL(\"images/download-button.png\"),\n magIcon = \"/static/img/icon-magnet.gif\";\n $('#searchResult > tbody > tr > td > a > img[src=\"'+ magIcon +'\"]').attr('src', newMagImgUrl);\n }", "function updateIcon () {\n browser.browserAction.setIcon({\n path: currentBookmark\n ? {\n 19: '../public/star-filled-19.png',\n 38: '../public/star-filled-38.png'\n }\n : {\n 19: '../public/star-empty-19.png',\n 38: '../public/star-empty-38.png'\n },\n tabId: currentTab.id\n })\n browser.browserAction.setTitle({\n // Screen readers can see the title\n title: currentBookmark ? 'Unbookmark it!' : 'Bookmark it!',\n tabId: currentTab.id\n })\n}", "function Icon(id, resPath, src, width, height, tooltip, alt) {\n\tthis.id = id; // unique button id\n\tthis.width = width; // button width\n\tthis.height = height; // button height\n\tthis.src = src; // src-Attribute\n\tthis.onclick = Icon_onclick;\n\tthis.resPath = resPath;\n\tthis.tooltip = tooltip; // Tooltip\n\tthis.alt = alt;\n\tthis.border = 0;\n}", "get icon()\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}", "getIcon_() {\n return this.isCloudGamingDevice_ ? 'oobe-32:game-controller' :\n 'oobe-32:checkmark';\n }", "function showIcon() {\r\n $(\"#icon_picture\").css('opacity', '1');\r\n}", "function setImage(){\n\t\tbtn.backgroundImage = btn.value ? btn.imageOn : btn.imageOff;\n\t}", "function setIcon(privatep) {\n $('.privacyicon').remove();\n var img = $('<img>').attr({\n src: host + (privatep ? privateIcon : publicIcon),\n 'class': 'privacyicon'});\n\n if (!currentBag) {\n img.css('cursor', 'pointer')\n .click(function() {\n var target = privatep ? 'public' : 'private';\n if (confirm('Switch to '\n + (privatep ? 'public' : 'private') + '?')) {\n currentBag = space + '_' + target;\n setIcon(!privatep);\n }\n });\n }\n $('#type').prepend(img);\n}", "function show_as_image(e) {\n var me = $(e.target)\n , at = me.parents(sel_svgs)\n ;\n e.preventDefault(); // don't scroll to top\n me.parents('.actions').find('a').css('color', '');\n me.css('color', '#000');\n\n at.find(sel_num).hide(); // hide line numbers\n at.find(sel_raw).children('svg:first').show().siblings().hide(); // show svg\n}", "function toggleImage (value) {\n if (value === 'Sunny') {\n image.setAttribute('src', '../img/SVG/sun.svg')\n } else if (value === 'Cloudy' || value === 'Overcast' || value === 'Partly cloudy') {\n image.setAttribute('src', '../img/SVG/cloud-sun.svg')\n } else if (value === 'Rain' || value === 'Light Rain') {\n image.setAttribute('src', '../img/SVG/cloud-rain.svg')\n } else if (value === 'Snow') {\n image.setAttribute('src', '../img/SVG/cloud-snowflakes.svg')\n }\n /* Make hidden icon display */\n document.querySelector('.temp__card-icon').style.display = 'block'\n}", "function showIcon (color = 'red') {\n browser.pageAction.show(currentTab.id)\n updateIcon(true, color)\n}", "function getIcon(){\r\n switch (e['eventtype']) {\r\n case \"residential\": return \"img/house.png\";\r\n\r\n case \"commercial\": return \"img/commercial.png\";\r\n\r\n case \"charity\": return \"img/charity.png\"\r\n\r\n }\r\n }", "function openInfoImage(event){\n var t = torpedo.tooltip;\n $(t.find(\"#torpedoInfoImage\")[0]).qtip({\n overwrite: false,\n content: {\n text: \"<img id='torpedoPopupImage' src='\"+chrome.extension.getURL(chrome.i18n.getMessage(\"infoImage\"))+\"'> \",\n button: true\n },\n show: {\n event: event.type,\n ready: true\n },\n hide: {\n event: 'unfocus'\n },\n position: {\n at: 'center',\n my: 'center',\n target: jQuery(window)\n },\n style:{\n classes: \"torpedoPopup\"\n }\n });\n}", "function createIconButton (parentItem, iconNameURI, onClickFn, options) { //St.Side.RIGHT\n let defaults = {x_expand: true, y_expand: true, x_align: Clutter.ActorAlign.END, y_align: Clutter.ActorAlign.END};\n options = {...defaults, ...options };\n\n let icon = new St.Icon({icon_name: iconNameURI, style_class: 'system-status-icon' });\n let iconButton = new St.Button({\n style_class: 'menu-icon-btn', x_fill: true, can_focus: true,\n child: icon,\n\n });\n parentItem.actor.add_child(iconButton);\n parentItem.iconButtons = parentItem.iconButtons || new Array();\n parentItem.iconsButtonsPressIds = parentItem.iconButtons || new Array();\n parentItem.iconButtons.push(iconButton);\n parentItem.iconsButtonsPressIds.push( iconButton.connect('button-press-event', onClickFn) );\n}", "updateExpandIcon() {}", "show() {\n // applyTextTheme\n image(this.image, this.x, this.y, this.width, this.height)\n }", "function setIcon(icon) {\n this.icon = icon;\n }", "function buttonFilters() {\n image(imgFilters, 600, 550);\n}", "function buildIcon(imagePath, alt, params) {\r\n var image_html = '<img src=\"' + imagePath + '\" border=\"0\" alt=\"' + alt + '\" title=\"' + alt + '\" ' + params + ' />';\r\n return image_html;\r\n}", "showDeleteBtn() {\n if (this.state.allowDelete) {\n return (\n <Image source={require('../img/deleteText.png')}></Image>\n );\n } else {\n return null;\n }\n }", "set icon(aValue) {\n this._logger.debug(\"icon[set]\");\n this._icon = aValue;\n }", "function IconOptions() {}", "_createButtonIcon(type, parent, onClick) {\n var button = this._createElementUnder('button', parent);\n var span = this._createElementUnder('span', button);\n span.classList.add('material-icons-round');\n span.classList.add('md-24');\n span.innerText = type;\n button.addEventListener(\"click\", onClick);\n return button;\n }", "_onClick({x,y,object}) {\n console.log(\"Clicked icon:\",object);\n }", "function drawIcon(backgroundSrc, imagePaths, cb, clickAction) {\n var iconCtx = $(\"<canvas width='38' height='38'/>\")[0].getContext(\"2d\");\n var image = new Image();\n var backgroundDrawn = false;\n var clickActionAvailable = isCommandAvailable(clickAction);\n function loadNext() {\n var path = clickAction ? getCommandIconUrl(clickAction) : imagePaths.shift();\n if (path) image.src = getExtensionUrl(path + \".png\");\n else cb(iconCtx);\n }\n image.onload = function() {\n if (backgroundDrawn) {\n if (clickAction) {\n clickAction = null;\n iconCtx.globalAlpha = clickActionAvailable ? 1.0 : 0.5;\n iconCtx.drawImage(image, 0, 0, 38, 38);\n iconCtx.globalAlpha = 1.0;\n } else iconCtx.drawImage(image, 0, 0);\n } else {\n iconCtx.globalAlpha = clickActionAvailable || settings.showProgress && song.info ? 0.5 : 1.0;\n iconCtx.drawImage(image, 0, 0);\n iconCtx.globalAlpha = 1.0;\n backgroundDrawn = true;\n }\n loadNext();\n };\n image.src = getExtensionUrl(backgroundSrc);\n }", "function magicIconHover() {\n\tvar x = document.getElementById('magicIcon');\n\tx.setAttribute(\"src\", \"media/w95-phone-inv.png\");\n}", "function IconLabelButton() {\n this._init.apply(this, arguments);\n}", "function icon(str, click) {\n return '<span class=\"glyphicon glyphicon-'+str+'\"'\n + (typeof click != \"undefined\" ? ' onclick=\"'+click+'\" style=\"cursor:pointer\"':'')\n +'></span>';\n}", "function setConnectIcon(evt, isConnectTo) {\n\tvar target = evt.target;\n\tvar tooltips = $(target).parent().parent().find('.buttons.connect');\n\tfor (var i = 0; i < tooltips.length; i++) {\n\t\tif (isConnectTo == true) {\n\t\t\ttooltips[i].setAttributeNS(null, \"href\",\n\t\t\t\t\t\"img/connect-to.png\");\n\t\t\ttooltips[i].setAttributeNS(null, \"xlink\",\n\t\t\t\t\t'href = \"img/connect-to.png\"');\n\t\t} else {\n\t\t\ttooltips[i].setAttributeNS(null, \"href\",\n\t\t\t\t\t\"img/connect-from.png\");\n\t\t\ttooltips[i].setAttributeNS(null, \"xlink\",\n\t\t\t\t\t'href = \"img/connect-from.png\"');\n\t\t}\n\t}\n}", "function CheckImage(btn,sValue) {\n // Check if Image:\n \n if (sValue.substring(0, 4)=='img:') {\n //console.log(btn.id+' is image')\n let ButtonImage = document.createElement('img');\n ButtonImage.src = '/static/EcoLabels/'+sValue.substring(4);\n ButtonImage.className = 'button-img'\n btn.appendChild(ButtonImage);\n return \n } else {\n //console.log(btn.id+' is other')\n btn.innerHTML = sValue;\n }\n \n}", "actionIcons() {\n const componentName = this.breakdownPathComponents()[1];\n return {\n header: \"\",\n key: \"id\",\n render: (id) => <span className=\"icons\" style={{display: this.state.isAdmin ? \"inherit\" : \"none\"}}>\n <Link to={\"/\" + componentName + \"/\" + id}><img className=\"smallicon\" src=\"/assets/images/edit.png\"/></Link>\n <Link to={\"/\" + componentName + \"/\" + id + \"/delete\"}><img className=\"smallicon\" src=\"/assets/images/delete.png\"/></Link>\n </span>\n }\n }", "alertImage() {\n\t\tAlert.alert(\n\t\t\t'MobiShop',\n\t\t\t'from where you want the image',\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttext: 'cancel',\n\n\t\t\t\t\tstyle: 'cancel'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: 'gallery',\n\t\t\t\t\tonPress: () => this.onChooseImageUploud2()\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: 'camera',\n\t\t\t\t\tonPress: () => this.onChooseImageUploud()\n\t\t\t\t}\n\t\t\t],\n\t\t\t{ cancelable: false }\n\t\t);\n\t}", "function showToolbarIcon(tabId, iconName) {\n // Change toolbar icon to new icon\n var smallIconPath, bigIconPath\n\n if(isEdge()){\n\n smallIconPath = 'app/images/' + iconName + '-20.png'\n bigIconPath = 'app/images/' + iconName + '-40.png'\n chrome.browserAction.setIcon({\n tabId: tabId,\n path: {\n '20': smallIconPath,\n '40': bigIconPath\n }\n })\n\n }else{\n smallIconPath = 'app/images/' + iconName + '-19.png'\n bigIconPath = 'app/images/' + iconName + '-38.png'\n chrome.browserAction.setIcon({\n tabId: tabId,\n path: {\n '19': smallIconPath,\n '38': bigIconPath\n }\n })\n\n }\n\n }", "function showImage(){\n let imageTag = document.createElement('img');\n imageTag.src = \"./assets_from_client/assets/WSJ_Horizontal.png\";\n let regform = document.querySelector(\".register-form\");\n regform.prepend(imageTag);\n}", "function editorKeyPressed(){\n document.getElementById(\"save_icon\").src = \"lib/glyphicons/png/glyphicons-447-floppy-save.png\";\n document.getElementById(\"save_button\").className =\"btn btn-primary\";\n}", "open(image) {\n super.open();\n this._image.src = image.src;\n this._description.textContent = image.alt;\n }", "get flagIcon() {\n return FLAGS + \"/\" + this.popoverRegion.code + \".png\";\n }", "function updateMarker(m){\n m.setIcon('images/selectedlogo.png');\n }", "function updateIcon() {\n browser.browserAction.setIcon({\n path: currentBookmark ? {\n 19: \"icons/star-filled-19.png\",\n 38: \"icons/star-filled-38.png\"\n } : {\n 19: \"icons/star-empty-19.png\",\n 38: \"icons/star-empty-38.png\"\n } \n });\n browser.browserAction.setTitle({\n // Screen readers can see the title\n title: currentBookmark ? 'Acceptable' : 'Not Acceptable'\n }); \n}", "show() {\n // circle(this.x, this.y, this.circ);\n // args: image(image var, top edge, left edge, width, height);\n image(charImg, this.x, this.y, this.circ, this.circ);\n }", "function updateIcons() {\n if (vm.buttons) {\n for (var i = 0 , length = vm.buttons.length; i < length ; i++) {\n constructIconObject(vm.buttons[i]);\n }\n }\n }", "function displayIconAddress() {\n\n var icon = blockies.create({\n seed: gUserAddress.toLowerCase(),\n\n });\n $('.identicon').attr('src', icon.toDataURL());\n}", "get icon() {\n this._logger.debug(\"icon[get]\");\n return this._icon;\n }", "function _iconDefault() {\n clearTimeout( _iconIsRecording );\n chrome.browserAction.setIcon( { path: 'assets/img/icons/icon_16.png', tabId: currentTabId } );\n }", "getImg (name) {\n var html= '<div class=\"mooTree_img\"';\n if (name != '') {\n var img= this.control.theme;\n var i= MooTreeIcon.indexOf(name);\n if (i == -1) {\n // custom (external) icon:\n var x= name.split('#');\n img= x[0];\n i= (x.length == 2 ? parseInt(x[1])-1 : 0);\n }\n html+= ` style=\"background-image:url(${this.control.path + img}); background-position:-${(i*18)}px 0px\"`; // MS\n }\n html+= \"></div>\";\n return html;\n }", "getIcon(object) {\n var cont = this.getMarkerIconController();\n return cont.getIcon(object);\n }", "showSubmitButton() {\n if (this.props.displaySubmitButton) {\n return <button onClick={this.postImage} className=\"btn btn-primary btn-labeled fa fa-upload pull-right dropzone-submit\">Upload Image</button>;\n }\n }", "function getIconImage(myListSave) {\n\t\tvar hasImages = myListSave.iconName;\n\t\tvar iconHtml;\n\t\tvar link = contextPath + '/readingRoom/view/' + myListSave.id;\n\t\t\n\t\tif(hasImages) {\n\t\t\ticonHtml = '<a href=\"'+ link +'\" title=\"Go to the object description.\"><img src=\"' + getIconUrl(myListSave) + '\" class=\"viewImagesLink\" data-object-id=\"' + myListSave.id + '\" data-access=\"' + myListSave.accessRestriction + '\"/></a>';\n\t\t} else {\n\t\t\tvar $placeholderImage = $(getPlaceholderImage(myListSave, link));\n\t\t\t$placeholderImage.addClass('viewDescription');\n\t\t\t$placeholderImage.attr('data-object-id', myListSave.id);\n\t\t\ticonHtml = $placeholderImage[0].outerHTML;\n\t\t}\n\t\t\n\t\treturn iconHtml;\n\t}", "static get icon() { throw new Error('unimplemented - must use a concrete class'); }", "showImage() {\n if (this.state.closeFolder) {\n return (\n <>\n <div className=\"col-md-1 text-height\"><img width=\"30px\" src={RightArrow} alt=\"right arrow image\"/></div>\n <div className=\"col-md-2\"><img src={FolderImage} alt=\"folder image\"/></div>\n </>\n )\n } else {\n return (\n <>\n <div className=\"col-md-1 text-height\"><img width=\"30px\" src={DownArrow} alt=\"down arrow image\"/></div>\n <div className=\"col-md-2\"><img src={FolderOpenImage} alt=\"folder open image\"/></div>\n </>\n )\n }\n }", "function _uploadIcon(id) {\n vm.item.id;\n $window.location.href = \"/user/home/upload/\" + vm.item.id + \"/edit\";\n }", "bIcon(properties) {\n properties.tag = \"i\";\n properties.class = this.removeLeadingWhitespace(\n `${this.processContent(properties.class)} fab fa-${properties.icon}`\n );\n\n return this.getElement(properties);\n }", "function showBrokenImageIcon() {\n\t\t\teditor.contentStyles.push(\n\t\t\t\t'img:-moz-broken {' +\n\t\t\t\t\t'-moz-force-broken-image-icon:1;' +\n\t\t\t\t\t'min-width:24px;' +\n\t\t\t\t\t'min-height:24px' +\n\t\t\t\t'}'\n\t\t\t);\n\t\t}", "function showBrokenImageIcon() {\n\t\t\teditor.contentStyles.push(\n\t\t\t\t'img:-moz-broken {' +\n\t\t\t\t\t'-moz-force-broken-image-icon:1;' +\n\t\t\t\t\t'min-width:24px;' +\n\t\t\t\t\t'min-height:24px' +\n\t\t\t\t'}'\n\t\t\t);\n\t\t}", "function showBrokenImageIcon() {\n\t\t\teditor.contentStyles.push(\n\t\t\t\t'img:-moz-broken {' +\n\t\t\t\t\t'-moz-force-broken-image-icon:1;' +\n\t\t\t\t\t'min-width:24px;' +\n\t\t\t\t\t'min-height:24px' +\n\t\t\t\t'}'\n\t\t\t);\n\t\t}", "function changeIcon()\n{\n var pic = document.getElementById(\"user-info-icon-img\");\n var file = document.getElementById(\"upload-icon\");\n var ext = file.value.substring(file.value.lastIndexOf(\".\") + 1).toLowerCase();\n // gif在IE浏览器暂时无法显示\n if (ext != 'png' && ext != 'jpg' && ext != 'jpeg' && ext != 'gif') {\n alert(\"文件必须为图片!\");\n return;\n }\n // IE浏览器\n if (document.all) {\n\n file.select();\n var reallocalpath = document.selection.createRange().text;\n var ie6 = /msie 6/i.test(navigator.userAgent);\n // IE6浏览器设置img的src为本地路径可以直接显示图片\n if (ie6)\n pic.src = reallocalpath;\n else {\n // 非IE6版本的IE由于安全问题直接设置img的src无法显示本地图片,但是可以通过滤镜来实现\n pic.style.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='image',src=\\\"\" + reallocalpath + \"\\\")\";\n // 设置img的src为base64编码的透明图片 取消显示浏览器默认图片\n pic.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n }\n } else {\n html5IconReader(file);\n }\n}", "newIcon() {\n return `${this.iconPrefix}${this.getEquivalentIconOf(this.icon)}`;\n }", "function renderEventIcon(val) {\n return '<img alt=\"Event\" height=\"18px\" width=\"18px\" src=\"' + val + '\">';\n }", "function addImg(props, show)\n\t{\n\t\tshow = (typeof show === \"undefined\") ? false : show;\n\t\t\n\t\t$('.buttons button').each(function(){\n\t\t\t$(this).removeClass('hide');\n\t\t\t$(this).prop('disabled', false);\n\t\t});\n\t\t\n\t\tvar labelText = props['data-filter-name'];\n\t\t\n\t\tvar div = $('<div />', {'class': 'img-thumbnail'});\n\t\tvar img = $('<img />', props);\n\t\tvar label = $('<p />', {'class': 'img-label'}).text(labelText.capitalize());\n\t\t\n\t\timg.appendTo(div);\n\t\tlabel.appendTo(div);\n\t\tdiv.appendTo('#img-list');\n\t\t\n\t\tif (show){\n\t\t\t$('#img-container').empty();\n\t\t\tdelete props['id'];\n\t\t\tdelete props['class'];\n\t\t\tprops['class'] = 'img-instapy';\n\t\t\t$('<img />', props).appendTo('#img-container');\n\t\t}\n\t\t$('#img-list').fadeIn();\n\t\t$('#img-container').fadeIn();\n\t}", "function addIcon(name, data) {\n storage[name] = icon.fullIcon(data);\n}", "function ThirdIcon() {\n this.setIcon(ThirdOne);\n}", "function addStartButton() {\n // are we already present? user could have hit back button on an old \n // loaded page\n if (document.getElementById('SVGZoom.startButton')) {\n return;\n }\n\n // insert ourselves beside the SVG thumbnail area\n var info = getSVGInfo();\n var thumbnail = info.fileNode;\n if (hasAnnotation()) {\n thumbnail = thumbnail.childNodes[0].childNodes[0];\n }\n // make the container element we will go into a bit larger to accommodate \n // the icon\n var infoWidth = Number(String(info.width).replace('px', ''));\n thumbnail.style.width = (infoWidth + 30) + 'px';\n var img = document.createElement('img');\n img.id = 'SVGZoom.startButton';\n img.src = imageBundle['searchtool'];\n img.setAttribute('width', '30px');\n img.setAttribute('height', '30px');\n img.style.position = 'absolute';\n img.style.cursor = 'pointer';\n img.onclick = initUI;\n // some SVG pages have a spurious <br/> element; add before that\n if (thumbnail.lastChild.nodeType == 1 \n && thumbnail.lastChild.nodeName.toLowerCase() == 'br') {\n thumbnail.insertBefore(img, thumbnail.lastChild);\n } else {\n thumbnail.appendChild(img);\n }\n}", "addScreenshotButton(callback) {\n this.addButton(CAMERA_ICON, callback);\n }", "function OnDrawGizmos() {\n\tGizmos.DrawIcon(transform.position, \"Player_Icon.tif\");\n}", "createIconClass(data) {\n const name = 'jp-Dialog-buttonIcon';\n const extra = data.iconClass;\n return extra ? `${name} ${extra}` : name;\n }", "function showIcon(i) {\n\tvar x = document.getElementById(\"icon\" + i);\n\tif (x.style.display != \"block\"){\n\t\tx.style.display = \"block\";\n\t\tvisible[i] = true;\n\t}\n}", "function update_icon()\n {\n const icon = bookmarks.is_unlocked() ? \"unlocked-bookmarks.svg\" :\n \"locked-bookmarks.svg\";\n const path = `/icons/main/${icon}`;\n browser.browserAction.setIcon({\n path:\n {\n \"16\": path,\n \"32\": path,\n \"48\": path,\n \"64\": path,\n \"96\": path,\n \"128\": path,\n \"256\": path\n }\n });\n }", "getIcon() {\n if (!this.state.toggler) {\n return <FontAwesomeIcon icon={solid} color=\"#D5E84C\" />;\n } else {\n return <FontAwesomeIcon icon={lineStar} />;\n }\n }", "notifyIconAction() {}", "function changeIcon(button) {\n\t$(button).toggleClass('glyphicon-plus glyphicon-minus');\t\n}", "function drawImage() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.image, insertTexts.image, url);\n}", "function displayImage( $id )\n{\n\t// Set current button visuals to unselected:\n\tif (currentLIItem)\n\t\tcurrentLIItem.className = \"unSelected\"\n\t\n\t// Highlight the new button as selected:\n\tcurrentLIItem = document.getElementById( $id );\n\tif(currentLIItem)\n\t\tcurrentLIItem.className = \"selected\";\n\t\n\t// Retrieve image path, and set it as div bg:\n\timage = imageDictionary[ $id ];\n\tdocument.getElementById('body').style.background = image[2] + \" url(\" + image[0] + \") no-repeat top center\";\n\t// Stretch the div to the correct height\n\tdocument.getElementById('image-div').style.height = image[1] +\"px\";\n}", "function toggleIcon() {\n $(this).toggleClass('open-accordion');\n $(this).find(\".toggle-accordion\").html($(this).text() == 'Ver más' ? 'Ver menos' : 'Ver m&aacute;s');\n }" ]
[ "0.703531", "0.6779759", "0.6743075", "0.6592491", "0.6543792", "0.65394133", "0.6497033", "0.64916337", "0.6489585", "0.6455797", "0.641277", "0.62939835", "0.62808466", "0.62791866", "0.62377536", "0.62253857", "0.6222732", "0.6217703", "0.62109554", "0.6205579", "0.61768186", "0.6171654", "0.6165716", "0.6153216", "0.6123313", "0.6108939", "0.6095328", "0.6076676", "0.6060237", "0.6058816", "0.6038776", "0.60331845", "0.6028709", "0.6026088", "0.60124373", "0.60072935", "0.5996661", "0.59907013", "0.59892744", "0.5966581", "0.5962927", "0.5951205", "0.59466505", "0.5940592", "0.591746", "0.59144086", "0.59126896", "0.59126824", "0.59117633", "0.59103733", "0.5907178", "0.59053516", "0.59002477", "0.5897911", "0.58915794", "0.58900225", "0.5872063", "0.58642673", "0.58641016", "0.5863905", "0.585914", "0.58581346", "0.5855761", "0.58513856", "0.584969", "0.5844386", "0.5830194", "0.5827979", "0.5826459", "0.58246017", "0.5822576", "0.5804598", "0.58021045", "0.58019024", "0.57998985", "0.57933813", "0.5792614", "0.57922906", "0.57619315", "0.5756364", "0.5756364", "0.5756364", "0.5741065", "0.5738256", "0.57375646", "0.5732646", "0.5727917", "0.5725011", "0.5723202", "0.5721526", "0.57175523", "0.57111937", "0.5708324", "0.57050025", "0.56991357", "0.56973124", "0.5692815", "0.5688695", "0.56882757", "0.56713057" ]
0.7310389
0
copy photo from gallery to tfs (for iOS)
function copyPhoto(fileEntry) { window.resolveLocalFileSystemURL( Sencha.app.getImagesFolder(), function(fspDestDir) { fileEntry.copyTo( fspDestDir, null, setImageURL, function (err) { console.log('fail'); console.log('error code: ' + err.code); } ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseFromGallery(){\n navigator.camera.getPicture(videoTakenFromGallerySuccess,videoTakenFromGalleryFailed,{ sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,\n mediaType:navigator.camera.MediaType.ALLMEDIA,allowEdit:true,\n });\n}", "phototaked(file) {}", "function Take_Photo (e) {\r\n\tTitanium.Media.showCamera({\r\n\t\tsuccess:function(e){\r\n\t\t\t\r\n\t\t\t$.Img_User.image=e.media;\r\n\t\t},\r\n\t\terror:function(e){\r\n\t\t\talert(\"Error al accesar al dispositivo\");\r\n\t\t},\r\n\t\tcancel:function(e){\r\n\t\t\talert(\"Captura cancelada\");\r\n\t\t},\r\n\t\tallowEditing:true,\r\n\t\tsaveToPhotoGallery:true,\r\n\t\tmediaTypes:[Titanium.Media.MEDIA_TYPE_PHOTO] \r\n\t});\r\n\r\n}", "function upload(){\n\t\t\t\tvar b64content = fs.readFileSync('image-store/photo.jpg', { encoding: 'base64' })\n\n\t\t\t\tT.post('media/upload', { media_data: b64content }, function (err, data, response) {\n\t\t\t\t // now we can assign alt text to the media, for use by screen readers and\n\t\t\t\t // other text-based presentations and interpreters\n\t\t\t\t var mediaIdStr = data.media_id_string\n\t\t\t\t // var altText = \"Small flowers in a planter on a sunny balcony, blossoming.\"\n\t\t\t\t var meta_params = { media_id: mediaIdStr }\n\n\t\t\t\t T.post('media/metadata/create', meta_params, function (err, data, response) {\n\t\t\t\t if (!err) {\n\t\t\t\t // now we can reference the media and post a tweet (media will attach to the tweet)\n\t\t\t\t var params = { status: txt.text, media_ids: [mediaIdStr] }\n\n\t\t\t\t T.post('statuses/update', params, function (err, data, response) {\n\t\t\t\t console.log(\"tweet with picture\");\n\t\t\t\t })\n\t\t\t\t }\n\t\t\t\t })\n\t\t\t\t});\n\n\t\t\t\t// clear directory\n\n\t\t\t\tvar path = 'image-store/*';\n\n\t\t\t\texec('rm -r ' + path, function (err, stdout, stderr) {\n\t\t\t\t // your callback goes here\n\t\t\t\t});\n\t\t\t}", "copyImageAsDataUri() {\n const { mimeType, text, encoding } = this.selectedRequest.responseContent.content;\n\n getString(text).then(string => {\n let data = formDataURI(mimeType, encoding, string);\n copyToClipboard(data);\n });\n }", "function copyImage() {\r\n fs.readFile(imagePath, function (err, data) {\r\n if (err) throw err;\r\n fs.writeFile(\"/DATA/GRN_Images/\" + imageName, data, function (err) {\r\n if (err) throw err;\r\n console.log('Image copied to correct directory');\r\n });\r\n });\r\n}", "photoUploadComplete() {\n this.thisStoryFetch({searchLocation: constants.searchLocation.STORY});\n }", "function choosePhotoGallery(arg) {\n\ttry {\n\t\tTitanium.Media.openPhotoGallery({\n\t\t\tsuccess : photoFattchSuccess, // end of success block\n\t\t\tcancel : function() {\n\t\t\t\tTi.API.info(' Cancelled ');\n\t\t\t},\n\t\t\terror : function(error) {\n\t\t\t\tTi.API.info(' An error occurred!! ');\n\t\t\t},\n\t\t\tallowEditing : true,\n\t\t\tmediaTypes : arrMediaTypes,\n\n\t\t});\n\t} catch(ex) {\n\t}\n\n}", "function getPhotoFromGallery() {\n disableButtons(true);\n \n // Retrieve image file location from specified source\n navigator.camera.getPicture(onPhotoSuccess, onFail, { \n quality: 100, \n correctOrientation: true,\n destinationType: destinationType.FILE_URI,\n sourceType: pictureSource.PHOTOLIBRARY }\n );\n}", "onPhotoAdd() {\n navigator.camera.getPicture( photo => {\n let promise;\n const device = Device.getDevice();\n switch ( device.getPhotoEncodingMethod() ) {\n case PhotoEncodingMethods.ImgSrc:\n promise = imgSrcToBlob( photo );\n break;\n case PhotoEncodingMethods.Base64String:\n promise = base64StringToBlob( photo );\n break;\n case PhotoEncodingMethods.None:\n default:\n promise = null;\n }\n if ( promise ) {\n promise.then( coverBlob => {\n const coverUrl = createObjectURL( coverBlob );\n this.setState( { coverBlob, coverUrl } );\n } );\n }\n }, err => {\n console.error( err );\n }, {\n sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,\n destinationType: navigator.camera.DestinationType.FILE_URI,\n encodingType: navigator.camera.EncodingType.PNG\n } );\n }", "function createNewFileEntry(imgUri) {\n window.resolveLocalFileSystemURL(cordova.file.cacheDirectory, function success(dirEntry) {\n\n // JPEG file\n dirEntry.getFile(\"tempFile.jpeg\", { create: true, exclusive: false }, function (fileEntry) {\n\n // Do something with it, like write to it, upload it, etc.\n // writeFile(fileEntry, imgUri);\n console.log(\"got file: \" + fileEntry.fullPath);\n // displayFileData(fileEntry.fullPath, \"File copied to\");\n\n }, onErrorCreateFile);\n\n }, onErrorResolveUrl);\n}", "function onPhotoURISuccess(imageURI) {\n\n //alert('ok 1: ' + imageURI);\n\n try {\n //FileIO.updateCameraImages(imageURI);\n //alert('ok 2: ' + imageURI);\n upload_file (imageURI); \n \n }\n catch (e) {\n navigator.notification.alert('Error code: ' + e, null, 'Capture Loading Error');\n } \n\n}", "upload(event){\n let image = document.getElementById('output');\n url.push(URL.createObjectURL(event.target.files[0]));\n image.src = URL.createObjectURL(event.target.files[0])\n }", "function processImage(path, name) {\n\tvar new_location = 'public/uploads/';\n\n\tfs.copy(path, new_location + name, function(err) {\n\t\tif (err) {\n\t\t\tconsole.error(err);\n\t\t} else {\n\t\t\tconsole.log(\"success!\")\n\t\t}\n\t});\n}", "function uploadPhoto(accessToken, photo) {\n let data = new FormData();\n let config;\n\n data.append('access_token', accessToken);\n data.append('source', photo);\n data.append('privacy', JSON.stringify({ 'value': 'SELF' }));\n config = {\n method: 'POST',\n body: data\n }\n // Upload the photo to user's Facebook by using multipart/form-data post.\n return fetch(`${externalApiConfig.facebook.apiRoot}/me/photos?access_token=${accessToken}`, config);\n}", "function takePhoto() {\n imageCapture.takePhoto().then(function(blob) {\n console.log('Took photo:', blob);\n img.classList.remove('hidden');\n img.src = URL.createObjectURL(blob);\n }).catch(function(error) {\n console.log('takePhoto() error: ', error);\n });\n}", "function uploadPhoto(photoURI, photoType, databaseID){\n // !! Assumes variable fileURL contains a valid URL to a text file on the device,\n // for example, cdvfile://localhost/persistent/path/to/file.txt\n\n var leafSuccess = function (r) {\n //navigator.notification.alert(\"leaf photo uploaded\");\n console.log(\"Code = \" + r.responseCode);\n console.log(\"Response = \" + r.response);\n console.log(\"Sent = \" + r.bytesSent);\n cosole.log(\"survey.timeStart = \" + survey.timeStart);\n // deleteSurvey(survey.timeStart);\n };\n\n var fail = function (error) {\n navigator.notification.alert(\"An error has occurred: Code = \" + error.code);\n alert(\"upload error source: \" + error.source);\n alert(\"upload error target: \" + error.target);\n console.log(\"upload error source \" + error.source);\n console.log(\"upload error target \" + error.target);\n };\n\n var arthropodSuccess = function(r){\n //navigator.notification.alert(\"order photo uploaded\");\n\n //Increment number of arthropods submitted\n //here when there is a photo to upload\n //to prevent duplicate success alerts\n console.log(\"Code = \" + r.responseCode);\n console.log(\"Response = \" + r.response);\n console.log(\"Sent = \" + r.bytesSent);\n\n //If this was the last order photo to submit, clear form, submission succeeded\n // if(numberOfArthropodsSubmitted == numberOfArthropodsToSubmit) {\n // navigator.notification.alert(\"Successfully submitted survey data!\");\n // clearFields();\n\n // }\n };\n\n var options = new FileUploadOptions();\n options.fileKey = \"file\";\n options.mimeType=\"image/jpeg\";\n options.chunkedMode = false;\n options.headers = {\n Connection: \"close\"\n };\n\n // var params = {};\n // params.fullpath = imageURI;\n // params.name = options.fileName;\n \n // options.params = params;\n\n var ft = new FileTransfer();\n //If uploading leaf photo\n if(photoType.localeCompare(\"leaf-photo\") === 0) {\n options.fileName = \"survey_\" + databaseID + \"_leaf_photo.jpg\";\n ft.upload(photoURI, encodeURI(DOMAIN + \"/api/uploads.php?surveyID=\" + databaseID), leafSuccess, fail, options);\n }\n //Uploading arthropod photo\n else if(photoType.localeCompare(\"arthropod-photo\") === 0){\n options.fileName = \"order_\" + databaseID + \"_arthropod_photo.jpg\";\n ft.upload(photoURI, encodeURI(DOMAIN + \"/api/uploads.php?orderID=\" + databaseID), arthropodSuccess, fail, options);\n }\n}", "function onCopySuccess(entry) {\n var name = entry.nativeURL.slice(0, -4);\n window.PKVideoThumbnail.createThumbnail (entry.nativeURL, name + '.png', function(prevSucc) {\n return prevImageSuccess(prevSucc);\n }, fail);\n }", "function onCopySuccess(entry) {\n var name = entry.nativeURL.slice(0, -4);\n window.PKVideoThumbnail.createThumbnail (entry.nativeURL, name + '.png', function(prevSucc) {\n return prevImageSuccess(prevSucc);\n }, fail);\n }", "function moverPhoto(file){\r\n //alert(file);\r\n window.resolveLocalFileSystemURI(file, resolveOnSuccess, resOnError);\r\n //window.resolveLocalFileSystemURI( file , resolveOnSuccess, resOnError);\r\n}", "copyFileToUsersCollection(sourceFileId) {\n const { shouldCopyFileToRecents, userMediaStore, tenantUploadParams, } = this;\n if (!shouldCopyFileToRecents || !userMediaStore) {\n return Promise.resolve();\n }\n const { collection: sourceCollection } = tenantUploadParams;\n const { authProvider: tenantAuthProvider } = this.tenantMediaClient.config;\n return tenantAuthProvider({ collectionName: sourceCollection }).then(auth => {\n const body = {\n sourceFile: {\n id: sourceFileId,\n collection: sourceCollection,\n owner: {\n ...mapAuthToSourceFileOwner(auth),\n },\n },\n };\n const params = {\n collection: RECENTS_COLLECTION,\n };\n return userMediaStore.copyFileWithToken(body, params);\n });\n }", "function getPhoto(source) {\n // Retrieve image file location from specified source\n store('photoSource', 'album')\n navigator.camera.getPicture(uploadPhoto, onFail, {\n quality: 20,\n destinationType: DESTINATION_TYPE.FILE_URI,\n sourceType: source\n });\n}", "async function testGetStepImages_savesFiles() {\n let api = await getGoogleApiClient();\n let filePath = await api.saveStepImage('5fb5bee7.Photo1.132604.jpg', '05d8fd63').catch(error => console.log('GOOGLE API RESPONSE ERROR: ' + error));\n await deletePhotoFile(filePath);\n}", "copyProfilePicture() {\n fs.createReadStream(path.join(this._dataExportDirectory, PROFILE_PICTURE_FILE))\n .pipe(fs.createWriteStream(path.join(__dirname, '..', COPIED_PROFILE_PICTURE_FILE)));\n }", "function downloadPhoto(photoURL) {\r\n\tvar fileTransfer = new FileTransfer();\r\n\tvar uri = encodeURI(photoURL);\r\n\t// filesystem access for images\r\n\twindow.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function onRequestFileSystemSuccess(fileSystem) { \r\n\t\talert('requestFileSystem success');\r\n\t}, null);\r\n}", "async takePicture() {\n var photoLoc = `${FileSystem.documentDirectory}photos/Photo_${\n this.state.photoId\n }_Base64`;\n if (this.camera) {\n let photo = await this.camera.takePictureAsync({ base64: true });\n FileSystem.moveAsync({\n from: photo.uri,\n to: photoLoc\n }).then(() => {\n this.setState({\n photoId: this.state.photoId + 1\n });\n this.sendToImgur(photoLoc);\n });\n }\n }", "openVideoGallery(){\n let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2})\n let context = this;\n let { dispatch } = context.props.navigation;\n let arr = context.state.workImages;\n ImagePicker.openPicker({\n showCropGuidelines :false,\n maxFiles:context.state.maxNumberOfVideos,\n mediaType:\"video\"\n }).then(images => {\n let source = {uri: images.path, isStatic: true};\n ThumbnailGenerator.get(source.uri).then((result) => {\n let imageClone = context.state.workImages;\n result.isVideo = true;\n result.videoPath = images.path;\n result.id = Math.random();\n imageClone.push(result);\n context.setState({\n maxNumberOfVideos:0,\n dataSource:ds.cloneWithRows(imageClone)\n });\n })\n }).catch(e => {\n if(e.code===\"ERROR_PICKER_UNAUTHORIZED_KEY\"){\n dispatch(ToastActionsCreators.displayInfo(\"Cannot access images. Please allow access if you want to be able to select images.\"));\n return;\n }\n if(e.code===\"ERROR_PICKER_NO_CAMERA_PERMISSION\"){\n dispatch(ToastActionsCreators.displayInfo(\"Cannot access camera. Please allow access if you want to be able to click images.\"));\n return;\n }\n });\n }", "function ChoosePhoto(e) {\n console.log(\"gggg\");\n getPhoto(pictureSource.PHOTOLIBRARY);\n }", "static formImages() {\n let mainfsDirCount = PP64.fs.mainfs.getDirectoryCount();\n for (let d = 0; d < mainfsDirCount; d++) {\n let dirFileCount = PP64.fs.mainfs.getFileCount(d);\n for (let f = 0; f < dirFileCount; f++) {\n let fileBuffer = PP64.fs.mainfs.get(d, f);\n if (!PP64.utils.FORM.isForm(fileBuffer))\n continue;\n\n try {\n let formUnpacked = PP64.utils.FORM.unpack(fileBuffer);\n if (formUnpacked.BMP1.length) {\n formUnpacked.BMP1.forEach(bmpEntry => {\n let dataUri = PP64.utils.arrays.arrayBufferToDataURL(bmpEntry.parsed.src, bmpEntry.parsed.width, bmpEntry.parsed.height);\n console.log(`${d}/${f}:`);\n console.log(dataUri);\n });\n }\n }\n catch (e) {}\n }\n }\n }", "async uploadImage(currentBook) {\n const { imageFile } = this.state\n debugger\n const storageRef = storage.ref();\n const fileRef = storageRef.child(imageFile.name);\n await fileRef.put(imageFile);\n currentBook.image = await fileRef.getDownloadURL();\n // const fileUrl = await fileRef.getDownloadURL();\n // this.setState(currentBook);\n }", "openPhotoGallery(){\n let context = this;\n let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2})\n let { dispatch } = context.props.navigation;\n let arr = context.state.workImages;\n ImagePicker.openPicker({\n showCropGuidelines :false,\n multiple:true,\n maxFiles:context.state.maxNumberOfImages,\n mediaType:\"photo\"\n }).then(images => {\n\n if(images.length > context.state.maxNumberOfImages) {\n let numberOfImagesToDelete = images.length - context.state.maxNumberOfImages;\n images.splice(0, numberOfImagesToDelete);\n }\n \n for (let item of images) {\n item.id=Math.random();\n item.isVideo=false;\n arr.push(item);\n }\n \n context.setState({\n maxNumberOfImages: images.length > context.state.maxNumberOfImages ? 0 : (context.state.maxNumberOfImages-images.length),\n dataSource: ds.cloneWithRows(arr),\n workImages: arr\n });\n\n }).catch(e => {\n if(e.code===\"ERROR_PICKER_UNAUTHORIZED_KEY\"){\n dispatch(ToastActionsCreators.displayInfo(\"Cannot access images. Please allow access if you want to be able to select images.\"));\n return;\n }\n if(e.code===\"ERROR_PICKER_NO_CAMERA_PERMISSION\"){\n dispatch(ToastActionsCreators.displayInfo(\"Cannot access camera. Please allow access if you want to be able to click images.\"));\n return;\n }\n });\n }", "function onPhotoURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.jpg';\n }\n options.fileName = newfname;\n //alert(newfname);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n //options.headers = \"Content-Type: multipart/form-data; boundary=38516d25820c4a9aad05f1e42cb442f4\";\n options.chunkedMode = true;\n var ft = new FileTransfer();\n // alert(imageURI);\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=imageupload\"), win, fail, options);\n\n function win(r) {\n var resp = JSON.parse(r.response);\n window.location.reload();\n \n }\n\n function fail(error) {\n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "function getGalleryImageSource(image)\n{\n return image.Url() + image.FileName() + \"thumb\" + image.FileExtension() + \"?v=\" + image.ModifiedDateUTC();\n}", "function takephoto() {\n navigator.camera.getPicture(uploadPhoto, onFail, {\n quality: 40,\n correctOrientation: true,\n saveToPhotoAlbum: true,\n destinationType: Camera.DestinationType.FILE_URL\n });\n }", "function createImage(photo) {\n console.log(photo);\n // Create the card for the image and add it to gallery\n const imageContainer = document.createElement('div');\n imageContainer.classList.add('image-container');\n imageContainer.innerHTML = `<img src=\"${photo.src.medium}\"></img>`;\n const resolution = document.createElement('p');\n resolution.innerHTML = `Resolution: ${photo.height}x${photo.width}`;\n imageContainer.appendChild(resolution);\n const photographerParagraph = document.createElement('p');\n photographerParagraph.innerHTML = `Photographer: <span class=\"photographer\">${photo.photographer}</span>`;\n imageContainer.appendChild(photographerParagraph);\n const photographerUrl = document.createElement('p');\n photographerUrl.innerHTML = `url: <br><span class=\"photographer-url\"><a href=\"${photo.url}\">${photo.url}</a></span>`;\n imageContainer.appendChild(photographerUrl);\n // Opens a new window with the image in original size where user can download\n const downloadBtn = document.createElement('a');\n downloadBtn.href = photo.src.original;\n downloadBtn.setAttribute('target', '_blank');\n downloadBtn.innerHTML = `<button>Download</button>`;\n imageContainer.appendChild(downloadBtn);\n\n gallery.appendChild(imageContainer);\n}", "function createGallery() {\n log.debug('[Gallery] : createGallery() : number of images = ', todoItem.get('photoCount'));\n galleryExists = true;\n\n var photoCount = todoItem.get('photoCount');\n var columns = 0;\n\n // Bail if no photos, otherwise set the number of columns based on current photo count\n if (photoCount < 1) {\n Alloy.Globals.Menu.showInfoBar({title: \"No Photos To Display\"});\n log.debug(\"[Gallery] : createGallery : photoCount === 0\");\n return false;\n } else if (photoCount == 1) {\n columns = 1;\n } else if (photoCount == 2) {\n columns = 2;\n } else {\n columns = 3;\n }\n\n if (columns == 0) {\n return;\n }\n\n $.tdg.init({\n columns: columns,\n space: 10,\n delayTime: 500,\n //gridBackgroundColor: '#e1e1e1',\n //itemBackgroundColor: '#9fcd4c',\n itemBorderColor: '#eb5d36',\n itemBorderWidth: 3,\n itemBorderRadius: 5,\n onItemClick: openLargeImage\n });\n\n displayAllPhotos(photoCount);\n}", "function onPhotoURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.jpg';\n }\n options.fileName = newfname;\n //alert(newfname);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n //options.headers = \"Content-Type: multipart/form-data; boundary=38516d25820c4a9aad05f1e42cb442f4\";\n options.chunkedMode = false;\n var ft = new FileTransfer();\n // alert(imageURI);\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=imageupload\"), win, fail, options);\n\n function win(r) {\n var resp = JSON.parse(r.response);\n window.location.reload(); \n }\n\n function fail(error) {\n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "async savePicture(uri) {\n const img = await ImageManipulator.manipulate(uri, [], { compress: 0.2 });\n const assetImg = await MediaLibrary.createAssetAsync(img.uri);\n return assetImg.uri;\n }", "async function savePicture() {\n const asset = await MediaLibrary.createAssetAsync(capturedPhoto)\n .then(() => {\n alert('salvo com sucesso');\n })\n .catch((error) => console.log('err', error));\n }", "function add_photo_to_site(event, ui){\n var url = ui.draggable.attr('src');\n var img = $(event.target).find('.photo img');\n $.post(\"/sources\",{site_id: site_id, image: url},function(){\n \n })\n }", "function onPhotoDataSuccess(imageData) {\n curFile = imageData;\n setStuffForm();\n}", "async uploadImageAsync(uri, spot_id) {\n console.log(\"URI\", uri);\n const response = await fetch(uri);\n const blob = await response.blob();\n const ref = firebase\n .storage()\n .ref()\n .child(`lot_images/${current_spot.owner}/${current_spot.key}/lot.jpg`);\n await ref.put(blob).then(() => {\n console.log(\"in the async action\");\n self.props.navigation.navigate(\"MySpots\");\n });\n }", "function getPhoto(source) {\n // Retrieve image file location from specified source\n navigator.camera.getPicture(uploadPhoto, onFail, { quality: 50,\n destinationType: navigator.camera.DestinationType.FILE_URI,\n sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY\n });\n}", "function onGetPhotoDataSuccess(imageData) {\n var currentdate = new Date();\n var datetime = (currentdate.getFullYear()).toString() + (currentdate.getMonth() + 1).toString() + (currentdate.getFullYear()).toString()\n + (currentdate.getHours()).toString()\n + (currentdate.getMinutes()).toString()\n + (currentdate.getSeconds()).toString();\n \n\t try {\n\t\t moveFile(imageData, DeviceStorageDirectory+AppDocDirectory+\"/Private/Photos\")\n\t\t}\n\t\tcatch(err) {\n\t\t \n\t\t} \n\n}", "async function createAVMFromASharedGalleryImage() {\n const credential = new DefaultAzureCredential();\n const client = createComputeManagementClient(credential);\n const subscriptionId = \"\";\n const resourceGroupName = \"myResourceGroup\";\n const vmName = \"myVM\";\n const options = {\n body: {\n location: \"westus\",\n properties: {\n hardwareProfile: { vmSize: \"Standard_D1_v2\" },\n networkProfile: {\n networkInterfaces: [\n {\n id: \"/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}\",\n properties: { primary: true },\n },\n ],\n },\n osProfile: {\n adminPassword: \"{your-password}\",\n adminUsername: \"{your-username}\",\n computerName: \"myVM\",\n },\n storageProfile: {\n imageReference: {\n sharedGalleryImageId:\n \"/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName\",\n },\n osDisk: {\n name: \"myVMosdisk\",\n caching: \"ReadWrite\",\n createOption: \"FromImage\",\n managedDisk: { storageAccountType: \"Standard_LRS\" },\n },\n },\n },\n },\n queryParameters: { \"api-version\": \"2022-08-01\" },\n };\n const initialResponse = await client\n .path(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}\",\n subscriptionId,\n resourceGroupName,\n vmName\n )\n .put(options);\n const poller = getLongRunningPoller(client, initialResponse);\n const result = await poller.pollUntilDone();\n console.log(result);\n}", "function addUnitPhotoInEdit() {\n $scope.photomodel.UnitId = $scope.modelEdit.unitId;\n $scope.photomodel.Description = \"\";\n $scope.photomodel.PathName = \"\";\n \n var photo = unitphotoService.addUnitPhoto($scope.photomodel, $scope.file);\n photo.then(function (response) {\n $scope.photomodelEdit.PathName = \"/Album/FileUploads/\" + $scope.file.name;\n }, function (error) {\n });\n }", "function imageUpload(e) {\n var reader = new FileReader();\n reader.onload = async function (event) {\n var imgObj = await new Image();\n imgObj.src = await event.target.result;\n setImage([...getImage, imgObj.src]);\n };\n let p = e.target.files[0];\n\n reader.readAsDataURL(p);\n }", "function filePreview2(input) {\n if (input.files && input.files[0]) {\n\t\tvar reader = new FileReader();\t\t\n\t\treader.onload = function (e) {\n\t\t\t$('.newTripPhoto').attr('src', e.target.result);\n\t\t}\n\t\treader.readAsDataURL(input.files[0]);\n }\n}", "onPhotoBlogUpload() {\n try {\n const urlToAddPhotoBlog = `${API_URL}/api/blogs/${this.props.match.params.blogId}/photos`;\n if (this.state.showFileData) {\n const formData = new FormData();\n formData.append('file', this.state.selectedFile);\n axios\n .post(urlToAddPhotoBlog, formData, {\n withCredentials: true,\n headers: {\n 'content-type': 'multipart/form-data',\n },\n })\n .then((res) => {\n showToastSuccess(res.data.message);\n })\n .catch((err) => {\n showToastFailed(err.response.data.message);\n });\n }\n } catch (error) {\n showToastSuccess('Có Lỗi xảy ra');\n }\n }", "handleDrop(files) {\n const test = this.state.check_opened_module();\n // if(test){\n this.setState({ detectChange: true });\n const cookies = new Cookies();\n const token_val = cookies.get('risorsoLoggedIn');\n let id = this.props.ID,\n from = this.props.from;\n const data = new FormData();\n data.append('article_images', files[0]);\n this.fetchRequest(id, from, data, token_val);\n const imgName = files[0].name;\n // }\n }", "function onAvatarURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.jpg';\n }\n options.fileName = newfname;\n //alert(newfname);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n //options.headers = \"Content-Type: multipart/form-data; boundary=38516d25820c4a9aad05f1e42cb442f4\";\n options.chunkedMode = false;\n var ft = new FileTransfer();\n // alert(imageURI);\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=avatarupload\"), win, fail, options);\n\n function win(r) {\n var resp = JSON.parse(r.response);\n window.location.assign(\"edit-profile.html\"); \n }\n\n function fail(error) {\n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "function movePic2(file){ \n window.resolveLocalFileSystemURI(file, resolveOnSuccess2, resOnError2); \n}", "function doPhotoLightbox(lightbox, link) {\n\t\"use strict\";\n\tlightbox.setAttribute('data-upload-type', link.getAttribute('data-upload-type'));\n\tcompleteLightbox(lightbox, link);\n\tcallFunction('initUploadPhoto', 'photo-upload', lightbox);\n}", "function AdminPhotoUploadImage(id,file,photoid,large,useHttp)\n{\n return api(AdminPhotoUploadImageUrl,{id:id,file:file,photoid:photoid,large:large},useHttp).sync();\n}", "function reviewImage() {\n $('#upload-photo').change(function (event) {\n let reviewImage = URL.createObjectURL(event.target.files[0]);\n $('#upload-image').attr('src', reviewImage);\n })\n}", "function onPhotoSuccess(s, p) {\r\n console.log('onPhotoSuccess: '+s);\r\n var d, f, size;\r\n if(!p) p={};\r\n if(typeof(s)!='string' && s && 'target' in s) { // s is an event, try to find 'File' on target\r\n d = s.target.result;\r\n if('CameraFile' in s.target) {\r\n f = _Files[s.target.CameraFile];\r\n p.name = f.name;\r\n size = p.size = f.size;\r\n p.type = f.type;\r\n p.modified = bird.date(new Date(f.lastModifiedDate));\r\n _Files[s.target.CameraFile] = null; // do not remove to prevent messing with indexes\r\n\r\n }\r\n } else { // d = base64 data\r\n d = s;\r\n size = d.length;\r\n }\r\n var app = bird.a[_cameraApp];\r\n console.log('onPhotoSuccess: '+app.id, size, (app.id in bird.Apps), 'renderEntry' in bird.Apps[app.id]);\r\n var o = Sizzle('#'+app.id+' .camera-output')[0], cn='app-camera-img', uo, u;\r\n p.id='f'+(new Date().getTime());\r\n if(app.id in bird.Apps && 'renderEntry' in bird.Apps[app.id]) _renderEntry = bird.Apps[app.id].renderEntry;\r\n var fn = _renderEntry;\r\n var entry = fn.call(app, {id:p.id,media:[d]}), se;\r\n if(typeof(entry)=='string') {\r\n se = document.createElement('div');\r\n se.className = 'entry '+cn;\r\n bird.addHtml(se, entry);\r\n } else {\r\n se = entry;\r\n if(se.className.search(/\\bentry\\b/)<0){\r\n se.className+=' entry '+cn;\r\n }\r\n }\r\n var so = Sizzle('#'+app.id+' .camera-output > div:first');\r\n //console.log(se, so, o);\r\n if(so && so.length>0) {\r\n se = o.insertBefore(se, so[0]);\r\n so[0]=null;\r\n } else {\r\n se = o.appendChild(se);\r\n }\r\n if(app.upload) {\r\n // try cordova FileTransfer, or fallback to jQuery $.ajax with either FormData or targeting a iframe\r\n if(d.substr(0,5)!='data:' && _cameraNative) {\r\n uo = new FileUploadOptions();\r\n if('name' in p) uo.fileName = p.name;\r\n if('type' in p) uo.mimeType = p.type;\r\n if('key' in p) uo.fileKey = p.key;\r\n else uo.fileKey = 'media';\r\n uo.params = p;\r\n u = new FileTransfer();\r\n u.upload(d, encodeURI(app.upload), photoUploadSuccess, photoUploadError, uo, true);\r\n uo = null;\r\n se.className+= ' app-uploading';\r\n } else if(_cameraEnabled) { // ajax with FormData\r\n console.log('uploading with FormData!');\r\n uo = new FormData();\r\n if(!('name' in p)) p.name = 'image.jpg';\r\n for(var n in p) {\r\n uo.append(n, p[n]);\r\n }\r\n if(!('key' in p)) p.key = 'media';\r\n if(d.substr(0,5)=='data:') {\r\n uo.append(p.key, bird.b64Blob(d), p.name);\r\n }\r\n $.ajax({\r\n url: app.upload,\r\n type: 'POST',\r\n data: uo,\r\n processData: false,\r\n contentType: false,\r\n success: photoUploadSuccess,\r\n error: photoUploadError,\r\n progress: photoUploadProgress,\r\n context: se\r\n });\r\n uo = null;\r\n se.className+= ' app-uploading';\r\n }\r\n }\r\n if(window.getComputedStyle) {\r\n window.getComputedStyle(se).getPropertyValue('top');\r\n }\r\n se.className+=' entry-ready';\r\n se = null;\r\n app = null;\r\n img = null;\r\n o = null;\r\n\r\n bird.closeOverlay();\r\n /*\r\n // Get image handle\r\n var smallImage = document.getElementById('smallImage');\r\n\r\n // Unhide image elements\r\n smallImage.style.display = 'block';\r\n\r\n // Show the captured photo\r\n // The inline CSS rules are used to resize the image\r\n smallImage.src = \"data:image/jpeg;base64,\" + imageData;\r\n */\r\n}", "function copyImages (version) {\n\t\t\t\t\t\tvar images = ['blue.jpg', 'green.jpg', 'orange.jpg', 'red.jpg'];\n\n\t\t\t\t\t\tfse.copy(`${appRoot}/base-template/global-images`, `${dir}/${Static}/${versions[version]}/${img}`, (err) => {\n\t\t\t \tif (err) {\n return console.error(\"error:\", err);\n }\n\n console.info(chalk.green(\"static images folder copied successfully.\"));\n\t\t\t });\n\t\t\t\t\t}", "function onchangefillimage(selected) {\n\tvar fillimg = document.getElementById(\"fillimg\");\n\tvar image = selected.files;\n\tvar url = URL.createObjectURL(image[0]);\n\tfillimg.onload = function () {\n\t\tonchangeoptions();\n\t}\n\tfillimg.src = url; \n}", "onImageChange (e) {\n this.setState({ file: e.target.files[0] })\n // let url = URL.createObjectURL(e.target.files[0])\n // this.setState({ BlogImage: url })\n }", "function addPicture() {\n\n\tif (isPhotoGalleryOpen) {\n\t\treturn;\n\t}\n\n\tisPhotoGalleryOpen = true;\n\n\tTi.Media.openPhotoGallery({\n\t\tmediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],\n\t\tsuccess: function(e) {\n\t\t\tisPhotoGalleryOpen = false;\n\n\t\t\t// FIXME: https://jira.appcelerator.org/browse/TIMOB-19764\n\t\t\t// We need to wait for the photo gallery to close or our preview actions won't work\n\t\t\tsetTimeout(function() {\n\n\t\t\t\t// Create a unique filename\n\t\t\t\tvar filename = Ti.Platform.createUUID() + ((Alloy.Globals.logicalDensityFactor === 1) ? '' : '@' + Alloy.Globals.logicalDensityFactor + 'x') + '.jpg';\n\n\t\t\t\t// Create the file under the applicationDataDirectory\n\t\t\t\tvar file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, filename);\n\n\t\t\t\t// Write a square version of the selected media to the file\n\t\t\t\tfile.write(e.media.imageAsThumbnail(Alloy.Globals.detailSize));\n\n\t\t\t\t// Add the model to the collection\n\t\t\t\tAlloy.Collections.picture.create({\n\n\t\t\t\t\t// Set the time the picture was added\n\t\t\t\t\ttime: moment().format(),\n\n\t\t\t\t\t// Set the filename (the full path changes between builds)\n\t\t\t\t\tfilename: filename\n\t\t\t\t});\n\n\t\t\t}, 500);\n\t\t},\n\t\tcancel: function(e) {\n\t\t\tisPhotoGalleryOpen = false;\n\t\t},\n\t\terror: function(e) {\n\t\t\tisPhotoGalleryOpen = false;\n\n\t\t\talert(e.error || 'Unknown Error');\n\t\t}\n\t});\n}", "function getPhoto() {\n // Retrieve image file location from specified source\n navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,\n destinationType: destinationType.FILE_URI,\n sourceType: pictureSource.PHOTOLIBRARY });\n }", "function setUserDefaultImage(dest) {\n fs.copy('./public/profileImage.jpg', dest)\n .then(function() {\n console.log('success!');\n }).catch(function(err) {\n console.error(err);\n });\n}", "function getTaskFiles() {\n var tempNotes = vm.fieldNotes;\n var data = [];\n\n tempNotes.forEach(function(el) {\n data = data.concat(el.mediaFiles);\n });\n\n vm.files = data;\n }", "async uploadFile(file, createdId){ \n \n let fileName = file.name\n let ext = fileName.slice( fileName.lastIndexOf('.') ) \n \n // -- Add Original file in firebase storage -- //\n let storageRef = firebase.storage().ref()\n let imagesRef = storageRef.child('gallery/'+createdId+ext) \n\n let uploadState = await imagesRef.put(file).then( function(snapshot) { \n console.log('Uploaded !'); \n return true \n }).catch( (error) => {\n console.log(error)\n return false\n });\n \n return uploadState;\n\n // -- //\n \n }", "async function getPhoto(files){\n var rnd = Math.random().toString(36).substring(2, 9) + Math.random().toString(36).substring(2, 9);//salt\n return new Promise(function(resolve, reject){\n if (files) {\n files.map(file => {\n if(file.filename != \"\"){\n const saveTo = path.join(__dirname,\"/uploads/\" ,rnd + path.basename(file.filename))\n var face = \"http://157.245.127.122/\" + rnd + file.filename\n file.pipe(fs.createWriteStream(saveTo))\n resolve(face)\n }else{\n resolve(\"fuck\")\n }\n })}\n })\n}", "function uploadSitePhoto(sample,delay) {\n\n function submitSitePhoto( sampleId, photoPath ) {\n log(`Uploading site photo path = ${photoPath} [serverSampleId=${sampleId}]`);\n return Promise.resolve()\n .then(() => Alloy.Globals.CerdiApi.submitSitePhoto( sampleId, photoPath ));\n }\n\n var sitePhotoId = sample.get(\"serverSitePhotoId\");\n if ( !sitePhotoId ) {\n var sitePhoto = sample.getSitePhoto();\n var sampleId = sample.get(\"serverSampleId\");\n if ( sitePhoto ) {\n let blob = loadPhoto( sitePhoto );\n if ( needsOptimising(blob) ) {\n log(`Optimising ${sitePhoto}`);\n savePhoto( optimisePhoto(blob), sitePhoto );\n } \n return delayedPromise( submitSitePhoto( sampleId, sitePhoto ), delay)\n .then( (res) => {\n sample.set(\"serverSitePhotoId\", res.id);\n sample.save();\n Topics.fireTopicEvent( Topics.UPLOAD_PROGRESS, { id: sampleId} );\n return sample;\n })\n .catch( (err) => {\n log(`Error when attempting to upload site photo: ${err.message}`);\n return sample;\n })\n } \n } \n return sample;\n}", "function copyDocuments(pFromCapId, pToCapId) {\n\n //Copies all attachments (documents) from pFromCapId to pToCapId\n var vFromCapId = pFromCapId;\n var vToCapId = pToCapId;\n var categoryArray = new Array();\n\n // third optional parameter is comma delimited list of categories to copy.\n if (arguments.length > 2) {\n categoryList = arguments[2];\n categoryArray = categoryList.split(\",\");\n }\n\n var capDocResult = aa.document.getDocumentListByEntity(capId, \"CAP\");\n if (capDocResult.getSuccess()) {\n if (capDocResult.getOutput().size() > 0) {\n for (var docInx = 0; docInx < capDocResult.getOutput().size(); docInx++) {\n var documentObject = capDocResult.getOutput().get(docInx);\n currDocCat = \"\" + documentObject.getDocCategory();\n if (categoryArray.length == 0 || exists(currDocCat, categoryArray)) {\n // download the document content\n var useDefaultUserPassword = true;\n //If useDefaultUserPassword = true, there is no need to set user name & password, but if useDefaultUserPassword = false, we need define EDMS user name & password.\n var EMDSUsername = null;\n var EMDSPassword = null;\n var downloadResult = aa.document.downloadFile2Disk(documentObject, documentObject.getModuleName(), EMDSUsername, EMDSPassword, useDefaultUserPassword);\n if (downloadResult.getSuccess()) {\n var path = downloadResult.getOutput();\n //logDebug(\"path=\" + path);\n }\n var tmpEntId = vToCapId.getID1() + \"-\" + vToCapId.getID2() + \"-\" + vToCapId.getID3();\n documentObject.setDocumentNo(null);\n documentObject.setCapID(vToCapId)\n documentObject.setEntityID(tmpEntId);\n\n // Open and process file\n try {\n // put together the document content - use java.io.FileInputStream\n var newContentModel = aa.document.newDocumentContentModel().getOutput();\n inputstream = new java.io.FileInputStream(path);\n newContentModel.setDocInputStream(inputstream);\n documentObject.setDocumentContent(newContentModel);\n var newDocResult = aa.document.createDocument(documentObject);\n if (newDocResult.getSuccess()) {\n newDocResult.getOutput();\n logDebug(\"Successfully copied document: \" + documentObject.getFileName());\n } else {\n logDebug(\"Failed to copy document: \" + documentObject.getFileName());\n logDebug(newDocResult.getErrorMessage());\n }\n } catch (err) {\n logDebug(\"Error copying document: \" + err.message);\n return false;\n }\n }\n } // end for loop\n }\n }\n}", "function Attachments(input, count) {\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n document.getElementById('PhotoSource' + count + '').value = e.target.result; //Generated DataURL\n document.getElementById('PhotoFileName' + count + '').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}", "async storeAttachment(post) {\n // Crear Directorios para archivos, si no existen\n await mkdirp(this.current.fileDir);\n await mkdirp(this.current.thumbDir);\n\n // Almacenar thumb\n // Ubicación final de la thumb\n const thumbPath = this.current.thumbDir + post.file.thumb.split('/').reverse()[0];\n\n try {\n await fs.access(thumbPath);\n } catch (e) {\n // Descargar thumb\n try {\n const response = await axios.get(\n post.file.thumb,\n { responseType: 'arraybuffer' },\n );\n await fs.writeFile(thumbPath, response.data);\n } catch (error) {\n if (!(error.response && error.response.status === 404)) {\n throw new Error(error);\n }\n // Esto es un hack\n // Hace falta hacer el parseado de hilos con un headless browser\n const response = await axios.get(\n 'https://www.hispachan.org/buttons/previewerror.png',\n { responseType: 'arraybuffer' },\n );\n await fs.writeFile(thumbPath, response.data);\n }\n }\n\n // Establecer nueva ubicación\n post.file.thumb = thumbPath;\n\n // Almacenar archivo\n // Ubicación final del archivo\n const filePath = this.current.fileDir + post.file.url.split('/').reverse()[0];\n\n try {\n await fs.access(filePath);\n } catch (e) {\n // Descargar archivo\n try {\n const response = await axios.get(\n encodeURI(post.file.url),\n { responseType: 'arraybuffer' },\n );\n await fs.writeFile(filePath, response.data);\n post.file.md5 = md5(response.data);\n\n } catch (e) {\n if (e.response.status !== 404) {\n throw e;\n }\n }\n }\n\n // Establecer nueva ubicación\n post.file.url = filePath;\n\n await post.save();\n }", "function uploadPhoto()\r\n{\r\n\talert(\"upload start\");\r\n\tvar myImg = document.getElementById('myImg');\r\n\tvar options = new FileUploadOptions();\r\n\toptions.key=\"file.jpg\"; // temporary key for testing\r\n\toptions.AWSAccessKeyId=\"\"; // value removed for privacy reasons\r\n\toptions.acl=\"private\";\r\n\toptions.policy=\"\"; // value removed for privacy reasons\r\n\toptions.signature=\"\"; // value removed for privacy reasons\r\n\t\r\n\tvar ft = new FileTransfer();\r\n\tft.upload(myImg.src, encodeURI(\"https://andrewscm-bucket.s3.amazonaws.com/\"), onUploadSuccess, onUploadFail, options);\r\n}", "onDrop(files) {\n this.setState({\n image: files[0].preview\n });\n console.log(files);\n }", "function onMzgPhotoURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.png';\n }\n options.fileName = newfname;\n options.mimeType = \"png\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n options.chunkedMode = true;\n var ft = new FileTransfer();\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=mzgimageupload\"), win, fail, options);\n\n function win(r) {\n localStorage.setItem('sendimage', JSON.stringify(r.response));\n // var resp = JSON.parse(r.response);\n window.location.reload();\n \n }\n\n function fail(error) { \n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "function capturePhotoEdit() {\n // Take picture using device camera, allow edit, and retrieve image as base64-encoded string\n store('photoSource', 'camera');\n navigator.camera.getPicture(uploadPhoto, onFail, {\n quality: 20,\n allowEdit: true,\n destinationType: DESTINATION_TYPE.FILE_URI\n });\n}", "function addMediaToGallery(data,type){\n // If you need to open the object store in readwrite mode\n let tx=db.transaction(\"gallery\",\"readwrite\");\n //returns the same transaction object\n let gallery=tx.objectStore(\"gallery\")\n //to store the value in the object store\n gallery.add({mId:Date.now(),type,media:data})\n}", "__uploadPhotos(post, getMediaData, success) {\n\t \n\t\tlet html = new HtmlEnv(this, this.http, FACEBOOK_MOBILE_HOST);\n\t\tlet formTransform = new FormTransform();\n\n // Completes the post\n let completePost = (data, headers) => {\n \n // Create and send form to send post\n let postForm = new FormDataSender(this.http);\n formTransform.loadForm(postForm, data.upload);\n postForm.append('view_post', 'Post');\n \n // Send form to complete the post\n let options = this.__generateScrapeOptions('/composer/mbasic/?csid=' + data.upload.csid + '&' + encodeURIComponent('incparms[0]') + '=xc_message&av=' + this.scrapeUserId);\n options.method = 'POST';\n postForm.submit(options, (data, headers) => {\n\n // Unable to obtain identifier for post\n this._postSent({postId: 'DUMMY_ID - Facebook sendPost can not obtain postId. New post loaded from next load.'})\n });\n }\n\n // Uploads the photos\n let mediaIndex = 0\n let uploadPhoto = (data, media, complete) => {\n\n // Obtain the image data to upload\n getMediaData(media, 'image/jpeg', (imageData) => {\n\n // Obtain the image buffer\n let imageBuffer = new Buffer(imageData.imageBase64Data, 'base64')\n\n // Create form to upload image\n let imageForm = new FormDataSender(this.http);\n formTransform.loadForm(imageForm, data.upload, (key) => (key !== 'file1' && key !== 'filter_type'))\n imageForm.append('filter_type', '0')\n let contentType = (media.mimeType ? media.mimeType : 'image/png');\n imageForm.append('file1', imageBuffer, {\n filename: 'UploadFile.jpg',\n contentType: contentType\n });\n\n // Send form to upload the photo\n let options = this.__generateScrapeOptions('/composer/mbasic/?csid=' + data.upload.csid + '&av=' + this.scrapeUserId + '&view_overview');\n options.method = 'POST'\n imageForm.submit(options, (data, headers) => {\n let redirect = this.__generateScrapeOptions(options.path);\n html.handlePossibleRedirect(data, headers, redirect, this._origin('handlePossibleRedirect', 'sendPost'), (data, headers) => {\n html.parse(data, this.scraperFactory.create(FACEBOOK_MOBILE_HOST, options.path, '', (error, data) => {\n if (error) {\n\t\t\t\t\t\t\t\tthis.broadcastError(error, this._origin('parse', 'sendPost'));\n return\n }\n \n // Determine if further photos to upload\n mediaIndex++;\n if (mediaIndex < post.media.length) {\n \n // Create form to start adding another photo\n let anotherPhotoForm = new FormDataSender(this.http)\n formTransform.loadForm(anotherPhotoForm, data.upload )\n anotherPhotoForm.append('view_photo', 'Add Photos')\n\n // Undertake request to add another photo\n let options = this.__generateScrapeOptions('/composer/mbasic/?csid=' + data.upload.csid + '&' + encodeURIComponent('incparms[0]') + '=xc_message&av=' + this.scrapeUserId);\n options.method = 'POST'\n anotherPhotoForm.submit(options, (data, headers) => {\n let redirect = this.__generateScrapeOptions(options.path);\n html.handlePossibleRedirect(data, headers, redirect, this._origin('handlePossibleRedirect', 'sendPost'), (data, headers) => {\n html.parse(data, this.scraperFactory.create(FACEBOOK_MOBILE_HOST, options.path, '', (error, data) => {\n if (error) {\n\t\t\t\t\t\t\t\t\t\t\t\tthis.broadcastError(error, this._origin('parse', 'sendPost'));\n return\n }\n\n // Upload the next photo\n uploadPhoto(data, post.media[mediaIndex], complete)\n }))\n })\n })\n \n } else {\n // No further photos, so complete\n complete(data, headers)\n }\n }));\n })\n });\n })\n }\n\t\t\n\t\t// Handle feed to being process of uploading photo\n\t\tlet handleFeedStart = (error, data) => {\n\t\t\tif (error) {\n\t\t\t\tthis.broadcastError(error, this._origin('handleFeedStart', 'sendPost'));\n\t\t\t\treturn\n\t\t\t}\n\t\t\t\n // Remove the compose action (as starting with upload message)\n let composeAction = data.compose.action;\n delete(data.compose.action);\n \n // Overwrite to add message details\n data.compose.view_photo = 'Add Photos';\n data.compose.xc_message = this._appendAdText('Photo uploaded', post.message);\n\n // Send request to start loading of photo (contains message)\n let options = this.__generateScrapeOptions(composeAction);\n options.headers['content-type'] = 'application/x-www-form-urlencoded';\n options.body = querystring.stringify(data.compose);\n\n html.issuePost(options, this._origin('issuePost', 'sendPost'), (data, headers) => {\n let redirect = this.__generateScrapeOptions(options.path);\n html.handlePossibleRedirect(data, headers, redirect, this._origin('handlePossibleRedirect', 'sendPost'), (data, headers) => {\n html.parse(data, this.scraperFactory.create(FACEBOOK_MOBILE_HOST, options.path, '', (error, data) => {\n if (error) {\n\t\t\t\t\t\t\tthis.broadcastError(error, this._origin('parse', 'sendPost'));\n } else {\n\t // Upload the first photo (other photos follow \"additional photo\" path)\n\t uploadPhoto(data, post.media[mediaIndex], completePost);\n\t }\n }));\n })\n });\n\t\t};\n\t\tlet postHandler = this.scraperFactory.create(FACEBOOK_MOBILE_HOST, '/#mbasic_inline_feed_composer', '', handleFeedStart);\n\t\tlet options = this.__generateScrapeOptions('/');\n\n\t\thtml.issueParsedGet(options, this._origin('__uploadPhotos', 'sendPost'), postHandler);\n\t}", "function copyImg() {\n const d = 'dist/img/';\n const s = 'dev/img/';\n return src(`${s}**/*.{png,jpg,jpeg,gif}*`)\n .pipe($.plumber({ errorHandler }))\n .pipe($.debug())\n .pipe($.changed(d))\n .pipe($.if(conf.tinypng && (f => ['.png', '.jpg', '.jpeg'].includes(f.extname)), $.tinypngCompress({ key: getRandFromArr(conf.tinypngKey), sigFile: './.tinypng-sig', summarize: true })))\n .pipe(dest(d))\n .pipe($.notify({ title: 'Images', message: '✅ Task Completed!', icon: icons.success, onLast: true }))\n .pipe($.if(conf.upload.upload, $.through2.obj((file, enc, done) => {\n fileUpload($.path.basename(file.path), d);\n done();\n })));\n}", "handleFileUploadChange(e) {\n selectedImage = e.target.files[0];\n }", "createCopy()\n {\n let picture = new Picture2D();\n picture.empty = this.empty;\n picture.path = this.path;\n picture.image = this.image;\n picture.loaded = true;\n picture.stretch = false;\n picture.setW(picture.image.width, true);\n picture.setH(picture.image.height, true);\n return picture;\n }", "function post(err, stdout, stderr) {\r\n var b64content = fs.readFileSync('images/' + filename, {\r\n encoding: 'base64'\r\n })\r\n\r\n // Upload the media\r\n T.post('media/upload', {\r\n media_data: b64content\r\n }, uploaded);\r\n\r\n function uploaded(err, data, response) {\r\n // Now we can reference the media and post a tweet\r\n // with the media attached\r\n var mediaIdStr = data.media_id_string;\r\n var content = getAllContent()\r\n var params = {\r\n status: 'here is the image with glasses @' + content.data.name,\r\n in_reply_to_status_id: content.data.id,\r\n media_ids: [mediaIdStr]\r\n }\r\n // Post tweet\r\n T.post('statuses/update', params, tweeted);\r\n\r\n remove(); //remove the image stored\r\n };\r\n }", "function save_photo_story() {\n var arr = document.getElementsByClassName(\"img_story\")\n gId('story_content').style.display = 'block';\n if (arr.length > 1) {\n // gallery will be created if many pictures are in the temporary panel.\n var gallery = document.createElement(\"div\");\n gallery.className = \"gallery_container\"\n for (var i = 0; i < arr.length; i++) {\n var imageInGallery = document.createElement(\"img\")\n imageInGallery.className = \"image_story gallery\";\n imageInGallery.src = arr[i].src;\n gallery.appendChild(imageInGallery)\n }\n appendBlock(gallery, \"img\");\n } else {\n //only one picture is in temporary panel.\n oneImage = document.createElement(\"img\")\n oneImage.className = \"image_story\"\n oneImage.src = arr[0].src\n appendBlock(oneImage, \"img\");\n }\n clear();\n}", "function getPhoto(source) {\n // Retrieve image file location from specified source\n navigator.camera.getPicture(onSuccess, onFail, { quality: 50, \n destinationType: destinationType.DATA_URL,\n sourceType: source });\n \n }", "function previewMultiple(event) {\n var url = URL.createObjectURL(event.target.files[0]);\n document.getElementById(event.target.id).parentElement.firstChild.src = url;\n }", "async function takePhoto() {\n\n var fileCreationTimestamp = Date.now();\n\n for(var i =0; i!== mediaObjects.length;i++)\n {\n let photoPromise = mediaObjects[i].imageCapture.takePhoto();\n let mediaObjectPromise = mediaObjects[i];\n imagul.appendChild(mediaObjects[i].imagereference);\n Promise.all([photoPromise, mediaObjectPromise, fileCreationTimestamp]).then((values) =>\n {\n\n console.log('Taken Blob ' + values.type + ', ' + values.size + 'B');\n console.log(\"Photo taken value: \" + values[1].deviceId);\n var image = document.createElement(\"img\");\n image.setAttribute('id', values[2] + '_' + values[1].deviceId);\n image.setAttribute('method', 'POST');\n image.setAttribute('name', ' image' + countli);\n\n var processvalue = values[2] + '_' + values[1].deviceId;\n image.src = URL.createObjectURL(values[0]);\n values[1].imagereference.appendChild(image);\n\n var theFirstChild = values[1].imagereference.firstChild;\n values[1].imagereference.insertBefore(image, theFirstChild);\n\n var reader = new window.FileReader();\n reader.readAsDataURL(values[0]);\n reader.onloadend = function () {\n base64data = reader.result;\n let base64Image = base64data.split(';base64,').pop();\n\n var recordingName = \"\";\n var inputFolderElement = document.getElementById(\"foldername\");\n\n if(inputFolderElement && inputFolderElement.value !== \"\")\n {\n recordingName = inputFolderElement.value + \"_\";\n }\n else {\n recordingName = \"Default_Dataset_\";\n }\n fs.writeFile(values[2]+'_'+recordingName +'_image_'+countli+'.png', base64Image, {encoding: 'base64'}, function(err) {\n console.log('File created');\n });\n\n if(photoprocessing_check && photoprocessing_check.checked === true)\n {\n processphoto(processvalue);\n }\n\n countli +=1;\n }\n\n\n }).catch(err => console.error('takePhoto() failed: ', err));\n\n\n }\n\n}", "function copy() {\n return gulp.src('./src/assets/{documents,images}/*.*')\n .pipe(gulp.dest('./dist/assets/'));\n}", "function getPhotoAndUploadToContact(name, contactId) {\n var $j = jQuery.noConflict();\n\n SFHybridApp.logToConsole(\"in capturePhoto, contactId = \" + contactId);\n\n $j('#Image').attr('data-old-src', $j('#Image').attr('src'));\n $j('#Image').attr('src', \"images/camera.png\");\n\n navigator.camera.getPicture(function(imageData) {\n onPhotoDataSuccess(imageData, name, contactId);\n }, function(errorMsg) {\n // Most likely error is user cancelling out of camera\n onPhotoDataError(errorMsg);\n }, {\n quality: 50,\n correctOrientation: true,\n sourceType: Camera.PictureSourceType.CAMERA,\n destinationType: Camera.DestinationType.DATA_URL\n });\n}", "function UploadToSharePoint(){\n console.log(\"Uploading the files to SharePoint\");\n gulp.src([\"dist/**\"]).pipe(spsave({siteUrl: \"https://ecm.dev.opcw.org/sites/osdtemplate/\",folder: \"Administration\"},null));\n return gulp.src([\"views/**\"]).pipe(spsave({siteUrl: \"https://ecm.dev.opcw.org/sites/osdtemplate/\",folder: \"Administration\"}, null));\n}", "function getImage() {\n\t\n\t \n\t\n\t//alert( navigator.camera.DestinationType.FILE_URI );\n\t//abort;\n\t \n\t\t// Retrieve image file location from specified source\n\t navigator.camera.getPicture(uploadPhoto, function(message) {\n\t\t\t\t\talert('get picture failed');\n\t\t\t\t},{\n\t\t\t\t\tquality: 50, \n\t\t\t\t\tdestinationType: navigator.camera.DestinationType.FILE_URI,\n\t\t\t\t\tsourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY\n\t\t\t\t});\n\n}", "function openFilePicker(selection) {\n\n var srcType = Camera.PictureSourceType.SAVEDPHOTOALBUM;\n var options = setOptions(srcType);\n var func = createNewFileEntry;\n\n navigator.camera.getPicture(function cameraSuccess(imageUri) {\n displayImage(imageUri);\n }, function cameraError(error) {\n console.debug(\"Unable to obtain picture: \" + error, \"app\");\n }, options);\n}", "function getPhoto(source) {\n // Retrieve image file location from specified source\n navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, \n destinationType: destinationType.FILE_URI,\n sourceType: source });\n }", "_initSingleImageUpload() {\n if (typeof SingleImageUpload !== 'undefined' && document.getElementById('singleImageUploadExample')) {\n const singleImageUpload = new SingleImageUpload(document.getElementById('singleImageUploadExample'), {\n fileSelectCallback: (image) => {\n console.log(image);\n // Upload the file with fetch method\n // let formData = new FormData();\n // formData.append(\"file\", image.file);\n // fetch('/upload/image', { method: \"POST\", body: formData });\n },\n });\n }\n }", "function getPhoto(source) {\n // Retrieve image file location from specified source\n navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, \n destinationType: destinationType.FILE_URI,\n sourceType: source });\n }", "function getPhoto(){\n\tif(navigator.camera){\n\t\toptions={destinationType : 1,\n\t\t\t\t\t\tsourceType : 1,\n\t\t\t\t\t\tallowEdit: true}\n\t\tnavigator.camera.getPicture(getPictureSuccess, getPictureFail, options); \n\t}else{\n\t\timage = \"images/test.jpg\";\n\t\tgetPictureSuccess(image);\n\t}\n}", "function uploadPhoto(filepath) {\n // Create document with Meta-data\n var photo = new photoDB({\n filename: path.basename(filepath),\n contentType: 'binary'\n });\n\n // Read file from disk\n var stream = fs.createReadStream(filepath);\n\n // Promise to upload file contents\n return new Promise(function (resolve, reject) {\n photo.write(stream, (err, res) => {\n // Always resolve\n if (err !== null) console.error(err);\n resolve(res || err);\n });\n });\n}", "insertImagesAsFigures(files) {\n // TODO: we would need a transaction on archive level, creating assets,\n // and then placing them inside the article body.\n // This way the archive gets 'polluted', i.e. a redo of that change does\n // not remove the asset.\n const editorSession = this.getEditorSession();\n const paths = files.map(file => {\n return this.archive.addAsset(file);\n });\n const sel = editorSession.getSelection();\n if (!sel || !sel.containerPath) return;\n editorSession.transaction(tx => {\n importFigures(tx, sel, files, paths);\n });\n }", "async takePicture() {\n if (this.cam) {\n const options = {quality: 0.4, width: 2880, fixOrientation: true};\n const data = await this.cam.takePictureAsync(options)\n data.time = Date.now();\n data.thumbNail = data.uri;\n data.uri && this.setState({capturedImage: data});\n }\n }", "function movePic(file){ \n window.resolveLocalFileSystemURI(file, resolveOnSuccess, resOnError); \n}", "function zoto_modal_edit_featured_photo(options) {\n\tthis.$uber(options);\n//\tthis.zoto_modal_window(options);\n\t\n\tthis.featured_media = []; //what the user has featured\n\tthis.media = []; //available media to feature\n\tthis.selected_images = [];\n\t\n\tthis.glob = new zoto_glob({limit: 50}); // leave this at 50 please!\n\tthis.globber = new zoto_globber_view({'glob': this.glob});\n\t\n\tthis.settings = {};\n\tif (!this.settings.glob_settings) {\n\t\tthis.settings.glob_settings = this.glob.settings;\n\t} else {\n\t\tthis.glob.settings = this.settings.glob_settings;\n\t}\n\tif (!this.settings.view_style) {\n\t\tthis.settings.view_style = 'minimal';\n\t}\n\tthis.globber.switch_view(this.settings.view_style)\n\tthis.globber.update_edit_mode(0);\n\tthis.pagination = new zoto_pagination({visible_range: 11});\n\tthis.pagination.initialize();\n\tconnect(this.glob, 'GLOB_UPDATED', this.globber, 'update_glob');\n \tconnect(this.globber, 'TOTAL_ITEMS_KNOWN', this.pagination, 'prepare');\n\tconnect(this.globber, 'NO_VIEW_RESULTS', this, 'handle_no_results');\n\n\tconnect(this.pagination, 'UPDATE_GLOB_OFF', this, function(value) {\n\t\tthis.clean_up();\n\t\tthis.glob.settings.offset = value;\n\t\tthis.globber.update_glob(this.glob);\n\t});\n \t//connect(this.globber, 'ITEM_CLICKED', this.globber, 'handle_image_clicked');\n \tconnect(this.globber, 'SELECTION_CHANGED', this, 'handle_new_selection');\n \tconnect(this, 'UPDATE_GLOB_SSQ', this.glob, function(ssq) {\n\t\tthis.settings.simple_search_query = ssq;\n\t\tthis.settings.offset = 0;\n\t\tsignal(this, 'GLOB_UPDATED', this);\n \t});\n\t\n\tthis.options.order_options = this.options.order_options || [\n\t\t['date_uploaded-desc', 'uploaded : newest'],\n\t\t['date_uploaded-asc', 'uploaded : oldest'],\n\t\t['title-asc', 'title : a-z'],\n\t\t['title-desc', 'title : z-a'],\n\t\t['date-desc', 'taken : newest'],\n\t\t['date-asc', 'taken : oldest'],\n\t\t['HEAD', 'EXIF DATA'],\n\t\t['camera_model-asc', 'camera : a - z'],\n\t\t['camera_model-desc', 'camera : z - a'],\n\t\t['iso_speed-asc', 'speed : iso 6 - iso 6400'],\n\t\t['iso_speed-desc', 'speed : iso 6400 - iso 6'],\n\t\t['calc_focal_length-asc', 'length : 0mm - 1000mm'],\n\t\t['calc_focal_length-desc', 'length : 1000mm - 0mm'],\n\t\t['calc_fstop-asc', 'f-stop : f/1.0 - f/22'],\n\t\t['calc_fstop-desc', 'f-stop : f/22 - f/1.0'],\n\t\t['calc_exposure_time-asc', 'exposure : 0s - 30s'],\n\t\t['calc_exposure_time-desc', 'exposure : 30s - 0s']\n\t];\n\t\n}", "function uploadGoogleFilesToDropbox(attachment) {\n \n var path = '/Auditions/' + attachment.getName();\n \n var headers = {\n \"Content-Type\": \"application/octet-stream\",\n 'Authorization': 'Bearer ' + dropbox_token,\n \"Dropbox-API-Arg\": JSON.stringify({\"path\": path})\n \n };\n \n var options = {\n \"method\": \"POST\",\n \"headers\": headers,\n \"payload\": attachment.getBytes()\n };\n \n var apiUrl = \"https://content.dropboxapi.com/2/files/upload\";\n var response = JSON.parse(UrlFetchApp.fetch(apiUrl, options).getContentText());\n \n Logger.log(\"File uploaded successfully to Dropbox\");\n \n}", "function addTodoPicture() {\n navigator.camera.getPicture(addTodo, function () {\n alert('Failed to get camera.');\n }, {\n quality: 50,\n destinationType: Camera.DestinationType.DATA_URL,\n targetWidth: 100,\n targetHeight: 100\n });\n}", "function _doImageUpload(){\n var dataUrl = _getDataUrl($img),\n metaTransferId = (function(){\n if(metaTransfer && metaTransfer.getServerSideId())\n return metaTransfer.getServerSideId();\n else if(_locInfo.argumenta.metadata)\n return _locInfo.argumenta.metadata;\n else\n return 'null';\n })()\n transfer = basiin.tell(dataUrl);\n\n transfer.event.add({\n 'onAfterFinalize':function(event){\n frameProgressBar.setProgress(0);\n window.location = srv.location\n +'/'+ srv.basiin\n +'/image/uploaded/'+ basiin.transaction().id\n +'/'+ transfer.getServerSideId()\n +'/'+ metaTransferId\n },\n 'onAfterPacketLoad':function(event){\n frameProgressBar.setProgress(\n event.object.getProgress());\n }\n });\n }" ]
[ "0.561532", "0.55945224", "0.5586316", "0.544252", "0.53647995", "0.53227454", "0.5286344", "0.52729326", "0.52709943", "0.52616906", "0.52192575", "0.51363444", "0.51013196", "0.5085947", "0.50716823", "0.5056637", "0.5042237", "0.50379175", "0.503484", "0.50297225", "0.5026766", "0.49849513", "0.495574", "0.49434572", "0.4942512", "0.49406043", "0.49403423", "0.49382046", "0.4938174", "0.49313587", "0.492505", "0.49002004", "0.4887837", "0.48810714", "0.48738137", "0.48666266", "0.48546326", "0.48535505", "0.48534942", "0.48500314", "0.48394746", "0.48384216", "0.48297334", "0.48280355", "0.48185605", "0.48170483", "0.48163512", "0.48132592", "0.4808125", "0.48030764", "0.4786869", "0.47802463", "0.4778365", "0.477824", "0.47637066", "0.4763544", "0.4759073", "0.47561994", "0.475285", "0.4741711", "0.47380534", "0.47348586", "0.47347882", "0.47262278", "0.47212693", "0.47048175", "0.4692404", "0.4690986", "0.46856844", "0.46835086", "0.4681126", "0.4678269", "0.46719262", "0.46613473", "0.465801", "0.4657687", "0.4657334", "0.46567395", "0.46503976", "0.46480122", "0.46442077", "0.46390188", "0.46355549", "0.46350685", "0.46297923", "0.46272406", "0.4625734", "0.4619619", "0.46182597", "0.4615279", "0.46151647", "0.4615072", "0.46109352", "0.4605399", "0.4604505", "0.4603579", "0.4602721", "0.46012902", "0.45992643", "0.45961085" ]
0.64179885
0
file copy error callback
function onFileSystemFail(err) { console.log('deleteFileFromPersistentStorage file system fail: ' + fileName); console.log('error code = ' + err.code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCopyError(err, fileId, file){\n console.error(`ufs: cannot copy file \"${ fileId }\" (${ err.message })`);\n }", "function postProcess(fullPath, err, callback) {\r\n\t\tif (err) {\r\n\t\t\tconsole.log(fullPath + \" :: \" + err);\r\n\t\t\tstats.notCopied++;\r\n\t\t} else {\r\n\t\t\tstats.copied++;\r\n\t\t}\r\n\t\tcallback(err);\r\n\t\treturn;\r\n\t}", "function copyDone (error)\n {\n if (!done) {\n done = true;\n copyCallback(error);\n }\n }", "function onTransferError() {\n isFileTransferInProgress = false;\n msg(\"File transfer error\");\n eventHandler.dispatchEvent('error', new Error('File transfer failed'));\n}", "function fileShareError(event) {\n // cleanup\n receiveBuffer = [];\n incomingFileData = [];\n receivedSize = 0;\n // error\n if (sendInProgress) {\n console.error(\"fileShareError\", event);\n alert(\"error: File Sharing \" + event.error);\n sendInProgress = false;\n }\n}", "function onFileSystemFail(error) {\n console.log('moveFileToPersistentStorage file system fail code ' + error.code);\n var msg = 'An error occurred during file copy: ' + error.code;\n navigator.notification.alert(msg, null, 'File copy error in moveFileToPersistentStorage()');\n }", "function failFileBackup(error) {\n\tvar backupfailed = $.t('backupfailed');\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Backup - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(backupfailed, 'short');\n}", "onWriteError(err, fileId, file) {\n console.error(`ufs: cannot write file \"${ fileId }\" (${ err.message })`);\n }", "function copyFile(item, cb) {\n item.val.copy(item.parent, item.val.name, function(err) {\n if(err) return cb(err);\n\n // run processStack again\n return processStack();\n });\n }", "function copyNextFile(err) {\n if (err) {\n cb(err);\n }\n else if (i < files.length) {\n copyItem(path.join(p, files[i]), copyNextFile);\n i++;\n }\n else {\n cb();\n }\n }", "function _validateFiles() {\r\n fs.stat(src, function(err, stat) {\r\n\r\n if (err) {\r\n callback(err);\r\n return;\r\n }\r\n\r\n if (stat.isDirectory()) {\r\n callback('Source ' + src + ' is a directory. It must be a file');\r\n return;\r\n }\r\n\r\n if (src === dst) {\r\n callback('Source ' + src + ' and destination ' + dst + ' are identical');\r\n return;\r\n }\r\n\r\n if (stat.isFile()) {\r\n _openInputFile();\r\n } else {\r\n callback('Copying of sockets, pipes, and devices is not supported: ' + src);\r\n }\r\n });\r\n }", "function _validateSource() {\r\n path.exists(src, function(src_exists) {\r\n if (!src_exists) {\r\n callback('Source ' + src + ' does not exist. Nothing to be copied');\r\n return;\r\n }\r\n\r\n _validateDest();\r\n });\r\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make sure our error handler is attached before userland ones.", "function readFailureCallback(e) {\n if (this._readyState === FileReader.DONE) {\n return;\n }\n\n this._readyState = FileReader.DONE;\n this._result = null;\n this._error = new FileError(e);\n\n if (typeof this.onerror === \"function\") {\n this.onerror(new ProgressEvent(\"error\", {target:this}));\n }\n\n if (typeof this.onloadend === \"function\") {\n this.onloadend(new ProgressEvent(\"loadend\", {target:this}));\n }\n}", "function readFailureCallback(e) {\n if (this._readyState === FileReader.DONE) {\n return;\n }\n\n this._readyState = FileReader.DONE;\n this._result = null;\n this._error = new FileError(e);\n\n if (typeof this.onerror === \"function\") {\n this.onerror(new ProgressEvent(\"error\", {target:this}));\n }\n\n if (typeof this.onloadend === \"function\") {\n this.onloadend(new ProgressEvent(\"loadend\", {target:this}));\n }\n}", "function postCopyCallback(err, newDoc) {\n if (err) return; // Nothing else we can do if there's an error\n \n appendJson(newDoc);\n\n nextIndex++;\n\n // See if we've done copying all the source docs\n if(nextIndex === listLength) {\n appendFeedback(`Done copying ${listLength} of ${listLength} files`);\n setSpinnerDisplay(false);\n return;\n }\n else {\n // otherwise, call the iterator on the next item\n showProgress()\n copyDoc(docList[nextIndex], postCopyCallback);\n }\n }", "function onerror(er){debug(\"onerror\",er);unpipe();dest.removeListener(\"error\",onerror);if(EElistenerCount(dest,\"error\")===0)dest.emit(\"error\",er)}", "function fileUploadFailed() {\n console.log(\"Failed to upload file\");\n}", "function fileReadFail(data){\n console.log(data);\n}", "_onError(e) {\n console.log(`Filer filesystem error: ${e}`);\n }", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)errorOrDestroy(dest,er);}// Make sure our error handler is attached before userland ones.", "checkedEmitError(error) {\n if (!isIgnorableFileError(error)) {\n this.emit('error', error);\n }\n }", "function failFileRestoreWall(error) {\n\tvar restorefavwallsfailed = $.t('restorefavwallsfailed');\n\twindow.wallRestoreFailed = true;\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Restore - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(restorefavwallsfailed, 'short');\n}", "withSuccess() {\n return Object.freeze(\n new FileCopyResult(this.from, this.to, {success: true})\n );\n }", "function handleFileUploadError(_data) {\r\n\tcheckError(_data.response().jqXHR, '_folderMessage');\r\n}", "function errorHandler(e) {\n var msg = '';\n\n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg = 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg = 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg = 'INVALID_STATE_ERR';\n break;\n default:\n msg = 'Unknown Error';\n break;\n };\n\n console.log('Error: ' + msg);\n document.getElementById('download').style.display = '';\n document.getElementById('status').innerHTML = '<b>Error</b> '+msg;\n}", "function errorHandler(e) {\n\tif(e.target.error.name == \"NotReadableError\") {\n\t\talert(\"Cannot read file !\");\n\t}\n}", "saveFile (filename, callback) {\n let tmp_filepath = this.filedir + '.' + filename\n let filepath = this.filedir + filename\n fs.copyFile(tmp_filepath, filepath, fs.constants.COPYFILE_FICLONE, (err) => {\n callback(err)\n })\n }", "function copyFile(oldFilePath, newFilePath, callback) {\r\n fs.readFile(oldFilePath, (error, fileContent) => {\r\n if (error) {\r\n console.log(error);\r\n callback(error);\r\n }\r\n\r\n fs.writeFile(newFilePath, fileContent, (error) => {\r\n if (error) {\r\n console.error(error);\r\n callback(error);\r\n return;\r\n }\r\n\r\n callback(null);\r\n })\r\n })\r\n}", "function copyFile(item,cb) {\n request(item.url+item.file, function (err, response, body) {\n if (err) return cb(item,err);\n\n fs.ensureDirSync(item.path);\n fs.writeFile(item.path+item.file,body);\n return cb(item);\n });\n}", "function uploadFile(err, url){\n\n instance.publishState('created_file', url);\n instance.triggerEvent('has_created_your_file')\n\n if (err){\n\n console.log('error '+ err);\n\n }\n\n }", "function copySelectedFile() {\n\t// Nur etwas tun, wenn ein File selektiert ist\n\tif (selectedType == 'file') {\n\t\t// Request absetzen\n\t\tnew Ajax.Request('ajax/copyFile.php?'+url+'&file='+selectedFile, {\n\t\t\tmethod: 'get',\n\t\t\tonSuccess: function (transport) {\n\t\t\t\t// Reload, wenn Directory gewechselt wurde\n\t\t\t\tif (transport.responseText == 'true') {\n\t\t\t\t\tEffect.Pulsate(icoCopy.id, { pulses: 3, duration: 1.0 });\n\t\t\t\t\ticoPaste.src = '/images/icons/paste_plain.png';\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "copyBaseFiles(name, filePath) {\n /*NO-OP*/\n }", "_onError(event) {\n const span = document.createElement(\"span\");\n span.innerHTML = \"\" + \"Upload failed. Retrying in 5 seconds.\";\n this.node.appendChild(span);\n this.retry = setTimeout(() => this.callbackUpload(), 5000, this.data);\n\n TheFragebogen.logger.error(this.constructor.name + \".callbackUpload()\", \"Upload failed with HTTP code: \" + this.request.status + \". Retrying in 5 seconds.\");\n }", "onCopy() {\n this.commands.exec(\"copy\", this);\n }", "function addDefferedFileAction(success, error) {\n actions.success.push(success);\n actions.error.push(error); \n}", "function errorHandler(evt) {\n switch (evt.target.error.code) {\n case evt.target.error.NOT_FOUND_ERR:\n alert('File Not Found!');\n break;\n case evt.target.error.NOT_READABLE_ERR:\n alert('File is not readable');\n break;\n case evt.target.error.ABORT_ERR:\n break;\n default:\n alert('An error occurred reading this file.');\n }\n evt.target.abort();\n}", "function onUploadFailed(e) {\n alert(\"Error uploading file\");\n }", "function onUploadError(event) {\r\n\t\t\tthis.progressReport.innerHTML = \"上传失败\";\r\n\t\t}", "function transferErrors(transferObject, eventCode, eventMsg, propertyName) {\n //alert(\"Sample Upload Transfer Error \" + eventCode + \", \" + eventMsg);\n}", "function xhrTransferError(xhrEvent) {\n // console.log(\"An error occured while transferring the data\");\n}", "onItemError(src) {\r\n this.runCallbacks(this.onItemErrorCallbacks, [src]);\r\n this.runCallbacks(this.onAfterItemCallbacks, [src]);\r\n this.errors.push(src);\r\n this.cleanUp();\r\n this.start();\r\n }", "function error (err) {\n if(error.err) return;\n callback(error.err = err);\n }", "onReadError(err, fileId, file) {\n console.error(`ufs: cannot read file \"${ fileId }\" (${ err.message })`);\n }", "function onUploadFailed(e) {\r\n\talert(\"Error uploading file\");\r\n}", "function onerror(er) {\n $Fj4k$var$debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if ($Fj4k$var$EElistenerCount(dest, 'error') === 0) $Fj4k$var$errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onWritten(writeErr) {\n var flags = fo.getFlags({\n overwrite: optResolver.resolve('overwrite', file),\n append: optResolver.resolve('append', file),\n });\n if (fo.isFatalOverwriteError(writeErr, flags)) {\n return callback(writeErr);\n }\n\n callback(null, file);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function loading_error(error, filename, lineno) {\n console.log(\"Error when loading files: \" + error);\n res.send(error);\n }", "function failFileRestoreRing(error) {\n\tvar restorefavringsfailed = $.t('restorefavringsfailed');\n\twindow.ringRestoreFailed = true;\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Restore - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(restorefavringsfailed, 'short');\n}", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "_finishCopy(srcFolder, isMove, result, srcMessages, destMessages) { try {\n this.enableNotifications(Ci.nsIMsgFolder.allMessageCountNotifications, true, false);\n\n if (CS(result)) {\n this.updateSummaryTotals(false);\n // xxx todo - why are we doing a folder loaded here?\n this._notifyFolderLoaded();\n let isTB68 = this.msgDatabase.deleteMessages.length == 3; // COMPAT for TB 68\n MailServices.mfn.notifyMsgsMoveCopyCompleted(isMove, isTB68 ? srcMessages : /* COMPAT for TB 78 */toArray(srcMessages, Ci.nsIMsgDBHdr), this.delegator, isTB68 ? destMessages : /* COMPAT for TB 78 */toArray(destMessages, Ci.nsIMsgDBHdr));\n if (isMove)\n srcFolder.NotifyFolderEvent(\"DeleteOrMoveMsgCompleted\");\n }\n else {\n log.info(\"Move/Copy failed\");\n let activityListener = this.nativeMailbox.activityListener;\n if (activityListener)\n activityListener.showFailed();\n if (isMove)\n srcFolder.NotifyFolderEvent(\"DeleteOrMoveMsgFailed\");\n }\n executeSoon(() => {\n if (MailServices.copy.NotifyCompletion) { // COMPAT for TB 78 (bug 1715433)\n MailServices.copy.NotifyCompletion(srcFolder, this.delegator, result); // COMPAT for TB 78 (bug 1715433)\n } else { // COMPAT for TB 78 (bug 1715433)\n MailServices.copy.notifyCompletion(srcFolder, this.delegator, result);\n } // COMPAT for TB 78 (bug 1715433)\n });\n } catch (e) { e.code = \"error-finish-copy\"; log.error(\"_finishCopy error\", e);}}", "onerror() {}", "onerror() {}", "function errorReadingFiles(error) {\n logger(error);\n bootstrap.errorCallback();\n}", "onCopyCompleted(src, aResult) {\n let srcSupports = src.QueryInterface(Ci.nsISupports);\n log.debug(\"ewsMsgFolderComponent onCopyCompleted\");\n if (aResult != Cr.NS_OK) {\n log.error(\"Copy failed for folder \" + this.prettyName);\n }\n\n // When the copy proceeds without async intermediary, then the base code crashes in nsMsgFilterService here:\n // for (PRUint32 msgIndex = 0; msgIndex < m_searchHits.Length(); msgIndex++)\n // (for base code that I added :(\n // prevent that by forcing async\n // copyService->NotifyCompletion(srcSupport, dstFolder, result);\n executeSoon( () => {\n //let dstFolder = this.QueryInterface(Ci.nsIMsgFolder);\n // the copy service does a direct compare of msgFolder, so we have\n // to pass the C++ delegator here\n if (MailServices.copy.NotifyCompletion) { // COMPAT for TB 78 (bug 1715433)\n MailServices.copy.NotifyCompletion(srcSupports, this.delegator, aResult); // COMPAT for TB 78 (bug 1715433)\n } else { // COMPAT for TB 78 (bug 1715433)\n MailServices.copy.notifyCompletion(srcSupports, this.delegator, aResult);\n } // COMPAT for TB 78 (bug 1715433)\n });\n }", "addOnProgressListener(callback) {\n this.on(FILE_TRANSFER_PROGRESS, callback);\n }", "function onerror(er) {\n $SYhk$var$debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if ($SYhk$var$EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n } // Make sure our error handler is attached before userland ones.", "async copyTo(destFolder, destName, deep, multistatus) {\n const targetFolder = destFolder;\n if (targetFolder == null || !await util_1.promisify(fs_1.exists)(targetFolder.fullPath)) {\n throw new DavException_1.DavException(\"Target directory doesn't exist\", undefined, DavStatus_1.DavStatus.CONFLICT);\n }\n const newFilePath = path_1.join(targetFolder.fullPath, destName);\n const targetPath = (targetFolder.path + EncodeUtil_1.EncodeUtil.encodeUrlPart(destName));\n // If an item with the same name exists - remove it.\n try {\n const item = await this.context.getHierarchyItem(targetPath);\n if (item != null) {\n await item.delete(multistatus);\n }\n }\n catch (ex) {\n // Report error with other item to client.\n multistatus.addInnerException(targetPath, undefined, ex);\n return;\n }\n // Copy the file togather with all extended attributes (custom props and locks).\n try {\n await util_1.promisify(fs_1.copyFile)(this.fullPath, newFilePath);\n this.context.socketService.notifyRefresh(targetFolder.path.replace(/\\\\/g, '/').replace(/\\/$/, \"\"));\n }\n catch (err) {\n /*if(err.errno && err.errno === EACCES) {\n const ex = new NeedPrivilegesException(\"Not enough privileges\");\n const parentPath: string = System.IO.Path.GetDirectoryName(Path);\n ex.AddRequiredPrivilege(parentPath, Privilege.Bind);\n\n throw ex;\n }*/\n throw err;\n }\n }", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones.", "function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);\n } // Make sure our error handler is attached before userland ones." ]
[ "0.8021209", "0.69921285", "0.6665508", "0.65991473", "0.648742", "0.6478855", "0.6280451", "0.62238395", "0.62135863", "0.61942846", "0.6138471", "0.59483486", "0.59406954", "0.59406954", "0.59406954", "0.59281695", "0.59281695", "0.5923248", "0.5918593", "0.5889227", "0.58815074", "0.58799326", "0.5862595", "0.5804165", "0.57577604", "0.57526165", "0.5740202", "0.5719502", "0.5706562", "0.5685842", "0.5680757", "0.5679109", "0.5667049", "0.564381", "0.56379676", "0.5636982", "0.5608719", "0.56056255", "0.5595184", "0.558745", "0.55770135", "0.5557442", "0.5546525", "0.5546418", "0.55456656", "0.55424935", "0.5534409", "0.55330753", "0.55297065", "0.5514342", "0.55092734", "0.55069065", "0.5500617", "0.549986", "0.549986", "0.549986", "0.5483643", "0.5482826", "0.5482826", "0.5480467", "0.5472992", "0.54606897", "0.545354", "0.5445834", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416", "0.5427416" ]
0.5724476
27
Valid if it exists, and is not an autoadded Storybook element i.e. It is not dependent on Storybook's Preview implementation, so it'll work in JSDom (Jest)
function isValidTargetElement(targetElement) { return (0, _typeGuards.isNotNil)(targetElement) && targetElement !== _storybook.A11yElement.Root && targetElement !== _storybook.A11yElement.Component; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_assertElementExists(matchElement, element) {\n const elName = element.name.replace(/^:xhtml:/, '');\n if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {\n let errorMsg = `'${elName}' is not a known element:\\n`;\n errorMsg += `1. If '${elName}' is an Angular component, then verify that it is part of this module.\\n`;\n if (elName.indexOf('-') > -1) {\n errorMsg += `2. If '${elName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.`;\n }\n else {\n errorMsg +=\n `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;\n }\n this._reportError(errorMsg, element.sourceSpan);\n }\n }", "_assertElementExists(matchElement, element) {\n const elName = element.name.replace(/^:xhtml:/, '');\n if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {\n let errorMsg = `'${elName}' is not a known element:\\n`;\n errorMsg += `1. If '${elName}' is an Angular component, then verify that it is part of this module.\\n`;\n if (elName.indexOf('-') > -1) {\n errorMsg += `2. If '${elName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.`;\n }\n else {\n errorMsg +=\n `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;\n }\n this._reportError(errorMsg, element.sourceSpan);\n }\n }", "_assertElementExists(matchElement, element) {\n const elName = element.name.replace(/^:xhtml:/, '');\n if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {\n let errorMsg = `'${elName}' is not a known element:\\n`;\n errorMsg +=\n `1. If '${elName}' is an Angular component, then verify that it is part of this module.\\n`;\n if (elName.indexOf('-') > -1) {\n errorMsg +=\n `2. If '${elName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.`;\n }\n else {\n errorMsg +=\n `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;\n }\n this._reportError(errorMsg, element.sourceSpan);\n }\n }", "_assertElementExists(matchElement, element) {\n const elName = element.name.replace(/^:xhtml:/, '');\n if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {\n let errorMsg = `'${elName}' is not a known element:\\n`;\n errorMsg +=\n `1. If '${elName}' is an Angular component, then verify that it is part of this module.\\n`;\n if (elName.indexOf('-') > -1) {\n errorMsg +=\n `2. If '${elName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.`;\n }\n else {\n errorMsg +=\n `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;\n }\n this._reportError(errorMsg, element.sourceSpan);\n }\n }", "_checkForUndefinedComponents() {\n if (this.html == null) {\n return;\n }\n const matches = this.html.matchAll(/<([a-z]+-[a-z]*)[ \\/].*>/g);\n if (matches == null) {\n return;\n }\n const tags = Array.from(matches).map(m => m[1]);\n for (const tag of tags) {\n if (customElements.get(tag) == null) {\n console.error(`${this.constructor.name} tried to use tag ${tag}, but it has not been defined yet.`);\n }\n }\n }", "setupUselessElement() {}", "static getNativeElement(el) {\n if (el instanceof UnitTestElement) {\n return el.element;\n }\n throw Error('This TestElement was not created by the TestbedHarnessEnvironment');\n }", "validateNoReviewComponent() {\n return this\n .waitForElementVisible('@productCardWithoutReviewComponent', 10000, () => {}, '[STEP] - Product Card should not have review component')\n .assert.visible('@productCardWithoutReviewComponent');\n }", "checkIfElementExists(el) {\n if (!this.context.querySelector('#'+el)) {\n throw new Error(`#${el} does not exist`);\n }\n }", "function isDOMRequired() { \n\treturn true;\n}", "function isDOMRequired() {\r\n return false;\r\n}", "function isDOMRequired()\n{\n\treturn true;\n}", "get exists() {\n return (\n (this.opts.selector !== undefined || this.opts.element !== undefined)\n && ((this.$component instanceof Node\n && this.$component !== undefined\n && this.$component !== null)\n || (this.$component instanceof NodeList && this.$component.length > 0))\n );\n }", "function isElement(obj) {\n return !!((typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement)) === 'object' ? obj instanceof HTMLElement : obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string');\n }", "function isElement(obj) {\n return !!((typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement)) === 'object' ? obj instanceof HTMLElement : obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string');\n }", "isElement(value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__[\"a\" /* default */])(value) && Node.isNodeList(value.children) && !Editor.isEditor(value);\n }", "function isElement(o) {\n return o && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName === 'string';\n}", "function canUseDOM() {\n return !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\n}", "function isPlaywrightElementHandle(obj) {\n return !('$x' in obj);\n}", "function isElement(target) {\n return !!target && typeof target['tagName'] === 'string';\n }", "function isElement(obj) {\n return !!((typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement)) === 'object' ? obj instanceof HTMLElement : obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string');\n}", "function documentElementCheck () {\n const docNode = document.documentElement.nodeName;\n if (docNode) {\n return docNode.toLowerCase() === 'html';\n }\n return true;\n}", "validateReviewComponent() {\n return this\n .waitForElementVisible('@reviewComponent', 10000, () => {}, '[STEP] - Product Card should have review component')\n .assert.visible('@reviewComponent');\n }", "createNodeMock(element) {\n if (element.type === 'input') {\n return {};\n }\n return null;\n }", "function isValidElement(elem) {\n return !!elem && elem.nodeType === 1;\n }", "function hasDocument() {\n return typeof document !== \"undefined\";\n}", "function hasDocument() {\n return typeof document !== \"undefined\";\n}", "function assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n }", "setupUselessElement() {\n this.uselessElement = this.document.createElement('div');\n }", "setupUselessElement() {\n this.uselessElement = this.document.createElement('div');\n }", "setupUselessElement() {\n this.uselessElement = this.document.createElement('div');\n }", "function checkFeed(element) {\n expect(element).toBeDefined(); // Element must be defined...\n expect((element).length).toBeGreaterThan(0); // and have a length greater than 0...\n expect(element).not.toBe(''); // and not be an empty string.\n }", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n}", "function checkElementIdShadowing(value) {\n return value && value.nodeType === undefined ? value : undefined;\n}", "function hasCreateElement(){\n\treturn typeof document.createElement == \"function\"; \n}", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n }", "function isElement(o){\n return (\n typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName===\"string\"\n );\n }", "function isElement(o) {\n return typeof HTMLElement === 'object'\n ? o instanceof HTMLElement //DOM2\n : o &&\n typeof o === 'object' &&\n o !== null &&\n o.nodeType === 1 &&\n typeof o.nodeName === 'string';\n}", "function assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}", "function assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}", "function assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}", "function assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}", "function assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}", "function assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}", "function assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}", "function doesElementExist(selector) {\n const el = netSummaryItem.shadowRoot.querySelector(selector);\n return (el !== null) && (el.style.display !== 'none');\n }", "function isElement(o) {\n return !!o && o.nodeType === 1;\n}", "validateNoProductImagePlaceholder() {\n return this\n .waitForElementVisible('@noProductImagePlaceholder')\n .assert.visible('@noProductImagePlaceholder', 'No Product Image placeholder displayed');\n }", "_isAttachedToDOM() {\n const element = this._elementRef.nativeElement;\n if (element.getRootNode) {\n const rootNode = element.getRootNode();\n // If the element is inside the DOM the root node will be either the document\n // or the closest shadow root, otherwise it'll be the element itself.\n return rootNode && rootNode !== element;\n }\n // Otherwise fall back to checking if it's in the document. This doesn't account for\n // shadow DOM, however browser that support shadow DOM should support `getRootNode` as well.\n return document.documentElement.contains(element);\n }", "function isElement(o){\n return (\n typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName===\"string\"\n);\n}", "function detect(propName) {\n return Object.getOwnPropertyDescriptor(Element.prototype, propName) === undefined;\n }", "function is_dom_element(obj) {\n return !!(obj && obj.nodeType === 1);\n}", "function setup (elem, state) {\n elem.$attribute('story', story => state.story = story)\n}", "function SimpleTest_testDocumentAndWindowExists() {\n this.assertTrue(\"Window object exists\", 'undefined' != typeof(window) && null != window);\n this.assertTrue(\"Document Object exists\", 'undefined' != typeof(document) && null != document);\n this.assertTrue(\"Node type exists\", 'undefined' != typeof(node) && null != node);\n}", "function isElement(o){\n return (\n typeof HTMLElement === 'object' ? o instanceof HTMLElement : // DOM2\n o && typeof o === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName==='string'\n )\n}", "isValidElement() {\n return !!this.getAdUrl();\n }", "function isElement(o){\n return (\n typeof HTMLElement === \"function\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName===\"string\"\n );\n }", "function isElement(node) {\n var OwnElement = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "function isElement(node) {\n var OwnElement = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "function isElement(node) {\n var OwnElement = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "function isElement(node) {\n var OwnElement = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "function isElement(node) {\n var OwnElement = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}", "function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n}", "static get is() {\n return 'dom-if';\n }", "static isJsxElement(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.JsxElement;\r\n }", "function isElement(o) {\n return (typeof HTMLElement === \"object\" ? o instanceof HTMLElement : o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName === \"string\");\n}", "verifyUserIsAbleToSeeJobsBlog(){\n let jobsBlog = utils.byLocator(jobsPageLocator.jobsPage.jobsBlog);\n utils.verifyTheElementIsDisplayed(jobsBlog);\n }", "function isElement(o) {\n return (typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName === \"string\");\n }", "hasDOMNode(editor, target) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var {\n editable = false\n } = options;\n var editorEl = ReactEditor.toDOMNode(editor, editor);\n var targetEl; // COMPAT: In Firefox, reading `target.nodeType` will throw an error if\n // target is originating from an internal \"restricted\" element (e.g. a\n // stepper arrow on a number input). (2018/05/04)\n // https://github.com/ianstormtaylor/slate/issues/1819\n\n try {\n targetEl = isDOMElement(target) ? target : target.parentElement;\n } catch (err) {\n if (!err.message.includes('Permission denied to access property \"nodeType\"')) {\n throw err;\n }\n }\n\n if (!targetEl) {\n return false;\n }\n\n return targetEl.closest(\"[data-slate-editor]\") === editorEl && (!editable || targetEl.isContentEditable || !!targetEl.getAttribute('data-slate-zero-width'));\n }", "hasDOMNode(editor, target) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var {\n editable = false\n } = options;\n var editorEl = ReactEditor.toDOMNode(editor, editor);\n var targetEl; // COMPAT: In Firefox, reading `target.nodeType` will throw an error if\n // target is originating from an internal \"restricted\" element (e.g. a\n // stepper arrow on a number input). (2018/05/04)\n // https://github.com/ianstormtaylor/slate/issues/1819\n\n try {\n targetEl = isDOMElement(target) ? target : target.parentElement;\n } catch (err) {\n if (!err.message.includes('Permission denied to access property \"nodeType\"')) {\n throw err;\n }\n }\n\n if (!targetEl) {\n return false;\n }\n\n return targetEl.closest(\"[data-slate-editor]\") === editorEl && (!editable || targetEl.isContentEditable || !!targetEl.getAttribute('data-slate-zero-width'));\n }", "function isElement(o){\n\t\t\treturn (typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n\t\t\t\to && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName===\"string\")\n\t\t}", "function isElement(o) {\n return (\n typeof HTMLElement === 'object' ? o instanceof HTMLElement : //DOM2\n o && typeof o === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName === 'string'\n );\n }", "function checkIfinFrame(element){\n\tif(element.ownerDocument !== document) {\n\t\t//return element.ownerDocument\n\t\treturn \"someiframe\" //For Testing\n\t}else{\n\t\treturn ''\n\t}\n}", "function isElement( o ) {\n return (\n typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName === \"string\"\n );\n }", "function isElement(o) {\n return (\n typeof HTMLElement === \"object\" ? o instanceof HTMLElement :\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName === \"string\"\n );\n }", "function isElement(o) {\n return (\n typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName === \"string\"\n );\n }", "function isElement(o) {\n return (\n typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName === \"string\"\n );\n }", "function isElement(o) {\n return (\n typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName === \"string\"\n );\n }", "function isElement(obj) {\n return obj instanceof selection || typeof HTMLElement === 'object'\n ? obj instanceof HTMLElement // DOM2\n : obj && typeof obj === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string';\n }", "function isStable($el) {\n return typeof $el.attr('name') != 'undefined';\n}", "function isElement (o) {\n return (\n typeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n o && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName===\"string\"\n );\n }", "function isElement(o){\n\t\t\treturn (\n\t\t\t\ttypeof HTMLElement === \"object\" ? o instanceof HTMLElement : //DOM2\n\t\t\t\to && typeof o === \"object\" && o !== null && o.nodeType === 1 && typeof o.nodeName===\"string\"\n\t\t\t);\n\t\t}" ]
[ "0.61298835", "0.61298835", "0.61205226", "0.61205226", "0.60724515", "0.5960004", "0.5713902", "0.57050514", "0.5687601", "0.56861067", "0.567351", "0.5665304", "0.5644558", "0.5642582", "0.5637174", "0.55661213", "0.5520047", "0.5512397", "0.5487254", "0.5466414", "0.5460662", "0.54573804", "0.5443412", "0.5443376", "0.5421999", "0.54183435", "0.54183435", "0.54068416", "0.5405557", "0.5405557", "0.5405557", "0.5405557", "0.5405557", "0.5381429", "0.5381429", "0.5381429", "0.5364967", "0.5360776", "0.5360776", "0.5359016", "0.5311215", "0.5311215", "0.5311215", "0.5311215", "0.5311215", "0.5305182", "0.5305182", "0.5305182", "0.5305182", "0.5305182", "0.5305182", "0.5305182", "0.5305182", "0.5305182", "0.5292631", "0.52860355", "0.52535176", "0.5247094", "0.5247094", "0.5247094", "0.5247094", "0.5247094", "0.5247094", "0.52465934", "0.5226242", "0.52172613", "0.5216947", "0.5213325", "0.5203341", "0.5192637", "0.5187724", "0.5187031", "0.5186214", "0.51417685", "0.51402915", "0.51348865", "0.51348865", "0.51348865", "0.51348865", "0.51348865", "0.5129643", "0.5128928", "0.51230353", "0.51175517", "0.5114584", "0.5111988", "0.5108964", "0.5108964", "0.5091867", "0.5091326", "0.5089244", "0.50695264", "0.50589806", "0.5051377", "0.5051377", "0.5051377", "0.5047346", "0.50457984", "0.5039184", "0.5034888" ]
0.63711554
0
endregion Generates Jest a11y tests for all stories in a module Note: `colorcontrast` rule is NOT checked, and it is not likely to be fixed soon. Verify it is/isn't checked with a `console.log(results)` below
async function generateA11yStoryTests(storyModule) { var _storyModule$default$, _storyModule$default$2; const storiesTargetElement = (_storyModule$default$ = storyModule.default.parameters) === null || _storyModule$default$ === void 0 ? void 0 : (_storyModule$default$2 = _storyModule$default$.a11y) === null || _storyModule$default$2 === void 0 ? void 0 : _storyModule$default$2.element; Object.entries(storyModule).filter(isA11yStoryEntry).forEach(([storyName, story]) => { it(`${storyName} story is accessible`, async () => { var _story$parameters$a, _story$parameters, _story$parameters$a2, _baseElement$querySel; const targetElement = (_story$parameters$a = (_story$parameters = story.parameters) === null || _story$parameters === void 0 ? void 0 : (_story$parameters$a2 = _story$parameters.a11y) === null || _story$parameters$a2 === void 0 ? void 0 : _story$parameters$a2.element) !== null && _story$parameters$a !== void 0 ? _story$parameters$a : storiesTargetElement; const { baseElement, container } = (0, _render.renderStory)(story); const results = isValidTargetElement(targetElement) ? await axe((_baseElement$querySel = baseElement.querySelector(targetElement)) !== null && _baseElement$querySel !== void 0 ? _baseElement$querySel : baseElement) : await axe(container); expect(results).toHaveNoViolations(); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function runTests() {\n await fse.remove(\"cypress/report\");\n await cypress.run({\n spec: \"cypress/integration/**/*.spec.ts\",\n });\n const jsonReport = await merge({\n reportDir: \"cypress/report\",\n });\n await generator.create(jsonReport, {\n reportDir: \"cypress/report\",\n reportTitle: \"Bridge-X E2E All Test\",\n });\n await fse.writeJson(\"cypress/report/mochawesome-stat.json\", jsonReport, { spaces: 2 });\n}", "function jestTestsAndCoverage() {\n return gulp.src(SPEC_DIR)\n .pipe(jest(jestConfig));\n}", "function testAllTests() {\n testExtremal();\n testDifference();\n testSpearman();\n testSerial()\n}", "function runTest(test) {\n test.testOptions.screenCapture = './accessability-test/output/' + test.name +'.png'\n var options = { \n ...test.testOptions, \n standard: 'Section508'}; //standard: 'Section508'}; standard: 'WCAG2AAA'; \"WCAG2A\"; WCAG2AA}; \n pa11y(test.url, options).then((results) => {\n results.screenGrab = test.name + '.png';\n var htmlResults = accReporter.process(results, test.url, true);\n fs.writeFile('accessability-test/output/'+ test.name + '.html', htmlResults, function(err) {})\n }).catch((err) => {\n console.log(err);\n });\n}", "async runTests({tests} = {}) {\n const vizTargetRoot = document.getElementById('vizTargetRoot');\n\n for (const {screenshotOutputPath, testName, suiteName} of tests) {\n // This is to call out tests that may be 'hung', which is helpful for debugging\n const hungConsoleWarningTimeout = setTimeout(\n () => {\n console.log(`${suiteName}/${testName} being slow.`);\n },\n 5 * 1000\n );\n\n const target = vizTargetRoot.appendChild(document.createElement('div'));\n const {testRunner} = this.registeredTests.find((test) => test.testName === testName && test.suiteName === suiteName);\n const testInitializer = this.registeredTestInitializers[suiteName] || noop;\n const testFinalizer = this.registeredTestFinalizers[suiteName] || noop;\n\n // Run the test to render something to the viewport\n let screenshotTarget;\n\n try {\n await testInitializer();\n screenshotTarget = await testRunner(target);\n } catch (e) {\n console.error(`Error running test ${suiteName}/${testName}`, e);\n }\n\n if (!screenshotTarget) {\n throw new Error(`No screenshot target returned from test ${suiteName}/${testName}. Did you forget to 'return'?`);\n }\n\n let targetRect = screenshotTarget.getBoundingClientRect();\n\n // If the screenshot target has a parent, add the parent's padding to the clipping rectangle.\n if (screenshotTarget.parentElement && screenshotTarget.parentElement !== target) {\n const {\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = window.getComputedStyle(screenshotTarget.parentElement);\n\n const paddingTopPx = parseInt(paddingTop.replace('px', '')) || 0;\n const paddingRightPx = parseInt(paddingRight.replace('px', '') || 0);\n const paddingBottomPx = parseInt(paddingBottom.replace('px', '') || 0);\n const paddingLeftPx = parseInt(paddingLeft.replace('px', '') || 0);\n\n targetRect = {\n x: targetRect.x - paddingLeftPx,\n y: targetRect.y - paddingTopPx,\n width: targetRect.width + paddingLeftPx + paddingRightPx,\n height: targetRect.height + paddingTopPx + paddingBottomPx,\n };\n }\n\n await window.takeScreenshot({\n targetRect,\n screenshotOutputPath,\n });\n\n try {\n await testFinalizer(target);\n } catch (e) {\n console.error(`Error calling afterEach for test ${suiteName}/${testName}`, e);\n }\n\n vizTargetRoot.removeChild(target);\n\n await window.resetMouse();\n\n clearTimeout(hungConsoleWarningTimeout);\n }\n }", "function indexTests() {\n let startTestNum = startGameTests(); //testing the startGame function\n let callUnoTestNum = callUnoTests(); //testing the callUno function\n let cheatTestNum = cheatTests();\n console.log(\"\\n$ * * * * All tests for index.js * * * *\");\n console.log(\n \"$ Total tests for start() - 3. Passed: \" +\n startTestNum +\n \". Failed: \" +\n (3 - startTestNum)\n );\n console.log(\n \"$ Total tests for callUno() - 2. Passed: \" +\n callUnoTestNum +\n \". Failed: \" +\n (2 - callUnoTestNum)\n );\n console.log(\n \"$ Total tests for all cheats - 4. Passed: \" +\n cheatTestNum +\n \". Failed: \" +\n (4 - cheatTestNum)\n );\n console.log(\"\\n$ * * * * End tests for index.js * * * *\");\n return startTestNum + callUnoTestNum + cheatTestNum;\n}", "function testAccessibility2() {\n return pa11y(\"./build/index.html\").then((results) => { \n console.log(results);\n })\n}", "function testRunner() {\n\t var featureNames;\n\t var feature;\n\t var aliasIdx;\n\t var result;\n\t var nameIdx;\n\t var featureName;\n\t var featureNameSplit;\n\t for (var featureIdx in tests) {\n\t if (tests.hasOwnProperty(featureIdx)) {\n\t featureNames = [];\n\t feature = tests[featureIdx];\n\t // run the test, throw the return value into the Modernizr,\n\t // then based on that boolean, define an appropriate className\n\t // and push it into an array of classes we'll join later.\n\t //\n\t // If there is no name, it's an 'async' test that is run,\n\t // but not directly added to the object. That should\n\t // be done with a post-run addTest call.\n\t if (feature.name) {\n\t featureNames.push(feature.name.toLowerCase());\n\t if (feature.options && feature.options.aliases && feature.options.aliases.length) {\n\t // Add all the aliases into the names list\n\t for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n\t featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n\t }\n\t }\n\t }\n\t // Run the test, or use the raw value if it's not a function\n\t result = is(feature.fn, 'function') ? feature.fn() : feature.fn;\n\t // Set each of the names on the Modernizr object\n\t for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n\t featureName = featureNames[nameIdx];\n\t // Support dot properties as sub tests. We don't do checking to make sure\n\t // that the implied parent tests have been added. You must call them in\n\t // order (either in the test, or make the parent test a dependency).\n\t //\n\t // Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n\t // hashtag famous last words\n\t featureNameSplit = featureName.split('.');\n\t if (featureNameSplit.length === 1) {\n\t Modernizr[featureNameSplit[0]] = result;\n\t } else {\n\t // cast to a Boolean, if not one already\n\t if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n\t Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n\t }\n\t Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n\t }\n\t classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n\t }\n\t }\n\t }\n\t }", "function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n\n for (var featureIdx in tests) {\n if (tests.hasOwnProperty(featureIdx)) {\n featureNames = [];\n feature = tests[featureIdx]; // run the test, throw the return value into the Modernizr,\n // then based on that boolean, define an appropriate className\n // and push it into an array of classes we'll join later.\n //\n // If there is no name, it's an 'async' test that is run,\n // but not directly added to the object. That should\n // be done with a post-run addTest call.\n\n if (feature.name) {\n featureNames.push(feature.name.toLowerCase());\n\n if (feature.options && feature.options.aliases && feature.options.aliases.length) {\n // Add all the aliases into the names list\n for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n }\n }\n } // Run the test, or use the raw value if it's not a function\n\n\n result = is(feature.fn, 'function') ? feature.fn() : feature.fn; // Set each of the names on the Modernizr object\n\n for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n featureName = featureNames[nameIdx]; // Support dot properties as sub tests. We don't do checking to make sure\n // that the implied parent tests have been added. You must call them in\n // order (either in the test, or make the parent test a dependency).\n //\n // Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n // hashtag famous last words\n\n featureNameSplit = featureName.split('.');\n\n if (featureNameSplit.length === 1) {\n Modernizr[featureNameSplit[0]] = result;\n } else {\n // cast to a Boolean, if not one already\n if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n }\n\n classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n }\n }\n }\n }", "function runTests (port, build){\n\n describe('build tests', function() {\n this.timeout(20000);\n\n build();\n\n var browser = new Browser();\n\n before(function(d) {\n browser.visit('http://localhost:' + port, d);\n });\n\n\n // layout\n it('should show layout hbs content', function() {\n browser.assert.hasText('.layout', '[defaultLayout-hbs-output]');\n });\n\n\n\n // page\n it('should show index page hbs content', function() {\n browser.assert.hasText('.page', '[indexPage-hbs-output]');\n });\n\n\n\n // partial\n it('should show partial hbs content', function() {\n browser.assert.hasText('.partial', '[partial-hbs-output]');\n });\n\n it('should show partial json content', function() {\n browser.assert.hasText('.partial', '[partial-json-output]');\n });\n\n\n\n // first\n it('should show first hbs content', function() {\n browser.assert.hasText('.first', '[first-hbs-output]');\n });\n\n it('should show first js content', function() {\n browser.assert.hasText('.first', '[first-js-output]');\n });\n\n it('should show first json content', function() {\n browser.assert.hasText('.first', '[first-json-output]');\n });\n\n\n\n // second\n it('should show second hbs content', function() {\n browser.assert.hasText('.second', '[second-hbs-output]');\n });\n\n it('should show second js content', function() {\n browser.assert.hasText('.second', '[second-js-output]');\n });\n\n it('should show second dependency1 js content', function() {\n browser.assert.hasText('.second', '[someDependency1-js-output]');\n });\n\n it('should show second dependency2 js content', function() {\n browser.assert.hasText('.second', '[someDependency2-js-output]');\n });\n\n\n\n var lymCssBrowser = new Browser();\n\n before(function(d) {\n lymCssBrowser.visit('http://localhost:' + port+ '/css/lym.css', d);\n });\n\n it('should show first-settings css', function() {\n lymCssBrowser.assert.hasText('body', '.first-setting{color:red;}',true);\n });\n\n it('should show first-mixin css', function() {\n lymCssBrowser.assert.hasText('body', '.first-mixins{color:red;}',true);\n });\n\n it('should show second-mixin css', function() {\n lymCssBrowser.assert.hasText('body', '.second-mixins{color:orange;}',true);\n });\n\n it('should show second css', function() {\n lymCssBrowser.assert.hasText('body', '.second{color:green;}',true);\n });\n\n\n var firstBundleCssBrowser = new Browser();\n\n before(function(d) {\n firstBundleCssBrowser.visit('http://localhost:' + port+ '/css/first-bundle.css', d);\n });\n\n it('should show first css', function() {\n firstBundleCssBrowser.assert.hasText('body', '.first{color:red;}',true);\n });\n });\n}", "function testAll() {\n testAssert()\n testRemainder()\n testConversions()\n}", "function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n\n for (var featureIdx in tests) {\n if (tests.hasOwnProperty(featureIdx)) {\n featureNames = [];\n feature = tests[featureIdx];\n // run the test, throw the return value into the Modernizr,\n // then based on that boolean, define an appropriate className\n // and push it into an array of classes we'll join later.\n //\n // If there is no name, it's an 'async' test that is run,\n // but not directly added to the object. That should\n // be done with a post-run addTest call.\n if (feature.name) {\n featureNames.push(feature.name.toLowerCase());\n\n if (feature.options && feature.options.aliases && feature.options.aliases.length) {\n // Add all the aliases into the names list\n for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n }\n }\n }\n\n // Run the test, or use the raw value if it's not a function\n result = is(feature.fn, 'function') ? feature.fn() : feature.fn;\n\n\n // Set each of the names on the Modernizr object\n for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n featureName = featureNames[nameIdx];\n // Support dot properties as sub tests. We don't do checking to make sure\n // that the implied parent tests have been added. You must call them in\n // order (either in the test, or make the parent test a dependency).\n //\n // Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n // hashtag famous last words\n featureNameSplit = featureName.split('.');\n\n if (featureNameSplit.length === 1) {\n Modernizr[featureNameSplit[0]] = result;\n } else {\n // cast to a Boolean, if not one already\n /* jshint -W053 */\n if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n }\n\n classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n }\n }\n }\n }", "function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n\n for (var featureIdx in tests) {\n if (tests.hasOwnProperty(featureIdx)) {\n featureNames = [];\n feature = tests[featureIdx];\n // run the test, throw the return value into the Modernizr,\n // then based on that boolean, define an appropriate className\n // and push it into an array of classes we'll join later.\n //\n // If there is no name, it's an 'async' test that is run,\n // but not directly added to the object. That should\n // be done with a post-run addTest call.\n if (feature.name) {\n featureNames.push(feature.name.toLowerCase());\n\n if (feature.options && feature.options.aliases && feature.options.aliases.length) {\n // Add all the aliases into the names list\n for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n }\n }\n }\n\n // Run the test, or use the raw value if it's not a function\n result = is(feature.fn, 'function') ? feature.fn() : feature.fn;\n\n\n // Set each of the names on the Modernizr object\n for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n featureName = featureNames[nameIdx];\n // Support dot properties as sub tests. We don't do checking to make sure\n // that the implied parent tests have been added. You must call them in\n // order (either in the test, or make the parent test a dependency).\n //\n // Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n // hashtag famous last words\n featureNameSplit = featureName.split('.');\n\n if (featureNameSplit.length === 1) {\n Modernizr[featureNameSplit[0]] = result;\n } else {\n // cast to a Boolean, if not one already\n /* jshint -W053 */\n if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n }\n\n classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n }\n }\n }\n }", "function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n\n for (var featureIdx in tests) {\n if (tests.hasOwnProperty(featureIdx)) {\n featureNames = [];\n feature = tests[featureIdx];\n // run the test, throw the return value into the Modernizr,\n // then based on that boolean, define an appropriate className\n // and push it into an array of classes we'll join later.\n //\n // If there is no name, it's an 'async' test that is run,\n // but not directly added to the object. That should\n // be done with a post-run addTest call.\n if (feature.name) {\n featureNames.push(feature.name.toLowerCase());\n\n if (feature.options && feature.options.aliases && feature.options.aliases.length) {\n // Add all the aliases into the names list\n for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n }\n }\n }\n\n // Run the test, or use the raw value if it's not a function\n result = is(feature.fn, 'function') ? feature.fn() : feature.fn;\n\n\n // Set each of the names on the Modernizr object\n for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n featureName = featureNames[nameIdx];\n // Support dot properties as sub tests. We don't do checking to make sure\n // that the implied parent tests have been added. You must call them in\n // order (either in the test, or make the parent test a dependency).\n //\n // Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n // hashtag famous last words\n featureNameSplit = featureName.split('.');\n\n if (featureNameSplit.length === 1) {\n Modernizr[featureNameSplit[0]] = result;\n } else {\n // cast to a Boolean, if not one already\n /* jshint -W053 */\n if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n }\n\n classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n }\n }\n }\n }", "function startAllTests(){ \n testGetObjectFromArrays();\n testNormalizeHeader();\n testFillInTemplateFromObject();\n testIsCellEmpty();\n testIsAlnum();\n testIsDigit();\n}", "test () {\n let coloring = new Coloring(4);\n /* Create following graph and test whether it is\n 3 colorable\n (3)---(2)\n | / |\n | / |\n | / |\n (0)---(1)\n */\n let graph = [[0, 1, 1, 1],\n [1, 0, 1, 0],\n [1, 1, 0, 1],\n [1, 0, 1, 0]];\n let m = 3; // Number of colors\n this.graphColoring(graph, m);\n }", "function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n\n for (var featureIdx in tests) {\n featureNames = [];\n feature = tests[featureIdx];\n // run the test, throw the return value into the Modernizr,\n // then based on that boolean, define an appropriate className\n // and push it into an array of classes we'll join later.\n //\n // If there is no name, it's an 'async' test that is run,\n // but not directly added to the object. That should\n // be done with a post-run addTest call.\n if (feature.name) {\n featureNames.push(feature.name.toLowerCase());\n\n if (feature.options && feature.options.aliases && feature.options.aliases.length) {\n // Add all the aliases into the names list\n for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n }\n }\n }\n\n // Run the test, or use the raw value if it's not a function\n result = is(feature.fn, 'function') ? feature.fn() : feature.fn;\n\n\n // Set each of the names on the Modernizr object\n for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n featureName = featureNames[nameIdx];\n // Support dot properties as sub tests. We don't do checking to make sure\n // that the implied parent tests have been added. You must call them in\n // order (either in the test, or make the parent test a dependency).\n //\n // Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n // hashtag famous last words\n featureNameSplit = featureName.split('.');\n\n if (featureNameSplit.length === 1) {\n Modernizr[featureNameSplit[0]] = result;\n } else {\n // cast to a Boolean, if not one already\n /* jshint -W053 */\n if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n }\n\n classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n }\n }\n }", "function testRunner() {\n var featureNames;\n var feature;\n var aliasIdx;\n var result;\n var nameIdx;\n var featureName;\n var featureNameSplit;\n\n for (var featureIdx in tests) {\n featureNames = [];\n feature = tests[featureIdx];\n // run the test, throw the return value into the Modernizr,\n // then based on that boolean, define an appropriate className\n // and push it into an array of classes we'll join later.\n //\n // If there is no name, it's an 'async' test that is run,\n // but not directly added to the object. That should\n // be done with a post-run addTest call.\n if (feature.name) {\n featureNames.push(feature.name.toLowerCase());\n\n if (feature.options && feature.options.aliases && feature.options.aliases.length) {\n // Add all the aliases into the names list\n for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n }\n }\n }\n\n // Run the test, or use the raw value if it's not a function\n result = is(feature.fn, 'function') ? feature.fn() : feature.fn;\n\n\n // Set each of the names on the Modernizr object\n for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n featureName = featureNames[nameIdx];\n // Support dot properties as sub tests. We don't do checking to make sure\n // that the implied parent tests have been added. You must call them in\n // order (either in the test, or make the parent test a dependency).\n //\n // Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n // hashtag famous last words\n featureNameSplit = featureName.split('.');\n\n if (featureNameSplit.length === 1) {\n Modernizr[featureNameSplit[0]] = result;\n } else {\n // cast to a Boolean, if not one already\n /* jshint -W053 */\n if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n }\n\n Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n }\n\n classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n }\n }\n }", "function _runTest (index, basename, html) {\n const tests = [\n // preamble page\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // tests titlePage option\n _testToc(root, basename, 'Welcome');\n t.is(root.find('#_footnoteref_3').length, 1);\n t.is(root.find('#_footnotedef_3').length, 1);\n t.is(root.find('a.footnote').length, 1);\n t.is(root.find('div.footnote').length, 1);\n },\n // part I\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Part I');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap 1\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '1. First Chapter');\n t.is(root.find('#_footnoteref_4').length, 1);\n t.is(root.find('#_footnotedef_4').length, 1);\n t.is(root.find('a.footnote').length, 1);\n t.is(root.find('div.footnote').length, 1);\n },\n // chap 2\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '2. Second Chapter');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap2 sec1\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '2.1. Chap2. First Section');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap2 sec2 (depth:2)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '2.2. Chap2. Second Section');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap2 sec2-1 (depth:3)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '2.2.1. Chap2. Sec 2-1');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap2 sec2-1-1 (depth:4)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Chap2. Sec 2-1-1');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap2 sec2-1-2 (depth:4)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Chap2. Sec 2-1-2');\n t.is(root.find('#_footnoteref_4').length, 1);\n t.is(root.find('#_footnotedef_4').length, 1);\n t.is(root.find('a.footnote').length, 2); // multiply referred in Sec 2-1-2\n t.is(root.find('div.footnote').length, 1);\n },\n // chap2 sec2-2 (depth:3)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '2.2.2. Chap2. Sec 2-2');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap2 sec2-2-1 (depth:4)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Chap2. Sec 2-2-1');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap2 sec2-2-2 (depth:4)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Chap2. Sec 2-2-2');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap2 sec2-2-3 (depth:4)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Chap2. Sec 2-2-3<sup class=\"footnote\">[1]</sup>');\n t.is(root.find('#_footnoteref_1').length, 1);\n t.is(root.find('#_footnotedef_1').length, 1);\n t.is(root.find('a.footnote').length, 1);\n t.is(root.find('div.footnote').length, 1);\n },\n // chap2 sec2-3 (depth:3)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '2.2.3. Chap2. Sec 2-3');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap2 sec3 (depth:2)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '2.3. Chap2. Third Section');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // part II\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Part II');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap 3 (depth:1)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '3. Third Chapter<sup class=\"footnote\">[2]</sup>');\n t.is(root.find('#_footnoteref_2').length, 1);\n t.is(root.find('#_footnotedef_2').length, 1);\n t.is(root.find('a.footnote').length, 1);\n t.is(root.find('div.footnote').length, 1);\n },\n // chap3 sec1 (depth:2)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '3.1. Chap3. First Section');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap3 sec2 (depth:2)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '3.2. Chap3. Second Section');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap3 sec3 (depth:2)\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '3.3. Chap3. Third Section');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n ];\n if (tests[index])\n tests[index](basename, html);\n }", "async runTests() {\n for (let file of this.testFiles) {\n console.log(chalk.gray(`--- ${file.shortName}`));\n const beforeEaches = [];\n\n global.render = render;//jsdom\n\n global.beforeEach = (fn) => {\n beforeEaches.push(fn)\n };\n global.it = async (desc, fn) => {\n // console.log(desc);\n beforeEaches.forEach(func => func());\n //to handle errors ocurred during our test we need to do try and catch to avoid the test to collapse\n try {\n await fn();\n console.log(chalk.green(`\\tOK - ${desc}`));\n } catch (err) {\n const message = err.message.replace(/\\n/g, '\\n\\t\\t');\n console.log(chalk.red(`\\tX - ${desc}`));\n console.log(chalk.red('\\t', message));// \\t is tab \n }\n\n };\n //to skip the typo in stopping test for running\n try {\n require(file.name);//when we require the file inside a func node will find it and execute the file here\n } catch (err) {\n console.log(chalk.red('X - Error Loading File'), file.name);\n console.log(chalk.red(err));\n }\n\n }\n }", "runnerEnd(runner) {\n const specData = this.moduleName ? this.specHashData[this.moduleName] : this.specHashData;\n Object.values(specData).forEach((spec) => {\n const revSpecs = Object.values(spec);\n revSpecs.forEach((test, i) => {\n if (test.parent === test.title) {\n const { title, parent, ...rest } = revSpecs[i];\n revSpecs[i] = {\n title,\n spec: runner.specs[0],\n ...rest,\n };\n }\n if (test.parent !== test.title) {\n const parentIndex = revSpecs.findIndex(\n (item) => item.title === test.parent,\n );\n\n if (parentIndex > -1) {\n if (!revSpecs[parentIndex].suites) {\n revSpecs[parentIndex].suites = [];\n }\n revSpecs[parentIndex].suites.push(test);\n // eslint-disable-next-line no-param-reassign\n delete test.parent;\n }\n }\n // eslint-disable-next-line no-param-reassign\n delete test.parent;\n });\n if (this.moduleName) {\n const filePathLocation = path.join(\n this.resultsDir,\n `${this.fileName}.json`,\n );\n this.resultJsonObject.specs[this.moduleName] = revSpecs.shift();\n this.writToFile(this.resultJsonObject.specs[this.moduleName], filePathLocation);\n } else {\n this.nonMonoRepoResult.push(revSpecs.shift());\n }\n });\n if (!this.moduleName) {\n this.resultJsonObject.specs = this.nonMonoRepoResult;\n const filePathLocation = path.join(\n this.resultsDir,\n `${this.fileName}.json`,\n );\n this.writToFile(this.resultJsonObject, filePathLocation);\n }\n this.screenshots = [];\n this.specHashData = {};\n }", "function testRunner() {\n\t\tvar featureNames;\n\t\tvar feature;\n\t\tvar aliasIdx;\n\t\tvar result;\n\t\tvar nameIdx;\n\t\tvar featureName;\n\t\tvar featureNameSplit;\n\n\t\tfor (var featureIdx in tests) {\n\t\t\tif (tests.hasOwnProperty(featureIdx)) {\n\t\t\t\tfeatureNames = [];\n\t\t\t\tfeature = tests[featureIdx];\n\t\t\t\t// run the test, throw the return value into the Modernizr,\n\t\t\t\t// then based on that boolean, define an appropriate className\n\t\t\t\t// and push it into an array of classes we'll join later.\n\t\t\t\t//\n\t\t\t\t// If there is no name, it's an 'async' test that is run,\n\t\t\t\t// but not directly added to the object. That should\n\t\t\t\t// be done with a post-run addTest call.\n\t\t\t\tif (feature.name) {\n\t\t\t\t\tfeatureNames.push(feature.name.toLowerCase());\n\n\t\t\t\t\tif (feature.options && feature.options.aliases && feature.options.aliases.length) {\n\t\t\t\t\t\t// Add all the aliases into the names list\n\t\t\t\t\t\tfor (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {\n\t\t\t\t\t\t\tfeatureNames.push(feature.options.aliases[aliasIdx].toLowerCase());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Run the test, or use the raw value if it's not a function\n\t\t\t\tresult = is(feature.fn, 'function') ? feature.fn() : feature.fn;\n\n\n\t\t\t\t// Set each of the names on the Modernizr object\n\t\t\t\tfor (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {\n\t\t\t\t\tfeatureName = featureNames[nameIdx];\n\t\t\t\t\t// Support dot properties as sub tests. We don't do checking to make sure\n\t\t\t\t\t// that the implied parent tests have been added. You must call them in\n\t\t\t\t\t// order (either in the test, or make the parent test a dependency).\n\t\t\t\t\t//\n\t\t\t\t\t// Cap it to TWO to make the logic simple and because who needs that kind of subtesting\n\t\t\t\t\t// hashtag famous last words\n\t\t\t\t\tfeatureNameSplit = featureName.split('.');\n\n\t\t\t\t\tif (featureNameSplit.length === 1) {\n\t\t\t\t\t\tModernizr[featureNameSplit[0]] = result;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// cast to a Boolean, if not one already\n\t\t\t\t\t\t/* jshint -W053 */\n\t\t\t\t\t\tif (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {\n\t\t\t\t\t\t\tModernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tModernizr[featureNameSplit[0]][featureNameSplit[1]] = result;\n\t\t\t\t\t}\n\n\t\t\t\t\tclasses.push((result ? '' : 'no-') + featureNameSplit.join('-'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "async function runAllTests() {\n const files = [];\n const x = new Assert();\n x.blessEnabled = process.argv.findIndex(arg => arg === '--bless') !== -1;\n\n x.startTestSuite('all', false);\n print('> Starting all tests...');\n print('');\n\n fs.readdirSync(__dirname).forEach(function(file) {\n const fullPath = path.join(__dirname, file);\n if (file.endsWith('.js') && fs.lstatSync(fullPath).isFile()) {\n files.push(fullPath);\n }\n });\n files.sort();\n let tmp;\n for (let i = 0; i < files.length; ++i) {\n try {\n tmp = require(files[i]);\n if (tmp['check'] === undefined) {\n continue;\n }\n } catch (err) {\n print(`failed to load \\`${files[i]}\\`, ignoring it...`);\n }\n\n try {\n await tmp['check'](x);\n } catch (err) {\n x._incrError();\n print(`<== \\`${files[i]}\\` failed: ${err}\\n${err.stack}`);\n }\n print('');\n }\n\n print('');\n print(`< Ending ${x.getTotalRanTests()} ${plural('test', x.getTotalRanTests())} with ` +\n `${x.getTotalErrors()} ${plural('error', x.getTotalErrors())}`);\n\n const errors = x.getTotalErrors();\n x.endTestSuite(false);\n return errors;\n}", "function generateTest() {\n // TODO\n}", "function GetTestability() {}", "function GetTestability() {}", "function GetTestability() {}", "describe() {\n console.log(`It is a ${this.flavor} cake with ${this.icing} icing and decorated with ${this.decoration}`)\n \n while (){\nlet count = 0\n if {\n console.log(`YUM! What a great slice of cake!`)\n } else {\n console.log(`No more cake for you, you've had enough!`)\n \n }\n }\n\n}", "function specReporter (results) {\n for (var i = 0; i < results.length; i++) {\n if (lastSection !== results[i].current) {\n lastSection = results[i].current;\n console.log(\"\\n\" + lastSection + \":\");\n }\n\n if (results[i].status === 'pass') {\n console.log(\" ✓ \" + color(results[i].message, \"green\"));\n } else {\n console.log(\" ✗ \" + color(results[i].message, \"yellow\"));\n console.log(\" » \" + color(\"expected \" + results[i].expected + \",\", \"yellow\"));\n console.log(\" \" + color(\"got \" + results[i].actual + \"(\" + results[i].operator + \")\", \"yellow\"));\n }\n }\n}", "async function main() {\n const g_tests = async (flag) => {\n let test_base;\n let prefix = '';\n switch (flag) {\n case 'm':\n test_base = test_base_general;\n prefix = 'test_';\n break;\n case 'a':\n test_base = test_base_audio;\n prefix = 'test_';\n break;\n case 's':\n case 'c':\n test_base = test_base_toc;\n break;\n }\n ;\n const retval = await get_tests(`${test_base}/index.json`, prefix);\n return retval;\n };\n const preamble_run_test = async (name) => {\n if (name[0] === 'm' || name[0] === 'a' || name[0] === 's' || name[0] === 'c') {\n const tests = await g_tests(name[0]);\n run_test(tests[name].url);\n }\n else {\n throw new Error('Abnormal test id...');\n }\n };\n try {\n if (process.argv && process.argv.length > 2) {\n if (process.argv[2] === '-sm' || process.argv[2] === '-sa') {\n const label = process.argv[2][2];\n const tests = await g_tests(label);\n const scores = generate_scores(tests);\n console.log(JSON.stringify(scores, null, 4));\n }\n else if (process.argv[2] === '-l') {\n // run a local test that is not registered in the official test suite\n run_test(process.argv[3]);\n }\n else {\n preamble_run_test(process.argv[2]);\n }\n }\n else {\n preamble_run_test('m4.01');\n }\n }\n catch (e) {\n console.log(`Something went very wrong: ${e.message}`);\n process.exit(1);\n }\n}", "function GetTestability(){}", "run(name, rule, testsReadonly) {\n const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${parser}`;\n const tests = Object.assign({}, testsReadonly);\n // standardize the valid tests as objects\n tests.valid = tests.valid.map(test => {\n if (typeof test === 'string') {\n return {\n code: test,\n };\n }\n return test;\n });\n tests.valid = tests.valid.map(test => {\n if (typeof test !== 'string') {\n if (test.parser === parser) {\n throw new Error(errorMessage);\n }\n if (!test.filename) {\n return Object.assign(Object.assign({}, test), { filename: this.getFilename(test.parserOptions) });\n }\n }\n return test;\n });\n tests.invalid = tests.invalid.map(test => {\n if (test.parser === parser) {\n throw new Error(errorMessage);\n }\n if (!test.filename) {\n return Object.assign(Object.assign({}, test), { filename: this.getFilename(test.parserOptions) });\n }\n return test;\n });\n super.run(name, rule, tests);\n }", "async function defineTests () {\n const examplesData = await loadExamplesData()\n describe('dt2js CLI integration test', function () {\n this.timeout(20000)\n examplesData.forEach(data => {\n context(`for file ${data.fpath}`, () => {\n data.names.forEach(typeName => {\n it(`should convert ${typeName}`, async () => {\n const schema = await dt2jsCLI(data.fpath, typeName)\n validateJsonSchema(schema)\n })\n })\n })\n })\n })\n}", "function color_test(content) {\n\n for (let i = 0; i < colors.length; ++i) {\n // let color = colors[i]\n console.log(choose_color(content, i), i)\n }\n\n var filepath_lineno = 'http://localhost:8080/t005_v-model/:35:29'\n var message = 'message'\n var obj = 'hello world'\n for (let i = 0; i < colors.length; ++i) {\n var fmt = `${normal('%s')}${black(' <')}${blue('%s')}${black('> :- ')}${blue('%s')}${choose_color('| log by dlog_iterable |', i)}${black(' = ↓\\n')}${choose_color('%s', i)}`\n // console.log(fmt, filepath_lineno, now_time(), message + `${type(obj)}`, obj)\n }\n}", "function build() {\n console.log(chalk.yellow('Test build output...'));\n\n let compiler = webpack(config);\n return new Promise((resolve, reject) => {\n compiler.run((err, stats) => {\n if (err) {\n console.log(err)\n\n return reject(err);\n }\n console.log(stats.toString({\n colors: true\n }))\n return resolve({\n stats\n });\n });\n });\n}", "parse (xmlString) {\n const obj = xmljs.xml2js(xmlString, { compact: true });\n const tests = [];\n // Python doesn't always have a top-level testsuites element.\n let testsuites = obj.testsuite;\n if (testsuites === undefined) {\n testsuites = obj.testsuites.testsuite;\n }\n if (testsuites === undefined) {\n return tests;\n }\n // If there is only one test suite, put it into an array to make it iterable.\n if (!Array.isArray(testsuites)) {\n testsuites = [testsuites];\n }\n for (const suite of testsuites) {\n // Ruby doesn't always have _attributes.\n let testsuiteName = suite._attributes ? suite._attributes.name : undefined;\n\n // Get rid of github.com/orgName/repoName/\n testsuiteName = this.trim(testsuiteName);\n\n let testcases = suite.testcase;\n // If there were no tests in the package, continue.\n if (testcases === undefined) {\n continue;\n }\n // If there is only one test case, put it into an array to make it iterable.\n if (!Array.isArray(testcases)) {\n testcases = [testcases];\n }\n\n for (const testcase of testcases) {\n // Ignore skipped tests. They didn't pass and they didn't fail.\n if (testcase.skipped !== undefined) {\n continue;\n }\n\n const failure = testcase.failure;\n const error = testcase.error;\n\n const okayMessage = (failure === undefined && error === undefined) ? 'ok' : 'not ok';\n let name = testcase._attributes.name;\n\n if (testsuiteName.length > 0) {\n name = testsuiteName + '/' + name;\n }\n\n const testCaseRun = new TestCaseRun(okayMessage, name);\n\n if (!testCaseRun.successful) {\n // Here we must have a failure or an error.\n let log = (failure === undefined) ? error._text : failure._text;\n // Java puts its test logs in a CDATA element.\n if (log === undefined) {\n log = failure._cdata;\n }\n\n testCaseRun.failureMessage = log;\n }\n\n tests.push(testCaseRun);\n }\n }\n return tests;\n }", "function testMatchColors(console) {\n $$.each([\n \"moose\",\n \"glial mice mouse\",\n \"fff\",\n \"#fff\",\n \"#fff0\",\n \"#fff000\",\n \"'#fff'\",\n \"\\\"#ffffff\\\"\",\n \"#fff #aaa #bbb #c0c\",\n \"#fff, #aaa, #bbb, #c0c\",\n \"[#fff, #aaa, #bbb, #c0c]\",\n \"['#fff', '#aaa', '#bbb', '#c0c']\",\n \"['#fff' '#aaa' '#bbb' '#c0c']\",\n \"tomato\",\n \"fuchsia indianred\",\n \"'fuchsia' \\\"indianred\\\"\",\n \"[DimGrey, 'fuchsia', \\\"indianred\\\"\"\n ], function(test) {\n console.log(test, \"=>\", matchColors(test));\n });\n}", "function _runTest (index, basename, html) {\n const tests = [\n // preamble page\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Titlepage');\n t.is(root.find('#_footnoteref_3').length, 1);\n t.is(root.find('#_footnotedef_3').length, 1);\n t.is(root.find('a.footnote').length, 1);\n t.is(root.find('div.footnote').length, 1);\n },\n // part I\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Part I');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap 1\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '1. First Chapter');\n t.is(root.find('#_footnoteref_4').length, 1);\n t.is(root.find('#_footnotedef_4').length, 1);\n t.is(root.find('a.footnote').length, 1);\n t.is(root.find('div.footnote').length, 1);\n },\n // chap 2\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '2. Second Chapter');\n t.is(root.find('#_footnoteref_1').length, 1);\n t.is(root.find('#_footnotedef_1').length, 1);\n t.is(root.find('#_footnoteref_4').length, 1);\n t.is(root.find('#_footnotedef_4').length, 1);\n t.is(root.find('a.footnote').length, 3); // multiply referred in Sec 2-1-2\n t.is(root.find('div.footnote').length, 2);\n },\n // part II\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, 'Part II');\n t.is(root.find('a.footnote').length, 0);\n t.is(root.find('div.footnote').length, 0);\n },\n // chap 3\n (basename, html) => {\n const root = Node.getInstanceFromHTML(html);\n // check toc\n _testToc(root, basename, '3. Third Chapter<sup class=\"footnote\">[2]</sup>');\n t.is(root.find('#_footnoteref_2').length, 1);\n t.is(root.find('#_footnotedef_2').length, 1);\n t.is(root.find('a.footnote').length, 1);\n t.is(root.find('div.footnote').length, 1);\n },\n ];\n if (tests[index])\n tests[index](basename, html);\n }", "async function get_tests(file_name, prefix) {\n const process_doc_tests = (doc_test) => {\n const base = `${file_name.split('/').slice(0, -1).join('/')}/`;\n doc_test.tests.forEach((section_tests) => {\n section_tests.tests.forEach((test) => {\n test.url = (test['media-type'] && test['media-type'] === 'text/html') ? `${base}${prefix}${test.id}.html` : `${base}${prefix}${test.id}.jsonld`;\n flattened_suite[`${test.id}`] = test;\n });\n });\n };\n const index_body = await discovery_1.fetch_json(file_name);\n const test_suite = JSON.parse(index_body);\n const flattened_suite = {};\n process_doc_tests(test_suite);\n return flattened_suite;\n}", "function GetTestability() { }", "function GetTestability() { }", "_run()\n {\n var info = this._getInfoFromPackageJson()\n\n if (Tester.is(this._output, 'function')) {\n this._output('################################################')\n this._output(info.label)\n this._output(info.labelDescription)\n this._output('################################################')\n }\n\n var start = new Date()\n\n // @todo Progress bar start.\n\n this._runTestMethods()\n\n // @todo Progress bar stop.\n\n var end = new Date()\n var time = end - start\n var formatTime = time > 1000 ? (time / 1000).toFixed(1) + ' seconds' : time + ' miliseconds'\n var memoryBytes = process.memoryUsage().heapTotal\n var trace = Tester.getBacktrace(new Error(), 3)\n\n this._resultsJson = {\n info: info,\n errors: this._errors,\n ok: this._ok,\n all: this._all,\n className: this.constructor.name,\n assertionsCounter: this._assertionsCounter,\n testsCounter: this._testsCounter,\n timeMiliseconds: time,\n formatTime: formatTime,\n memoryBytes: memoryBytes,\n formatMemory: Tester.formatBytes(memoryBytes),\n from: trace\n }\n\n if (Tester.is(this._output, 'function')) {\n var arr = this._showOk === true ? this._all : this._errors\n for (let value of arr) {\n if (this._colorize === true) {\n // reverse red\n value = value.replace(/^Error:/, '\\x1b[31m\\x1b[7mError:\\x1b[0m')\n // reverse\n value = value.replace(/^Ok:/, '\\x1b[7mOk:\\x1b[0m')\n }\n this._output(value)\n }\n\n var className = this.constructor.name + ':'\n\n this._output(className)\n this._output(' - tests ' + this._testsCounter)\n this._output(' - assertions ' + this._assertionsCounter)\n this._output(' - errors ' + this._errors.length)\n this._output(' - time ' + formatTime)\n this._output(' - memory ' + Tester.formatBytes(memoryBytes))\n this._output(' - from ' + trace)\n this._output('')\n }\n }", "function generateTestsForScenarios(suite) {\n\t\ttestScenarioDocuments.forEach(function (doc) {\n\t\t\tsuite[doc.label] = function () {\n\t\t\t\tvar visibleBefore;\n\t\t\t\tvar visibleAfter;\n\t\t\t\tvar hasScrolled;\n\n\t\t\t\treturn this.get('remote').findById(doc.id)\n\t\t\t\t\t.findByClassName('before')\n\t\t\t\t\t.getProperty('value').then(function (visible) {\n\t\t\t\t\t\tvisibleBefore = parseInt(visible, 10);\n\t\t\t\t\t})\n\t\t\t\t\t.end()\n\t\t\t\t\t.findByClassName('scrollBtn')\n\t\t\t\t\t.click()\n\t\t\t\t\t.end()\n\t\t\t\t\t.findByClassName('hasScrolled')\n\t\t\t\t\t.getProperty('value').then(function (scrolled) {\n\t\t\t\t\t\thasScrolled = parseInt(scrolled, 10);\n\t\t\t\t\t})\n\t\t\t\t\t.end()\n\t\t\t\t\t.findByClassName('after')\n\t\t\t\t\t.getProperty('value').then(function (visible) {\n\t\t\t\t\t\tvisibleAfter = parseInt(visible, 10);\n\t\t\t\t\t})\n\t\t\t\t\t.then(function () {\n\t\t\t\t\t\tif (hasScrolled) {\n\t\t\t\t\t\t\tassert.notOk(visibleBefore, 'scrolled, target should not be visible before');\n\t\t\t\t\t\t\tassert.ok(visibleAfter, 'scrolled, target should be visible after');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tassert.ok(visibleBefore, 'not scrolled, target should be visible before');\n\t\t\t\t\t\t\tassert.ok(visibleAfter, 'not scrolled, target should be visible after');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t};\n\t\t});\n\t}", "function AssertTests() {\n}", "function generateTestResultOutput(tests, baseIndent) {\n var indent = baseIndent || '';\n var output = '';\n var results;\n var suites;\n var line;\n\n if (tests) {\n if (tests.result) results = Object.keys(tests.result);\n if (tests.suites) suites = Object.keys(tests.suites);\n } else {\n return false;\n }\n\n if (results) {\n for (var i in results) {\n var result = tests.result[results[i]];\n if (config.verboseReporter.output === 'only-failure' && result !== 'failure') continue;\n\n line = result;\n\n if (config.verboseReporter.color === 'full') {\n line = [indent, '*', results[i], ':', result, '\\n'].join(' ');\n }\n\n switch (result) {\n case 'success':\n line = successFmt(line);\n break;\n case 'failure':\n line = failureFmt(line);\n break;\n case 'skipped':\n line = skipFmt(line);\n break;\n default:\n break;\n }\n\n if (config.verboseReporter.color !== 'full') {\n line = [indent, '*', results[i], ':', line, '\\n'].join(' ');\n }\n\n output += line;\n }\n }\n\n if (suites) {\n for (var j in suites) {\n var suiteStr = [indent, '-', chalk.bold(suites[j]), ':', '\\n'].join(' ');\n var testReport = generateTestResultOutput(tests.suites[suites[j]], ' ' + indent);\n\n if (testReport) {\n suiteStr += testReport;\n output += suiteStr;\n }\n }\n }\n\n return output;\n }", "function startDescribe(app) {\n let result = `describe('React VT Tests', () => {${newLine}`; \n result += `${oneSpace}let wrapper;${newLine}`; \n result += `${oneSpace}beforeEach(() => {${newLine}`; \n result += `${twoSpace}wrapper = mount(<${app} />);${newLine}`; \n result += `${oneSpace}});${doubleLine}`; \n return result; \n}", "function writeResults(aTestcases) {\n var tc = 0;\n var output = \"\"; //why initialize\n//document.domain = \"mcom.com\";\n//added by stummala to get suitename when running all suites...\n//for forms u can see this in /cgi-bin/forms2.cgi\n if (aTestcases[tc].filename == \"catt001.html\") {\n \t output = '<A NAME=\"dom-core\"><H1> DOM CORE/HTML </H1>';\n }\n else if (aTestcases[tc].filename == \"dhtml001.html\") {\n \t output = '<A NAME=\"dhtml\"><H1> DHTML </H1>';\n }\n else if (aTestcases[tc].filename == \"sc2p000.html\") {\n \t output = '<A NAME=\"domcss\"><H1> DOM CSS </H1>';\n }\n else if (aTestcases[tc].filename == \"areanode.html\") {\n \t output = '<A NAME=\"inhr\"><H1> INHERITANCE </H1>';\n }\n else if (aTestcases[tc].filename == \"are001.html\") {\n \t output = '<A NAME=\"javascript\"><H1> JAVASCRIPT </H1>';\n }\n \n // Writes Test Filename and Creates Table\n output = output + '<H3>' + aTestcases[tc].filename + '</H3>' + '<TABLE BORDER=1>\\n <TBODY>\\n';\n \n // Writes Header\n output = output + ' <TR><TD><B>Description</B></TD>\\n <TD><B>Pass</B></TD>\\n ' +\n '<TD><B>Bug Number</B></TD>\\n <TD><B>Actual Result</B></TD>';\n if (top.name != \"testWindow\") {\n\t output += '\\n <TD><B>Expected Result</B></TD>';\n }\n output +='\\n </TR>\\n';\n\n // Iterates through Tests writing the Test Result\n for (tc=0; tc < aTestcases.length; tc++) {\n failed = (!aTestcases[tc].result);\n\n output += (' <TR>\\n <TD' + ((failed)?' bgcolor=red style=\"color:white;\"':'') +'>' + aTestcases[tc].testcase );\n\n // Writes Bug number for Failed Tests\n if (failed) {\n output += ('\\n <TD bgcolor=red style=\"color:white;\">failed');\n output += ('\\n <TD bgcolor=red style=\"color:white;\">' + aTestcases[tc].bug);\n output += ('\\n <TD bgcolor=red style=\"color:white;\">' + aTestcases[tc].actual);\n } else {\n output += (\"\\n <TD colspan=2>passed\");\n output += ('\\n <TD>' + aTestcases[tc].actual);\n }\n if (top.name != \"testWindow\") {\n output += ('\\n <TD>' + aTestcases[tc].expected);\n }\n output += ('\\n </TR>\\n');\n }\n\n output = output + ' </TBODY>\\n</TABLE>\\n\\n';\n document.results.textarea.value = output;\n\n\n if (top.name == \"testWindow\") {\n// document.results.submit(); submit() moved to BODY, it's failing here\n }\n else {\n document.write(document.results.textarea.value);\n //dump(document.results.textarea.value);\n }\n}", "function runCoopReportingTest(testName, tests){\n tests.forEach( test => {\n coopCoepReportingTest(testName, ...test);\n });\n verifyRemainingReports();\n}", "function runAllTests() {\n var baseSpreadsheetTests = new BaseSpreadsheetTests();\n baseSpreadsheetTests.run();\n\n var masteryTrackerTests = new MasteryTrackerTests();\n masteryTrackerTests.run();\n\n var masteryDataTests = new MasteryDataTests();\n masteryDataTests.run();\n}", "async generateTests()\n {\n this.description = 'Basic Tests:';\n\n this.addTest(new Test('This is an example test. The first parameter is a description.', DescriptionTest));\n }", "function generate_scores(all_tests) {\n let retval = {};\n retval.$name = \"PubManifest\";\n retval.$description = \"Test implementation of the algorithm in Typescript.\";\n retval.$href = \"https://github.com/iherman/PubManifest/\";\n const keys = _.allKeys(all_tests);\n keys.forEach((key) => {\n retval[key] = true;\n });\n return retval;\n}", "function createCustom({ title, description, language }) {\n const indexStr = `\n export default function solution(A) {}\n\n export const tests = [\n // {title: '', args: [], expects: true},\n // MAKE SURE YOU TEST EXTREMES\n ];\n `;\n\n const testStr = `\n import solution, {tests} from './index';\n\n describe(\\'${title}\\', () => {\n tests.forEach((test, ind) =>\n it(\\`${ind + 1}): ${test.title}\\`, () => {\n const val = solution(test.args);\n expect(val).toEqual(test.expects);\n }),\n );\n })\n `;\n\n const readmeStr = `# ${title}\n\n ${description}\n `;\n const dir = `${process.cwd()}/${language}/Miscellaneous-Challenges/${slugify(\n title,\n )}`;\n\n const index = `${dir}/index.ts`;\n const test = `${dir}/index.test.ts`;\n const readme = `${dir}/readme.md`;\n\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir);\n fs.writeFileSync(index, indexStr);\n fs.writeFileSync(test, testStr);\n fs.writeFileSync(readme, readmeStr);\n }\n}", "static getAllTests() {\n return [\n CalculatorTest.test01,\n CalculatorTest.test02,\n CalculatorTest.test03,\n CalculatorTest.test04,\n CalculatorTest.test05,\n CalculatorTest.test06,\n CalculatorTest.test07,\n CalculatorTest.test08,\n CalculatorTest.test09\n ];\n }", "function render(niceDate, all) {\n let html = `<h1>REST test run ${niceDate.replace(/_/g, ' ')}</h1>`;\n for (let t of all) {\n let failedOn, badError = t.error && !t.error.includes('AssertionError');\n for (let i in t) {\n if (i === 'error') { continue; }\n if (i === 'name') {\n let runs = all.filter(x => x.name === t[i]);\n let runInfo = runs.length < 2 ? '' : ', run ' +\n (runs.indexOf(t) + 1) + '/' + runs.length;\n html += `<hr><h2>${t[i]}${runInfo}</h2>`;\n continue;\n }\n let h3 = i[0].toUpperCase() + i.slice(1);\n if (i === 'status' && failedOn) {\n failedOn = badError ? 'non-test (other code)' : ' ' + failedOn;\n t[i] += ` on ${badError ? '' : 'test'}` + failedOn\n }\n if (i === 'tests') {\n let l = t[i].length - (badError ? 1 : 0);\n if (l === 0 && !badError) { continue; }\n if (l === 1 && badError) { h3 = '0 tests'; }\n else if (l === 1) { h3 = '1 test' }\n else { h3 = l + ' tests' }\n let _class = 'passed';\n t[i] = t[i].map((x, i) => {\n x[0] === '*' && (_class = 'failed');\n x[0] === '*' && (failedOn = i + 1);\n let r = `<pre class=\"a-test ${_class}\">${x.slice(x[0] === '*')}`\n + `${x[0] === '*' ? '<hr>' + t.error : ''}</pre>`\n x[0] === '*' && (_class = 'undone');\n return r;\n }).join('');\n }\n html += `\n <h3>${h3}</h3>\n ${i === 'tests' ? '' : `<pre class=\"${i} ${t[i]}\"\n >`}${t[i].substr ? t[i] : JSON.stringify(t[i], '', ' ')}${i === 'tests' ? '' : `</pre>`}\n `\n }\n }\n let div = document.createElement('div');\n let footer = document.createElement('footer');\n div.innerHTML = html;\n footer.innerHTML = `\n <a\n target=\"_blank\"\n href=\"${location.pathname.split('.html').join('.json')}\" \n class=\"json\"\n >Show test result as JSON</a>\n `;\n document.body.append(div);\n document.body.append(footer);\n}", "function runAnimationWorkletTests() {\n const testcases = Array.prototype.map.call(document.querySelectorAll('script[type$=worklet]'), ($el) => {\n return $el.textContent;\n });\n\n runTests(testcases);\n}", "function runTest () {\n execSync('yarn test');\n}", "function formatSuite(testSuite, filename) {\n var suiteClass = /^(\\w+)/.exec(filename)[1];\n suiteClass = suiteClass[0].toUpperCase() + suiteClass.substring(1);\n\n var formattedSuite = indents(0) + \"var \" + suiteClass + \" = { 'tests' : {}};\\n\";\n\n for (var i = 0; i < testSuite.tests.length; ++i) {\n var testClass = testSuite.tests[i].getTitle();\n formattedSuite += suiteClass + \".tests['\" + testClass + \"'] = require('./\" + testClass + \".js');\\n\";\n }\n\n formattedSuite += \"\\n\"\n + indents(0) + suiteClass + \".run = function \" + suiteClass + \"_run() {\\n\"\n + indents(1) + \"var webdriver = require('selenium-webdriver');\\n\"\n + indents(1) + \"\\n\"\n + indents(1) + \"var driver = new webdriver.Builder().\\n\"\n + indents(2) + \"withCapabilities(webdriver.Capabilities.firefox()).\\n\"\n + indents(2) + \"build();\\n\"\n + indents(1) + 'var baseUrl = \"\";\\n'\n + indents(1) + \"var acceptNextAlert = true;\\n\"\n + indents(1) + \"var verificationErrors = [];\\n\"\n + indents(1) + \"\\n\"\n + indents(1) + \"Object.keys(\" + suiteClass + \".tests).forEach(function (v,k,a) {\\n\"\n + indents(2) + suiteClass + \".tests[v](webdriver, driver, baseUrl, acceptNextAlert, verificationErrors);\\n\"\n + indents(1) + \"});\\n\"\n + indents(0) + \"}\\n\"\n + indents(1) + \"\\n\"\n + indents(0) + \"module.exports = \" + suiteClass + \";\\n\"\n + indents(0) + \"//\" + suiteClass + \".run();\";\n\n return formattedSuite;\n}", "function compileTest(options) {\n const funcs = Object.keys(options).map((key) => {\n const value = options[key];\n return Object.prototype.hasOwnProperty.call(Checks, key)\n ? Checks[key](value)\n : getAttribCheck(key, value);\n });\n return funcs.length === 0 ? null : funcs.reduce(combineFuncs);\n}", "function run_all_tests(){\n\t$(\"#tests_list .section_title\").each(function(num,obj){\n\t\ttype=obj.id.substr(8);\n\t\trun_tests(type);\n\t});\n}", "function generateTree_TestCase(root, _testCase, YAHOO) {\r\n\ttry{\r\n\t\tvar testCaseName = _testCase[\"name\"];\r\n\t\tvar nodeTestCase = new YAHOO.widget.TextNode(testCaseName, root, false);\r\n\t\tfor(var propName in _testCase) {\r\n\t\t\t//ignore property _should \r\n\t\t\tif((propName != '_should') && (propName.indexOf('should') >= 0)){\r\n\t\t\t\t// add each test into tree by looking for the friendly name\r\n\t\t\t\tvar nodeTest = new YAHOO.widget.TextNode(propName, nodeTestCase, true);\r\n\t\t\t\t// The default status of the test node is set to checked\r\n\t\t\t\tnodeTest.highlightState = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// The default status of the testcase node is set to checked\r\n\t\tnodeTestCase.highlightState = 1;\r\n\t}\r\n\tcatch(err){\r\n\t\talert(err);\r\n\t}\r\n}", "function reportResults() {\n console.log(\"\\n\\n|---------------- RESULTS ---------------|\");\n var prettyTable = [];\n var plainText = '';\n for (var t in mTests) {\n var reportingTest = mTests[t];\n if (reportingTest.mResult == 'pass'){\n prettyTable.push([chalk.yellow(reportingTest.mName) + \": \\t\\t\", chalk.green.bold(reportingTest.mResult)]);\n }else{\n prettyTable.push([chalk.yellow(reportingTest.mName) + \": \\t\\t\", chalk.red.bold(reportingTest.mResult)]);\n }\n plainText += reportingTest.mName + \": \\t\\t\" + reportingTest.mResult + \"\\n\";\n\n for (var i in reportingTest.mInstructions) {\n var reportingInstruction = reportingTest.mInstructions[i];\n\n plainText += '\\t' + \"- \" + reportingInstruction.name + '\\t\\t' + reportingInstruction.result + '\\n';\n if (reportingInstruction.result == 'pass')\n prettyTable.push(['\\t' + \"- \" + reportingInstruction.name, chalk.green(reportingInstruction.result)]);\n else\n prettyTable.push(['\\t' + \"- \" + reportingInstruction.name, chalk.red(reportingInstruction.result)]);\n }\n }\n\n // console.log(plainText);\n\n fs.writeFileSync('./logs/test-results'+Date.now()+'.log', plainText, 'utf8');\n\n console.log(table(prettyTable));\n console.log(\"Exiting...\");\n process.exit();\n }", "function createModule() { // Revealing Module Pattern with execution context passed in arguments\r\n var init = function() {\r\n // -------- add pass through JS here (follows execution order of page)\r\n \r\n \r\n // --------\r\n $(function() {\r\n // add DOM ready init code here\r\n\r\n });\r\n \r\n }(); // self invoking\r\n \r\n function getComponents() {\r\n var componentNames = [],\r\n components = $(\"*[data-component-name]\");\r\n\r\n $(components).each(function(i) {\r\n componentNames.push($(this).attr(\"data-component-name\"));\r\n });\r\n \r\n return componentNames;\r\n } // end getComponents()\r\n \r\n function writeUITests() {\r\n /*\r\n * Use this chassis.debug.writeUITests() in Firebug to create component\r\n * tests when markup, and CSS is complete\r\n * add output to tests.js\r\n */\r\n \r\n var components = $(\"*[data-component-name]\"),\r\n componentsLength = $(components).length,\r\n pageContext = $(\"#container\").attr(\"class\").split(\" \"),\r\n pageName = pageContext[3],\r\n testStartStr = '',\r\n testBodyStr = '',\r\n testEndStr = '',\r\n testStr = '';\r\n \r\n testStartStr += '/* ------------------------------------------\\n';\r\n testStartStr += ' PAGE : BEGIN '+pageName+' TEST CASES\\n';\r\n testStartStr += ' ------------------------------------------ */\\n';\r\n testStartStr += 'if (pageName == \"'+pageName+'\") { // PAGE NAME CHECK\\n';\r\n \r\n testBodyStr += '\\n';\r\n testBodyStr += 'module(\"Layouts\");';\r\n testBodyStr += '\\n';\r\n testBodyStr += writePageAndLayoutUITests()+'\\n';\r\n\r\n testBodyStr += 'module(\"Components\");';\r\n testBodyStr += '\\n';\r\n testBodyStr += writeComponentUITests();\r\n \r\n testEndStr += '\\n';\r\n testEndStr += '} // end if (pageName == \"'+pageName+'\")\\n';\r\n testEndStr += '\\n';\r\n testEndStr += '/* ------------------------------------------\\n';\r\n testEndStr += ' PAGE : END '+pageName+' TEST CASES\\n';\r\n testEndStr += ' ------------------------------------------ */\\n';\r\n \r\n testStr = testStartStr + testBodyStr + testEndStr;\r\n \r\n return testStr;\r\n } // end writeUITests()\r\n \r\n function writePageAndLayoutUITests() {\r\n /*\r\n * Use this chassis.debug.writePageAndLayoutUITests() in Firebug to create component\r\n * tests when markup, and CSS is complete\r\n * add output to tests.js\r\n */\r\n\r\n var pageContext = $(\"#container\").attr(\"class\").split(\" \"),\r\n layoutName = $(\"#wrapper\").attr(\"class\"),\r\n pageName = pageContext[3],\r\n testStartStr = '\\ntest(\"Page and Layout UI tests\", function() {\\n',\r\n testBodyStr = '',\r\n testEndStr = '});\\n',\r\n testStr = '';\r\n \r\n testBodyStr += ' equals(\"'+pageName+'\", \"'+pageName+'\", \"page name ('+pageName+') present\");\\n';\r\n testBodyStr += ' equals($(\"#wrapper\").attr(\"class\"), \"'+layoutName+'\", \"layout: '+layoutName+' present\");\\n';\r\n \r\n testStr = testStartStr + testBodyStr + testEndStr;\r\n \r\n return testStr;\r\n } // end writePageAndLayoutUITests\r\n \r\n function writeComponentUITests() {\r\n /*\r\n * Use this chassis.debug.writeComponentUITests() in Firebug to create component\r\n * tests when markup, and CSS is complete\r\n * add output to tests.js\r\n */\r\n var components = $(\"*[data-component-name]\"),\r\n testStartStr = '\\ntest(\"Component UI tests\", function() {\\n',\r\n testBodyStr = '',\r\n testEndStr = '});\\n',\r\n testStr = '';\r\n \r\n $(components).each(function(i) {\r\n \r\n var componentName = $(this).attr(\"data-component-name\"),\r\n components = $(\"*[data-component-name='\"+componentName +\"']\");\r\n \r\n if (testBodyStr.indexOf(componentName) == -1) { // only continue if componentName is not previously found\r\n \r\n if ($(components).length > 1) {\r\n $(components).each(function(i) {\r\n // if multiple components\r\n testBodyStr += ' ok($(\"*[data-component-name=\\''+ componentName +'\\']\")['+i+'],' +\r\n '\"Component: '+ componentName + ' (' + (i+1) + ') present\");\\n';\r\n });\r\n } else {\r\n // if single component\r\n testBodyStr += ' ok($(\"*[data-component-name=\\''+ componentName +'\\']\")[0],' +\r\n '\"Component: '+ componentName +' present\");\\n';\r\n } // end if ($(components).length > 1)\r\n \r\n } // end if (testBodyStr.indexOf(componentName) == -1)\r\n \r\n }); // $(components).each()\r\n \r\n testStr = testStartStr + testBodyStr + testEndStr;\r\n \r\n return testStr;\r\n } // end writeComponentUITests()\r\n \r\n function destroyOnUnload() { // Private method\r\n $(window).unload(function() {\r\n chassis.debug.destroy();\r\n });\r\n } // destroyOnUnload()\r\n\r\n var contract = { // add public methods / properties here (remove if not needed)\r\n getComponents : getComponents,\r\n writeUITests : writeUITests,\r\n writePageAndLayoutUITests : writePageAndLayoutUITests,\r\n writeComponentUITests : writeComponentUITests\r\n };\r\n\r\n // Public interface (properties and methods)\r\n return contract;\r\n\r\n } // end module", "async generateReportLoop() {\n while ( true ) { // eslint-disable-line no-constant-condition\n try {\n winston.info( 'Generating Report' );\n const testNameMap = {};\n this.snapshots.forEach( snapshot => snapshot.tests.forEach( test => {\n testNameMap[ test.nameString ] = test.names;\n } ) );\n const testNameStrings = _.sortBy( Object.keys( testNameMap ) );\n const testNames = testNameStrings.map( nameString => testNameMap[ nameString ] );\n\n const elapsedTimes = testNames.map( () => 0 );\n const numElapsedTimes = testNames.map( () => 0 );\n\n const snapshotSummaries = [];\n for ( const snapshot of this.snapshots.slice( 0, MAX_SNAPSHOTS ) ) {\n snapshotSummaries.push( {\n timestamp: snapshot.timestamp,\n shas: snapshot.shas,\n tests: testNames.map( ( names, i ) => {\n const test = snapshot.findTest( names );\n if ( test ) {\n const passedTestResults = test.results.filter( testResult => testResult.passed );\n const failedTestResults = test.results.filter( testResult => !testResult.passed );\n const failMessages = _.uniq( failedTestResults.map( testResult => testResult.message ).filter( _.identity ) );\n test.results.forEach( testResult => {\n if ( testResult.milliseconds ) {\n elapsedTimes[ i ] += testResult.milliseconds;\n numElapsedTimes[ i ]++;\n }\n } );\n\n const result = {\n y: passedTestResults.length,\n n: failedTestResults.length\n };\n if ( failMessages.length ) {\n result.m = failMessages;\n }\n return result;\n }\n else {\n return {};\n }\n } )\n } );\n await sleep( 0 ); // allow other async stuff to happen\n }\n\n const testAverageTimes = elapsedTimes.map( ( time, i ) => {\n if ( time === 0 ) {\n return time;\n }\n else {\n return time / numElapsedTimes[ i ];\n }\n } );\n const testWeights = [];\n for ( const names of testNames ) {\n const test = this.snapshots[ 0 ] && this.snapshots[ 0 ].findTest( names );\n if ( test ) {\n testWeights.push( Math.ceil( test.weight * 100 ) / 100 );\n }\n else {\n testWeights.push( 0 );\n }\n await sleep( 0 ); // allow other async stuff to happen\n }\n\n const report = {\n snapshots: snapshotSummaries,\n testNames: testNames,\n testAverageTimes: testAverageTimes,\n testWeights: testWeights\n };\n\n await sleep( 0 ); // allow other async stuff to happen\n\n this.reportJSON = JSON.stringify( report );\n }\n catch( e ) {\n this.setError( `report error: ${e}` );\n }\n\n await sleep( 5000 );\n }\n }", "async runTests () {\n this.installBchApi()\n utils.log('bch-api dependencies installed.')\n\n await this.runUnitTests()\n\n await this.runAbcIntegrationTests()\n\n await this.runBchnIntegrationTests()\n\n utils.log('bch-api tests complete.')\n utils.log(' ')\n }", "function doTest (err, label, tests) {\n if (err instanceof Error) {\n console.error (label +': \\033[1m\\033[31mERROR\\033[0m\\n');\n console.error (util.inspect (err, false, 10, true));\n console.log ();\n console.error (err.stack);\n console.log ();\n errors++;\n } else {\n var testErrors = [];\n tests.forEach (function (test) {\n if (test[1] !== true) {\n testErrors.push (test[0]);\n errors++;\n }\n });\n\n if (testErrors.length === 0) {\n console.log (label +': \\033[1m\\033[32mok\\033[0m');\n } else {\n console.error (label +': \\033[1m\\033[31mfailed\\033[0m ('+ testErrors.join (', ') +')');\n }\n }\n\n doNext ();\n}", "testAlbums() {\n this.albumTest.startAllTests();\n }", "function test_case(err, response) {\n\n\tif (err) {\n\t\tconsole.error(err);\n\t} else {\n assert.equal(response.headers['Content-Type'], 'text/json', 'content type is not text/json');\n assert.equal(response.statusCode, 200, 'status code must be 200');\n\n for (key in response.results) {\n kw = response.results[key];\n // at least 6 results\n assert.isAtLeast(kw.results.length, 6, 'results must have at least 6 links');\n assert.equal(kw.no_results, false, 'no results should be false');\n assert.typeOf(kw.num_results, 'string', 'num_results must be a string');\n assert.isAtLeast(kw.num_results.length, 5, 'num_results should be a string of at least 5 chars');\n assert.typeOf(Date.parse(kw.time), 'number', 'time should be a valid date');\n\n for (let res of kw.results) {\n assert.isOk(res.link, 'link must be ok');\n assert.typeOf(res.link, 'string', 'link must be string');\n assert.isAtLeast(res.link.length, 5, 'link must have at least 5 chars');\n\n assert.isOk(res.title, 'title must be ok');\n assert.typeOf(res.title, 'string', 'title must be string');\n assert.isAtLeast(res.title.length, 10, 'title must have at least 10 chars');\n\n assert.isOk(res.snippet, 'snippet must be ok');\n assert.typeOf(res.snippet, 'string', 'snippet must be string');\n assert.isAtLeast(res.snippet.length, 10, 'snippet must have at least 10 chars');\n }\n }\n\t}\n}", "function test_utilization_utilization_graphs() {}", "function writeTest(actions){\n actions.forEach(function (action) {\n console.log('expect(actions).to.contain(\"' + action + '\");');\n });\n console.log('expect(actions.length).to.equal(' + actions.length + ');');\n}", "function Harness ({\n reporter : base_reporter = reporters.noop,\n assertions : base_assertions = verisimilitude,\n}) {\n /* NOTE(jordan): configuration like { profile: true } might one day\n * exist, which would cause the sisyphus constructor to wrap the\n * base_reporter with reporter-composers for e.g. time profiling of\n * assertions and suites.\n */\n const reporter = base_reporter\n /* NOTE(jordan): context encapsulates all of the state maintained by\n * an instance of the sisyphus test harness: the suite function, the\n * test runner, any configuration, the intercepted set of messaging\n * assertions, the current reporter iterator... so on.\n */\n const Context = ({ depth, suite, definition }) => ᐅeffect(ᐅ([\n ᐅdo([ Assertions.create, set.value.mut(`assertions`) ]),\n ᐅdo([ TestRunner.create, set.value.mut(`run_test`) ]),\n ᐅdo([ Tests.create , set.value.mut(`tests`) ]),\n ]))({\n depth,\n reporter,\n definition,\n base_assertions,\n /* assign the reporter to be an interceptor ... */\n assign_reporter (target) {\n return intercept.set_reporter(this.reporter)(target)\n },\n /* recall the reporter from an assignment as an interceptor ... */\n recall_reporter (target) {\n return this.receive(intercept.release(target))\n },\n /* send messages to the reporter ... */\n send (message) {\n return this.receive(this.reporter(message))\n },\n /* receive the reporter and its report on a message ... */\n receive ([ reporter, report ]) {\n set.values.mut({ reporter })(this)\n return report\n },\n suite (description, definition) {\n return suite(description, definition, { depth: depth + 1 })\n },\n })\n /* NOTE(jordan): `suite` is how sets of tests are described and grouped.\n * A `suite` is purely organizational; it's functionally equivalent to\n * an `and` over all of its tests.\n */\n function suite (\n description,\n definition,\n {\n depth = 0,\n context = Context({ depth, suite, definition }),\n } = {},\n ) {\n const length = len(context.tests)\n context.send(intercept.Message({\n prefix : `sisyphus:suite`,\n type : `prerun`,\n payload : { depth, length, description },\n sender : context.suite,\n }))\n const result = map_indexed(context.run_test)(context.tests)\n context.send(intercept.Message({\n prefix : `sisyphus:suite`,\n type : `result`,\n payload : { depth, length, result, description },\n sender : context.suite,\n }))\n return result\n }\n /* NOTE(jordan): and that's it. All the magic that will happen, has\n * happened. Just return the suite builder and call it on a set of test\n * definitions, and you'll be all harnessed up and ready to rip.\n */\n return { suite }\n}", "function runTests() {\n\ttestBeepBoop();\n\ttestGetDigits();\n}", "function build_tests() {\r\n\t\tvar tests = new Collection(), version = \"Mon Dec 19 11:24:51 2011\";\r\n\r\n\t\t// check for existense of framework 2 files\r\n\t\tvar framework_file = test_presence.create_sub({\r\n\t\t\tid: \"framework-found\",\r\n\t\t\tname: \"The bm-framework.js file should be in the file manager\",\r\n\t\t\tdesc: \"The JavaScript framework 2.0 requires that the file bm-framework.js be loaded into the javascript folder in the file manager. You can get this file from the JavaScript Starter Kit. If this test is not passing, check that the sitename you entered on this page is correct, and also check the name of the case-sensitive 'javascript' folder.\",\r\n\t\t\tregex: /bootstrap/,\r\n\t\t\ttest_url: function() { return \"/bmfsweb/\"+templates.sitename+\"/image/javascript/bm-framework.js?break-cache\" },\r\n\t\t\tfix_url: function() { return \"/admin/filemanager/list_files.jsp\"; }\r\n\t\t});\r\n\t\ttests.add(framework_file);\r\n\r\n\t\ttests.add(\r\n\t\t\tframework_file.create_sub({\r\n\t\t\t\tid: \"framework-version\",\r\n\t\t\t\tregex: \"@version \"+version,\r\n\t\t\t\tname: \"bm-framework version (found in the comment at the top) should match \" + version,\r\n\t\t\t\tdesc: \"This test checks the time stamp on the version tag of the framework, and compares it to the latest release.<br/><br/>If this test raises a warning, confirm the @version stamp at the top of bm-framework is AFTER \" + version+\". <br/><br/>If the framework is out of date, download the latest version through the link at the top of the page.\",\r\n\t\t\t\twait_for: tests.find_by_ids(\"framework-found\")\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\ttests.add(\r\n\t\t\ttest_presence.create_sub({\r\n\t\t\t\tid: \"text-found\",\r\n\t\t\t\tname: \"The text.js file should be in the file manager\",\r\n\t\t\t\tdesc: \"The JavaScript framework 2.0 requires that the file text.js be loaded into the javascript folder in the file manager. You can get this file from the JavaScript Starter Kit. If this test is not passing, check that the sitename you entered on this page is correct, and also check the name of the case-sensitive 'javascript' folder.\",\r\n\t\t\t\tregex: /.*/,\r\n\t\t\t\ttest_url: function() { return \"/bmfsweb/\"+templates.sitename+\"/image/javascript/text.js?breach-cache\";},\r\n\t\t\t\tfix_url: function() { return \"/admin/filemanager/list_files.jsp\";}\r\n\t\t\t})\r\n\t\t);\r\n\r\n\r\n\t\t// defaults to the header/footer test - very straightforward\r\n\t\ttests.add(clone(test_absence));\r\n\r\n\t\ttests.add(\r\n\t\t\ttest_presence.create_sub({\r\n\t\t\t\tid: \"header-added\",\r\n\t\t\t\tname: \"Header/Footer should have a reference to bm-framework.js\",\r\n\t\t\t\tdesc: \"The framework 2.0 requires a script tag with reference to bm-framework.js: <br/> <code>&lt;script type='text/javascript' src='$BASE_PATH$/javascript/bm-framework.js' &gt;&lt;/script&gt;</code>\",\r\n\t\t\t\tregex: /bm-framework.js/\r\n\t\t\t})\r\n\t\t);\t\t\r\n\t\t\r\n\t\ttests.add(\r\n\t\t\ttest_absence.create_sub({\r\n\t\t\t\tid: \"nerfed\",\r\n\t\t\t\twarning_passes: false,\r\n\t\t\t\tname: \"The allplugins-require.js file should be replaced by the new version\",\r\n\t\t\t\tdesc: \"In 1.0, the file javascript/allplugins-require.js was the core of the framework. By replacing it with a dummy file, we are effectively disabling the old framework, without creating 404 errors on the server.<br/> If this test is failing, it means that we have detected the previous file in place.<br/> If you get a warning, it may mean that the file doesn't exist. This can be okay - just make sure that you remove all references to it in other places.\",\r\n\t\t\t\tregex: /define/,\r\n\t\t\t\ttest_url: function() { return \"/bmfsweb/\"+templates.sitename+\"/image/javascript/allplugins-require.js?break-cache\";},\r\n\t\t\t\tfix_url: function() { return \"/admin/filemanager/list_files.jsp\";}\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\t// homepage test - check the alt js for references\r\n\t\ttests.add(\r\n\t\t\ttest_absence.create_sub({\r\n\t\t\t\tid: \"homepage-remove\",\r\n\t\t\t\tname: \"The Home Page Alt JS file shouldn't have any references to allplugins-require.js (make sure you clear the cache)\",\r\n\t\t\t\tdesc: \"The references to allplugins-require.js need to be removed from the home page alternate JS file. This test fails when that old code is detected, and will show a warning if it can't find the file. In case of failure you can remove the entire function 'include_homepage_js', which is how the old code was loaded on the home page. As part of the upgrade, you will also be replacing this Alt JS file with a new piece of code. If you do remove this code, make sure that 'homepage' is marked as active in bm-framework.js.\",\r\n\t\t\t\twarning_passes: false,\r\n\t\t\t\ttest_url:function() { return \"/bmfsweb/\"+templates.sitename+\"/homepage/js/\"+templates.sitename+\"_Hp_Alt.js\";},\r\n\t\t\t\tfix_url:function() { return \"/admin/homepage/define_xsl_template.jsp\";}\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\t// homepage test - check the alt js for references\r\n\t\ttests.add(\r\n\t\t\ttest_presence.create_sub({\r\n\t\t\t\tid: \"homepage-param\",\r\n\t\t\t\tname: \"The Home Page Alt JS file should have a reference to bm-framework.js\",\r\n\t\t\t\tdesc: \"The JavaScript framework 2.0 uses an (optional) parameter to assist in identifying the home page. This file can be found in the JavaScript Start Kit; it is basically: <code>window['framework/homepage']=true</code>. If this test fails, it means that it found the Alt JS file, but no reference to the new code. A warning means it can't find the file.\",\r\n\t\t\t\twarning_passes: false,\r\n\t\t\t\tregex: /framework\\/homepage/,\r\n\t\t\t\twait_for: tests.find_by_ids(\"homepage-remove\"),\r\n\t\t\t\ttest_url:function() { return \"/bmfsweb/\"+templates.sitename+\"/homepage/js/\"+templates.sitename+\"_Hp_Alt.js\";},\r\n\t\t\t\tfix_url:function() { return \"/admin/homepage/define_xsl_template.jsp\";}\r\n\t\t\t})\r\n\t\t);\r\n\r\n\r\n\t\t// homepage test - check the homepage directly\r\n\t\ttests.add(\r\n\t\t\ttest_absence.create_sub({\r\n\t\t\t\tid: \"homepagedirect\",\r\n\t\t\t\tname: \"The Home Page shouldn't have any references to allplugins-require (will fail for comments)\",\r\n\t\t\t\tdesc: \"The home page may have some references to the old framework, that are outside of the alt js file. This could be from a customized Homepage XSL file, or more likely from a custom home page. If this test fails you will have to manually search for and remove these references.\",\r\n\t\t\t\twait_for: tests.find_by_ids(\"header\"),\r\n\t\t\t\ttest_url:function() { return \"/commerce/display_company_profile.jsp\";},\r\n\t\t\t\tfix_url:function() { return \"/commerce/display_company_profile.jsp\";},\r\n\t\t\t\twarning_passes: false\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\t// this one we need a refernce to later, so breaking the pattern a bit\r\n\t\tvar globalscript_test = test_absence.create_sub({\r\n\t\t\tid: \"gss-allplugin\",\r\n\t\t\tname: \"Global Script Search shouldn't have any matches for allplugins-require (will fail for comments)\",\r\n\t\t\tdesc: \"We are running a global script search for the term 'allplugins-require'. The test will fail if it finds any results. This can be used to identify any BML that is referencing the old framework directly. All these references should be removed. This will NOT show references from default values on config attributes. This will most likely only find one reference - in our BML Util Library 'require_javascript.'\",\r\n\t\t\twait_for: tests.find_by_ids(\"homepage-remove\", \"header\"),\r\n\t\t\ttest_url: function() { return \"/admin/scripts/search_script.jsp?formaction=searchBmScript&search_string=allplugins-require\";},\r\n\t\t\tfix_url:function() { return this.test_url(); },\r\n\t\t\tget_text: function() {\r\n\t\t\t\tvar defer = jq$.Deferred(), me = this;\r\n\t\t\t\tjq$.get(me.test_url(), {}, function(data) { \r\n\t\t\t\t\t//get rid of the first two... we put it there!\r\n\t\t\t\t\tdata = data.replace(me.regex, \"\");\r\n\t\t\t\t\tdata = data.replace(me.regex, \"\");\r\n\t\t\t\t\tdefer.resolve(data);\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn defer.promise();\r\n\t\t\t}\r\n\t\t});\r\n\t\ttests.add(globalscript_test);\r\n\r\n\t\t// global script test - for bml-util lib\r\n\r\n\t\ttests.add(\r\n\t\t\tglobalscript_test.create_sub({\r\n\t\t\t\tid: \"gss-bml\",\r\n\t\t\t\tname: \"Global Script Search shouldn't have any matches for require_javascript\",\r\n\t\t\t\tdesc: \"We are running a global script search for the term 'require_javascript'. The test will fail if it finds any results. This can be used to identify any BML that is referencing the now obsolete library that we used to load JavaScript in the Framework v1. These references should be removed, and the corresponding section activated in bm-framework.js.\",\r\n\t\t\t\twait_for: tests.find_by_ids(\"gss-allplugin\"),\r\n\t\t\t\tregex: /require_javascript/,\r\n\t\t\t\ttest_url: function() { return \"/admin/scripts/search_script.jsp?formaction=searchBmScript&search_string=require_javascript\";},\r\n\t\t\t\tfix_url: function() { return this.test_url();}\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\ttests.add(\r\n\t\t\ttest_absence.create_sub({\r\n\t\t\t\tid: \"start-configs\",\r\n\t\t\t\tname: \"Run this test again manually to begin the configuration tests.\",\r\n\t\t\t\tdesc: \"This test will run and fail the first time - you must manually run it in order to begin the configuration tests, which can be time intensive.\",\r\n\t\t\t\ttimes: 0,\r\n\t\t\t\trun: function() {\r\n\t\t\t\t\tif(this.times === 0) {\r\n\t\t\t\t\t\tthis.times += 1;\r\n\t\t\t\t\t\tthis.on_fail();\r\n\t\t\t\t\t\tthis.render();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.on_pass();\r\n\t\t\t\t\t\tthis.render();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\t// crawl the homepage, create a test for each configurator\r\n\t\ttests.add(\r\n\t\t\ttest_absence.create_sub({\r\n\t\t\t\tid: \"crawl\",\r\n\t\t\t\tname: \"Test configuration using homepage punchins... \",\r\n\t\t\t\tdesc: \"This test will crawl the home page for punchin urls, and then spin up a test for each one it finds. This is so that we can quickly crawl the configurators directly on the buyside, and identify which ones reference allplugins-require. Please note that this will only visit the first page of each configurator; it's possible that we will miss some references if they are buried deep within a configurator.\",\r\n\t\t\t\twait_for: tests.find_by_ids(\"homepage-remove\", \"header\", \"gss-allplugin\", \"gss-bml\", \"start-configs\"),\r\n\t\t\t\tregex: /require_javascript/,\r\n\t\t\t\ttest_url:function() { return \"/commerce/display_company_profile.jsp\";},\r\n\t\t\t\tfix_url:function() { return \"/commerce/display_company_profile.jsp\";},\r\n\t\t\t\t// this test spawns additional tests\r\n\t\t\t\trun: function() {\r\n\t\t\t\t\tvar me = this,\r\n\t\t\t\t\tdefer = jq$.Deferred(),\r\n\t\t\t\t\thome_str = jq$.ajax({\r\n\t\t\t\t\t\turl: me.test_url()\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tme.is_running = true;\r\n\t\t\t\t\thome_str.then(function(data) {\r\n\t\t\t\t\t\t// matches url for configurator punchins\r\n\t\t\t\t\t\tvar matches = data.match(/<a[^>]*?href=\"\\/commerce\\/new_equipment\\/.*?<\\/a>/g),\r\n\t\t\t\t\t\t\tcount = 0;\r\n\r\n\t\t\t\t\t\t_(matches).each(function(val) {\r\n\t\t\t\t\t\t\tvar label = val.match(/(>)(.*)(<)/)[2],\r\n\t\t\t\t\t\t\t\turl = val.match(/(\")(\\/commerce.*)(\")/)[2],\r\n\t\t\t\t\t\t\t\tid = eventify(\"bmjs-config-id-\" + count++),\r\n\t\t\t\t\t\t\t\ttest,\r\n\t\t\t\t\t\t\t\tdefer = jq$.Deferred(),\r\n\t\t\t\t\t\t\t\tdescription = \"This will scrape the first page of the configurator for references to allplugins-require, and fail if it finds any. This test was dynamically generated by scraping the home page for punchin URLs. If this test fails remove the references, then make sure config is active in the bm-framework.js file.\";\r\n\r\n\t\t\t\t\t\t\turl = url.replace(/&amp;/g, \"&\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttest = test_absence.create_sub({\r\n\t\t\t\t\t\t\t\tid: id,\r\n\t\t\t\t\t\t\t\tname: label + \" shouldn't have any references to allplugins-require.\",\r\n\t\t\t\t\t\t\t\tdesc: description,\r\n\t\t\t\t\t\t\t\ttest_url: function() { return url;},\r\n\t\t\t\t\t\t\t\tfix_url: function() { return url;},\r\n\t\t\t\t\t\t\t\twarning_passes: false\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\ttest.begin();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tme.on_pass();\r\n\t\t\t\t\t\tme.render();\r\n\t\t\t\t\t});\r\n\t\t\t\t\tme.render();\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\twindow.tests = tests;\r\n\t\treturn tests;\r\n\t}", "function generateTest(list, app, nodestr) {\n nodeStore = nodestr;\n stateNodes[app] = true; \n // If there are no asserts, return. \n // This should never happen if our frontend works correctly. \n if (list.length === 0) return; \n\n // With valid input, we can start building our result. \n // First, we start by adding all dependencies\n firstBlock = addDependencies(app);\n // Then we add our Describe syntax to begin our test \n let result = startDescribe(app);\n // Now we loop through and add each assertion block as an it statement \n list.forEach(item => {\n if (checkKeyPress(item)) result += addBlock(item); \n }); \n // After looping we close our describe function and are finished\n result += '});'\n return firstBlock + newLine + result; \n}", "function getColorsModules() {\n return [{\n // The module that recognizes colors\n name: \"Colors\",\n precedence: 1,\n kernel: function(value) {\n var colors = matchColors(value);\n if (colors == null) {\n return false;\n }\n // Construct some 'div's\n var ret = \"\",\n width = principal,\n height = principal;\n $$.each(colors, function(color, ix) {\n ret += makeSwatch(color, width, height) + \" \";\n });\n return ret;\n }\n },{\n // The module that recognizes color ranges\n name: \"ColorRanges\",\n precedence: 1,\n kernel: function(value) {\n var colors = matchColorRange(value);\n if (colors == null) {\n return false;\n }\n if (colors.length == 2) {\n // Construct a fade from one color to the other\n var ret = \"\",\n width = 2,\n height = principal,\n a = color2Rgb(colors[0]),\n b = color2Rgb(colors[1]),\n nSteps = 200;\n // Convert 'a' and 'b' to a common base\n var maxBase = Math.max(a.base, b.base);\n a = rgbScaleBase(a, maxBase);\n b = rgbScaleBase(b, maxBase);\n // Calculate a delta color\n var delta = {\n r: (b.r - a.r) / nSteps,\n g: (b.g - a.g) / nSteps,\n b: (b.b - a.b) / nSteps\n };\n ret += colors[0] + \"&nbsp;\";\n for (var i = 0; i <= nSteps; ++i) {\n var color = rgb2Hex({\n r: a.r + i * delta.r,\n g: a.g + i * delta.g,\n b: a.b + i * delta.b,\n base: maxBase\n });\n ret += '<div style=\"width: ' + width + 'px; height: ' + height + 'px; background-color: ' + color + '; '\n + 'display: inline-block; padding: 0px;\" '\n + 'onmouseover=\"rangeMouseOver(\\'' + color + '\\')\" '\n // + (i == 0 || i == nSteps ? 'onmouseout=\"$(\\'#rangeMouseOver\\').empty();\" ' : '')\n + '></div>';\n }\n ret += \"&nbsp;\" + colors[1]\n + '<br />'\n + '<div id=\"rangeMouseOver\"></div>';\n return ret;\n } else {\n return false;\n }\n }\n }];\n}", "validateColourSwatch() {\n this\n .waitForElementVisible('@colorSwatchIcon', 10000, () => {}, '[STEP] - Color Swatch should be displayed')\n .assert.containsText('@colorSwatchIcon', 'More Colours');\n }", "function runA11yChecks() {\n return axe.run(document, {\n runOnly: {\n type: 'rule',\n values: [\n 'aria-allowed-attr',\n 'aria-required-attr',\n 'aria-valid-attr',\n 'aria-valid-attr-value',\n 'color-contrast',\n 'image-alt',\n 'label',\n 'tabindex'\n ]\n }\n });\n}", "async function basicTesting() {\n console.log(chalk.white(\"INITIALIZING BASIC TESTING\"));\n await testAvailableBooks();\n await testTicker(\"btc_mxn\");\n await testGetTrades(\"btc_mxn\");\n await testOrders(\"eth_mxn\", \"buy\", \"1.0\", \"market\");\n await testOrders(\"eth_mxn\", \"sell\", \"1.0\", \"market\");\n await testWithdrawals(\"btc\", \"0.001\", \"15YB8xZ4GhHCHRZXvgmSFAzEiDosbkDyoo\");\n await testBalances();\n}", "function checkWhiteColor() {\n\t\t\tcp.countPixels([255, 255, 255], \n\t\t\t\twin, \n\t\t\t\tfunction(count) {\n\t\t\t\t\tvalueOf(testRun, count).shouldBe(win.rect.width*win.rect.height - expectedRed - expectedGreen);\n\t\t\t\t\tfin();\t\n\t\t\t\t}\n\t\t\t);\n\t\t}", "function generateEarlReport()\n{\n var rdfaExtractorUrl = getRdfaExtractorUrl();\n var rdftext = '';\n \n rdftext = '<rdf:RDF xmlns:earl=\"http://www.w3.org/ns/earl#\"\\n'; \n rdftext += ' xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\\n';\n rdftext += ' xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\\n';\n rdftext += ' xmlns:foaf=\"http://xmlns.com/foaf/0.1/\">\\n\\n';\n\n rdftext += '<earl:Software ' +\n 'rdf:about=\"http://rdfa.digitalbazaar.com/rdfa-test-harness\">\\n';\n rdftext += ' <dc:title>Crazy Ivan</dc:title>\\n';\n rdftext += ' <dc:description>The W3C RDFa Test Harness</dc:description>\\n';\n rdftext += ' <foaf:homepage ' +\n 'rdf:resource=\"http://rdfa.digitalbazaar.com/rdfa-test-harness\" />\\n';\n rdftext += '</earl:Software>\\n\\n';\n\n for(var i = 1; i <= 2000; i++)\n {\n var id = \"unit-test-anchor-\" + i;\n var elem = document.getElementById(id);\n if(elem)\n {\n // Calculate the proper idString to use when describing the\n // test case numbers.\n idString = \"\";\n if(i < 10)\n {\n idString = '000' + i;\n }\n else if(i < 100)\n {\n idString = '00' + i;\n }\n else if(i < 1000)\n {\n idString = '0' + i;\n }\n else\n {\n idString = i;\n }\n \n var assertionUrl =\n \"http://rdfa.digitalbazaar.com/rdfa-test-harness#\" + id\n var tcUrl = 'http://www.w3.org/2006/07/SWD/RDFa/testsuite/' +\n 'xhtml1-testcases/Test' + idString;\n var tcDescription =\n document.getElementById(id.replace('anchor', 'description'));\n var tcResult =\n document.getElementById(id.replace('anchor', 'result')).innerHTML;\n var resultUrl = 'http://www.w3.org/ns/earl#notTested';\n\n if(tcResult == \"PASS\")\n {\n resultUrl = 'http://www.w3.org/ns/earl#pass';\n }\n else if((tcResult == \"FAIL\") || (tcResult == \"ERROR\"))\n {\n resultUrl = 'http://www.w3.org/ns/earl#fail';\n }\n \n rdftext += '<earl:TestCase rdf:about=\"' + tcUrl +'\">\\n';\n rdftext += ' <dc:title>Test Case #' +\n id.replace('unit-test-anchor-', '') + '</dc:title>\\n';\n rdftext += ' <dc:description>' +\n tcDescription.innerHTML + '</dc:description>\\n';\n rdftext += '</earl:TestCase>\\n';\n\n rdftext += '<earl:Assertion rdf:about=\"' +\n assertionUrl.replace('anchor', 'assertion') + '\">\\n';\n rdftext += ' <earl:assertedBy rdf:resource=\"http://rdfa.digitalbazaar.com/rdfa-test-harness\"/>\\n';\n rdftext += ' <earl:subject rdf:resource=\"' + rdfaExtractorUrl +\n '\"/>\\n';\n rdftext += ' <earl:test rdf:resource=\"' + tcUrl + '\"/>\\n';\n rdftext += ' <earl:result rdf:parseType=\"Resource\">\\n';\n rdftext += ' <rdf:type ';\n rdftext += 'rdf:resource=\"http://www.w3.org/ns/earl#TestResult\"/>\\n';\n rdftext += ' <earl:outcome ';\n rdftext += 'rdf:resource=\"' + resultUrl + '\"/>\\n';\n rdftext += ' </earl:result>\\n';\n\n rdftext += '</earl:Assertion>\\n\\n';\n }\n }\n rdftext += '</rdf:RDF>\\n'; \n\n document.getElementById('earl-report').innerHTML = escapeXml(rdftext);\n}", "function countTestCases()/* : Number*/\n {\n return 1;\n }", "function checkRedColor() {\n\t\t\tcp.countPixels([255, 0, 0], \n\t\t\t\twin, \n\t\t\t\tfunction(count){\n\t\t\t\t\tvalueOf(testRun, count).shouldBe(expectedRed);\n\t\t\t\t\tcheckGreenColor();\t\n\t\t\t\t}\n\t\t\t);\n\t\t}", "function executeTests() {\n\n\tconsole.log('Executing tests...');\n\n\tsetupOutput();\n\n\tfor (var testFile of tests) {\n\t\tconsole.log('Running test %s', testFile);\n\n\t\trequire(testFile);\n\t}\n}", "function findAndRunE2eTests(filter, outputFile) {\n // create an output file with header.\n var startTime = new Date().getTime();\n var header = `Doc Sample Protractor Results for ${lang} on ${new Date().toLocaleString()}\\n`;\n header += argv.fast ?\n ' Fast Mode (--fast): no npm install, webdriver update, or boilerplate copy\\n' :\n ' Slow Mode: npm install, webdriver update, and boilerplate copy\\n';\n header += ` Filter: ${filter ? filter : 'All tests'}\\n\\n`;\n fs.writeFileSync(outputFile, header);\n\n // create an array of combos where each\n // combo consists of { examplePath: ... }\n var examplePaths = [];\n var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);\n e2eSpecPaths.forEach(function(specPath) {\n // get all of the examples under each dir where a pcFilename is found\n localExamplePaths = getExamplePaths(specPath, true);\n // Filter by example name\n if (filter) {\n localExamplePaths = localExamplePaths.filter(function (fn) {\n return fn.match(filter) != null;\n })\n }\n // Filter by language, also supports variations like js-es6\n localExamplePaths = localExamplePaths.filter(function (fn) {\n return fn.match('/'+lang+'(?:-[^/]*)?$') != null;\n });\n localExamplePaths.forEach(function(examplePath) {\n examplePaths.push(examplePath);\n })\n });\n\n // run the tests sequentially\n var status = { passed: [], failed: [] };\n return examplePaths.reduce(function (promise, examplePath) {\n return promise.then(function () {\n var runTests = isDartPath(examplePath) ? runE2eDartTests : runE2eTsTests;\n return runTests(examplePath, outputFile).then(function(ok) {\n var arr = ok ? status.passed : status.failed;\n arr.push(examplePath);\n })\n });\n }, Q.resolve()).then(function() {\n var stopTime = new Date().getTime();\n status.elapsedTime = (stopTime - startTime)/1000;\n return status;\n });\n}", "function generateTestCaseCallback(Y) {\r\n var testCases = new Array();\r\n var Assert = Y.Assert;\r\n\t\t\t\r\n testCases[0] = new Y.Test.Case({\r\n name: \"blackberry.app Tests\",\r\n\t\t\t\r\n\t\t\tsetUp : function () {\r\n\t\t\t\t//Order is a stack, last object will appear first in DOM\r\n\t\t\t\tframework.setupFailButton();\r\n\t\t\t\tframework.setupPassButton();\r\n\t\t\t\tframework.setupInstructions();\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\ttearDown : function () {\r\n\t\t\t\tframework.tearDownFailButton();\r\n\t\t\t\tframework.tearDownPassButton();\r\n\t\t\t\tframework.tearDownInstructions();\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t_should: {\r\n error: {\r\n \"blackberry.app.exit should return an error\" : \"Too many arguments\",\r\n \"blackberry.app.requestBackground should return an error\" : \"Too many arguments\",\r\n\t\t\t\t\t\"blackberry.app.requestForeground should return an error\" : \"Too many arguments\",\r\n\t\t\t\t\t\"blackberry.app.setHomeScreenIcon should return an error\" : \"Argument is not nullable\",\r\n\t\t\t\t\t\"blackberry.app.setHomeScreenName should return an error\" : \"Required argument missing\",\r\n } \r\n },\r\n\t\t\t\r\n\t\t\t\"blackberry.app should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.event should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.event);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.author should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.author);\r\n\t\t\t\tAssert.isString(blackberry.app.author);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.authorEmail should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.authorEmail);\r\n\t\t\t\tAssert.isString(blackberry.app.authorEmail);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.authorURL should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.authorURL);\r\n\t\t\t\tAssert.isString(blackberry.app.authorURL);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.copyright should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.copyright);\r\n\t\t\t\tAssert.isString(blackberry.app.copyright);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.description should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.description);\r\n\t\t\t\tAssert.isString(blackberry.app.description);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.id should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.id);\r\n\t\t\t\tAssert.isString(blackberry.app.id);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.isForeground should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.isForeground);\r\n\t\t\t\tAssert.isBoolean(blackberry.app.isForeground);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.license should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.license);\r\n\t\t\t\tAssert.isString(blackberry.app.license);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.licenseURL should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.licenseURL);\r\n\t\t\t\tAssert.isString(blackberry.app.licenseURL);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.name should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.name);\r\n\t\t\t\tAssert.isString(blackberry.app.name);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.version should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.version);\r\n\t\t\t\tAssert.isString(blackberry.app.version);\r\n\t\t\t},\r\n\t\t\r\n\t\t/* Missing Test cases\r\n\t\t\t\"blackberry.app.requestBackground should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.requestBackground);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.requestForeground should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.requestForeground);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.setHomeScreenIcon should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.setHomeScreenIcon);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.setHomeScreenName should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.setHomeScreenName);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.showBannerIndicator should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.showBannerIndicator);\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t\"blackberry.app.removeBannerIndicator should exist\" : function() {\r\n\t\t\t\tAssert.isNotUndefined(blackberry.app.removeBannerIndicator);\r\n\t\t\t},\r\n\t\t*/\r\n \r\n \"blackberry.app.exit should return an error\": function() {\r\n try {\r\n blackberry.app.exit(\"ppp\"); \r\n } catch (err) {\r\n throw new Error(err); \r\n }\r\n },\r\n \r\n \"blackberry.app.requestBackground should return an error\": function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tblackberry.app.requestBackground(\"ppp\");\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthrow new Error(err);\r\n\t\t\t\t}\r\n },\t\t\t\r\n \r\n \"blackberry.app.requestForeground should return an error\": function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tblackberry.app.requestForeground(\"ppp\");\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthrow new Error(err);\r\n\t\t\t\t}\r\n },\r\n \r\n \"blackberry.app.setHomeScreenIcon should return an error\": function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tblackberry.app.setHomeScreenIcon(null);\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthrow new Error(err);\r\n\t\t\t\t} \r\n },\r\n \r\n \"blackberry.app.setHomeScreenName should return an error\": function() {\r\n\t\t\t\ttry { \r\n\t\t\t\t\tblackberry.app.setHomeScreenName();\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthrow new Error(err);\r\n\t\t\t\t}\r\n },\r\n\r\n\t\t\t\"blackberry.app properties should be readonly\": function() {\r\n\t\t\t\tvar readOnly = false;\r\n\t\t\t\t\r\n\t\t\t\tvar author = blackberry.app.author;\r\n\t\t\t\tvar authorEmail = blackberry.app.authorEmail;\r\n\t\t\t\tvar copyright = blackberry.app.copyright;\r\n\t\t\t\tvar description = blackberry.app.description;\r\n\t\t\t\tvar id = blackberry.app.id;\r\n\t\t\t\tvar isForeground = blackberry.app.isForeground;\r\n\t\t\t\tvar license = blackberry.app.license;\r\n\t\t\t\tvar licenseURL = blackberry.app.licenseURL;\r\n\t\t\t\tvar name = blackberry.app.name;\r\n\t\t\t\tvar version = blackberry.app.version;\r\n\t\t\t\t\r\n\t\t\t\tblackberry.app.author = \"Incorrect Author\";\r\n\t\t\t\tblackberry.app.authorEmail = \"[email protected]\";\r\n\t\t\t\tblackberry.app.copyright = \"1234\";\r\n\t\t\t\tblackberry.app.description = \"Incorrect Description\";\r\n\t\t\t\tblackberry.app.id = \"incorrect id\";\r\n\t\t\t\tblackberry.app.isForeground = false;\r\n\t\t\t\tblackberry.app.license = \"Incorrect License\";\r\n\t\t\t\tblackberry.app.licenseURL = \"IncorrectLicenseUrl\";\r\n\t\t\t\tblackberry.app.name = \"Incorrect Name\";\r\n\t\t\t\tblackberry.app.version = \"9.9.9\";\r\n\t\t\t\t\r\n\t\t\t\tif (author == blackberry.app.author && authorEmail == blackberry.app.authorEmail &&\r\n\t\t\t\tcopyright == blackberry.app.copyright && description == blackberry.app.description &&\r\n\t\t\t\tid == blackberry.app.id && isForeground == blackberry.app.isForeground &&\r\n\t\t\t\tlicense == blackberry.app.license && licenseURL == blackberry.app.licenseURL &&\r\n\t\t\t\tname == blackberry.app.name && version == blackberry.app.version) {\r\n\t\t\t\t\treadOnly = true;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tAssert.isTrue(readOnly)\r\n },\r\n\t\t\t\r\n\t\t\t//app.exit() function will not work as it closes the widget\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//requestBackground\r\n\t\t\t\"MANUAL 1 should put application into the background\": function() {\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Application should have gone into the background.<br />Pass this test if this is true. Otherwise, fail.\");\r\n\t\t\t\t\r\n\t\t\t\talert(\"Application is going to call app.requestBackground and send application into background\");\r\n\t\t\t\tblackberry.app.requestBackground();\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click) *24hr wait since wait() has a bug*\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//requestForeground\r\n\t\t\t\"MANUAL 2 should put application into the background and then foreground\": function() {\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Application will go into background and then foreground.<br />Pass this test if this is true. Otherwise, fail.\");\r\n\t\t\t\t\r\n\t\t\t\talert(\"Application is going to background for 3 seconds and then call app.requestForeground and go back into foreground\");\r\n\t\t\t\tblackberry.app.requestBackground();\r\n\t\t\t\tsetTimeout('blackberry.app.requestForeground()', 3000);\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click) *24hr wait since wait() has a bug*\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//setHomeScreenIcon (Local)\r\n\t\t\t\"MANUAL 3 should set the homescreen icon to a local image\": function() {\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Sets homescreen icon to local image.<br />Pass this test if this is true. Otherwise, fail.\");\r\n\t\t\t\tvar uri = \"local:///img/sample2.gif\";\r\n\t\t\t\talert(\"Will attempt to set homescreen icon to local image\");\r\n\t\t\t\tblackberry.app.setHomeScreenIcon(uri);\r\n\t\t\t\talert(\"HomeScreenIcon has been set\");\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click) *24hr wait since wait() has a bug*\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//setHomeScreenIcon (External)\r\n\t\t\t\"MANUAL 4 should set the homescreen icon to an external image\": function() {\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Sets homescreen icon to an external image.<br />Pass this test if this is true. Otherwise, fail.\");\r\n\t\t\t\tvar uri = \"http://www.rim.com/images/layout/new_layout/topleft.gif\";\r\n\t\t\t\talert(\"Will attempt to set homescreen icon to external image\");\r\n\t\t\t\tblackberry.app.setHomeScreenIcon(uri);\r\n\t\t\t\talert(\"HomeScreenIcon has been set\");\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click) *24hr wait since wait() has a bug*\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//setHomeScreenIcon (hover)\r\n\t\t\t\"MANUAL 5 should set the homescreen icon hover to an image\": function() {\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Sets homescreen icon hover to an image.<br />Pass this test if this is true. Otherwise, fail.\");\r\n\t\t\t\tvar uri = \"http://www.rim.com/images/layout/new_layout/home_infoarea_smartphones.jpg\";\r\n\t\t\t\talert(\"Will attempt to set homescreen icon hover to image\");\r\n\t\t\t\tblackberry.app.setHomeScreenIcon(uri, true);\r\n\t\t\t\talert(\"HomeScreenIcon hover has been set\");\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click) *24hr wait since wait() has a bug*\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//setHomeScreenName\r\n\t\t\t\"MANUAL 6 should set the homescreen name to Hello World\": function() {\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Sets homescreen name to 'Hello World'<br />Pass this test if this is true. Otherwise, fail.\");\r\n\t\t\t\talert(\"Will attempt to set homescreen name to 'Hello World'\");\r\n\t\t\t\tblackberry.app.setHomeScreenName(\"Hello World\");\r\n\t\t\t\talert(\"HomeScreenName has been set\");\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click) *24hr wait since wait() has a bug*\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//Show all Properties\r\n\t\t\t\"MANUAL 7 should show all the application properties\": function() {\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Shows all application properties<br />Pass this test if this is true. Otherwise, fail.<br />\" +\r\n\t\t\t\t\"author=\" + blackberry.app.author + \"<br />\" +\r\n\t\t\t\t\"authorEmail=\" + blackberry.app.authorEmail + \"<br />\" +\r\n\t\t\t\t\"authorURL=\" + blackberry.app.authorURL + \"<br />\" +\r\n\t\t\t\t\"copyright=\" + blackberry.app.copyright + \"<br />\" +\r\n\t\t\t\t\"description=\" + blackberry.app.description + \"<br />\" +\r\n\t\t\t\t\"id=\" + blackberry.app.id + \"<br />\" +\r\n\t\t\t\t\"isForeground=\" + blackberry.app.isForeground + \"<br />\" +\r\n\t\t\t\t\"license=\" + blackberry.app.license + \"<br />\" +\r\n\t\t\t\t\"licenseURL=\" + blackberry.app.licenseURL + \"<br />\" +\r\n\t\t\t\t\"name=\" + blackberry.app.name + \"<br />\" +\r\n\t\t\t\t\"version=\" + blackberry.app.version\r\n\t\t\t\t);\r\n\t\t\t\talert(\"Will attempt to show all blackberry.app properties\");\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click) *24hr wait since wait() has a bug*\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t//app.event.onExit() (set and unset) - will not work as it closes the widget and kills YUI - needs to be tested manually\r\n\t\t\t\r\n\t\t\t//onBackground (set)\r\n\t\t\t\"blackberry.app.event onBackground event should trigger when application is set to background\": function() {\r\n\t\t\t\t\r\n\t\t\t\t//Sets flag and makes sure the application is in the foreground to start the test\r\n\t\t\t\tvar eventFlag = false;\r\n\t\t\t\tblackberry.app.requestForeground();\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Sets onBackground event to function that sets a flag to be true\r\n\t\t\t\t//Then puts application into the background\r\n\t\t\t\tblackberry.app.event.onBackground(function() { eventFlag = true; });\r\n\t\t\t\tblackberry.app.requestBackground();\r\n\t\t\t\tsetTimeout('Assert.isTrue(eventFlag)', 500);\r\n },\r\n\t\t\t\r\n\t\t\t//onBackground (unset)\r\n\t\t\t\"blackberry.app.event onBackground event should not trigger when application is set to background\": function() {\r\n\t\t\t\t\r\n\t\t\t\t//Sets flag and makes sure the application is in the foreground to start the test\r\n\t\t\t\tvar eventFlag = false;\r\n\t\t\t\tblackberry.app.requestForeground();\r\n\t\t\t\t\r\n\t\t\t\t//Sets onBackground event to something and then unsets it\r\n\t\t\t\t//Then puts application into the background\r\n\t\t\t\tblackberry.app.event.onBackground(function() { eventFlag = true; });\r\n\t\t\t\tblackberry.app.event.onBackground(null);\r\n\t\t\t\tblackberry.app.requestBackground();\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//eventFlag should remain false since event function has nothing in it\r\n\t\t\t\tsetTimeout('Assert.isFalse(eventFlag)', 500);\r\n },\r\n\t\t\t\r\n\t\t\t//onForeground (set)\r\n\t\t\t\"blackberry.app.event onForeground event should trigger when application is set to foreground\": function() {\r\n\t\t\t\t\r\n\t\t\t\t//Sets flag and makes sure the application is in the foreground to start the test\r\n\t\t\t\tvar eventFlag = false;\r\n\t\t\t\tblackberry.app.requestForeground();\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Sets onForeground event to function that sets a flag to be true\r\n\t\t\t\t//Puts application into background, waits 3 seconds and puts application in foreground\r\n\t\t\t\tblackberry.app.event.onForeground(function() { eventFlag = true; });\r\n\t\t\t\tblackberry.app.requestBackground();\r\n\t\t\t\tsetTimeout('blackberry.app.requestForeground()', 3000);\t\t\t\t\t\t\t\t\r\n\t\t\t\tsetTimeout('Assert.isTrue(eventFlag)', 500);\r\n },\r\n\t\t\t\r\n\t\t\t//onForeground (unset)\r\n\t\t\t\"blackberry.app.event onForeground event should not trigger when application is set to foreground\": function() {\r\n\t\t\t\t\r\n\t\t\t\t//Sets flag and makes sure the application is in the foreground to start the test\r\n\t\t\t\tvar eventFlag = false;\r\n\t\t\t\tblackberry.app.requestForeground();\r\n\t\t\t\t\r\n\t\t\t\t//Sets onForeground event to something and then unsets it\r\n\t\t\t\t//Puts application into background, waits 3 seconds and puts application in foreground\t\t\t\t\r\n\t\t\t\tblackberry.app.event.onForeground(function() { eventFlag = true; });\r\n\t\t\t\tblackberry.app.event.onForeground(null);\r\n\t\t\t\tblackberry.app.requestBackground();\r\n\t\t\t\tsetTimeout('blackberry.app.requestForeground()', 3000);\t\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//eventFlag should remain false since event function has nothing in it\r\n\t\t\t\tsetTimeout('Assert.isFalse(eventFlag)', 500);\r\n },\r\n\t\t\t\r\n\t\t\t/***** BannerIndicator Tests *****/\r\n\t\t\t/*\t\t\t\r\n\t\t\t\"MANUAL 8a showBannerIndicator should add an indicator icon\": function() {\t\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Banner Indicator icon should be set.\");\r\n\t\t\t\t\r\n\t\t\t\talert(\"Will attempt to set the banner indicator icon from local source (gif).\");\t\t\t\t\r\n\t\t\t\tblackberry.app.showBannerIndicator(\"icon.gif\");\r\n\t\t\t\t\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click)\r\n },\r\n\t\t\t\r\n\t\t\t\"MANUAL 8b showBannerIndicator should update an indicator icon\": function() {\t\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Banner Indicator icon should be updated.\");\r\n\t\t\t\t\r\n\t\t\t\talert(\"Will attempt to update the banner indicator icon.\");\t\t\t\t\r\n\t\t\t\tblackberry.app.showBannerIndicator(\"icon2.gif\");\r\n\t\t\t\t\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click)\r\n },\r\n\t\t\t\r\n\t\t\t\"MANUAL 9 showBannerIndicator should add an indicator icon with value\": function() {\t\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Banner Indicator icon should be set with a value (15).\");\r\n\t\t\t\t\r\n\t\t\t\talert(\"Will attempt to set the banner indicator icon with value.\");\t\t\t\t\r\n\t\t\t\tblackberry.app.showBannerIndicator(\"icon.gif\", 15);\r\n\t\t\t\t\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click)\r\n },\r\n\t\t\t\r\n\t\t\t\"MANUAL 10 showBannerIndicator should add an indicator icon with value larger than 99\": function() {\t\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Banner Indicator icon should be set with a value 99+.\");\r\n\t\t\t\t\r\n\t\t\t\talert(\"Will attempt to set the banner indicator icon with value larger than 99.\");\t\t\t\t\r\n\t\t\t\tblackberry.app.showBannerIndicator(\"icon.gif\", 150);\r\n\t\t\t\t\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click)\r\n },\r\n\t\t\t\r\n\t\t\t\"MANUAL 11 removeBannerIndicator should remove Indicator\": function() {\t\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Banner Indicator should be removed.\");\r\n\t\t\t\t\r\n\t\t\t\talert(\"Will attempt to remove the banner indicator.\");\t\t\t\t\r\n\t\t\t\tblackberry.app.removeBannerIndicator();\r\n\t\t\t\t\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click)\r\n },\r\n\t\t\t\r\n\t\t\t//ADD TO QC\r\n\t\t\t\"MANUAL 12 showBannerIndicator should work with jpg images\": function() {\t\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Banner Indicator icon should be set (jpg).\");\r\n\t\t\t\t\r\n\t\t\t\talert(\"Will attempt to set the banner indicator icon from local source (jpg).\");\r\n\t\t\t\t//blackberry.app.showBannerIndicator(\"??.jpg\");\r\n\t\t\t\t\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click)\r\n },\r\n\t\t\t\r\n\t\t\t//ADD TO QC\r\n\t\t\t\"MANUAL 13 showBannerIndicator should work with png images\": function() {\t\r\n\t\t\t\tframework.test = this; //so pass() and fail() can access this test\r\n\t\t\t\tframework.setInstructions(\"Banner Indicator icon should be set (png).\");\r\n\t\t\t\t\r\n\t\t\t\talert(\"Will attempt to set the banner indicator icon from local source (png).\");\r\n\t\t\t\t//blackberry.app.showBannerIndicator(\"??.png\");\r\n\t\t\t\t\r\n\t\t\t\tframework.test.wait(24*60*60*1000); //wait until user inputs the test result (via button click)\r\n },\r\n\t\t\t\r\n\t\t\t//Negative BannerIndicator Tests\r\n\t\t\t\"blackberry.app.showBannerIndicator should throw an error when the icon path is incorrect\": function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tblackberry.app.showBannerIndicator(\"noImage.gif\");\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthrow new Error(err);\r\n\t\t\t\t}\r\n },\r\n\t\t\t\r\n\t\t\t\"blackberry.app.showBannerIndicator should throw an error when passed a string to the value\": function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tblackberry.app.showBannerIndicator(\"icon.gif\", \"error\");\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthrow new Error(err);\r\n\t\t\t\t}\r\n },\r\n\t\t\t\r\n\t\t\t\"blackberry.app.showBannerIndicator should throw an error when value passed without icon\": function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tblackberry.app.showBannerIndicator();\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthrow new Error(err);\r\n\t\t\t\t}\r\n },\r\n\t\t\t\r\n\t\t\t//NEED TO ADD TO QC\r\n\t\t\t\"blackberry.app.removeBannerIndicator should throw an error when given parameter\": function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tblackberry.app.removeBannerIndicator(\"string\");\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthrow new Error(err);\r\n\t\t\t\t}\r\n },\r\n\t\t\t\r\n\t\t\t//NEED TO ADD TO QC\r\n\t\t\t\"blackberry.app.showBannerIndicator should throw an error when given image larger than 32x32\": function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t//blackberry.app.showBannerIndicator(??); //Image larger than 32x32 pixels\r\n\t\t\t\t} catch (err) {\r\n\t\t\t\t\tthrow new Error(err);\r\n\t\t\t\t}\r\n },\r\n\t\t\t*/\r\n });\r\n\r\n return testCases;\r\n }", "function setupEachStory (modulePath) {\n const packageReadmePath = modulePath.replace(\n 'src/.stories.js',\n 'readme.md'\n );\n const readme = readmes[packageReadmePath];\n\n // Setup each story to have a readme in it, when available, regardless of if\n // the consumer uses a HeidiStorybook.\n const storiesOf = (name, ...args) => {\n if (!args[0]) args[0] = module;\n let story = storybook.storiesOf(name, ...args);\n story.addDecorator(insertAppLikeGlobalCSS);\n if (readme) {\n story = story.addDecorator(withReadme(readme));\n }\n story = story.addDecorator(knobs.withKnobs);\n return story;\n };\n\n const _storybook = Object.assign({}, storybook, { storiesOf });\n stories[modulePath].default(_storybook, addons);\n }", "constructor(name, tests, enabled = true) {\n this.name = name;\n this.tests = tests;\n this.enabled = enabled;\n }", "function writeResultsToScreen(aTestcases) {\n var tc = 0;\n\n // Writes Test Filename and Creates Table\n document.write('<H3>' + aTestcases[tc].filename + '</H3>');\n document.write('<TABLE BORDER=1><TBODY>');\n \n // Writes Header\n document.write('<TR><TD><B>Description</B></TD><TD><B>Pass</B></TD>' +\n '<TD><B>Bug Number</B></TD><TD><B>Actual Result</B></TD></TR>');\n\n // Iterates through Tests writing the Test Result\n for (tc=0; tc < aTestcases.length; tc++) {\n failed = (!aTestcases[tc].result);\n\n document.write('<TR><TD' + ((failed)?' bgcolor=red style=\"color:white;\"':'') +'>' + aTestcases[tc].testcase );\n\n // Writes Bug number for Failed Tests\n if (failed) {\n document.write('<TD bgcolor=red style=\"color:white;\">failed');\n document.write('<TD bgcolor=red style=\"color:white;\">' + aTestcases[tc].bug);\n document.write('<TD bgcolor=red style=\"color:white;\">' + aTestcases[tc].actual);\n } else {\n document.write(\"<TD colspan=2>passed\");\n document.write('<TD>' + aTestcases[tc].actual);\n }\n document.write('</TR>');\n }\n\n document.write('</TBODY></TABLE>');\n}", "function run(){\n\n\tdescribe(\"XML Tester\", function(){\n\t\t\n\t\t//gameName = process.env.npm_config_gamename;\n\t\t//console.log(\"Testing \" + gameName);\n\t\t\n\t\t//findXML();\n\t\t//parseXML();\n\t\t//loadGame();\n\t\t//StartMultiGameTest();\n\t});\n}", "run(name, rule, tests) {\n const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${parser}`;\n // standardize the valid tests as objects\n tests.valid = tests.valid.map(test => {\n if (typeof test === 'string') {\n return {\n code: test,\n };\n }\n return test;\n });\n tests.valid.forEach(test => {\n if (typeof test !== 'string') {\n if (test.parser === parser) {\n throw new Error(errorMessage);\n }\n if (!test.filename) {\n test.filename = this.getFilename(test.parserOptions);\n }\n }\n });\n tests.invalid.forEach(test => {\n if (test.parser === parser) {\n throw new Error(errorMessage);\n }\n if (!test.filename) {\n test.filename = this.getFilename(test.parserOptions);\n }\n });\n super.run(name, rule, tests);\n }", "function testAccessibility() {\n return src('./**/*.html')\n .pipe(access({\n force: true\n }))\n .on('error', console.log)\n .pipe(access.report({reportType: 'txt'}))\n .pipe(rename({\n extname: '.txt'\n }))\n .pipe(dest('reports/txt'));\n}", "onTestPass(test) {\n this._passes++;\n this._out.push(test.title + ': pass');\n let status_id = this.qaTouch.statusConfig('Passed');\n let caseIds = this.qaTouch.TitleToCaseIds(test.title);\n if (caseIds.length > 0) {\n let results = caseIds.map(caseId => {\n return {\n case_id: caseId,\n status_id: status_id,\n };\n });\n this._results.push(...results);\n }\n }", "function runTest(comparison, text) {\n if(comparison) {\n testOutput(text, 'passed');\n passed += 1;\n } else {\n testOutput(text, 'failed');\n failed += 1;\n }\n }", "function CabalTestRunner(args, cwd) {\n function initArgs() {\n var ret = args || [];\n if (ret.indexOf(\"test\") === -1) {\n ret.push(\"test\");\n }\n if (ret.indexOf(\"--show-details=streaming\") === -1) {\n ret.push(\"--show-details=streaming\");\n }\n return ret;\n }\n function onStdout(data) {\n var regex = /(\\d+) examples, (\\d+) failures/;\n var match = data.match(regex);\n if (match) {\n self.failureCount = parseInt(match[2]);\n self.successCount = parseInt(match[1]) - self.failureCount;\n }\n }\n\n var self = this;\n this.init();\n this.cmd = \"cabal\";\n this.args = initArgs();\n this.cwd = cwd;\n\n this.onStdout(onStdout);\n}", "testArtists() {\n this.artistTest.startAllTests();\n }", "function checkViewColor() {\n\t\t\tcp.countPixels([127, 127, 127], \n\t\t\t\twin, \n\t\t\t\tfunction(count) {\n\t\t\t\t\tvalueOf(testRun, count).shouldBe(expected);\n\t\t\t\t\tfin();\t\n\t\t\t\t}\n\t\t\t);\n\t\t}", "function standAloneTest()\n{\n $(\"#qunit\").css({display: \"block\"})\n\n gbmLggDzSpecificTests();\n\n} // standAloneTest", "async actionsTestChangeColor() {\n try {\n await this.actionsPage.navigateToActionsPage()\n await this.homePage.blackAndColor()\n } catch (error) {\n console.error(`Error with ${this.actionsTestChangeColor} function`)\n }\n }", "function describeConsistently(apiSpec) {\n __tests.push({ spec: apiSpec, config: __currentConfig });\n if (MOCHA_MODE) {\n // buildMochaTests(apiSpec);\n }\n}", "function myTestName() {\n var testName = \"My Test Name\";\n logStart(testName);\n try {\n target.captureScreenWithName(\"screen name\");\n logMessage(\"1. First Step.\");\n \n // add steps here\n \n target.captureScreenWithName(\"Reading List\");\n logPass(testName);\n }\n catch(exception) {\n logMessage(\"TEST FAILED - \" + exception);\n logMessage(\"Logging Element Tree\");\n app.logElementTree();\n logFail(testName);\n }\n}", "function _generate_background_foreground_tests(aTests) {\n let self = this;\n for each (let [, test] in Iterator(aTests)) {\n let helperFunc = this[\"_\" + test + \"_helper\"];\n this[\"test_\" + test + \"_background\"] = function() {\n set_context_menu_background_tabs(true);\n helperFunc.apply(self, [true]);\n reset_context_menu_background_tabs();\n };\n this[\"test_\" + test + \"_foreground\"] = function() {\n set_context_menu_background_tabs(false);\n helperFunc.apply(self, [false]);\n reset_context_menu_background_tabs();\n };\n }\n}" ]
[ "0.57294434", "0.5580079", "0.5499903", "0.543109", "0.53744584", "0.53662854", "0.5349277", "0.5311394", "0.5297236", "0.5289699", "0.5285793", "0.5285352", "0.5285352", "0.5285352", "0.5278204", "0.5275723", "0.52538955", "0.52538955", "0.51994085", "0.51746184", "0.5172395", "0.5166695", "0.51257485", "0.5093231", "0.5067683", "0.5067683", "0.5067683", "0.5007992", "0.4999991", "0.49991336", "0.49705377", "0.49575016", "0.49560106", "0.49508816", "0.49469817", "0.49462807", "0.49453983", "0.49373448", "0.49330932", "0.49268004", "0.49268004", "0.49169034", "0.49128827", "0.48773682", "0.48755568", "0.4870708", "0.4861301", "0.48541522", "0.48540622", "0.48437333", "0.48355842", "0.48267424", "0.48127502", "0.48114955", "0.47983438", "0.47844467", "0.4780811", "0.47656474", "0.47652197", "0.4746896", "0.4746575", "0.4740875", "0.47321683", "0.47217858", "0.47208142", "0.47056118", "0.46972987", "0.46970364", "0.46799034", "0.4658987", "0.46569714", "0.4654805", "0.46508554", "0.46423796", "0.46403304", "0.4635546", "0.46276733", "0.46071365", "0.46017826", "0.46012163", "0.45945597", "0.45905572", "0.45869046", "0.45854357", "0.45790306", "0.457599", "0.4572831", "0.45696655", "0.45546794", "0.45495653", "0.4547123", "0.45469275", "0.45454937", "0.45380604", "0.4535237", "0.45255262", "0.4525389", "0.45252907", "0.45239055", "0.45177704" ]
0.66634655
0
Public Functions / changeTagValueType update data when tag value type change
function changeTagValueType() { // Update the model value type vm.tagModel.valType = vm.tagValueTypeDropdown.selectedTagValueType.value; if (vm.tagModel.valType === 'P') { // Trigger a blur to update the input formatting $timeout(function() { $('#tag-percent-input').blur(); }, 0); } else { // Trigger a blur to update the input formatting $timeout(function() { $('#tag-currency-input').blur(); }, 0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTagValue() {\n\n\t\tif (!isUpdateValid()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Start processing animation\n\t\tvm.tagModel.processing = true;\n\n\t\t// Allow the animation to complete before closing\n\t\t$timeout(function() {\n\n\t\t\t// Update the tag values by reference\n\t\t\tvm.initTagData.valType = vm.tagModel.valType;\n\t\t\tvm.initTagData.valAmount = vm.tagModel.valType === 'P' ?\n\t\t\t\tvm.percentSlider.model : vm.currencySlider.model;\n\n\t\t\t$scope.close();\n\t\t}, 250);\n\t}", "function onTagChange($e,$data){\n\t\t\taddTag($data.item.value);\n\t\t}", "updateValueByDOMTags(){\n this.value.length = 0;\n\n [].forEach.call(this.getTagElms(), node => {\n if( node.classList.contains(this.settings.classNames.tagNotAllowed.split(' ')[0]) ) return\n this.value.push( getSetTagData(node) )\n })\n\n this.update()\n }", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "function changeTags(value){\n setTags(value)\n console.log(tags)\n }", "tagChange(tag) {\n let tagPos = this.tags.indexOf(tag);\n if (tagPos === this.tags.length-1 && (tag.name !== '' || tag.value !== '')) this.addEmptyTag();\n }", "function onTagChange() {\n\n\t}", "valueTypeChanged() {\n if (!this.isValueTypeSelect()) {\n this.maxValueCount = AnnotationMaxValueCount.NONE;\n }\n this.options = [];\n }", "function changeTaggableModel(newTaggableId, newTaggableType) {\n taggableId = newTaggableId;\n taggableType = newTaggableType;\n updateExistingTagLabels();\n}", "function changeDataType(newDataType) {\n console.log('changeDataType: ' + DATATYPE_NAME[newDataType]);\n gDataType = parseInt(newDataType);\n\n // Enable or disable the 'lower case' checkbox based on new data type.\n var elem = $('#lower-case-checkbox input');\n if (newDataType == DATATYPE_STRING) {\n elem.removeAttr('disabled');\n } else {\n elem.attr('disabled', true);\n }\n\n // Change the placeholders to match the data type.\n changeControlPanelPlaceholders();\n\n // Clear out any of the old data.\n clearInputData();\n clearOutputData();\n\n // Build a new tree with the new data type.\n gTree = new BinarySearchTree();\n}", "replace( t, old_type, new_type ) {\n if(t.type==old_type) t.type = new_type\n if( Array.isArray(t.value) ) {\n var a = t.value\n for(var i=0; i<a.length; i++) a[i] = this.replace(a[i], old_type, new_type)\n } \n return t\n }", "function value_modification_handler(node) {\n node = node || document;\n let inps = node.getElementsByClassName('terminus-value');\n\n for (let i = 0; i < inps.length; i++) {\n let inp = inps[i];\n inp.addEventListener('change', function () {\n this.classList.add('value-modified');\n let pnd = this.parentNode._boundData;\n pnd.object[pnd.prop] = this.value;\n });\n }\n}", "onValueChange(value) {\n const { fieldValue } = this.props;\n const { onFieldValueChange } = this.context.jsonEditor;\n const valueType = getValueType(fieldValue);\n\n onFieldValueChange(this.getFieldPath(), coerceToType(value, valueType));\n }", "updateValue(type){\n // if (type === \"Distribution\"){\n // this.item.class = \"BoundedNormalDistribution\";\n // }\n this.item.class = type;\n this.updated.emit(this.item);\n }", "onUpdateTagAtIndex() {}", "updateDataType_() {\n /** @type {!Object} */\n this.dataType = {\n bits: ((parseInt(this.bitDepth, 10) - 1) | 7) + 1,\n float: this.bitDepth == '32f' || this.bitDepth == '64',\n signed: this.bitDepth != '8',\n be: this.container == 'RIFX'\n };\n if (['4', '8a', '8m'].indexOf(this.bitDepth) > -1 ) {\n this.dataType.bits = 8;\n this.dataType.signed = false;\n }\n }", "function setDataType(valueName, valueModel){\n switch(valueName){\n case \"on\":\n case \"reachable\":\n valueModel.set(\"number\", {min: 0, max: 1, step: 1, unit: \"int\"});\n break;\n case \"bri\":\n case \"sat\":\n valueModel.set(\"number\", {min: 0, max: 255, step: 1, unit: \"int\"});\n break;\n case \"hue\":\n valueModel.set(\"number\", {min: 0, max: 65535, step: 1, unit: \"int\"});\n break;\n default:\n valueModel.set(\"string\", {max: 99});\n break;\n }\n}", "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "async function updateTag(cluster, tagID, valueChange, reloadDatabase = true) {\n try {\n const index = cluster.Tags.findIndex((t) => t[tagUniqueIdentifier] === tagID);\n\n // if the tag wasn't found\n if (index < -1) {\n const description = 'Error Description: \\n\\t==>Updating tag Failed. No tag found with such id';\n const error = new Error(description);\n this.emit('error', new Error('Invalid id'), description);\n throw error;\n }\n\n for (let attribute in valueChange) {\n cluster.Tags[index][attribute] = valueChange[attribute];\n }\n if (reloadDatabase) await updateDoc(cluster.clusterID, cluster);\n } catch (error) {\n // pass the error the the caller\n throw error;\n }\n }", "updateDataType_() {\n this.dataType = {\n bits: ((parseInt(this.bitDepth, 10) - 1) | 7) + 1,\n fp: this.bitDepth == '32f' || this.bitDepth == '64',\n signed: this.bitDepth != '8',\n be: this.container == 'RIFX'\n };\n if (['4', '8a', '8m'].indexOf(this.bitDepth) > -1 ) {\n this.dataType.bits = 8;\n this.dataType.signed = false;\n }\n }", "function setTag(key, value) {\n\t getCurrentHub().setTag(key, value);\n\t}", "function valueTypeChange() {\n if (vm.annotType.valueType === 'Select') {\n // add an option if none exist\n if (!vm.annotType.options || (vm.annotType.options.length < 1)) {\n optionAdd();\n }\n } else {\n vm.annotType.options = undefined;\n vm.annotType.maxValueCount = 0;\n }\n }", "function updateDataValue(elem, data){\n let value = X3domCreateArray(data, 1);\n setX3domAttribut(elem, value, \"value\");\n x3dElem.render();\n}", "updateDataType_() {\r\n this.dataType = {\r\n bits: ((parseInt(this.bitDepth, 10) - 1) | 7) + 1,\r\n fp: this.bitDepth == '32f' || this.bitDepth == '64',\r\n signed: this.bitDepth != '8',\r\n be: this.container == 'RIFX'\r\n };\r\n if (['4', '8a', '8m'].indexOf(this.bitDepth) > -1 ) {\r\n this.dataType.bits = 8;\r\n this.dataType.signed = false;\r\n }\r\n }", "set type(value) {}", "updateValueEvents() {\n this.updateEventsContainer('value');\n }", "changeValue(value) {\n this.rawValue = value;\n if (this.rawToFinalValue) {\n this.value = this.rawToFinalValue(value);\n }\n else\n this.value = value;\n this.parentSectionReflection.valueChanged();\n this.validate();\n }", "function IDataType(value, typetag) {\n this.value = value;\n this.typetag = typetag;\n}", "function type(d){\n d.value = +d.value\n return d\n }", "function updateComparisonType(){\n\n comparisonChartType = this.value; // \"spend_vs_gm\"\n\n // buildCharts(chartdata, comparison_data); \n buildCharts(); \n}", "handler(newVal, oldVal) {\n if(!TypeChecker.isUndefined(oldVal)) {\n this.getValue();\n }\n }", "function typeUpdated(e) {\n var index = item.index();\n console.log(index, signals[id]);\n var signal = signals[id][index];\n var typeVal = type_select.val();\n var subtypeVal = subtype_select.val();\n signal.type = typeVal;\n signal.subtype = subtypeVal;\n }", "function type(d) {\n\t\t d.value = +d.value;\n\t\t return d;\n\t\t}", "function changeTag(newTag, oldTag){\n\ttagUtorid = '', tagCourse = '';\n\ttagTerm = '', tagYear = '';\n\tvar i=0;\n\tselectedRow.find('td').each(function(){\n\t\tswitch(i){\n \t\tcase 0:\n \t\ttagUtorid = $(this).text();\n \t\tbreak;\n \t\tcase 1:\n \t\ttagCourse = $(this).text();\n \t\tbreak;\n \tcase 2:\n \t\ttagTerm = $(this).text();\n \t\tbreak;\n \tcase 3:\n \t\ttagYear = $(this).text();\n \t\tbreak;\n\t\t}\n\t\ti++;\n\t});\n\tvar changeString = 'All_Applications=True&TagUtorid=\"' +\n\t\t\t\ttagUtorid + '\"&TagCourse=\"' + tagCourse +\n\t\t\t\t'\"&TagValue=\"' + newTag + '\"&OldTag=\"' + oldTag +\n\t\t\t\t'\"&TagTerm=\"' + tagTerm +'\"&TagYear=\"' + tagYear +\n\t\t\t\t'\"&ChangeTag';\n\tdisplayPageInfo(changeString);\n}", "updateGaugeValue(newValue) {\n if (newValue instanceof JQX.Utilities.BigNumber === false) {\n return super.updateGaugeValue(newValue);\n }\n\n const that = this.context,\n oldValue = that._getEventValue();\n\n if (that.mode === 'numeric') {\n that.value = newValue.toString();\n that.$.digitalDisplay.value = that.value;\n }\n else {\n that._valueDate = JQX.Utilities.DateTime.fromFullTimeStamp(newValue);\n that.value = newValue;\n that.$.digitalDisplay.$.input.value = that._valueDate;\n }\n\n that._drawValue = that.logarithmicScale ? Math.log10(that.value).toString() : that.value;\n that._number = newValue;\n\n that.$.fireEvent('change', { 'value': that._getEventValue(), 'oldValue': oldValue });\n }", "function type(d) {\n d.value = +d.value;\n return d;\n }", "function toggleTag(tag) {\n //writeDebug(\"called toggleTag(\"+tag+\")\");\n\n var currentValues = $input.val() || '';\n currentValues = currentValues.split(/\\s*,\\s*/);\n var found = false;\n var newValues = new Array();\n for (var i = 0; i < currentValues.length; i++) {\n var value = currentValues[i];\n if (!value) \n continue;\n if (value == tag) {\n found = true;\n } else {\n if (value.indexOf(tag) != 0) {\n newValues.push(value);\n }\n }\n }\n\n if (!found) {\n newValues.push(tag)\n }\n //writeDebug(\"newValues=\"+newValues);\n\n setTags(newValues);\n }", "function postAddTagValue(data, textStatus, jqXHR, param) {\n\tvar tag = param.tag;\n\tvar row = param.row;\n\tvar allTags = param.allTags;\n\tvar predicate = param.predicate;\n\tvar value = htmlEscape($('#'+idquote(tag)+'_id').val());\n\tvalue = sanitize(value);\n\tvar valueTr = $('<tr>');\n\tvalueTr.insertBefore(row);\n\tvar valueTd = $('<td>');\n\tvalueTr.append(valueTd);\n\tvalueTd.addClass('file-tag');\n\tvalueTd.addClass(tag);\n\tvalueTd.addClass('multivalue');\n\tif (tag == 'url') {\n\t\tvar a = $('<a>');\n\t\tvalueTd.append(a);\n\t\ta.attr({'href': value});\n\t\ta.html(value);\n\t} else {\n\t\tvalueTd.html(value);\n\t}\n\tvalueTd = $('<td>');\n\tvalueTr.append(valueTd);\n\tvalueTd.addClass('file-tag');\n\tvalueTd.addClass(tag);\n\tvalueTd.addClass('multivalue');\n\tvalueTd.addClass('delete');\n\tvar input = $('<input>');\n\tinput.attr({'type': 'button',\n\t\t'name': 'tag',\n\t\t'value': value\n\t});\n\tinput.val('Remove Value');\n\tvalueTd.append(input);\n\tinput.click({\t'tag': tag,\n\t\t\t\t\t'value': value},\n\t\t\t\t\tfunction(event) {removeTagValue(event.data.tag, event.data.value, $(this).parent().parent(), predicate);});\n\t$('#'+idquote(tag)+'_id').val('');\n\tif (!allTags[tag]['tagdef multivalue']) {\n\t\tvalueTr.prev().remove();\n\t}\n}", "updateGaugeValue(newValue) {\n const that = this.context,\n oldValue = that.value;\n\n that.value = newValue;\n that._drawValue = that.logarithmicScale ? Math.log10(newValue).toString() : newValue;\n that._number = this.createDescriptor(that.value);\n that.$.digitalDisplay.value = newValue;\n that.$.fireEvent('change', { 'value': newValue, 'oldValue': oldValue });\n\n delete that._valueBeforeCoercion;\n }", "function handleUserTypeValueChange(e) {\n updateUserTypeValue(e.target.value);\n }", "registerValue(value, valueHolder) {\n const category = determineValueTypeCategory(value);\n if (category === ValueTypeCategory.Primitive) {\n valueHolder.valueId = 0;\n valueHolder.value = value;\n }\n else {\n const valueRef = this._serialize(value, 1, null, category);\n Verbose && this._log(`value #${valueRef.valueId} for trace #${valueHolder.traceId}: ${ValueTypeCategory.nameFrom(category)} (${valueRef.serialized})`);\n valueHolder.valueId = valueRef.valueId;\n valueHolder.value = undefined;\n }\n }", "function valueForTag(_tag) {\n return $REVISION;\n}", "function valueForTag(_tag) {\n return $REVISION;\n}", "_changeScaleType() {\n const that = this;\n\n that._numericProcessor = new JQX.Utilities.NumericProcessor(that, 'scaleType');\n\n that._validateMinMax('both');\n\n that._setTicksAndInterval();\n that._scaleTypeChangedFlag = true;\n that._validate(true, that._number.toString());\n that._scaleTypeChangedFlag = false;\n }", "function setTag(key, value) {\n hub.getCurrentHub().setTag(key, value);\n}", "function genericOnChange(event) {\n setValue(event.target.value);\n }", "function changeSubType(typedd) {\n\t// Find out which sentence we're looking at\n\tsid = parseInt(typedd.readAttribute(\"sid\"));\n\tsubTypeVal = typedd.getValue();\n\tif (subTypeVal == \"None\") {\n\t\tsubTypeHash.unset(sid);\n\t} else {\n\t\tsubTypeHash.set(sid, subTypeVal);\n\t}\n}", "onReplaceTagAtIndex() {}", "_updateValue(newValue) {\n this._numericProcessor.updateGaugeValue(newValue);\n }", "function change (data) {\n now = Date.now();\n range = [new Date(now - step - offset), new Date(now - offset)];\n\n d3.select(that).select(\".value\")\n .text(function(){ \n var value = +data.pop().value;\n return (d.format || format)(value);\n });\n /*d3.select(that).select(\".timestamp\")\n .text(function(){ return \", \" + timestampFormat(new Date()); });*/\n\n timer && clearTimeout(timer);\n timer = setTimeout(function() {\n metric_(range[0], range[1], step, change);\n }, update(d));\n }", "mapGenericTag(tag, warnings) {\n tag = { id: tag.id, value: tag.value }; // clone object\n this.postMap(tag, warnings);\n // Convert native tag event to generic 'alias' tag\n const id = this.getCommonName(tag.id);\n return id ? { id, value: tag.value } : null;\n }", "function OnProps_Change( e )\r\n{\r\n try\r\n {\r\n var newDamageTypeValue = Alloy.Globals.replaceCharAt( current_non_structural_element * 6 + 2 , Alloy.Globals.AeDESModeSectionFive[\"DAMAGE_TYPES\"] , $.widgetAppCheckBoxAeDESModeFormsSectionFiveNonStructuralDamageProps.get_value() ) ;\r\n Alloy.Globals.AeDESModeSectionFive[\"DAMAGE_TYPES\"] = newDamageTypeValue ;\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n}", "function processValue(el) {\n switch (el.dataType) {\n case HEX:\n {\n return processHEX(el.value);\n }\n case RGB:{\n return processRGB(el.value);\n }\n case RGBA:{\n return processRGB(el.value);\n }\n \n }\n}", "function processValue(el) {\n switch (el.dataType) {\n case HEX:\n {\n return processHEX(el.value);\n }\n case RGB:{\n return processRGB(el.value);\n }\n case RGBA:{\n return processRGB(el.value);\n }\n \n }\n}", "createTag (tagNumber, value) {\n const typ = this._knownTags[tagNumber]\n\n if (!typ) {\n return new Tagged(tagNumber, value)\n }\n\n return typ(value)\n }", "createTag (tagNumber, value) {\n const typ = this._knownTags[tagNumber]\n\n if (!typ) {\n return new Tagged(tagNumber, value)\n }\n\n return typ(value)\n }", "createTag (tagNumber, value) {\n const typ = this._knownTags[tagNumber]\n\n if (!typ) {\n return new Tagged(tagNumber, value)\n }\n\n return typ(value)\n }", "setInfoKey(key, value) {\n let pair = this.data.info.find((pair) => {\n return pair.key === key;\n });\n let encodedValue;\n switch (typeof value) {\n case 'string':\n encodedValue = this.textEncoder.encode(value);\n break;\n case 'boolean':\n encodedValue = new Uint8Array([value ? 1 : 0]);\n break;\n default:\n throw new TypeError('Invalid value type, expected string or boolean.');\n }\n if (!pair) {\n pair = { key, value: encodedValue };\n this.data.info.push(pair);\n }\n else {\n pair.value = encodedValue;\n }\n }", "function switchType(data) {\n data.type = data.type == 'F' ? 'C' : 'F';\n decode(data);\n }", "function type(d) {\n d.value = +d.value;\n return d;\n}", "onElementTypeChange(elementType) {\n var elem = updateObject({}, this.getConfiguredElement());\n\n //override the frontend terminology\n var elementTypeOverride = getElementTypeOverrideBack(elementType);\n setElemFieldVal(elem, FIELD_TYPE, elementTypeOverride);\n setElemFieldVal(elem, FIELD_PARENT, null);\n if (elementTypeOverride === ELEMENT_TYPE_UE) {\n setElemFieldVal(elem, FIELD_WIRELESS, true);\n setElemFieldVal(elem, FIELD_WIRELESS_TYPE, 'wifi,5g,4g,other');\n }\n\n elem.parentElements = this.elementsOfType(getParentTypes(elementTypeOverride));\n\n if (this.getConfigMode() !== CFG_ELEM_MODE_CLONE) {\n setElemFieldVal(elem, FIELD_NAME, getSuggestedName(elementTypeOverride, this.getTableEntries()));\n setElemFieldVal(elem, FIELD_DN_NAME, getSuggestedDnn(elementTypeOverride));\n }\n // this.props.cfgElemUpdate(elem);\n this.updateElement(elem);\n }", "async function handleUserTypeValueSave() {\n updateIsSaving(true);\n\n await updateInstance({\n variables: {\n actionId: UPDATE_USER_TYPE_FOR_APP_SPEC_ACTION_ID,\n executionParameters: JSON.stringify({\n value: userTypeValue,\n instanceId: userType.id,\n }),\n },\n refetchQueries,\n });\n\n updateIsEditMode(false);\n updateIsSaving(false);\n }", "updateCurrentTag(newTag) {\n this.setState({ currentTag: newTag });\n }", "onGenericChange() {\n this.contentChanged.emit(void 0);\n }", "function updateTagView(tags, changedTag) {\n var outputTags = [];\n\n if (changedTag) {\n var tagIndex = tags.indexOf(changedTag);\n if (tagIndex == -1) {\n tags.push(changedTag);\n } else {\n tags.splice(tags.indexOf(changedTag), 1);\n }\n }\n\n $.each(tags, function(index, tag) {\n if (tag.match(/ /)) {\n outputTags.push('[[' + tag + ']]');\n } else {\n outputTags.push(tag);\n }\n });\n \n $('#editor input').val(outputTags.join(' '))\n}", "function setValue(elem, value, eventType){\n\t\t\n\t\t//Set value\n\t\t$(elem).val(value);\n\n\t\t//Fire native change event\n\t\tvar elem = $(elem).get(0);\n\t\t\n\t\tif (eventType === null){\n\t\t\t\n\t\t\treturn;//don't fire event\n\t\t}\n\t\telse if (eventType === undefined){ //calculate it\n\n\t\t\tif(elem.nodeName == \"SELECT\" ||\n\t\t\t elem.nodeName == \"INPUT\" ||\n\t\t\t elem.nodeName == \"TEXTAREA\" ||\n\t\t\t elem.nodeName == \"METER\" ||\n\t\t\t elem.nodeName == \"PROGRESS\")\n\t\t\t\teventType = \"change\";\n\t\t\telse\n\t\t\t\tthrow \"TEST SPEC: Unknown form type !\";\n\t\t}\n\t\t\n\t\tsendEvent(elem, eventType);\n\t}", "function updateTags(){\n\tWRAP_STATE.describeTags = WRAP_STATE.tagStack.reduce(function(a, b){\n\t\treturn a.concat(b);\n\t}, []);\n\tWRAP_STATE.hasDescribeTags = (WRAP_OPTIONS.tagsAny)? \n\t\thasAnyTags(WRAP_STATE.describeTags): \n\t\thasAllTags(WRAP_STATE.describeTags);\n}", "function chooseValueType(item) {\n if (!item || !item.valueType || !item.visualMode) return;\n item.valueType = item.valueType.toUpperCase();\n item.visualMode = item.visualMode.toUpperCase();\n\n // console.log(item);\n // console.log(item.value, item.value && !_.isArray(item.value));\n switch (true) {\n case (((item.valueType === 'STRING') && (item.visualMode === 'SELECT')) ||\n ((item.valueType === 'INTEGERARRAY') && (item.visualMode === 'SELECT'))):\n renderControl('select');\n break;\n case ((item.valueType === 'DATETIME') && (item.visualMode === 'DATERANGEPICKER')):\n renderControl('date-range');\n break;\n case ((item.valueType === 'DOUBLE') && (item.visualMode === 'DOUBLERANGESLIDER')):\n renderControl('range-slider');\n break;\n case ((item.valueType === 'INTEGER') && (item.visualMode === 'INTEGERRANGESLIDER')):\n renderControl('range-slider');\n break;\n case (\n // (item.value && !_.isArray(item.value)) ||\n (item.visualMode === 'CHECKBOX') ||\n ((item.valueType === 'STRINGARRAY') && (item.visualMode === 'LABEL')) ||\n ((item.valueType === 'INTEGERARRAY') && (item.visualMode === 'LABEL'))):\n if(item.value && !_.isArray(item.value) && !item.options) item.options = [item.value];\n renderControl('checkbox-group');\n break;\n case ((item.valueType === 'BOOLEAN') && (item.visualMode === 'RADIOGROUP')):\n renderControl('radio-group');\n break;\n default:\n //Empty\n }\n }", "handleChange(event, index, value, type){\n\t\tthis.filterData(type, value)\n\t}", "_setElementValue(value, element, dimensions) {\n const that = this;\n\n value = that._cloneValue(value);\n\n if (that.setElementValue) {\n that.setElementValue(value, element, dimensions);\n\n if (element.supressChange === true) {\n element.supressChange = false;\n }\n }\n else {\n if (that.type === 'boolean') {\n element.checked = value;\n }\n else {\n element.value = value;\n }\n }\n }", "function type(d) {\n d.value = +d.value;\n return d;\n}", "@onValuesChanged(\"price\", [\"insert\", \"modify\"])\n\t\t\tchangePrice(value) {\n\t\t\t\teventLog.push(\"Price changed: \" + value);\n\t\t\t}", "function changeIntensity(event) {\n //Create a shallow copy\n const newNewValues = { ...newValues };\n //Change the values given\n newNewValues.description = event.target.value;\n //Set newValues\n setNewValues(newNewValues);\n }", "function handleTagSearch() {\n const newValues = document.getElementById('search_input').value\n setNewTagOption(newValues)\n console.log('newValues: ', newValues)\n }", "onChange(data){\n this.setState({ [data.type]: { ...this.state[data.type], value: data.value } });\n }", "function handleRangeUpdate() {\n video[this.name] = this.value;\n}", "function updateInput (newNode, oldNode) {\n var newValue = newNode.value\n var oldValue = oldNode.value\n\n updateAttribute(newNode, oldNode, 'checked')\n updateAttribute(newNode, oldNode, 'disabled')\n\n if (newValue !== oldValue) {\n oldNode.setAttribute('value', newValue)\n oldNode.value = newValue\n }\n\n if (newValue === 'null') {\n oldNode.value = ''\n oldNode.removeAttribute('value')\n }\n\n if (!newNode.hasAttributeNS(null, 'value')) {\n oldNode.removeAttribute('value')\n } else if (oldNode.type === 'range') {\n // this is so elements like slider move their UI thingy\n oldNode.value = newValue\n }\n}", "updateValue(value) {\n const that = this.context;\n\n value = value instanceof JQX.Utilities.BigNumber ? value : new JQX.Utilities.BigNumber(value);\n\n const renderedValue = this.validate(value, that._minObject, that._maxObject);\n let oldValue = that.value,\n valueDetail, difference;\n\n that._number = renderedValue;\n that._drawValue = that.logarithmicScale ? Math.log10(renderedValue) : renderedValue;\n\n if (that.mode === 'numeric') {\n valueDetail = value.toString();\n that.value = valueDetail;\n difference = this.compare(value, oldValue);\n }\n else {\n oldValue = JQX.Utilities.DateTime.fromFullTimeStamp(oldValue);\n that._valueDate = JQX.Utilities.DateTime.fromFullTimeStamp(value);\n that.value = value;\n value = that._valueDate;\n valueDetail = value;\n difference = value.compare(oldValue) !== 0;\n }\n\n if (!that._programmaticValueIsSet && (difference || that._scaleTypeChangedFlag)) {\n that.$.fireEvent('change', { 'value': valueDetail, 'oldValue': oldValue });\n }\n\n if (that.$.hiddenInput) {\n that.$.hiddenInput.value = value;\n }\n\n that._moveThumbBasedOnValue(that._drawValue);\n }", "setvalue(tags) {\n for (let tag of tags) {\n if (tag.body.items && tag.body.items.length > 0) tag.body.value = tag.body.items[tag.body.items.length - 1].value\n else if (tag.body.source) tag.body.value = tag.body.source;\n }\n console.log('Annotations, tags', tags)\n //aggregate targets\n }", "function OnPresenceOfDamage_Change( e )\r\n{\r\n try\r\n {\r\n var newDamageTypeValue = Alloy.Globals.replaceCharAt( current_non_structural_element * 6 , Alloy.Globals.AeDESModeSectionFive[\"DAMAGE_TYPES\"] , $.widgetAppCheckBoxAeDESModeFormsSectionFiveNonStructuralDamagePresenceOfDamage.get_value() ) ;\r\n Alloy.Globals.AeDESModeSectionFive[\"DAMAGE_TYPES\"] = newDamageTypeValue ;\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n}", "function postLoadTagRangeValues(data, textStatus, jqXHR, param) {\n\tvar range = param.range;\n\t$.each(data[0], function(key, value) {\n\t\trange[key] = value;\n\t});\n\tsetRangeValues(param.range, param.tdRange, param.tag);\n}", "_onChangeType(dataType, timePeriod) {return this.componentDidUpdate();}", "function updateInput(newNode, oldNode) {\n\tconst newValue = newNode.value;\n\tconst oldValue = oldNode.value;\n\n\tupdateAttribute(newNode, oldNode, 'checked');\n\tupdateAttribute(newNode, oldNode, 'disabled');\n\n\tif (newValue !== oldValue) {\n\t\toldNode.setAttribute('value', newValue);\n\t\toldNode.value = newValue;\n\t}\n\n\tif (newValue === 'null') {\n\t\toldNode.value = '';\n\t\toldNode.removeAttribute('value');\n\t}\n\n\tif (!newNode.hasAttributeNS(null, 'value')) {\n\t\toldNode.removeAttribute('value');\n\t} else if (oldNode.type === 'range') {\n\t\t// this is so elements like slider move their UI thingy\n\t\toldNode.value = newValue;\n\t}\n}", "function handleChangeType(event){\n const {name, value} = event.currentTarget\n changeFilde(name, value);\n}", "_updateValue(value) {\n const valuesHandler = this._valuesHandler;\n valuesHandler.updateValue(valuesHandler.getActualValue(value));\n }", "function handleSelectChange(e, value) {\n\t\tsetDisplayTag(e.target.value)\n\t}", "attributeChangedCallback(attr, oldVal, newVal) {\n console.log('inside attributeChangedCallback', 'attr:', attr, 'oldVal:', oldVal, 'newVal:', newVal);\n if (attr === 'value') {\n this.value = newVal;\n }\n }", "function OnPipeline_Change( e )\r\n{\r\n try\r\n {\r\n current_offset_feature_type = Alloy.Globals.replaceCharAt( 4 , current_offset_feature_type , $.widgetAppCheckBoxBAEAModeFormsFaultRuptureOffsetFeatureTypePipeline.get_value() ) ;\r\n\r\n Ti.App.fireEvent( 'baea_mode_fault_rupture:offset_feature_type_changed' , { value: current_offset_feature_type } ) ;\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n}", "_inputTypeChangeHandler(newValue) {\n this.log.debug(\n this.inputTypeProperty,\n 'of device',\n this.device.type,\n this.device.id,\n 'changed to',\n newValue\n )\n\n this._triggerSwitchDebounced()\n }", "function updateWhenChangeType(e){\n\t$inputs = $(e).parents('table').find('input.dataInput');\n\t$.each($inputs,function(){\n\t\tcalculateInput($(this));\n\t});\n}", "function handleRangeUpdate() {\n // this.name = corresponding video property\n video[this.name] = this.value;\n}", "function commonSetValue(tag, value)\n{\n\n//alert(tag + '<<<>>>>' + value);\n\n var s = document.getElementById(tag);\n s.value = value;\n\n}", "_applyModelType(value, old) {\n if (old) {\n this.getStateManager().setState(\"modelId\", 0);\n }\n // if (value) {\n // this.getStateManager().setState(\"modelType\", value);\n // } else {\n // this.getStateManager().removeState(\"modelType\");\n // }\n }", "function handleTypeChange(e){\n //update the selectedType object\n publicAPI.$npcSelectedType = $(this);\n // update the available skills to select based on the new matrix\n //debug string\n console.log(`Type changed to ${publicAPI.$npcSelectedType.val()}`);\n updateAvailableSkillsSelectors();\n }", "setInteger(name, value) {\n this.features_[name] = { int64List: { value: [value] } };\n }" ]
[ "0.6505273", "0.6376833", "0.6187452", "0.6109588", "0.6109588", "0.6109588", "0.6109588", "0.6048532", "0.5974636", "0.59192455", "0.5913044", "0.58147687", "0.5695044", "0.5641808", "0.56093323", "0.5592057", "0.558667", "0.55201674", "0.5517151", "0.55169946", "0.5466293", "0.5466293", "0.5466293", "0.54393744", "0.543082", "0.5424716", "0.54224753", "0.5420062", "0.5390135", "0.5379074", "0.5353305", "0.5336592", "0.53127116", "0.5304888", "0.53034115", "0.5247144", "0.5226674", "0.51777375", "0.5157842", "0.51568115", "0.5143151", "0.51315176", "0.51302725", "0.5129942", "0.5129502", "0.5124214", "0.5105838", "0.5105838", "0.5102867", "0.50898075", "0.507514", "0.50751376", "0.5070311", "0.5064718", "0.505488", "0.50533706", "0.5039831", "0.5034319", "0.5034319", "0.5030305", "0.5030305", "0.5030305", "0.50224173", "0.5018059", "0.50121576", "0.5010852", "0.50104463", "0.4997084", "0.49957174", "0.4987613", "0.4983044", "0.49812657", "0.49722254", "0.49669087", "0.49644133", "0.49599904", "0.4958363", "0.49539697", "0.49521503", "0.494542", "0.4944225", "0.49342442", "0.49342304", "0.49250576", "0.4921891", "0.4919622", "0.4919072", "0.49128222", "0.49126253", "0.4911389", "0.4909829", "0.49082845", "0.4900185", "0.48935762", "0.4890197", "0.48859134", "0.4884804", "0.4884247", "0.48759273", "0.4871525" ]
0.7618515
0
isUpdateValid is the tag value form valid?
function isUpdateValid() { var modelNum, maxNum; if (vm.tagModel.valType === 'P') { modelNum = Number(vm.percentSlider.model); maxNum = 100; } else { modelNum = Number(vm.currencySlider.model); maxNum = Number(vm.currencySlider.options.max); } return modelNum > 0 && modelNum <= maxNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _formUpdateValid(){\n \tif ($scope.updateuser.$valid){\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t\t}\n }", "check_update(value) { return (this.value != value); }", "validateBeforeUpdate (id, newData, prevData) { return true }", "function isObsFormValid(){\t \n var v1 = textoObsField.isValid();\n return( v1);\n }", "function validateUpdate(item) {\n\n //Required schema of the input data\n const schema = {\n value: Joi.string().min(1).required(),\n ttl: Joi.number().required()\n\n };\n return Joi.validate(item, schema); //Return validation result\n}", "function validateLiveUpdates() {\n const current = new Date();\n const currentDate = current.toISOString().slice(0, 10);\n\n if (formData[\"liveUpdating\"]\n && currentDate > formData[\"enddatetime\"]) {\n return false;\n }\n\n return true;\n }", "_checkUpdateIsAble () {\n function error (parameter) {\n throw new Error (`Parameter '${parameter}' is forbidden in UPDATE query`)\n }\n if (this._selectStr.length > 1) error('only')\n if (this._orderStr) error('orderBy')\n if (this._limitStr) error('limit')\n if (this._offsetStr) error('offset')\n return true\n }", "isValid() {\n if (\n this.state.isDanger ||\n this.state.apiValue === '' ||\n this.state.apiValue === undefined\n )\n return false;\n\n return true;\n }", "validateUpdate(selector){\n for(const update of this.#updateCollection){\n if(update.selector === selector){\n return true\n }\n }\n return false\n }", "function validateCreativeTag() {\n var ele = $('textarea[name*=\"tags.tag\"]'),\n val = ele.val();\n\n if (($scope.creativeMode === 'edit') && val) {\n fireAPItoValidate(ele, val);\n }\n\n ele.on('change', function () {\n localStorage.setItem('isOnchangeOfCreativeFeild', 1);\n val = $(this).val();\n fireAPItoValidate(this, val);\n });\n }", "function updateTagValue() {\n\n\t\tif (!isUpdateValid()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Start processing animation\n\t\tvm.tagModel.processing = true;\n\n\t\t// Allow the animation to complete before closing\n\t\t$timeout(function() {\n\n\t\t\t// Update the tag values by reference\n\t\t\tvm.initTagData.valType = vm.tagModel.valType;\n\t\t\tvm.initTagData.valAmount = vm.tagModel.valType === 'P' ?\n\t\t\t\tvm.percentSlider.model : vm.currencySlider.model;\n\n\t\t\t$scope.close();\n\t\t}, 250);\n\t}", "updateTag(req, res, next) {\n let { success, code } = checkValidation(req, tags.paramValidation.update)\n if (!success) {\n return res.status(422).send(responseCreator(code))\n }\n next();\n }", "function alsoValidate() {\n const { hasError, error } = validateURL(e.target.value)\n onUpdate(idx, e.target.value, hasError, error)\n }", "validateUpdateListItem(formValues, newDocumentUpdate = false) {\r\n return this.clone(Item, \"validateupdatelistitem\").postCore({\r\n body: jsS({ \"formValues\": formValues, bNewDocumentUpdate: newDocumentUpdate }),\r\n });\r\n }", "function isValidUpdateForm() {\n\tvar name = $(\"#name-update\").val();\n\tvar date = $(\"#date-update\").val();\n\tvar score = $(\"#scores-update\").val();\n\t\n\tvar checkName = isValidName(name);\n\tvar checkDate = isValidDate(date);\n\tvar checkScore = isValidScore(score);\n\t\n\t$(\"#invalid-name-update\").html(\"\");\n\t$(\"#invalid-date-update\").html(\"\");\n\t$(\"#invalid-score-update\").html(\"\");\n\t\n\tif (!checkName || !checkDate || !checkScore) {\n\t\tif (!checkName) {\n\t\t\t$(\"#invalid-name-update\").html(\"Invalid student's name\");\n\t\t}\n\t\tif (!checkDate) {\n\t\t\t$(\"#invalid-date-update\").html(\"Invalid student's date\");\n\t\t}\n\t\tif (!checkScore) {\n\t\t\t$(\"#invalid-score-update\").html(\"Invalid student's score\");\n\t\t}\n\t\treturn false;\n\t}\n\treturn true;\n}", "validate()\n {\n if (this.dirty)\n {\n this.updateText();\n this.dirty = false;\n }\n }", "afterValidChange() { }", "_updateIsDirty() {\n if (!this.hasRendered) return;\n\n const commentContent = this.getCommentContent();\n const attachmentsElement = this.shadowRoot.querySelector('mr-upload');\n this.isDirty = !isEmptyObject(this.delta) || Boolean(commentContent) ||\n attachmentsElement.hasAttachments;\n }", "function isFormUpdateEventHandler( event ){\n const form = event.target.closest(\"form\");\n const isFormUpdate = document.createElement(\"input\");\n isFormUpdate.type = \"hidden\";\n isFormUpdate.name = \"is_form_update\";\n isFormUpdate.value = 'True'\n form.appendChild(isFormUpdate);\n form.querySelectorAll('[type=submit]')[0].click();\n}", "onCheckFormValue(newSoftware) {\n let invalid = false;\n\n if (!_.trim(newSoftware.softwareType).length) {\n invalid = true;\n }\n\n if (!_.trim(newSoftware.name).length) {\n invalid = true;\n }\n\n this.setState({ formInvalid: invalid });\n return invalid;\n }", "function fanTuriYozishUpdate() {\n let nomi = document.forms['updateFanTuriForm']['nomiUpdate'].value;\n let tugma = document.getElementById('fanTuriUpdate');\n if (nomi == \"\") {\n tugma.disabled = true;\n } else {\n tugma.disabled = false;\n }\n}", "function oqituvchiYozishUpdate() {\n let tugma = document.getElementById('oqituvchiUpdate');\n let ism = document.forms['updateOqituvchiForm']['ismUpdate'].value;\n let familiya = document.forms['updateOqituvchiForm']['familiyaUpdate'].value;\n let nomer = document.forms['updateOqituvchiForm']['nomerUpdate'].value;\n let tajriba = document.forms['updateOqituvchiForm']['tajribaUpdate'].value;\n let togilganYili = document.forms['updateOqituvchiForm']['togilganYiliUpdate'].value;\n let qisqaMalumot = document.forms['updateOqituvchiForm']['qisqaMalumotUpdate'].value;\n if (ism == \"\" || familiya == \"\" || nomer == \"\" || tajriba == \"\" || togilganYili == \"\" || qisqaMalumot == \"\") {\n tugma.disabled = true;\n } else {\n tugma.disabled = false;\n }\n}", "function validateUpdate(update, errors) {\n const act = update.ssAct ?? '';\n switch (act) {\n case '':\n errors.ssAct = 'Action must be specified.';\n return false;\n case 'clear':\n return validateFields('Clear', [], ['cellId', 'formula'], update, errors);\n case 'deleteCell':\n return validateFields('Delete Cell', ['cellId'], ['formula'],\n\t\t\t update, errors);\n case 'copyCell': {\n const isOk = validateFields('Copy Cell', ['cellId','formula'], [],\n\t\t\t\t update, errors);\n if (!isOk) {\n\treturn false;\n }\n else if (!FIELD_INFOS.cellId.err(update.formula)) {\n\t return true;\n }\n else {\n\terrors.formula = `Copy requires formula to specify a cell ID`;\n\treturn false;\n }\n }\n case 'updateCell':\n return validateFields('Update Cell', ['cellId','formula'], [],\n\t\t\t update, errors);\n default:\n errors.ssAct = `Invalid action \"${act}`;\n return false;\n }\n}", "function validateUpdate(update, errors) {\n const act = update.ssAct ?? '';\n switch (act) {\n case '':\n errors.ssAct = 'Action must be specified.';\n return false;\n case 'clear':\n return validateFields('Clear', [], ['cellId', 'formula'], update, errors);\n case 'deleteCell':\n return validateFields('Delete Cell', ['cellId'], ['formula'],\n\t\t\t update, errors);\n case 'copyCell': {\n const isOk = validateFields('Copy Cell', ['cellId','formula'], [],\n\t\t\t\t update, errors);\n if (!isOk) {\n\treturn false;\n }\n else if (!FIELD_INFOS.cellId.err(update.formula)) {\n\t return true;\n }\n else {\n\terrors.formula = `Copy requires formula to specify a cell ID`;\n\treturn false;\n }\n }\n case 'updateCell':\n return validateFields('Update Cell', ['cellId','formula'], [],\n\t\t\t update, errors);\n default:\n errors.ssAct = `Invalid action \"${act}`;\n return false;\n }\n}", "validateOnChange(e) {\n // only update the validation for this field\n return this.validate(e, true);\n }", "editTagChangeDetected(tagData) {\n var originalData = tagData.__originalData;\n\n for( var prop in originalData )\n if( !this.dataProps.includes(prop) && tagData[prop] != originalData[prop] )\n return true\n\n return false; // not changed\n }", "updateErrorState(value) {\r\n let isValid = true;\r\n let errorMessage = this.validInput(value);\r\n if (errorMessage)\r\n isValid = false;\r\n this.setState({ error: (isValid ? null : errorMessage) });\r\n return isValid;\r\n }", "function checkUpdate()\n{\n\t// Collect input fields.\n\tvar inputs = $(\"#startCity, #startState, #endCity, #endState\");\n\n\t// Make sure they all contain values.\n\tif (inputs[0].value != \"\" && inputs[1].value != \"\" && inputs[2].value != \"\" && inputs[3].value != \"\")\n\t{\n\t\tupdate();\n\t}\n}", "isUpdatePermitted() {\n return this.checkAdminPermission('update')\n }", "isChanged(name) {\n var e = this.getFormControl(name);\n return e && (e.dirty || e.touched);\n }", "'validateValue'(value) {}", "function valid(){return validated}", "isValid() {\n const form = this.template.querySelector(\"form\");\n const validity = form.reportValidity();\n return validity;\n }", "function shouldRunUpdater(vni, isStale) { \n // TODO: May add different policies in the future.\n return (!isStale) && haveAllInputs(vni) && dataIsGood(vni);\n}", "shouldUpdate(_changedProperties){return!0}", "function validatePut() {\n return true\n}", "function isEditMenuValid(){\r\n return(EMenuNameField.isValid() && EMenuDescField.isValid() && EMStartDateField.isValid() && EMEndDateField.isValid());\r\n }", "function validateForm(value) {\n\t\t\tif (status !== \"\") {\n\t\t\t\t// Reset status on input change\n\t\t\t\t$$invalidate(3, status = \"\");\n\t\t\t}\n\n\t\t\treturn validateProvider(value) !== null;\n\t\t}", "reCheckInvalidTags(){\n var _s = this.settings\n\n this.getTagElms(_s.classNames.tagNotAllowed).forEach((tagElm, i) => {\n var tagData = getSetTagData(tagElm),\n hasMaxTags = this.hasMaxTags(),\n tagValidation = this.validateTag(tagData),\n isValid = tagValidation === true && !hasMaxTags;\n\n if( _s.mode == 'select' )\n this.toggleScopeValidation(tagValidation)\n\n // if the tag has become valid\n if( isValid ){\n tagData = tagData.__preInvalidData\n ? tagData.__preInvalidData\n : { value:tagData.value }\n\n return this.replaceTag(tagElm, tagData)\n }\n\n // if the tag is still invaild, set its title as such (reson of invalid might have changed)\n tagElm.title = hasMaxTags || tagValidation\n })\n }", "function validationforUpdate() {\n\tvar totalRows = mygrid.getRowsNum();\n \n\tfor (var rowId = 1; rowId <= totalRows ; rowId++) { \n \t\tif (!isValidQuantity(rowId, \"countedQuantity\")) {\n \t\t\treturn false;\n\t\t}\n }\n \n return true;\n}", "isValid() {\n if (this.value) {\n return true;\n } else {\n return false;\n }\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "get canUpdateValues () {\n if (this._canUpdateValues === undefined) {\n var value = this.values;\n }\n\n return this._canUpdateValues;\n }", "shouldUpdate(e){return!0}", "function isModuloFormValid(){\t \n var v1 = sectoresCombo.isValid();\n var v2 = fechaInicioField.isValid();\n var v3 = fechaFinField.isValid();\n var v4 = equiposSBS.isValid();\n var v5 = productosCombo.isValid();\n var v6 = descripcionEventoField.isValid();\n var v7 = hmInicioField.isValid();\n var v8 = hmFinField.isValid();\n if (v7 && v8)\n {\n// var h_i=hmInicioField.getValue().split(\":\");\n// var h_f=hmFinField.getValue().split(\":\");\n if(fechaInicioField.getValue().getTime()==fechaFinField.getValue().getTime() && hmInicioField.getValue()>=hmFinField.getValue())\n {\n v7=false;\n v8=false;\n hmInicioField.markInvalid('La hora de inicio debe ser inferior a la hora de fin');\n hmFinField.markInvalid('La hora de fin debe ser superior a la hora de inicio');\n }\n }\n \n return( v1 && v2 && v3 && v4 && v5 && v6 && v7 && v8);\n }", "function formIsValid(id, isCreate) {\n if ($(\"#\" + id).valid()) { return true; }\n if (isCreate) { return false; }\n $(\"#\" + id + \" input\").each(function (index) {\n if ($(this).data(\"ismodified\") && $(this).hasClass(\"input-validation-error\")) { return false; }\n });\n return true;\n}", "get validity() {\n return this.getInput().validity;\n }", "isValid(){\n let component = this.props.component\n let key = this.props.attribute\n return !component.state.data[key].error\n }", "function dirtyManualFields() {\n\tvar len = fieldsToCheck.length;\n\tvar element;\n\tfor (var i=0; i<len; ++i) {\n\t\tid = fieldsToCheck[i];\n\t\telement = '#' + id;\n\t\tif($(element).val() != $(element).data('initial_value')) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "get canUpdate() {\n return this._canUpdate;\n }", "checkChange(){\n if(this.value != this.$editable.html()) {\n this.set('value', this.$editable.html());\n this.updateHeight();\n //this.$editable.scrollTop(0);\n }\n }", "function activateUpdateBtn() {\n if(minInput.value.length > 0 && maxInput.value.length > 0) {\n updateButton.disabled = false;\n rangeErrorMessage()\n } else {\n updateButton.disabled = true;\n }\n}", "_iStateOnValueChange() {\n this.dirty = true;\n }", "function getFormIsValid() {\n return interactedWith && !getFieldErrorsString()\n }", "isActiveFieldDirty() {\r\n if (this.slides && this.slides.length > this.activeIndex) {\r\n let activeField = this.slides[this.activeIndex].items[0];\r\n if ([FormFieldType.information.toString(), FormFieldType.image.toString()].indexOf(activeField.type) >= 0) {\r\n return true;\r\n }\r\n return this.currentData[activeField.name] && this.currentData[activeField.name].value;\r\n }\r\n return false;\r\n }", "setContentValid(isValid) {\n this.get('currentPost').set('hasValidContent', isValid);\n }", "function isEditMenuItemValid(){\r\n return(EMenuItemNameField.isValid() && EMenuItemDescField.isValid() && EMenuItemValidFromField.isValid() && EMenuItemValidToField.isValid() && EMenuItemPriceField.isValid() && EMenuItemTypePerField.isValid());\r\n }", "isValidTagName(newName) {\n let isValid = true;\n this.tags.forEach(tag => {\n if (tag.name == newName) {\n isValid = false;\n }\n });\n return isValid;\n }", "validate() {\n const valid = this.required ? this.hasValue : true;\n this.invalid = !valid;\n return valid;\n }", "function validate_update_user() {\n var form = get_form_data('#update_user_form');\n\n if (check_field_empty(form.email, 'email'))\n return false;\n if (check_field_empty(form.name, 'full name'))\n return false;\n if (check_field_empty(form.password, 'password'))\n return false;\n if (check_field_empty(form.confirm_password, 'password confirmation'))\n return false;\n if (check_field_email(form.email))\n return false;\n if (check_field_password(form.password, form.confirm_password))\n return false;\n\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : get_cookie()\n }, {\n \"email\" : form.email\n }, {\n \"name\" : form.name\n }, {\n \"password\" : form.password\n } ]\n };\n call_server('update_user', dataObj);\n}", "function updateRow(primaryKey, entity, dateInputValidator, numericInputValidator, uniqueValidator){\r\n\tvar updateButton = document.getElementById(\"updateButton\");\r\n\tupdateButton.addEventListener(\"click\", function(){\r\n\t\tvar notNullInputs = document.getElementsByClassName(\"notNull\");\r\n\t\tvar notNullsNotNull = true;\r\n\t\tvar notNullsLeftNull = [];\r\n\t\tfor(var i = 0; i < notNullInputs.length; i++){\r\n\t\t\tif(notNullInputs[i].value === '' || notNullInputs[i].value.toUpperCase() === 'NULL'){\r\n\t\t\t\tnotNullsNotNull = false;\r\n\t\t\t\tnotNullsLeftNull.push(notNullInputs[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar selectors = document.getElementsByTagName(\"select\");\r\n\t\tvar selectorSetToAll = false;\r\n\t\tfor(var i = 0; i < selectors.length; i++){\r\n\t\t\tif(selectors[i].value === 'all'){\r\n\t\t\t\tselectorSetToAll = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar dateValidated = true;\r\n\t\tif(dateInputValidator){\r\n\t\t\tdateValidated = dateInputValidator();\r\n\t\t}\r\n\t\tvar numericValidated = true;\r\n\t\tif(numericInputValidator){\r\n\t\t\tnumericValidated = numericInputValidator()();\r\n\t\t}\r\n\t\tvar uniqueValidated = true;\r\n\t\tif(uniqueValidator){\r\n\t\t\tuniqueValidated = uniqueValidator();\r\n\t\t}\r\n\t\tif(!notNullsNotNull || selectorSetToAll || !dateValidated || !numericValidated || !uniqueValidated){\r\n\t\t\tnotNullsLeftNull.forEach(function(notNullLeftNull){\r\n\t\t\t\tvar fieldName = notNullLeftNull.getAttribute(\"name\");\r\n\t\t\t\t\tfieldName = fieldName.charAt(0).toUpperCase() + fieldName.substring(1);\r\n\t\t\t\t\talert(fieldName + \" cannot be left null.\");\r\n\t\t\t});\r\n\t\t\tif(selectorSetToAll){\r\n\t\t\t\talert(\"Cannot update instance with attribute '*'\");\r\n\t\t\t}\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tvar selector = '#update' + entity;\r\n\t\t\tvar windowToReplace = '/' + entity.charAt(0).toLowerCase() + \r\n\t\t\t\t\t\t\t\t entity.substring(1) + 'Table';\r\n\t\t\t$.ajax({\r\n\t\t\t\turl: primaryKey,\r\n\t\t\t\ttype: 'PUT',\r\n\t\t\t\tdata: $(selector).serialize(),\r\n\t\t\t\tsuccess: function(result){\r\n\t\t\t\t\tconsole.log('success');\r\n\t\t\t\t\twindow.location.replace(windowToReplace);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}", "function updateProfile(valid, advisorForm){\n $scope.successMsg = false;\n $scope.errorMsg = false;\n if(valid){\n advisor.update($scope.advisorData).then(function (response){\n if(response.data.success){\n $scope.successMsg = response.data.message;\n getById();\n }else{\n $scope.errorMsg = response.data.message;\n }\n })\n }else{\n $scope.errorMsg= \"Please ensure from is filled our properly\";\n }\n }", "function checkIfUpdateDiff (oldVal, newVal) {\n if (oldVal && !newVal) {\n $log.debug('Attribute setA initialized');\n vm.updateDiff();\n }\n if (newVal) {\n $log.debug('Attribute setA changed');\n vm.updateDiff();\n }\n }", "isValid() {\n let valid = true;\n Object.keys(this.form).forEach((key) => {\n if (this.form[key] === null)\n valid = false;\n });\n return valid;\n }", "function newDeviceInfoUpdatedButton() {\n /*\n\tdomUpdateDeviceInfoFormSubmitButton.disabled = true;\n\tif (newDisplayOrderInput.value.length > 0 || newFriendlyNameInput.value.length > 0 || newDeviceNotesInput.value.length > 0 ) {\n domUpdateDeviceInfoFormSubmitButton.disabled = false;\n\t}\n */\n }", "function isModuloFormValid(){\t \n var v1 = consecuenciasField.isValid();\n var v2 = descripcionField.isValid();\n return( v1 && v2);\n }", "isFormValid() {\n let { input } = this.state,\n formIsValid = true\n\n _.forIn(input, (value) => { \n this.checkFieldHasError(value.name)\n if( this.checkHasInputError(value) == false ) \n formIsValid = false \n });\n\n return formIsValid\n }", "validateState(name, indexOrGuid = null, attribute = null) {\n if (indexOrGuid != null) {\n //this is a $each situation - array\n const { $dirty, $invalid } = this.$v[name][attribute].$values.$each[indexOrGuid].Value;\n return $dirty ? !$invalid : null;\n } else {\n const { $dirty, $error } = this.$v[name];\n return $dirty ? !$error : null;\n }\n }", "validate( _value, _utils ) {\n\t\t\treturn false;\n\t\t}", "validate(){\n var isValid = !this.state.inputText || this.validateTag({value:this.state.inputText}) === true;\n\n this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid, !isValid)\n\n return isValid\n }", "function isValid( ) {\n\n\t\t\tif ( _widget[ \"content\" ][ \"impl\" ].value.match(_validPtn) ) {\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function canBtnHdlr() {\n\tvar cells = $(this).closest(\"tr\").find(\"input[data-changed=true]\");\n\tif ( cells.length > 0 ) {\n\t\tcells.each( function () { // Restore the old value\n\t\t\t$(this).val( $(this).attr( \"data-oldv\" ) );\n\t\t\t$(this).attr( \"data-changed\", \"false\" );\n\t\t}); // forEach\n\t}\n\t$(this).closest(\"tr\").find(\"input[type=text]\").prop( \"disabled\", true );\n\tchgUpd2Edit( $(this).siblings(\".updBtn\") );\n}", "tagChange(tag) {\n let tagPos = this.tags.indexOf(tag);\n if (tagPos === this.tags.length-1 && (tag.name !== '' || tag.value !== '')) this.addEmptyTag();\n }", "function isValidInput(params) {\n\treturn((params) && \n\t (params.hasOwnProperty('id')) &&\n\t (Array.isArray(params.changes)) &&\n\t (params.changes.length > 0) &&\n\t (params.changes[0].hasOwnProperty('rev')) && \n\t (! params.id.startsWith('_design/')));\n}", "get updateComplete() {\n return this.getUpdateComplete();\n }", "function isEditRoomValid(){\r\n return(ERoomNumberField.isValid() && ERoomValidFromField.isValid() && ERoomValidToField.isValid());\r\n }", "function isVaild(ele) {\n var id = ele.id || '';\n var val = ele.value || '';\n var sts = {\n 'isValid': true,\n 'errorMsg': ''\n }\n // Name and title validator\n if (id === 'name' || id === 'title') {\n if (!val.length) {\n sts['isValid'] = false;\n sts['errorMsg'] = `This field is required : ${id}`\n }\n }\n else if (id === 'extension') { // Extension validator\n var ext = Number(val);\n if (isNaN(ext) || ext < 0) {\n sts['isValid'] = false;\n sts['errorMsg'] = `Invalid ext!!`\n }\n }\n return sts;\n }", "isUpdatePossible(timecard){\n let flag = true;\n\n if(timecard != null){\n let temp_timecard = companydata.getTimecard(timecard.timecard_id);\n let tempEmp_id = temp_timecard.emp_id;\n let allTimecards = companydata.getAllTimecard(tempEmp_id);\n allTimecards.forEach(tc => {\n if (this.prepareTimecardDate(timecard.start_time) == this.prepareTimecardDate(tc.start_time)) {\n if(timecard.timecard_id != tc.timecard_id){\n flag = false;\n }\n }\n });\n }\n return flag;\n }", "updateInputStatus(errorMessage) {\r\n this.setState({ isLoading: false });\r\n this.fieldStatus.valid = errorMessage ? false : true;\r\n this.setState({ error: (this.fieldStatus.valid ? null : errorMessage) });\r\n this.updateToStore();\r\n }", "updateErrorState(type, value) {\r\n let isValid = true;\r\n let errorMessage = this.validInput(value);\r\n if (errorMessage)\r\n isValid = false;\r\n if (type == 'blur')\r\n this.setState({ error: (isValid ? null : errorMessage) });\r\n return isValid;\r\n }", "function checkupdate(currentstr, inputstr, field){\r\n\tif(currentstr!=inputstr&&inputstr!=\"\"){\r\n\t\tupdateflag = true;\r\n\t\tupdatestr += field+\": from \"+currentstr+\" to \"+inputstr+\";\\n\";\r\n\t}\r\n}", "isFormIncomplete() {\n // the sliders are also required, but they start with a value of 1 so\n // they are never technically empty\n const requiredFields = ['positionId', 'semester', 'year'];\n let isIncomplete = false;\n\n for (let key of requiredFields) {\n if (this.props.newReview[key] === newReviewTemplate[key]) {\n isIncomplete = true;\n break;\n }\n }\n return isIncomplete;\n }", "validateAndSaveChange(name, value) {\r\n // Since we may be comparing this field to other fields, use the full form instead of just the one field\r\n let validation;\r\n if (((this.state.data.startDttm !== null && name === 'endDttm') ||\r\n (this.state.data.endDttm !== null && name === 'startDttm') )\r\n && value !== null) {\r\n validation = new Validator({ ...this.state.data, [name]: value }, rules_all, messages);\r\n } else {\r\n validation = new Validator({ ...this.state.data, [name]: value }, rules_min, messages);\r\n }\r\n validation.passes(); // Trigger validation\r\n\r\n // Set state using function to granularly modify data\r\n this.setState((previousState) => {\r\n previousState.data = { ...previousState.data, [name]: value };\r\n previousState.validity = { ...previousState.validity, [name]: !validation.errors.has(name) };\r\n previousState.errors = { ...previousState.errors, [name]: validation.errors.has(name) ? validation.errors.first(name) : null };\r\n\r\n // Special rule: always update validation of start and end dates\r\n previousState.validity = { ...previousState.validity, 'startDttm': !validation.errors.has('startDttm') };\r\n previousState.validity = { ...previousState.validity, 'endDttm': !validation.errors.has('endDttm') };\r\n previousState.errors = { ...previousState.errors, 'startDttm': validation.errors.has('startDttm') ? validation.errors.first('startDttm') : null };\r\n previousState.errors = { ...previousState.errors, 'endDttm': validation.errors.has('endDttm') ? validation.errors.first('endDttm') : null };\r\n \r\n return previousState;\r\n });\r\n }", "async validateAttributes () {\n\t}", "checkHtml5Validity() {\n if (!this.useHtml5Validation) return;\n\n if (this.$refs[this.$data._elementRef] === undefined) return;\n\n const el = this.$el.querySelector(this.$data._elementRef);\n\n let type = null;\n let message = null;\n let isValid = true;\n if (!el.checkValidity()) {\n type = \"is-danger\";\n message = el.validationMessage;\n isValid = false;\n }\n this.isValid = isValid;\n\n this.$nextTick(() => {\n if (this.parentField) {\n // Set type only if not defined\n if (!this.parentField.type) {\n this.parentField.newType = type;\n }\n // Set message only if not defined\n if (!this.parentField.message) {\n this.parentField.newMessage = message;\n }\n }\n });\n\n return this.isValid;\n }", "function validationforUpdate() {\n\tvar rowsNum = beanGrid.getRowsNum();\n\tvar oneChecked = false;\n\tfor ( var p = 1; p < (rowsNum + 1); p++) {\n\t\t// only validate lines with permission\n\t\tif (cellValue(p, \"permission\") == \"Y\")\n\t\t{\n\t\t\tif (validateLine(p) == false) {\n\t\t\t\tbeanGrid.selectRowById(p, null, false, false);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse if ($('okDoUpdate'+ p).checked == true)\n\t\t\t\toneChecked = true;\n\t\t}\n\t}\n\tif(!oneChecked)\n\t\t{\n\t\t\talert(messagesData.noRowSelected);\n\t\t\treturn false;\n\t\t}\n\t\n\treturn true;\n}", "function validateInput(inputValue, inputErrorMSG, errorMSG) {\n updateBTN.removeAttribute('data-dismiss')\n if (inputValue.value === '') {\n inputErrorMSG.innerHTML = errorMSG\n inputErrorMSG.style.display = 'block'\n return false\n }\n if (inputValue === prodPrice || inputValue === updateProdPrice) {\n let regex = /^[0-9.]+$/\n if (regex.test(inputValue.value)) {\n inputErrorMSG.style.display = 'none'\n return true\n }\n else {\n inputErrorMSG.innerHTML = 'Prodcut price must be only numbers'\n inputErrorMSG.style.display = 'block'\n return false\n }\n }\n if (inputValue === prodDesc || inputValue === updateProdDesc) {\n console.log(inputValue, inputValue.value)\n if (inputValue.value.length < 15 || inputValue.value.length < 15) {\n inputErrorMSG.innerHTML = 'Prodcut description is small'\n inputErrorMSG.style.display = 'block'\n return false\n }\n else {\n inputErrorMSG.style.display = 'none'\n return true\n }\n }\n else {\n inputErrorMSG.style.display = 'none'\n return true\n }\n}", "isValid() {\n\t\t// deconstruct the props\n\t\tconst {errors, isValid } = validateInput(this.state);\n\t\tthis.setState({ errors });\n\t\treturn isValid;\n\t}", "valid() {\r\n return true\r\n }", "set canUpdate(value) {\n this._canUpdate = value;\n }", "function checkAndUpdatePetInfoInHtml () {\n checkWeightAndHappinessBeforeUpdating()\n updatePetInfoInHtml()\n}", "validate(_value, _utils) {\n return false;\n }", "function validateAttributeValue(className, value, updateFn) {\n var origValue = value;\n\n if (!needsInterpolation(value)) {\n switch (className.replace(SUFFIXES,\"\")) {\n case 'layout' :\n if ( !findIn(value, LAYOUT_OPTIONS) ) {\n value = LAYOUT_OPTIONS[0]; // 'row';\n }\n break;\n\n case 'flex' :\n if (!findIn(value, FLEX_OPTIONS)) {\n if (isNaN(value)) {\n value = '';\n }\n }\n break;\n\n case 'flex-offset' :\n case 'flex-order' :\n if (!value || isNaN(+value)) {\n value = '0';\n }\n break;\n\n case 'layout-align' :\n var axis = extractAlignAxis(value);\n value = $mdUtil.supplant(\"{main}-{cross}\",axis);\n break;\n\n case 'layout-padding' :\n case 'layout-margin' :\n case 'layout-fill' :\n case 'layout-wrap' :\n case 'layout-nowrap' :\n case 'layout-nowrap' :\n value = '';\n break;\n }\n\n if (value != origValue) {\n (updateFn || angular.noop)(value);\n }\n }\n\n return value;\n }", "checkValidity () {\n\n // Validate generic fields\n let fields = this.getFieldsForType('generic');\n for (let i in fields) {\n const valid = this.input[fields[i]].checkValidity();\n if (!valid) return false;\n };\n\n // Adjust source validation based on selected format\n const type = this.input.type.value;\n if (type === 'image' || type === 'video') {\n const format = this.input[`${type}_format`].value;\n this.input[`${type}_source`].pattern = `^.+${format}$`;\n }\n\n // Validate type specific fields\n fields = this.getFieldsForType(type);\n for (let i in fields) {\n const valid = this.input[`${type}_${fields[i]}`].checkValidity();\n if (!valid) return false;\n };\n\n return true;\n }", "getValidStatus() {\n this.checkInput();\n return this.state.isValid;\n }", "function checkIsWidgetIsValid() {\n if(canUpdateWidget(vm.widget)){\n $location.url(\"/user/\" + vm.userId + \"/website/\" + vm.websiteId + \"/page/\" + vm.pageId + \"/widget\");\n }else{\n deleteWidget();\n }\n\n }", "function checkIfNewTagIsValid(data, currentPageURL, newTags) {\n const lowerCaseTags = newTags.toLowerCase();\n\n //Check if error message is present and remove it when it's true\n if ($('.tagErrorMessage').length) {\n $('.tagErrorMessage').remove();\n }\n // Check if tag already exist and if it has no special characters\n if (typeof data[0].tags !== 'undefined' && data[0].tags.includes(lowerCaseTags) === true) {\n inputBorderStyling();\n $('.tagInputOverview').after('<div class=\"tagErrorMessage\">Tag already exists on this element</div>');\n } else if (lowerCaseTags.match(/[`~!@#$%^&*()|+=?;:'\",.<>\\/]/gi) !== null) {\n inputBorderStyling();\n $('.tagInputOverview').after('<div class=\"tagErrorMessage\">`~!@#$%^&*()|+=?;:\\'\",.<>\\\\/ not allowed except for -_</div>');\n } else if (!newTags) {\n inputBorderStyling();\n $('.tagInputOverview').after('<div class=\"tagErrorMessage\">Please fill in a tag name</div>');\n } else {\n // Post tags\n const currentTagString = (typeof data[0].tags !== 'undefined') ? data[0].tags.join(', ') : '';\n const tagList = currentTagString.length > 0 ? currentTagString + ', ' + newTags : newTags;\n const url = location.protocol + '//' + location.host + '/' + currentPageURL;\n postTagRequest(postTagInHtml, url, tagList, {currentPageURL, newTags});\n }\n}", "checkUpdate() {\n if (this.updating === true) return false\n this.hasChanged = false\n const _entityList = this.entity_items.getEntitieslist()\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hassEntities = _entityList\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n this.hasChanged = this.entity_items.hasChanged(this.hassEntities)\n if (this.hasChanged) {\n /**\n * refresh and update the graph\n */\n this.updateGraph(true)\n }\n }\n return this.hasChanged\n }", "checkUpdate() {\n if (this.updating === true) return false\n this.hasChanged = false\n const _entityList = this.entity_items.getEntitieslist()\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hassEntities = _entityList\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n this.hasChanged = this.entity_items.hasChanged(this.hassEntities)\n if (this.hasChanged) {\n /**\n * refresh and update the graph\n */\n this.updateGraph(true)\n }\n }\n return this.hasChanged\n }" ]
[ "0.6944741", "0.63028544", "0.6260635", "0.6087864", "0.6078639", "0.6070235", "0.60670257", "0.58582544", "0.58548623", "0.57840073", "0.57627743", "0.5752816", "0.57387906", "0.571443", "0.56738544", "0.5644522", "0.5641344", "0.56112695", "0.55955", "0.5535345", "0.5534027", "0.5531972", "0.55281556", "0.55281556", "0.55247897", "0.55170417", "0.55150133", "0.54980516", "0.54810613", "0.5468513", "0.54386395", "0.54253346", "0.5413251", "0.54075795", "0.5406194", "0.54014176", "0.53884643", "0.53816473", "0.53807724", "0.5374247", "0.5364557", "0.5358889", "0.5358889", "0.53296554", "0.5321182", "0.53197044", "0.5318252", "0.53091866", "0.53081816", "0.5305529", "0.528715", "0.5284962", "0.5282895", "0.527066", "0.52704304", "0.5269077", "0.5264492", "0.52602774", "0.52602524", "0.5254617", "0.525039", "0.5244225", "0.5240264", "0.52361363", "0.5232381", "0.52239954", "0.52179", "0.52033126", "0.5200782", "0.51890737", "0.5187355", "0.51864135", "0.5184485", "0.517903", "0.5179", "0.51764196", "0.5171864", "0.5168884", "0.51671994", "0.5165422", "0.5160059", "0.5159586", "0.51429707", "0.5138523", "0.51365", "0.51360595", "0.5135278", "0.51338255", "0.5127689", "0.5127359", "0.5122303", "0.51202625", "0.51195973", "0.51149994", "0.51115584", "0.5111223", "0.51096016", "0.5104667", "0.5102816", "0.5102816" ]
0.7146377
0
updateTagValue update the value of the tag
function updateTagValue() { if (!isUpdateValid()) { return; } // Start processing animation vm.tagModel.processing = true; // Allow the animation to complete before closing $timeout(function() { // Update the tag values by reference vm.initTagData.valType = vm.tagModel.valType; vm.initTagData.valAmount = vm.tagModel.valType === 'P' ? vm.percentSlider.model : vm.currencySlider.model; $scope.close(); }, 250); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "updateValueByDOMTags(){\n this.value.length = 0;\n\n [].forEach.call(this.getTagElms(), node => {\n if( node.classList.contains(this.settings.classNames.tagNotAllowed.split(' ')[0]) ) return\n this.value.push( getSetTagData(node) )\n })\n\n this.update()\n }", "onUpdateTagAtIndex() {}", "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "function setTag(key, value) {\n\t getCurrentHub().setTag(key, value);\n\t}", "function changeTags(value){\n setTags(value)\n console.log(tags)\n }", "vouchFor(tagsdoc, index) {\n\n var tag = tagsdoc.tags[index];\n var modified_tag = {\n value: tag.value,\n count: tag.count + 1,\n };\n tagsdoc.tags[index] = modified_tag;\n db_pending.put({\n _id: tagsdoc._id,\n _rev: tagsdoc._rev,\n type: \"tag\",\n tags: tagsdoc.tags,\n }, function (err, response) {\n if (err) {\n console.log(err);\n }\n console.log(\"successfully upvoted\");\n });\n\n }", "function updateValue( value ) \n{\n \n updateComponentValue( value );\n \n}", "function postAddTagValue(data, textStatus, jqXHR, param) {\n\tvar tag = param.tag;\n\tvar row = param.row;\n\tvar allTags = param.allTags;\n\tvar predicate = param.predicate;\n\tvar value = htmlEscape($('#'+idquote(tag)+'_id').val());\n\tvalue = sanitize(value);\n\tvar valueTr = $('<tr>');\n\tvalueTr.insertBefore(row);\n\tvar valueTd = $('<td>');\n\tvalueTr.append(valueTd);\n\tvalueTd.addClass('file-tag');\n\tvalueTd.addClass(tag);\n\tvalueTd.addClass('multivalue');\n\tif (tag == 'url') {\n\t\tvar a = $('<a>');\n\t\tvalueTd.append(a);\n\t\ta.attr({'href': value});\n\t\ta.html(value);\n\t} else {\n\t\tvalueTd.html(value);\n\t}\n\tvalueTd = $('<td>');\n\tvalueTr.append(valueTd);\n\tvalueTd.addClass('file-tag');\n\tvalueTd.addClass(tag);\n\tvalueTd.addClass('multivalue');\n\tvalueTd.addClass('delete');\n\tvar input = $('<input>');\n\tinput.attr({'type': 'button',\n\t\t'name': 'tag',\n\t\t'value': value\n\t});\n\tinput.val('Remove Value');\n\tvalueTd.append(input);\n\tinput.click({\t'tag': tag,\n\t\t\t\t\t'value': value},\n\t\t\t\t\tfunction(event) {removeTagValue(event.data.tag, event.data.value, $(this).parent().parent(), predicate);});\n\t$('#'+idquote(tag)+'_id').val('');\n\tif (!allTags[tag]['tagdef multivalue']) {\n\t\tvalueTr.prev().remove();\n\t}\n}", "function setTag(key, value) {\n hub.getCurrentHub().setTag(key, value);\n}", "setvalue(tags) {\n for (let tag of tags) {\n if (tag.body.items && tag.body.items.length > 0) tag.body.value = tag.body.items[tag.body.items.length - 1].value\n else if (tag.body.source) tag.body.value = tag.body.source;\n }\n console.log('Annotations, tags', tags)\n //aggregate targets\n }", "function updateSliderValue(element, value) {\n //console.log(element + \" has value \" + value);\n values[element] = value\n let valEle= \"value\" + element;\n document.getElementById(valEle).innerHTML = \"Value: \" + value;\n}", "function handleTagSearch() {\n const newValues = document.getElementById('search_input').value\n setNewTagOption(newValues)\n console.log('newValues: ', newValues)\n }", "function onTagChange($e,$data){\n\t\t\taddTag($data.item.value);\n\t\t}", "updateCurrentTag(newTag) {\n this.setState({ currentTag: newTag });\n }", "function commonSetValue(tag, value)\n{\n\n//alert(tag + '<<<>>>>' + value);\n\n var s = document.getElementById(tag);\n s.value = value;\n\n}", "set value(value)\n {\n this.updated = true\n this._value = value\n }", "_updateValue(value) {\n const valuesHandler = this._valuesHandler;\n valuesHandler.updateValue(valuesHandler.getActualValue(value));\n }", "tagChange(tag) {\n let tagPos = this.tags.indexOf(tag);\n if (tagPos === this.tags.length-1 && (tag.name !== '' || tag.value !== '')) this.addEmptyTag();\n }", "function update_tag(accepted, total_count, tag_name, accepted_count) {\r\n if(accepted_count > 0) {\r\n var badge_type = 3;\r\n\t if(accepted_count >= 100) {\r\n\t badge_type = 2;\r\n\t }\r\n\t if(accepted_count >= 400) {\r\n\t badge_type = 1;\r\n\t }\r\n accepted.tag_stats[accepted.tag_stats.length] = [tag_name, accepted_count, badge_type, total_count];\r\n update_answer_tags(accepted);\r\n }\r\n }", "async function updateTag(cluster, tagID, valueChange, reloadDatabase = true) {\n try {\n const index = cluster.Tags.findIndex((t) => t[tagUniqueIdentifier] === tagID);\n\n // if the tag wasn't found\n if (index < -1) {\n const description = 'Error Description: \\n\\t==>Updating tag Failed. No tag found with such id';\n const error = new Error(description);\n this.emit('error', new Error('Invalid id'), description);\n throw error;\n }\n\n for (let attribute in valueChange) {\n cluster.Tags[index][attribute] = valueChange[attribute];\n }\n if (reloadDatabase) await updateDoc(cluster.clusterID, cluster);\n } catch (error) {\n // pass the error the the caller\n throw error;\n }\n }", "function upVoteUpdate(counter, newval){\n\t \t$(counter).text(parseFloat(newval));\n\t }", "updateValue() {\n this.value = this.getValueFromView();\n this.emit(this.value);\n }", "function onattributevalue(token) {\n var attributes = currentTag.attributes\n var attribute = attributes[attributes.length - 1]\n\n attribute.value = parseEntities(slice(token, 1, 1), parseEntitiesOptions)\n attribute.position.end = point(token.end)\n }", "function updateTagView(tags, changedTag) {\n var outputTags = [];\n\n if (changedTag) {\n var tagIndex = tags.indexOf(changedTag);\n if (tagIndex == -1) {\n tags.push(changedTag);\n } else {\n tags.splice(tags.indexOf(changedTag), 1);\n }\n }\n\n $.each(tags, function(index, tag) {\n if (tag.match(/ /)) {\n outputTags.push('[[' + tag + ']]');\n } else {\n outputTags.push(tag);\n }\n });\n \n $('#editor input').val(outputTags.join(' '))\n}", "update(metadataKey, value) {\n this.metadata[metadataKey] = value;\n }", "setValue(value, {update=true} = {}) {\n let numpad = this.numpad.querySelector('.value')\n if (numpad) numpad.setAttribute('text', {value})\n this.el.setAttribute('text', {value})\n this.inputField.value = value\n if (update && this.data.target)\n {\n this.data.target.setAttribute(this.data.component, {[this.data.property]: value})\n }\n }", "updateValueEvents() {\n this.updateEventsContainer('value');\n }", "_updateValue(newValue) {\n this._numericProcessor.updateGaugeValue(newValue);\n }", "function updateAnnotValue($scope, newVal){\n $scope.annotValue = newVal;\n}", "onReplaceTagAtIndex() {}", "function updateField(fieldId, updateValue) {\n fieldId.innerText = updateValue; \n calculateTotalPrice();\n updateTotal();\n}", "function incGitTag() {\n let output = runCommand('git describe --abbrev=0 --tags', {stdio: 'pipe'});\n if (output && output !== \"\") {\n let versionArray;\n versionArray = output.split(\".\");\n if (versionArray.length !== 3) {\n logError(\"invalid version: \" + version);\n }\n var version3 = parseInt(versionArray[2]);\n if (isNaN(version3)) {\n logError(\"invalid version: \" + version);\n }\n var newVersion = versionArray[0] + \".\" + versionArray[1] + \".\" + (version3 + 1);\n console.log('new tag version', newVersion);\n // write tag\n output = runCommand(`git tag ${newVersion}`);\n console.log(\"version updated to \" + newVersion);\n } else {\n logError(\"git describe output was invalid\");\n }\n}", "updateValue(arg1, arg2) {\n return \"une string\"\n }", "updateValue (val) {\n this._value = val;\n }", "function addTag (name) {\n $('#post_current_tags').val(function () {\n return $(this).val().concat(name, ',')\n })\n $('.current-tags').append(\"<span class='badge badge-pill badge-primary tag'>\" + name + '</span>')\n }", "function toggleTag(tag) {\n //writeDebug(\"called toggleTag(\"+tag+\")\");\n\n var currentValues = $input.val() || '';\n currentValues = currentValues.split(/\\s*,\\s*/);\n var found = false;\n var newValues = new Array();\n for (var i = 0; i < currentValues.length; i++) {\n var value = currentValues[i];\n if (!value) \n continue;\n if (value == tag) {\n found = true;\n } else {\n if (value.indexOf(tag) != 0) {\n newValues.push(value);\n }\n }\n }\n\n if (!found) {\n newValues.push(tag)\n }\n //writeDebug(\"newValues=\"+newValues);\n\n setTags(newValues);\n }", "setFieldValue({ name, value }) {\n this.fields[name].value = value;\n }", "function handleRangeUpdate(){\n video[this.name] = this.value; // element has name equal to video property\n}", "function BOT_set(topic,key,tag,value) {\r\n\tvar t = (typeof(topic) == \"string\") ? eval(topic) : topic;\r\n\tvar ta = BOT_getTopicAttribute(topic, key);\r\n\tif(ta == undefined) return false;\r\n\tvar val = BOT_getTopicAttributeTagValue(ta,tag);\r\n\tif(val == undefined) return false;\r\n\tif(BOT_getTopicAttributeIndex == -1 || BOT_getTopicAttributeTagValueIndex == -1) return false;\r\n\tt[BOT_getTopicAttributeIndex][BOT_getTopicAttributeTagValueIndex][1] = value;\r\n\treturn true\r\n}", "function tag(id) {\n\turl = \"tag.php?id=\" + id + \"&tag=\" + document.getElementById('newtag').value;\n\tdoAjaxCall(url, \"updateTag\", \"GET\", true);\n}", "function TagMenu_setValue(theValue) {\r\n this.listControl.setValue(theValue);\r\n}", "function tag(v, tagadd, newbut, tagclose, oldbut, name) {\n if (eval(v)%2 == 0) {\n eval(\"window.document.editform.\"+name+\".value = newbut;\");\n var post = window.document.editform.post.value;\n window.document.editform.post.value = post + tagadd;\n window.document.editform.post.focus();\n } else {\n eval(\"window.document.editform.\"+name+\".value = oldbut;\");\n var post = window.document.editform.post.value;\n window.document.editform.post.value = post + tagclose;\n window.document.editform.post.focus();\n }\n eval(v+\"++;\");\n}", "function updateTagRefEntry(tagNode)\n{\n var cNodes = g_libDom.getElementsByTagName(\"TAGLIBRARY\")\n var cTagRefNodes;\n var nodeIndex = -1;\n var tagRefIndex = -1;\n var tagRefFileName = \"\"\n var tagRefDom;\n var iHTML;\n\n for(var i=0; i<cNodes.length; i++)\n {\n if(cNodes[i].NAME == tagNode.NAMESPACE)\n { \n nodeIndex = i;\n break;\n }\n }\n\n if(nodeIndex >= 0)\n {\n // Get the Tag Ref objects from the selected TagLibrary. \n cTagRefNodes = cNodes[nodeIndex].childNodes;\n\n // Iterate through the list to find out if it already exists.\n for( var j=0; j < cTagRefNodes.length; j++) {\n if(cTagRefNodes[j].Name == tagNode.Name) {\n tagRefIndex = j;\n break;\n }\n }\n \n if(tagRefIndex >= 0) {\n \n // An entry already exists for the tag. Just get the filename....\n tagRefFileName = cTagRefNodes[tagRefIndex].File;\n\n } else {\n\n // This is a new tag. We will need to create an entry.\n iHTML = cNodes[nodeIndex].innerHTML;\n var tagRefNamePattern = /@@NAME@@/g;\n var newTagRef = g_tagRefPattern.replace(tagRefNamePattern, tagNode.NAME);\n tagRefFileName = g_subFolderName + tagNode.NAME + \".vtm\"\n iHTML = iHTML + newTagRef + \"\\r\\n\";\n cNodes[nodeIndex].innerHTML = iHTML;\n }\n\n } else {\n // Something bad happened. We got here without a namespace being created. Don't do anything.\n return;\n }\n\n // OK, now on to the individual VTM file...\n\n // Form the url to the tag ref file.\n var fileName = 'TagLibraries/ASPNet/' + tagRefFileName;\n\n // Get the DOM for the specified Tag file. \n tagRefDom = dw.tagLibrary.getTagLibraryDOM(tagRefFileName);\n\n var tagPatternStr = /@@NAME@@/g;\n\n // Note: We may have to do something special with the BIND/CASESENSITIVE.\n var tag2PatternStr = /@@BIND@@/g;\n var tag3PatternStr = /@@CASESENSITIVE@@/g;\n\n var newTagString = g_tagPatternOpen.replace(tagPatternStr, tagNode.NAME);\n newTagString = newTagString.replace(tag2PatternStr, \"\");\n newTagString = newTagString.replace(tag3PatternStr, \"\");\n \n newTagString += g_tagPatternClose;\n\n tagRefDom.documentElement.outerHTML = newTagString;\n\n // Build up the Tag Information \n var tNodes = tagRefDom.getElementsByTagName(\"TAG\");\n\n if(tNodes.length > 0) {\n\n var sourceAttrNodes = tagNode.getElementsByTagName(\"ATTRIBUTES\");\n var sourceAttrCatNodes = tagNode.getElementsByTagName(\"ATTRIBCATEGORIES\");\n\n tNodes[0].innerHTML = g_tagFormatPattern + sourceAttrNodes[0].outerHTML;\n\n if (sourceAttrCatNodes.length > 0)\n {\n tNodes[0].innerHTML += sourceAttrCatNodes[0].outerHTML;\n }\n }\n\n}", "function valueForTag(_tag) {\n return $REVISION;\n}", "function valueForTag(_tag) {\n return $REVISION;\n}", "set tagList(value) {\n if (value) {\n this._tagList = value;\n this._tagList.registerInput(this);\n }\n }", "vouchAgainst(tagsdoc, index) {\n\n var tag = tagsdoc.tags[index];\n if (tag.count > 0) {\n var modified_tag = {\n value: tag.value,\n count: tag.count - 1,\n };\n tagsdoc.tags[index] = modified_tag;\n\n db_pending.put({\n _id: tagsdoc._id,\n _rev: tagsdoc._rev,\n type: \"tag\",\n tags: tagsdoc.tags,\n }, function (err, response) {\n if (err) {\n return console.log(err);\n }\n console.log(\"success\");\n });\n } else {\n tagsdoc.tags.splice(index, 1);\n db_pending.put({\n _id: tagsdoc._id,\n _rev: tagsdoc._rev,\n type: \"tag\",\n tags: tagsdoc.tags,\n }, function (err, response) {\n if (err) {\n return this.error(err);\n }\n console.log(\"successfully downvoted\");\n });\n }\n }", "function updateExistingTagLabels() {\n removeExistingTagLabels();\n if (taggableId !== \"\") {\n sendGetTagsRequest();\n }\n}", "function addCatalogFieldValue(tag, row) {\n\tvar value = $('#'+idquote(tag)+'_id').val();\n\tif (value.replace(/^\\s*/, \"\").replace(/\\s*$/, \"\").length == 0) {\n\t\t// ignore empty strings\n\t\treturn;\n\t}\n\tvar valueTr = $('<tr>');\n\tvalueTr.insertBefore(row);\n\tvar valueTd = $('<td>');\n\tvalueTr.append(valueTd);\n\tvalueTd.addClass('file-tag');\n\tvalueTd.addClass(tag);\n\tvalueTd.addClass('multivalue');\n\tvalueTd.html(value);\n\tvalueTd = $('<td>');\n\tvalueTr.append(valueTd);\n\tvalueTd.addClass('file-tag');\n\tvalueTd.addClass(tag);\n\tvalueTd.addClass('multivalue');\n\tvalueTd.addClass('delete');\n\tvar input = $('<input>');\n\tinput.attr({'type': 'button',\n\t\t'name': 'tag',\n\t\t'value': value\n\t});\n\tinput.val('Remove Value');\n\tvalueTd.append(input);\n\tinput.click({\t'tag': tag,\n\t\t\t\t\t'value': value},\n\t\t\t\t\tfunction(event) {removeCatalogFieldValue(event.data.tag, event.data.value, $(this).parent().parent());});\n\t$('#'+idquote(tag)+'_id').val('');\n\tif (!catalogMultivalueFields.contains(tag)) {\n\t\tvalueTr.prev().remove();\n\t}\n}", "set foo(newVal) { \n let oldVal = this.foo;\n console.log('setting foo from', oldVal, 'to', newVal);\n this.setAttribute('foo', newVal);\n this.requestUpdate('foo', oldVal).then(\n result => console.log('updateComplete:', result)\n );\n }", "function updateValue(key, newValue) {\n ticket[key] = newValue\n}", "function handleRangeUpdate() {\n video[this.name] = this.value;\n}", "function SetFieldValue( name, newValue, form, createIfNotFound)\n{\n var field = GetFieldNamed( name, form, createIfNotFound);\n\n if(field != undefined)\n field.value = newValue;\n}", "updateSlider_() {\n if (!this.sliderInput_) {\n return;\n }\n this.sliderInput_.setAttribute('value', this.getValue());\n }", "function updateTags(){\n\tWRAP_STATE.describeTags = WRAP_STATE.tagStack.reduce(function(a, b){\n\t\treturn a.concat(b);\n\t}, []);\n\tWRAP_STATE.hasDescribeTags = (WRAP_OPTIONS.tagsAny)? \n\t\thasAnyTags(WRAP_STATE.describeTags): \n\t\thasAllTags(WRAP_STATE.describeTags);\n}", "function populateTagField (tagArray){\n\t\ttagArray.forEach(addTag);\n\t}", "updateTags(event) {\n this.setState({\n tagFilter: event.target.value,\n });\n }", "function updateRange() {\n video[this.name] = this.value;\n}", "function _setValue(xml) {\n var valueNode = Sdk.Xml.selectSingleNode(xml, \"//a:KeyValuePairOfstringanyType[b:key='Value']/b:value\");\n if (!Sdk.Xml.isNodeNull(valueNode)) {\n _value = parseFloat(Sdk.Xml.getNodeText(valueNode));\n }\n }", "function ex3_update_node(node_name, field_name, value) {\n get_node(node_name)[field_name] = value;\n // Update everything\n update_all();\n}", "function updatevalue(val,slider) {\r\n\t$('#'+slider+'value').text(val.toFixed(4));\r\n}", "function updateValue()/*:void*/ {\n if (this.valueDirty$nJmn) {\n this.computeAndTrack$nJmn();\n }\n }", "async updateUser() {\n // get all input names upsert the value of each to the database\n var updateList = this.state.inputNamesToBeUpdated\n // get tag input\n var tag = this.state.tag\n // make lowercase and add to state\n await this.setState({tag: tag.toLowerCase()})\n // was tag changed\n var tagChanged = (this.state.tag !== this.state.saved_tag)\n\n // check if tag was changed\n if (updateList.includes(\"tag\")) {\n // confirm tag is available, otherwise use saved tag\n const available = await this.tagIsAvailable()\n if (!available) {\n // remove from update list\n updateList.splice(updateList.indexOf(\"tag\"), 1)\n if (tagChanged)\n // show unavailable message\n this.setState({tagError: true, tagHelpText: \"Unavailable\"})\n }\n else {\n this.setState({tagError: false, tagHelpText: \"\", showTagUpdatedMessage: true, saved_tag: tag})\n }\n }\n for (const inputName of updateList) {\n console.log(\"Updating \" + inputName + \" to \" + this.state[inputName])\n await updateValue(inputName, this.state[inputName])\n }\n // reset list of input names to be updated\n this.setState({\n inputNamesToBeUpdated: [],\n showTagUpdatedMessage: true,\n })\n }", "function setValue(data)\n\t{\n\t\tobjThis.selectorElt.tagSuggest().setValue(data);\n\t}", "set vector2Value(value) {}", "function updateTag(event){\n if(updateID == 0){\n let span = document.createElement('span');\n span.innerText = ' [X]';\n span.style.color = '#465881';\n span.addEventListener('click', stopUpdate);\n tagsWrapper.appendChild(span);\n updateID = event.target.id;\n let tagTitle = event.target.childNodes[0].nodeValue;\n input.value = tagTitle;\n input.style.borderColor = '#465881';\n event.target.style.backgroundColor = '#465881'; \n }\n}", "_setChildElementValue() {\n this._elements.forEach((element) => {\n let name = element.name;\n element.value = this.value[name];\n });\n }", "function updateInputValue(input, value) {\n input.val(value);\n input.change();\n }", "updateTagList(response) {\n const tags_container = document.querySelector('#displayed-tags')\n\n if (tags_container != undefined) {\n const response_text = response.text()\n response_text.then(value => {\n tags_container.innerHTML = value\n })\n }\n }", "function processTagInput() {\n idIndex = idUpdate();\n var usertext = $(this).prop(\"value\");\n $(this).hide();\n var spoint = jQuery(\"<span/>\", {\n id: \"stag\" + idIndex,\n class: \"all\",\n html: usertext,\n });\n $(this).parent().prepend(spoint);\n}", "function updateSlider(sliderId, val){\n var slider = document.getElementById(sliderId);\n slider.value = val;\n}", "setFeedPostsUpdated (value) {\n\n this\n .feedPostsUpdatedContainer\n .innerText = value;\n }", "function writeValue($field, key, value) {\n if ($field.is('input')) { // Simple one-line textbox\n $field.val(value);\n } else if ($field.is('textarea')) { // Multi-line textbox, requires parsing\n if (key === 'samples') {\n $field.val(parseSamples(value));\n } else { // tags\n $field.val(parseArray(value));\n }\n } else if ($field.is('table')) { // Atmosphere 'Loops' or 'One-Shots' special field\n $field.html(parseAtmosphereChildren(value, key));\n }\n}", "function addValue(countId, content, name) {\n\tvar valueCount = $(\"#\" + countId).val();\n\tvar valueHtml = $(\"#valueTemplate\").html();\n\tvar value = new Value();\n\tvalue.makeHtml(content, valueHtml, function(name) {}, valueCount, name);\n\n\t$(\"#\" + countId).val(parseInt(valueCount) + 1);\n\n}", "function updateCurrentValue(n) {\n currentValue = n;\n $currentValueField.html(n);\n}", "function handleRangeUpdate() {\n // this.name = corresponding video property\n video[this.name] = this.value;\n}", "function updateTagProb() {\n for (var i=0; i < $scope.place.tags.length; i++) {\n if ($scope.tagProb[$scope.place.tags[i]]) {\n $scope.tagProb[$scope.place.tags[i]]++;\n } else if ($scope.place.tags[i] !== '') {\n $scope.tagProb[$scope.place.tags[i]] = 1;\n }\n }\n }", "update() {\n\t this.value = this.originalInputValue;\n\t }", "updateTags() {\n // Clear previous tags\n let parent = document.getElementById('tag-container');\n this.clearChildNodes(parent);\n\n let {area, comparisonAreas} = this.selected;\n\n // Create tag for focused country\n this.createTag(area.country, true);\n\n // Create tag for each comparison area\n for (let i = 0; i < comparisonAreas.length; i++) {\n this.createTag(comparisonAreas[i], false);\n }\n }", "function onTagChange() {\n\n\t}", "function updateValue (key, value) {\n var data = {};\n data[key] = value;\n return function (done) {\n this.user.specRequest(this.container._id)\n .send(data)\n .expect(200)\n .expectBody(key, value)\n .end(done);\n };\n }", "getTagValue(tagName) {\n return this.__tags[tagName];\n }", "function updateValue(val, id) {\n console.log(val);\n console.log(id);\n}", "setInfoKey(key, value) {\n let pair = this.data.info.find((pair) => {\n return pair.key === key;\n });\n let encodedValue;\n switch (typeof value) {\n case 'string':\n encodedValue = this.textEncoder.encode(value);\n break;\n case 'boolean':\n encodedValue = new Uint8Array([value ? 1 : 0]);\n break;\n default:\n throw new TypeError('Invalid value type, expected string or boolean.');\n }\n if (!pair) {\n pair = { key, value: encodedValue };\n this.data.info.push(pair);\n }\n else {\n pair.value = encodedValue;\n }\n }", "function chgStyleByTag(tagID, property, value) {\r\n\tvar vtagID = tagID;\r\n\tvar vProperty = property;\r\n\tvar vValue = value;\r\n\tswitch(vTagID) {\r\n\t\tcase 'p':\r\n\t\t\tbreak;\r\n\t\tcase 'h1':\r\n\t\t\tbreak;\r\n\t\tcase 'h2':\r\n\t\t\tbreak;\r\n\t\tcase 'td':\r\n\t\t\tbreak;\r\n\t\tcase 'li':\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tconsole.log('Invalid text tag: ' + vTagID + '<BR>Valid tags: p, h1, h2, d, and li.');\r\n\t}\t\r\n\tswitch(vProperty) {\r\n\t\tcase 'color':\r\n\t\t\tbreak;\r\n\t\tcase 'textDecoration':\r\n\t\t\tbreak;\r\n\t\tcase 'fontSize':\r\n\t\t\tbreak;\r\n\t\tcase 'backgroundColor':\r\n\t\t\tbreak\r\n\t\tcase 'borderStyle':\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tconsole.log('Invalid style propety: ' + vProperty + '<BR>Valid properties: color, textDecoration, fontSize, backgroundColor, and borderStyle.');\r\n\t}\r\n\tif (vValue == null) {\r\n\t\tconsole.log('No value entered with classID: ' + vClassID + ' and property: ' + vProperty);\r\n\t} else {\r\n\t\tdocument.getElementById('vTagID').style.vProperty = vValue;\r\n\t}\r\n}", "function processUpdateTag(node, responseProcessor) {\n // early state storing, if no state we perform a normal update cycle\n if (!storeState(responseProcessor, node)) {\n handleElementUpdate(node, responseProcessor);\n }\n }", "updateItem(el, value, index) {}", "writeValue(value) {\n this.active_user = value;\n this.resetSearchString();\n }", "'sliderValues.update'(userID, value) {\n check(value, Number);\n check(userID, String);\n SliderValues.update({ userID }, {\n $set: {\n value,\n },\n });\n }", "async setItem(tagoRunURL, key, value) {\n const result = await this.doRequest({\n path: `/run/${tagoRunURL}/sdb/${key}`,\n method: \"POST\",\n body: value,\n });\n return result;\n }", "tryToSetTag(tag) {\n if (this.validateTagString(tag.tag)) {\n if (this.hasTag(tag.tag)) {\n this.removeTag(tag.tag);\n }\n this.__tags[tag.tag] = tag.value;\n this.__combinedTagString += `${tag.tag}:${tag.value}` + ' ';\n return true;\n }\n return false;\n }", "updateFeatureValue(key, evt) {\n var value = evt.currentTarget.innerHTML;\n if (\n (key === \"target_value\" && isValidTargetValue(value)) ||\n (key === \"spf\" && isNumber(value))\n ) {\n var obj = {};\n obj[key] = value;\n this.props.updateFeature(this.props.feature, obj);\n } else {\n alert(\"Invalid value\");\n }\n }", "setValue(value){\n const thisWidget = this;\n const newValue = thisWidget.parseValue(value);\n \n /* TODO: Add validation */\n if(newValue !=thisWidget.value && thisWidget.isValid(newValue)){\n thisWidget.value = newValue;\n thisWidget.announce();\n }\n thisWidget.renderValue();\n }", "function updateDataValue(elem, data){\n let value = X3domCreateArray(data, 1);\n setX3domAttribut(elem, value, \"value\");\n x3dElem.render();\n}" ]
[ "0.6492815", "0.6492815", "0.6492815", "0.6492815", "0.6103223", "0.6081969", "0.596684", "0.596684", "0.596684", "0.59585774", "0.5846785", "0.5839426", "0.5806268", "0.5747082", "0.57427496", "0.5638813", "0.5456899", "0.54544014", "0.5444481", "0.54350126", "0.54139423", "0.53552973", "0.533765", "0.5317053", "0.5313749", "0.53082293", "0.52973354", "0.52732694", "0.525982", "0.523424", "0.52139044", "0.52002215", "0.514845", "0.5145323", "0.5142381", "0.5141972", "0.51409125", "0.5126632", "0.512574", "0.5117639", "0.5103267", "0.5102778", "0.50804275", "0.5065656", "0.5059876", "0.50555176", "0.50474316", "0.5044717", "0.5033672", "0.5033485", "0.5033485", "0.50231916", "0.5021559", "0.5009268", "0.5000579", "0.49976477", "0.49944526", "0.49815798", "0.4980577", "0.49796668", "0.49707446", "0.49692845", "0.49646828", "0.49569488", "0.49466574", "0.49459463", "0.49445814", "0.4944575", "0.49397114", "0.49318478", "0.49262843", "0.49229616", "0.49215272", "0.49116117", "0.49047625", "0.49033064", "0.49024278", "0.489486", "0.4886826", "0.48550656", "0.4854539", "0.48458904", "0.48422545", "0.48386833", "0.4836407", "0.48359546", "0.48357064", "0.4833324", "0.48233366", "0.48056892", "0.47974634", "0.47932476", "0.4793087", "0.4791333", "0.4790661", "0.47888353", "0.47854862", "0.47842613", "0.47796717", "0.47788945" ]
0.7507505
0
Private Functions / percentSliderStop when the slider stops, blur the input to get the proper formatting
function percentSliderStop() { $('#tag-percent-input').blur(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSliderBlur() {\n gShaderToy.mMouseIsDown = false;\n }", "onSliderBlur() {\n gShaderToy.mMouseIsDown = false;\n }", "_blur(event) {\n // Depending on support for input[type=range],\n // the event.target could be either the handle or its child input.\n // Use closest() to locate the actual handle.\n event.target.closest(`.${CLASSNAME_HANDLE}`).classList.remove('is-focused');\n\n events.off('touchstart.Slider');\n events.off('mousedown.Slider');\n }", "_calcSliderValueDebounced(mouseVal, valueVar) {\n var val = this._scale.invert(mouseVal), //convert pixel --> value\n stepped = this._calcStepRounded(val), //round it\n inputElem = valueVar === 'value' ? this._inputStart : this._inputEnd; //which input field\n\n //validate that stepped is not greater than the other handle\n if(this.isRange) {\n stepped = (valueVar === 'value' && stepped > this.endValue) ? this.endValue : stepped;\n stepped = (valueVar === 'endValue' && stepped < this.value) ? this.value : stepped;\n }\n\n this.toggleClass('validation-error', false, inputElem);\n this.set(valueVar, stepped);\n }", "function currencySliderStop() {\n\n\t\t$('#tag-currency-input').blur();\n\t}", "function onSliderInput() {\n\tvar sibling = $(this).siblings('input').first();\n\tvar me = $(this);\n\tvar my_rel = me.data('slider-rel');\n\n\tvar my_val = Number(me.val());\n\tvar sib_val = Number(sibling.val());\n\tvar step = Number(me.attr('step'));\n\n\tif (my_rel == 'max' &&\n\t my_val < sib_val) {\n\t // My value is too low. Freeze at one step higher.\n\t me.val(Math.min(sib_val + step, 1440));\n\t} else if (my_rel == 'min' &&\n\t\t my_val > sib_val) {\n\t // My value is too high. Freeze at one step lower.\n\t me.val(Math.max(sib_val - step, 0));\n\t}\n\n\tvar target = $(this).data('display');\n\t$(target).text(util.minuteToTime($(this).val()));\n\n\tif (triggerCb) {\n\t if (my_rel == 'max') triggerCb(sib_val, my_val);\n\t else triggerCb(my_val, sib_val);\n\t}\n }", "function inputHandler() {\n stopAnimation();\n setTime(parseInt(slider.value));\n }", "onSliderChange(e) {\n var slider = e.target,\n axis = slider.getAttribute('data-axis'),\n vPart = slider.getAttribute('data-vPart'),\n value = slider.value;\n\n slider.nextSibling.textContent = vPart + ': ' + value;\n gShaderToy['mMouse' + axis] = value;\n gShaderToy.mForceFrame = true;\n setTimeout(this.onSliderBlur, 20);\n }", "onSliderChange(e) {\n var slider = e.target,\n axis = slider.getAttribute('data-axis'),\n vPart = slider.getAttribute('data-vPart'),\n value = slider.value;\n\n slider.nextSibling.textContent = vPart + ': ' + value;\n gShaderToy['mMouse' + axis] = value;\n gShaderToy.mForceFrame = true;\n setTimeout(this.onSliderBlur, 20);\n }", "sliderOnChange() {\n updateShaderToyTime(this.sliderInput.value);\n }", "sliderOnChange() {\n updateShaderToyTime(this.sliderInput.value);\n }", "function dragStop(e) {\n \n //setup variables\n var that = e.data,\n sliderMoveVal,\n trackingSlider = '';\n \n ///check if our slider is disabled\n if (!that.options.isDisabled) {\n \n //check if there is a step option\n if (that.options.step > 0) {\n \n //take the dragging element and move to the postion that you need\n if ($(that._prvt.draggingElem)[0] === that._prvt.handleMax[0]) {\n \n //calculate the value\n if(that._prvt.currentMax > that.options.maxLimit){\n that._prvt.currentMax = that.options.maxLimit;\n }\n \n //\n sliderMoveVal = unitsToPixels(that , that._prvt.currentMax) - that._prvt.innerOffset;\n \n //tracking value to add\n trackingSlider = '_max';\n } else {\n //out\n\n //check if the slider went lower than it should\n if(that._prvt.currentMin < that.options.minLimit){\n \n that._prvt.currentMin = that.options.minLimit;\n }\n \n //calculate value\n sliderMoveVal = unitsToPixels(that , that._prvt.currentMin) - that._prvt.innerOffset;\n \n //tracking value to add\n trackingSlider = '_min';\n }\n \n //animate slider\n $(that._prvt.draggingElem).animate({\n 'left': sliderMoveVal + 'px'\n }, 30);\n \n //adjust the sliderRange element\n $(that._prvt.sliderRange).animate({\n 'left': unitsToPixels(that , that._prvt.currentMin) - that._prvt.innerOffset+'px',\n 'width': (unitsToPixels(that , that._prvt.currentMax) - unitsToPixels(that , that._prvt.currentMin))+(that._prvt.handleWidth / 2)+'px'\n }, 30);\n }\n \n //remove custom events\n $('body').off('._RangeSlider'); //dragStop\n \n //set a flag for dragging\n that._prvt.isDragging = false;\n \n //trigger a custom event that updates backbone.js or any other listener\n $(that.element).trigger(that.options.events.onChange, {\n 'name': that.options.filterName,\n 'currentMin': that._prvt.currentMin,\n 'currentMax': that._prvt.currentMax\n });\n\n //bring back the click on the bar\n $(e.data.element).on('click._RangeSlider', '.sliderBar', that, onClickUpdate); //onClickUpdate\n\n }\n e.preventDefault();\n e.stopPropagation();\n }", "updateBlurValue() {\n if (this.blur < this.blurMin || this.blur > this.blurMax)\n this.blurChange = -this.blurChange;\n\n this.blur += this.blurChange;\n }", "function filterPercentSliderChange(slider) {\n\tfilterPercentValue = slider.value;\n\t\n\tif(filterByPercent) {\t\n\t\tredrawWithPercentFilter();\n\t}\n}", "updateSlider() {\n var outsideLoop = false;\n\n //this.loop = window.TimebarLoop;\n\n if (gShaderToy && !this.busy) {\n this.sliderInput.value = gShaderToy.mTf;\n }\n\n if (this.loop && gShaderToy.mTf > this.maxValueInput.value * 1000) {\n this.sliderInput.value = this.minValueInput.value * 1000;\n outsideLoop = true;\n }\n\n if (this.loop && gShaderToy.mTf < this.minValueInput.value * 1000) {\n this.sliderInput.value = this.minValueInput.value * 1000;\n outsideLoop = true;\n }\n\n if (outsideLoop) {\n updateShaderToyTime(this.sliderInput.value);\n updateInputsTime(this.sliderInput.value);\n }\n\n setTimeout(this.updateSlider.bind(this), 26);\n }", "updateSlider() {\n var outsideLoop = false;\n\n //this.loop = window.TimebarLoop;\n\n if (gShaderToy && !this.busy) {\n this.sliderInput.value = gShaderToy.mTf;\n }\n\n if (this.loop && gShaderToy.mTf > this.maxValueInput.value * 1000) {\n this.sliderInput.value = this.minValueInput.value * 1000;\n outsideLoop = true;\n }\n\n if (this.loop && gShaderToy.mTf < this.minValueInput.value * 1000) {\n this.sliderInput.value = this.minValueInput.value * 1000;\n outsideLoop = true;\n }\n\n if (outsideLoop) {\n updateShaderToyTime(this.sliderInput.value);\n updateInputsTime(this.sliderInput.value);\n }\n\n setTimeout(this.updateSlider.bind(this), 26);\n }", "_inputBlurHandler() {\n const that = this;\n\n if (that._suppressBlurEvent === true) {\n // suppresses validation because it was already handled in \"_incrementOrDecrement\" function\n that._suppressBlurEvent = false;\n\n if (that._formattedValue) {\n that._cachedInputValue = that._formattedValue;\n that.$.input.value = that._formattedValue;\n delete that._formattedValue;\n }\n }\n else if (that.$.input.value !== that._editableValue) {\n that._triggerChangeEvent = true;\n that._validate();\n that._triggerChangeEvent = false;\n }\n else {\n that.$.input.value = that._cachedInputValue;\n }\n\n if (that.radixDisplay) {\n that.$.radixDisplayButton.removeAttribute('focus');\n }\n\n if (that.opened) {\n that._closeRadix();\n }\n\n if (that.spinButtons) {\n that.$.spinButtonsContainer.removeAttribute('focus');\n }\n if (that.showUnit) {\n that.$.unitDisplay.removeAttribute('focus');\n }\n\n that.removeAttribute('focus');\n }", "function weightSliderValueChange() {\n $('#sliderWeight').on('input', function () { //versions of IE < 9 do not support this event, they have proprietary onPropertyChange event\n $('.sliderWeightValue').text($(this).val() + \"%\");\n }).on('mouseup', function () {\n var value = $(this).val();\n\n //remove selected value on another slider\n $('#sliderSummation').val(0);\n $('.sliderSummationValue').text(\"-\");\n\n //show overlays\n $('#controls-panel-overlay').show();\n $('#best-results-table-overlay').show();\n\n $('.sliderWeightValue').text(value + \"%\");\n $('input[type=radio][name=select]:checked').prop('checked', false);\n setTimeout(function(){\n selectButtonsByWeight(value);\n displayModelsSelectedByWeight(value, selectedSolution);\n displayCurves();\n }, 10);\n });\n}", "function blackAndWhiteThresholdSliderOnInput() {\n\tvar slider = document.getElementById(\"BlackAndWhiteThresholdSlider\");\n\tvar num_input = document.getElementById(\"BlackAndWhiteThresholdValue\");\n\t\n\tnum_input.value = slider.value;\n}", "function weightSumValueChange() {\n $('#sliderSummation').on('input', function () {\n $('.sliderSummationValue').text($(this).val() + \"%\");\n }).on('mouseup', function () {\n var value = $(this).val();\n\n //remove selected value on another slider\n $('#sliderWeight').val(0);\n $('.sliderWeightValue').text(\"-\");\n\n //show overlays\n $('#controls-panel-overlay').show();\n $('#best-results-table-overlay').show();\n\n $('.sliderSummationValue').text(value + \"%\");\n $('input[type=radio][name=select]:checked').prop('checked', false);\n setTimeout(function(){\n selectButtonsByWeightSummation(value, selectedSolution);\n displayModels();\n displayCurves();\n }, 10);\n });\n}", "_calcSliderValue(mouseVal, valueVar) {\n this.debounce('_calcSliderValue', function() {\n this._calcSliderValueDebounced(mouseVal, valueVar);\n }, 10);\n }", "sliderOnMouseDown() {\n this.wasPaused = gShaderToy.mIsPaused;\n this.sliderInput.min = parseInt(this.minValueInput.value * 1000, 10);\n this.sliderInput.max = parseInt(this.maxValueInput.value * 1000, 10);\n\n if (!this.wasPaused) {\n this.busy = true;\n gShaderToy.pauseTime();\n }\n\n return false;\n }", "updateSlider_() {\n if (!this.sliderInput_) {\n return;\n }\n this.sliderInput_.setAttribute('value', this.getValue());\n }", "function blackAndWhiterThresholdValueOnInput() {\n\tvar slider = document.getElementById(\"BlackAndWhiteThresholdSlider\");\n\tvar num_input = document.getElementById(\"BlackAndWhiteThresholdValue\");\n\t\n\tslider.value = num_input.value;\n}", "sliderOnMouseDown() {\n this.wasPaused = gShaderToy.mIsPaused;\n this.sliderInput.min = parseInt(\n this.minValueInput.value * 1000,\n 10\n );\n this.sliderInput.max = parseInt(\n this.maxValueInput.value * 1000,\n 10\n );\n\n if (!this.wasPaused) {\n this.busy = true;\n gShaderToy.pauseTime();\n }\n\n return false;\n }", "blur() {\r\n this.isFocussed = false;\r\n this.showLimits = true;\r\n }", "interfaceBPMSliderCallback(faustControler) {\n var val;\n var input = faustControler.faustInterfaceView.slider;\n var fval = Number((parseFloat(input.value) * parseFloat(faustControler.itemParam.step)) + parseFloat(faustControler.itemParam.min));\n val = fval.toFixed(parseFloat(faustControler.precision));\n faustControler.value = val;\n var output = faustControler.faustInterfaceView.output;\n //---- update the value text\n if (output)\n output.textContent = \"\" + val + \" \" + faustControler.unit;\n this.BPM = fval;\n //this.setBPM(fval) \n }", "function setBlur(sender){\n sender.style.borderColor = \"\";\n showTextProgress(sender);\n if (theProgressDiv != null){\n hideObject(document.getElementById(theProgressDiv));\n }\n}", "function update_slider(slider_name, value, breakeven_active) { \n $('#baseline_service_life_text').tooltip('hide')\n $('#proposed_service_life_text').tooltip('hide')\n $('#lcoe_proposed').tooltip('hide')\n $('#lcoe_baseline').tooltip('hide')\n\n var slider = document.getElementById(slider_name);\n var max = slider.noUiSlider.options.range.max\n var min = slider.noUiSlider.options.range.min\n value = parseFloat(value)\n\n key = slider_name.substring(0, 8) // 'baseline' and 'proposed' are both 8 letters\n\n // for break-even purposes, calculate the maximum values after the slider is moved to make sure calculation based on most recent values\n // the following four conditions handle the popups on service life and degradation\n if (slider_name == 'baseline_degradation_rate') {\n\n var year = parseFloat($('#'+key+'_service_life_text').val())\n var max_degradation = 1 / (year - 0.5) * 100\n\n // checking equality\n if (!isNaN(value) && !(value < max_degradation)) {\n\n value = max_degradation // restrict displayed value based on maximum\n $('#baseline_degradation_rate_text').val(max_degradation.toFixed(2))\n document.getElementById('baseline_degradation_rate_text').setAttribute('data-original-title', 'Choose a shorter service life to enable a larger degradation rate.');\n\n $('#baseline_degradation_rate_text').tooltip('enable')\n $('#baseline_degradation_rate_text').tooltip('show')\n setTimeout(function(){\n $('#baseline_degradation_rate_text').tooltip('hide');\n }, 3000);\n } else {\n $('#baseline_degradation_rate_text').tooltip('disable')\n }\n\n }\n\n if (slider_name == 'proposed_degradation_rate') {\n var year = parseFloat($('#'+key+'_service_life_text').val())\n var max_degradation = 1 / (year - 0.5) * 100\n\n if (!isNaN(value) && !(value < max_degradation)) { //!isNaN to avoid this condition when '-' inputted before negative number\n value = max_degradation\n $('#proposed_degradation_rate_text').val(max_degradation.toFixed(2))\n document.getElementById('proposed_degradation_rate_text').setAttribute('data-original-title', 'Choose a shorter service life to enable a larger degradation rate.');\n\n $('#proposed_degradation_rate_text').tooltip('enable')\n $('#proposed_degradation_rate_text').tooltip('show')\n setTimeout(function(){\n $('#proposed_degradation_rate_text').tooltip('hide');\n }, 3000);\n } else {\n $('#proposed_degradation_rate_text').tooltip('disable')\n }\n }\n if (slider_name == 'baseline_service_life') {\n var degradation_rate = parseFloat($('#'+key+'_degradation_rate_text').val())/100.0\n var max_year = 1 / degradation_rate + 0.5\n if (!isNaN(value) && !(value < max_year.toFixed(0))) { //!isNaN to avoid this condition when '-' inputted before negative number\n value = max_year.toFixed(0) // round to integer\n\n $('#baseline_service_life_text').val(max_year.toFixed(0))\n document.getElementById('baseline_service_life_text').setAttribute('data-original-title', 'Choose a smaller degradation rate to enable a longer service life.');\n\n $('#baseline_service_life_text').tooltip('enable')\n $('#baseline_service_life_text').tooltip('show')\n\n setTimeout(function(){\n $('#baseline_service_life_text').tooltip('hide');\n }, 3000);\n } else {\n $('#baseline_service_life_text').tooltip('disable')\n }\n } \n if (slider_name == 'proposed_service_life') {\n var degradation_rate = parseFloat($('#'+key+'_degradation_rate_text').val())/100.0\n var max_year = 1 / degradation_rate + 0.5\n if (!isNaN(value) && !(value < max_year.toFixed(0))) {\n value = max_year.toFixed(0)\n\n $('#proposed_service_life_text').val(max_year.toFixed(0))\n document.getElementById('proposed_service_life_text').setAttribute('data-original-title', 'Choose a smaller degradation rate to enable a longer service life.');\n\n $('#proposed_service_life_text').tooltip('enable')\n $('#proposed_service_life_text').tooltip('show')\n\n setTimeout(function(){\n $('#proposed_service_life_text').tooltip('hide');\n }, 3000);\n } else {\n $('#proposed_service_life_text').tooltip('disable')\n }\n } \n\n var degradation_rate = parseFloat($('#'+key+'_degradation_rate_text').val())/100.0\n var year = parseFloat($('#'+key+'_service_life_text').val())\n var max_year = 1 / degradation_rate + 0.5\n \n if (max_year > SERVICE_LIFE_SLIDER_MAX) {\n max_year = SERVICE_LIFE_SLIDER_MAX\n } \n var max_degradation = 1 / (year - 0.5) * 100\n if (max_degradation > DEGRADATION_MAX) {\n max_degradation = DEGRADATION_MAX\n } \n\n // when the degradation or service life slider moves, update the maximum of the other slider\n if (slider_name == 'baseline_degradation_rate') {\n if (degradation_rate > 0) {\n document.getElementById('baseline_service_life').noUiSlider.updateOptions({\n padding: [0, SERVICE_LIFE_SLIDER_MAX-parseInt(max_year)]\n });\n }\n }\n if (slider_name == 'proposed_degradation_rate') {\n if (degradation_rate > 0) {\n document.getElementById('proposed_service_life').noUiSlider.updateOptions({\n padding: [0, SERVICE_LIFE_SLIDER_MAX-parseInt(max_year)]\n });\n }\n }\n if (slider_name == 'baseline_service_life') {\n document.getElementById('baseline_degradation_rate').noUiSlider.updateOptions({\n padding: [0, Math.round((DEGRADATION_MAX - max_degradation)*100)/100 ]\n });\n }\n if (slider_name == 'proposed_service_life') {\n document.getElementById('proposed_degradation_rate').noUiSlider.updateOptions({\n padding: [0, Math.round((DEGRADATION_MAX - max_degradation)*100)/100 ] \n });\n } \n\n // efficiency bounded by 0% and 100%\n if (slider_name == 'baseline_efficiency') {\n if (value < 0 || isNaN(value)) $('#baseline_efficiency_text').val(0)\n if (value > EFFICIENCY_MAX) $('#baseline_efficiency_text').val(EFFICIENCY_MAX)\n if (!breakeven_active) $('#baseline_efficiency_text').tooltip('disable') \n }\n if (slider_name == 'proposed_efficiency') {\n if (value < 0 || isNaN(value)) $('#proposed_efficiency_text').val(0)\n if (value > EFFICIENCY_MAX) $('#proposed_efficiency_text').val(EFFICIENCY_MAX)\n if (!breakeven_active) $('#proposed_efficiency_text').tooltip('disable') \n }\n\n // degradation rate lower bounded by zero\n if (slider_name == 'baseline_degradation_rate' && (value < 0 || isNaN(value))) {\n $('#baseline_degradation_rate_text').val(0)\n if (!breakeven_active) $('#baseline_degradation_rate_text').tooltip('disable') \n }\n if (slider_name == 'proposed_degradation_rate' && (value < 0 || isNaN(value))) {\n if (!breakeven_active) $('#proposed_degradation_rate_text').tooltip('disable') \n }\n\n // energy yield lower bounded by zero\n if (slider_name == 'baseline_energy_yield' && (value < 0 || isNaN(value))) {\n $('#baseline_energy_yield_text').val(0)\n if (!breakeven_active) $('#baseline_energy_yield_text').tooltip('disable') \n }\n if (slider_name == 'proposed_energy_yield' && (value < 0 || isNaN(value))) {\n $('#proposed_energy_yield_text').val(0)\n if (!breakeven_active) $('#proposed_energy_yield_text').tooltip('disable') \n }\n\n // displays warning if non-positive integer service life\n if ((slider_name == 'baseline_service_life' && (!Number.isInteger(value))) || (slider_name == 'baseline_service_life' && value >= SERVICE_LIFE_CAP) || (slider_name == 'baseline_service_life' && value < 1)) {\n\n if (value > SERVICE_LIFE_CAP) { // set service life maximum at 1000 (calculator freezes if service life is too large)\n $('#baseline_service_life_text').val(SERVICE_LIFE_CAP)\n }\n\n if (value < 1) { // restrict to positive numbers\n $('#baseline_service_life_text').val(1)\n }\n\n if (!breakeven_active) { // only display for non-break-even interaction\n\n document.getElementById('baseline_service_life_text').setAttribute('data-original-title', 'Service life must be a positive integer no greater than 1000.');\n \n $('#baseline_service_life_text').tooltip('enable')\n $('#baseline_service_life_text').tooltip('show')\n }\n } else {\n $('#baseline_service_life_text').tooltip('disable')\n }\n\n if ((slider_name == 'proposed_service_life' && (!Number.isInteger(value))) || (slider_name == 'proposed_service_life' && value >= SERVICE_LIFE_CAP) || (slider_name == 'proposed_service_life' && value < 1)) {\n\n if (value > SERVICE_LIFE_CAP) { // set service life maximum at 1000 (calculator freezes if service life is too large)\n $('#proposed_service_life_text').val(SERVICE_LIFE_CAP)\n }\n\n if (value < 1) { // restrict to positive numbers\n $('#proposed_service_life_text').val(1)\n }\n\n if (!breakeven_active) {\n document.getElementById('proposed_service_life_text').setAttribute('data-original-title', 'Service life must be a positive integer no greater than 1000.');\n \n $('#proposed_service_life_text').tooltip('enable')\n $('#proposed_service_life_text').tooltip('show')\n }\n } else {\n $('#proposed_service_life_text').tooltip('disable')\n } \n\n // The conditionals allow the user to put in an out-of-bounds number\n if (value >= max) {\n slider.noUiSlider.set(max);\n } else if (value <= min) {\n slider.noUiSlider.set(min);\n } else {\n slider.noUiSlider.set(value);\n }\n}", "function SliderListener() {\n document.getElementById('slider-start').addEventListener('input', function(e) {\n //code to be executed when event listener is triggerd\n var SliderValue = \"\" + parseInt(e.target.value, 10) + \"\" //create vare with range slider value\n filterBy(SliderValue); //trigger Fiter function adn send varibale with it.\n });\n}", "function updateSlider() {\n\n // Empty input field\n if (volumeNumber.value === \"\") {\n volumeSlider.value = 0;\n volumeImage.src = \"./assets/media/icons/volume-level-0.svg\";\n\n // Input Field Range 1 to 100\n } else {\n if (volumeNumber.value == 0) {\n volumeImage.src = \"./assets/media/icons/volume-level-0.svg\";\n } else if (1 <= volumeNumber.value && volumeNumber.value <= 33) {\n volumeImage.src = \"./assets/media/icons/volume-level-1.svg\";\n } else if (34 <= volumeNumber.value && volumeNumber.value <= 66) {\n volumeImage.src = \"./assets/media/icons/volume-level-2.svg\";\n } else if (67 <= volumeNumber.value && volumeNumber.value <= 100) {\n volumeImage.src = \"./assets/media/icons/volume-level-3.svg\";\n } else {\n volumeNumber.value = 100;\n }\n volumeSlider.value = volumeNumber.value;\n }\n}", "function startSliderWatch() {\n\t\t$(\".donate-range\").change(function(){\n\t\t\tvar $thisVal = $(this).val();\n\t\t\tupdateSliderValue($thisVal);\n\t\t\tupdateSliderMessage($thisVal);\n\t\t\t$('.donate-slider-amount').removeClass('blank').html('$'+$thisVal);\n\t\t});\n\n\t\tsetTimeout(function(){ updateSliderValue($(\".donate-range\").val()); },50);\n\t}", "function numericField_Blur(inputBox, settings) {\n\t\tvar fieldValueNumeric = parseFloat($(inputBox).val());\n\t\tvar $inputBox = $(inputBox);\n\n\t\tif (isNaN(fieldValueNumeric)) {\n\t\t\t$inputBox.val(\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (isNumeric(settings.min) && fieldValueNumeric < settings.min)\n\t\t\t$inputBox.val(\"\");\n\n\t\tif (isNumeric(settings.max) && fieldValueNumeric > settings.max)\n\t\t\t$inputBox.val(\"\");\n\t}", "function stopSlider() {\n document.removeEventListener('mousemove', moveSlider);\n slider.style.cursor = 'grab';\n }", "function seekVolume() {\n volume = volume_slide.value / 100;\n audi.volume = volume;\n //let new position of slider determine background color length\n volume_slide.oninput = function() {\n\n var valu = (this.value-this.min)/(this.max-this.min)*100;\n this.style.background = 'linear-gradient(to right, #fff 0%, #fff ' + valu + '%, rgb(156, 152, 152) ' + valu + '%, rgb(156, 152, 152) 100%)';\n };\n \n \n}", "function updateDeathPrecentSlider(valA, valB){\n $('.deathPercentage-slider').slider(\"values\", 0, valA)\n $(\".deathPercentage-rate-slider.lower-handle\").text(valA)\n $('.deathPercentage-slider').slider(\"values\", 1, valB)\n $(\".deathPercentage-rate-slider.upper-handle\").text(valB)\n}", "function updatePercentFilterText(slider) {\n\tdocument.getElementById(\"filterPercentText\").innerHTML = \"\" + slider.value + \"%\";\n}", "function updateSlider(slider, number, type){\n slider.addEventListener( \"input\", ()=>{\n number.value = slider.value;\n });\n number.addEventListener(\"input\", ()=>{\n numberRegex(type);\n slider.value = number.value;\n });\n number.addEventListener(\"keydown\", (e)=>{\n if(!(e.key==\"0\"||e.key==\"1\"||e.key==\"2\"||e.key==\"3\"||e.key==\"4\"||e.key==\"5\"||e.key==\"6\"||e.key==\"7\"||e.key==\"8\"||e.key==\"9\"||e.key==\"Backspace\")){\n e.preventDefault();\n }\n else{\n if(e.key==\"Backspace\"&&/^[1-9]{1}$/.test(number.value)){\n e.preventDefault();\n }\n }\n })\n const numberRegex = (type)=>{\n let regex = type==2?/^[1-9]{1}[0-9]{0,2}/:/^[1-9]{1}[0-9]{0,4}/;\n // caps the number to be between 1 and 10000)\n console.log(number.value);\n if(parseInt(number.value)>10000){\n number.value = 10000;\n }\n else if(parseInt(number.value)<1){\n number.value = 1;\n }\n number.value = number.value?((regex.test(number.value))?(number.value.match(regex)[0]):1):1;\n number.value.toString();\n }\n}", "function resetSlider(bins){\n document.getElementById(\"theSlider\").value = bins;\n }", "onSliderChange_() {\n this.setEditorValue_(this.sliderInput_.value);\n }", "function happinessSlider(data) {\n slider = d3.select(\"div#legend\")\n .append(\"input\")\n .attr(\"type\", \"range\")\n .attr(\"min\", \"0\")\n .attr(\"max\", \"30\")\n .attr(\"step\", \"2\")\n .attr(\"id\", \"percentage\");\n\n update(percentage);\n\n d3.select(\"#percentage\")\n .on(\"input\", function() {\n update(+this.value);\n percentage = +this.value;\n render(data, keyValues, percentage);\n find_lines();\n });\n }", "function setDeathPercentageSlider() {\n var handleA = $(\".deathPercentage-rate-slider.lower-handle\");\n var handleB = $(\".deathPercentage-rate-slider.upper-handle\");\n\n $('.deathPercentage-slider').slider({\n create: function (e, ui) {\n handleA.text(0);\n handleB.text(0.70);\n },\n slide: function (e, ui) {\n if (ui.values[0] == ui.values[1])\n return false;\n if ($(ui.handle).hasClass(\"upper-handle\")) {\n handleB.text(ui.value);\n maxDeath = ui.value\n }\n else {\n handleA.text(ui.value);\n minDeath = ui.value\n }\n },\n orientation: 'horizontal',\n range: true,\n min: 0,\n max: 0.70,\n step: 0.05,\n values: [0, 0.70],\n animate: true\n });\n}", "function updateControls(animate) {\n var rate, value_sub, max_sub, min_sub, min_reverse_sign, min_max_length, nsb_offset, psb_offset, length_offset = 0;\n if ($ps_wrap[0].parentNode === null) {\n return; // Bail out since it's not attached to the DOM\n }\n value_sub = properties.value;\n max_sub = properties.max;\n min_sub = properties.min;\n if (max_sub <= min_sub) {\n rate = 0;\n } else {\n rate = ((value_sub - min_sub) / (max_sub - min_sub));\n }\n if (!!animate && (disabled === false) && (transition_class_added === false)) {\n addTransitionClass();\n }\n min_reverse_sign = min_sub * -1;\n min_max_length = (min_reverse_sign + max_sub);\n psb_offset = (min_reverse_sign / min_max_length) * 100;\n nsb_offset = 100 - psb_offset;\n switch (type) {\n case 'horizontal':\n if (min_sub >= 0) {\n length_offset = psb_offset;\n psb_offset = 0;\n }\n $ps_range_positive_spectrum_bar.css('left', psb_offset + '%');\n if (max_sub <= 0) {\n length_offset = nsb_offset;\n nsb_offset = 0;\n }\n $ps_range_negative_spectrum_bar.css('right', nsb_offset + '%');\n if (value_sub < 0) {\n $ps_range_negative_spectrum_bar.css('width', (((Math.abs(value_sub) / min_max_length) * 100) + length_offset) + '%');\n $ps_range_positive_spectrum_bar.css('width', 0);\n } else {\n $ps_range_negative_spectrum_bar.css('width', 0);\n $ps_range_positive_spectrum_bar.css('width', (((value_sub / min_max_length) * 100) + length_offset) + '%');\n }\n $ps_range_bar.css('right', (100 - (rate * 100)) + '%');\n $ps_toggle_neck.css('left', (rate * 100) + '%');\n break;\n case 'vertical':\n if (min_sub >= 0) {\n length_offset = psb_offset;\n psb_offset = 0;\n }\n $ps_range_positive_spectrum_bar.css('bottom', psb_offset + '%');\n if (max_sub <= 0) {\n length_offset = nsb_offset;\n nsb_offset = 0;\n }\n $ps_range_negative_spectrum_bar.css('top', nsb_offset + '%');\n if (value_sub < 0) {\n $ps_range_negative_spectrum_bar.css('height', (((Math.abs(value_sub) / min_max_length) * 100) + length_offset) + '%');\n $ps_range_positive_spectrum_bar.css('height', 0);\n } else {\n $ps_range_negative_spectrum_bar.css('height', 0);\n $ps_range_positive_spectrum_bar.css('height', (((value_sub / min_max_length) * 100) + length_offset) + '%');\n }\n $ps_range_negative_spectrum_bar.css('top', nsb_offset + '%');\n $ps_range_positive_spectrum_bar.css('bottom', psb_offset + '%');\n $ps_range_bar.css('top', (100 - (rate * 100)) + '%');\n $ps_toggle_neck.css('bottom', (rate * 100) + '%');\n break;\n }\n return pebble_slider_object;\n }", "function colorSlider() {\n seek_slider.oninput = function() {\n\n var value = (this.value-this.min)/(this.max-this.min)*100;\n this.style.background = 'linear-gradient(to right, #fff 0%, #fff ' + value + '%, rgb(156, 152, 152) ' + value + '%, rgb(156, 152, 152) 100%)';\n };\n \n \n}", "function befUpdateSlider($el, valIndex, sliderOptions) {\n var val = parseFloat($el.val(), 10),\n currentMin = $el.parents('div.views-widget').next('.bef-slider').slider('values', 0),\n currentMax = $el.parents('div.views-widget').next('.bef-slider').slider('values', 1);\n // If we have a range slider.\n if (valIndex != null) {\n // Make sure the min is not more than the current max value.\n if (valIndex == 0 && val > currentMax) {\n val = currentMax;\n }\n // Make sure the max is not more than the current max value.\n if (valIndex == 1 && val < currentMin) {\n val = currentMin;\n }\n // If the number is invalid, go back to the last value.\n if (isNaN(val)) {\n val = $el.parents('div.views-widget').next('.bef-slider').slider('values', valIndex);\n }\n }\n else {\n // If the number is invalid, go back to the last value.\n if (isNaN(val)) {\n val = $el.parents('div.views-widget').next('.bef-slider').slider('value');\n }\n }\n // Make sure we are a number again.\n val = parseFloat(val, 10);\n // Set the slider to the new value.\n // The slider's change event will then update the textfield again so that\n // they both have the same value.\n if (valIndex != null) {\n $el.parents('div.views-widget').next('.bef-slider').slider('values', valIndex, val);\n }\n else {\n $el.parents('div.views-widget').next('.bef-slider').slider('value', val);\n }\n }", "function onBlur() {\n\t\t\t// Set last value as input value\n\t\t\t$$invalidate(2, inputValue = value);\n\t\t}", "function adjustRange() {\n\t\t$('input[type=range]').on('input', function(e) {\n\t\t var min = e.target.min,\n\t\t max = e.target.max,\n\t\t val = e.target.value;\n\t\t \n\t\t $(e.target).css({\n\t\t 'backgroundSize': (val - min) * 100 / (max - min) + '% 100%'\n\t\t });\n\t\t}).trigger('input');\t\n\t}", "function onBlur() {\n\t\t\t$$invalidate(3, inputValue = value);\n\t\t}", "interfaceSliderCallback(faustControler) {\n var val;\n if (faustControler.faustInterfaceView.slider) {\n var input = faustControler.faustInterfaceView.slider;\n val = Number((parseFloat(input.value) * parseFloat(faustControler.itemParam.step)) + parseFloat(faustControler.itemParam.min)).toFixed(parseFloat(faustControler.precision));\n }\n else if (faustControler.faustInterfaceView.button) {\n var input = faustControler.faustInterfaceView.button;\n if (faustControler.value == undefined || faustControler.value == \"0\") {\n faustControler.value = val = \"1\";\n }\n else {\n faustControler.value = val = \"0\";\n }\n }\n var text = faustControler.itemParam.address;\n faustControler.value = val;\n var output = faustControler.faustInterfaceView.output;\n //---- update the value text\n if (output)\n output.textContent = \"\" + val + \" \" + faustControler.unit;\n // \tSearch for DSP then update the value of its parameter.\n this.setParamValue(text, val);\n for (var address in faustControler.valueChangeCallbacks) {\n let cb = faustControler.valueChangeCallbacks[address];\n cb(address, val);\n }\n }", "function onSliderChange () {\n // show spinner\n document.getElementById('loader').style.display = 'block'\n\n // get slider values\n data.inputs = {\n 'Count':document.getElementById('count').valueAsNumber,\n 'Radius':document.getElementById('radius').valueAsNumber,\n 'Length':document.getElementById('length').valueAsNumber\n }\n compute()\n}", "_updateValue () {\n let sliderWidth = this._sliderElement.offsetWidth;\n\n // Calculate the new value\n let { minValue, maxValue } = this._options;\n let percentage = this._xPosition / sliderWidth;\n let value = minValue + (maxValue - minValue) * percentage;\n this.emit(\"update\", value);\n }", "function setPokestops(balanceXP, inputType) {\n if(inputType != 'range'){\n let stops = Math.floor(balanceXP/250) + 1;\n document.getElementById('stopValue').innerHTML = stops;\n }else{\n let stops = Math.floor(balanceXP/250);\n document.getElementById('stopValue').innerHTML = stops;\n }\n\n}", "labeledInput(value, key) {\n let inputClass = 'input-valid'\n if (Number.isNaN(Number.parseFloat(value))){\n inputClass = 'input-invalid'\n }\n return <div key={key}>\n <ValueSlider\n label={'Income ' + (key + 1)}\n value={value}\n id={key}\n callback={(x) => this.setIncome(key, x)}\n delCallback={()=>this.delIncome(key)}\n className={inputClass}\n />\n </div>\n }", "function updateSlider(obj, that) {\n var currMinPixel, \n currMaxPixel, \n leftCss, \n labelsVal;\n\n //check if our object is an object\n if (typeof obj !== 'undefined') {\n if (!obj.state) {\n \n //call disabled sliders\n that.options.isDisabled = true;\n //\n disableSlider(that);\n \n } else {\n \n //switch the flag for dsiabled slider\n that.options.isDisabled = false;\n \n //remove disabled class\n $(that.element).removeClass('disabled');\n \n //setup all the local variables \n that._prvt.currentMin = obj.min;\n that._prvt.currentMax = obj.max;\n \n //setup the Limit Values\n that.options.minLimit = obj.min;\n that.options.maxLimit = obj.max;\n \n //add values\n currMinPixel = unitsToPixels(that, that._prvt.currentMin);\n currMaxPixel = unitsToPixels(that, that._prvt.currentMax);\n \n //get the CSS property value\n leftCss = parseInt(that._prvt.sliderBarBack.css('left'), 10);\n \n //adjust current offset value\n that._prvt.innerOffset = currMinPixel;\n \n //this will reset the intenal values to what they need to be\n that._prvt.sliderBar.animate({ \n //setup the width and position of this based on the values that are passed in\n 'left': currMinPixel + leftCss,\n 'width': currMaxPixel - currMinPixel + that._prvt.handleWidth + 'px'\n }, 500);\n \n //animate slider range color\n that._prvt.sliderRange.animate({ \n //setup the width and position of this based on the values that are passed in\n 'left': 0,\n 'width': (currMaxPixel - currMinPixel) + (that._prvt.handleWidth / 2) + 'px'\n }, 500);\n \n //adjust values and slider position\n that._prvt.handleMax.animate({\n 'left': currMaxPixel - currMinPixel\n }, 400);\n \n //update min\n that._prvt.handleMin.animate({\n 'left': currMinPixel - currMinPixel\n }, 400);\n \n //update labels\n labelsVal = formatLabels(that);\n that._prvt.maxLabel.html(labelsVal.maxVal);\n that._prvt.minLabel.html(labelsVal.minVal);\n \n //run a funciton that checks for values and makes items hidden if they need to be\n checkMinMaxValues(that);\n }\n }\n }", "function handleBudgetUpdate(values) {\n const slider = $(this);\n const sliderLabels = slider.siblings(\".slider-label\");\n const budgetLabels = slider.siblings(\".slider-values\");\n budgetLabels.removeClass(\"hidden\");\n budgetLabels.find(\".min-value\").html(values[0]);\n budgetLabels.find(\".max-value\").html(values[1]);\n sliderLabels.find(\".label-min\").html(values[0]);\n sliderLabels.find(\".label-max\").html(values[1]);\n let min;\n let max;\n let inputValue;\n if (String(slider.data(\"min\")) !== values[0].replace(\"€\", \"\")) {\n min = values[0].replace(\"€\", \"\");\n }\n if (String(slider.data(\"max\")) !== values[1].replace(\"€\", \"\")) {\n max = values[1].replace(\"€\", \"\");\n }\n if (min) {\n inputValue = min;\n if (max) {\n inputValue += \",\" + max;\n }\n } else if (max) {\n inputValue = \"0,\" + max;\n }\n const input = slider.siblings(\".price-input\");\n if (inputValue) {\n input.attr(\"disabled\", false);\n input.val(inputValue);\n } else {\n input.attr(\"disabled\", true);\n }\n\n}", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "handleBlur(event) {\n this.finishUpdate();\n }", "function adjustSliderValue(){\n if(scroll_value[0]>scroll_value[1]){\n scroll_value[1]=[scroll_value[0], scroll_value[0]=scroll_value[1]][0];\n index==0?index=1:index=0;\n }\n refreshUI(true);\n}", "function blurHandler() {\n isWindowFocused = false;\n controlPressed = false;\n }", "function updateRange(ui, rangeInfo) {\r\n if (ui.values[1] - ui.values[0] >= 2) {\r\n $('#slider-range').slider(\"enable\");\r\n setStartEndIndex(ui.values[0], ui.values[1]);\r\n rangeInfo.html(toKm(g_data['kmstart']) + \" - \" + toKm(g_data['kmend']));\r\n $('#search-input .rangekm').html(toKm(g_data['kmstart']) + ' - ' + toKm(g_data['kmend']));\r\n }\r\n\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function restInputs() {\r\n const allSliders = document.querySelectorAll('input[type=\"range\"]');\r\n allSliders.forEach((slider) => {\r\n // console.log(slider.name);\r\n if (slider.name === 'hue') {\r\n const hueColor = initialColors[slider.getAttribute('data-hue')];\r\n //get the hue value from the current color with hsl() that return an array with the hue, brightness and sat values of a color\r\n const hueValue = chroma(hueColor).hsl()[0];\r\n slider.value = Math.floor(hueValue);\r\n } else if (slider.name === 'brightness') {\r\n const brightnessColor = initialColors[slider.getAttribute('data-bright')];\r\n const brightnessValue = chroma(brightnessColor).hsl()[2];\r\n slider.value = brightnessValue.toFixed(2);\r\n } else if (slider.name === 'saturation') {\r\n //get the data-set with different techinique\r\n const satColor = initialColors[slider.dataset.sat];\r\n const satValue = chroma(satColor).hsl()[1];\r\n slider.value = satValue.toFixed(2);\r\n }\r\n });\r\n}", "function blurFilterField(e) {\n var _obj = e || {},\n _type = _obj.type || null;\n\n state.filter.focused = false;\n\n if (_type !== 'blur' || _type === 'force') {\n $.filterField.softKeyboardOnFocus = Ti.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS;\n $.filterField.blur();\n }\n\n $.filterField.editable = false;\n $.filterField.touchEnabled = false;\n\n $.clearFilterBtn.animate({ opacity:0.0, duration:250 }, function() {\n $.clearFilterBtn.visible = false;\n });\n $.filterBg.animate({ backgroundColor:'#969696', duration:250 });\n\n if ($.filterField.value.length > 0) {\n $.filterField.color = '#333';\n $.filterField.animate({ left:38, duration:250 });\n $.filterLbl.animate({ left:50, duration:250 });\n } else {\n $.filterLbl.animate({ left:50, opacity:1.0, duration:250 });\n }\n}", "function textBoxToSlider(textBox, isMin){\n $(textBox).on(\"change keyup paste\", function(){\n passCorrectedValuesToSliderAndGetThem(this, isMin)\n })\n }", "sliderReleased(){\r\n clearInterval(this.interval)\r\n this.interval = false\r\n }", "function adjustBubbles() {\n\n // make sure the low value bubble is actually within the slider\n fitToBar(refs.currBub);\n\n if(gap(refs.minBub, refs.currBub) < 5) {\n // the low bubble overlaps the minLimit bubble\n\n // so hide the minLimit bubble\n hide(refs.minBub);\n } else {\n // the low bubble doesn't overlap the minLimit bubble\n\n // single knob slider\n\n // so show the minLimit slider\n show(refs.minBub);\n\n }\n\n if(gap(refs.currBub, refs.maxBub) < 5) {\n // the low bubble overlaps the maxLimit bubble\n\n // so hide the maxLimit bubble\n hide(refs.maxBub);\n } else {\n // the low bubble doesn't overlap the maxLimit bubble\n\n // no overlap\n\n // so show the maxLimit bubble\n show(refs.maxBub);\n }\n }", "function spacingSliderOnInput() {\n\tvar slider = document.getElementById(\"SpacingSlider\");\n\tvar num_input = document.getElementById(\"SpacingValue\");\n\t\n\tnum_input.value = slider.value / 100;\n}", "function onRangechanged(data){\n\tvar slider = document.getElementById('slider');\n\tslider.value = data.value;\n}", "function adjustSliderMovement(obj,sliderLeapValue,txtField,offset) {\r\n\tvar mousePos = parseInt(evt.clientX) - (5 + offset);\r\n\t//Get the slider value for the mouse pointer position\r\n\tvar currSliderValue = obj.lower + Math.round(parseInt(mousePos)*(obj.upperLimit-obj.lowerLimit)/obj.upper);\r\n\t//Round the slider value to the nearest leap, per the requirement\r\n\tnearestSliderValue = roundToNearest(currSliderValue,sliderLeapValue);\r\n\t//Map the slider value shown in the input box to a pixel size\r\n\tnearestSliderPixels = (nearestSliderValue * obj.upper) / obj.upper ;\r\n\tobj.style.left = nearestSliderPixels + \"px\";\r\n\tdocument.getElementById(obj.id + \"_readout\").style.width = nearestSliderPixels + \"px\";\r\n\tdocument.getElementById(txtField).value = nearestSliderValue;\r\n}", "function handleBlackAndWhiteConversionUI() {\n\tvar slider = document.getElementById(\"BlackAndWhiteThresholdSlider\");\n\tvar num_input = document.getElementById(\"BlackAndWhiteThresholdValue\");\n\t\n\tif (document.getElementById(\"BlackAndWhiteThresholdMethod\").value === \"automatic\") {\n\t\tslider.style.visibility = \"hidden\"; \n\t\tnum_input.style.visibility = \"hidden\"; \n\t}\n\telse {\n\t\tslider.style.visibility = \"visible\";\n\t\tnum_input.style.visibility = \"visible\";\n\t}\n}", "function ResetAverageNightlyRateSlider(min,max,posMin,posMax,minRange,maxRange){\n $('#slider_minPrice').html('min: <span class=\"bold\">'+minPrice+'</span>');\n $('#slider_maxPrice').html('max: <span class=\"bold\">'+maxPrice+'</span>');\n $(\"#average_nigthlyRate\").val(minRange + ' - ' + maxRange);\n $(\"#info_average_nigthlyRate\").html(minRange + ' - ' + maxRange);\n\n $(\"#slider_average_nigthlyRate\").slider( \"destroy\" );\n $(\"#slider_average_nigthlyRate\").slider({\n range: true,\n min: min,\n max: max,\n values: [minRange, maxRange],\n slide: function(event, ui) {\n $(\"#average_nigthlyRate\").val(ui.values[0] + ' - ' + ui.values[1]);\n $(\"#info_average_nigthlyRate\").html(ui.values[0] + ' - ' + ui.values[1]);\n }\n });\n\n $( \"#slider_average_nigthlyRate\").slider({\n stop: function(event, ui) {\n $('#average_nightly_rate').next('a.remove-small').show();\n sendFilterRequest($(this));\n }\n });\n\n /*\n\n $(\"#slider_average_nigthlyRate\").slider2( \"destroy\" );\n $(\"#slider_average_nigthlyRate\").slider2({\n range: true,\n min: min,\n max: max,\n posMin: posMin,\n posMax: posMax,\n values: [minRange, maxRange],\n slide: function(event, ui) {\n $(\"#average_nigthlyRate\").val(ui.values[0] + ' - ' + ui.values[1]);\n $(\"#info_average_nigthlyRate\").html(ui.values[0] + ' - ' + ui.values[1]);\n }\n });\n\n $( \"#slider_average_nigthlyRate\").slider2({\n stop: function(event, ui) {\n $('#average_nightly_rate').next('a.remove-small').show();\n sendFilterRequest($(this));\n }\n });\n\n */\n}", "handleSlider() {\n this.slider.addEventListener('change', event => {\n this.sliderValue.innerText = event.target.value;\n this.rate = event.target.value * 10;\n });\n }", "function iChange (f){\n // value\n let valDiv = f.querySelector('.component__value');\n let val = valDiv.value;\n // color\n let colorDiv = f.querySelector('.component__color');\n let color = colorDiv.innerText;\n // number\n let numberDiv = f.querySelector('.component__number');\n let number = numberDiv.innerText;\n\n stringValid = true;\n if(val == \"%\" || isNaN(Number(val.slice(0, -1))) || val.slice(-1) !== \"%\" || val.slice(-1) == \"\"||val == \"\"){\n stringValid = false;\n }\n\nif(stringValid){ //test string if(for input)\n valDiv.style.backgroundColor = \"white\"; \n\n let valNumber = Number(val.slice(0, -1));\n \n let valEfR = document.getElementById(number);\n let elemForRefresh = Number(valEfR.style.height.slice(0, -1));\n\n let sclElements = Array.from(document.querySelectorAll('.flask__scale>div'));\n let flaskSize = 0;\n sclElements.forEach(function(elem){\n let counter = Number(elem.style.height.slice(0, -1));\n flaskSize = flaskSize + counter;\n });\n \n if((flaskSize + valNumber - elemForRefresh) <= 100){\n scl.find('#'+number).attr('style', 'height:'+val+'; background-color: '+color+';\" ');\n valDiv.style.backgroundColor = \"white\";\n\n document.getElementById('scaleValue').innerText = flaskSize+valNumber-elemForRefresh;\n\n valDiv.style.backgroundColor = \"white\";\n }\n else{\n valDiv.style.backgroundColor = \"orange\";\n }\n}\nelse{\n valDiv.style.backgroundColor = \"red\"; //test string else(for input)\n}\n}", "function updateSplit() {\n let value = ((split.value - split.min) / (split.max - split.min)) * 100;\n if (split.classList.contains(\"input-range-dark\")) {\n split.style.background = `linear-gradient(to right, #171b41 0%, #171b41 ${value}%, #fff ${value}%, #fff 100%`;\n } else if (split.classList.contains(\"input-range-light\")) {\n split.style.background = `linear-gradient(to right, #fff 0%, #fff ${value}%, #171b41 ${value}%, #171b41 100%`;\n }\n}", "function handleBlur() {\n\t\t\tif (onBlur) {\n\t\t\t\tonBlur(value);\n\t\t\t}\n\t\t}", "function onSliderChange() {\n var zero = ($(\"#slider\").val() == 0);\n $(\"#not-paying\").toggle(zero);\n $(\"#payment-types\").toggle(!zero);\n $(\"#gift\").toggle(!zero);\n\n updateAmountFromSlider();\n }", "sliderOnMouseUp() {\n if (!this.wasPaused) {\n gShaderToy.pauseTime();\n }\n\n window.requestAnimationFrame(\n function() {\n updateShaderToyTime(this.sliderInput.value, !this.wasPaused);\n updateInputsTime(this.sliderInput.value);\n this.busy = false;\n }.bind(this)\n );\n }", "function updateNum_Slider() {\n outStyle(false);\n let aE = document.activeElement;\n if (aE.hasAttribute(\"mirr\")) {\n let aMirrorE = document.getElementById(aE.getAttribute(\"mirr\"));\n if (!aE.value) {\n aE.value = 0;\n }\n aMirrorE.value = aE.value;\n\n if (aE.id.substr(0, 1) === \"T\") {\n let switchE = aE;\n aE = aMirrorE;\n aMirrorE = switchE;\n }\n if (aE.value === \"0\") {\n aMirrorE.value = \"\"\n }\n colorCode(aE);\n\n let iElements = document.getElementById(\"outer\").querySelectorAll(\"input\");\n for (let i = 0; i < iElements.length; i++) {\n iElements[i].value = iElements[i].value;// Needed for refreshing style after undetected (webkit\\autofill ?) changes\n }\n }\n}", "function cleanupInterestInput(){\n\tvar val = parseFloat($('.js--finance-interest').val());\n\t$('.js--finance-interest').val(val.toFixed(2) + \"%\");\n}", "function internalHandleSliderMoved() {\n var newValue = this.sliderDiv.val();\n this.setLabelText(newValue);\n this.notifyListeners(newValue);\n }", "blur() {}", "sliderOnMouseUp() {\n if (!this.wasPaused) {\n gShaderToy.pauseTime();\n }\n\n window.requestAnimationFrame(\n function() {\n updateShaderToyTime(\n this.sliderInput.value,\n !this.wasPaused\n );\n updateInputsTime(this.sliderInput.value);\n this.busy = false;\n }.bind(this)\n );\n }", "function rangeSlider(value) {\n video.currentTime = range.value;\n fillProgress.style.width = (value * 100) / range.max + \"%\";\n}", "function populateTotalPercent(e, a) {\n if (\"carb\" == a) l = e + parseInt($(\"#protein_slider\").slider(\"value\")) + parseInt($(\"#fat_slider\").slider(\"value\"));\n else if (\"protein\" == a) l = e + parseInt($(\"#carb_slider\").slider(\"value\")) + parseInt($(\"#fat_slider\").slider(\"value\"));\n else if (\"fat\" == a) var l = e + parseInt($(\"#carb_slider\").slider(\"value\")) + parseInt($(\"#protein_slider\").slider(\"value\"));\n l > 100 ? $(\"#total_percent\").removeClass(\"label-success label-warning\").addClass(\"label-danger\") : l < 100 ? $(\"#total_percent\").removeClass(\"label-success label-danger\").addClass(\"label-warning\") : $(\"#total_percent\").removeClass(\"label-warning label-danger\").addClass(\"label-success\"), $(\"#total_percent\").text(l + \"%\")\n}", "function adjustOpacity(event) {\n\tif(sliderActive) {\n\t\tvar x = (event.x - (slider.sliderWidth / 2)) - slider.leftOffset;\n\t\tvar fraction = x / (slider.areaWidth - slider.sliderWidth);\n\t\t\n\t\t// round fraction to 0.05\n\t\tfraction = parseInt(fraction * 100);\n\t\tfraction -= (fraction % 5);\n\t\tfraction /= 100;\n\t\tfraction = (fraction < 0) ? 0 : ((fraction > 1) ? 1 : fraction);\n\t\t\n\t\t// show effects\n\t\tsetSliderTo(fraction);\n\t\t//getObj('back').style.opacity = fraction;\n\t\t\n\t\tvar indicator = getObj('opacityValue');\n\t\tindicator.innerHTML = fraction;\n\t\tindicator.style.left = (1* x + ((fraction >= DEF_OP) ? -20 : 20)) + 'px';\n\t\tindicator.style.display = 'block';\n\t\tvar css_class = (fraction < 0.15) ? 'opacityWarn' : 'opacityHint';\n\t\tindicator.setAttribute('class', (DEF_OP == fraction) ? 'opacityMark' : css_class);\n\t\t\n\t\t_fullscreen_opacity = fraction;\n\t}\n\telse {\n\t\tsliderReleased();\n\t}\n}", "function blurring(){\n load++;\n loadingText.innerHTML = load + '%';\n loadingText.style.opacity = 1 - (load/100);\n // bg.style.opacity = load / 100;\n bg.style.filter = `blur(${20 - load/100 * 30}px)`;\n if(load > 99){\n clearInterval(timer);\n }\n}", "function updateSlider( e ) {\r\n var data = this.getData(),\r\n slider = data.slider,\r\n value = parseInt( this.get( \"value\" ), 10 );\r\n if ( data.wait ) {\r\n data.wait.cancel();\r\n }\r\n // Update the Slider on a delay to allow time for typing\r\n data.wait = Y.later( 200, slider, function () {\r\n data.wait = null;\r\n this.set( \"value\", value );\r\n } );\r\n }", "_inputChanged(text, inputElem, formatterId, valueVar) {\n var formatter = this.$$(formatterId),\n newVal;\n\n // get a raw number from our input field string\n formatter.set('unformat', text);\n newVal = formatter.unformattedValue;\n\n if(!newVal && newVal !== 0) {\n // toggle Error state\n this.toggleClass('validation-error', true, inputElem);\n return;\n }\n\n // make sure our newVal is between our max and min\n // TODO Check with design if this is the appropriate approach: num sets to min or max rather than toggling validation error\n newVal = Math.max(newVal, this.min);\n newVal = Math.min(newVal, this.max);\n\n // make sure it matches our step\n newVal = this._calcStepRounded(newVal);\n\n // make sure it is not above/below the other value if range\n if(this.isRange) {\n if((valueVar === 'value' && newVal > this.endValue) ||\n (valueVar === 'endValue' && newVal < this.value)) {\n\n this.toggleClass('validation-error', true, inputElem);\n return;\n }\n }\n\n this.toggleClass('validation-error', false, inputElem);\n /*\n in the case that you have a valid number followed by junk, eg, '25kasdjjhasdj'\n the unformatter is smart enough to throw away the chars and just keep the number\n however, this number can be the same as what was already in the box and wont clear from the box\n so reset value to force a recalc to be safe\n */\n this[valueVar] = null;\n this.set(valueVar, newVal);\n }", "function readSlider(){\n outputSlider.innerHTML = rangeSlider.value;\n rangeSlider.oninput = function () {\n outputSlider.innerHTML = this.value\n }\n }", "_trackOnClick(elem) {\n // TODO vertical: [1]\n var val = Px.d3.mouse(elem)[0], // Get the mouse position\n prop = 'value'; //assume it should affect the left value\n\n if(this.isRange) {\n //check to see which is closer\n var scaled = this._scale.invert(val),\n half = (this.endValue - this.value) / 2 + this.value;\n\n prop = (scaled > this.endValue || scaled > half) ? 'endValue' : 'value';\n }\n\n this._calcSliderValue(val, prop);\n }" ]
[ "0.7218121", "0.7218121", "0.6938819", "0.6700834", "0.6666914", "0.6539147", "0.6391279", "0.6296303", "0.6296303", "0.62397665", "0.62397665", "0.6190092", "0.6147399", "0.61416197", "0.6138224", "0.6138224", "0.61041045", "0.6077673", "0.6045355", "0.6036651", "0.6036568", "0.5994406", "0.5985339", "0.5982207", "0.5979011", "0.5956669", "0.59372115", "0.59222436", "0.59149617", "0.58975744", "0.589488", "0.5884266", "0.58642733", "0.58422774", "0.5839636", "0.5836866", "0.5824845", "0.581544", "0.5804296", "0.57637566", "0.5762411", "0.5760891", "0.575675", "0.57432413", "0.5727129", "0.5720735", "0.57191384", "0.5713033", "0.5699816", "0.56963336", "0.5690435", "0.5675631", "0.5675589", "0.5663862", "0.5656103", "0.5653743", "0.5653743", "0.5653743", "0.5653743", "0.5653743", "0.5653743", "0.5653743", "0.56499535", "0.5648861", "0.5645297", "0.5634873", "0.562969", "0.562969", "0.562969", "0.562969", "0.562969", "0.562765", "0.5623714", "0.56040084", "0.5596202", "0.55865836", "0.55841905", "0.5583163", "0.5573603", "0.5566747", "0.5562392", "0.5545638", "0.5538327", "0.552736", "0.55193126", "0.55181503", "0.55149335", "0.5510075", "0.5508061", "0.55057937", "0.55040795", "0.54986054", "0.54945666", "0.5490197", "0.5488933", "0.54878485", "0.5487353", "0.5486272", "0.5471472", "0.5469668" ]
0.8401178
0
currencySliderStop when the slider stops, blur the input to get the proper formatting
function currencySliderStop() { $('#tag-currency-input').blur(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function percentSliderStop() {\n\n\t\t$('#tag-percent-input').blur();\n\t}", "registerConvert() {\n\t\tlet fields = this.container.find('.js-currencyc_value');\n\t\tfields.on('keyup focusout', (e) => {\n\t\t\tlet value = App.Fields.Double.formatToDb(e.currentTarget.value);\n\t\t\tlet currentCurrencyData = $(e.currentTarget).parent().find('.js-currencyc_list option:selected').data();\n\t\t\tfields.each((_n, ve) => {\n\t\t\t\tlet currencyData = $(ve).parent().find('.js-currencyc_list option:selected').data();\n\t\t\t\tif (currentCurrencyData.currencyId === currencyData.currencyId) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t$(ve).val(\n\t\t\t\t\tApp.Fields.Double.formatToDisplay((value * currencyData.conversionRate) / currentCurrencyData.conversionRate),\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t});\n\t\t});\n\t}", "onSliderBlur() {\n gShaderToy.mMouseIsDown = false;\n }", "onSliderBlur() {\n gShaderToy.mMouseIsDown = false;\n }", "_inputBlurHandler() {\n const that = this;\n\n if (that._suppressBlurEvent === true) {\n // suppresses validation because it was already handled in \"_incrementOrDecrement\" function\n that._suppressBlurEvent = false;\n\n if (that._formattedValue) {\n that._cachedInputValue = that._formattedValue;\n that.$.input.value = that._formattedValue;\n delete that._formattedValue;\n }\n }\n else if (that.$.input.value !== that._editableValue) {\n that._triggerChangeEvent = true;\n that._validate();\n that._triggerChangeEvent = false;\n }\n else {\n that.$.input.value = that._cachedInputValue;\n }\n\n if (that.radixDisplay) {\n that.$.radixDisplayButton.removeAttribute('focus');\n }\n\n if (that.opened) {\n that._closeRadix();\n }\n\n if (that.spinButtons) {\n that.$.spinButtonsContainer.removeAttribute('focus');\n }\n if (that.showUnit) {\n that.$.unitDisplay.removeAttribute('focus');\n }\n\n that.removeAttribute('focus');\n }", "_blur(event) {\n // Depending on support for input[type=range],\n // the event.target could be either the handle or its child input.\n // Use closest() to locate the actual handle.\n event.target.closest(`.${CLASSNAME_HANDLE}`).classList.remove('is-focused');\n\n events.off('touchstart.Slider');\n events.off('mousedown.Slider');\n }", "function inputHandler() {\n stopAnimation();\n setTime(parseInt(slider.value));\n }", "function bind() {\n $('.rate').blur(update_price);\n $('.qty').blur(update_price);\n }", "function currenciesListFocusOut(event) {\n const inputValue = event.target.value;\n if(isNaN(inputValue) || Number(inputValue)===0) event.target.value=\"\";\n else event.target.value = Number(inputValue).toFixed(7);\n}", "function onSliderChange() {\n var zero = ($(\"#slider\").val() == 0);\n $(\"#not-paying\").toggle(zero);\n $(\"#payment-types\").toggle(!zero);\n $(\"#gift\").toggle(!zero);\n\n updateAmountFromSlider();\n }", "function changeCurrency(e) {\n console.log(\"value \", e.value);\n\n setCurCurrency(e.value);\n }", "function updateSlider(slider, number, type){\n slider.addEventListener( \"input\", ()=>{\n number.value = slider.value;\n });\n number.addEventListener(\"input\", ()=>{\n numberRegex(type);\n slider.value = number.value;\n });\n number.addEventListener(\"keydown\", (e)=>{\n if(!(e.key==\"0\"||e.key==\"1\"||e.key==\"2\"||e.key==\"3\"||e.key==\"4\"||e.key==\"5\"||e.key==\"6\"||e.key==\"7\"||e.key==\"8\"||e.key==\"9\"||e.key==\"Backspace\")){\n e.preventDefault();\n }\n else{\n if(e.key==\"Backspace\"&&/^[1-9]{1}$/.test(number.value)){\n e.preventDefault();\n }\n }\n })\n const numberRegex = (type)=>{\n let regex = type==2?/^[1-9]{1}[0-9]{0,2}/:/^[1-9]{1}[0-9]{0,4}/;\n // caps the number to be between 1 and 10000)\n console.log(number.value);\n if(parseInt(number.value)>10000){\n number.value = 10000;\n }\n else if(parseInt(number.value)<1){\n number.value = 1;\n }\n number.value = number.value?((regex.test(number.value))?(number.value.match(regex)[0]):1):1;\n number.value.toString();\n }\n}", "sliderOnChange() {\n updateShaderToyTime(this.sliderInput.value);\n }", "sliderOnChange() {\n updateShaderToyTime(this.sliderInput.value);\n }", "onSliderChange_() {\n this.setEditorValue_(this.sliderInput_.value);\n }", "function startSliderWatch() {\n\t\t$(\".donate-range\").change(function(){\n\t\t\tvar $thisVal = $(this).val();\n\t\t\tupdateSliderValue($thisVal);\n\t\t\tupdateSliderMessage($thisVal);\n\t\t\t$('.donate-slider-amount').removeClass('blank').html('$'+$thisVal);\n\t\t});\n\n\t\tsetTimeout(function(){ updateSliderValue($(\".donate-range\").val()); },50);\n\t}", "function handleBudgetUpdate(values) {\n const slider = $(this);\n const sliderLabels = slider.siblings(\".slider-label\");\n const budgetLabels = slider.siblings(\".slider-values\");\n budgetLabels.removeClass(\"hidden\");\n budgetLabels.find(\".min-value\").html(values[0]);\n budgetLabels.find(\".max-value\").html(values[1]);\n sliderLabels.find(\".label-min\").html(values[0]);\n sliderLabels.find(\".label-max\").html(values[1]);\n let min;\n let max;\n let inputValue;\n if (String(slider.data(\"min\")) !== values[0].replace(\"€\", \"\")) {\n min = values[0].replace(\"€\", \"\");\n }\n if (String(slider.data(\"max\")) !== values[1].replace(\"€\", \"\")) {\n max = values[1].replace(\"€\", \"\");\n }\n if (min) {\n inputValue = min;\n if (max) {\n inputValue += \",\" + max;\n }\n } else if (max) {\n inputValue = \"0,\" + max;\n }\n const input = slider.siblings(\".price-input\");\n if (inputValue) {\n input.attr(\"disabled\", false);\n input.val(inputValue);\n } else {\n input.attr(\"disabled\", true);\n }\n\n}", "function onSliderInput() {\n\tvar sibling = $(this).siblings('input').first();\n\tvar me = $(this);\n\tvar my_rel = me.data('slider-rel');\n\n\tvar my_val = Number(me.val());\n\tvar sib_val = Number(sibling.val());\n\tvar step = Number(me.attr('step'));\n\n\tif (my_rel == 'max' &&\n\t my_val < sib_val) {\n\t // My value is too low. Freeze at one step higher.\n\t me.val(Math.min(sib_val + step, 1440));\n\t} else if (my_rel == 'min' &&\n\t\t my_val > sib_val) {\n\t // My value is too high. Freeze at one step lower.\n\t me.val(Math.max(sib_val - step, 0));\n\t}\n\n\tvar target = $(this).data('display');\n\t$(target).text(util.minuteToTime($(this).val()));\n\n\tif (triggerCb) {\n\t if (my_rel == 'max') triggerCb(sib_val, my_val);\n\t else triggerCb(my_val, sib_val);\n\t}\n }", "_inputFocusHandler() {\n const that = this;\n\n if (that.spinButtons) {\n that.$.spinButtonsContainer.setAttribute('focus', '');\n }\n if (that.radixDisplay) {\n that.$.radixDisplayButton.setAttribute('focus', '');\n }\n if (that.showUnit) {\n that.$.unitDisplay.setAttribute('focus', '');\n }\n\n if (that.opened) {\n that._closeRadix();\n }\n\n that.setAttribute('focus', '');\n\n if (that.outputFormatString) {\n that.$.input.value = that._editableValue;\n }\n }", "function sliderValueChange() {\n elemValue = document.getElementById('value');\n var porcessorValue = processorSlider.value;\n var memoryValue = memorySlider.value;\n var storageValue = storageSlider.value;\n //formula to calculate cloud price based on slider value\n finalValue = Number(((((porcessorValue * memoryValue) * 1000) + ((porcessorValue * memoryValue) * storageValue) + ((porcessorValue * memoryValue) * 100)) / 12).toFixed(2));\n if (document.getElementById('cPanel').ej2_instances[0].checked) {\n finalValue = Number((finalValue - 10).toFixed(2));\n }\n if (document.getElementById('discount').ej2_instances[0].checked) {\n finalValue = Number((finalValue - ((finalValue * 25) / 100)).toFixed(2));\n }\n elemValue.innerText = finalValue.toString();\n }", "function handleSlider(valueNum, valueTxt) {\n slider.slider('value', valueNum);\n CALCULATOR.calculate(valueNum);\n setAmountValue();\n $priceTxt.text($sliderMarkers.children().eq(valueTxt).text());\n }", "function updateNum_Slider() {\n outStyle(false);\n let aE = document.activeElement;\n if (aE.hasAttribute(\"mirr\")) {\n let aMirrorE = document.getElementById(aE.getAttribute(\"mirr\"));\n if (!aE.value) {\n aE.value = 0;\n }\n aMirrorE.value = aE.value;\n\n if (aE.id.substr(0, 1) === \"T\") {\n let switchE = aE;\n aE = aMirrorE;\n aMirrorE = switchE;\n }\n if (aE.value === \"0\") {\n aMirrorE.value = \"\"\n }\n colorCode(aE);\n\n let iElements = document.getElementById(\"outer\").querySelectorAll(\"input\");\n for (let i = 0; i < iElements.length; i++) {\n iElements[i].value = iElements[i].value;// Needed for refreshing style after undetected (webkit\\autofill ?) changes\n }\n }\n}", "_calcSliderValueDebounced(mouseVal, valueVar) {\n var val = this._scale.invert(mouseVal), //convert pixel --> value\n stepped = this._calcStepRounded(val), //round it\n inputElem = valueVar === 'value' ? this._inputStart : this._inputEnd; //which input field\n\n //validate that stepped is not greater than the other handle\n if(this.isRange) {\n stepped = (valueVar === 'value' && stepped > this.endValue) ? this.endValue : stepped;\n stepped = (valueVar === 'endValue' && stepped < this.value) ? this.value : stepped;\n }\n\n this.toggleClass('validation-error', false, inputElem);\n this.set(valueVar, stepped);\n }", "function UpdateAmtTextBox() {\n var value = $('#amountSlider').slider('option', 'value');\n\tvalue = formatNumber(value,0,' ','',currencySymbol,'','-','');\n\tdocument.getElementById('Amount').value=value;\n}", "blur() {\r\n this.isFocussed = false;\r\n this.showLimits = true;\r\n }", "handleSlider() {\n this.slider.addEventListener('change', event => {\n this.sliderValue.innerText = event.target.value;\n this.rate = event.target.value * 10;\n });\n }", "updateSlider_() {\n if (!this.sliderInput_) {\n return;\n }\n this.sliderInput_.setAttribute('value', this.getValue());\n }", "labeledInput(value, key) {\n let inputClass = 'input-valid'\n if (Number.isNaN(Number.parseFloat(value))){\n inputClass = 'input-invalid'\n }\n return <div key={key}>\n <ValueSlider\n label={'Income ' + (key + 1)}\n value={value}\n id={key}\n callback={(x) => this.setIncome(key, x)}\n delCallback={()=>this.delIncome(key)}\n className={inputClass}\n />\n </div>\n }", "function blackAndWhiteThresholdSliderOnInput() {\n\tvar slider = document.getElementById(\"BlackAndWhiteThresholdSlider\");\n\tvar num_input = document.getElementById(\"BlackAndWhiteThresholdValue\");\n\t\n\tnum_input.value = slider.value;\n}", "function weightSumValueChange() {\n $('#sliderSummation').on('input', function () {\n $('.sliderSummationValue').text($(this).val() + \"%\");\n }).on('mouseup', function () {\n var value = $(this).val();\n\n //remove selected value on another slider\n $('#sliderWeight').val(0);\n $('.sliderWeightValue').text(\"-\");\n\n //show overlays\n $('#controls-panel-overlay').show();\n $('#best-results-table-overlay').show();\n\n $('.sliderSummationValue').text(value + \"%\");\n $('input[type=radio][name=select]:checked').prop('checked', false);\n setTimeout(function(){\n selectButtonsByWeightSummation(value, selectedSolution);\n displayModels();\n displayCurves();\n }, 10);\n });\n}", "onSliderChange(e) {\n var slider = e.target,\n axis = slider.getAttribute('data-axis'),\n vPart = slider.getAttribute('data-vPart'),\n value = slider.value;\n\n slider.nextSibling.textContent = vPart + ': ' + value;\n gShaderToy['mMouse' + axis] = value;\n gShaderToy.mForceFrame = true;\n setTimeout(this.onSliderBlur, 20);\n }", "onSliderChange(e) {\n var slider = e.target,\n axis = slider.getAttribute('data-axis'),\n vPart = slider.getAttribute('data-vPart'),\n value = slider.value;\n\n slider.nextSibling.textContent = vPart + ': ' + value;\n gShaderToy['mMouse' + axis] = value;\n gShaderToy.mForceFrame = true;\n setTimeout(this.onSliderBlur, 20);\n }", "function blackAndWhiterThresholdValueOnInput() {\n\tvar slider = document.getElementById(\"BlackAndWhiteThresholdSlider\");\n\tvar num_input = document.getElementById(\"BlackAndWhiteThresholdValue\");\n\t\n\tslider.value = num_input.value;\n}", "handleSellCurrencyChange(event) {\n this.sellCurrencyValue = event.detail.value;\n if(this.buyCurrencyValue && this.sellCurrencyValue){\n this.handleCurrencyConversion();\n } else {\n this.rate = null;\n this.buyAmountValue = null;\n }\n }", "function forceCurrency(event) {\n\t// remove disallowed chars\n\tthis.value = this.value.replace(/[^0-9\\.]/g, \"\");\n\n\t// if only showing a dollar amount, add decimal points to show cents\n\tvar indexOfDecimal = this.value.indexOf(\".\");\n\tif (indexOfDecimal === -1) {\n\t\tthis.value += \".00\";\n\t}\n\t// if decimal is there, force exactly 2 digits after it\n\telse {\n\t\tvar charsAfterDecimal = this.value.slice(indexOfDecimal + 1, this.value.length);\n\t\t\n\t\t// add zeroes to the end of value until there are exactly 2 digits there\n\t\twhile (charsAfterDecimal.length < 2) {\n\t\t\tthis.value += \"0\";\n\t\t\tcharsAfterDecimal = this.value.slice(indexOfDecimal + 1, this.value.length);\n\t\t}\n\n\t\t// cut off any digits after decimal if more than 2\n\t\tthis.value = this.value.slice(0, indexOfDecimal + 3);\n\t}\n\n\t// if value starts with decimal point, add a zero in front. It looks better\n\tif (this.value.charAt(0) == \".\") {\n\t\tthis.value = \"0\" + this.value;\n\t}\n}", "inputsFormat() {\n\n // On input\n this.jQueryCount.on('input', ( function(){\n\n // RegExp to find non-numerical chars\n const nonDigitRegExp = /\\D/;\n \n // Non-numerical chars are prohibited to input\n $(this).val($(this).val().replace(nonDigitRegExp,''));\n \n\n }));\n\n // On input\n this.jQueryPrice.on('input', (function(){\n \n // RegExp to find non-numerical and non-dot chars\n const nonDigitRegExp = /[^0-9.]/;\n\n // Prohibites chars are replaced with empty string\n $(this).val($(this).val().replace(nonDigitRegExp,''));\n\n // Basically this code allows only one dot in the field\n // The dot can be 'moved' forward, but not backwards -- that's kinda an issue tbh\n // NOTE: Think how to rewrite this to deal with 'past' and 'present' dot\n if($(this).val().match(/\\./g)){\n \n if($(this).val().match(/\\./g).length > 1){\n \n const valArray = $(this).val().split('');\n valArray[valArray.indexOf('.')] = '';\n $(this).val(valArray.join(''));\n }\n }\n \n }));\n \n // During focus\n this.jQueryPrice.focus(function(){\n\n // Dollar sign is hid\n let regExpDollar = /\\$/;\n\n $(this).val($(this).val().replace(/\\,/g, ''));\n $(this).val($(this).val().replace(regExpDollar, ''));\n });\n\n // Out of focus\n this.jQueryPrice.blur(function(){\n\n \n let regExpDollar = /\\$/;\n\n // Semis are put to divide digits\n if(!isNaN(parseFloat($(this).val()))){\n $(this).val(putSemi($(this).val()));\n\n // And dollar sign is added to the beggining of the string\n if(!$(this).val().match(regExpDollar)){\n $(this).val('$'.concat($(this).val()));\n }\n }\n\n // This code deletes all dots except one\n const strayDotRegExp = /\\.(?!\\d)/g;\n\n $(this).val($(this).val().replace(strayDotRegExp,''));\n \n if($(this).val().charAt(0) === '.'){\n $(this).val($(this).val().slice(1));\n }\n });\n \n }", "function jsf_def_InputBlur() {\n var pattern = new RegExp('[^0-9]+', 'g');\n var $input = $j(this);\n var value = $input.val();\n value = value.replace(pattern, '');\n $input.val(value);\n}", "function changeInput(e){\n\tvar cAmount = $(e).val();\n\tvar cPar = $(e).parents(\".divPost\");\n\t//console.log(cPar);\n\tif($.isNumeric(cAmount)){\n\t\tvar cFromCur = cPar.find(\".fromCur\").text();\n\t\tconsole.log(\"from cur : \" + cFromCur);\n\t\tvar cToCur = cPar.find(\".toCur\").text();\n\t\tconsole.log(\"to cur : \" + cToCur);\n\t\tvar cType = cPar.find(\".inputType\").val();\n\t\tconsole.log(\"type : \" + cType);\n\t\tvar cRate = rates[cType][cFromCur][cToCur];\n\t\tconsole.log(cRate);\n\t\tvar cOutput = cAmount*cRate;\n\t\tconsole.log(cAmount);\n\t\tconsole.log(cOutput);\n\t\tcPar.find(\".outputAmount\").val(cOutput.toFixed(2));\n\t\t$(\".blockTotal #totalInput\").text(cAmount);\n\t}else{\t\t\n\t\tcPar.find(\".outputAmount\").val('');\n\t\t$(\".blockTotal #totalInput\").text('');\n\t};\n\tupdateTotalTable();\t\n\tchangeSaveStatus(0);\n}", "function convertCurrency(unlockme) {\n\n var amount = document.getElementById('from-currency-amount').value.trim();\n //remove common thousand separators\n amount = amount.replace(' ','');\n amount = amount.replace(',','');\n\n if (testIfIntorDec(amount)) {\n // we have something that looks like digits!\n // first return the input back to the user in our standard format.\n // this could be usefull if the user for instance used another decimal separator then . and got unexpected\n // results from our code removing the thousand seperators\n document.getElementById('from-currency-amount').value = accounting.formatNumber(accounting.toFixed(amount, decimalsCalc(amount)), decimalsCalc(amount), \" \");\n\n //FROM->TO conversion\n convertCurrencyCalculator(amount, document.getElementById('from-currency').value, document.getElementById('to-currency').value, document.getElementById('answer-currency-amount'), unlockme);\n\n } else {\n //now we want to check if the user might have wanted to do a reverse convert and put something valid in the into field instead\n var amount = document.getElementById('answer-currency-amount').value.trim();\n amount = amount.replace(' ','');\n amount = amount.replace(',','');\n\n if (testIfIntorDec(amount)) {\n //again return the sanitized input back to its origin making sure output is correct\n document.getElementById('answer-currency-amount').value = accounting.formatNumber(accounting.toFixed(amount, decimalsCalc(amount)), decimalsCalc(amount), \" \");\n\n //TO->FROM conversion\n convertCurrencyCalculator(amount, document.getElementById('to-currency').value, document.getElementById('from-currency').value, document.getElementById('from-currency-amount'), unlockme);\n\n } else {\n\n //We didnt find anything valid to convert. Tell the user and clear booth field.\n\n var elements = document.getElementsByClassName('form-in');\n\n for (var i = 0; i < elements.length; i++) {\n if (getComputedStyle(elements[i]).getPropertyValue(\"background-color\") != \"rgb(255, 0, 0)\") { //doesnt run if already red. to not create multiple timeouts\n elements[i].style.backgroundColor = \"red\";\n setTimeout( function(e, o) {\n setBgColor(e, o);\n }, 2500, elements[i], null);\n };\n };\n var t = document.createTextNode(\"There is no valid input. Please enter a integer or decimal (using . as deceimal separator) in either the from or to currency field.\");\n var p = document.createElement(\"P\");\n p.setAttribute(\"class\", \"input-currency-error-message\");\n p.appendChild(t);\n\n $('.input-currency-error-message').hide(); //hide already exisitng messages (only hide, dont delete. so they timer is not interruped causeing warnings)\n\n insertAfternojq(document.getElementById('convert-btn'), p);\n\n //reset invalid input to null\n document.getElementById('answer-currency-amount').value = \"\";\n document.getElementById('from-currency-amount').value = \"\";\n\n //either way make it expire\n setTimeout( function(e) {\n deleteMe(e); //deletes if exist\n }, 4500, p);\n\n //finally unlock button\n unlockme.disabled = false;\n unlockme.removeAttribute('style');\n\n //Ends error message on no valid input\n\n };\n };\n}", "function stopSlider() {\n document.removeEventListener('mousemove', moveSlider);\n slider.style.cursor = 'grab';\n }", "function weightSliderValueChange() {\n $('#sliderWeight').on('input', function () { //versions of IE < 9 do not support this event, they have proprietary onPropertyChange event\n $('.sliderWeightValue').text($(this).val() + \"%\");\n }).on('mouseup', function () {\n var value = $(this).val();\n\n //remove selected value on another slider\n $('#sliderSummation').val(0);\n $('.sliderSummationValue').text(\"-\");\n\n //show overlays\n $('#controls-panel-overlay').show();\n $('#best-results-table-overlay').show();\n\n $('.sliderWeightValue').text(value + \"%\");\n $('input[type=radio][name=select]:checked').prop('checked', false);\n setTimeout(function(){\n selectButtonsByWeight(value);\n displayModelsSelectedByWeight(value, selectedSolution);\n displayCurves();\n }, 10);\n });\n}", "callback(value) {\n return formatCurrency(value, 0);\n }", "function numericField_Blur(inputBox, settings) {\n\t\tvar fieldValueNumeric = parseFloat($(inputBox).val());\n\t\tvar $inputBox = $(inputBox);\n\n\t\tif (isNaN(fieldValueNumeric)) {\n\t\t\t$inputBox.val(\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (isNumeric(settings.min) && fieldValueNumeric < settings.min)\n\t\t\t$inputBox.val(\"\");\n\n\t\tif (isNumeric(settings.max) && fieldValueNumeric > settings.max)\n\t\t\t$inputBox.val(\"\");\n\t}", "function updateSlider() {\n\n // Empty input field\n if (volumeNumber.value === \"\") {\n volumeSlider.value = 0;\n volumeImage.src = \"./assets/media/icons/volume-level-0.svg\";\n\n // Input Field Range 1 to 100\n } else {\n if (volumeNumber.value == 0) {\n volumeImage.src = \"./assets/media/icons/volume-level-0.svg\";\n } else if (1 <= volumeNumber.value && volumeNumber.value <= 33) {\n volumeImage.src = \"./assets/media/icons/volume-level-1.svg\";\n } else if (34 <= volumeNumber.value && volumeNumber.value <= 66) {\n volumeImage.src = \"./assets/media/icons/volume-level-2.svg\";\n } else if (67 <= volumeNumber.value && volumeNumber.value <= 100) {\n volumeImage.src = \"./assets/media/icons/volume-level-3.svg\";\n } else {\n volumeNumber.value = 100;\n }\n volumeSlider.value = volumeNumber.value;\n }\n}", "function blurFilterField(e) {\n var _obj = e || {},\n _type = _obj.type || null;\n\n state.filter.focused = false;\n\n if (_type !== 'blur' || _type === 'force') {\n $.filterField.softKeyboardOnFocus = Ti.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS;\n $.filterField.blur();\n }\n\n $.filterField.editable = false;\n $.filterField.touchEnabled = false;\n\n $.clearFilterBtn.animate({ opacity:0.0, duration:250 }, function() {\n $.clearFilterBtn.visible = false;\n });\n $.filterBg.animate({ backgroundColor:'#969696', duration:250 });\n\n if ($.filterField.value.length > 0) {\n $.filterField.color = '#333';\n $.filterField.animate({ left:38, duration:250 });\n $.filterLbl.animate({ left:50, duration:250 });\n } else {\n $.filterLbl.animate({ left:50, opacity:1.0, duration:250 });\n }\n}", "function befUpdateSlider($el, valIndex, sliderOptions) {\n var val = parseFloat($el.val(), 10),\n currentMin = $el.parents('div.views-widget').next('.bef-slider').slider('values', 0),\n currentMax = $el.parents('div.views-widget').next('.bef-slider').slider('values', 1);\n // If we have a range slider.\n if (valIndex != null) {\n // Make sure the min is not more than the current max value.\n if (valIndex == 0 && val > currentMax) {\n val = currentMax;\n }\n // Make sure the max is not more than the current max value.\n if (valIndex == 1 && val < currentMin) {\n val = currentMin;\n }\n // If the number is invalid, go back to the last value.\n if (isNaN(val)) {\n val = $el.parents('div.views-widget').next('.bef-slider').slider('values', valIndex);\n }\n }\n else {\n // If the number is invalid, go back to the last value.\n if (isNaN(val)) {\n val = $el.parents('div.views-widget').next('.bef-slider').slider('value');\n }\n }\n // Make sure we are a number again.\n val = parseFloat(val, 10);\n // Set the slider to the new value.\n // The slider's change event will then update the textfield again so that\n // they both have the same value.\n if (valIndex != null) {\n $el.parents('div.views-widget').next('.bef-slider').slider('values', valIndex, val);\n }\n else {\n $el.parents('div.views-widget').next('.bef-slider').slider('value', val);\n }\n }", "_blur() {\n if (this.disabled) {\n return;\n }\n if (!this.focused) {\n this._keyManager.setActiveItem(-1);\n }\n // Wait to see if focus moves to an indivdual chip.\n setTimeout(() => {\n if (!this.focused) {\n this._propagateChanges();\n this._markAsTouched();\n }\n });\n }", "_blur() {\n if (this.disabled) {\n return;\n }\n if (!this.focused) {\n this._keyManager.setActiveItem(-1);\n }\n // Wait to see if focus moves to an indivdual chip.\n setTimeout(() => {\n if (!this.focused) {\n this._propagateChanges();\n this._markAsTouched();\n }\n });\n }", "function setPokestops(balanceXP, inputType) {\n if(inputType != 'range'){\n let stops = Math.floor(balanceXP/250) + 1;\n document.getElementById('stopValue').innerHTML = stops;\n }else{\n let stops = Math.floor(balanceXP/250);\n document.getElementById('stopValue').innerHTML = stops;\n }\n\n}", "function Moneyformat() {\n $('.rate , .quantity').keyup(function (event) {\n // skip for arrow keys\n if (event.which >= 37 && event.which <= 40) return;\n // format number\n $(this).val(function (index, value) {\n return value.replace(/\\D/g, \"\").replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n });\n });\n }", "function onBlur() {\n\t\t\t// Set last value as input value\n\t\t\t$$invalidate(2, inputValue = value);\n\t\t}", "_onInputBlur () {\n this.getUIElement().classList.remove(this.options.activeClass);\n }", "interfaceBPMSliderCallback(faustControler) {\n var val;\n var input = faustControler.faustInterfaceView.slider;\n var fval = Number((parseFloat(input.value) * parseFloat(faustControler.itemParam.step)) + parseFloat(faustControler.itemParam.min));\n val = fval.toFixed(parseFloat(faustControler.precision));\n faustControler.value = val;\n var output = faustControler.faustInterfaceView.output;\n //---- update the value text\n if (output)\n output.textContent = \"\" + val + \" \" + faustControler.unit;\n this.BPM = fval;\n //this.setBPM(fval) \n }", "function handleChange(e) {\n const {\n target: { value },\n } = e;\n // custom value for masking | const tranformValue = value.split(\"/\").join(\"\");\n if (isCurrency) {\n const parseValue = Number(value.replace(/[^0-9.-]+/g, ''));\n const currency = new Intl.NumberFormat().format(parseValue); // 123,456\n setCurrencyValue(currency);\n setFieldValue(name, parseValue);\n }\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "_blur() {\n if (this.addOnBlur) {\n this._emitChipEnd();\n }\n this.focused = false;\n // Blur the chip list if it is not focused\n if (!this._chipGrid.focused) {\n this._chipGrid._blur();\n }\n this._chipGrid.stateChanges.next();\n }", "function blurHandler() {\n isWindowFocused = false;\n controlPressed = false;\n }", "function validateCurrencyInput(textField, event) {\n\t// Firefox behaves differently with backspace, so it needs to be handled apart\n\tif (event.code === 'Backspace') {\n\t\treturn;\n\t}\n\n\t// Workaround for IE's lack of \"String.includes\" support\n\tlet pointPresent = false;\n\tconst value = textField.value;\n\tfor (let i = 0, l = value.length; i < l; i++) {\n\t\tif (value.charAt(i) === '.') {\n\t\t\tpointPresent = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ((event.charCode === 46 && pointPresent) ||\n\t\t(event.charCode !== 46 && (event.charCode < 48 || event.charCode > 57))) {\n\t\tevent.preventDefault();\n\t}\n}", "function blurEvent() {\r\n if (input.value) {\r\n input.classList.remove(\"red\")\r\n }\r\n}", "function ResetAverageNightlyRateSlider(min,max,posMin,posMax,minRange,maxRange){\n $('#slider_minPrice').html('min: <span class=\"bold\">'+minPrice+'</span>');\n $('#slider_maxPrice').html('max: <span class=\"bold\">'+maxPrice+'</span>');\n $(\"#average_nigthlyRate\").val(minRange + ' - ' + maxRange);\n $(\"#info_average_nigthlyRate\").html(minRange + ' - ' + maxRange);\n\n $(\"#slider_average_nigthlyRate\").slider( \"destroy\" );\n $(\"#slider_average_nigthlyRate\").slider({\n range: true,\n min: min,\n max: max,\n values: [minRange, maxRange],\n slide: function(event, ui) {\n $(\"#average_nigthlyRate\").val(ui.values[0] + ' - ' + ui.values[1]);\n $(\"#info_average_nigthlyRate\").html(ui.values[0] + ' - ' + ui.values[1]);\n }\n });\n\n $( \"#slider_average_nigthlyRate\").slider({\n stop: function(event, ui) {\n $('#average_nightly_rate').next('a.remove-small').show();\n sendFilterRequest($(this));\n }\n });\n\n /*\n\n $(\"#slider_average_nigthlyRate\").slider2( \"destroy\" );\n $(\"#slider_average_nigthlyRate\").slider2({\n range: true,\n min: min,\n max: max,\n posMin: posMin,\n posMax: posMax,\n values: [minRange, maxRange],\n slide: function(event, ui) {\n $(\"#average_nigthlyRate\").val(ui.values[0] + ' - ' + ui.values[1]);\n $(\"#info_average_nigthlyRate\").html(ui.values[0] + ' - ' + ui.values[1]);\n }\n });\n\n $( \"#slider_average_nigthlyRate\").slider2({\n stop: function(event, ui) {\n $('#average_nightly_rate').next('a.remove-small').show();\n sendFilterRequest($(this));\n }\n });\n\n */\n}", "initPriceSlider(min, max, step) {\n\t\tlet minVal, maxVal;\n\n\t\tif (this.filters.price.length) {\n\t\t\tminVal = this.filters.price[0];\n\t\t\tmaxVal = this.filters.price[1];\n\t\t} else {\n\t\t\tminVal = max * 0.05;\n\t\t\tmaxVal = max * 0.4;\n\t\t}\n\n\t\t$('.price-range__slider').slider({\n\t\t\trange: true,\n\t\t\tvalues: [minVal, maxVal],\n\t\t\tmin: min,\n\t\t\tmax: max,\n\t\t\tstep: step,\n\t\t\tslide: () => {\n\t\t\t\tthis.showPriceRangeValues();\n\t\t\t},\n\t\t\tchange: () => {\n\t\t\t\tthis.showPriceRangeValues();\n\t\t\t\tthis.filters.price = this.getPriceRange();\n\t\t\t\tthis.setCookies('price', this.filters.price.join('_'));\n\t\t\t\t$('#oops').addClass('template');\n\t\t\t\tthis.postFilters(this.filters);\n\t\t\t}\n\t\t});\n\t\tthis.showPriceRangeValues();\n\t}", "function onBlur() {\n\t\t\t$$invalidate(3, inputValue = value);\n\t\t}", "function onSliderChange() {\n sw = slider.value;\n}", "blur() {}", "onBlur(e) {\n if (!this.$isFocused)\n return;\n this.$isFocused = false;\n this.renderer.hideCursor();\n this.renderer.visualizeBlur();\n this._emit(\"blur\", e);\n }", "money(event, d = 2, sm = '.', sd = ','){\r\n let decimal = d,\r\n separator_milhar = sd,\r\n separator_decimal = sd,\r\n decimal_potention = Math.pow(10, decimal),\r\n separator_thousend = `$1` + separator_milhar,\r\n override_value,\r\n value_pointer,\r\n blocks,\r\n parts,\r\n isObj = typeof event == 'object',\r\n isEmpty = event.target.value.length <= 0;\r\n\r\n if(!isObj || isEmpty){\r\n throw new Error('Bad format object');\r\n }\r\n\r\n event.target.setAttribute('maxLength', 20);\r\n\r\n override_value = event.target.value.replace(/\\D/g, '');\r\n value_pointer = (override_value / decimal_potention).toFixed(decimal);\r\n blocks = value_pointer.split('.');\r\n parts = blocks[0]\r\n .toString()\r\n .replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, separator_thousend);\r\n\r\n event.target.value = `R$ ${typeof blocks[1] === 'undefined' ? parts : parts + separator_decimal + blocks[1]}`;\r\n }", "function convertCurrency(event) {\n $(\"#amountDisplay\").html(\"\");\n $(\"#fromCurr\").html(\"\");\n $(\"#result\").html(\"\");\n $(\"#toCurr\").html(\"\");\n event.preventDefault();\n\n var amount = document.querySelector(\"#amount\").value;\n var fromCrr = document.querySelector(\"#from\").value;\n var toCrr = document.querySelector(\"#to\").value;\n if (amount == \"\" || fromCrr == \"\" || toCrr == \"\") {\n alert(\"Can't convery if any field is blank\");\n } else {\n var result = 0;\n var str = \"\";\n\n str = \"USD\" + fromCrr;\n str1 = \"USD\" + toCrr;\n for (key in rate) {\n if (key === str) {\n temp = (amount * 1) / rate[key];\n temp = temp.toFixed(6);\n }\n }\n for (key in rate) {\n if (key === str1) {\n result = temp * rate[key];\n result = result.toFixed(6);\n }\n }\n $(\"#amountDisplay\").append(amount);\n $(\"#fromCurr\").append(fromCrr);\n $(\"#result\").append(result);\n $(\"#toCurr\").append(toCrr);\n }\n}", "function PriceSlider(){\n if($('.price-slider').length) {\n $(\".price-slider\").slider({\n min: 0,\n max: 1500,\n step: 1,\n range: true,\n create: function( event, ui ){\n\n var $this=$(this),\n\n values=$(this).find('.range').attr('value').split(',');\n\n $this.slider(\"values\", values );\n\n $this.prepend(\"<label class='label-min'>$\"+values[0]+\"</label>\");\n\n $this.append(\"<label class='label-max'>$\"+values[1]+\"</label>\");\n\n },\n slide: function( event, ui ) {\n\n var $this=$(this),\n\n values=ui.values;\n\n $this.find('.label-min').text(\"$\"+values[0]+\"\");\n\n $this.find('.label-max').text(\"$\"+values[1]+\"\");\n\n $this.find('.range').attr('value',values);\n\n }\n });\n }\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "onFilterInputFocusout() {}", "function amountTypedIn(amt)\n{\n\t// make slider's value equal to amount typed in\n\t//first remove any non-numerics\n\tvar pattern = /[^0-9]/g;\n\tamt = amt.replace(pattern, \"\");\n\t$('#slider').slider('value', amt);\n\t(amt < 1000000) ? amt=1000000 : amt=amt;\n\t(amt > 500000000) ? amt=500000000 : amt=amt;\n\tdocument.getElementById(\"Amount\").value = formatNumber(amt,0,' ','',currencySymbol,'','-','');\n\t$('#amountSlider').slider('option', 'value', amt);\n\tUpdateAmtTextBox(); \t//we call this in case an out of range number was entered\n}", "function sliderSlider (e) {\n\n try {\n year = parseInt(e.originalTarget.attributes.value.value);\n new_value = new Date(year, 10, 10);\n slider.value(new_value);\n } catch (err) {\n year = parseInt(e.srcElement.getAttribute(\"value\"));\n new_value = new Date(year, 10, 10);\n slider.value(new_value);\n\n };\n}", "function onSliderChange () {\n // show spinner\n document.getElementById('loader').style.display = 'block'\n\n // get slider values\n data.inputs = {\n 'Count':document.getElementById('count').valueAsNumber,\n 'Radius':document.getElementById('radius').valueAsNumber,\n 'Length':document.getElementById('length').valueAsNumber\n }\n compute()\n}", "callback(value) {\n return formatCurrency(value, 4);\n }", "updateSlider() {\n var outsideLoop = false;\n\n //this.loop = window.TimebarLoop;\n\n if (gShaderToy && !this.busy) {\n this.sliderInput.value = gShaderToy.mTf;\n }\n\n if (this.loop && gShaderToy.mTf > this.maxValueInput.value * 1000) {\n this.sliderInput.value = this.minValueInput.value * 1000;\n outsideLoop = true;\n }\n\n if (this.loop && gShaderToy.mTf < this.minValueInput.value * 1000) {\n this.sliderInput.value = this.minValueInput.value * 1000;\n outsideLoop = true;\n }\n\n if (outsideLoop) {\n updateShaderToyTime(this.sliderInput.value);\n updateInputsTime(this.sliderInput.value);\n }\n\n setTimeout(this.updateSlider.bind(this), 26);\n }", "updateSlider() {\n var outsideLoop = false;\n\n //this.loop = window.TimebarLoop;\n\n if (gShaderToy && !this.busy) {\n this.sliderInput.value = gShaderToy.mTf;\n }\n\n if (this.loop && gShaderToy.mTf > this.maxValueInput.value * 1000) {\n this.sliderInput.value = this.minValueInput.value * 1000;\n outsideLoop = true;\n }\n\n if (this.loop && gShaderToy.mTf < this.minValueInput.value * 1000) {\n this.sliderInput.value = this.minValueInput.value * 1000;\n outsideLoop = true;\n }\n\n if (outsideLoop) {\n updateShaderToyTime(this.sliderInput.value);\n updateInputsTime(this.sliderInput.value);\n }\n\n setTimeout(this.updateSlider.bind(this), 26);\n }", "changeBaseCurrency() {\n this.setBaseCurrency( event.target.innerText );\n }", "blur() {\n this.control_input.blur();\n this.onBlur(null);\n }", "handleBlur(event) {\n this.finishUpdate();\n }", "_keydownHandlerSlider(event) {\n const that = this,\n key = event.key;\n\n if (key === 'Escape' && that._thumbDragged && that.mechanicalAction === 'switchWhenReleased') {\n that._documentUpHandler(undefined, true);\n that._valuesHandler.validate(false, that._valueAtDragStart);\n return;\n }\n\n if (['ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp'].indexOf(key) !== -1 && !that.coerce) {\n that.$thumb.removeClass('enable-animation');\n that.$secondThumb.removeClass('enable-animation');\n that.$fill.removeClass('enable-animation');\n that._restoreAnimationClass = true;\n }\n\n this._valuesHandler.keydownHandler(event);\n }", "handleBuyCurrencyChange(event) {\n this.buyCurrencyValue = event.detail.value;\n if(this.sellCurrencyValue && this.buyCurrencyValue){\n this.handleCurrencyConversion();\n } else {\n this.rate = null;\n this.buyAmountValue = null;\n }\n }", "function dragStop(e) {\n \n //setup variables\n var that = e.data,\n sliderMoveVal,\n trackingSlider = '';\n \n ///check if our slider is disabled\n if (!that.options.isDisabled) {\n \n //check if there is a step option\n if (that.options.step > 0) {\n \n //take the dragging element and move to the postion that you need\n if ($(that._prvt.draggingElem)[0] === that._prvt.handleMax[0]) {\n \n //calculate the value\n if(that._prvt.currentMax > that.options.maxLimit){\n that._prvt.currentMax = that.options.maxLimit;\n }\n \n //\n sliderMoveVal = unitsToPixels(that , that._prvt.currentMax) - that._prvt.innerOffset;\n \n //tracking value to add\n trackingSlider = '_max';\n } else {\n //out\n\n //check if the slider went lower than it should\n if(that._prvt.currentMin < that.options.minLimit){\n \n that._prvt.currentMin = that.options.minLimit;\n }\n \n //calculate value\n sliderMoveVal = unitsToPixels(that , that._prvt.currentMin) - that._prvt.innerOffset;\n \n //tracking value to add\n trackingSlider = '_min';\n }\n \n //animate slider\n $(that._prvt.draggingElem).animate({\n 'left': sliderMoveVal + 'px'\n }, 30);\n \n //adjust the sliderRange element\n $(that._prvt.sliderRange).animate({\n 'left': unitsToPixels(that , that._prvt.currentMin) - that._prvt.innerOffset+'px',\n 'width': (unitsToPixels(that , that._prvt.currentMax) - unitsToPixels(that , that._prvt.currentMin))+(that._prvt.handleWidth / 2)+'px'\n }, 30);\n }\n \n //remove custom events\n $('body').off('._RangeSlider'); //dragStop\n \n //set a flag for dragging\n that._prvt.isDragging = false;\n \n //trigger a custom event that updates backbone.js or any other listener\n $(that.element).trigger(that.options.events.onChange, {\n 'name': that.options.filterName,\n 'currentMin': that._prvt.currentMin,\n 'currentMax': that._prvt.currentMax\n });\n\n //bring back the click on the bar\n $(e.data.element).on('click._RangeSlider', '.sliderBar', that, onClickUpdate); //onClickUpdate\n\n }\n e.preventDefault();\n e.stopPropagation();\n }", "_keyupHandlerSlider() {\n const that = this;\n\n if (that._restoreAnimationClass) {\n that.$thumb.addClass('enable-animation');\n that.$secondThumb.addClass('enable-animation');\n that.$fill.addClass('enable-animation');\n }\n }", "handleBlur () {\n // Should the container require to do anything in particular here\n }", "cancelBlur() {\n this._cancelBlur = true;\n }", "stopAnimation() {\n setStyle(this.slider, 'transition', '', true);\n setStyle(this.slider, 'transform', 'translateX(0%)', true);\n }", "function cp_show_price_slider( min_price, max_price, min_value, max_value, precise_price ) {\n\tmax_value = ( ( ! precise_price && max_value <= 1000 ) ? max_price : ( ( precise_price && max_value >= 1000 ) ? 1000 : max_value ) );\n\n\tjQuery('#slider-range').slider( {\n\t\trange: true,\n\t\tmin: min_price,\n\t\tmax: ( ( ! precise_price ) ? max_price : 1000 ),\n\t\tstep: 1,\n\t\tvalues: [ min_value, max_value ],\n\t\tslide: function(event, ui) {\n\t\t\tjQuery('#amount').val( cp_currency_position( ui.values[0] ) + ' - ' + cp_currency_position( ui.values[1] ) );\n\t\t}\n\t});\n\n\tjQuery('#amount').val( cp_currency_position( jQuery('#slider-range').slider('values', 0) ) + ' - ' + cp_currency_position( jQuery('#slider-range').slider('values', 1) ) );\n\n}", "function spacingSliderOnInput() {\n\tvar slider = document.getElementById(\"SpacingSlider\");\n\tvar num_input = document.getElementById(\"SpacingValue\");\n\t\n\tnum_input.value = slider.value / 100;\n}", "sliderReleased(){\r\n clearInterval(this.interval)\r\n this.interval = false\r\n }", "function update_slider(slider_name, value, breakeven_active) { \n $('#baseline_service_life_text').tooltip('hide')\n $('#proposed_service_life_text').tooltip('hide')\n $('#lcoe_proposed').tooltip('hide')\n $('#lcoe_baseline').tooltip('hide')\n\n var slider = document.getElementById(slider_name);\n var max = slider.noUiSlider.options.range.max\n var min = slider.noUiSlider.options.range.min\n value = parseFloat(value)\n\n key = slider_name.substring(0, 8) // 'baseline' and 'proposed' are both 8 letters\n\n // for break-even purposes, calculate the maximum values after the slider is moved to make sure calculation based on most recent values\n // the following four conditions handle the popups on service life and degradation\n if (slider_name == 'baseline_degradation_rate') {\n\n var year = parseFloat($('#'+key+'_service_life_text').val())\n var max_degradation = 1 / (year - 0.5) * 100\n\n // checking equality\n if (!isNaN(value) && !(value < max_degradation)) {\n\n value = max_degradation // restrict displayed value based on maximum\n $('#baseline_degradation_rate_text').val(max_degradation.toFixed(2))\n document.getElementById('baseline_degradation_rate_text').setAttribute('data-original-title', 'Choose a shorter service life to enable a larger degradation rate.');\n\n $('#baseline_degradation_rate_text').tooltip('enable')\n $('#baseline_degradation_rate_text').tooltip('show')\n setTimeout(function(){\n $('#baseline_degradation_rate_text').tooltip('hide');\n }, 3000);\n } else {\n $('#baseline_degradation_rate_text').tooltip('disable')\n }\n\n }\n\n if (slider_name == 'proposed_degradation_rate') {\n var year = parseFloat($('#'+key+'_service_life_text').val())\n var max_degradation = 1 / (year - 0.5) * 100\n\n if (!isNaN(value) && !(value < max_degradation)) { //!isNaN to avoid this condition when '-' inputted before negative number\n value = max_degradation\n $('#proposed_degradation_rate_text').val(max_degradation.toFixed(2))\n document.getElementById('proposed_degradation_rate_text').setAttribute('data-original-title', 'Choose a shorter service life to enable a larger degradation rate.');\n\n $('#proposed_degradation_rate_text').tooltip('enable')\n $('#proposed_degradation_rate_text').tooltip('show')\n setTimeout(function(){\n $('#proposed_degradation_rate_text').tooltip('hide');\n }, 3000);\n } else {\n $('#proposed_degradation_rate_text').tooltip('disable')\n }\n }\n if (slider_name == 'baseline_service_life') {\n var degradation_rate = parseFloat($('#'+key+'_degradation_rate_text').val())/100.0\n var max_year = 1 / degradation_rate + 0.5\n if (!isNaN(value) && !(value < max_year.toFixed(0))) { //!isNaN to avoid this condition when '-' inputted before negative number\n value = max_year.toFixed(0) // round to integer\n\n $('#baseline_service_life_text').val(max_year.toFixed(0))\n document.getElementById('baseline_service_life_text').setAttribute('data-original-title', 'Choose a smaller degradation rate to enable a longer service life.');\n\n $('#baseline_service_life_text').tooltip('enable')\n $('#baseline_service_life_text').tooltip('show')\n\n setTimeout(function(){\n $('#baseline_service_life_text').tooltip('hide');\n }, 3000);\n } else {\n $('#baseline_service_life_text').tooltip('disable')\n }\n } \n if (slider_name == 'proposed_service_life') {\n var degradation_rate = parseFloat($('#'+key+'_degradation_rate_text').val())/100.0\n var max_year = 1 / degradation_rate + 0.5\n if (!isNaN(value) && !(value < max_year.toFixed(0))) {\n value = max_year.toFixed(0)\n\n $('#proposed_service_life_text').val(max_year.toFixed(0))\n document.getElementById('proposed_service_life_text').setAttribute('data-original-title', 'Choose a smaller degradation rate to enable a longer service life.');\n\n $('#proposed_service_life_text').tooltip('enable')\n $('#proposed_service_life_text').tooltip('show')\n\n setTimeout(function(){\n $('#proposed_service_life_text').tooltip('hide');\n }, 3000);\n } else {\n $('#proposed_service_life_text').tooltip('disable')\n }\n } \n\n var degradation_rate = parseFloat($('#'+key+'_degradation_rate_text').val())/100.0\n var year = parseFloat($('#'+key+'_service_life_text').val())\n var max_year = 1 / degradation_rate + 0.5\n \n if (max_year > SERVICE_LIFE_SLIDER_MAX) {\n max_year = SERVICE_LIFE_SLIDER_MAX\n } \n var max_degradation = 1 / (year - 0.5) * 100\n if (max_degradation > DEGRADATION_MAX) {\n max_degradation = DEGRADATION_MAX\n } \n\n // when the degradation or service life slider moves, update the maximum of the other slider\n if (slider_name == 'baseline_degradation_rate') {\n if (degradation_rate > 0) {\n document.getElementById('baseline_service_life').noUiSlider.updateOptions({\n padding: [0, SERVICE_LIFE_SLIDER_MAX-parseInt(max_year)]\n });\n }\n }\n if (slider_name == 'proposed_degradation_rate') {\n if (degradation_rate > 0) {\n document.getElementById('proposed_service_life').noUiSlider.updateOptions({\n padding: [0, SERVICE_LIFE_SLIDER_MAX-parseInt(max_year)]\n });\n }\n }\n if (slider_name == 'baseline_service_life') {\n document.getElementById('baseline_degradation_rate').noUiSlider.updateOptions({\n padding: [0, Math.round((DEGRADATION_MAX - max_degradation)*100)/100 ]\n });\n }\n if (slider_name == 'proposed_service_life') {\n document.getElementById('proposed_degradation_rate').noUiSlider.updateOptions({\n padding: [0, Math.round((DEGRADATION_MAX - max_degradation)*100)/100 ] \n });\n } \n\n // efficiency bounded by 0% and 100%\n if (slider_name == 'baseline_efficiency') {\n if (value < 0 || isNaN(value)) $('#baseline_efficiency_text').val(0)\n if (value > EFFICIENCY_MAX) $('#baseline_efficiency_text').val(EFFICIENCY_MAX)\n if (!breakeven_active) $('#baseline_efficiency_text').tooltip('disable') \n }\n if (slider_name == 'proposed_efficiency') {\n if (value < 0 || isNaN(value)) $('#proposed_efficiency_text').val(0)\n if (value > EFFICIENCY_MAX) $('#proposed_efficiency_text').val(EFFICIENCY_MAX)\n if (!breakeven_active) $('#proposed_efficiency_text').tooltip('disable') \n }\n\n // degradation rate lower bounded by zero\n if (slider_name == 'baseline_degradation_rate' && (value < 0 || isNaN(value))) {\n $('#baseline_degradation_rate_text').val(0)\n if (!breakeven_active) $('#baseline_degradation_rate_text').tooltip('disable') \n }\n if (slider_name == 'proposed_degradation_rate' && (value < 0 || isNaN(value))) {\n if (!breakeven_active) $('#proposed_degradation_rate_text').tooltip('disable') \n }\n\n // energy yield lower bounded by zero\n if (slider_name == 'baseline_energy_yield' && (value < 0 || isNaN(value))) {\n $('#baseline_energy_yield_text').val(0)\n if (!breakeven_active) $('#baseline_energy_yield_text').tooltip('disable') \n }\n if (slider_name == 'proposed_energy_yield' && (value < 0 || isNaN(value))) {\n $('#proposed_energy_yield_text').val(0)\n if (!breakeven_active) $('#proposed_energy_yield_text').tooltip('disable') \n }\n\n // displays warning if non-positive integer service life\n if ((slider_name == 'baseline_service_life' && (!Number.isInteger(value))) || (slider_name == 'baseline_service_life' && value >= SERVICE_LIFE_CAP) || (slider_name == 'baseline_service_life' && value < 1)) {\n\n if (value > SERVICE_LIFE_CAP) { // set service life maximum at 1000 (calculator freezes if service life is too large)\n $('#baseline_service_life_text').val(SERVICE_LIFE_CAP)\n }\n\n if (value < 1) { // restrict to positive numbers\n $('#baseline_service_life_text').val(1)\n }\n\n if (!breakeven_active) { // only display for non-break-even interaction\n\n document.getElementById('baseline_service_life_text').setAttribute('data-original-title', 'Service life must be a positive integer no greater than 1000.');\n \n $('#baseline_service_life_text').tooltip('enable')\n $('#baseline_service_life_text').tooltip('show')\n }\n } else {\n $('#baseline_service_life_text').tooltip('disable')\n }\n\n if ((slider_name == 'proposed_service_life' && (!Number.isInteger(value))) || (slider_name == 'proposed_service_life' && value >= SERVICE_LIFE_CAP) || (slider_name == 'proposed_service_life' && value < 1)) {\n\n if (value > SERVICE_LIFE_CAP) { // set service life maximum at 1000 (calculator freezes if service life is too large)\n $('#proposed_service_life_text').val(SERVICE_LIFE_CAP)\n }\n\n if (value < 1) { // restrict to positive numbers\n $('#proposed_service_life_text').val(1)\n }\n\n if (!breakeven_active) {\n document.getElementById('proposed_service_life_text').setAttribute('data-original-title', 'Service life must be a positive integer no greater than 1000.');\n \n $('#proposed_service_life_text').tooltip('enable')\n $('#proposed_service_life_text').tooltip('show')\n }\n } else {\n $('#proposed_service_life_text').tooltip('disable')\n } \n\n // The conditionals allow the user to put in an out-of-bounds number\n if (value >= max) {\n slider.noUiSlider.set(max);\n } else if (value <= min) {\n slider.noUiSlider.set(min);\n } else {\n slider.noUiSlider.set(value);\n }\n}" ]
[ "0.7104866", "0.63198334", "0.63052547", "0.63052547", "0.6225074", "0.61850816", "0.6126309", "0.60301", "0.5933545", "0.57518923", "0.56433153", "0.56074816", "0.56014985", "0.56014985", "0.5597195", "0.55478835", "0.5537766", "0.5528481", "0.5506492", "0.54987305", "0.5498321", "0.5492014", "0.5484344", "0.54821396", "0.5479327", "0.54724294", "0.54715204", "0.54472595", "0.54404235", "0.5432767", "0.5423156", "0.5423156", "0.5418662", "0.5404855", "0.5401486", "0.53958505", "0.5393227", "0.5359015", "0.5356244", "0.5351247", "0.5350309", "0.53465927", "0.5322859", "0.5310541", "0.52995604", "0.52973735", "0.5255992", "0.5255992", "0.5251878", "0.5242826", "0.52403", "0.5232126", "0.5231911", "0.5226326", "0.52226996", "0.52226996", "0.52226996", "0.52226996", "0.52226996", "0.52226996", "0.52226996", "0.5222483", "0.5214104", "0.52137697", "0.5213442", "0.52116346", "0.5198289", "0.5194339", "0.5193217", "0.51916796", "0.5189256", "0.51880515", "0.51846313", "0.51815397", "0.51778996", "0.51778996", "0.51778996", "0.51778996", "0.51778996", "0.5177766", "0.5173419", "0.5172825", "0.51688236", "0.51685596", "0.5165935", "0.5165935", "0.5165241", "0.5163707", "0.5162823", "0.51619494", "0.5161816", "0.516109", "0.51556474", "0.514834", "0.514493", "0.513535", "0.5129641", "0.5129364", "0.5124877", "0.5110546" ]
0.87058455
0
This class defines a complete generic visitor for a parse tree produced by PythonLikeParser.
function PythonLikeVisitor() { antlr4.tree.ParseTreeVisitor.call(this); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "visitNode(node) { }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "function walk_tree(ast) {\n var walker = {\n \"assign\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n assign_expr.left_expr = walk_tree(ast[2]);\n assign_expr.right_expr = walk_tree(ast[3]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr;\n },\n \n \"var\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n \n assign_expr.left_expr = new type_object();\n assign_expr.left_expr.name = ast[1][0][0];\n assign_expr.right_expr = walk_tree(ast[1][0][1]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr; \n },\n \n \"stat\" : function() {\n return walk_tree(ast[1]);\n },\n \n \"dot\" : function() {\n var dot_obj = walk_tree(ast[1]);\n dot_obj.child = new type_object();\n dot_obj.child.name = ast[2];\n dot_obj.child.parent = dot_obj;\n return dot_obj;\n },\n \n \"name\" : function() {\n var new_obj = new type_object();\n new_obj.type = \"name\";\n new_obj.name = ast[1];\n return new_obj;\n },\n \n \"new\" : function() {\n var expr = walk_tree(ast[1]);\n expr.type = \"composition\";\n return expr;\n },\n \n \"function\" : function() {\n var func = new type_function(\"function\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"defun\" : function() { \n var func = new type_function(\"defun\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"return\" : function() {\n var return_expr = new type_expression();\n return_expr.type = \"return_expr\";\n return_expr.expr = walk_tree(ast[1]);\n return return_expr;\n },\n \n \"string\" : function() {\n var obj = new type_object();\n obj.type = \"string\";\n obj.value = ast[1];\n return obj;\n },\n \n \"num\" : function() {\n var obj = new type_object();\n obj.type = \"num\";\n obj.value = ast[1];\n return obj;\n },\n \n \"binary\" : function() {\n var binary_expr = new binary_expression();\n binary_expr.type = \"binary_expr\";\n binary_expr.binary_lhs = walk_tree(ast[2]);\n binary_expr.binary_rhs = walk_tree(ast[3]);\n },\n }\n \n var parent = ast[0];\n \n var func = walker[parent];\n \n return func(ast);\n}", "function Visitor() {}", "function Visitor() {}", "function Visitor() {}", "getTreeInternal() {\n const op = this;\n return new class extends Tree {\n /**\n * @param {!Visitor<P, R>} visitor\n * @param {P} arg\n * @return {R}\n * @template P, R\n */\n visit(visitor, arg) {\n const handler = op[visitor.symbol];\n if (handler) {\n return handler.call(\n op, args.map(a => visitor.wrap(a, arg)), arg);\n }\n return visitor.default(args, arg);\n }\n };\n }", "function Visitor(doc) {\n\tthis.stack = [];\n\tthis.parent = doc; //always a list item\n\tthis.node = doc.head();\n\tthis.index = 0;\n\tthis.point = 1;\n\tthis.retained = 0;\n\tthis.ops = []; //to get to the doc\n}", "function FPythonListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node))\n return;\n if (node.kind === ts.SyntaxKind.EnumDeclaration) {\n var enNode = node;\n var symbol = checker.getSymbolAtLocation(enNode.name);\n if (!!symbol && generateDts) {\n visitEnumNode(enNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.FunctionDeclaration) {\n var fnNode = node;\n var symbol = checker.getSymbolAtLocation(fnNode.name);\n if (!!symbol && generateDts) {\n visitFunctionNode(fnNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.VariableStatement) {\n var vsNode = node;\n if (vsNode.declarationList.declarations.length > 0) {\n var varNode = vsNode.declarationList.declarations[0];\n var symbol = checker.getSymbolAtLocation(varNode.name);\n if (!!symbol && (generateDts || isSymbolHasComments(symbol))) {\n visitVariableNode(varNode, symbol);\n }\n }\n }\n else if (node.kind === ts.SyntaxKind.ClassDeclaration) {\n // This is a top level class, get its symbol\n var symbol = checker.getSymbolAtLocation(node.name);\n if (!symbol)\n return;\n if (generateDts || isSymbolHasComments(symbol)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.InterfaceDeclaration) {\n // This is a top level class, get its symbol\n var name_1 = node.name;\n var symbol = checker.getSymbolAtLocation(name_1);\n if (generateDts || isSymbolHasComments(symbol) || isOptionsInterface(name_1.text)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.ModuleDeclaration) {\n // This is a namespace, visit its children\n ts.forEachChild(node, visit);\n }\n else if (node.kind === ts.SyntaxKind.ExportDeclaration) {\n visitExportDeclarationNode(node);\n }\n }", "visit(){\n\t\tif(!this.parent || this.parent.content)\n\t\t\treturn this.convert(...arguments)\n\t}", "function KELParserVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function PEGtoAST(node) {\n switch (type(node)) {\n case \"null\":\n return undefined;\n case \"string\":\n return new StringNode(node);\n case \"array\":\n return new ASTNodeList(...node.map(PEGtoAST));\n case \"object\":\n switch (node.TYPE) {\n case \"whitespace\":\n return new Whitespace();\n case \"parbreak\":\n return new Parbreak();\n case \"subscript\":\n return new Subscript(PEGtoAST(node.content));\n case \"superscript\":\n return new Superscript(PEGtoAST(node.content));\n case \"inlinemath\":\n return new InlineMath(PEGtoAST(node.content));\n case \"displaymath\":\n return new DisplayMath(PEGtoAST(node.content));\n case \"mathenv\":\n return new MathEnv(node.env, PEGtoAST(node.content));\n case \"group\":\n return new Group(PEGtoAST(node.content));\n case \"macro\":\n return new Macro(node.content, PEGtoAST(node.args));\n case \"environment\":\n return new Environment(\n PEGtoAST(node.env),\n PEGtoAST(node.args),\n PEGtoAST(node.content)\n );\n case \"verbatim\":\n return new Verbatim(PEGtoAST(node.content));\n case \"verb\":\n return new Verb(node[\"escape\"], PEGtoAST(node.content));\n case \"commentenv\":\n return new CommentEnv(PEGtoAST([node.content]));\n case \"comment\":\n return new CommentNode(\n node.sameline,\n PEGtoAST(node.content)\n );\n case \"arglist\":\n return new ArgList(PEGtoAST(node.content));\n }\n }\n}", "function CodiVisitor() {\r\n\tantlr4.tree.ParseTreeVisitor.call(this);\r\n\treturn this;\r\n}", "function PlaygroundVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "compileNode(o) {\r\n\t\t\t\t\tvar answer, compiledName, isValue, name, properties, prototype, ref1, ref2, ref3, ref4, val;\r\n\t\t\t\t\tisValue = this.variable instanceof Value;\r\n\t\t\t\t\tif (isValue) {\r\n\t\t\t\t\t\t// If `@variable` is an array or an object, we’re destructuring;\r\n\t\t\t\t\t\t// if it’s also `isAssignable()`, the destructuring syntax is supported\r\n\t\t\t\t\t\t// in ES and we can output it as is; otherwise we `@compileDestructuring`\r\n\t\t\t\t\t\t// and convert this ES-unsupported destructuring into acceptable output.\r\n\t\t\t\t\t\tif (this.variable.isArray() || this.variable.isObject()) {\r\n\t\t\t\t\t\t\tif (!this.variable.isAssignable()) {\r\n\t\t\t\t\t\t\t\tif (this.variable.isObject() && this.variable.base.hasSplat()) {\r\n\t\t\t\t\t\t\t\t\treturn this.compileObjectDestruct(o);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\treturn this.compileDestructuring(o);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.variable.isSplice()) {\r\n\t\t\t\t\t\t\treturn this.compileSplice(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.isConditional()) {\r\n\t\t\t\t\t\t\treturn this.compileConditional(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((ref1 = this.context) === '//=' || ref1 === '%%=') {\r\n\t\t\t\t\t\t\treturn this.compileSpecialMath(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.addScopeVariables(o);\r\n\t\t\t\t\tif (this.value instanceof Code) {\r\n\t\t\t\t\t\tif (this.value.isStatic) {\r\n\t\t\t\t\t\t\tthis.value.name = this.variable.properties[0];\r\n\t\t\t\t\t\t} else if (((ref2 = this.variable.properties) != null ? ref2.length : void 0) >= 2) {\r\n\t\t\t\t\t\t\tref3 = this.variable.properties, [...properties] = ref3, [prototype, name] = splice.call(properties, -2);\r\n\t\t\t\t\t\t\tif (((ref4 = prototype.name) != null ? ref4.value : void 0) === 'prototype') {\r\n\t\t\t\t\t\t\t\tthis.value.name = name;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tval = this.value.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tcompiledName = this.variable.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tif (this.context === 'object') {\r\n\t\t\t\t\t\tif (this.variable.shouldCache()) {\r\n\t\t\t\t\t\t\tcompiledName.unshift(this.makeCode('['));\r\n\t\t\t\t\t\t\tcompiledName.push(this.makeCode(']'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn compiledName.concat(this.makeCode(': '), val);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanswer = compiledName.concat(this.makeCode(` ${this.context || '='} `), val);\r\n\t\t\t\t\t// Per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Assignment_without_declaration,\r\n\t\t\t\t\t// if we’re destructuring without declaring, the destructuring assignment must be wrapped in parentheses.\r\n\t\t\t\t\t// The assignment is wrapped in parentheses if 'o.level' has lower precedence than LEVEL_LIST (3)\r\n\t\t\t\t\t// (i.e. LEVEL_COND (4), LEVEL_OP (5) or LEVEL_ACCESS (6)), or if we're destructuring object, e.g. {a,b} = obj.\r\n\t\t\t\t\tif (o.level > LEVEL_LIST || isValue && this.variable.base instanceof Obj && !this.nestedLhs && !(this.param === true)) {\r\n\t\t\t\t\t\treturn this.wrapInParentheses(answer);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn answer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function statVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function Parser() {\n var nodeFactory = arguments.length <= 0 || arguments[0] === undefined ? new _nodeFactory.NodeFactory() : arguments[0];\n\n _classCallCheck(this, Parser);\n\n this.nodeFactory = nodeFactory;\n }", "function traverser(ast, visitor) {\n\n function traverseArray(array, parent) {\n array.forEach(child => {\n traverseNode(child, parent);\n });\n }\n\n function traverseNode(node, parent) {\n let methods = visitor[node.type];\n if (methods && methods.enter) {\n methods.enter(node, parent);\n }\n\n switch (node.type) {\n case 'Document':\n traverseArray(node.body, node);\n break;\n case 'DOMELEMENT':\n traverseArray(node.params, node);\n break;\n case \"CARGO\":\n break;\n }\n if (methods && methods.exit) {\n methods.exit(node, parent);\n }\n }\n traverseNode(ast, null);\n}", "function rcVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function NodeVisitor() {\n _classCallCheck(this, NodeVisitor);\n\n this[path] = [];\n }", "function ast_walker() {\n\tfunction _vardefs( defs ) {\n\t\treturn [ this[0], MAP( defs, function ( def ) {\n\t\t\tvar a = [ def[0] ];\n\t\t\tif ( def.length > 1 ) {\n\t\t\t\ta[1] = walk( def[1] );\n\t\t\t}\n\t\t\treturn a;\n\t\t} ) ];\n\t}\n\n\t;\n\tfunction _block( statements ) {\n\t\tvar out = [ this[0] ];\n\t\tif ( statements != null ) {\n\t\t\tout.push( MAP( statements, walk ) );\n\t\t}\n\t\treturn out;\n\t}\n\n\t;\n\tvar walkers = {\n\t\t\"string\" : function ( str ) {\n\t\t\treturn [ this[0], str ];\n\t\t},\n\t\t\"num\" : function ( num ) {\n\t\t\treturn [ this[0], num ];\n\t\t},\n\t\t\"name\" : function ( name ) {\n\t\t\treturn [ this[0], name ];\n\t\t},\n\t\t\"toplevel\" : function ( statements ) {\n\t\t\treturn [ this[0], MAP( statements, walk ) ];\n\t\t},\n\t\t\"block\" : _block,\n\t\t\"splice\" : _block,\n\t\t\"var\" : _vardefs,\n\t\t\"const\" : _vardefs,\n\t\t\"try\" : function ( t, c, f ) {\n\t\t\treturn [\n\t\t\t\tthis[0],\n\t\t\t\tMAP( t, walk ),\n\t\t\t\tc != null ? [ c[0], MAP( c[1], walk ) ] : null,\n\t\t\t\tf != null ? MAP( f, walk ) : null\n\t\t\t];\n\t\t},\n\t\t\"throw\" : function ( expr ) {\n\t\t\treturn [ this[0], walk( expr ) ];\n\t\t},\n\t\t\"new\" : function ( ctor, args ) {\n\t\t\treturn [ this[0], walk( ctor ), MAP( args, walk ) ];\n\t\t},\n\t\t\"switch\" : function ( expr, body ) {\n\t\t\treturn [ this[0], walk( expr ), MAP( body, function ( branch ) {\n\t\t\t\treturn [ branch[0] ? walk( branch[0] ) : null,\n\t\t\t\t MAP( branch[1], walk ) ];\n\t\t\t} ) ];\n\t\t},\n\t\t\"break\" : function ( label ) {\n\t\t\treturn [ this[0], label ];\n\t\t},\n\t\t\"continue\" : function ( label ) {\n\t\t\treturn [ this[0], label ];\n\t\t},\n\t\t\"conditional\" : function ( cond, t, e ) {\n\t\t\treturn [ this[0], walk( cond ), walk( t ), walk( e ) ];\n\t\t},\n\t\t\"assign\" : function ( op, lvalue, rvalue ) {\n\t\t\treturn [ this[0], op, walk( lvalue ), walk( rvalue ) ];\n\t\t},\n\t\t\"dot\" : function ( expr ) {\n\t\t\treturn [ this[0], walk( expr ) ].concat( slice( arguments, 1 ) );\n\t\t},\n\t\t\"call\" : function ( expr, args ) {\n\t\t\treturn [ this[0], walk( expr ), MAP( args, walk ) ];\n\t\t},\n\t\t\"function\" : function ( name, args, body ) {\n\t\t\treturn [ this[0], name, args.slice(), MAP( body, walk ) ];\n\t\t},\n\t\t\"debugger\" : function () {\n\t\t\treturn [ this[0] ];\n\t\t},\n\t\t\"defun\" : function ( name, args, body ) {\n\t\t\treturn [ this[0], name, args.slice(), MAP( body, walk ) ];\n\t\t},\n\t\t\"if\" : function ( conditional, t, e ) {\n\t\t\treturn [ this[0], walk( conditional ), walk( t ), walk( e ) ];\n\t\t},\n\t\t\"for\" : function ( init, cond, step, block ) {\n\t\t\treturn [ this[0], walk( init ), walk( cond ), walk( step ), walk( block ) ];\n\t\t},\n\t\t\"for-in\" : function ( vvar, key, hash, block ) {\n\t\t\treturn [ this[0], walk( vvar ), walk( key ), walk( hash ), walk( block ) ];\n\t\t},\n\t\t\"while\" : function ( cond, block ) {\n\t\t\treturn [ this[0], walk( cond ), walk( block ) ];\n\t\t},\n\t\t\"do\" : function ( cond, block ) {\n\t\t\treturn [ this[0], walk( cond ), walk( block ) ];\n\t\t},\n\t\t\"return\" : function ( expr ) {\n\t\t\treturn [ this[0], walk( expr ) ];\n\t\t},\n\t\t\"binary\" : function ( op, left, right ) {\n\t\t\treturn [ this[0], op, walk( left ), walk( right ) ];\n\t\t},\n\t\t\"unary-prefix\" : function ( op, expr ) {\n\t\t\treturn [ this[0], op, walk( expr ) ];\n\t\t},\n\t\t\"unary-postfix\" : function ( op, expr ) {\n\t\t\treturn [ this[0], op, walk( expr ) ];\n\t\t},\n\t\t\"sub\" : function ( expr, subscript ) {\n\t\t\treturn [ this[0], walk( expr ), walk( subscript ) ];\n\t\t},\n\t\t\"object\" : function ( props ) {\n\t\t\treturn [ this[0], MAP( props, function ( p ) {\n\t\t\t\treturn p.length == 2\n\t\t\t\t\t? [ p[0], walk( p[1] ) ]\n\t\t\t\t\t: [ p[0], walk( p[1] ), p[2] ]; // get/set-ter\n\t\t\t} ) ];\n\t\t},\n\t\t\"regexp\" : function ( rx, mods ) {\n\t\t\treturn [ this[0], rx, mods ];\n\t\t},\n\t\t\"array\" : function ( elements ) {\n\t\t\treturn [ this[0], MAP( elements, walk ) ];\n\t\t},\n\t\t\"stat\" : function ( stat ) {\n\t\t\treturn [ this[0], walk( stat ) ];\n\t\t},\n\t\t\"seq\" : function () {\n\t\t\treturn [ this[0] ].concat( MAP( slice( arguments ), walk ) );\n\t\t},\n\t\t\"label\" : function ( name, block ) {\n\t\t\treturn [ this[0], name, walk( block ) ];\n\t\t},\n\t\t\"with\" : function ( expr, block ) {\n\t\t\treturn [ this[0], walk( expr ), walk( block ) ];\n\t\t},\n\t\t\"atom\" : function ( name ) {\n\t\t\treturn [ this[0], name ];\n\t\t}\n\t};\n\n\tvar user = {};\n\tvar stack = [];\n\n\tfunction walk( ast ) {\n\t\tif ( ast == null ) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\tstack.push( ast );\n\t\t\tvar type = ast[0];\n\t\t\tvar gen = user[type];\n\t\t\tif ( gen ) {\n\t\t\t\tvar ret = gen.apply( ast, ast.slice( 1 ) );\n\t\t\t\tif ( ret != null ) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\t}\n\t\t\tgen = walkers[type];\n\t\t\treturn gen.apply( ast, ast.slice( 1 ) );\n\t\t} finally {\n\t\t\tstack.pop();\n\t\t}\n\t}\n\n\t;\n\n\tfunction dive( ast ) {\n\t\tif ( ast == null ) {\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\tstack.push( ast );\n\t\t\treturn walkers[ast[0]].apply( ast, ast.slice( 1 ) );\n\t\t} finally {\n\t\t\tstack.pop();\n\t\t}\n\t}\n\n\t;\n\n\tfunction with_walkers( walkers, cont ) {\n\t\tvar save = {}, i;\n\t\tfor ( i in walkers ) {\n\t\t\tif ( HOP( walkers, i ) ) {\n\t\t\t\tsave[i] = user[i];\n\t\t\t\tuser[i] = walkers[i];\n\t\t\t}\n\t\t}\n\t\tvar ret = cont();\n\t\tfor ( i in save ) {\n\t\t\tif ( HOP( save, i ) ) {\n\t\t\t\tif ( !save[i] ) {\n\t\t\t\t\tdelete user[i];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tuser[i] = save[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}\n\n\t;\n\n\treturn {\n\t\twalk : walk,\n\t\tdive : dive,\n\t\twith_walkers : with_walkers,\n\t\tparent : function () {\n\t\t\treturn stack[stack.length - 2]; // last one is current node\n\t\t},\n\t\tstack : function () {\n\t\t\treturn stack;\n\t\t}\n\t};\n}", "function JavapVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "compileNode(o) {\r\n\t\t\t\t\tvar arg, argCode, argIndex, cache, compiledArgs, fragments, j, len1, ref1, ref2, ref3, ref4, varAccess;\r\n\t\t\t\t\tthis.checkForNewSuper();\r\n\t\t\t\t\tif ((ref1 = this.variable) != null) {\r\n\t\t\t\t\t\tref1.front = this.front;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcompiledArgs = [];\r\n\t\t\t\t\t// If variable is `Accessor` fragments are cached and used later\r\n\t\t\t\t\t// in `Value::compileNode` to ensure correct order of the compilation,\r\n\t\t\t\t\t// and reuse of variables in the scope.\r\n\t\t\t\t\t// Example:\r\n\t\t\t\t\t// `a(x = 5).b(-> x = 6)` should compile in the same order as\r\n\t\t\t\t\t// `a(x = 5); b(-> x = 6)`\r\n\t\t\t\t\t// (see issue #4437, https://github.com/jashkenas/coffeescript/issues/4437)\r\n\t\t\t\t\tvarAccess = ((ref2 = this.variable) != null ? (ref3 = ref2.properties) != null ? ref3[0] : void 0 : void 0) instanceof Access;\r\n\t\t\t\t\targCode = (function() {\r\n\t\t\t\t\t\tvar j, len1, ref4, results1;\r\n\t\t\t\t\t\tref4 = this.args || [];\r\n\t\t\t\t\t\tresults1 = [];\r\n\t\t\t\t\t\tfor (j = 0, len1 = ref4.length; j < len1; j++) {\r\n\t\t\t\t\t\t\targ = ref4[j];\r\n\t\t\t\t\t\t\tif (arg instanceof Code) {\r\n\t\t\t\t\t\t\t\tresults1.push(arg);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn results1;\r\n\t\t\t\t\t}).call(this);\r\n\t\t\t\t\tif (argCode.length > 0 && varAccess && !this.variable.base.cached) {\r\n\t\t\t\t\t\t[cache] = this.variable.base.cache(o, LEVEL_ACCESS, function() {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.variable.base.cached = cache;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tref4 = this.args;\r\n\t\t\t\t\tfor (argIndex = j = 0, len1 = ref4.length; j < len1; argIndex = ++j) {\r\n\t\t\t\t\t\targ = ref4[argIndex];\r\n\t\t\t\t\t\tif (argIndex) {\r\n\t\t\t\t\t\t\tcompiledArgs.push(this.makeCode(\", \"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcompiledArgs.push(...(arg.compileToFragments(o, LEVEL_LIST)));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfragments = [];\r\n\t\t\t\t\tif (this.isNew) {\r\n\t\t\t\t\t\tfragments.push(this.makeCode('new '));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfragments.push(...this.variable.compileToFragments(o, LEVEL_ACCESS));\r\n\t\t\t\t\tfragments.push(this.makeCode('('), ...compiledArgs, this.makeCode(')'));\r\n\t\t\t\t\treturn fragments;\r\n\t\t\t\t}", "function RomeVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function TreeParser() {\n var orderOfOperations,\n tokens,\n length,\n index,\n peekAtNextToken,\n parse,\n parseExpression,\n parseAdditive,\n parseMultiplicative,\n parsePrimary,\n isInLevel,\n parseBinary,\n calculate,\n mathOperations;\n\n orderOfOperations = [['+', '-'],['*', '/'], ['^']];\n\n mathOperations = {\n '+' : function(x, y) {\n return x + y;\n },\n\n '-' : function(x, y) {\n return x - y;\n },\n\n '*' : function(x, y) {\n return x * y;\n },\n\n '/' : function(x, y) {\n if (y === 0) {\n throw 'the right operand of a divide operator cannot be zero';\n }\n return x / y;\n },\n\n '^' : function(x, y) {\n return Math.pow(x, y);\n } \n }\n\n tokens = [];\n length = 0;\n index = 0;\n\n peekAtNextToken = function () {\n if (index === length) {\n return null;\n }\n return tokens[index];\n };\n\n /**\n * creates an abstract tree from a tokens array\n * this function does not validate the expression mathematically\n * @param {array} tokensArr an array that contains tokens\n * @return {object} the abstract expression tree root\n */\n parse = function (tokensArr) {\n tokens = tokensArr;\n length = tokens.length;\n if (length === 0) {\n return;\n }\n index = 0;\n\n //we want to parse the expression from left to right to avoid problems like 1-1-1=1\n tokens = tokens.reverse();\n return parseExpression();\n };\n\n /**\n * parses an assignment expression\n * @return {object} the abstract expression tree assignment node\n */\n parseExpression = function () {\n return parseBinary(0);\n };\n\n /**\n * parses an assignment expression\n * @return {object} the abstract expression tree assignment node\n */\n isInLevel = function (operator, order) {\n return orderOfOperations[order].indexOf(operator) > -1;\n };\n\n /**\n * recursivly parses a binary expression by order of operations\n * each recursion level represents the more immidiate operation\n * @param {Number} order the current order of operation\n * @return {object} the abstract expression tree node\n */\n parseBinary = function (order) {\n var right,\n token,\n node;\n\n right = order == orderOfOperations.length - 1\n ? parsePrimary()\n : parseBinary(order + 1);\n \n token = peekAtNextToken();\n if (token === null) {\n return right;\n }\n\n while (isInLevel(token.value, order)) {\n index += 1;\n node = {};\n node = token;\n node.right = right;\n node.left = parseBinary(order);\n right = node;\n \n token = peekAtNextToken();\n if (token === null) {\n return right;\n }\n }\n\n return right;\n };\n\n /**\n * parses a term expression i.e. a finite number, an varialbe or an expression in parens\n * @return {object} the abstract expression tree primary node\n */\n parsePrimary = function () {\n var token,\n node;\n\n if (index === length) {\n throw \"error: there are no more tokens to parse\";\n }\n\n token = tokens[index];\n if (token.type === tokenType.num || token.type === tokenType.id) {\n index += 1;\n node = {};\n node = token;\n return node;\n }\n\n if (token.value === ')') {\n index += 1;\n node = parseExpression();\n\n token = peekAtNextToken();\n if (token.value !== '(') {\n throw \"error: '(' was expected\";\n }\n\n index += 1;\n return node;\n }\n\n throw \"error: token '\" + token.value + \"' was not expected\";\n };\n\n /**\n * calculates the result from mathematical tree\n * @param {object} the ree/sub tree token node\n * @return {Number} the result of the calculation\n */\n calculate = function (node) {\n var left,\n right,\n operator,\n result;\n\n if (node === null) return;\n if (node.type === tokenType.id) {\n throw 'variables are not supported at this point';\n }\n \n if (node.type === tokenType.num) {\n return parseFloat(node.value);\n }\n\n left = node.left.type === tokenType.num\n ? parseFloat(node.left.value)\n : calculate(node.left);\n\n right = node.right.type === tokenType.num\n ? parseFloat(node.right.value)\n : calculate(node.right);\n\n if (node.type !== tokenType.op) {\n throw 'an operator was expected';\n }\n\n result = mathOperations[node.value](left, right);\n return result; \n }\n\n return {\n parse: parse,\n calculate: calculate\n };\n }", "function walkAst(node, parent) {\n\t\t\tif (!node)\n\t\t\t\treturn;\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], node);\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, node);\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 && !(parent && (\n\t\t\t\t\t\t// We need to filter out parents that are comparison\n\t\t\t\t\t\t// operators, e.g. for situations like if (++i < 1),\n\t\t\t\t\t\t// as we can't replace that with if (_$_(i, \"+\", 1) < 1)\n\t\t\t\t\t\t// Match any operator beginning with =, !, < and >.\n\t\t\t\t\t\tparent.type === 'BinaryExpression'\n\t\t\t\t\t\t\t&& /^[=!<>]/.test(parent.operator)\n\t\t\t\t\t\t// array[i++] is a MemberExpression with computed = true\n\t\t\t\t\t\t// We can't replace that with array[_$_(i, \"+\", 1)].\n\t\t\t\t\t\t|| parent.type === 'MemberExpression'\n\t\t\t\t\t\t\t&& parent.computed))) {\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}", "function traverseNodes(node, visitor) {\n traverse(node, null, visitor);\n}", "constructor( type, code_or_tree, embedded=false ){\n super(type)\n if(typeof code_or_tree == \"string\" ){\n var p = new GeneratorParser(false, embedded)\n this.tree = p.get(new Source(\"generator-lexeme\",code_or_tree))\n }else this.tree = code_or_tree\n }", "function traverseTokens(tokens, visitor) {\n tokens.forEach(t => {\n if (t.type === 'html_block' || t.type === 'html_inline') {\n const matches = t.content.match(/<(\\w+-(\\w+-?)+)/);\n if (matches) {\n visitor(matches[1]);\n }\n }\n\n if (t.children) {\n traverseTokens(t.children, visitor);\n }\n });\n}", "function ast_walker(){function e(e){return[this[0],MAP(e,function(e){var t=[e[0]\n];return e.length>1&&(t[1]=s(e[1])),t})]}function t(e){var t=[this[0]];return e!=\nnull&&t.push(MAP(e,s)),t}function s(e){if(e==null)return null;try{i.push(e);var t=\ne[0],s=r[t];if(s){var o=s.apply(e,e.slice(1));if(o!=null)return o}return s=n[t],\ns.apply(e,e.slice(1))}finally{i.pop()}}function o(e){if(e==null)return null;try{\nreturn i.push(e),n[e[0]].apply(e,e.slice(1))}finally{i.pop()}}function u(e,t){var n=\n{},i;for(i in e)HOP(e,i)&&(n[i]=r[i],r[i]=e[i]);var s=t();for(i in n)HOP(n,i)&&(\nn[i]?r[i]=n[i]:delete r[i]);return s}var n={string:function(e){return[this[0],e]\n},num:function(e){return[this[0],e]},name:function(e){return[this[0],e]},toplevel\n:function(e){return[this[0],MAP(e,s)]},block:t,splice:t,\"var\":e,\"const\":e,\"try\":\nfunction(e,t,n){return[this[0],MAP(e,s),t!=null?[t[0],MAP(t[1],s)]:null,n!=null?\nMAP(n,s):null]},\"throw\":function(e){return[this[0],s(e)]},\"new\":function(e,t){return[\nthis[0],s(e),MAP(t,s)]},\"switch\":function(e,t){return[this[0],s(e),MAP(t,function(\ne){return[e[0]?s(e[0]):null,MAP(e[1],s)]})]},\"break\":function(e){return[this[0],\ne]},\"continue\":function(e){return[this[0],e]},conditional:function(e,t,n){return[\nthis[0],s(e),s(t),s(n)]},assign:function(e,t,n){return[this[0],e,s(t),s(n)]},dot\n:function(e){return[this[0],s(e)].concat(slice(arguments,1))},call:function(e,t)\n{return[this[0],s(e),MAP(t,s)]},\"function\":function(e,t,n){return[this[0],e,t.slice\n(),MAP(n,s)]},\"debugger\":function(){return[this[0]]},defun:function(e,t,n){return[\nthis[0],e,t.slice(),MAP(n,s)]},\"if\":function(e,t,n){return[this[0],s(e),s(t),s(n\n)]},\"for\":function(e,t,n,r){return[this[0],s(e),s(t),s(n),s(r)]},\"for-in\":function(\ne,t,n,r){return[this[0],s(e),s(t),s(n),s(r)]},\"while\":function(e,t){return[this[0\n],s(e),s(t)]},\"do\":function(e,t){return[this[0],s(e),s(t)]},\"return\":function(e)\n{return[this[0],s(e)]},binary:function(e,t,n){return[this[0],e,s(t),s(n)]},\"unary-prefix\"\n:function(e,t){return[this[0],e,s(t)]},\"unary-postfix\":function(e,t){return[this\n[0],e,s(t)]},sub:function(e,t){return[this[0],s(e),s(t)]},object:function(e){return[\nthis[0],MAP(e,function(e){return e.length==2?[e[0],s(e[1])]:[e[0],s(e[1]),e[2]]}\n)]},regexp:function(e,t){return[this[0],e,t]},array:function(e){return[this[0],MAP\n(e,s)]},stat:function(e){return[this[0],s(e)]},seq:function(){return[this[0]].concat\n(MAP(slice(arguments),s))},label:function(e,t){return[this[0],e,s(t)]},\"with\":function(\ne,t){return[this[0],s(e),s(t)]},atom:function(e){return[this[0],e]},directive:function(\ne){return[this[0],e]}},r={},i=[];return{walk:s,dive:o,with_walkers:u,parent:function(\n){return i[i.length-2]},stack:function(){return i}}}", "function HelloVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "_traverse(n, state, f) {\n var content = \"\";\n\n if (TreeTransformer.isNode(n)) {\n // If we were called on a node object, then we handle it\n // this way.\n var node = n; // safe cast; we just tested\n // Put the node on the stack before recursing on its children\n\n state._containers.push(node);\n\n state._ancestors.push(node); // Record the node's text content if it has any.\n // Usually this is for nodes with a type property of \"text\",\n // but other nodes types like \"math\" may also have content.\n\n\n if (typeof node.content === \"string\") {\n content = node.content;\n } // Recurse on the node. If there was content above, then there\n // probably won't be any children to recurse on, but we check\n // anyway.\n //\n // If we wanted to make the traversal completely specific to the\n // actual Perseus parse trees that we'll be dealing with we could\n // put a switch statement here to dispatch on the node type\n // property with specific recursion steps for each known type of\n // node.\n\n\n var keys = Object.keys(node);\n keys.forEach(key => {\n // Never recurse on the type property\n if (key === \"type\") {\n return;\n } // Ignore properties that are null or primitive and only\n // recurse on objects and arrays. Note that we don't do a\n // isNode() check here. That is done in the recursive call to\n // _traverse(). Note that the recursive call on each child\n // returns the text content of the child and we add that\n // content to the content for this node. Also note that we\n // push the name of the property we're recursing over onto a\n // TraversalState stack.\n\n\n var value = node[key];\n\n if (value && typeof value === \"object\") {\n state._indexes.push(key);\n\n content += this._traverse(value, state, f);\n\n state._indexes.pop();\n }\n }); // Restore the stacks after recursing on the children\n\n state._currentNode = state._ancestors.pop();\n\n state._containers.pop(); // And finally call the traversal callback for this node. Note\n // that this is post-order traversal. We call the callback on the\n // way back up the tree, not on the way down. That way we already\n // know all the content contained within the node.\n\n\n f(node, state, content);\n } else if (Array.isArray(n)) {\n // If we were called on an array instead of a node, then\n // this is the code we use to recurse.\n var nodes = n; // Push the array onto the stack. This will allow the\n // TraversalState object to locate siblings of this node.\n\n state._containers.push(nodes); // Now loop through this array and recurse on each element in it.\n // Before recursing on an element, we push its array index on a\n // TraversalState stack so that the TraversalState sibling methods\n // can work. Note that TraversalState methods can alter the length\n // of the array, and change the index of the current node, so we\n // are careful here to test the array length on each iteration and\n // to reset the index when we pop the stack. Also note that we\n // concatentate the text content of the children.\n\n\n var index = 0;\n\n while (index < nodes.length) {\n state._indexes.push(index);\n\n content += this._traverse(nodes[index], state, f); // Casting to convince Flow that this is a number\n\n index = state._indexes.pop() + 1;\n } // Pop the array off the stack. Note, however, that we do not call\n // the traversal callback on the array. That function is only\n // called for nodes, not arrays of nodes.\n\n\n state._containers.pop();\n } // The _traverse() method always returns the text content of\n // this node and its children. This is the one piece of state that\n // is not tracked in the TraversalState object.\n\n\n return content;\n }", "function parse_Statement() {\n tree.addNode('Statement', 'branch');\n console.log('got to here');\n if (foundTokensCopy[parseCounter][0] == 'print') {\n console.log('found print');\n parse_PrintStatement();\n //tree.endChildren();\n //tree.endChildren();\n\n }\n // extends to here for the identifier question\n else if (foundTokensCopy[parseCounter][1] == 'identifier') {\n parse_AssignmentStatement();\n //tree.endChildren();\n\n console.log(\"got to identifier 2\");\n\n } else if (foundTokensCopy[parseCounter][0] == 'int') {\n parse_VarDecl();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == 'string') {\n parse_VarDecl();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == 'boolean') {\n parse_VarDecl();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == 'while') {\n parse_WhileStatement();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == 'if') {\n parse_IfStatement();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == '{') {\n parse_Block();\n //tree.endChildren();\n\n\n\n\n } else {\n console.log('error');\n }\n\n\n\n tree.endChildren();\n\n\n\n}", "function Parser() {\n}", "function Parser() {\n}", "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}", "function explode(visitor) {\n\t if (visitor._exploded) return visitor;\n\t visitor._exploded = true;\n\n\t // normalise pipes\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var parts = nodeType.split(\"|\");\n\t if (parts.length === 1) continue;\n\n\t var fns = visitor[nodeType];\n\t delete visitor[nodeType];\n\n\t var _arr = parts;\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var part = _arr[_i];\n\t visitor[part] = fns;\n\t }\n\t }\n\n\t // verify data structure\n\t verify(visitor);\n\n\t // make sure there's no __esModule type since this is because we're using loose mode\n\t // and it sets __esModule to be enumerable on all modules :(\n\t delete visitor.__esModule;\n\n\t // ensure visitors are objects\n\t ensureEntranceObjects(visitor);\n\n\t // ensure enter/exit callbacks are arrays\n\t ensureCallbackArrays(visitor);\n\n\t // add type wrappers\n\n\t var _arr2 = Object.keys(visitor);\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var nodeType = _arr2[_i2];\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var wrapper = virtualTypes[nodeType];\n\t if (!wrapper) continue;\n\n\t // wrap all the functions\n\t var fns = visitor[nodeType];\n\t for (var type in fns) {\n\t fns[type] = wrapCheck(wrapper, fns[type]);\n\t }\n\n\t // clear it from the visitor\n\t delete visitor[nodeType];\n\n\t if (wrapper.types) {\n\t var _arr4 = wrapper.types;\n\n\t for (var _i4 = 0; _i4 < _arr4.length; _i4++) {\n\t var type = _arr4[_i4];\n\t // merge the visitor if necessary or just put it back in\n\t if (visitor[type]) {\n\t mergePair(visitor[type], fns);\n\t } else {\n\t visitor[type] = fns;\n\t }\n\t }\n\t } else {\n\t mergePair(visitor, fns);\n\t }\n\t }\n\n\t // add aliases\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var fns = visitor[nodeType];\n\n\t var aliases = t.FLIPPED_ALIAS_KEYS[nodeType];\n\t if (!aliases) continue;\n\n\t // clear it from the visitor\n\t delete visitor[nodeType];\n\n\t var _arr3 = aliases;\n\t for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n\t var alias = _arr3[_i3];\n\t var existing = visitor[alias];\n\t if (existing) {\n\t mergePair(existing, fns);\n\t } else {\n\t visitor[alias] = _lodashLangClone2[\"default\"](fns);\n\t }\n\t }\n\t }\n\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t ensureCallbackArrays(visitor[nodeType]);\n\t }\n\n\t return visitor;\n\t}", "function explode(visitor) {\n\t if (visitor._exploded) return visitor;\n\t visitor._exploded = true;\n\n\t // normalise pipes\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var parts = nodeType.split(\"|\");\n\t if (parts.length === 1) continue;\n\n\t var fns = visitor[nodeType];\n\t delete visitor[nodeType];\n\n\t var _arr = parts;\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var part = _arr[_i];\n\t visitor[part] = fns;\n\t }\n\t }\n\n\t // verify data structure\n\t verify(visitor);\n\n\t // make sure there's no __esModule type since this is because we're using loose mode\n\t // and it sets __esModule to be enumerable on all modules :(\n\t delete visitor.__esModule;\n\n\t // ensure visitors are objects\n\t ensureEntranceObjects(visitor);\n\n\t // ensure enter/exit callbacks are arrays\n\t ensureCallbackArrays(visitor);\n\n\t // add type wrappers\n\n\t var _arr2 = Object.keys(visitor);\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var nodeType = _arr2[_i2];\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var wrapper = virtualTypes[nodeType];\n\t if (!wrapper) continue;\n\n\t // wrap all the functions\n\t var fns = visitor[nodeType];\n\t for (var type in fns) {\n\t fns[type] = wrapCheck(wrapper, fns[type]);\n\t }\n\n\t // clear it from the visitor\n\t delete visitor[nodeType];\n\n\t if (wrapper.types) {\n\t var _arr4 = wrapper.types;\n\n\t for (var _i4 = 0; _i4 < _arr4.length; _i4++) {\n\t var type = _arr4[_i4];\n\t // merge the visitor if necessary or just put it back in\n\t if (visitor[type]) {\n\t mergePair(visitor[type], fns);\n\t } else {\n\t visitor[type] = fns;\n\t }\n\t }\n\t } else {\n\t mergePair(visitor, fns);\n\t }\n\t }\n\n\t // add aliases\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var fns = visitor[nodeType];\n\n\t var aliases = t.FLIPPED_ALIAS_KEYS[nodeType];\n\t if (!aliases) continue;\n\n\t // clear it from the visitor\n\t delete visitor[nodeType];\n\n\t var _arr3 = aliases;\n\t for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n\t var alias = _arr3[_i3];\n\t var existing = visitor[alias];\n\t if (existing) {\n\t mergePair(existing, fns);\n\t } else {\n\t visitor[alias] = _lodashLangClone2[\"default\"](fns);\n\t }\n\t }\n\t }\n\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t ensureCallbackArrays(visitor[nodeType]);\n\t }\n\n\t return visitor;\n\t}", "visitFunction(node) {\n const { type, id, typeParameters, params, returnType, body } = node;\n const scopeManager = this.scopeManager;\n const upperScope = this.currentScope();\n // Process the name.\n if (type === types_1.AST_NODE_TYPES.FunctionDeclaration && id) {\n upperScope.__define(id, new experimental_utils_1.TSESLintScope.Definition('FunctionName', id, node, null, null, null));\n // Remove overload definition to avoid confusion of no-redeclare rule.\n const { defs, identifiers } = upperScope.set.get(id.name);\n for (let i = 0; i < defs.length; ++i) {\n const def = defs[i];\n if (def.type === 'FunctionName' &&\n def.node.type === types_1.AST_NODE_TYPES.TSDeclareFunction) {\n defs.splice(i, 1);\n identifiers.splice(i, 1);\n break;\n }\n }\n }\n else if (type === types_1.AST_NODE_TYPES.FunctionExpression && id) {\n scopeManager.__nestFunctionExpressionNameScope(node);\n }\n // Open the function scope.\n scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);\n const innerScope = this.currentScope();\n // Process the type parameters\n this.visit(typeParameters);\n // Process parameter declarations.\n for (let i = 0; i < params.length; ++i) {\n this.visitPattern(params[i], { processRightHandNodes: true }, (pattern, info) => {\n if (pattern.type !== types_1.AST_NODE_TYPES.Identifier ||\n pattern.name !== 'this') {\n innerScope.__define(pattern, new experimental_utils_1.TSESLintScope.ParameterDefinition(pattern, node, i, info.rest));\n this.referencingDefaultValue(pattern, info.assignments, null, true);\n }\n });\n }\n // Process the return type.\n this.visit(returnType);\n // Process the body.\n if (body && body.type === types_1.AST_NODE_TYPES.BlockStatement) {\n this.visitChildren(body);\n }\n else {\n this.visit(body);\n }\n // Close the function scope.\n this.close(node);\n }", "function __processNode() {\n try {\n switch (type) {\n case TYPE.boolean:\n case TYPE.number:\n case TYPE.string:\n return node;\n case TYPE.Date:\n var date = node;\n var dateDetails = {\n \"[*TYPE*]\": typeName,\n //epochMs: date.getTime(),\n value: date.toISOString()\n };\n if (hideType) {\n delete dateDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return dateDetails.value; // delete dateDetails.epochMs;\n }\n return dateDetails;\n case TYPE.function:\n try {\n verboseObjectsOut.push(node);\n var full;\n if (node.toString == null) {\n full = \"ERROR_node_no_toString_method\";\n }\n else {\n full = node.toString();\n }\n var fcnName = full.substring(full.indexOf(\" \"), full.indexOf(\"(\"));\n var fcnParams = full.substring(full.indexOf(\"(\"), full.indexOf(\"{\") - 1);\n var fcnDetails = { \"[*TYPE*]\": typeName, signature: fcnName + fcnParams, full: full };\n if (hideType) {\n delete fcnDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n delete fcnDetails.full;\n }\n return fcnDetails;\n }\n catch (ex) {\n return { \"[*TYPE*]\": typeName, value: \"function-unknown\" };\n }\n case TYPE.Error:\n verboseObjectsOut.push(node);\n var errDetails = { \"[*TYPE*]\": typeName, name: node.name, message: node.message, stack: node.stack == null ? null : node.stack.split(\"\\n\") };\n if (hideType) {\n delete errDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n delete errDetails.stack;\n }\n return errDetails;\n case TYPE.null:\n return null; // \"[*NULL*]\";\n case TYPE.undefined:\n return \"[*UNDEFINED*]\";\n case TYPE.RegExp:\n //var regexp = (node as RegExp);\n //var regexpDetails = { \"[*TYPE*]\": typeName, source: regexp.source, details: regexp.g };\n //if (hideType) {\n // delete regexpDetails[\"[*TYPE*]\"];\n //}\n //if (!showVerboseDetails) {\n // delete regexpDetails.source;\n //}\n //return regexpDetails;\n case TYPE.Array:\n case TYPE.object:\n switch (typeName) {\n case \"Promise\":\n var promise = node;\n if (promise[\"toJSON\"] != null) {\n var promiseDetails = promise.toJSON();\n promiseDetails[\"[*TYPE*]\"] = typeName;\n return promiseDetails;\n }\n if (promise.toString == null) {\n return { \"[*TYPE*]\": typeName, value: \"ERROR_promise_no_toString_method\" };\n }\n else {\n return { \"[*TYPE*]\": typeName, value: promise.toString() };\n }\n case \"Buffer\":\n try {\n var buffer = node;\n var strOutput = void 0;\n if (buffer.toString == null) {\n strOutput = \"ERROR_buffer2_no_toString_method\";\n }\n else {\n strOutput = buffer.toString();\n }\n var bufferDetails = { \"[*TYPE*]\": typeName, value: stringHelper.summarize(strOutput, 200), length: buffer.length };\n if (hideType) {\n delete bufferDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n //return bufferDetails.value;\n }\n return bufferDetails;\n }\n catch (ex) {\n return { \"[*TYPE*]\": typeName, value: \"buffer-unknown\" };\n }\n case \"Stream\":\n case \"ReadableStream\":\n case \"WriteableStream\":\n var streamDetails = { \"[*TYPE*]\": typeName, value: \"[*STREAM*]\" };\n if (hideType) {\n delete streamDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return streamDetails.value;\n }\n return streamDetails;\n case \"Moment\":\n var momentValue = node;\n var momentDetails = { \"[*TYPE*]\": typeName, value: momentValue.toJSON() };\n if (hideType) {\n delete momentDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return momentValue.toISOString();\n }\n return momentDetails;\n case \"IncommingMessage\":\n try {\n var req = node;\n var msgDetails = { \"[*TYPE*]\": typeName, value: { headers: req.headers, method: req.method, statusCode: req.statusCode, httpVersion: req.httpVersion, statusMessage: req.statusMessage, url: req.url } };\n if (hideType) {\n delete msgDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return msgDetails.value;\n }\n return msgDetails;\n }\n catch (ex) {\n //failure parsing as node http.IncommingMessage. try as normal instead.\n break;\n }\n default:\n //try to see if a .toJSON() method exists\n if (typeof (node[\"toJSON\"]) !== \"undefined\") {\n var toJsonDetails = node.toJSON();\n toJsonDetails[\"[*TYPE*]\"] = typeName;\n return toJsonDetails;\n }\n break;\n }\n try {\n if (!nodeDepthSearchDisabled) {\n //check to see if we can stringify (no circular dependencies)\n exports.JSONX.stringifyX(node, replacer);\n }\n //able to stringify (no exception thrown), so lets ignore depth searching for our children (avoid stringifying to gain perf)\n return _nodePropertyRecurser(node, depth, typeName, true);\n }\n catch (ex) {\n //couldn't stringify\n if (depth >= maxSearchDepth) {\n return \"[*MAX_SEARCH_DEPTH*]\";\n }\n //can't stringify it, so...\n if (ex.message.toLowerCase().indexOf(\"circular\") < 0 && ex.message.toLowerCase().indexOf(\"typeerror\") < 0) {\n //exception isn't due to circular or typeErrors, so let's just stop\n if (ex.toString == null) {\n return \"[*ERROR_ex_no_toString=\" + ex + \"*]\";\n }\n return \"[*ERROR_\" + ex.toString() + \"*]\";\n }\n if (!disableCircularDetection) {\n //circular, lets try to recursively work through this\n if (node[_superStringifyTokenId] !== undefined) {\n //circular found, so stop\n return \"[*CIRCULAR_REFERENCE*]\";\n }\n //mark this as processed\n node[_superStringifyTokenId] = null;\n _processedNodes.push(node);\n }\n return _nodePropertyRecurser(node, depth, typeName);\n }\n default:\n var unknownDetails;\n if (node.toString == null) {\n unknownDetails = { \"[*TYPE*]\": typeName, status: \"inspectJSONify does not know how to parse this\", value: \"some-node_no_toString\" };\n }\n else {\n unknownDetails = { \"[*TYPE*]\": typeName, status: \"inspectJSONify does not know how to parse this\", value: node.toString() };\n }\n if (hideType) {\n delete unknownDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return \"[*???*] \" + unknownDetails.value;\n }\n return unknownDetails;\n }\n }\n catch (ex) {\n //logger.assert(ex);\n return \"error: {0}\" + String(ex);\n }\n }", "function EQLVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function Visitor() {\r\n}", "function newtraverse(model, variable, parent, node, func)\n\t{\n\t\t// just simplify some MODEL code\n\t\tif (node.type == 'CallExpression')\n\t\t{\n\t\t\t// Case does not require more then one argument\n\t\t\tif (node.callee.name == 'Case')\n\t\t\t{\n\t\t\t\tArray.prototype.push.apply(node.arguments, casetemplate);\n\t\t\t}\n\t\t\t// TSUM does not require more then one argument\n\t\t\telse if (node.callee.name == 'TSUM')\n\t\t\t{\n\t\t\t\tnode.arguments[0].name = 'vars[' + model[node.arguments[0].name].id + ']';\n\t\t\t\tnode.arguments.push({\n\t\t\t\t\t\"type\" : \"Identifier\",\n\t\t\t\t\t\"name\" : \"T\"\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if (node.callee.name == 'If')\n\t\t\t{\n\t\t\t\tnode.type = 'ConditionalExpression';\n\t\t\t\tvar arguments = node.arguments;\n\t\t\t\tnode.test = arguments[0];\n\t\t\t\tnode.consequent = arguments[1];\n\t\t\t\tif (arguments[2] == undefined)\n\t\t\t\t{\n\t\t\t\t\tnode.alternate = {\n\t\t\t\t\t\t\"type\" : \"Identifier\",\n\t\t\t\t\t\t\"name\" : \"NA\"\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnode.alternate = arguments[2];\n\t\t\t\t}\n\t\t\t\tdelete node.arguments;\n\t\t\t\tdelete node.callee;\n\t\t\t}\n\t\t\t// Mut does not require more then one argument.\n\t\t\telse if (node.callee.name == 'Mut')\n\t\t\t{\n\t\t\t\tnode.arguments.push({\n\t\t\t\t\t\"type\" : \"MemberExpression\",\n\t\t\t\t\t\"computed\" : true,\n\t\t\t\t\t\"object\" : {\n\t\t\t\t\t\t\"type\" : \"Identifier\",\n\t\t\t\t\t\t\"name\" : node.arguments[0].name\n\t\t\t\t\t},\n\t\t\t\t\t\"property\" : {\n\t\t\t\t\t\t\"type\" : \"Identifier\",\n\t\t\t\t\t\t\"name\" : \"prev\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tfor ( var key in node)\n\t\t{\n\t\t\tif (key in node)\n\t\t\t{\n\t\t\t\tvar child = node[key];\n\t\t\t\tif (typeof child === 'object')\n\t\t\t\t{\n\t\t\t\t\tif (Array.isArray(child))\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (var i = 0, len = child.length; i < len; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewtraverse(model, variable, node, child[i], func);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewtraverse(model, variable, node, child, func);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfunc(variable, parent, node);\n\t}", "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}", "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_2__[\"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_3__[\"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_2__[\"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}", "function visit(text, visitor, options) {\n if (options === void 0) { options = ParseOptions.DEFAULT; }\n var _scanner = Object(_scanner__WEBPACK_IMPORTED_MODULE_0__[\"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 return true;\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}", "function Parser() {\n\n}", "function RiScriptVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function createParseTreeView (node) {\n let text = node.token.text.replace(HTMLCharsToEscape, (match) => HTMLEscapeReplacements[match]);\n let nodeInfo = `<div class=\"node-info ${node.ASType.category}\">${text}</div>`;\n let nodeChildren = `<div class=\"node-children\">${node.children.map(createParseTreeView).join(\"\")}</div>`;\n return `<div class=\"ast-node\">${nodeInfo}${nodeChildren}</div>`;\n}", "function calculatorVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "visit(visitor){\n if (visitor.before) {\n visitor.before.call(visitor, this);\n }\n if (visitor.after) {\n visitor.after.call(visitor, this);\n }\n }", "function SQLVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function Parser()\n{\n this.pathArray = [];\n \n this.onopentag = function(path, node) { }\n this.onclosetag = function(path) { }\n this.ontext = function(path, text) { }\n \n this.parse = function(xmlSource) {\n this.pathArray = [];\n this.path = '';\n \n var parser = sax.parser(true);\n \n parser.onopentag = function(node) {\n this.pathArray.push(node.name);\n this.path = this.pathArray.join(\".\");\n \n this.onopentag(this.path, node);\n }.bind(this);\n \n parser.ontext = function(text) {\n this.ontext(this.path, text);\n }.bind(this);\n \n parser.onclosetag = function() {\n this.onclosetag(this.path);\n this.pathArray.pop();\n this.path = this.pathArray.join(\".\");\n }.bind(this);\n \n parser.write(xmlSource).close();\n }\n}", "function RandomVisitor() {\n antlr4.tree.ParseTreeVisitor.call(this);\n return this;\n}", "function ParseNode(type, value, mode) {\n this.type = type;\n this.value = value;\n this.mode = mode;\n}", "function ParseNode(type, value, mode) {\n this.type = type;\n this.value = value;\n this.mode = mode;\n}", "function VillanelleGrammarVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function parse_StatementList() {\n tree.addNode('StatementList', 'branch');\n // Assign operator = here i think is wrong... need to find an identifier?\n console.log(\"got to statementlist \");\n if (foundTokensCopy[parseCounter][0] == 'print') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n console.log('got past the if');\n\n }\n // extends to here for the identifier question\n else if (foundTokensCopy[parseCounter][1] == 'identifier') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n\n } else if (foundTokensCopy[parseCounter][0] == 'int') {\n console.log('got past the if type');\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else if (foundTokensCopy[parseCounter][0] == 'string') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else if (foundTokensCopy[parseCounter][0] == 'boolean') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else if (foundTokensCopy[parseCounter][1] == 'while') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else if (foundTokensCopy[parseCounter][1] == 'if') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n\n } else if (foundTokensCopy[parseCounter][0] == '{') {\n parse_Statement();\n //tree.endChildren();\n //tree.endChildren();\n parse_StatementList();\n //tree.endChildren();\n //tree.endChildren();\n } else {\n console.log(\"epsilon\");\n //epsilon production\n }\n tree.endChildren();\n\n}", "function VNode() {}", "function processExpression(node, context, \n\t// some expressions like v-slot props & v-for aliases should be parsed as\n\t// function params\n\tasParams = false, \n\t// v-on handler values may contain multiple statements\n\tasRawStatements = false) {\n\t {\n\t return node;\n\t }\n\t}", "function TNode(){}", "function subParse(parser, pos, extensions) {\n var p = new parser.constructor(parser.options, parser.input, pos);\n if (extensions)\n for (var k in extensions)\n p[k] = extensions[k] ;\n\n var src = parser ;\n var dest = p ;\n ['inFunction','inAsync','inGenerator','inModule'].forEach(function(k){\n if (k in src)\n dest[k] = src[k] ;\n }) ;\n p.nextToken();\n return p;\n}", "compileNode(o) {\r\n\t\t\t\t\tvar body, bodyFragments, compare, compareDown, declare, declareDown, defPart, down, forClose, forCode, forPartFragments, fragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, last, lvar, name, namePart, ref, ref1, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart;\r\n\t\t\t\t\tbody = Block.wrap([this.body]);\r\n\t\t\t\t\tref1 = body.expressions, [last] = slice1.call(ref1, -1);\r\n\t\t\t\t\tif ((last != null ? last.jumps() : void 0) instanceof Return) {\r\n\t\t\t\t\t\tthis.returns = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsource = this.range ? this.source.base : this.source;\r\n\t\t\t\t\tscope = o.scope;\r\n\t\t\t\t\tif (!this.pattern) {\r\n\t\t\t\t\t\tname = this.name && (this.name.compile(o, LEVEL_LIST));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tindex = this.index && (this.index.compile(o, LEVEL_LIST));\r\n\t\t\t\t\tif (name && !this.pattern) {\r\n\t\t\t\t\t\tscope.find(name);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index && !(this.index instanceof Value)) {\r\n\t\t\t\t\t\tscope.find(index);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.returns) {\r\n\t\t\t\t\t\trvar = scope.freeVariable('results');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.from) {\r\n\t\t\t\t\t\tif (this.pattern) {\r\n\t\t\t\t\t\t\tivar = scope.freeVariable('x', {\r\n\t\t\t\t\t\t\t\tsingle: true\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tivar = (this.object && index) || scope.freeVariable('i', {\r\n\t\t\t\t\t\t\tsingle: true\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\tkvar = ((this.range || this.from) && name) || index || ivar;\r\n\t\t\t\t\tkvarAssign = kvar !== ivar ? `${kvar} = ` : \"\";\r\n\t\t\t\t\tif (this.step && !this.range) {\r\n\t\t\t\t\t\t[step, stepVar] = this.cacheToCodeFragments(this.step.cache(o, LEVEL_LIST, shouldCacheOrIsAssignable));\r\n\t\t\t\t\t\tif (this.step.isNumber()) {\r\n\t\t\t\t\t\t\tstepNum = parseNumber(stepVar);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.pattern) {\r\n\t\t\t\t\t\tname = ivar;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvarPart = '';\r\n\t\t\t\t\tguardPart = '';\r\n\t\t\t\t\tdefPart = '';\r\n\t\t\t\t\tidt1 = this.tab + TAB;\r\n\t\t\t\t\tif (this.range) {\r\n\t\t\t\t\t\tforPartFragments = source.compileToFragments(merge(o, {\r\n\t\t\t\t\t\t\tindex: ivar,\r\n\t\t\t\t\t\t\tname,\r\n\t\t\t\t\t\t\tstep: this.step,\r\n\t\t\t\t\t\t\tshouldCache: shouldCacheOrIsAssignable\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsvar = this.source.compile(o, LEVEL_LIST);\r\n\t\t\t\t\t\tif ((name || this.own) && !(this.source.unwrap() instanceof IdentifierLiteral)) {\r\n\t\t\t\t\t\t\tdefPart += `${this.tab}${ref = scope.freeVariable('ref')} = ${svar};\\n`;\r\n\t\t\t\t\t\t\tsvar = ref;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (name && !this.pattern && !this.from) {\r\n\t\t\t\t\t\t\tnamePart = `${name} = ${svar}[${kvar}]`;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!this.object && !this.from) {\r\n\t\t\t\t\t\t\tif (step !== stepVar) {\r\n\t\t\t\t\t\t\t\tdefPart += `${this.tab}${step};\\n`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdown = stepNum < 0;\r\n\t\t\t\t\t\t\tif (!(this.step && (stepNum != null) && down)) {\r\n\t\t\t\t\t\t\t\tlvar = scope.freeVariable('len');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdeclare = `${kvarAssign}${ivar} = 0, ${lvar} = ${svar}.length`;\r\n\t\t\t\t\t\t\tdeclareDown = `${kvarAssign}${ivar} = ${svar}.length - 1`;\r\n\t\t\t\t\t\t\tcompare = `${ivar} < ${lvar}`;\r\n\t\t\t\t\t\t\tcompareDown = `${ivar} >= 0`;\r\n\t\t\t\t\t\t\tif (this.step) {\r\n\t\t\t\t\t\t\t\tif (stepNum != null) {\r\n\t\t\t\t\t\t\t\t\tif (down) {\r\n\t\t\t\t\t\t\t\t\t\tcompare = compareDown;\r\n\t\t\t\t\t\t\t\t\t\tdeclare = declareDown;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tcompare = `${stepVar} > 0 ? ${compare} : ${compareDown}`;\r\n\t\t\t\t\t\t\t\t\tdeclare = `(${stepVar} > 0 ? (${declare}) : ${declareDown})`;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tincrement = `${ivar} += ${stepVar}`;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tincrement = `${kvar !== ivar ? `++${ivar}` : `${ivar}++`}`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tforPartFragments = [this.makeCode(`${declare}; ${compare}; ${kvarAssign}${increment}`)];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.returns) {\r\n\t\t\t\t\t\tresultPart = `${this.tab}${rvar} = [];\\n`;\r\n\t\t\t\t\t\treturnResult = `\\n${this.tab}return ${rvar};`;\r\n\t\t\t\t\t\tbody.makeReturn(rvar);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.guard) {\r\n\t\t\t\t\t\tif (body.expressions.length > 1) {\r\n\t\t\t\t\t\t\tbody.expressions.unshift(new If((new Parens(this.guard)).invert(), new StatementLiteral(\"continue\")));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (this.guard) {\r\n\t\t\t\t\t\t\t\tbody = Block.wrap([new If(this.guard, body)]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.pattern) {\r\n\t\t\t\t\t\tbody.expressions.unshift(new Assign(this.name, this.from ? new IdentifierLiteral(kvar) : new Literal(`${svar}[${kvar}]`)));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (namePart) {\r\n\t\t\t\t\t\tvarPart = `\\n${idt1}${namePart};`;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.object) {\r\n\t\t\t\t\t\tforPartFragments = [this.makeCode(`${kvar} in ${svar}`)];\r\n\t\t\t\t\t\tif (this.own) {\r\n\t\t\t\t\t\t\tguardPart = `\\n${idt1}if (!${utility('hasProp', o)}.call(${svar}, ${kvar})) continue;`;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (this.from) {\r\n\t\t\t\t\t\tif (this.await) {\r\n\t\t\t\t\t\t\tforPartFragments = new Op('await', new Parens(new Literal(`${kvar} of ${svar}`)));\r\n\t\t\t\t\t\t\tforPartFragments = forPartFragments.compileToFragments(o, LEVEL_TOP);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tforPartFragments = [this.makeCode(`${kvar} of ${svar}`)];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbodyFragments = body.compileToFragments(merge(o, {\r\n\t\t\t\t\t\tindent: idt1\r\n\t\t\t\t\t}), LEVEL_TOP);\r\n\t\t\t\t\tif (bodyFragments && bodyFragments.length > 0) {\r\n\t\t\t\t\t\tbodyFragments = [].concat(this.makeCode('\\n'), bodyFragments, this.makeCode('\\n'));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfragments = [this.makeCode(defPart)];\r\n\t\t\t\t\tif (resultPart) {\r\n\t\t\t\t\t\tfragments.push(this.makeCode(resultPart));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tforCode = this.await ? 'for ' : 'for (';\r\n\t\t\t\t\tforClose = this.await ? '' : ')';\r\n\t\t\t\t\tfragments = fragments.concat(this.makeCode(this.tab), this.makeCode(forCode), forPartFragments, this.makeCode(`${forClose} {${guardPart}${varPart}`), bodyFragments, this.makeCode(this.tab), this.makeCode('}'));\r\n\t\t\t\t\tif (returnResult) {\r\n\t\t\t\t\t\tfragments.push(this.makeCode(returnResult));\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn fragments;\r\n\t\t\t\t}", "function t(e,n,r){switch(e.type){case\"VariableDeclaration\":e.declarations.forEach(function(e,n){t(e.init,n,r)});break;case\"BinaryExpression\":case\"LogicalExpression\":e.operator&&i[e.operator]?(e.type=\"CallExpression\",e.callee={type:\"MemberExpression\",computed:!1,object:e.right,property:{type:\"Identifier\",name:i[e.operator]}},t(e.left,n,r),t(e.right,n,r),e.arguments=[e.left]):(t(e.left,n,r),t(e.right,n,r));break;case\"ExpressionStatement\":t(e.expression,n,r);break;case\"CallExpression\":e.arguments.forEach(function(e,n){t(e,n,r)});break;case\"AssignmentExpression\":if(e.operator&&i[e.operator]){var o=e.right;e.right={type:\"BinaryExpression\",operator:e.operator.replace(/=/,\"\").trim(),left:e.left,right:o},e.operator=\"=\",t(e.left,n,r),t(e.right,n,r)}else t(e.right,n,r);break;case\"UnaryExpression\":e.operator&&i[e.operator]?(e.type=\"CallExpression\",e.callee={type:\"MemberExpression\",computed:!1,object:e.argument,property:{type:\"Identifier\",name:\"+\"===e.operator||\"-\"===e.operator?i[\"u\"+e.operator]:i[e.operator]}},t(e.argument,n,r),e.arguments=[]):t(e.argument,n,r);break;case\"UpdateExpression\":e.operator&&i[e.operator]&&(e.type=\"CallExpression\",e.callee={type:\"MemberExpression\",computed:!1,object:e.argument,property:{type:\"Identifier\",name:i[e.operator]}},t(e.argument,n,r),e.arguments=[]);break;//We don't ned to transform following nodes! Phew!\ncase\"Literal\":case\"Identifier\":case\"BlockStatement\":case\"FunctionExpression\":}}", "function pseudoCodeParserListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function visitor(node, idx, args){\n\t\t\t\tnode.level = args.level;\n\t\t\t\tnode.parent = args.parent;\n\t\t\t\treturn {level : args.level+1, parent : node};\n\t\t\t}", "function Parser(input) {\n\tRecognizer.call(this);\n\t// The input stream.\n\tthis._input = null;\n\t// The error handling strategy for the parser. The default value is a new\n\t// instance of {@link DefaultErrorStrategy}.\n\tthis._errHandler = new DefaultErrorStrategy();\n\tthis._precedenceStack = [];\n\tthis._precedenceStack.push(0);\n\t// The {@link ParserRuleContext} object for the currently executing rule.\n\t// this is always non-null during the parsing process.\n\tthis._ctx = null;\n\t// Specifies whether or not the parser should construct a parse tree during\n\t// the parsing process. The default value is {@code true}.\n\tthis.buildParseTrees = true;\n\t// When {@link //setTrace}{@code (true)} is called, a reference to the\n\t// {@link TraceListener} is stored here so it can be easily removed in a\n\t// later call to {@link //setTrace}{@code (false)}. The listener itself is\n\t// implemented as a parser listener so this field is not directly used by\n\t// other parser methods.\n\tthis._tracer = null;\n\t// The list of {@link ParseTreeListener} listeners registered to receive\n\t// events during the parse.\n\tthis._parseListeners = null;\n\t// The number of syntax errors reported during parsing. this value is\n\t// incremented each time {@link //notifyErrorListeners} is called.\n\tthis._syntaxErrors = 0;\n\tthis.setInputStream(input);\n\treturn this;\n}", "function Parser(input) {\n\tRecognizer.call(this);\n\t// The input stream.\n\tthis._input = null;\n\t// The error handling strategy for the parser. The default value is a new\n\t// instance of {@link DefaultErrorStrategy}.\n\tthis._errHandler = new DefaultErrorStrategy();\n\tthis._precedenceStack = [];\n\tthis._precedenceStack.push(0);\n\t// The {@link ParserRuleContext} object for the currently executing rule.\n\t// this is always non-null during the parsing process.\n\tthis._ctx = null;\n\t// Specifies whether or not the parser should construct a parse tree during\n\t// the parsing process. The default value is {@code true}.\n\tthis.buildParseTrees = true;\n\t// When {@link //setTrace}{@code (true)} is called, a reference to the\n\t// {@link TraceListener} is stored here so it can be easily removed in a\n\t// later call to {@link //setTrace}{@code (false)}. The listener itself is\n\t// implemented as a parser listener so this field is not directly used by\n\t// other parser methods.\n\tthis._tracer = null;\n\t// The list of {@link ParseTreeListener} listeners registered to receive\n\t// events during the parse.\n\tthis._parseListeners = null;\n\t// The number of syntax errors reported during parsing. this value is\n\t// incremented each time {@link //notifyErrorListeners} is called.\n\tthis._syntaxErrors = 0;\n\tthis.setInputStream(input);\n\treturn this;\n}", "function Parser() {\n if(false === (this instanceof Parser)) {\n return new Parser();\n }\n\n events.EventEmitter.call(this);\n}", "function ExprListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function Parse(_compiler) {\n var _this = this;\n this._compiler = _compiler;\n this._parser = new Parser(new Lexer());\n this._pipesCache = new Map();\n this._evalCache = new Map();\n this._calcCache = new Map();\n var compiler = this._compiler;\n var pipeCache = compiler._delegate._metadataResolver._pipeCache;\n pipeCache.forEach(function (pipeMetadata, pipe) { return _this._pipesCache.set(pipeMetadata.name, new pipe()); });\n }", "function arithmeticAntlrVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "compileNode(o) {\r\n\t\t\t\t\tvar answer, body, boundMethodCheck, comment, condition, exprs, generatedVariables, haveBodyParam, haveSplatParam, i, ifTrue, j, k, l, len1, len2, len3, m, methodScope, modifiers, name, param, paramToAddToScope, params, paramsAfterSplat, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, scopeVariablesCount, signature, splatParamName, thisAssignments, wasEmpty, yieldNode;\r\n\t\t\t\t\tthis.checkForAsyncOrGeneratorConstructor();\r\n\t\t\t\t\tif (this.bound) {\r\n\t\t\t\t\t\tif ((ref1 = o.scope.method) != null ? ref1.bound : void 0) {\r\n\t\t\t\t\t\t\tthis.context = o.scope.method.context;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!this.context) {\r\n\t\t\t\t\t\t\tthis.context = 'this';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.updateOptions(o);\r\n\t\t\t\t\tparams = [];\r\n\t\t\t\t\texprs = [];\r\n\t\t\t\t\tthisAssignments = (ref2 = (ref3 = this.thisAssignments) != null ? ref3.slice() : void 0) != null ? ref2 : [];\r\n\t\t\t\t\tparamsAfterSplat = [];\r\n\t\t\t\t\thaveSplatParam = false;\r\n\t\t\t\t\thaveBodyParam = false;\r\n\t\t\t\t\tthis.checkForDuplicateParams();\r\n\t\t\t\t\tthis.disallowLoneExpansionAndMultipleSplats();\r\n\t\t\t\t\t// Separate `this` assignments.\r\n\t\t\t\t\tthis.eachParamName(function(name, node, param, obj) {\r\n\t\t\t\t\t\tvar replacement, target;\r\n\t\t\t\t\t\tif (node.this) {\r\n\t\t\t\t\t\t\tname = node.properties[0].name.value;\r\n\t\t\t\t\t\t\tif (indexOf.call(JS_FORBIDDEN, name) >= 0) {\r\n\t\t\t\t\t\t\t\tname = `_${name}`;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttarget = new IdentifierLiteral(o.scope.freeVariable(name, {\r\n\t\t\t\t\t\t\t\treserve: false\r\n\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t// `Param` is object destructuring with a default value: ({@prop = 1}) ->\r\n\t\t\t\t\t\t\t// In a case when the variable name is already reserved, we have to assign\r\n\t\t\t\t\t\t\t// a new variable name to the destructured variable: ({prop:prop1 = 1}) ->\r\n\t\t\t\t\t\t\treplacement = param.name instanceof Obj && obj instanceof Assign && obj.operatorToken.value === '=' ? new Assign(new IdentifierLiteral(name), target, 'object') : target; //, operatorToken: new Literal ':'\r\n\t\t\t\t\t\t\tparam.renameParam(node, replacement);\r\n\t\t\t\t\t\t\treturn thisAssignments.push(new Assign(node, target));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tref4 = this.params;\r\n\t\t\t\t\t// Parse the parameters, adding them to the list of parameters to put in the\r\n\t\t\t\t\t// function definition; and dealing with splats or expansions, including\r\n\t\t\t\t\t// adding expressions to the function body to declare all parameter\r\n\t\t\t\t\t// variables that would have been after the splat/expansion parameter.\r\n\t\t\t\t\t// If we encounter a parameter that needs to be declared in the function\r\n\t\t\t\t\t// body for any reason, for example it’s destructured with `this`, also\r\n\t\t\t\t\t// declare and assign all subsequent parameters in the function body so that\r\n\t\t\t\t\t// any non-idempotent parameters are evaluated in the correct order.\r\n\t\t\t\t\tfor (i = j = 0, len1 = ref4.length; j < len1; i = ++j) {\r\n\t\t\t\t\t\tparam = ref4[i];\r\n\t\t\t\t\t\t// Was `...` used with this parameter? Splat/expansion parameters cannot\r\n\t\t\t\t\t\t// have default values, so we need not worry about that.\r\n\t\t\t\t\t\tif (param.splat || param instanceof Expansion) {\r\n\t\t\t\t\t\t\thaveSplatParam = true;\r\n\t\t\t\t\t\t\tif (param.splat) {\r\n\t\t\t\t\t\t\t\tif (param.name instanceof Arr || param.name instanceof Obj) {\r\n\t\t\t\t\t\t\t\t\t// Splat arrays are treated oddly by ES; deal with them the legacy\r\n\t\t\t\t\t\t\t\t\t// way in the function body. TODO: Should this be handled in the\r\n\t\t\t\t\t\t\t\t\t// function parameter list, and if so, how?\r\n\t\t\t\t\t\t\t\t\tsplatParamName = o.scope.freeVariable('arg');\r\n\t\t\t\t\t\t\t\t\tparams.push(ref = new Value(new IdentifierLiteral(splatParamName)));\r\n\t\t\t\t\t\t\t\t\texprs.push(new Assign(new Value(param.name), ref));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tparams.push(ref = param.asReference(o));\r\n\t\t\t\t\t\t\t\t\tsplatParamName = fragmentsToText(ref.compileNodeWithoutComments(o));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (param.shouldCache()) {\r\n\t\t\t\t\t\t\t\t\texprs.push(new Assign(new Value(param.name), ref)); // `param` is an Expansion\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tsplatParamName = o.scope.freeVariable('args');\r\n\t\t\t\t\t\t\t\tparams.push(new Value(new IdentifierLiteral(splatParamName)));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\to.scope.parameter(splatParamName);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Parse all other parameters; if a splat paramater has not yet been\r\n\t\t\t\t\t\t\t// encountered, add these other parameters to the list to be output in\r\n\t\t\t\t\t\t\t// the function definition.\r\n\t\t\t\t\t\t\tif (param.shouldCache() || haveBodyParam) {\r\n\t\t\t\t\t\t\t\tparam.assignedInBody = true;\r\n\t\t\t\t\t\t\t\thaveBodyParam = true;\r\n\t\t\t\t\t\t\t\t// This parameter cannot be declared or assigned in the parameter\r\n\t\t\t\t\t\t\t\t// list. So put a reference in the parameter list and add a statement\r\n\t\t\t\t\t\t\t\t// to the function body assigning it, e.g.\r\n\t\t\t\t\t\t\t\t// `(arg) => { var a = arg.a; }`, with a default value if it has one.\r\n\t\t\t\t\t\t\t\tif (param.value != null) {\r\n\t\t\t\t\t\t\t\t\tcondition = new Op('===', param, new UndefinedLiteral());\r\n\t\t\t\t\t\t\t\t\tifTrue = new Assign(new Value(param.name), param.value);\r\n\t\t\t\t\t\t\t\t\texprs.push(new If(condition, ifTrue));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\texprs.push(new Assign(new Value(param.name), param.asReference(o), null, {\r\n\t\t\t\t\t\t\t\t\t\tparam: 'alwaysDeclare'\r\n\t\t\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// If this parameter comes before the splat or expansion, it will go\r\n\t\t\t\t\t\t\t// in the function definition parameter list.\r\n\t\t\t\t\t\t\tif (!haveSplatParam) {\r\n\t\t\t\t\t\t\t\t// If this parameter has a default value, and it hasn’t already been\r\n\t\t\t\t\t\t\t\t// set by the `shouldCache()` block above, define it as a statement in\r\n\t\t\t\t\t\t\t\t// the function body. This parameter comes after the splat parameter,\r\n\t\t\t\t\t\t\t\t// so we can’t define its default value in the parameter list.\r\n\t\t\t\t\t\t\t\tif (param.shouldCache()) {\r\n\t\t\t\t\t\t\t\t\tref = param.asReference(o);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tif ((param.value != null) && !param.assignedInBody) {\r\n\t\t\t\t\t\t\t\t\t\tref = new Assign(new Value(param.name), param.value, null, {\r\n\t\t\t\t\t\t\t\t\t\t\tparam: true\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tref = param;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// Add this parameter’s reference(s) to the function scope.\r\n\t\t\t\t\t\t\t\tif (param.name instanceof Arr || param.name instanceof Obj) {\r\n\t\t\t\t\t\t\t\t\t// This parameter is destructured.\r\n\t\t\t\t\t\t\t\t\tparam.name.lhs = true;\r\n\t\t\t\t\t\t\t\t\tif (!param.shouldCache()) {\r\n\t\t\t\t\t\t\t\t\t\tparam.name.eachName(function(prop) {\r\n\t\t\t\t\t\t\t\t\t\t\treturn o.scope.parameter(prop.value);\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// This compilation of the parameter is only to get its name to add\r\n\t\t\t\t\t\t\t\t\t// to the scope name tracking; since the compilation output here\r\n\t\t\t\t\t\t\t\t\t// isn’t kept for eventual output, don’t include comments in this\r\n\t\t\t\t\t\t\t\t\t// compilation, so that they get output the “real” time this param\r\n\t\t\t\t\t\t\t\t\t// is compiled.\r\n\t\t\t\t\t\t\t\t\tparamToAddToScope = param.value != null ? param : ref;\r\n\t\t\t\t\t\t\t\t\to.scope.parameter(fragmentsToText(paramToAddToScope.compileToFragmentsWithoutComments(o)));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tparams.push(ref);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tparamsAfterSplat.push(param);\r\n\t\t\t\t\t\t\t\t// If this parameter had a default value, since it’s no longer in the\r\n\t\t\t\t\t\t\t\t// function parameter list we need to assign its default value\r\n\t\t\t\t\t\t\t\t// (if necessary) as an expression in the body.\r\n\t\t\t\t\t\t\t\tif ((param.value != null) && !param.shouldCache()) {\r\n\t\t\t\t\t\t\t\t\tcondition = new Op('===', param, new UndefinedLiteral());\r\n\t\t\t\t\t\t\t\t\tifTrue = new Assign(new Value(param.name), param.value);\r\n\t\t\t\t\t\t\t\t\texprs.push(new If(condition, ifTrue));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (((ref5 = param.name) != null ? ref5.value : void 0) != null) {\r\n\t\t\t\t\t\t\t\t\t// Add this parameter to the scope, since it wouldn’t have been added\r\n\t\t\t\t\t\t\t\t\t// yet since it was skipped earlier.\r\n\t\t\t\t\t\t\t\t\to.scope.add(param.name.value, 'var', true);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// If there were parameters after the splat or expansion parameter, those\r\n\t\t\t\t\t// parameters need to be assigned in the body of the function.\r\n\t\t\t\t\tif (paramsAfterSplat.length !== 0) {\r\n\t\t\t\t\t\t// Create a destructured assignment, e.g. `[a, b, c] = [args..., b, c]`\r\n\t\t\t\t\t\texprs.unshift(new Assign(new Value(new Arr([\r\n\t\t\t\t\t\t\tnew Splat(new IdentifierLiteral(splatParamName)),\r\n\t\t\t\t\t\t\t...((function() {\r\n\t\t\t\t\t\t\t\tvar k,\r\n\t\t\t\t\t\t\tlen2,\r\n\t\t\t\t\t\t\tresults1;\r\n\t\t\t\t\t\t\t\tresults1 = [];\r\n\t\t\t\t\t\t\t\tfor (k = 0, len2 = paramsAfterSplat.length; k < len2; k++) {\r\n\t\t\t\t\t\t\t\t\tparam = paramsAfterSplat[k];\r\n\t\t\t\t\t\t\t\t\tresults1.push(param.asReference(o));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn results1;\r\n\t\t\t\t\t\t\t})())\r\n\t\t\t\t\t\t])), new Value(new IdentifierLiteral(splatParamName))));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Add new expressions to the function body\r\n\t\t\t\t\twasEmpty = this.body.isEmpty();\r\n\t\t\t\t\tthis.disallowSuperInParamDefaults();\r\n\t\t\t\t\tthis.checkSuperCallsInConstructorBody();\r\n\t\t\t\t\tif (!this.expandCtorSuper(thisAssignments)) {\r\n\t\t\t\t\t\tthis.body.expressions.unshift(...thisAssignments);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.body.expressions.unshift(...exprs);\r\n\t\t\t\t\tif (this.isMethod && this.bound && !this.isStatic && this.classVariable) {\r\n\t\t\t\t\t\tboundMethodCheck = new Value(new Literal(utility('boundMethodCheck', o)));\r\n\t\t\t\t\t\tthis.body.expressions.unshift(new Call(boundMethodCheck, [new Value(new ThisLiteral()), this.classVariable]));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!(wasEmpty || this.noReturn)) {\r\n\t\t\t\t\t\tthis.body.makeReturn();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// JavaScript doesn’t allow bound (`=>`) functions to also be generators.\r\n\t\t\t\t\t// This is usually caught via `Op::compileContinuation`, but double-check:\r\n\t\t\t\t\tif (this.bound && this.isGenerator) {\r\n\t\t\t\t\t\tyieldNode = this.body.contains(function(node) {\r\n\t\t\t\t\t\t\treturn node instanceof Op && node.operator === 'yield';\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t(yieldNode || this).error('yield cannot occur inside bound (fat arrow) functions');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Assemble the output\r\n\t\t\t\t\tmodifiers = [];\r\n\t\t\t\t\tif (this.isMethod && this.isStatic) {\r\n\t\t\t\t\t\tmodifiers.push('static');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.isAsync) {\r\n\t\t\t\t\t\tmodifiers.push('async');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!(this.isMethod || this.bound)) {\r\n\t\t\t\t\t\tmodifiers.push(`function${this.isGenerator ? '*' : ''}`);\r\n\t\t\t\t\t} else if (this.isGenerator) {\r\n\t\t\t\t\t\tmodifiers.push('*');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsignature = [this.makeCode('(')];\r\n\t\t\t\t\t// Block comments between a function name and `(` get output between\r\n\t\t\t\t\t// `function` and `(`.\r\n\t\t\t\t\tif (((ref6 = this.paramStart) != null ? ref6.comments : void 0) != null) {\r\n\t\t\t\t\t\tthis.compileCommentFragments(o, this.paramStart, signature);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor (i = k = 0, len2 = params.length; k < len2; i = ++k) {\r\n\t\t\t\t\t\tparam = params[i];\r\n\t\t\t\t\t\tif (i !== 0) {\r\n\t\t\t\t\t\t\tsignature.push(this.makeCode(', '));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (haveSplatParam && i === params.length - 1) {\r\n\t\t\t\t\t\t\tsignature.push(this.makeCode('...'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Compile this parameter, but if any generated variables get created\r\n\t\t\t\t\t\t// (e.g. `ref`), shift those into the parent scope since we can’t put a\r\n\t\t\t\t\t\t// `var` line inside a function parameter list.\r\n\t\t\t\t\t\tscopeVariablesCount = o.scope.variables.length;\r\n\t\t\t\t\t\tsignature.push(...param.compileToFragments(o, LEVEL_PAREN));\r\n\t\t\t\t\t\tif (scopeVariablesCount !== o.scope.variables.length) {\r\n\t\t\t\t\t\t\tgeneratedVariables = o.scope.variables.splice(scopeVariablesCount);\r\n\t\t\t\t\t\t\to.scope.parent.variables.push(...generatedVariables);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsignature.push(this.makeCode(')'));\r\n\t\t\t\t\t// Block comments between `)` and `->`/`=>` get output between `)` and `{`.\r\n\t\t\t\t\tif (((ref7 = this.funcGlyph) != null ? ref7.comments : void 0) != null) {\r\n\t\t\t\t\t\tref8 = this.funcGlyph.comments;\r\n\t\t\t\t\t\tfor (l = 0, len3 = ref8.length; l < len3; l++) {\r\n\t\t\t\t\t\t\tcomment = ref8[l];\r\n\t\t\t\t\t\t\tcomment.unshift = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.compileCommentFragments(o, this.funcGlyph, signature);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!this.body.isEmpty()) {\r\n\t\t\t\t\t\tbody = this.body.compileWithDeclarations(o);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// We need to compile the body before method names to ensure `super`\r\n\t\t\t\t\t// references are handled.\r\n\t\t\t\t\tif (this.isMethod) {\r\n\t\t\t\t\t\t[methodScope, o.scope] = [o.scope, o.scope.parent];\r\n\t\t\t\t\t\tname = this.name.compileToFragments(o);\r\n\t\t\t\t\t\tif (name[0].code === '.') {\r\n\t\t\t\t\t\t\tname.shift();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\to.scope = methodScope;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanswer = this.joinFragmentArrays((function() {\r\n\t\t\t\t\t\tvar len4, p, results1;\r\n\t\t\t\t\t\tresults1 = [];\r\n\t\t\t\t\t\tfor (p = 0, len4 = modifiers.length; p < len4; p++) {\r\n\t\t\t\t\t\t\tm = modifiers[p];\r\n\t\t\t\t\t\t\tresults1.push(this.makeCode(m));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn results1;\r\n\t\t\t\t\t}).call(this), ' ');\r\n\t\t\t\t\tif (modifiers.length && name) {\r\n\t\t\t\t\t\tanswer.push(this.makeCode(' '));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (name) {\r\n\t\t\t\t\t\tanswer.push(...name);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanswer.push(...signature);\r\n\t\t\t\t\tif (this.bound && !this.isMethod) {\r\n\t\t\t\t\t\tanswer.push(this.makeCode(' =>'));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanswer.push(this.makeCode(' {'));\r\n\t\t\t\t\tif (body != null ? body.length : void 0) {\r\n\t\t\t\t\t\tanswer.push(this.makeCode('\\n'), ...body, this.makeCode(`\\n${this.tab}`));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanswer.push(this.makeCode('}'));\r\n\t\t\t\t\tif (this.isMethod) {\r\n\t\t\t\t\t\treturn indentInitial(answer, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.front || (o.level >= LEVEL_ACCESS)) {\r\n\t\t\t\t\t\treturn this.wrapInParentheses(answer);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn answer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function Java9Listener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function ModelParser() {\n Parser.call(this);\n\n this.onValue = function(v) {\n\tthis.emit('model', v);\n };\n this.onEnd = function() { };\n\n this.on('list', function() {\n\tvar list = [];\n\tvar oldOnValue = this.onValue, oldOnUp = this.onUp;\n\tthis.onValue = function(v) {\n\t list.push(v);\n\t};\n\tthis.onUp = function() {\n\t this.onValue = oldOnValue;\n\t this.onUp = oldOnUp;\n\t this.onValue(list);\n\t};\n });\n this.on('dict', function() {\n\tvar key = undefined, dict = {};\n\tvar oldOnValue = this.onValue, oldOnUp = this.onUp;\n\tthis.onValue = function(v) {\n\t if (key === undefined) {\n\t\tkey = v.toString();\n\t } else {\n\t\tdict[key] = v;\n\t\tkey = undefined;\n\t }\n\t};\n\tthis.onUp = function() {\n\t this.onValue = oldOnValue;\n\t this.onUp = oldOnUp;\n\t this.onValue(dict);\n\t};\n });\n this.on('integer', function(integer) {\n\tthis.onValue(integer);\n });\n this.on('string', function(string) {\n\tthis.onValue(string);\n });\n this.on('up', function() {\n\tthis.onUp();\n });\n}", "function XMLParserListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function TNode() {}", "function TNode() {}", "function TNode() {}", "function GoobScraperVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function Parser(text) {\n if (typeof text !== 'string') {\n throw new Error('not a string');\n }\n this.text = text.trim();\n this.level = 0;\n this.place = 0;\n this.root = null;\n this.stack = [];\n this.currentObject = null;\n this.state = NEUTRAL;\n}", "function Parser(text) {\n if (typeof text !== 'string') {\n throw new Error('not a string');\n }\n this.text = text.trim();\n this.level = 0;\n this.place = 0;\n this.root = null;\n this.stack = [];\n this.currentObject = null;\n this.state = NEUTRAL;\n}", "function Parser(text) {\n if (typeof text !== 'string') {\n throw new Error('not a string');\n }\n this.text = text.trim();\n this.level = 0;\n this.place = 0;\n this.root = null;\n this.stack = [];\n this.currentObject = null;\n this.state = NEUTRAL;\n}", "function Parser(text) {\n if (typeof text !== 'string') {\n throw new Error('not a string');\n }\n this.text = text.trim();\n this.level = 0;\n this.place = 0;\n this.root = null;\n this.stack = [];\n this.currentObject = null;\n this.state = NEUTRAL;\n}", "visitFunctionDeclaration(tree) {}", "visitFunctionDeclaration(tree) {}", "visitFunctionDeclaration(tree) {}", "function parser(v) {\n\t// default value parser fallback\n\tvar p = valueParser; \n\n\t// dispatch on arrays\n\tif (isArray(v)) {\n\t\t// if [], make it a shortcut for isArray\n\t\tif(isEmpty(v)) {\n\t\t\tp = function(x){ return isArray; };\n\t\t// override valueParser, and use the schema parser for arrays\n\t\t} else {\n\t\t\tp = arrayParser;\n\t\t}\n\t}\n\t// dispatch on object\n\tif (isObject(v)) {\n\t\t// if {}, make it a shortcut for isObject\n\t\tif(isEmpty(v)) {\n\t\t\tp = function(x) { return isObject; };\n\t\t// override valueParser, and use the schema parser for objects\n\t\t// (Note that this def of isObject excludes arrays and functions.)\n\t\t} else {\n\t\t\tp = objectParser;\n\t\t}\n\t}\n\n\t// dispatch on string\n\tif (isString(v)) {\n\t\t// test for the presence of any specials\n\t\tvar specials = parseSpecial(v);\n\t\tif(specials.length > 0) {\n\t\t\t// right now we're assuming that there can only be one special\n\t\t\t// per string (which isn't true), but this works for now\n\t\t\tswitch (specials[0].name) {\n\t\t\t\t// match `*` up to isAnything\n\t\t\t\tcase 'STAR':\n\t\t\t\t\tp = function(x){ return isAnything; };\n\t\t\t\t\tbreak;\n\t\t\t\t// match up `$...$` to the sibling parser\n\t\t\t\tcase 'SIBLING':\n\t\t\t\t\tp = function(x){return parseSiblingVar(x, parseSiblingKey)};\n\t\t\t\t\tbreak;\n\t\t\t\t// otherwise use the default parseSpecial parser\n\t\t\t\tdefault:\n\t\t\t\t\tp = function(x) { return parseSpecial; }\n\t\t\t}\n\t\t};\n\t};\n\n\t// return the dispatched parser\n\treturn p(v);\n}", "forEach(visitor) {\n this.tree_walk(this.root, (node) => visitor(node.item.key, node.item.value));\n }", "function expressionDefinitionVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function n3Visitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "parseAST(AST) {\n // initialize prototype as empty object\n const prototype = {};\n let isQuellable = true;\n\n let operationType;\n\n // initialiaze arguments as null\n let protoArgs = null; //{ country: { id: '2' } }\n \n // initialize stack to keep track of depth first parsing\n const stack = [];\n\n /**\n * visit is a utility provided in the graphql-JS library. It performs a\n * depth-first traversal of the abstract syntax tree, invoking a callback\n * when each SelectionSet node is entered. That function builds the prototype.\n * Invokes a callback when entering and leaving Field node to keep track of nodes with stack\n *\n * Find documentation at:\n * https://graphql.org/graphql-js/language/#visit\n */\n visit(AST, {\n enter(node) {\n if (node.directives) {\n if (node.directives.length > 0) {\n isQuellable = false;\n return BREAK;\n }\n }\n },\n OperationDefinition(node) {\n if (node.operation === \"subscription\") {\n isQuellable = false;\n return BREAK;\n }\n if(node.operation === 'mutation') {\n console.log('we got mutation', node);\n }\n\n },\n Field: {\n enter(node) {\n if (node.alias) {\n isQuellable = false;\n return BREAK; \n }\n if(node.arguments && node.arguments.length > 0) {\n \n protoArgs = protoArgs || {};\n protoArgs[node.name.value] = {};\n \n // collect arguments if arguments contain id, otherwise make query unquellable\n // hint: can check for graphQl type ID instead of string 'id'\n for (let i = 0; i < node.arguments.length; i++) {\n const key = node.arguments[i].name.value;\n const value = node.arguments[i].value.value;\n \n if(!key.includes('id')) {\n isQuellable = false;\n return BREAK;\n }\n protoArgs[node.name.value][key] = value;\n }\n }\n // add value to stack\n stack.push(node.name.value);\n },\n leave(node) {\n // remove value from stack\n stack.pop();\n },\n },\n SelectionSet(node, key, parent, path, ancestors) {\n /* Exclude SelectionSet nodes whose parents' are not of the kind\n * 'Field' to exclude nodes that do not contain information about\n * queried fields.\n */\n if (parent.kind === \"Field\") {\n // loop through selections to collect fields\n const tempObject = {};\n for (let field of node.selections) {\n tempObject[field.name.value] = true;\n }\n\n // loop through stack to get correct path in proto for temp object;\n // mutates original prototype object;\n const protoObj = stack.reduce((prev, curr, index) => {\n return index + 1 === stack.length // if last item in path\n ? (prev[curr] = tempObject) // set value\n : (prev[curr] = prev[curr]); // otherwise, if index exists, keep value\n }, prototype);\n }\n },\n });\n const proto = isQuellable ? prototype : \"unQuellable\";\n //const proto = \"unQuellable\";\n return {proto, protoArgs};\n }", "function processBuiltinAST(node) {\n delete node.loc;\n node._builtin = true;\n Object.values(node).forEach(maybeChildNode => {\n if (\n maybeChildNode &&\n typeof maybeChildNode === \"object\" &&\n \"type\" in maybeChildNode\n ) {\n processBuiltinAST(maybeChildNode);\n } else if (maybeChildNode && maybeChildNode.forEach) {\n maybeChildNode.forEach(processBuiltinAST);\n }\n });\n return node;\n}", "function node_t() {\n this.type = null;\n this.start = tokStart;\n this.end = null;\n }", "function SqlBaseVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function createVisitor(visitor) {\n //remap some deprecated visitor names TODO remove this in v1\n if (visitor.ClassFieldStatement) {\n visitor.FieldStatement = visitor.ClassFieldStatement;\n }\n if (visitor.ClassMethodStatement) {\n visitor.MethodStatement = visitor.ClassMethodStatement;\n }\n return ((statement, parent, owner, key) => {\n var _a;\n return (_a = visitor[statement.constructor.name]) === null || _a === void 0 ? void 0 : _a.call(visitor, statement, parent, owner, key);\n });\n}", "function parse_Expr() {\n tree.addNode('Expr', 'branch');\n if (foundTokensCopy[parseCounter][1] == \"digit\") {\n console.log('its a gooda digit');\n parse_IntExpr();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][0] == '\"') {\n parse_StringExpr();\n //tree.endChildren();\n\n } else if (foundTokensCopy[parseCounter][0] == '(' || foundTokensCopy[parseCounter][0] == 'false' || foundTokensCopy[parseCounter][0] == 'true') {\n parse_BooleanExpr();\n //tree.endChildren();\n\n\n } else if (foundTokensCopy[parseCounter][1] == 'identifier') {\n parse_ID();\n //tree.endChildren();\n\n\n }\n else {\n document.getElementById('parse').value += \"PARSE ERROR: KILLING PARSER\"\n throw new Error(\"Something went badly wrong!\");\n }\n tree.endChildren();\n\n}", "function AbstractTree() {\n\n\tthis.root = null;\n\tthis.cur = null;\n\n\t// Add a node: kind = [branch|leaf]\n\tthis.addNode = function(token, kind) {\n\n\t\t// Construct the node object\n\t\tvar node = new Node(token, this.cur);\n\n\t\t// if there are no nodes in the tree yet, start the tree here\n\t\tif(!this.cur) {\n\t\t\tthis.cur = node;\n\n\t\t// otherwise, add this node to the children array\n\t\t} else {\n\t\t\tthis.cur.addChild(node);\n\t\t}\n\n\t\t// if we are an interior/branch node, then update the current node to be this node\n\t\tif (kind === \"branch\") {\n\t\t\tthis.cur = node;\n\t\t}\n\n\t\t// if this node is the super root, set it as the root of the tree\n\t\tif(token === \"Super Root\") {\n\t\t\tthis.root = node;\n\t\t}\n\n\t\toutVerbose(parseTabs() + \"Added node -> \" + node.toString());\n\n\t};\n\n\tthis.startBranch = function(branchName) {\n\t\tthis.addNode(branchName, \"branch\");\n\n\t\tif((typeof branchName === \"object\") && !isNaN(branchName.type)) {\n\t\t\tif(branchName.value) {\n\t\t\t\tbranchName = getTokenType(branchName.type) + \" \" + branchName.value;\n\t\t\t} else {\n\t\t\t\tbranchName = getTokenType(branchName.type);\n\t\t\t}\n\t\t}\n\n\t\toutVerbose(parseTabs() + \"Creating \" + branchName + \" branch\");\n\t\tnumTabs++;\n\t};\n\n\tthis.endBranch = function() {\n\n\t\t// if the current node has a parent (i.e. is NOT the superRoot)\n\t\tif(this.cur.parent) {\n\n\t\t\t// move the current node up to this node's parent\n\t\t\tthis.cur = this.cur.parent;\n\n\t\t// otherwise, we have a problem\n\t\t} else {\n\t\t\toutError(\"ERROR: can't end branch because parent does not exist.\");\n\t\t}\n\n\t\tnumTabs--;\n\n\t};\n\n\tthis.traverseTree = function(treeRoot) {\n\n\t\t// if token type is a number\n\t\tif(!isNaN(treeRoot.token.type)) {\n\t\t\tthis.addNode(treeRoot.token, \"leaf\");\n\t\t\treturn;\n\t\t}\n\n\t\tswitch(treeRoot.token) {\n\n\t\t\tcase \"Statement\":\n\n\t\t\t\t// print statement\n\t\t\t\tif(treeRoot.children[0].token.type === T_TYPE.PRINT) {\n\t\t\t\t\tthis.startBranch(\"print\");\n\t\t\t\t\tthis.traverseTree(treeRoot.children[2]);\n\t\t\t\t\tthis.endBranch();\n\t\t\t\t}\n\n\t\t\t\t// assignment statement\n\t\t\t\telse if(treeRoot.children[1] && treeRoot.children[1].token.type === T_TYPE.EQUAL) {\n\t\t\t\t\tthis.startBranch(\"assign\");\n\t\t\t\t\tthis.addNode(treeRoot.children[0].token, \"leaf\");\n\t\t\t\t\tthis.traverseTree(treeRoot.children[2]);\n\t\t\t\t\tthis.endBranch();\n\t\t\t\t}\n\n\t\t\t\t// block\n\t\t\t\telse if(treeRoot.children[0] && treeRoot.children[0].token.type === T_TYPE.BRACE) {\n\t\t\t\t\tthis.startBranch(\"block\");\n\t\t\t\t\t// ignore } if it's the next node\n\t\t\t\t\tif(treeRoot.children[1].token.type !== T_TYPE.BRACE && treeRoot.children[1].token.value !== \"}\") {\n\t\t\t\t\t\tthis.traverseTree(treeRoot.children[1]);\n\t\t\t\t\t}\n\t\t\t\t\tthis.endBranch();\n\t\t\t\t}\n\n\t\t\t\t// otherwise (VarDecl)\n\t\t\t\telse if(treeRoot.children[0]) {\n\t\t\t\t\tthis.traverseTree(treeRoot.children[0]);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"IfStatement\":\n\t\t\t\tthis.startBranch(\"if\");\n\n\t\t\t\t// BooleanExpr\n\t\t\t\tthis.traverseTree(treeRoot.children[1]);\n\n\t\t\t\t// block\n\t\t\t\tthis.startBranch(\"block\");\n\t\t\t\t// ignore } if it's the next node\n\t\t\t\tif(treeRoot.children[3].token.type !== T_TYPE.BRACE && treeRoot.children[3].token.value !== \"}\") {\n\t\t\t\t\tthis.traverseTree(treeRoot.children[3]);\n\t\t\t\t}\n\t\t\t\tthis.endBranch();\n\n\t\t\t\tthis.endBranch();\n\t\t\t\tbreak;\n\n\t\t\tcase \"WhileStatement\":\n\t\t\t\tthis.startBranch(\"while\");\n\n\t\t\t\t// BooleanExpr\n\t\t\t\tthis.traverseTree(treeRoot.children[1]);\n\n\t\t\t\t// block\n\t\t\t\tthis.startBranch(\"block\");\n\t\t\t\t// ignore } if it's the next node\n\t\t\t\tif(treeRoot.children[3].token.type !== T_TYPE.BRACE && treeRoot.children[3].token.value !== \"}\") {\n\t\t\t\t\tthis.traverseTree(treeRoot.children[3]);\n\t\t\t\t}\n\t\t\t\tthis.endBranch();\n\n\t\t\t\tthis.endBranch();\n\t\t\t\tbreak;\n\n\t\t\tcase \"StatementList\":\n\t\t\t\tif(treeRoot.children[0]) {\n\t\t\t\t\tthis.traverseTree(treeRoot.children[0]);\n\t\t\t\t}\n\t\t\t\tif(treeRoot.children[1]) {\n\t\t\t\t\tthis.traverseTree(treeRoot.children[1]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"IntExpr\":\n\t\t\t\tif(treeRoot.children[1]) {\n\t\t\t\t\tthis.startBranch(treeRoot.children[1].token); // use operation as branch root\n\t\t\t\t\tthis.traverseTree(treeRoot.children[0]);\n\t\t\t\t\tthis.traverseTree(treeRoot.children[2]);\n\t\t\t\t\tthis.endBranch();\n\t\t\t\t} else {\n\t\t\t\t\tthis.traverseTree(treeRoot.children[0]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"StringExpr\":\n\t\t\t\tthis.startBranch(\"string\");\n\t\t\t\tthis.traverseTree(treeRoot.children[1]);\n\t\t\t\tthis.endBranch();\n\t\t\t\tbreak;\n\n\t\t\tcase \"BooleanExpr\":\n\t\t\t\tif(treeRoot.children[1]) {\n\t\t\t\t\tthis.startBranch(\"equal?\");\n\t\t\t\t\tthis.traverseTree(treeRoot.children[1]);\n\t\t\t\t\tthis.traverseTree(treeRoot.children[3]);\n\t\t\t\t\tthis.endBranch();\n\t\t\t\t} else {\n\t\t\t\t\tthis.traverseTree(treeRoot.children[0]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"CharList\":\n\t\t\t\tthis.traverseTree(treeRoot.children[0]);\n\t\t\t\tif(treeRoot.children[1]) {\n\t\t\t\t\tthis.traverseTree(treeRoot.children[1]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"VarDecl\":\n\t\t\t\tthis.startBranch(\"declare\");\n\t\t\t\tthis.addNode(treeRoot.children[0].token, \"leaf\"); // Type\n\t\t\t\tthis.addNode(treeRoot.children[1].token, \"leaf\"); // Id\n\t\t\t\tthis.endBranch();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif(treeRoot.children[0]) {\n\t\t\t\t\tthis.traverseTree(treeRoot.children[0]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tthis.addNode(\"Super Root\", \"branch\");\n\tthis.traverseTree(parseTree.root);\n\n}" ]
[ "0.65919274", "0.60482764", "0.60482764", "0.5950813", "0.58122927", "0.58122927", "0.58122927", "0.577187", "0.5699212", "0.56250006", "0.56055236", "0.55747366", "0.55630654", "0.5482851", "0.5422624", "0.5421316", "0.5384845", "0.53826153", "0.538102", "0.5351745", "0.5320969", "0.5311846", "0.53096694", "0.53013444", "0.529842", "0.52747416", "0.52065355", "0.51916397", "0.51837194", "0.51699376", "0.514871", "0.51202685", "0.51123625", "0.51117015", "0.51082635", "0.50969404", "0.50969404", "0.50849426", "0.5076205", "0.5076205", "0.5072178", "0.5071671", "0.50716686", "0.5070783", "0.50634646", "0.50622183", "0.5055639", "0.5055227", "0.5052282", "0.50355095", "0.50238234", "0.5002504", "0.49980307", "0.49915472", "0.49884036", "0.49818417", "0.49693036", "0.49693036", "0.49664652", "0.49571887", "0.49468195", "0.4943597", "0.49380812", "0.49349028", "0.491821", "0.4904911", "0.49039137", "0.49016047", "0.48996693", "0.48996693", "0.4891556", "0.48813492", "0.48805952", "0.48784792", "0.48718625", "0.48712304", "0.4864881", "0.48620227", "0.48374555", "0.48374555", "0.48374555", "0.48373854", "0.48299104", "0.48299104", "0.48299104", "0.48299104", "0.48111612", "0.48111612", "0.48111612", "0.48109332", "0.48074782", "0.4805158", "0.4797293", "0.47858387", "0.4780633", "0.47787943", "0.4776185", "0.47735912", "0.4766188", "0.47610176" ]
0.7582853
0
use for get current file info used by file_on_mouse_down, open_new_dir.
function get_cur_file_info_by_id(id){ file_to_operate_id = id; element_to_operate = document.getElementById(id); switch(cur_dir_path){ case 'root': file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).type; break; case 'root/Pictures': file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).filename; break; case 'root/Contacts': file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).name; break; case 'root/Videos': file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).name; break; } //element_to_operate.innerHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_current_code_path(){\n\tvar id = $(\"#file_name_nav\").find(\"span.selected\").attr(\"id\");\n\tid = id.replace(\"t_\", \"\");\n\treturn full_path($(\"#\"+id));\n}", "get info() {\n return this.project.getFileInfo(this.path)\n }", "function showFileInfo(file){\n console.log(\"name : \" + file.name);\n console.log(\"size : \" + file.size);\n console.log(\"type : \" + file.type);\n console.log(\"date : \" + file.lastModified);\n }", "function getCurrentImage() {\n\t\treturn this.options.folder ?\n\t\t\t\tthis.options.folder + \"/\" + this.options.images[this.current] :\n\t\t\t\tthis.options.images[this.current];\n\t}", "function _getLocateFile() {\n\t\treturn OS.Path.join(_getLocateDirectory(), LOCATE_FILE_NAME);\n\t}", "get() {\n return this.filePointer.get();\n }", "get() {\n return this.filePointer.get();\n }", "function displayFileDetails(file, side){\n side.innerHTML = file.name + \" (\"+ file.size + \" bytes) has been selected. <br/> Last Modified: \" +\n (file.lastModifiedDate ? file.lastModifiedDate.toLocaleDateString() : 'n/a') + \". <br/><br/> To change files drop another file.\";\n }", "function selectFile(evt) {\n\t\tvar last_file = {};\n\t\tif (context_element && (context_element.type == 2)) {\n\t\t\tlast_file = context_element;\n\t\t}\n\t\tcontext_element = getElProp(evt);\n\t\tif (context_element.type == 1) {\n\t\t\t// If select directory then open the directory\n\t\t\t// if index >= 0 then select subfolde, if index < 0 - then select up folder\n\t\t\tif (context_element.index >= 0) {\n\t\t\t\tgetDirContent(cur_path + context_element.name + '/');\n\t\t\t} else {\n\t\t\t\tvar\n\t\t\t\t\tpath = '',\n\t\t\t\t\ti\n\t\t\t\t;\n\t\t\t\tfor (i = dir_content.path.length + context_element.index; i >= 0; i--) {\n\t\t\t\t\tpath = dir_content.path[i] + '/' + path;\n\t\t\t\t}\n\t\t\t\tgetDirContent('/' + path);\n\t\t\t}\n\t\t} else if (context_element.type == 2) {\n\t\t\t// Іf select the file then highlight and execute the external functions with the file properties\n\t\t\thighlightFileItem(context_element.index);\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_select || on_dblselect) {\n\t\t\t\tvar file = dir_content.files[context_element.index];\n\t\t\t\t// Generate additional field\n\t\t\t\tfile.path = cur_path + file.name;\n\t\t\t\tfile.wwwPath = getURIEncPath(HTMLDecode(upload_path + cur_path + file.name));\n\t\t\t\t// If thumbnail exist, set the www path to him\n\t\t\t\tif (file.thumb && file.thumb !== '') {\n\t\t\t\t\tfile.wwwThumbPath = getURIEncPath(HTMLDecode(upload_path + file.thumb));\n\t\t\t\t}\n\t\t\t\tif (on_select) {\n\t\t\t\t\ton_select(file);\n\t\t\t\t}\n\t\t\t\t// If double click on file then chose them by on_dblselect() function\n\t\t\t\tif ( on_dblselect &&(last_file.index == context_element.index) && ((context_element.time - last_file.time) < dbclick_delay) ) {\n\t\t\t\t\ton_dblselect(file);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// No selections\n\t\t\t// Clean the highlight\n\t\t\thighlightFileItem();\n\t\t\t// Hide the tooltips\n\t\t\thideTooltips();\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_deselect) {\n\t\t\t\ton_deselect();\n\t\t\t}\n\t\t}\n\t}", "file () {\n try {\n const file = this.currentFile()\n\n if (!file) throw createError({ code: 'ENOENT', message: 'No file selected' })\n return file\n } catch (e) {\n throw new Error(e)\n }\n }", "function open_dir(dir){\r\n $('body').addClass('loading');\r\n manager.get_dir(dir,function(files){\r\n \r\n global.total_selected=0;\r\n $('#edit').hide();\r\n html='';\r\n for(var i=0;i<files.length;i++){\r\n html+='<div data-file=\"'+files[i].rel_filename+'\" class=\"file '+files[i].type+'\"'+\r\n 'title=\"'+files[i].filename+'\" data-i=\"'+i+'\" data-type=\"'+files[i].type+'\">'+\r\n '<div class=\"icon\"><i class=\"fa fa-'+files[i].icon+'\"></i></div>'+\r\n '<div class=\"name\">'+files[i].filename+'</div>'+\r\n '<div class=\"type\">'+files[i].type+'</div>'+\r\n '<div class=\"filedate\" data-date=\"'+files[i].modified_timestamp+'\">'+files[i].date+'</div>'+\r\n '<div class=\"filesize\" data-size=\"'+files[i].raw_size+'\">'+files[i].filesize+'</div>'+\r\n '</div>';\r\n }\r\n $('.file').remove();\r\n $('#files').html(html);\r\n $('#info').text(files.length+' file(s)');\r\n\r\n //remove selection\r\n $('#files').off('click').on('click',function(event) { \r\n if(!$(event.target).closest('.file').length) {\r\n $('.selected').removeClass('selected');\r\n $('#info').text(files.length+' file(s)');\r\n $('#edit').hide();\r\n } \r\n })\r\n\r\n //select files\r\n $('.file').on('click',function(e){\r\n var index=parseInt($(this).data('i')),\r\n text='';\r\n \r\n if(!e.ctrlKey){\r\n if($(this).hasClass('selected')) return; //kill if already selected\r\n $('.selected').removeClass('selected');\r\n }\r\n if(e.shiftKey){ //select multiples\r\n\r\n if(index > global.last_selected){\r\n while(index >= global.last_selected){\r\n $('.file[data-i=\"'+index+'\"]').addClass('selected');\r\n index--;\r\n }\r\n }\r\n else{\r\n while(index <= global.last_selected){\r\n $('.file[data-i=\"'+index+'\"]').addClass('selected');\r\n index++;\r\n }\r\n }\r\n $(this).addClass('selected');\r\n global.total_selected=$('.selected').length;\r\n\r\n text=global.total_selected+' files selected';\r\n }\r\n else if(e.ctrlKey){\r\n if($(this).hasClass('selected'))\r\n $(this).removeClass('selected');\r\n else\r\n $(this).addClass('selected');\r\n global.total_selected=$('.selected').length;\r\n text=global.total_selected+' files selected';\r\n }\r\n else{ //deselect everything except this one\r\n global.last_selected=index;\r\n $(this).addClass('selected');\r\n global.total_selected=1;\r\n console.log(manager.files[index]);\r\n text=manager.files[index].rel_filename;\r\n if(manager.files[index].type!=='dir')\r\n text+=' - Size:'+manager.files[index].filesize;\r\n text+=' - Modified:'+manager.files[index].modified;\r\n }\r\n $('#info').text(text);\r\n \r\n if(global.total_selected === 1){\r\n $('#edit .single').show();\r\n }\r\n else{\r\n $('#edit .single').hide();\r\n }\r\n if(global.total_selected > 0){\r\n $('#edit').show();\r\n }\r\n else{\r\n $('#edit').hide();\r\n }\r\n });\r\n \r\n //open the file\r\n $('.file[data-type!=\"dir\"]').on('dblclick',function(){\r\n var index=$(this).data('i');\r\n if(typeof index==='undefined')return;\r\n var file=manager.files[index];\r\n $('#image').html('');\r\n $('#text textarea').html('');\r\n manager.get_file(index,function(file){\r\n if(!file){\r\n error('This type of file is not permitted.');\r\n }\r\n else{\r\n console.log(file);\r\n $('#image').hide();\r\n $('#text').hide();\r\n $('#iframe').hide();\r\n if(file.action=='view'){\r\n if(file.type==='jpg' || file.type==='gif' || file.type==='png'){\r\n $('#image').html('<img src=\"'+global.base_url+file.rel_filename+'\">');\r\n $('#image').show();\r\n lightbox.show(file.filename);\r\n }\r\n else{\r\n console.log(global.base_url+encodeURIComponent(file.rel_filename));\r\n window.open(global.base_url+encodeURIComponent(file.rel_filename));\r\n //$('#iframe iframe').attr('src',global.base_url+encodeURIComponent(file.rel_filename));\r\n }\r\n }\r\n else if(file.action=='edit'){\r\n $('#text textarea').text(file.contents);\r\n $('#text').show();\r\n lightbox.show(file.filename);\r\n }\r\n else{\r\n $('#iframe iframe').attr('src','download.php?file='+encodeURIComponent(file.rel_filename));\r\n }\r\n }\r\n });\r\n \r\n });\r\n\r\n $('.dir').on('dblclick',function(){open_dir($(this).data('file'));});\r\n\r\n manager.get_breadcrumbs(function(nav){\r\n html='';\r\n for(var i=0;i<nav.length;i++){\r\n html+='<li><a data-path=\"'+nav[i].rel_path+'\">'+nav[i].name+'</a></li>';\r\n }\r\n $('.breadcrumb li').remove();\r\n $('.breadcrumb').html(html);\r\n $('.breadcrumb li a').on('click',function(){open_dir($(this).data('path'));});\r\n $('body').removeClass('loading');\r\n });\r\n });\r\n //window.location.href=window.location.origin+window.location.pathname+'?dir='+$(this).data('file');\r\n}", "function getActiveFile() {\n var active = getActiveTab();\n if(!active) {\n return false;\n }\n return lt.objs.tabs.__GT_path(active);\n }", "openFile(x,e){\n console.log(x);\n let text = this.VirtualDisk[x.father].getData(x.clusterStart);\n if(x.kind == \"file\"){\n this.setState({\n disks : this.state.disks,\n current : this.state.current,\n mode : 3,\n selected : x,\n nameFile : x.name,\n infoFile : text\n });\n }\n\n }", "GetPath() {return this.filePath;}", "get information(){\n return this.info_files;\n }", "function getCurrentFileOrDefault() {\n var pFile = LaunchBar.executeAppleScript('if application \"TaskPaper\" is running then',\n 'tell application id (id of application \"TaskPaper\")',\n ' set a to file of the front document',\n ' return POSIX path of a',\n 'end tell',\n 'else',\n ' return \"\"',\n 'end if').trim();\n if (pFile == \"\") {\n if(File.exists(LaunchBar.homeDirectory + \"/.tpProjectFile\"))\n pFile = File.readText(LaunchBar.homeDirectory + \"/.tpProjectFile\");\n } else {\n //\n // Save the path to the ~/.tpProjectFile location.\n //\n File.writeText(pFile, LaunchBar.homeDirectory + \"/.tpProjectFile\");\n }\n\n //\n // Return the project file location.\n //\n return (pFile);\n}", "function file(i)\n\t\t\t\t{\n\t\t\t\t\tvar filename = files[i];\n\t\t\t\t\tfs.stat(curDir+'/'+filename,function(err,stat){\n\t\t\t\t\t\t\n\t\t\t\t\t\tstats[i] = stat;\n\t\t\t\t\t\tif(stat.isDirectory())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconsole.log('\t'+i+'\t\\033[36m'+filename+'/\\033[39m');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconsole.log('\t'+i+'\t\\033[36m'+filename+'\\033[39m');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif (i!=files.length) {\n\t\t\t\t\t\t\tfile(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconsole.log('\\n\tSelect which file or direcroty you want to see');\n\t\t\t\t\t\t\tconsole.log('\tor');\n\t\t\t\t\t\t\tconsole.log('\tyou can just enter another path to see');\n\t\t\t\t\t\t\tconsole.log('\tor');\n\t\t\t\t\t\t\tconsole.log('\tenter \"b\" to go to the parent folder.\\n');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}", "async getFileInfo() {\n return this.fileInfo;\n }", "static getRecentFiles(evt){\n let filePaths = FolderData.recentFilePaths;\n IpcResponder.respond(evt, \"files-recent\", {filePaths});\n }", "function getFile(){\n\n\t\treturn this.file;\n\t}", "function getFileInfoDropdown(){\n\t\tvar currentField = this;\n\t\tvar val = this.value; //filename\n\t\tdropdownAdd(val);\n\t\tshowAlarms(val);\n}", "static getLastOpenedFile(callback) {\r\n FileWriterRemote.fileWriter.getLastOpenedFile(callback);\r\n }", "get file() {\r\n return new File(this, \"file\");\r\n }", "function showFileInfo (container) {\n\n var options = container.data(\"options\");\n\n\t\tvar fileinfo = '';\n\t\t\t\n\t\tif(options.fileName || options.scanNum) {\n\t\t\tfileinfo += '<div style=\"margin-top:5px;\" class=\"font_small\">';\n\t\t\tif(options.fileName) {\n\t\t\t\tfileinfo += 'File: '+options.fileName;\n\t\t\t}\n\t\t\tif(options.scanNum) {\n\t\t\t\tfileinfo += ', Scan: '+options.scanNum;\n\t\t\t}\n if(options.precursorMz) {\n fileinfo += ', Exp. m/z: '+options.precursorMz;\n }\n\t\t\tif(options.charge) {\n\t\t\t\tfileinfo += ', Charge: '+options.charge;\n\t\t\t}\n\t\t\tfileinfo += '</div>';\n\t\t}\n\t\t\n\t\t$(getElementSelector(container, elementIds.fileinfo)).append(fileinfo);\n\t}", "function getCurrentUserInfo() {\r\n\t \treturn self._userInfo;\r\n\t }", "function GetCurentFileName()\n{\n var pagePathName = window.location.pathname;\n var lastPathSegment = pagePathName.substr(pagePathName.lastIndexOf('/') + 1);\n lastPathSegment = lastPathSegment.substr(0, lastPathSegment.lastIndexOf('.'));\n if (lastPathSegment == \"\") lastPathSegment = \"index\";\n return lastPathSegment;\n}", "function getCurrentImage() {\n\tvar currentImagePath = $(\".overlayImg img\").attr(\"src\");\n\tvar currentImage = currentImagePath.substring(currentImagePath.lastIndexOf(\"/\") + 1, currentImagePath.length);\n\t\n\treturn currentImage;\n}", "getFiles() {\n this.divFiles.innerHTML = \"\";\n this._fileList = this.fs.readdir(this.path).filter(fileName => fileName !== \".\" && fileName !== \"..\" && this.fs.isFile(this.fs.stat(this.path + fileName).mode));\n\n this._fileList.forEach(fileName => {\n var divFile = this.createFileDiv(fileName, false);\n this.divFiles.appendChild(divFile);\n });\n\n if (this._fileList.length === 0) {\n var fileName = this.newFile(\"untitled.dsp\", \"import(\\\"stdfaust.lib\\\");\\nprocess = ba.pulsen(1, 10000) : pm.djembe(60, 0.3, 0.4, 1) <: dm.freeverb_demo;\");\n this.select(fileName);\n } else {\n this.select(this._fileList[0]);\n }\n\n if (this.$mainFile >= this._fileList.length) this.setMain(this._fileList.length - 1);else this.setMain(this.$mainFile);\n }", "function FileMgr() {\n}", "function getCurrentFilenames(dirPath) { \n let files = []\n // console.log(`Current files in: ${dirPath}`); \n fs.readdirSync(dirPath).forEach(file => { \n // console.log(\" \" + file);\n files.push(file)\n });\n return files\n}", "function _getCurrent(){\n return current || null;\n }", "function getScriptInfo() {\n var ex, fn, dbLevel;\n var fInfo = null;\n\n dbLevel = $.level; // save\n $.level = 0; // debug off\n try {\n undefined_variable1 = undefined_variable2;\n } catch(ex) {\n fInfo = ex.fileName;\n }\n $.level = dbLevel; // restore\n fn = fInfo.substring(fInfo.lastIndexOf(\"/\")+1, fInfo.lastIndexOf(\".\"));\n if (fn != null && fn != \"\") {\n scriptName = fn;\n }\n return;\n}", "function init()\r\n\t\t\t{ \r\n\t\t\t\tget_data('get_dir','','directory');\r\n\t\t\t\tget_data('read_dir','current_dir','file_folder');\r\n\t\t\t}", "function getCurrentItemData() {\n\t\t\t\treturn mItemData[oTemplatePrivateModel.getProperty(getPropertyPath(PATH_TO_SELECTED_KEY))]; // return metadata of selected item\n\t\t\t}", "getActiveFileName() /*:string*/ {\n const activeFilePath = this.getActiveFilePath();\n if (!activeFilePath) {\n return '';\n }\n\n const basename = path.basename(activeFilePath);\n let ext = basename.split('.').slice(1).join('.');\n\n // Detection dot-files.\n if ('.' + ext === basename) {\n ext = '';\n }\n\n const exceptionalExts = [\n '',\n 'json',\n 'cson',\n 'md',\n 'yml',\n 'yaml',\n 'conf',\n 'lock',\n 'properties'\n ];\n\n if (~exceptionalExts.indexOf(ext)) {\n return '';\n }\n\n return basename;\n }", "function getAndProcessData() { \n\t\tchooseFileSource();\n\t}", "function mycallback() {\n // either call the ImageInfo.getAllFields([file]) function which returns an object holding all the info\n alert(\n \"All info about this file: \" + ImageInfo.getAllFields(file)\n );\n // or call ImageInfo.getField([file], [field]) to get a specific field\n alert(\n \"Format: \" + ImageInfo.getField(file, \"format\") + \", dimensions : \" + ImageInfo.getField(file, \"width\") + \"x\" + ImageInfo.getField(file, \"height\")\n );\n}", "function getCurrentPathName() {\n pathName = window.location.pathname;\n return pathName;\n }", "get currentIcon() {\n return this._regOrToggled(this.icon, this.toggledIcon, this.isToggled);\n }", "function displayCurrent(img){\n img.className = 'current ' + scope.photoImport.data[n].orientClass;\n return img;\n }", "function _getDataFromFile(){\n\tvar fileData = _openFIle();\n\treturn fileData;\n}", "get currentIcon() {\n return this._regOrToggled(this.icon, this.toggledIcon, this.isToggled);\n }", "getCurrentTestInfo() {\n if (!this.currentTest) {\n throw new Error(\"Can't obtain TestInfo if not actively in a test!\");\n }\n return this.currentTest;\n }", "function displayStats(highlighted_path){\n /*\n * grab file info for selected file.\n */\n let stats = fs.statSync(highlighted_path);\n let size = stats.size;\n let mtime = stats.mtime;\n let birthtime = stats.birthtime;\n\n let parent = document.getElementById(\"stats\");\n\n while(parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n\n \n let nPath = document.createElement(\"p\");\n let nSize = document.createElement(\"p\");\n let nM = document.createElement(\"p\");\n let nB = document.createElement(\"p\"); \n \n nPath.innerText = \"Path: \" +highlighted_path;\n parent.appendChild(nPath);\n\n nSize.innerText = \"Size: \" + size + \" bytes\";\n parent.appendChild(nSize);\n\n nM.innerText = \"Last Modified: \" +mtime;\n parent.appendChild(nM);\n\n nB.innerText = \"Date Created: \" + birthtime;\n parent.appendChild(nB);\n}", "function File(info) {\n this.name = info.name;\n this.kind = info.kind;\n this.genre = info.genre;\n this.size = info.size;\n this.last_revision = info.commit_revision;\n this.author = info.commit_author;\n this.last_date = info.commit_date;\n this.id = info.index;\n this.commit_history = {};\n this.comments = [];\n}", "function CursorInfo() { }", "get file() {\n return this.args.file;\n }", "function get_current_page_filename()\n{\n let path = window.location.pathname;\n let page = path.split(\"/\").pop();\n return page;\n}", "function readFileInfo(x){\n\tconsole.log(\"Cur \" + x + \" Tot \" + nrOfFiles);\n\tif (x >= nrOfFiles) {\n\t\tofferShare();\n\t\treturn;\n\t}\n\tvar f = files[x];\n\tvar reader = new FileReader();\n\t\treader.onloadend = function (e) {\n\t\t\tif(reader.readyState == FileReader.DONE){\n\t\t\t\tconsole.log(f.name);\n\t\t\t\tfmArray[x].stageLocalFile(f.name, f.type, reader.result);\n\t\t\t\treadFileInfo(x+1);\n\t\t\t}\n\t\t}; \n\t\treader.readAsArrayBuffer(f);\n}", "function handleFileSelect(evt) {\r\n\t\"use strict\";\t\r\n var files = evt.target.files;\r\n\r\n // files is a FileList of File objects. List some properties.\r\n var output = [];\r\n for (var i = 0, f; f = files[i]; i++) {\r\n output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',\r\n f.size, ' bytes, last modified: ',\r\n f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a',\r\n '</li>');\r\n }\r\n\t\r\n\tupdateBGfromFile();\r\n\t\r\n\tBGNAME = escape(f.name);\r\n document.getElementById('file_output').innerHTML = '<ul>' + output.join('') + '</ul>';\r\n }", "getCurrentDirectory(fileName, insertedPath) {\r\n var currentDir = path.parse(fileName).dir || '/';\r\n var workspacePath = vs.workspace.rootPath;\r\n // based on the project root\r\n if (insertedPath.startsWith('/') && workspacePath) {\r\n currentDir = vs.workspace.rootPath;\r\n }\r\n return path.resolve(currentDir);\r\n }", "function Dir() {\r\n}", "function getImageInfo() {\n\n}", "get pathname()\t{ return \"\" + this.path + this.file}", "function callerPath () {\n return callsites()[2].getFileName()\n}", "getOwnFiles() {\n //source scope only inherits files from global, so just return all files. This function mostly exists to assist XmlScope\n return this.getAllFiles();\n }", "static fileWithInfo (fileInfo) {\n switch (fileInfo.extension) {\n case 'json':\n return MoveAnnotated.json(fileInfo)\n case 'txt':\n return MoveAnnotated.txt(fileInfo)\n default:\n throw new Error('unrecognized filetype')\n }\n }", "getCWD() {\n let cwd = this.state.cursor().get( 'cwd' )\n\n return cwd || null\n }", "function mousecoords(ev){\n\n\te = ev || window.event;\n\t\n\t// get the mouse location\n\t\n\tif(e.pageX||e.pageY){\n\n\t\tmousecursor.y = e.pageY;\n\n\t}else{\n\t\n\t\tmousecursor.y = e.clientY + drag_manager.body_scroll;\n\n\t}\n\t\n\t/*\n\t* If the files are being dragged\n\t*/\n\n\tif(drag_manager.drag_flag){\n\n\t\t/*\n\t\t* Has the window been scrolled since the drag started - if so get the values again\n\t\t*/\n\n\t\tif(drag_manager.initial_scroll!=document.getElementById(\"file_area\").scrollTop){\n\n\t\t\tfolder_positions_find();\n\n\t\t\tdrag_manager.initial_scroll = document.getElementById(\"file_area\").scrollTop;\n\t\t\t\n\t\t}\n\t\t\n\t\t/*\n\t\t* for each selected item\n\t\t*/\n\n\t\tfor(x=0;x!=drag_manager.selected_items.length;x++){\n\n\t\t\t/*\n\t\t\t* change the styles to allow for dragging and transparency\n\t\t\t*/\n\n\t\t\tdrag_manager.selected_items[x].style.position = \"absolute\";\n\t\t\t\t\n\t\t\tif(navigator.appName==\"Netscape\"){\t\t\t\t\t\n\t\t\t\tdrag_manager.selected_items[x].style.MozOpacity=0.5;\n\t\t\t}else if(navigator.appName==\"Microsoft Internet Explorer\"){\t\t\t\t\n\t\t\t\tdrag_manager.selected_items[x].style.filter=\"alpha(opacity=50)\";\n\t\t\t}else if(navigator.appName==\"Opera\"){\n\t\t\t\tdrag_manager.selected_items[x].style.opacity=.50;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t* set the top of the file\n\t\t\t*/\n\n\t\t\tdrag_manager.selected_items[x].style.top = mousecursor.y + drag_manager.scroll_value - drag_manager.body_scroll - file_area_height() + (x*25) + \"px\";\t\n\n\t\t\t/*\n\t\t\t* fix the file to the left\n\t\t\t*/\n\t\t\t\n\t\t\tdrag_manager.selected_items[x].style.left=\"0px\";\n\t\t\t\n\t\t\t/*\n\t\t\t* take the files back int he z buffer to make sure the folders we are dragging over are visible\n\t\t\t*/\n\n\t\t\tdrag_manager.selected_items[x].style.zindex=\"-1\";\n\t\t\n\n\t\t}\n\n\t\tfolder_count=0;\n\t\t\n\t\t/*\n\t\t* code to highlight the folders\n\t\t*/\n\t\t\t\n\t\twhile(folder_count!=folder_position_top.length){\n\n\t\t\tif((folder_position_top[folder_count]+(drag_manager.body_scroll+drag_manager.new_scroll)<=mousecursor.y)&&(mousecursor.y<=folder_position_bottom[folder_count]+(drag_manager.body_scroll+drag_manager.new_scroll))){\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(String(drag_manager.last_mouse_over)!=String(folder_div_id[folder_count].id)){\t\n\t\t\t\t\t\t\t\n\t\t\t\t\tif(drag_manager.last_mouse_over!=null){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdocument.getElementById(String(drag_manager.last_mouse_over)).style.backgroundColor = \"#fff\";\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tdrag_manager.last_mouse_over = String(folder_div_id[folder_count].id);\n\t\t\t\t\t\n\t\t\t\t\tif(folder_div_id[folder_count].className==\"folder\"){\n\t\t\t\t\t\n\t\t\t\t\t\tif(!folder_div_id[folder_count].highlight){\n\t\n\t\t\t\t\t\t\tfolder_div_id[folder_count].style.backgroundColor=\"#c2ccd8\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\t\t\n\t\t\tfolder_count++;\n\n\t\t}\n\t\t\n\t\tdrag_manager.dragged=true;\n\n\t}\t\t\t\n\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\ttemp = document.getElementById('file_area');\n\t\n\tnew_cursor_location = mousecursor.y-temp.parentNode.offsetTop;\n\t\n}", "function getPathInfo(requestInfo) {\n let {\n commitType,\n oldPath,\n newPath\n } = requestInfo;\n\n // TODO: Validate the file path\n // Find out the file path validation function on GiHub and GitLab\n /*/ Validate the file path\n if (!validatePattern(REGEX_PATH, fpath)) {\n return errorHandler({\n msg: \"Invalid file path!\",\n err: true\n });\n }*/\n\n // trim path before comparision\n oldPath = trimSlash(oldPath);\n newPath = trimSlash(newPath);\n\n // get proper fpath and check for rename\n let rename = false;\n let fpath, oldParentDir;\n switch (commitType) {\n case REQ_DELETE:\n oldParentDir = getParentPath(oldPath);\n fpath = oldPath;\n break;\n\n case REQ_EDIT:\n oldParentDir = getParentPath(oldPath);\n fpath = newPath;\n if (oldPath != newPath) rename = true;\n break;\n\n case REQ_NEW:\n oldParentDir = oldPath;\n fpath = newPath;\n // GitLab does not display oldPath in the UI\n if (SERVER == SERVER_GL)\n fpath = `${oldPath}/${newPath}`;\n break;\n\n case REQ_UPLOAD:\n // TODO: Support multiple uploaded files on GitHub\n oldParentDir = oldPath;\n fpath = `${oldPath}/${newPath}`;\n break;\n }\n\n // trim path again\n fpath = trimSlash(fpath);\n\n // Extract proper fileName and parent directory \n let fname = removeParentPath(fpath);\n let newParentDir = getParentPath(fpath);\n\n // Prepare a list of dirs that should be fetched from repo \n let {\n dirs,\n newdirs,\n moved\n } = compareParentDirs(commitType, oldParentDir, newParentDir);\n\n return {\n dname: newParentDir,\n fname,\n dirs,\n newdirs,\n\tnewPath: fpath,\n oldPath,\n rename\n };\n}", "location() {\n return `File: ${this._fileName}, Line: ${this._lineNum}`;\n }", "static io_getfile(filename, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.io_getfile({0})\".format(filename));\n Database.getfile(filename, fcn);\n }", "function currently (current) {\n\n $(\".location\").text(App.city.address);\n $(\".temperature\").text(convertTemperature(current.temperature));\n $(\".description\").text(current.summary);\n $(\".humidity\").text(\"Humidity: \" + (current.humidity * 100).toFixed(0) + \"%\");\n $(\".wind\").text(\"Wind: \" + current.windSpeed + \" m/s\");\n $(\".pressure\").text(\"Pressure: \" + current.pressure + \" hPa\");\n $(\".last-updated\").text(\"Last Updated: \" + convertTimeStamp(current.time).time);\n\n App.icons.push(current.icon);\n\n }", "function handleFileChange(event) {\n file.current = event.target.files[0];\n }", "get isFile() {\n return this.stats.isFile()\n }", "function getCurEntry() {\n var entries = getEntries();\n return entries[g_cur_entry];\n}", "get filePath() {\n //must be the copy version, otherwise, this.path may changed by other\n\t\treturn this._path.clone();\n\t}", "get currentPathChanged() {\n return this._currentPathChanged;\n }", "function currentModuleInfo() {\n\t\tvar scripts = document.getElementsByTagName('script'),\n\t\t script,\n\t\t name = null,\n\t\t src = null,\n\t\t i;\n\t\t// On IE, it's the first script element that is in interactive readyState.\n\t\t// On other browsers, it's the last script element.\n\t\tfor (i = 0; i < scripts.length; i++) {\n\t\t\tscript = scripts[i];\n\t\t\tif ('interactive' === script.readyState) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (script && script.getAttribute) {\n\t\t\tif (script.getAttribute('data-pronto-name')) {\n\t\t\t\tname = script.getAttribute('data-pronto-name');\n\t\t\t}\n\t\t\tif (script.getAttribute('src')) {\n\t\t\t\tsrc = script.getAttribute('src');\n\t\t\t}\n\t\t}\n\t\treturn [name, (src && src.match(/\\//) ? src.replace(/(^|\\/)[^\\/]+$/, '') : null)];\n\t}", "function getCurrentDate() {\n\tvar currentDate = new Date();\n\tvar day = currentDate.getDate();\n\tvar month = currentDate.getMonth() + 1;\n\tvar year = currentDate.getFullYear();\n\treturn (month + \"/\" + day + \"/\" + year);\n}", "function FileHelper() {\n\n}", "function getNewFilePath() {\n //choose a name\n var fileName = getCurrentDateTime() + \".txt\";\n \n if (!folderLocation) {\n folderLocation = os.tmpdir();\n folderLocation = path.join(folderLocation, 'vslogcat');\n }\n\n var filePath = path.join(folderLocation, fileName);\n console.log(\"File path is \" + filePath);\n return filePath;\n\n}", "function updateFileInfo(fileName) {\n var adjustedFileName = fileName;\n\n if (fileName.length > 50) {\n adjustedFileName = fileName.substr(0, 15) + '...' + fileName.substr(fileName.length - 15);\n }\n\n fileInfo.find('.file-name').html(adjustedFileName);\n fileInfo.attr('title', fileName);\n\n fileInputField.attr('title', fileName);\n\n fileInfo.find('.clear').show();\n }", "fileData() {\n if (this.state.selectedFile) {\n return (\n <div>\n <h2>File Details:</h2>\n <p>File Name: {this.state.selectedFile.name}</p>\n <p>File Type: {this.state.selectedFile.type}</p>\n <p>\n Last Modified:{' '}\n {this.state.selectedFile.lastModifiedDate.toDateString()}\n </p>\n </div>\n );\n } else {\n return (\n <div>\n <br />\n <h4>Choose before Pressing the Upload button</h4>\n </div>\n );\n }\n }", "function parseInfo(info) {\n var metadata = {\n name: info.name,\n time: new Date(info.time),\n };\n\n // file\n if (info.type == 0) {\n metadata.is_dir = false;\n metadata.size = parseInt(info.size);\n } else {\n metadata.is_dir = true;\n }\n\n return metadata;\n}", "async function fileInfo(file) {\n // Take deep paths into considerations\n const p = path.parse(file)\n const input = path.join(p.dir, p.base)\n const output = `${getConvertedFileName(input)}`\n const exists = fs.existsSync(output)\n\n const exif = await exiftool.read(input)\n const date = exif.MediaCreateDate || exif.DateTimeOriginal\n\n // console.log(date.rawValue)\n // console.log(exif['CreateDate: ExifDateTime'])\n try {\n date.rawValue\n } catch (error) {\n // console.log('ERROR --------------')\n // console.log(exif)\n }\n\n // console.log(exif.CreateDate.year)\n\n return {\n input,\n output: output.replace('.mp4', '~===TEMP===~.mp4'),\n exists,\n }\n}", "function showCurrentPath(d) {\n if (d == tmRoot)\n $('#path_label').text(getPath(d));\n else\n $('#path_label').text($('#path_label').text() + \"/\" + getPath(d));\n}", "function gotFile(file) {\n createDiv(\"<h1>\"+file.name+\"</h1>\").class(tabNumber).parent(\"left\");\n\n // Handle image and text differently\n if (file.type === 'image') {\n createImg(file.data);\n } \n else if (file.type === 'text') {\n tabs[file.name] = new Tab(file.name, tabNumber);\n switchTab(file.name, tabNumber);\n analyzeText(file, tabNumber);\n }\n}", "function FilePath() {\n\n}", "getFileInfo(filePath) {\n const location = this.getFileLocation(filePath)\n if (location) return this.manifest[location.path]\n }", "getFileName() {\n return this.filename;\n }", "get currentFrame() {\n return this._currentFrame\n }", "function browse() {\r\n\r\n}", "function filename() {\n \"use strict\";\n console.log(document.currentScript);\n}", "function getFileURL() {\n return urlVars['file'];\n}", "_getCallerFilePath() {\n // we are going to temporarily override this method. Keep for restore\n const originalPrepareStackTrace = Error.prepareStackTrace;\n let callerFile;\n\n try {\n // temporary change\n Error.prepareStackTrace = (_, stack) => stack;\n const err = new Error();\n let currentFile = err.stack.shift().getFileName();\n while (err.stack.length) {\n callerFile = err.stack.shift().getFileName();\n if (currentFile !== callerFile) break;\n }\n } catch (err) { }\n\n // restore original method\n Error.prepareStackTrace = originalPrepareStackTrace; \n return callerFile;\n }", "function startFileStatus(){\n // Javascript Files\n var file = document.createElement('script'); // Hack to extract absolute url\n $jQ('script[src]').each(function(){\n file.src=$jQ(this).attr('src');\n setLink($jQ(this),'src', file.src);\n });\n // CSS Files\n file = document.createElement('link'); // Hack to extract absolute url\n $jQ('link[href]').each(function(){\n file.href=$jQ(this).attr('href');\n setLink($jQ(this),'href', file.href);\n });\n}", "function display_file_name(event) {\n // alert(event.fpfile.filename );\n $('.uploaded_file_name').text(event.fpfile.filename)\n}", "function extract_file_info (element) {\n return Drupal.media.filter.extract_file_info(element);\n}", "function setcurrentFileUrl(){\n if ($scope.selectedFile) {\n $scope.apifileurl = $scope.selectedFile.apifileurl;\n } else {\n if($scope.selectedApi){\n var maxRev = getMaxRevisionFor($scope.selectedApi);\n if(maxRev) {\n $scope.apifileurl = maxRev.apifileurl;\n }\n } else {\n $scope.apifileurl = undefined;\n }\n }\n }", "function getCurrent() {\n return $(containerStr + ' LI.'+$.fn.bgStretcher.settings.album).filter('.bgs-current');\n }", "function getFilePath() {\n $('input[type=file]').change(function () {\n var filePath = $('#fileUpload').val();\n });\n}", "function fileSelected(data, evt) {\n /*jshint validthis: true */\n this.file = evt.target.files[0];\n if (this.file)\n this.filename(this.file.name);\n this.errorMessage('');\n }", "function updateOSFileName(event) {\n if(span_import) {\n if(this.files[0]) {\n span_import.innerHTML = this.files[0].name;\n } else {\n span_import.innerHTML = noFileTxt;\n }\n }\n}", "function getFileInfoDB( ctx ) {\n // Use the context key as a cache key.\n const { key } = ctx;\n // Look for a currently cached db.\n const db = Cache.get( key );\n if( db ) {\n return db;\n }\n // Nothing cached, so generate a DB.\n return singleton( key, async () => {\n // List all active files on target repo + branch.\n const result = await listAllFiles( ctx );\n // Open a readable on the result.\n const ins = await result.readable();\n // Process each file record in the result and add a mapping from the\n // file path to its commit.\n const db = {};\n const fsCache = {};\n await jsonlStreamForEach( ins, async ( record ) => {\n const { path, commit } = record;\n // Ignore files without a commit.\n if( !commit ) {\n return;\n }\n // Lookup the fileset for the current file.\n const fileset = await getFilesetForPath( ctx, commit, path, fsCache );\n if( fileset ) {\n // Get file's cache control from the fileset.\n const cacheControl = fileset.cacheControl;\n // Add a db record.\n db[record.path] = { commit, cacheControl };\n }\n });\n // Add to the cache and return.\n Cache.set( key, db );\n return db;\n });\n }", "function fileData() {\n\n if (state.selectedFile) {\n\n return (\n <div>\n <h2>File Details:</h2>\n\n <p>File Name: {state.selectedFile.name}</p>\n\n\n <p>File Type: {state.selectedFile.type}</p>\n\n\n <p>\n Last Modified:{\" \"}\n {state.selectedFile.lastModifiedDate.toDateString()}\n </p>\n\n </div>\n );\n } else {\n return (\n <div>\n <br />\n <h4>Choose before Pressing the Upload button</h4>\n </div>\n );\n }\n}", "function Current(name, type, def, upvars) {\n def = def || mkRawIdentifier({ lineno: -1 }, \"undefined\", null, true);\n\n this.__hash__ = genhash.gen(name);\n this.name = name;\n this.type = type;\n this._def = def;\n this.upvars = upvars;\n this.gotIntervened = false;\n }", "getFileInfo(url) {\n return new Promise((resolve, reject) => {\n if (this.infos[url])\n return resolve(this.infos[url]);\n const req = require('request');\n req.head(url, (err, response, _) => {\n if (err)\n return reject(err);\n try {\n const result = {\n name: response.headers['content-disposition'].split('filename=')[1].split(';')[0],\n type: response.headers['content-type'].split(';')[0]\n };\n this.infos[url] = result;\n BdApi.saveData('RepoUtils', 'infos', this.infos);\n resolve(result);\n }\n catch (e) {\n reject(e);\n }\n });\n });\n }", "function FileHelper()\n{\n}", "function get(file) {\r\n if (inLengthyOperation) {\r\n return;\r\n }\r\n beginLengthyOperation();\r\n setTimeout(function () {\r\n var sourceDiv = document.getElementById('sourceDiv');\r\n sourceDiv.innerHTML = '';\r\n selectTab('sourceTab');\r\n if (file === currentFile) {\r\n recalculateSourceTab();\r\n } else {\r\n if (currentFile === null) {\r\n var tab = document.getElementById('sourceTab');\r\n tab.onclick = tab_click;\r\n }\r\n currentFile = file;\r\n var fileDiv = document.getElementById('fileDiv');\r\n fileDiv.innerHTML = currentFile;\r\n recalculateSourceTab();\r\n return;\r\n }\r\n }, 50);\r\n}" ]
[ "0.64498436", "0.6211815", "0.5877517", "0.58511686", "0.58344495", "0.5813102", "0.5813102", "0.56974804", "0.56627387", "0.5660691", "0.55960137", "0.55346304", "0.55316913", "0.5522157", "0.54973036", "0.5495355", "0.5493738", "0.54894185", "0.5487194", "0.5457002", "0.53932345", "0.53858525", "0.53773206", "0.53715104", "0.53692037", "0.5361538", "0.53356224", "0.5316852", "0.5244857", "0.5242068", "0.5241874", "0.523644", "0.5186664", "0.51749057", "0.51578194", "0.51555425", "0.5153613", "0.5142354", "0.5141011", "0.51366377", "0.5135322", "0.5129657", "0.5128219", "0.51220345", "0.5113668", "0.5106979", "0.50922596", "0.5076472", "0.5071453", "0.5070483", "0.5066009", "0.5053286", "0.5049351", "0.5049127", "0.504746", "0.50408125", "0.50327915", "0.5031162", "0.5025221", "0.5022742", "0.50198454", "0.50179374", "0.5014956", "0.5007817", "0.49982908", "0.49941233", "0.49897593", "0.49836758", "0.49772596", "0.49756253", "0.49731675", "0.49621007", "0.4957813", "0.49512672", "0.49465993", "0.49426815", "0.49365383", "0.4932904", "0.4932406", "0.4930016", "0.4929076", "0.49277058", "0.49224338", "0.49223918", "0.49109548", "0.4907344", "0.49065906", "0.49031645", "0.48997805", "0.48997357", "0.48946854", "0.48896885", "0.48712778", "0.48694122", "0.48629466", "0.48619375", "0.4860464", "0.48547548", "0.48534286", "0.485092" ]
0.6290701
1
for event: 1. mouse move 2. long press 3. right click
function file_on_mouse_down(event){ get_cur_file_info_by_id(this.id); //console.log('event.button' + event.button); // if(2 == event.button){ // return false; // }else{ // close_rmenu(); // } // guess function state. var func_state = -1; var state_mouse_move = 0; var state_left_click = 1; var state_left_long_press = 2; var state_right_click = 3; switch(event.button) { case 0: func_state = state_left_click; break; case 2: func_state = state_right_click; //popup_rmenu(event); //return false; break; } elementToDrag = this; // The initial mouse position, converted to document coordinates var scroll = getScrollOffsets(); // A utility function from elsewhere var startX = event.clientX + scroll.x; var startY = event.clientY + scroll.y; // The original position (in document coordinates) of the element // that is going to be dragged. Since elementToDrag is absolutely // positioned, we assume that its offsetParent is the document body. var origX = elementToDrag.offsetLeft; var origY = elementToDrag.offsetTop; // Compute the distance between the mouse down event and the upper-left // corner of the element. We'll maintain this distance as the mouse moves. var deltaX = startX - origX; var deltaY = startY - origY; //console.log('in (file on mouse down) event:' + event); //console.log('start: %s - %s', startX, startY); //console.log('origin: %s - %s', origX, origY); //console.log('delta: %s - %s', deltaX, deltaY); // start time count var time_cnt = 0; timer = setInterval(function() { time_cnt += 10; if (time_cnt >= 250) { clearInterval(timer); popup_rmenu(event); func_state = state_left_long_press; //alert('time out'); } }, 10) // Register the event handlers that will respond to the mousemove events // and the mouseup event that follow this mousedown event. if (document.addEventListener) { // Standard event model // Register capturing event handlers on the document document.addEventListener("mousemove", moveHandler, true); document.addEventListener("mouseup", upHandler, true); } else if (document.attachEvent) { // IE Event Model for IE5-8 // In the IE event model, we capture events by calling // setCapture() on the element to capture them. elementToDrag.setCapture(); elementToDrag.attachEvent("onmousemove", moveHandler); elementToDrag.attachEvent("onmouseup", upHandler); // Treat loss of mouse capture as a mouseup event. elementToDrag.attachEvent("onlosecapture", upHandler); } // We've handled this event. Don't let anybody else see it. if (event.stopPropagation) event.stopPropagation(); // Standard model else event.cancelBubble = true; // IE // Now prevent any default action. if (event.preventDefault) event.preventDefault(); // Standard model else event.returnValue = false; // IE function out_of_content_row(left, top){ var right = left + file_width; var bottom = top + file_height; var out_of_range = false; if((right < content_row_left) || (left > content_row_right) || (top > content_row_bottom) || (bottom < content_row_top)){ out_of_range = true; } return out_of_range; } /** * This is the handler that captures mousemove events when an element * is being dragged. It is responsible for moving the element. **/ function moveHandler(e) { func_state = state_mouse_move; if (!e) e = window.event; // IE event Model // Move the element to the current mouse position, adjusted by the // position of the scrollbars and the offset of the initial click. var scroll = getScrollOffsets(); var left = (e.clientX + scroll.x - deltaX); var top = (e.clientY + scroll.y - deltaY); elementToDrag.style.left = left + "px"; elementToDrag.style.top = top + "px"; console.log('in moveHandler: %d - %d', left, top); //console.log('element position: %s - %s', elementToDrag.style.left, elementToDrag.style.top); if(out_of_content_row(left, top)){ //left = origX; //top = origY; delete_file(); upHandler(e); } // And don't let anyone else see this event. if (e.stopPropagation) e.stopPropagation(); // Standard else e.cancelBubble = true; // IE clearInterval(timer); } /** * This is the handler that captures the final mouseup event that * occurs at the end of a drag. **/ function upHandler(e) { if (!e) e = window.event; // IE Event Model // Unregister the capturing event handlers. if (document.removeEventListener) { // DOM event model document.removeEventListener("mouseup", upHandler, true); document.removeEventListener("mousemove", moveHandler, true); } else if (document.detachEvent) { // IE 5+ Event Model elementToDrag.detachEvent("onlosecapture", upHandler); elementToDrag.detachEvent("onmouseup", upHandler); elementToDrag.detachEvent("onmousemove", moveHandler); elementToDrag.releaseCapture(); } // And don't let the event propagate any further. if (e.stopPropagation) e.stopPropagation(); // Standard model else e.cancelBubble = true; // IE // clearInterval(timer); // refresh_content(); switch(func_state) { case state_left_click: clearInterval(timer); open_new_dir(); break; case state_right_click: case state_left_long_press: clearInterval(timer); refresh_content(); break; case state_mouse_move: clearInterval(timer); refresh_content(); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onMouseDown(e) {\n\t\t var cm = this, display = cm.display;\n\t\t if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n\t\t display.input.ensurePolled();\n\t\t display.shift = e.shiftKey;\n\n\t\t if (eventInWidget(display, e)) {\n\t\t if (!webkit) {\n\t\t // Briefly turn off draggability, to allow widgets to do\n\t\t // normal dragging things.\n\t\t display.scroller.draggable = false;\n\t\t setTimeout(function () { return display.scroller.draggable = true; }, 100);\n\t\t }\n\t\t return\n\t\t }\n\t\t if (clickInGutter(cm, e)) { return }\n\t\t var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n\t\t win(cm).focus();\n\n\t\t // #3261: make sure, that we're not starting a second selection\n\t\t if (button == 1 && cm.state.selectingText)\n\t\t { cm.state.selectingText(e); }\n\n\t\t if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n\t\t if (button == 1) {\n\t\t if (pos) { leftButtonDown(cm, pos, repeat, e); }\n\t\t else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n\t\t } else if (button == 2) {\n\t\t if (pos) { extendSelection(cm.doc, pos); }\n\t\t setTimeout(function () { return display.input.focus(); }, 20);\n\t\t } else if (button == 3) {\n\t\t if (captureRightClick) { cm.display.input.onContextMenu(e); }\n\t\t else { delayBlurEvent(cm); }\n\t\t }\n\t\t }", "mouseDown(x, y, _isLeftButton) {}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n var button = e_button(e);\n if (button == 3 && captureRightClick ? contextMenuInGutter(cm, e) : clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n var button = e_button(e);\n if (button == 3 && captureRightClick ? contextMenuInGutter(cm, e) : clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }", "function onMouseDown(e) {\n var cm = this,\n display = cm.display;\n\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) {\n return;\n }\n\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () {\n return display.scroller.draggable = true;\n }, 100);\n }\n\n return;\n }\n\n if (clickInGutter(cm, e)) {\n return;\n }\n\n var pos = posFromMouse(cm, e),\n button = e_button(e),\n repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus(); // #3261: make sure, that we're not starting a second selection\n\n if (button == 1 && cm.state.selectingText) {\n cm.state.selectingText(e);\n }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) {\n return;\n }\n\n if (button == 1) {\n if (pos) {\n leftButtonDown(cm, pos, repeat, e);\n } else if (e_target(e) == display.scroller) {\n e_preventDefault(e);\n }\n } else if (button == 2) {\n if (pos) {\n extendSelection(cm.doc, pos);\n }\n\n setTimeout(function () {\n return display.input.focus();\n }, 20);\n } else if (button == 3) {\n if (captureRightClick) {\n cm.display.input.onContextMenu(e);\n } else {\n delayBlurEvent(cm);\n }\n }\n }", "function onMouseDown(e) {\r\n var cm = this, display = cm.display;\r\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\r\n display.input.ensurePolled();\r\n display.shift = e.shiftKey;\r\n\r\n if (eventInWidget(display, e)) {\r\n if (!webkit) {\r\n // Briefly turn off draggability, to allow widgets to do\r\n // normal dragging things.\r\n display.scroller.draggable = false;\r\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\r\n }\r\n return\r\n }\r\n if (clickInGutter(cm, e)) { return }\r\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\r\n window.focus();\r\n\r\n // #3261: make sure, that we're not starting a second selection\r\n if (button == 1 && cm.state.selectingText)\r\n { cm.state.selectingText(e); }\r\n\r\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\r\n\r\n if (button == 1) {\r\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\r\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\r\n } else if (button == 2) {\r\n if (pos) { extendSelection(cm.doc, pos); }\r\n setTimeout(function () { return display.input.focus(); }, 20);\r\n } else if (button == 3) {\r\n if (captureRightClick) { onContextMenu(cm, e); }\r\n else { delayBlurEvent(cm); }\r\n }\r\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { onContextMenu(cm, e); }\n else { delayBlurEvent(cm); }\n }\n}", "doubleClick(x, y, _isLeftButton) {}", "function onMouseDown(e) {\n\t\t var cm = this, display = cm.display;\n\t\t if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;\n\t\t display.shift = e.shiftKey;\n\t\t\n\t\t if (eventInWidget(display, e)) {\n\t\t if (!webkit) {\n\t\t // Briefly turn off draggability, to allow widgets to do\n\t\t // normal dragging things.\n\t\t display.scroller.draggable = false;\n\t\t setTimeout(function(){display.scroller.draggable = true;}, 100);\n\t\t }\n\t\t return;\n\t\t }\n\t\t if (clickInGutter(cm, e)) return;\n\t\t var start = posFromMouse(cm, e);\n\t\t window.focus();\n\t\t\n\t\t switch (e_button(e)) {\n\t\t case 1:\n\t\t // #3261: make sure, that we're not starting a second selection\n\t\t if (cm.state.selectingText)\n\t\t cm.state.selectingText(e);\n\t\t else if (start)\n\t\t leftButtonDown(cm, e, start);\n\t\t else if (e_target(e) == display.scroller)\n\t\t e_preventDefault(e);\n\t\t break;\n\t\t case 2:\n\t\t if (webkit) cm.state.lastMiddleDown = +new Date;\n\t\t if (start) extendSelection(cm.doc, start);\n\t\t setTimeout(function() {display.input.focus();}, 20);\n\t\t e_preventDefault(e);\n\t\t break;\n\t\t case 3:\n\t\t if (captureRightClick) onContextMenu(cm, e);\n\t\t else delayBlurEvent(cm);\n\t\t break;\n\t\t }\n\t\t }", "function down(evt){mouseDown(getMousePos(evt));}", "function down(evt){mouseDown(getMousePos(evt));}", "function onMouseDown(e) {\n\t var cm = this, display = cm.display;\n\t if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;\n\t display.shift = e.shiftKey;\n\t\n\t if (eventInWidget(display, e)) {\n\t if (!webkit) {\n\t // Briefly turn off draggability, to allow widgets to do\n\t // normal dragging things.\n\t display.scroller.draggable = false;\n\t setTimeout(function(){display.scroller.draggable = true;}, 100);\n\t }\n\t return;\n\t }\n\t if (clickInGutter(cm, e)) return;\n\t var start = posFromMouse(cm, e);\n\t window.focus();\n\t\n\t switch (e_button(e)) {\n\t case 1:\n\t // #3261: make sure, that we're not starting a second selection\n\t if (cm.state.selectingText)\n\t cm.state.selectingText(e);\n\t else if (start)\n\t leftButtonDown(cm, e, start);\n\t else if (e_target(e) == display.scroller)\n\t e_preventDefault(e);\n\t break;\n\t case 2:\n\t if (webkit) cm.state.lastMiddleDown = +new Date;\n\t if (start) extendSelection(cm.doc, start);\n\t setTimeout(function() {display.input.focus();}, 20);\n\t e_preventDefault(e);\n\t break;\n\t case 3:\n\t if (captureRightClick) onContextMenu(cm, e);\n\t else delayBlurEvent(cm);\n\t break;\n\t }\n\t }", "function on_down(event){\n \tif (mode =='EDIT'){\n //EDIT MODE\n \t\tmouseDown = true;\n \t\tonMouseDownPosition = [event.clientX, event.clientY];\n \t\tonMouseDownTheta = theta;\n \t\tonMouseDownPhi = phi;\n\n \t\tif (cursorMode =='edit'){\n handleCursorEdit();\n \t\t} else if (cursorMode == 'pan'){\n handleCursorPan();\n \t\t}\n \t} else{\n //PLAY MODE\n \t\t domElement.style.cursor = \"default\";\n \t}\n window.addEventListener( \"mousemove\", on_move );\n }", "function mouseDown(e) {\n mousePress(e.button, true);\n}", "function onMouseDown(e) {\n\t var cm = this, display = cm.display;\n\t if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return;\n\t display.shift = e.shiftKey;\n\n\t if (eventInWidget(display, e)) {\n\t if (!webkit) {\n\t // Briefly turn off draggability, to allow widgets to do\n\t // normal dragging things.\n\t display.scroller.draggable = false;\n\t setTimeout(function(){display.scroller.draggable = true;}, 100);\n\t }\n\t return;\n\t }\n\t if (clickInGutter(cm, e)) return;\n\t var start = posFromMouse(cm, e);\n\t window.focus();\n\n\t switch (e_button(e)) {\n\t case 1:\n\t // #3261: make sure, that we're not starting a second selection\n\t if (cm.state.selectingText)\n\t cm.state.selectingText(e);\n\t else if (start)\n\t leftButtonDown(cm, e, start);\n\t else if (e_target(e) == display.scroller)\n\t e_preventDefault(e);\n\t break;\n\t case 2:\n\t if (webkit) cm.state.lastMiddleDown = +new Date;\n\t if (start) extendSelection(cm.doc, start);\n\t setTimeout(function() {display.input.focus();}, 20);\n\t e_preventDefault(e);\n\t break;\n\t case 3:\n\t if (captureRightClick) onContextMenu(cm, e);\n\t else delayBlurEvent(cm);\n\t break;\n\t }\n\t }", "function onMouseDown(e) {\n var cm = this, display = cm.display\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled()\n display.shift = e.shiftKey\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false\n setTimeout(function () { return display.scroller.draggable = true; }, 100)\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var start = posFromMouse(cm, e)\n window.focus()\n\n switch (e_button(e)) {\n case 1:\n // #3261: make sure, that we're not starting a second selection\n if (cm.state.selectingText)\n { cm.state.selectingText(e) }\n else if (start)\n { leftButtonDown(cm, e, start) }\n else if (e_target(e) == display.scroller)\n { e_preventDefault(e) }\n break\n case 2:\n if (webkit) { cm.state.lastMiddleDown = +new Date }\n if (start) { extendSelection(cm.doc, start) }\n setTimeout(function () { return display.input.focus(); }, 20)\n e_preventDefault(e)\n break\n case 3:\n if (captureRightClick) { onContextMenu(cm, e) }\n else { delayBlurEvent(cm) }\n break\n }\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled()\n display.shift = e.shiftKey\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false\n setTimeout(function () { return display.scroller.draggable = true; }, 100)\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var start = posFromMouse(cm, e)\n window.focus()\n\n switch (e_button(e)) {\n case 1:\n // #3261: make sure, that we're not starting a second selection\n if (cm.state.selectingText)\n { cm.state.selectingText(e) }\n else if (start)\n { leftButtonDown(cm, e, start) }\n else if (e_target(e) == display.scroller)\n { e_preventDefault(e) }\n break\n case 2:\n if (webkit) { cm.state.lastMiddleDown = +new Date }\n if (start) { extendSelection(cm.doc, start) }\n setTimeout(function () { return display.input.focus(); }, 20)\n e_preventDefault(e)\n break\n case 3:\n if (captureRightClick) { onContextMenu(cm, e) }\n else { delayBlurEvent(cm) }\n break\n }\n}", "function onMouseDown(e) {\n\t var cm = this, display = cm.display;\n\t if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;\n\t display.shift = e.shiftKey;\n\n\t if (eventInWidget(display, e)) {\n\t if (!webkit) {\n\t // Briefly turn off draggability, to allow widgets to do\n\t // normal dragging things.\n\t display.scroller.draggable = false;\n\t setTimeout(function(){display.scroller.draggable = true;}, 100);\n\t }\n\t return;\n\t }\n\t if (clickInGutter(cm, e)) return;\n\t var start = posFromMouse(cm, e);\n\t window.focus();\n\n\t switch (e_button(e)) {\n\t case 1:\n\t // #3261: make sure, that we're not starting a second selection\n\t if (cm.state.selectingText)\n\t cm.state.selectingText(e);\n\t else if (start)\n\t leftButtonDown(cm, e, start);\n\t else if (e_target(e) == display.scroller)\n\t e_preventDefault(e);\n\t break;\n\t case 2:\n\t if (webkit) cm.state.lastMiddleDown = +new Date;\n\t if (start) extendSelection(cm.doc, start);\n\t setTimeout(function() {display.input.focus();}, 20);\n\t e_preventDefault(e);\n\t break;\n\t case 3:\n\t if (captureRightClick) onContextMenu(cm, e);\n\t else delayBlurEvent(cm);\n\t break;\n\t }\n\t }", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(function() {display.input.focus();}, 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n else delayBlurEvent(cm);\n break;\n }\n }", "function mouseDown(x, y, button) {\r\n\tif (button == 0 || button == 2) {\t// If the user clicks the right or left mouse button...\r\n\t\tmouseClick = true;\r\n\t}\r\n\t//*** Your Code Here\r\n}", "function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n // #3261: make sure, that we're not starting a second selection\n if (cm.state.selectingText)\n cm.state.selectingText(e);\n else if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(function() {display.input.focus();}, 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n else delayBlurEvent(cm);\n break;\n }\n }", "on_mousedown(e, localX, localY) {\n\n }", "function onMouseDown(e) {\n if (signalDOMEvent(this, e)) return;\n var cm = this, display = cm.display;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(bind(focusInput, cm), 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n break;\n }\n }", "function onMouseDown(e) {\n if (signalDOMEvent(this, e)) return;\n var cm = this, display = cm.display;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(bind(focusInput, cm), 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n break;\n }\n }", "function onMouseDown(e) {\n if (signalDOMEvent(this, e)) return;\n var cm = this, display = cm.display;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(bind(focusInput, cm), 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n break;\n }\n }", "function onMouseDown(e) {\n if (signalDOMEvent(this, e)) return;\n var cm = this, display = cm.display;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(bind(focusInput, cm), 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n break;\n }\n }", "function onMouseDown(e) {\n if (signalDOMEvent(this, e)) return;\n var cm = this, display = cm.display;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(bind(focusInput, cm), 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n break;\n }\n }", "function onMouseDown(e) {\n if (signalDOMEvent(this, e)) return;\n var cm = this, display = cm.display;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(bind(focusInput, cm), 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n break;\n }\n }", "mouseDown(pt) {}", "mouseDown(pt) {}", "function onMouseDown(e) {\r\n if (signalDOMEvent(this, e)) return;\r\n var cm = this, display = cm.display;\r\n display.shift = e.shiftKey;\r\n\r\n if (eventInWidget(display, e)) {\r\n if (!webkit) {\r\n // Briefly turn off draggability, to allow widgets to do\r\n // normal dragging things.\r\n display.scroller.draggable = false;\r\n setTimeout(function(){display.scroller.draggable = true;}, 100);\r\n }\r\n return;\r\n }\r\n if (clickInGutter(cm, e)) return;\r\n var start = posFromMouse(cm, e);\r\n window.focus();\r\n\r\n switch (e_button(e)) {\r\n case 1:\r\n if (start)\r\n leftButtonDown(cm, e, start);\r\n else if (e_target(e) == display.scroller)\r\n e_preventDefault(e);\r\n break;\r\n case 2:\r\n if (webkit) cm.state.lastMiddleDown = +new Date;\r\n if (start) extendSelection(cm.doc, start);\r\n setTimeout(bind(focusInput, cm), 20);\r\n e_preventDefault(e);\r\n break;\r\n case 3:\r\n if (captureRightClick) onContextMenu(cm, e);\r\n break;\r\n }\r\n }", "onMouseDown(event) {\n this._mouseDownTimeStamp = event.timeStamp;\n // If we have selection, we want the context menu on right click even if the\n // terminal is in mouse mode.\n if (event.button === 2 && this.hasSelection) {\n return;\n }\n // Only action the primary button\n if (event.button !== 0) {\n return;\n }\n // Allow selection when using a specific modifier key, even when disabled\n if (!this._enabled) {\n if (!this.shouldForceSelection(event)) {\n return;\n }\n // Don't send the mouse down event to the current process, we want to select\n event.stopPropagation();\n }\n // Tell the browser not to start a regular selection\n event.preventDefault();\n // Reset drag scroll state\n this._dragScrollAmount = 0;\n if (this._enabled && event.shiftKey) {\n this._onIncrementalClick(event);\n }\n else {\n if (event.detail === 1) {\n this._onSingleClick(event);\n }\n else if (event.detail === 2) {\n this._onDoubleClick(event);\n }\n else if (event.detail === 3) {\n this._onTripleClick(event);\n }\n }\n this._addMouseDownListeners();\n this.refresh(true);\n }", "function mousedown(e){\n\t\tvar data;\n\n\t\tif (!isLeftButton(e)) { return; }\n\n\t\tdata = {\n\t\t\ttarget: e.target,\n\t\t\tstartX: e.pageX,\n\t\t\tstartY: e.pageY,\n\t\t\ttimeStamp: e.timeStamp\n\t\t};\n\n\t\tadd(document, mouseevents.move, mousemove, data);\n\t\tadd(document, mouseevents.cancel, mouseend, data);\n\t}", "function mousedown(e){\n\t\tvar data;\n\n\t\tif (!isLeftButton(e)) { return; }\n\n\t\tdata = {\n\t\t\ttarget: e.target,\n\t\t\tstartX: e.pageX,\n\t\t\tstartY: e.pageY,\n\t\t\ttimeStamp: e.timeStamp\n\t\t};\n\n\t\tadd(document, mouseevents.move, mousemove, data);\n\t\tadd(document, mouseevents.cancel, mouseend, data);\n\t}", "mouseDown(event) {\n var button = event.which || event.button;\n this.activeCommands[button] = true;\n }", "mouseDown(event) {\n var button = event.which || event.button;\n this.activeCommands[button] = true;\n }", "function Edit_MouseDown(event)\n{\n\t//interactions blocked?\n\tif (__SIMULATOR.UserInteractionBlocked())\n\t{\n\t\t//block the event (will forward to designer, if possible)\n\t\tBrowser_BlockEvent(event);\n\t}\n\telse\n\t{\n\t\t//get event type\n\t\tvar evtType = Browser_GetMouseDownEventType(event);\n\t\t//valid?\n\t\tif (evtType)\n\t\t{\n\t\t\t//in touch browser? event was touch start?\n\t\t\tif (__BROWSER_IS_TOUCH_ENABLED && evtType == __BROWSER_EVENT_MOUSEDOWN && Brower_TouchIsDoubleClick(event))\n\t\t\t{\n\t\t\t\t//convert touchstarts to double clicks\n\t\t\t\tevtType = __BROWSER_EVENT_DOUBLECLICK;\n\t\t\t}\n\t\t\t//get the html\n\t\t\tvar theHTML = Get_HTMLObject(Browser_GetEventSourceElement(event));\n\t\t\t//update creation point\n\t\t\tPopupMenu_UpdateCreationPoint(event);\n\t\t\t//block the event unless its left click, we want to keep the matchcode\n\t\t\tevent.cancelBubble = true;\n\t\t\t//has propagation?\n\t\t\tif (event.stopPropagation)\n\t\t\t{\n\t\t\t\t//stop it as well\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t\t//matchcode not showing?\n\t\t\tif (!theHTML.STATES_MATCHCODE)\n\t\t\t{\n\t\t\t\t//destroy menus\n\t\t\t\tPopups_TriggerCloseAll();\n\t\t\t}\n\t\t\t//check event\n\t\t\tswitch (evtType)\n\t\t\t{\n\t\t\t\tcase __BROWSER_EVENT_DOUBLECLICK:\n\t\t\t\t\t//trigger event\n\t\t\t\t\t__SIMULATOR.ProcessEvent(new Event_Event(theHTML.InterpreterObject, __NEMESIS_EVENT_DBLCLICK, theHTML.InterpreterObject.GetData()));\n\t\t\t\t\tbreak;\n\t\t\t\tcase __BROWSER_EVENT_MOUSERIGHT:\n\t\t\t\t\t//has prevent default?\n\t\t\t\t\tif (event.preventDefault)\n\t\t\t\t\t{\n\t\t\t\t\t\t//trigger it\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\tevent.returnValue = false;\n\t\t\t\t\t//trigger an event\n\t\t\t\t\t__SIMULATOR.ProcessEvent(new Event_Event(theHTML.InterpreterObject, __NEMESIS_EVENT_RIGHTCLICK, []));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}", "function pressRightClick() { return false; }", "function qf(e,t){Pt(e.display,t)||jf(e,t)||Ne(e,t,\"contextmenu\")||e.display.input.onContextMenu(t)}", "mouseUp(x, y, _isLeftButton) {}", "function onMouseDown (e){\n mousePressed=true;\n butt.value=1;\n butt.addEventListener(\"mouseup\", onMouseUp, true);\n butt.addEventListener(\"touchend\", touch2Mouse.touchHandler, true);\n butt.fire(e);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t e_preventDefault(e);\n\t\t\n\t\t var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n\t\t if (addNew && !e.shiftKey) {\n\t\t ourIndex = doc.sel.contains(start);\n\t\t if (ourIndex > -1)\n\t\t ourRange = ranges[ourIndex];\n\t\t else\n\t\t ourRange = new Range(start, start);\n\t\t } else {\n\t\t ourRange = doc.sel.primary();\n\t\t ourIndex = doc.sel.primIndex;\n\t\t }\n\t\t\n\t\t if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n\t\t type = \"rect\";\n\t\t if (!addNew) ourRange = new Range(start, start);\n\t\t start = posFromMouse(cm, e, true, true);\n\t\t ourIndex = -1;\n\t\t } else if (type == \"double\") {\n\t\t var word = cm.findWordAt(start);\n\t\t if (cm.display.shift || doc.extend)\n\t\t ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n\t\t else\n\t\t ourRange = word;\n\t\t } else if (type == \"triple\") {\n\t\t var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n\t\t if (cm.display.shift || doc.extend)\n\t\t ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n\t\t else\n\t\t ourRange = line;\n\t\t } else {\n\t\t ourRange = extendRange(doc, ourRange, start);\n\t\t }\n\t\t\n\t\t if (!addNew) {\n\t\t ourIndex = 0;\n\t\t setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n\t\t startSel = doc.sel;\n\t\t } else if (ourIndex == -1) {\n\t\t ourIndex = ranges.length;\n\t\t setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n\t\t {scroll: false, origin: \"*mouse\"});\n\t\t } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n\t\t setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n\t\t {scroll: false, origin: \"*mouse\"});\n\t\t startSel = doc.sel;\n\t\t } else {\n\t\t replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n\t\t }\n\t\t\n\t\t var lastPos = start;\n\t\t function extendTo(pos) {\n\t\t if (cmp(lastPos, pos) == 0) return;\n\t\t lastPos = pos;\n\t\t\n\t\t if (type == \"rect\") {\n\t\t var ranges = [], tabSize = cm.options.tabSize;\n\t\t var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n\t\t var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n\t\t var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n\t\t for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n\t\t line <= end; line++) {\n\t\t var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n\t\t if (left == right)\n\t\t ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n\t\t else if (text.length > leftPos)\n\t\t ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n\t\t }\n\t\t if (!ranges.length) ranges.push(new Range(start, start));\n\t\t setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n\t\t {origin: \"*mouse\", scroll: false});\n\t\t cm.scrollIntoView(pos);\n\t\t } else {\n\t\t var oldRange = ourRange;\n\t\t var anchor = oldRange.anchor, head = pos;\n\t\t if (type != \"single\") {\n\t\t if (type == \"double\")\n\t\t var range = cm.findWordAt(pos);\n\t\t else\n\t\t var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n\t\t if (cmp(range.anchor, anchor) > 0) {\n\t\t head = range.head;\n\t\t anchor = minPos(oldRange.from(), range.anchor);\n\t\t } else {\n\t\t head = range.anchor;\n\t\t anchor = maxPos(oldRange.to(), range.head);\n\t\t }\n\t\t }\n\t\t var ranges = startSel.ranges.slice(0);\n\t\t ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n\t\t setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n\t\t }\n\t\t }\n\t\t\n\t\t var editorSize = display.wrapper.getBoundingClientRect();\n\t\t // Used to ensure timeout re-tries don't fire when another extend\n\t\t // happened in the meantime (clearTimeout isn't reliable -- at\n\t\t // least on Chrome, the timeouts still happen even when cleared,\n\t\t // if the clear happens after their scheduled firing time).\n\t\t var counter = 0;\n\t\t\n\t\t function extend(e) {\n\t\t var curCount = ++counter;\n\t\t var cur = posFromMouse(cm, e, true, type == \"rect\");\n\t\t if (!cur) return;\n\t\t if (cmp(cur, lastPos) != 0) {\n\t\t cm.curOp.focus = activeElt();\n\t\t extendTo(cur);\n\t\t var visible = visibleLines(display, doc);\n\t\t if (cur.line >= visible.to || cur.line < visible.from)\n\t\t setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n\t\t } else {\n\t\t var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n\t\t if (outside) setTimeout(operation(cm, function() {\n\t\t if (counter != curCount) return;\n\t\t display.scroller.scrollTop += outside;\n\t\t extend(e);\n\t\t }), 50);\n\t\t }\n\t\t }\n\t\t\n\t\t function done(e) {\n\t\t cm.state.selectingText = false;\n\t\t counter = Infinity;\n\t\t e_preventDefault(e);\n\t\t display.input.focus();\n\t\t off(document, \"mousemove\", move);\n\t\t off(document, \"mouseup\", up);\n\t\t doc.history.lastSelOrigin = null;\n\t\t }\n\t\t\n\t\t var move = operation(cm, function(e) {\n\t\t if (!e_button(e)) done(e);\n\t\t else extend(e);\n\t\t });\n\t\t var up = operation(cm, done);\n\t\t cm.state.selectingText = up;\n\t\t on(document, \"mousemove\", move);\n\t\t on(document, \"mouseup\", up);\n\t\t }", "function mouseDownHandler(event){\n\t\t\tif(!event.isLeftClick()) return;\n\t\t\t\n\t\t\tsetSelectionPos(selection.first, event);\t\t\t\t\n\t\t\tif(selectionInterval != null){\n\t\t\t\tclearInterval(selectionInterval);\n\t\t\t}\n\t\t\tlastMousePos.pageX = null;\n\t\t\tselectionInterval = setInterval(updateSelection, 1000/options.selection.fps);\n\t\t\t\n\t\t\t$(document).observe('mouseup', mouseUpHandler);\n\t\t}", "function pointerDown(event) {\n dragging = true;\n pointerMove(event);\n \n }", "mouseDown(e) {\n this._modifiers(e);\n const _leftClick = Event.isLeftClick(e);\n this.status.button1 = _leftClick;\n this.status.button2 = !_leftClick;\n return this.handleMouseDown(e);\n }", "mouseDown(e) {\n this._modifiers(e);\n const _leftClick = Event.isLeftClick(e);\n this.status.button1 = _leftClick;\n this.status.button2 = !_leftClick;\n return this.handleMouseDown(e);\n }", "onMouseDown(event) {\n // only dragging with left mouse button\n if (event.button !== 0) {\n return;\n }\n\n this.onPointerDown(false, event);\n }", "onMouseDown(event) {\n // only dragging with left mouse button\n if (event.button !== 0) {\n return;\n }\n\n this.onPointerDown(false, event);\n }", "onMouseDown(event) {\n // only dragging with left mouse button\n if (event.button === 0) {\n this.onPointerDown(event);\n }\n }", "onMouseDown(event) {\n // only dragging with left mouse button\n if (event.button === 0) {\n this.onPointerDown(event);\n }\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\r\n var display = cm.display, doc = cm.doc;\r\n e_preventDefault(e);\r\n\r\n var ourRange, ourIndex, startSel = doc.sel;\r\n if (addNew && !e.shiftKey) {\r\n ourIndex = doc.sel.contains(start);\r\n if (ourIndex > -1)\r\n ourRange = doc.sel.ranges[ourIndex];\r\n else\r\n ourRange = new Range(start, start);\r\n } else {\r\n ourRange = doc.sel.primary();\r\n }\r\n\r\n if (e.altKey) {\r\n type = \"rect\";\r\n if (!addNew) ourRange = new Range(start, start);\r\n start = posFromMouse(cm, e, true, true);\r\n ourIndex = -1;\r\n } else if (type == \"double\") {\r\n var word = findWordAt(cm, start);\r\n if (cm.display.shift || doc.extend)\r\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\r\n else\r\n ourRange = word;\r\n } else if (type == \"triple\") {\r\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\r\n if (cm.display.shift || doc.extend)\r\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\r\n else\r\n ourRange = line;\r\n } else {\r\n ourRange = extendRange(doc, ourRange, start);\r\n }\r\n\r\n if (!addNew) {\r\n ourIndex = 0;\r\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\r\n startSel = doc.sel;\r\n } else if (ourIndex > -1) {\r\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\r\n } else {\r\n ourIndex = doc.sel.ranges.length;\r\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\r\n {scroll: false, origin: \"*mouse\"});\r\n }\r\n\r\n var lastPos = start;\r\n function extendTo(pos) {\r\n if (cmp(lastPos, pos) == 0) return;\r\n lastPos = pos;\r\n\r\n if (type == \"rect\") {\r\n var ranges = [], tabSize = cm.options.tabSize;\r\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\r\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\r\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\r\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\r\n line <= end; line++) {\r\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\r\n if (left == right)\r\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\r\n else if (text.length > leftPos)\r\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\r\n }\r\n if (!ranges.length) ranges.push(new Range(start, start));\r\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\r\n {origin: \"*mouse\", scroll: false});\r\n cm.scrollIntoView(pos);\r\n } else {\r\n var oldRange = ourRange;\r\n var anchor = oldRange.anchor, head = pos;\r\n if (type != \"single\") {\r\n if (type == \"double\")\r\n var range = findWordAt(cm, pos);\r\n else\r\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\r\n if (cmp(range.anchor, anchor) > 0) {\r\n head = range.head;\r\n anchor = minPos(oldRange.from(), range.anchor);\r\n } else {\r\n head = range.anchor;\r\n anchor = maxPos(oldRange.to(), range.head);\r\n }\r\n }\r\n var ranges = startSel.ranges.slice(0);\r\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\r\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\r\n }\r\n }\r\n\r\n var editorSize = display.wrapper.getBoundingClientRect();\r\n // Used to ensure timeout re-tries don't fire when another extend\r\n // happened in the meantime (clearTimeout isn't reliable -- at\r\n // least on Chrome, the timeouts still happen even when cleared,\r\n // if the clear happens after their scheduled firing time).\r\n var counter = 0;\r\n\r\n function extend(e) {\r\n var curCount = ++counter;\r\n var cur = posFromMouse(cm, e, true, type == \"rect\");\r\n if (!cur) return;\r\n if (cmp(cur, lastPos) != 0) {\r\n ensureFocus(cm);\r\n extendTo(cur);\r\n var visible = visibleLines(display, doc);\r\n if (cur.line >= visible.to || cur.line < visible.from)\r\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\r\n } else {\r\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\r\n if (outside) setTimeout(operation(cm, function() {\r\n if (counter != curCount) return;\r\n display.scroller.scrollTop += outside;\r\n extend(e);\r\n }), 50);\r\n }\r\n }\r\n\r\n function done(e) {\r\n counter = Infinity;\r\n e_preventDefault(e);\r\n focusInput(cm);\r\n off(document, \"mousemove\", move);\r\n off(document, \"mouseup\", up);\r\n doc.history.lastSelOrigin = null;\r\n }\r\n\r\n var move = operation(cm, function(e) {\r\n if (!e_button(e)) done(e);\r\n else extend(e);\r\n });\r\n var up = operation(cm, done);\r\n on(document, \"mousemove\", move);\r\n on(document, \"mouseup\", up);\r\n }", "function onContextMenu(cm, e) {\n\t\t if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n\t\t if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n\t\t if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n\t\t }", "function mouseDown(e)\n{\n\tmouseClickDown = true;\n\tmouseX = e.clientX;\n\tmouseY = e.clientY;\n}", "function onMouseDown(event) {\n if (scope.enabled === false) return; // Prevent the browser from scrolling.\n\n event.preventDefault(); // Manually set the focus since calling preventDefault above\n // prevents the browser from setting it automatically.\n\n scope.domElement.focus ? scope.domElement.focus() : window.focus();\n var mouseAction;\n\n switch (event.button) {\n case 0:\n mouseAction = scope.mouseButtons.LEFT;\n break;\n\n case 1:\n mouseAction = scope.mouseButtons.MIDDLE;\n break;\n\n case 2:\n mouseAction = scope.mouseButtons.RIGHT;\n break;\n\n default:\n mouseAction = -1;\n }\n\n switch (mouseAction) {\n case _threeModule.MOUSE.DOLLY:\n if (scope.enableZoom === false) return;\n handleMouseDownDolly(event);\n state = STATE.DOLLY;\n break;\n\n case _threeModule.MOUSE.ROTATE:\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n if (scope.enablePan === false) return;\n handleMouseDownPan(event);\n state = STATE.PAN;\n } else {\n if (scope.enableRotate === false) return;\n handleMouseDownRotate(event);\n state = STATE.ROTATE;\n }\n\n break;\n\n case _threeModule.MOUSE.PAN:\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n if (scope.enableRotate === false) return;\n handleMouseDownRotate(event);\n state = STATE.ROTATE;\n } else {\n if (scope.enablePan === false) return;\n handleMouseDownPan(event);\n state = STATE.PAN;\n }\n\n break;\n\n default:\n state = STATE.NONE;\n }\n\n if (state !== STATE.NONE) {\n scope.domElement.ownerDocument.addEventListener('mousemove', onMouseMove, false);\n scope.domElement.ownerDocument.addEventListener('mouseup', onMouseUp, false);\n scope.dispatchEvent(startEvent);\n }\n }", "mousedownHandler(event) {\n\n // Set mouse state\n if (this._state === this.STATE.NONE) {\n this._state = event.button;\n }\n\n this._moveCurr = this.getMouseLocation(event.pageX, event.pageY);\n\n this._canvas.addEventListener('mousemove', this.mousemove);\n this._canvas.addEventListener('mouseup', this.mouseup);\n }", "click(x, y, _isLeftButton) {}", "function rightClick()\n{\n\ttry {\n\t\tvar e = window.event; \n\t\tif(e != null && e.button)\n\t\t{\n\t\t\tif( e.target.parentElement.className.indexOf('haas') == -1 && e.target.parentElement.parentElement.className.indexOf('haas') == -1)\n\t\t\t\ttoggleContextMenu(null);\n\t\t}\n\t} catch(ex) {}\n}", "click(e) {\n this._modifiers(e);\n const _leftClick = Event.isLeftClick(e);\n this.status.button1 = _leftClick;\n this.status.button2 = !_leftClick;\n const [xd, yd] = this.status.mouseDownDiff;\n if (xd > 20 || yd > 20) {\n return true;\n }\n else {\n return this.handleClick(e);\n }\n }", "click(e) {\n this._modifiers(e);\n const _leftClick = Event.isLeftClick(e);\n this.status.button1 = _leftClick;\n this.status.button2 = !_leftClick;\n const [xd, yd] = this.status.mouseDownDiff;\n if (xd > 20 || yd > 20) {\n return true;\n }\n else {\n return this.handleClick(e);\n }\n }", "mouseDown(e){\n if(e.button == 0){\n e.stopPropagation();\n e.preventDefault();\n\n this.set('moveStart', true);\n\n const self = this;\n this.set('mouseMoveListener', function(e){\n if(self.mouseMove){\n self.mouseMove(e);\n }\n });\n\n this.set('mouseUpListener', function(e){\n if(self.mouseUp){\n self.mouseUp(e);\n }\n });\n\n document.addEventListener('mousemove', this.get('mouseMoveListener'));\n document.addEventListener('mouseup', this.get('mouseUpListener'));\n }\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = doc.sel.ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex > -1) {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n } else {\n ourIndex = doc.sel.ranges.length;\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = doc.sel.ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = findWordAt(cm, start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex > -1) {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n } else {\n ourIndex = doc.sel.ranges.length;\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = findWordAt(cm, pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = doc.sel.ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = findWordAt(cm, start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex > -1) {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n } else {\n ourIndex = doc.sel.ranges.length;\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = findWordAt(cm, pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = doc.sel.ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = findWordAt(cm, start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex > -1) {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n } else {\n ourIndex = doc.sel.ranges.length;\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = findWordAt(cm, pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n\t var display = cm.display, doc = cm.doc;\n\t e_preventDefault(e);\n\t\n\t var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n\t if (addNew && !e.shiftKey) {\n\t ourIndex = doc.sel.contains(start);\n\t if (ourIndex > -1)\n\t ourRange = ranges[ourIndex];\n\t else\n\t ourRange = new Range(start, start);\n\t } else {\n\t ourRange = doc.sel.primary();\n\t ourIndex = doc.sel.primIndex;\n\t }\n\t\n\t if (e.altKey) {\n\t type = \"rect\";\n\t if (!addNew) ourRange = new Range(start, start);\n\t start = posFromMouse(cm, e, true, true);\n\t ourIndex = -1;\n\t } else if (type == \"double\") {\n\t var word = cm.findWordAt(start);\n\t if (cm.display.shift || doc.extend)\n\t ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n\t else\n\t ourRange = word;\n\t } else if (type == \"triple\") {\n\t var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n\t if (cm.display.shift || doc.extend)\n\t ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n\t else\n\t ourRange = line;\n\t } else {\n\t ourRange = extendRange(doc, ourRange, start);\n\t }\n\t\n\t if (!addNew) {\n\t ourIndex = 0;\n\t setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n\t startSel = doc.sel;\n\t } else if (ourIndex == -1) {\n\t ourIndex = ranges.length;\n\t setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n\t {scroll: false, origin: \"*mouse\"});\n\t } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n\t setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n\t {scroll: false, origin: \"*mouse\"});\n\t startSel = doc.sel;\n\t } else {\n\t replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n\t }\n\t\n\t var lastPos = start;\n\t function extendTo(pos) {\n\t if (cmp(lastPos, pos) == 0) return;\n\t lastPos = pos;\n\t\n\t if (type == \"rect\") {\n\t var ranges = [], tabSize = cm.options.tabSize;\n\t var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n\t var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n\t var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n\t for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n\t line <= end; line++) {\n\t var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n\t if (left == right)\n\t ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n\t else if (text.length > leftPos)\n\t ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n\t }\n\t if (!ranges.length) ranges.push(new Range(start, start));\n\t setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n\t {origin: \"*mouse\", scroll: false});\n\t cm.scrollIntoView(pos);\n\t } else {\n\t var oldRange = ourRange;\n\t var anchor = oldRange.anchor, head = pos;\n\t if (type != \"single\") {\n\t if (type == \"double\")\n\t var range = cm.findWordAt(pos);\n\t else\n\t var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n\t if (cmp(range.anchor, anchor) > 0) {\n\t head = range.head;\n\t anchor = minPos(oldRange.from(), range.anchor);\n\t } else {\n\t head = range.anchor;\n\t anchor = maxPos(oldRange.to(), range.head);\n\t }\n\t }\n\t var ranges = startSel.ranges.slice(0);\n\t ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n\t setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n\t }\n\t }\n\t\n\t var editorSize = display.wrapper.getBoundingClientRect();\n\t // Used to ensure timeout re-tries don't fire when another extend\n\t // happened in the meantime (clearTimeout isn't reliable -- at\n\t // least on Chrome, the timeouts still happen even when cleared,\n\t // if the clear happens after their scheduled firing time).\n\t var counter = 0;\n\t\n\t function extend(e) {\n\t var curCount = ++counter;\n\t var cur = posFromMouse(cm, e, true, type == \"rect\");\n\t if (!cur) return;\n\t if (cmp(cur, lastPos) != 0) {\n\t cm.curOp.focus = activeElt();\n\t extendTo(cur);\n\t var visible = visibleLines(display, doc);\n\t if (cur.line >= visible.to || cur.line < visible.from)\n\t setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n\t } else {\n\t var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n\t if (outside) setTimeout(operation(cm, function() {\n\t if (counter != curCount) return;\n\t display.scroller.scrollTop += outside;\n\t extend(e);\n\t }), 50);\n\t }\n\t }\n\t\n\t function done(e) {\n\t cm.state.selectingText = false;\n\t counter = Infinity;\n\t e_preventDefault(e);\n\t display.input.focus();\n\t off(document, \"mousemove\", move);\n\t off(document, \"mouseup\", up);\n\t doc.history.lastSelOrigin = null;\n\t }\n\t\n\t var move = operation(cm, function(e) {\n\t if (!e_button(e)) done(e);\n\t else extend(e);\n\t });\n\t var up = operation(cm, done);\n\t cm.state.selectingText = up;\n\t on(document, \"mousemove\", move);\n\t on(document, \"mouseup\", up);\n\t }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc\n e_preventDefault(e)\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start)\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex] }\n else\n { ourRange = new Range(start, start) }\n } else {\n ourRange = doc.sel.primary()\n ourIndex = doc.sel.primIndex\n }\n\n if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n type = \"rect\"\n if (!addNew) { ourRange = new Range(start, start) }\n start = posFromMouse(cm, e, true, true)\n ourIndex = -1\n } else if (type == \"double\") {\n var word = cm.findWordAt(start)\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, word.anchor, word.head) }\n else\n { ourRange = word }\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)))\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, line.anchor, line.head) }\n else\n { ourRange = line }\n } else {\n ourRange = extendRange(doc, ourRange, start)\n }\n\n if (!addNew) {\n ourIndex = 0\n setSelection(doc, new Selection([ourRange], 0), sel_mouse)\n startSel = doc.sel\n } else if (ourIndex == -1) {\n ourIndex = ranges.length\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"})\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"})\n startSel = doc.sel\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)\n }\n\n var lastPos = start\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)) }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false})\n cm.scrollIntoView(pos)\n } else {\n var oldRange = ourRange\n var anchor = oldRange.anchor, head = pos\n if (type != \"single\") {\n var range\n if (type == \"double\")\n { range = cm.findWordAt(pos) }\n else\n { range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) }\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head\n anchor = minPos(oldRange.from(), range.anchor)\n } else {\n head = range.anchor\n anchor = maxPos(oldRange.to(), range.head)\n }\n }\n var ranges$1 = startSel.ranges.slice(0)\n ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect()\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0\n\n function extend(e) {\n var curCount = ++counter\n var cur = posFromMouse(cm, e, true, type == \"rect\")\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt()\n extendTo(cur)\n var visible = visibleLines(display, doc)\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside\n extend(e)\n }), 50) }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false\n counter = Infinity\n e_preventDefault(e)\n display.input.focus()\n off(document, \"mousemove\", move)\n off(document, \"mouseup\", up)\n doc.history.lastSelOrigin = null\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e) }\n else { extend(e) }\n })\n var up = operation(cm, done)\n cm.state.selectingText = up\n on(document, \"mousemove\", move)\n on(document, \"mouseup\", up)\n}", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc\n e_preventDefault(e)\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start)\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex] }\n else\n { ourRange = new Range(start, start) }\n } else {\n ourRange = doc.sel.primary()\n ourIndex = doc.sel.primIndex\n }\n\n if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n type = \"rect\"\n if (!addNew) { ourRange = new Range(start, start) }\n start = posFromMouse(cm, e, true, true)\n ourIndex = -1\n } else if (type == \"double\") {\n var word = cm.findWordAt(start)\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, word.anchor, word.head) }\n else\n { ourRange = word }\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)))\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, line.anchor, line.head) }\n else\n { ourRange = line }\n } else {\n ourRange = extendRange(doc, ourRange, start)\n }\n\n if (!addNew) {\n ourIndex = 0\n setSelection(doc, new Selection([ourRange], 0), sel_mouse)\n startSel = doc.sel\n } else if (ourIndex == -1) {\n ourIndex = ranges.length\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"})\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"})\n startSel = doc.sel\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)\n }\n\n var lastPos = start\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)) }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false})\n cm.scrollIntoView(pos)\n } else {\n var oldRange = ourRange\n var anchor = oldRange.anchor, head = pos\n if (type != \"single\") {\n var range\n if (type == \"double\")\n { range = cm.findWordAt(pos) }\n else\n { range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) }\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head\n anchor = minPos(oldRange.from(), range.anchor)\n } else {\n head = range.anchor\n anchor = maxPos(oldRange.to(), range.head)\n }\n }\n var ranges$1 = startSel.ranges.slice(0)\n ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect()\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0\n\n function extend(e) {\n var curCount = ++counter\n var cur = posFromMouse(cm, e, true, type == \"rect\")\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt()\n extendTo(cur)\n var visible = visibleLines(display, doc)\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside\n extend(e)\n }), 50) }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false\n counter = Infinity\n e_preventDefault(e)\n display.input.focus()\n off(document, \"mousemove\", move)\n off(document, \"mouseup\", up)\n doc.history.lastSelOrigin = null\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e) }\n else { extend(e) }\n })\n var up = operation(cm, done)\n cm.state.selectingText = up\n on(document, \"mousemove\", move)\n on(document, \"mouseup\", up)\n}", "function CALCULATE_TOUCH_DOWN_OR_MOUSE_DOWN() {\r\n \r\nif (GLOBAL_CLICK.CLICK_TYPE == \"right_button\") {\r\n \r\nfor (var x=0;x<HOLDER.length;x++){\r\n \r\n\tif (GET_DISTANCE_FROM_OBJECT.VALUE(x) < HOLDER[x].FI ) {\r\n\t\r\n\tHOLDER[x].FOKUS('R');\r\n HOLDER[x].SHOW_MENU();\r\n GLOBAL_CLICK.CLICK_PRESSED = true;\r\n \r\n E(\"NAME_OF_SELECTED\").value = HOLDER[x].NAME;\r\n E(\"NAME_OF_SELECTED\").dataset.index_ = x;\r\n \r\n VOICE.SPEAK(\"Object \" + HOLDER[x].NAME + \" SELECTED . \");\r\n \r\n }else {\r\n HOLDER[x].HIDE_MENU(x);\r\n }\r\n \r\n}\r\n/////////////\r\n//right\r\n//////////// \r\n}\r\nelse if (GLOBAL_CLICK.CLICK_TYPE == \"left_button\"){\r\n\r\nfor (var x=0;x<HOLDER.length;x++){\r\n if (GET_DISTANCE_FROM_OBJECT.VALUE(x) < HOLDER[x].FI ) {\r\n \r\n\t\r\n\tHOLDER[x].FOKUS('L');\r\n\t HOLDER[x].SHOW_MENU('L');\r\n HOLDER[x].SELECTED = true;\r\n \r\n \r\n \r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = true;\r\n \r\n \r\n \r\n E(\"NAME_OF_SELECTED\").value = HOLDER[x].NAME;\r\n E(\"NAME_OF_SELECTED\").dataset.index_ = x;\r\n \r\n //VOICE.SPEAK(\"Object \" + HOLDER[x].NAME + \" SELECTED . \");\r\n \r\n }else {\r\n \r\n HOLDER[x].HIDE_MENU(x);\r\n \r\n \r\n }\r\n }\r\n}\r\n \r\n\r\n\r\n\r\n\r\n }", "function mousedown(e){\n\t\t// console.log(e);\n\t\tmouseIsDown = true;\n\t}", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\") {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0));\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\") {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0));\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0));\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function mouseevent(e){\n\t// console.log(`Event Type = ${e.type}`);\n}", "function mouseUpEvent(e) {\n\tswitch (e.button) {\n\t\tcase 0:\n\t\t\tleft_click_drag_flag = false;\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tright_click_drag_flag = false;\n\t\t\tbreak;\n\t}\n}", "function onTouchStart(event){\n updateMousePosition(event);\n var newEvent = new Event('mousedown');\n newEvent.which = mouseButton.LEFT;\n onMouseDown(newEvent);\n timer = setTimeout(onLongTouch, touchDuration);\n}" ]
[ "0.7261054", "0.7226753", "0.722626", "0.722626", "0.71976715", "0.71976715", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.7183344", "0.71630836", "0.7156611", "0.71441346", "0.71441346", "0.71441346", "0.71441346", "0.71441346", "0.71441346", "0.71441346", "0.71441346", "0.71441346", "0.71339166", "0.71208864", "0.7085339", "0.7085339", "0.7074897", "0.70657575", "0.7054442", "0.70369154", "0.7024513", "0.7024513", "0.7019126", "0.7004547", "0.6996227", "0.6990917", "0.6956968", "0.69492227", "0.69492227", "0.69492227", "0.69492227", "0.69492227", "0.69492227", "0.69352597", "0.69352597", "0.69206697", "0.6876982", "0.68525374", "0.68525374", "0.68486017", "0.68486017", "0.6793099", "0.6706039", "0.66559637", "0.6645549", "0.66239196", "0.66126394", "0.660728", "0.6604921", "0.6581711", "0.6581711", "0.6581124", "0.6581124", "0.6566847", "0.6566847", "0.65598494", "0.6551046", "0.65495074", "0.65274453", "0.65229034", "0.6508701", "0.64955187", "0.64827424", "0.64827424", "0.64795804", "0.64785635", "0.6477272", "0.6477272", "0.6477272", "0.64728343", "0.64643013", "0.64631283", "0.64631283", "0.64528185", "0.6450133", "0.64471793", "0.64471793", "0.6442469", "0.6435278", "0.6432519", "0.6430725" ]
0.0
-1
This is the handler that captures mousemove events when an element is being dragged. It is responsible for moving the element.
function moveHandler(e) { func_state = state_mouse_move; if (!e) e = window.event; // IE event Model // Move the element to the current mouse position, adjusted by the // position of the scrollbars and the offset of the initial click. var scroll = getScrollOffsets(); var left = (e.clientX + scroll.x - deltaX); var top = (e.clientY + scroll.y - deltaY); elementToDrag.style.left = left + "px"; elementToDrag.style.top = top + "px"; console.log('in moveHandler: %d - %d', left, top); //console.log('element position: %s - %s', elementToDrag.style.left, elementToDrag.style.top); if(out_of_content_row(left, top)){ //left = origX; //top = origY; delete_file(); upHandler(e); } // And don't let anyone else see this event. if (e.stopPropagation) e.stopPropagation(); // Standard else e.cancelBubble = true; // IE clearInterval(timer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveHandler(e) {\n if (!e) e = window.event; // IE event Model\n\n // Move the element to the current mouse position, adjusted by the\n // position of the scrollbars and the offset of the initial click.\n var scroll = lion.getScrollOffsets();\n elementToDrag.style.left = (e.clientX + scroll.x - deltaX) + \"px\";\n elementToDrag.style.top = (e.clientY + scroll.y - deltaY) + \"px\";\n\n // And don't let anyone else see this event.\n if (e.stopPropagation) e.stopPropagation(); // Standard\n else e.cancelBubble = true; // IE\n }", "onElementMouseMove(event) {\n if (this.dragContext) {\n this.updateMove(event.clientX);\n event.preventDefault();\n }\n }", "onElementMouseMove(event) {\n if (this.dragContext) {\n this.updateMove(event.clientX);\n event.preventDefault();\n }\n }", "onElementMouseMove(event) {}", "onElementMouseMove(event) {\n if (this.dragContext) {\n this.updateMove(event.clientX);\n event.preventDefault();\n }\n }", "function moveHandler(e) {\n if (!e) e = window.event; // IE event Model\n\n if (e.touches && e.touches.length > 1) upHandler(e); //if at any point there are two fingers on screen stop the move\n \n // Move the element to the current mouse position, adjusted by the\n // position of the scrollbars and the offset of the initial click.\n var scroll = getScrollOffsets();\n var newLeft;\n if (options.axis == null || options.axis === 'x') newLeft = ((e.clientX || event.targetTouches[0].clientX) + scroll.x - deltaX);\n else newLeft = parseFloat(elementToDrag.style.left);\n\n var newTop;\n if (options.axis == null || options.axis === 'y') newTop = ((e.clientY || event.targetTouches[0].clientY) + scroll.y - deltaY);\n else newTop = parseFloat(elementToDrag.style.top);\n\n //check if new location is in containment\n if(newLeft < options.containment[0] || newLeft > options.containment[2] || newTop < options.containment[1] || newTop > options.containment[3])\n return;\n\n elementToDrag.style.left = newLeft + \"px\";\n elementToDrag.style.top = newTop + \"px\";\n // don't let anyone else see this event.\n if (e.stopPropagation) e.stopPropagation(); // Standard\n else e.cancelBubble = true; // IE\n \n if (event.preventDefault) event.preventDefault(); // Standard model\n else event.returnValue = false; // IE\n \n if(options.drag) options.drag(e, e.target);\n }", "function moveHandler(e){\n if(!e) e=window.event;\n elementToDrag.style.left=(e.clientX-deltaX)+\"px\";\n elementToDrag.style.top=(e.clientY-deltaY)+\"px\";\n\n if(e.stopPropagation) e.stopPropagation();\n else e.cancelBubble=true;\n }", "onElementMouseMove(event) {\n // Keep track of the last mouse position in case, due to OSX sloppy focusing,\n // focus is moved into the browser before a mousedown is delivered.\n // The cached mousemove event will provide the correct target in\n // GridNavigation#onGridElementFocus.\n this.mouseMoveEvent = event;\n }", "function DIF_mouseMove(e) {\n if (DIF_dragging) {\n var pos = DIF_getEventPosition(e);\n DIF_drag(pos.x - DIF_pageMouseDownLeft[DIF_iframeBeingDragged], pos.y - DIF_pageMouseDownTop[DIF_iframeBeingDragged]);\n }\n}", "function mouseMoveHandler(e) {\n updateFromEvent(e);\n move(mouseX, mouseY);\n }", "moveHandler(event) {\n\n //Get the element that's firing the event\n let element = event.target;\n\n //Find the pointer’s x and y position (for mouse).\n //Subtract the element's top and left offset from the browser window\n this._x = (event.pageX - element.offsetLeft);\n this._y = (event.pageY - element.offsetTop);\n\n //Prevent the event's default behavior \n event.preventDefault();\n }", "function handleDrag ( event /*: JQueryEventObject */ ) {\n var dx = event.pageX - $element[0].dragData.lastX,\n dy = event.pageY - $element[0].dragData.lastY,\n dleft = dx, dtop = dy, dright = dx, dbottom = dy;\n if ( $element[0].dragData.type != 4 ) {\n if ( $element[0].dragData.type > 2 ) dtop = 0;\n if ( $element[0].dragData.type < 6 ) dbottom = 0;\n if ( $element[0].dragData.type % 3 > 0 ) dleft = 0;\n if ( $element[0].dragData.type % 3 < 2 ) dright = 0;\n }\n reposition( dleft, dtop, dright, dbottom );\n $element[0].dragData.lastX = event.pageX;\n $element[0].dragData.lastY = event.pageY;\n }", "function mousemoveHandler ( event /*: JQueryEventObject */ ) {\n if ( $element.hasClass( pausedDragSelectClass ) ) return;\n if ( !$element.hasClass( SELECTED_FOR_DRAGGING_CLASS ) ) {\n $element.css( { cursor : 'default' } );\n return;\n }\n switch ( eventToCellNumber( event, $element[0] ) ) {\n case 0 : case 8 : $element.css( { cursor : 'nwse-resize' } ); break;\n case 1 : case 7 : $element.css( { cursor : 'ns-resize' } ); break;\n case 2 : case 6 : $element.css( { cursor : 'nesw-resize' } ); break;\n case 3 : case 5 : $element.css( { cursor : 'ew-resize' } ); break;\n case 4 : $element.css( { cursor : 'move' } ); break;\n default : $element.css( { cursor : 'default' } );\n }\n }", "function elementDrag(e) {\n e = e || window.event;\n // Calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos2 = pos4 - e.clientY;\n pos3 = e.clientX;\n pos4 = e.clientY;\n // Set the element's new position:\n divCont.style.marginLeft = divCont.offsetLeft - _self._ratio * pos1 + \"px\";\n divCont.style.marginTop = divCont.offsetTop - _self._ratio * pos2 + \"px\";\n }", "function moveHandler(e) \n\t{\n\t\t\n\t\tme.style.cursor = \"move\"; \n\t\t\n\t\tif (!e) e = window.event; // IE Event Model\n\t\t\n\t\t// Move the element to the current mouse position, adjusted as\n\t\t// necessary by the offset of the initial mouse-click.\n\t\tme.style.left = (e.clientX - deltaX) + \"px\";\n\t\tme.style.top = (e.clientY - deltaY) + \"px\";\n\t\t\n\t\t// And don't let anyone else see this event.\n\t\tif (e.stopPropagation) e.stopPropagation( ); // DOM Level 2\n\t\telse e.cancelBubble = true; // IE\n\t}", "onPointerMove(e) {\n\t\tif (this.mouseMoved < dragThreshold) {\n\t\t\tthis.mouseMoved += 1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!draggingEl) {\n\t\t\temit(this.el, 'dragstart');\n\n\t\t\tdraggingEl = this.el;\n\t\t\tthis.$clonedEl = createDragShadow(this.el, this.shadowClass);\n\n\t\t\t// for auto-scroll\n\t\t\tthis.scrollParent.addEventListener(events.enter, this.onPointerEnter, { passive: true });\n\t\t\tthis.scrollParent.addEventListener(events.leave, this.onPointerLeave, { passive: true });\n\t\t\tthis.onPointerEnter();\n\t\t}\n\n\t\tthis.$clonedEl.moveTo(e);\n\t\temit(this.el, 'drag');\n\n\t\t// for auto-scroll\n\t\tconst scrollRect = this.scrollParent.getBoundingClientRect();\n\t\t// is the mouse closer to the top or bottom edge of the scroll parent?\n\t\tconst topDist = Math.abs(scrollRect.top - e.clientY);\n\t\tconst bottomDist = Math.abs(scrollRect.bottom - e.clientY);\n\t\t// should we scroll up, or down?\n\t\tconst speedDirection = topDist < bottomDist ? -1 : 1;\n\t\t// should we scroll at 3px per frame, or 0px per frame (i.e. pause auto-scroll)?\n\t\tconst speedMagnitude = Math.min(topDist, bottomDist) < 40 ? 3 : 0;\n\t\tthis.scrollSpeed = speedDirection * speedMagnitude;\n\t}", "function DIF_mousemove(e) {\r\n\tif (DIF_dragging) {\r\n\t\tvar pos = {x: e.pageX, y: e.pageY};\r\n\t\tDIF_drag(pos.x - DIF_pageMouseDownLeft[DIF_iframeBeingDragged] , pos.y - DIF_pageMouseDownTop[DIF_iframeBeingDragged]);\r\n\t}\r\n}", "onMouseMove (e) {\n let event = 'mouse-move';\n if (this.isMouseDown) {\n event = 'mouse-drag';\n }\n\n this.emit(event, normaliseMouseEventToElement(this.canvas, e));\n }", "function onMouseMoveEventOnHandler(ev){\n if(WorkStore.isSelected()) return;\n\n window.addEventListener(MOUSE_DOWN, onMouseDownHandler);\n document.body.classList.add(\"drag\");\n}", "captureMouseMoves(/*object*/ event) {\n if (!this._eventMoveToken && !this._eventUpToken) {\n this._eventMoveToken = EventListener.listen(\n this._domNode,\n 'mousemove',\n this._onMouseMove\n );\n this._eventUpToken = EventListener.listen(\n this._domNode,\n 'mouseup',\n this._onMouseUp\n );\n }\n\n if (!this._isDragging) {\n this._deltaX = 0;\n this._deltaY = 0;\n this._isDragging = true;\n this._x = event.clientX;\n this._y = event.clientY;\n }\n event.preventDefault();\n }", "_moveHandler() {\n if (this.hasAttribute('dragged') && JQX.Utilities.Core.isMobile) {\n event.originalEvent.preventDefault();\n }\n }", "handleMouseDown(e) {\n this.start = pos(e);\n this.w0 = this.state.w;\n d.addEventListener('mousemove', this.handleDrag)\n d.addEventListener('mouseup', this.handleMouseUp.bind(this))\n }", "function dragMoveListener (event) {\n var target = event.target,\n // keep the dragged position in the data-x/data-y attributes\n x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx,\n y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy;\n\n\t// translate the element\n\ttarget.style.webkitTransform =\n\ttarget.style.transform =\n\t 'translate(' + x + 'px, ' + y + 'px)';\n\n\t// update the posiion attributes\n\ttarget.setAttribute('data-x', x);\n\ttarget.setAttribute('data-y', y);\n}", "onMouseDrag(e) {}", "function reactionMouseMove (e) { \r\n if (!drag) return; // Abbrechen, falls Zugmodus nicht aktiviert\r\n reactionMove(e.clientX,e.clientY); // Position ermitteln, rechnen und neu zeichnen\r\n }", "function reactionMouseMove (e) { \r\n if (!drag) return; // Abbrechen, falls Zugmodus nicht aktiviert\r\n reactionMove(e.clientX,e.clientY); // Position ermitteln, rechnen und neu zeichnen \r\n }", "function dragMouse(e) {\n console.log('dragMouse');\n e = e || window.event;\n // calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos2 = pos4 - e.clientY;\n pos3 = e.clientX;\n pos4 = e.clientY;\n // set the element's new position:\n elem.style.top = (elem.offsetTop - pos2) + \"px\";\n elem.style.left = (elem.offsetLeft - pos1) + \"px\";\n }", "dragMove(event) {\n\t\tif (!this.isDrag) return false;\n\t\tif (this.isDrag) {\n\t\t\t// make cursor change to grabbing\n\t\t\tthis.slider.classList.add('grabbing')\n\t\t\t// Get the mouse or finger X position\n\t\t\tlet clientX = this.getClientX(event);\n\t\t\tlet moved = this.reference - clientX;\n\t\t\tthis.reference = clientX;\n\t\t\tthis.direction = (moved > 0) ? 1 : (moved < 0) ? -1 : 0;\n\t\t\tthis.scroll(this.direction, this.scrollOffset + moved);\n\t\t}\n\n\t}", "function _onDocumentMouseMove(e) {\r\n var pointerId = Utils.getPointerId(e),\r\n item = clones.get(pointerId);\r\n if (item) {\r\n item.clientX = e.clientX;\r\n item.clientY = e.clientY;\r\n if (item.pointerId === pointerId) {\r\n _preventDefault(e);\r\n frameId = Gestures.getAnimationFrame(frameId, _setPositions);\r\n item.updateIntersection(e);\r\n } else if (Math.abs(item.startPosition.x - e.clientX) > self.dragOffset || Math.abs(item.startPosition.y - e.clientY) > self.dragOffset) {\r\n _preventDefault(e);\r\n item.dispatchDragStart();\r\n item.pointerId = pointerId;\r\n frameId = Gestures.getAnimationFrame(frameId, _setPositions); // apply current position to prevent jumping on rotated elements\r\n document.body.append(item.clone);\r\n }\r\n }\r\n }", "function reactionMouseMove (e) { \n if (!drag) return; // Abbrechen, falls Zugmodus nicht aktiviert\n reactionMove(e.clientX,e.clientY); // Position ermitteln, rechnen und neu zeichnen\n }", "function reactionMouseMove (e) { \n if (!drag) return; // Abbrechen, falls Zugmodus nicht aktiviert\n reactionMove(e.clientX,e.clientY); // Position ermitteln, rechnen und neu zeichnen\n }", "function dragMoveListener(event) {\n\tvar target = event.target,\n\t// keep the dragged position in the data-x/data-y attributes\n\tx = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx,\n\ty = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy;\n\n\ttarget.style.opacity = \"0.4\";\n\t$('.window-element').find('iframe').hide();\n\n\t// translate the element\n\ttarget.style.webkitTransform =\n\t\ttarget.style.transform =\n\t\t'translate(' + x + 'px, ' + y + 'px)';\n\n\t// update the posiion attributes\n\ttarget.setAttribute('data-x', x);\n\ttarget.setAttribute('data-y', y);\n\n}", "function movable_div_MDown_handler (event) {\n\n \"use strict\";\n\n movable_div_initiate_move (this, event.clientX, event.clientY);\n\n // in order to never lose events while dragging, we now \"capture\" the mouse by registering global event handlers (at the document level).\n\n bfd_parent_document.addEventListener (\"mousemove\", this.onmousemoveCallback, false);\n bfd_parent_document.addEventListener (\"mouseup\", this.onmouseupCallback, false);\n if (bfd_parent_document !== bfd_network_document) bfd_network_document.addEventListener (\"mousemove\", this.onmousemoveCallback, false);\n if (bfd_parent_document !== bfd_network_document) bfd_network_document.addEventListener (\"mouseup\", this.onmouseupCallback, false);\n\n return false;\n}", "onElementTouchMove(event) {\n if (this.dragContext) {\n this.updateMove(event.touches[0].clientX);\n event.preventDefault();\n }\n }", "onElementTouchMove(event) {\n if (this.dragContext) {\n this.updateMove(event.touches[0].clientX);\n event.preventDefault();\n }\n }", "function TreeGrid_Sizer_Drag_OnMove(event)\n{\n\t//block the event\n\tBrowser_BlockEvent(event);\n\t//get current position\n\tvar currentPos = Browser_GetScreenCoordinates(event);\n\t//Calculate the modifier\n\tvar nModifier = currentPos.x - __DRAG_DATA.StartPosition.x;\n\t//trigger resize\n\tTreeGrid_Resize(__DRAG_DATA.Sizer.UIDObject, nModifier);\n}", "function eventMouseMove(e) {\n\n //move the box based on the mouse X and Y\n movePiece(e.offsetX, e.offsetY);\n\n }", "function Mousemove(e,target) {\n\t\t\tif(isDrag==true)\n\t\t\t{\n\t\t\t\t//prevent default event\n\t\t\t\te.preventDefault();\n\n\t\t\t\t//trace mouse\n\t\t\t\t$(target).css({\"top\":e.pageY - y + \"px\",\"left\":e.pageX - x + \"px\"});\n\t\t\t\t\n\t\t\t\t//mouse up or mouse leave event\n\t\t\t\t$(frameDocument).off(\"mouseup\").on(\"mouseup\",target,function(e){Mouseup(e,target)});\n\t\t\t\t$(frameDocument).off(\"mouseleave\").on(\"mouseleave\",target,function(e){Mouseup(e,target)});\n\t\t\t}\n\t\t}", "onMouseMove(e) {\n // if we are not dragging, we don't do nothing\n if(!this.isMouseDown) return;\n\n // get our touch/mouse position\n var mousePosition = this.getMousePosition(e);\n\n // get our current position\n this.currentPosition = this.endPosition + ((mousePosition[this.direction] - this.startPosition) * this.options.dragSpeed);\n\n // if we're not hitting the boundaries\n if(this.currentPosition > this.boundaries.min && this.currentPosition < this.boundaries.max) {\n // if we moved that means we have started translating the slider\n this.isTranslating = true;\n }\n else {\n // clamp our current position with boundaries\n this.currentPosition = Math.min(this.currentPosition, this.boundaries.min);\n this.currentPosition = Math.max(this.currentPosition, this.boundaries.max);\n }\n\n // drag hook\n this.onDrag(mousePosition);\n }", "function mouse_move_handler(e) {\n\tvar evn;\n\tevn = e || event;\n\tif (is_drag) {\n\t\t$(\"#\" + maskName).show();\n\t\tdrag_clone.style[\"visibility\"] = \"visible\";\n\t\tvar y = evn.clientY\n\t\t\t\t+ document.getElementsByTagName('html')[0].scrollTop;\n\t\t\n\t\tvar browser = navigator.userAgent.toLowerCase();\n\t\tif (window.chrome != null || browser.indexOf('safari') > -1) {\n\t\t\t// if chrome or safari, add window's scrollTop()\n\t\t\ty = y + $(window).scrollTop();\n\t\t}\n\n\t\tdrag_clone.style[\"top\"] = (y - 5) + \"px\";\n\t\tdrag_clone.style[\"left\"] = (evn.clientX - 5) + \"px\";\n\t}\n\treturn false;\n}", "function moveHandler(e) \n { // ejf Nov 4, 2010. Now the virtual doesn't go off to the left or top\n // It can still go off the bottom or right. \n if (!e) e = window.event; // IE Event Model\n var xnew = (e.clientX - deltaX); var ynew = (e.clientY - deltaY);\n if ((xnew > 0) && (ynew > 0)) {\n elementToDrag.style.left = (e.clientX - deltaX) + \"px\";\n elementToDrag.style.top = (e.clientY - deltaY) + \"px\";\n \n if (e.stopPropagation) e.stopPropagation(); // DOM Level 2\n else e.cancelBubble = true; // IE\n }\n }", "function mouseMoveHandler(event){\n\t\t\tif(event.pageX == null && event.clientX != null){\n\t\t\t\tvar de = document.documentElement, b = document.body;\n\t\t\t\tlastMousePos.pageX = event.clientX + (de && de.scrollLeft || b.scrollLeft || 0);\n\t\t\t\tlastMousePos.pageY = event.clientY + (de && de.scrollTop || b.scrollTop || 0);\n\t\t\t}else{\n\t\t\t\tlastMousePos.pageX = event.pageX;\n\t\t\t\tlastMousePos.pageY = event.pageY;\n\t\t\t}\n\t\t\t\n\t\t\tvar offset = overlay.cumulativeOffset();\n\t\t\tvar pos = {\n\t\t\t\tx: xaxis.min + (event.pageX - offset.left - plotOffset.left) / hozScale,\n\t\t\t\ty: yaxis.max - (event.pageY - offset.top - plotOffset.top) / vertScale\n\t\t\t};\n\t\t\t\n\t\t\tif(options.mouse.track && selectionInterval == null){\t\t\t\t\n\t\t\t\thit(pos);\n\t\t\t}\n\t\t\t\n\t\t\ttarget.fire('flotr:mousemove', [event, pos]);\n\t\t}", "function dragElement( event ) {\r\n xPosition = document.all ? window.event.clientX : event.pageX;\r\n yPosition = document.all ? window.event.clientY : event.pageY;\r\n if ( selected !== null ) {\r\n selected.style.left = ((xPosition - xElement) + selected.offsetWidth / 2) + 'px';\r\n selected.style.top = ((yPosition - yElement) + selected.offsetHeight / 2) + 'px';\r\n }\r\n }", "function gestureMove(ev){if(!pointer||!typesMatch(ev,pointer))return;updatePointerState(ev,pointer);runHandlers('move',ev);}", "function mouse_move_handler(e) {\n //Saves the previous coordinates\n mouse.px = mouse.x;\n mouse.py = mouse.y;\n\n //Sets the new coordinates\n mouse.x = e.offsetX || e.layerX;\n mouse.y = e.offsetY || e.layerY;\n }", "function drag(elementToDrag, event) \n {\n if (!event)\n event = window.event;\n var startX = event.clientX, startY = event.clientY; \n var origX = elementToDrag.offsetLeft, origY = elementToDrag.offsetTop;\n var deltaX = startX - origX, deltaY = startY - origY;\n if (document.addEventListener) // DOM Level 2 event model\n { \n document.addEventListener(\"mousemove\", moveHandler, true);\n document.addEventListener(\"mouseup\", upHandler, true);\n }\n else if (document.attachEvent) // IE 5+ Event Model\n { \n elementToDrag.setCapture();\n elementToDrag.attachEvent(\"onmousemove\", moveHandler);\n elementToDrag.attachEvent(\"onmouseup\", upHandler);\n elementToDrag.attachEvent(\"onlosecapture\", upHandler);\n }\n else // IE 4 Event Model\n { \n var oldmovehandler = document.onmousemove; // used by upHandler() \n var olduphandler = document.onmouseup;\n document.onmousemove = moveHandler;\n document.onmouseup = upHandler;\n }\n\n // We've handled this event. Don't let anybody else see it. \n if (event.stopPropagation) event.stopPropagation(); // DOM Level 2\n else event.cancelBubble = true; // IE\n\n // Now prevent any default action.\n if (event.preventDefault) event.preventDefault(); // DOM Level 2\n else event.returnValue = false; // IE\n\n /**\n * This is the handler that captures mousemove events when an element\n * is being dragged. It is responsible for moving the element.\n **/\n function moveHandler(e) \n { // ejf Nov 4, 2010. Now the virtual doesn't go off to the left or top\n // It can still go off the bottom or right. \n if (!e) e = window.event; // IE Event Model\n var xnew = (e.clientX - deltaX); var ynew = (e.clientY - deltaY);\n if ((xnew > 0) && (ynew > 0)) {\n elementToDrag.style.left = (e.clientX - deltaX) + \"px\";\n elementToDrag.style.top = (e.clientY - deltaY) + \"px\";\n \n if (e.stopPropagation) e.stopPropagation(); // DOM Level 2\n else e.cancelBubble = true; // IE\n }\n }\n \n /**\n * This is the handler that captures the final mouseup event that\n * occurs at the end of a drag.\n **/\n function upHandler(e) \n {\n if (!e) e = window.event; // IE Event Model\n if (document.removeEventListener) // DOM event model\n { \n document.removeEventListener(\"mouseup\", upHandler, true);\n document.removeEventListener(\"mousemove\", moveHandler, true);\n }\n else if (document.detachEvent) // IE 5+ Event Model\n { \n elementToDrag.detachEvent(\"onlosecapture\", upHandler);\n elementToDrag.detachEvent(\"onmouseup\", upHandler);\n elementToDrag.detachEvent(\"onmousemove\", moveHandler);\n elementToDrag.releaseCapture();\n }\n else // IE 4 Event Model\n { \n document.onmouseup = olduphandler;\n document.onmousemove = oldmovehandler;\n }\n\n // And don't let the event propagate any further.\n if (e.stopPropagation) e.stopPropagation(); // DOM Level 2\n else e.cancelBubble = true; // IE\n }\n }", "fireMouseMoved(event) {\n handleLinkDrag.call(this, event, this.link);\n }", "function drag(e) {\n if (active) { //check whether the drag is active\n \n //tell the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be (MDN)\n e.preventDefault();\n \n //set the value of currentX and currentY to the result of the current pointer position with an adjustment from initialX and initialY\n if (e.type === \"touchmove\") {\n currentX = e.touches[0].clientX - initialX;\n currentY = e.touches[0].clientY - initialY;\n } else {\n currentX = e.clientX - initialX;\n currentY = e.clientY - initialY;\n }\n\n //set the new Offset\n xOffset = currentX;\n yOffset = currentY;\n\n //set the new position for our dragged element\n setTranslate(currentX, currentY, dragItem);\n }\n }", "onElementTouchMove(event) {\n if (this.dragContext) {\n this.updateMove(event.touches[0].clientX);\n event.preventDefault();\n }\n }", "function onMouseMove(e) {\n\t\n\t\t\t// propagate the event to the callback with x,y coords\n\t\t\tmouseMoveCB(e, translateMouseCoords(e.clientX, e.clientY));\n\n\t\t}", "function handler(event) {\n var elem = this, returned, data = event.data || {};\n // mousemove or mouseup\n if (data.elem) {\n // update event properties...\n elem = event.dragTarget = data.elem; // drag source element\n event.dragProxy = drag.proxy || elem; // proxy element or source\n event.cursorOffsetX = data.pageX - data.left; // mousedown offset\n event.cursorOffsetY = data.pageY - data.top; // mousedown offset\n event.offsetX = event.pageX - event.cursorOffsetX; // element offset\n event.offsetY = event.pageY - event.cursorOffsetY; // element offset\n }\n // mousedown, check some initial props to avoid the switch statement\n else if (drag.dragging || (data.which > 0 && event.which != data.which) ||\n $(event.target).is(data.not)) return;\n // handle various events\n switch (event.type) {\n // mousedown, left click, event.target is not restricted, init dragging\n case 'mousedown':\n $.extend(data, $(elem).offset(), {\n elem: elem, target: event.target,\n pageX: event.pageX, pageY: event.pageY\n }); // store some initial attributes\n $event.add(document, \"mousemove mouseup\", handler, data);\n selectable(elem, false); // disable text selection\n drag.dragging = null; // pending state\n break; // prevents text selection in safari\n // mousemove, check distance, start dragging\n case !drag.dragging && 'mousemove':\n if (squared(event.pageX - data.pageX)\n + squared(event.pageY - data.pageY) // x² + y² = distance²\n < data.distance) break; // distance tolerance not reached\n event.target = data.target; // force target from \"mousedown\" event (fix distance issue)\n returned = hijack(event, \"dragstart\", elem); // trigger \"dragstart\", return proxy element\n if (returned !== false) { // \"dragstart\" not rejected\n drag.dragging = elem; // activate element\n drag.proxy = event.dragProxy = $(returned || elem)[0]; // set proxy\n }\n // mousemove, dragging\n case 'mousemove':\n if (drag.dragging) {\n returned = hijack(event, \"drag\", elem); // trigger \"drag\"\n if (data.drop && $special.drop) { // manage drop events\n $special.drop.allowed = (returned !== false); // prevent drop\n $special.drop.handler(event); // \"dropstart\", \"dropend\"\n }\n if (returned !== false) break; // \"drag\" not rejected, stop\n event.type = \"mouseup\"; // helps \"drop\" handler behave\n }\n // mouseup, stop dragging\n case 'mouseup':\n $event.remove(document, \"mousemove mouseup\", handler); // remove page events\n if (drag.dragging) {\n if (data.drop && $special.drop) $special.drop.handler(event); // \"drop\"\n hijack(event, \"dragend\", elem); // trigger \"dragend\"\n }\n selectable(elem, true); // enable text selection\n drag.dragging = drag.proxy = data.elem = false; // deactivate element\n break;\n }\n }", "function dragElement(elmnt) {\n var pos1 = 0; pos2 = 0; pos3 = 0; pos4 = 0;\n document.getElementById(elmnt.id + \"Mover\").onmousedown = dragMouseDown;\n function dragMouseDown(e) {\n e = e || window.event;\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n pos4 = e.clientY;\n document.onmouseup = closeDragElement;\n // call a function whenever the cursor moves:\n document.onmousemove = elementDrag;}\n function elementDrag(e) {\n e = e || window.event;\n // calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos2 = pos4 - e.clientY;\n pos3 = e.clientX;\n pos4 = e.clientY;\n // set the element's new position:\n elmnt.style.top = (elmnt.offsetTop - pos2) + \"px\";\n elmnt.style.left = (elmnt.offsetLeft - pos1) + \"px\";}\n function closeDragElement() {\n /* stop moving when mouse button is released:*/\n document.onmouseup = null;\n document.onmousemove = null;}}", "function onMouseMove(event)\n{\n if (dragging)\n {\n var pos = getRelative(event);\n var deltaX = mouseDragStartX - pos.x;\n var deltaY = mouseDragStartY - pos.y;\n if (!isNaN(deltaX) && !isNaN(deltaY)) // check if mouse is inside div element\n {\n camRotationY += deltaX;\n camRotationX += deltaY;\n mouseDragStartX = pos.x;\n mouseDragStartY = pos.y;\n }\n }\n}", "function mouseMoveHandler(e) {\r\n\tif (!e) {\r\n\t\te = event;\r\n\t}\r\n\tif (e.clientX) {\r\n\t //if there is an x pos property\r\n\t //GET MOUSE LOCATION\r\n\t\tv_xcoordinate = mouseX(e);\r\n\t\tv_ycoordinate = mouseY(e);\t\r\n\t\tv_havemouse = 1;\r\n\t}\r\n\tif (v_visible == 1) { \r\n\t\tpositionLayer();\t\r\n\t}\r\n}", "function dragHandler(event) {\n\tvar resultContainer = this;\n var x = event.clientX - this.offsetLeft;\n var y = event.clientY - this.offsetTop;\n document.onmousemove = function(event) {\n\t\t//calculate gap between the content box and window\n var l = event.clientX - x;\n var t = event.clientY - y;\n if(l < 0) {\n l = 0;\n } else if(l > document.documentElement.clientWidth - resultContainer.offsetWidth) {\n l = document.documentElement.clientWidth - resultContainer.offsetWidth;\n }\n if(t < 0) {\n t = 0;\n } else if(t > document.documentElement.clientHeight - resultContainer.offsetHeight) {\n t = document.documentElement.clientHeight - resultContainer.offsetHeight;\n }\n resultContainer.style.left = l + \"px\";\n resultContainer.style.top = t + \"px\";\n }\n document.onmouseup = function() {\n\t\tchrome.runtime.sendMessage({ type: \"remember_this\",\n\t\t\tx: resultContainer.style.left, y: resultContainer.style.top });\n document.onmousemove = null;\n document.onmouseup = null;\n }\n}", "function listenDrag(e){\n // prevent browser dragging\n S.lib.preventDefault(e);\n\n var coords = S.lib.getPageXY(e);\n drag.start_x = coords[0];\n drag.start_y = coords[1];\n\n draggable = U.get(S.contentId());\n S.lib.addEvent(document, 'mousemove', positionDrag);\n S.lib.addEvent(document, 'mouseup', unlistenDrag);\n\n if(S.client.isGecko)\n U.get(drag_id).style.cursor = '-moz-grabbing';\n }", "function onMouseMove(e) {\n\t\tconst currentX = e.clientX;\n\t\tconst currentY = e.clientY;\n\n\t\tdelta.x = currentX - drag.x;\n\t\tdelta.y = currentY - drag.y;\n\n\t\tconst offsetLeft = element.offsetLeft;\n\t\tconst offsetTop = element.offsetTop;\n\n\n\t\tconst first = document.getElementById(\"objectpanel\");\n\t\tconst second = document.getElementById(\"canvaspanel\");\n\t\tlet firstWidth = first.offsetWidth;\n\t\tlet secondWidth = second.offsetWidth;\n\t\tif (direction === \"H\") // Horizontal\n\t\t{\n\t\t\telement.style.left = offsetLeft + delta.x + \"px\";\n\t\t\tfirstWidth += delta.x;\n\t\t\tsecondWidth -= delta.x;\n\t\t}\n\t\tdrag.x = currentX;\n\t\tdrag.y = currentY;\n\t\tfirst.style.width = firstWidth + \"px\";\n\t\tsecond.style.width = secondWidth + \"px\";\n\t}", "_addDragEvent() {\n this.pointer.addEventListener('mousedown', event => {\n this.firstPosition = event.screenX;\n this.firstLeft = toInteger(this.pointer.style.left) || 0;\n this.dragEventHandler = {\n changeAngle: this._changeAngle.bind(this),\n stopChangingAngle: this._stopChangingAngle.bind(this)\n };\n\n document.addEventListener('mousemove', this.dragEventHandler.changeAngle);\n document.addEventListener('mouseup', this.dragEventHandler.stopChangingAngle);\n });\n }", "dragMove(event) {\n\t\tif (!this.isDrag) return false;\n\t\tif (this.isDrag) {\n\t\t\t// Get the mouse or finger X position\n\t\t\tlet clientX = this.getClientX(event);\n\t\t\tthis.moved = this.reference - clientX;\n\t\t\tthis.reference = clientX;\n\t\t\tthis.direction = (this.moved > 0) ? 1 : -1;\n\t\t\tthis.scroll(this.direction, this.scrollOffset + this.moved);\n\t\t}\n\n\t}", "_handleMouseMove(x, y) {\n this._findNewFocus(x, y);\n this._debugHighlight();\n const _mouseMoveHandled = this._delegateMouseMove(x, y);\n const _currentlyDragging = this._delegateDrag(x, y);\n return (_mouseMoveHandled || _currentlyDragging);\n }", "_handleMouseMove(x, y) {\n this._findNewFocus(x, y);\n this._debugHighlight();\n const _mouseMoveHandled = this._delegateMouseMove(x, y);\n const _currentlyDragging = this._delegateDrag(x, y);\n return (_mouseMoveHandled || _currentlyDragging);\n }", "function dragMove (e) {\n e.preventDefault();\n if (e.originalEvent) e = e.originalEvent;\n var movedX, movedY, relX, relY,\n clientX = isTouch ? e.touches[0].pageX : e.clientX,\n clientY = isTouch ? e.touches[0].pageY : e.clientY;\n if (!restrictX) {\n // Mouse movement (x axis) in px\n movedX = clientX - posX;\n // New pixel value (x axis) of element\n newX = relativeX + movedX;\n if (newX >= limitsX[0] && newX <= limitsX[1]) {\n posX = clientX;\n relativeX = newX;\n }\n else if (newX < limitsX[0]) {\n relativeX = limitsX[0];\n }\n else if (newX > limitsX[1]) {\n relativeX = limitsX[1];\n }\n }\n if (!restrictY) {\n movedY = clientY - posY;\n newY = relativeY + movedY;\n if (newY >= limitsY[0] && newY <= limitsY[1]) {\n posY = clientY;\n relativeY = newY;\n }\n else if (newY < limitsY[0]) {\n relativeY = limitsY[0];\n }\n else if (newY > limitsY[1]) {\n relativeY = limitsY[1];\n }\n }\n self.draggy.position = self.position = [relativeX, relativeY];\n self.style.cssText = transform.pre + relativeX + 'px,' + relativeY + 'px' + transform.post;\n self.onChange(relativeX, relativeY);\n $(self).trigger('onDrag');\n }", "function mouseDragged(){\r\n inputForMDragging(mouseX, mouseY);\r\n\r\n\r\n}", "function mousemove(e){\n\t\t// console.log(e);\n\t}", "function dragMove (e) {\n e.preventDefault();\n var movedX, movedY, relX, relY,\n clientX = isTouch ? e.touches[0].pageX : e.clientX,\n clientY = isTouch ? e.touches[0].pageY : e.clientY;\n if (!restrictX) {\n // Mouse movement (x axis) in px\n movedX = clientX - posX;\n // New pixel value (x axis) of element\n newX = relativeX + movedX;\n if (newX >= limitsX[0] && newX <= limitsX[1]) {\n posX = clientX;\n relativeX = newX;\n }\n else if (newX < limitsX[0]) {\n relativeX = limitsX[0];\n }\n else if (newX > limitsX[1]) {\n relativeX = limitsX[1];\n }\n }\n if (!restrictY) {\n movedY = clientY - posY;\n newY = relativeY + movedY;\n if (newY >= limitsY[0] && newY <= limitsY[1]) {\n posY = clientY;\n relativeY = newY;\n }\n else if (newY < limitsY[0]) {\n relativeY = limitsY[0];\n }\n else if (newY > limitsY[1]) {\n relativeY = limitsY[1];\n }\n }\n self.draggy.position = self.position = [relativeX, relativeY];\n stylar(self).set('transform', 'translate(' + relativeX + 'px,' + relativeY + 'px)');\n self.onChange(relativeX, relativeY);\n self.dispatchEvent(onDrag);\n }", "onDragMove(e) {\n if (this.dragging) {\n let value = (mousePosition.x - this.position.x*2)/this.width;\n this.setValue(value)\n this.dragFunction();\n }\n }", "function onMousemoveNodeHandler(d) {\r\n\t\t\t\t\t\t\toCtrl.fireHover(d);\r\n\t\t\t\t\t\t\t// console.log('onMousemoveNodeHandler: pos X '+ d.x\r\n\t\t\t\t\t\t\t// + \" pos Y \" + d.y);\r\n\t\t\t\t\t\t}", "function UltraGrid_Sizer_Drag_OnMove(event)\n{\n\t//block the event\n\tBrowser_BlockEvent(event);\n\t//get current position\n\tvar currentPos = Browser_GetScreenCoordinates(event);\n\t//Calculate the modifier\n\tvar nModifier = currentPos.x - __DRAG_DATA.StartPosition.x;\n\t//trigger resize\n\tUltraGrid_Resize(__DRAG_DATA.Header, nModifier);\n}", "function onMouseMove(event) {\n moveAt(event.pageX, event.pageY);\n }", "onMouseMove(event) {\n this.internalMove(event);\n }", "onMouseMove(event) {\n this.internalMove(event);\n }", "function dragMouseDown(e) {\n e.stopImmediatePropagation();\n divCont.style.zIndex = \"\" + ++currentZIndex;\n\n e = e || window.event;\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n pos4 = e.clientY;\n divCont.onmouseup = closeDragElement;\n divCont.onpointerup = closeDragElement;\n divCont.onmouseleave = closeDragElement;\n // call a function whenever the cursor moves:\n document.onmousemove = elementDrag;\n }", "function mmove(e) {\r\n\t\t\t\t\tif(isDrag==true)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//prevent default event\r\n\t\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\t\t//trace mouse\r\n\t\t\t\t\t\t$(e.target).css({\"top\":e.pageY - y + \"px\",\"left\":e.pageX - x + \"px\"});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//mouse up or mouse leave event\r\n\t\t\t\t\t\t$(e.target).on(\"mouseup\",mup);\r\n\t\t\t\t\t\t$(frameBody).on(\"mouseleave\",\"textarea\",mup);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function drag(e) {\n if (active) {\n e.preventDefault();\n \n currentX = e.clientX - 90;\n currentY = e.clientY - 250;\n \n //Multiple if-statements to check that the move is inside the borders of the container\n if (currentX > contSize-itemSize)\n {\n currentX = contSize-itemSize;\n }\n if (currentX < 0)\n {\n currentX = 0;\n }\n if (currentY > contSize-itemSize)\n {\n currentY = contSize-itemSize;\n }\n if (currentY < 0)\n {\n currentY = 0;\n }\n\n setTranslate(currentX, currentY, dragItem);\n }\n}", "function onMouseMove(e) {\n previousDragX = currentDragX;\n currentDragX = e.clientX;\n previousTimeStamp = currentTimeStamp;\n currentTimeStamp = e.timeStamp;\n\n\n moveByPixels(currentDragX - previousDragX);\n if (needsRedrawing()) {\n that.redraw();\n }\n\n $timeDisplay.html(new Date(centerPointTime));\n }", "function onMouseMove(e) {\n const currentX = unify(e).clientX;\n console.log('entered onMouseMove: currentX = ' + currentX);\n\n delta.x = currentX - drag.x;\n\n const offsetLeft = element.offsetLeft;\n\n //const first = document.getElementById(figStr + \"-first\");\n const second = document.getElementById(figStr + \"-second\");\n //let firstWidth = first.offsetWidth;\n let secondWidth = second.offsetWidth;\n\n element.style.left = offsetLeft + delta.x + \"px\";\n //firstWidth += delta.x;\n secondWidth -= delta.x;\n\n drag.x = currentX;\n //first.style.width = firstWidth + \"px\";\n second.style.width = secondWidth + \"px\";\n }", "function handleMouseMove(e)\r\n{\r\n if (!e)\r\n {\r\n var e = window.event;\r\n }\r\n\r\n if (e.pageX || e.pageY)\r\n {\r\n _mouse_x = e.pageX;\r\n _mouse_y = e.pageY;\r\n }\r\n else if (e.clientX || e.clientY)\r\n {\r\n /* _mouse_x = e.clientX + document.body.scrollLeft\r\n + document.documentElement.scrollLeft;\r\n _mouse_y = e.clientY + document.body.scrollTop\r\n + document.documentElement.scrollTop;*/\r\n }\r\n\r\n if (_isResizing)\r\n {\r\n updateResize();\r\n }\r\n\r\n if (_isMoving)\r\n {\r\n updateMove();\r\n }\r\n}", "_handleDragging(event) {\n const p = this._getPoint(event);\n\n this._updateValue(this._currentHandle, this._getValueFromCoord(p.pageX, p.pageY));\n\n event.preventDefault();\n }", "function handleMouseMove(e) {\r\n // only do this code if the mouse is being dragged\r\n if (!isDown) {\r\n return\r\n }\r\n\r\n // tell the browser we're handling this event\r\n e.preventDefault()\r\n e.stopPropagation()\r\n\r\n // get the current mouse position\r\n mouseX = parseInt(e.clientX - offsetX)\r\n mouseY = parseInt(e.clientY - offsetY)\r\n\r\n // dx & dy are the distance the mouse has moved since\r\n // the last mousemove event\r\n var dx = mouseX - startX\r\n var dy = mouseY - startY\r\n // reset the vars for next mousemove\r\n startX = mouseX\r\n startY = mouseY\r\n\r\n start_x = start_x + dx //netPanningX\r\n start_y = start_y + dy //netPanningY\r\n recalc()\r\n}", "onDrag(mousePosition) {\n }", "_moveHandler(event) {\n const that = this;\n\n event.stopPropagation();\n\n if (!that._itemIsPressed || !that.reorder || that.readonly || that._items.length < 2) {\n return;\n }\n\n if (that._dragStart) {\n that.$container.addClass('jqx-reordering');\n\n if (!that._dragging) {\n const item = that._selectedItem;\n\n that.$.fireEvent('dragStart', {\n 'position': { left: event.pageX, top: event.pageY },\n 'target': event.originalEvent.target,\n 'index': that._selectedItemIndex,\n 'label': item.label,\n 'content': item.content.innerHTML\n });\n\n that._selectedItem.dragged = that._dragging = true;\n }\n\n //Cancels the ripple animation during reorder but doesn't interfere with it's event listeners\n if (that.hasAnimation) {\n const ripple = that._selectedItem.querySelector('.jqx-ripple');\n\n if (ripple) {\n ripple.style.height = 0;\n }\n }\n\n const mouseCoordinate = event.clientY;\n let inItem = false;\n\n for (let i = 0; i < that._itemsCoordinates.length; i++) {\n const currentCoordinateSet = that._itemsCoordinates[i];\n\n if (mouseCoordinate >= currentCoordinateSet.fromY && mouseCoordinate <= currentCoordinateSet.toY) {\n inItem = i;\n break;\n }\n }\n\n const hoveredItem = that._items[inItem];\n\n if (inItem !== false && hoveredItem !== that._selectedItem) {\n if (that._lastReorderedItem && hoveredItem === that._lastReorderedItem) {\n return;\n }\n\n that._lastReorderedItem = hoveredItem;\n\n if (Math.abs(that._reorderedIndex - inItem) > 1) {\n const indexOffset = that._reorderedIndex - inItem < 0 ? -1 : 1;\n\n that._swapItems(that._reorderedIndex, inItem + indexOffset);\n }\n\n that._swapItems(that._reorderedIndex, inItem);\n\n that._reorderedIndex = inItem;\n that._storeItemsCoordinates();\n return;\n }\n\n that._lastReorderedItem = undefined;\n }\n else {\n that._dragStart = true;\n }\n }", "function mouseDragged() {\n onceMoved = true;\n mouseMove = true;\n \n xCentreCoord -= (1/coordToPixelRatio)*(mouseX - startMouseX);\n yCentreCoord += (1/coordToPixelRatio)*(mouseY - startMouseY);\n\n startMouseX = mouseX;\n startMouseY = mouseY;\n }", "function handleMouseMove(evt) {\n evt.preventDefault();\n var p = mouseCoordsSvg(evt);\n if(g['shape'].active){\n g['shape'].mousemove(p.x, p.y);\n }\n else if (g['active_tool']){\n if (g['tool']=='move'){\n var t = [];\n t.x = p.x - g['p'].x;\n t.y = p.y - g['p'].y;\n g['moving_object'].setAttribute('transform',\n 'translate('+t.x+','+t.y+')');\n }\n else if (g['tool']=='delete'){\n var target = evt.target;\n if (target.NodeName !== 'svg' && target.id !== 'canvas'){\n var group = find_group(target.parentNode);\n delete_object(group);\n }\n }\n }\n}", "handleMouseMove(e) {\n if (this.state.isDragging) {\n this.updateAngles(e);\n }\n e.preventDefault();\n }", "function mouseMove(evnt){\n if (!dragObject) return;\n evnt = evnt || window.event;\n var mousePos = mousePosition(evnt);\n\n // if draggable, set new absolute position\n if(dragObject){\n dragObject.style.position = 'absolute';\n\n dragObject.style.top = mousePos.y - mouseOffset.y + \"px\";\n dragObject.style.left = mousePos.x - mouseOffset.x + \"px\";\n return false;\n }\n}", "mouseDrag(prev, pt) {}", "mouseDrag(prev, pt) {}", "function cust_MouseMove(evnt, swipedirection) {\n //f_log(evnt.clientX+\", \"+evnt.clientY)\n}", "function canvasMouseMoveEv(event) {}", "function sliderMouseMove(mouseMoveEvent) {\r\n // normalisedValue is the slider position on a linear scale from 0 to 1\r\n var normalisedValue = (mouseMoveEvent.clientX - mouseDownEvent.offsetX - mouseDownEvent.target.parentNode.getBoundingClientRect().x)/mouseDownEvent.target.parentNode.clientWidth;\r\n normalisedValue = Math.min(Math.max(normalisedValue, 0), 1);\r\n mouseDownEvent.target.style.left = (normalisedValue * 100) + '%';\r\n // set the target parameter using the options object defined on the great-grandparent slider div\r\n theSlider.targetParameter.value = theSlider.options.responseFunction(normalisedValue);\r\n // Prevent any default action of the mouse move event (e.g. text selection)\r\n mouseMoveEvent.preventDefault();\r\n }", "onDragStarted(mousePosition) {\n }", "function CdkDragMove() {}", "function CdkDragMove() {}", "function onMouseMove(event) {\n\tmousePos = event.point;\n}", "function dragElement(elmnt) {\r\n var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;\r\n if (document.getElementById(elmnt.id + \"-header\")) {\r\n // if present, the header is where you move the DIV from:\r\n document.getElementById(elmnt.id + \"-header\").onmousedown = dragMouseDown;\r\n } else {\r\n // otherwise, move the DIV from anywhere inside the DIV:\r\n elmnt.onmousedown = dragMouseDown;\r\n }\r\n \r\n function dragMouseDown(e) {\r\n e = e || window.event;\r\n e.preventDefault();\r\n // get the mouse cursor position at startup:\r\n pos3 = e.clientX;\r\n pos4 = e.clientY;\r\n document.onmouseup = closeDragElement;\r\n // call a function whenever the cursor moves:\r\n document.onmousemove = elementDrag;\r\n }\r\n \r\n function elementDrag(e) {\r\n e = e || window.event;\r\n e.preventDefault();\r\n // calculate the new cursor position:\r\n pos1 = pos3 - e.clientX;\r\n pos2 = pos4 - e.clientY;\r\n pos3 = e.clientX;\r\n pos4 = e.clientY;\r\n // set the element's new position:\r\n elmnt.style.top = (elmnt.offsetTop - pos2) + \"px\";\r\n elmnt.style.left = (elmnt.offsetLeft - pos1) + \"px\";\r\n }\r\n \r\n function closeDragElement() {\r\n // stop moving when mouse button is released:\r\n document.onmouseup = null;\r\n document.onmousemove = null;\r\n }\r\n }", "function dragElement(elmnt) {\n var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;\n if (document.getElementById(elmnt.id + \"header\")) {\n /* if present, the header is where you move the DIV from:*/\n document.getElementById(elmnt.id + \"header\").onmousedown = dragMouseDown;\n } else {\n /* otherwise, move the DIV from anywhere inside the DIV:*/\n elmnt.onmousedown = dragMouseDown;\n }\n\n function dragMouseDown(e) {\n e = e || window.event;\n e.preventDefault();\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n pos4 = e.clientY;\n document.onmouseup = closeDragElement;\n // call a function whenever the cursor moves:\n document.onmousemove = elementDrag;\n }\n\n function elementDrag(e) {\n e = e || window.event;\n e.preventDefault();\n // calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos2 = pos4 - e.clientY;\n pos3 = e.clientX;\n pos4 = e.clientY;\n // set the element's new position:\n elmnt.style.top = (elmnt.offsetTop - pos2) + \"px\";\n }\n\n function closeDragElement() {\n /* stop moving when mouse button is released:*/\n document.onmouseup = null;\n document.onmousemove = null;\n }\n }", "function handleMouseMoveEvent(event) {\n\t\tif (mouseDown && selectedPoint != null) {\t\t\n\t\t\tvar evt = event ? event:window.event;\n\t\t\tif (!selectedPoint.moved && evt.ctrlKey) {\n\t\t\t\tif (selectedHandle != null) {\n\t\t\t\t\tselectedHandle.x = relativeX;\n\t\t\t\t\tselectedHandle.y = relativeY;\n\t\t\t\t\tselectedPoint.highlight = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (evt.shiftKey) {\n\t\t\t\t\trelativeX = Math.floor(relativeX / GRID_CELL_WIDTH) * GRID_CELL_WIDTH;\n\t\t\t\t\trelativeY = Math.floor(relativeY / GRID_CELL_WIDTH) * GRID_CELL_WIDTH;\n\t\t\t\t}\n\t\t\t\tselectedPoint.moveTo(relativeX, relativeY);\n\t\t\t\tselectedPoint.moved = true;\n\t\t\t}\n\t\t}\n\t}", "function _move_elem(e) {\n\tconsole.log(\"move elem\");\n x_pos = document.all ? window.event.clientX : e.pageX;\n y_pos = document.all ? window.event.clientY : e.pageY;\n if (selected !== null) {\n selected.style.left = (x_pos - x_elem) + 'px';\n selected.style.top = (y_pos - y_elem) + 'px';\n }\n}", "function dragMouseStart(e) {\n console.log('dragMouseStart');\n // allow effect data transfer on the start of mouse move\n e.dataTransfer.effectAllowed = 'move'\n // drop effect on start of mouse move\n e.dataTransfer.dropEffect = 'move';\n\n e = e || window.event;\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n pos4 = e.clientY;\n console.log(pos3 + \" \" + pos4);\n // get the element from the mouse position\n var node = document.elementFromPoint(pos3, pos4);\n // get the parent node of the elemnt \n node = node.parentNode;\n console.log(node);\n // create a selection to hold the cards to be moved\n selection = getSelection(node);\n selectednode = node;\n document.dragend = dragMouseEnd;\n \n }", "function onMouseMove(event) {\n mousePos = event.point;\n}" ]
[ "0.7829178", "0.75963956", "0.75963956", "0.75552905", "0.75467914", "0.74622387", "0.7408157", "0.7294221", "0.72456145", "0.7178884", "0.71744835", "0.70877546", "0.70258254", "0.7008248", "0.6947241", "0.687514", "0.6863924", "0.6841702", "0.6828741", "0.6769443", "0.67639095", "0.6756179", "0.6739531", "0.67301524", "0.6719872", "0.67182577", "0.667857", "0.66747075", "0.6671908", "0.66658336", "0.66658336", "0.66596997", "0.6657263", "0.663146", "0.663146", "0.66294944", "0.66101474", "0.6603879", "0.66009897", "0.6596511", "0.6591025", "0.65854686", "0.6576103", "0.6575883", "0.65701145", "0.65676975", "0.6567079", "0.6566104", "0.65646", "0.6563323", "0.6558493", "0.65552884", "0.65526986", "0.65500826", "0.6537579", "0.6535543", "0.6530483", "0.6529529", "0.6517588", "0.6509795", "0.6509795", "0.6509408", "0.6506683", "0.6503563", "0.6503152", "0.6501973", "0.6501084", "0.64959055", "0.6490892", "0.64843756", "0.64843756", "0.6483898", "0.6477819", "0.6474695", "0.64720523", "0.6464816", "0.64608747", "0.6460235", "0.64592975", "0.64542025", "0.6451185", "0.64477277", "0.64450425", "0.6437981", "0.6432403", "0.64283574", "0.64283574", "0.6425761", "0.6423277", "0.64201945", "0.6410855", "0.6409247", "0.6409247", "0.64033043", "0.6401154", "0.63977593", "0.6397745", "0.6396425", "0.6384621", "0.6365487" ]
0.7636558
1
This is the handler that captures the final mouseup event that occurs at the end of a drag.
function upHandler(e) { if (!e) e = window.event; // IE Event Model // Unregister the capturing event handlers. if (document.removeEventListener) { // DOM event model document.removeEventListener("mouseup", upHandler, true); document.removeEventListener("mousemove", moveHandler, true); } else if (document.detachEvent) { // IE 5+ Event Model elementToDrag.detachEvent("onlosecapture", upHandler); elementToDrag.detachEvent("onmouseup", upHandler); elementToDrag.detachEvent("onmousemove", moveHandler); elementToDrag.releaseCapture(); } // And don't let the event propagate any further. if (e.stopPropagation) e.stopPropagation(); // Standard model else e.cancelBubble = true; // IE // clearInterval(timer); // refresh_content(); switch(func_state) { case state_left_click: clearInterval(timer); open_new_dir(); break; case state_right_click: case state_left_long_press: clearInterval(timer); refresh_content(); break; case state_mouse_move: clearInterval(timer); refresh_content(); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseUp(e) {\n removeMoveListener();\n removeUpListener();\n _callbacks.end.forEach(function(callback) {\n callback.call();\n });\n }", "onMouseUp(e) {\n // we have finished dragging\n this.isMouseDown = false;\n\n // remove specific styles\n this.options.element.classList.remove(\"dragged\");\n\n // update our end position\n this.endPosition = this.currentPosition;\n\n // send our mouse/touch position to our hook\n var mousePosition = this.getMousePosition(e);\n\n // drag ended hook\n this.onDragEnded(mousePosition);\n }", "onMouseUp(event) {\n this.internalEnd(false, event);\n }", "onMouseUp(event) {\n this.internalEnd(false, event);\n }", "function MouseUpEvent() {}", "function handleDragEnd(){\n this.isMouseDown = false\n this.lastX = null\n}", "onMouseUp (e) {\n if (this.isMouseDown) {\n this.isMouseDown = false;\n this.emit('mouse-up', normaliseMouseEventToElement(this.canvas, e));\n }\n }", "function mouseUpHandler(event){\n\t\t\t$(document).stopObserving('mouseup', mouseUpHandler);\n\t\t\tif(selectionInterval != null){\n\t\t\t\tclearInterval(selectionInterval);\n\t\t\t\tselectionInterval = null;\n\t\t\t}\n\n\t\t\tsetSelectionPos(selection.second, event);\n\t\t\tclearSelection();\n\t\t\t\n\t\t\tif(selectionIsSane() || event.isLeftClick()){\n\t\t\t\tdrawSelection();\n\t\t\t\tfireSelectedEvent();\n\t\t\t\tignoreClick = true;\n\t\t\t}\n\t\t\tEvent.stop(event);\n\t\t}", "_mouseUp() {\n if (this._currentHandle) {\n this._currentHandle.style.cursor = 'grab';\n this._currentHandle.classList.remove('is-dragged');\n }\n document.body.classList.remove('u-coral-closedHand');\n\n events.off('mousemove.Slider', this._draggingHandler);\n events.off('touchmove.Slider', this._draggingHandler);\n events.off('mouseup.Slider', this._mouseUpHandler);\n events.off('touchend.Slider', this._mouseUpHandler);\n events.off('touchcancel.Slider', this._mouseUpHandler);\n\n this._currentHandle = null;\n this._draggingHandler = null;\n this._mouseUpHandler = null;\n }", "function UltraGrid_Sizer_Drag_OnEnd(event)\n{\n\t//trigger final move\n\t__DRAG_DATA.OnMove(event);\n}", "function Form_Drag_OnEnd(event)\n{\n\t//trigger final move\n\t__DRAG_DATA.OnMove(event);\n}", "finishDrag() {\n //Use last loc_sim_ from last mouseDown or mouseMove event\n //because for touchEnd events there is no location.\n if (this.eventHandler_ != null) {\n this.eventHandler_.finishDrag(this.dragSimObj_, this.loc_sim_, this.dragOffset_);\n }\n}", "onPointerUp() {\n\t\tif (draggingEl) {\n\t\t\tthis.$clonedEl.remove();\n\t\t\tdocument.body.classList.remove(this.docBodyClass);\n\t\t\temit(draggingEl, 'dragend');\n\t\t\tdraggingEl = null;\n\t\t}\n\t\tdocument.removeEventListener(events.move, this.onPointerMove);\n\n\t\t// for auto-scroll\n\t\tthis.scrollParent.removeEventListener(events.enter, this.onPointerEnter);\n\t\tthis.scrollParent.removeEventListener(events.leave, this.onPointerLeave);\n\t\tthis.onPointerLeave();\n\t}", "function endDrag () {\n $element.parents().off( \"mousemove\", handleDrag );\n $element.parents().off( \"mouseup\", endDrag );\n $element[0].dispatchEvent( new CustomEvent(\n ( $element[0].dragType == 4 ) ? 'moved' : 'resized',\n { bubbles : true } ) );\n }", "function CdkDragEnd() {}", "function CdkDragEnd() {}", "function dragEnd (e) {\n self.draggy.position = self.position;\n $(self.draggy.ele).removeClass('activeDrag');\n $(self).trigger('onDrop');\n $(d).off(events.move, dragMove);\n $(d).off(events.end, dragEnd);\n }", "function TreeGrid_Sizer_Drag_OnEnd(event)\n{\n\t//trigger final move\n\t__DRAG_DATA.OnMove(event);\n}", "function handleMouseUp(e) {\r\n // tell the browser we're handling this event\r\n e.preventDefault()\r\n e.stopPropagation()\r\n\r\n // clear the isDragging flag\r\n isDown = false\r\n}", "function dragEnd (e) {\n self.draggy.position = self.position;\n classes(self.draggy.ele).remove('activeDrag');\n self.dispatchEvent(onDrop);\n d.removeEventListener(events.move, dragMove);\n d.removeEventListener(events.end, dragEnd);\n }", "function mouseup(e){\n\t\t// console.log(e);\n\n\t\tmouseIsDown = false;\n\n\t\tif (newFurniture == undefined) return;\n\n\t\tcurrentLayout.addFurniture(newFurniture);\n\n\t\tvar point = {\n\t\t\tx: e.offsetX,\n\t\t\ty: e.offsetY\n\t\t};\n\n\t\tvar midPoint = midPointBetweenPoints(startPoint, point);\n\n\t\tcurrentLayout.selectFurnitureAtPoint(midPoint);\n\n\t\tnewFurniture = undefined;\n\t}", "function sliderMouseUp(mouseUpEvent) {\r\n if(mouseDownEvent.button === 0) {\r\n // Remove all 'while grabbing' styling\r\n mouseDownEvent.target.classList.remove('sliding');\r\n document.body.style.cursor = '';\r\n // Remove the event mouse move and mouse up listeners from the window\r\n window.removeEventListener('mousemove', sliderMouseMove)\r\n window.removeEventListener('mouseup', sliderMouseUp)\r\n // Prevent any default action of the mouse up event\r\n mouseUpEvent.preventDefault();\r\n }\r\n }", "function upHandler(e) {\n if (!e) e = window.event; // IE Event Model\n\n // Unregister the capturing event handlers.\n if (document.removeEventListener) { // DOM event model\n document.removeEventListener(\"mouseup\", upHandler, true);\n document.removeEventListener(\"mousemove\", moveHandler, true);\n }\n else if (document.detachEvent) { // IE 5+ Event Model\n elementToDrag.detachEvent(\"onlosecapture\", upHandler);\n elementToDrag.detachEvent(\"onmouseup\", upHandler);\n elementToDrag.detachEvent(\"onmousemove\", moveHandler);\n elementToDrag.releaseCapture();\n }\n\n // And don't let the event propagate any further.\n if (e.stopPropagation) e.stopPropagation(); // Standard model\n else e.cancelBubble = true; // IE\n }", "function mouseup(e) {\r\n fsw_state = 0;\r\n ui_modified = true;\r\n}", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.removeEventListener('mousemove', mouseMoveHandler);\n }\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.removeEventListener('mousemove', mouseMoveHandler);\n }\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.removeEventListener('mousemove', mouseMoveHandler);\n }\n }", "endDrag(x, y) {}", "function mouseUpHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n container.removeEventListener('mousemove', mouseMoveHandler);\r\n }\r\n }", "function mouseUpHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n container.removeEventListener('mousemove', mouseMoveHandler);\r\n }\r\n }", "function mouse_up_handler() {\n mouse.down = false; \n }", "function ev_mouseup(e) {\n\t//e.preventDefault();\n\t//canEl.onmousemove = null;\n\tif (dimmerUpdateId != -1)\n\t\tobjArr[dimmerUpdateId].onMouseUp();\n\tdimmerUpdateId = -1;\n}", "function mouseup(e){\n\t\t// console.log(e);\n\n\t\tif (mouseIsDown){\n\t\t\tvar point = {\n\t\t\t\tx: e.offsetX,\n\t\t\t\ty: e.offsetY\n\t\t\t};\n\n\t\t\tcurrentLayout.selectFurnitureAtPoint(point);\n\t\t}\n\n\t\tmouseIsDown = false;\n\t}", "function Mouseup(e,target) {\n\t\t\t//remove event handler\n\t\t\t$(frameDocument).off(\"mousemove\",target,Mousemove);\n\t\t\t$(frameDocument).off(\"mouseleave\",target,Mouseup);\n\t\t\t$(frameDocument).off(\"mouseup\",target,Mouseup);\n\t\t\tisDrag=false;\n\t\t\tpositionX=positionY=\"\";\n\t\t\t\n\t\t\t//icon\n\t\t\t$(target).css(\"cursor\",\"default\");\n\t\t\t$(frameDocument).css(\"cursor\",\"default\");\n\t\t\ttarget=\"\";\n\t\t\t\n\t\t\teditor.updateTextArea();//update iframe\n\t\t}", "function upHandler(e){\n\te.preventDefault();\n\te.stopPropagation();\n\n\twindow.removeEventListener(\"mouseup\", upHandler, false);\n\twindow.removeEventListener(\"mousemove\", moveHandler, false);\n\tconsole.log(\"upHandler\");\n\timgDiv.style.cursor = \"\";\n\n}", "function mouseUpEvent(e) {\n\tswitch (e.button) {\n\t\tcase 0:\n\t\t\tleft_click_drag_flag = false;\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tright_click_drag_flag = false;\n\t\t\tbreak;\n\t}\n}", "dragEnd(e){\n console.log('--| [drag end]');\n }", "onMouseUp(event) {\n this.isDragging = false;\n this.isPanning = false;\n this.isMinimapPanning = false;\n if (this.layout && typeof this.layout !== 'string' && this.layout.onDragEnd) {\n this.layout.onDragEnd(this.draggingNode, event);\n }\n }", "e_mouseUp(e)\n\t{\n\t\tthis.mouseState.isDown = false;\n\t\tthis.mouseState.dragEventFired = false;\n\n\t\tthis.componentsDragged.forEach(function(component)\n\t\t{\n\t\t\tcomponent.isDragged = false;\n\t\t});\n\t}", "function mouseUp(event) {\n mouseIsDown = false;\n // if (drawHandle !== -1) {\n // clearInterval(drawHandle);\n // drawHandle = -1;\n // }\n }", "function ListView_Sizer_Drag_OnEnd(event)\n{\n\t//trigger final move\n\t__DRAG_DATA.OnMove(event);\n}", "_documentMouseupHandler() {\n const that = this;\n\n that._up = true;\n that.$upButton.removeClass('jqx-numeric-text-box-pressed-component');\n that.$downButton.removeClass('jqx-numeric-text-box-pressed-component');\n }", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "function dragEnd(e) {\n splitter.resizeChildren(e ? e : window.event);\n document.onmousemove = null;\n document.onmouseup = null;\n }", "_onHandleMouseUp(ev) {\n console.assert(this._mouseActive);\n\n ev.stopPropagation();\n ev.preventDefault();\n\n this._mouseActive = false;\n this._activeHandle = null;\n\n document.removeEventListener('mouseup', this._onHandleMouseUp, true);\n document.removeEventListener('mousemove', this._onHandleMouseMove, true);\n\n $('body').removeClass('revision-selector-grabbed');\n\n if (!_.isEqual(this._activeValues, this._values)) {\n this.trigger('revisionSelected', this._activeValues);\n }\n }", "_documentUpHandler(event) {\n const that = this;\n\n if (!that._thumbDragged) {\n return;\n }\n\n if (that.mechanicalAction === 'switchWhenReleased') {\n that._moveThumbBasedOnCoordinates(event, true, true);\n }\n else if (that.mechanicalAction === 'switchUntilReleased') {\n if (that._numericProcessor.compare(that._number, that._cachedValue._number)) {\n const oldValue = that._getEventValue();\n\n that._number = that._cachedValue._number;\n that._drawValue = that._cachedValue._drawValue;\n\n if (that._cachedValue._valueDate) {\n that._valueDate = that._cachedValue._valueDate;\n }\n\n that.value = that._cachedValue.value;\n\n that._moveThumbBasedOnValue(that._drawValue);\n\n const value = that._getEventValue();\n\n that.$.fireEvent('change', { 'value': value, 'oldValue': oldValue });\n that.$.hiddenInput.value = value;\n }\n }\n\n if (that.showTooltip) {\n that.$tooltip.addClass('jqx-hidden');\n }\n\n that._thumbDragged = false;\n that.$track.removeClass('jqx-dragged');\n that.$fill.removeClass('disable-animation');\n }", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "resizeEnd() {\n this.options.container.addEventListener(\"mouseup\", (e) => {\n if (this.resizing) {\n this.resizing = false;\n this.options.container.removeEventListener(\"mousemove\", this.resizeHandler);\n if (this.handlers.resizeEnd)\n this.handlers.resizeEnd({\n target: this.targetElement,\n inputEvent: e,\n translate: [this.store.currentTranslate[0], this.store.currentTranslate[1]], // deep copy\n width: this.store.currentSize[0],\n height: this.store.currentSize[1],\n });\n }\n });\n }", "function reactionMouseUp (e) { \r\n drag = false; // Zugmodus deaktivieren \r\n reactionUp(e.clientX,e.clientY); // Hilfsroutine aufrufen \r\n }", "function upHandler(e) \n {\n if (!e) e = window.event; // IE Event Model\n if (document.removeEventListener) // DOM event model\n { \n document.removeEventListener(\"mouseup\", upHandler, true);\n document.removeEventListener(\"mousemove\", moveHandler, true);\n }\n else if (document.detachEvent) // IE 5+ Event Model\n { \n elementToDrag.detachEvent(\"onlosecapture\", upHandler);\n elementToDrag.detachEvent(\"onmouseup\", upHandler);\n elementToDrag.detachEvent(\"onmousemove\", moveHandler);\n elementToDrag.releaseCapture();\n }\n else // IE 4 Event Model\n { \n document.onmouseup = olduphandler;\n document.onmousemove = oldmovehandler;\n }\n\n // And don't let the event propagate any further.\n if (e.stopPropagation) e.stopPropagation(); // DOM Level 2\n else e.cancelBubble = true; // IE\n }", "function upHandler(e) \n\t{\n\t\tme.style.cursor = \"default\"; \n\t\t\n\t\tif (!e) e = window.event; // IE Event Model\n\t\t\n\t\t// Unregister the capturing event handlers.\n\t\tif (document.removeEventListener) { // DOM event model\n\t\t\tdocument.removeEventListener(\"mouseup\", upHandler, true);\n\t\t\tdocument.removeEventListener(\"mousemove\", moveHandler, true);\n\t\t}\n\t\telse if (document.detachEvent) { // IE 5+ Event Model\n\t\t\tme.detachEvent(\"onlosecapture\", upHandler);\n\t\t\tme.detachEvent(\"onmouseup\", upHandler);\n\t\t\tme.detachEvent(\"onmousemove\", moveHandler);\n\t\t\tme.releaseCapture( );\n\t\t}\n\t\telse { // IE 4 Event Model\n\t\t\t// Restore the original handlers, if any\n\t\t\tdocument.onmouseup = olduphandler;\n\t\t\tdocument.onmousemove = oldmovehandler;\n\t\t}\n\t\t\n\t\t// And don't let the event propagate any further.\n\t\tif (e.stopPropagation) e.stopPropagation( ); // DOM Level 2\n\t\telse e.cancelBubble = true; // IE\n\t}", "function mouseUp(e) {\n mousePress(e.button, false);\n}", "function upHandler(event) {\n if (!event) event = window.event; // IE Event Model\n\n // Unregister the capturing event handlers.\n if (document.removeEventListener) { // DOM event model\n document.removeEventListener(bTouchMode? \"touchend\": \"mouseup\", upHandler, true);\n document.removeEventListener(bTouchMode? \"touchmove\": \"mousemove\", moveHandler, true);\n }\n else if (document.detachEvent) { // IE 5+ Event Model\n elementToDrag.detachEvent(\"onlosecapture\", upHandler);\n elementToDrag.detachEvent(bTouchMode? \"touchend\": \"onmouseup\", upHandler);\n elementToDrag.detachEvent(bTouchMode? \"touchmove\": \"onmousemove\", moveHandler);\n elementToDrag.releaseCapture();\n }\n\n if (options.stop) options.stop(event);\n // And don't let the event propagate any further.\n if (event.stopPropagation) event.stopPropagation(); // Standard model\n else event.cancelBubble = true; // IE\n \n }", "function mousedownHandler ( event /*: JQueryEventObject */ ) {\n if ( $element.hasClass( pausedDragSelectClass ) ) return;\n if ( !$element.hasClass( SELECTED_FOR_DRAGGING_CLASS ) ) return;\n $element[0].dragData.type = eventToCellNumber( event, $element[0] );\n $element[0].dragData.firstX = event.pageX;\n $element[0].dragData.firstY = event.pageY;\n $element[0].dragData.lastX = event.pageX;\n $element[0].dragData.lastY = event.pageY;\n $element.parents().on( \"mousemove\", handleDrag );\n $element.parents().on( \"mouseup\", endDrag );\n }", "function mouseupSlider(e) {\n loc_document.unbind('mousemove', moveSlider);\n }", "on_mouseup(e, localX, localY) {\n\n }", "function mouseup(e) {\n angular.element(document).unbind('mousemove', mousemove);\n angular.element(document).unbind('mouseup', mouseup);\n dragging = false;\n }", "function mouseUpHandler(e) {\n //middle button\n if (e.which == 2) {\n container.off('mousemove');\n }\n }", "function mup(e) {\r\n\t\t\t\t\t//remove event handler\r\n\t\t\t\t\t$(frameBody).off(\"mousemove\",mmove);\r\n\t\t\t\t\t$(frameBody).off(\"mouseleave\",mup);\r\n\t\t\t\t\t$(e.target).off(\"mouseup\",mup);\r\n\t\t\t\t\tisDrag=false;\r\n\t\t\t\t\tix=iy=\"\";\r\n\t\t\t\t}", "function mouseUp() { }", "function onMouseUp(e) {\n\n\t\t\t// propagate the event to the callback with x,y coords\n\t\t\tmouseUpCB(e, translateMouseCoords(e.clientX, e.clientY));\n\t\t}", "function DIF_enddrag(e) {\r\n\tDIF_dragging=false;\r\n//\tDIF_objectDragging.style.cursor=\"auto\";\r\n\tDIF_iframeBeingDragged=\"\";\r\n}", "function gestureEnd(ev){if(!pointer||!typesMatch(ev,pointer))return;updatePointerState(ev,pointer);pointer.endTime=+Date.now();runHandlers('end',ev);lastPointer=pointer;pointer=null;}", "_onMouseUp () {\n Actions.changeDragging(false);\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.off('mousemove');\n }\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.off('mousemove');\n }\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.off('mousemove');\n }\n }", "function mouseUpHandler(e){\n //middle button\n if (e.which == 2){\n container.off('mousemove');\n }\n }", "_dragEnd(e) {\n HAXStore._lockContextPosition = false;\n }", "function mouseup() {\n if (!_this.props.mousedownNode && !_this.props.mousedownLink) {\n _this.resetSelected()\n }\n // avoid firing off unnecessary actions\n else {\n _this.props.onMousedownNodeUpdate(null)\n _this.props.onMousedownLinkUpdate(null)\n }\n }", "mouseUp(event) {\n if (!this.active) return;\n\n if (this.zoomSwitchPosition === true) {\n const firstPoint = this.pointToNormalizedCanvas(this.dragStart);\n const secondPoint = this.getMouseEventPosition(event);\n this.zoomOnRectangle(firstPoint, secondPoint);\n\n this.emitUpdateEvent();\n }\n this.zoomSwitchPosition = false;\n this.dragging = false;\n }", "function mouseUpHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n container.off('mousemove');\r\n }\r\n }", "function mouseUpHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n container.off('mousemove');\r\n }\r\n }", "function mouseUpHandler(e){\r\n //middle button\r\n if (e.which == 2){\r\n container.off('mousemove');\r\n }\r\n }", "function canvasMouseUpEv(event) {\n // Finish editing annotation\n if (this.point_move) {\n this.last_segm = null;\n this.last_baseline = null;\n this.last_segm_type = null;\n this.emitAnnotationEditedEvent(this.last_active_annotation); // TODO: not always\n\n this.point_move = false;\n }\n}", "function mouseUp() {\n console.log(\"Mouse Up\");\n mouseDownPress = false;\n}", "_onMouseUp() {\n if (this._animationFrameID) {\n this._didMouseMove();\n }\n this._onMoveEnd();\n }", "onMouseUp(event) {\n const me = this,\n context = me.context;\n me.removeListeners();\n\n if (context) {\n me.scrollManager && me.scrollManager.stopMonitoring(me.dragWithin || me.outerElement);\n\n if (context.action === 'container') {\n me.finishContainerDrag(event);\n } else if (context.started && context.action.startsWith('translate')) {\n me.finishTranslateDrag(event);\n }\n\n if (context.started) {\n // Prevent the impending document click from the mouseup event from propagating\n // into a click on our element.\n EventHelper.on({\n element: document,\n thisObj: me,\n click: documentListeners.docclick,\n capture: true,\n expires: me.clickSwallowDuration,\n // In case a click did not ensue, remove the listener\n once: true\n });\n } else {\n me.reset(true);\n }\n }\n }", "onMouseUp(e) {}", "onDragEnd(e) {\n this.isDown = false;\n }", "onMouseUp(event) {\n const me = this,\n context = me.context;\n\n me.removeListeners();\n\n if (context) {\n me.scrollManager && me.scrollManager.stopMonitoring(me.dragWithin || me.outerElement);\n\n if (context.action === 'container') {\n me.finishContainerDrag(event);\n } else if (context.started && context.action.startsWith('translate')) {\n me.finishTranslateDrag(event);\n }\n\n if (context.started) {\n // Prevent the impending document click from the mouseup event from propagating\n // into a click on our element.\n const clickPreventer = EventHelper.on({\n element: document,\n thisObj: me,\n click: documentListeners.docclick,\n capture: true,\n once: true\n });\n // In case a click did not ensue, remove the listener\n me.setTimeout(clickPreventer, 50);\n } else {\n me.reset();\n }\n }\n }", "mouseReleased() {\n this.mouseEvent(\"mouseReleased\");\n }", "function mouseup(d) {\n if(mousedown_node) {\n // hide drag line\n drag_line\n .classed('hidden', true)\n .style('marker-end', '');\n }\n // because :active only works in WebKit?\n svg.classed('active', false);\n \n // clear mouse event vars\n resetMouseVars();\n }", "onGhostPointerUp(e) {\r\n this.ghostAnchor.node.releasePointerCapture(e.pointerId);\r\n this.onChange(this, this.regionData.copy(), IRegionCallbacks_1.ChangeEventType.MOVEEND);\r\n }", "onMouseUp( event ) {\n //console.log(\"MultiControls.onMouseUp\");\n event.preventDefault();\n //event.stopPropagation();\n this.mouseDragOn = false;\n var mousePtUp = this.getMousePt(event);\n if (mousePtUp.x == this.mousePtDown.x && mousePtUp.y == this.mousePtDown.y) {\n var t = Util.getClockTime();\n var dt = t - this.mouseDownTime;\n if (dt < 0.6)\n this.handleMuseEvent(event, 'click');\n else {\n console.log(\"Lazy click... ignored...\");\n }\n }\n }", "function mouseup(e) {\n cursor.blink = blink;\n if (!cursor.selection) {\n if (ctrlr.editable) {\n cursor.show();\n }\n else {\n textareaSpan.detach();\n }\n }\n\n // delete the mouse handlers now that we're not dragging anymore\n rootjQ.unbind('mousemove', mousemove);\n $(e.target.ownerDocument).unbind('mousemove', docmousemove).unbind('mouseup', mouseup);\n }", "function mouseUp(e) {\n clickObj.mouseDown = false;\n $(window).unbind('mousemove');\n }", "function touch_end_handler(e) {\n if (!e.touches) mouse.down = false; //If there are no more touches on the screen, sets \"down\" to false.\n }", "function handleMouseUp()\r\n{\r\n _mouse_down = false;\r\n\r\n if (_isResizing)\r\n {\r\n if (_objectOverrideCell == _objectResizing)\r\n {\r\n _lastCellRealWidth = _objectOverrideCell.offsetWidth;\r\n }\r\n _isResizing = false;\r\n enforceMinimumTableWidth();\r\n saveColumnSize();\r\n }\r\n\r\n if (_isMoving)\r\n {\r\n finishMoving();\r\n }\r\n}", "function dragEnd() {\n posFinal = getTransform();\n \n if (posFinal - posStart < -100) {\n self.next();\n slide(true);\n } else if (posFinal - posStart > 100) {\n self.prev();\n slide(true);\n } else {\n ML.El.cssTransition(ul, '-webkit-' + swipeTransitionValue + ', ' + swipeTransitionValue);\n ML.El.cssTransform(ul, 'translateX(' + (posStart) + 'px)');\n }\n document.removeEventListener('onmouseup', dragEnd, false);\n document.removeEventListener('onmouseove', dragAction, false);\n }", "function dropper(event) {\n\n// Unregister the event handlers for mouseup and mousemove\n\n document.removeEventListener(\"mouseup\", dropper, true);\n document.removeEventListener(\"mousemove\", mover, true);\n\n// Prevent propagation of the event\n\n event.stopPropagation();\n} //** end of dropper", "function dragEnd(e) {\n clearDropClasses(e.currentTarget);\n}", "function pointerUp(event) {\n dragging = false;\n }", "function handleDragEnd(e){\n var drag_item_src = e.target;\n $(drag_item_src).removeClass('drag_item_dragged');\n}", "onDragEnded(mousePosition) {\n }", "function dragEnd(e) {\n active = false;\n}", "function mousedownMoveHandler(event) {\n setSelection();\n releaseSelection(event);\n $(document).mousemove(moveSelection);\n $(document).mouseup(releaseMoveSelection);\n}", "function mouseup(event) {\n current_slider = null;\n}", "function bkmkDragEndHandler (e) {\n // Signal we stopped dragging an internal item\n isBkmkItemDragged = false;\n isBkmkDragActive = false;\n refBkmkScrollLeft = refBkmkScrollTop = -1;\n\n//let target = e.target;\n//console.log(\"Drag end event: \"+e.type+\" target: \"+target+\" class: \"+target.classList);\n dtSignature = undefined; // Forget dragged signature\n noDropZone = undefined;\n}" ]
[ "0.7608333", "0.7530356", "0.73980874", "0.73980874", "0.7257201", "0.725184", "0.7097712", "0.70804566", "0.6971638", "0.6957199", "0.6954656", "0.69436604", "0.6917587", "0.6896842", "0.6880018", "0.6880018", "0.6866899", "0.6849868", "0.6834869", "0.68327224", "0.6828433", "0.6828271", "0.6819806", "0.68153733", "0.6812697", "0.6812697", "0.6812697", "0.6794932", "0.67928946", "0.67928946", "0.6786524", "0.6771401", "0.6770252", "0.6764642", "0.6754967", "0.6752871", "0.6749688", "0.6723294", "0.6714908", "0.67148715", "0.6711706", "0.6687572", "0.6679487", "0.6673733", "0.66616225", "0.66601", "0.6649015", "0.6649015", "0.6646058", "0.6641649", "0.6622454", "0.66091704", "0.66040653", "0.66036403", "0.6602163", "0.66005236", "0.6597514", "0.6580969", "0.65755904", "0.65686285", "0.6547334", "0.65404904", "0.65377784", "0.65174395", "0.651271", "0.6498691", "0.6498691", "0.6498691", "0.6498691", "0.6497569", "0.649652", "0.6495443", "0.6485715", "0.6485715", "0.6485715", "0.64752465", "0.64734584", "0.6470216", "0.6464565", "0.64619094", "0.6453423", "0.6448664", "0.6447042", "0.6437305", "0.64264345", "0.6422538", "0.6415907", "0.6413337", "0.6406744", "0.6406047", "0.64019823", "0.6399974", "0.6393992", "0.6392982", "0.63853693", "0.63841033", "0.63822615", "0.6369835", "0.63669693", "0.6365718" ]
0.6913578
13
notice: difference between refresh_content_by_path and refresh_content 1. path is not provided, content_json should comment; 2. path_str is replaced by cur_dir_path;
function refresh_content(){ var content_ele = document.getElementById("id_content"); var content_width = content_ele.clientWidth; //content_json = file_arch_json[path_str]; if(content_json == null){ return null; } //console.log("in function refresh element element:" + file_arch_json); //console.log("in function refresh element element:" + path_str + "\n" + JSON.stringify(content_json)); var content_row = document.getElementById("id_content_row"); if(content_row != null){ content_ele.removeChild(content_row); } content_row = document.createElement("div"); content_row.id = "id_content_row"; content_row.className = "style_content_row"; var file; for(var i=0;i<content_json.length;i++){ file = create_div_by_path(cur_dir_path, content_json[i]); content_row.appendChild(file); } content_ele.appendChild(content_row); function getValue(str){ return parseInt(str.substring(0, str.length-2)) } file_style = window.getComputedStyle(file); file_margin_right = getValue(file_style.marginLeft); file_extral_space = file_margin_right * 2 + getValue(file_style.borderLeftWidth) + getValue(file_style.borderRightWidth); file_width = getValue(file_style.width); file_height = getValue(file_style.height); file_offset_width = file_width + file_extral_space; file_offset_height = file_height + file_extral_space; content_row_style = window.getComputedStyle(content_row); //console.log('content_row_style:%r', content_row_style); content_row_width_extral = getValue(content_row_style.paddingLeft); var cols_per_row = parseInt( (content_width - content_row_width_extral) / file_offset_width ); content_row_width = cols_per_row * file_offset_width + content_row_width_extral; content_row_height = (parseInt(content_json.length/cols_per_row) + 1) * (file_offset_height) + content_row_width_extral; content_row.style.width = content_row_width + "px"; content_row.style.height = content_row_height + "px"; //notice: correct value get must after content_row_width is set. content_row_left = content_row.offsetLeft;//content_row_style.left; content_row_top = content_row.offsetTop;//content_row_style.top; content_row_right = content_row_left + content_row_width; content_row_bottom = content_row_top + content_row_height; var child = null; var row_cnt = 0; var col_cnt = 0; var pos_cnt = 0; for(child = content_row.firstElementChild; child != null; child = child.nextElementSibling, pos_cnt++){ row_cnt = parseInt(pos_cnt / cols_per_row); col_cnt = pos_cnt % cols_per_row; file_left = content_row_left + content_row_width_extral + file_margin_right + file_offset_width * col_cnt; file_top = content_row_top + content_row_width_extral + file_margin_right + file_offset_height * row_cnt; child.style.left = file_left + 'px'; child.style.top = file_top + 'px'; //console.log('child' + pos_cnt + ': ' + file_left + ' - ' + file_top); } return content_ele; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDirContent(path) {\n\t\tshowLoading();\n\t\tcontext_element = {};\n\t\tpath = HTMLDecode(path || cur_path);\n\t\tsendXMLHttpReq(req_url, {\n\t\t\tmode: 'POST',\n\t\t\tparameters: 'cmd=list&src=' + encodeURIComponent(path),\n\t\t\tonsuccess: function (req) {\n\t\t\t\tupdate(req.responseXML);\n\t\t\t\thideLoading();\n\t\t\t}\n\t\t});\n\t}", "getLoadContent(context, { manager, disk, path }) {\n GET.content(disk, path).then((response) => {\n if (response.data.result.status === 'success') {\n context.commit(`${manager}/setDirectoryContent`, response.data);\n }\n });\n }", "refreshTimeline_() {\n var clientId = this.fileContext['clientId'];\n var selectedFolderPath =\n getFolderFromPath(this.fileContext['selectedFilePath']);\n\n if (angular.isUndefined(this.currentFolder)) {\n this.currentFolder = selectedFolderPath;\n }\n\n this.inProgress = true;\n\n var url = 'clients/' + clientId + '/vfs-timeline/' + selectedFolderPath;\n this.grrApiService_.get(url)\n .then(this.onTimelineFetched_.bind(this))\n .finally(function() {\n this.inProgress = false;\n }.bind(this));\n }", "getContents(path, type) {\n const { client, reponame, owner, branch } = this.props;\n const { data } = this.state;\n return new Promise((resolve, reject) => {\n // Check if the ini file is already in the data structure\n if(data[path]) {\n if(data[path].deleted) {\n return resolve({decoded: data[path].decoded, raw: data[path].raw, path: path})\n }\n }\n if(reponame && branch) {\n client.repos.getContents({owner: owner, repo: reponame, ref: branch, path: path})\n .then(raw => {\n var content = null;\n var decodedContent = null;\n\n if (raw.data.size < 100000 && raw.data.encoding === 'base64'){\n content = raw.data.content;\n decodedContent = new Buffer(raw.data.content, 'base64').toString('ascii');\n }\n else {\n console.log(\"Not decoding, size too big: \" + raw.data.size );\n }\n // Hash function\n const hash = crypto.createHash('sha1');\n const hashedData = hash.update(decodedContent);\n data[path] = {\n raw: content,\n decoded: decodedContent,\n sha: raw.data.sha,\n type: type,\n changed: false,\n vcs: 'github',\n origHash: hashedData.digest('hex')\n };\n console.log(`Refreshed ${path}`);\n this.setState({data: Object.assign({}, data)});\n return resolve({ decoded: decodedContent, raw: raw.data.content, path: path});\n }).catch(error => {\n return reject(error);\n });\n }\n });\n }", "fetchPath( newpath: string ) {\n fetch( '/files', {\n method: 'post',\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify({\n path: this.getCWD() ? path.resolve( this.getCWD(), newpath ) : './'\n })\n })\n .then( res => res.json() )\n .then( data => {\n dispatcher.dispatch({\n type: ACTIONS.FILES,\n payload: data\n })\n })\n }", "function refreshTargetPackage(pkg, refreshDir){\n let pkg_url = 'https://'+ cdn_base_address + '/api/packages/';\n let package_url = {};\n package_url.url = pkg_url + pkg.name + '/';//replacePackage_url(pkg, cdn_base_address);\n package_url.type = TYPE_FILE;\n refresh_cache.push(package_url);\n\n let package_file = {};\n package_file.url = pkg_url + pkg.name;//pkg.latest.package_url.replace('pub.dartlang.org', cdn_base_address);\n package_file.type = TYPE_FILE;\n refresh_cache.push(package_file);\n\n let doc_url = 'https://'+ cdn_base_address + '/api/documentation/'\n let document_url = {};\n document_url.url = doc_url + pkg.name;//getDocument_url(pkg, cdn_base_address);\n document_url.type = TYPE_FILE;\n refresh_cache.push(document_url);\n\n //check publisher resource\n let options= {\n url: flutter_base_url + pkg.name + '/publisher',\n gzip: true,\n headers: {\n 'User-Agent' : 'pub.flutter-io.cn'\n }\n };\n // request.get(options, (err, response, body) => {\n // try {\n // let j = JSON.parse(body);\n // if (j.publisherId != null) {\n // let publisher_url = {};\n // publisher_url.url = cdn_publisher_resource_address + j.publisherId + '/packages';\n // publisher_url.type = TYPE_FILE;\n // // refresh_cache.push(publisher_url);\n // }\n // } catch (e) {\n // console.error(currentTimestamp() + 'failed to parse JSON, response-->' + res);\n // }\n // });\n\n //add browser resources\n let browser_package = {};\n browser_package.url = cdn_browser_resource_address + pkg.name;\n browser_package.type = TYPE_FILE;\n // refresh_cache.push(browser_package);\n refresh_cache_chuangcache_file.push(browser_package);\n\n let browser_package2 = {};\n browser_package2.url = cdn_browser_resource_address + pkg.name + '/';\n browser_package2.type = TYPE_FILE;\n // refresh_cache.push(browser_package2);\n refresh_cache_chuangcache_file.push(browser_package2);\n\n let browser_package_versions = {};\n browser_package_versions.url = cdn_browser_resource_address + pkg.name + '/versions';\n browser_package_versions.type = TYPE_FILE;\n // refresh_cache.push(browser_package_versions);\n refresh_cache_chuangcache_file.push(browser_package_versions);\n\n if (refresh_directory && refreshDir) {\n let browser_document = {};\n browser_document.url = cdn_browser_document_address + pkg.name + '/latest/';\n browser_document.type = TYPE_DIRECTORY;\n // refresh_cache.push(browser_document);\n refresh_cache_chuangcache_dir.push(browser_document);\n\n browser_document = {};\n browser_document.url = cdn_browser_document_address + pkg.name + '/p_limit/';\n browser_document.type = TYPE_DIRECTORY;\n // refresh_cache.push(browser_document);\n refresh_cache_chuangcache_dir.push(browser_document);\n }\n}", "updateContent({ state, commit, getters, dispatch }, { response, oldDir, commitName, type }) {\n // if operation success\n if (response.data.result.status === 'success' && oldDir === getters.selectedDirectory) {\n // add/update file/folder in to the files/folders list\n commit(`${state.activeManager}/${commitName}`, response.data[type]);\n // repeat sort\n dispatch('repeatSort', state.activeManager);\n\n // if tree module is showing\n if (type === 'directory' && state.settings.windowsConfig === 2) {\n // update tree module\n dispatch('tree/addToTree', {\n parentPath: oldDir,\n newDirectory: response.data.tree,\n });\n\n // if both managers show the same folder\n } else if (\n state.settings.windowsConfig === 3 &&\n state.left.selectedDirectory === state.right.selectedDirectory &&\n state.left.selectedDisk === state.right.selectedDisk\n ) {\n // add/update file/folder in to the files/folders list (inactive manager)\n commit(`${getters.inactiveManager}/${commitName}`, response.data[type]);\n // repeat sort\n dispatch('repeatSort', getters.inactiveManager);\n }\n }\n }", "function manageRequest(content){\n folderStructure = content;\n\n displayFolders(content);\n}", "function refreshWorkingDir(){\n\tdetachPlayer();\n $.get(fsurl+'?operation=get_node', { 'path' : workingDir})\n .done(function (d) {\n renderFilesTable(d);\n renderBreadcrumb();\n })\n .fail(function () {\n console.log('problem refreshing');\n });\n if (!clipboard.hasOwnProperty('nodes')) $(\"#ff-actions\").slideUp();\n}", "function refreshFolder(_data) {\r\n\tvar _folderType = $('#folderType').val();\r\n\tvar _id = $('#ownerModuleId').val();\r\n\tjQuery.ajax({\r\n\t\turl: currentURL() + '/app/folder/refresh',\r\n\t\tdata: {'_id' : _id, '_type' : _folderType},\r\n cache: false,\r\n contentType: 'application/x-www-form-urlencoded',\r\n dataType: 'text',\r\n type: 'POST',\r\n\t\tbeforeSend: function(req) {\r\n\t\t\tshowWaitDialog('Actualizando documentos...');\r\n\t\t},\r\n\t\tsuccess: function(response) {\r\n\t\t\t// clean folder\r\n\t\t\t$('#folderTreeview').treeview('remove');\r\n\t\t\t// update\r\n\t\t\tvar _dataUpdated = '[' + decodeURIComponent(response.replace(/\\+/g, '%20')) + ']';\r\n\t\t\t//console.log('data updated', _data);\r\n\t\t\t$('#folderTreeview').treeview({\r\n\t\t\t\tshowTags: true,\r\n\t\t\t\tdata: _dataUpdated,\r\n\t\t\t\tonNodeSelected: function(event, node) {\r\n\t\t\t\t\tif (node.nodeId != 0) {\r\n\t\t\t\t\t\tif (node.folder) {\r\n\t\t\t\t\t\t\tgetFolderFields(node.detail);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tshowDocumentDetail(node.detail);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t }\r\n\t\t\t});\r\n\t\t\t//initTreeView(response);\r\n\t\t},\r\n\t\terror : function(xhr, ajaxOptions, thrownError) {\r\n\t\t\tcheckError(xhr);\r\n\t\t},\r\n\t\tcomplete: function() {\r\n\t\t\thideWaitDialog();\r\n\t\t}\r\n\t});\r\n}", "_onFileChanged(sender, change) {\n var _a, _b, _c;\n if (change.type !== 'rename') {\n return;\n }\n let oldPath = change.oldValue && change.oldValue.path;\n let newPath = change.newValue && change.newValue.path;\n if (newPath && this._path.indexOf(oldPath || '') === 0) {\n let changeModel = change.newValue;\n // When folder name changed, `oldPath` is `foo`, `newPath` is `bar` and `this._path` is `foo/test`,\n // we should update `foo/test` to `bar/test` as well\n if (oldPath !== this._path) {\n newPath = this._path.replace(new RegExp(`^${oldPath}/`), `${newPath}/`);\n oldPath = this._path;\n // Update client file model from folder change\n changeModel = {\n last_modified: (_a = change.newValue) === null || _a === void 0 ? void 0 : _a.created,\n path: newPath\n };\n }\n this._path = newPath;\n void ((_b = this.sessionContext.session) === null || _b === void 0 ? void 0 : _b.setPath(newPath));\n const updateModel = Object.assign(Object.assign({}, this._contentsModel), changeModel);\n const localPath = this._manager.contents.localPath(newPath);\n void ((_c = this.sessionContext.session) === null || _c === void 0 ? void 0 : _c.setName(PathExt.basename(localPath)));\n this._updateContentsModel(updateModel);\n this._ycontext.set('path', this._path);\n }\n }", "function loadFileFromPath(path) {\n if (searching == \"scouts\") {\n // copies the scouts file over\n let file = fs.readFileSync(path).toString();\n if (isJsonString(file) && file[0] == \"{\") {\n fs.writeFileSync(\"./resources/scouts.json\", file);\n }\n // copies the schedule file over\n } else if (searching == \"schedule\") {\n let file = fs.readFileSync(path).toString();\n if (isJsonString(file) && file[0] == \"{\") {\n fs.writeFileSync(\"./resources/schedule.json\", file);\n }\n }\n // reload that page!\n window.location.reload();\n}", "function parseJSON( path, content ) {\n\n return JSON.parse( content, function( key, value ) {\n\n if ( options.stripComments && key === \"{{comment}}\" ) return undefined;\n\n // Replace variables in their values\n\n if ( Object.keys( options.variables ).length && typeof value === \"string\" ) {\n value = replaceVariables( value );\n }\n\n var match = ( typeof value === \"string\" ) ? value.match( options.parsePattern ) : null;\n\n if ( match ) {\n var folderPath = getFolder( path ) || \".\";\n var fullPath = folderPath + \"/\" + match[ 1 ];\n\n return isDirectory( fullPath ) ? parseDirectory( fullPath ) : parseFile( fullPath );\n }\n\n return value;\n\n } );\n }", "function remoteSetContentAfterOpen(filepathArg) {\n\tvar hasExecuted = false; //closure variable\n\n\tif (!hasExecuted) { //if never executed before (aka if hasExecuted has still the value it was initialized with)\n\t\thasExecuted = true; //set it to true to prevent execution next time\n\t\tfilepath = filepathArg;\n\t\tfs.readFile(filepathArg, function (err, data) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(\"Read failed: \" + err);\n\t\t\t}\n\t\t\tsetContent(data);\n\t\t});\n\t} else {\n\t\tconsole.log(\"remoteSetContentAfterOpen can only be called once to prevent resetting content accidently\")\n\t}\n}", "function updateJsonInTree(path, callback) {\n return (host, context) => {\n if (!host.exists(path)) {\n host.create(path, fileutils_1.serializeJson(callback({}, context)));\n return host;\n }\n host.overwrite(path, fileutils_1.serializeJson(callback(readJsonInTree(host, path), context)));\n return host;\n };\n}", "updateTree(uri, content) {\n let tree = this.getTree(uri);\n if (tree) {\n tree = this.parser.parse(content);\n this.trees.set(uri, tree);\n }\n else {\n tree = this.createTree(uri, content);\n }\n return tree;\n }", "function updateContent(/** @type {string} */ text) {\n\t\tlet json;\n\t\ttry {\n\t\t\tjson = JSON.parse(text);\n\t\t} catch {\n\t\t\tjsonDoccument.style.display = 'none';\n\t\t\treturn;\n\t\t}\n\t\tjsonDoccument.style.display = '';\n\t\terrorContainer.style.display = 'none';\n\n\t\tjsonDoccument.innerHTML = '';\n\t\tfor (const note of json.editors || []) {\n\t\t\tconst rootObject = document.createElement('div');\n\t\t\trootObject.className = 'root';\n\t\t\tjsonDoccument.appendChild(rootObject);\n\n\t\t\tconst deleteButton = document.createElement('button');\n\t\t\tdeleteButton.className = 'delete-button';\n\t\t\tdeleteButton.addEventListener('click', () => {\n\t\t\t\tvscode.postMessage({ type: 'delete', id: note.id, });\n\t\t\t});\n\t\t\trootObject.appendChild(deleteButton);\n\t\t}\n\n\t\tjsonDoccument.appendChild(addObjectButtonContainer);\n jsonDoccument.appendChild(addArrayButtonContainer);\n jsonDoccument.appendChild(addBooleanButtonContainer);\n jsonDoccument.appendChild(addNumberButtonContainer);\n\t}", "function changeContentDIV(el){\n\n var fileDIV = document.getElementById(\"files\");\n var typeDIV = document.getElementById(\"types\");\n\n var path = el.path.split(\"/\");\n\n var list = [];\n\n if(path[0] == \"\"){\n\n for(var i = 0; i < folderStructure.length; i++){\n\n if(folderStructure[i].type != \"folder\"){\n list.push({\n name: folderStructure[i].name,\n path: folderStructure[i].path,\n description: folderStructure[i].description\n });\n }\n\n }\n\n } else {\n\n var done = false;\n var content = folderStructure;\n var pathIndex = 0;\n\n while(done == false){\n\n for(var i = 0; i < content.length; i++){\n\n if(content[i].name == path[pathIndex]){\n\n content = content[i].contents\n pathIndex++;\n\n if(pathIndex == path.length){\n\n for(var j = 0; j < content.length; j++){\n if(content[j].type != \"folder\"){\n list.push({\n name: content[j].name,\n path: content[j].path,\n description: content[j].description\n });\n }\n\n }\n\n done = true;\n break;\n } else {\n break;\n }\n\n }\n\n }\n\n }\n\n }\n\n\n fileDIV.innerHTML = \"\";\n typeDIV.innerHTML = \"\";\n\n if(list.length == 0){\n\n var DOM = document.createElement(\"p\");\n DOM.innerHTML = \"No files in directory\";\n\n fileDIV.append(DOM);\n\n return;\n }\n\n for(var i = 0; i < list.length; i++){\n\n var fileDOM = document.createElement(\"p\");\n fileDOM.innerHTML = list[i].name;\n fileDOM.path = list[i].path;\n fileDOM.setAttribute(\"class\", \"underLineText\");\n fileDOM.setAttribute(\"onclick\", \"openFile(this)\");\n\n fileDIV.appendChild(fileDOM);\n\n var typeDOM = document.createElement(\"p\");\n typeDOM.innerHTML = list[i].description;\n\n typeDIV.appendChild(typeDOM);\n\n }\n}", "function populateJSONObjFolder(action, jsonObject, folderPath) {\n var myitems = fs.readdirSync(folderPath);\n myitems.forEach((element) => {\n var statsObj = fs.statSync(path.join(folderPath, element));\n var addedElement = path.join(folderPath, element);\n if (statsObj.isDirectory() && !/(^|\\/)\\.[^\\/\\.]/g.test(element)) {\n if (irregularFolderArray.includes(addedElement)) {\n var renamedFolderName = \"\";\n if (action !== \"ignore\" && action !== \"\") {\n if (action === \"remove\") {\n renamedFolderName = removeIrregularFolders(element);\n } else if (action === \"replace\") {\n renamedFolderName = replaceIrregularFolders(element);\n }\n jsonObject[\"folders\"][renamedFolderName] = {\n type: \"local\",\n folders: {},\n files: {},\n path: addedElement,\n action: [\"new\", \"renamed\"],\n };\n element = renamedFolderName;\n }\n } else {\n jsonObject[\"folders\"][element] = {\n type: \"local\",\n folders: {},\n files: {},\n path: addedElement,\n action: [\"new\"],\n };\n }\n populateJSONObjFolder(\n action,\n jsonObject[\"folders\"][element],\n addedElement\n );\n } else if (statsObj.isFile() && !/(^|\\/)\\.[^\\/\\.]/g.test(element)) {\n jsonObject[\"files\"][element] = {\n path: addedElement,\n description: \"\",\n \"additional-metadata\": \"\",\n type: \"local\",\n action: [\"new\"],\n };\n }\n });\n}", "function refreshFile() {\n const local = false;\n if (!local) {\n $('#notify_button').hide();\n $('.notify_log').hide();\n }\n var refreshUrl = (window.location.origin) ? window.location.origin + '/on_load' : 'http://127.0.0.1:3000/on_load';\n //var refreshURL = 'http://localhost:3000/on_load';\n fetch(refreshUrl, {\n method: \"GET\",\n headers:{'Content-type': 'application/json',\n 'User-agent': 'request'\n },\n json: true\n }).then(function (response) {\n response = response.clone();\n response.json().then(data => {\n for(var i = 0; i < data.length; i++) {\n if (data[i] !== '') {\n update_sub(data[i]);\n disableSub(data[i]);\n }\n }\n var container = $('#current_sub_container');\n console.log((container.height()));\n container.height(150);\n container.css(\"overflow-y\", \"scroll\");\n });\n console.log('ready for subscriptions');\n }).catch(function (error) {\n console.log(error);\n });\n}", "async function awaitContents(path) {\n\t\ttry {\n\t\t\tsetLoading(true);\n\t\t\tconst contents = await api.getContents(path);\n\t\t\tsetContents(contents);\n\t\t} finally {\n\t\t\tsetLoading(false);\n\t\t}\n\t}", "refreshTree() {\r\n files = [];\r\n files = findFiles(path.join(resLocation, \"CNC files\"));\r\n files.unshift(allFilesName);\r\n let additionalFolders = vscode.workspace.getConfiguration(\"AutodeskPostUtility\").get(\"customCNCLocations\")\r\n if (additionalFolders.folders) {\r\n for (let i = 0; i < additionalFolders.folders.length; i++) {\r\n if (fs.existsSync(additionalFolders.folders[i])) {\r\n files = files.concat([[path.basename(additionalFolders.folders[i]),additionalFolders.folders[i]]]); \r\n }\r\n }\r\n }\r\n this._onDidChangeTreeData.fire();\r\n }", "async loadDocumentContent (documentPath) {\n const doc = await this.fetch(`/load_document?d=${documentPath}`) \n return this.parseDocument(doc);\n }", "function src( path ){\n\t\treturn json.get( path )\n\t\t.then( function( data ){\n\t\t\t\n\t\t\t// TODO: Check the user...\n\t\t\t\n\t\t\t// Delete the initial JSON src file\n\t\t\treturn del( path, urn );\n\t\t});\n\t}", "refresh() {\n this.changefolder(); //changefolder with empty folder - just refresh\n }", "function updateJson(host, path, updater) {\n const updatedValue = updater(readJson(host, path));\n writeJson(host, path, updatedValue);\n}", "function loadDirectoryContent(fs) {\n fs.root.createReader().readEntries(function success(entries) {\n var i, files = [];\n\n for (i = 0; i < entries.length; i++) {\n if (entries[i].isFile) {\n files.push(entries[i].name);\n }\n }\n\n result.resolve({\n files: files,\n path: path\n });\n }, handleError);\n }", "function folder_content(){\n\n\t$.ajax({\n\t\t type: \"POST\",\n\t\t url: \"website_code/php/folderproperties/folder_content.php\",\n\t\t data: {folder_id: String(window.name).substr(0,String(window.name).indexOf(\"_\"))},\n\t})\n\t.done(function(response){\n\t\ttab_stateChanged(response, 'panelContent');\n\t})\n\n}", "overwrite(path, content) {\n return this._base.overwrite(this._fullPath(path), content);\n }", "overwrite(path, content) {\n return this._base.overwrite(this._fullPath(path), content);\n }", "updateJson(pathJson, data) {\r\n pathJson = path + pathJson;\r\n if(this.isJSON(data)==1)\r\n {\r\n data=JSON.stringify(data);\r\n }\r\n\r\n fs.writeFile(pathJson, data, function (err) {\r\n if (err) {\r\n return console.error(err);\r\n }\r\n });\r\n\r\n return 1;\r\n }", "populateFiles(dataresponse) {\n //console.log(\"filepanel.populateFiles()\")\n Vfstorage.setValue(\"filepanel\" + this.panelid, this.path);\n //it is assumed that first element is \".\" describing the content of current dir\n if (dataresponse.length>0 && dataresponse[0].name === \".\") this.currentdir = dataresponse.shift();\n else this.currentdir = null;\n //console.log(\"populateFiles currentdir:\",this.currentdir);\n this.files = dataresponse;//JSON.parse(dataresponse);//,this.dateTimeReviver);//populate window list\n this.filescount = this.files.length + this.resources.length;\n let that = this;\n this.files.forEach(function (item, index, arr) {\n if (!arr[index].name && arr[index].alias) {\n arr[index].name = arr[index].alias;\n arr[index].attributes = 16;\n arr[index].date = \"\";\n arr[index].filetype = 8;\n arr[index].nicesize = \"VF-DIR\";arr[index].isdir =true;\n }\n arr[index].provenance = false;\n //console.log(arr[index]);\n arr[index].ext = that.extension(arr[index].name); //may return undefined\n arr[index].nicedate = that.dateTimeReviver(null, arr[index].date);\n if (!arr[index].ext) arr[index].ext = \"\";\n arr[index].available = !!(arr[index].filetype & 8); //available if the filetype attribute contains flag 8\n if (arr[index].attributes & 16) { if (!arr[index].nicesize) {arr[index].nicesize = \"DIR\";arr[index].isdir =true;} }\n else {\n arr[index].isdir =false;\n //convert to 4GB or 30MB or 20kB or 100b\n arr[index].nicesize = ~~(arr[index].size / 1000000000) > 0 ? ~~(arr[index].size / 1000000000) + \"GB\" : (~~(arr[index].size / 1000000) > 0 ? ~~(arr[index].size / 1000000) + \"MB\" : (~~(arr[index].size / 1000) > 0 ? ~~(arr[index].size / 1000) + \"kB\" : arr[index].size + \" b\"));\n }\n });\n if (this.path.length > 0) {//non root path\n this.addUpDir();\n }\n\n }", "addUsingPath(url, content, parameters = { Overwrite: false }) {\r\n const path = [`AddUsingPath(decodedurl='${url}'`];\r\n if (parameters) {\r\n if (parameters.Overwrite) {\r\n path.push(\",Overwrite=true\");\r\n }\r\n if (parameters.AutoCheckoutOnInvalidData) {\r\n path.push(\",AutoCheckoutOnInvalidData=true\");\r\n }\r\n if (!stringIsNullOrEmpty(parameters.XorHash)) {\r\n path.push(`,XorHash=${parameters.XorHash}`);\r\n }\r\n }\r\n path.push(\")\");\r\n return new Files_1(this, path.join(\"\"))\r\n .postCore({\r\n body: content,\r\n }).then((response) => {\r\n return {\r\n data: response,\r\n file: this.getByName(url),\r\n };\r\n });\r\n }", "function successCallbackWithFsCaching(resp, status, headers, config) {\n\t\t\tvar docs = [];\n\n\t\t\tvar totalEntries = resp.items.length;\n\n\t\t\tresp.items.forEach(function(entry, i) {\n\t\t\t\tvar doc = {\n\t\t\t\t\ttitle : entry.title,\n\t\t\t\t\tupdatedDate : Util.formatDate(entry.modifiedDate),\n\t\t\t\t\tupdatedDateFull : entry.modifiedDate,\n\t\t\t\t\ticon : entry.iconLink,\n\t\t\t\t\talternateLink : entry.alternateLink,\n\t\t\t\t\tsize : entry.fileSize ? '( ' + entry.fileSize + ' bytes)' : null\n\t\t\t\t};\n\n\t\t\t\t// 'http://gstatic.google.com/doc_icon_128.png' -> 'doc_icon_128.png'\n\t\t\t\tdoc.iconFilename = doc.icon.substring(doc.icon.lastIndexOf('/') + 1);\n\n\t\t\t\t// If file exists, it we'll get back a FileEntry for the filesystem URL.\n\t\t\t\t// Otherwise, the error callback will fire and we need to XHR it in and write it to the FS.\n\t\t\t\tvar fsURL = fs.root.toURL() + FOLDERNAME + '/' + doc.iconFilename;\n\t\t\t\twindow.webkitResolveLocalFileSystemURL(fsURL, function(entry) {\n\t\t\t\t\tconsole.log('Fetched icon from the FS cache');\n\n\t\t\t\t\tdoc.icon = entry.toURL(); // should\n\t\t\t\t\t// be === to fsURL, but whatevs.\n\n\t\t\t\t\t$scope.docs.push(doc);\n\n\t\t\t\t\t// Only want to sort and call $apply() when we have all entries.\n\t\t\t\t\tif (totalEntries - 1 == i) {\n\t\t\t\t\t\t$scope.docs.sort(Util.sortByDate);\n\t\t\t\t\t\t$scope.$apply(function($scope) {\n\t\t\t\t\t\t}); // Inform angular we made changes.\n\t\t\t\t\t}\n\t\t\t\t}, function(e) {\n\t\t\t\t\t$http.get(doc.icon, {\n\t\t\t\t\t\tresponseType : 'blob'\n\t\t\t\t\t}).success(function(blob) {\n\t\t\t\t\t\tconsole.log('Fetched icon via XHR');\n\t\t\t\t\t\tblob.name = doc.iconFilename; // Add icon filename to blob.\n\t\t\t\t\t\twriteFile(blob); // Write is async, but that's ok.\n\t\t\t\t\t\tdoc.icon = window.URL.createObjectURL(blob);\n\t\t\t\t\t\t$scope.docs.push(doc);\n\t\t\t\t\t\tif (totalEntries - 1 == i) {\n\t\t\t\t\t\t\t$scope.docs.sort(Util.sortByDate);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t});\n\t\t\t});\n\t\t}", "listContents(path, recursive, cb) {\n\t\tconst promise = Path.normalizePath(path).then((path) => this.adapter.listContents(path, recursive));\n\n\t\tif (cb) {\n\t\t\tpromise.nodeify(cb);\n\t\t}\n\n\t\treturn promise;\n\t}", "getFileContent(path: string) {\n fs.readFile(path, 'utf8', (err, data) => {\n this.editorContentCallback(data, path);\n });\n }", "refresh () {\n const provider = this.fileProviderOf('/')\n // emit folderAdded so that File Explorer reloads the file tree\n provider.event.emit('folderAdded', '/')\n }", "function refreshData() {\n \n //the server name is not recognized locally (running a browser from the vm),\n //so change it to localhost\n if ( location.hostname == 'localhost' ) running_local = true;\n \n //ajax call to get data\n var fname = document.getElementById(\"fname\").value;\n var display = document.getElementById(\"divcontent\");\n\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"POST\", \"/scripts/FileProcessor.php\");\n xmlhttp.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\",\n \"User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36\"\n );\n xmlhttp.send(\"fname=\" + fname);\n xmlhttp.onreadystatechange = function() {\n if (this.readyState === 4 & this .status === 200 ) {\n// console.log(this.responseText);\n display.innerHTML = this.responseText;\n //(running_local)?this.responseText.replace('https://api.desb-bsed.dev.global.gc.ca','http://localhost'):this.responseText;\n }\n else {\n display.innerHTML = this.readyState + \" Loading...\" + this.status;\n// display.innerHTML = this.responseText;\n }\n }\n}", "function successCallbackWithFsCaching(resp, status, headers, config) {\n var docs = [];\n var totalEntries = resp.items.length;\n console.log(totalEntries);\n resp.items.forEach(function (entry, i) {\n var doc = {\n title: entry.title,\n updatedDate: Util.formatDate(entry.modifiedDate),\n updatedDateFull: entry.modifiedDate,\n icon: entry.iconLink,\n alternateLink: entry.alternateLink,\n size: entry.fileSize ? '( ' + entry.fileSize + ' bytes)' : null\n };\n // 'http://gstatic.google.com/doc_icon_128.png' -> 'doc_icon_128.png'\n doc.iconFilename = doc.icon.substring(doc.icon.lastIndexOf('/') + 1);\n console.log(doc.icon);\n // If file exists, it we'll get back a FileEntry for the filesystem URL.\n // Otherwise, the error callback will fire and we need to XHR it in and\n // write it to the FS.\n var fsURL = fs.root.toURL() + FOLDERNAME + '/' + doc.iconFilename;\n window.webkitResolveLocalFileSystemURL(fsURL, function (entry) {\n console.log('Fetched icon from the FS cache');\n doc.icon = entry.toURL();\n // should be === to fsURL, but whatevs.\n $scope.docs.push(doc);\n // Only want to sort and call $apply() when we have all entries.\n if (totalEntries - 1 == i) {\n $scope.docs.sort(Util.sortByDate);\n $scope.$apply(function ($scope) {\n }); // Inform angular we made changes.\n }\n }, function (e) {\n $http.get(doc.icon, { responseType: 'blob' }).success(function (blob) {\n console.log('Fetched icon via XHR');\n blob.name = doc.iconFilename;\n // Add icon filename to blob.\n writeFile(blob);\n // Write is async, but that's ok.\n doc.icon = window.URL.createObjectURL(blob);\n $scope.docs.push(doc);\n if (totalEntries - 1 == i) {\n $scope.docs.sort(Util.sortByDate);\n }\n });\n });\n });\n }", "function build_content(path) {\r\n var _con = content,\r\n // package.json\r\n json = '{' + eol, ce = program.css, dir_arr = build_path(path), engine = program.template;\r\n json += ' \"name\": \"' + program.name + '\" \\'' + eol;\r\n json += '+\\' , \"version\": \"0.0.1-alpha\" \\'' + eol;\r\n json += '+\\' , \"private\": true \\'' + eol;\r\n json += '+\\' , \"dependencies\": { \\'' + eol;\r\n if(program.css)\r\n json += '+\\' \"' + program.css + '\": \">= 0.0.1\" \\'' + eol;\r\n if(program.template)\r\n json += ' +\\' , \"' + program.template + '\": \">= 0.0.1\" \\'' + eol;\r\n json += '+\\' } \\'' + eol;\r\n json += '+\\'}';\r\n var css_content = 'var ' + engine + 'Layout=' + config.template[engine + 'Layout'] + eol + 'var ' + engine + 'Index=' + config.template[engine + 'Index'] + eol;\r\n _con = _con.replace(\"{name}\", program.name).replace(\"{json}\", json.replace(/\\r\\n/,''));\r\n _con = _con.replace(\"{css_template}\", css_content);\r\n _con = _con.replace(\"{create_css}\", ' write(path + \"' + config.custum_dir.css[ce] + '/style.css\", \"/*please write your '+ program.css +' code here!*/\");' + eol);\r\n _con = _con.replace(\"{create_js}\", '//todo: choose some lib to use ' + program.architec + ' by yourself!'+eol);\r\n _con = _con.replace(\"{create_template}\", '//todo: load template to use ' + program.css + ' by yourself!' + eol);\r\n _con = _con.replace(\"{create_html}\", 'write(path +\"/index.html\",index_html);'+eol);\r\n _con = _con.replace(\"{dir}\",\"'\"+ dir_arr+\"'.split(',').join(' '+path).split(' ').slice(1)\"+eol);\r\n return _con;\r\n}", "function refreshDirectory () {\n\tvar lmesg = $('#loading_message').clone();\n\t$('#directory').empty().append( lmesg.contents() );\n $('#directory').load( _get_url([\"directory\"]), \n \tfunction(response, status, xhr) {\n\t\t\tif (status == \"error\") {\n\t\t\t\tvar msg = \"An error occurred: \";\n\t\t\t\t$(\"#directory\").html(msg + xhr.status + \" \" + xhr.statusText);\n\t\t\t} else {\n\t\t\t\tif( textOnLoad != \"\" ) {\n\t\t\t\t\t// Call the click callback for the relevant text, if it is\n\t\t\t\t\t// in the page.\n\t\t\t\t\t$('#'+textOnLoad).click();\n\t\t\t\t\ttextOnLoad = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n}", "function loadContent(url, back_forward) {\r\n\t$(\"#loader\").show();\r\n\t\r\n\tvar search_timestamp = getQueryVariable(\"timestamp\", url);\r\n\t\r\n\tif (cached_data.hasOwnProperty(url) == 1) {\r\n\t\tupdateContent(cached_data[url], search_timestamp, back_forward);\r\n\t} else {\r\n\t\t$.ajax({\r\n\t\t\turl: domain + \"content\",\r\n\t\t\tdataType: \"json\",\r\n\t\t\tdata: {id: cleanURL(url)},\r\n\t\t\tasync: true,\r\n\t\t\tsuccess: function(content) {\r\n\t\t\t\tif ($.parseJSON(content.Cache) === true) {\r\n\t\t\t\t\tcached_data[url] = content;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tupdateContent(content, search_timestamp, back_forward);\r\n\t\t\t},\r\n\t\t\terror: function(xhr, textStatus, error) {\r\n\t\t\t\twindow.location.href = url;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "function syncTreeNode(content, path, initialLoad) {\n\n if (infiniteMode) {\n return;\n }\n\n if (!$scope.content.isChildOfListView) {\n navigationService.syncTree({ tree: \"media\", path: path.split(\",\"), forceReload: initialLoad !== true }).then(function (syncArgs) {\n $scope.page.menu.currentNode = syncArgs.node;\n });\n }\n else if (initialLoad === true) {\n\n //it's a child item, just sync the ui node to the parent\n navigationService.syncTree({ tree: \"media\", path: path.substring(0, path.lastIndexOf(\",\")).split(\",\"), forceReload: initialLoad !== true });\n\n //if this is a child of a list view and it's the initial load of the editor, we need to get the tree node\n // from the server so that we can load in the actions menu.\n umbRequestHelper.resourcePromise(\n $http.get(content.treeNodeUrl),\n 'Failed to retrieve data for child node ' + content.id).then(function (node) {\n $scope.page.menu.currentNode = node;\n });\n }\n }", "updateTreeView(path, type) {\n\n // function to create tree view\n let merge = (treeView, tempView, type) =>{\n // temp View has a single key always\n key = Object.keys(tempView);\n // if key not present then add it to treeView object\n if(Object.keys(treeView).indexOf(key[0]) == -1)\n {\n if(type == \"add\")\n treeView[key] = tempView[key];\n }\n // if key present then search for child key int treeView object\n else\n {\n merge(treeView[key], tempView[key], type);\n }\n }\n\n // function to create tree view\n let deleteFile = (treeView, tempView, type) =>{\n // temp View has a single key always\n key = Object.keys(tempView);\n // if key not present then add it to treeView object\n if(treeView[key[0]] == tempView[key[0]])\n {\n if(type == \"uplink\")\n delete treeView[key];\n }\n // if key present then search for child key int treeView object\n else\n {\n deleteFile(treeView[key], tempView[key], type);\n }\n }\n\n let update = (path, type) => {\n // return the details of the current project in atom\n let object = atom.project;\n // get the path of the project folder in the atom\n let root_path = object['rootDirectories'][0]['realPath'];\n // get the project folder name\n let projectFolderName = root_path.substring(root_path.lastIndexOf(\"\\\\\")+1);\n // relative path = path according to tree view from project\n let itemRelativePathArray = path.substring(path.lastIndexOf(projectFolderName));\n itemRelativePathArray = itemRelativePathArray.split(\"\\\\\");\n // actual path = original path of file on system\n let itemActualPath = path;\n // if path is of file\n if(itemRelativePathArray[itemRelativePathArray.length-1].indexOf(\".\")!=-1 && type != \"uplink\")\n {\n if(itemRelativePathArray[itemRelativePathArray.length-1].indexOf(\".html\")!=-1)\n {\n _fs_plus.readFile(itemActualPath, \"utf8\", (err,data) => {\n dataElement[\"html\"][itemRelativePathArray[itemRelativePathArray.length-1]] = data;\n });\n }\n if (itemRelativePathArray[itemRelativePathArray.length-1].indexOf(\".css\")!=-1) {\n _fs_plus.readFile(itemActualPath, \"utf8\", (err,data) => {\n dataElement[\"css\"][itemRelativePathArray[itemRelativePathArray.length-1]] = data;\n });\n }\n if (itemRelativePathArray[itemRelativePathArray.length-1].indexOf(\".js\")!=-1) {\n _fs_plus.readFile(itemActualPath, \"utf8\", (err,data) => {\n dataElement[\"js\"][itemRelativePathArray[itemRelativePathArray.length-1]] = data;\n });\n }\n // create temp object of file\n for(let i = itemRelativePathArray.length - 1; i >= 0 ; i--)\n {\n if(i == itemRelativePathArray.length - 1)\n tempView = { [itemRelativePathArray[i]] : itemActualPath}; // assign the value\n else\n tempView = { [itemRelativePathArray[i]] : tempView}; //put the previous object\n }\n // merge current path object with original treeView object\n if(type != \"change\")\n merge(treeView, tempView, type);\n // reset the temp object\n tempView = {};\n }\n\n if(itemRelativePathArray[itemRelativePathArray.length-1].indexOf(\".\")!=-1 && type == \"uplink\")\n {\n if(itemRelativePathArray[itemRelativePathArray.length-1].indexOf(\".html\")!=-1)\n {\n delete dataElement[\"html\"][itemRelativePathArray[itemRelativePathArray.length-1]];\n }\n if (itemRelativePathArray[itemRelativePathArray.length-1].indexOf(\".css\")!=-1) {\n delete dataElement[\"css\"][itemRelativePathArray[itemRelativePathArray.length-1]];\n }\n if (itemRelativePathArray[itemRelativePathArray.length-1].indexOf(\".js\")!=-1) {\n delete dataElement[\"js\"][itemRelativePathArray[itemRelativePathArray.length-1]];\n }\n // create temp object of file\n for(let i = itemRelativePathArray.length - 1; i >= 0 ; i--)\n {\n if(i == itemRelativePathArray.length - 1)\n tempView = { [itemRelativePathArray[i]] : itemActualPath}; // assign the value\n else\n tempView = { [itemRelativePathArray[i]] : tempView}; //put the previous object\n }\n // merge current path object with original treeView object\n if(type != \"change\")\n deleteFile(treeView, tempView, type);\n // reset the temp object\n tempView = {};\n }\n console.log(treeView);\n console.log(dataElement);\n }\n\n if( type==\"add\")\n {\n update(path, \"add\");\n }\n if( type==\"uplink\")\n {\n update(path, \"uplink\");\n }\n if( type==\"change\")\n {\n update(path, \"change\");\n }\n }", "function loadFiles(currentPath) {\n lastPath = currentPath;\n\n $(\"#iframeUpload\").contents().find(\"input[type=text]\").val(currentPath);\n\n $('#thumbs').html(\"<div class='thumbsLoader'><p>Searching for files ...<p><img src='/img/ajax-loader.gif' /></div>\");\n\n $.ajax({\n url: 'ExplorerEngine.aspx',\n data: \"action=getfiles&dir=\" + currentPath,\n dataType: \"json\",\n cache: false,\n success: showFiles\n });\n currentImg = null;\n}", "function loadContent(fileName){\n\t$(\"#contentwrapper\").load(\"../content/\" + fileName);\n\n}", "function onSelectTreeDir(path) {\r\n\tcurrent_path = path;\r\n\tselectItems([]);\r\n\t$('#status').html(path);\r\n\tcache.get(path, function(data) {\r\n\t\tconsole.debug(data);\r\n\t\tvar content = {\r\n\t\t\ttotal: data.files.length,\r\n\t\t\trows: data.files\r\n\t\t};\r\n\t\t$('#file_list').datagrid('loadData', content);\r\n\t\t$('#icons_list').datagrid('loadData', content);\r\n\t\t\r\n\t});\r\n}", "function actOnChangedContent (changedContent) {\n var newContent = changedContent.added;\n var modifiedContent = changedContent.modified;\n var removedContent = changedContent.removed;\n\n for (var fileName in newContent) {\n fetchContent (newContent[fileName], storeNewContent, \n changedContent.timestamp, changedContent.id, \n changedContent.authorEmail, changedContent.username,\n changedContent.name\n );\n }\n\n for (var fileName in modifiedContent) {\n console.log ('Modified files: ' + modifiedContent[fileName]);\n fetchContent (modifiedContent[fileName], storeNewContent, \n changedContent.timestamp, changedContent.id, \n changedContent.authorEmail, changedContent.username,\n changedContent.name\n );\n }\n\n}", "function getFileList(path) {\n url = \"./files\" + escapePathForURI(path);\n $.ajax({\n url: url,\n type: \"GET\",\n cache: false,\n dataType: \"json\", // The type of data that you're expecting back from the server.\n success: function (response) {\n $(\"#status\").remove();\n list = procFileList(response);\n sortFileList(list, \"parsedDate\", true);\n genHTMLFileList(list, path);\n },\n error: function(xhr, status, error) {\n errMsg = xhr.responseText;\n $(\"#status\").html(errMsg);\n //window.location.replace(url); // can't use the \"back\" button\n }\n }); \n}", "setContent(content) {\r\n return this.clone(File, \"$value\", false).postCore({\r\n body: content,\r\n headers: {\r\n \"X-HTTP-Method\": \"PUT\",\r\n },\r\n }).then(_ => new File(this));\r\n }", "syncKeysForPath(path, json) {\n // search from leaf to root, to find the first path with entry in keys map\n for (let i = path.length - 1; i >= 0; i--) {\n const currentPath = path.slice(0, i);\n const currentPathString = this.pathUtilService.toPathString(currentPath);\n if (this.keysMap[currentPathString]) {\n // path[i] is key that should be added to currentPat\n const key = path[i];\n // if currentPath has the key\n if (this.keysMap[currentPathString].has(key)) {\n // just build the store keys map for that /current/path/key if it is object or array\n const keyPath = currentPath.concat(key);\n const keySchema = this.jsonSchemaService.forPathArray(keyPath);\n if (keySchema.type === 'object' || keySchema.type === 'array') {\n this.buildKeysMapRecursivelyForPath(json.getIn(keyPath), keyPath, keySchema);\n }\n // if currentPath doesn't have the key\n }\n else {\n const currentSchema = this.jsonSchemaService.forPathArray(currentPath);\n // if currentPath is to a table list\n if (currentSchema.componentType === 'table-list') {\n // have to rebuild keys map for it because key is here an index we don't know what to add\n this.buildKeysMapRecursivelyForPath(json.getIn(currentPath), currentPath, currentSchema);\n // if not to a table list.\n }\n else {\n // just add the key which will build keys map for /current/path/key as well if needed\n this.addKey(currentPathString, key, currentSchema, json.getIn(currentPath.concat(path[i])));\n }\n }\n // break when a entry found for a path in keys map\n break;\n }\n }\n }", "function generateIndex(path1, requestObject) {\n //return \"<h1>Index generation point xd</h1>\";\n var indexTemplate;\n var dirContentTemplate;\n var dirContent = fs.readdirSync(path1);\n var parsedDirList = \"\";\n try {\n indexTemplate = fs.readFileSync(\"resources/indexTemplate.html\").toString();\n dirContentTemplate = fs.readFileSync(\"resources/dirContentTemplate.html\").toString();\n dirContentTemplate = dirContentTemplate.substring(dirContentTemplate.indexOf(\"[start]\") + 7);\n } catch(error) {\n console.log(\"[ERROR] - \" + error);\n }\n // alright, so, for sort first directories, then files, it's simple, we do on separate for loops\n // unless there's an more nicely way\n for(c = 0; c < dirContent.length; c++) {\n //dir loop\n if(fs.existsSync(path1 + dirContent[c]) && fs.statSync(path1 + dirContent[c]).isDirectory()) {\n parsedDirList+=dirContentTemplate + \"\\r\\n\\t\\t\\t\";\n parsedDirList=parsedDirList.replace(\"{imageObject}\", \"<img src=\\\"/rsrcfs/visualRes/folder.png\\\"/>\");\n parsedDirList = parsedDirList.replace(\"{modifiedDate}\", fs.statSync(path1 + dirContent[c])[\"mtime\"]);\n parsedDirList = parsedDirList.replace(\"{sizeValue}\", fs.statSync(path1 + dirContent[c])[\"size\"]);\n //parsedDirList = parsedDirList.replace(\"{fileObject}\", dirContent[c]);\n parsedDirList = parsedDirList.replace(\"{fileObject}\", \"<a href=\\\"\" + requestObject.url + dirContent[c] + \"\\\">\" + dirContent[c] + \"</a>\");\n } else if(fs.existsSync(path1 + \"/\" + dirContent[c]) && fs.statSync(path1 + \"/\" + dirContent[c]).isDirectory()) {\n parsedDirList+=dirContentTemplate + \"\\r\\n\\t\\t\\t\";\n parsedDirList=parsedDirList.replace(\"{imageObject}\", \"<img src=\\\"/rsrcfs/visualRes/folder.png\\\"/>\");\n parsedDirList = parsedDirList.replace(\"{modifiedDate}\", fs.statSync(path1 + \"/\" + dirContent[c])[\"mtime\"]);\n parsedDirList = parsedDirList.replace(\"{sizeValue}\", fs.statSync(path1 + \"/\" + dirContent[c])[\"size\"]);\n //parsedDirList = parsedDirList.replace(\"{fileObject}\", dirContent[c]);\n parsedDirList = parsedDirList.replace(\"{fileObject}\", \"<a href=\\\"\" + requestObject.url + \"/\" + dirContent[c] + \"\\\">\" + dirContent[c] + \"</a>\");\n }\n }\n for(d = 0; d < dirContent.length; d++) {\n //file loop\n if(fs.existsSync(path1 + dirContent[d]) && fs.statSync(path1 + dirContent[d]).isFile()) {\n parsedDirList+=dirContentTemplate + \"\\r\\n\\t\\t\\t\";\n parsedDirList=parsedDirList.replace(\"{imageObject}\", \"<img src=\\\"/rsrcfs/visualRes/generic_file.png\\\"/>\");\n parsedDirList = parsedDirList.replace(\"{modifiedDate}\", fs.statSync(path1 + dirContent[d])[\"mtime\"]);\n parsedDirList = parsedDirList.replace(\"{sizeValue}\", fs.statSync(path1 + dirContent[d])[\"size\"]);\n //parsedDirList = parsedDirList.replace(\"{fileObject}\", dirContent[d]);\n parsedDirList = parsedDirList.replace(\"{fileObject}\", \"<a href=\\\"\" + requestObject.url + dirContent[d] + \"\\\">\" + dirContent[d] + \"</a>\");\n } else if(fs.existsSync(path1 + \"/\" + dirContent[d]) && fs.statSync(path1 + \"/\" + dirContent[d]).isFile()) {\n parsedDirList+=dirContentTemplate + \"\\r\\n\\t\\t\\t\";\n parsedDirList=parsedDirList.replace(\"{imageObject}\", \"<img src=\\\"/rsrcfs/visualRes/generic_file.png\\\"/>\");\n parsedDirList = parsedDirList.replace(\"{modifiedDate}\", fs.statSync(path1 + \"/\" + dirContent[d])[\"mtime\"]);\n parsedDirList = parsedDirList.replace(\"{sizeValue}\", fs.statSync(path1 + \"/\" + dirContent[d])[\"size\"]);\n //parsedDirList = parsedDirList.replace(\"{fileObject}\", dirContent[d]);\n parsedDirList = parsedDirList.replace(\"{fileObject}\", \"<a href=\\\"\" + requestObject.url + \"/\" + dirContent[d] + \"\\\">\" + dirContent[d] + \"</a>\");\n }\n }\n //index parsing\n indexTemplate = indexTemplate.replace(\"{serverName}\", \"Guanaco Webserver v/2.1b\");\n indexTemplate = indexTemplate.replace(\"{osType}\", os.type());\n indexTemplate = indexTemplate.replace(\"{osRelease}\", os.release());\n indexTemplate = indexTemplate.replace(\"{hostName}\", genericUtils.parseHost(requestObject));\n indexTemplate = indexTemplate.replace(\"{localPort}\", requestObject.connection.localPort);\n indexTemplate = indexTemplate.replace(\"{currentDir}\", requestObject.url);\n indexTemplate = indexTemplate.replace(\"{currentBodyDir}\", requestObject.url);\n indexTemplate = indexTemplate.replace(\"{dirContent}\", parsedDirList);\n return indexTemplate;\n}", "function main()\n{\n\n var nodeRef = json.get(\"nodeRef\");\n var version = json.get(\"version\");\n var majorVersion = json.get(\"majorVersion\") == \"true\";\n var description = json.get(\"description\");\n\n // allow for content to be loaded from id\n if (nodeRef != null && version != null)\n {\n\n var workingCopy = search.findNode(nodeRef);\n\n var versions = null;\n if (workingCopy != null)\n {\n if (workingCopy.isLocked)\n {\n // We cannot revert a locked document\n status.code = 404;\n status.message = \"error.nodeLocked\";\n status.redirect = true;\n return;\n }\n\n versions = [];\n var versionHistory = workingCopy.versionHistory;\n if (versionHistory != null)\n {\n for (i = 0; i < versionHistory.length; i++)\n {\n var v = versionHistory[i];\n if (v.label.equals(version))\n { \n if (!workingCopy.hasAspect(\"cm:workingcopy\"))\n {\n // Ensure the original file is versionable - may have been uploaded via different route\n if (!workingCopy.hasAspect(\"cm:versionable\"))\n {\n // We cannot revert a non versionable document\n status.code = 404;\n status.message = \"error.nodeNotVersionable\";\n status.redirect = true;\n return;\n }\n\n // It's not a working copy, do a check out to get the actual working copy\n workingCopy = workingCopy.checkout();\n }\n\n // Update the working copy content\n workingCopy.properties.content.write(v.node.properties.content);\n workingCopy.properties.content.mimetype = v.node.properties.content.mimetype;\n workingCopy.properties.content.encoding = v.node.properties.content.encoding;\n\n // check it in again, with supplied version history note\n workingCopy = workingCopy.checkin(description, majorVersion);\n\n model.document = workingCopy;\n return;\n }\n }\n }\n\n // Could not find the version\n status.code = 404;\n status.message = \"error.versionNotFound\";\n status.redirect = true;\n return;\n }\n else\n {\n // Could not find a document for the nodeRef\n status.code = 404;\n status.message = \"error.nodeNotFound\";\n status.redirect = true;\n return;\n }\n }\n}", "function listDir() {\n $.ajax({\n type: 'POST',\n dataType: \"json\",\n contentType: \"application/json\",\n url: \"/listDirectory\",\n cache: false,\n data: JSON.stringify(arr),\n success: function (response) {\n $(\"#main\").empty();\n for (key in response) {\n let filename = response[key].name;\n if (response[key].type == \"file\") {\n let elem = $(\".file.hidden\").clone();\n elem.removeClass(\"hidden\");\n elem.find(\"p\").html(filename);\n elem.attr(\"ondblclick\", \"updateURL('\" + filename.toString() + \"')\");\n elem.contextmenu(function (e) {\n right_click_on_f(e, filename);\n e.preventDefault();\n e.stopImmediatePropagation();\n });\n $(\"#main\").append(elem);\n $(\"#main\").append(\"<br>\");\n } else {\n let elem = $(\".folder.hidden\").clone();\n elem.removeClass(\"hidden\");\n elem.find(\"p\").html(filename);\n elem.attr(\"ondblclick\", \"updateURL('\" + filename.toString() + \"')\");\n elem.contextmenu(function (e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n right_click_on_f(e, filename);\n });\n $(\"#main\").append(elem);\n $(\"#main\").append(\"<br>\");\n }\n }\n window.history.pushState({}, null, url);\n },\n error: function (err) {\n alert(\"no!\");\n console.log(err);\n }\n });\n}", "async function loadJSON(){\n try {\n let url = document.location.pathname.replace('index','items').replace('html','json')\n if(document.location.href.startsWith('file')){\n console.log('what');\n url = \"file://\"+url\n }\n \n itemsPortfolio = filterByQueryCategory(globalItems)\n console.log(itemsPortfolio);\n itemsPortfolio = filterByQuery(itemsPortfolio);\n currentPage = 0\n let itemsPaginated = paginatorItem(itemsPortfolio);\n buildItems(itemsPaginated)\n } catch (error) {\n console.error('errrr ',JSON.stringify(error), error.message)\n }\n}", "function fileList(path) {\n $('#current-path').prop(\"value\", path)\n $('#input-file-path').prop(\"value\", path)\n generateNav(path)\n $.ajax({\n url: domain + \"list?dir=\" + path,\n success: function (result) {\n $(\"#fileList\").html(\"\")\n $(result.response).each(function (i, data) {\n if (path == \"/\") {\n path = \"\"\n }\n nameCell = '<a target=\"_blank\" class=\"text-secondary\" href=\"' + this.url + '\"><i class=\"fa fa-file\" aria-hidden=\"true\"></i> ' + this.name + '</a>'\n if (this.isDir) {\n nameCell = '<a href=\"#' + path + '/' + this.name + '\" name=\"btn-dir\"><i class=\"fa fa-folder-open\" aria-hidden=\"true\"></i> ' + this.name + '</a>'\n }\n trRow = '<tr>\\\n <th scope=\"row\">\\\n <div class=\"checkbox\">\\\n <label>\\\n <input type=\"checkbox\" name=\"file-id\" dir=\"' + this.isDir + '\" value=\"' + this.name + '\" url=\"' + this.url + '\">\\\n <span class=\"checkbox-decorator\"><span class=\"check\"></span><div class=\"ripple-container\"></div></span>\\\n </label>\\\n </div> \\\n </th>\\\n <td name=\"name\">' + nameCell + '</td>\\\n <td>' + this.size + '</td>\\\n <td>' + this.time + '</td>\\\n <td name=\"operation\" style=\"width: 10%\"></td>\\\n </tr>';\n // $(\"tbody\").html(trRow)\n $(trRow).appendTo($(\"#fileList\"))\n\n });\n //给所有的文件夹绑定点击事件\n $(\"a[name='btn-dir']\").click(function () {\n fileList($(this).attr('href').substring(1));\n });\n //重命名、编辑\n $(\"#fileList tr\").hover(function () {\n $(this).addClass(\"bg-table-row\");\n let checkBox = $(this).children(\"th\").children(\"span\").children(\"div\").children(\"label\").children(\"input[name='file-id']\");\n let isDir = checkBox.attr('dir');\n if (isDir === undefined) {\n checkBox = $(this).children(\"th\").children(\"div\").children(\"label\").children(\"input[name='file-id']\");\n isDir = checkBox.attr('dir');\n }\n let path = getParam() + \"/\" + checkBox.val();\n let name = checkBox.val();\n let butts;\n if (isDir === \"true\") {\n butts = '<a name=\\'file-rename\\' href=\\'#\\' data-toggle=\\'tooltip\\' data-placement=\\'top\\' title=\\'重命名\\'><li class=\\'fa fa-pencil\\'></li></a>';\n } else {\n butts = '<a name=\\'file-edit\\' href=\\'#\\' data-toggle=\\'tooltip\\' data-placement=\\'top\\' title=\\'编辑\\'><li class=\\'fa fa-file-text\\'></li></a>&nbsp;&nbsp;<a name=\\'file-rename\\' href=\\'#\\' data-toggle=\\'tooltip\\' data-placement=\\'top\\' title=\\'重命名\\'><li class=\\'fa fa-pencil\\'></li></a>';\n }\n $(this).children(\"td[name='operation']\").append(butts);\n // $('[data-toggle=\"tooltip\"]').tooltip();\n //编辑\n $(\"a[name='file-edit']\").click(function (e) {\n //禁用a标签自带的跳转\n e.preventDefault();\n chrome.tabs.create({url: \"editor.html#\" + path});\n });\n //重命名\n $(\"a[name='file-rename']\").click(function (e) {\n //禁用a标签自带的跳转\n e.preventDefault();\n $('#input-rename-old-path').prop(\"value\", path);\n $('#input-rename-new-path').prop(\"value\", name);\n $('#model-rename').modal('show');\n });\n }, function () {\n $(this).removeClass(\"bg-table-row\");\n $(this).children(\"td[name='operation']\").html(\"\");\n })\n },\n error: function (xhr, status, error) {\n toastr.error(error);\n }\n });\n}", "function updateResortAjax(path,c_json){\n $.ajax({\n url: path,\n type: 'PATCH',\n dataType: 'json',\n data: c_json,\n headers: { Authorization: 'Token token=' + sessionStorage.getItem('powder-token')}\n })\n .done(function() {\n console.log(\"Updated\");\n loadResortsAjax();\n })\n .fail(function() {\n console.log(\"error\");\n });\n }", "function refreshReports(){\r\n reportLog = fsReports.readFileSync(\"./Dictionary/Report_Log.json\",\"UTF-8\");\r\n JsonArrayReports = JSON.parse(reportLog);\r\n}", "async loadContent() {\n const { include, routeBasePath, sidebarPath } = options\n const { siteConfig, siteDir } = context\n const adrsDir = contentPath\n\n if (!fs.existsSync(adrsDir)) {\n fs.copySync(path.resolve(__dirname, './template'), adrsDir)\n }\n\n // Prepare metadata container.\n let adrs = {}\n\n // Metadata for default adrs files.\n const adrsFiles = await globby(include, {\n cwd: adrsDir,\n })\n\n await Promise.all(\n adrsFiles.map(async source => {\n const metadata = await processMetadata(\n source,\n adrsDir,\n siteConfig,\n routeBasePath,\n siteDir,\n )\n adrs[metadata.id] = metadata\n }),\n )\n const adrsSidebars = createSidebar(adrs)\n // Get the titles of the previous and next ids so that we can use them.\n Object.keys(adrs).forEach(currentID => {\n const previousID = idx(adrs, [currentID, 'previous'])\n if (previousID) {\n const previousTitle = idx(adrs, [previousID, 'title'])\n adrs[currentID].previous_title = previousTitle || 'Previous'\n }\n const nextID = idx(adrs, [currentID, 'next'])\n if (nextID) {\n const nextTitle = idx(adrs, [nextID, 'title'])\n adrs[currentID].next_title = nextTitle || 'Next'\n }\n })\n\n const sourceToPermalink = {}\n const permalinkToId = {}\n Object.values(adrs).forEach(({ id, source, permalink }) => {\n sourceToPermalink[source] = permalink\n permalinkToId[permalink] = id\n })\n\n globalContents = {\n adrs,\n adrsDir,\n adrsSidebars,\n sourceToPermalink,\n permalinkToId,\n }\n\n return globalContents\n }", "updateFolderData({lastFilePath=null, recentFilePaths=null}){\n this.send(\"folder-data-update\", {lastFilePath, recentFilePaths})\n }", "__handleItemPath(path, value) {\n let itemsPath = path.slice(6); // 'items.'.length == 6\n\n let dot = itemsPath.indexOf('.');\n let itemsIdx = dot < 0 ? itemsPath : itemsPath.substring(0, dot); // If path was index into array...\n\n if (itemsIdx == parseInt(itemsIdx, 10)) {\n let itemSubPath = dot < 0 ? '' : itemsPath.substring(dot + 1); // If the path is observed, it will trigger a full refresh\n\n this.__handleObservedPaths(itemSubPath); // Note, even if a rull refresh is triggered, always do the path\n // notification because unless mutableData is used for dom-repeat\n // and all elements in the instance subtree, a full refresh may\n // not trigger the proper update.\n\n\n let instIdx = this.__itemsIdxToInstIdx[itemsIdx];\n let inst = this.__instances[instIdx];\n\n if (inst) {\n let itemPath = this.as + (itemSubPath ? '.' + itemSubPath : ''); // This is effectively `notifyPath`, but avoids some of the overhead\n // of the public API\n\n inst._setPendingPropertyOrPath(itemPath, value, false, true);\n\n inst._flushProperties();\n }\n\n return true;\n }\n }", "_handleContents(contents) {\n // Update our internal data.\n this._model = {\n name: contents.name,\n path: contents.path,\n type: contents.type,\n content: undefined,\n writable: contents.writable,\n created: contents.created,\n last_modified: contents.last_modified,\n mimetype: contents.mimetype,\n format: contents.format\n };\n this._items = contents.content;\n this._paths.clear();\n contents.content.forEach((model) => {\n this._paths.add(model.path);\n });\n }", "async updateItem() {\n const { ctx } = this;\n const { query } = ctx;\n const { body } = ctx.request;\n let resource = null;\n let tempResource = null;\n console.log(query);\n console.log(body);\n if (query.target.includes('indexPage')) {\n resource = this.app.caches.getResource('indexPage');\n tempResource = resource.content;\n if (query.target === 'indexPageTerm') {\n if (body.termOther instanceof Array) {\n body.termOther.forEach(item => {\n if (item[1].includes('resource/tmp')) {\n const uniqueId = this.app.methods.getUniqueId();\n fs.copyFileSync(item[1], `/resource/free/${uniqueId}`);\n item[1] = uniqueId;\n }\n });\n }\n tempResource[body.oldCategory][1].splice(body.oldIndex, 1);\n tempResource[body.category][1].splice(body.index, 0, [\n body.termIcon.length === 2\n ? body.termIcon\n : [body.termIcon[0], await ctx.service.file.create(body.termIcon[1], 'indexPage')], //body.termIcon?\"\":\"\",\n body.term,\n body.termDescription,\n body.termOther\n ]);\n console.log(tempResource[body.category][1][body.index]);\n } else {\n const terms = tempResource[body.oldIndex][1];\n tempResource.splice(body.oldIndex, 1);\n tempResource.splice(body.index, 0, [body.category, terms]);\n }\n }\n console.log(tempResource);\n resource.markModified('content');\n await resource.save();\n ctx.body = getList(query, tempResource);\n }", "function getCurrentJavaContent() {\n var selectedJAVAFile = new URL(location.href).searchParams.get('javafile');\n\n get(\"/workspaces/temp/javafile/\" + selectedJAVAFile).then(function(response) {\n const submit = document.createElement('button');\n submit.setAttribute(\"type\", \"submit\");\n /*submit.setAttribute(\"onclick\", \"window.location.replace('./workspaces.html')\");*/\n submit.innerHTML = \"Save & Reload\";\n document.getElementById(\"footer_menu\").appendChild(submit);\n const cancel = document.createElement('button');\n cancel.setAttribute(\"type\", \"button\");\n cancel.setAttribute(\"onclick\", \"location.href='./workspaces.html'\");\n cancel.innerHTML = \"Discard changes\";\n document.getElementById(\"footer_menu\").appendChild(cancel);\n const text = document.createElement('i');\n text.style.fontSize = \"12px\";\n text.innerHTML = \"Editing: <b>\" + selectedJAVAFile + \"</b>\";\n document.getElementById(\"footer_menu\").appendChild(text);\n\n const form = document.getElementById(\"usrform\");\n createJavaEditor(response);\n });\n}", "async function writeFile(path, content) {\n //Creates folder if folder doesn't already exist\n let folderPath = path.split('/');\n folderPath.pop();\n await mkdirp(folderPath.join('/'));\n\n // Overwrites tableData.json with newData\n fs.writeFile(path, content, function(err) {\n if(err) {\n return console.error(err);\n }\n console.log(\"Success: Table data refreshed!\");\n });\n}", "function dynamicContentLoader(templatePathSuffix, contentPathSuffix, idParentElement, templateId) {\n $.get('template/' + templatePathSuffix, function (template) {\n $('#' + idParentElement).append(template);\n $.get('content/' + getLanguage() + '/' + contentPathSuffix, function (content) {\n $('#' + templateId).tmpl(content).appendTo('#' + idParentElement);\n })\n });\n}", "function resetFileContentCache() {\n FILE_CONTENT_CACHE.clear();\n}", "async function getAllFiles() {\n console.log(path)\n const url = `/api/allFiles?location=${path}`\n const response = await fetch(url)\n const allFiles = await response.json()\n console.log(allFiles)\n generateFileList(allFiles)\n}", "static computeSubContent(path) {\n return new Promise((resolve, reject) => {\n fs_1.readFile(path, (err, data) => {\n if (err)\n return reject(err);\n zlib_1.deflate(data, (err, buffer) => {\n if (err)\n return reject(err);\n resolve(buffer.toString('base64'));\n });\n });\n });\n }", "function syncTreeNode(content, path, initialLoad) {\n\n if (infiniteMode) {\n return;\n }\n\n if (!$scope.content.isChildOfListView) {\n navigationService.syncTree({ tree: \"member\", path: path.split(\",\"), forceReload: initialLoad !== true }).then(function (syncArgs) {\n $scope.page.menu.currentNode = syncArgs.node;\n });\n }\n else if (initialLoad === true) {\n\n //it's a child item, just sync the ui node to the parent\n navigationService.syncTree({ tree: \"member\", path: path.substring(0, path.lastIndexOf(\",\")).split(\",\"), forceReload: initialLoad !== true });\n\n //if this is a child of a list view and it's the initial load of the editor, we need to get the tree node \n // from the server so that we can load in the actions menu.\n umbRequestHelper.resourcePromise(\n $http.get(content.treeNodeUrl),\n 'Failed to retrieve data for child node ' + content.id).then(function (node) {\n $scope.page.menu.currentNode = node;\n });\n }\n }", "async function updateFile(fileId, content) {\n return await $.ajax({\n url: domain + \"/file/\" + encodeURIComponent(fileId),\n method: \"PUT\",\n data: content,\n });\n }", "get_reading_fs(accessors, lang_id = default_lang) {\n //\n // Must return all texts resources\n {\n if (!accessors) {\n return this.texts[lang_id];\n }\n }\n let access_arr;\n {\n if (!(accessors instanceof Array)) {\n access_arr = json.get_accessor_parts(accessors);\n }\n else {\n access_arr = accessors;\n }\n }\n //\n // Fetch final directory from accessors\n let access_idx = 0;\n const nb_accessors = access_arr.length;\n {\n let exists = true;\n let path = this.get_path(lang_id);\n while (access_idx < nb_accessors && exists) {\n {\n if (path[path.length - 1] !== \"/\") {\n path += \"/\";\n }\n path += access_arr[access_idx];\n }\n exists = pathExistsSync(path);\n access_idx++;\n }\n {\n //\n // Full accessors are a path\n if (exists) {\n //\n // Full accessors is a directory => return all files content\n if (file.is_directory(path)) {\n return file.read_dir_files_json(path);\n }\n //\n // else path is a file => return its content\n return readJsonSync(path);\n }\n //\n // Else not exist : accessors_idx-1 is a file's property name\n //\n // If accessors_idx-1 is a directory -> error, should be a file\n if (file.is_directory(path)) {\n const unexisting_access_idx = access_idx - 1;\n const msg = \"File \" +\n access_arr[unexisting_access_idx] +\n \" does not exit in directory \" +\n access_arr.slice(0, unexisting_access_idx).join(\"/\");\n logger.error = msg;\n throw ReferenceError(msg);\n }\n //\n // Else accessors_idx-1 is a file\n let content = readJsonSync(path);\n //\n // Reach the last requested acessor\n while (access_idx < nb_accessors) {\n const prop_name = access_arr[access_idx];\n if (!content[prop_name]) {\n const msg = \"Property \" +\n prop_name +\n \" does not exist in file \" +\n path +\n \" (requested with accessor \" +\n access_arr.join(\".\") +\n \")\";\n logger.error = msg;\n throw ReferenceError(msg);\n }\n content = content[prop_name];\n access_idx++;\n }\n return content;\n }\n }\n }", "function updateRecentDocument(path) {\n let added = false;\n if (path) {\n app.addRecentDocument(path);\n if (!Array.isArray(prefs.preferences.recentDocuments)) {\n prefs.preferences.recentDocuments = [path];\n added = true;\n }\n else {\n let recentIndex = prefs.preferences.recentDocuments.indexOf(path);\n added = true;\n if (recentIndex > -1) {\n prefs.preferences.recentDocuments.splice(recentIndex, 1);\n added = false;\n }\n prefs.preferences.recentDocuments.unshift(path);\n if (prefs.preferences.recentDocuments.length > prefs.preferences.maxRecentDocuments) {\n prefs.preferences.recentDocuments.length = prefs.preferences.maxRecentDocuments;\n }\n }\n }\n else {\n if (!Array.isArray(prefs.preferences.recentDocuments)) {\n prefs.preferences.recentDocuments = [];\n }\n if (prefs.preferences.recentDocuments.length > prefs.preferences.maxRecentDocuments) {\n prefs.preferences.recentDocuments.length = prefs.preferences.maxRecentDocuments;\n }\n }\n if (menu && added) {\n // LATER: This is fragile, as the indices need to be changed if the menu structure changes.\n menu.items[1].submenu.items[2].submenu.insert(0, new MenuItem({label: path, click: () => {\n loadProjectFromFile(path);\n }}));\n }\n}", "function updateContent(transport) {\n var subtab = false;\n var sampleIdList = null;\n var sampleNameList = null;\n var skillModelsNotCachedList = null;\n var cachedFileStatusList = null;\n var samplesThatRequireCachingList = null;\n\n if (transport) {\n\n var json = transport.responseText.evalJSON(true);\n subtab = json.subtab;\n sampleIdList = json.lstSampleId;\n sampleNameList = json.lstSampleName;\n skillModelsNotCachedList = json.lstSkillModelsNotCached;\n cachedFileStatusList = json.lstCachedFileStatus;\n samplesThatRequireCachingList = json.lstSamplesThatRequireCaching;\n selectedSkillModelList = json.lstSelectedSkillModels;\n displaySampleCachedFileInfo(sampleIdList,\n sampleNameList,\n skillModelsNotCachedList,\n cachedFileStatusList,\n samplesThatRequireCachingList);\n }\n\n if (!subtab) {\n subtab = getSelectedSubtab();\n } else {\n selectSubtab(subtab);\n }\n if (subtab == \"byStudentStep\") {\n //theHelpWindow.updateContent($(\"help-export-step\"));\n $('cached_export_selection_div').show();\n $('stepExportNav').show();\n //Nudge here prevents all nav box margins from collapsing in IE8\n $('samples').setStyle({\n marginBottom: '0.5em'\n });\n if ($F('exportStepIncludeNoKCs') || $F('exportStepIncludeAllKCs')) {\n $('skills').hide();\n } else {\n $('skills').show();\n }\n\n $('kcModelNavHeader').hide();\n $('primary_kc_model_label').hide();\n\n studentStepSkillModelInit(selectedSkillModelList);\n $('students').show();\n $('problems').show();\n\n resetKCMHeader();\n if ($('contentSetName')) {\n $('contentSetName').show();\n }\n if ($('contentSetNameModified')) {\n $('contentSetNameModified').show();\n }\n\n requestByStudentStep();\n showExportFileStatus();\n updateExportFileStatus();\n\n }\n}", "function refresh(rebuild) {\n _.forEach(_views, function (view) {\n var top = view.$openFilesContainer.scrollTop();\n if (rebuild) {\n view._rebuildViewList(true);\n } else {\n view._redraw();\n }\n view.$openFilesContainer.scrollTop(top);\n });\n }", "function maybe_populate_folder_contents( anchor ) {\n\t\tvar container = $( anchor ).closest( '.toggleable' ).find( '.toggle-content.folder-loop' ).first();\n\n\t\t// If the folder content has already been populated, do nothing.\n\t\tif ( $.trim( container.text() ).length ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do not continue if we are currently fetching a set of results.\n\t\tif ( fetching_folder_contents !== false ) {\n\t\t\treturn;\n\t\t}\n\t\tfetching_folder_contents = true;\n\t\tcontainer.addClass( 'loading' );\n\n\t\t// Make the AJAX request and populate the list.\n\t\t$.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'GET',\n\t\t\tdata: {\n\t\t\t\tfolder: $( anchor ).data( 'folder-id' ),\n\t\t\t\tgroup_id: $( '#directory-group-id' ).val(),\n\t\t\t\tuser_id: $( '#directory-user-id' ).val(),\n\t\t\t\taction: 'bp_docs_get_folder_content',\n\t\t\t},\n\t\t\tsuccess: function( response ) {\n\t\t\t\t$( container ).html( response );\n\t\t\t\tset_folder_related_colspans();\n\t\t\t\tfetching_folder_contents = false;\n\t\t\t\tcontainer.removeClass( 'loading' );\n\t\t\t}\n\n\t\t} );\n\n\t}", "onChangePath(p, callback) {\nlet foundPath = this.findLoadedPath(p);\nlet directory = this.findDirectoryItemFromPath(foundPath);\nlet nodeToGet = [foundPath];\nlet filesInPath = [];\nlet forEachKey = function(object, callback) {\nfor (let key in object) {\ncallback(key);\n}\n};\nlet addNewItem = function(array, item) {\nif (array.indexOf(item) === -1) {\narray.push(item);\n}\n};\nforEachKey(this._fullPathOpen, addNewItem.bind(nodeToGet, nodeToGet));\n// Add all files found in directory...\nlet pathListCallback = (parentNode, p, fileList) => {\nif ((p === foundPath) || this._fullPathLoaded[p]) {\nfilesInPath.push({path: p, fileList: fileList, toString: function() { return this.path; }});\nfileList.forEach(\nfunction(file) {\nif (file.directory && (file.name !== '..')) {\nlet s = path.join(p, file.name);\nif (this._fullPathLoaded[s]) {\naddNewItem(nodeToGet, s);\n}\n}\n},\nthis\n);\n}\ngetNode(); // Next directory...\n};\n// Load all files in directory...\nlet nodeIndex = 0;\nlet getNode = () => {\nif (nodeIndex < nodeToGet.length) {\nthis.getFiles(null, nodeToGet[nodeIndex], pathListCallback);\nnodeIndex++;\n} else {\nif (directory) {\ndirectory.clear();\nthis.showFilesInPath(filesInPath);\n}\ncallback();\n}\n};\ngetNode();\n}", "editorContentCallback(initContent: string, filePath: string) {\n const { setEditorContent } = this.props;\n setEditorContent(initContent, filePath);\n }", "_updateCurrentPath() {\n let current = this.currentWidget;\n let newValue = '';\n if (current && current instanceof DocumentWidget) {\n newValue = current.context.path;\n }\n this._currentPathChanged.emit({\n newValue: newValue,\n oldValue: this._currentPath\n });\n this._currentPath = newValue;\n }", "function loadContent(idContainer, path, menuMobile) {\n $(idContainer).load(path);\n }", "receiveContentProps({ path }) {\n this.rootUrl = `/${path}`;\n }", "function retrieveJsonHttpGetDoc(path, doRegularPolish, doPagePolish, doHighlightWrap) {\n var deferred = $q.defer();\n return getCmd(path).getAll(function (data) {\n if (data.value) {\n if (doHighlightWrap) {\n setHightlightTag(data.value);\n }\n if (doRegularPolish) {\n removeMetafromArrayJSON(data.value);\n }\n if (doPagePolish) {\n managePageJSON(data.value);\n }\n }\n }, function (err) {\n var exeError = common.setExecutionError(err);\n deferred.reject({ data: new CommandResponse(false, new ExecutionError(-1, exeError)) });\n return deferred.promise;\n }).$promise;\n }", "parseArticlePaths(folder){\n if(folder && folder.children && folder.children.length){\n let articles = [];\n folder.children.forEach((e, i, a) => {\n if(!e.children && e.name && e.path){\n articles.push({name: e.name, path: e.path});\n }\n });\n let articlesDone = new Promise ((aResolve, aReject) => {\n let promiseCount = articles.length;\n let articlePromises = articles.map((e) => {\n let promise = new Promise((resolve, reject) => {\n fetch(e.path).then((response) => {\n return response.text();\n }).then((markdown) => {\n e.content = {__html: generateVideoIframe(Marked(markdown))};\n resolve();\n });\n });\n promise.then(() => {\n promiseCount--;\n if(promiseCount === 0){\n aResolve();\n }\n });\n return promise;\n });\n }).then(() => {\n this.setState({articles: articles});\n });\n }\n else return;\n }", "async prepend(location, content) {\n try {\n const { content: actualContent } = await this.get(location, 'utf-8');\n return this.put(location, `${content}${actualContent}`);\n }\n catch (e) {\n if (e instanceof exceptions_1.FileNotFound) {\n return this.put(location, content);\n }\n throw e;\n }\n }", "function refreshContent(content){\n while (content.hasChildNodes()){\n content.removeChild(content.firstChild);\n }\n}", "_recurseGetContent(content, element) {\n console.debug(\"Setting content\", content, \"on children of\", element, \"...\");\n for (const child of element.children) {\n let newContent = null;\n // Get and switch on content type\n const contentType = child.getAttribute(\"content-type\");\n if (contentType != null) {\n switch (contentType) {\n // Content is supposed to be an object, and an object is therefore\n // delegated to be filled with information.\n // Useful for 'experiences' in CV.\n case \"object\":\n newContent = {};\n if (child.getContent != null) {\n child.getContent(newContent);\n } else {\n this._recurseGetContent(newContent, child);\n }\n break;\n // Content is supposed to be an array, and elements of any children will\n // therefore be added to this array.\n case \"array\":\n newContent = [];\n if (child.getContent != null) {\n child.getContent(newContent);\n } else {\n this._recurseGetContent(newContent, child);\n }\n break;\n // Content is some key-value pair, and value is obtained\n case \"component\":\n newContent = child.getContent();\n break;\n default:\n throw new Error(`Unsupported content-type ${contentType}`);\n }\n // Add obtained value as 'key' to current object/array\n const contentKey = child.getAttribute(\"content-key\");\n if (contentKey != null) {\n const ignoreIfNull = child.getAttribute(\"content-ignore-if-null\");\n if (ignoreIfNull != null && newContent == null) {\n continue;\n }\n content[contentKey] = newContent;\n } else if (content.push != null) {\n content.push(newContent);\n }\n } else if (child.getContent != null) {\n child.getContent(content);\n } else {\n this._recurseGetContent(content, child);\n }\n }\n console.debug(\"Finished setting content\", content, \"on children of\", element, \"...\");\n }", "function reloadOpenDocuments () {\n vscode.workspace.textDocuments.forEach(document => {\n if ((document.languageId !== 'scala') && (document.languageId !== 'java')) {\n return\n }\n const filename = document.fileName\n const fileContents = document.getText()\n const payload = {\n filename,\n fileContents\n }\n axios.post(serverUrl() + '/reload-file', payload)\n })\n}", "function refresh_file_manager_images() {\n var data = {};\n data[csfr_token_name] = $.cookie(csfr_cookie_name);\n $.ajax({\n type: \"POST\",\n url: base_url + \"file_controller/get_blog_images\",\n data: data,\n success: function (response) {\n var obj = JSON.parse(response);\n if (obj.result == 1) {\n document.getElementById(\"image_file_manager_upload_response\").innerHTML = obj.content;\n }\n }\n });\n}", "function goto(hash) {\n\n hash = decodeURIComponent(hash).slice(1).split('=');\n \n if (hash.length) {\n var rendered = '';\n // if hash has search in it\n\n if (hash[0] === 'search') {\n\n filemanager.addClass('searching');\n rendered = searchData(response, hash[1].toLowerCase());\n if (rendered.length) {\n currentPath = hash[0];\n render(rendered);\n }\n else {\n render(rendered);\n }\n\n }\n\n // if hash is some path\n\n else if (hash[0].trim().length) {\n currentPath = hash[0];\n var p = hash[0].trim();\n path = p.split('/');\n demo = response;\n console.log(\"refresh path\"+path);\n for (var i = 0; i < path.length; i++) {\n for (var j = 0; j < demo.length; j++) {\n\n if (demo[j].name === path[i]) {\n console.log(\"currentPath refresh\", currentPath);\n var aa = currentPath.split(\"/\");\n var currn_fol = aa[aa.length - 1];\n if (currn_fol == demo[j].name) {\n jQuery(\"#folder_iddd\").val(demo[j].id);\n jQuery(\"#folder_parent_id\").val(demo[j].id);\n }\n //console.log(\"currentfolder_id == \",demo[j].name+\"==\"+demo[j].id);\n flag = 1;\n demo = demo[j].items;\n break;\n }\n }\n }\n rendered = searchByPath(hash[0]);\n if (rendered.length) {\n\n currentPath = hash[0];\n breadcrumbsUrls = generateBreadcrumbs(hash[0]);\n render(rendered);\n }\n else {\n currentPath = hash[0];\n breadcrumbsUrls = generateBreadcrumbs(hash[0]);\n render(rendered);\n }\n\n }\n\n // if there is no hash\n\n else {\n\n currentPath = data.path;\n breadcrumbsUrls.push(data.path);\n render(searchByPath(data.path));\n }\n }\n }", "function class_folderContentsResponseLocal( responseText )\r\n\t{\r\n\t\tclass_DataStringToVariables( responseText );\r\n\t\r\n\t\t// QA_STAT: Indicates the ajax request is done.\r\n\t\tajaxLoaded( \"getContents\" );\r\n\t}", "async function reloadData() {\r\n seTtreeNodes([]);\r\n if (Newfolders.length == 0 || Newfolders.err == \"No files exist\") {\r\n seTselectedFodler(false);\r\n seTFolderID(null)\r\n } else {\r\n Newfolders.map(async (fileRead) => {\r\n console.log(\"map map \")\r\n if (fileRead.metadata.parentId === null && fileRead.metadata.items === false && fileRead.metadata.file === false) { //Folder without files (items)\r\n const TempFile = {\r\n label: fileRead.metadata.label,\r\n id: fileRead.metadata.id,\r\n parentId: fileRead.metadata.parentId,\r\n items: null,\r\n file: false\r\n }\r\n seTtreeNodes(treeNodes => [...treeNodes, TempFile])\r\n }\r\n else if (fileRead.metadata.parentId != null && fileRead.metadata.items === false && fileRead.metadata.file === false) // Folder inside folder without files (items)\r\n {\r\n const TempFile = {\r\n label: fileRead.metadata.label,\r\n id: fileRead.metadata.id,\r\n parentId: fileRead.metadata.parentId,\r\n items: null,\r\n file: false\r\n }\r\n seTtreeNodes(treeNodes => [...treeNodes, TempFile])\r\n }\r\n else if (fileRead.metadata.parentId === null && fileRead.metadata.items === true && fileRead.metadata.file === false) // Folder with files (items)\r\n {\r\n const TempFile = {\r\n label: fileRead.metadata.label,\r\n id: fileRead.metadata.id,\r\n parentId: fileRead.metadata.parentId,\r\n items: setItems(fileRead.metadata.id),\r\n file: false\r\n\r\n }\r\n seTtreeNodes(treeNodes => [...treeNodes, TempFile])\r\n }\r\n else if (fileRead.metadata.parentId != null && fileRead.metadata.items === true && fileRead.metadata.file === false) // Folder inside folder without files (items)\r\n {\r\n const TempFile = {\r\n label: fileRead.metadata.label,\r\n id: fileRead.metadata.id,\r\n parentId: fileRead.metadata.parentId,\r\n items: setItems(fileRead.metadata.id),\r\n file: false\r\n }\r\n seTtreeNodes(treeNodes => [...treeNodes, TempFile])\r\n }\r\n\r\n });\r\n\r\n\r\n }\r\n return;\r\n }", "function refreshChat(){\r\n chatDictionary = fsReports.readFileSync(\"./Dictionary/Chat_Dictionary.json\",\"UTF-8\");\r\n JsonArrayChat = JSON.parse(chatDictionary);\r\n}", "async function fileSystemTricks({ result }){\n\tif(!result.result[0].code.find){\n\t\tconst parsed = JSON.parse(result.result[0].code);\n\t\tresult.result[0].code = parsed.files;\n\t\tresult.result[0].tree = parsed.tree;\n\t\tconsole.log('will weird things ever stop happening?');\n\t\treturn;\n\t}\n\tconst serviceJSONFile = result.result[0].code.find(item => item.name === 'service.json');\n\tif(serviceJSONFile && !serviceJSONFile.code){\n\t\tconst fetched = await fetch(`./.${result.result[0].name}/service.json`);\n\t\tserviceJSONFile.code = await fetched.text();\n\t}\n\tif(serviceJSONFile){\n\t\tlet serviceJSON = JSON.parse(serviceJSONFile.code);\n\t\tif(!serviceJSON.tree){\n\t\t\tconst fetched = await fetch(`./${serviceJSON.path}/service.json`);\n\t\t\tserviceJSONFile.code = await fetched.text();\n\t\t\tserviceJSON = JSON.parse(serviceJSONFile.code);\n\t\t}\n\t\tresult.result[0].code = serviceJSON.files;\n\t\tresult.result[0].tree = {\n\t\t\t[result.result[0].name]: serviceJSON.tree\n\t\t}\n\t}\n\tconst len = result.result[0].code.length;\n\tfor(var i=0; i < len; i++){\n\t\tconst item = result.result[0].code[i];\n\t\tif(!item.code && item.path){\n\t\t\tconst fetched = await fetch('./' + item.path);\n\t\t\titem.code = await fetched.text();\n\t\t}\n\t}\n}", "async function parseTree({ url, currPath, page }) {\n console.log(`creating/recreating path: ${currPath}`);\n await page.goto(url);\n resolveFolder(currPath);\n await page.waitForSelector(\".Box-row\");\n const itemRows = await page.$$(\".Box-row\");\n const folders = [];\n // potential parallel spot\n for (let i = 0; i < itemRows.length; i++) {\n const currRow = itemRows[i];\n const toSkip = await page.evaluate((ele) => {\n return ele.innerText === \". .\";\n }, currRow);\n if (toSkip) {\n continue;\n }\n const { isFolder, name, href } = await getRowData({ page, currRow });\n if (isFolder) {\n folders.push({ name, href });\n } else {\n toDownload.push({ name, href, currPath });\n }\n }\n const folderVisiter_p = [];\n for (let i = 0; i < folders.length; i++) {\n const { href, name } = folders[i];\n const parseFolder_p = callParser({ href, name, currPath });\n folderVisiter_p.push(parseFolder_p);\n }\n await Promise.all(folderVisiter_p);\n}", "loadFolder(folder) {\n const { path } = folder;\n this._get(path, (contents)=>{\n if (Array.isArray(contents)) {\n folder.contents= this.readContents(path, contents);\n }\n });\n }", "function doDirListing(clb) {\n\n\t\t\tvar json;\n\n\t\t\t// do the progress bar\n\t\t\tdisplayDialog({\n\t\t\t\ttype: 'progress',\n\t\t\t\tstate: 'show',\n\t\t\t\tlabel: 'Reading directory contents...'\n\t\t\t});\n\n\t\t\t// erase any old data\n\t\t\t$('#sidebar ul').remove();\n\t\t\t$('#browser ul').remove();\n\t\t\tresetAllOptions();\n\n\t\t\tjson = $.parseJSON(\n\t\t\t$.ajax({\n\t\t\t\ttype: 'post',\n\t\t\t\turl: 'assets/engines/' + opts.engine + '/' + opts.handler,\n\t\t\t\tdata: {\n\t\t\t\t\tmethod: 'getDirectoryList',\n\t\t\t\t\treturnFormat: 'json',\n\t\t\t\t\ttimeOut: parseInt(opts.timeOut, 10),\n\t\t\t\t\tbaseRelPath: window.encodeURIComponent(opts.baseRelPath[sys.currentPathIdx]),\n\t\t\t\t\tfileExts: window.encodeURIComponent(opts.fileExts)\n\t\t\t\t},\n\t\t\t\tdataType: 'json',\n\t\t\t\tasync: true,\n\t\t\t\tsuccess: function (data) {\n\t\t\t\t\tvar reDBLSL = new RegExp('\\/\\/', 'gim');\n\t\t\t\t\tif (typeof data !== 'object' || typeof data.error !== 'boolean' || data.error) {\n\t\t\t\t\t\tif (sys.debug) {\n\t\t\t\t\t\t\tconsole.log(data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsys.dirContents = [];\n\t\t\t\t\t\tdisplayDialog({\n\t\t\t\t\t\t\ttype: 'throw',\n\t\t\t\t\t\t\tstate: 'show',\n\t\t\t\t\t\t\tlabel: 'Oops! There was a problem',\n\t\t\t\t\t\t\tcontent: data.msg\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (data.dirlisting.length >= 0) {\n\t\t\t\t\t\t\tsys.dirContents = data.dirlisting;\n\t\t\t\t\t\t\tdisplayDialog({\n\t\t\t\t\t\t\t\ttype: 'progress',\n\t\t\t\t\t\t\t\tstate: 'hide'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (typeof sys.dirContents === 'object' && sys.dirContents.length > 0) {\n\t\t\t\t\t\t\t\tsys.basePath = opts.baseRelPath[sys.currentPathIdx];\n\t\t\t\t\t\t\t\t// fix path\n\t\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\t\tsys.basePath = sys.basePath.replace(reDBLSL, '/');\n\t\t\t\t\t\t\t\t} while (reDBLSL.test(sys.basePath));\n\t\t\t\t\t\t\t\t// save cookie\n\t\t\t\t\t\t\t\t$.cookie('cj_dir', sys.basePath, {\n\t\t\t\t\t\t\t\t\texpires: 1,\n\t\t\t\t\t\t\t\t\tpath: opts.baseRelPath[0]\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tif (sys.debug) {\n\t\t\t\t\t\t\t\t\tconsole.log($.cookie('cj_dir'));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($.isFunction(clb)) {\n\t\t\t\t\t\t\t\t\tclb.apply();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function (err) {\n\t\t\t\t\tif (sys.debug) {\n\t\t\t\t\t\tconsole.log(err.responseText);\n\t\t\t\t\t}\n\t\t\t\t\tsys.dirContents = [];\n\t\t\t\t\tdisplayDialog({\n\t\t\t\t\t\ttype: 'throw',\n\t\t\t\t\t\tstate: 'show',\n\t\t\t\t\t\tlabel: 'Oops! There was a problem',\n\t\t\t\t\t\tcontent: 'Problems communicating with the CFC. Unexpected results returned for doDirListing.'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}).responseText || null);\n\n\t\t\t// enable and re-initialize some options and buttons\n\t\t\tupdateDirOptions();\n\t\t\t$('#newfolder').attr({\n\t\t\t\tdisabled: false\n\t\t\t});\n\t\t}", "function loadSearch() {\t\n//\tconsole.log('mdRaws length: ',mdRaws.length)\n\tlet origins = Object.keys(client.origins);\nlet sites = [];\t\n origins.forEach(site => {\n let format = site.slice(-4);\n let rawPath = site.slice(6);\t \n if (format.includes('.md') || format.includes('.mdx')) { \t \n sites.push(rawPath);\n }\n })\t\n setMdPath(sites);\n let raws = [];\n let head = '#';\t\n sites.map(path => {\n let pathArr = path.split('/');\t \n let folder = path.split('/')[0];\n let pathEnd = path.split('/')[pathArr.length - 1];\t\n let blogPathEnd = pathEnd.match(/([a-z]+\\-.+\\w+)|(\\w+.md)|(\\w+.mdx)/i)[0]; \n blogPathEnd = blogPathEnd.replace(/(.mdx)|(.md)/, '');\n let isBlog = folder === 'blog' ? true : false; \n let isSrc = folder !== 'blog' && folder !== 'docs' ? true : false;\t\n let rawHead = isBlog ? routePaths(blogPathEnd) : isSrc ? pathEnd.replace(/(.mdx)|(.md)/, '') : path.replace(/(.mdx)|(.md)/, '') ;\n//console.log('rawHead: ',rawHead);\n//\t console.log(pathEnd);\n//\tconsole.log('path: ',path)\n let fullPath = '../../../'+ path;\n fetch(fullPath).then(res => res.text())\n .then(md => {\n let from = 0;\n let hashAt;\t \n for(let i=0; i < md.length; i++) {\n if (md[i] === '\\n'&& md[i+1] !== '\\n') {\n let raw = {\"id\": 0, \"head\":'', \"text\": ''};\t\n\n if (i > hashAt && hashAt === from) {\n\t let strHash = md.slice(from, i);\n//\t\t console.log(strHash)\n\t strHash = strHash.split('{')[0];\n \t strHash = strHash.toLowerCase();\t\t\n \t let strToPath = strHash.replace(/[#]\\s/g, '#');\n\t strToPath = strToPath.trim();\t\n//\t\tconsole.log(strToPath);\n\t strToPath = strToPath.replace(/(')|([?])|([!])|([$])|([&])|([(])|([)])|([*])|([+])|([,])|([;])|([=])/g, '');\t\t\n\t strToPath = strToPath.replace(/(:)|(\\s)|(@)/g, '-');\t\t\n strToPath = strToPath.replace(/[-]+/g, '-');\t\t\n//\t\tconsole.log(strToPath);\n let hashT = strHash.match(/#+/);\t \t\t\n rawHead = isBlog ? routePaths(blogPathEnd) + strToPath : isSrc ? pathEnd.replace(/(.mdx)|(.md)/, '') + strToPath : path.replace(/(.mdx)|(.md)/, '') + strToPath;\n//\tconsole.log('rawHead for blog: ', rawHead);\n//\t console.log('blog path end: ', blogPathEnd);\n//\t console.log('isSrc: ',isSrc);\n //\t\t console.log(hashT);\n// if (head.length < hashT.length) {\n\t head = hashT;\n//\t }\n\t \n\t}\n\t\n\tlet rawText = md.slice(from, i);\nrawText = rawText.replace(/(\\[)|(\\])|([(].+[)])|(<(“[^”]*”|'[^’]*’|[^'”>])*>)|(\\n)|([{]\\s?#+.+[}])/g, '');\n\t\traw.head = rawHead;\n\t\traw.text = rawText;\n//\t\tconsole.log('raw: ',raw);\n\t\traw.id = raws.length === 0 ? 0 : raws.length;\t\t\n\t raws.push(raw);\n from = i + 1;\t\t\n\t}\n if (md[i] === '#' && md[i-1] === '\\n' || md[i] === '#' && hashAt === undefined) {\n \t hashAt = i;\t\t \n//\t\t console.log('#')\n\t } \n }\n//\t console.log(raws.length)\n//console.log(raws);\t \n })\n })\n\tsetMdRaw(raws);\n//\t console.log('effect: ', raws);\n}", "function fetchDirList(path) {\n //declare $_POST['path]\n var formData = new FormData();\n formData.append('path', path);\n //fetch navigation.php --> final response = resourceList(Array with directory resources) \n return fetch('server/navigation.php', {\n method: 'POST',\n body: formData\n }).then(res => res.text()).then(text => JSON.parse(text));\n}", "applyPatch(content, patch) {\n let folder = tempAssets([content, patch]);\n let result = applyPatch(folder);\n rmTempAssets(folder);\n return result;\n }", "function fetchDirectoryContents() {\n\tcontentsRequest = new XMLHttpRequest();\n\n\tif (!contentsRequest) {\n\t\talert('Cannot create an XMLHTTP instance');\n\t\treturn false;\n\t}\n\tcontentsRequest.onreadystatechange = function() {\n\t\tdisplayContents();\n\t\tmakeDirStepable();\n\t\tinitDragToTrash();\n\t};\n\tcontentsRequest.open('GET', ajaxScriptUrl + properties.toGetParameter()\n\t\t\t+ '&action=display');\n\tcontentsRequest.send();\n}" ]
[ "0.6158273", "0.6051624", "0.563377", "0.56292254", "0.5614095", "0.55910856", "0.55402964", "0.5521351", "0.5485968", "0.54563063", "0.5317053", "0.5308717", "0.5299543", "0.5291411", "0.5266777", "0.526408", "0.52381295", "0.52331513", "0.5193688", "0.5185586", "0.51588213", "0.51452315", "0.51205033", "0.5116351", "0.5085435", "0.50802106", "0.5073344", "0.5071934", "0.50653195", "0.50653195", "0.5062972", "0.5061148", "0.5057737", "0.50543934", "0.5050176", "0.50492746", "0.5038603", "0.5031496", "0.50304466", "0.50227064", "0.50125974", "0.50095177", "0.4992662", "0.49917004", "0.49760467", "0.4971017", "0.49694204", "0.4958878", "0.4946953", "0.49430978", "0.4940943", "0.49275202", "0.49155268", "0.49124992", "0.49117085", "0.49004093", "0.48985925", "0.48746356", "0.48734814", "0.48715055", "0.48671144", "0.486403", "0.4863984", "0.48611292", "0.48609075", "0.4852188", "0.48407784", "0.48403874", "0.48396719", "0.4837972", "0.48360428", "0.48339993", "0.48318055", "0.48302618", "0.4824307", "0.4823568", "0.48101768", "0.48011303", "0.47993383", "0.4799086", "0.47983998", "0.47978216", "0.47977182", "0.4791838", "0.47864586", "0.47764423", "0.47745797", "0.47741824", "0.4772571", "0.47715923", "0.4769562", "0.47625026", "0.4760056", "0.47567075", "0.47500858", "0.47460073", "0.47425812", "0.47343954", "0.4721176", "0.4718798" ]
0.55837774
6
Create a reducing function iterating left or right.
function createReduce(dir) { // Optimized iterator function as using arguments.length // in the main function will deoptimize the, see #1991. function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; } return function(obj, iteratee, memo, context) { iteratee = optimizeCb(iteratee, context, 4); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = dir > 0 ? 0 : length - 1; // Determine the initial value if none is provided. if (arguments.length < 3) { memo = obj[keys ? keys[index] : index]; index += dir; } return iterator(obj, iteratee, memo, keys, index, length); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static *reduceRight$e(thiz, args, s) {\n\t\tlet l = yield * getLength(thiz);\n\t\tlet acc;\n\t\tlet fx = args[0];\n\n\t\tif ( args.length < 1 || !fx.isCallable ) {\n\t\t\treturn yield CompletionRecord.makeTypeError(s.realm, 'First argument to reduceRight must be a function.');\n\t\t}\n\n\t\tif ( args.length > 1 ) {\n\t\t\tacc = args[1];\n\t\t}\n\n\t\tfor ( let i = l - 1; i >= 0; --i ) {\n\t\t\tif ( !thiz.has(i) ) continue;\n\t\t\tlet lv = yield * thiz.get(i);\n\t\t\tif ( !acc ) {\n\t\t\t\tacc = lv;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tacc = yield * fx.call(thiz, [acc, lv], s);\n\t\t}\n\n\t\tif ( !acc ) return yield CompletionRecord.makeTypeError(s.realm, 'Reduce an empty array with no initial value.');\n\t\treturn acc;\n\t}", "function reduce(left, right) {\n if (path.length == 0) {\n return right;\n }\n if (left instanceof UnaryOperation) {\n var u = left;\n path.shift();\n return reduce(u.expr, new UnaryOperation(u.op, right));\n }\n else if (left instanceof BinaryOperation) {\n var b = left;\n if (b.op === '+') {\n if (path.shift() === 'left') {\n return reduce(b.left, new BinaryOperation(right, '-', b.right));\n }\n else {\n return reduce(b.right, new BinaryOperation(right, '-', b.left));\n }\n }\n else if (b.op === '-') {\n if (path.shift() === 'left') {\n return reduce(b.left, new BinaryOperation(right, '+', b.right));\n }\n else {\n return reduce(b.right, new BinaryOperation(b.left, '-', right));\n }\n }\n else if (b.op === '*') {\n if (path.shift() === 'left') {\n return reduce(b.left, new BinaryOperation(right, '/', b.right));\n }\n else {\n return reduce(b.right, new BinaryOperation(right, '/', b.left));\n }\n }\n else if (b.op === '/') {\n if (path.shift() === 'left') {\n return reduce(b.left, new BinaryOperation(right, '*', b.right));\n }\n else {\n return reduce(b.right, new BinaryOperation(b.left, '/', right));\n }\n }\n }\n }", "function reduceRight(zero, f) {\n return i => reduceRight_(i, zero, f);\n}", "function Left$prototype$reduce(f, x) {\n return x;\n }", "function reduce(f) {\n return function(initial) {\n return function(foldable) {\n return Z.reduce (function(y, x) { return f (y) (x); },\n initial,\n foldable);\n };\n };\n }", "function reduceRight(collection, iterator, initialValue){\n\tif(Array.isArray(collection)){\n\t\tcollection.sort(function(a,b){ return b-a;});\n\t}\n\treturn reduce(collection,iterator, initialValue);\n}", "function reduceRight(callback, value) {\n /*jshint newcap:false*/\n var elements, isset, index;\n\n // convert elements to object\n elements = Object(this);\n\n // make sure callback is a function\n requireFunction(callback);\n\n // status of the initial value\n isset = undefined !== value;\n\n // index of the last element\n index = (elements.length >>> 0) - 1;\n\n // iterate over elements backwards\n for (; -1 < index; --index) {\n\n // current index exists\n if (index in elements) {\n\n // initial value is set\n if (isset) {\n\n // replace initial value with a return value of callback\n value = callback(value, elements[index], index, elements);\n } else {\n // current element becomes initial value\n value = elements[index];\n\n // status of the initial value\n isset = true;\n }\n }\n }\n // make sure the initial value exists after iteration\n requireValue(isset);\n return value;\n }", "function reduceRight_(i, zero, f, __trace) {\n return (0, _suspend.suspend)(() => A.reduceRight_(Array.from(i), (0, _succeed.succeed)(zero), (el, acc) => core.chain_(acc, a => f(el, a))), __trace);\n}", "function reduceRightFn(array, reduceRightCallback, initial = undefined) {\n array = array.reverse();\n console.log(array)\n let accumulator = initial;\n\n if(accumulator === undefined) {\n accumulator = array[0];\n array.splice(0, 1);\n }\n\n array.forEach(element => {\n accumulator = reduceRightCallback(accumulator, element)\n })\n\n return accumulator;\n}", "function reducer(a,b) {\n return a + b;\n}", "function myReduceFunc() {\n \n\n\n}", "function reducer(a,b){\n return a += b;\n }", "function reduceRight(fn, memo, list) {\n if (isEmpty(list)) {\n return memo;\n }\n\n const { head, tail } = list;\n\n return fn(reduceRight(fn, memo, tail), head);\n}", "function reduceAll(f) {\n return as => reduceAll_(as, f);\n}", "function createReduce(dir){ // Optimized iterator function as using arguments.length\n\t// in the main function will deoptimize the, see #1991.\n\tfunction iterator(obj,iteratee,memo,keys,index,length){for(;index>=0&&index<length;index+=dir){var currentKey=keys?keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj);}return memo;}return function(obj,iteratee,memo,context){iteratee=optimizeCb(iteratee,context,4);var keys=!isArrayLike(obj)&&_.keys(obj),length=(keys||obj).length,index=dir>0?0:length-1; // Determine the initial value if none is provided.\n\tif(arguments.length<3){memo=obj[keys?keys[index]:index];index+=dir;}return iterator(obj,iteratee,memo,keys,index,length);};} // **Reduce** builds up a single result from a list of values, aka `inject`,", "function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n }", "function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n }", "function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n }", "function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n }", "function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n }", "function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n }", "function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n }", "function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n }", "function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n }", "function createReduce(dir) {\n\t\t // Optimized iterator function as using arguments.length\n\t\t // in the main function will deoptimize the, see #1991.\n\t\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t\t for (; index >= 0 && index < length; index += dir) {\n\t\t var currentKey = keys ? keys[index] : index;\n\t\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t\t }\n\t\t return memo;\n\t\t }\n\n\t\t return function(obj, iteratee, memo, context) {\n\t\t iteratee = optimizeCb(iteratee, context, 4);\n\t\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t\t length = (keys || obj).length,\n\t\t index = dir > 0 ? 0 : length - 1;\n\t\t // Determine the initial value if none is provided.\n\t\t if (arguments.length < 3) {\n\t\t memo = obj[keys ? keys[index] : index];\n\t\t index += dir;\n\t\t }\n\t\t return iterator(obj, iteratee, memo, keys, index, length);\n\t\t };\n\t\t }", "function createReduce(dir) {\n\t\t // Optimized iterator function as using arguments.length\n\t\t // in the main function will deoptimize the, see #1991.\n\t\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t\t for (; index >= 0 && index < length; index += dir) {\n\t\t var currentKey = keys ? keys[index] : index;\n\t\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t\t }\n\t\t return memo;\n\t\t }\n\n\t\t return function(obj, iteratee, memo, context) {\n\t\t iteratee = optimizeCb(iteratee, context, 4);\n\t\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t\t length = (keys || obj).length,\n\t\t index = dir > 0 ? 0 : length - 1;\n\t\t // Determine the initial value if none is provided.\n\t\t if (arguments.length < 3) {\n\t\t memo = obj[keys ? keys[index] : index];\n\t\t index += dir;\n\t\t }\n\t\t return iterator(obj, iteratee, memo, keys, index, length);\n\t\t };\n\t\t }", "function reduceRight(array, startingPoint, combiner) {\n let output = startingPoint;\n\n // here we use a for loop so we can loop in reverse\n for (let i = array.length - 1; i >= 0; --i) {\n // we execute the comber function by passing it the values it needs\n output = combiner(output, array[i]);\n }\n\n return output;\n}", "function createReduce(dir) {\n // Optimized iterator function as using arguments.length\n // in the main function will deoptimize the, see #1991.\n function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n}\n\nreturn function(obj, iteratee, memo, context) {\n iteratee = optimizeCb(iteratee, context, 4);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n // Determine the initial value if none is provided.\n if (arguments.length < 3) {\n memo = obj[keys ? keys[index] : index];\n index += dir;\n }\n return iterator(obj, iteratee, memo, keys, index, length);\n};\n}", "function reducer(accumulator, currentValue){\n return accumulator + currentValue;\n }", "function createReduce(dir) {\n // Optimized iterator function as using arguments.length\n // in the main function will deoptimize the, see #1991.\n function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }\n\n return function(obj, iteratee, memo, context) {\n iteratee = optimizeCb(iteratee, context, 4);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n // Determine the initial value if none is provided.\n if (arguments.length < 3) {\n memo = obj[keys ? keys[index] : index];\n index += dir;\n }\n return iterator(obj, iteratee, memo, keys, index, length);\n };\n }", "function createReduce(dir) {\n // Optimized iterator function as using arguments.length\n // in the main function will deoptimize the, see #1991.\n function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }\n\n return function(obj, iteratee, memo, context) {\n iteratee = optimizeCb(iteratee, context, 4);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n // Determine the initial value if none is provided.\n if (arguments.length < 3) {\n memo = obj[keys ? keys[index] : index];\n index += dir;\n }\n return iterator(obj, iteratee, memo, keys, index, length);\n };\n }", "function createReduce(dir) {\n // Optimized iterator function as using arguments.length\n // in the main function will deoptimize the, see #1991.\n function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }\n\n return function (obj, iteratee, memo, context) {\n iteratee = optimizeCb(iteratee, context, 4);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n // Determine the initial value if none is provided.\n if (arguments.length < 3) {\n memo = obj[keys ? keys[index] : index];\n index += dir;\n }\n return iterator(obj, iteratee, memo, keys, index, length);\n };\n }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function myReduce(arr, callFunction , accumulator = arr[0] ){\n\n\n\n // use let instead of var\n\n // if statement to check what we are doing\n\n\n // better way to inilize?\n // how to iniilize\n\n // maybe should be recursive?\n\n\n \n\n if (arguments.length === 3){\n\n var start = 0;\n\n // if an initial value was passed we need to look\n // at the first element\n\n\n\n\n } else {\n\n\n var start = 1;\n\n // if an initial value was not passed\n // we need to look at the first element\n\n\n\n\n }\n\n\n \n for (let i = start ; i < arr.length; i++){\n\n accumulator = callFunction(accumulator, arr[i]);\n\n \n\n // not always going to be +\n // not always going to be 0\n // will work in most cases I think\n\n\n\n }\n\n\n\n return accumulator;\n\n\n\n\n\n\n\n\n\n\n\n}", "function reduce(arr, func, intitial_value){\n accumulator = intitial_value\n for(let i =0; i< arr.length; i++){\n accumulator = func(arr[i], accumulator)\n }\n return accumulator\n}", "function reduceFunctions(f){\n function helper(p, func) {\n return func(p);\n }\n return p => f.reduce(helper, p);\n}", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\t\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\t\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\t\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\t\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\t\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\t\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\t\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\t\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\t\n\t return function(obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }", "function createReduce(dir) {\n\t // Optimized iterator function as using arguments.length\n\t // in the main function will deoptimize the, see #1991.\n\t function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }\n\n\t return function (obj, iteratee, memo, context) {\n\t iteratee = optimizeCb(iteratee, context, 4);\n\t var keys = !isArrayLike(obj) && _.keys(obj),\n\t length = (keys || obj).length,\n\t index = dir > 0 ? 0 : length - 1;\n\t // Determine the initial value if none is provided.\n\t if (arguments.length < 3) {\n\t memo = obj[keys ? keys[index] : index];\n\t index += dir;\n\t }\n\t return iterator(obj, iteratee, memo, keys, index, length);\n\t };\n\t }" ]
[ "0.69307965", "0.68434834", "0.67686254", "0.62968653", "0.6292559", "0.62247425", "0.6172193", "0.6078777", "0.607583", "0.6016731", "0.60144776", "0.60141987", "0.5947723", "0.59183216", "0.59162104", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.5865268", "0.5865268", "0.5793755", "0.5778055", "0.5770891", "0.57368803", "0.57290155", "0.5725522", "0.57177824", "0.57177824", "0.57177824", "0.57177824", "0.57177824", "0.57177824", "0.57177824", "0.57177824", "0.5704536", "0.5704224", "0.5701144", "0.5698298", "0.5698298", "0.5698298", "0.5698298", "0.5698298", "0.5698298", "0.5698298", "0.5698298", "0.5698298", "0.5690887" ]
0.0
-1
Optimized iterator function as using arguments.length in the main function will deoptimize the, see 1991.
function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TestAssignmentToIterator2() {\n var i = 0;\n arguments.__defineGetter__('callee', function(){});\n arguments.__defineGetter__('length', function(){ return 1 });\n arguments[Symbol.iterator] = [].entries;\n for (var entry of arguments) {\n assertEquals([i, arguments[i]], entry);\n i++;\n }\n\n assertEquals(arguments.length, i);\n}", "function values(){\n var args = arguments;\n //need to bind since arguments within next refers to arguments passed in to next\n //not the origin values arguments\n var n = args.length;\n var i = 0;\n return {\n next: function(){\n if (i >= n ){\n throw new Error(\"end of iteration\");\n } else {\n return args[i++];\n //store args[i] to return, increments i then return args[i]\n }\n }\n }\n}", "[ Symbol.iterator]( ...args){\n\t\t// look at retained state\n\t\tconst iteration= this.state&& this.state[ Symbol.iterator]\n\t\tif( iteration){\n\t\t\t// & iterate through it all\n\t\t\treturn iteration.call( this.state, ...args)\n\t\t}\n\t}", "function doFunction() {\n\tfor (let item of arguments) {\t// this works\n\t\tconsole.log(item);\n\t}\n}", "function iter$$1(f, xs) {\n for(var i = 0 ,i_finish = xs.length - 1 | 0; i <= i_finish; ++i){\n f(xs[i]);\n }\n return /* () */0;\n}", "function sum(){\n var sum=0;\n for(let elem of arguments){\n sum+=elem;\n }\nreturn sum\n}", "_makeIterator() {\n return this.fn.apply(this.context, this.args);\n }", "function cycleIterator(array) {\n let count = 0\n function innerFunc(){\n for(let i=0; i<array.length; i++){\n if(count < array.length){\n let result = array[count]\n count++\n return result\n }else{\n count = 0\n }\n };\n }\n return innerFunc\n}", "*[Symbol.iterator]() {\n let i = 0\n while (i < this.size()) {\n yield this.get(i)\n i++\n }\n }", "function each( x, F, i0, i1 )\n{\n var len = x.length, argslen = arguments.length;\n if ( argslen < 4 ) i1 = len-1;\n if ( 0 > i1 ) i1 += len;\n if ( argslen < 3 ) i0 = 0;\n if ( i0 > i1 ) return x;\n var i, k, l=i1-i0+1, l1, lr, r, q;\n r=l&15; q=r&1;\n if ( q ) F(x[i0], i0, x);\n for (i=q; i<r; i+=2)\n { \n k = i0+i;\n F(x[ k], k, x);\n F(x[++k], k, x);\n }\n for (i=r; i<l; i+=16)\n {\n k = i0+i;\n F(x[ k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n F(x[++k], k, x);\n }\n return x;\n}", "[Symbol.iterator]()\n {\n return this._iterate({ wrapPoint:false, includeEmpty:false });\n }", "function i(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}", "*[Symbol.iterator]() {\n const length = this.length;\n for (let i = 0 ; i < length ; i++) {\n yield this.get(i);\n }\n }", "function sum2() {\n console.log(arguments);\n\n let total = 0;\n for (let value of arguments) total += value;\n return total;\n}", "function argsFor() {\n\n}", "function iterar1(argumento1) {\n for (let myLoop = 0; myLoop < argumento1.length; myLoop++) {\n console.log(argumento1[myLoop]);\n }\n}", "function TestDirectArgumentsIteratorProperty() {\n assertTrue(arguments.hasOwnProperty(Symbol.iterator));\n assertFalse(arguments.propertyIsEnumerable(Symbol.iterator));\n var descriptor = Object.getOwnPropertyDescriptor(arguments, Symbol.iterator);\n assertTrue(descriptor.writable);\n assertFalse(descriptor.enumerable);\n assertTrue(descriptor.configurable);\n assertEquals(descriptor.value, [][Symbol.iterator]);\n assertEquals(arguments[Symbol.iterator], [][Symbol.iterator]);\n}", "function sumForLoop() {\n \"use strict\";\n var args = Array.prototype.slice.apply(arguments, []);\n var sum = 0;\n for (var i = 0; i < args.length; i++) {\n sum += args[i];\n }\n return sum;\n\n}", "function sumOfArguments() {\n let sum = 0;\n for (let i = 0; i < arguments.length; i++) {\n sum += arguments[i];\n }\n console.log(sum);\n}", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n}", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t\t for (; index >= 0 && index < length; index += dir) {\n\t\t var currentKey = keys ? keys[index] : index;\n\t\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t\t }\n\t\t return memo;\n\t\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t\t for (; index >= 0 && index < length; index += dir) {\n\t\t var currentKey = keys ? keys[index] : index;\n\t\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t\t }\n\t\t return memo;\n\t\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function argumentsArray() {\n console.log(\"argumentsArray() called\");\n \n // IE11: Not Supported\n console.log(\"IE11: for of loop Not Supported\");\n //for (let value of arguments) console.log(value);\n\n return arguments.length + \" arguments passed in\";\n}", "function sum2() {\n let total = 0;\n for (let num of arguments) {\n total += num;\n }\n return total;\n}" ]
[ "0.6528015", "0.60660607", "0.5998979", "0.59139353", "0.5854361", "0.58020836", "0.57688564", "0.57576233", "0.57464075", "0.574258", "0.57326597", "0.5720234", "0.570122", "0.56448364", "0.5634669", "0.5603158", "0.5603055", "0.56021297", "0.55884683", "0.5584208", "0.5581478", "0.5581478", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.5579746", "0.55793464", "0.5570613" ]
0.0
-1
Generator function to create the findIndex and findLastIndex functions
function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); var length = getLength(array); var index = dir > 0 ? 0 : length - 1; for (; index >= 0 && index < length; index += dir) { if (predicate(array[index], index, array)) return index; } return -1; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "location(index) {\n var idx = this.search.findLeft(index)\n if(idx+1<this.rows.length && this.rows[idx+1]==index) return [idx+1,0]\n return [idx, index-this.rows[idx]]\n }", "function createIndexFinder(dir,predicateFind,sortedIndex){return function(array,item,idx){var i=0,length=getLength(array);if(typeof idx=='number'){if(dir>0){i=idx>=0?idx:Math.max(idx+length,i);}else {length=idx>=0?Math.min(idx+1,length):idx+length+1;}}else if(sortedIndex&&idx&&length){idx=sortedIndex(array,item);return array[idx]===item?idx:-1;}if(item!==item){idx=predicateFind(slice.call(array,i,length),_.isNaN);return idx>=0?idx+i:-1;}for(idx=dir>0?i:length-1;idx>=0&&idx<length;idx+=dir){if(array[idx]===item)return idx;}return -1;};} // Return the position of the first occurrence of an item in an array,", "traverseToIndex() { }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t\t return function(array, item, idx) {\n\t\t var i = 0, length = getLength(array);\n\t\t if (typeof idx == 'number') {\n\t\t if (dir > 0) {\n\t\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t\t } else {\n\t\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t\t }\n\t\t } else if (sortedIndex && idx && length) {\n\t\t idx = sortedIndex(array, item);\n\t\t return array[idx] === item ? idx : -1;\n\t\t }\n\t\t if (item !== item) {\n\t\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t\t return idx >= 0 ? idx + i : -1;\n\t\t }\n\t\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t\t if (array[idx] === item) return idx;\n\t\t }\n\t\t return -1;\n\t\t };\n\t\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t\t return function(array, item, idx) {\n\t\t var i = 0, length = getLength(array);\n\t\t if (typeof idx == 'number') {\n\t\t if (dir > 0) {\n\t\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t\t } else {\n\t\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t\t }\n\t\t } else if (sortedIndex && idx && length) {\n\t\t idx = sortedIndex(array, item);\n\t\t return array[idx] === item ? idx : -1;\n\t\t }\n\t\t if (item !== item) {\n\t\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t\t return idx >= 0 ? idx + i : -1;\n\t\t }\n\t\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t\t if (array[idx] === item) return idx;\n\t\t }\n\t\t return -1;\n\t\t };\n\t\t }", "IndexOf() {\n\n }", "pos(index) {\n var idx = this.search.findLeft(index)\n if(idx+1<this.rows.length && this.rows[idx+1]==index)\n return [idx+1,0]\n return [idx, index-this.rows[idx]]\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN$1);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN$1);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN$1);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN$1);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN$1);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN$1);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN$1);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN$1);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN$1);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function (array, item, idx) {\n\t var i = 0,\n\t length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function (array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n\t return function(array, item, idx) {\n\t var i = 0, length = getLength(array);\n\t if (typeof idx == 'number') {\n\t if (dir > 0) {\n\t i = idx >= 0 ? idx : Math.max(idx + length, i);\n\t } else {\n\t length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t }\n\t } else if (sortedIndex && idx && length) {\n\t idx = sortedIndex(array, item);\n\t return array[idx] === item ? idx : -1;\n\t }\n\t if (item !== item) {\n\t idx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t return idx >= 0 ? idx + i : -1;\n\t }\n\t for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t if (array[idx] === item) return idx;\n\t }\n\t return -1;\n\t };\n\t }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }", "function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n }" ]
[ "0.6169708", "0.61012435", "0.60185516", "0.60123676", "0.60123676", "0.60076076", "0.59661746", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5918533", "0.5907632", "0.58996195", "0.5897573", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.58974653", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097", "0.5887097" ]
0.0
-1
Generator function to create the indexOf and lastIndexOf functions
function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if (typeof idx == 'number') { if (dir > 0) { i = idx >= 0 ? idx : Math.max(idx + length, i); } else { length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; } } else if (sortedIndex && idx && length) { idx = sortedIndex(array, item); return array[idx] === item ? idx : -1; } if (item !== item) { idx = predicateFind(slice.call(array, i, length), _.isNaN); return idx >= 0 ? idx + i : -1; } for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { if (array[idx] === item) return idx; } return -1; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LastIndexOf() {\n\n }", "IndexOf() {\n\n }", "indexOf(val) {}", "function myIndexOf2(source, searchValue, startIdx=0) {\n for (let i = startIdx; i <= source.length - searchValue.length; i++) {\n let substring = source.slice(i, i + searchValue.length);\n \n if (substring === searchValue) {\n return i;\n }\n }\n \n return -1;\n }", "match(input, start, end){}", "function lastIndexOf(str, token, start) {\n\treturn str \n\t\t? String(str).lastIndexOf(token, start || 0) \n\t\t: -1;\n}", "createIndexOfSplitMethod(splitAt){\n if(Array.isArray(splitAt)){\n this.getIndexOfSplit = (data)=>{\n for(let i=0; i<data.length - splitAt.length+1; i++){\n let valid=true;\n for(let k=0;k<splitAt.length; k++){\n if(data[i+k] !== splitAt[k]){\n valid=false;\n break;\n }\n }\n if(valid){\n return i + splitAt.length - 1;\n }\n }\n return -1;\n }\n } else if(typeof splitAt === 'function'){\n this.getIndexOfSplit = splitAt;\n } else if( splitAt.constructor.name === \"RegExp\" ){\n this.getIndexOfSplit = data => {\n const result = data.toString().match(splitAt)\n return result ? result.index + result[0].length - 1 : -1;\n };\n } else if( typeof splitAt === 'string' ){\n this.getIndexOfSplit = data => {\n const index = data.toString().indexOf(splitAt);\n if(index >= 0){\n return index + splitAt.length - 1\n }\n return -1;\n };\n }\n }", "indexOf(data) {}", "function indexOf(str1, str2) {\n var n = str1.lastIndexOf(str2);\n console.log(n);\n}", "indexOf(elemento){}", "function lastIndexOf(target, array) {\n //solution code here\n}", "function myIndexOf(haystack, needle, start_idx)\n{\n\tif (!start_idx) start_idx = 0;\n\tfor (var hs_idx=start_idx, nd_idx=0, len=haystack.length; hs_idx<len; hs_idx++)\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tif (haystack.charAt(hs_idx) === needle.charAt(nd_idx))\n\t\t\t{\n\t\t\t\tvar done;\n\t\t\t\tif (++nd_idx >= needle.length)\n\t\t\t\t{\n\t\t\t\t\t// match found\n\t\t\t\t\treturn hs_idx - needle.length + 1;\n\t\t\t\t}\n\t\t\t\telse break;\n\t\t\t}\n\t\t\telse if (nd_idx > 0) nd_idx = 0;\n\t\t\telse break;\n\t\t}\n\t}\n\n\treturn -1;\n}", "findEnd(rst, startToken, endToken, getFrom, includeLast){\n const inf = 1000000000;\n let counter = 1;\n let traversed = rst.substring(0, rst.indexOf(startToken) + startToken.length);\n rst = rst.substring(rst.indexOf(startToken) + startToken.length);\n while(counter > 0){\n const firstBeg = rst.indexOf(startToken) === -1 ? inf : rst.indexOf(startToken);\n const firstEnd = rst.indexOf(endToken) === -1 ? inf : rst.indexOf(endToken);\n if(firstBeg < firstEnd){\n counter++;\n traversed += rst.substring(0, firstBeg + startToken.length);\n rst = rst.substring(firstBeg + startToken.length)\n }\n else{\n counter--;\n traversed += rst.substring(0, firstEnd + endToken.length);\n rst = rst.substring(firstEnd + endToken.length);\n }\n }\n traversed = traversed.substring(traversed.indexOf(getFrom) + getFrom.length, traversed.length - endToken.length);\n // in case end token ist the same as the start token for a subsequent call\n if(includeLast)\n rst = endToken + rst;\n return new Tuple(traversed, rst);\n }", "function lastIndexOf(arr, elt, start=arr.length-1) {\n\tconsole.log(start);\n\tfor (let i = start; i >= 0; i--)\n\t\tif (arr[i] === elt) return i;\n\treturn -1;\n}", "_lineSearch(lineString, forwardSearch, backwardSearch) {\r\n let forward = lineString.indexOf(forwardSearch);\r\n let backward = lineString.indexOf(backwardSearch);\r\n if (forward >= 0 ){\r\n return forward;\r\n } else if (backward >= 0) {\r\n return backward;\r\n } else {\r\n return -1;\r\n }\r\n }", "function indexOfEndRecurse(text, start, end, from, fn) {\n var r = indexOf(text, [start, end], from, text.length);\n\n if ( r ) {\n if ( r.word == start ) {\n\n if ( fn ) {\n return fn(text, start, end, r.i); // We handle it manually here\n }\n else {\n // Index for the closing tag of this opening tag\n r = indexOfEndRecurse(text, start, end, r.i + start.length); // Must be the end one\n\n // Now, from k, find the next one recursively\n return indexOfEndRecurse(text, start, end, r + end.length);\n }\n\n } else {\n // Everything is in order\n return r.i;\n }\n }\n\n return undefined;\n }", "function myLastIndexOf(arr, element, startPos = arr.length){\n\n var index ;\n\n // uses the optional parameter\n\n for (let i = startPos ; i >= 0; i--){\n\n if (arr[i] === element) { // maybe use == instead\n\n // can exit here on true\n\n index = i ;\n\n\n return index;\n // return i;\n\n\n\n }\n\n\n\n }\n\n\n\n index = -1;\n\n return index;\n // return -1;\n // this is for if we want to go the whole array\n // not needed though\n\n\n\n}", "function lastIndexOfAny(str, arr, start) {\n var max = -1;\n for (var i = 0; i < arr.length; i++) {\n var val = str.lastIndexOf(arr[i], start);\n max = Math.max(max, val);\n }\n return max;\n }", "function indexOf(list, value) {\n\n}", "function stringLastIndexOf(s1, s2) {\n var i;\n for (i = s1.length; i > 0; i--) {\n if (s1[i] == s2)\n return i;\n }\n return -1;\n}", "_getInterpolationEndIndex(input, expressionEnd, start) {\n for (const charIndex of this._forEachUnquotedChar(input, start)) {\n if (input.startsWith(expressionEnd, charIndex)) {\n return charIndex;\n }\n // Nothing else in the expression matters after we've\n // hit a comment so look directly for the end token.\n if (input.startsWith('//', charIndex)) {\n return input.indexOf(expressionEnd, charIndex);\n }\n }\n return -1;\n }", "_getInterpolationEndIndex(input, expressionEnd, start) {\n for (const charIndex of this._forEachUnquotedChar(input, start)) {\n if (input.startsWith(expressionEnd, charIndex)) {\n return charIndex;\n }\n // Nothing else in the expression matters after we've\n // hit a comment so look directly for the end token.\n if (input.startsWith('//', charIndex)) {\n return input.indexOf(expressionEnd, charIndex);\n }\n }\n return -1;\n }", "getIndex() {\n\t\t\tconst {overrides} = this.impl;\n\t\t\tif (overrides !== undefined) {\n\t\t\t\treturn overrides.getIndex(this);\n\t\t\t}\n\n\t\t\treturn this.currentToken.start;\n\t\t}", "function i(e,n){return{start:e.start,end:e.end,index:n}}", "function lastPositionOcc (s){\n var position;\n for (i = s.length; i<=0; i--){\n if (s[i] === 'a'){\n position = i;\n }else{\n position = -1\n }\n }\n return position;\n}", "function find_second(s1, s2) {\n var first_f = s1.indexOf(s2);\n var second_f = s1.indexOf(s2, first_f +1);\n return second_f;\n // console.log(search_s);\n\n}", "function strrpos(strText, strFinder, intOffset)\n{\n var intCount = -1;\n if (intOffset) {\n intCount = (strText + '').slice(intOffset).lastIndexOf(strFinder);\n if (intCount !== -1)\n intCount += intOffset;\n } else\n intCount = (strText + '').lastIndexOf(strFinder);\n return intCount >= 0 ? intCount : false;\n}", "function substringByStartAndEnd(input, start, end) {}", "function boyer_moore_horspool(raw, templ) {\n\tvar indexes = [];\n\tvar stop_table = {};\n\tvar t_len = templ.length;\n\tvar start_offset = 0;\n\tvar curr_substr = '';\n\tfor(var i = 0; i < t_len - 1; i++) {\n\t\tstop_table[templ[i]] = t_len - i - 1;\n\t}\n\t//console.log(stop_table);\n\twhile(true) {\n\t\tcurr_substr = raw.substr(start_offset, t_len);\n\t\t//console.log(curr_substr, start_offset, t_len);\n\t\tif(curr_substr === templ)\n\t\t\tindexes.push(start_offset)\n\t\tif(start_offset + t_len > raw.length)\n\t\t\tbreak\n\t\tlsymb = curr_substr[curr_substr.length-1]\n\t\tstart_offset += stop_table[lsymb]? stop_table[lsymb] : t_len;\n\t}\n\treturn indexes\n}", "function indexOf(text, words, from, to) {\n if ( words.substring ) words = [words];\n\n for ( ;from < text.length && from < to ; from++ ) {\n for ( var j = 0; j < words.length ; j++ ) {\n if ( words[j].length <= to && matchesWord(text, words[j], from) ) {\n return { word: words[j], i: from, j:j };\n }\n }\n }\n\n return undefined;\n }", "function indexer(str, find) {\n return str.indexOf(find) > 0 ? str.indexOf(find) : false;\n }", "function indexOf(item,arr,begin,end){for(var i=begin;i<end;i++){if(arr[i]===item)return i;}return-1;}", "indexOf() {\n return this.choices.indexOf.apply(this.choices, arguments);\n }", "indexOf() {\n return this.choices.indexOf.apply(this.choices, arguments);\n }", "function indexOf(str, token, start) {\n\treturn str \n\t\t? String(str).indexOf(token, start || 0) \n\t\t: -1;\n}", "function stringFunctions(value) {\n console.log(`.length - ${value.length}`);\n console.log(`.endsWith('World') - ${value.endsWith(\"World\")}`);\n console.log(`.startsWith('Hello') - ${value.startsWith(\"Hello\")}`);\n console.log(`.indexOf('Hello') - ${value.indexOf(\"Hello\")}`);\n console.log(`.substr(2, 3) - ${value.substr(2, 3)}`); // (start-index, length) start at start-index, read for 3 characters \n console.log(`.substring(2, 3) - ${value.substring(2, 3)}`); // (start-index, end-index) start at start-index, up to but not including the end-index\n \n /*\n Other Methods\n - split(string)\n - toLowerCase()\n - trim()\n - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n */\n}", "function firstToLast(str,c){\n if(str.lastIndexOf(c)===-1) return -1\n return str.lastIndexOf(c)-str.indexOf(c);\n}", "function fnormalize(text,change, change2) {\n let x = 0;\n let y = 0;\n let firstIndex = text.indexOf(change);\n console.log(firstIndex);\n if (firstIndex != -1) {\n \n for (let i = firstIndex; i < text.length; i++) {\n \n res= text.indexOf(change, i+1);\n if (res!== y ) {\n x++\n } //else if (res === y){ break;}\n y = res\n }\n \n }\n for (let k = 0; k < x+1 ; k++) {\n text = text.replace(change, change2);\n \n }\n return text\n\n}", "function createEndsWithFilter(endsWith) {\n // YOUR CODE BELOW HERE //\n \n //return a function, this function takes givenValue\n return function (givenValue){\n //use last character of both. match their case. check if equal.\n return endsWith[endsWith.length-1].toLowerCase() === givenValue[givenValue.length-1].toLowerCase();\n \n };\n \n \n // YOUR CODE ABOVE HERE //\n}", "function getIndex(ranges, cursor, end) {\n for (var i = 0; i < ranges.length; i++) {\n var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);\n var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);\n if (atAnchor || atHead) {\n return i;\n }\n }\n return -1;\n }", "function getIndex(ranges, cursor, end) {\n for (var i = 0; i < ranges.length; i++) {\n var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);\n var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);\n if (atAnchor || atHead) {\n return i;\n }\n }\n return -1;\n }", "function testcase() {\n var arr = [0, 1, 2, 3, 4];\n //'fromIndex' will be set as 4 if not passed by default\n return arr.lastIndexOf(0) === arr.lastIndexOf(0, 4) &&\n arr.lastIndexOf(2) === arr.lastIndexOf(2, 4) &&\n arr.lastIndexOf(4) === arr.lastIndexOf(4, 4);\n }", "function secondIndex(str, target) {\n\tlet count = 0;\n\tfor (let i = 0; i < str.length; i++) {\n\t\tif (str[i] === target) {\n\t\t\tcount++;\n\t\t}\n\t\tif (count === 2) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn undefined;\n}", "function lastIndexOf(array, last){\n\tvar match = false;\n\tvar index;\n\n\tfor(var i = array.length - 1; i >= 0; i--){\n\t\tif(array[i] === last){\n\t\t\tmatch = true;\n\t\t\tindex = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif(match){\n\t\treturn index;\n\t}else{\n\t\treturn -1;\n\t}\n}", "_getNextIndexOf(object){\n let savepoint = this.state.currentPoint;\n return function(propertyName){\n let currentPoint = savepoint[propertyName];\n let maxIndex = object.length - 1;\n let n = currentPoint + 1;\n if (n > maxIndex) {\n return null\n }\n return n;\n }\n }", "function strpos( haystack, needle, offset){ // Finds position of first occurrence of a string within another \r\n var i = (haystack+'').indexOf( needle, offset ); \r\n return i===-1 ? false : i;\r\n}", "function nthIndexOf(subject, target, n) {\r\n var i, tLen,\r\n indices = [],\r\n nIsNegative = n < 0,\r\n fnName = (nIsNegative ? 'lastI' : 'i') + 'ndexOf',\r\n l = subject.length,\r\n increment = nIsNegative ? -1 : 1;\r\n if (n = ~~n) {\r\n if (isArrayLike(subject)) {\r\n for (i = nIsNegative ? l - 1 : 0; nIsNegative ? i >= 0 : (i < l); i += increment) {\r\n if (target === subject[i] && !(n -= increment)) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n }\r\n else if (typeOf(subject, 'String')) {\r\n if (typeOf(target, 'RegExp')) {\r\n target = flagRegExp(target, 'g');\r\n subject.replace(target, function(a) {\r\n a = arguments;\r\n indices.push(a[a.length - 2]);\r\n });\r\n return increment * n <= indices.length ? indices.slice(nIsNegative ? n : ~-n)[0] : -1;\r\n }\r\n else {\r\n subject = subject.split(target);\r\n return subject[n * increment] != undefined ? subject.slice(0, n).join(target).length : -1;\r\n }\r\n }\r\n else {\r\n for (i in subject) {\r\n if (target === subject[i]) {\r\n n -= increment;\r\n if (nIsNegative) {\r\n indices.push(i);\r\n }\r\n else if (!n) {\r\n return i;\r\n }\r\n }\r\n }\r\n if (n < indices.length) {\r\n return indices[n];\r\n }\r\n }\r\n }\r\n }", "function Occurence(count,searchstr,mainstr)\n{\n //console.log(\"Occurance:\"+count+\"/\"+searchstr+\"/\"+ mainstr)\n let offset=0;\n for (let i=0;i<count;i++)\n {\n let n = mainstr.substring(offset).indexOf(searchstr);\n if (n>=0)\n {\n offset+=n+ searchstr.length;\n }\n else\n {\n //console.log(\"error\");\n return -1\n }\n //console.log(offset);\n //console.log(mainstr.substring(offset)) \n }\n let ret= offset-searchstr.length;\n //console.log(\"Occurance:\"+mainstr.substring(ret))\n return ret;\n}", "function createEndsWithFilter(endsWith) {\n // YOUR CODE BELOW HERE //\n return function (str){\n \n // Test whether the last index of a string wether upper or lower case is equal to endsWith.\n if(str.charAt(str.length - 1).toUpperCase() === endsWith || str.charAt(str.length - 1).toLowerCase() === endsWith){\n return true;\n } else{\n return false;\n }\n } ; \n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function lastIndexOf(item, arr, start, stop)\n{\n\tif (start >= arr.length || start < 0 || stop >= arr.length || stop < 0 || start < stop) return -1;\n\tvar index;\n\tvar startPoint = (start || arr.length-1);\n\tvar stopFlag = (stop-1 || -1); //ensures that the first element in the array is checked\n\n\tvar i;\n\tfor (i = startPoint; i > stopFlag; i--)\n\t{\n\t\tif (arr[i] === item)\n\t\t{\n\t\t\tindex = i;\n\t\t\treturn index;\n\t\t}\n\t}\n\tindex = -1;\n\treturn index;\n}", "prevMatchInRange(state, from, to) {\n for (let pos = to;;) {\n let start = Math.max(from, pos - 10000 /* ChunkSize */ - this.spec.unquoted.length);\n let cursor = stringCursor(this.spec, state, start, pos), range = null;\n while (!cursor.nextOverlapping().done)\n range = cursor.value;\n if (range)\n return range;\n if (start == from)\n return null;\n pos -= 10000 /* ChunkSize */;\n }\n }", "function indexOf(val) {\n return this.indexOf(val);\n}", "function indexOfStringEnd(code,ix) {\r\n\t\tvar quote = code.charAt(ix); \r\n\t\tfor (var j=ix+1;j<code.length;j++) {\r\n\t\t\tvar x0 = code.charAt(j); \r\n\t\t\tvar x1 = code.charAt(j+1); \r\n\t\t\tif (x0 === '\\n' ) { return -j; } \r\n\t\t\tif (x0 === '\\\\' && x1 === '\\\\') { j+=1; continue; }\r\n\t\t\tif (x0 === '\\\\' && x1 === quote) { j+=1; continue; }\r\n\t\t\tif (x0 === quote) { return j+1; }\r\n\t\t}\r\n\t}", "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(isNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(isNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "ranges(words, history, custom = () => {}) {\n // [[start, end, type], ...]\n let ranges = words.map((w, n) => w.ranges(this.toString()).map(r => [...r, n])).flat().sort((a, b) => {\n return a[0] - b[0];\n });\n // remove conflicts\n let offset = 0;\n ranges.forEach((range, m) => {\n ranges[m][0] = Math.max(range[0], offset);\n offset = Math.max(range[1] + 1, offset);\n });\n // remove empty ranges\n ranges = ranges.filter(r => r[1] >= r[0]);\n\n // extract text nodes\n const content = this.toString();\n\n const doc = this.e.ownerDocument;\n const walk = doc.createTreeWalker(this.e, NodeFilter.SHOW_TEXT, {\n acceptNode: () => {\n return NodeFilter.FILTER_ACCEPT;\n }\n }, false);\n let t;\n let position = -1;\n let ch;\n const update = () => {\n position += 1;\n if (position === content.length) {\n return false;\n }\n ch = content[position];\n };\n update();\n let range = ranges.shift();\n let e = doc.createRange();\n\n const track = () => {\n const out = [];\n\n while (t = walk.nextNode()) {\n const ignore = history.has(t);\n\n history.add(t);\n const data = t.data.replace(/[\\n\\t]/g, ' ');\n\n for (let x = 0; x < data.length; x += 1) {\n if (data[x] === ch) {\n if (range[0] === position) {\n e.setStart(t, x);\n }\n if (range[1] === position) {\n e.setEnd(t, x + 1);\n if (ignore === false) {\n custom(e, this.words[range[2]]);\n out.push(e);\n }\n\n range = ranges.shift();\n\n if (!range) {\n return out;\n }\n e = doc.createRange();\n }\n if (update() === false) {\n throw Error('position reached');\n }\n }\n }\n }\n throw Error('end of stream');\n };\n\n return track();\n }", "allStringPositions(hay, ndl) {\n let off = 0 // offset\n let all = []\n let pos\n\n while ((pos = hay.indexOf(ndl, off)) !== -1) {\n off = pos + 1\n all.push(pos)\n }\n\n return all\n }", "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\nif(buffer.length===0)return-1;// Normalize byteOffset\nif(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byteOffset=-0x80000000;}byteOffset=+byteOffset;// Coerce to Number.\nif(numberIsNaN(byteOffset)){// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1;}// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1;}else if(byteOffset<0){if(dir)byteOffset=0;else return-1;}// Normalize val\nif(typeof val==='string'){val=Buffer.from(val,encoding);}// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1;}return arrayIndexOf(buffer,val,byteOffset,encoding,dir);}else if(typeof val==='number'){val=val&0xFF;// Search for a byte value [0-255]\nif(typeof Uint8Array.prototype.indexOf==='function'){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset);}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset);}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir);}throw new TypeError('val must be string, number or Buffer');}", "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){\n// Empty buffer means no match\nif(buffer.length===0)return-1\n// Normalize byteOffset;\nif(typeof byteOffset===\"string\"){encoding=byteOffset;byteOffset=0}else if(byteOffset>2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset// Coerce to Number.;\nif(numberIsNaN(byteOffset)){\n// byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\nbyteOffset=dir?0:buffer.length-1}\n// Normalize byteOffset: negative offsets start from the end of the buffer\nif(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}\n// Normalize val\nif(typeof val===\"string\"){val=Buffer.from(val,encoding)}\n// Finally, search either indexOf (if dir is true) or lastIndexOf\nif(Buffer.isBuffer(val)){\n// Special case: looking for empty string/buffer always fails\nif(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val===\"number\"){val=val&255// Search for a byte value [0-255];\nif(typeof Uint8Array.prototype.indexOf===\"function\"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError(\"val must be string, number or Buffer\")}", "function sc_stringIndexRight(s, cset, start) {\n var res;\n if (!start) start = s.length - 1;\n\n if (cset instanceof sc_Char) {\n res = s.lastIndexof(sc_char2string(cset), start);\n return res >= 0 ? res : false;\n }\n if (cset.length == 1) {\n res = s.lastIndexOf(cset, start);\n return res >= 0 ? res : false;\n } else {\n for (var i = start; i >= 0; i-- ) {\n\t if (cset.indexOf(s.charAt(i)))\n\t return i;\n }\n\n return false;\n }\n}", "function xBeforeYOnTheRight(str, startingIdx, x, y) {\n for (var i = startingIdx, len = str.length; i < len; i++) {\n if (str.startsWith(x, i)) {\n // if x was first, Bob's your uncle, that's truthy result\n return true;\n }\n\n if (str.startsWith(y, i)) {\n // since we're in this clause, x failed, so if y matched,\n // this means y precedes x\n return false;\n }\n } // default result\n\n\n return false;\n}", "location(index) {\n var idx = this.search.findLeft(index)\n if(idx+1<this.rows.length && this.rows[idx+1]==index) return [idx+1,0]\n return [idx, index-this.rows[idx]]\n }", "function editEnd(from, to) {\n if (!to) return 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "function editEnd(from, to) {\n if (!to) return 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "function editEnd(from, to) {\n if (!to) return 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "match(input, start, end) {\n start = start || 0\n end = end || input.length\n if(typeof input === 'string') input = new Source(input)\n if( !this.startsWith(input.get(start)) )\n return this.error(input, start, start+1)\n var n = end\n end=start+1\n while(end<n && this.startsWith(input.get(end))) end++\n return this.token(input,start,end,\" \")\n }", "function getLastMeasureIndex(text) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var prefixList = Array.isArray(prefix) ? prefix : [prefix];\n return prefixList.reduce(function (lastMatch, prefixStr) {\n var lastIndex = text.lastIndexOf(prefixStr);\n\n if (lastIndex > lastMatch.location) {\n return {\n location: lastIndex,\n prefix: prefixStr\n };\n }\n\n return lastMatch;\n }, {\n location: -1,\n prefix: ''\n });\n}", "function getLastMeasureIndex(text) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var prefixList = Array.isArray(prefix) ? prefix : [prefix];\n return prefixList.reduce(function (lastMatch, prefixStr) {\n var lastIndex = text.lastIndexOf(prefixStr);\n\n if (lastIndex > lastMatch.location) {\n return {\n location: lastIndex,\n prefix: prefixStr\n };\n }\n\n return lastMatch;\n }, {\n location: -1,\n prefix: ''\n });\n}", "function getLastMeasureIndex(text) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var prefixList = Array.isArray(prefix) ? prefix : [prefix];\n return prefixList.reduce(function (lastMatch, prefixStr) {\n var lastIndex = text.lastIndexOf(prefixStr);\n\n if (lastIndex > lastMatch.location) {\n return {\n location: lastIndex,\n prefix: prefixStr\n };\n }\n\n return lastMatch;\n }, {\n location: -1,\n prefix: ''\n });\n}", "function getLastMeasureIndex(text) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var prefixList = Array.isArray(prefix) ? prefix : [prefix];\n return prefixList.reduce(function (lastMatch, prefixStr) {\n var lastIndex = text.lastIndexOf(prefixStr);\n\n if (lastIndex > lastMatch.location) {\n return {\n location: lastIndex,\n prefix: prefixStr\n };\n }\n\n return lastMatch;\n }, {\n location: -1,\n prefix: ''\n });\n}", "function getLastMeasureIndex(text) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var prefixList = Array.isArray(prefix) ? prefix : [prefix];\n return prefixList.reduce(function (lastMatch, prefixStr) {\n var lastIndex = text.lastIndexOf(prefixStr);\n\n if (lastIndex > lastMatch.location) {\n return {\n location: lastIndex,\n prefix: prefixStr\n };\n }\n\n return lastMatch;\n }, {\n location: -1,\n prefix: ''\n });\n}", "function MATCH()\n{\n if(arguments.length==0)\n {\n alert(\"please enter parameter into function \");\n return \"=MATCH()\";\n }\n \n for(var i=1;i<arguments.length-1;i++)\n {\n \n if(arguments[0]==arguments[i])\n\n {\n return i;\n }\n \n \n }\n\n \n\n return \"#NAME?\";\n\n}", "function getIndicesString(bitstring, query, start) {\n var splitStart = _.max([bitstring.indexOf(query),start]);\n var startIndex = bitstring.substring(0,splitStart).split(',').length - 1;\n var endIndex = startIndex + query.split(',').length - 3;\n\n if (startIndex == endIndex) {\n return startIndex + '';\n } else {\n return startIndex + ':' + endIndex;\n }\n}", "function t(e,a){return{start:e.start,end:e.end,index:a}}", "function createPositionalPseudo( fn ) {\n return markFunction(function( argument ) {\n argument = +argument;\n return markFunction(function( seed, matches ) {\n var j,\n matchIndexes = fn( [], seed.length, argument ),\n i = matchIndexes.length;\n\n // Match elements found at the specified indexes\n while ( i-- ) {\n if ( seed[ (j = matchIndexes[i]) ] ) {\n seed[j] = !(matches[j] = seed[j]);\n }\n }\n });\n });\n}", "function indexOfAll(tempArr){\r\n\r\n for(let i = 0 ; i <tempArr.length ; i++){\r\n\r\n console.log(indexOf(tempArr[i]));\r\n }\r\n /*\r\n tempArr.forEach((a)=> console.log(indexOf(tempArr[a]))); // same like above\r\n */\r\n //Note if we want to search from end to start , we can use lastIndexOf()\r\n\r\n }", "function getFirstAndLast(str, callback){\n firstChar(str, function(firstLetter){\n lastChar(str, function(lastLetter){\n callback(firstLetter + lastLetter);\n });\n });\n}", "function getLastMeasureIndex(text) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var prefixList = Array.isArray(prefix) ? prefix : [prefix];\n return prefixList.reduce(function (lastMatch, prefixStr) {\n var lastIndex = text.lastIndexOf(prefixStr);\n if (lastIndex > lastMatch.location) {\n return {\n location: lastIndex,\n prefix: prefixStr\n };\n }\n return lastMatch;\n }, {\n location: -1,\n prefix: ''\n });\n}", "function lastIndexOf(arr, target) {\n return arr.reduce( (startIndex, item, index) => {\n item === target ? startIndex = index : null;\n return startIndex;\n }, -1)\n}", "function editEnd(from, to) {\n if (!to) return from ? from.length : 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "function editEnd(from, to) {\n if (!to) return from ? from.length : 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "function editEnd(from, to) {\n if (!to) return from ? from.length : 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "function nthIndexOf (s, v, from, n, reverse) {\n let d = reverse ? -1 : 1\n from -= d\n for (let c=0; c<n; c++) {\n from = reverse ? s.lastIndexOf(v, from + d) : s.indexOf(v, from + d)\n }\n return from\n}", "function indexOf(str1, str2) {\n var n = str1.indexOf(str2);\n console.log(n);\n}", "function _indexOf(a,s){\n\t// Do we need the hack?\n\tif(a.indexOf){\n\t\treturn a.indexOf(s);\n\t}\n\n\tfor(var j=0;j<a.length;j++){\n\t\tif(a[j]===s){\n\t\t\treturn j;\n\t\t}\n\t}\n\treturn -1;\n}", "search(string, startPosition, callback) {\n if (startPosition == null) {\n startPosition = 0;\n }\n if (typeof startPosition === 'function') {\n callback = startPosition;\n startPosition = 0;\n }\n try {\n const ret = this.searchSync(string, startPosition);\n callback(null, ret);\n }\n catch (error) {\n callback(error);\n }\n }", "search(string, startPosition, callback) {\n if (startPosition == null) {\n startPosition = 0;\n }\n if (typeof startPosition === 'function') {\n callback = startPosition;\n startPosition = 0;\n }\n try {\n const ret = this.searchSync(string, startPosition);\n callback(null, ret);\n }\n catch (error) {\n callback(error);\n }\n }", "function firstToLast(str,c){\n if(str.indexOf(c) === -1) return -1;\n return str.lastIndexOf(c) - str.indexOf(c);\n}", "search(string, startPosition, callback) {\r\n if (startPosition == null) {\r\n startPosition = 0;\r\n }\r\n if (typeof startPosition === 'function') {\r\n callback = startPosition;\r\n startPosition = 0;\r\n }\r\n try {\r\n const ret = this.searchSync(string, startPosition);\r\n callback(null, ret);\r\n }\r\n catch (error) {\r\n callback(error);\r\n }\r\n }", "function indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item)\n return i;\n }\n return -1;\n}", "function indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item)\n return i;\n }\n return -1;\n}", "function indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item)\n return i;\n }\n return -1;\n}", "function indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item)\n return i;\n }\n return -1;\n}", "function indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item)\n return i;\n }\n return -1;\n}", "function indexOf(item, arr, begin, end) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item)\n return i;\n }\n return -1;\n}", "function splitAt_(insertPosition) {\n \n}", "function xIndexOf(Val, Str, x) {\n 'use strict';\n\n var Ot,\n i;\n\n if (x <= (Str.split(Val).length - 1)) {\n Ot = Str.indexOf(Val);\n if (x > 1) {\n for (i = 1; i < x; i += 1) {\n Ot = Str.indexOf(Val, Ot + 1);\n }\n }\n return Ot;\n } else {\n alert(Val + \" Occurs less than \" + x + \" times\");\n return 0;\n }\n}", "function r0(e,t){var n=new RegExp(\"^\".concat(!e&&e!==0?\"\":e,\"$\")),r=ed(t);return r.findIndex(function(a){return n.test(a)})}", "function ArrayIndex(){\n var indices = [];\n var array = ['a', 'b', 'a', 'c', 'a', 'd'];\n var element = 'a';\n var idx = array.lastIndexOf(element);\n \n console.log('Index of Element', idx)\n \n while (idx != -1) {\n\n indices.push(idx);\n\n idx = (idx > 0 ? array.lastIndexOf(element, idx - 1) : -1);\n //Output\n // [ 4, 2, 0 ]\n }\n\n console.log('Postions of \"a\" element in Array',indices);\n\n}", "indexOf(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = 0;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n }" ]
[ "0.6704978", "0.61552393", "0.60958135", "0.5932218", "0.5810419", "0.5789355", "0.5777259", "0.5732596", "0.56094474", "0.55971", "0.5525533", "0.55069697", "0.5505558", "0.5496774", "0.5481369", "0.5341538", "0.53364044", "0.53041726", "0.52636915", "0.5210988", "0.5210491", "0.5210491", "0.5187071", "0.516969", "0.5109439", "0.51031995", "0.5095523", "0.5084962", "0.50770783", "0.502622", "0.501622", "0.50057536", "0.49993566", "0.49993566", "0.4998054", "0.49960443", "0.4990853", "0.49879593", "0.49868998", "0.49779293", "0.49779293", "0.4970022", "0.4964027", "0.4956204", "0.49543887", "0.4949318", "0.49471667", "0.4943458", "0.4943036", "0.49212736", "0.49155456", "0.49070638", "0.48978525", "0.48948485", "0.48948485", "0.48924482", "0.48864484", "0.48829558", "0.48829558", "0.48824245", "0.48813465", "0.4877985", "0.48753902", "0.48749366", "0.48749366", "0.48749366", "0.4865599", "0.48618522", "0.48618522", "0.48618522", "0.48618522", "0.48618522", "0.48602057", "0.48598537", "0.4856724", "0.48544684", "0.48495552", "0.48401275", "0.48363605", "0.4828913", "0.48273462", "0.48273462", "0.48273462", "0.48176327", "0.48082694", "0.48056087", "0.48052892", "0.48052892", "0.48040462", "0.4799844", "0.47968006", "0.47968006", "0.47968006", "0.47968006", "0.47968006", "0.47968006", "0.47956547", "0.4795471", "0.47897428", "0.47895014", "0.47854543" ]
0.0
-1
Generated by PEG.js 0.8.0.
function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() { super(new GeneratorParser(true)) }", "static definition() {\n return 'A tree is a perennial plant with an elongated stem, or trunk, supporting branches and leaves.'\n }", "function generate (p) {\n // Type\n if (typeof p === 'string' && node.type === null) {\n node.type = p.replace(/^./, ch => ch.toUpperCase())\n return\n }\n\n // Type\n if (typeof p === 'function') {\n node.type = p\n return\n }\n\n // Children\n if (isArray(p)) {\n node.children = p\n return\n }\n\n // Attr\n if (typeof p === 'object') {\n node.attr = p\n return\n }\n\n // Content\n if (typeof p === 'string') {\n node.attr.content = p\n return\n }\n }", "function SSyntax() {\r\n}", "Program(p) {\n gen(p.statements)\n }", "function t(e){switch(e.type){case V.AssignmentExpression:case V.ArrayExpression:case V.ArrayPattern:case V.BinaryExpression:case V.CallExpression:case V.ConditionalExpression:case V.ClassExpression:case V.ExportBatchSpecifier:case V.ExportSpecifier:case V.FunctionExpression:case V.Identifier:case V.ImportSpecifier:case V.Literal:case V.LogicalExpression:case V.MemberExpression:case V.MethodDefinition:case V.NewExpression:case V.ObjectExpression:case V.ObjectPattern:case V.Property:case V.SequenceExpression:case V.ThisExpression:case V.UnaryExpression:case V.UpdateExpression:case V.YieldExpression:return!0}return!1}// Generation is done by generateStatement.", "function generators() {\n\t\t\t\tBlockly.JavaScript.fw = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.rr = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.rl = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.lt = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.start = function(block) {\n\t\t\t\t\treturn '';\n\t\t\t\t};\n\t\t\t}", "function Rep() {\r\n}", "function G(){}", "generate() {\n return {\n instructions: 'instructions here',\n question: 'question here',\n diagram: 'diagram here',\n answer: 'answer here',\n }\n }", "function symbol(s, p) {\n var x = state.syntax[s];\n if (!x || typeof x !== \"object\") {\n state.syntax[s] = x = {\n id: s,\n lbp: p,\n value: s\n };\n }\n return x;\n }", "function PEGtoAST(node) {\n switch (type(node)) {\n case \"null\":\n return undefined;\n case \"string\":\n return new StringNode(node);\n case \"array\":\n return new ASTNodeList(...node.map(PEGtoAST));\n case \"object\":\n switch (node.TYPE) {\n case \"whitespace\":\n return new Whitespace();\n case \"parbreak\":\n return new Parbreak();\n case \"subscript\":\n return new Subscript(PEGtoAST(node.content));\n case \"superscript\":\n return new Superscript(PEGtoAST(node.content));\n case \"inlinemath\":\n return new InlineMath(PEGtoAST(node.content));\n case \"displaymath\":\n return new DisplayMath(PEGtoAST(node.content));\n case \"mathenv\":\n return new MathEnv(node.env, PEGtoAST(node.content));\n case \"group\":\n return new Group(PEGtoAST(node.content));\n case \"macro\":\n return new Macro(node.content, PEGtoAST(node.args));\n case \"environment\":\n return new Environment(\n PEGtoAST(node.env),\n PEGtoAST(node.args),\n PEGtoAST(node.content)\n );\n case \"verbatim\":\n return new Verbatim(PEGtoAST(node.content));\n case \"verb\":\n return new Verb(node[\"escape\"], PEGtoAST(node.content));\n case \"commentenv\":\n return new CommentEnv(PEGtoAST([node.content]));\n case \"comment\":\n return new CommentNode(\n node.sameline,\n PEGtoAST(node.content)\n );\n case \"arglist\":\n return new ArgList(PEGtoAST(node.content));\n }\n }\n}", "function P(){}", "function Generator() {} // 84", "constructor( type, code_or_tree, embedded=false ){\n super(type)\n if(typeof code_or_tree == \"string\" ){\n var p = new GeneratorParser(false, embedded)\n this.tree = p.get(new Source(\"generator-lexeme\",code_or_tree))\n }else this.tree = code_or_tree\n }", "get formula() { return this.ast ? this.ast.toString(this.id) : ''; }", "function Expr() {}", "function Pe(){}", "function u$2(u,e){t$i`\n /*\n * ${e.name}\n * ${0===e.output?\"RenderOutput: Color\":1===e.output?\"RenderOutput: Depth\":3===e.output?\"RenderOutput: Shadow\":2===e.output?\"RenderOutput: Normal\":4===e.output?\"RenderOutput: Highlight\":\"\"}\n */\n `;}", "compile() {\n return { [this.word]: this.body };\n }", "function ecma (){}", "man() {\n console.log('Peano - Expression := ');\n console.log('0 | ++expr | --expr | definition');\n console.log('definition = <Nom_fonction>(<arg>i, <arg>j, ...) { }');\n console.log('\\n');\n }", "function newSyntax() {\n foo::bar();\n const { abc } = { ...oneTwoThree };\n return new.target;\n }", "define () {\n return {\n type: '@node',\n id: 'string'\n }\n }", "static generateCode() {\n let parserSource = parser.generate();\n return parserSource;\n }", "constructor(body, freevars, dotpos, expected_args){\n this.body = body;\n this.freevars = freevars;\n this.dotpos = dotpos;\n this.expected_args = expected_args;\n }", "function _t_(_p, _n, _g, _port) {\n hdl.obj(this, _p, _n);\n this._seq = {\n type: 'BlockStatement',\n body: [{\n type: 'IfStatement',\n test: {\n type: 'FunccallExpression',\n arguments: [{\n type: 'Association',\n value: {\n type: 'Identifier',\n phase: 'name',\n value: \"clk\"\n }\n }]\n },\n consequence: {\n type: 'BlockStatement',\n body: [{\n type: 'IfStatement',\n test: {\n type: 'BinaryExpression',\n operator: \"=\",\n left: {\n type: 'Identifier',\n phase: 'name',\n value: \"holdn\"\n },\n right: {\n type: 'EnumLiteral',\n value: \"'1'\"\n }\n },\n consequence: {\n type: 'BlockStatement',\n body: [{\n type: 'AssignmentExpressionSig',\n left: {\n type: 'Identifier',\n phase: 'name',\n value: \"r\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'Identifier',\n phase: 'name',\n value: \"rin\"\n }\n }]\n }]\n }]\n },\n alternate: {\n type: 'BlockStatement',\n body: [{\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"x\"\n },\n element: \"ipend\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"rin\"\n },\n element: \"x\"\n },\n element: \"ipend\"\n }\n }]\n }]\n }, {\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"m\"\n },\n element: \"werr\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"rin\"\n },\n element: \"m\"\n },\n element: \"werr\"\n }\n }]\n }]\n }, {\n type: 'IfStatement',\n test: {\n type: 'BinaryExpression',\n operator: \"=\",\n left: {\n type: 'BinaryExpression',\n operator: \"or\",\n left: {\n type: 'Identifier',\n phase: 'name',\n value: \"holdn\"\n },\n right: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"ico\"\n },\n element: \"mds\"\n }\n },\n right: {\n type: 'EnumLiteral',\n value: \"'0'\"\n }\n },\n consequence: {\n type: 'BlockStatement',\n body: [{\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"d\"\n },\n element: \"inst\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"rin\"\n },\n element: \"d\"\n },\n element: \"inst\"\n }\n }]\n }]\n }, {\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"d\"\n },\n element: \"mexc\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"rin\"\n },\n element: \"d\"\n },\n element: \"mexc\"\n }\n }]\n }]\n }, {\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"d\"\n },\n element: \"set\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"rin\"\n },\n element: \"d\"\n },\n element: \"set\"\n }\n }]\n }]\n }]\n }\n }, {\n type: 'IfStatement',\n test: {\n type: 'BinaryExpression',\n operator: \"=\",\n left: {\n type: 'BinaryExpression',\n operator: \"or\",\n left: {\n type: 'Identifier',\n phase: 'name',\n value: \"holdn\"\n },\n right: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"dco\"\n },\n element: \"mds\"\n }\n },\n right: {\n type: 'EnumLiteral',\n value: \"'0'\"\n }\n },\n consequence: {\n type: 'BlockStatement',\n body: [{\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"x\"\n },\n element: \"data\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"rin\"\n },\n element: \"x\"\n },\n element: \"data\"\n }\n }]\n }]\n }, {\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"x\"\n },\n element: \"mexc\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"rin\"\n },\n element: \"x\"\n },\n element: \"mexc\"\n }\n }]\n }]\n }, {\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"x\"\n },\n element: \"set\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"rin\"\n },\n element: \"x\"\n },\n element: \"set\"\n }\n }]\n }]\n }]\n }\n }]\n }\n }, {\n type: 'IfStatement',\n test: {\n type: 'BinaryExpression',\n operator: \"=\",\n left: {\n type: 'Identifier',\n phase: 'name',\n value: \"rstn\"\n },\n right: {\n type: 'EnumLiteral',\n value: \"'0'\"\n }\n },\n consequence: {\n type: 'BlockStatement',\n body: [{\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"w\"\n },\n element: \"s\"\n },\n element: \"s\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'EnumLiteral',\n value: \"'1'\"\n }\n }]\n }]\n }, {\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"w\"\n },\n element: \"s\"\n },\n element: \"ps\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'EnumLiteral',\n value: \"'1'\"\n }\n }]\n }]\n }, {\n type: 'IfStatement',\n test: {\n type: 'BinaryExpression',\n operator: \"/=\",\n left: {\n type: 'IndexExpression',\n object: {\n type: 'Identifier',\n phase: 'const',\n value: \"need_extra_sync_reset\"\n },\n indexes: [{\n type: 'Identifier',\n phase: 'name',\n value: \"fabtech\"\n }]\n },\n right: {\n type: 'IntLiteral',\n value: \"0\"\n }\n },\n consequence: {\n type: 'BlockStatement',\n body: [{\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"d\"\n },\n element: \"inst\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'Aggregate',\n entries: [{\n type: 'AggregateEntry',\n tags: [{\n type: 'Others'\n }],\n value: {\n type: 'Aggregate',\n entries: [{\n type: 'AggregateEntry',\n tags: [{\n type: 'Others'\n }],\n value: {\n type: 'EnumLiteral',\n value: \"'0'\"\n }\n }]\n }\n }]\n }\n }]\n }]\n }, {\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"r\"\n },\n element: \"x\"\n },\n element: \"mexc\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'EnumLiteral',\n value: \"'0'\"\n }\n }]\n }]\n }]\n }\n }]\n }\n }]\n }\n }]\n };\n this.elaborate = function() {}\n }", "vertex_glsl_code () {}", "function generateCode(){\n\n}", "function generate(node) {\n return escodegen.generate(node);\n}", "man() {\n console.log('Grammaire de la machine de Peano :');\n this.expression.man();\n this.definition.man();\n }", "function Generator() {} // 80", "string_lexeme(quotation='\"') { \n var code = quotation + \n \"(-[\\\\\\\\|\"+quotation+\"]|\\\\\\\\([\\\\\\\\|n|r|t|\"+quotation+\"]|u[A-F|a-f|\\\\d][A-F|a-f|\\\\d][A-F|a-f|\\\\d][A-F|a-f|\\\\d]))*\"+quotation\n console.log(code)\n return new GeneratorLexeme(\"string\", code)\n }", "function gen(node) {\n if (node && !generator[node.type]) {\n throw new Error(`${node.type} is not supported in NFA/DFA interpreter.`);\n }\n\n return node ? generator[node.type](node) : '';\n}", "function genProgram (node, position) {\n return generateChildren(node.body, position);\n}", "getAst() {\n\n return {\n type: 'string',\n val: this.value\n };\n }", "Program() {\n return {\n type: 'Program',\n body: this.StatementList(),\n };\n }", "function _t_(_p, _n, _g, _port) {\n hdl.obj(this, _p, _n);\n this._seq = {\n type: 'BlockStatement',\n body: [{\n type: 'IfStatement',\n test: {\n type: 'FunccallExpression',\n arguments: [{\n type: 'Association',\n value: {\n type: 'Identifier',\n phase: 'name',\n value: \"sclk\"\n }\n }]\n },\n consequence: {\n type: 'BlockStatement',\n body: [{\n type: 'AssignmentExpressionSig',\n left: {\n type: 'Identifier',\n phase: 'name',\n value: \"rp\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'Identifier',\n phase: 'name',\n value: \"rpin\"\n }\n }]\n }]\n }, {\n type: 'IfStatement',\n test: {\n type: 'BinaryExpression',\n operator: \"=\",\n left: {\n type: 'Identifier',\n phase: 'name',\n value: \"rstn\"\n },\n right: {\n type: 'EnumLiteral',\n value: \"'0'\"\n }\n },\n consequence: {\n type: 'BlockStatement',\n body: [{\n type: 'AssignmentExpressionSig',\n left: {\n type: 'MemberExpression',\n object: {\n type: 'Identifier',\n phase: 'sig',\n value: \"rp\"\n },\n element: \"error\"\n },\n right: [{\n type: 'Waveform',\n list: [{\n type: 'WaveformElem',\n value: {\n type: 'EnumLiteral',\n value: \"'0'\"\n }\n }]\n }]\n }]\n }\n }]\n }\n }]\n };\n this.elaborate = function() {}\n }", "function Stack_Oliteral() {\r\n}", "function python(hljs) {\n var KEYWORDS = {\n keyword:\n 'and elif is global as in if from raise for except finally print import pass return ' +\n 'exec else break not with class assert yield try while continue del or def lambda ' +\n 'async await nonlocal|10',\n built_in:\n 'Ellipsis NotImplemented',\n literal: 'False None True'\n };\n var PROMPT = {\n className: 'meta', begin: /^(>>>|\\.\\.\\.) /\n };\n var SUBST = {\n className: 'subst',\n begin: /\\{/, end: /\\}/,\n keywords: KEYWORDS,\n illegal: /#/\n };\n var LITERAL_BRACKET = {\n begin: /\\{\\{/,\n relevance: 0\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE],\n variants: [\n {\n begin: /(u|b)?r?'''/, end: /'''/,\n contains: [hljs.BACKSLASH_ESCAPE, PROMPT],\n relevance: 10\n },\n {\n begin: /(u|b)?r?\"\"\"/, end: /\"\"\"/,\n contains: [hljs.BACKSLASH_ESCAPE, PROMPT],\n relevance: 10\n },\n {\n begin: /(fr|rf|f)'''/, end: /'''/,\n contains: [hljs.BACKSLASH_ESCAPE, PROMPT, LITERAL_BRACKET, SUBST]\n },\n {\n begin: /(fr|rf|f)\"\"\"/, end: /\"\"\"/,\n contains: [hljs.BACKSLASH_ESCAPE, PROMPT, LITERAL_BRACKET, SUBST]\n },\n {\n begin: /(u|r|ur)'/, end: /'/,\n relevance: 10\n },\n {\n begin: /(u|r|ur)\"/, end: /\"/,\n relevance: 10\n },\n {\n begin: /(b|br)'/, end: /'/\n },\n {\n begin: /(b|br)\"/, end: /\"/\n },\n {\n begin: /(fr|rf|f)'/, end: /'/,\n contains: [hljs.BACKSLASH_ESCAPE, LITERAL_BRACKET, SUBST]\n },\n {\n begin: /(fr|rf|f)\"/, end: /\"/,\n contains: [hljs.BACKSLASH_ESCAPE, LITERAL_BRACKET, SUBST]\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE\n ]\n };\n var NUMBER = {\n className: 'number', relevance: 0,\n variants: [\n {begin: hljs.BINARY_NUMBER_RE + '[lLjJ]?'},\n {begin: '\\\\b(0o[0-7]+)[lLjJ]?'},\n {begin: hljs.C_NUMBER_RE + '[lLjJ]?'}\n ]\n };\n var PARAMS = {\n className: 'params',\n variants: [\n // Exclude params at functions without params\n {begin: /\\(\\s*\\)/, skip: true, className: null },\n {\n begin: /\\(/, end: /\\)/, excludeBegin: true, excludeEnd: true,\n contains: ['self', PROMPT, NUMBER, STRING, hljs.HASH_COMMENT_MODE],\n },\n ],\n };\n SUBST.contains = [STRING, NUMBER, PROMPT];\n return {\n name: 'Python',\n aliases: ['py', 'gyp', 'ipython'],\n keywords: KEYWORDS,\n illegal: /(<\\/|->|\\?)|=>/,\n contains: [\n PROMPT,\n NUMBER,\n // eat \"if\" prior to string so that it won't accidentally be\n // labeled as an f-string as in:\n { beginKeywords: \"if\", relevance: 0 },\n STRING,\n hljs.HASH_COMMENT_MODE,\n {\n variants: [\n {className: 'function', beginKeywords: 'def'},\n {className: 'class', beginKeywords: 'class'}\n ],\n end: /:/,\n illegal: /[${=;\\n,]/,\n contains: [\n hljs.UNDERSCORE_TITLE_MODE,\n PARAMS,\n {\n begin: /->/, endsWithParent: true,\n keywords: 'None'\n }\n ]\n },\n {\n className: 'meta',\n begin: /^[\\t ]*@/, end: /$/\n },\n {\n begin: /\\b(print|exec)\\(/ // don’t highlight keywords-turned-functions in Python 3\n }\n ]\n };\n}", "function generateSeq() {\r\n\r\n}", "getCpp(){ return this.program.generateCpp(); }", "function symbol(s, p) {\n var x = syntax[s];\n if (!x || typeof x !== 'object') {\n syntax[s] = x = {\n id: s,\n lbp: p,\n value: s\n };\n }\n return x;\n }", "constructor() { super(GeneratorConstants.SPACE) }", "function Transform$7() {}", "function scala(hljs) {\n\n var ANNOTATION = { className: 'meta', begin: '@[A-Za-z]+' };\n\n // used in strings for escaping/interpolation/substitution\n var SUBST = {\n className: 'subst',\n variants: [\n {begin: '\\\\$[A-Za-z0-9_]+'},\n {begin: '\\\\${', end: '}'}\n ]\n };\n\n var STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"', end: '\"',\n illegal: '\\\\n',\n contains: [hljs.BACKSLASH_ESCAPE]\n },\n {\n begin: '\"\"\"', end: '\"\"\"',\n relevance: 10\n },\n {\n begin: '[a-z]+\"', end: '\"',\n illegal: '\\\\n',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST]\n },\n {\n className: 'string',\n begin: '[a-z]+\"\"\"', end: '\"\"\"',\n contains: [SUBST],\n relevance: 10\n }\n ]\n\n };\n\n var SYMBOL = {\n className: 'symbol',\n begin: '\\'\\\\w[\\\\w\\\\d_]*(?!\\')'\n };\n\n var TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][A-Za-z0-9_]*',\n relevance: 0\n };\n\n var NAME = {\n className: 'title',\n begin: /[^0-9\\n\\t \"'(),.`{}\\[\\]:;][^\\n\\t \"'(),.`{}\\[\\]:;]+|[^0-9\\n\\t \"'(),.`{}\\[\\]:;=]/,\n relevance: 0\n };\n\n var CLASS = {\n className: 'class',\n beginKeywords: 'class object trait type',\n end: /[:={\\[\\n;]/,\n excludeEnd: true,\n contains: [\n {\n beginKeywords: 'extends with',\n relevance: 10\n },\n {\n begin: /\\[/,\n end: /\\]/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0,\n contains: [TYPE]\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0,\n contains: [TYPE]\n },\n NAME\n ]\n };\n\n var METHOD = {\n className: 'function',\n beginKeywords: 'def',\n end: /[:={\\[(\\n;]/,\n excludeEnd: true,\n contains: [NAME]\n };\n\n return {\n name: 'Scala',\n keywords: {\n literal: 'true false null',\n keyword: 'type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n STRING,\n SYMBOL,\n TYPE,\n METHOD,\n CLASS,\n hljs.C_NUMBER_MODE,\n ANNOTATION\n ]\n };\n}", "function GenLanguageDef(){}", "function Parser() {\n\n}", "build(regexp) {\n let ast = regexp;\n\n if (regexp instanceof RegExp) {\n regexp = `${regexp}`;\n }\n\n if (typeof regexp === 'string') {\n ast = parser.parse(regexp, {\n captureLocations: true,\n });\n }\n\n return gen(desugar(ast));\n }", "function ninja() {}", "private public function m246() {}", "function compile() {\n\n}", "generate (type) {\n return generate(type)\n }", "function gi(t,e){0}", "function Literal( arg ) {\r\n}", "function erlang(hljs) {\n var BASIC_ATOM_RE = '[a-z\\'][a-zA-Z0-9_\\']*';\n var FUNCTION_NAME_RE = '(' + BASIC_ATOM_RE + ':' + BASIC_ATOM_RE + '|' + BASIC_ATOM_RE + ')';\n var ERLANG_RESERVED = {\n keyword:\n 'after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if ' +\n 'let not of orelse|10 query receive rem try when xor',\n literal:\n 'false true'\n };\n\n var COMMENT = hljs.COMMENT('%', '$');\n var NUMBER = {\n className: 'number',\n begin: '\\\\b(\\\\d+(_\\\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\\\d+(_\\\\d+)*(\\\\.\\\\d+(_\\\\d+)*)?([eE][-+]?\\\\d+)?)',\n relevance: 0\n };\n var NAMED_FUN = {\n begin: 'fun\\\\s+' + BASIC_ATOM_RE + '/\\\\d+'\n };\n var FUNCTION_CALL = {\n begin: FUNCTION_NAME_RE + '\\\\(', end: '\\\\)',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n begin: FUNCTION_NAME_RE, relevance: 0\n },\n {\n begin: '\\\\(', end: '\\\\)', endsWithParent: true,\n returnEnd: true,\n relevance: 0\n // \"contains\" defined later\n }\n ]\n };\n var TUPLE = {\n begin: '{', end: '}',\n relevance: 0\n // \"contains\" defined later\n };\n var VAR1 = {\n begin: '\\\\b_([A-Z][A-Za-z0-9_]*)?',\n relevance: 0\n };\n var VAR2 = {\n begin: '[A-Z][a-zA-Z0-9_]*',\n relevance: 0\n };\n var RECORD_ACCESS = {\n begin: '#' + hljs.UNDERSCORE_IDENT_RE,\n relevance: 0,\n returnBegin: true,\n contains: [\n {\n begin: '#' + hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n begin: '{', end: '}',\n relevance: 0\n // \"contains\" defined later\n }\n ]\n };\n\n var BLOCK_STATEMENTS = {\n beginKeywords: 'fun receive if try case', end: 'end',\n keywords: ERLANG_RESERVED\n };\n BLOCK_STATEMENTS.contains = [\n COMMENT,\n NAMED_FUN,\n hljs.inherit(hljs.APOS_STRING_MODE, {className: ''}),\n BLOCK_STATEMENTS,\n FUNCTION_CALL,\n hljs.QUOTE_STRING_MODE,\n NUMBER,\n TUPLE,\n VAR1, VAR2,\n RECORD_ACCESS\n ];\n\n var BASIC_MODES = [\n COMMENT,\n NAMED_FUN,\n BLOCK_STATEMENTS,\n FUNCTION_CALL,\n hljs.QUOTE_STRING_MODE,\n NUMBER,\n TUPLE,\n VAR1, VAR2,\n RECORD_ACCESS\n ];\n FUNCTION_CALL.contains[1].contains = BASIC_MODES;\n TUPLE.contains = BASIC_MODES;\n RECORD_ACCESS.contains[1].contains = BASIC_MODES;\n\n var PARAMS = {\n className: 'params',\n begin: '\\\\(', end: '\\\\)',\n contains: BASIC_MODES\n };\n return {\n name: 'Erlang',\n aliases: ['erl'],\n keywords: ERLANG_RESERVED,\n illegal: '(</|\\\\*=|\\\\+=|-=|/\\\\*|\\\\*/|\\\\(\\\\*|\\\\*\\\\))',\n contains: [\n {\n className: 'function',\n begin: '^' + BASIC_ATOM_RE + '\\\\s*\\\\(', end: '->',\n returnBegin: true,\n illegal: '\\\\(|#|//|/\\\\*|\\\\\\\\|:|;',\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, {begin: BASIC_ATOM_RE})\n ],\n starts: {\n end: ';|\\\\.',\n keywords: ERLANG_RESERVED,\n contains: BASIC_MODES\n }\n },\n COMMENT,\n {\n begin: '^-', end: '\\\\.',\n relevance: 0,\n excludeEnd: true,\n returnBegin: true,\n keywords: {\n $pattern: '-' + hljs.IDENT_RE,\n keyword: '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' +\n '-import -include -include_lib -compile -define -else -endif -file -behaviour ' +\n '-behavior -spec'\n },\n contains: [PARAMS]\n },\n NUMBER,\n hljs.QUOTE_STRING_MODE,\n RECORD_ACCESS,\n VAR1, VAR2,\n TUPLE,\n {begin: /\\.$/} // relevance booster\n ]\n };\n}", "transform(program) {\n var options = AsxFormatter.options(this.file.ast);\n //DefaultFormatter.prototype.transform.apply(this, arguments);\n\n var locals = [];\n var definitions = [];\n var body = [];\n program.body.forEach(item=>{\n switch(item.type){\n case 'ExpressionStatement':\n var exp = item.expression;\n if(exp.type=='Literal' && exp.value.toLowerCase()=='use strict'){\n return;\n }\n break;\n case 'VariableDeclaration':\n item.declarations.forEach(d=>{\n locals.push(d.id);\n });\n break;\n case 'FunctionDeclaration':\n if(item.id.name=='module'){\n item.body.body.forEach(s=>{\n body.push(s);\n })\n return;\n }else\n if(item._class){\n item.id =t.identifier('c$'+item._class);\n body.push(t.expressionStatement(t.callExpression(\n t.memberExpression(\n t.identifier('asx'),\n t.identifier('c$')\n ),[item])));\n return;\n }else{\n locals.push(item.id);\n }\n break;\n }\n body.push(item);\n });\n\n var definer = [];\n\n\n\n if(Object.keys(this.imports).length){\n\n Object.keys(this.imports).forEach(key=>{\n var items = this.imports[key];\n if(items['*'] && typeof items['*']=='string'){\n this.imports[key]=items['*'];\n }\n });\n definer.push(t.property('init',\n t.identifier('imports'),\n t.valueToNode(this.imports)\n ))\n }\n var exports;\n if(this.exports['*']){\n exports = this.exports['*'];\n delete this.exports['*'];\n }\n if(Object.keys(this.exports).length){\n definer.push(t.property('init',\n t.identifier('exports'),\n t.valueToNode(this.exports)\n ))\n }\n if(body.length){\n if(exports){\n var ret = [];\n Object.keys(exports).forEach(key=>{\n var val = exports[key];\n if(typeof val=='string') {\n ret.push(t.property('init',\n t.literal(key), t.identifier(val == '*' ? key : val)\n ))\n }else{\n ret.push(t.property('init',\n t.literal(key), val\n ))\n }\n });\n body.push(t.returnStatement(\n t.objectExpression(ret)\n ));\n }\n var initializer = t.functionExpression(null, [t.identifier('asx')], t.blockStatement(body));\n definer.push(t.property('init',\n t.identifier('execute'),\n initializer\n ))\n }\n definitions.forEach(item=>{\n\n if(item._class){\n definer.push(t.property('init',\n t.literal('.'+item._class),\n item\n ))\n }else{\n definer.push(t.property('init',\n t.literal(':'+item.id.name),\n item\n ))\n }\n\n })\n definer = t.objectExpression(definer);\n\n\n\n /*\n var definer = t.functionExpression(null, [t.identifier(\"module\")], t.blockStatement(body));\n if(options.bind){\n definer = t.callExpression(\n t.memberExpression(\n definer,\n t.identifier(\"bind\")\n ),[\n t.callExpression(t.identifier(\"eval\"),[t.literal(\"this.global=this\")])\n ]\n );\n }*/\n var body = [];\n var definer = util.template(\"asx-module\",{\n MODULE_NAME: t.literal(this.getModuleName()),\n MODULE_BODY: definer\n });\n if(options.runtime){\n var rt = util.template(\"asx-runtime\")\n //rt._compact = true;\n body.push(t.expressionStatement(rt));\n }\n body.push(t.expressionStatement(definer))\n program.body = body;\n }", "constructor() { super([Space.TAG], JXONLexer.lexemes) }", "function t(e){switch(e.type){case V.AssignmentExpression:case V.ArrayExpression:case V.ArrayPattern:case V.BinaryExpression:case V.CallExpression:case V.ConditionalExpression:case V.ClassExpression:case V.ExportBatchSpecifier:case V.ExportSpecifier:case V.FunctionExpression:case V.Identifier:case V.ImportSpecifier:case V.Literal:case V.LogicalExpression:case V.MemberExpression:case V.MethodDefinition:case V.NewExpression:case V.ObjectExpression:case V.ObjectPattern:case V.Property:case V.SequenceExpression:case V.ThisExpression:case V.UnaryExpression:case V.UpdateExpression:case V.YieldExpression:return!0}return!1}", "function hg(a){this.wh=a;this.wi=\"\";this.Mo=new RegExp(this.Eb,\"g\")}", "function LogicNodes() {}", "function parse(){\n var syntax = esprima.parse(editor.getValue());\n codeArray = [];\n expand(syntax.body, codeArray, 0);\n}", "function scala(hljs) {\n\n var ANNOTATION = { className: 'meta', begin: '@[A-Za-z]+' };\n\n // used in strings for escaping/interpolation/substitution\n var SUBST = {\n className: 'subst',\n variants: [\n {begin: '\\\\$[A-Za-z0-9_]+'},\n {begin: '\\\\${', end: '}'}\n ]\n };\n\n var STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"', end: '\"',\n illegal: '\\\\n',\n contains: [hljs.BACKSLASH_ESCAPE]\n },\n {\n begin: '\"\"\"', end: '\"\"\"',\n relevance: 10\n },\n {\n begin: '[a-z]+\"', end: '\"',\n illegal: '\\\\n',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST]\n },\n {\n className: 'string',\n begin: '[a-z]+\"\"\"', end: '\"\"\"',\n contains: [SUBST],\n relevance: 10\n }\n ]\n\n };\n\n var SYMBOL = {\n className: 'symbol',\n begin: '\\'\\\\w[\\\\w\\\\d_]*(?!\\')'\n };\n\n var TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][A-Za-z0-9_]*',\n relevance: 0\n };\n\n var NAME = {\n className: 'title',\n begin: /[^0-9\\n\\t \"'(),.`{}\\[\\]:;][^\\n\\t \"'(),.`{}\\[\\]:;]+|[^0-9\\n\\t \"'(),.`{}\\[\\]:;=]/,\n relevance: 0\n };\n\n var CLASS = {\n className: 'class',\n beginKeywords: 'class object trait type',\n end: /[:={\\[\\n;]/,\n excludeEnd: true,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n beginKeywords: 'extends with',\n relevance: 10\n },\n {\n begin: /\\[/,\n end: /\\]/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0,\n contains: [TYPE]\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0,\n contains: [TYPE]\n },\n NAME\n ]\n };\n\n var METHOD = {\n className: 'function',\n beginKeywords: 'def',\n end: /[:={\\[(\\n;]/,\n excludeEnd: true,\n contains: [NAME]\n };\n\n return {\n name: 'Scala',\n keywords: {\n literal: 'true false null',\n keyword: 'type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit'\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n STRING,\n SYMBOL,\n TYPE,\n METHOD,\n CLASS,\n hljs.C_NUMBER_MODE,\n ANNOTATION\n ]\n };\n}", "__getInputString(line, input, block, key, ugen) {\n let value = '';\n if (typeof input === 'number') {\n if (isNaN(key)) {\n value += `mem[${ugen.__addresses__[key]}]`; //input\n } else {\n value += input;\n }\n } else if (typeof input === 'boolean') {\n value += '' + input;\n } else {\n //console.log( 'key:', key, 'input:', ugen.inputs, ugen.inputs[ key ] ) \n // XXX not sure why this has to be here, but somehow non-processed objects\n // that only contain id numbers are being passed here...\n\n if (input !== undefined) {\n if (Gibberish.mode === 'processor') {\n if (input.ugenName === undefined && input.id !== undefined) {\n if (ugen === undefined) {\n input = Gibberish.processor.ugens.get(input.id);\n } else {\n if (ugen.type !== 'seq') {\n input = Gibberish.processor.ugens.get(input.id);\n }\n }\n }\n }\n\n Gibberish.processUgen(input, block);\n\n if (!input.isop) {\n // check is needed so that graphs with ssds that refer to themselves\n // don't add the ssd in more than once\n if (Gibberish.callbackUgens.indexOf(input.callback) === -1) {\n Gibberish.callbackUgens.push(input.callback);\n }\n }\n\n value += `v_${input.id}`;\n input.__varname = value;\n }\n }\n\n return value;\n }", "function erlang(hljs) {\n var BASIC_ATOM_RE = '[a-z\\'][a-zA-Z0-9_\\']*';\n var FUNCTION_NAME_RE = '(' + BASIC_ATOM_RE + ':' + BASIC_ATOM_RE + '|' + BASIC_ATOM_RE + ')';\n var ERLANG_RESERVED = {\n keyword:\n 'after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if ' +\n 'let not of orelse|10 query receive rem try when xor',\n literal:\n 'false true'\n };\n\n var COMMENT = hljs.COMMENT('%', '$');\n var NUMBER = {\n className: 'number',\n begin: '\\\\b(\\\\d+#[a-fA-F0-9]+|\\\\d+(\\\\.\\\\d+)?([eE][-+]?\\\\d+)?)',\n relevance: 0\n };\n var NAMED_FUN = {\n begin: 'fun\\\\s+' + BASIC_ATOM_RE + '/\\\\d+'\n };\n var FUNCTION_CALL = {\n begin: FUNCTION_NAME_RE + '\\\\(', end: '\\\\)',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n begin: FUNCTION_NAME_RE, relevance: 0\n },\n {\n begin: '\\\\(', end: '\\\\)', endsWithParent: true,\n returnEnd: true,\n relevance: 0\n // \"contains\" defined later\n }\n ]\n };\n var TUPLE = {\n begin: '{', end: '}',\n relevance: 0\n // \"contains\" defined later\n };\n var VAR1 = {\n begin: '\\\\b_([A-Z][A-Za-z0-9_]*)?',\n relevance: 0\n };\n var VAR2 = {\n begin: '[A-Z][a-zA-Z0-9_]*',\n relevance: 0\n };\n var RECORD_ACCESS = {\n begin: '#' + hljs.UNDERSCORE_IDENT_RE,\n relevance: 0,\n returnBegin: true,\n contains: [\n {\n begin: '#' + hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n begin: '{', end: '}',\n relevance: 0\n // \"contains\" defined later\n }\n ]\n };\n\n var BLOCK_STATEMENTS = {\n beginKeywords: 'fun receive if try case', end: 'end',\n keywords: ERLANG_RESERVED\n };\n BLOCK_STATEMENTS.contains = [\n COMMENT,\n NAMED_FUN,\n hljs.inherit(hljs.APOS_STRING_MODE, {className: ''}),\n BLOCK_STATEMENTS,\n FUNCTION_CALL,\n hljs.QUOTE_STRING_MODE,\n NUMBER,\n TUPLE,\n VAR1, VAR2,\n RECORD_ACCESS\n ];\n\n var BASIC_MODES = [\n COMMENT,\n NAMED_FUN,\n BLOCK_STATEMENTS,\n FUNCTION_CALL,\n hljs.QUOTE_STRING_MODE,\n NUMBER,\n TUPLE,\n VAR1, VAR2,\n RECORD_ACCESS\n ];\n FUNCTION_CALL.contains[1].contains = BASIC_MODES;\n TUPLE.contains = BASIC_MODES;\n RECORD_ACCESS.contains[1].contains = BASIC_MODES;\n\n var PARAMS = {\n className: 'params',\n begin: '\\\\(', end: '\\\\)',\n contains: BASIC_MODES\n };\n return {\n name: 'Erlang',\n aliases: ['erl'],\n keywords: ERLANG_RESERVED,\n illegal: '(</|\\\\*=|\\\\+=|-=|/\\\\*|\\\\*/|\\\\(\\\\*|\\\\*\\\\))',\n contains: [\n {\n className: 'function',\n begin: '^' + BASIC_ATOM_RE + '\\\\s*\\\\(', end: '->',\n returnBegin: true,\n illegal: '\\\\(|#|//|/\\\\*|\\\\\\\\|:|;',\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, {begin: BASIC_ATOM_RE})\n ],\n starts: {\n end: ';|\\\\.',\n keywords: ERLANG_RESERVED,\n contains: BASIC_MODES\n }\n },\n COMMENT,\n {\n begin: '^-', end: '\\\\.',\n relevance: 0,\n excludeEnd: true,\n returnBegin: true,\n lexemes: '-' + hljs.IDENT_RE,\n keywords:\n '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' +\n '-import -include -include_lib -compile -define -else -endif -file -behaviour ' +\n '-behavior -spec',\n contains: [PARAMS]\n },\n NUMBER,\n hljs.QUOTE_STRING_MODE,\n RECORD_ACCESS,\n VAR1, VAR2,\n TUPLE,\n {begin: /\\.$/} // relevance booster\n ]\n };\n}", "build () {}", "function Gb(){}", "function _G() {}", "function _G() {}", "function PlatForm() {}", "function TinyLisp(){ \n}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function Generator(){}", "function $366c34664626fae6$var$gcode(hljs) {\n const GCODE_IDENT_RE = \"[A-Z_][A-Z0-9_.]*\";\n const GCODE_CLOSE_RE = \"%\";\n const GCODE_KEYWORDS = {\n $pattern: GCODE_IDENT_RE,\n keyword: \"IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT EQ LT GT NE GE LE OR XOR\"\n };\n const GCODE_START = {\n className: \"meta\",\n begin: \"([O])([0-9]+)\"\n };\n const NUMBER = hljs.inherit(hljs.C_NUMBER_MODE, {\n begin: \"([-+]?((\\\\.\\\\d+)|(\\\\d+)(\\\\.\\\\d*)?))|\" + hljs.C_NUMBER_RE\n });\n const GCODE_CODE = [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.COMMENT(/\\(/, /\\)/),\n NUMBER,\n hljs.inherit(hljs.APOS_STRING_MODE, {\n illegal: null\n }),\n hljs.inherit(hljs.QUOTE_STRING_MODE, {\n illegal: null\n }),\n {\n className: \"name\",\n begin: \"([G])([0-9]+\\\\.?[0-9]?)\"\n },\n {\n className: \"name\",\n begin: \"([M])([0-9]+\\\\.?[0-9]?)\"\n },\n {\n className: \"attr\",\n begin: \"(VC|VS|#)\",\n end: \"(\\\\d+)\"\n },\n {\n className: \"attr\",\n begin: \"(VZOFX|VZOFY|VZOFZ)\"\n },\n {\n className: \"built_in\",\n begin: \"(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\\\[)\",\n contains: [\n NUMBER\n ],\n end: \"\\\\]\"\n },\n {\n className: \"symbol\",\n variants: [\n {\n begin: \"N\",\n end: \"\\\\d+\",\n illegal: \"\\\\W\"\n }\n ]\n }\n ];\n return {\n name: \"G-code (ISO 6983)\",\n aliases: [\n \"nc\"\n ],\n // Some implementations (CNC controls) of G-code are interoperable with uppercase and lowercase letters seamlessly.\n // However, most prefer all uppercase and uppercase is customary.\n case_insensitive: true,\n keywords: GCODE_KEYWORDS,\n contains: [\n {\n className: \"meta\",\n begin: GCODE_CLOSE_RE\n },\n GCODE_START\n ].concat(GCODE_CODE)\n };\n}", "function GeneratorClass () {}", "function $436c309948703748$var$scala(hljs) {\n const ANNOTATION = {\n className: \"meta\",\n begin: \"@[A-Za-z]+\"\n };\n // used in strings for escaping/interpolation/substitution\n const SUBST = {\n className: \"subst\",\n variants: [\n {\n begin: \"\\\\$[A-Za-z0-9_]+\"\n },\n {\n begin: /\\$\\{/,\n end: /\\}/\n }\n ]\n };\n const STRING = {\n className: \"string\",\n variants: [\n {\n begin: '\"',\n end: '\"',\n illegal: \"\\\\n\",\n contains: [\n hljs.BACKSLASH_ESCAPE\n ]\n },\n {\n begin: '\"\"\"',\n end: '\"\"\"',\n relevance: 10\n },\n {\n begin: '[a-z]+\"',\n end: '\"',\n illegal: \"\\\\n\",\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n },\n {\n className: \"string\",\n begin: '[a-z]+\"\"\"',\n end: '\"\"\"',\n contains: [\n SUBST\n ],\n relevance: 10\n }\n ]\n };\n const SYMBOL = {\n className: \"symbol\",\n begin: \"'\\\\w[\\\\w\\\\d_]*(?!')\"\n };\n const TYPE = {\n className: \"type\",\n begin: \"\\\\b[A-Z][A-Za-z0-9_]*\",\n relevance: 0\n };\n const NAME = {\n className: \"title\",\n begin: /[^0-9\\n\\t \"'(),.`{}\\[\\]:;][^\\n\\t \"'(),.`{}\\[\\]:;]+|[^0-9\\n\\t \"'(),.`{}\\[\\]:;=]/,\n relevance: 0\n };\n const CLASS = {\n className: \"class\",\n beginKeywords: \"class object trait type\",\n end: /[:={\\[\\n;]/,\n excludeEnd: true,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n beginKeywords: \"extends with\",\n relevance: 10\n },\n {\n begin: /\\[/,\n end: /\\]/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0,\n contains: [\n TYPE\n ]\n },\n {\n className: \"params\",\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0,\n contains: [\n TYPE\n ]\n },\n NAME\n ]\n };\n const METHOD = {\n className: \"function\",\n beginKeywords: \"def\",\n end: /[:={\\[(\\n;]/,\n excludeEnd: true,\n contains: [\n NAME\n ]\n };\n return {\n name: \"Scala\",\n keywords: {\n literal: \"true false null\",\n keyword: \"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit\"\n },\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n STRING,\n SYMBOL,\n TYPE,\n METHOD,\n CLASS,\n hljs.C_NUMBER_MODE,\n ANNOTATION\n ]\n };\n}", "function initGenerate(TheBigAST) {\n var globalItems = TheBigAST[0];\n var functionBox = TheBigAST[1];\n allFuncs = findAllFuncs(functionBox[0].body);\n //strLiteralSection = generateStrLiteralSection();\n var funcsAsm = findFunctionNames(functionBox[0].body);\n var headers = includeHeaders(globalItems);\n var dataSection = generateDataSection(globalItems);\n var textHeader = generateTextHeader(TheBigAST[1]);\n var compiled = textHeader + funcsAsm + dataSection;\n console.log(compiled);\n return 0;\n}", "function seq(...args)\n{\n return {type: 0x30, children: args};\n}", "astProperties() {\r\n\t\t\t\t\treturn {};\r\n\t\t\t\t}", "function vs(t) {\n t.Gr.forEach((function(t) {\n t.next();\n }));\n}", "function ruby(hljs) {\n var RUBY_METHOD_RE = '[a-zA-Z_]\\\\w*[!?=]?|[-+~]\\\\@|<<|>>|=~|===?|<=>|[<>]=?|\\\\*\\\\*|[-/+%^&*~`|]|\\\\[\\\\]=?';\n var RUBY_KEYWORDS = {\n keyword:\n 'and then defined module in return redo if BEGIN retry end for self when ' +\n 'next until do begin unless END rescue else break undef not super class case ' +\n 'require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor',\n literal:\n 'true false nil'\n };\n var YARDOCTAG = {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n };\n var IRB_OBJECT = {\n begin: '#<', end: '>'\n };\n var COMMENT_MODES = [\n hljs.COMMENT(\n '#',\n '$',\n {\n contains: [YARDOCTAG]\n }\n ),\n hljs.COMMENT(\n '^\\\\=begin',\n '^\\\\=end',\n {\n contains: [YARDOCTAG],\n relevance: 10\n }\n ),\n hljs.COMMENT('^__END__', '\\\\n$')\n ];\n var SUBST = {\n className: 'subst',\n begin: '#\\\\{', end: '}',\n keywords: RUBY_KEYWORDS\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n variants: [\n {begin: /'/, end: /'/},\n {begin: /\"/, end: /\"/},\n {begin: /`/, end: /`/},\n {begin: '%[qQwWx]?\\\\(', end: '\\\\)'},\n {begin: '%[qQwWx]?\\\\[', end: '\\\\]'},\n {begin: '%[qQwWx]?{', end: '}'},\n {begin: '%[qQwWx]?<', end: '>'},\n {begin: '%[qQwWx]?/', end: '/'},\n {begin: '%[qQwWx]?%', end: '%'},\n {begin: '%[qQwWx]?-', end: '-'},\n {begin: '%[qQwWx]?\\\\|', end: '\\\\|'},\n {\n // \\B in the beginning suppresses recognition of ?-sequences where ?\n // is the last character of a preceding identifier, as in: `func?4`\n begin: /\\B\\?(\\\\\\d{1,3}|\\\\x[A-Fa-f0-9]{1,2}|\\\\u[A-Fa-f0-9]{4}|\\\\?\\S)\\b/\n },\n { // heredocs\n begin: /<<[-~]?'?(\\w+)(?:.|\\n)*?\\n\\s*\\1\\b/,\n returnBegin: true,\n contains: [\n { begin: /<<[-~]?'?/ },\n hljs.END_SAME_AS_BEGIN({\n begin: /(\\w+)/, end: /(\\w+)/,\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n })\n ]\n }\n ]\n };\n var PARAMS = {\n className: 'params',\n begin: '\\\\(', end: '\\\\)', endsParent: true,\n keywords: RUBY_KEYWORDS\n };\n\n var RUBY_DEFAULT_CONTAINS = [\n STRING,\n IRB_OBJECT,\n {\n className: 'class',\n beginKeywords: 'class module', end: '$|;',\n illegal: /=/,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: '[A-Za-z_]\\\\w*(::\\\\w+)*(\\\\?|\\\\!)?'}),\n {\n begin: '<\\\\s*',\n contains: [{\n begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE\n }]\n }\n ].concat(COMMENT_MODES)\n },\n {\n className: 'function',\n beginKeywords: 'def', end: '$|;',\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: RUBY_METHOD_RE}),\n PARAMS\n ].concat(COMMENT_MODES)\n },\n {\n // swallow namespace qualifiers before symbols\n begin: hljs.IDENT_RE + '::'\n },\n {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '(\\\\!|\\\\?)?:',\n relevance: 0\n },\n {\n className: 'symbol',\n begin: ':(?!\\\\s)',\n contains: [STRING, {begin: RUBY_METHOD_RE}],\n relevance: 0\n },\n {\n className: 'number',\n begin: '(\\\\b0[0-7_]+)|(\\\\b0x[0-9a-fA-F_]+)|(\\\\b[1-9][0-9_]*(\\\\.[0-9_]+)?)|[0_]\\\\b',\n relevance: 0\n },\n {\n begin: '(\\\\$\\\\W)|((\\\\$|\\\\@\\\\@?)(\\\\w+))' // variables\n },\n {\n className: 'params',\n begin: /\\|/, end: /\\|/,\n keywords: RUBY_KEYWORDS\n },\n { // regexp container\n begin: '(' + hljs.RE_STARTERS_RE + '|unless)\\\\s*',\n keywords: 'unless',\n contains: [\n IRB_OBJECT,\n {\n className: 'regexp',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n illegal: /\\n/,\n variants: [\n {begin: '/', end: '/[a-z]*'},\n {begin: '%r{', end: '}[a-z]*'},\n {begin: '%r\\\\(', end: '\\\\)[a-z]*'},\n {begin: '%r!', end: '![a-z]*'},\n {begin: '%r\\\\[', end: '\\\\][a-z]*'}\n ]\n }\n ].concat(COMMENT_MODES),\n relevance: 0\n }\n ].concat(COMMENT_MODES);\n\n SUBST.contains = RUBY_DEFAULT_CONTAINS;\n PARAMS.contains = RUBY_DEFAULT_CONTAINS;\n\n var SIMPLE_PROMPT = \"[>?]>\";\n var DEFAULT_PROMPT = \"[\\\\w#]+\\\\(\\\\w+\\\\):\\\\d+:\\\\d+>\";\n var RVM_PROMPT = \"(\\\\w+-)?\\\\d+\\\\.\\\\d+\\\\.\\\\d(p\\\\d+)?[^>]+>\";\n\n var IRB_DEFAULT = [\n {\n begin: /^\\s*=>/,\n starts: {\n end: '$', contains: RUBY_DEFAULT_CONTAINS\n }\n },\n {\n className: 'meta',\n begin: '^('+SIMPLE_PROMPT+\"|\"+DEFAULT_PROMPT+'|'+RVM_PROMPT+')',\n starts: {\n end: '$', contains: RUBY_DEFAULT_CONTAINS\n }\n }\n ];\n\n return {\n name: 'Ruby',\n aliases: ['rb', 'gemspec', 'podspec', 'thor', 'irb'],\n keywords: RUBY_KEYWORDS,\n illegal: /\\/\\*/,\n contains: COMMENT_MODES.concat(IRB_DEFAULT).concat(RUBY_DEFAULT_CONTAINS)\n };\n}", "function ruby(hljs) {\n var RUBY_METHOD_RE = '[a-zA-Z_]\\\\w*[!?=]?|[-+~]\\\\@|<<|>>|=~|===?|<=>|[<>]=?|\\\\*\\\\*|[-/+%^&*~`|]|\\\\[\\\\]=?';\n var RUBY_KEYWORDS = {\n keyword:\n 'and then defined module in return redo if BEGIN retry end for self when ' +\n 'next until do begin unless END rescue else break undef not super class case ' +\n 'require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor',\n literal:\n 'true false nil'\n };\n var YARDOCTAG = {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n };\n var IRB_OBJECT = {\n begin: '#<', end: '>'\n };\n var COMMENT_MODES = [\n hljs.COMMENT(\n '#',\n '$',\n {\n contains: [YARDOCTAG]\n }\n ),\n hljs.COMMENT(\n '^\\\\=begin',\n '^\\\\=end',\n {\n contains: [YARDOCTAG],\n relevance: 10\n }\n ),\n hljs.COMMENT('^__END__', '\\\\n$')\n ];\n var SUBST = {\n className: 'subst',\n begin: '#\\\\{', end: '}',\n keywords: RUBY_KEYWORDS\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n variants: [\n {begin: /'/, end: /'/},\n {begin: /\"/, end: /\"/},\n {begin: /`/, end: /`/},\n {begin: '%[qQwWx]?\\\\(', end: '\\\\)'},\n {begin: '%[qQwWx]?\\\\[', end: '\\\\]'},\n {begin: '%[qQwWx]?{', end: '}'},\n {begin: '%[qQwWx]?<', end: '>'},\n {begin: '%[qQwWx]?/', end: '/'},\n {begin: '%[qQwWx]?%', end: '%'},\n {begin: '%[qQwWx]?-', end: '-'},\n {begin: '%[qQwWx]?\\\\|', end: '\\\\|'},\n {\n // \\B in the beginning suppresses recognition of ?-sequences where ?\n // is the last character of a preceding identifier, as in: `func?4`\n begin: /\\B\\?(\\\\\\d{1,3}|\\\\x[A-Fa-f0-9]{1,2}|\\\\u[A-Fa-f0-9]{4}|\\\\?\\S)\\b/\n },\n { // heredocs\n begin: /<<[-~]?'?(\\w+)(?:.|\\n)*?\\n\\s*\\1\\b/,\n returnBegin: true,\n contains: [\n { begin: /<<[-~]?'?/ },\n { begin: /\\w+/,\n endSameAsBegin: true,\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n }\n ]\n }\n ]\n };\n var PARAMS = {\n className: 'params',\n begin: '\\\\(', end: '\\\\)', endsParent: true,\n keywords: RUBY_KEYWORDS\n };\n\n var RUBY_DEFAULT_CONTAINS = [\n STRING,\n IRB_OBJECT,\n {\n className: 'class',\n beginKeywords: 'class module', end: '$|;',\n illegal: /=/,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: '[A-Za-z_]\\\\w*(::\\\\w+)*(\\\\?|\\\\!)?'}),\n {\n begin: '<\\\\s*',\n contains: [{\n begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE\n }]\n }\n ].concat(COMMENT_MODES)\n },\n {\n className: 'function',\n beginKeywords: 'def', end: '$|;',\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: RUBY_METHOD_RE}),\n PARAMS\n ].concat(COMMENT_MODES)\n },\n {\n // swallow namespace qualifiers before symbols\n begin: hljs.IDENT_RE + '::'\n },\n {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '(\\\\!|\\\\?)?:',\n relevance: 0\n },\n {\n className: 'symbol',\n begin: ':(?!\\\\s)',\n contains: [STRING, {begin: RUBY_METHOD_RE}],\n relevance: 0\n },\n {\n className: 'number',\n begin: '(\\\\b0[0-7_]+)|(\\\\b0x[0-9a-fA-F_]+)|(\\\\b[1-9][0-9_]*(\\\\.[0-9_]+)?)|[0_]\\\\b',\n relevance: 0\n },\n {\n begin: '(\\\\$\\\\W)|((\\\\$|\\\\@\\\\@?)(\\\\w+))' // variables\n },\n {\n className: 'params',\n begin: /\\|/, end: /\\|/,\n keywords: RUBY_KEYWORDS\n },\n { // regexp container\n begin: '(' + hljs.RE_STARTERS_RE + '|unless)\\\\s*',\n keywords: 'unless',\n contains: [\n IRB_OBJECT,\n {\n className: 'regexp',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n illegal: /\\n/,\n variants: [\n {begin: '/', end: '/[a-z]*'},\n {begin: '%r{', end: '}[a-z]*'},\n {begin: '%r\\\\(', end: '\\\\)[a-z]*'},\n {begin: '%r!', end: '![a-z]*'},\n {begin: '%r\\\\[', end: '\\\\][a-z]*'}\n ]\n }\n ].concat(COMMENT_MODES),\n relevance: 0\n }\n ].concat(COMMENT_MODES);\n\n SUBST.contains = RUBY_DEFAULT_CONTAINS;\n PARAMS.contains = RUBY_DEFAULT_CONTAINS;\n\n var SIMPLE_PROMPT = \"[>?]>\";\n var DEFAULT_PROMPT = \"[\\\\w#]+\\\\(\\\\w+\\\\):\\\\d+:\\\\d+>\";\n var RVM_PROMPT = \"(\\\\w+-)?\\\\d+\\\\.\\\\d+\\\\.\\\\d(p\\\\d+)?[^>]+>\";\n\n var IRB_DEFAULT = [\n {\n begin: /^\\s*=>/,\n starts: {\n end: '$', contains: RUBY_DEFAULT_CONTAINS\n }\n },\n {\n className: 'meta',\n begin: '^('+SIMPLE_PROMPT+\"|\"+DEFAULT_PROMPT+'|'+RVM_PROMPT+')',\n starts: {\n end: '$', contains: RUBY_DEFAULT_CONTAINS\n }\n }\n ];\n\n return {\n name: 'Ruby',\n aliases: ['rb', 'gemspec', 'podspec', 'thor', 'irb'],\n keywords: RUBY_KEYWORDS,\n illegal: /\\/\\*/,\n contains: COMMENT_MODES.concat(IRB_DEFAULT).concat(RUBY_DEFAULT_CONTAINS)\n };\n}", "function erlang(hljs) {\n const BASIC_ATOM_RE = '[a-z\\'][a-zA-Z0-9_\\']*';\n const FUNCTION_NAME_RE = '(' + BASIC_ATOM_RE + ':' + BASIC_ATOM_RE + '|' + BASIC_ATOM_RE + ')';\n const ERLANG_RESERVED = {\n keyword:\n 'after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if ' +\n 'let not of orelse|10 query receive rem try when xor',\n literal:\n 'false true'\n };\n\n const COMMENT = hljs.COMMENT('%', '$');\n const NUMBER = {\n className: 'number',\n begin: '\\\\b(\\\\d+(_\\\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\\\d+(_\\\\d+)*(\\\\.\\\\d+(_\\\\d+)*)?([eE][-+]?\\\\d+)?)',\n relevance: 0\n };\n const NAMED_FUN = {\n begin: 'fun\\\\s+' + BASIC_ATOM_RE + '/\\\\d+'\n };\n const FUNCTION_CALL = {\n begin: FUNCTION_NAME_RE + '\\\\(',\n end: '\\\\)',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n begin: FUNCTION_NAME_RE,\n relevance: 0\n },\n {\n begin: '\\\\(',\n end: '\\\\)',\n endsWithParent: true,\n returnEnd: true,\n relevance: 0\n // \"contains\" defined later\n }\n ]\n };\n const TUPLE = {\n begin: /\\{/,\n end: /\\}/,\n relevance: 0\n // \"contains\" defined later\n };\n const VAR1 = {\n begin: '\\\\b_([A-Z][A-Za-z0-9_]*)?',\n relevance: 0\n };\n const VAR2 = {\n begin: '[A-Z][a-zA-Z0-9_]*',\n relevance: 0\n };\n const RECORD_ACCESS = {\n begin: '#' + hljs.UNDERSCORE_IDENT_RE,\n relevance: 0,\n returnBegin: true,\n contains: [\n {\n begin: '#' + hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n begin: /\\{/,\n end: /\\}/,\n relevance: 0\n // \"contains\" defined later\n }\n ]\n };\n\n const BLOCK_STATEMENTS = {\n beginKeywords: 'fun receive if try case',\n end: 'end',\n keywords: ERLANG_RESERVED\n };\n BLOCK_STATEMENTS.contains = [\n COMMENT,\n NAMED_FUN,\n hljs.inherit(hljs.APOS_STRING_MODE, {\n className: ''\n }),\n BLOCK_STATEMENTS,\n FUNCTION_CALL,\n hljs.QUOTE_STRING_MODE,\n NUMBER,\n TUPLE,\n VAR1,\n VAR2,\n RECORD_ACCESS\n ];\n\n const BASIC_MODES = [\n COMMENT,\n NAMED_FUN,\n BLOCK_STATEMENTS,\n FUNCTION_CALL,\n hljs.QUOTE_STRING_MODE,\n NUMBER,\n TUPLE,\n VAR1,\n VAR2,\n RECORD_ACCESS\n ];\n FUNCTION_CALL.contains[1].contains = BASIC_MODES;\n TUPLE.contains = BASIC_MODES;\n RECORD_ACCESS.contains[1].contains = BASIC_MODES;\n\n const PARAMS = {\n className: 'params',\n begin: '\\\\(',\n end: '\\\\)',\n contains: BASIC_MODES\n };\n return {\n name: 'Erlang',\n aliases: ['erl'],\n keywords: ERLANG_RESERVED,\n illegal: '(</|\\\\*=|\\\\+=|-=|/\\\\*|\\\\*/|\\\\(\\\\*|\\\\*\\\\))',\n contains: [\n {\n className: 'function',\n begin: '^' + BASIC_ATOM_RE + '\\\\s*\\\\(',\n end: '->',\n returnBegin: true,\n illegal: '\\\\(|#|//|/\\\\*|\\\\\\\\|:|;',\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, {\n begin: BASIC_ATOM_RE\n })\n ],\n starts: {\n end: ';|\\\\.',\n keywords: ERLANG_RESERVED,\n contains: BASIC_MODES\n }\n },\n COMMENT,\n {\n begin: '^-',\n end: '\\\\.',\n relevance: 0,\n excludeEnd: true,\n returnBegin: true,\n keywords: {\n $pattern: '-' + hljs.IDENT_RE,\n keyword: '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' +\n '-import -include -include_lib -compile -define -else -endif -file -behaviour ' +\n '-behavior -spec'\n },\n contains: [PARAMS]\n },\n NUMBER,\n hljs.QUOTE_STRING_MODE,\n RECORD_ACCESS,\n VAR1,\n VAR2,\n TUPLE,\n {\n begin: /\\.$/\n } // relevance booster\n ]\n };\n}", "function erlang(hljs) {\n const BASIC_ATOM_RE = '[a-z\\'][a-zA-Z0-9_\\']*';\n const FUNCTION_NAME_RE = '(' + BASIC_ATOM_RE + ':' + BASIC_ATOM_RE + '|' + BASIC_ATOM_RE + ')';\n const ERLANG_RESERVED = {\n keyword:\n 'after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if ' +\n 'let not of orelse|10 query receive rem try when xor',\n literal:\n 'false true'\n };\n\n const COMMENT = hljs.COMMENT('%', '$');\n const NUMBER = {\n className: 'number',\n begin: '\\\\b(\\\\d+(_\\\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\\\d+(_\\\\d+)*(\\\\.\\\\d+(_\\\\d+)*)?([eE][-+]?\\\\d+)?)',\n relevance: 0\n };\n const NAMED_FUN = {\n begin: 'fun\\\\s+' + BASIC_ATOM_RE + '/\\\\d+'\n };\n const FUNCTION_CALL = {\n begin: FUNCTION_NAME_RE + '\\\\(',\n end: '\\\\)',\n returnBegin: true,\n relevance: 0,\n contains: [\n {\n begin: FUNCTION_NAME_RE,\n relevance: 0\n },\n {\n begin: '\\\\(',\n end: '\\\\)',\n endsWithParent: true,\n returnEnd: true,\n relevance: 0\n // \"contains\" defined later\n }\n ]\n };\n const TUPLE = {\n begin: /\\{/,\n end: /\\}/,\n relevance: 0\n // \"contains\" defined later\n };\n const VAR1 = {\n begin: '\\\\b_([A-Z][A-Za-z0-9_]*)?',\n relevance: 0\n };\n const VAR2 = {\n begin: '[A-Z][a-zA-Z0-9_]*',\n relevance: 0\n };\n const RECORD_ACCESS = {\n begin: '#' + hljs.UNDERSCORE_IDENT_RE,\n relevance: 0,\n returnBegin: true,\n contains: [\n {\n begin: '#' + hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n begin: /\\{/,\n end: /\\}/,\n relevance: 0\n // \"contains\" defined later\n }\n ]\n };\n\n const BLOCK_STATEMENTS = {\n beginKeywords: 'fun receive if try case',\n end: 'end',\n keywords: ERLANG_RESERVED\n };\n BLOCK_STATEMENTS.contains = [\n COMMENT,\n NAMED_FUN,\n hljs.inherit(hljs.APOS_STRING_MODE, {\n className: ''\n }),\n BLOCK_STATEMENTS,\n FUNCTION_CALL,\n hljs.QUOTE_STRING_MODE,\n NUMBER,\n TUPLE,\n VAR1,\n VAR2,\n RECORD_ACCESS\n ];\n\n const BASIC_MODES = [\n COMMENT,\n NAMED_FUN,\n BLOCK_STATEMENTS,\n FUNCTION_CALL,\n hljs.QUOTE_STRING_MODE,\n NUMBER,\n TUPLE,\n VAR1,\n VAR2,\n RECORD_ACCESS\n ];\n FUNCTION_CALL.contains[1].contains = BASIC_MODES;\n TUPLE.contains = BASIC_MODES;\n RECORD_ACCESS.contains[1].contains = BASIC_MODES;\n\n const PARAMS = {\n className: 'params',\n begin: '\\\\(',\n end: '\\\\)',\n contains: BASIC_MODES\n };\n return {\n name: 'Erlang',\n aliases: ['erl'],\n keywords: ERLANG_RESERVED,\n illegal: '(</|\\\\*=|\\\\+=|-=|/\\\\*|\\\\*/|\\\\(\\\\*|\\\\*\\\\))',\n contains: [\n {\n className: 'function',\n begin: '^' + BASIC_ATOM_RE + '\\\\s*\\\\(',\n end: '->',\n returnBegin: true,\n illegal: '\\\\(|#|//|/\\\\*|\\\\\\\\|:|;',\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, {\n begin: BASIC_ATOM_RE\n })\n ],\n starts: {\n end: ';|\\\\.',\n keywords: ERLANG_RESERVED,\n contains: BASIC_MODES\n }\n },\n COMMENT,\n {\n begin: '^-',\n end: '\\\\.',\n relevance: 0,\n excludeEnd: true,\n returnBegin: true,\n keywords: {\n $pattern: '-' + hljs.IDENT_RE,\n keyword: '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' +\n '-import -include -include_lib -compile -define -else -endif -file -behaviour ' +\n '-behavior -spec'\n },\n contains: [PARAMS]\n },\n NUMBER,\n hljs.QUOTE_STRING_MODE,\n RECORD_ACCESS,\n VAR1,\n VAR2,\n TUPLE,\n {\n begin: /\\.$/\n } // relevance booster\n ]\n };\n}", "getAst() {\n\n return {\n type: 'array',\n elements: this.elements.map(elem => elem.getAst())\n };\n }", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}" ]
[ "0.61950994", "0.5627876", "0.56192935", "0.560038", "0.5565909", "0.5449063", "0.5415006", "0.5353297", "0.53442514", "0.53437316", "0.53218937", "0.52902955", "0.5279069", "0.5254386", "0.5252234", "0.52399904", "0.5229311", "0.52138877", "0.5208072", "0.5205691", "0.52052647", "0.5177318", "0.51719993", "0.5167104", "0.5151679", "0.51421714", "0.5133515", "0.5130106", "0.5124187", "0.5121663", "0.5121576", "0.51131135", "0.5111617", "0.51066273", "0.5079315", "0.5077627", "0.50669116", "0.50648296", "0.50426364", "0.50424266", "0.50405914", "0.50355446", "0.50245404", "0.50243926", "0.5020685", "0.50179857", "0.50135344", "0.5011493", "0.5008467", "0.5007526", "0.50021607", "0.49982157", "0.49850544", "0.4973919", "0.49666792", "0.496641", "0.49588224", "0.4953461", "0.4950618", "0.49453148", "0.49396792", "0.4936301", "0.49355015", "0.49343288", "0.49334356", "0.49297696", "0.49294126", "0.49252754", "0.49252754", "0.49224085", "0.49184582", "0.4917069", "0.4917069", "0.4917069", "0.4917069", "0.4917069", "0.4917069", "0.49088487", "0.49084088", "0.49048084", "0.4893687", "0.4892944", "0.48908916", "0.48817384", "0.4877339", "0.4877339", "0.48736304", "0.48736304", "0.48725784", "0.48712975", "0.48712975", "0.48712975", "0.48712975", "0.48712975", "0.48712975", "0.48712975", "0.48712975", "0.48712975", "0.48712975", "0.48712975", "0.48712975" ]
0.0
-1
Function For Add Link
function addHotLink(link){ var style = document.createElement('style'); var css = ".new_player #actions #hotlink {background-position: 3px -97px;}" + "\n"; style.textContent= css; var head = document.getElementsByTagName('head')[0]; head.appendChild(style); var a = document.createElement('a'); a.href = link; a.target = "_blank"; a.innerHTML = 'HotLink' a.className = 'radius_3'; a.id = 'hotlink'; var li = document.createElement('li'); li.appendChild(a); var ul_actions = document.getElementById('actions'); ul_actions.appendChild(li); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLink() {\n SC.RunLoop.begin();\n Nodelink.store.createRecord(Nodelink.Link, { guid: 'node2', startNode: 'node1', endNode: 'node2' } );\n SC.RunLoop.end();\n}", "function AddLink(thetype) {\n\tAddTag(\"[\" + thetype + \"]\", \"[/\" + thetype + \"]\", '');\n}", "function addLink (target, link) {\n\torgHtml = document.getElementById(target).innerHTML;\n\tnewHtml = link + orgHtml + \"</a>\";\n\tdocument.getElementById(target).innerHTML = newHtml;\n}", "function createLink(label,link){\n var newLink=$(\"<a>\", {\n title: label,\n href: link,\n class: \"toolbox_button\"\n }).append( label );\n return newLink;\n }", "function renderAddLink (url, text) {\n var cls = 'btn-large';\n\n if ( ! url ) {\n url = '#';\n cls += ' disabled';\n }\n\n return Present.addLink(url, text, true, cls);\n}", "function link() {\n var LINKY_URL_REGEXP =\n /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"”’]$/;\n var sub = selection.anchorNode.data.substring(0, selection.anchorOffset - 1);\n if (LINKY_URL_REGEXP.test(sub)) {\n var matchs = sub.match(LINKY_URL_REGEXP);\n if (matchs && matchs.length) {\n var st = selection.anchorOffset - matchs[0].length - 1;\n range.setStart(selection.anchorNode, st);\n scope.doCommand(null, {\n name: 'createLink',\n param: matchs[0]\n });\n }\n }\n }", "function _addLink() {\n\n\t\t\tvar _item = {\n\n\t\t\t\tname: vm.formData.linkName,\n\t\t\t\tredirect_url: vm.formData.linkUrl\n\n\t\t\t};\n\n\t\t\t// disable further removals for 1s\n\t\t\tvm.disableAdd = true;\n\n\t\t\t// set timeout to wait localstorage update (~1s enough?)\n\t\t\t$timeout( function() {\n\n\t\t\t\t// add single item to storage (_itemAdded is dummy server response, newly added item)\n\t\t\t\tvar _itemAdded = LinkVoteChallengeService.addItem( _item );\n\n\t\t\t\t// disable further removals for 1s\n\t\t\t\tvm.disableAdd = false;\n\n\t\t\t\tif( _itemAdded ) {\n\n\t\t\t\t\t// @see toaster.controller.js\n\t\t\t\t\t$rootScope.$broadcast( 'mso.showToaster', { toasterType: 'mso.itemAdded', targetItem: { item: _item } } );\n\n\t\t\t\t\tvm.link = _itemAdded;\n\n\t\t\t\t\t// clear form\n\t\t\t\t\tvm.formData = { linkName: '', linkUrl: '' };\n\n\t\t\t\t}\n\n\t\t\t}, 1000 );\n\n\t\t}", "function addBrainLink() {\n\t\tvar sourceKey = $('#sourceName').val();\n\t\tvar targetKey = $('#targetName').val();\n\t\tvar notes = $('[name=\"linkNotes\"]').val();\n\t\tvar attrKey = $('#attrName').val();\n\t\tvar attrValue = $('#attrValue').val();\n\t\tvar linkData = {userID: datasetProperties.userID, datasetKey: datasetProperties.key, source: sourceKey, target: targetKey, notes: notes, attrKey: attrKey, attrValue: attrValue};\n\t\tdatabase.addBrainLink(linkData);\n\t}", "function CreateLink(editor) {\r\n\tthis.editor = editor;\r\n\tvar cfg = editor.config;\r\n\tvar self = this;\r\n\r\n editor.config.btnList.createlink[3] = function() { self.show(self._getSelectedAnchor()); }\r\n}", "function addControlLink ( text, url, linkClass ) {\n\n if ( ! linkContainer ) {\n \n console.error( 'domui.addControlLink() error: link container not created.');\n\n return;\n\n }\n\n if ( ! text || ! url ) {\n\n console.error( 'domui.addControlLink() error: no text or link supplied.');\n\n return;\n\n }\n\n var link = document.createElement( 'a' );\n\n link.innerHTML = text;\n\n link.href = url;\n\n link.className = linkClass || '';\n\n linkContainer.appendChild( link );\n\n return link;\n\n }", "static createLink(name, link) {\n return Helper_1.createEntry(name, true, `Object.assign(exports, require('${link}'));`);\n }", "function Hyperlink(){\n\tthis.createHyperlink =function(url, name, id){\n\t\tthis.item =document.createElement('a');\n\t\t//this.item.setAttribute(\"href\", url);\n\t\tvar linkText = document.createTextNode(name);\n\t\tthis.item.appendChild(linkText);\n\t\tthis.item.title = name;\n\t\tthis.item.href = 'http://' + url;\n\t\tconsole.log(this.item);\n\t\tdocument.body.appendChild(this.item);\n\n }\n this.addtodiv=function(id){\n document.getElementById(id).appendChild(this.item);\n }\n}", "function makeLink() {\n // var a=\"http://www.geocodezip.com/v3_MW_example_linktothis.html\"\n var url = window.location.pathname;\n var a = url.substring(url.lastIndexOf(\n '/') + 1) + \"?lat=\" +\n map.getCenter()\n .lat()\n .toFixed(6) + \"&lng=\" +\n map.getCenter()\n .lng()\n .toFixed(6) +\n \"&zoom=\" + map.getZoom() +\n \"&type=\" +\n MapTypeId2UrlValue(map.getMapTypeId());\n if (filename !=\n \"TrashDays40.xml\") a +=\n \"&filename=\" + filename;\n document.getElementById(\n \"link\")\n .innerHTML =\n '<a href=\"' + a +\n '\">Link to this page<\\/a>';\n }", "function createLink(url,text){\r\n\treturn \"<a href=\\\"\"+url+\"\\\"\"+Target+\">\"+text+\"</a>\";\r\n}", "function AddLink(link, sender) {\n var targetUrlStr = UrlHostPathname(link.target);\n\n if (blackListedUrls.has(targetUrlStr))\n return;\n\n var nodes = sessions[currentSession].nodes;\n\n // insert target node\n if (!(nodes[targetUrlStr])) {\n nodes[targetUrlStr] = {\n url: targetUrlStr,\n rawUrl: link.target,\n title: link.title,\n };\n } else {\n nodes[targetUrlStr].title = link.title;\n }\n\n // timestamp\n //if (!(nodes[targetUrlStr].timestamps)) {\n // nodes[targetUrlStr].timestamps = [];\n //}\n //nodes[targetUrlStr].timestamps.push(Date.now());\n var date = new Date();\n nodes[targetUrlStr].hours = date.getHours();\n nodes[targetUrlStr].minutes = date.getMinutes();\n\n // check that source URL is a nonempty string\n if (link.source.length > 0) {\n var sourceUrlStr = UrlHostPathname(link.source);\n\n // check for a self loop\n if (sourceUrlStr != targetUrlStr) {\n var forwardLinks = sessions[currentSession].forwardLinks;\n var backLinks = sessions[currentSession].backLinks;\n\n // insert source vertex\n if (!(nodes[sourceUrlStr])) {\n nodes[sourceUrlStr] = {\n url: sourceUrlStr,\n rawUrl: link.source\n };\n }\n\n if (!(forwardLinks[sourceUrlStr])) {\n forwardLinks[sourceUrlStr] = new Set();\n }\n if (!(backLinks[targetUrlStr])) {\n backLinks[targetUrlStr] = new Set();\n }\n\n // add vertices to the adjacency lists\n forwardLinks[sourceUrlStr].add(targetUrlStr);\n backLinks[targetUrlStr].add(sourceUrlStr);\n }\n }\n}", "function addLink(toAdd, rel, defHref, size) {\n return add(\"<link>\", {\n rel: rel,\n href: toAdd ? defHref : size,\n size: size\n });\n }", "function add_link(link_name) {\n document.querySelector(\"#link-view\").style.display = \"none\"\n document.querySelector(\"#add_link-view\").style.display = \"block\"\n \n document.querySelector(\"#add_link-view\").innerHTML = `<form id='add_link'><div class=\"input-group mb-3\">\n <input type=\"text\" class=\"form-control\" placeholder=\"URL\" id=\"basic_url\" aria-describedby=\"basic-addon3\"> </div>\n <div class=\"input-group mb-3\"> <input type=\"text\" class=\"form-control\" placeholder=\"Name\" id=\"basic_name\" aria-describedby=\"basic-addon3\"> \n </div> <button type=\"submit\" class=\"add_link btn btn-dark\" name=\"add_link\">Add Link</button></form>`\n\n // Submit link and add to database\n document.querySelector('#add_link').onsubmit = function() {\n fetch(`/add`, {\n method: 'POST',\n body: JSON.stringify({\n name: document.querySelector('#basic_name').value,\n subject: link_name,\n link: document.querySelector('#basic_url').value\n }) \n })\n } \n }", "function linkPush() {\n\tconst linksDiv = document.querySelector('.links');\n\tvar iLink = this;\n\tiLink.classList.remove('choose');\n\tiLink.id = iLink.getAttribute('data-id');\n\n\tvar a = document.createElement('a');\n\ta.href = data[iLink.id][0];\n\ta.target = '_blank';\n\ta.append(iLink);\n\tlinksDiv.append(a);\n\t// console.log(iLink);\n\tupdateData(iLink); // function to update data in storage\n}", "function addLink(){\r\n\tif(getId(\"imgIcoGrupoFrmLink\").src == \"\" || getId(\"imgIcoGrupoFrmLink\").getAttribute(\"sIdGrupoSel\") == \"\"){alert(\"Selecione um grupo para o link!\"); return}\r\n\tif(getId(\"imgLinkSelIco\").src == \"\" || getId(\"imgLinkSelIco\").getAttribute(\"sIdIconSel\") == \"\"){alert(\"Selecione um ícone para o link!\"); return}\r\n\tif(getId(\"txtNomeLink\").value == \"\"){alert(\"Entre com a descrição do link!\"); return}\r\n\tif(getId(\"txtLink\").value == \"\"){alert(\"Entre com o endereço do link!\"); return}\r\n\t\r\n\tif( oXmlDb.query(oLinksXmlDoc, {nome: \"'\" + encodeXml_Disabled(getId(\"txtNomeLink\").value) + \"'\", idGrupo: \"'\" + getId(\"imgIcoGrupoFrmLink\").getAttribute(\"sIdGrupoSel\") + \"'\"}) == null ){\r\n\t\t\r\n\t\tnewId = parseInt(oXmlDb.max(oLinksXmlDoc, \"id|n\"))+1;\r\n\t\t\r\n\t\tvar oObjDados = {\r\n\t\t\t id: newId\r\n\t\t\t,nome: encodeXml_Disabled(getId(\"txtNomeLink\").value)\r\n\t\t\t,idGrupo: getId(\"imgIcoGrupoFrmLink\").getAttribute(\"sIdGrupoSel\")\r\n\t\t\t,idIcone: getId(\"imgLinkSelIco\").getAttribute(\"sIdIconSel\")\r\n\t\t\t,url: encodeXml_Disabled(getId(\"txtLink\").value)\r\n\t\t}\r\n\t\toXmlDb.add(oLinksXmlDoc, oObjDados);\r\n\t\t_sV(llXmlLinks, oXmlDb.getXml(oLinksXmlDoc));\r\n\t\toLinksXmlDoc = oXmlDb.createDoc(_gV(llXmlLinks));\r\n\t\t//alert(\"Link inserido.\");\r\n\t\tlistLinks();\r\n\t\tgetId(\"txtNomeGrupo\").value = \"\";\r\n\t\tgetId(\"imgGrupoSelIco\").src = \"\";\r\n\t\tgetId(\"imgGrupoSelIco\").setAttribute(\"sIdIconSel\", \"\");\r\n\t\t\r\n\t\tllCloseWin(\"llWinFrmLink\");\r\n\t} else {\r\n\t\talert(\"Já existe um link com essa descrição nesse grupo!\");\r\n\t}\r\n}", "function addLink(link) {\n links.push(link);\n console.log('Connecting node [' + link.firstId + '] and [' + link.secondId + ']');\n }", "function addUrl(href, obj) {\n logger.trace(\"Entering addUrl function\");\n if (((href !== undefined) && !href.includes(\"redLink\"))) {\n if (href.includes(\"/wiki\")) {\n if (obj.type === \"actor\") {\n if (movieUrls.length > 300) {\n return;\n }\n var check = false;\n for (var a = 0; a < pastMovieUrls.length; a++) {\n if (pastMovieUrls[a] === href) {\n check = true;\n }\n }\n if (check === false){\n movieUrls.push(\"https://en.wikipedia.org\" + href);\n pastMovieUrls.push(href);\n }\n }\n else {\n if (actorUrls.length > 300) {\n return;\n }\n var c = false;\n for (var b = 0; b < pastActorUrls.length; b++) {\n if (pastMovieUrls[b] === href) {\n c = true;\n }\n }\n if (c === false){\n actorUrls.push(\"https://en.wikipedia.org\" + href);\n pastActorUrls.push(href);\n }\n }\n }\n }\n}", "function drawLink() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.link, insertTexts.link, url);\n}", "async createLink () {\n\t\tconst thing = this.codemark || this.review || this.codeError;\n\t\tconst type = (\n\t\t\t(this.codemark && 'c') ||\n\t\t\t(this.review && 'r') ||\n\t\t\t(this.codeError && 'e')\n\t\t);\n\t\tconst attr = (\n\t\t\t(this.codemark && 'codemarkId') ||\n\t\t\t(this.review && 'reviewId') ||\n\t\t\t(this.codeError && 'codeErrorId')\n\t\t);\n\t\tconst linkId = UUID().replace(/-/g, '');\n\t\tthis.url = this.makePermalink(linkId, this.isPublic, thing.teamId, type);\n\t\tconst hash = this.makeHash(thing, this.markers, this.isPublic, type);\n\n\t\t// upsert the link, which should be collision free\n\t\tconst update = {\n\t\t\t$set: {\n\t\t\t\tteamId: thing.teamId,\n\t\t\t\tmd5Hash: hash,\n\t\t\t\t[attr]: thing.id\n\t\t\t}\n\t\t};\n\n\t\tconst func = this.request.data.codemarkLinks.updateDirectWhenPersist ||\n\t\t\tthis.request.data.codemarkLinks.updateDirect;\t// allows for migration script\n\t\tawait func.call(\n\t\t\tthis.request.data.codemarkLinks,\n\t\t\t{ id: linkId },\n\t\t\tupdate,\n\t\t\t{ upsert: true }\n\t\t);\n\t}", "async function addLink(obj) {\n const res = await fetch('/api/addLink',{\n method: 'POST',\n body: JSON.stringify(obj),\n headers: {\n 'content-type': 'application/json'\n }\n });\n //get folder back\n const data = await res.json();\n //use folder id to make another API call to grab the links folder with the links data\n const res1 = await fetch(`/api/folder/${data._id}`);\n const data1 = await res1.json();\n //pass folder with links data to re-populate the content div with updated links\n renderFolderContent(data1);\n }", "function addLink(link, callback) {\n if(Editor.writeAccess && link != null) {\n socket.emit(\"link/add\", link, function (data) {\n callback(data);\n });\n }\n}", "function registerLinkClick(queryTerm, rank, linkText, url, documentId, searchActionId) {\n var pageNumber = \"0\";\n var linkClickUrl = $('#solrquest #linkClickUrl').val();\n\n if (!url || url == \"#\") {\n url = \"undefined\";\n }\n\n var registerLinkClickUrl = linkClickUrl + \"&url=\" + url + \"&rank=\" + rank + \"&linkText=\" + linkText\n + \"&documentId=\" + documentId + \"&queryTerm=\" + queryTerm + \"&searchActionId=\" + searchActionId + \"&pageNumber=\" + pageNumber;\n\n // console.log(registerLinkClickUrl);\n\n jQuery.ajax({\n type: \"POST\",\n global: false,\n url: registerLinkClickUrl\n });\n }", "function addCPNlinkToPage(){\n\t\tcpn_url = location.href.match(/^(http.+\\/)[^\\/]+$/ )[1]+\"/savefiles/\"+$('#model_name').val()+\".cpn\";\n\n\t\t$.get(cpn_url).done(function() { \n \t\tsay('<a href=\"'+cpn_url+'\">CPN file</a> created');\n \t\t}).fail(function() { \n \t\tsay('CPN file does not exist!');\n \t\t});\t\t\n\t}", "function makeLink(url, text) {\n const selection = document.getSelection();\n document.execCommand('createLink', true, url);\n selection.anchorNode.parentElement.target = '_blank';\n selection.anchorNode.parentElement.innerHTML = text;\n showPostPreview();\n}", "function addNewLink() {\n var navbar = _$c(navbar)\n navbar.textContent = \"www.stratofyzika.com\"\n}", "function new_check_link (e, url) {\r\n var a = document.createElement('a');\r\n a.title = url || e.href;\r\n a.href= 'javascript:;';\r\n a.style.fontWeight = \"bold\";\r\n a.style.fontSize = \"small\";\r\n a.style.textDecoration = \"none\";\r\n a.appendChild(document.createTextNode('[C]'));\r\n a.addEventListener(\"click\", click, true);\r\n e.parentNode.insertBefore(a, e.nextSibling);\r\n}", "function newUrl() {\n\trecordUrl();\n\n\tconstructUrlMarkup(2);\n}", "function insertLink(title, url) {\n Links.insert({ title, url, createdAt: new Date() });\n}", "function buildCreatedLink (linkURL) {\n if(Bkg.DEBUG)\n console.log(\"Popup.buildCreatedLink:\" + linkURL);\n var string = \"<span class='created_task_conv_link'>\" + linkURL + \"</span>\";\n return string;\n}", "function edLink(display, URL, newWin) {\n\tthis.display = display;\n\tthis.URL = URL;\n\tif (!newWin) {\n\t\tnewWin = 0;\n\t}\n\tthis.newWin = newWin;\n}", "function makeOrChangeLink()\n{\n var dom = dw.getDocumentDOM(); \n\n if (typeof dom[\"setLinkHref\"] != 'undefined') //CONTRIBUTE ALERT\n dom.setLinkHref();\n}", "function addLinks(apples){ //parameter\n\tapples.innerHTML += \"<a href='#home'>Home</a> \";\n\t// apples.innerHTML += \"<a href=\"about.html\">About</a> \";\n\t// apples.innerHTML += \"<a href=\"add.html\">+add</a> \";\n\n}", "function addButton() {\r\n\ttrace(\"addButton()\");\r\n\tvar href=\"\";\r\n\tvar links=new Array();\r\n\t\r\n\tswitch(GM_getValue(\"popup_mode\", 1)) {\r\n\t\tcase 0: // popup closed\r\n\t\tcase 1: // in normal mode\r\n\t\t\tlinks=getSelectLink(eLinks);\r\n\t\t\tbreak;\r\n\t\tcase 2: // in edit mode\r\n\t\t\tvar txt = document.getElementById(\"editbox\");\r\n\t\t\tlinks=txt.value.split('\\n');\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\ttrace(\"ERROR: popup_mode=\" + GM_getValue(\"popup_mode\", 1));\r\n\t\t\talert(\"Error !!! popup_mode unknown.\");\r\n\t\t\treturn;\r\n\t}\r\n\r\n\thref = getAddLink(links);\r\n\ttrace(\"href=\"+href);\r\n\t\r\n\tif(ed2kDlMethod=='local') {\r\n\t\tfor (var i=0; i<links.length; i++) {\r\n\t\t\twindow.location.replace(links[i]);\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tvar e_win = window.open(href, 'emule');\r\n\t\te_win.blur();\r\n\t}\r\n\t\r\n}", "function _getLink(text, enabled, urlFormat, index) {\n if (enabled == false)\n return J.FormatString(' <a class=\"button-white\" style=\"filter:Alpha(Opacity=60);opacity:0.6;\" href=\"javascript:void(0);\"><span>{0}</span></a>',\n text);\n else\n return J.FormatString(' <a class=\"button-white\" href=\"javascript:window.location.href=\\'' + urlFormat + '\\';\"><span>{1}</span></a>', index, text);\n }", "function fnVoltarLink() {\r\n\tvar oLink = document.links[0];\r\n\toLink.innerHTML = \"Pegar Feeds\";\r\n\toLink.className = \"\";\r\n\toLink.onclick = fnGo;\r\n}", "handleAddLink(target, url) {\n const { editorState, isDirty } = this.state;\n const { delegate } = this.props;\n this.setState(() => ({\n editorState: createLinkAtSelection(editorState, target, url),\n }), () => {\n if (!isDirty) {\n delegate.handleDirtyEditor();\n }\n });\n }", "function mk_link(text) {\r\n var a = $e('a')\r\n a.style.background = null\r\n a.style.backgroundColor = null\r\n a.href = '#'\r\n a.appendChild( $t(text) )\r\n return a\r\n}", "function insertingLinksToCollection (item, linked) {\n let linksNumbering=0;\n for( let i=0; i<linked.length; i++ ) {\n item.links[linksNumbering++] = {\n 'rel': linked[i][0],\n 'href': linked[i][1],\n 'prompt': linked[i][0]\n }\n }\n }", "function createLink(editor, link, altText, displayText) {\n editor.focus();\n var url = link ? link.trim() : '';\n if (url) {\n var linkData = roosterjs_editor_dom_1.matchLink(url);\n // matchLink can match most links, but not all, i.e. if you pass link a link as \"abc\", it won't match\n // we know in that case, users will want to insert a link like http://abc\n // so we have separate logic in applyLinkPrefix to add link prefix depending on the format of the link\n // i.e. if the link starts with something like abc@xxx, we will add mailto: prefix\n // if the link starts with ftp.xxx, we will add ftp:// link. For more, see applyLinkPrefix\n var normalizedUrl_1 = linkData ? linkData.normalizedUrl : applyLinkPrefix(url);\n var originalUrl_1 = linkData ? linkData.originalUrl : url;\n editor.addUndoSnapshot(function () {\n var range = editor.getSelectionRange();\n var anchor = null;\n if (range && range.collapsed) {\n anchor = getAnchorNodeAtCursor(editor);\n // If there is already a link, just change its href\n if (anchor) {\n anchor.href = normalizedUrl_1;\n // Change text content if it is specified\n updateAnchorDisplayText(anchor, displayText);\n }\n else {\n anchor = editor.getDocument().createElement('A');\n anchor.textContent = displayText || originalUrl_1;\n anchor.href = normalizedUrl_1;\n editor.insertNode(anchor);\n }\n }\n else {\n // the selection is not collapsed, use browser execCommand\n editor.getDocument().execCommand(\"createLink\" /* CreateLink */, false, normalizedUrl_1);\n anchor = getAnchorNodeAtCursor(editor);\n updateAnchorDisplayText(anchor, displayText);\n }\n if (altText && anchor) {\n // Hack: Ideally this should be done by HyperLink plugin.\n // We make a hack here since we don't have an event to notify HyperLink plugin\n // before we apply the link.\n anchor.removeAttribute(TEMP_TITLE);\n anchor.title = altText;\n }\n return anchor;\n }, \"CreateLink\" /* CreateLink */);\n }\n}", "function addUser(e){\n var url=e.getAttribute(\"href\");\n url=url+\"?user=\"+getPageUser();\n console.log(\"New URL\",url);\n e.href=url;\n}", "function add_link(text, title, func) {\n var bar = document.getElementById('titlebar'); //formerly 'volumebartable'\n var link = document.createElement('a');\n link.title = title;\n link.innerHTML = text;\n var dofunc = function(event) {\n event.stopPropagation();\n event.preventDefault();\n func();\n };\n link.addEventListener('click', dofunc, false);\n //var lp = document.createElement('td');\n //lp.appendChild(link);\n //bar.childNodes[0].childNodes[0].appendChild(lp);\n bar.appendChild(link);\n }", "function _(e){var t=document.createElement(\"a\");return t.href=e,t}", "function makeItemLink(key, linkLi) {\n\t\tvar editLink = document.createElement('a');\n\t\teditLink.href = \"#editRide\";\n\t\teditLink.key = key;\n\t\t// assigns the variable that was passed\n\t\tvar editText = \"Edit trail\";\n\t\t//editLink.addEventListener(\"click\", editTrail);\n\t\teditLink.innerHTML = editText;\n\t\tlinkLi.setAttribute(\"class\", \"modLinks\");\n\t\tlinkLi.appendChild(editLink);\n\n\t\t// add a line break \n\t\tvar breakTag = document.createElement('br');\n\t\tlinkLi.appendChild(breakTag);\n\n\t\tvar deleteLink = document.createElement('a');\n\t\tdeleteLink.href = \"#\";\n\t\tdeleteLink.key = key;\n\t\tvar deleteText = \"Delete trail\";\n\t\t//deleteLink.addEventListener(\"click\", deleteTrail);\n\t\tdeleteLink.innerHTML = deleteText;\n\t\tlinkLi.appendChild(deleteLink);\n\t}", "function addLinkText(par, url) {\r\n try {\r\n // add blue color to url text\r\n var color = [0, 0, 0.85];\r\n var urlText = addColorText(par, url, color);\r\n urlText.helpTip = loc_linkTextTip;\r\n\r\n // open url by click\r\n with(par) {\r\n urlText.onClick = function() {\r\n var os = ($.os.indexOf('Win') != -1) ? 'Win' : 'Mac';\r\n if (os == 'Win') {\r\n system('explorer ' + url);\r\n } else {\r\n system('open ' + url);\r\n }\r\n };\r\n }\r\n return urlText;\r\n } catch (e) {\r\n var urlText = addStaticText(par, url);\r\n return urlText;\r\n }\r\n}", "function create_link(self, kw, common)\n {\n let id = kw_get_str(kw, \"id\", kw_get_str(kw, \"name\", \"\"));\n\n /*\n * Check if link exists\n */\n let gobj_link = self.yuno.gobj_find_unique_gobj(id);\n if(gobj_link) {\n log_error(sprintf(\"%s: link already exists '%s'\", self.gobj_short_name(), id));\n return null;\n }\n\n // 'id' or 'name' can be use as all port names\n kw[\"source_port\"] = kw_get_dict_value(kw, \"source_port\", id);\n kw[\"target_port\"] = kw_get_dict_value(kw, \"target_port\", id);\n\n json_object_update_missing(kw, common);\n\n return self.yuno.gobj_create_unique(id, Ka_link, kw, self);\n }", "function g_link(template, item) {\r\n return \"/\" + template.id + \"/\" + item.id;\r\n}", "addSingleLinkToUrl(sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink = false) {\r\n const query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".AddSingleLinkToUrl\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n TargetItemUrl: targetItemUrl,\r\n TryAddReverseLink: tryAddReverseLink,\r\n }),\r\n });\r\n }", "function createLinkElement(link) {\n var linktitle = document.createElement(\"a\");\n linktitle.href = link.url;\n linktitle.style.color = \"#428bca\";\n linktitle.style.textDecoration = \"none\";\n linktitle.style.marginRight = \"5px\";\n linktitle.appendChild(document.createTextNode(link.title));\n\n var linkUrl = document.createElement(\"span\");\n linkUrl.appendChild(document.createTextNode(link.url));\n\n var titleLine = document.createElement(\"h4\");\n titleLine.style.margin = \"0px\";\n titleLine.appendChild(linktitle);\n titleLine.appendChild(linkUrl);\n\n var detailsLine = document.createElement(\"span\");\n detailsLine.appendChild(document.createTextNode(\"Added by \" + link.author));\n\n var linkDiv = document.createElement(\"div\");\n linkDiv.classList.add(\"link\");\n linkDiv.appendChild(titleLine);\n linkDiv.appendChild(detailsLine);\n\n return linkDiv;\n}", "function generate_link_element(link_data) {\n\tvar link = document.createElement(\"a\");\n\tlink.classList.add(\"link\");\n\tlink.style.color = foreground_color;\n\tlink.href = link_data.link;\n\tlink.textContent = link_data.title;\n\n\treturn link;\n}", "function addLink(container, search, parameters) {\r\n\tvar url = (parameters.album?(search.albumTemplate):(search.artistTemplate)) || search.template;\r\n\tvar a = $(\"<a style='margin-left:5px' class='\"+search.title + \"'></a>\");\r\n\tvar img = $(\"<img title='\"+search.title+\"'>\")\r\n\ta.attr(\"href\", makeUrl(url, parameters));\r\n\timg.attr(\"src\", search.imgsrc);\r\n\ta.append(img);\r\n\tcontainer.append(a);\r\n}", "function fn_createlink(strImgLink)\r\n{\r\n\tvar tempCode;\r\n\ttempCode = \"<a href = \" + chr(34) + strImgLink + chr(34) + \"> View </a>\";\r\n\treturn tempCode + Chr(10);\r\n}", "function getAddLink(links) {\r\n\tvar url=\"\";\r\n\tvar lnk=\"\"; // string of links\r\n\tvar tmp=\"\";\r\n\tvar cat=\"\";\r\n\t\r\n\ttrace('getAddLink('+links+')');\r\n\t\r\n\tvar cat = document.getElementById('cat').value;\r\n\t\r\n\tfor (var i=0; i<links.length; i++) {\r\n\t\ttmp=links[i].split('|');\r\n\r\n\t\t// we encode the filename\r\n\t\ttmp[2]=encodeURIComponent(decodeURIComponent(tmp[2]));\r\n\t\ttmp=tmp.join('|');\r\n\t\t\t\r\n\t\tif (i==0) {\r\n\t\t\tlnk=tmp;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlnk += '\\n' + tmp;\r\n\t\t}\r\n\t}\r\n\r\n\t// then we encode the link (so the filename is encoded twice)\r\n\tlnk=encodeURIComponent(lnk);\r\n\tlnk=lnk.replace(/\\%257C/gi, '|');\r\n\tlnk=lnk.replace(/\\%7C/gi, '|');\r\n\r\n\t\t\t\r\n\tswitch(ed2kDlMethod) {\r\n\t\tcase 'local':\r\n\t\t\turl = links.join('\\n');\r\n\t\t\tbreak;\r\n\t\tcase 'emule':\r\n\t\t\turl = getEmuleLink(lnk, cat);\r\n\t\t\tbreak;\r\n\t\tcase 'amule':\r\n\t\t\turl = getAmuleLink(lnk, cat);\r\n\t\t\tbreak;\r\n\t\tcase 'mldonkey':\r\n\t\t\turl = getMLDonkeyLink(lnk);\r\n\t\t\tbreak;\r\n\t\tcase 'custom':\r\n\t\t\turl = getCustomLink(lnk, cat);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t}\r\n\treturn url;\r\n}", "function addLinkToDiagram(link) {\n diagram.startTransaction();\n model.addLinkData({\n //key: link._id,\n type: link.type,\n from: link.from,\n to: link.to,\n dash: link.dash\n });\n diagram.commitTransaction(\"update\");\n modelLinkWithoutFilter.push(link);\n}", "function makeHyperlink(url){\n return '<a target=\"_blank\" href=\"'+ url+ '\">' + url + '</a>'\n}", "function createLink(href, text){\n var link = document.createElement('a');\n link.href = href;\n link.innerText = text;\n link.target = '_blank';\n return link;\n}", "function addLink() {\n var body_element, selection, pagelink, copytext, newdiv;\n body_element = document.getElementsByTagName('body')[0];\n selection = window.getSelection();\n pagelink = \" Read more at: <a href='\" + document.location.href + \"'>\" + document.location.href + \"</a>\";\n copytext = selection + pagelink;\n newdiv = document.createElement('div');\n newdiv.style.position = 'absolute';\n newdiv.style.left = '-99999px';\n body_element.appendChild(newdiv);\n newdiv.innerHTML = copytext;\n selection.selectAllChildren(newdiv);\n window.setTimeout(function () {\n body_element.removeChild(newdiv);\n }, 0);\n }", "function addLinks() {\n\t\tsetLoggedUserName();\n\n\t\tif(loggedUserName == null) return;\n\n\t\t// Search for the div element in which tag are listed\n\t\tvar rightDiv = \n\t\t\t\tgetElementByClass(getElementsByName(document,'div'),'right list');\n\t\t\n\t\t// For each tag item in the div add the edit link and delete link\n\t\tvar itemBundles = getElementByClass(getElementsByName(rightDiv,'ul'),'bundles');\n\t\tvar bundleFold = getElementByClass(getElementsByName(itemBundles,'li'),'bundle fold');\n\t\tvar itemsGroupUL= getElementsByName(bundleFold,'ul')[0];\n\t\tvar itemsGroup = getElementsByName(itemsGroupUL,'li');\n\t\t\n\t\tfor(var index=0; index < itemsGroup.length; ++index) {\n\t\t\tvar item = itemsGroup[index];\n\t\t\tvar itemAnchor = getElementsByName(item,'a')[0];\n\t\t\tvar editLinkElem = createRenameLinkElement(item);\n\t\t\tvar delLinkElem = createDeleteLinkElement(item);\n\t\t\tif(editLinkElem != null) item.insertBefore(editLinkElem,itemAnchor);\n\t\t\tif(delLinkElem != null) item.insertBefore(delLinkElem,itemAnchor);\t\t\t\n\t\t}\n\t}", "function newLink(start, end, meaning, htmlstyle)\n{\n // Link around meaning\n var bbA = document.createElement(\"a\");\n\n // Link URL\n var bbAHref = document.createAttribute(\"href\");\n bbAHref.nodeValue = \"javascript:insertTagsToLogInfo(\\\"\"+start+\"\\\", \\\"\"+end+\"\\\")\";\n bbA.setAttributeNode(bbAHref);\n\n // Link format\n var bbHTML = document.createElement(\"span\");\n\n // Link style\n var bbHTMLStyle = document.createAttribute(\"style\");\n bbHTMLStyle.nodeValue = htmlstyle + \";margin: 0px 2px 0px 2px\";\n bbHTML.setAttributeNode(bbHTMLStyle);\n\n // Link text\n var bbHTMLText = document.createTextNode(meaning);\n bbHTML.appendChild(bbHTMLText);\n\n // Add link text to link\n bbA.appendChild(bbHTML);\n\n // Return link object\n return bbA;\n}", "function renderLink(url) {\n let card = document.createElement(\"div\");\n card.classList.add('card');\n\n let newLink = document.createElement(\"div\");\n newLink.innerHTML = '<a href=\"'+url+'\">'+url+'</a>';\n // newLink.classList.add(\"bg-success\");\n\n card.appendChild(newLink);\n\n let linkSection = document.querySelector('#linkSection');\n linkSection.appendChild(card); \n}", "function addLink(linkObj) { \r\n var myDiv = document.getElementById(\"list\"); \r\n // creating checkbox element \r\n var checkbox = document.createElement('input'); \r\n checkbox.type = \"checkbox\"; \r\n checkbox.name = \"name\"; \r\n checkbox.value = \"value\"; \r\n checkbox.id = count_links; \r\n // creating label for checkbox \r\n var label = document.createElement('label'); \r\n // assigning attributes for the created label tag \r\n label.htmlFor = \"id\"; \r\n\t// appending the created text to the created label tag \r\n\tvar lb = linkObj.lnk + \" -> \" + linkObj.desc;\r\n label.appendChild(document.createTextNode(lb)); \r\n //appending the checkbox and label to div \r\n myDiv.appendChild(checkbox); \r\n myDiv.appendChild(label); \r\n document.getElementById('list').innerHTML += \"<br>\";\r\n\tcount_links = count_links + 1;\r\n\tdocument.getElementById('links').innerHTML = '';\r\n\tdocument.getElementById('links_desc').innerHTML = '';\r\n\tcreateJASON(summary,codeURL,instrURL,libsURLs);\r\n}", "function feedLink(url) {\n var feed_link = document.createElement('a');\n feed_link.href = url;\n feed_link.addEventListener(\"click\", onClick);\n return feed_link;\n}", "function addMenu(addUrl,addUrlTarget,addUrlTitre){\r\n var sentence = \"<tr><td><div align=\\\"center\\\"><font color=\\\"#ffffff\\\"><a href=\\\"\"+addUrl+\"\\\" target=\\\"\"+addUrlTarget+\"\\\">\"+addUrlTitre+\"</a></font></div></td></tr>\";\r\n return sentence;\r\n}", "function addItem() {\n const urlBox = document.getElementById('inputBox');\n const iconBox = document.getElementById('selectBox');\n const urlVal = urlBox.value;\n const iconVal = iconBox.value;\n postLink(urlVal, iconVal);\n removeIcons();\n resetModalContent();\n}", "function makeLink() {\n// var a=\"http://www.geocodezip.com/v3_MW_example_linktothis.html\"\n/*\n var url = window.location.pathname;\n var a = url.substring(url.lastIndexOf('/')+1)\n + \"?lat=\" + mapProfile.getCenter().lat().toFixed(6)\n + \"&lng=\" + mapProfile.getCenter().lng().toFixed(6)\n + \"&zoom=\" + mapProfile.getZoom()\n + \"&type=\" + MapTypeId2UrlValue(mapProfile.getMapTypeId());\n if (filename != \"FlightAware_JBU670_KLAX_KJFK_20120229_kml.xml\") a += \"&filename=\"+filename;\n document.getElementById(\"link\").innerHTML = '<a href=\"' +a+ '\">Link to this page<\\/a>';\n*/\n }", "function setNewUserUrl(url){\n\tconsole.log(\"NEW URL, \", url)\n $(\"#addUser\").attr(\"href\", url);\n}", "addUrl(title, displayFormat = UrlFieldFormatType.Hyperlink, properties) {\r\n const props = {\r\n DisplayFormat: displayFormat,\r\n FieldTypeKind: 11,\r\n };\r\n return this.add(title, \"SP.FieldUrl\", extend(props, properties));\r\n }", "function getCustomLink(links, cat) {\r\n\t// Url to add ed2k links to custom application\r\n\r\n\treturn 'http://192.168.0.43/ed2k.php?cat=' + cat + '&post=' + encodeURIComponent(window.location) + '&ed2k=' + links;\r\n\t//return emuleUrl +'ed2k.php?cat=' + cat + '&post=' + encodeURIComponent(window.location) + '&ed2k=' + links;\r\n}", "function InsertAnchorLink() {\r\n var selectedField = RTE.Canvas.currentEditableRegion();\r\n var anchorTags = selectedField.getElementsByTagName(\"ins\");\r\n var anchorList = \"\";\r\n //This loop creates an Array that we pass into the dialog window\r\n for (i = 0; i < anchorTags.length; i++) {\r\n if (anchorTags[i].id && (anchorTags[i].id.length > 0))\r\n anchorList = anchorList + anchorTags[i].id + \",\";\r\n }\r\n anchorList = anchorList.substring(0, anchorList.length - 1);\r\n var options = SP.UI.$create_DialogOptions();\r\n var selectedText = getSelectedText();\r\n\r\n options.title = \"Please select an anchor\";\r\n options.width = 400;\r\n options.height = 200;\r\n options.y = getTop(200);\r\n\r\n options.args =\r\n {\r\n selectedText: selectedText,\r\n anchorList: anchorList\r\n };\r\n options.url = \"/_layouts/BeenJammin.SharePoint.CustomRibbonActions/AnchorLinkDialog.aspx\";\r\n options.dialogReturnValueCallback = Function.createDelegate(null, AnchorLinkCloseCallback);\r\n SP.UI.ModalDialog.showModalDialog(options);\r\n\r\n}", "function setUrlAdr(link) {\n //url_adr = link.onclick;\n if (link.onclick !== null) { url_adr = link.onclick.toString().split(\"'\")[1]; }\n else {url_adr = link.href.toString().split(\"#\")[1];}\n}", "function g_link(template, id) {\r\n return \"/\" + template.id + \"/\" + id;\r\n}", "static createLinkButton(tar, url = 'none', text, order = 0) {\n // Create the button\n const button = document.createElement('a');\n // Set up the button\n button.classList.add('mp_button_clone');\n if (url !== 'none') {\n button.setAttribute('href', url);\n button.setAttribute('target', '_blank');\n }\n button.innerText = text;\n button.style.order = `${order}`;\n // Inject the button\n tar.insertBefore(button, tar.firstChild);\n }", "function ISSUE_ELEMENT_LINK$static_(){IssuesPanelBase.ISSUE_ELEMENT_LINK=( IssuesPanelBase.ISSUE_BLOCK.createElement(\"link\"));}", "function addURL() {\n var url = companyInfo['url'];\n var shortURL = url.replace('https://www.linkedin.com/', '');\n $('#company-linkedin').val(shortURL);\n}", "addSingleLinkFromUrl(sourceItemUrl, targetListName, targetItemId, tryAddReverseLink = false) {\r\n const query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".AddSingleLinkFromUrl\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemUrl: sourceItemUrl,\r\n TargetItemID: targetItemId,\r\n TargetListName: targetListName,\r\n TryAddReverseLink: tryAddReverseLink,\r\n }),\r\n });\r\n }", "function _adminLink(href, table, id, callback, anchor) {\n anchor = _createElement('a');\n if (id) anchor.id = table + id;\n // href will always be appended with id\n anchor.href = href + id;\n _setInnerHTML(anchor, table);\n if (callback) gU.on(anchor, 'click', callback);\n return anchor;\n }", "function addIDandSelfLink(req, item){\n item.id = item[Datastore.KEY].id;\n item.self = \"https://\" + req.get(\"host\") + req.route.path + \"/\"+ item.id;\n return item;\n}", "function linkHandler ( info, tab ) {\n sendItem( { 'message': info.linkUrl } );\n}", "function insertLink(nodeType) {\n return new prosemirrorMenu.MenuItem({\n title: \"Insert link\",\n label: \"Page Link\",\n // enable: function enable() { return hasPages },\n run: function run(state, _, view) {\n var attrs = null;\n if (state.selection instanceof prosemirrorState.NodeSelection && state.selection.node.type == nodeType) {\n attrs = state.selection.node.attrs;\n }\n openPrompt({\n title: \"Insert page\",\n fields: {\n pageLink: new TextField({\n name: \"search-page\",\n label: \"Search page\",\n required: false,\n autocomplete: true,\n value: attrs && attrs.href\n }),\n externalLink: new TextField({\n label: \"External URL\",\n required: false,\n value: attrs && attrs.href\n }),\n text: new TextField({\n label: \"Text\",\n required: false,\n value: attrs && attrs.text\n }),\n title: new TextField({\n label: \"Description\",\n required: false,\n value: attrs && attrs.title\n }),\n target: new SelectField({\n label: \"Open target\",\n required: false,\n options: [\n { value: '', label: 'default' },\n { value: '_blank', label: '_blank' },\n { value: '_self', label: '_self' },\n { value: '_parent', label: '_parent' },\n { value: '_top', label: '_top' },\n ]\n }),\n },\n callback: function callback(attrs) {\n const schema = view.state.schema;\n attrs.href = attrs.externalLink ? attrs.externalLink : attrs.pageLink;\n const node = schema.text(attrs.text, [schema.marks.link.create(attrs)])\n view.dispatch(view.state.tr.replaceSelectionWith(node, false));\n view.focus();\n }\n });\n }\n })\n}", "function create_link(link, number) {\n let a = document.createElement('a');\n \n a.setAttribute('href', link);\n a.setAttribute('target', 'blank');\n a.innerHTML = `# ${number.toString().padStart(5, '0')}`;\n\n return a;\n }", "function externalLink(service, link, linkName) {\n console.log(service + link + linkName);\n if (link !== null && link !== \"\") {\n return `<a href=\"${service}${link}\">${linkName}</a>`;\n } else {\n return \"\";\n }\n}", "function modifyLink() {\n\tvar object = document.getElementById(\"Radicado\");\n\tvar ticket = document.getElementById(\"Ticket\");\n\tticket.value = \"http://jvargas:8080/LabelGenerator/view/rotuloFrames.jsp?params=Radicado=\"\n\t\t\t+ object.value;\n\tdocument.getElementById(\"LINK_Ticket\").href = ticket.value;\n}", "function setLibraryHTML(libraryUrlPattern, isbn, title, linktext, color) {\r\n\tvar splLinkyDiv = document.getElementById('splLinkyLibraryHTML');\r\n\tif (splLinkyDiv == null) { return; }\r\n\r\n\tvar link = document.createElement('a');\r\n\tlink.setAttribute('title', title );\r\n\tlink.setAttribute('href', libraryUrlPattern+isbn);\r\n\tlink.setAttribute('target', \"_blank\");\r\n\tlink.style.color = color;\r\n\r\n\tvar label = document.createTextNode( linktext );\r\n\tlink.appendChild(label);\r\n\r\n\t//append to existing content\r\n\tsplLinkyDiv.appendChild(link);\r\n\tsplLinkyDiv.appendChild(document.createElement('br'));\r\n}", "function createButton(linktext, attachE, actionFunc, classN){\n\tvar currentView = document.getElementById('frontend_view_selector').className;\n\tvar hreflink;\t\n\tvar morelink = document.createElement(\"a\");\n\tmorelink.style.display = 'inline';\n\tvar text = document.createTextNode(linktext);\n\tmorelink.className=classN;\t\n\tif(currentView == 'upcoming'){\n\t\threflink = \tdocument.getElementById('todayview').childNodes[0].href;\n\t} else {\n\t\threflink = '#';\t\n\t\tmorelink.onclick = actionFunc;\n\t}\t\n\tmorelink.href = hreflink;\n\tmorelink.appendChild(text);\n\tattachE.appendChild(morelink);\n}", "function drawLink(editor) {\n var cm = editor.codemirror;\n var stat = editor.getCMTextState(cm);\n //var options = editor.options;\n var url = \"http://\";\n _replaceSelection(cm, stat.link, insertTexts.link, url);\n}", "function createLink(start, end){\n startId = \"tool_\" + start;\n endId = \"tool_\" + end;\n if(!document.getElementById(\"ele_\"+start)){\n addToCanvas(document.getElementById(startId));\n }\n if(!document.getElementById(\"ele_\"+end)){\n addToCanvas(document.getElementById(endId));\n }\n // link;\n jsPlumb.connect({\n uuids: [\"ele_\" + start + \"_output\", \"ele_\" + end + \"_input\"],\n });\n}", "createShortenedListURL(params) {\n return ApiService.post('/link', { url: params.url });\n }", "function generate_link()\n{\n var id_value;\n\n var sId = $(\"Ecom478\").val();\n // var sId2 = $(\"Ecom479\").val()\n //if(!sId1)\n //sId.setAttribute.('href', 'http://localhost:8080/home/branches/?Id='+sId);\n document.getElementById(\"Ecom478\").href = \"http://localhost:8080/home/branches/?Id=\"+sId;\n}", "link(cell){\n if (cell == null ||cell == undefined ) return ;\n if (this.linked(cell)) return ;\n this.linkIds.push(cell.id) ;\n this.links[cell.tag] = cell ;\n cell.link(this) ;\n }", "function eLink(db,nm) {\nel = document.createElement(\"a\");\nel.setAttribute(\"target\",\"_blank\");\ndbs = new Array(\"http://www.wowarmory.com/search.xml?searchType=items&searchQuery=\",\"http://www.wowhead.com/?search=\",\"http://www.thottbot.com/?s=\",\"http://wow.allakhazam.com/search.html?q=\");\ndbTs = new Array(\"Armory\",\"Wowhead\",\"Thottbot\",\"Allakhazam\");\ndbHs = new Array(\"&real; \",\"&omega; \",\"&tau; \",\"&alpha;\");\nel.href = dbs[db]+nm;\nel.setAttribute(\"title\",dbTs[db]);\nel.innerHTML = dbHs[db];\nreturn el;\n}", "function buildLink(callback){\n var floatingPanel = document.createElement('a');\n var panelStyle = 'display:none; position:fixed;z-index:9999999;top:10px;width:200px;left:50%;margin-left:-100px;font-family:Helvetica;color:#ffffff;background-color:#F37A1F; text-decoration:none; text-align:center; box-shadow:0px 2px 10px #999999; border-radius:4px; ';\n floatingPanel.setAttribute('href', url());\n floatingPanel.setAttribute('style', panelStyle);\n floatingPanel.setAttribute('id', 'clickPanel');\n floatingPanel.setAttribute('target','_blank');\n var linkHeader = document.createElement('h3');\n linkHeader.setAttribute('style','line-height:40px; text-decoration:none; font-size:18px;');\n var linkText = document.createTextNode('Track Shipments');\n floatingPanel.appendChild(linkHeader);\n linkHeader.appendChild(linkText);\n document.body.appendChild(floatingPanel);\n callback();\n}", "_onClickUrl(urlLink) {\n //Alert.alert(\"clicked\");\n Linking.openURL(\"http://\"+urlLink);\n \n }", "function setLink(e, attr, nv){\n e.attr(vars.link, e.attr(attr));\n e.attr(attr, nv); // Absolute URL\n setHTTPStatus(e.attr(vars.id), '0');\n getHTTPStatus(e.attr(vars.id), nv);\n}", "function createLink(el) {\n if (el.tagName.toLowerCase() === 'A') return;\n\n const url = $('h2 a', el.parentNode).first().attr('href');\n $(el.parentNode).append(`<a href=\"${url}\" class=\"${el.className}\">`);\n\n // Remove linked Children\n $('a', el).each((index, item) => {\n const text = $(item).html();\n $(item).after(text);\n item.remove();\n });\n\n // Create Link Element\n let link = $('a.content', el.parentNode);\n link.html($(el).html());\n $(el).remove();\n }", "function buildLink(xx,yy,ii,jj,kk,ll,colonyData){\r\n\tgetCell(xx,yy,ii,jj).innerHTML = createLink(constructionUrl(kk,ll,colonyData),getCell(xx,yy,ii,jj).innerHTML);\r\n}", "function updateLink() {\n const url = urlInput.value;\n const name = nameInput.value;\n editBookmark({url, name, key}, () => {\n renderBookmarks(pagination.currentPage);\n cancelEdit();\n });\n }", "function CreateEraLink(current_window, current_document)\r\n\t{\r\n\t\tvar eraLink= GetEraDomain(current_window) + \"?\";\r\n\t\tif (current_window.era_rc != null && current_window.era_rc[\"ContentId\"]) \r\n\t\t{\r\n\t\t\teraLink += (\"ContentId=\" + current_window.era_rc[\"ContentId\"]);\r\n\t\t} else {\r\n\t\t\teraLink += (\"ContentId=\" + GetTelephonyContentId(current_window));\r\n\t\t}\r\n\t\teraLink += (\"&\");\r\n\t\teraLink += (\"numrequests=1\");\r\n\t\teraLink += (\"&\");\r\n\t\teraLink += (\"req1=\" + GetContentType(current_window) + \"||\");\r\n\t\teraLink += (GetEraMaxItems(current_window)+ \"|\");\r\n\t\teraLink += (\"SortBy:\" + GetEraSortType(current_window));\r\n\t\teraLink += (\"&\");\r\n\t\teraLink += (\"OutputType=html\");\r\n\t\t\t\r\n\t\tDisplayEraFrame(eraLink, current_document, current_window);\r\n\t\tcurrent_window.era_rc = null;\r\n\t}" ]
[ "0.73390245", "0.7222045", "0.7190175", "0.7144045", "0.7133425", "0.71167755", "0.7107103", "0.69758093", "0.69573075", "0.6913089", "0.68788207", "0.68554854", "0.68406504", "0.6840541", "0.6838247", "0.6837062", "0.68068236", "0.6756413", "0.6743228", "0.674088", "0.6729427", "0.67280084", "0.6709199", "0.6673367", "0.66709405", "0.6647237", "0.6627785", "0.659257", "0.65921164", "0.658919", "0.6572899", "0.6534373", "0.65204847", "0.6518852", "0.64958566", "0.6495368", "0.648863", "0.64813745", "0.6476109", "0.6462401", "0.64493346", "0.64475983", "0.6447061", "0.64394015", "0.64297277", "0.6419476", "0.6393453", "0.63915104", "0.63858926", "0.6383024", "0.63822013", "0.63738745", "0.6365062", "0.6363982", "0.63590056", "0.634982", "0.63373303", "0.63334316", "0.6324845", "0.6324504", "0.6320562", "0.6318767", "0.63179445", "0.631259", "0.6312254", "0.6309305", "0.6298409", "0.62843347", "0.6276915", "0.6269795", "0.6259384", "0.625848", "0.62579405", "0.6256796", "0.6235862", "0.6218929", "0.62189084", "0.62113696", "0.62068146", "0.6203374", "0.6195275", "0.61928064", "0.61866814", "0.61854225", "0.61741525", "0.6168146", "0.6167955", "0.6164257", "0.6164176", "0.61605084", "0.6158039", "0.61533606", "0.61485547", "0.6145346", "0.6141885", "0.61369824", "0.6136446", "0.61222583", "0.61205584", "0.61198646" ]
0.64295596
45
This component is showing if the API is not responding on requests.
render() { return ( <Row className="show-grid"> <Col md={12}> <div className="header"> <h2> APIet svarer ikke </h2> </div> <div className="test row-info" style={{marginTop: '2em'}}> <p>APIet svarte dessverre ikke på forespørselen. Vennligst prøv å <a onClick={() => window.location.reload(true)}>oppdater siden.</a></p> <p>Hvis ikke det fungerte, vennligst gi beskjed til administrator.</p> <p>Er du en <b>utvikler</b>? Har du husket å starte APIet?</p> </div> </Col> </Row> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function errorMessagePullingDataFromAPI(){\n\t\t$errorLoadingAPI.text(\"Error pulling all the data from the API\");\n\t}", "handleAPIFailure(requestedLocation) {\n this.showingWeatherForRef.current.innerHTML = requestedLocation + \" was not found\";\n }", "function handleRequestError() {\n qs(\"main\").classList.add(\"hidden\");\n qs(\"footer\").classList.add(\"hidden\");\n let buttons = qsa(\"button\");\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].disabled = true;\n }\n id(\"error-msg\").classList.remove(\"hidden\");\n }", "function showAPICallFailure(data, msg){\n\t\t\t\tlogger.debug(\"showAPICallFailure\", data);\n\t\t\t\tlpChatShowView(lpCWAssist.lpChatMakeOfflineScreenHtml(msg), true);\n\t\t\t\tshowChatWizContainer();\n\t\t\t}", "function checkAPI(result) {\n let isAPILiveUp = result === undefined;\n writeError(1, `API may be down, or check your connection.`);\n}", "onRequestError(status, response) {\n /* Cancel the slow load timer */\n clearTimeout(this.loadTimer);\n clearTimeout(this.timeoutTimer);\n if (this.attempts <= 3 && status !== 404) {\n /* Up to 3 attempts, retry the loading process automatically. */\n this.loadingScreen.updateProgress(RoKA.LoadingState.RETRY);\n this.performRequest();\n }\n else {\n /* We have tried too many times without success, give up and display an error to the user. */\n this.loadingScreen.updateProgress(RoKA.LoadingState.ERROR);\n switch (status) {\n case 0:\n new RoKA.ErrorScreen(RoKA.Application.commentSection, RoKA.ErrorState.BLOCKED);\n break;\n case 404:\n new RoKA.ErrorScreen(RoKA.Application.commentSection, RoKA.ErrorState.NOT_FOUND);\n break;\n case 503:\n case 504:\n case 520:\n case 521:\n new RoKA.ErrorScreen(RoKA.Application.commentSection, RoKA.ErrorState.OVERLOAD);\n break;\n default:\n new RoKA.ErrorScreen(RoKA.Application.commentSection, RoKA.ErrorState.REDDITERROR, response);\n }\n }\n }", "function didNotFetch() {\n return { type: FAILED_FETCH };\n}", "onNoData() {\n this.setState({ error: 'No Data Found', loading: false });\n\n }", "static failedGet() {\n console.log('failed loading')\n const refresh = '<a class=\"refreshpage\" href=\".\">refresh page</a>'\n $('#main').html('Oops, something went wrong, make sure you are online.<br>' + refresh);\n }", "isServerUnavailableError(error) {\n if (error.message && (error.message.indexOf('NetworkError') > -1 || error.message.indexOf('Failed to fetch') > -1 || (error.statusCode && (error.statusCode === '400' || error.statusCode === '503')))) {\n return true;\n }\n return false;\n }", "function setApiError() {\n apiError(true);\n}", "test_good_connection() {\n axios.get(\"https://protected-ravine-04165.herokuapp.com/health\")\n .then((response) => {\n if(response.data === \"Great connection\") {\n console.log(\"TEST: React App has good connection to API - PASSED\");\n } else {\n console.log(\"TEST: React App has good connection to API - FAILED\");\n }\n \n }).catch(() => {\n console.log(\"TEST: React App has good connection to API - FAILED\");\n });\n }", "notRecieved(error) {\n console.log(\n \"API ERROR (No Response):\",\n error.config.method,\n error.config.url\n );\n return Promise.reject({\n msg: \"Could not connect to the API server. Please try again later\",\n status: 521,\n error\n });\n }", "function showNetworkTimeout() {\n message.error('网络超时', 1.5);\n return false;\n}", "function unableToResolve() {\n console.log(\"WORKER: fetch request failed in both cache and network.\");\n return new Response(errorText, {\n status: 503,\n statusText: \"Service Unavailable\",\n headers: new Headers({\n \"Content-Type\": \"text/html; charset=utf-8\",\n }),\n });\n }", "function displayAPIError(error) {\n console.log(error)\n}", "_warnPrivateAPIAccess(apiName){if(this._warnPrivateAPIAccessAsyncEnabled){console.warn(`Accessing private API (${apiName})!`)}}", "function handle404(request, response) {\n response.status(404).send(\"No Api found! Try again.\");\n}", "function gbRequestDidFail ( errorCode, errorMessage )\n{\n\ttoggleRefresh ();\n}", "componentDidMount() {\n this.setState({ isLoading: true });\n\n fetch(API + DEFAULT_QUERY)\n .then(response => {\n if (response.ok) {\n return response.json();\n } else {\n throw new Error(\"Coudn't connect to API ...\");\n }\n })\n .then(response => this.setState({\n data: response.data, \n isLoading:false\n }))\n .catch(error => this.setState({ error, isLoading: false }));\n }", "function apiLoadError() {\n var errorMsg = \"AJAX: API Load Error. Please reload the page\";\n $('#linkError').append(errorMsg);\n }", "failure(_resp) {\n // server didn't respond, likely network issue.. retry.\n if (_resp.X.status === 0) {\n console.warn('Server Connection Lost: Reconnecting...');\n }\n else {\n console.error('Transporter was unable to complete the synchronization request.');\n }\n Queue.push(() => {\n this.busy = false;\n });\n window.location.reload(true);\n }", "function checkIsConnected() {\r\n if (_connectionState != Labs.ConnectionState.Connected) {\r\n throw \"API not initialized\";\r\n }\r\n }", "function displayError() {\n\t\t// Hide loading animations\n\t\tdocument.getElementById(\"loadingmeaning\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadinggraph\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadingcelebs\").style.display = \"none\";\n\t\t\n\t\t// Display error at bottom of the page\n\t\tdocument.getElementById(\"errors\").innerHTML =\n\t\t\t\"Sorry, but an error occured during your server request.\";\n\t}", "ajaxError() {\n this.loaderContent.hide();\n }", "function _failedReq() {\n\t\t\t\t\t\tif(idataObj.hasOwnProperty('socket')) {\n\t\t\t\t\t\t\tidataObj.socket = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//logger.error(JSON.stringify(idataObj));\n\t\t\t\t\t\tif(idataObj.offLineRequest == true) {\n\t\t\t\t\t\t\tdbStore.redisConnPub.publish('FAILURE_DAEMON', JSON.stringify(idataObj));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(socket) {\n\t\t\t\t\t\t\tidataObj.socketId = socket.id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "function displayError(ioId, responseObject) {\n Y.log(\"Could not load the databases\", \"error\");\n Y.log(\"Status code message: [0]\".format(responseObject.statusText), \"error\");\n loadingPanel.hide();\n MV.showAlertDialog(\"Could not load collections! Please check if the app server is running. Status Text: [0]\".format(responseObject.statustext), MV.warnIcon);\n }", "function _noconn()\n\t{\n\t\tUTILS.msgbox(\"You do not have a good enough signal to complete the request. Please try again later.\", \"No Connection\");\n\t}", "getGraphics() {\n fetch('http://localhost:4200/api/Graphics')\n .then(res => res.json())\n .then(data => {\n if(data.code === '404') {\n this.setState({\n isGetting: false,\n })\n } else {\n this.setState({\n isGetting: true,\n Graphics: data,\n })\n }\n })\n .catch(error => {\n console.log(error)\n })\n }", "function requestFailed(response) {\n console.log(response);\n if (response.status == '400') {\n notificationService.displayError(response.data.Message);\n console.log(response.data);\n }\n else\n console.log(response.statusText);\n }", "function dataNotLoaded(request, text, error) {\n console.error('You fucked up.');\n}", "response() {\n throw new Error('Not implemented');\n }", "test_sentimet_blank() {\n axios.get(\"https://protected-ravine-04165.herokuapp.com/sentiment/apple\")\n .then((response) => {\n if(response.data.length > 5) {\n console.log(\"TEST: API /sentiment/apple returns data - FAILED\");\n } else {\n console.log(\"TEST: API /sentiment/apple returns data - PASSED\");\n }\n \n }).catch(() => {\n console.log(\"TEST: API /sentiment/apple returns data - PASSED\");\n });\n }", "static get NOT_OWNED() { return 200; }", "weatherFail() {\n this.setState({\n error: 'Location not found!',\n loading: false\n })\n }", "function checkForApiFail () {\r\n console.log(\"checkForApiFail runs\")\r\n if ( gmail.get.user_email === undefined ) { // test all of the gmail API requirements \r\n emo.gmailApiWorks = false;\r\n }\r\n else {\r\n emo.gmailApiWorks = true;\r\n };\r\n\r\n}", "function onFailure(err) {\n onTimelyResponse(spec.code);\n Object(__WEBPACK_IMPORTED_MODULE_11__utils_js__[\"logError\"])(\"Server call for \".concat(spec.code, \" failed: \").concat(err, \". Continuing without bids.\"));\n onResponse();\n }", "function checkAPIRunning() {\n $.ajax({\n url: \"../HelloWorldAPI/api/Hello/GetHello/\",\n dataType: 'json',\n success: function (data) {\n if (data != null && data.greeting === \"Hello World\") {\n $(\"#APIStatusLabel\").text(\"Running\").css(\"color\", \"green\");\n }\n else {\n $(\"#APIStatusLabel\").text(\"Not Running\").css(\"color\", \"red\");\n }\n },\n error: function (data) {\n $(\"#APIStatusLabel\").text(\"Not Running\").css(\"color\", \"red\");\n\n }\n });\n}", "isNetworkLoading() {\n return this.getNetworkState() === 'loading'\n }", "function noConnectionError(list) {\n list.append(\n '<li class=\"disabled\">' +\n '<p>Content not available while offline.</p>' +\n '<p>Check your connection and try again.</p>' +\n '</li>',\n );\n }", "checkResponse (resp, skipNote) {\n if (!resp.requestSuccessful || !resp.ok) {\n if (this.user.inited && !skipNote) this.notify(ntfn.make('API error', resp.msg, ntfn.ERROR))\n return false\n }\n return true\n }", "isBusy () {\n // return <Boolean>\n console.log(\"isBusy called\")\n }", "onTransportError() {\n if (this.status === _UAStatus.STATUS_USER_CLOSED) {\n return;\n }\n this.status = _UAStatus.STATUS_NOT_READY;\n }", "function checkError(ajax) {\n\t\tif (ajax.status != \"200\") {\n\t\t\tif (ajax.status != \"410\") {\n\t\t\t\tdocument.getElementById(\"errors\").innerHTML = \"Error Message: \" + ajax.statusText;\n\t\t\t}\n\t\t\tvar loadingGifs = document.getElementsByClassName(\"loading\");\n\t\t\tfor (var i = 0; i < loadingGifs.length; i++) {\n\t\t\t\tloadingGifs[i].style.display = \"none\";\n\t\t\t}\n\t\t\tif (ajax.status == \"410\") {\n\t\t\t\tdocument.getElementById(\"nodata\").style.display = \"block\";\n\t\t\t}\n\t\t\tdocument.getElementById(\"currentTemp\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"slider\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"buttons\").style.display = \"none\";\n\t\t} else {\n\t\t\tdocument.getElementById(\"nodata\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"currentTemp\").style.display = \"block\";\n\t\t\tdocument.getElementById(\"slider\").style.display = \"block\";\n\t\t\tdocument.getElementById(\"buttons\").style.display = \"block\";\n\t\t}\n\t}", "function checkError() {\n if (err && !err.message.match(/response code/)) {\n return when().delay(1000); // chill for a second\n }\n }", "function onFailGrabUpdate(msg, req, res) {\n res.json({\n result: false,\n 'msg': msg\n });\n}", "function ajax_error(error, status, request){\n Vibe.vibrate('long'); \n var errMsg = 'The ajax request with \"'+request+'\" failed with status ' +status+ ': ' + error;\n console.log(errMsg);\n var errWind = new UI.Window();\n var text = new UI.Text({\n position: new Vector2(0, 0),\n size: new Vector2(144, 168),\n text: errMsg,\n font:'gothic-14',\n color:'white',\n textOverflow:'wrap',\n textAlign:'center',\n backgroundColor:'black'\n });\n errWind.add(text);\n errWind.show();\n}", "function apiFail(thisres){\n console.log(thisres);\n }", "function onComponentUpdate() {\n if (application.get().code === 500) {\n // manually set code, stay failed\n return;\n }\n\n let starting = 0;\n let error = 0;\n let ready = 0;\n let total = 0;\n _.forEach(components, c => {\n if (c.componentName === 'Linkurious') { return; }\n const code = c.get().code;\n ++total;\n if (code < 200) { ++starting; }\n if (code >= 200 && code < 300) { ++ready; }\n if (code >= 400) { ++error; }\n });\n\n if (error > 0) {\n application.set('error');\n } else if (starting > 0) {\n application.set('starting');\n } else if (ready === total) {\n application.set('initialized');\n }\n }", "stop() {\n // TODO: set error code based on error type\n this.configs.HTTPRequest\n .response.status(501)\n .json({\n data: this.data,\n error: this.error,\n model: this.model,\n });\n }", "[kServerBusy]() {\n const busy = this.serverBusy;\n process.nextTick(() => {\n try {\n this.emit('busy', busy);\n } catch (error) {\n this[kRejections](error, 'busy', busy);\n }\n });\n }", "allowApiSpinner() {\n this.allowSpinnerWhenCallingAStitchApi = true;\n }", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "get ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}", "async healthCheck() {\n let healthPage = `${this.baseUrl}:${this.port}/swagger-ui.html`;\n try {\n let httpResponse = await axios.get(healthPage, { header: { 'Content-type': 'application/json' } });\n console.log('System is running in the following address: ' + `${this.baseUrl}:${this.port}`);\n process.exit(0);\n\n } catch (error) {\n console.log('\\nSystem is not working in the address ' + `${this.baseUrl}:${this.port}`);\n console.log('\\n You can change the ip using the following command:');\n console.log('npm config set api-tests-for-waes-backend:ip <IP>');\n\n console.log('\\n You can change the ip using the following command:');\n console.log('npm config set api-tests-for-waes-backend:port <PORT>\\n');\n\n process.exit(1);\n }\n }", "handleError(error) {\n this.setState({ loading: false });\n // if a known error is returned\n if (propertyExists(error, [\"response\", \"data\"], \"object\")) {\n // deal with all errors\n const errData = error.response.data;\n // if the request is invalid\n if (errData.badRequest) {\n this.setState({\n errorMessage: \"Something was wrong about your request.\",\n initialLoad: false\n });\n }\n // if the user hasn't signed up for this position (wasn't invited)\n else if (errData.notSignedUp) {\n this.setState({\n errorMessage: \"It looks like you aren't signed up for this evaluation.\",\n initialLoad: false\n });\n }\n // any other error\n else {\n this.setErrorState();\n }\n }\n // unknown error\n else {\n this.setErrorState();\n }\n }", "async isBackendDown(){\n var aws_data = require(\"./config/AWSConfig.json\");\n var resp_flag=false;\n var request = new XMLHttpRequest(); \n await request.open('GET', aws_data.WebsitePath, true);\n request.onreadystatechange = function(){\n if (request.readyState === 4){\n if (request.status === 0) { \n resp_flag=true;\n } \n }\n else{\n }\n };\n await request.send();\n await setTimeout(() => {\n { \n if(resp_flag){\n this.setState({backend_Down_Popup:true});\n }\n else\n {\n this.setState({backend_Down_Popup:false});\n } }\n }, 2000);\n }", "function UpdateOnError(ajaxContext) {\n $(\"#Analyze\").val($(\"#Analyze\").data(\"value\"));\n window.clearInterval(intervalId);\n $(\".results\").html(\"Unfortunately your request errored out [HTTP status code \" + ajaxContext.status +\n \"]. Please retry your request.\");\n $(\"#Analyze, .demo-sample-btn\").prop(\"disabled\", false);\n}", "get ok() {\n\t\treturn this[INTERNALS$1$1].status >= 200 && this[INTERNALS$1$1].status < 300;\n\t}", "async componentDidMount() {\n try {\n const response = await axios.get(`${apiUrl}` + '/rides')\n this.setState({rides: response.data.rides})\n }\n // handle error message to user\n catch(err) {\n this.setState({flashMessage: <p>There may be a network issue...try clicking Rides again</p>})\n }\n }", "async function monitorNewComponent(component){\n const {componentUrl, componentId, componentName, requestType, payload} = component;\n let status, //Holds the current status state of each component\n componentStatus,//The corresponding network status as specified by cachet\n componentMessage, //The accompanying network status message as specified by cachet\n statusText; //The status text from the network\n\n //----------- Header for the url or API query\n \n const http = axios.create({\n headers:{\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'token': components.accessToken,\n }, timeout: 300000\n });\n \n \n /* ------------- Query the url or API and return it's current network status---------------- */\n console.log(`Status-check is now monitoring - (${componentName})`)\n\n if(requestType.toLowerCase() == 'get' || requestType.toLowerCase() == 'delete'){\n try {\n const res = await http.get(`${componentUrl}`); // \n status = res.status;\n statusText = res.statusText;\n // console.log(status);\n } catch (e) {\n status = (e.response && e.response.status) || 500;\n statusText = (e.response && e.response.statusText) || \"Server not responding\";\n // console.log(error);\n } \n } \n else if ( requestType.toLowerCase() == 'post' || requestType.toLowerCase() == 'put' ){\n try {\n const rec = await http.post(`${componentUrl}`, payload);\n status = rec.status;\n statusText = rec.statusText; \n } catch (e) {\n status = (e.response && e.response.status) || 500;\n statusText = (e.response && e.response.statusText) || \"Server not responding\";\n // console.log(error);\n } \n }\n \n\n /* ------------------ Assign Credentials Depending on network status ------------------ */\n // console.log(status);\n if ( status >= 200 && status < 400 ) { // 200 and 300 level Errors\n // console.log('gets here');\n componentStatus = 1;\n componentMessage = `The Component is Working`;\n }else if ( status === 400 || status === 401 ) {\n componentStatus =3;\n componentMessage = `The Component may not be working for everbody`;\n }else if ( status == 404 ) {\n componentStatus = 4;\n componentMessage = `The Component is not working for everybody`;\n }else{ // 500 or unknown Error\n componentStatus = 2;\n componentMessage = `The Component is experiencing some slowness`;\n }\n // console.log(componentStatus);\n\n /* -------------- Check the current network status of the component in the cachet API ----*/\n \n\n const client = axios.create({\n headers: cachetCredentials.headers\n });\n\n const response = await client.get(`${cachetCredentials.baseUrl}components/${componentId}`);\n let queryCachet = response.data.data.status;\n // console.log(`${componentName} from cachet:${queryCachet}`);\n // console.log(`${componentName} from Network:${componentStatus}`);\n\n if (componentStatus == queryCachet) return;\n\n /*----- Update the Component if the current cachet status and network status don't Match ---*/\n \n const body = {\n 'status':status,\n 'component_id': componentId,\n 'component_status': componentStatus,\n 'name': statusText,\n 'message':componentMessage\n }\n\n\n // console.log(cachetCredentials.cachetUrl, body, cachetCredentials.headers);\n\n \n try {\n await client.post(`${cachetCredentials.baseUrl}incidents`, body);\n // currentNumOfInstanceRunning--;\n // console.log('done');\n\n } catch (e) {\n // console.log(e);\n }\n }", "function noWeather() {\n app.textContent = 'Unable to get weather data at this time.';\n }", "function onConnectionLost(responseObject) {\r\n // document.getElementById(\"messages\").innerHTML += '<span>ERROR: Connection lost</span><br/>';\r\n if (responseObject.errorCode !== 0) {\r\n // document.getElementById(\"messages\").innerHTML += '<span>ERROR: ' + + responseObject.errorMessage + '</span><br/>';\r\n }\r\n}", "function showNoResults() {\n seriesFactory.getTopSeries()\n .success(function (series) {\n $scope.searchResult = series;\n })\n .error(function (error) {\n //$scope.status = 'error error error beep beep;\n });\n }", "function checkConnection() {\n var status_div = document.querySelector('#connection_status');\n\n var loading = document.createElement('i'),\n url = '/dashboard/_load/ping.php';\n\n loading.className = 'fas fa-spinner fa-spin';\n status_div.appendChild(loading);\n\n fetch(url, {\n method: 'GET',\n credentials: 'same-origin',\n cache: 'default'\n })\n .then(response => {\n clearStatus(status_div);\n\n // status needed == 200\n if( response.status == 200 || response.status == 202 ) {\n serviceIsUp(status_div);\n } else {\n serviceIsDown(status_div);\n }\n\n status_div.innerHTML = `<small>${response.statusText}</small>`;\n })\n // connection errors\n .catch(err => {\n clearStatus(status_div);\n serviceIsDown(status_div);\n status_div.innerHTML = `<small>Unreachable</small>`;\n console.error(err);\n });\n}", "function checkQuery() {\n if(window.icResponseUrl) {\n post(window.icResponseUrl, {response: JSON.stringify(window.icResponse)});\n }\n}", "handleOnUpdateResponseError(error) {\n if (error.response.status == 409) {\n Nova.error(\n this.__(\n 'Another user has updated this resource since this page was loaded. Please refresh the page and try again.'\n )\n )\n } else {\n this.handleResponseError(error)\n }\n }", "function showAPICallFailureInPopup(data, msg){\n\t\t\t\tlogger.debug(\"showAPICallFailureInPopup\", data);\n\t\t\t\tnotificationDialog.open(msg, true);\n\t\t\t}", "get ok() {\n return this.status >= 200 && this.status < 300;\n }", "getNormalResponse() {\n return \"Not implemented\";\n }", "isStatusAPICall(isLoading, serverResponse, resetDataInStore) {\n const APIStatus = {\n SUCCESS: 1,\n FAILED: 0,\n LOADING: -1,\n };\n let apiStatus = APIStatus.LOADING;\n if (!isLoading\n && serverResponse\n && serverResponse.response\n && serverResponse.status\n && serverResponse.status >= 200\n && serverResponse.status <= 300) {\n apiStatus = APIStatus.SUCCESS;\n }\n if (!isLoading\n && serverResponse\n && serverResponse.response\n && serverResponse.status\n && serverResponse.status >= 400) {\n if (serverResponse.response.message\n && typeof serverResponse.response.message === 'string') {\n showPopupAlert(serverResponse.response.message);\n if (resetDataInStore !== undefined) {\n resetDataInStore();\n }\n apiStatus = APIStatus.FAILED;\n } else {\n if (resetDataInStore !== undefined) {\n resetDataInStore();\n }\n apiStatus = APIStatus.FAILED;\n }\n }\n return apiStatus;\n }" ]
[ "0.6657675", "0.65178144", "0.64637446", "0.63949186", "0.62572837", "0.62231547", "0.6139637", "0.61231196", "0.6115831", "0.6066946", "0.6059462", "0.6044216", "0.60037094", "0.6001247", "0.5971857", "0.59173656", "0.58732873", "0.58609915", "0.5851991", "0.5835516", "0.58275986", "0.581775", "0.580626", "0.58048123", "0.58040607", "0.5802908", "0.57899505", "0.5789707", "0.5788169", "0.5773303", "0.5736702", "0.57233846", "0.57205886", "0.57147354", "0.5712939", "0.5703435", "0.5697828", "0.56935465", "0.5680824", "0.5660998", "0.56594425", "0.56430924", "0.5637414", "0.56248164", "0.560337", "0.5597859", "0.55966514", "0.5589928", "0.5585084", "0.5563094", "0.5542872", "0.5542842", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540673", "0.5540455", "0.55369574", "0.55359274", "0.55344766", "0.5524049", "0.5515408", "0.5514431", "0.5511041", "0.5506121", "0.5483867", "0.54816675", "0.5481645", "0.5472184", "0.54715043", "0.54712814", "0.54602", "0.54580885" ]
0.0
-1
eslintdisable noempty / eslintdisable strict
function max(num) { if (num.length === 0){ return undefined; } else{ let max = num[0]; let i=0; while (i < num.length) { if (max < num[i]){ max = num[i]; } i++; } return max; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function noop() { } // tslint:disable-line:no-empty", "function removeEmpty (noop) {\n return noop !== undefined\n}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty() {}", "function empty () {}", "function empty () {}", "function empty () {}", "is_empty()\n\t{\n\t\tconst { value } = this.props\n\t\treturn !value || !value.trim()\n\t}", "isLikeEmpty(inputVar) {\n if (typeof inputVar !== 'undefined' && inputVar !== null) {\n let strTemp = JSON.stringify(inputVar);\n strTemp = strTemp.replace(/\\s+/g, ''); // remove all whitespaces\n strTemp = strTemp.replace(/\\\"+/g, \"\"); // remove all >\"<\n strTemp = strTemp.replace(/\\'+/g, \"\"); // remove all >'<\n strTemp = strTemp.replace(/\\[+/g, \"\"); // remove all >[<\n strTemp = strTemp.replace(/\\]+/g, \"\"); // remove all >]<\n if (strTemp !== '') {\n return false;\n } else {\n return true;\n }\n } else {\n return true;\n }\n }", "function handleEmpty() {\n if (scope.onempty !== undefined && typeof (scope.onempty) === \"function\") {\n scope.onempty();\n }\n }", "function isemptyornull(value)\n {\n return !(typeof value === \"string\" && value.length > 0);\n }", "_isEmpty(value) {\n return _.isNil(value) || (_.isString(value) && value.trim().length === 0);\n }", "_isEmpty(value) {\n return _.isNil(value) || (_.isString(value) && value.trim().length === 0);\n }", "_isEmpty(value) {\n return _.isNil(value) || (_.isString(value) && value.trim().length === 0);\n }", "notEmpty (value, msg) {\n assert(!lodash.isEmpty(value), msg || `params must be not empty, but got ${value}`);\n }", "isEmpty() {}", "function isBlank( element, index, array) {\n return (element === \"\" || undefined); \n }", "isValueEmpty(input) {\n return input ? true : false\n }", "empty() {}", "isEmpty (param) {\n if (param == null || param === '') {\n return true\n }\n return false\n }", "function empty() {\n }", "function String$empty() {\n return '';\n }", "function String$empty() {\n return '';\n }", "function empty () {\n return !line || !line.trim()\n }", "function __isEmpty($str) {\r\n return __trim($str).length==0;\r\n}", "isEmpty (value, msg) {\n assert(lodash.isEmpty(value), msg || `params must be empty, but got ${value}`);\n }", "function empty(v) {\n return !v || !v.length;\n}", "function isEmpty(){console.log(\"ERROR\");return (wordLen === 0)}", "checkIfEmpty() {\n if (this.state.repoName === '') {\n return false\n } else {\n return true\n }\n }", "cannotBeEmpty(){\n\t\treturn this.addTest((obj) => {\n return new Validity(!!obj,\n `${this.name} cannot be empty`);\n });\n\t}", "is_empty(value) {\n return (\n (value == undefined) ||\n (value == null) ||\n (value.hasOwnProperty('length') && value.length === 0) ||\n (value.constructor === Object && Object.keys(value).length === 0)\n )\n }", "function empty(a) {\n return isNumber(a) ? 0\n : isString(a) ? ''\n : isArray(a) ? []\n : hasMethod(a, 'empty') ? a.empty()\n : isObject(a) ? {}\n : undefined;\n}", "static isEmpty(obj) {\n return Helpers.isBlank(obj) || obj === '' || (Array.isArray(obj) && obj.length === 0);\n }", "function isBlank (thing) {\n return (!thing || thing.length === 0)\n}", "isEmpty(){}", "get empty() {\n return this.addValidator({\n message: (value, label) => `Expected ${label} to be empty, got \\`${value}\\``,\n validator: value => value === ''\n });\n }", "function noempty(input_value, default_value)\n{\n if (!input_value)\n {\n return default_value;\n }\n if (input_value.length==0)\n {\n return default_value;\n }\n return input_value;\n}", "function isEmpty(){\n\n}", "function isEmpty(param) {\n if (!param || param.length === 0) {\n console.log('isEmpty');\n } else {\n console.log('isNotEmpty');\n }\n}", "function isSearchBlockEmpty(block) {\n\t return block === void 0 || block === null || block.keyword.trim() === '';\n\t}", "isEmpty() {\n }", "empty () {\n return !(this.length >= 1);\n }", "isEmpty() {\n\n }", "isEmpty() {\n\n }", "isEmpty() { }", "isEmpty(value) {\n return value == '' ? true : false;\n }", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function is_empty(str) {\r\n\treturn (!str || str.length === 0 || /^\\s*$/.test(str));\r\n}", "get nonEmpty() {\n return this.addValidator({\n message: (_, label) => `Expected ${label} to not be empty`,\n validator: value => value !== ''\n });\n }", "function emptyString (data) {\n return data === '';\n }", "isEmpty () {\n return (!this || this.length === 0 || !this.trim());\n }", "function isEmpty(input) {\n\treturn !input.replace(/^\\s+/g, '').length;\n}", "function is_Blank(input) {\n return input === \"\";\n}", "function test(o0)\n{\n try {\nthis.o649 = 1;\n}catch(o6.o14(o24.includes(\"\", 26), \"a non-empty string includes the empty string even at the end\")){}\n}", "function empty(S) {\n return refinement(S, `${S.type} & Empty`, value => {\n return value.length === 0;\n });\n}", "function empty(S) {\n return refinement(S, `${S.type} & Empty`, value => {\n return value.length === 0;\n });\n}", "validateEmptyFields(firstName,lastName,address,city,state,property,description,pricing){\n if (validator.isEmpty(firstName,lastName,address,city,state,property,description,pricing)){\n return 'This field is required';\n }\n return false;\n }", "_isEmpty() {\n return this.modelValue?.length === 0;\n }", "function notEmpty(value) {\n return isDefined(value) && value.toString().trim().length > 0;\n}", "function isEmpty( element ) {\n\tif( element.length < 1 ) {\n\t\treturn \"This field is required.\";\n\t}\n\treturn \"\";\n}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}" ]
[ "0.65947914", "0.63063747", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.6297361", "0.61087763", "0.61087763", "0.61087763", "0.61028343", "0.5997972", "0.59496766", "0.59474623", "0.5947393", "0.5947393", "0.5947393", "0.5915634", "0.5905962", "0.5902905", "0.5896559", "0.58925766", "0.5871597", "0.585189", "0.58480054", "0.58480054", "0.58347905", "0.5813766", "0.5798691", "0.5777679", "0.57615477", "0.5749595", "0.5747182", "0.574687", "0.574355", "0.5740814", "0.57398754", "0.57250595", "0.5723768", "0.57204205", "0.56935614", "0.5687546", "0.5671834", "0.5666297", "0.566195", "0.5657956", "0.5657956", "0.56493235", "0.56411374", "0.5630672", "0.5630672", "0.5630672", "0.5630672", "0.5630672", "0.5630148", "0.5618939", "0.56180245", "0.5615613", "0.561447", "0.5598977", "0.55951875", "0.5592134", "0.5592134", "0.55907345", "0.5581254", "0.5577623", "0.55769867", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599", "0.557599" ]
0.0
-1
Helper method to genearate fake events. Needed for some javascript heavy forms that won't work unles these events are triggered. Taken from passff
function createFakeEvent(typeArg) { if (['keydown', 'keyup', 'keypress'].includes(typeArg)) { return new KeyboardEvent(typeArg, { 'key': ' ', 'code': ' ', 'charCode': ' '.charCodeAt(0), 'keyCode': ' '.charCodeAt(0), 'which': ' '.charCodeAt(0), 'bubbles': true, 'composed': true, 'cancelable': true }); } else if (['input', 'change'].includes(typeArg)) { return new InputEvent(typeArg, { 'bubbles': true, 'composed': true, 'cancelable': true }); } else if (['focus', 'blur'].includes(typeArg)) { return new FocusEvent(typeArg, { 'bubbles': true, 'composed': true, 'cancelable': true }); } else { log.error("createFakeEvent: Unknown event type: " + typeArg); return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fakeEvent(){\n const event = document.createEvent(\"HTMLEvents\")\n event.initEvent(\"change\",false,true)\n document.getElementById(\"choixTypeMedia\").dispatchEvent(event)\n}", "function fakeEvent(el, type) {\n var event;\n\n if (document.createEvent) {\n event = document.createEvent('HTMLEvents');\n event.initEvent(type, true, true);\n } else {\n event = document.createEventObject();\n event.eventType = 'on' + type;\n }\n\n if (document.createEvent) {\n el.dispatchEvent(event);\n } else {\n el.fireEvent(event.eventType, event);\n }\n }", "function InputEvent() {\n var _this14 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n $.extend(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this14.isNativeEvent(evt)) {\n _this14.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);\n _this14.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "function generateEvent(s,args){var evt=document.createEvent(\"CustomEvent\");evt.initCustomEvent(s,false,false,args);return evt;}", "function FakeEvent(type, bubbles, cancelable, target) {\r\n\t\t this.initEvent(type, bubbles, cancelable, target);\r\n\t\t }", "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function InputEvent() {\n var _this14 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n _extends(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this14.isNativeEvent(evt)) {\n _this14.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);\n _this14.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "function i(){var t=this,n=window||s;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(n){t.isNativeEvent(n)&&e(n.target).trigger(\"input\")},misbehaves:function(n){t.isNativeEvent(n)&&(t.behavesOk(n),e(document).on(\"change.inputevent\",n.data.selector,t.fakeInputEvent),t.fakeInputEvent(n))},behavesOk:function(n){t.isNativeEvent(n)&&e(document).off(\"input.inputevent\",n.data.selector,t.behavesOk).off(\"change.inputevent\",n.data.selector,t.misbehaves)},install:function(){if(!n.inputEventPatched){n.inputEventPatched=\"0.0.3\";for(var i=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<i.length;r++){var o=i[r];e(document).on(\"input.inputevent\",o,{selector:o},t.behavesOk).on(\"change.inputevent\",o,{selector:o},t.misbehaves)}}},uninstall:function(){delete n.inputEventPatched,e(document).off(\".inputevent\")}})}", "function InputEvent() {\n var _this13 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n $.extend(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this13.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this13.isNativeEvent(evt)) {\n _this13.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this13.fakeInputEvent);\n _this13.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this13.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this13.behavesOk).off('change.inputevent', evt.data.selector, _this13.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this13.behavesOk).on('change.inputevent', selector, { selector: selector }, _this13.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "function l(){var n=this,r=window||t;o(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(t){n.isNativeEvent(t)&&e(t.target).trigger(\"input\")},misbehaves:function(t){n.isNativeEvent(t)&&(n.behavesOk(t),e(document).on(\"change.inputevent\",t.data.selector,n.fakeInputEvent),n.fakeInputEvent(t))},behavesOk:function(t){n.isNativeEvent(t)&&e(document).off(\"input.inputevent\",t.data.selector,n.behavesOk).off(\"change.inputevent\",t.data.selector,n.misbehaves)},install:function(){if(!r.inputEventPatched){r.inputEventPatched=\"0.0.3\";for(var t=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],i=0;i<t.length;i++){var a=t[i];e(document).on(\"input.inputevent\",a,{selector:a},n.behavesOk).on(\"change.inputevent\",a,{selector:a},n.misbehaves)}}},uninstall:function(){delete r.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function fixSpecialEvents(events) {\n events.forEach(name => {\n $.event.special[name] = {\n setup: function (_, ns, handle) {\n if (ns.includes(\"noPreventDefault\")) {\n this.addEventListener(name, handle, {passive: false});\n } else {\n this.addEventListener(name, handle, {passive: true});\n }\n }\n };\n });\n}", "beforeHandlers (event) {\n\n }", "function trigger_preSending()\n {\n var transobj = {funname:\"SendInvitation_ForWebPage\", param:null}; \t \n $(document.body).attr(\"fnRemoteHtmlReq-event-param\", JSON.stringify(transobj)); \n //$(document.body).trigger(\"fnRemoteHtmlReq-event\") // is it work?\n var event = document.createEvent(\"HTMLEvents\"); \n event.initEvent(\"fnRemoteHtmlReq-event\", true, false); \n document.body.dispatchEvent(event);\n }", "function makeSimulator(eventType) {\n\t return function (domComponentOrNode, eventData) {\n\t var node;\n\t if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n\t node = findDOMNode(domComponentOrNode);\n\t } else if (domComponentOrNode.tagName) {\n\t node = domComponentOrNode;\n\t }\n\t\n\t var dispatchConfig = ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType];\n\t\n\t var fakeNativeEvent = new Event();\n\t fakeNativeEvent.target = node;\n\t // We don't use SyntheticEvent.getPooled in order to not have to worry about\n\t // properly destroying any properties assigned from `eventData` upon release\n\t var event = new SyntheticEvent(dispatchConfig, ReactMount.getID(node), fakeNativeEvent, node);\n\t assign(event, eventData);\n\t\n\t if (dispatchConfig.phasedRegistrationNames) {\n\t EventPropagators.accumulateTwoPhaseDispatches(event);\n\t } else {\n\t EventPropagators.accumulateDirectDispatches(event);\n\t }\n\t\n\t ReactUpdates.batchedUpdates(function () {\n\t EventPluginHub.enqueueEvents(event);\n\t EventPluginHub.processEventQueue(true);\n\t });\n\t };\n\t}", "function EventHelper (possibleEvents) {\n }", "function fire(type) {\n if (can_fake_events()) {\n var e = make_event(type);\n\n if (D.dispatchEvent) {\n // modern browsers\n D.dispatchEvent(e);\n } else if (D.fireEvent) {\n // ie<9\n D.fireEvent('on' + type);\n } else {\n // pathological and/or old browser\n throw 'fire() failed';\n }\n } else if (D['on' + type]) {\n // browser does not support fake events, but it does have\n // a handler defined on the document, so call that instead\n D['on' + type]();\n } else {\n // don't do anything\n }\n }", "dispatch_event( evt_name ){\r\n this.dispatchEvent( new CustomEvent( evt_name, { \r\n bubbles : true, \r\n cancelable : true, \r\n composed : false,\r\n detail : { value : this.input.value }\r\n }));\r\n }", "function generateEvent(s, args) {\n \tvar evt = document.createEvent(\"CustomEvent\");\n \tevt.initCustomEvent(s, false, false, args);\n \treturn evt;\n }", "function generateEvent(s, args) {\n \tvar evt = document.createEvent(\"CustomEvent\");\n \tevt.initCustomEvent(s, false, false, args);\n \treturn evt;\n }", "function generateEvent(s, args) {\n \tvar evt = document.createEvent(\"CustomEvent\");\n \tevt.initCustomEvent(s, false, false, args);\n \treturn evt;\n }", "function E(){F=Q.props.trigger.trim().split(\" \").reduce(function(e,t){if(\"manual\"===t)return e;if(Q.props.target)switch(t){case\"mouseenter\":T(\"mouseover\",d,e),T(\"mouseout\",h,e);break;case\"focus\":T(\"focusin\",d,e),T(\"focusout\",h,e);break;case\"click\":T(t,d,e);break}else switch(T(t,c,e),Q.props.touchHold&&(T(\"touchstart\",c,e),T(\"touchend\",u,e)),t){case\"mouseenter\":T(\"mouseleave\",u,e);break;case\"focus\":T(Dt?\"focusout\":\"blur\",f,e);break}return e},[])}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function _loop_1(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target,\n bound,\n source;\n\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n } else {\n source = 'unknown.' + onproperty;\n }\n\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n\n elt = elt.parentElement;\n }\n }, true);\n };\n\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n }", "dispatch_event( evt_name ){\r\n this.dispatchEvent( new CustomEvent( evt_name, { \r\n bubbles : true, \r\n cancelable : true, \r\n composed : false,\r\n detail : { \r\n value : this.main_value,\r\n } \r\n }));\r\n }", "function makeSimulator(eventType) {\n\t return function(domComponentOrNode, eventData) {\n\t var node;\n\t if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n\t node = domComponentOrNode.getDOMNode();\n\t } else if (domComponentOrNode.tagName) {\n\t node = domComponentOrNode;\n\t }\n\t\n\t var fakeNativeEvent = new Event();\n\t fakeNativeEvent.target = node;\n\t // We don't use SyntheticEvent.getPooled in order to not have to worry about\n\t // properly destroying any properties assigned from `eventData` upon release\n\t var event = new SyntheticEvent(\n\t ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n\t ReactMount.getID(node),\n\t fakeNativeEvent\n\t );\n\t assign(event, eventData);\n\t EventPropagators.accumulateTwoPhaseDispatches(event);\n\t\n\t ReactUpdates.batchedUpdates(function() {\n\t EventPluginHub.enqueueEvents(event);\n\t EventPluginHub.processEventQueue();\n\t });\n\t };\n\t}", "function makeSimulator(eventType) {\n return function (domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = findDOMNode(domComponentOrNode);\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var dispatchConfig = ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType];\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(dispatchConfig, ReactMount.getID(node), fakeNativeEvent, node);\n assign(event, eventData);\n\n if (dispatchConfig.phasedRegistrationNames) {\n EventPropagators.accumulateTwoPhaseDispatches(event);\n } else {\n EventPropagators.accumulateDirectDispatches(event);\n }\n\n ReactUpdates.batchedUpdates(function () {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue(true);\n });\n };\n}", "function makeSimulator(eventType) {\n return function (domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = findDOMNode(domComponentOrNode);\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var dispatchConfig = ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType];\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(dispatchConfig, ReactMount.getID(node), fakeNativeEvent, node);\n assign(event, eventData);\n\n if (dispatchConfig.phasedRegistrationNames) {\n EventPropagators.accumulateTwoPhaseDispatches(event);\n } else {\n EventPropagators.accumulateDirectDispatches(event);\n }\n\n ReactUpdates.batchedUpdates(function () {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue(true);\n });\n };\n}", "function makeSimulator(eventType) {\n return function (domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = findDOMNode(domComponentOrNode);\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var dispatchConfig = ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType];\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(dispatchConfig, ReactMount.getID(node), fakeNativeEvent, node);\n assign(event, eventData);\n\n if (dispatchConfig.phasedRegistrationNames) {\n EventPropagators.accumulateTwoPhaseDispatches(event);\n } else {\n EventPropagators.accumulateDirectDispatches(event);\n }\n\n ReactUpdates.batchedUpdates(function () {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue(true);\n });\n };\n}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n document.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n document.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "function patchViaCapturingAllTheEvents() {\n eventNames.forEach(function (property) {\n var onproperty = 'on' + property;\n document.addEventListener(property, function (event) {\n var elt = event.target, bound;\n while (elt) {\n if (elt[onproperty] && !elt[onproperty]._unbound) {\n bound = global.zone.bind(elt[onproperty]);\n bound._unbound = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n });\n}", "function generateEvent(s, args) {\r\n var evt = document.createEvent(\"CustomEvent\");\r\n evt.initCustomEvent(s, false, false, args);\r\n return evt;\r\n }", "function oneTimeEventHandlers(){\n $('#add-new-bookmark').on(\"submit\",formSubmitHandler); \n $('#click-to-toggle-form').click(formToggleHandler); //\n $(\"#filter-bookmark-rating\").on(\"change\", minRatingChangeHandler)\n}", "function createFakeEvent(type, canBubble = true, cancelable = true) {\n const event = document.createEvent('Event');\n event.initEvent(type, canBubble, cancelable);\n return event;\n}", "function triggerEvents()\n{\n $(\"[data-type]\").each(function(index) {\n this.dispatchEvent(new Event('input'));\n });\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n mergeInto(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function a(e) {\n return function(t, n) {\n var o;\n h.isValidElement(t) && E(!1, \"TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.\"), \n S.isDOMComponent(t) ? o = w(t) : t.tagName && (o = t);\n var i = d.eventNameDispatchConfigs[e], a = new r();\n a.target = o, a.type = e.toLowerCase();\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var s = new x(i, g.getInstanceFromNode(o), a, o);\n // Since we aren't using pooling, always persist the event. This will make\n // sure it's marked and won't warn when setting additional properties.\n s.persist(), l(s, n), i.phasedRegistrationNames ? f.accumulateTwoPhaseDispatches(s) : f.accumulateDirectDispatches(s), \n b.batchedUpdates(function() {\n p.enqueueEvents(s), p.processEventQueue(!0);\n });\n };\n }", "fireEvent(event) {\n if (this[event]) {\n this[event]();\n }\n }", "function _trackCustomEvents () {\r\n var arrRegisteredEvents = [];\r\n\r\n objSettings.track_custom.forEach(function loop (item) {\r\n if (arrRegisteredEvents.indexOf(item.selector + item.event) === -1) {\r\n arrRegisteredEvents.push(item.selector + item.event);\r\n document.addEventListener(item.event, function onEvent (e) {\r\n var element = e.target,\r\n strEventName = '',\r\n objEventProperties = {},\r\n intAncestorLevel = 0;\r\n \r\n while (element.matches(item.selector) === false && intAncestorLevel < objSettings.bubbling_threshold) {\r\n if (element.parentElement) {\r\n element = element.parentElement;\r\n }\r\n intAncestorLevel++;\r\n }\r\n\r\n // We report only if element matches custom_event selector:\r\n if (element.matches(item.selector) === true) {\r\n // Prevent default for links & form submissions, so that event will have chance to be sent before browser redirects and cancel requests:\r\n if (element.tagName === 'A' || element.getAttribute('type') === 'submit') {\r\n e.preventDefault();\r\n }\r\n\r\n try {\r\n // event name:\r\n switch (item.name.type) {\r\n case 'attribute':\r\n if (element.hasAttribute(item.name.value) === true) {\r\n strEventName = element.getAttribute(item.name.value);\r\n }\r\n\r\n break;\r\n case 'function':\r\n if (item.name.value && typeof item.name.value === 'function') {\r\n strEventName = (item.name.value)(element);\r\n }\r\n\r\n break;\r\n case 'text':\r\n if (item.name.value) {\r\n strEventName = item.name.value;\r\n }\r\n\r\n break;\r\n }\r\n\r\n // event properties:\r\n if ('properties' in item) {\r\n switch (item.properties.type) {\r\n case 'attribute':\r\n if (element.hasAttribute(item.properties.value) === true) {\r\n objEventProperties = JSON.parse(element.getAttribute(item.properties.value));\r\n }\r\n\r\n break;\r\n case 'function':\r\n if (item.properties.value && typeof item.properties.value === 'function') {\r\n objEventProperties = (item.properties.value)(element);\r\n }\r\n\r\n break;\r\n case 'text':\r\n if (item.properties.value) {\r\n objEventProperties = JSON.parse(item.properties.value);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (strEventName) {\r\n providers.forEach(function _trackEvent (provider) {\r\n if (typeof provider.obj.trackEvent === 'function') {\r\n provider.obj.trackEvent(strEventName, objEventProperties, function onEvent () {\r\n if (element.tagName === 'A') {\r\n var strHref = element.getAttribute('href'),\r\n strTarget = element.getAttribute('target');\r\n\r\n strHref && strHref.length > 0 && (strTarget ? window.open(strHref, strTarget) : document.location.href = strHref);\r\n }\r\n else if (element.getAttribute('type') === 'submit') {\r\n return true;\r\n //helpers.findParentNode(element, 'FORM').submit();\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n catch (e) {\r\n console.warn(config.dictionary.trackEventFailed);\r\n }\r\n }\r\n }, false);\r\n }\r\n });\r\n}", "function makeSimulator(eventType) {\n\t return function (domComponentOrNode, eventData) {\n\t var node;\n\t !!React.isValidElement(domComponentOrNode) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;\n\t if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n\t node = findDOMNode(domComponentOrNode);\n\t } else if (domComponentOrNode.tagName) {\n\t node = domComponentOrNode;\n\t }\n\t\n\t var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];\n\t\n\t var fakeNativeEvent = new Event();\n\t fakeNativeEvent.target = node;\n\t fakeNativeEvent.type = eventType.toLowerCase();\n\t\n\t // We don't use SyntheticEvent.getPooled in order to not have to worry about\n\t // properly destroying any properties assigned from `eventData` upon release\n\t var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);\n\t // Since we aren't using pooling, always persist the event. This will make\n\t // sure it's marked and won't warn when setting additional properties.\n\t event.persist();\n\t _assign(event, eventData);\n\t\n\t if (dispatchConfig.phasedRegistrationNames) {\n\t EventPropagators.accumulateTwoPhaseDispatches(event);\n\t } else {\n\t EventPropagators.accumulateDirectDispatches(event);\n\t }\n\t\n\t ReactUpdates.batchedUpdates(function () {\n\t EventPluginHub.enqueueEvents(event);\n\t EventPluginHub.processEventQueue(true);\n\t });\n\t };\n\t}", "function makeSimulator(eventType) {\n return function (domComponentOrNode, eventData) {\n var node;\n !!React.isValidElement(domComponentOrNode) ? \"development\" !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = findDOMNode(domComponentOrNode);\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n fakeNativeEvent.type = eventType.toLowerCase();\n\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);\n // Since we aren't using pooling, always persist the event. This will make\n // sure it's marked and won't warn when setting additional properties.\n event.persist();\n _assign(event, eventData);\n\n if (dispatchConfig.phasedRegistrationNames) {\n EventPropagators.accumulateTwoPhaseDispatches(event);\n } else {\n EventPropagators.accumulateDirectDispatches(event);\n }\n\n ReactUpdates.batchedUpdates(function () {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue(true);\n });\n };\n}", "function fakeClick(event, anchorObj) {\n if(anchorObj.click) {\n anchorObj.click()\n }\n else if(document.createEvent) {\n if(event.target !== anchorObj) {\n var evt = document.createEvent(\"MouseEvents\");\n evt.initMouseEvent(\"click\", true, true, window,\n 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n var allowDefault = anchorObj.dispatchEvent(evt);\n }\n }\n}", "onClickChange(value) {\r\n if (isObject(this.events) && value == this.events.click) {\r\n console.error(value);\r\n throw new Error(\"Attempt to override Forms.onClick callback with Forms.events.click will lead to infinite loop!\");\r\n }\r\n }", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function makeSimulator(eventType) {\n return function(domComponentOrNode, eventData) {\n var node;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = domComponentOrNode.getDOMNode();\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(\n ReactBrowserEventEmitter.eventNameDispatchConfigs[eventType],\n ReactMount.getID(node),\n fakeNativeEvent\n );\n assign(event, eventData);\n EventPropagators.accumulateTwoPhaseDispatches(event);\n\n ReactUpdates.batchedUpdates(function() {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue();\n });\n };\n}", "function hookform()\n\t{\n\t\tvar disablebtn = document.getElementById(\"disable\");\n\t\tdisablebtn.addEventListener(\"click\",\n\t\t\t\tfunction(event)\n\t\t\t\t{\n\t\t\t disable();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t);\n\t\t\n\t\tvar capturebtn = document.getElementById(\"capture\");\n\t\tcapturebtn.addEventListener(\"click\",\n\t\t function(event)\n\t\t {\n\t\t\t capture();\n\t\t }\n\t\t );\n\t\t\n\t\t\n\t\tvar monitorbtn = document.getElementById(\"monitor\");\n\t\tmonitorbtn.addEventListener(\"click\",\n\t\t function(event)\n\t\t {\n\t\t\t monitor();\n\t\t }\n\t\t);\n\t\t\n\t}", "function tell_to_box( tobox)\n {\n var transobj = {funname:\"setReceiptobjForInivitation_forRemoteWebpage\", param:null}; \t \n $(tobox).attr(\"fnRemoteHtmlReq-event-param\", JSON.stringify(transobj)); \n //$(tobox).trigger(\"fnRemoteHtmlReq-event\") // is it work\n var event = document.createEvent(\"HTMLEvents\"); \n event.initEvent(\"fnRemoteHtmlReq-event\", true, false); \n tobox.dispatchEvent(event);\n }", "function dispararEvento(elemento, evento){\r\n\tevento = evento.toLowerCase();\r\n\tif(ExpYes){\r\n\t\tvar evObj = document.createEventObject();\r\n\t\telemento.fireEvent(evento, evObj);\r\n\t}\r\n\telse{\r\n\t\tvar evObj = document.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent( evento.replace(\"on\",\"\"), true, true, window, 1, 12, 345, 7, 220, false, false, true, false, 0, null );\r\n\t\telemento.dispatchEvent(evObj);\r\n\t}\t\t\r\n}", "fakeTouchEvent(e) {\n return {\n identifier: -1,\n target: e.target,\n pageX: e.pageX,\n pageY: e.pageY\n };\n }", "function makeSimulator(eventType) {\n return function (domComponentOrNode, eventData) {\n var node;\n !!React.isValidElement(domComponentOrNode) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = findDOMNode(domComponentOrNode);\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n fakeNativeEvent.type = eventType.toLowerCase();\n\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);\n // Since we aren't using pooling, always persist the event. This will make\n // sure it's marked and won't warn when setting additional properties.\n event.persist();\n _assign(event, eventData);\n\n if (dispatchConfig.phasedRegistrationNames) {\n EventPropagators.accumulateTwoPhaseDispatches(event);\n } else {\n EventPropagators.accumulateDirectDispatches(event);\n }\n\n ReactUpdates.batchedUpdates(function () {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue(true);\n });\n };\n}", "function makeSimulator(eventType) {\n return function (domComponentOrNode, eventData) {\n var node;\n !!React.isValidElement(domComponentOrNode) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = findDOMNode(domComponentOrNode);\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n fakeNativeEvent.type = eventType.toLowerCase();\n\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);\n // Since we aren't using pooling, always persist the event. This will make\n // sure it's marked and won't warn when setting additional properties.\n event.persist();\n _assign(event, eventData);\n\n if (dispatchConfig.phasedRegistrationNames) {\n EventPropagators.accumulateTwoPhaseDispatches(event);\n } else {\n EventPropagators.accumulateDirectDispatches(event);\n }\n\n ReactUpdates.batchedUpdates(function () {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue(true);\n });\n };\n}", "function makeSimulator(eventType) {\n return function (domComponentOrNode, eventData) {\n var node;\n !!React.isValidElement(domComponentOrNode) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.') : _prodInvariant('14') : void 0;\n if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n node = findDOMNode(domComponentOrNode);\n } else if (domComponentOrNode.tagName) {\n node = domComponentOrNode;\n }\n\n var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = node;\n fakeNativeEvent.type = eventType.toLowerCase();\n\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);\n // Since we aren't using pooling, always persist the event. This will make\n // sure it's marked and won't warn when setting additional properties.\n event.persist();\n _assign(event, eventData);\n\n if (dispatchConfig.phasedRegistrationNames) {\n EventPropagators.accumulateTwoPhaseDispatches(event);\n } else {\n EventPropagators.accumulateDirectDispatches(event);\n }\n\n ReactUpdates.batchedUpdates(function () {\n EventPluginHub.enqueueEvents(event);\n EventPluginHub.processEventQueue(true);\n });\n };\n}", "function uueventfire(node, // @param Node: target node\r\n eventType, // @param String: \"click\", \"custom\"\r\n param) { // @param Mix(= void): param\r\n // @return Node:\r\n if (uu.event.has(node, eventType)) {\r\n\r\n var fakeEventObjectEx = {\r\n stopPropagation: uu.nop,\r\n preventDefault: uu.nop,\r\n node: node, // current target\r\n name: eventType, // event name\r\n code: 0, // 0: unknown\r\n src: node, // event source\r\n rel: node,\r\n px: 0,\r\n py: 0,\r\n ox: 0,\r\n oy: 0,\r\n type: eventType, // event type\r\n param: param\r\n };\r\n\r\n node.uuEventEvaluatorHash[eventType].forEach(function(evaluator) {\r\n evaluator.call(node, fakeEventObjectEx, true); // fromCustomEvent = true\r\n });\r\n }\r\n return node;\r\n}", "function setUpOnFocusHandlers () {\r\n\t//TODO Ver possibilidade de adequar a novo modelo de eventos\r\n\tif(getRootDocument().forms) {\r\n\t\tfor (var f = 0; f < getRootDocument().forms.length; f++) {\r\n\t\t\tif(getRootDocument().forms[f].elements) {\r\n\t\t\t\tfor (var e = 0; e < getRootDocument().forms[f].elements.length; e++) {\r\n\t\t\t\t\tif (getRootDocument().forms[f].elements[e] &&\r\n\t\t\t\t\t\t\t(getRootDocument().forms[f].elements[e].type == 'text'\r\n\t\t\t\t\t\t\t\t\t|| getRootDocument().forms[f].elements[e].type == 'textarea'\r\n\t\t\t\t\t\t\t\t\t\t|| getRootDocument().forms[f].elements[e].type == 'select-one'\r\n\t\t\t\t\t\t\t\t\t\t\t|| getRootDocument().forms[f].elements[e].type == 'select-multiple'\r\n\t\t\t\t\t\t\t\t\t\t\t\t|| getRootDocument().forms[f].elements[e].type == 'password'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| getRootDocument().forms[f].elements[e].type == 'checkbox'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| getRootDocument().forms[f].elements[e].type == 'radio'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| getRootDocument().forms[f].elements[e].type == 'file'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| getRootDocument().forms[f].elements[e].type == 'fileupload')) {\r\n\t\t\t\t\t\tif (typeof getRootDocument().forms[f].elements[e].oldOnFocus == \"undefined\"){\r\n\t\t\t\t\t\t\tgetRootDocument().forms[f].elements[e].oldOnFocus = getRootDocument().forms[f].elements[e].onfocus;\r\n\t\t\t\t\t\t\tgetRootDocument().forms[f].elements[e].onfocus = trataOnFocus;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function setFormEvents() {\n const shexgForm = document.getElementById(\"shexgform\");\n const checkButton = document.getElementById(\"checkbtn\");\n const newButtons = document.querySelectorAll(\".newButton\");\n\n for (const button of newButtons) {\n button.addEventListener(\"click\", () => {\n // Get the last input element before the \"new button\", as a template\n const lastInputInGroup = button.previousSibling;\n // Empty the input value and use a proper id/name\n const newInput = lastInputInGroup.cloneNode(true);\n newInput.value = \"\";\n\n const baseId = lastInputInGroup.getAttribute(\"id\");\n const idParts = baseId.split(\"-\");\n\n const newId = `${idParts[0]}-${\n idParts.length === 1 ? 1 : parseInt(idParts[1]) + 1\n }`;\n\n newInput.setAttribute(\"id\", newId);\n newInput.setAttribute(\"name\", newId);\n\n // Insert the new input element before the \"new button\" with the right id/name\n lastInputInGroup.parentElement.insertBefore(newInput, button);\n });\n }\n\n // Check and submit\n checkButton.addEventListener(\"click\", () => {\n if (!shexgForm.checkValidity()) {\n shexgForm.querySelector(\"[type=submit]\").click();\n }\n });\n }", "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "function initEventHandlersDev(){\n // Computer user requires keyboard presses\n document.onkeydown = respondToKeyPress;\n document.onkeyup = respondToKeyRelease;\n initTouchEventHandlers();\n // initButtonEventHandlers();\n initMobileEventHandlers();\n}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "function makeSimulator(eventType) {\n return function (domNode, eventData) {\n !!React.isValidElement(domNode) ? invariant(false, 'TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering.') : void 0;\n !!ReactTestUtils.isCompositeComponent(domNode) ? invariant(false, 'TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.') : void 0;\n\n var dispatchConfig = eventNameDispatchConfigs[eventType];\n\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = domNode;\n fakeNativeEvent.type = eventType.toLowerCase();\n\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var targetInst = getInstanceFromNode(domNode);\n var event = new SyntheticEvent(dispatchConfig, targetInst, fakeNativeEvent, domNode);\n\n // Since we aren't using pooling, always persist the event. This will make\n // sure it's marked and won't warn when setting additional properties.\n event.persist();\n _assign(event, eventData);\n\n if (dispatchConfig.phasedRegistrationNames) {\n accumulateTwoPhaseDispatches(event);\n } else {\n accumulateDirectDispatches(event);\n }\n\n ReactDOM.unstable_batchedUpdates(function () {\n // Normally extractEvent enqueues a state restore, but we'll just always\n // do that since we we're by-passing it here.\n enqueueStateRestore(domNode);\n runEventsInBatch(event, true);\n });\n restoreStateIfNeeded();\n };\n}", "function _polymorph_core() {\n //Event API. Controls all underlying events.\n\n this.guid = (count = 6, priorkeys) => {\n let pool = \"1234567890qwertyuiopasdfghjklzxcvbnm\";\n let newGuid = \"\";\n do {\n newGuid = \"\";\n for (i = 0; i < count; i++) newGuid += pool[Math.floor(Math.random() * pool.length)];\n } while (priorkeys && (priorkeys[i] ||\n (priorkeys.length != undefined && priorkeys.includes(i))\n ));\n return newGuid;\n }\n\n this.addEventAPI = (itm, errf = console.error) => {\n itm.events = {};\n itm.fire = function (e, args) {\n let _e = e.split(\",\");\n let _oe = e.split(\",\"); //original elevents\n _e.push(\"*\"); // a wildcard event listener\n _e.forEach((i) => {\n if (!itm.events[i]) return;\n //prime the ketching function with a starter object to prime it.\n let cnt = true;\n if (itm.events[i].cetches) itm.events[i].cetches.forEach((f) => {\n if (cnt != false) cnt = f(args, true, e)\n });\n //fire each event\n if (itm.events[i].events) {\n itm.events[i].events.forEach((f) => {\n if (cnt == false) return;\n try {\n result = f(args, _oe);\n if (itm.events[i].cetches) itm.events[i].cetches.forEach((f) => {\n if (cnt != false) cnt = f(result, undefined, i)\n });\n } catch (er) {\n errf(er);\n }\n\n });\n }\n if (itm.events[i].cetches) itm.events[i].cetches.forEach((f) => (f(args, false, e)));\n })\n };\n itm.on = function (e, f) {\n let _e = e.split(',');\n _e.forEach((i) => {\n if (!itm.events[i]) itm.events[i] = {};\n if (!itm.events[i].events) itm.events[i].events = [];\n itm.events[i].events.push(f);\n })\n };\n itm.cetch = function (i, f) {\n if (!itm.events[i]) itm.events[i] = {};\n if (!itm.events[i].cetches) itm.events[i].cetches = [];\n itm.events[i].cetches.push(f);\n }\n }\n\n this.addEventAPI(this);\n\n this._option = (function () {\n //snippet that pre-evaluates functions, so that we can quickly load dynmaics\n function iff(it) {\n if (typeof it == \"function\") {\n return it();\n } else return it;\n }\n\n function _option(settings) {\n let appendedElement;\n ///////////////////////////////////////////////////////////////////////////////////////\n //Create the input and register an event handler\n switch (settings.type) {\n case \"bool\":\n case \"boolean\":\n appendedElement = document.createElement(\"input\");\n appendedElement.type = \"checkbox\";\n appendedElement.addEventListener(\"input\", (e) => {\n let actualObject = iff(settings.object);\n if (typeof actualObject != \"object\") actualObject = {}; // this doesnt always work :///\n if (settings.beforeInput) settings.beforeInput(e);\n actualObject[settings[\"property\"]] = appendedElement.checked;\n if (settings.afterInput) settings.afterInput(e);\n })\n break;\n case \"textarea\":\n case \"text\":\n case \"number\":\n appendedElement = document.createElement(settings.type == \"textarea\" ? \"textarea\" : \"input\");\n appendedElement.style.display = \"block\";\n appendedElement.addEventListener(\"input\", (e) => {\n let actualObject = iff(settings.object);\n if (typeof actualObject != \"object\") actualObject = {};\n if (settings.beforeInput) settings.beforeInput(e);\n actualObject[settings[\"property\"]] = appendedElement.value;\n if (settings.afterInput) settings.afterInput(e);\n })\n break;\n case \"select\":\n appendedElement = document.createElement(\"select\");\n appendedElement.addEventListener(\"click\", (e) => { //apparently click is better than change or select\n let actualObject = iff(settings.object);\n if (typeof actualObject != \"object\") actualObject = {};\n if (settings.beforeInput) settings.beforeInput(e);\n actualObject[settings[\"property\"]] = appendedElement.value;\n if (settings.afterInput) settings.afterInput(e);\n })\n break;\n case \"array\":\n appendedElement = document.createElement(\"div\");\n appendedElement.style.display = \"flex\";\n appendedElement.style.flexDirection = \"column\";\n appendedElement.addEventListener(\"input\", (e) => {\n let actualObject = iff(settings.object);\n if (!actualObject[settings[\"property\"]]) actualObject[settings[\"property\"]] = [];\n let te = e.target.parentElement;\n let index = 0;\n while (te.previousElementSibling) {\n te = te.previousElementSibling;\n index++;\n }\n actualObject[settings['property']][index] = e.target.value;\n });\n appendedElement.addEventListener(\"click\", (e) => {\n let actualObject = iff(settings.object);\n if (e.target.tagName != \"BUTTON\") return;\n if (!actualObject[settings[\"property\"]]) actualObject[settings[\"property\"]] = [];\n if (e.target.innerText == \"+\") {\n let s = document.createElement(\"span\");\n s.innerHTML = `<input><button>x</button>`;\n s.style.width = \"100%\";\n appendedElement.insertBefore(s, appendedElement.children[appendedElement.children.length - 1]);\n actualObject[settings['property']].push(\"\");\n } else {\n let index = 0;\n let te = e.target.parentElement;\n while (te.previousElementSibling) {\n te = te.previousElementSibling;\n index++;\n }\n actualObject[settings['property']].splice(index, 1);\n e.target.parentElement.remove();\n }\n });\n break;\n case 'button':\n appendedElement = document.createElement(\"button\");\n appendedElement.innerText = settings.label;\n appendedElement.addEventListener(\"click\", (e) => {\n settings.fn();\n })\n break;\n }\n if (settings.placeholder) appendedElement.placeholder = settings.placeholder;\n if (settings.label && settings.type != \"button\") {\n let lb = document.createElement(\"label\");\n lb.innerHTML = settings.label;\n lb.appendChild(appendedElement);\n lb.style.display = \"flex\";\n lb.style.justifyContent = \"space-between\";\n settings.div.appendChild(lb);\n } else {\n //create ghost wrapper so element doesnt become inoperable\n let lb = document.createElement(\"label\");\n lb.innerHTML = \"&nbsp;\";\n lb.appendChild(appendedElement);\n lb.style.display = \"flex\";\n lb.style.justifyContent = \"space-between\";\n settings.div.appendChild(lb);\n }\n //initially load the property value.\n this.load = function () {\n let actualObject = iff(settings.object);\n if (!actualObject) console.log(\"Warning: attempt to reference an undefined object\");\n else {\n switch (settings.type) {\n case \"bool\":\n case \"boolean\":\n if (actualObject[settings[\"property\"]]) appendedElement.checked = actualObject[settings[\"property\"]];\n else appendedElement.checked = false;\n break;\n case \"text\":\n case \"textarea\":\n case \"number\":\n if (actualObject[settings[\"property\"]]) appendedElement.value = actualObject[settings[\"property\"]] || \"\";\n else appendedElement.value = \"\";\n break;\n case \"select\":\n //clear my div\n appendedElement.innerHTML = \"\";\n let _source = iff(settings.source);\n //if source is an array\n if (_source.length) {\n //differentiate between array of objects and array of string\n _source.forEach(i => {\n let op = document.createElement(\"option\");\n op.innerText = i;\n op.value = i;\n appendedElement.appendChild(op);\n })\n } else\n for (let i in _source) {\n let op = document.createElement(\"option\");\n op.innerText = _source[i];\n op.value = i;\n appendedElement.appendChild(op);\n }\n if (actualObject[settings[\"property\"]]) appendedElement.value = actualObject[settings[\"property\"]];\n break;\n case \"array\": //array of text\n while (appendedElement.children.length) appendedElement.children[0].remove();\n if (actualObject[settings[\"property\"]])\n for (let i = 0; i < actualObject[settings['property']].length; i++) {\n let s = document.createElement(\"span\");\n s.innerHTML = `<input value=\"${actualObject[settings['property']][i]}\"><button>x</button>`;\n s.style.width = \"100%\";\n appendedElement.appendChild(s);\n }\n let b = document.createElement(\"button\");\n b.innerHTML = \"+\";\n b.style.width = \"100%\";\n appendedElement.appendChild(b);\n break;\n }\n }\n }\n this.appendedElement = appendedElement;\n }\n\n return _option;\n })();\n\n\n //Reallly low level user identification, etc.\n //#region\n this.saveUserData = () => {\n localStorage.setItem(\"pm_userData\", JSON.stringify(this.userData));\n };\n\n this.userData = {\n documents: {},\n uniqueID: this.guid(7),\n itemsCreatedCount: 0,\n }\n\n Object.assign(this.userData, JSON.parse(localStorage.getItem(\"pm_userData\")));\n //#endregion\n\n\n Object.defineProperty(this, \"currentDoc\", {\n get: () => {\n return this.items._meta;\n }\n })\n\n //Document level functions\n this.updateSettings = () => {\n this.documentTitleElement.innerText = this.items._meta.displayName;\n if (!polymorph_core.isStaticMode()) {\n document.querySelector(\"title\").innerHTML =\n this.items._meta.displayName + \" - Polymorph\";\n }\n if (!polymorph_core.isLoading) this.filescreen.saveRecentDocument(this.currentDocID, undefined, this.items._meta.displayName);\n this.fire(\"updateSettings\");\n };\n\n this.on(\"updateSettings\", (d) => {\n this.fire(\"updateItem\", { id: \"_meta\" });\n })\n let tc = new capacitor(1000, 10, () => {\n polymorph_core.fire(\"updateSettings\");\n });\n //title updates\n this.on(\"UIstart\", () => {\n if (!this.documentTitleElement) {\n this.documentTitleElement = document.createElement(\"a\");\n if (!this.isStaticMode()) {\n this.documentTitleElement.contentEditable = true;\n }\n this.topbar.add(\"titleElement\", this.documentTitleElement);\n }\n this.documentTitleElement.addEventListener(\"keyup\", () => {\n this.items._meta.displayName = this.documentTitleElement.innerText;\n tc.submit();\n document.querySelector(\"title\").innerHTML =\n this.items._meta.displayName + \" - Polymorph\";\n });\n })\n\n //Operator registration\n //#region\n this.operators = {};\n this.registerOperator = (type, options, _constructor) => {\n if (_constructor) {\n this.operators[type] = {\n constructor: _constructor,\n options: options\n };\n } else {\n this.operators[type] = {\n constructor: options,\n options: {}\n };\n }\n this.fire(\"operatorAdded\", {\n type: type\n });\n for (let i = 0; i < this.operatorLoadCallbacks[type]; i++) {\n this.operatorLoadCallbacks[type][i].op.fromSaveData(\n this.operatorLoadCallbacks[type][i].data\n );\n }\n };\n //#endregion\n\n //Item management\n //#region\n this.items = {};\n\n this.oldCache = {}; // literally a copy of polymorph_core.items.\n this.on(\"updateItem\", (d) => {\n let copyOfItem = JSON.parse(JSON.stringify(this.items[d.id]));\n if (copyOfItem) {\n delete copyOfItem._lu_;\n copyOfItem = JSON.stringify(copyOfItem);\n if (!d.loadProcess && !d.unedit) {\n if (this.oldCache[d.id] && copyOfItem != this.oldCache[d.id]) {\n //console.log(`updated ${copyOfItem} against ${this.oldCache[d.id]}`)\n this.items[d.id]._lu_ = Date.now();\n this.fire(\"modifiedItem\", d);\n }\n }\n this.oldCache[d.id] = copyOfItem;\n }\n })\n\n let _Rixits = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/\";\n\n function b64(n) {\n var rixit; // like 'digit', only in some non-decimal radix \n var residual = n;\n var result = '';\n while (true) {\n rixit = residual % 64\n result = _Rixits.charAt(rixit) + result;\n residual = Math.floor(residual / 64);\n if (residual == 0)\n break;\n }\n return result;\n }\n\n //insert an item.\n this.insertItem = (itm) => {\n let UID = `${this.userData.uniqueID}_${b64(Date.now())}_${this.userData.itemsCreatedCount}`;\n this.userData.itemsCreatedCount++;\n this.items[UID] = itm;\n return UID;\n }\n //#endregion\n\n this.operatorLoadCallbacks = {};\n this.rectLoadCallbacks = {};\n\n //A shared space for operators to access\n this.shared = {};\n\n\n // Starting function: this is only called once by filemanager.\n this.start = (isStaticMode) => {\n this.fire(\"UIsetup\");\n this.fire(\"UIstart\");\n this.resetDocument();\n if (isStaticMode) {\n this.handleStaticData();\n } else {\n this.handleURL();\n }\n }\n\n}", "function emulateEventHandlers(eventNames) {\n\tfor (var i = 0; i < eventNames.length; i++) {\t\n\t\tdocument.addEventListener(eventNames[i], function (e) {\n\t\t\twindow.event = e;\n\t\t}, true);\t// using capture\n\t}\n}", "function newEvent(e)\r\n{\r\n var evt = (e || window.event);\r\n\tifrm = document.body.getElementsByTagName('iframe');\r\n\tif(ifrm.length) \r\n\t\tfor(i=0; i < ifrm.length; i++)\r\n\t\t\tif(ifrm[i]) hideIfNotClicked(evt,ifrm[i]);\r\n}", "function buildEvtsForSpecificSimFactory(params) {\n var createNewInstance = params.createNewInstance;\n return function buildForSpecificSim(userSimEvts, userSim, keys) {\n var out = (function () {\n var out = createNewInstance();\n if (keys === undefined) {\n return out;\n }\n objectKeys_1.objectKeys(out)\n .filter(function (eventName) { return id_1.id(keys).indexOf(eventName) < 0; })\n .forEach(function (eventName) { return delete out[eventName]; });\n return out;\n })();\n objectKeys_1.objectKeys(out).forEach(function (eventName) {\n var evt = evt_1.Evt.factorize(out[eventName]);\n evt_1.Evt.factorize(userSimEvts[eventName]).attach(function (data) {\n if (UserSim.match(data)) {\n if (data !== userSim) {\n return;\n }\n assert_1.assert(typeGuard_1.typeGuard(evt));\n evt.post();\n return;\n }\n else {\n var _a = id_1.id(data), userSim_ = _a.userSim, rest = __rest(_a, [\"userSim\"]);\n assert_1.assert(UserSim.match(userSim_));\n if (userSim_ !== userSim) {\n return;\n }\n evt.post(rest);\n }\n });\n });\n return out;\n };\n}", "function InternalEvent() {}", "function makeNativeSimulator(eventType) {\n\t return function (domComponentOrNode, nativeEventData) {\n\t var fakeNativeEvent = new Event(eventType);\n\t assign(fakeNativeEvent, nativeEventData);\n\t if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {\n\t ReactTestUtils.simulateNativeEventOnDOMComponent(eventType, domComponentOrNode, fakeNativeEvent);\n\t } else if (domComponentOrNode.tagName) {\n\t // Will allow on actual dom nodes.\n\t ReactTestUtils.simulateNativeEventOnNode(eventType, domComponentOrNode, fakeNativeEvent);\n\t }\n\t };\n\t}", "function writeEvents(uiEntity){\r\n\r\n\t\tvar evnts = uiEntity.events;\r\n\t\tif(evnts){\r\n\t\t\tvar events = evnts.split(\",\");\r\n\t\t\thtmlData += \" events='\";\r\n\r\n\t\t\tfor(var i = 0;i<events.length;i++){\r\n\t\t\t\t if(\"OC\"== events[i] ){\r\n\t\t\t\t\t htmlData += \"OC\";\r\n\t\t\t\t\t //htmlData = htmlData+ \" onchange='onFieldOnChange(this,event)' \"; \r\n\t\t\t\t\t onChangeEnabled = true;\r\n\t\t\t\t }\r\n\t\t\t}\r\n\t\t\thtmlData += \"'\";\r\n\t\t}\r\n\t}", "function rawHandlerProxy(ev) {\n\t\tvar myElement = document.getElementById(myId);\n\t\tvar self = DwtControl.findControl(myElement);\t\t\n\t\treturn self._rawEventHandler(ev);\n\t}", "dispatch_event( evt_name ){\r\n this.dispatchEvent( new CustomEvent( evt_name, { \r\n bubbles : true, \r\n cancelable : true, \r\n composed : false,\r\n detail : { \r\n value : this._value,\r\n }\r\n }));\r\n }", "function setFormEvents() {\n\t\tvar $lightbox = $('.lightbox');\n\t\t$lightbox.find('.submit').click(submit);\n\t\t$lightbox.find('.select-field').click(selectUpdate);\n\t\t$lightbox.find('input[type=number]').keydown(checkInput);\n\t\t$lightbox.find('.more-info, em.close-form, .cover').click(closeForm);\n\t\t$lightbox.find('#req-more-info .close-form').click(function(){\n\t\t\t$lightbox.find('.more-info').click();\n\t\t});\n\n\t\t// Stop click even propogating to lightbox to prevent closing modal\n\t\t$lightbox.find('form').click(function(e) {\n\t\t\treturn false;\n\t\t});\n\n\t\t$lightbox.find('.checkbox-field label').click(function() {\n\t\t\tvar $input = $(this).find('input');\n\t\t\t$input.prop('checked', !$input.prop('checked'));\n\t\t});\n\n\t\t$lightbox.find('.more-info label').click(function() {\n\t\t\t$(this).next('input').focus();\n\t\t});\n\n\t\t$lightbox.find('.select-field').focus(function() {\n\t\t\t$(this).children('.select-list').focus();\n\t\t});\n\n\t\tvar textInputs = $lightbox.find('.more-info input[type=text], .more-info input[type=number]');\n\t\tvar inputs = $lightbox.find('.more-info input, .more-info .select-list, .more-info .checkbox-field>label');\n\t\tvar checkboxes = $lightbox.find('.more-info .checkbox-field>label');\n\t\tvar selectLists = $lightbox.find('.select-list');\n\t\tvar selectListItems = selectLists.children('div');\n\n\t\t$lightbox.find('.submit').keydown(function(e) {\n\t\t\tenterClick.call($(this).children('input'), e);\n\t\t});\n\t\tcheckboxes.keydown(enterClick);\n\t\tfunction enterClick(e) {\n\t\t\tif (e.which === 13) {\n\t\t\t\t$(this).click();\n\t\t\t}\n\t\t}\n\t\tcheckboxes.click(function() {\n\t\t\tvar checked = $lightbox.find('.checkbox-field[data-required] input:checked').closest('.checkbox-field');\n\t\t\tvar parentForm = $(this).closest('form');\n\t\t\tparentForm.children('.input-field').removeClass('input-field').children('input, .select-list').attr('tabindex', '-1'); //.each(function(){this.disabled=true;});\n\t\t\tchecked.each(function() {\n\t\t\t\tvar required = $(this).attr('data-required').split(' ');\n\t\t\t\trequired.forEach(function(reqGroup) {\n\t\t\t\t\tthis.children('.' + reqGroup).addClass('input-field').children('input, .select-list').attr('tabindex', '0'); //.each(function(){this.disabled=false;});\n\t\t\t\t}, parentForm);\n\t\t\t});\n\t\t});\n\n\t\tselectListItems.click(function() {\n\t\t\tif (!$(this).hasClass('selected')) {\n\t\t\t\t$(this).siblings('.selected').removeClass('selected');\n\t\t\t\t$(this).addClass('selected');\n\t\t\t}\n\t\t});\n\t\tselectLists.click(function(e) {\n\t\t\t$(this).parent().toggleClass('open');\n\t\t});\n\t\tselectLists.keydown(function(e) {\n\t\t\tswitch (e.which) {\n\t\t\t\tcase 13:\n\t\t\t\t\t$(this).click();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 38:\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$(this).parent().addClass('open');\n\t\t\t\t\tvar selected = $(this).children('.selected');\n\t\t\t\t\tif (selected.prev('div').length) {\n\t\t\t\t\t\tselected.removeClass('selected');\n\t\t\t\t\t\tselected.prev('div').addClass('selected');\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 40:\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$(this).parent().addClass('open');\n\t\t\t\t\tvar selected = $(this).children('.selected');\n\t\t\t\t\tif (selected.next('div').length) {\n\t\t\t\t\t\tselected.removeClass('selected');\n\t\t\t\t\t\tselected.next('div').addClass('selected');\n\t\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tinputs.focus(function() {\n\t\t\t$(this).parent().closest('div').addClass('focused');\n\t\t});\n\t\tinputs.focusout(function() {\n\t\t\t$(this).parent().removeClass('focused');\n\t\t\t$(this).parent().removeClass('open');\n\t\t});\n\t\ttextInputs.change(function() {\n\t\t\tif ($(this).val() === '') $(this).parent('.text-field').removeClass('filled');\n\t\t\telse $(this).parent('.text-field').addClass('filled');\n\t\t});\n\t}", "function makeSimulator(eventType) {\n return function (domNode, eventData) {\n if (!!React.isValidElement(domNode)) {\n {\n throw Error( \"TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering.\" );\n }\n }\n\n if (!!ReactTestUtils.isCompositeComponent(domNode)) {\n {\n throw Error( \"TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.\" );\n }\n }\n\n var dispatchConfig = eventNameDispatchConfigs$1[eventType];\n var fakeNativeEvent = new Event();\n fakeNativeEvent.target = domNode;\n fakeNativeEvent.type = eventType.toLowerCase(); // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n\n var targetInst = getInstanceFromNode$1(domNode);\n var event = new SyntheticEvent(dispatchConfig, targetInst, fakeNativeEvent, domNode); // Since we aren't using pooling, always persist the event. This will make\n // sure it's marked and won't warn when setting additional properties.\n\n event.persist();\n\n _assign(event, eventData);\n\n if (dispatchConfig.phasedRegistrationNames) {\n accumulateTwoPhaseDispatches$1(event);\n } else {\n accumulateDirectDispatches$1(event);\n }\n\n ReactDOM.unstable_batchedUpdates(function () {\n // Normally extractEvent enqueues a state restore, but we'll just always\n // do that since we're by-passing it here.\n enqueueStateRestore$1(domNode);\n runEventsInBatch$1(event);\n });\n restoreStateIfNeeded$1();\n };\n}", "function events() {\r\n\taddition();\r\n\tcounter();\r\n\tcheckForm();\r\n}", "_evtClick(event) { }", "function AttachEventHandlers() {\n\n //If the event handlers have already been attached, get outta here.\n if (mbEventHandlersAttached) return;\n \n //Attach standard event handlers for input fields. \n try {\n AttachEventHandlersToFields();\n }\n catch(e) {\n //ignore error\n }\n \n //Page-specific event handlers go here.\n //AddEvt($(\"XXXXXX\"), \"mouseover\", functionXXXXX);\n \n //AddEvt($(\"New\"), \"mouseover\", functionXXXXX);\n \n \n \n //Set flag to indicate event handlers have been attached.\n mbEventHandlersAttached = true;\n}", "function raisePHPEvent(eventname)\n{\n var args = new Array();\n var args2 = new Array();\n \n if (arguments) {\n args = arguments;\n } else if (this.arguments) {\n args = this.arguments;\n }\n\n for (i=0; i< args.length; i++) {\n args2[i] = args[i];\n }\n \n if (typeof(jQuery) !== 'undefined') {\n $.post('transferevents.php', {'action': 'raise_event', 'eventname': eventname, 'arguments': JSONstring.make(args2)}, function (data) {_cjEventHandler(data)});\n } else if (typeof(Prototype) !== 'undefined') {\n new Ajax.Request('transferevents.php', {\n 'method': 'post',\n 'parameters': {'action': 'raise_event', 'eventname': eventname, 'arguments': JSONstring.make(args2)},\n onSuccess: function (data) {_cjEventHandler(data.responseJSON);}\n });\n } else {\n alert('You need JQuery or Prototype to raise php events');\n }\n}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}" ]
[ "0.6547445", "0.6182105", "0.59836423", "0.59764826", "0.5953555", "0.58859825", "0.58859825", "0.58859825", "0.58859825", "0.58624244", "0.58088124", "0.5769422", "0.5767997", "0.5732902", "0.5732902", "0.5732902", "0.5732902", "0.5732902", "0.54864055", "0.54685295", "0.5461119", "0.5435418", "0.5408188", "0.5394674", "0.53756815", "0.5369495", "0.5369495", "0.5369495", "0.53653455", "0.535529", "0.5350339", "0.5346069", "0.5327417", "0.5327417", "0.5327417", "0.5318375", "0.5318375", "0.5313883", "0.53133565", "0.53133565", "0.5305744", "0.52826726", "0.5278371", "0.5268536", "0.52679974", "0.52668643", "0.52620476", "0.5255574", "0.5244469", "0.5242481", "0.52404714", "0.5235073", "0.5232395", "0.5225977", "0.5225977", "0.5225977", "0.5225977", "0.5225977", "0.5225977", "0.5225977", "0.5225977", "0.5225977", "0.5225977", "0.52213776", "0.52212256", "0.52211165", "0.52199274", "0.5217464", "0.5217464", "0.5217464", "0.5214554", "0.52106404", "0.520898", "0.5200535", "0.51889944", "0.5187882", "0.5184133", "0.51813626", "0.51800805", "0.516854", "0.51656044", "0.51636773", "0.516167", "0.51610106", "0.51559335", "0.51509607", "0.51472175", "0.5143082", "0.51404345", "0.51368034", "0.51332057", "0.51317084", "0.5131469", "0.5131469", "0.5131469", "0.5131469", "0.5131469", "0.5131469", "0.5131469", "0.5131469" ]
0.54062307
23
Helper method to copy the password to clipboard.
function copyToClipboard(txt) { const input = document.createElement('input'); input.style.position = 'fixed'; input.style.opacity = 0; input.value = txt; document.body.appendChild(input); input.select(); document.execCommand('copy'); document.body.removeChild(input); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyPassword() {\n passwordFinal.select();\n document.execCommand(\"Copy\");\n }", "function copy() {\n var copyText = password; // **** FIX ****\n copyText.select();\n document.execCommand(\"copy\");\n }", "function copyPassword() {\n let passwordText = document.querySelector(\"#password\");\n passwordText.select();\n document.execCommand('copy');\n}", "function copyPassword() {\n passwordEl.select();\n document.execCommand(\"copy\");\n}", "function copyPassword() {\n var copyText = document.querySelector(\"#password\");\n copyText.select();\n document.execCommand(\"copy\");\n}", "function copyPasswordToClipboard(){\n const newClip = document.querySelector(\"#generatedPassword\").value;\n navigator.permissions.query({name: \"clipboard-write\"}).then(result => {\n if (result.state == \"granted\" || result.state == \"prompt\") {\n updateClipboard(newClip);\n }\n });\n }", "function copyPassword() {\n var copyText = document.querySelector(\"#password\");\n copyText.select();\n document.execCommand(\"copy\");\n alert(\"Copied password to Clipboard: \" + copyText.value);\n}", "function copy(){\n const pass = document.querySelector(\"#password\").textContent;\n const txtEl = document.createElement(\"textarea\");\n txtEl.value = pass;\n document.body.appendChild(txtEl);\n txtEl.select();\n txtEl.setSelectionRange(22, 100)\n document.execCommand(\"copy\");\n document.body.removeChild(txtEl);\n alert(`Copied to clipboard \\n ${pass} `); \n \n\n}", "function copyToClipboard() {\n let passwordText = document.querySelector('#password')\n let passwordVal = passwordText.value\n passwordText.focus();\n passwordText.select();\n document.execCommand('copy')\n alert('Your password has been copied!')\n}", "function copyPass() {\n var copyText = document.getElementById(\"password\");\n copyText.select();\n copyText.setSelectionRange(0, 128)\n document.execCommand(\"copy\");\n alert(\"Copied the text: \" + copyText.value);\n }", "function copyPass() {\n var str = document.getElementById(\"pwBox\").innerHTML;\n function listener(e) {\n e.clipboardData.setData(\"text/html\", str);\n e.clipboardData.setData(\"text/plain\", str);\n e.preventDefault();\n }\n document.addEventListener(\"copy\", listener);\n document.execCommand(\"copy\");\n document.removeEventListener(\"copy\", listener);\n }", "function copyPassword(){\n var copyText = document.getElementById(\"password\");\n copyText.select();\n copyText.setSelectionRange(0,99999);\n document.execCommand(\"copy\");\n alert(\"Copied\");\n }", "function copyPassword() {\n /*get the password field*/\n var copyPass = document.getElementById(\"pwBox\");\n /*select the password field*/\n copyPass.select();\n copyPass.setSelectionRange(0, 9999); /*for mobile devices*/\n\n /*Copy the password inside the password field*/\n document.execCommand(\"copy\");\n /*alert the copied text*/\n alert(\"Copied the password: \" + copyPass.value);\n}", "function pwCopy() {\n var copyText = document.getElementById(\"password\");\n\n copyText.select();\n document.execCommand(\"copy\");\n\n alert(\"Your password \"+ copyText.value + \" was copied to your clipboard.\");\n}", "function copyPwd(){\n password = document.getElementById(\"password\");\n password.select();\n document.execCommand('copy');\n alert(\"Password copied!\");\n }", "function copyPassword() {\n let copiedText = document.getElementById(\"password\");\n copiedText.select();\n copiedText.setSelectionRange(0, 99999);\n document.execCommand(\"copy\");\n\n}", "function passCopy() {\n let copiedText = document.getElementById(\"password\");\n copiedText.select();\n //adding selection reange for phones\n copiedText.setSelectionRange(0, 99999);\n document.execCommand(\"copy\");\n //alerting what actually did we copy\n alert(\"Copied password \" + copiedText.value);\n }", "function copyPWToClipboard() {\n\t/* The select() method is used to select the contents of a text field.*/\n\tvar pw = document.getElementById(\"sitePassword\").select(); /*It puts \"sitePassword\" content in var pw */\n\t/* The document.execCommand('copy') method's \"copy\" commands can be used to replace the clipboard's */\n\t/* current contents with the selected material. These commands can be used without any special permission */\n\t/* if you are using them in a short-lived event handler for a user action (for example, a click handler). */\n document.execCommand('copy');\t\t\t\n}", "function copyPassword() {\n \n document.getElementById(\"display\").select();\n document.execCommand(\"Copy\");\n alert(\"Your randomly generated password has been copied to your clipboard!\");\n\n}", "function copyPassword() {\n document.getElementById(\"password\").select();\n document.execCommand(\"Copy\");\n alert(\"Password copied to clipboard!\");\n}", "function copyPasswordToClipboard() {\n passwordText.select();\n passwordText.setSelectionRange(0, 99999); // For mobile devices - not working on my device.\n\n navigator.clipboard.writeText(passwordText.value);\n alert(\"Copied the password: \\n\\n\" + passwordText.value + \"\\n\\nto your clipboard.\");\n\n /* document.execCommand(\"copy\"); <== flagged as deprecated, however if you have a look\n at https://www.w3schools.com/jsref/met_document_execcommand.asp \n the issue is more that it is 'experimental' and could\n change. Found alternative method on www.w3schools.com :\n navigator.clipboard.writeText(passwordText.value)\n */\n}", "function copyToClipboard() {\n if (form.password.value.length >= 4) {\n const pswCopied = form.password.value;\n navigator.clipboard.writeText(pswCopied);\n\n changeIcon();\n showTooltip();\n }\n}", "function copyPassword(e) {\n document.querySelector(\"#finalPassword\").select(); //Selects password text\n document.execCommand(\"Copy\"); //Copies password text to clipboard\n e.preventDefault(); //Prevents page refresh when copy button is clicked\n }", "function copyPassword(){\n\n document.getElementById(\"yourPwd\").select();\n document.execCommand(\"Copy\");\n alert(\"Password Copied to clipboard!\")\n }", "function copyToClipboard(){\n // define a variable for the copied password as the output to the text area\n var copiedPassword = document.getElementById(\"passwordDisplay\");\n // select the variable\n copiedPassword.select();\n // Copies password to user's clipboard \n //source: https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand\n document.execCommand(\"copy\");\n //Advises user their password has been copied, and advises of location.\n alert(\"Your password has been copied to the clipboard\");\n}", "function copyPass() {\n var copyText = document.getElementById(\"password\");\n copyText.select();\n copyText.setSelectionRange(0, 99999);\n document.execCommand(\"copy\");\n alert(\"Copied the text: \" + copyText.value);\n}", "function copyToClipboard() {\n // BONUS \n let copyText = document.getElementById(\"password\");\n copyText.select();\n document.execCommand(\"copy\");\n alert(\"Copied the text: \" + copyText.value);\n}", "function copyPassword(){\n\ndocument.getElementById(\"password\").select();\n\ndocument.execCommand(\"Copy\");\n\nalert(\"Password copied to clipboard\");\n\n}", "function copy() {\n document.getElementById(\"password\").select()\n document.execCommand(\"copy\")\n}", "function copyPassword() {\n document.getElementById(\"password\").select();\n\n document.execCommand(\"copy\");\n\n alert(\"Password has been copied to clipboard!\");\n}", "function copyPassword() {\n /* Get the text field */\n var copyText = document.getElementById(\"password\");\n\n /* Select the text field */\n copyText.select();\n copyText.setSelectionRange(0, 99999); /*For mobile devices*/\n\n /* Copy the text inside the text field */\n document.execCommand(\"copy\");\n\n /* Alert the copied text */\n alert(\"Copied the password: \" + copyText.value);\n}", "function copyPassword() {\n // Select the text field\n passwordText.select();\n passwordText.setSelectionRange(0, 127); // For mobile devices\n\n // Copy the password text\n document.execCommand(\"copy\");\n\n // Alert that the text has been copied\n alert(\"Copied the password \" + passwordText.value + \" to clipboard\");\n}", "function copyPassword() {\n /* Get the text field */\n var copyText = document.getElementById(\"randomPassword\");\n\n /* Select the text field */\n copyText.select();\n copyText.setSelectionRange(0, 99999); /*For mobile devices*/\n\n /* Copy the text inside the text field */\n document.execCommand(\"copy\");\n\n /* Alert the copied text */\n alert(\"Copied the password: \" + copyText.value);\n}", "function copyFunction() {\n\n // creates a variable that calls the password area\n var copyText = document.getElementById(\"password\");\n // selects the content\n copyText.select();\n copyText.setSelectionRange(0, 99999)\n // copies it to clipboard\n document.execCommand(\"copy\");\n alert(\"Copied the text: \" + copyText.value);\n}", "function copyToClipboard() {\n var copyText = document.getElementById(\"password\"); // Get the text field\n copyText.select(); // Select the text field\n copyText.setSelectionRange(0, 99999); // For mobile devices\n document.execCommand(\"copy\"); // Copy the text inside the text field\n alert(\"Copied the text: \" + copyText.value); // Alert user text has been copied\n}", "function writePassword() {\n document.getElementById(\"password\").toSelect();\n document.execCommand(\"write\");\n alert(\"Password copied to clipboard!\");\n }", "function textToClipboard (text) {\n var dummy = document.createElement(\"textarea\");\n var passwordtext = document.querySelector(\"#passwordDisplay\").textContent;\n document.body.appendChild(dummy);\n dummy.value = passwordtext;\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n}", "function copied() {\n document.getElementById(\"password\").select();\n document.execCommand(\"copy\");\n alert(\"The password has been copied to your clipboard!\");\n}", "function copyPassword(){\n\n document.getElementById(\"viewerPoint\").select();\n\n document.execCommand(\"Copy\");\n\n alert(\"Password copied to clipboard!\");\n\n}", "function copyToClipboard() {\n var copyText = document.getElementById(\"passcode\");\n copyText.select();\n copyText.setSelectionRange(0, 99999)\n document.execCommand(\"copy\");\n alert(\"Copied the text: \" + copyText.value);\n}", "function copyButton() {\n document.querySelector(\"#password\").select();\n document.execCommand('copy');\n alert(\"Copied password to clipboard\");\n}", "function copyText() {\n\n navigator.clipboard.writeText(outputPassword.textContent);\n console.log(\"copied!\")\n\n}", "function copyText(event) {\n\n/*Function to prevent default behavior, in this case the behavior of btn inside a form, so the form doesn't get refresh when user hits any btn*/\n event.preventDefault();\n var copyText = document.getElementById(\"generatedPassword\");\n copyText.select();\n copyText.setSelectionRange(0, 99999); /*For mobile devices*/\n document.execCommand(\"copy\");\n }", "function writePassword() {\n let password = generatePassword();\n\n //Verify we received a valid password\n if(password !== \"\")\n {\n let passwordText = document.querySelector(\"#password\");\n\n passwordText.textContent = password;\n passwordText.select();\n document.execCommand(\"copy\");\n alert(\"Password has been copied to clipboard!\");\n }\n}", "copyPassword() {\n const textArea = document.createElement(\"textarea\");\n // make the text area invisible\n textArea.style.position = 'fixed';\n textArea.style.top = 0;\n textArea.style.left = 0;\n textArea.style.width = '2em';\n textArea.style.height = '2em';\n textArea.style.padding = 0;\n textArea.style.border = 'none';\n textArea.style.outline = 'none';\n textArea.style.boxShadow = 'none';\n textArea.style.background = 'transparent';\n\n // put the password in the text area\n textArea.value = this.props.entry.password;\n\n document.body.appendChild(textArea);\n textArea.select();\n\n try {\n console.log(\"copying\");\n const result = document.execCommand('copy');\n\n if (!result) {\n console.error('copy failed');\n return;\n }\n\n console.log(\"copied\");\n } catch (e) {\n console.error(\"copy failed: \" + e);\n alert(\"TODO: user-visible error??\");\n }\n\n this.setState({ revealText: \"Copied!\" }, () => {\n setTimeout(() => this.setState({ revealText: \"View/Copy Password\" }), 2500);\n })\n\n document.body.removeChild(textArea);\n this.setState({ hasRequestedReveal: false });\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n copyButton.removeAttribute(\"disabled\");\n copyButton.focus();\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword() {\n var password = generatepassword();\n var passwordText = document.querySelector(\"#password\");\n\n\n\n passwordText.value = password;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword() {\n let password = generatePassword();\n let passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword() {\n var password = generatePassword();\n passwordText.value = password;\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword() {\n var password = generatePassword();\n var passwordTextEl = document.querySelector(\"#password\");\n passwordTextEl.value = password;\n passwordTextEl.addEventListener(\"click\", copyPasswordtoClipboard); // Click in text area to copy password to clipboard\n}", "function writePassword() {\n\t// var password = generatePassword();\n\tpassword;\n\tvar passwordText = document.querySelector('#password');\n\n\tpasswordText.value = password;\n\n\tcopyBtn.removeAttribute('disabled');\n\tcopyBtn.focus();\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword(password) {\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function copyCredential(copyID) {\n // Get the element we want to copy\n let credentialToCopy = document.querySelector('#' + copyID);\n // If it is hidden, change to text, copy, and then hide again\n if (credentialToCopy.type == 'password') {\n credentialToCopy.type = 'text';\n credentialToCopy.select();\n document.execCommand('copy');\n credentialToCopy.type = 'password';\n } else {\n // Else, if it is shown, just copy!\n credentialToCopy.select();\n document.execCommand('copy');\n }\n // Fade In / Out Copy Confirmation Message\n let copyConfirmation = document.querySelector('#confirm-' + copyID);\n $( copyConfirmation ).fadeIn( 300 ).delay( 1500 ).fadeOut( 400 );\n}", "function writePassword() {\n\n var passwordText = document.querySelector(\"#password\");\n\n newPassword.value = password;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = userPassword;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword(password) {\n\n console.log(password);\n let passwordEl = document.querySelector(\"#password\");\n\n passwordEl.value = password;\n\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function copy(){\n var id = document.getElementById(\"roomID\").innerHTML;\n var pw = document.getElementById(\"password\").innerHTML;\n var message = \"RoomID: \" + id + \", Password: \" + pw;\n navigator.clipboard.writeText(message);\n}", "function writePassword() {\n var password = generatePassword();\n\n passwordText.value = password;\n\n // Add note to click password field to copy generated password if not already visible\n var copyText = document.querySelector(\"#copyText\");\n if (copyText.dataset.state === \"hidden\") {\n copyText.dataset.state = \"show\"\n copyText.textContent = \"Click the password box to copy your new password!\";\n }\n}", "copyLetterSal() {\n this.clipboard.copy(this.letterSalutation);\n }", "function clipCopy(){\n passDisplay.select();\n document.execCommand(\"copy\");\n}", "function copyClipboard() {\n const { phone_number, message } = get_inputs();\n const WA_link = get_link(phone_number, message);\n\n // * Copy text value to the clipboard\n let dummy = document.createElement(\"textarea\");\n document.body.appendChild(dummy);\n dummy.value = WA_link;\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n}", "function copyToClipbord(text) {\n // Create a temp textarea element and assign it the value from the hex\n const el = document.createElement('textarea');\n el.value = text.innerText;\n // Append the element to the html body, select it, and copy\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n console.log(`${el.value} was copied to clipboard`);\n // Remove it afterwards and assign an active class to our popup\n document.body.removeChild(el);\n const copyWindow = copyPanel.children[0];\n copyWindow.classList.add('active');\n copyPanel.classList.add('active');\n}", "function clipboard()\n{\nvar copyText = display;\n copyText.select();\n copyText.setSelectionRange(0, 128)\n document.execCommand(\"copy\");\n alert(\"Copied to clipboard: \" + copyText.value);\n \n\n\n}", "function copyToClipboard(elem) {\n var target = document.getElementById('hexInput'),\n currentFocus = document.activeElement,\n succeed;\n target.value = elem;\n target.focus();\n target.setSelectionRange(0, 7);\n try {\n succeed = document.execCommand(\"copy\");\n\n } catch (e) {\n succeed = false;\n }\n if (currentFocus && typeof currentFocus.focus === \"function\") {\n currentFocus.focus();\n } else {\n target.textContent = \"\";\n }\n return succeed;\n }", "function copyToClipboard(txt) {\n\tif(window.clipboardData) {\n\t window.clipboardData.clearData();\n\t window.clipboardData.setData('Text', txt);\n\t} else if(navigator.userAgent.indexOf(\"Opera\") != -1) {\n\t window.location = txt;\n\t} else if (window.netscape) {\n\t\ttry {\n\t\t netscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n\t\t} catch (e) {\n\t\t alert(\"Please open your firefox security constraint by 'about:config' to set signed.applets.codebase_principal_support' as 'true'\");\n\t\t return false;\n\t\t}\n\t\tvar clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);\n\t\tif (!clip)return;\n\t\tvar trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);\n\t\tif (!trans)return;\n\t\ttrans.addDataFlavor('text/unicode');\n\t\tvar str = new Object();\n\t\tvar len = new Object();\n\t\tvar str = Components.classes[\"@mozilla.org/supports-string;1\"].createInstance(Components.interfaces.nsISupportsString);\n\t\tvar copytext = txt;\n\t\tstr.data = copytext;\n\t\ttrans.setTransferData('text/unicode',str,copytext.length*2);\n\t\tvar clipid = Components.interfaces.nsIClipboard;\n\t\tif (!clip)return false;\n\t\tclip.setData(trans,null,clipid.kGlobalClipboard);\n\t}\n}", "copyToClipboard() {\n var copyText = document.getElementById('InputFieldContent');\n copyText.select();\n document.execCommand('Copy');\n }", "function copyToClipboard (text) {\n window.prompt (\"Copy to clipboard: Ctrl+C, Enter\",text);\n}", "function copyToClipboard()\n{\n textarea.select(); //The select() method selects the entire contents of a text area.\n\n // browser extensions can interact with the system clipboard by document.execCommand(\"copy\");\n document.execCommand(\"copy\");\n}", "copyToClipBoard() {\n let input = document.querySelector('.initKeyBoard');\n input.style.display = 'block';\n input.value = this.display;\n input.select();\n document.execCommand(\"Copy\");\n input.style.display = 'none';\n }", "function copy() {\r\n var copyText = document.getElementById(\"email\");\r\n copyText.style.display=\"block\";\r\n copyText.select();\r\n copyText.setSelectionRange(0, 99999)\r\n document.execCommand(\"copy\");\r\n alert(copyText.value+\" was copied! Let's connect!\");\r\n copyText.style.display=\"none\";\r\n }", "function copyToClipboard(clipboardData) {\n $(\"#clipboardProxy\").val(clipboardData);\n $(\"#clipboardProxy\").focus();\n $(\"#clipboardProxy\").select();\n document.execCommand(\"copy\");\n}", "function Clipboard () {}", "function copyToClipboard(text) { \n\t\tvar textArea = document.createElement( \"textarea\" ); \n\t\ttextArea.value = text;\n\t\t document.body.appendChild( textArea ); \n\t\t textArea.select(); \n\t\t try { var successful = document.execCommand( 'copy' ); var msg = successful ? 'successful' : 'unsuccessful'; \n\t\t } catch (err) { console.log('Oops, unable to copy'); } document.body.removeChild( textArea ); \n\t}", "function copyToClipboard(text) {\r\n var ta = document.getElementById('ta');\r\n ta.style.display = 'block';\r\n ta.value = text;\r\n ta.select();\r\n document.execCommand('copy');\r\n ta.style.display = 'none';\r\n}", "function copyToClipboard(str) {\n var el = document.createElement('textarea');\n el.value = str;\n el.setAttribute('readonly', '');\n el.style.position = 'absolute';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n}", "function copyToClipboard(value) {\n var $temp = $(\"<textarea>\");\n $(\"body\").append($temp);\n $temp.val(value).select();\n\n document.execCommand(\"copy\");\n $temp.remove();\n }", "pasteFromClipboard() {\n let text = atom.clipboard.read();\n this.onPaste(text);\n //this.pty.write(text);\n this.writeToPty(text);\n }", "function writePassword() {\n var password = getPasswordOptions();\n var passwordText = document.querySelector('#password');\n \n passwordText.value = password;\n }", "function Clipboard_CopyTo(value) {\n var tempInput = document.createElement(\"input\");\n tempInput.value = value;\n document.body.appendChild(tempInput);\n tempInput.select();\n document.execCommand(\"copy\");\n document.body.removeChild(tempInput);\n }", "function copyText() {\n const elem = document.createElement('textarea');\n elem.value = \"[email protected]\";\n elem.setAttribute('readonly', '');\n elem.style.position = 'absolute';\n elem.style.left = '-9999px';\n document.body.appendChild(elem);\n elem.select();\n document.execCommand('copy');\n document.body.removeChild(elem);\n $('.toast').toast('show');\n}", "function myFunction() {\n var copyText = document.getElementById(\"myInput\");\n copyText.select();\n copyText.setSelectionRange(0, 99999);\n document.execCommand(\"copy\");\n \n var tooltip = document.getElementById(\"myTooltip\");\n tooltip.innerHTML = \"Link to profile was copied to clipboard!\";\n //tooltip.innerHTML = \"Copied: \" + copyText.value;\n}", "onCopyToClipboard() {\n Clipboard.setString( this.state.mnemonic );\n this.setState({ showModal: false, isMnemonicCopied: true });\n }", "function copyToClipboard() {\n const txtAreaCopy = document.querySelector(\"#txtarea-clipboard\");\n\n txtAreaCopy.innerHTML = mJiraFullString; //JSON.stringify(dict);\n\n txtAreaCopy.select();\n\n document.execCommand(\"copy\");\n}", "function copyToClipboard() {\r\n const textArea = document.createElement('textarea');\r\n const colorToCopy = this.innerText;\r\n textArea.value = colorToCopy;\r\n document.body.appendChild(textArea);\r\n //select all things in the text area\r\n textArea.select();\r\n //copy to clipboard command\r\n document.execCommand('copy');\r\n document.body.removeChild(textArea);\r\n console.log('copied!');\r\n\r\n //Popup UI -> could do copyPopup.style.display = 'flex';\r\n copyPopup.classList.add('active');\r\n setTimeout(() => {\r\n copyPopup.classList.remove('active');\r\n }, 2000);\r\n}", "function copyToClipboard(text){\n var dummy = document.createElement(\"textarea\");\n document.body.appendChild(dummy);\n dummy.value = text;\n dummy.select();\n document.execCommand(\"copy\");\n document.body.removeChild(dummy);\n}", "function writePassword() {\n validInput = false;\n if (copyButton.style.display = \"block\") {\n copyButton.style.display = \"none\";\n }\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n passwordLength = 0;\n \n function copyText() { \n passwordText.select(); //select text\n passwordText.setSelectionRange(0, 99999);// for mobile devices\n document.execCommand(\"copy\"); //copy text\n copyButton.removeEventListener(\"click\", copyText);\n alert(\"Copied!\");\n };\n\n //main program function\n function generatePassword() {\n //if the password length has not already been set, ask the user for it, otherwise, move on to the next question:\n\n if (passwordLength === 0) {\n\n passwordLength = setLength();\n \n if (passwordLength === null) { //if cancel button is clicked, return null:\n return null;\n }\n \n }\n console.log(\"password length: \" + passwordLength);\n \n //Ask if they want special characters:\n specialCharacters = yesOrNo(\"Do you want your password to contain special characters? Enter either 'y' for yes or 'n' for no.\");\n if (specialCharacters === null) { //if cancel button is clicked, return null\n return null;\n }\n console.log(\"Special Characters? \" + specialCharacters);\n //Ask if they want numbers:\n numbers = yesOrNo(\"Do you want your password to contain numbers? Enter either 'y' for yes or 'n' for no.\");\n if (numbers === null) { //if cancel button is clicked, return null\n return null;\n }\n console.log(\"numbers? \" + numbers);\n //Ask if they want uppercase letters:\n uppercase = yesOrNo(\"Do you want your password to contain uppercase letters? Enter either 'y' for yes or 'n' for no.\");\n if (uppercase === null) { //if cancel button is clicked, return null\n return null;\n }\n console.log(\"Uppercase Letters? \" + uppercase);\n //Ask if they want lowercase letters:\n lowercase = yesOrNo(\"Do you want your password to contain lowercase letters? Enter either 'y' for yes or 'n' for no.\");\n if (lowercase === null) { //if cancel button is clicked, return null\n return null;\n }\n else if (specialCharacters === 'n' && numbers === 'n' && uppercase === 'n' && lowercase === 'n') {\n //if the user answered 'n' to all yes or no questions, alert them with an error and ask them the questions again:\n alert(\"You must have at least one of the criteria that was previously asked for.\"); \n validInput = false; \n return null\n }\n else {\n //validation successful, password displayed, show copy button:\n console.log(\"Lowercase letters? \" + lowercase);\n //Add Event listener to the copy button:\n copyButton.addEventListener(\"click\", copyText);\n copyButton.style.display = \"block\";\n validInput = true;\n \n //After all the input is validated and stored, execute the password algorithm:\n var newPassword = executeAlgorithm();\n \n //Convert the resulting array to a string:\n var passwordString = convertToString(newPassword);\n \n return passwordString;\n } \n \n\n\n function setLength() {\n \n //run the loop until valid input is received:\n while (!validInput) {\n \n //prompt the user for the password length:\n var input = prompt(\"Enter the password length. Must be a minimum of 8 characters and a maximum of 128 characters.\");\n \n if (input === null) { //if cancel button is clicked, return null:\n reset();\n return input;\n }\n else {\n input = parseInt(input); //convert input to a number\n \n var isNum = !isNaN(input); //if input is a number, store true/false\n \n if (isNum) {\n //if input is a number, check whether it's between 8 and 128 and return it:\n if (input >= 8 && input <= 128) {\n return input;\n }\n else {\n //if number is not in range, run the while loop again:\n validInput = false;\n }\n }\n else {\n //if input is not a number, run the while loop again:\n validInput = false;\n }\n //input is not valid, display error:\n alert('Invalid input. Must be an integer number between 8 and 128.');\n }\n \n }\n \n }\n\n function yesOrNo(message) {\n\n //run the loop until valid input is received:\n while (!validInput) {\n \n //pass the appropriate message to the prompt:\n var input = prompt(message);\n \n if (input === null) { //if cancel button is clicked, return null:\n reset();\n return input;\n }\n else {\n input = input.toLowerCase(); //convert input to lowercase\n \n if (input === 'y' || input === 'n') { //check if input is either y or n\n return input;\n }\n else {\n //if input is not either y or n, run the while loop again:\n validInput = false;\n }\n //input is not valid, display error:\n alert(\"Invalid input. Enter either 'y' for yes or 'n' for no.\");\n }\n \n }\n \n }\n\n function convertToString(newPassword) {\n\n var passwordString = \"\";\n \n for (var i = 0; i < newPassword.length; i++) {\n //loop through each element in the new password array and add it to the password string:\n passwordString += newPassword[i]; \n }\n //return the password string\n return passwordString;\n \n }\n \n function executeAlgorithm() {\n\n //initialize an array to store all character lists, and empty password array, and a character variable:\n var combinedLists = []; \n var passwordArray = [];\n var char;\n \n //if the user asked for special characters, add it to the combinedList array:\n if (specialCharacters === 'y') { \n combinedLists.push(specialCharsList);\n }\n \n //if the user asked for numbers, add it to the combinedList array:\n if (numbers === 'y') {\n combinedLists.push(numbersList);\n }\n \n //if the user asked for uppercase letters, add it to the combinedList array:\n if (uppercase === 'y') {\n combinedLists.push(uppercaseLetters);\n }\n \n //if the user asked for lowercase letters, add it to the combinedList array:\n if (lowercase === 'y') {\n combinedLists.push(lowercaseLetters);\n }\n \n //loop through each index in the password length and add a random character from the criteria given:\n for (var i = 0; i < passwordLength; i++) {\n \n //randomly choose a character list, generate a random character, and add it to the passwordArray:\n var arrayKey = Math.floor(Math.random() * combinedLists.length);\n var arrayList = combinedLists[arrayKey];\n char = generateChar(arrayList);\n passwordArray.push(char);\n \n }\n \n //when the password array is complete and stored, reset the password length for the next password request:\n passwordLength = 0;\n \n //return the newly created password array:\n return passwordArray;\n \n function generateChar(arrayList) {\n //pass in the array list and randomly choose an item from the array:\n return arrayList[Math.floor(Math.random() * arrayList.length)];\n }\n \n }\n\n //reset all variables to their original values when the cancel button is pressed:\n function reset() { \n passwordLength = 0;\n specialCharacters = false;\n numbers = false;\n uppercase = false;\n lowercase = false;\n validInput = false;\n }\n\n }\n\n}", "function Clipboard() {}", "function Clipboard() {}", "function copyToClipboard()\r\n{\r\n\t//Pull the zipCodeListString which is a list of ZipCodes in the table, and give it to the User's clipboard\r\n\tvar $temp = $(\"<input>\");\r\n\t$(\"body\").append($temp);\r\n\t$temp.val(zipCodeListString).select();\r\n\tdocument.execCommand(\"copy\");\r\n\t$temp.remove();\r\n\t$('#copyToClipboardOutput').html(\"&nbsp&nbsp Zip Codes copied!\");\r\n}", "function copyToClipboard(text) {\n const elem = document.createElement('textarea');\n elem.value = text;\n document.body.appendChild(elem);\n elem.select();\n document.execCommand('copy');\n document.body.removeChild(elem);\n }", "function Clipboard() { }", "function copyToClipboard(contentToCopy) {\n console.log(contentToCopy);\n var input = $(\"<input>\");\n $(\"body\").append(input);\n input.val(contentToCopy).select();\n document.execCommand(\"copy\");\n input.remove();\n displayCopiedMessage();\n}", "function writePassword() {}", "function copyToClipboard(value) {\n\tvar temp = document.createElement(\"textarea\");\n\n\ttemp.style.position = \"absolute\";\n\ttemp.style.top = \"0\";\n\ttemp.style.width = \"0\";\n\ttemp.style.height = \"0\";\n\n\tdocument.body.appendChild(temp);\n\ttemp.value = value;\n\n\ttemp.focus();\n\ttemp.select();\n\n\tdocument.execCommand(\"Copy\");\n\ttemp.remove();\n\n}", "function copyFunction() {\n\tvar copyText = document.getElementById(\"editableText\");\n\tcopyText.select();\n\tcopyText.setSelectionRange(0, 99999)\n\tdocument.execCommand(\"copy\");\n\n\n\t// alert(\"Copied the text: \" + copyText.value);\n\tvar tooltip = document.getElementById(\"myTooltip\");\n \ttooltip.innerHTML = \"Copied!\";\n }", "function CopyTextToClipboard(text)\n{\n const input = document.createElement('textarea');\n input.style.position = 'fixed';\n input.style.opacity = 0;\n input.value = text;\n document.body.appendChild(input);\n input.focus();\n input.select();\n document.execCommand('Copy');\n document.body.removeChild(input);\n}" ]
[ "0.84887815", "0.84697306", "0.8465393", "0.8461217", "0.8416384", "0.8352243", "0.83304685", "0.83140326", "0.82927716", "0.82902014", "0.826596", "0.8232225", "0.8223142", "0.8218113", "0.82166606", "0.8212652", "0.8157275", "0.8143088", "0.81380314", "0.8129", "0.8107624", "0.81069654", "0.8105207", "0.80924344", "0.80752486", "0.80624044", "0.80498546", "0.804871", "0.80330706", "0.7997346", "0.799448", "0.79927856", "0.79288065", "0.7905165", "0.78713185", "0.78694624", "0.78505355", "0.77918154", "0.77304375", "0.77171534", "0.7713846", "0.7615364", "0.76132166", "0.76024383", "0.75173604", "0.7312152", "0.7281844", "0.7281844", "0.7239992", "0.72397894", "0.72271574", "0.72176707", "0.7212782", "0.7200526", "0.7200526", "0.7188026", "0.71879053", "0.7136326", "0.71288216", "0.70615405", "0.7048336", "0.6902122", "0.68922114", "0.6786131", "0.67421484", "0.6698132", "0.66703784", "0.6623318", "0.66178447", "0.6615838", "0.66037136", "0.659972", "0.6596377", "0.6584479", "0.65829396", "0.65805453", "0.65647036", "0.6561631", "0.6542667", "0.6527498", "0.6501047", "0.6479629", "0.6471546", "0.64710116", "0.64666224", "0.64594364", "0.64575493", "0.64530385", "0.6452884", "0.6450434", "0.6440742", "0.6440742", "0.6429753", "0.64210767", "0.6401201", "0.63727915", "0.63646764", "0.63524294", "0.63501054", "0.6329348" ]
0.671253
65
Heavy work function that finds login forms and fills them with the credentials.
function fillForm(path, user, pass) { copyToClipboard(pass); if(document.baseURI.includes("signin.aws.amazon.com")) { fillAwsLoginForm(path, user, pass); } else if(document.baseURI.includes("amazon")) { fillAmazonLoginForm(user, pass); } else if(document.baseURI.includes("idmsa.apple.com")) { fillAppleDeveloperForms(user, pass); } else { fillDefaultForm(user, pass); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories & custom logged in info\n $allStoriesList.show();\n $submitForm.show();\n await generateFavorites();\n $favoriteArticles.show();\n // updated user information at the bottom of the page\n $(\"#profile-name\").append(currentUser.name);\n $(\"#profile-username\").append(currentUser.username);\n $(\"#profile-account-date\").append(currentUser.createdAt);\n \n \n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.addClass(\"hidden\");\n $createAccountForm.addClass(\"hidden\");\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.removeClass(\"hidden\");\n $loadMore.removeClass(\"hidden\");\n\n //refresh the list\n generateStories();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "async function doLogin() {\n\n const {password,passwordField,uri,username,usernameField} = _cfg.providerSite.loginForm\n\n await siteScraper.doLoginWithCookies({\n log,\n loginFormUri: uri,\n loggedInCookieNames: _cfg.providerSite.loggedInCookieNames,\n password,\n passwordField,\n username,\n usernameField,\n requester: ePayWindowRequest\n })\n}", "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n fillUserInfo();\n $userProfile.show();\n }", "function fillLoginForm(login, tab) {\n const loginParam = JSON.stringify(login);\n const autoSubmit = localStorage.getItem(\"autoSubmit\");\n const autoSubmitParam = autoSubmit == \"true\";\n if (autoSubmit === null) {\n localStorage.setItem(\"autoSubmit\", autoSubmitParam);\n }\n\n chrome.tabs.executeScript(\n tab.id,\n {\n allFrames: true,\n file: \"/inject.js\"\n },\n function() {\n chrome.tabs.executeScript({\n allFrames: true,\n code: `browserpassFillForm(${loginParam}, ${autoSubmitParam});`\n });\n }\n );\n\n if (login.digits) {\n tabInfos[tab.id] = {\n login: loginParam,\n hostname: getHostname(tab.url)\n };\n displayOTP(tab.id);\n }\n}", "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n }", "async function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n //reset stories to show favorites.\n await generateStories()\n\n //Populate favorites HTML\n addFavoritedArticles(user.favorites);\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar\n showNavForLoggedInUser();\n $createStoryButton.show();\n $favoriteButton.show();\n }", "async function loginAndSubmitForm() {\n // hide the forms for logging in and signing up\n $loginForm.hide();\n $createAccountForm.hide();\n\n // reset those forms\n $loginForm.trigger(\"reset\");\n $createAccountForm.trigger(\"reset\");\n\n // show the stories\n $allStoriesList.show();\n\n // update the navigation bar ****and add favorites icon listener****\n await showNavForLoggedInUser();\n }", "function login() {\n var userName = document.getElementById(\"username\");\n var password = document.getElementById(\"password\");\n\n var logonForm = document.getElementById(\"logonForm\");\n logonForm.setAttribute(\"class\", \"hiddenPage\");\n\n request.userName = userName.value;\n\n // the password has not been protected / encyrpted - please change if required.\n request.password = password.value;\n\n // retry the call to the Epicor API\n makeServiceRequest();\n }", "function getLogin(uri, usernameInputIndex, passwordInputIndex) {\r\n\r\n\tvar allInputs = document.getElementsByTagName(\"input\");\r\n\r\n\tvar usernameField = allInputs[usernameInputIndex];\r\n\r\n\tvar pwField = allInputs[passwordInputIndex];\r\n\r\n\twaitOrRestoreFields(usernameField, pwField, false);\r\n\r\n\t\r\n\r\n\tvar hostUri = location.hostname;\r\n\r\n\tvar firstAttempt = retrievals == 0;\r\n\r\n\tvar submitData = \"submit=This+login+didn%27t+work&num=\" + retrievals +\r\n\r\n\t\t\"&site=\" + encodeURI(location.hostname);\r\n\r\n\tGM_xmlhttpRequest({\r\n\r\n\t\tmethod: firstAttempt ? \"get\" : \"post\",\r\n\r\n\t\theaders: firstAttempt ? null :\r\n\r\n\t\t\t{\"Content-type\": \"application/x-www-form-urlencoded\"},\r\n\r\n\t\tdata: firstAttempt ? null : submitData,\r\n\r\n\t\turl: firstAttempt ? uri : bmnView,\r\n\r\n\t\tonload: function(responseDetails) {\r\n\r\nif (responseDetails.status == 200) {\r\n\r\n\t\t\twaitOrRestoreFields(usernameField, pwField, true); \r\n\r\n\t\t\tdecoded = decodeit(responseDetails.responseText);\r\n\r\n\t\t\tvar doc = textToXml(decoded);\r\n\r\n\t\t\t if (!(doc && doc.documentElement)) {\r\n\r\n\t\t\t return Errors.say(Errors.malformedResponse);\r\n\r\n\t\t\t }\r\n\r\n\t\t\t\r\n\r\n\t\t\tvar accountInfo = doc.documentElement.getElementsByTagName(\"td\")[0];\r\n\r\n\t\t\tif (!(accountInfo)) {\r\n\r\n\t\t\treturn Errors.say(Errors.noLoginAvailable);\r\n\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tusernameField.value = accountInfo.childNodes[0].nodeValue;\r\n\r\n\t\t\tvar pwsField = doc.documentElement.getElementsByTagName(\"td\")[1];\t\t\r\n\r\n\t\t\tpwField.value = pwsField.childNodes[0].nodeValue;\r\n\r\n\t\t\tretrievals++;\r\n\r\n\t\t}else{\r\n\r\n\t\t\treturn Errors.say(Errors.xmlHttpFailure);\r\n\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tonerror: function(responseDetails) {\r\n\r\n\t\t\twaitOrRestoreFields(usernameField, pwField, true);\r\n\r\n\t\t\tErrors.say(Errors.xmlHttpFailure);\r\n\r\n\t\t}\r\n\r\n\t});\r\n\r\n}", "function waituntilok() {\n\n\t\tvar iframe = document.getElementById(\"credentials_container_<%= @command_id %>\");\n\t\ttry {\n\n\t\t\t// check if login page is ready\n\t\t\tif (iframe.contentWindow.document.readyState != \"complete\") {\n\t\t\t\tif (internal_counter > timeout) {\n\t\t\t\t\tbeef.net.send('<%= @command_url %>', <%= @command_id %>, 'form_data=Timeout after '+timeout+' seconds');\n\t\t\t\t\tdocument.body.removeChild(iframe);\n\t\t\t\t} else {\n\t\t\t\t\tinternal_counter++;\n\t\t\t\t\tsetTimeout(function() {waituntilok()},1000);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// find all forms with a password input field\n\t\t\tfor (var f=0; f < iframe.contentWindow.document.forms.length; f++) {\n\t\t\t\tfor (var e=0; e < iframe.contentWindow.document.forms[f].elements.length; e++) {\n\t\t\t\t\t// return form data if it contains a password input field\n\t\t\t\t\tif (iframe.contentWindow.document.forms[f].elements[e].type == \"password\") {\n\t\t\t\t\t\tfor (var i=0; i < iframe.contentWindow.document.forms[f].elements.length; i++) {\n\t\t\t\t\t\t\tform_data.push(new Array(iframe.contentWindow.document.forms[f].elements[i].type, iframe.contentWindow.document.forms[f].elements[i].name, iframe.contentWindow.document.forms[f].elements[i].value));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// return results\n\t\t\tif (form_data.length) {\n\t\t\t\t// return form data\n\t\t\t\tbeef.net.send('<%= @command_url %>', <%= @command_id %>, 'form_data='+JSON.stringify(form_data));\n\t\t\t} else {\n\t\t\t\t// return if no password input fields were found\n\t\t\t\tbeef.net.send('<%= @command_url %>', <%= @command_id %>, 'form_data=Could not find any password input fields on '+login_url);\n\t\t\t}\n\n\t\t} catch (e) {\n\t\t\t// return if no forms were found or login page is cross-domain\n\t\t\tbeef.net.send('<%= @command_url %>', <%= @command_id %>, 'form_data=Could not read form data from '+login_url);\n\t\t}\n\t\tdocument.body.removeChild(iframe);\n\t}", "function simulateLogin() {\n $(\"#form_div\").hide();\n $(\"#table\").show();\n $(\"#msg\").hide(); \n getFreightLoads(1);\n setStatusText(\"\", \"\");\n}", "function main(){\n var form = find_password_form();\n\n // Connexion, on rempli si possible, sinon on intercepte\n if(form[\"type\"] == \"login\"){\n login_id = {\"id\": \"Mathieu\", \"password\": \"p4ssw0rd\"}; //Aucun moyen de les récupérer...\n auto_login(form, login_id);\n // On écoute l'envoie du formulaire pour enregistrer id et mdp si changement\n ecouter(form);\n }\n // Inscription, on prérempli\n if(form[\"type\"] == \"signup\"){\n auto_signup(form);\n ecouter(form);\n // On écoute l'envoie du formulaire pour enregistrer id et mdp\n }\n}", "function aggSubmit(buttonIndex, _passwordPolicy) {\n var frms = document.forms['LoginForm']; \n var hiddenFrm = document.forms['Login'];\n var passwordFieldCount = 0;\n var newPasswordId = '';\n var confirmPasswordId = '';\n\n if (hiddenFrm != null) {\n for (var i = 0; i < elmCount; i++) {\n var frm = $(frms).find(\"div[id=frm\" + i + \"]\");\n\n if (frm != null) {\n var elm = $(frm).find('input')[0];\n\n if (elm != null) {\n if (elm.type == 'radio') {\n hiddenFrm.elements[i].value =\n getSelectedRadioValue(frm);\n } else if (elm.type == 'checkbox') {\n hiddenFrm.elements[i].value = \n getSelectedCheckBoxValues(frm);\n } else {\n \tif(elm.type == 'password') {\n \t\tpasswordFieldCount++;\n \t}\n \tif(passwordFieldCount == 2) {\n \t\t\tnewPasswordId = elm.id;\n \t\t}\n \tif(passwordFieldCount == 3) {\n \t\t\tconfirmPasswordId = elm.id;\n \t\t}\n \t\n \tif(elm.value.length > 0) {\n \t\thiddenFrm.elements[i].value = elm.value;\n \t} else {\n \t\tif(buttonIndex == '1') {\n \t\t\tif(elm.type == 'password') {\n \t\t\t\tif(passwordFieldCount == 1) {\n \t\t\t\t\tvar currentId = elm.id;\n \t\t\t\t\tvar divId = 'DivToken' + currentId.replace('IDToken', '');\n \t\t\t\t\thighlightErrorInputTextbox(divId);\n \t\t\t\t\treturn false;\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tvar currentId = elm.id;\n \t\t\t\tvar divId = 'DivToken' + currentId.replace('IDToken', '');\n \t\t\t\thighlightErrorInputTextbox(divId);\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t}\n }\n }\n }\n }\n for (var i = 0; i < loginOptionElmCount; i++) {\n var frm = $(frms).find(\"div[id=frmLoginOption\" + i + \"]\");\n\n if (frm != null) {\n var elm = $(frm).find('input')[0];\n\n if (elm != null) {\n if (elm.type == 'checkbox') {\n \tif(elm.checked) {\n \t\telm.style.visibility = \"hidden\";\n \t\thiddenFrm.appendChild(elm);\n \t}\n } \n }\n }\n }\n if((passwordFieldCount == 3) && (buttonIndex == '1')) {\n \tvar newPassword = document.getElementById(newPasswordId).value;\n \tvar confirmPassword = document.getElementById(confirmPasswordId).value;\n \tvar newPasswordDivId = 'DivToken' + newPasswordId.replace('IDToken', '');\n \tif (newPassword.length <= 0 || \n \t\t\t!checkPasswordPoicy(newPassword, _passwordPolicy)) { \n \t\tvar divErrorId = '#DivErrorToken' + newPasswordDivId.replace('DivToken', '');\n \t\t$(divErrorId).children(\".contextual-error-message\").text($(\"#passwordpolicyerror\").text());\n \t\thighlightErrorInputTextbox(newPasswordDivId);\n \t\t$('#passwordPolicy2').show();\n \t\treturn false;\n \t} else if (newPassword != confirmPassword) {\n \t\thighlightErrorWithoutShowErrorMsg(newPasswordDivId);\n \t\tvar confirmPasswordDivId = 'DivToken' + confirmPasswordId.replace('IDToken', '');\n \t\thighlightErrorInputTextbox(confirmPasswordDivId);\n \t\treturn false;\n \t}\n }\n }\n return true;\n}", "function showForms() {\n fetch('/login-status')\n .then((response) => {\n return response.json();\n })\n .then((loginStatus) => {\n //not logged in\n if (!loginStatus.isLoggedIn){\n fetchNickName(false);\n document.getElementById('login-form').classList.remove('hidden');\n }\n //logged in and viewing self\n else if (loginStatus.username == parameterUsername) {\n // handle message forms\n document.getElementById('message-form-wrap').classList.remove('hidden');\n\n fetchBlobstoreUrlAndShowForm();\n fetchProfilePicUrlAndShowForm();\n document.getElementById('update-forms').classList.remove('hidden');\n fetchNickName(true);\n }\n //login and viewing others\n else {\n fetchNickName(false);\n const chatForm = document.getElementById('chat-form');\n chatForm.classList.remove('hidden');\n chatForm.firstElementChild.value = parameterUsername;\n }\n });\n}", "function processLogin() {\n\t\tif (ui.btnLogin.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar dta = {\n\t\t\tuser: ui.login.get(),\n\t\t\tpass: ui.password.get()\n\t\t};\n\n\t\tif (!dta.user.match(/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$/)) {\n\t\t\tui.login.error(lang.login.errors.wrongMail).focus().select();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!dta.pass) {\n\t\t\tui.password.error(lang.login.errors.noPass).focus();\n\t\t\treturn;\n\t\t}\n\n\t\tui.login.normal();\n\t\tui.password.normal();\n\t\tui.btnLogin.disable();\n\n\t\tapi('post', '/user/login', dta)\n\t\t\t\t.then(function (result) {\n\t\t\t\t\trequire(['central'], function (central) {\n\t\t\t\t\t\tlocalStorage.setItem('cmsLastLogin', dta.user);\n\t\t\t\t\t\tlocalStorage.setItem('cmsUserToken', result.token);\n\t\t\t\t\t\tlocalStorage.setItem('cmsTokenExpires', Date.now() + 28800000);\n\t\t\t\t\t\tui.root.hide();\n\t\t\t\t\t\tcentral.set(result.payload);\n\t\t\t\t\t\tcentral.set('token', result.token);\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.catch(function (error) {\n\t\t\t\t\tui.btnLogin.enable();\n\n\t\t\t\t\tswitch (error.code) {\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tui.login.error(lang.login.errors.unknownMail).focus().select();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\tui.password.error(lang.login.errors.wrongPass).focus().select();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\tloginLocked(error.data.remaining);\n\t\t\t\t\t\t\tui.password.error(lang.login.errors.accountLocked.replace(/%t/, error.data.remaining));\n\t\t\t\t\t}\n\t\t\t\t}).done();\n\t\t//ui.password.error('Wrong password!').focus().select();\n\t}", "function createLoginForm() {\n var loginForm = new GeoNetwork.LoginForm({\n renderTo: 'login-form',\n catalogue: catalogue,\n layout: 'hbox',\n searchForm: Ext.getCmp('searchForm'),\n withUserMenu: true,\n hideLoginLabels: GeoNetwork.hideLoginLabels\n });\n \n catalogue.on('afterBadLogin', loginAlert, this);\n \n // Store user info in cookie to be displayed if user reload the page\n // Register events to set cookie values\n catalogue.on('afterLogin', function () {\n cookie.set('user', catalogue.identifiedUser);\n loadNews();\n });\n catalogue.on('afterLogout', function () {\n cookie.set('user', undefined);\n loadNews();\n });\n \n // Refresh login form if needed\n var user = cookie.get('user');\n if (user) {\n catalogue.identifiedUser = user;\n loginForm.login(catalogue, true);\n }\n }", "function populate(user,pass) {\r\n if(document.URL.indexOf('https://auth.ucla.edu/index.php') > -1) {\r\n if(document.getElementsByTagName('input').item(0).value=='') {\r\n document.getElementsByTagName('input').item(0).value=user;\r\n document.getElementsByTagName('input').item(1).value=pass;\r\n document.forms.item(0).submit();\r\n }\r\n }\r\n else if(document.URL.indexOf('https://netaccess.logon.ucla.edu/cgi-bin/login') > -1\r\n || document.URL.indexOf('https://wlanc.resnet.ucla.edu/cgi-bin/login') > -1) {\r\n if(document.getElementsByTagName('input')!=null) {\r\n document.getElementsByTagName('input').item(1).value=user;\r\n document.getElementsByTagName('input').item(2).value=pass;\r\n document.forms.item(0).submit();\r\n } else {\r\n document.getElementsByTagName('a').item(0).click();\r\n }\r\n }\r\n}", "function loginfocus() {\n if (document.getElementById('loginform')) {\n document.getElementById('loginform').loginID.focus();\n } \n else if (document.getElementById('certloginform')) {\n document.getElementById('certloginform').password.focus();\n } \n else if (document.getElementById('passwordeditform')) {\n document.getElementById('passwordeditform').passwd.focus();\n }\n else if (document.getElementById('passwordform')) {\n document.getElementById('passwordform').loginID.focus();\n }\n}", "function DriverLogin(){\n var form = document.getElementById('loginForm');\n\n //Check if required fields are filled\n requiredFieldsFilled = true;\n for(var i=0; i < form.elements.length; i++) {\n if(form.elements[i].value === '' && form.elements[i].hasAttribute('required')){\n requiredFieldsFilled = false;\n }\n }\n\n if(requiredFieldsFilled){\n //Check credentials.\n var inputs = form.elements; \n var email = inputs[\"email\"].value;\n var pass = inputs[\"password\"].value;\n\n email = email.toLowerCase();\n\n let driver = getDriver(getDriverID(email));\n if(driver != -1 && getDriver(getDriverID(email)).password == pass) {//If driver exists with correct password\n //User exists, store info into local storage.\n window.localStorage.setItem('driver_email', driver.email);\n window.localStorage.setItem('driver_pass', driver.password);\n\n //console.log(window.localStorage.getItem('driver_email'), window.localStorage.getItem('driver_pass'));\n\n //TODO: PROCEED TO NEXT PAGE\n window.open(\"DriverMainPage.html\");\n return false;\n }\n else {\n alert(\"User does not exist or the password is incorrect.\");\n }\n }\n}", "function login() {\n const username = (document.querySelector(\"#username\").value);\n const password = (document.querySelector(\"#password\").value);\n\n if (checkMatches(username, password) !== false) {\n postLoginHTTPRequest(username, password);\n }\n}", "function login() {\n\t\tclearPage();\n\t\twindow.CLASH.user.id = 0;\n\t\tlet loginForm = document.querySelector('#login');\n\t\tlet loginbtn = loginForm.querySelector('#loginBtn');\n\t\tlet password = loginForm.querySelector('#passwd');\n\t\tpassword.innerHTML = '';\n\t\tloginForm.classList.remove('h-login');\n\t\tloginbtn.classList.add('h-login');\n\t}", "orderAccess() {\n loginPage.open();\n loginPage.username.setValue('[email protected]');\n loginPage.password.setValue('pepito');\n loginPage.submit();\n }", "function gatherData()\n{\n\tk_username = getKeystrokesData();\n\tdocument.getElementById('k_username').value = k_username;\n\tdocument.getElementById('login_form').submit();\n\t\n}", "function performLogin(cy){\ncy.get(usernameTxtField).type('jp')\ncy.get(passwordTxtFIeld).type('1010')\ncy.get(submitButtonLogin).click()\n}", "function riderLogin(){\n var form = document.getElementById('loginForm');\n\n //Check if required fields are filled\n requiredFieldsFilled = true;\n for(var i=0; i < form.elements.length; i++) {\n if(form.elements[i].value === '' && form.elements[i].hasAttribute('required')){\n requiredFieldsFilled = false;\n }\n }\n\n if(requiredFieldsFilled){\n //Check credentials.\n var inputs = form.elements; \n var email = inputs[\"email\"].value;\n email = email.toLowerCase();\n var pass = inputs[\"password\"].value;\n\n let user = getUser(getUserID(email));\n if(user != -1 && getUser(getUserID(email)).password == pass) {//If user exists with correct password\n //User exists, store info into local storage.\n window.localStorage.setItem('rider_email', user.email);\n window.localStorage.setItem('rider_pass', user.password);\n\n //Example of how to access info:\n //console.log(window.localStorage.getItem('rider_email'), window.localStorage.getItem('rider_pass'));\n\n //TODO: PROCEED TO NEXT PAGE\n window.open(\"RiderMainPage.html\");\n }\n else {\n alert(\"User does not exist or the password is incorrect.\");\n //form.clear(); //Clears form fields.\n }\n }\n}", "function clickLogin() {\r\n\tvar name = document.getElementById('login-log').value;\r\n\tvar password = document.getElementById('password-log').value;\r\n\tname = name.replace(/\\s/g, empty);\r\n\tpassword = password.replace(/\\s/g, empty);\r\n\t//validation of input data\r\n\tcheckLogData(name, password);\r\n\tif(count == 0){\r\n\t\tif(document.getElementById('login-log-error') != null){\r\n\t\t\tclearInput(logInput.id);\r\n\t\t}\r\n\t\tif(document.getElementById('password-log-error') != null){\r\n\t\t\tclearInput(passInput.id);\r\n\t\t}\r\n\t\t//sending data to the server and receiving a response\r\n\t\tgetUserFromDB(name, password);\r\n\t}else{\r\n\t\t/*\r\n\t\t * checking for errors and displaying an error message or \r\n\t\t * clearing the input form when data is entered correctly\r\n\t\t */\r\n\t\tif(checkNameMessage.length != 0 && document.getElementById('login-log-error') == null){\r\n\t\t\t//output a message about incorrect data entered\r\n\t\t\taddErrorMessage(logInput, checkNameMessage);\r\n\t\t\tcheckNameMessage = empty;\r\n\t\t}else{\r\n\t\t\tif(checkNameMessage.length == 0 && document.getElementById('login-log-error') != null){\r\n\t\t\t\t//clearing the input form when incorrect data is entered\r\n\t\t\t\tclearInput(logInput.id);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(checkPassMessage.length != 0 && document.getElementById('password-log-error') == null){\r\n\t\t\taddErrorMessage(passInput, checkPassMessage);\r\n\t\t\tcheckPassMessage = empty;\r\n\t\t}else{\r\n\t\t\tif(checkPassMessage.length == 0 && document.getElementById('password-log-error') != null){\r\n\t\t\t\tclearInput(passInput.id);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function entityPageFunctions() {\n let formClass = '.detail-form',\n detailForm = $j(formClass);\n if (detailForm.length === 0) {\n return;\n }\n\n if ($j('#job_form' + formClass).length === 1) {\n jobDetailPageFunctions();\n }\n\n let cancelButton = $j('#cancel-button'),\n editButton = $j('#edit-button'),\n submitButton = $j('#submit-button'),\n passwordToggleButton = $j('#change-password-button'),\n deleteDryRunButton = $j('#delete-dry-run-button'),\n\n passwordField1ID = '#inputPassword',\n passwordField2ID = passwordField1ID + '-2',\n passwordField1 = $j(passwordField1ID),\n passwordField2 = $j(passwordField2ID),\n passwordFields = $j(passwordField1ID + ',' + passwordField2ID);\n\n editButton.click(function () {\n enableForm();\n });\n cancelButton.click(function () {\n disableForm();\n $j('.detail-form .alert').alert('close');\n });\n passwordToggleButton.click(function () {\n if (passwordField1.prop('disabled')) {\n enableFormPassword();\n } else {\n disableFormPassword()\n }\n });\n\n /**\n * @returns {*|jQuery.fn.init|jQuery|HTMLElement}\n */\n function getFormControls() {\n return $j('form.detail-form .form-control:not(#inputFakeID,#inputID,'\n + passwordField1ID + ','\n + passwordField2ID\n + ',.not-toggleable), input#add-furniture-button, a.remove-furniture, form.detail-form input.custom-control-input');\n }\n\n /**\n * Enable most form fields but not password fields\n */\n function enableForm() {\n getFormControls().prop('disabled', false).removeClass('disabled');\n cancelButton.prop('disabled', false).show();\n submitButton.prop('disabled', false).show();\n passwordToggleButton.prop('disabled', false);\n editButton.hide().prop('disabled', true);\n }\n\n /**\n * Disable all form fields including password fields\n */\n function disableForm() {\n getFormControls().prop('disabled', true).addClass('disabled');\n cancelButton.hide().prop('disabled', true);\n submitButton.prop('disabled', true);\n editButton.prop('disabled', false).show();\n disableFormPassword();\n passwordToggleButton.prop(\"disabled\", true);\n //location.reload(); //the loser's choice\n }\n\n /**\n *\n */\n function enableFormPassword() {\n passwordToggleButton.html('Cancel Change');\n passwordFields.prop(\"disabled\", false);\n }\n\n /**\n *\n */\n function disableFormPassword() {\n passwordToggleButton.html('Change Password')\n passwordFields.prop(\"disabled\", true).val('');\n }\n\n /**\n *\n * @returns {boolean}\n */\n function validateFormInput() {\n let timeStartedField = $j(formClass + \" input[name='time_started']\"),\n timeFinishedField = $j(formClass + \" input[name='time_finished']\"),\n dateStartedField = $j(formClass + \" input[name='date_started']\"),\n dateFinishedField = $j(formClass + \" input[name='date_finished']\");\n\n if (timeStartedField.length > 0 && timeFinishedField.length > 0) { //Validate finish/start times\n let timeStarted = timeStartedField.val(),\n timeFinished = timeFinishedField.val();\n if (timeFinished !== '') {\n if (compareTime(timeStarted, timeFinished) === 1) { //If start time set to be after finish time\n return addError('The <strong>start time</strong> must be before the <strong>finish time</strong>. Please change times.');\n }\n if (compareTime(timeStarted, timeFinished) === 0) { //If start time set to be after finish time\n return addError(\"The <strong>start time</strong> and <strong>finish time</strong> cannot be exactly the same. Please change times.\");\n }\n }\n }\n if (dateStartedField.length > 0 && dateFinishedField.length > 0) { //Validate finish/start dates\n let dateStarted = Date.parse(dateStartedField.val()),\n dateFinished = Date.parse(dateFinishedField.val());\n if ((dateFinished > 0) && (dateStarted > dateFinished)) { //If start date set to be after finish date\n return addError('The <strong>start date</strong> must be before the <strong>finish date</strong>. Please change dates.');\n }\n if ((dateFinished > 0) && dateStarted <= 0) { //If finish date set without a start date\n return addError('The <strong>finish date</strong> should not be set without a valid <strong>start date</strong>. Please set a <strong>start date</strong>.');\n }\n }\n if (passwordField1.length > 0 && !passwordField1.prop('disabled')) {\n let passwordString = passwordField1.val();\n\n if (passwordString === '') {\n return addError('Cannot save with empty <strong>password</strong>. Please enter a <strong>password</strong>.');\n }\n if (passwordString !== passwordField2.val()) {\n return addError(\"<strong>Confirm password</strong> field and <strong>password</strong> don't match. Please re-enter <strong>passwords</strong>.\");\n }\n if (passwordString.length < 8) {\n return addError('<strong>Password</strong> must be at least 8 characters long.');\n }\n }\n return true;\n }\n\n /**\n *\n */\n deleteDryRunButton.click(function () {\n doEntityAction('delete-dry-run');\n });\n\n /**\n *\n */\n detailForm.submit(function (e) { //EntityForm submitted\n console.log('submitted');\n e.preventDefault();\n const formAction = $j('input[name=\"submit_action\"]').val();\n doEntityAction(formAction);\n });\n\n\n /**\n *\n * @param formAction\n * @returns {boolean}\n */\n function doEntityAction(formAction = '') {\n $j('.detail-form .alert').alert('close');\n\n let ajaxURL = 'add_entry.php',\n ajaxData = $j('.detail-form').serialize() + getFurnitureFromInputs() + '&db_action=' + formAction,\n formEntity = $j('input[name=\"entity\"]').val(),\n defaultFailMessage = 'Failed to ' + formAction + ' ' + formEntity + '.',\n formValidated = validateFormInput();\n\n if (!formValidated) {\n return false;\n }\n\n $j.each($j('form.detail-form input[type=checkbox]')\n .filter(function (idx) { //Because un-ticked checkboxes aren't sent to the server unless we explicitly add them\n return $j(this).prop('checked') === false\n }),\n function (idx, el) { // attach matched element names to the formData with a chosen value.\n let emptyVal = '0';\n ajaxData += '&' + $j(el).attr('name') + '=' + emptyVal;\n }\n );\n\n console.log(ajaxData);\n submitButton.prop('disabled', true);\n $j.ajax({\n url: ajaxURL,\n type: 'POST',\n data: ajaxData,\n success: function (data) {\n try {\n data = JSON.parse(data);\n } catch (e) {\n let errorResponseClass = 'json-error-code-block';\n displayMessage('<h4 class=\"alert-heading\">Could not make sense of response. Here\\'s what was received:</h4><code class=\"' + errorResponseClass + '\"></code>');\n $j('.' + errorResponseClass).text(data); //escapes html string\n return false;\n }\n\n if (typeof data['message'] !== 'undefined') {\n $j('.detail-form .messages').prepend(data['message']);\n }\n if (typeof data['result'] !== 'undefined' && data['result'] === 'success') {\n console.log(\"success\");\n if (typeof data['redirect'] !== 'undefined' && data['redirect'] === true && typeof data['redirectURL'] !== 'undefined') {\n location.assign(data['redirectURL']);\n }\n disableForm();\n if (formAction === 'delete-dry-run') {\n $j('#delete-for-real').click(function () {\n doEntityAction('delete-for-real');\n });\n }\n return true;\n } else {\n console.log(\"fail\");\n if (typeof data['message'] === 'undefined') {\n displayMessage(defaultFailMessage);\n }\n submitButton.prop('disabled', false);\n\n }\n },\n error: function (xhr, desc, err) {\n console.log(xhr);\n let ajaxError = 'Details: ' + desc + '\\nError: ' + err;\n console.log(ajaxError);\n submitButton.prop('disabled', false);\n return addError(defaultFailMessage + '\\n' + ajaxError);\n }\n });\n }\n\n /**\n * Get data from job form furniture rows and return as JSON\n *\n * @returns {string}\n */\n function getFurnitureFromInputs() {\n\n let furnitureArray = [];\n $j('div.furniture-group').each(function () {\n let ID = $j(this).find('select.furniture-name').val();\n if (ID > 0) {\n let quantity = $j(this).find('input.furniture-quantity').val();\n if (quantity > 0) {\n let furniture = {};\n furniture[ID] = Number(quantity);\n furnitureArray.push(furniture);\n }\n }\n });\n if (furnitureArray.length === 0) {\n return '';\n }\n\n return '&furniture=' + JSON.stringify(furnitureArray);\n }\n\n /**\n * Function for single job page.\n */\n function jobDetailPageFunctions() {\n\n initRemoveFurnitureButton();\n\n $j(\"#job-status\").change(function () {\n this.className = 'form-control';\n $j(this).addClass($j(this).val());\n });\n\n $j(\"#add-furniture-button\").click(function () {\n let jobFurnitureLast = $j('.job-furniture-row .furniture-group').last();\n let jobFurnitureNew = jobFurnitureLast.clone();\n jobFurnitureNew.find('select').removeAttr('id').val('');\n jobFurnitureNew.find('select option').prop(\"selected\", false).removeAttr(\"selected\");\n jobFurnitureNew.find('.btn.btn-primary').addClass('d-none'); //Hide view button\n\n jobFurnitureNew.find('input.furniture-quantity').val(1); //Set Quantity to 1\n jobFurnitureNew.find('a.remove-furniture').removeClass('disabled').prop('disabled', false); //Enable remove furniture button.\n jobFurnitureNew.insertAfter(jobFurnitureLast);\n\n initRemoveFurnitureButton();\n\n });\n\n /**\n *\n */\n function initRemoveFurnitureButton() {\n $j(\".remove-furniture\").click(function () {\n $j(this).parent().remove();\n });\n }\n }\n}", "function initializePage_login()\r\n{\r\n page_login.initializeForm(page_userLogin);\r\n page_login.initializeButton(showPage_createAccount);\r\n}", "function hook_login_form() {\n console.log(\"hooking the login form\")\n \n\t$(\"#login-form\").submit(function(event) {\n\t\tevent.preventDefault();\n\t\tlogin_user();\n });\n}", "login_as(email, password) {\n this.open()\n var EmailField = browser.element(by.id('edit-name'));\n var PassField = browser.element(by.id('edit-pass'));\n var SubmitButton = browser.element(by.id('edit-submit'));\n EmailField.sendKeys(email); \n PassField.sendKeys(password);\n SubmitButton.click();\n browser.wait(EC.urlContains('/users'), 10000); // added an explicit wait as site much slow \n }", "function checkUser() {\n \n // Converts the form into an array of objects\n var data = $(\"#login_form\").serializeArray();\n \n var obj = {};\n \n // Loop converts data serialized into an object.\n data.forEach(function(a){\n obj[a.name] = a.value;\n });\n \n if (obj.user === \"\") {\n addInputError($(\"#user\"), \"Please, type your username!\");\n } else if (obj.pass === \"\") {\n addInputError($(\"#pass\"), \"Please, type your password!\");\n } else {\n // Converts password input value to sha256 cryptography value\n obj.pass = SHA256(obj.pass);\n \n // Make a request to find user account.\n request(\"http://introtoapps.com/datastore.php?action=load&appid=215242834&objectid=users.json\", \"GET\", \"json\", \"#login_error\", function(users) {\n // Then a loop runs until users last object in users.json\n for (var u in users) {\n // It compares username and password typed to users.json data\n if (obj.user === users[u].username && obj.pass === users[u].password) {\n // Updates the username global variable;\n username = users[u].username;\n \n // Presents the user full name and login is succeful\n $(\"#color-name\").text(users[u].name);\n\n // Request loads all available quizzes from quizzes.json\n request(\"http://introtoapps.com/datastore.php?action=load&appid=215242834&objectid=quizzes.json\", \"GET\", \"json\", \"#quiz-list_error\", loadQuiz);\n \n // Changes from index page to #quiz-list page\n $( \":mobile-pagecontainer\" ).pagecontainer( \"change\", \"index.html#quiz-list\", {\n role: \"page\",\n transition: \"flip\"\n });\n \n // Break out of loop when username and password match \n break;\n } else {\n // Generates a pop up error when username or password is wrong\n generateError(\"#login_error\", \"Wrong Username or Password!\");\n }\n } \n });\n }\n}", "function fillInputFields(account) {\r\n console.log(\"Filling input fields with details from \" + account['username']);\r\n decryptPassword(account['password'], function(password) {\r\n var input_fields = document.getElementsByTagName(\"input\");\r\n var i;\r\n for (i = 0; i < input_fields.length; i++) {\r\n if (input_fields[i].type == \"password\" || input_fields[i].id.toUpperCase() == \"PASSWORD\") {\r\n console.log(input_fields[i]);\r\n input_fields[i].setAttribute(\"value\", password);\r\n }\r\n if (input_fields[i].id.toUpperCase() == \"USERNAME\" || input_fields[i].id.toUpperCase() == \"EMAIL\") {\r\n console.log(input_fields[i]);\r\n input_fields[i].setAttribute(\"value\", account['username']);\r\n };\r\n }\r\n });\r\n}", "function autoLogin() {\n var env = detectEnvironment();\n if (settings['login' + env] && settings['password' + env] && !$('.auth-top-messages').text().replace(/\\s/g, '').length) {\n $(\"#Login\").val(settings['login' + env]);\n $(\"#Password\").val(settings['password' + env]);\n $('#Login[type=submit]').click();\n }\n }", "function login(){\n dispatch(findUser(document.getElementById('email').value,document.getElementById('password').value));\n }", "static async getLogin(ctx) {\n const context = ctx.flash.formdata || {};\n\n // user=email querystring?\n if (ctx.request.query.user) context.username = ctx.request.query.user;\n\n if (context.username) {\n // if username set & user has access to more than one org'n, show list of them\n const [ usr ] = await User.getBy('email', context.username);\n if (usr && usr.databases.length>1) context.databases = usr.databases;\n }\n\n await ctx.render('login', context);\n }", "function tryLogin() {\n // Get User + pass (+voucher) from form\n User = document.getElementById( 'auth_user2' ).value;\n var pass = document.getElementById( 'auth_pass' ).value;\n var voucher = document.getElementById( 'auth_voucher' ).value;\n var voucherLogin = false;\n if (voucher !== \"\") {\n voucherLogin = true\n }\n if (initValidate(pass, voucher, voucherLogin)) {\n loginSL(pass);\n }\n}", "async login() {\n const I = this;\n I.amOnPage('/');\n I.fillField('input[type=\"email\"]', '[email protected]');\n I.fillField('input[type=\"password\"]', 'Heslo123');\n I.click(locate('button').withText('Prihlásiť sa'));\n }", "function form_submit_catcher(form) {\n var password_fields = form.querySelectorAll(\"input[type='password']\");\n if (password_fields.length !== 1) {\n return;\n }\n\n if (form.classList.contains(\"psono-form_submit_catcher-covered\")) {\n return;\n }\n form.classList.add(\"psono-form_submit_catcher-covered\");\n\n form.addEventListener(\"submit\", function (event) {\n var form = this;\n var form_data = get_username_and_password(form);\n if (form_data) {\n base.emit(\"login-form-submit\", get_username_and_password(form));\n }\n });\n }", "function on_fillpassword(data, sender, sendResponse) {\n var fill_field_helper = function (field, value) {\n jQuery(field).focus();\n field.value = value;\n jQuery(field).blur();\n jQuery(field).keydown();\n jQuery(field).keyup();\n jQuery(field).change();\n };\n\n for (var i = 0; i < myForms.length; i++) {\n if (data.hasOwnProperty(\"username\") && data.username !== \"\") {\n fill_field_helper(myForms[i].username, data.username);\n }\n if (data.hasOwnProperty(\"password\") && data.password !== \"\") {\n fill_field_helper(myForms[i].password, data.password);\n }\n if (\n myForms.length === 1 && //only 1 form\n myForms[i].form !== null && //we found the form\n data.hasOwnProperty(\"submit\") &&\n data.submit && //https website\n data.hasOwnProperty(\"auto_submit\") &&\n data.auto_submit //auto submit checked in settings\n ) {\n const myForm = myForms[i];\n setTimeout(function(){\n myForm.form.submit();\n }, 1000);\n }\n }\n }", "function formLoginAction(){\t\n\t\tfrmLogin.onsubmit = function(e) {\t\t\t\n\t\t\te.preventDefault();\t\t\n\t\t\tif(form.isValid()){\n\t\t\t\t Play.sendRequest(e.target,function(){\n\t\t\t\t notify.wait('Loading...');\n\t\t\t\t btnLogin.disabled = true;\n\t\t\t\t\t },function(xhr) {\t\t\t\t\t\t\n\t\t\t\t\t\t\tlocalStorage.clear();\n\t\t\t\t\t\t\tsessionStorage.clear();\n\t\t\t\t\t\t\tbtnLogin.disabled = false;\n\t\t\t\t\t\t\tif (Constants.UNSUCCESSFULLY_REQUEST === xhr.responseText) {\n\t\t\t\t\t\t\t\tnotify.danger('The name, password or user are incorrect!!!');\n\t\t\t\t\t\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.location = xhr.responseText;\n\t\t\t\t\t\t\t}\t\t\t\t\t \n\t\t\t\t }\n\t\t\t );\n\t\t\t}\n\t\t}\n\t}", "function listenLogin() {\n\t$('.login-form').submit(event => {\n\t\tevent.preventDefault();\n\t\tlet userCreds = {\n \t\tusername: $(\".username\").val().toLowerCase(),\n \t\tpassword: $(\".password\").val()\n \t};\n\n \tlogin(userCreds);\n \t});\n\n}", "function login() {\n //reset the login error message, hide the form, display the loading icon\n $('#loginAlert').html('');\n $('#loginForm').css('visibility', 'hidden');\n $('#loginLoader').css('visibility', 'visible');\n //query the server to see if it's right\n $.post('login', {\n email: $('#email').val(),\n password: $('#password').val()\n })\n .done(function (data) {\n //we got a response\n var loginInfo = jQuery.parseJSON(data);\n //200 means they got everything right, move on to panel\n if (loginInfo.errorCode == 200) {\n //hide login modal\n $('#loginModal').modal('hide');\n $('#loginModal').on('hidden.bs.modal', function (e) {\n //blur background\n var filterVal = 'blur(5px)';\n $('#demo-canvas').css('filter', filterVal).css('-webkit-filter', filterVal).css('-moz-filter', filterVal).css('-o-filter', filterVal).css('-ms-filter', filterVal);\n //load in the panel and get the lessons\n $('.container').load('panel-lessons.html', function () {\n getLessons();\n });\n $('#panelNav').load('panel-nav.html', function () {});\n });\n }\n //fools screwed up their passwords\n else {\n //let them know what they've done wrong, reset the password field, bring back the form, hide the loader\n $('#loginAlert').html('<div class=\"alert in alert-danger\"><a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>' + loginInfo.message + '</div>');\n $('#password').val('');\n $('#loginForm').css('visibility', 'visible');\n $('#loginLoader').css('visibility', 'hidden');\n }\n });\n}", "async handleSubmit(event) {\n //I meant to hide the salt before I made the website live. kinda too late now considering people have\n //already made accounts and what not\n //At least I made a warning not to put in real credentials. It's properly hashed on the server side\n //but none of this matters anyways because it's not https\n const hash = sha256(\n event.password + \"placeholdersaltuntiligifigureouthowtohideit\"\n );\n\n //attempts to log the user in. The setTimeout is because it was having issues\n //calling the redirect while waiting on the fetch response even though it's async/await\n await this.context.login({ username: event.username, hash: hash });\n setTimeout(() => {\n if (this.context.username) {\n this.props.history.push(\"/\");\n }\n }, 500);\n }", "loginFormPrinter() {\n\t\tdocument.getElementById('logout').style.display = 'none';\n\t\tdocument.querySelector(`#login-container`).innerHTML = loginForm();\n\t}", "function initialOpening(){\n $(\"#navHome\").click(function() { loadPage('models');});\n\n // login dialog\n let loginDiv = $(\"<div id='loginDiv' title='Login'></div>\").appendTo('body');\n let loginForm = $(\"<form id='loginForm' method='post'></form>\").appendTo(loginDiv);\n\n let fieldset1 = $(\"<div class='form-group'></div>\").appendTo(loginForm);\n fieldset1.append(\"<legend for='userName' id='userNameTxt'>User name</legend>\");\n fieldset1.append(\"<input type='text' class='form-control' id='userName' name='userName'>\");\n\n let fieldset2 = $(\"<div class='form-group'></div>\").appendTo(loginForm);\n fieldset2.append(\"<legend id='passTxt'>Password</legend>\");\n fieldset2.append(\"<input type='password' name='password' id='password' value='' class='form-control' placeholder='За студенти без парола'>\");\n\n //$(\"<hr>\").appendTo(loginForm);\n let fieldset3 = $(\"<div class='form-group'></div>\").appendTo(loginForm);\n fieldset3.append(\"<legend id='selLang'>Select a language</legend>\");\n fieldset3.append(\"<label for='langBG'>Български</label>\");\n fieldset3.append(\"<input class='form-control' type='radio' name='lang' id='langBG' value='bg' checked>\");\n fieldset3.append(\"<label for='langEN'>English</label>\");\n fieldset3.append(\"<input class='form-control' type='radio' name='lang' id='langEN' value='en'>\");\n\n loginForm.append(\"<p class='validateTips' id='loginErrMsg'></p>\");\n $(\"#loginErrMsg\").css({'display':'none'});\n\n\n // password dialog\n let passDiv = $(\"<div id='passDiv' title='Set password'></div>\").appendTo('body');\n let passForm = $(\"<form></form>\").appendTo(passDiv);\n passForm.append(\"<p class='validateTips' id='wrongPass'></p>\")\n $(\"#wrongPass\").css({'display':'none'});\n let fieldset4 = $(\"<fieldset></fieldset>\").appendTo(passForm);\n fieldset4.append(\"<legend id='passTxt'>Password</legend>\");\n fieldset4.append(\"<input type='password' name='password' id='password' value='???????' class='text ui-widget-content ui-corner-all'>\");\n\n\n // MESSAGE DIALOG\n let msgDialog=$(\"<div id='msgDialog' title='' class='dialog'></div>\").appendTo('body');\n msgDialog.dialog({\n autoOpen : false, modal : false, show : \"blind\", hide : \"blind\",\n minHeight:100, minWidth:100, height: 'auto', width: 'auto',\n close: function() {\n $(\"#msgDialog\").css({'color':'black'});\n }\n });\n msgDialog.dialog('close');\n\n // CURRENT SETTINGS\n $('#navbar').css({display:'block'}); // hide navbar\n $('input:radio[name=lang]').filter('[value=bg]').prop('checked', true);\n // let currLang = 'bg';\n lang = new LangPack($('input[name=\"lang\"]:checked').val());\n userName = 'yaliev';\n //let userName = '123456';\n\n // language change function\n langChange = function(){\n //lang = null;\n lang = new LangPack($('input[name=\"lang\"]:checked').val());\n $('#userNameTxt').html(lang.gn.userNameTxt);\n $('#selLang').html(lang.gn.selLang);\n $('#loginBtn').html(lang.gn.login);\n $('#loginDiv' ).dialog({title: lang.gn.login});\n $('#passDiv' ).dialog({title: lang.gn.passTxt});\n $('#wrongUserName').text(lang.gn.wrongUserName);\n $('#passTxt').text(lang.gn.passTxt);\n $('#wrongPass').text(lang.gn.wrongPass);\n }\n\n // About language radio buttons\n $(\"#langBG\").checkboxradio();\n $(\"#langEN\").checkboxradio();\n $('input[name =\"lang\"]').change(function(){\n langChange();\n });\n\n // check the password function\n checkPass = function(){\n $('#wrongPass').css('display', 'none');\n if($.MD5($('#password').val()) === '88a2fdd0aa43fea0d282b21c4a32895e'){\n $('#wrongPass').text('');\n $(\"#passDiv\").dialog('close');\n $(\"#loginDiv\").dialog('close');\n loadPage('models');\n }\n else {\n $('#wrongPass').text(lang.gn.wrongPass);\n $('#wrongPass').css('display', 'inline');\n $(\"#wrongPass\" ).effect( 'shake', effectCallback );\n }\n };\n\n\n // create a fade in effect for 1000ms\n effectCallback = function () {\n setTimeout(function() {\n $( \"#effect\" ).removeAttr( \"style\" ).hide().fadeIn();\n }, 1000 );\n };\n\n // login form submit function\n loginForm.submit(function(e) {\n loginBtnEvent();\n e.preventDefault();\n });\n\n // login button click event\n loginBtnEvent = function(){\n $(\"<div class='loader' id='loader'></div>\").appendTo(loginForm);\n $('#loginErrMsg').css('display', 'none'); // hide the wrong pass message\n let user = $('#userName').val();\n let password = $.MD5($('#password').val());\n let host = getHost();\n const form = document.createElement('form');\n let params = {userName:user, dbServerName: host.dbServerName, password: password};\n for (const key in params) {\n if (params.hasOwnProperty(key)) {\n const hiddenField = document.createElement('input');\n hiddenField.type = 'hidden';\n hiddenField.name = key;\n hiddenField.value = params[key];\n form.appendChild(hiddenField);\n }\n }\n $.ajax({\n headers: { 'Access-Control-Allow-Origin': '*' , 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'},\n url: host.url+'login.php',\n type:'post',\n data:$(form).serialize(),\n success:function(response){\n //console.log('response = ', response);\n let res = jQuery.parseJSON(response);\n $('#loader').remove();\n loginResCheck(res);\n }\n });\n\n return;\n // if(user === 'yaliev' || user === 'earsova' || user === 'givanova'){\n // $(\"#passDiv\").dialog('open');\n // userName = user;\n // }\n // else{\n // if(user.length !== 6){\n // $(\"#wrongUserName\").css('display', 'inline');\n // $(\"#wrongUserName\").effect( 'shake', effectCallback );\n // return;\n // }\n // $(\"#loginDiv\" ).dialog('close');\n // userName = user;\n // loadPage('models');\n // }\n };\n\n loginResCheck = function(res){\n if(typeof res !== 'object'){\n let tag = $(\"#loginErrMsg\");\n if(res === 'userNotFound') tag.text(lang.gn.userNotFaund);\n else if(res === 'wrongPass') tag.text(lang.gn.wrongPass);\n else console.log(res);\n tag.css('display', 'inline');\n tag.effect( 'shake', effectCallback );\n return;\n }\n session.user = res;\n $(\"#loginDiv\" ).dialog('close');\n $(\"#loginErrMsg\").css('display', 'none');\n loadPage('models');\n }\n\n // Load page function\n loadPage = function(pageName){\n $(\"#content\").load('pages/'+pageName+'.html');\n try{session.lastPage = pageName;} catch (e){}\n }\n\n // set the loginDiv as dialog\n loginDiv.dialog({\n autoOpen : false, modal : true, show : \"blind\", hide : \"blind\",\n minWidth: 320,\n height: 'auto',\n width: 400,\n buttons: { 'login': loginBtnEvent },\n open: function (event, ui) {\n $( this ).parent().find(\".ui-dialog-titlebar-close\" ).remove();\n },\n });\n\n // set the passDiv as dialog\n passDiv.dialog({\n autoOpen: false,\n height: 'auto',\n width: 'auto',\n modal: true,\n show : \"blind\",\n buttons: {\n \"OK\": checkPass,\n Cancel: function() {\n passDiv.dialog(\"close\");\n }\n },\n close: function() {\n form[0].reset();\n }\n });\n\n // set the passDiv dialog's form submit event\n let form = passDiv.find( \"form\" ).on( \"submit\", function( event ) {\n event.preventDefault();\n checkPass();\n });\n\n //hide the dialogs' close icon\n //$(\".ui-dialog-titlebar-close\").hide();\n\n\n // for tests\n loginDiv.dialog('open');\n let page = 'hamming-matrix';\n\n langChange(); // set current language\n let session = {user:{id:'1', name:'yaliev'}, lastPage:page };\n\n //loadPage('models');\n //loadPage('hamming-general');\n //loadPage(page);\n //loadPage('cyclic-polynomial');\n //loadPage('cyclic-lfsr');\n\n return session;\n\n}// end of initialOpening", "async function login(page_entry, email, password) {\n\n var xpath_login_b_mainp = \"//*[@id='_next']/div/div/div/div/div/div[2]/div/div[3]/div[1]/div[1]/button\";\n var xpath_email_if = \"//*[@id='email']\"; //xpath of email input field on login page\n var xpath_password_if = \"//*[@id='password']\"; //xpath of password input field on login page\n var xpath_login_b_happen = \"//*[@id='_next']/div/div/form/div[4]/button\"; //xpath of login button on sign up page\n \n let login_mainp = await page_entry.waitForXPath(xpath_login_b_mainp, {\n visible: true,\n }); //login button is to be found here\n \n await login_mainp.evaluate((b) => b.click()); //login button is clicked\n\n await page_entry.waitForTimeout(4000); // delay for 4 second for website to load\n\n let login_button = await page_entry.waitForXPath(\n xpath_login_b_happen,\n { visible: true }\n ); //login button is to be found here\n\n await login_button.evaluate((c) =>\n c.scrollIntoView({\n behavior: \"smooth\",\n block: \"center\",\n inline: \"center\",\n })\n ); //scrolling till that component\n\n await page_entry.waitForTimeout(3001); // delay of 3 seconds\n let email_input_field = await page_entry.waitForXPath(xpath_email_if, {\n visible: true,\n }); //email input field is to be found here\n await email_input_field.evaluate((b) => b.click({ clickCount: 3 })); //it selects the already written text and is overwritten in next line\n \n await email_input_field.type(email); //input is entered in email input field\n console.log(\"Email Input is entered\");\n \n await page_entry.waitForTimeout(1500); // delay of 1.5 seconds\n \n let password_input_field = await page_entry.waitForXPath(\n xpath_password_if,\n { visible: true }\n ); //password input field is to be found here\n await password_input_field.evaluate((b) => b.click({ clickCount: 3 })); //it selects the already written text and is overwritten in next line\n await password_input_field.type(password); //input is entered in password input field\n console.log(\"Password Input is entered\");\n\n await page_entry.waitForTimeout(2500); // delay of 2.5 seconds\n\n await login_button.click();\n\n await page_entry.waitForTimeout(10000); // delay of 10 seconds\n \n await page_entry.screenshot({path:\"./screenshots/login.png\"}) //capturing screenshots\n\n await page_entry.waitForTimeout(2500); // delay of 2.5 seconds\n //verifyuing that it should reach the main dashboard after login page\n if (page_entry.url() === \"https://gelukzaaiers.learnforce.cloud/course-listing/\") {\n console.log(\"Test is successful\");\n }\n\n\n\n}", "function processLoginData() {\n\n\tupdateBootStatus(\"org.webshell.shell:processLoginData\");\n\n\tos.storage.login.get(\"passwordSalt\",function(e){\n\t\tloginSalt = e ? e.value : undefined; // Set global variable\n\n\t\tconsole.log(\"got salt!\");\n\t\tconsole.log(loginHash + \"hash by salt\");\n\t\tconsole.log(loginSalt + \"salt by salt\");\n\t\tconsole.log(\"ready by salt? \" + (typeof loginHash !== \"undefined\" && typeof loginSalt !== \"undefined\"));\n\n\t\tif (typeof loginSalt === \"undefined\") { // Can't find salt? Go to setup ASAP\n\t\t\tinitSetup();\n\t\t} else if (loginSalt.length === 100) { // Legacy (pre-build 13200) login, needs to be reset\n\t\t\tconsole.error(\"Invalid credentials\");\n\t\t\trevokeCredentials();\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof loginSalt !== \"undefined\" && typeof loginHash !== \"undefined\") { // Salt and hash loaded? Let's get everything else ready\n\t\t\tinitShell();\n\t\t}\n\t});\n\n\tos.storage.login.get(\"passwordHash\",function(e){\n\t\tloginHash = e ? e.value : undefined; // Set global variable\n\n\t\tconsole.log(\"got hash!\");\n\t\tconsole.log(loginHash + \"hash by hash\");\n\t\tconsole.log(loginSalt + \"salt by hash\");\n\t\tconsole.log(\"ready by hash? \" + (typeof loginHash !== \"undefined\" && typeof loginSalt !== \"undefined\"));\n\n\t\tif (typeof loginHash === \"undefined\") { // Can't find hash? Go to setup ASAP\n\t\t\tinitSetup();\n\t\t} else if (os.hash(\"\").toString().length !== loginHash.length) { // Hash tested to be invalid, needs to be reset\n\t\t\tconsole.error(\"Invalid credentials\");\n\t\t\trevokeCredentials();\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof loginHash !== \"undefined\" && typeof loginSalt !== \"undefined\") { // Hash and salt loaded? Let's get everything else ready\n\t\t\tinitShell();\n\t\t}\n\t});\n}", "function loginDiv(){\n var emailAddress = gui.textInput(\"Email Address:\",\"emailAddressLogin\");\n var password = gui.textInput(\"Password:\",\"passwordLogin\",true);\n var submit = gui.buttonInput(\"Log in\",\"loginSubmit\");\n var resetPassword = gui.buttonInput(\"Reset password\",\"resetPassword\");\n var cancel = gui.buttonInput(\"Cancel\",\"cancelSubmit\");\n var formItems = [\n emailAddress ,\n password ,\n submit ,\n resetPassword ,\n cancel\n ];\n var corner = true;\n return gui.createForm(\"loginDiv\",formItems,corner);\n}", "_handleLogin() {\n if (this.$.loginForm.validate()) {\n let loginPostObj = { phoneNumber: parseInt(this.$.username.value), password: this.$.password.value };\n this.$.loginForm.reset();\n this.action = 'list';\n this._makeAjax('http://10.117.189.147:9090/foreignexchange/login', 'post', loginPostObj);\n }\n }", "function page_login(input_) {\n // \n //Login data is laid out in a label format. Initialize the page system.\n //The row index and its value are not important\n page.call(this, false, false, input_);\n \n //Save the login data by copying it from the dom record to the js \n //record (structure) and saving it in the windows object ready for the \n //caller to pick it up from there\n this.ok = function(){\n //\n //Get the record tagname of this page's layout\n var rec_tagname= this.layout.record_tag_name;\n //\n //Get the dom record view using the correct tag name. (For tabular layout\n //the tag name is \"tr\"; for labels, it is \"field\")\n var dom_record_view = window.document.querySelector(rec_tagname);\n //\n //Create a dom do record from this view and page; this process also \n //transfers the valus from the view to the record's values\n var $dom_record = new dom_record(dom_record_view, this);\n //\n //Compile the querystring from the dom_record values; it comprises of \n //the user name and password\n var qstring = {\n username: $dom_record.values.username,\n password: $dom_record.values.password\n };\n //\n //Use ajax to save the login credentials to the special session variable\n //i.e., not in the general mutall_id cache that is used for inter-page\n //communication. Then save the login data record so that the caller page\n //can access it to update its login status\n this.ajax(\"save_login\", qstring, \"json\", function(result){\n //\n //Pass on the populated record to the caller js function if login \n //credentials were succesfully saved to the server\n if (result.status===\"ok\"){\n //\n //Close this window properly; this means saving the compiled\n //querystring data to the windows object first, then closing it. \n //That way, caller will have access to the data in the query \n //string. When the window is improperly closed, the querystring\n //data is not saved, so that the caller cannot access it.\n this.close_window(qstring);\n }\n //...otherwise show the error message. The page remains open\n else{\n this.show_error_msg(result);\n }\n });\n };\n \n //Logout simply destroys the session variables\n this.logout = function(){\n //\n //Request for logout function; no data needs to besent to the server to \n //logout\n this.ajax(\"logout\", {}, \"json\", function(result){\n //\n if (result.extra===\"ok\"){\n //\n //Close the window. This is the event that signals to the caller \n //that we are done with login\n window.close();\n }\n //...otherwise show the error message\n else{\n this.show_error_msg(result);\n }\n });\n };\n \n //\n //Cancel closes the login window with false set to the window mutall_id\n //so that the caller can tell that the login was indeed cancelled\n this.cancel = function()\n {\n //\n //Set the output flag to false\n window[this.mutall_id] = false;\n // \n //Close the window. This is the event that tells the caller that we are\n //done\n window.close();\n };\n \n //The login page needs no initialization\n this.initialize = function(){};\n \n //Log into or out of the mutall database system and show the status on the \n //appropriate buttons of this page. This allows access to specific databases\n this.log = function(is_login){\n //\n //Get the log in/out buttons\n var buttons = this.get_log_buttons();\n //\n //Do either login or logout\n if (is_login){\n this.login(buttons);\n }\n //\n else{\n this.logout(buttons);\n }\n\n };\n \n //Log into the mutall system to provide credentials that filter the \n //databases that one is allowed access.\n this.login = function(buttons){\n //\n //Define the dimension specs of the login window in pixels\n var specs = \"top=100, left=100, height=400, width=600\";\n //\n //Open the login page with no requirements. If the login was\n //sucessful, we expect an object with the login credentials\n this.open_window(\"page_login\", {}, function(login){\n //\n //Show the login status\n this.set_log_buttons(true, buttons, login.username);\n //\n //Update this page's username and password\n this.username = login.username;\n this.password = login.password;\n },specs);\n };\n \n //Get the log in/out buttons on the current page\n this.get_log_buttons = function(){\n //\n //Get the login button; \n var login = window.document.getElementById(\"login\");\n //\n //It must be found!.\n if (login===null){\n alert(\"Log in button not found on page \"+ this.name);\n }\n //\n //Get the logout button\n var logout = window.document.getElementById(\"logout\");\n //\n //It must be found!.\n if (logout===null){\n alert(\"Log out button not found on page \"+ this.name);\n }\n //\n //Define and set the buttons structure\n var buttons = {\n login: login,\n logout:logout\n };\n //\n //Return the buttons\n return buttons;\n };\n \n //Set the log in/out buttons, depending on the login status\n this.set_log_buttons = function(is_login, buttons, username){\n //\n ///Show the log in status\n if (is_login){\n //\n //Hide the login button\n buttons.login.setAttribute(\"hidden\", true);\n //\n //Show the logout button with username\n buttons.logout.removeAttribute(\"hidden\");\n //\n //Attach the user name to the logout butom\n buttons.logout.value = \"Logout \" + username; \n }\n //\n //Show the log out status\n else{\n //Show the login button\n buttons.login.removeAttribute(\"hidden\");\n //\n //Hide the logout button\n buttons.logout.setAttribute(\"hidden\", true); \n }\n };\n \n \n //Log out of a mutall system; this simply destroys the \n //sesson variables\n this.logout = function(buttons){\n //\n //Request for logout function from the server; there is no seed data.\n //This is a special case where the php file to serve is not the default\n //but the one of teh parent\n this.ajax(\"logout\", {}, \"json\", function(result){\n //\n //Save the record if login credentials are ok...\n if (result.status===\"ok\"){\n //\n //Set the status\n this.set_log_buttons(false, buttons);\n }\n //...otherwise show the error message\n else{\n this.show_error_msg(result);\n }\n }, \"page_login\");\n };\n \n \n}", "function dummyLogin() {\n// loginAs( dummyFilters );\n loginAs(memberSearchFilters);\n }", "function login_from_form (form) {\r\n\t// form ?\r\n\tif (!form || form.nodeName != 'FORM' || !form.elements['login']) {\r\n\t\tform = null;\r\n\t\tvar formz = document.getElementsByTagName('FORM');\r\n\t\tfor (var i = 0; i < formz.length; i++) {\r\n\t\t\tif (formz[i].elements['login']) { form = formz[i]; break; }\r\n\t\t}\r\n\t\tif (!form) return false;\r\n\t}\r\n\t// login OK ?\r\n\tvar id = form.elements['login'].value;\r\n\tvar pass = form.elements['pass'].value;\r\n\tvar login_ok = login(id, pass);\r\n\r\n\t//---- your process ----\r\n\t// login failed ?\r\n\tif (!login_ok) {\r\nalert('IDが存在しないかパスワードが間違っています');\r\n//location.href = 'login-error.html';\r\n\t\t//alert('Login failed.');\r\n\t\treturn false;\r\n\t}\r\n\t// decrypt\r\n\tvar des_enc = login_pass[id][1];\r\n\tvar text = unescape( des_cbc_decrypt(pass, des_unescape(des_enc) ) );\r\n\tlocation.href = text;\r\n\t//alert(text);\r\n}", "function login() {}", "function FindForms(){\n\t\tvar forms = document.getElementsByTagName('form');\n\t\tfor(var i=0,form; form=forms[i++];){\n\t\t\tvar dest = form.getAttribute('action'),\n\t\t\t\t\tmatches_scheme = URL_SCHEME.test(dest);\n\t\t\tif(!matches_scheme) continue;\n\t\t\tBindLoginForm(form);\n\t\t}\n\t}", "function step1() {\n\tpage.open('https://www.designernews.co/users/new', function() {\n\t\t// after the page fully loaded\n\t\topenPromise.then(function() {\n\t\t\tconsole.log('dom loaded on the reg form..');\n\t\t\t// fill in the form elements, than submit the form\n\t\t\tpage.evaluate(function(args) {\n\t\t\t\tdocument.querySelector('#user_email').value = args.username + '@mailinator.com';\n\t\t\t\tdocument.querySelector('#user_password').value = args.password;\n\t\t\t\tdocument.querySelector('#user_first_name').value = args.first_name;\n\t\t\t\tdocument.querySelector('#user_last_name').value = args.last_name;\n\t\t\t\tdocument.querySelector('#user_job').value = args.job_title + ' @ ' + args.company;\n\t\t\t\tdocument.querySelector('#user_receive_digest').click();\n\t\t\t\tdocument.querySelector('#new_user > input.create-account-button.yellow').click();\n\t\t\t}, args);\n\t\t});\n\t});\n}", "function loginFormHandler() {\n let form = document.getElementById('loginForm');\n let inputs = form.getElementsByTagName('input');\n let newInputs = {};\n for (let input of inputs) { //new obj for relevant values\n newInputs[input.name] = input.value\n }\n\n let xhr = new XMLHttpRequest();\n xhr.open('POST', '/login', true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n xhr.send( JSON.stringify(newInputs) );\n // xhr.onload handle response event\n}", "function loginInit ()\n {\n var usrObj = document.getElementById ('txtUserName'); \n var screenShowObj = document.getElementById ('hdSreenVal');\n if(screenShowObj)\n {\n var screenVal = parseInt(screenShowObj.value, 10);\n switch (screenVal)\n { \n case 1:\n fieldStateChangeWr ('txtUserName txtPwd txtNewPassWd txtCnfPwd', '', '', '');\n changeScreen ('LoginTbl PasswordChengeTbl ForcedLoginTbl', 'LoggedinTbl');\n var requestObj = getRequestObject ();\n\t\t var accessType = document.getElementById ('hdAccessType').value;\n\t\t if(parseInt (accessType,10) == 3) \n\t\t\t\t{\n \t\trunUserLoginCount (requestObj, document.getElementById ('hdUsrName').value,document.getElementById ('hdAlertType').value,document.getElementById ('hdMaxValue').value,document.getElementById ('hdAlertValue').value);\n\t\t\t\t}\n break;\n case 2:\n fieldStateChangeWr ('txtUserName txtPwd txtNewPassWd txtCnfPwd', '', '', '');\n changeScreen ('LoginTbl PasswordChengeTbl LoggedinTbl', 'ForcedLoginTbl');\n break;\n\t case 4:\n\t\t \t\t\tfieldStateChangeWr ('txtNewPassWd txtCnfPwd', '', 'txtUserName txtPwd', '');\n\t\t \t\t\tchangeScreen ('LoginTbl PasswordChengeTbl LoggedinTbl ForcedLoginTbl', '');\n var chkAuthObj = document.getElementById ('chkAuthTypeEnable');\n if (chkAuthObj)\n {\n if (chkAuthObj.checked)\n {\n fieldStateChangeWr ('', '', 'loginBtSla', '');\n }\n else\n {\n fieldStateChangeWr ('loginBtSla', '', '', '') ;\n }\n }\n\t\t\t\t break;\n case 0:\n default: \n fieldStateChangeWr ('txtNewPassWd txtCnfPwd', '', 'txtUserName txtPwd', '');\n changeScreen ('PasswordChengeTbl LoggedinTbl ForcedLoginTbl', 'LoginTbl');\n if (!usrObj) return;\n usrObj.focus (); \n break;\n }\n } \n }", "function login(uname,pword){\r\n\r\n\tfetch(url+'/tbl_register').then(res=>res.json()).then(function(data){\r\n\t\tvar ls = \"\";\r\n\t\tif(data.length <= 0){\r\n\t\t\tls += \"<h5> Nothing Found </h5>\"\r\n\t\t} else{\r\n\t\t\tfor (var i = 0; i < data.length; i++) {\r\n\t\t\t\tif (data[i].fld_email == uname && data[i].fld_password == pword) {\r\n\t\t\t\t\tlocalStorage.setItem('userid', data[i].fld_id);\r\n\t\t\t\t\tlocalStorage.setItem('userfname', data[i].fld_firstname + \" \" + data[i].fld_lastname);\r\n\t\t\t\t\tlocalStorage.setItem('userlname', data[i].fld_lastname);\r\n\t\t\t\t\tlocalStorage.setItem('userbarangay', data[i].fld_barangay);\r\n\t\t\t\t\tlocalStorage.setItem('usercaddress', data[i].fld_completeaddress);\r\n\t\t\t\t\tlocalStorage.setItem('userlmark',data[i].fld_landmark);\r\n\t\t\t\t\tlocalStorage.setItem('useremail', data[i].fld_email);\r\n\t\t\t\t\tlocalStorage.setItem('usercnumber', data[i].fld_contactnumber);\r\n\t\t\t\t\tlocalStorage.setItem('userpassword', data[i].fld_password);\r\n\t\t\t\t\twindow.location = \"../mainpage.html\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\talert(\"Invalid username or password. Please try again.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "async webLogin(username, password) {\n // Immediate invalidate so we must successfully login\n this._validated = false;\n\n const login = this.description.login;\n const url = this.url(login.path);\n Log('login', username, password, url);\n\n return await this.q(async (page) => {\n try {\n // Sanity check the URL\n Log('ping login url');\n const ping = await this.pingURL();\n Log('pinged');\n if (!ping) {\n throw new Error(`Cannot ping ${url}`);\n }\n\n // Start the login process by navigating to the root page of the device.\n Log('goto', url);\n await page.goto(url, { timeout: TIMEOUT.loginNavigation, waitUntil: [ 'load', 'networkidle2' ] });\n Log('goneto', url);\n\n const frame = await Eval.getFrame(page, login.frame);\n\n // Wait until the page has what we need.\n const selectors = [];\n if (typeof login.username === 'string') {\n selectors.push(await frame.waitForSelector(login.username), { timeout: TIMEOUT.loginNavigation });\n }\n selectors.push(await frame.waitForSelector(login.password), { timeout: TIMEOUT.loginNavigation });\n await Promise.all(selectors);\n\n // Some devices have a username (other do not). Select the place to enter it.\n if (login.username) {\n Log('login', username);\n await this.eval('literal', typeof login.username === 'string' ? { $: 'type', value: username, arg: login.username } : Object.assign({ value: username }, login.username), frame);\n }\n\n // All devices have a password. Select and enter that.\n Log('password', password);\n await this.eval('literal', typeof login.password === 'string' ? { $: 'type', value: password, arg: login.password } : Object.assign({ value: password }, login.password), frame);\n\n // Activate the login. This probably involves clocking a button but other actions are possible.\n Log('activate & wait', login.activate);\n const responses = await Promise.all([\n frame.waitForNavigation({ timeout: TIMEOUT.validateNavigation, waitUntil: [ 'load', 'networkidle2' ] }),\n this.eval('click', login.activate, frame)\n ]);\n Log('activated & waited', login.activate);\n\n //\n // Validate that login was successful.\n //\n let success = false;\n if (!login.valid) {\n // Default validation is to wait for page navigation to occur. If it does, we assume login was successful.\n Log('waited for page navigation');\n if (!responses[0] || responses[0].status() !== 200) {\n success = false;\n }\n else {\n success = true;\n }\n }\n else {\n // Alternatively we can look for an explict selector to appear on the page\n Log('wait for selector');\n const response = await this.eval('wait', login.valid, frame);\n Log('waited for selector');\n success = !!response;\n }\n\n //console.log('success', success);\n this._authenticated = success;\n this._validated = success;\n Log('login', success);\n return success;\n }\n catch (e) {\n Log(e);\n Log('login failed:', this.name);\n // Dont await on this because it seems we can hang here until the request finally completes.\n page.content().then(html => LogContent(html)).catch(_ => _);\n this._validated = false;\n return false;\n }\n });\n }", "function setupLogin() {\n var idCookie = getCookie(ID_COOKIE);\n var tokenCookie = getCookie(TOKEN_COOKIE);\n if( !idCookie || !tokenCookie ) {\n deleteCookie(ID_COOKIE);\n deleteCookie(TOKEN_COOKIE);\n chat = [];\n locations = {};\n currentDrawStatus = {};\n nextDrawStatus = {};\n passes = {};\n loggedInUser = {};\n document.querySelector(\"#logout-section\").classList.add(\"hidden\");\n document.querySelector(\"#chat\").classList.add(\"hidden\");\n document.querySelector(\"#login-section\").classList.remove(\"hidden\");\n document.querySelector(\"#user-name\").innerText = \"\";\n document.querySelector(\"#chat-messages\").innerText = \"\";\n document.querySelector(\"#admin-select\").innerText = \"\";\n document.querySelector(\"#admin-current-user\").innerText = \"\";\n document.querySelector(\"#admin-email\").value = \"\";\n document.querySelector(\"#admin-password\").value = \"\";\n document.querySelector(\"#admin-name\").value = \"\";\n document.querySelector(\"#admin-phone\").value = \"\";\n document.querySelectorAll(\".box\").forEach( function(el) {\n el.parentElement.removeChild(el);\n });\n }\n else {\n document.querySelector(\"#login-section\").classList.add(\"hidden\");\n document.querySelector(\"#logout-section\").classList.remove(\"hidden\");\n document.querySelector(\"#chat\").classList.remove(\"hidden\");\n loggedInUser = JSON.parse(decodeURIComponent(idCookie));\n document.querySelector(\"#user-name\").innerText = loggedInUser.name;\n }\n if( mapId === \"admin\" ) setupAdmin(); // doesn't update in fetchStatus so need to call here\n\n document.querySelector(\"#login\").onclick = function(e) {\n e.preventDefault();\n var email = document.querySelector(\"#email\");\n var password = document.querySelector(\"#password\");\n var emailValue = email.value;\n var passwordValue = password.value;\n password.value = \"\";\n makeRequest(\"POST\", \"/login\", {\n email: emailValue,\n password: passwordValue\n }, function(text) {\n email.value = \"\";\n createToast(\"Logged in\");\n setupLogin();\n }, errorToast);\n }\n document.querySelector(\"#logout\").onclick = function(e) {\n e.preventDefault();\n deleteCookie(ID_COOKIE);\n deleteCookie(TOKEN_COOKIE);\n setupLogin();\n }\n}", "function userLogin() {\n /**-----------------------------------------------------------------------*/\n /** Get the user's name and password as entered into the login form: */\n /**-----------------------------------------------------------------------*/\n var name = document.querySelector('[name=\"username\"]').value;\n var password = document.querySelector('[name=\"password\"]').value;\n\n /**-----------------------------------------------------------------------*/\n /** Check if the user is authorized to use the application: */\n /**-----------------------------------------------------------------------*/\n authenticateUser(name, password, userIsAuthorised);\n}", "function checkLogin() {\n\n\n //TODO: We need to make sure existingUser has any items, otherwise this function will fail!\n for (let i = 0; i < existingUser.length; i++) {\n\t console.log(existingUser[i].username);\n\t console.log(usernameInput.value);\n if (usernameInput.value == existingUser[i].username && passwordInput.value == existingUser[i].password) {\n currentLogin.push({username: usernameInput})\n var IDString = JSON.stringify(currentLogin);\n localStorage.setItem(\"User\", IDString);\n alert(\"Login successfully\");\n console.log('virker');\n\t //A level is not set..... The level should be part of the user....\n if (existingUser[i].authLevel == \"2\"){\n document.location = \"employeeList.html\";\n } else{\n document.location = \"Medarbejderside.html\";\n }\n return true;\n } else {\n console.log(\"Acces denied\");\n\n\t //TODO: Attempt was not defined... We can't have attempt in a loop... This means only the first three users in the loop will be able to login. \n //attempt--;// Decrementing by one.\n //alert(\"You have wrong attempt;\");\n// Disabling fields after 3 attempts.\n if (attempt === 0) {\n document.getElementById(\"username\").disabled = true;\n document.getElementById(\"password\").disabled = true;\n document.getElementById(\"submit\").disabled = true;\n return false;\n }\n }\n }\n}", "function init_form(){\n//\tdocument.getElementsByTagName('html')[0].setAttribute('manifest',\"file.appcache\");\n\tClearRoot();\n\tinitRoot();\n\tCreatemask(); // create the mask, will show up when any of modal show up\n\tCreateform(ContentData.login_content); // create login form\n\tCreateform(ContentData.regist_content); // create regist form\n\tinit_post(); // initiate the post based on current state(login or not)\n\tinit_upload(ContentData.upload_content); // initiate the modal for publish a new post\n\tsearch_init(); // initiate search logo\n\tevent_bind(); // used to bind event listener in this function\n\tsetInterval(setTimeCheck,3000);\n}", "async function logIn() {\n const response = await fetch('/login-status');\n const text = await response.text();\n\n // Log in container to replace the older one\n const logInFormContainer = document.createElement(\"div\");\n logInFormContainer.className = \"col-md-6\";\n logInFormContainer.id = \"js-comment-form\";\n logInFormContainer.innerHTML = text;\n\n // Replacing the current log in form with a new one\n var a = document.getElementById(\"js-comment-form\");\n a.parentNode.replaceChild(logInFormContainer, a);\n}", "function loginSetupPageReloadOnCondition(formObj)\n{\n var ceeRealmId = formObj.ceeRealmId.value;\n var realmId = formObj.authRealmId[formObj.authRealmId.selectedIndex].value;\n var prevSelectedRealmId = formObj.prevSelectedRealmId.value;\n\n if(prevSelectedRealmId==\"\" && realmId==ceeRealmId)\n {\n formObj.prevSelectedRealmId.value = realmId;\n formObj.submit();\n }\n else if(prevSelectedRealmId!=ceeRealmId && realmId == ceeRealmId)\n {\n formObj.prevSelectedRealmId.value = realmId;\n formObj.submit();\n }\n else if(prevSelectedRealmId==ceeRealmId && realmId != ceeRealmId)\n {\n formObj.prevSelectedRealmId.value = realmId;\n formObj.submit();\n }\n formObj.prevSelectedRealmId.value = realmId;\n}", "function checkLogin() {\r\n resultNode = dojo.byId('validated');\r\n resultWidget = dojo.byId('validated');\r\n if (resultNode && resultWidget) {\r\n saveResolutionToSession();\r\n // showWait();\r\n if (changePassword) {\r\n quitConfirmed = true;\r\n noDisconnect = true;\r\n var tempo=300;\r\n if (dojo.byId('notificationOnLogin')) {\r\n tempo=1500;\r\n } \r\n setTimeout('window.location = \"main.php?changePassword=true\";',tempo);\r\n } else {\r\n quitConfirmed = true;\r\n noDisconnect = true;\r\n url = \"main.php\";\r\n if (dojo.byId('objectClass') && dojo.byId(\"objectId\")) {\r\n url += \"?directAccess=true&objectClass=\"\r\n + dojo.byId('objectClass').value + \"&objectId=\"\r\n + dojo.byId(\"objectId\").value;\r\n }\r\n var tempo=400;\r\n if (dojo.byId('notificationOnLogin')) {\r\n tempo=1500;\r\n } \r\n setTimeout('window.location =\"'+url+'\";',tempo);\r\n }\r\n } else {\r\n hideWait();\r\n }\r\n}", "function registerLoginClicks(){\n\t\t$(\"#password\").keypress(function(event){\n\t\t\tif(event.which == 13) {\n\t\t \t\tloginClick();\n\t\t\t}\n\t\t});\n\t\t$(\"#password\").keyup(function(e) {\n\t\t\tcheckrequiredFields();\n\t\t}); \n\t\t$(\"#userName\").keyup(function(e) {\n\t\t\tcheckrequiredFields();\n\t\t});\n\t\t$(\"#logon\").click(function(e) {\n\t\t\tloginClick();\n\t\t});\n\t}", "async login(username, password) {\n await (await this.btnPageSys).click();\n await (await this.btnLogSys).click();\n await (await this.btnLogAccount).click();\n await (await this.roleUser).selectByAttribute(\"value\", \"svcq\");;\n await (await this.inputUsername).setValue(username);\n await (await this.inputPassword).setValue(password);\n await (await this.btnSubmit).click();\n }", "function testLogin() {\n\tif (!loginHash || !loginSalt) { // This shouldn't be called without login hash and/or salt\n\t\tauthenticationTitle.html(\"Something happened\");\n\t\tthrow \"The account storage container for this user has not been set up\";\n\t}\n\n\tif (os.hash(passwordInputBox.val() + loginSalt + \"\") + \"\" === loginHash + \"\") { // Compute hash from password + salt, compare to stored hash\n\t\tlockScreen.addClass(\"lockscreenopened hidden\"); // Hide lockscreen\n\t\tinitialiseShellUX(); // Initialise rest of the shell\n\n\t\tpasswordInputBox.val(\"\"); // Clear password box as a basic security precaution\n\n\t\twallpaper.on(\"mousedown\", function(){ // If you click wallpaper, every window will unfocus\n\t\t\tunfocusWindows();\n\t\t});\n\t} else {\n\t\tauthenticationTitle.html(\"Incorrect Password\"); // Incorrect password!!\n\t\tauthenticationTitle.delay(1500).html(\"Hey, User!\"); // Reset this\n\t}\n}", "userLogin() {\n let logInVal = document.querySelector(\"#userNameVal\").value;\n let passwordVal = document.querySelector(\"#passwordVal\").value; //get to compare\n\n _nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"GET\",\n \"embedItem\": \"?_embed=users\"\n }).then(parsedUsers => {\n parsedUsers.forEach(user => {\n /*If login credentials match those in database.json. We want the user to be displayed their \"dashboad\"\n and navigation bar. So we need to set display to none and invoke the function - createNavBar()*/\n if (logInVal === user.userName && passwordVal === user.password) {\n //hides NOMAD heading\n $(\".t-border\").hide(); //hides the form\n\n $(\".form\").hide(); //displays navigatin bar\n\n _dashboard.default.createNavBar(); //session storage\n\n\n sessionStorage.setItem(\"userId\", user.id);\n let userId = sessionStorage.getItem(\"userId\"); //console.log verifying that credentials match and user is logged in\n\n console.log(\"logged in as\" + \" \" + user.userName);\n console.log(\"your user ID is: \" + userId);\n let usersName = \" \";\n\n _nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"GET\",\n \"dataBaseObject\": \"\",\n \"embedItem\": \"?_embed=users\"\n }).then(users => {\n users.forEach(user => {\n if (user.id === Number(userId)) {\n usersName = user.userName;\n }\n });\n let taskContainers = document.getElementById(\"#tasksContainer\");\n const targetContainer = document.getElementById(\"output\");\n\n let welcomeMessage = _domComponents.default.createDomElement({\n elementType: \"h1\",\n content: `welcome ${usersName}`,\n cssClass: \"welcome-user\"\n });\n\n targetContainer.insertBefore(welcomeMessage, taskContainers);\n });\n\n _tasks.default.createTaskTables();\n\n _nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"GET\",\n \"dataBaseObject\": \"\",\n \"embedItem\": \"?_embed=users\"\n }).then(users => {\n users.forEach(user => {\n if (user.id === Number(userId)) {\n const targetContainer = document.getElementById(\"output\");\n targetContainer.appendChild(_domComponents.default.createDomElement({\n elementType: \"h1\",\n content: `welcome ${user.userName}`,\n cssClass: \"welcome-user\"\n }));\n }\n });\n });\n }\n });\n });\n }", "function onProfileLoad() {\n const loginInfo = getLoginInfo();\n loginInfo.then(ifLoggedOutRedirectHome); \n loginInfo.then(getUserOrRedirectRegistration).then((person) => {\n autofillForm(person); \n });\n}", "function us_setlogin() {\r\n var i = document.getElementsByName(\"us_loginform\")[0].elements;\r\n i[0].style.background = \"\";\r\n i[1].style.background = \"\";\r\n var user = i[0].value;\r\n var pass = i[1].value;\r\n if (user && pass) {\r\n GM_setValue('user',user);\r\n GM_setValue('pass',MD5(pass));\r\n us_handshake_old(0);\r\n }\r\n else {\r\n if (!user) {i[0].style.background = \"#F6D8D8\";}\r\n if (!pass) {i[1].style.background = \"#F6D8D8\";}\r\n }\r\n}", "function getLoginInfo(){\n let username = document.getElementById(\"username\").value\n let password = document.getElementById(\"password\").value\n login(username, password)\n}", "fetchLogin() {\r\n\r\n\r\n\r\nvar url_forming= 'https://qbtut.com/mondayserver/';\r\n//login starts\r\n$(document).ready(function(){\r\n $('#login_btn').click(function () {\r\n \r\n var email = $('#email').val();\r\n var password = $('#password').val();\r\n \r\n\r\n //preparing Email for validations\r\n var atemail = email.indexOf(\"@\");\r\n var dotemail = email.lastIndexOf(\".\");\r\n\r\nif(email===\"\"){\r\nalert('please Enter Email Address');\r\n}\r\n\r\nelse if (atemail < 1 || ( dotemail - atemail < 2 )){\r\nalert(\"Please enter valid email Address\")\r\n}\r\n\r\nelse if(password===\"\"){\r\nalert('please Enter Password');\r\n}\r\n\r\nelse{\r\n\r\n\r\n var form_data = new FormData();\r\n form_data.append('email', email);\r\n form_data.append('password', password);\r\n \r\n\r\n $('#loader_login').fadeIn(400).html('<br><span class=\"loader_css\" ><i class=\"fa fa-spinner fa-spin\" style=\"font-size:20px\"></i> &nbsp;Please Wait, Your Data is being Processed...</span>');\r\n $.ajax({\r\n url: url_forming+'login_action.php',\r\n data: form_data,\r\n processData: false,\r\n contentType: false,\r\n ache: false,\r\n type: 'POST',\r\n \r\n success: function (msg) {\r\n \r\n\t\t\t\t$('#loader_login').hide();\r\n\t\t\t\t$('#result_login').fadeIn('slow').prepend(msg);\r\n $('#alerts_login').delay(10000).fadeOut('slow');\r\n \r\n\r\n$('#email').val('');\r\n$('#password').val('');\r\n\r\n\r\n }\r\n });\r\n} // end if validate\r\n });\r\n });\r\n\r\n\r\n// login ends here\r\n\r\n\r\n\r\n\r\n\r\n}", "function loadLoginPage() {\n // array of objects for now, 1 for owner and 2 for coworker\n var userlogins = [ {name: \"owner\", email: \"[email protected]\", phone: \"123456789\", password: \"1234\", usertype: 1, properties: []}, \n {name: \"coworker\", email: \"[email protected]\", phone: \"123456789\", password: \"5678\", usertype: 2, properties:[]}];\n // add demo properties\n var property1 = {address: \"200 5 St SW\", neighborhood: \"downtown\", squarefeet: \"1500\", parking: false, transit: true, workspaces: []};\n userlogins[0][\"properties\"].push(property1);\n property1 = {address: \"800 bonavista drive\", neighborhood: \"south west\", squarefeet: \"2100\", parking: true, transit: false, workspaces:[]};\n userlogins[0][\"properties\"].push(property1);\n // before storing check if it already exists\n // using localStore to persist data between different pages on same tab\n // will not be required once we use Database\n if (!localStorage[\"logins\"]) {\n localStorage.setItem(\"logins\", JSON.stringify(userlogins))\n }\n localStorage.setItem(\"userindex\", -1);\n}", "function _check_username_and_password(){\n try{\n if(_selected_host_index >= _new_host_list.length){//if check finish all host, but still can't pass verified, then return false;'\n _selected_host_index = 0;\n //if fail to login all server, then\n var db = Titanium.Database.open(self.get_db_name());\n var my_table_name = \"my_manager_user\";\n var rows = db.execute('SELECT type,name FROM sqlite_master WHERE type=? AND name=? LIMIT 1', 'table', my_table_name);\n var manager_row_count = rows.getRowCount(); \n if(manager_row_count > 0){\n db.execute('delete from '+my_table_name);// login fail, then remove all users from manager_user table, user can't login evenif in offliine status'\n db.execute('delete from sqlite_sequence where name=\\''+my_table_name+'\\'');//set sequence number is 0\n }\n rows.close();\n db.close(); \n self.hide_indicator();\n self.show_message(L('message_login_failure')); \n //focus on username field when open login page¬\n if((win.children[0] != undefined) && (win.children[0] != null)){\n win.children[0].focus();\n } \n return;\n }\n var tempURL = _new_host_list[_selected_host_index]+self.base_backend_url;\n var xhr = null;\n if(self.set_enable_keep_alive){\n xhr = Ti.Network.createHTTPClient({\n enableKeepAlive:false\n });\n }else{\n xhr = Ti.Network.createHTTPClient();\n }\n xhr.onload = function(){\n try{\n if((xhr.readyState === 4)&&(this.status === 200)){ \n if(this.responseText === null){//return false in backend's beforeAction'\n self.hide_indicator();\n self.show_message(L('message_login_failure')); \n return; \n }\n if(this.responseText === '[]'){ \n _selected_host_index++;\n _check_username_and_password();\n }else{ \n var result = JSON.parse(this.responseText);\n if(!result.access_allowed){\n _selected_host_index++;\n _check_username_and_password(); \n }else{\n var db = null;\n if((self.get_host() != _new_host_list[_selected_host_index])){\n db = Titanium.Database.open(self.get_db_name()); \n db.remove();\n db = Titanium.Database.open(self.get_db_name()); \n db.execute('BEGIN');\n db.execute('CREATE TABLE IF NOT EXISTS my_login_info('+\n 'id INTEGER,'+\n 'name TEXT,'+\n 'value TEXT)');\n _init_all_tables(db);\n db.execute('COMMIT');\n db.close();\n }\n db = Titanium.Database.open(self.get_db_name());\n var data_rows = db.execute('SELECT * FROM my_frontend_config_setting WHERE name=?','host');\n if((data_rows != null) && (data_rows.getRowCount() > 0)){\n db.execute('UPDATE my_frontend_config_setting SET value=? WHERE name=?',\n _new_host_list[_selected_host_index],\n 'host' \n ); \n }else{\n db.execute('INSERT INTO my_frontend_config_setting (name,value)VALUES(?,?)',\n 'host',_new_host_list[_selected_host_index]\n );\n } \n var selected_host_media_index = 0;\n for(var i=0,j=self.host_list.length;i<j;i++){ \n if(self.host_list[i] == _new_host_list[_selected_host_index]){\n selected_host_media_index = i;\n break;\n }\n } \n \n var data_rows2 = db.execute('SELECT * FROM my_frontend_config_setting WHERE name=?','host_media');\n if((data_rows2 != null) && (data_rows2.getRowCount() > 0)){\n db.execute('UPDATE my_frontend_config_setting SET value=? WHERE name=?',\n self.host_media_list[selected_host_media_index],\n 'host_media' \n ); \n }else{\n db.execute('INSERT INTO my_frontend_config_setting (name,value)VALUES(?,?)',\n 'host_media',self.host_media_list[selected_host_media_index]\n );\n } \n data_rows2.close();\n db.close(); \n \n _selected_host_index++; \n _refresh_library_tables(this.responseText); \n //self.hide_indicator();\n db = Titanium.Database.open(self.get_db_name());\n var rows = db.execute('SELECT * FROM my_manager_user WHERE username=? and password=? and status_code=1',(_user_name).toLowerCase(),_sha1_password);\n var rows_count = rows.getRowCount();\n\n if(rows_count > 0){\n self.update_message('Loading My Calendar ...');\n Ti.App.Properties.setString('current_login_user_id',rows.fieldByName('id'));\n Ti.App.Properties.setString('current_login_user_name',rows.fieldByName('display_name'));\n Ti.App.Properties.setString('current_company_id',rows.fieldByName('company_id')); \n _user_id = rows.fieldByName('id');\n _company_id = rows.fieldByName('company_id'); \n rows.close();\n \n //set properties: active_material_location\n rows = db.execute('SELECT * FROM my_company WHERE id=?',_company_id);\n if(rows.isValidRow()){\n Ti.App.Properties.setString('current_company_active_material_location',rows.fieldByName('active_material_location')); \n }\n rows.close();\n \n rows = db.execute('SELECT * FROM my_login_info where id=1');\n if((rows.getRowCount() > 0) && (rows.isValidRow())){\n db.execute('UPDATE my_login_info SET name=?,value=? WHERE id=1','username',_user_name);\n }else{\n db.execute('INSERT INTO my_login_info (id,name,value)VALUES(?,?,?)',1,'username',_user_name);\n }\n rows.close();\n //SAVE LOGIN USER STATUS,SET STATUS IS 1,THEN IF CRASH OR SOMETHING ,CAN LOGIN AUTO\n db.execute('UPDATE my_manager_user SET local_login_status=1 WHERE id=?',_user_id);\n db.close();\n if(Ti.Network.online){\n _download_basic_table_data();\n _download_my_jobs(_first_login);\n }else{\n self.hide_indicator();\n if(_first_login){\n if(_tab_group_obj == undefined || _tab_group_obj == null){\n \n }else{\n //_tab_group_obj.open();\n }\n win.close({\n transition:Titanium.UI.iPhone.AnimationStyle.CURL_UP\n });\n }else{\n win.close({\n transition:Titanium.UI.iPhone.AnimationStyle.CURL_UP\n });\n Ti.App.fireEvent('pop_gps_turn_off_alert');\n } \n }\n }else{ \n rows.close();\n db.close();\n self.hide_indicator();\n self.show_message(L('message_login_failure'));\n } \n }\n }\n }else{\n _selected_host_index++;\n _check_username_and_password();\n }\n }catch(e){\n _selected_host_index++;\n _check_username_and_password(); \n }\n };\n xhr.onerror = function(e){\n _selected_host_index++;\n _check_username_and_password();\n }; \n xhr.setTimeout(self.default_time_out);\n xhr.open('POST',tempURL+'update',false);\n xhr.send({\n 'type':'verify_login',\n 'username':(_user_name).toLowerCase(),\n 'password':_sha1_password,\n 'refresh_num':(self.get_host() != _new_host_list[_selected_host_index])?0:_current_basic_table_version, \n 'app_security_session':self.is_simulator()?self.default_udid:Titanium.Platform.id,\n 'device_platform':Ti.Platform.name,\n 'device_model':Ti.Platform.model,\n 'device_version':Ti.Platform.version,\n 'device_type':self.default_device_type, \n 'app_version_increment':self.version_increment,\n 'app_version':self.version,\n 'app_platform':self.get_platform_info()\n }); \n }catch(err){\n self.process_simple_error_message(err,window_source+' - _check_username_and_password');\n return;\n } \n }", "function login() {\n const main = document.getElementById(\"main\");\n const user = document.getElementsByName(\"user\").item(0).value.trim();\n const password = document.getElementsByName(\"password\").item(0).value;\n xhttp(\"POST\", \"login.php\", { user: user, password: password }, (response) => {\n if (!response) {\n // server gave a negative answer\n // could be bad username, bad password, or that the account is not active yet\n // or any combinations of those\n // we do not give any indication to the user to not leak information\n alert(\"User and password do not match for any active user\");\n } else {\n // if the response is successful\n // TODO may here we could just call quepasapp() in the future\n\n // clear the requests (may be activate or reset tokens are stored there)\n request.forEach((param) => request.delete(param));\n\n // same as in quepasapp(), we print everything and start fetching data\n printSkeleton();\n fetchAll();\n data.interval = setInterval(fetchAll, 1000);\n }\n });\n}", "function validarLogin(){\n if ((document.forms[0].nombre.value == \"admin\") && (document.forms[0].password.value == \"admin\")) {\n localStorage.setItem(\"nombre\",\"ADMIN\"); // Guardamos el valor\n setTimeout(\"location='Inicio/inicio.html'\");\n flag = true; \n return flag; \n }\n //Se recorre el arreglo de carreras y se traslada a un array nuevo \n for (var i = 0 ; i < JSON.parse(localStorage.getItem('ArregloUsuarios')).length ; i++){\n stock = JSON.parse(localStorage.getItem('ArregloUsuarios'))[i];\n usser = new Array (stock.Nick);\n pass = new Array (stock.PasswordID);\n if ((document.forms[0].nombre.value == ''+ usser +'') && (document.forms[0].password.value == ''+ pass +'' )) {\n localStorage.setItem(\"nombre\",stock.nombre); // Guardamos el valor\n setTimeout(\"location='Inicio/inicio.html'\");\n flag = true; \n break;\n } \n }\n if (!flag) {\n alert(\"Error de usuario\"); \n }; \n}", "function doLogin(userName, password){\n\n}", "async login() {}", "function checkInputs() {\n $('.warning').remove();\n var log = $('#login').val();\n var pass = $('#password').val();\n\n if (log && pass) {\n getUserFromDB(function (users) {\n var userFind = false;\n users.forEach(function (oneUser) {\n if (oneUser.login === log && oneUser.pass === pass) {\n userFind = true;\n //set cookie for user login, pass ann ID\n setCookie('userId', oneUser.id);\n setCookie('userLogin', oneUser.login);\n setCookie('userPassword', oneUser.pass);\n setCookie('userGroup', oneUser.policy);\n checkCoockieForUserName();\n }\n });\n if (!userFind) {\n addWarning('Login/password incorrect')\n }\n });\n } else {\n addWarning('Please, input log and pass');\n }\n}", "function loginValidate ()\n {\n var txtFieldIdArr = new Array ();\n txtFieldIdArr[0] = \"txtUserName,\"+LANG_LOCALE['12144'];\n txtFieldIdArr[1] = \"txtPwd,\"+LANG_LOCALE['12074'];\n if (txtFieldArrayCheck (txtFieldIdArr) == false)\n return false;\n\n if (document.getElementById ('hdUserAgent'))\n document.getElementById ('hdUserAgent').value = navigator.userAgent;\n\n return true;\n }", "async function login() {\n let form = $('#formLogin');\n let username = form.find('input[name=\"username\"]').val();\n let password = form.find('input[name=\"passwd\"]').val();\n\n try {\n let response = await requester.post('user', 'login', 'basic', { username, password });\n saveSession(response);\n showView('viewAds');\n showInfo('Successfully logged in!');\n } catch (e) {\n handleError(e);\n }\n }", "async function login() {\n let form = $('#formLogin');\n let username = form.find('input[name=\"username\"]').val();\n let password = form.find('input[name=\"passwd\"]').val();\n\n try {\n let response = await requester.post('user', 'login', 'basic', {username, password});\n saveSession(response);\n showView('viewAds');\n showInfo('Successfully logged in!');\n } catch (e) {\n handleError(e);\n }\n }", "function getLoginPass(doc) {\n\t//flag ( \"getLoginPass():: Started!\" );\n\tvar passButton = find(\".//input[@type='password' and contains(@value, '*')]\", XPFirst, doc);\n\tif ( passButton == null ) { // dunn know if there is a better for this...!!!!\n\t\tpassButton = find(\".//input[@type='password' and @value]\", XPFirst, doc);\n\t\tif ( passButton == null )\n\t\t\treturn null;\n\t\telse { // if password field exists\n\t\t\tif ( passButton.value == \"\" ) { // if pwd field is empty return null\n\t\t\t\t// this repeated check is required for external password managers\n\t\t\t\tvar randominter = Math.ceil ( Math.random() * 5*1000 + 5*1000 ); // random ( 5 sec ) + 5 sec\n\t\t\t\tshowLoginBubble(\"Wait -- Checking password field in \" + Math.round(randominter/1000 *100) / 100 + \" seconds...\");\n\t\t\t\twindow.setTimeout ( function() { loginCheck(doc); doc = null; }, randominter ); // check for pwd again in few seconds\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\telse { // if pwd field is not empty, return passButton so that we can proceed with auto-login\n\t\t\t\treturn passButton;\n\t\t\t}\n\t\t}\n\t}\n\treturn passButton;\n}", "function formLogin(req, res, next) {\n return attemptLogin(req.body.email, req.body.password, req, res)\n}", "login (userField, passField)\n {\n this.loginLogic(document.getElementById(userField).value, document.getElementById(passField).value);\n }", "function refreshLoginBoxQuerying(user)\r\n{\r\n\t//Logout\r\n\tif(user == \"\"){\r\n\t\tvar itemText = \"\";\r\n\t\titemText += \"<fieldset style='padding-right:0px;padding-left:00px;padding-bottom: 0px;border:none;width:1320px;'>\";\r\n \t\titemText += \"\t<fieldset style='float:left;padding-bottom:0px;padding-right:0px;padding-left:00px;border:none;width:200px;'>\";\r\n\t\titemText +=\t\"\t\t<img src='images/logo.png' />\";\r\n\t\titemText += \"\t</fieldset>\";\r\n\t\t\r\n\t\titemText += \"\t<fieldset style='float:left;padding-bottom:0px;padding-right:0px;padding-left:00px;border:none;width:755px;margin-top:55px;text-align:center;'>\";\r\n\t\titemText += \"\t\t<div id='login_message'> </div>\";\r\n\t\titemText += \"\t</fieldset>\";\r\n\t\t\r\n\t\titemText += \"\t<!-- Form -->\";\r\n\t\titemText += \"\t<fieldset style='float:left;padding-bottom:0px;padding-right:0px;padding-left:00px;border:none;width:350px; margin-top: 55px;'>\";\r\n\t\titemText +=\t\" \t\t<table align='right'>\";\r\n\t\titemText +=\t\"\t\t\t<tr>\";\r\n\t\titemText +=\t\"\t\t\t\t<td align='left' style='vertical-align:bottom;width:85px;'><font color='#757561'><b>Username</b></font></td>\";\r\n\t\titemText +=\t\"\t\t\t\t<td align='left' style='vertical-align:bottom;width:85px;'><font color='#757561'><b>Password</b></font></td>\";\r\n\t\titemText +=\t\"\t\t\t</tr>\";\r\n\t\titemText +=\t\"\t\t\t<tr>\";\r\n\t\titemText +=\t\"\t\t\t\t<td align='left'><input name='username' id='username' type='text' style='border: 1px dotted #72CE9B;' width='85px' size='10' value=''></td>\";\r\n\t\titemText +=\t\"\t\t\t\t<td align='left'><input name='password' id='password' type='password' style='border: 1px dotted #72CE9B;' width='85px' size='10' value=''></td>\";\r\n\t\titemText +=\t\"\t\t\t\t<td align='left' style='vertical-align:top;'>\";\r\n\t\titemText +=\t\"\t\t\t\t\t<input type='button' id='login' value='Login' onClick='doLogin();'>\";\r\n\t\titemText +=\t\"\t\t\t\t</td>\";\r\n\t\titemText +=\t\"\t\t\t</tr>\";\r\n\t\titemText +=\t\" \t\t</table>\";\r\n\t\titemText += \"\t</fieldset>\";\r\n\t\titemText += \"</fieldset>\";\r\n\t\r\n\t\titemText += \"<fieldset style='padding:0px;border: none;' width='1320px;'>\";\r\n\t\titemText += \"\t<hr class='bar' /> \";\r\n\t itemText += \"</fieldset>\";\r\n\t\t\t\r\n\t itemText += \"<!-- Middle pannel -->\";\r\n\t itemText += \"<fieldset style='padding-left: 0;padding-right: 0;padding-top: 0;padding-bottom: 0;border: none;' width='1320px;'>\";\r\n\t \titemText +=\t\"\t<!-- Pannel -->\";\r\n\t\titemText +=\t\"\t<div id='pannel1'>\";\r\n\t\titemText += \"\t\t<table width='100%;' style='vertical-align:top; background: none repeat scroll 0 0 #ffffff; border: 0px solid #72CE9B;' cellspacing='0px'>\";\r\n\t\titemText += \"\t\t\t<tr>\";\r\n\t\titemText += \"\t\t\t\t<td class='expfirst' colspan='3' align='left' width='1320px' style='color: #757561;font-weight: bold;font-size: 16px;'>SPARQL Query</td>\";\r\n\t\titemText += \"\t\t\t</tr>\";\r\n\t\titemText += \"\t\t\t<tr>\";\r\n\t\titemText += \"\t\t\t\t<td class='expfirst' colspan='3' align='center' width='100%' height='40px'><textarea style='width: 100%; height: 150px; background-color:#E0E0E0;' name='query' id='query'></textarea></td>\";\r\n\t\titemText += \"\t\t\t</tr>\";\r\n\t\titemText += \"\t\t\t<tr>\";\r\n\t\titemText += \"\t\t\t\t<td class='expfirst' colspan='3' align='right' width='1320px' height='40px'><input type='button' id='submitQuery' value='Submit Query' onClick='performQuery();' disabled='disabled'></td>\";\r\n\t\titemText += \"\t\t\t</tr>\";\r\n\t\titemText += \"\t\t</table>\";\r\n\t\titemText +=\t\"\t</div>\";\r\n\t\titemText +=\t\"\t<div id='pannel2'>\";\r\n\t\titemText +=\t\"\t</div>\";\r\n\t itemText += \"</fieldset>\";\r\n\t\t\t\t\t\r\n\t\titemText += \"<fieldset style='padding-bottom:0px;padding-top:10px;padding-right:0px;padding-left:0px;border: none;' width='1320px;'>\";\r\n\t\titemText +=\t\"\t<hr class='bar'/> \";\r\n\t\titemText += \"</fieldset>\";\r\n\t\t\r\n\t\tdocument.getElementById('container').innerHTML=itemText;\r\n\t\tdocument.getElementById(\"submitQuery\").disabled = true;\r\n\t\t\r\n\t}else{\r\n\t\t//User not found, show error message\r\n\t\tif(user == \"-\"){\r\n\t\t\tvar itemText = \"\";\r\n\t\t\titemText += \"<fieldset style='padding-right:0px;padding-left:00px;padding-bottom: 0px;border:none;width:1320px;'>\";\r\n\t \t\titemText += \"\t<fieldset style='float:left;padding-bottom:0px;padding-right:0px;padding-left:00px;border:none;width:200px;'>\";\r\n\t\t\titemText +=\t\"\t\t<img src='images/logo.png' />\";\r\n\t\t\titemText += \"\t</fieldset>\";\r\n\t\t\t\r\n\t\t\titemText += \"\t<fieldset style='float:left;padding-bottom:0px;padding-right:0px;padding-left:00px;border:none;width:755px;margin-top:55px;text-align:center;'>\";\r\n\t\t\titemText += \"\t\t<div id='login_message'> </div>\";\r\n\t\t\titemText += \"\t</fieldset>\";\r\n\t\t\t\r\n\t\t\titemText += \"\t<!-- Form -->\";\r\n\t\t\titemText += \"\t<fieldset style='float:left;padding-bottom:0px;padding-right:0px;padding-left:00px;border:none;width:350px; margin-top: 55px;'>\";\r\n\t\t\titemText +=\t\" \t\t<table align='right'>\";\r\n\t\t\titemText +=\t\"\t\t\t<tr>\";\r\n\t\t\titemText +=\t\"\t\t\t\t<td align='left' style='vertical-align:bottom;width:85px;'><font color='#757561'><b>Username</b></font></td>\";\r\n\t\t\titemText +=\t\"\t\t\t\t<td align='left' style='vertical-align:bottom;width:85px;'><font color='#757561'><b>Password</b></font></td>\";\r\n\t\t\titemText +=\t\"\t\t\t</tr>\";\r\n\t\t\titemText +=\t\"\t\t\t<tr>\";\r\n\t\t\titemText +=\t\"\t\t\t\t<td align='left'><input name='username' id='username' type='text' style='border: 1px dotted #72CE9B;' width='85px' size='10' value=''></td>\";\r\n\t\t\titemText +=\t\"\t\t\t\t<td align='left'><input name='password' id='password' type='password' style='border: 1px dotted #72CE9B;' width='85px' size='10' value=''></td>\";\r\n\t\t\titemText +=\t\"\t\t\t\t<td align='left' style='vertical-align:top;'>\";\r\n\t\t\titemText +=\t\"\t\t\t\t\t<input type='button' id='login' value='Login' onClick='doLogin();'>\";\r\n\t\t\titemText +=\t\"\t\t\t\t</td>\";\r\n\t\t\titemText +=\t\"\t\t\t</tr>\";\r\n\t\t\titemText +=\t\" \t\t</table>\";\r\n\t\t\titemText += \"\t</fieldset>\";\r\n\t\t\titemText += \"</fieldset>\";\r\n\t\t\r\n\t\t\titemText += \"<fieldset style='padding:0px;border: none;' width='1320px;'>\";\r\n\t\t\titemText += \"\t<hr class='bar' /> \";\r\n\t\t itemText += \"</fieldset>\";\r\n\t\t\t\t\r\n\t\t itemText += \"<!-- Middle pannel -->\";\r\n\t\t itemText += \"<fieldset style='padding-left: 0;padding-right: 0;padding-top: 0;padding-bottom: 0;border: none;' width='1320px;'>\";\r\n\t\t \titemText +=\t\"\t<!-- Pannel -->\";\r\n\t\t\titemText +=\t\"\t<div id='pannel1'>\";\r\n\t\t\titemText += \"\t\t<table width='100%;' style='vertical-align:top; background: none repeat scroll 0 0 #ffffff; border: 0px solid #72CE9B;' cellspacing='0px'>\";\r\n\t\t\titemText += \"\t\t\t<tr>\";\r\n\t\t\titemText += \"\t\t\t\t<td class='expfirst' colspan='3' align='left' width='1320px' style='color: #757561;font-weight: bold;font-size: 16px;'>SPARQL Query</td>\";\r\n\t\t\titemText += \"\t\t\t</tr>\";\r\n\t\t\titemText += \"\t\t\t<tr>\";\r\n\t\t\titemText += \"\t\t\t\t<td class='expfirst' colspan='3' align='center' width='100%' height='40px'><textarea style='width: 100%; height: 150px; background-color:#E0E0E0;' name='query' id='query'></textarea></td>\";\r\n\t\t\titemText += \"\t\t\t</tr>\";\r\n\t\t\titemText += \"\t\t\t<tr>\";\r\n\t\t\titemText += \"\t\t\t\t<td class='expfirst' colspan='3' align='right' width='1320px' height='40px'><input type='button' id='submitQuery' value='Submit Query' onClick='performQuery();' disabled='disabled'></td>\";\r\n\t\t\titemText += \"\t\t\t</tr>\";\r\n\t\t\titemText += \"\t\t</table>\";\r\n\t\t\titemText +=\t\"\t</div>\";\r\n\t\t\titemText +=\t\"\t<div id='pannel2'>\";\r\n\t\t\titemText +=\t\"\t</div>\";\r\n\t\t itemText += \"</fieldset>\";\r\n\t\t\t\t\t\t\r\n\t\t\titemText += \"<fieldset style='padding-bottom:0px;padding-top:10px;padding-right:0px;padding-left:0px;border: none;' width='1320px;'>\";\r\n\t\t\titemText +=\t\"\t<hr class='bar'/> \";\r\n\t\t\titemText += \"</fieldset>\";\r\n\t\t\t\r\n\t\t\tdocument.getElementById('container').innerHTML=itemText;\r\n\t\t\tdocument.getElementById('login_message').innerHTML=\"<font color='red'><b>User not found, please try again</b></font>\";\r\n\t\t}\r\n\t\t//User found, retrieve content\r\n\t\telse{\r\n\t\t\tvar itemText = \"\";\r\n\t\t\titemText += \"<fieldset style='padding-right:0px;padding-left:00px;padding-bottom: 0px;border:none;width:1320px;'>\";\r\n\t \t\titemText += \"\t<fieldset style='float:left;padding-bottom:0px;padding-right:0px;padding-left:00px;border:none;width:200px;'>\";\r\n\t\t\titemText +=\t\"\t<img src='images/logo.png' />\";\r\n\t\t\titemText += \"\t</fieldset>\";\r\n\t\t\t\r\n\t\t\titemText += \"\t<fieldset style='float:left;padding-bottom:0px;padding-right:0px;padding-left:00px;border:none;width:755px;margin-top:55px;text-align:center;'>\";\r\n\t\t\titemText += \"\t\t<div id='login_message'> </div>\";\r\n\t\t\titemText += \"\t</fieldset>\";\r\n\t\t\r\n\t\t\titemText += \"\t<!-- Form -->\";\r\n\t\t\titemText += \"\t<fieldset style='float:left;padding-bottom:0px;padding-right:0px;padding-left:00px;border:none;width:350px; margin-top: 55px;'>\";\r\n\t\t\titemText +=\t\"\t\t<table align='right'>\";\r\n\t\t\titemText +=\t\"\t\t\t<tr>\";\r\n\t\t\titemText +=\t\"\t\t\t\t<td align='left' style='vertical-align:bottom;width:50px;'><img src='images/profile-portrait.png' style='border: 1px dotted #72CE9B;vertical-align:text-top;'></td>\";\r\n\t\t\titemText +=\t\"\t\t\t\t<td align='left' style='vertical-align:bottom;width:65px;'>\";\r\n\t\t\titemText +=\t\"\t\t\t\t\t&nbsp;<font color='#757561'><b>\" + username + \"</b></font><br>\";\r\n\t\t\titemText +=\t\"\t\t\t\t\t<input type='button' id='login' value='Logout' onClick='doLogout();'>\";\r\n\t\t\titemText +=\t\"\t\t\t\t</td>\";\r\n\t\t\titemText +=\t\"\t\t\t</tr>\";\r\n\t\t\titemText +=\t\"\t\t</table>\";\r\n\t\t\titemText += \"\t</fieldset>\";\r\n\t\t\titemText += \"</fieldset>\";\r\n\t\t\t\r\n\t\t\titemText += \"<fieldset style='padding:0px;border: none;' width='1320px;'>\";\r\n\t\t\titemText += \"\t<hr class='bar' /> \";\r\n\t\t itemText += \"</fieldset>\";\r\n\t\t\t\t\r\n\t\t itemText += \"<!-- Middle pannel -->\";\r\n\t\t itemText += \"<fieldset style='padding-left: 0;padding-right: 0;padding-top: 0;padding-bottom: 0;border: none;' width='1320px;'>\";\r\n\t\t \titemText +=\t\"\t<!-- Pannel -->\";\r\n\t\t\titemText +=\t\"\t<div id='pannel1'>\";\r\n\t\t\titemText += \"\t\t<table width='100%;' style='vertical-align:top; background: none repeat scroll 0 0 #ffffff; border: 0px solid #72CE9B;' cellspacing='0px'>\";\r\n\t\t\titemText += \"\t\t\t<tr>\";\r\n\t\t\titemText += \"\t\t\t\t<td class='expfirst' colspan='3' align='left' width='1320px' style='color: #757561;font-weight: bold;font-size: 16px;'>SPARQL Query</td>\";\r\n\t\t\titemText += \"\t\t\t</tr>\";\r\n\t\t\titemText += \"\t\t\t<tr>\";\r\n\t\t\titemText += \"\t\t\t\t<td class='expfirst' colspan='3' align='center' width='100%' height='40px'><textarea style='width: 100%; height: 150px; background-color:#E0E0E0;' name='query' id='query'></textarea></td>\";\r\n\t\t\titemText += \"\t\t\t</tr>\";\r\n\t\t\titemText += \"\t\t\t<tr>\";\r\n\t\t\titemText += \"\t\t\t\t<td class='expfirst' colspan='3' align='right' width='1320px' height='40px'><input type='button' id='submitQuery' value='Submit Query' onClick='performQuery();' disabled='disabled'></td>\";\r\n\t\t\titemText += \"\t\t\t</tr>\";\r\n\t\t\titemText += \"\t\t</table>\";\r\n\t\t\titemText +=\t\"\t</div>\";\r\n\t\t\titemText +=\t\"\t<div id='pannel2'>\";\r\n\t\t\titemText +=\t\"\t</div>\";\r\n\t\t\titemText += \"</fieldset>\";\r\n\t\t\t\t\t\t\r\n\t\t\titemText += \"<fieldset style='padding-bottom:0px;padding-top:10px;padding-right:0px;padding-left:0px;border: none;' width='1320px;'>\";\r\n\t\t\titemText +=\t\"\t<hr class='bar'/> \";\r\n\t\t\titemText += \"</fieldset>\";\r\n\t\t\t\r\n\t\t\tdocument.getElementById('container').innerHTML=itemText;\r\n\t\t\tdocument.getElementById(\"submitQuery\").disabled = false;\r\n\t\t\t\r\n\t\t\t//performQuery(user, path);\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n}", "function checkLogin(email, password) {\n const payLoad = {\n email: email,\n password: password\n };\n\n fetch(\"https://5bdffe29f2ef840013994a15.mockapi.io/users\")\n .then(res => res.json())\n .then(function (data) {\n let ok = 0;\n for (let i = 0; i < data.length; i++) {\n if (data[i].email.toLowerCase() == payLoad.email.toLowerCase()) {\n ok = 1;\n if (data[i].password == payLoad.password) {\n let body = document.querySelector(\"body\");\n let modalBackground = document.querySelector(\".modal-backdrop\");\n let loginModal = document.querySelector(\"#loginModal\");\n loginModal.style.display = \"none\";\n loginModal.classList.remove(\"show\");\n if (modalBackground) {\n modalBackground.remove();\n }\n body.classList.remove(\"modal-open\");\n let loginButton = document.querySelector(\".login-logout\");\n loginButton.textContent = \"Logout\";\n let myspan = document.querySelector(\".glyphicon-log-in\");\n myspan.classList.remove(\"glyphicon-log-in\");\n myspan.classList.add(\"glyphicon-log-out\");\n ok = 2;\n /*==================================================================\n [ Checking if it's the administrator logging in ]*/\n if (data[i].email.toLowerCase() == \"[email protected]\" && data[i].password == \"admin\") {\n let dashboard = document.querySelector(\"#dashboard-button\");\n dashboard.style.display = \"block\";\n localStorage.setItem(\"dashboard\", \"true\");\n showAdministratorData();\n }\n else {\n localStorage.setItem(\"dashboard\", \"false\");\n }\n /*==================================================================\n [ Setting local storage in order to keep user logged in on all the pages ]*/\n localStorage.setItem(\"logout\", \"Logout\");\n localStorage.setItem(\"user-email\", data[i].email);\n localStorage.setItem(\"user-address\", data[i].address);\n localStorage.setItem(\"user-id\", data[i].id);\n localStorage.setItem(\"user-phone\", data[i].phone);\n localStorage.setItem(\"user-bonusCode\", data[i].bonusCode);\n if (document.querySelector(\".donate-title\")) {\n let donateTitle = document.querySelector(\".donate-title\");\n donateTitle.innerHTML = \"Welcome back!<br>\\\n How many shoes would you like to donate this time?\";\n document.querySelector(\".telephone-input\").style.display = \"none\";\n document.querySelector(\".email-donate-input\").style.display = \"none\";\n document.querySelector(\".address-donate-input\").style.display = \"none\";\n document.querySelector(\".submit-donate-button\").innerHTML = \"Get your bonus\";\n }\n if (document.querySelector(\".your-bonus-codes\")) {\n document.querySelector(\".your-bonus-codes\").style.display = \"block\";\n }\n if (document.querySelector(\".shoes-subtitle\")) {\n document.querySelector(\".shoes-subtitle\").style.display = \"block\";\n }\n\n }\n }\n }\n /*==================================================================\n [ Password is wrong ]*/\n if (ok == 1) {\n let password = document.querySelector(\".password-input\");\n showValidate(password);\n }\n\n /*==================================================================\n [ User is wrong or incorect ]*/\n if (ok == 0) {\n let email = document.querySelector(\".email-input\");\n showValidate(email);\n }\n\n })\n\n}", "function createFormData(username, password, htmlres) {\n const $ = cheerio.load(htmlres);\n let hiddenData = $(\"form\").find('input[type=\"hidden\"]'); //parse the html for these generated values\n let length = $(\"form\").find('input[type=\"hidden\"]').length;\n //create formData\n let formData = {\n username: username, //1.\n password: password //2.\n };\n for (var i = 0; i < length; i++) {\n formData[hiddenData[i].attribs.name] = hiddenData[i].attribs.value; //3,4,5.\n }\n formData[\"submit\"] = \"log in\"; //6.\n //formData has six attributes required for login\n return formData;\n}", "function buildLogin() {\n $('body').empty().append($pageContent);\n $pageContent.empty().append(signUp).css(('margin-top'), $('.navbar').outerHeight());\n }", "function processSuccessLogin(result) {\n // Success Login save the id and the loginId to the footer\n // Can't save to session or anything here\n $($pt.landPage.session.id).text(result[0].id);\n $($pt.landPage.session.user).text(result[0].loginId);\n $($pt.landPage.session.email).text(result[0].email);\n\n // Notifications\n if (result[0].notify !== 0) {\n $($pt.landPage.session.notify).attr(\"data-badge\", result[0].notify);\n $(document).attr(\"title\", \"* PhotoThief\");\n $(\"#favicon\").attr(\"href\", \"favicon2.ico\");\n }\n\n // Hide slogan\n $($pt.landPage.section.slogan).addClass(\"hidden\").removeClass(\"show\");\n // Hide signup button\n $($pt.landPage.action.signup).addClass(\"hidden\").removeClass(\"show\");\n // Show demand button\n $($pt.landPage.action.demand).addClass(\"show\").removeClass(\"hidden\");\n // Show upload button\n $($pt.landPage.action.upload).addClass(\"show\").removeClass(\"hidden\");\n // Show user info\n $($pt.landPage.session.info).addClass(\"show\").removeClass(\"hidden\");\n\n // Toggle the login Button to say logout\n $($pt.landPage.action.icon).text(\"exit_to_app\");\n $($pt.landPage.action.text).text(\"Logout\");\n $($pt.landPage.action.login).addClass(($pt.landPage.action.logout).substr(1));\n $($pt.landPage.action.login).removeClass(($pt.landPage.action.login).substr(1));\n\n // Confirm leaving webapp\n window.onbeforeunload = function() {\n return \"\";\n };\n\n // Reload the main page with carousel with user specific data ???\n //initialize();\n }", "function validate_login_form(form, data) {\n if (data.user_username == \"\") {\n // if username variable is empty\n addFormError(form[\"user_username\"], 'The username is invalid');\n return false; // stop the script if validation is triggered\n }\n\n if (data.user_password == \"\") {\n // if password variable is empty\n addFormError(form[\"user_password\"], 'The password is invalid');\n return false; // stop the script if validation is triggered\n }\n\n //Attempt login. If successful, change login text to username, hides modal, and reinits markers\n $.post(\"login\", {\n username: data.user_username,\n password: data.user_password\n }, function(user) {\n if (user[0] != null) {\n username = data.user_username;\n password = data.user_password;\n $('#successful_login').removeClass('active');\n dialogBox.removeClass('dialog-effect-out').addClass('dialog-effect-in');\n document.getElementById('login_form').reset();\n $('#login-modal').modal('hide');\n $('#loginButton').hide();\n $('#logoutButton').show();\n $('#username').text(username);\n $('#username').show();\n markerCluster.clearMarkers()\n initMarkers();\n } else {\n addFormError(form[\"user_username\"], 'The username or password is incorrect');\n }\n });\n}", "function autofillLogin() {\n var dLogin = document.getElementById(\"desired_login\");\n var dEmail = document.getElementById(\"desired_email\");\n\n var fname = document.getElementById(\"fname\");\n var lname = document.getElementById(\"lname\");\n dLogin.value = fname.value + \".\" + lname.value;\n dEmail.value = fname.value + \".\" + lname.value + \"@cambridgecollege.edu\";\n}", "function scrapeFields() {\n\tvar provider = providers[$(\"#autofill-provider\").val()];\n\tscrapeRandom(provider);\n}", "function validateFieldsLoginPage(processing_text) \n{\t\n var elemUsername = document.getElementById(\"userid\");\n var userid = elemUsername.value;\n userid = trimstring(userid);\n elemUsername.value = userid;\n var elemPassword = document.getElementById(\"pass\");\n var pass = elemPassword.value;\n pass = trimstring(pass);\n elemPassword.value = pass;\n \n\tif (userid == '' || pass == '') \n\t{\t\t\n\t\tdocument.getElementById('required').className = \"error-show\";\n\t\t\n\t\ttry\n {\n document.getElementById('errormsg').className = \"error-hide\";\n }\n catch (err)\n {\n }\n\t\t\n setFocusLoginPage();\n return false;\n }\n\t\n if (!isValidLoginId(userid,\"Username\")) \n\t{\t\t\n elemPassword.focus();\n\t\telemUsername.focus();\n return false;\n }\n\n\tvar isButtonDisabled = document.getElementById('signin_button').disabled;\n\t\n\tif (isButtonDisabled)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById('signin_button').disabled = true;\n\t\tdocument.getElementById('signin_button').value = processing_text;\n\t\treturn true;\n\t}\n}", "function login(){\n browser.maximizeWindow()\n browser.url('https://stage.pasv.us/user/login')\n $('[name=\"email\"]').setValue('[email protected]')\n $('[name=\"password\"]').setValue('lutka')\n $('[type=\"submit\"]').click()\n}", "function watchSubmit() {\n $(\"form[name='js-login-submit-form']\").submit(function(event) {\n event.preventDefault();\n let username = $(this).find('.js-username').val();\n let password = $(this).find('.js-password').val();\n console.log(\"submitLogin firing with username/password: \" + username + \"/\" + password);\n submitLogin(username, password);\n });\n}" ]
[ "0.71068174", "0.70831144", "0.70727664", "0.705191", "0.6945985", "0.68821186", "0.68821186", "0.68735254", "0.68104607", "0.67728907", "0.65103406", "0.65035194", "0.64629877", "0.6454861", "0.6429596", "0.64158803", "0.6347176", "0.6327344", "0.63093513", "0.6286776", "0.62734634", "0.6252385", "0.6250254", "0.62442166", "0.6195068", "0.6180297", "0.61391973", "0.61360806", "0.6081926", "0.6057854", "0.60535353", "0.60421145", "0.60282207", "0.6023874", "0.6019923", "0.6016489", "0.60139316", "0.6001202", "0.59987754", "0.5998093", "0.5989098", "0.598679", "0.59776807", "0.59722966", "0.5947559", "0.5946499", "0.593523", "0.5934488", "0.5934385", "0.5927726", "0.5925859", "0.59242094", "0.59200853", "0.5919824", "0.59154063", "0.58948886", "0.5893526", "0.5875537", "0.5875203", "0.58730227", "0.58718187", "0.5870829", "0.586685", "0.58623284", "0.58582675", "0.5849507", "0.58484524", "0.58393675", "0.5827603", "0.5827597", "0.58255136", "0.5824864", "0.5820894", "0.5814564", "0.58008033", "0.57914346", "0.57894355", "0.57894313", "0.57828873", "0.57824576", "0.5779874", "0.5769471", "0.57662123", "0.57657766", "0.57578194", "0.5752495", "0.57472235", "0.57434523", "0.5743113", "0.5735413", "0.5734094", "0.573249", "0.57318205", "0.5728972", "0.57223916", "0.57202995", "0.5718611", "0.5713938", "0.5713564", "0.571322" ]
0.6300012
19
Proxy factory for class methods
function proxyFactory( col, method ) { return function() { // Save arguments var args = arguments; // Things that will be done: // - Wait for resolved collection instance // - Call the proxied method return col.then( function( colInstance ) { return method( colInstance, args ); } ); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Proxy(){}", "function Proxy(){}", "function ProxyClass(runtime, scope, instanceConstructor, baseClass) {\n function ProxyConstructor() {\n somewhatImplemented(\"Proxy\");\n }\n var c = new Class(\"Proxy\", ProxyConstructor, ApplicationDomain.coerceCallable(ProxyConstructor));\n c.extendBuiltin(baseClass);\n return c;\n}", "createProxy() {\r\n return this;\r\n }", "static create(fetcher, config = {}) {\n // Create a proxy, wrapping a simple object returning methods that calls functions\n // TODO: Lazily fetch available functions and return these from the ownKeys() trap\n const factory = new FunctionsFactory(fetcher, config);\n\n // Wrap the factory in a proxy that calls the internal call method\n return new Proxy(factory, {\n get(target, p, receiver) {\n if (typeof p === 'string' && RESERVED_NAMES.indexOf(p) === -1) {\n return target.callFunction.bind(target, p);\n } else {\n const prop = Reflect.get(target, p, receiver);\n\n return typeof prop === 'function' ? prop.bind(target) : prop;\n }\n }\n });\n }", "function ClassProxy(className, metaData) {\n if (metaData) {\n this._define(className, metaData);\n }\n else {\n this._className = className;\n }\n return this;\n}", "function proxy(name) {\n return function() {\n var ret = protectedInstance[name].apply(protectedInstance, arguments);\n // Swap return values if the method returns a reference to\n // its receiver.\n return ret === protectedInstance ? instance : ret;\n };\n }", "function createFetcher(...methodNames) {\n return new Proxy(FETCHER_TARGET, proxyHandler(new Set(methodNames)));\n}", "function proxy(obj,methodName){var method=obj[methodName];return function(){return method.apply(obj,arguments);};}", "function proxyMethod(name){ // Wrap to always call the current version\n\tvar proxiedMethod=function proxiedMethod(){if(typeof current[name]==='function'){return current[name].apply(this,arguments);}}; // Copy properties of the original function, if any\n\t(0,_assign2.default)(proxiedMethod,current[name]);proxiedMethod.toString=proxyToString(name);return proxiedMethod;}", "function proxyMethod(name){ // Wrap to always call the current version\n\tvar proxiedMethod=function proxiedMethod(){if(typeof current[name]==='function'){return current[name].apply(this,arguments);}}; // Copy properties of the original function, if any\n\t(0,_assign2.default)(proxiedMethod,current[name]);proxiedMethod.toString=proxyToString(name);return proxiedMethod;}", "function patchClass(className) {\n var OriginalClass = _global$1[className];\n if (!OriginalClass)\n return;\n _global$1[className] = function () {\n var a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n var instance = new OriginalClass(function () { });\n var prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global$1[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n Object.defineProperty(_global$1[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global$1[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n var OriginalClass = _global$1[className];\n if (!OriginalClass)\n return;\n _global$1[className] = function () {\n var a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n var instance = new OriginalClass(function () { });\n var prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global$1[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n Object.defineProperty(_global$1[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global$1[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n var OriginalClass = _global$1[className];\n if (!OriginalClass)\n return;\n _global$1[className] = function () {\n var a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n var instance = new OriginalClass(function () { });\n var prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global$1[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n Object.defineProperty(_global$1[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global$1[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n var OriginalClass = _global$1[className];\n if (!OriginalClass)\n return;\n _global$1[className] = function () {\n var a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default: throw new Error('Arg list too long.');\n }\n };\n var instance = new OriginalClass(function () { });\n var prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global$1[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n Object.defineProperty(_global$1[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global$1[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n var OriginalClass = _global$1[className];\n if (!OriginalClass)\n return;\n _global$1[className] = function () {\n var a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default: throw new Error('Arg list too long.');\n }\n };\n var instance = new OriginalClass(function () { });\n var prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global$1[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n Object.defineProperty(_global$1[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global$1[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n const OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n const a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n const instance = new OriginalClass(function () { });\n let prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n const OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n const a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n const instance = new OriginalClass(function () { });\n let prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n const OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n const a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n const instance = new OriginalClass(function () { });\n let prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () { return this[originalInstanceKey][prop]; }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n }", "_createService(Router, Store, name, handlers) {\n this.meta(Store, name)\n return new Proxy(handlers, {\n // Anytime a property on the object is accessed,\n // the Proxy calls the get method and injects\n // the initial object as well as the method called\n //\n // this.$resources.blog.list(pageNumber)\n // => [BlogPost, BlogPost, ...]\n //\n // this.$resources.blog.featured()\n // => [BlogPost, BlogPost, BlogPost]\n get(obj, method) {\n if (Reflect.has(obj, method)) {\n return async function(...args) {\n await obj[method](Store, ...args)\n }\n } else {\n console.error(`Request object has no method ${method}`)\n }\n },\n })\n }", "function get(){return proxy;}", "function get(){return proxy;}", "function patchClass(className) {\n var OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n var a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n var instance = new OriginalClass(function () { });\n var prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n var OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n var a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n var instance = new OriginalClass(function () { });\n var prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n var OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n var a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n var instance = new OriginalClass(function () { });\n var prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}", "function patchClass(className) {\n var OriginalClass = _global[className];\n if (!OriginalClass) return; // keep original class in global\n\n _global[zoneSymbol(className)] = OriginalClass;\n\n _global[className] = function () {\n var a = bindArguments(arguments, className);\n\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n\n default:\n throw new Error('Arg list too long.');\n }\n }; // attach original delegate to patched function\n\n\n attachOriginToPatched(_global[className], OriginalClass);\n var instance = new OriginalClass(function () {});\n var prop;\n\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob') continue;\n\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n } else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function set(fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop); // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n } else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function get() {\n return this[originalInstanceKey][prop];\n }\n });\n }\n })(prop);\n }\n\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n }", "function createProxy( methodName ) {\n return function() {\n var player = this.$el.data( \"ooyala\" )._player,\n args = [].slice.call(arguments);\n\n return player[ methodName ].apply(player, args);\n };\n }", "function fakeNew(F, ...args) {\n const obj = Object.create(F.prototype); // prototype inheritance\n F.call(obj, ...args); // mixin\n return obj; // prototype + mixin is how js emulate class-based paradigm\n}", "function patchClass(className) {\n var OriginalClass = global[className];\n if (!OriginalClass) return;\n\n global[className] = function () {\n var a = bindArguments(arguments);\n switch (a.length) {\n case 0: this._o = new OriginalClass(); break;\n case 1: this._o = new OriginalClass(a[0]); break;\n case 2: this._o = new OriginalClass(a[0], a[1]); break;\n case 3: this._o = new OriginalClass(a[0], a[1], a[2]); break;\n case 4: this._o = new OriginalClass(a[0], a[1], a[2], a[3]); break;\n default: throw new Error('what are you even doing?');\n }\n };\n\n var instance = new OriginalClass();\n\n var prop;\n for (prop in instance) {\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n global[className].prototype[prop] = function () {\n return this._o[prop].apply(this._o, arguments);\n };\n } else {\n Object.defineProperty(global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this._o[prop] = global.zone.bind(fn);\n } else {\n this._o[prop] = fn;\n }\n },\n get: function () {\n return this._o[prop];\n }\n });\n }\n }(prop));\n }\n\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n global[className][prop] = OriginalClass[prop];\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator.\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator.\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator.\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator.\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator.\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator.\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator.\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator.\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "constructor(objeto,view,...parametros){\n let proxy= ProxyFactory.create(objeto, parametros, (model) => view.update(model));\n view.update(proxy);\n //retorna uma instancia no proprio construtor\n return proxy;\n }", "function proxyMethod(name) {\n // Wrap to always call the current version\n var proxiedMethod = function proxiedMethod() {\n if (typeof current[name] === 'function') {\n return current[name].apply(this, arguments);\n }\n };\n\n // Copy properties of the original function, if any\n (0, _assign2.default)(proxiedMethod, current[name]);\n proxiedMethod.toString = proxyToString(name);\n try {\n Object.defineProperty(proxiedMethod, 'name', {\n value: name\n });\n } catch (err) {}\n\n return proxiedMethod;\n }", "function proxyMethod(name) {\n // Wrap to always call the current version\n var proxiedMethod = function proxiedMethod() {\n if (typeof current[name] === 'function') {\n return current[name].apply(this, arguments);\n }\n };\n\n // Copy properties of the original function, if any\n (0, _assign2.default)(proxiedMethod, current[name]);\n proxiedMethod.toString = proxyToString(name);\n try {\n Object.defineProperty(proxiedMethod, 'name', {\n value: name\n });\n } catch (err) {}\n\n return proxiedMethod;\n }", "function proxyMethod(name) {\n // Wrap to always call the current version\n var proxiedMethod = function proxiedMethod() {\n if (typeof current[name] === 'function') {\n return current[name].apply(this, arguments);\n }\n };\n\n // Copy properties of the original function, if any\n (0, _assign2.default)(proxiedMethod, current[name]);\n proxiedMethod.toString = proxyToString(name);\n try {\n Object.defineProperty(proxiedMethod, 'name', {\n value: name\n });\n } catch (err) {}\n\n return proxiedMethod;\n }", "function proxyMethod(name) {\n // Wrap to always call the current version\n var proxiedMethod = function proxiedMethod() {\n if (typeof current[name] === 'function') {\n return current[name].apply(this, arguments);\n }\n };\n\n // Copy properties of the original function, if any\n (0, _assign2.default)(proxiedMethod, current[name]);\n proxiedMethod.toString = proxyToString(name);\n try {\n Object.defineProperty(proxiedMethod, 'name', {\n value: name\n });\n } catch (err) {}\n\n return proxiedMethod;\n }", "function proxyMethod(name) {\n // Wrap to always call the current version\n var proxiedMethod = function proxiedMethod() {\n if (typeof current[name] === 'function') {\n return current[name].apply(this, arguments);\n }\n };\n\n // Copy properties of the original function, if any\n (0, _assign2.default)(proxiedMethod, current[name]);\n proxiedMethod.toString = proxyToString(name);\n try {\n Object.defineProperty(proxiedMethod, 'name', {\n value: name\n });\n } catch (err) {}\n\n return proxiedMethod;\n }", "function proxyStaticMethods(target, source) {\n\t if (typeof source !== 'function') {\n\t return;\n\t }\n\t for (var key in source) {\n\t if (source.hasOwnProperty(key)) {\n\t var value = source[key];\n\t if (typeof value === 'function') {\n\t var bound = value.bind(source);\n\t // Copy any properties defined on the function, such as `isRequired` on\n\t // a PropTypes validator.\n\t for (var k in value) {\n\t if (value.hasOwnProperty(k)) {\n\t bound[k] = value[k];\n\t }\n\t }\n\t target[key] = bound;\n\t } else {\n\t target[key] = value;\n\t }\n\t }\n\t }\n\t}", "function proxyStaticMethods(target, source) {\n\t if (typeof source !== 'function') {\n\t return;\n\t }\n\t for (var key in source) {\n\t if (source.hasOwnProperty(key)) {\n\t var value = source[key];\n\t if (typeof value === 'function') {\n\t var bound = value.bind(source);\n\t // Copy any properties defined on the function, such as `isRequired` on\n\t // a PropTypes validator.\n\t for (var k in value) {\n\t if (value.hasOwnProperty(k)) {\n\t bound[k] = value[k];\n\t }\n\t }\n\t target[key] = bound;\n\t } else {\n\t target[key] = value;\n\t }\n\t }\n\t }\n\t}", "function proxyMethod(name) {\n\t // Wrap to always call the current version\n\t var proxiedMethod = function proxiedMethod() {\n\t if (typeof current[name] === 'function') {\n\t return current[name].apply(this, arguments);\n\t }\n\t };\n\n\t // Copy properties of the original function, if any\n\t (0, _assign2.default)(proxiedMethod, current[name]);\n\t proxiedMethod.toString = proxyToString(name);\n\n\t return proxiedMethod;\n\t }", "function proxyMethod(name) {\n\t // Wrap to always call the current version\n\t var proxiedMethod = function proxiedMethod() {\n\t if (typeof current[name] === 'function') {\n\t return current[name].apply(this, arguments);\n\t }\n\t };\n\n\t // Copy properties of the original function, if any\n\t (0, _assign2.default)(proxiedMethod, current[name]);\n\t proxiedMethod.toString = proxyToString(name);\n\n\t return proxiedMethod;\n\t }", "function proxyMethod(name) {\n // Wrap to always call the current version\n var proxiedMethod = function proxiedMethod() {\n if (typeof current[name] === 'function') {\n return current[name].apply(this, arguments);\n }\n };\n\n // Copy properties of the original function, if any\n (0, _assign2.default)(proxiedMethod, current[name]);\n proxiedMethod.toString = proxyToString(name);\n\n return proxiedMethod;\n }", "function proxyMethod(name) {\n // Wrap to always call the current version\n var proxiedMethod = function proxiedMethod() {\n if (typeof current[name] === 'function') {\n return current[name].apply(this, arguments);\n }\n };\n\n // Copy properties of the original function, if any\n (0, _assign2.default)(proxiedMethod, current[name]);\n proxiedMethod.toString = proxyToString(name);\n\n return proxiedMethod;\n }", "function proxyMethod(name) {\n // Wrap to always call the current version\n var proxiedMethod = function proxiedMethod() {\n if (typeof current[name] === 'function') {\n return current[name].apply(this, arguments);\n }\n };\n\n // Copy properties of the original function, if any\n (0, _assign2.default)(proxiedMethod, current[name]);\n proxiedMethod.toString = proxyToString(name);\n\n return proxiedMethod;\n }", "function cProxy(\n)\n{\n\n\n}", "function createMethodsManager() {\n var methods = {};\n\n return {\n addMethod: addMethod,\n setTarget: setTarget\n };\n\n /*\n * Adds a method that will be available to extend the object.\n *\n * @param {string} name The method name\n * @param {function} [method] The handler for the specified method name.\n * @return {function} The handler for the specified method name.\n */\n function addMethod(name, method) {\n if (method !== undefined) {\n methods[name] = method;\n }\n return methods[name];\n }\n\n /*\n * Sets the target object to extend.\n *\n * @param {object} target The target object.\n */\n function setTarget(target) {\n var targetMethods = {};\n for (var name in methods) {\n targetMethods[name] = wrapMethod(target, methods[name]);\n }\n return targetMethods;\n }\n\n /*\n * Wraps the method so that it is executed with the appropriate\n * arguments.\n *\n * @param {object} target The target object.\n * @param {function} method The method to wrap.\n */\n function wrapMethod(target, method) {\n return function() {\n\n // Put arguments into a real array.\n var methodArgs = [];\n for (var i = 0; i < arguments.length; i++) {\n methodArgs.push(arguments[i]);\n }\n\n var params = method(target, parseMethodArgs, methodArgs);\n\n modifyTarget(target,\n params.source,\n params.sourceKeys,\n params.filters,\n params.overrideKeys);\n return this;\n };\n }\n}", "function classCreate() {\n return function() {\n this.initialize.apply(this, arguments);\n }\n}", "static getProxy() {\n return new Proxy({}, {\n get(target, name) {\n const mailDelivery = new MailDelivery();\n mailDelivery.className = name;\n return mailDelivery.proxy;\n },\n });\n }", "function TruckFactory() {}", "function TruckFactory() {}", "function factory() {}", "function factory() {}", "function patchClass(className) {\n var OriginalClass = global[className];\n if (!OriginalClass) return;\n\n global[className] = function (fn) {\n this._o = new OriginalClass(global.zone.bind(fn, true));\n // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks\n this._creationZone = global.zone;\n };\n\n var instance = new OriginalClass(function () {});\n\n global[className].prototype.disconnect = function () {\n var result = this._o.disconnect.apply(this._o, arguments);\n if (this._active) {\n this._creationZone.dequeueTask();\n this._active = false;\n }\n return result;\n };\n\n global[className].prototype.observe = function () {\n if (!this._active) {\n this._creationZone.enqueueTask();\n this._active = true;\n }\n return this._o.observe.apply(this._o, arguments);\n };\n\n var prop;\n for (prop in instance) {\n (function (prop) {\n if (typeof global[className].prototype !== undefined) {\n return;\n }\n if (typeof instance[prop] === 'function') {\n global[className].prototype[prop] = function () {\n return this._o[prop].apply(this._o, arguments);\n };\n } else {\n Object.defineProperty(global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this._o[prop] = global.zone.bind(fn);\n } else {\n this._o[prop] = fn;\n }\n },\n get: function () {\n return this._o[prop];\n }\n });\n }\n }(prop));\n }\n}", "function factory(require, exports, module) {\n /**\n * Flag to prevent the Class.proto.init from being invoked during initialization\n * @type {Boolean}\n */\n var start = true;\n\n /**\n * Creates a shim for invoking a this.parent() command by wrapping it inside a closure\n * @method protoParent\n * @private\n * @param {object} prototype\n * @param {string} name\n * @param {function} method\n * @return {Function}\n */\n function protoParent(prototype, name, method) {\n return function() {\n this.parent = prototype[name];\n return method.apply(this, arguments);\n };\n }\n\n /**\n * Extends an object's properties and assign them as prototypes in a Function\n * @protected\n * @param {Function} BaseClass\n * @param {object} properties\n * @return {Function}\n */\n function extendClass(BaseClass, properties) {\n var parent = BaseClass.prototype;\n start = false;\n var prototype = new BaseClass();\n start = true;\n var attribute;\n // iterate over the properties and copy them.\n for (var name in properties) {\n if (properties.hasOwnProperty(name)) {\n attribute = properties[name];\n prototype[name] = typeof parent[name] === 'function' && typeof properties[name] === 'function' ?\n protoParent(parent, name, attribute) :\n attribute;\n }\n }\n /**\n * Create a fresh constructor\n * @class Class\n * @constructor\n */\n function Class() {\n // use the init method to define your constructor's content.\n if (start && this.init.apply) {\n this.init.apply(this, arguments);\n }\n }\n Class.prototype = prototype;\n Class.prototype.constructor = Class;\n /**\n * @method extend\n * @param attributes\n * @return {Class}\n */\n Class.extend = function(attributes) {\n return extendClass(Class, attributes);\n };\n return Class;\n }\n\n var Class = extendClass(function() {}, {});\n\n return module.exports = Class;\n }", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator. (mergeInto refuses to work on functions.)\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator. (mergeInto refuses to work on functions.)\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator. (mergeInto refuses to work on functions.)\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator. (mergeInto refuses to work on functions.)\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator. (mergeInto refuses to work on functions.)\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator. (mergeInto refuses to work on functions.)\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "function proxyStaticMethods(target, source) {\n if (typeof source !== 'function') {\n return;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value === 'function') {\n var bound = value.bind(source);\n // Copy any properties defined on the function, such as `isRequired` on\n // a PropTypes validator. (mergeInto refuses to work on functions.)\n for (var k in value) {\n if (value.hasOwnProperty(k)) {\n bound[k] = value[k];\n }\n }\n target[key] = bound;\n } else {\n target[key] = value;\n }\n }\n }\n}", "_factoryFunction (...dependencies) {\n\t\tlet serviceInstance = new ShortURLAPI(...dependencies);\n\t\tserviceInstance._BASE_URL = this._baseURL;\n\t\tserviceInstance._USE_CAMEL_CASE = this._isUsingCamelCase;\n\t\treturn serviceInstance;\n\t}", "function WaqrProxy() {\r\n this.wiz = new Wiz();\r\n this.repositoryBrowserController = new RepositoryBrowserControllerProxy();\r\n}", "function patchClass(className) {\n var OriginalClass = global[className];\n if (!OriginalClass)\n return;\n global[className] = function (fn) {\n this[originalInstanceKey] = new OriginalClass(global.zone.bind(fn, true));\n // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks\n this[creationZoneKey] = global.zone;\n };\n var instance = new OriginalClass(function () { });\n global[className].prototype.disconnect = function () {\n var result = this[originalInstanceKey].disconnect.apply(this[originalInstanceKey], arguments);\n if (this[isActiveKey]) {\n this[creationZoneKey].dequeueTask();\n this[isActiveKey] = false;\n }\n return result;\n };\n global[className].prototype.observe = function () {\n if (!this[isActiveKey]) {\n this[creationZoneKey].enqueueTask();\n this[isActiveKey] = true;\n }\n return this[originalInstanceKey].observe.apply(this[originalInstanceKey], arguments);\n };\n var prop;\n for (prop in instance) {\n (function (prop) {\n if (typeof global[className].prototype !== 'undefined') {\n return;\n }\n if (typeof instance[prop] === 'function') {\n global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n Object.defineProperty(global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = global.zone.bind(fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n }\n });\n }\n }(prop));\n }\n}", "function Class() {\n return generator.newInstance(this, arguments);\n }", "function TruckFactory(){}", "function proxyPolyfill () {\n let lastRevokeFn = null;\n\n /**\n * @param {*} o\n * @return {boolean} whether this is probably a (non-null) Object\n */\n function isObject (o) {\n return o ? (typeof o === 'object' || typeof o === 'function') : false;\n }\n\n /**\n * @constructor\n * @param {!Object} target\n * @param {{apply, construct, get, set}} handler\n */\n const ProxyPolyfill = function (target, handler) {\n if (!isObject(target) || !isObject(handler)) {\n throw new TypeError('Cannot create proxy with a non-object as target or handler');\n }\n\n // Construct revoke function, and set lastRevokeFn so that Proxy.revocable can steal it.\n // The caller might get the wrong revoke function if a user replaces or wraps scope.Proxy\n // to call itself, but that seems unlikely especially when using the polyfill.\n let throwRevoked = function () {};\n lastRevokeFn = function () {\n throwRevoked = function (trap) {\n throw new TypeError(`Cannot perform '${trap}' on a proxy that has been revoked`);\n };\n };\n\n // Fail on unsupported traps: Chrome doesn't do this, but ensure that users of the polyfill\n // are a bit more careful. Copy the internal parts of handler to prevent user changes.\n const unsafeHandler = handler;\n handler = { get: null, set: null, apply: null, construct: null };\n for (const k in unsafeHandler) {\n if (!(k in handler)) ; else {\n handler[k] = unsafeHandler[k];\n }\n }\n if (typeof unsafeHandler === 'function') {\n // Allow handler to be a function (which has an 'apply' method). This matches what is\n // probably a bug in native versions. It treats the apply call as a trap to be configured.\n handler.apply = unsafeHandler.apply.bind(unsafeHandler);\n }\n\n // Define proxy as this, or a Function (if either it's callable, or apply is set).\n // TODO(samthor): Closure compiler doesn't know about 'construct', attempts to rename it.\n let proxy = this;\n let isMethod = false;\n let isArray = false;\n if (typeof target === 'function') {\n proxy = function ProxyPolyfill () {\n const usingNew = (this && this.constructor === proxy);\n const args = Array.prototype.slice.call(arguments);\n throwRevoked(usingNew ? 'construct' : 'apply');\n\n if (usingNew && handler.construct) {\n return handler.construct.call(this, target, args);\n } else if (!usingNew && handler.apply) {\n return handler.apply(target, this, args);\n }\n\n // since the target was a function, fallback to calling it directly.\n if (usingNew) {\n // inspired by answers to https://stackoverflow.com/q/1606797\n args.unshift(target); // pass class as first arg to constructor, although irrelevant\n // nb. cast to convince Closure compiler that this is a constructor\n const f = /** @type {!Function} */ (target.bind.apply(target, args));\n /* eslint new-cap: \"off\" */\n return new f();\n }\n return target.apply(this, args);\n };\n isMethod = true;\n } else if (target instanceof Array) {\n proxy = [];\n isArray = true;\n }\n\n // Create default getters/setters. Create different code paths as handler.get/handler.set can't\n // change after creation.\n const getter = handler.get ? function (prop) {\n throwRevoked('get');\n return handler.get(this, prop, proxy);\n } : function (prop) {\n throwRevoked('get');\n return this[prop];\n };\n const setter = handler.set ? function (prop, value) {\n throwRevoked('set');\n handler.set(this, prop, value, proxy);\n } : function (prop, value) {\n throwRevoked('set');\n this[prop] = value;\n };\n\n // Clone direct properties (i.e., not part of a prototype).\n const propertyNames = Object.getOwnPropertyNames(target);\n const propertyMap = {};\n propertyNames.forEach(function (prop) {\n if ((isMethod || isArray) && prop in proxy) {\n return; // ignore properties already here, e.g. 'bind', 'prototype' etc\n }\n const real = Object.getOwnPropertyDescriptor(target, prop);\n const desc = {\n enumerable: !!real.enumerable,\n get: getter.bind(target, prop),\n set: setter.bind(target, prop)\n };\n Object.defineProperty(proxy, prop, desc);\n propertyMap[prop] = true;\n });\n\n // Set the prototype, or clone all prototype methods (always required if a getter is provided).\n // TODO(samthor): We don't allow prototype methods to be set. It's (even more) awkward.\n // An alternative here would be to _just_ clone methods to keep behavior consistent.\n let prototypeOk = true;\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(proxy, Object.getPrototypeOf(target));\n /* eslint no-proto: \"off\" */\n } else if (proxy.__proto__) {\n proxy.__proto__ = target.__proto__;\n } else {\n prototypeOk = false;\n }\n if (handler.get || !prototypeOk) {\n for (const k in target) {\n if (propertyMap[k]) {\n continue;\n }\n Object.defineProperty(proxy, k, { get: getter.bind(target, k) });\n }\n }\n\n // The Proxy polyfill cannot handle adding new properties. Seal the target and proxy.\n Object.seal(target);\n Object.seal(proxy);\n\n return proxy; // nb. if isMethod is true, proxy != this\n };\n\n ProxyPolyfill.revocable = function (target, handler) {\n const p = new ProxyPolyfill(target, handler);\n return { proxy: p, revoke: lastRevokeFn };\n };\n\n return ProxyPolyfill;\n }", "function RosterProxy(service) {\n this.service = service;\n this.helpers = new Helpers();\n}", "function activateProxy(args, info) {\n return util_1.createMethod(Object.assign({ method: {\n args,\n name: 'activateProxy',\n pallet: 'democracy'\n } }, info));\n}", "function proxify(obj) {\n if (!lo.isObject(obj)) {\n throw new Error('Proxify input is not object')\n }\n // Proxify prototype if available\n if ('prototype' in obj) proxify(obj.prototype)\n // Get all own property member of the object\n let properties = Object.getOwnPropertyNames(obj)\n for (let property of properties) {\n // Skip constructor function\n if (property === 'constructor') continue\n // Skip if the property is not generator function\n if (!isGeneratorFunction(obj[property])) continue\n // Store current function\n let srcFunction = obj[property]\n // Inject object/class with proxified generator function\n obj[property] = function proxifier() {\n return run(srcFunction.apply(this, arguments))\n }\n }\n}", "function _createWrappedRequestMethodFactory(breadcrumbsEnabled, tracingEnabled) {\n return function wrappedRequestMethodFactory(originalRequestMethod) {\n return function wrappedMethod() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var httpModule = this;\n var requestArgs = http_1.normalizeRequestArgs(this, args);\n var requestOptions = requestArgs[0];\n var requestUrl = http_1.extractUrl(requestOptions);\n // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n if (http_1.isSentryRequest(requestUrl)) {\n return originalRequestMethod.apply(httpModule, requestArgs);\n }\n var span;\n var parentSpan;\n var scope = core_1.getCurrentHub().getScope();\n if (scope && tracingEnabled) {\n parentSpan = scope.getSpan();\n if (parentSpan) {\n span = parentSpan.startChild({\n description: (requestOptions.method || 'GET') + \" \" + requestUrl,\n op: 'http.client',\n });\n var sentryTraceHeader = span.toTraceparent();\n utils_1.logger.log(\"[Tracing] Adding sentry-trace header \" + sentryTraceHeader + \" to outgoing request to \" + requestUrl + \": \");\n requestOptions.headers = tslib_1.__assign(tslib_1.__assign({}, requestOptions.headers), { 'sentry-trace': sentryTraceHeader });\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalRequestMethod\n .apply(httpModule, requestArgs)\n .once('response', function (res) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('response', requestUrl, req, res);\n }\n if (tracingEnabled && span) {\n if (res.statusCode) {\n span.setHttpStatus(res.statusCode);\n }\n span.description = http_1.cleanSpanDescription(span.description, requestOptions, req);\n span.finish();\n }\n })\n .once('error', function () {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var req = this;\n if (breadcrumbsEnabled) {\n addRequestBreadcrumb('error', requestUrl, req);\n }\n if (tracingEnabled && span) {\n span.setHttpStatus(500);\n span.description = http_1.cleanSpanDescription(span.description, requestOptions, req);\n span.finish();\n }\n });\n };\n };\n}", "function AutoFactory() {}", "function proxy(object, preMethod, postMethod, errorMethod) {\n\n // proxy a function\n if ( typeof object==='function' ) {\n\n if ( object.__isProxy ) {\n return object;\n }\n\n return (function(fn) {\n var proxyfn= function() {\n if ( preMethod ) {\n preMethod({\n fn: fn,\n arguments: Array.prototype.slice.call(arguments)} );\n }\n var retValue= null;\n try {\n // apply original function call with itself as context\n retValue= fn.apply(fn, Array.prototype.slice.call(arguments));\n // everything went right on function call, then call\n // post-method hook if present\n if ( postMethod ) {\n postMethod({\n fn: fn,\n arguments: Array.prototype.slice.call(arguments)} );\n }\n } catch(e) {\n // an exeception was thrown, call exception-method hook if\n // present and return its result as execution result.\n if( errorMethod ) {\n retValue= errorMethod({\n fn: fn,\n arguments: Array.prototype.slice.call(arguments),\n exception: e} );\n } else {\n // since there's no error hook, just throw the exception\n throw e;\n }\n }\n\n // return original returned value to the caller.\n return retValue;\n };\n proxyfn.__isProxy= true;\n return proxyfn;\n\n })(object);\n }\n\n /**\n * If not a function then only non privitive objects can be proxied.\n * If it is a previously created proxy, return the proxy itself.\n */\n if ( !typeof object==='object' ||\n object.constructor===Array ||\n object.constructor===String ||\n object.__isProxy ) {\n\n return object;\n }\n\n // Our proxy object class.\n var cproxy= function() {};\n // A new proxy instance.\n var proxy= new cproxy();\n // hold the proxied object as member. Needed to assign proper\n // context on proxy method call.\n proxy.__object= object;\n proxy.__isProxy= true;\n\n // For every element in the object to be proxied\n for( var method in object ) {\n // only function members\n if ( typeof object[method]==='function' ) {\n // add to the proxy object a method of equal signature to the\n // method present at the object to be proxied.\n // cache references of object, function and function name.\n proxy[method]= (function(proxy,fn,method) {\n return function() {\n // call pre-method hook if present.\n if ( preMethod ) {\n preMethod({\n object: proxy.__object,\n method: method,\n arguments: Array.prototype.slice.call(arguments)} );\n }\n var retValue= null;\n try {\n // apply original object call with proxied object as\n // function context.\n retValue= fn.apply( proxy.__object, arguments );\n // everything went right on function call, the call\n // post-method hook if present\n if ( postMethod ) {\n postMethod({\n object: proxy.__object,\n method: method,\n arguments: Array.prototype.slice.call(arguments)} );\n }\n } catch(e) {\n // an exeception was thrown, call exception-method hook if\n // present and return its result as execution result.\n if( errorMethod ) {\n retValue= errorMethod({\n object: proxy.__object,\n method: method,\n arguments: Array.prototype.slice.call(arguments),\n exception: e} );\n } else {\n // since there's no error hook, just throw the exception\n throw e;\n }\n }\n\n // return original returned value to the caller.\n return retValue;\n };\n })(proxy,object[method],method);\n }\n }\n\n // return our newly created and populated of functions proxy object.\n return proxy;\n}", "function classFactory(klass) {\n return {\n create: function (injections) {\n if (typeof klass.extend === 'function') {\n return klass.extend(injections);\n } else {\n return klass;\n }\n }\n };\n }", "function classFactory(klass) {\n return {\n create: function (injections) {\n if (typeof klass.extend === 'function') {\n return klass.extend(injections);\n } else {\n return klass;\n }\n }\n };\n }", "constructor(){\n super(...arguments);\n this._handlers = {};\n this._proxies = [];\n }", "function proxyMethod(proxyClass, implementationProperty, methodName) {\n proxyClass.prototype[methodName] = function() {\n var implementation = this[implementationProperty];\n implementation[methodName].apply(implementation, arguments);\n };\n}", "register() {\n if (this._registered) {\n return;\n }\n\n this._registered = true;\n this._debug = !! process.env.DEBUG;\n const autoloader = this;\n\n let ManagedProxy = null;\n\n const constructor = function (...$args) {\n if (undefined !== this[Symbol.__jymfony_field_initialization]) {\n this[Symbol.__jymfony_field_initialization]();\n }\n\n const retVal = this.__construct(...$args);\n if (undefined !== global.mixins && undefined !== this[global.mixins.initializerSymbol]) {\n this[global.mixins.initializerSymbol](...$args);\n }\n\n if (undefined !== retVal && this !== retVal) {\n return retVal;\n }\n\n let self = this;\n if (!! autoloader.debug) {\n self = new Proxy(self, {\n get: (target, p) => {\n if (p !== Symbol.toStringTag && ! Reflect.has(target, p)) {\n throw new TypeError('Undefined property ' + p.toString() + ' on instance of ' + ReflectionClass.getClassName(target));\n }\n\n return Reflect.get(target, p);\n },\n });\n }\n\n if (undefined !== this.__invoke) {\n return new ManagedProxy(self.__invoke, proxy => {\n proxy.target = self;\n return null;\n }, {\n get: (target, key) => {\n if ('__self__' === key) {\n return target;\n }\n\n return Reflect.get(target, key);\n },\n apply: (target, ctx, args) => {\n return target.__invoke(...args);\n },\n preventExtensions: (target) => {\n Reflect.preventExtensions(target);\n\n return false;\n },\n getOwnPropertyDescriptor: (target, key) => {\n if ('__self__' === key) {\n return { configurable: true, enumerable: false };\n }\n\n return Reflect.getOwnPropertyDescriptor(target, key);\n },\n });\n }\n\n return this;\n };\n\n /**\n * This is the base class of all the autoloaded classes.\n * It is runtime-injected where needed.\n */\n this._global.__jymfony.JObject = class JObject {\n constructor(...$args) {\n return constructor.bind(this)(...$args);\n }\n\n __construct() { }\n };\n\n this._global.Symbol.reflection = Symbol('reflection');\n this._global.Symbol.docblock = Symbol('docblock');\n this._global.Symbol.__jymfony_field_initialization = Symbol('[FieldInitialization]');\n\n const ClassLoader = require('./ClassLoader');\n this._classLoader = new ClassLoader(this._finder, path, require('vm'));\n\n ManagedProxy = require('./Proxy/ManagedProxy');\n\n const includes = new Set();\n for (const module of this._finder.listModules()) {\n let packageInfo;\n const packageJson = path.join(this._rootDir, 'node_modules', module, 'package.json');\n\n try {\n packageInfo = JSON.parse(fs.readFileSync(packageJson, { encoding: 'utf8' }));\n } catch (e) {\n continue;\n }\n\n const dir = path.join(this._rootDir, 'node_modules', module);\n this._processPackageInfo(packageInfo, dir, includes);\n }\n\n this._processPackageInfo(\n JSON.parse(fs.readFileSync(this._rootDir + '/package.json', { encoding: 'utf8' })),\n this._rootDir,\n includes,\n true\n );\n\n for (const file of includes) {\n this._classLoader.loadFile(file, null);\n }\n }", "construct(target, argArray, newTarget) {\n // Don't proceed if the hook says no\n if (!hook({\n kind: \"__$$_PROXY_CONSTRUCT\" /* CONSTRUCT */,\n policy,\n newTarget,\n argArray,\n target,\n path: stringifyPath(inputPath)\n })) {\n return {};\n }\n return Reflect.construct(target, argArray, newTarget);\n }", "createMocker(baseClass, args = [])\n {\n Tester.valid(baseClass, 'function')\n Tester.valid(args, 'array')\n\n return new Mocker(baseClass, args)\n }", "function promoterenhancer(){\n\n}", "function proxy(obj, methodName) {\n var method = obj[methodName];\n return function () {\n return method.apply(obj, arguments);\n };\n}", "function proxy(obj, methodName) {\n var method = obj[methodName];\n return function () {\n return method.apply(obj, arguments);\n };\n}", "function proxy(obj, methodName) {\n var method = obj[methodName];\n return function () {\n return method.apply(obj, arguments);\n };\n}", "function proxy(obj, methodName) {\n var method = obj[methodName];\n return function () {\n return method.apply(obj, arguments);\n };\n}", "function create(name, members, staticMembers, realClass) {\r\n if (typeof name !== 'string' && typeof name !== 'undefined') {\r\n realClass = staticMembers;\r\n staticMembers = members;\r\n members = name;\r\n name = undefined;\r\n }\r\n if (typeof members === 'function' && typeof staticMembers === 'undefined' && typeof realClass === 'undefined') {\r\n realClass = members;\r\n members = null;\r\n }\r\n if (typeof staticMembers === 'function' && typeof realClass === 'undefined') {\r\n realClass = staticMembers;\r\n staticMembers = null;\r\n }\r\n\r\n var methods = {\r\n first: function() { return this.calls.first().object; },\r\n mostRecent: function () { return this.calls.mostRecent().object; }\r\n };\r\n\r\n var C = jasmine.createSpy(name, methods);\r\n\r\n Object.defineProperty(C, \"instance\", {\r\n get: function () {\r\n var f = function (i) { return this.calls.all()[i].object; }.bind(this);\r\n f.count = function () { return this.calls.count(); }.bind(this);\r\n return f;\r\n }\r\n });\r\n\r\n if (members) {\r\n shallowCopyIfNotExist(C.prototype, members)\r\n }\r\n\r\n if (staticMembers) {\r\n shallowCopyIfNotExist(C, staticMembers);\r\n }\r\n\r\n if (realClass) {\r\n if (realClass.prototype) {\r\n shallowCopyIfNotExist(C.prototype, realClass.prototype, { 'function': noop });\r\n shallowCopyIfNotExist(C, realClass, { 'function': noop });\r\n }\r\n else {\r\n shallowCopyIfNotExist(C.prototype, realClass, { 'function': noop });\r\n }\r\n }\r\n\r\n return C;\r\n}", "function createSafeProxy(subject) {\n\n // copy 'subject' properties\n const proto = Object.getPrototypeOf(subject)\n\n // 'Constructor' that copies 'subject' object\n const Proxy = (subject) => this.subject = subject\n\n // inheritance the prototype\n Proxy.prototype = Object.create(proto)\n\n // proxied method: overload\n Proxy.prototype.hello = () => (this.subject.hello() + ' world')\n\n return new Proxy(subject)\n}", "constructor(rtObject) {\n return new Proxy(rtObject, {\n get : function(rtObject, property, receiver) {\n return (...args) => {\n return rtObject.get(property).then((response) => {\n if(response.type == \"f\".charCodeAt(0)) {\n //TODO :: need to add condition to use sendReturns or send both.\n\t var methodName = property;\n return rtObject.sendReturns(methodName, ...args);\n } \n else {\n return response;\n\t }\n });\n\t };\n },\n set : function(rtObject, property, value) {\n return rtObject.get(property).then((response) => {\n\t var type = response.type;\n \t return rtObject.set(property, RTValueHelper.create(value, type)).then(() => {\n return rtObject.get(property).then((response) => {\n let result = false;\n\t if (type === RTValueType.UINT64 || type === RTValueType.INT64) {\n\t result = value.toString() === response.value.toString();\n\t } else {\n\t result = response.value === value;\n\t }\n\t logger_1.debug(`Set succesfull ? ${result}`);\n\t }).catch((err) => {\n\t logger_1.error(err);\n\t });\n\t })\n })\n }\t\n });\n }", "function Class (Base) {\n let InstanceMap = new Map();\n\n // Strip out `initialize` function and any `_` properties\n // for the shadow API.\n let shadowAPI = Object.keys(Base).reduce((shadow, prop) => {\n if (prop === \"initialize\" || prop[0] === \"_\") {\n return shadow;\n }\n\n let proxy = function () {\n return Base[prop].apply(InstanceMap.get(this), arguments);\n };\n\n shadow[prop] = exportFunction(proxy, unsafeWindow);\n\n return shadow;\n }, createObjectIn(unsafeWindow));\n\n return function () {\n let realInstance = Object.create(Base);\n realInstance.initialize.apply(realInstance, arguments);\n let shadowInstance = cloneInto(shadowAPI, unsafeWindow, { cloneFunctions: true });\n InstanceMap.set(shadowInstance, realInstance);\n\n realInstance.getShadow = () => shadowInstance;\n\n return realInstance;\n };\n}", "static make( obj= {}, opts){\n\t\tvar p= new Prox( obj, opts)\n\t\treturn p.proxied\n\t}", "_createClass (name, superclass, instSlots = {}, classSlots = {}) {\n const metaclass = createClassStub(\n this.loadClass('Metaclass'),\n `${name} class`,\n superclass.class(),\n classSlots\n )\n return createClassStub(metaclass, name, superclass, instSlots)\n }", "function constructorDecorator(...args) {\n const instance = new OriginalClass(...args);\n\n // Decorator for the defaultType property\n Object.defineProperty(instance, 'defaultType', {\n get: () => instance._defaultType,\n set: (type) => {\n if (!['box', 'box_by_4_points', 'points', 'polygon',\n 'polyline', 'auto_segmentation', 'cuboid'].includes(type)) {\n throw Error(`Unknown shape type found ${type}`);\n }\n instance._defaultType = type;\n },\n });\n\n // Decorator for finish method.\n const decoratedFinish = instance.finish;\n instance.finish = (result) => {\n if (instance._defaultType === 'auto_segmentation') {\n try {\n instance._defaultType = 'polygon';\n decoratedFinish.call(instance, result);\n } finally {\n instance._defaultType = 'auto_segmentation';\n }\n } else {\n decoratedFinish.call(instance, result);\n }\n };\n\n return instance;\n }", "function patchClass(className){var OriginalClass=_global[className];if(!OriginalClass)return;// keep original class in global\n_global[zoneSymbol(className)]=OriginalClass;_global[className]=function(){var a=bindArguments(arguments,className);switch(a.length){case 0:this[originalInstanceKey]=new OriginalClass;break;case 1:this[originalInstanceKey]=new OriginalClass(a[0]);break;case 2:this[originalInstanceKey]=new OriginalClass(a[0],a[1]);break;case 3:this[originalInstanceKey]=new OriginalClass(a[0],a[1],a[2]);break;case 4:this[originalInstanceKey]=new OriginalClass(a[0],a[1],a[2],a[3]);break;default:throw new Error(\"Arg list too long.\");}};// attach original delegate to patched function\nattachOriginToPatched(_global[className],OriginalClass);var instance=new OriginalClass(function(){});var prop;for(prop in instance){// https://bugs.webkit.org/show_bug.cgi?id=44721\nif(className===\"XMLHttpRequest\"&&prop===\"responseBlob\")continue;(function(prop){if(typeof instance[prop]===\"function\"){_global[className].prototype[prop]=function(){return this[originalInstanceKey][prop].apply(this[originalInstanceKey],arguments)}}else{ObjectDefineProperty(_global[className].prototype,prop,{set:function set(fn){if(typeof fn===\"function\"){this[originalInstanceKey][prop]=wrapWithCurrentZone(fn,className+\".\"+prop);// keep callback in wrapped function so we can\n// use it in Function.prototype.toString to return\n// the native one.\nattachOriginToPatched(this[originalInstanceKey][prop],fn)}else{this[originalInstanceKey][prop]=fn}},get:function get(){return this[originalInstanceKey][prop]}})}})(prop)}for(prop in OriginalClass){if(prop!==\"prototype\"&&OriginalClass.hasOwnProperty(prop)){_global[className][prop]=OriginalClass[prop]}}}", "function class_1() {\n var _ = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n _[_i] = arguments[_i];\n }\n var _this = \n //Calls constructor of the class passed in so that you know whne the instanmce is created\n _super.call(this) || this;\n console.log(\"Instance Decorator has been created\");\n return _this;\n }" ]
[ "0.7071681", "0.7071681", "0.63713616", "0.63627934", "0.62179136", "0.61736554", "0.61304075", "0.6119467", "0.6095978", "0.6093134", "0.6093134", "0.60640657", "0.60640657", "0.60640657", "0.60633", "0.60633", "0.60593104", "0.60593104", "0.60407186", "0.60090125", "0.59890324", "0.59890324", "0.5957403", "0.5957403", "0.5957403", "0.59437007", "0.59405535", "0.59163123", "0.58972025", "0.58951175", "0.58951175", "0.58951175", "0.58951175", "0.58951175", "0.58951175", "0.58951175", "0.58951175", "0.58936685", "0.5877199", "0.5877199", "0.5877199", "0.5877199", "0.5877199", "0.5869166", "0.5869166", "0.58467513", "0.58467513", "0.58408195", "0.58408195", "0.58408195", "0.58385175", "0.57730323", "0.57657176", "0.576414", "0.5733181", "0.5733181", "0.568372", "0.568372", "0.5649701", "0.56395274", "0.56370175", "0.56370175", "0.56370175", "0.56370175", "0.56370175", "0.56370175", "0.56370175", "0.56284076", "0.56253624", "0.5618587", "0.5599953", "0.5593491", "0.5591991", "0.5589087", "0.556686", "0.556341", "0.5512761", "0.5511001", "0.5499393", "0.5494804", "0.5494804", "0.5487076", "0.5476492", "0.5471282", "0.5461053", "0.5456975", "0.54495925", "0.544425", "0.544425", "0.544425", "0.544425", "0.54393595", "0.5438695", "0.542655", "0.54202914", "0.539814", "0.5367704", "0.53660214", "0.53587484", "0.53556716" ]
0.55544186
76
TODO: Think about sensible links
function getPersonen(req, res) { var person = { vorname: 'Elon', name: 'Musk', geburtsdatum: '1971-06-28', ermaessigung: 'halbtax' }; res.json(person); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get anchor() {}", "link() {\n\t\t// Call super link to link members of Top Level (Identified)\n\t\tsuper.link();\n\t\t\n this._built = this._sbolDocument.lookupURI(this._built);\t\t\n }", "function openlink(upperCase){\n clickAnchor(upperCase,getItem(\"link\"));\n}", "function atLinks() {\n linklist = [\"239MTG\", \"affinityforartifacts\", \"alliesmtg\", \"AllStandards\", \"Alphabetter\", \"Amonkhet\", \"architectMTG\", \"ArclightPhoenixMTG\", \"aristocratsMTG\", \"BadMTGCombos\", \"basementboardgames\", \"BaSE_MtG\", \"BudgetBrews\", \"budgetdecks\", \"BulkMagic\", \"cardsphere\", \"casualmtg\", \"CatsPlayingMTG\", \"CircuitContest\", \"cocomtg\", \"CompetitiveEDH\", \"custommagic\", \"DeckbuildingPrompts\", \"edh\", \"EDHug\", \"EggsMTG\", \"ElvesMTG\", \"enchantress\", \"EsperMagic\", \"findmycard\", \"fishmtg\", \"FlickerMTG\", \"freemagic\", \"goblinsMTG\", \"HamiltonMTG\", \"HardenedScales\", \"humansmtg\", \"infect\", \"johnnys\", \"kikichord\", \"lanternmtg\", \"lavaspike\", \"locketstorm\", \"lrcast\", \"magicarena\", \"Magicdeckbuilding\", \"MagicDuels\", \"magicTCG\", \"magicTCG101\", \"MakingMagic\", \"marchesatheblackrose\", \"marduMTG\", \"MentalMentalMagic\", \"millMTG\", \"ModernLoam\", \"modernmagic\", \"ModernRecMTG\", \"modernspikes\", \"ModernZombies\", \"monobluemagic\", \"mtg\", \"MTGAngels\", \"mtgbattlebox\", \"mtgbracket\", \"mtgbrawl\", \"mtgbudgetmodern\", \"mtgcardfetcher\", \"mtgcube\", \"MTGDredge\", \"mtgfinalfrontier\", \"mtgfinance\", \"mtgfrontier\", \"mtglegacy\", \"MTGManalessDredge\", \"MTGMaverick\", \"mtgmel\", \"mtgrules\", \"mtgspirits\", \"mtgtreefolk\", \"mtgvorthos\", \"neobrand\", \"nicfitmtg\", \"oathbreaker_mtg\", \"oldschoolmtg\", \"pauper\", \"PauperArena\", \"PauperEDH\", \"peasantcube\", \"PennyDreadfulMTG\", \"PioneerMTG\", \"planeshiftmtg\", \"ponzamtg\", \"RatsMTG\", \"RealLifeMTG\", \"RecklessBrewery\", \"rpg_brasil\", \"scapeshift\", \"shittyjudgequestions\", \"sistersmtg\", \"skredred\", \"Sligh\", \"spikes\", \"stoneblade\", \"StrangeBrewEDH\", \"SuperUltraBudgetEDH\", \"therandomclub\", \"Thoptersword\", \"threecardblind\", \"TinyLeaders\", \"TronMTG\", \"UBFaeries\", \"uwcontrol\", \"xmage\", \"reddit.com/message\", \"reddit.com/user/MTGCardFetcher\"]\n\n for (j = 0; j < linklist.length; j++) {\n if (location.href.toLowerCase().includes(linklist[j].toLowerCase()))\n return true;\n }\n return false;\n}", "get href(){return $href;}", "get href(){return $href;}", "function bp_ont_link(ont_acronym){\n return \"/ontologies/\" + ont_acronym;\n}", "startLinkRouting() {}", "function getCustomLink(links, cat) {\r\n\t// Url to add ed2k links to custom application\r\n\r\n\treturn 'http://192.168.0.43/ed2k.php?cat=' + cat + '&post=' + encodeURIComponent(window.location) + '&ed2k=' + links;\r\n\t//return emuleUrl +'ed2k.php?cat=' + cat + '&post=' + encodeURIComponent(window.location) + '&ed2k=' + links;\r\n}", "get conceptIndexLink(): LinkModel {\n return this.links.getLinkByKey(\"concepts\");\n }", "function eLink(db,nm) {\n\tdbs = new Array(\"http://us.battle.net/wow/en/search?f=wowitem&q=\",\"http://www.wowhead.com/?search=\");\n\tdbTs = new Array(\"Armory\",\"Wowhead\");\n\tdbHs = new Array(\"&real; \",\"&omega; \");\n\tel = '<a href=\"'+ dbs[db]+nm + '\" target=\"_blank\" title=\"'+ dbTs[db] +'\">'+ dbHs[db] + '</a>';\n\treturn el;\n}", "function makeOrChangeLink()\n{\n var dom = dw.getDocumentDOM(); \n\n if (typeof dom[\"setLinkHref\"] != 'undefined') //CONTRIBUTE ALERT\n dom.setLinkHref();\n}", "function ShowLinks(linkId) { console.log(\"sellwood_px: ShowLinks called; this function is not defined in px.\"); }", "function exLinks()\n{\n\tif (document.getElementById)\n\t{\n \tvar aObject = document.getElementsByTagName(\"a\");\n \tfor (var x=0; x<aObject.length; x++)\n \t{\t\t\t\t\n \t\tif (aObject[x].className == \"exwin\")\n \t\t{\n \t\t\taObject[x].onclick = function()\n \t\t\t{\n \t\t\t\t\n \t\t\t\t//if we direct through \"jabout\" the page will get templated, we dont want that so we're gonna use \"hompages\"\n \t\t\t\tthis.href = String(this.href).toLowerCase().replace(\"cgi-bin/jabout\", \"homepages\");\n \t\t\t\twindow.open(this.href, \"Figures\", \"dependent=0,toolbar=1,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=400\");\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t}\n\t}\n}", "render() {\n const path = this.props.linkData.path;\n const title = this.props.linkData.title\n return (\n <li><Link to={path}>{title}</Link></li>\n );\n }", "function oldGLnk(target, description, linkData)\n{\n}", "function ablinks() {\n // Auto Build links list items from bare a-tag source code 20171128\n var k = 0;\n var libs = document.getElementsByClassName('linkpool');\n for (var i = 0; i < libs.length; i++) {\n var lib = libs[i];\n var links = lib.childNodes;\n for (var j = 0; j < links.length; j++) {\n var a = links[j];\n if (a.innerHTML === '') {\n if (a.className !== '') {\n a.className = a.className + ' ali';\n } else {\n a.className = 'ali';\n }\n if (a.title !== '') {\n a.innerHTML = '&bull;&nbsp;' + a.title;\n } else {\n a.innerHTML = a.href;\n }\n a.target = '_blank';\n k = k + 1;\n }\n }\n }\n return k;\n}", "get contentIndexLink(): LinkModel {\n return this.links.getLinkByKey(\"content\");\n }", "function getAmuleLink(links, cat) {\r\n\r\n\tif(cat == \"0\") {\r\n\t\tcat = \"all\";\r\n\t}\r\n\t\r\n\t// Url to add ed2k links to amule\r\n\treturn emuleUrl + \"footer.php?selectcat=\" + cat + \"&Submit=Download+link&ed2klink=\" + links;\r\n}", "function fnVoltarLink() {\r\n\tvar oLink = document.links[0];\r\n\toLink.innerHTML = \"Pegar Feeds\";\r\n\toLink.className = \"\";\r\n\toLink.onclick = fnGo;\r\n}", "function g_link(template, item) {\r\n return \"/\" + template.id + \"/\" + item.id;\r\n}", "getHref() {\n switch (this.type) {\n case \"room\":\n return \"room.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n case \"device\":\n return \"device.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n default:\n return \"home.html\";\n }\n }", "link() {\n\t\t// Call super link to link members of Top Level (Identified)\n\t\tsuper.link();\n\n this._modules = this._sbolDocument.lookupURIs(this._modules);\n this._functionalComponents = this._sbolDocument.lookupURIs(this._functionalComponents);\n this._interactions = this._sbolDocument.lookupURIs(this._interactions);\n this._models = this._sbolDocument.lookupURIs(this._models);\n }", "getUrlFromOP(ref) {\n const as = this.$('a');\n const links = as.map((i, el) => this.$(el)).get();\n for (const link of links) {\n const text = link.text();\n if (text === ref) {\n const href = link.attr('href');\n if (href) return href;\n }\n }\n }", "function snd_index(link){\n\tswitch(link){\n\t\tcase \"events\" : location.href=\"events.html\";\n\t\t\t\tbreak;\n \t\tcase \"aidmap\" :\tlocation.href=\"sub/map.html\";\n\t\t\t\tbreak;\n\t\tcase \"advice\" :\n\t}\n}", "function directLink(link) {\r\n\tlink.href = link.href.replace(/\\/gp/, \"\");\r\n}", "function startLinkStatus(){\n var a = document.createElement('a'); // Hack to extract absolute url\n $jQ('a[href]').each(function() {\n if ($jQ(this).attr('href').length > 0 &&\n $jQ(this).attr('href').search('javascript:')==-1 &&\n $jQ(this).attr('href').search('mailto:')==-1 &&\n $jQ(this).attr('href').search('#')!=0) {\n a.href = $jQ(this).attr('href');\n setLink($jQ(this),'href', a.href);\n }\n });\n}", "function setupLinks() {\n\tfor(let i = 0; i < 11; i++) {\n\t\tif(i == 10) { \n\t\t\tlinks[i] = createA('/resilience-repository/about.html', proj_names[i]);\n\t\t}\n\t\telse {\n\t\t\tlinks[i] = createA('/resilience-repository/projects/proj'+i+'.html', proj_names[i]);\n\t\t}\n\t}\n}", "function _(e){var t=document.createElement(\"a\");return t.href=e,t}", "get url() { return this.link.url; }", "generateLink() {\n return `\n <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'>\n ${this.options[0]}\n </a>&nbsp;\n `;\n }", "function makeLink() {\n // var a=\"http://www.geocodezip.com/v3_MW_example_linktothis.html\"\n var url = window.location.pathname;\n var a = url.substring(url.lastIndexOf(\n '/') + 1) + \"?lat=\" +\n map.getCenter()\n .lat()\n .toFixed(6) + \"&lng=\" +\n map.getCenter()\n .lng()\n .toFixed(6) +\n \"&zoom=\" + map.getZoom() +\n \"&type=\" +\n MapTypeId2UrlValue(map.getMapTypeId());\n if (filename !=\n \"TrashDays40.xml\") a +=\n \"&filename=\" + filename;\n document.getElementById(\n \"link\")\n .innerHTML =\n '<a href=\"' + a +\n '\">Link to this page<\\/a>';\n }", "function ini_breadcrumb_genLink(root, name2href, name2title,\r\n\t\t\t\t\t\t\t\tind, ub, name) {\r\n\tvar typ = (ind == ub) ? \"tail\" : \"mid\";\r\n\treturn ini_breadcrumb_getLink(root, name2href[name], name2title[name], typ);\r\n}", "function action() {\n var $ = cheerio.load(item.techops.getHTML(item));\n var links = $('a');\n var foundERR;\n if (links != undefined) {\n links = links.filter((i, link) => {\n if ($(link).attr('href') !== undefined) {\n return !$(link).attr('href').includes('https://byui.instructure.com');\n } else {\n course.message('Link without href attribute found');\n return false;\n }\n });\n links.each(function (i, link) {\n link = $(link).attr('href').toLowerCase();\n foundERR = externalResources.find(externalResource => externalResource.test(link));\n if (foundERR != undefined) {\n course.log('ERR Identified', {\n 'name': foundERR.toString().replace(/\\//g, ''),\n 'url': link,\n 'item': item.techops.getTitle(item),\n 'type': item.techops.type\n });\n }\n });\n }\n callback(null, course, item);\n }", "function processLinks() {\n $(document).find('*').each(function () {\n var localName = $(this)[0].localName;\n if (localName.startsWith(\"link-\")) {\n\n var parts = localName.split(\"-\");\n var txt = $(this).text() || parts[1];\n\n $(this).empty();\n $(this).append('<a href=\"#\" onclick=\"$(\\'#list-' + parts[1] + '-list\\').click()\">' + txt + '</a>');\n }\n })\n}", "link () {\n\t this._attachments = this._sbolDocument.lookupURIs(this._attachments);\n\t this._wasGeneratedBys = this._sbolDocument.lookupURIs(this._wasGeneratedBys);\n\t}", "link() {\n this._locations = this._sbolDocument.lookupURIs(this._locations);\n this._component = this._sbolDocument.lookupURI(this._component);\n }", "getUrl(name) { return \"\"; }", "link() {\n\t\t// Call super link to link members of Top Level (Identified)\n\t\tsuper.link();\n\t\t\n this._members = this._sbolDocument.lookupURIs(this._members);\n }", "navigateHyperlink() {\n let fieldBegin = this.getHyperlinkField();\n if (fieldBegin) {\n this.fireRequestNavigate(fieldBegin);\n }\n }", "link() {\n this._subject = this._sbolDocument.lookupURI(this._subject);\n this._object = this._sbolDocument.lookupURI(this._object);\n }", "function link() {\n var LINKY_URL_REGEXP =\n /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"”’]$/;\n var sub = selection.anchorNode.data.substring(0, selection.anchorOffset - 1);\n if (LINKY_URL_REGEXP.test(sub)) {\n var matchs = sub.match(LINKY_URL_REGEXP);\n if (matchs && matchs.length) {\n var st = selection.anchorOffset - matchs[0].length - 1;\n range.setStart(selection.anchorNode, st);\n scope.doCommand(null, {\n name: 'createLink',\n param: matchs[0]\n });\n }\n }\n }", "get link() {\n return this.getText('link');\n }", "function g_link(template, id) {\r\n return \"/\" + template.id + \"/\" + id;\r\n}", "function linkHeadings() {\n \n var headings = getHeadings();\n \n headings.forEach(function (heading) {\n heading.element.innerHTML = '<a href=\"#' + heading.id + '\">' +\n heading.element.innerHTML + \"</a>\";\n });\n }", "function do_links( link_snap, get_char, header ) {\r\n var link_letter_order = []\r\n\r\n\r\n for( var i = 0; i< link_snap.snapshotLength; i++ ) {\r\n var link = link_snap.snapshotItem(i)\r\n\r\n var char = get_char(link)\r\n\r\n if( ! char ) continue\r\n\r\n // if the char is different from the last char...\r\n if( link_letter_order.length == 0 || char != link_letter_order[link_letter_order.length-1] ) {\r\n link_letter_order.push( char )\r\n\r\n var s = $e('div')\r\n s.style.background = '#aaa'\r\n s.style.borderTop = 'solid #777 1px'\r\n\r\n s.style.padding = '3px'\r\n s.style.marginTop = '20px'\r\n s.style.marginBottom = '-7px'\r\n\r\n s.innerHTML = \" &middot; \"\r\n\r\n var a = mk_link(char)\r\n a.name = char\r\n\r\n var top = mk_link('^top')\r\n top.target = '_self'\r\n\r\n\r\n s.appendChild( a )\r\n s.appendChild( $t(' ') )\r\n s.appendChild( top )\r\n\r\n var br = $e('br')\r\n\r\n link.parentNode.insertBefore(br,link)\r\n link.parentNode.insertBefore(s,br)\r\n \r\n /* link.parentNode.insertBefore($e('hr'),s) */\r\n }\r\n }\r\n\r\n for( var j=0; j<link_letter_order.length; j++ ) {\r\n var char = link_letter_order[j]\r\n header.innerHTML += \" <a href='#\" + char + \"' target='_self' style='color:#999'>\" + char + \"</a>\"\r\n }\r\n}", "function setUrlAdr(link) {\n //url_adr = link.onclick;\n if (link.onclick !== null) { url_adr = link.onclick.toString().split(\"'\")[1]; }\n else {url_adr = link.href.toString().split(\"#\")[1];}\n}", "toLinkUrl() {\r\n return this.urlPath + this._stringifyAux() +\r\n (isPresent(this.child) ? this.child._toLinkUrl() : '');\r\n }", "function loadLikeABoss(link) {\n\treturn;\n}", "createShortenedListURL(params) {\n return ApiService.post('/link', { url: params.url });\n }", "function AnonIP() {\n\tvar list = document.getElementsByTagName('a');\n\tfor(var i in list) {\n\t\tif(list[i].href && list[i].href.indexOf('Special:Contributions/') && list[i].innerHTML == 'A Wikia contributor') {\n\t\t\tlist[i].innerHTML = list[i].href.substring(list[i].href.lastIndexOf('/') + 1, list[i].href.length);\n\t\t}\n\t}\n}", "function onClick(link){\n \n}", "link() {\n this._definition = this._sbolDocument.lookupURI(this._definition);\n this._mappings = this._sbolDocument.lookupURIs(this._mappings);\n }", "link() {\n this._definition = this._sbolDocument.lookupURI(this._definition);\n this._mappings = this._sbolDocument.lookupURIs(this._mappings);\n }", "link() {\n this._definition = this._sbolDocument.lookupURI(this._definition);\n this._mappings = this._sbolDocument.lookupURIs(this._mappings);\n }", "function change_links(a){\r\n\tx = a.href.indexOf('gid=');\r\n\ta.innerHTML = eval('gid'+a.href.substr(a.href.indexOf('gid=')+4));\r\n}", "function changeLinkToHtml() {\n var allLinks = document.querySelectorAll('#'+parameters.cdmContainer+' a');\n allLinks.forEach(function (item) {\n item.setAttribute(\"href\", (item.getAttribute(\"href\"))+\".html\");\n });\n\n }", "function eLink(db,nm) {\nel = document.createElement(\"a\");\nel.setAttribute(\"target\",\"_blank\");\ndbs = new Array(\"http://www.wowarmory.com/search.xml?searchType=items&searchQuery=\",\"http://www.wowhead.com/?search=\",\"http://www.thottbot.com/?s=\",\"http://wow.allakhazam.com/search.html?q=\");\ndbTs = new Array(\"Armory\",\"Wowhead\",\"Thottbot\",\"Allakhazam\");\ndbHs = new Array(\"&real; \",\"&omega; \",\"&tau; \",\"&alpha;\");\nel.href = dbs[db]+nm;\nel.setAttribute(\"title\",dbTs[db]);\nel.innerHTML = dbHs[db];\nreturn el;\n}", "function insertLinks () {\n var pages = {\n RecentChanges: {\n title: i18n('recent_changes').escape(),\n links: ['WikiActivity', 'DiscussionsActivity']\n },\n WikiActivity: {\n title: i18n('wiki_activity').escape(),\n links: ['WikiActivity/watchlist', 'RecentChanges', 'DiscussionsActivity']\n },\n DiscussionsActivity: {\n title: i18n('discussions_activity').escape(),\n links: ['RecentChanges', 'WikiActivity']\n },\n 'WikiActivity/watchlist': {\n title: i18n('watchlist').escape(),\n links: ['RecentChanges', 'WikiActivity', 'DiscussionsActivity']\n }\n };\n // Terminates the function if the current page is not in the list\n if (Object.keys(pages).every(function (p) { return 'Special:' + p !== config.wgCanonicalNamespace + ':' + config.wgTitle; })) {\n return;\n }\n var headerSubtitle = document.getElementsByClassName('page-header__page-subtitle')[0];\n var pagesLinked = pages[config.wgTitle].links;\n var links = [];\n\n pagesLinked.forEach(function (page) {\n links.push('<a href=\"/wiki/Special:' + page + '\" title=\"Special:' + page + '\">' + pages[page].title + ' ></a>');\n });\n // Doesn't include link to followed pages if it's an anonymous user\n links = (config.wgTitle === 'WikiActivity' && !config.wgUserName ? links.slice(1) : links);\n // Inserts links\n headerSubtitle.innerHTML = links.join(' | ');\n }", "function createOrderedList(link)\n{\n return link.index+'. '+link.url\n}", "function getmatche(link){\n request(link, cb);\n }", "link() {\n\t\t// Call super link to link members of Top Level (Identified)\n\t\tsuper.link();\n\n this._components = this._sbolDocument.lookupURIs(this._components);\n\n this._sequenceAnnotations = this._sbolDocument.lookupURIs(this._sequenceAnnotations).sort(function(a, b) {\n\n if(a instanceof URI || b instanceof URI)\n return 0;\n\n if(a.ranges.length === 0 || b.ranges.length === 0)\n return 0;\n\n return a.ranges[0].start - b.ranges[0].start;\n });\n\n this._sequenceConstraints = this._sbolDocument.lookupURIs(this._sequenceConstraints);\n this._sequences = this._sbolDocument.lookupURIs(this._sequences);\n }", "function setFlink(t, a) {\n\tif (t) document.title = dt+\" : \"+t;\n\tif (a) document.location.href = dl+\"#\"+a;\n}", "function SocialAccountLinkModule(){}", "function getEmuleLink(links, cat) {\r\n\t\t\r\n\t// Url to add ed2k links to emule\r\n\treturn emuleUrl + \"?w=password&p=\" + emulePwd + \"&cat=\" + cat + \"&c=\" + links;\r\n}", "function linkTo (classname, doclet, kind) {\n\tif (doclet) {\n\t\tconst memberType = doclet.kind || kind;\n\t\tif (memberType) {\n\t\t\treturn `https://abal.moe/Eris/docs/${classname}#${memberType}-${doclet.name}`;\n\t\t}\n\t}\n\treturn `https://abal.moe/Eris/docs/${classname}`;\n}", "function linkAdminCompose(fWhere) {\r\n setUpLinkBackJSON(fWhere);;\r\n window.location.href = \"adminCompose.html\";\r\n}", "_link() {\r\n if(this.store.activeTab === \"n0\") {\r\n this.push(\"/\")\r\n }\r\n else {\r\n this.push(`/console/${this.connections[this.store.activeTab]}`)\r\n }\r\n }", "function printlink() {\n\t\t\t\tvar linkElem = $('#inspo');\n\t\t\t\tlinkElem.html(links[randomlink].text);\n\t\t\t}", "function eLink(db,nm) {\ndbs = new Array(\"http://us.battle.net/wow/en/search?q=\",\"http://www.wowhead.com/?search=\",\"http://db.mmo-champion.com/search/all/\",\"http://www.wowdb.com/search?search=\");\ndbTs = new Array(\"Armory\",\"Wowhead\",\"DB MMO-Champion\",\"WoWDB\");\ndbHs = new Array(\"&real; \",\"&omega; \",\"&delta; \",\"&piv; \");\nel = '<a href=\"'+ dbs[db]+nm + '\" target=\"_blank\" title=\"'+ dbTs[db] +'\">'+ dbHs[db] + '</a>';\nreturn el;\n}", "linkAccount() {}", "function main() {\n\tif (isSearchPage()) {\n\t\tsaveLinks();\n\t} else {\n\t\taddNextItemLink();\n\t}\n}", "function makeLinks(site, node) {\r\n\tvar container = $(\"<span class='torrentLinkSpan'></span>\");\r\n\tvar artistName = getText(site.artistPath ? $(site.artistPath, node) : $(node));\r\n\tvar albumName = site.albumPath ? getText($(site.albumPath, node)) : \"\";\r\n\tif(albumName && site.albumFunction) albumName = site.albumFunction(albumName).replace(/^\\s+/,\"\");\r\n\tfor(j = 0;search=searches[j];j++)\r\n\t\tif(search != site.search) addLink(container, search, {artist:artistName, album:albumName});\r\n\tif (site.beforePath) $(site.beforePath, node).before(container);\r\n\telse (site.placePath ? $(site.placePath, node) : $(node)).append(container);\t\t\r\n}", "function setup_queue_link(element)\n{\n element.addEvent(\"click\", function(event) {\n var id = event.target.get('id');\n var name = id.substr(6);\n\n location.href = mlisturl + \"/\" + name;\n });\n}", "function icm_link (src) {\r\n var a = $x(\"id('content')//ul//a\", src);\r\n if(a.length == 1 && a[0].href.indexOf(\"http://www.imdb.com\") == -1)\r\n return 'http://icheckmovies.com'+a[0].href;\r\n}", "linkName(link){\n\t\tlet linkSplit = link.split(\"/\");\n\t\treturn linkSplit[2];\n\t}", "get link() {\n\t\treturn this.__link;\n\t}", "function genLinks(key, mvName) {\n var links = '';\n links += '<a href=\"javascript:edit(\\'' + key + '\\',\\'' + mvName + '\\')\"> Edit</a> | ';\n links += '<a href=\"javascript:del(\\'' + key + '\\',\\'' + mvName + '\\')\"> X </a>';\n return links;\n}", "function AttachLinkEvents() {\n var aElements = document.getElementsByTagName(\"a\");\n for (i = 0; i < aElements.length; i++) {\n if (aElements[i].rel == \"contents\") {\n aElements[i].onclick = function() {\n var todomain = getDomain(this.href);\n var thisdomain = getDomain(window.location);\n if(todomain == thisdomain) {\n ShowPage(this);\n return false;\n } else {\n window.open(this.href); return false;\n }\n }\n }\n } \n}", "handleFactDeepLink() {\n if (location.hash.startsWith(\"#f-\")) {\n this.selectItem(location.hash.slice(3));\n }\n }", "function handleLinkClick(event) {\n\t\tvar linkLabel = event.currentTarget.id;\n\t\tvar url;\n\t\tswitch(linkLabel) {\n\t\t\tcase 'pivotal' :\n\t\t\t\turl = \"http://www.gopivotal.com/\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'support' :\n\t\t\t\turl = \"https://support.gopivotal.com/hc/en-us\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'feedback' :\n\t\t\t\turl = \"http://www.gopivotal.com/contact\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'help' :\n\t\t\t\turl = \"../../static/docs/gpdb_only/index.html\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'logout' :\n\t\t\t\tlogoutClick();\n\t\t\t\tbreak;\n\t\t}\n\t}", "trackLinkBy(index, link) {\n return link.id;\n }", "function CreateEraLink(current_window, current_document)\r\n\t{\r\n\t\tvar eraLink= GetEraDomain(current_window) + \"?\";\r\n\t\tif (current_window.era_rc != null && current_window.era_rc[\"ContentId\"]) \r\n\t\t{\r\n\t\t\teraLink += (\"ContentId=\" + current_window.era_rc[\"ContentId\"]);\r\n\t\t} else {\r\n\t\t\teraLink += (\"ContentId=\" + GetTelephonyContentId(current_window));\r\n\t\t}\r\n\t\teraLink += (\"&\");\r\n\t\teraLink += (\"numrequests=1\");\r\n\t\teraLink += (\"&\");\r\n\t\teraLink += (\"req1=\" + GetContentType(current_window) + \"||\");\r\n\t\teraLink += (GetEraMaxItems(current_window)+ \"|\");\r\n\t\teraLink += (\"SortBy:\" + GetEraSortType(current_window));\r\n\t\teraLink += (\"&\");\r\n\t\teraLink += (\"OutputType=html\");\r\n\t\t\t\r\n\t\tDisplayEraFrame(eraLink, current_document, current_window);\r\n\t\tcurrent_window.era_rc = null;\r\n\t}", "function getLink(url, term, label) {\n formattedTerm = term.split(' ').join('+');\n return \"<a target=\\\"_blank\\\" href=\\\"\" + url + formattedTerm + \"\\\" title=\\\"View results on \" + label + \"\\\"\\\">\" + term + \"</a>\";\n}", "function newUrl() {\n\trecordUrl();\n\n\tconstructUrlMarkup(2);\n}", "function generateLink(queryStrings){\n\tgame_id = queryStrings['gid']\n\tvar link = $('<a></a>')\n\t\t.attr(\"href\",\"index.html\")\n\t\t.append(\"<span class='backLink'>< Back to Scoreboard</span>\")\n\t$('#link').html(link)\n}", "function reLink() {\r\n const linkList = document.querySelectorAll('a');\r\n\r\n linkList.forEach((link) => {\r\n const linkAttribute = link.getAttribute('href');\r\n\r\n if (linkAttribute.startsWith('/p/')) {\r\n const linkFormatted = 'https://instagram.com' + linkAttribute + 'media/?size=l'\r\n\r\n link.setAttribute('href', linkFormatted);\r\n\r\n // Log to the console the thumbnail and respective link for hover/click.\r\n\t\t\tconsole.log('-=-=-=-=-=-=-');\r\n \tconsole.log('Image: ', link.firstElementChild);\r\n \tconsole.log('Direct Link: ', linkFormatted);\r\n };\r\n });\r\n}", "function CommonLink(props){\r\n return(\r\n <div>\r\n <strong><Link to = {props.to} className={props.class}>{props.title}</Link></strong>\r\n </div>\r\n )\r\n \r\n}", "function getLink(action) {\n\tvar links = user.link;\n\tfor(let link of links) if(link.action == action) return link.url;\n}", "function new_check_link (e, url) {\r\n var a = document.createElement('a');\r\n a.title = url || e.href;\r\n a.href= 'javascript:;';\r\n a.style.fontWeight = \"bold\";\r\n a.style.fontSize = \"small\";\r\n a.style.textDecoration = \"none\";\r\n a.appendChild(document.createTextNode('[C]'));\r\n a.addEventListener(\"click\", click, true);\r\n e.parentNode.insertBefore(a, e.nextSibling);\r\n}", "function linkAttach(links, directory){\n\tvar linkList = links.split(\"]\");\n\tlinkList.forEach(function(link, index){\n\t\t\t this[index] = link.substring(1).split(\"#\")}, linkList);\n\tvar full = \"\";\n\tvar linklen = 0;\n\tlinkList.forEach(function(link){\n\t\t\t if(link.length == 3){\n\t\t\t\tfull += \"<p>\"+link[1]+\"</p> -<a href=data/\"+directory+'/'+link[0]+\" download>Download</a> -<a href=data/\"+directory+'/'+link[2]+\" target='_blank'>View</a><br>$ \";\n\t\t\t\tlinklen+=1;\n\t\t\t }\n\t\t\t if(link.length == 2){\n\t\t\t\tfull += \"<p>\"+link[1]+\"</p> -<a href=data/\"+directory+'/'+link[0]+\" download>Download</a><br>$ \";\n\t\t\t\tlinklen+=1;\n\t\t\t }\n\t\t\t});\n\tif (full.length == 0) return \"No relevant examples.\"\n\telse if (linklen == 1) return \"Example:\"+ toolList(full, \"$ \");\n\treturn \"Examples:\"+ toolList(full, \"$ \");\n}", "function setup_metacpan_links() {\n $('a[href^=\"/dist/overview/\"]').each(\n function() {\n var module = this.href.match('/dist/overview/(.*)$')[1].replace('-', '::', 'g');\n console.log(\"module = \" + module);\n $(this).after('&nbsp;' + '<a href=\"http://metacpan.org/module/' + module + '\">' + metacpan_img + '</a>');\n });\n}", "function _getLink(text, enabled, urlFormat, index) {\n if (enabled == false)\n return J.FormatString(' <a class=\"button-white\" style=\"filter:Alpha(Opacity=60);opacity:0.6;\" href=\"javascript:void(0);\"><span>{0}</span></a>',\n text);\n else\n return J.FormatString(' <a class=\"button-white\" href=\"javascript:window.location.href=\\'' + urlFormat + '\\';\"><span>{1}</span></a>', index, text);\n }", "link() {\n this._remote = this._sbolDocument.lookupURI(this._remote);\n this._local = this._sbolDocument.lookupURI(this._local);\n }", "function isLink() {\n return (window.location.href.indexOf('/lnk') > -1) || (window.location.href.indexOf('/s') > -1);\n}", "function manuallinkClickIO(href,linkname,modal){\n\tif(modal){\n\t\tcmCreateManualLinkClickTag(href,linkname,modal_variables.CurrentURL);\n\t}else{\n\t\tcmCreateManualLinkClickTag(href,linkname,page_variables.CurrentURL);\n\t}\n}", "static createLink(name, link) {\n return Helper_1.createEntry(name, true, `Object.assign(exports, require('${link}'));`);\n }", "function findlink(db,name){\n\tif ((db=='pfam')||(db=='Pfam27.0'))\n\t\t{\n\t\tthelink='http://pfam.sanger.ac.uk/family/'+name;\n\t\t}\n\telse if (db=='cdd')\n\t\t{\n\t\tthelink='http://www.ncbi.nlm.nih.gov/Structure/cdd/cddsrv.cgi?uid='+name;\n\t\t}\n\telse if (db=='pdb')\n\t\t{\n\t\tthelink='http://www.rcsb.org/pdb/explore.do?structureId='+name.substring(0, name.length - 2);\n\t\t}\n\telse if (db=='cog')\n\t\t{\n\t\tthelink='http://www.ncbi.nlm.nih.gov/cdd/?term='+name;\n\t\t}\n\telse if (db=='smart')\n\t\t{\n\t\tthelink='http://www.ncbi.nlm.nih.gov/Structure/cdd/cddsrv.cgi?uid='+name;\n\t\t}\n\telse if (db=='tigr')\n\t\t{\n\t\tthelink='http://www.jcvi.org/cgi-bin/tigrfams/HmmReportPage.cgi?acc='+name;\n\t\t}\n\telse if (db=='pirsf')\n\t\t{\n\t\tthelink='http://pir.georgetown.edu/cgi-bin/ipcSF?id='+name;\n\t\t}\n\telse\n\t\t{\n\t\tthelink='https://www.google.com/#q='+name;\n\t\t}\n\t\t\n\t\t\n\t\t\n\treturn thelink;\n\t}", "function _getlinks ()\n\t{\n\t\treturn links;\n\t}", "function CreateRealLinks(input) {\n var inputAsDom = $('<div>' + input + '</div>');\n inputAsDom.find('a').each(function() {\n if ($(this).attr('data-vtz-browse')) {\n $(this).attr('href', $(this).attr('data-vtz-browse'));\n }\n });\n return inputAsDom.html();\n }", "function displayLinks() {\n $('[data-type=gallery] .image').each(function(index, item) {\n const link = $('a', item.parentNode);\n if (!link.get(0)) return;\n\n item = $(item);\n item.addClass('clickable');\n item.data('href', link.attr('href'));\n item.on('click', goto_article);\n });\n\n function goto_article(event) {\n let el = event.currentTarget;\n window.location = $(el).data('href');\n }\n}" ]
[ "0.6098567", "0.60367835", "0.59262234", "0.59258676", "0.5920313", "0.5920313", "0.5904969", "0.57829535", "0.5705335", "0.5705112", "0.56949604", "0.56861275", "0.56860304", "0.5681934", "0.56725335", "0.5669609", "0.56680095", "0.5665643", "0.5645112", "0.5643068", "0.5637304", "0.56309974", "0.5622687", "0.56038684", "0.55985534", "0.5592556", "0.55848396", "0.55791074", "0.55785406", "0.55711514", "0.5568659", "0.5568425", "0.55496824", "0.55476075", "0.55464435", "0.5541401", "0.55332315", "0.5525103", "0.5523536", "0.55231416", "0.5502095", "0.55017847", "0.55002874", "0.5493419", "0.54921305", "0.54766864", "0.54732805", "0.5466726", "0.5457647", "0.54530644", "0.5449011", "0.5446157", "0.54426694", "0.54426694", "0.54426694", "0.54396516", "0.54383594", "0.54382247", "0.54312235", "0.5428423", "0.5420088", "0.54186535", "0.54174876", "0.54131705", "0.5406099", "0.53923", "0.5387715", "0.5386767", "0.53812146", "0.5379655", "0.537731", "0.5376805", "0.5376355", "0.53752714", "0.5370923", "0.5368846", "0.5365305", "0.5363826", "0.5361927", "0.5360499", "0.5359933", "0.5359113", "0.5357551", "0.5354119", "0.5352227", "0.5349783", "0.53496754", "0.53494805", "0.5348753", "0.5348053", "0.5342831", "0.5339242", "0.5334943", "0.53326434", "0.53296703", "0.53283864", "0.53271574", "0.5321942", "0.5320446", "0.5306707", "0.5306687" ]
0.0
-1
Current blob size limit is around 500MB for browsers
function downloadResource(url, filename) { if (!filename) filename = url.split("\\").pop().split("/").pop(); fetch(url, { headers: new Headers({ Origin: location.origin, }), mode: "cors", }) .then((response) => response.blob()) .then((blob) => { let blobUrl = window.URL.createObjectURL(blob); forceDownload(blobUrl, filename); }) .catch((e) => console.error(e)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMaxMessageSize() {\r\n\treturn 700;\r\n}", "function getUploadChunkSize() {\n return 8 * 1024 * 1024; // 8 MB Chunks\n}", "function getUploadChunkSize() {\n return 8 * 1024 * 1024; // 8 MB Chunks\n}", "function gh_file_size(bytes) {\r\n if (bytes >= (1 << 20)) {\r\n var f = (bytes / (1 << 20)).toFixed(2);\r\n return f + \" M\"; ß\r\n }\r\n if (bytes >= (1 << 10)) {\r\n var f = (bytes / (1 << 10)).toFixed(2);\r\n return f + \" K\";\r\n }\r\n return bytes + \" B\";\r\n}", "function cacheNextBlob() {\n blobs.index++;\n xhr = new XMLHttpRequest();\n xhr.open('GET', blobs[blobs.index].url, true);\n xhr.responseType = 'blob';\n // xhr.setRequestHeader(\"Cache-Control\", \"max-age=100000\");// 100000 is too much and would not be good as it would fill up the HDD of the IOT node\n // xhr.timeout = 40000; // Set timeout to 4 seconds (4000 milliseconds)\n xhr.setRequestHeader('subscription-key', $('#SubscriptionKey').val()),\n xhr.ontimeout = function () { alert(\"Timed out!!!\"); }\n xhr.onload = blobCached;\n xhr.onprogress = updateProgress;\n xhr.send();\n xhr.onerror = XMLHttpRequestError;\n //AA $('#progressbar').progressbar();\n //AA xhr.abort if the prosess took so long! ..................................<<<<<<<<<<<<<<<<-----\n\n}", "getDefaultChunkSize(contentLength) {\n const STEP = [\n 1,\n 2,\n 4,\n 8,\n 16,\n 32,\n 64,\n 128,\n 256,\n 512,\n 1024,\n 2048,\n 4096,\n 5120,\n ];\n let available = 1024 * 1024;\n for (let i = 0; i < STEP.length; i++) {\n available = STEP[i] * 1024 * 1024;\n if (contentLength / available <= 10000) break;\n }\n return Math.max(available, 1024 * 1024);\n }", "function processBlobs(recordedBlobs){\n // Add the recorded video to a hidden file input field\n if(recordedBlobs[0].size<5242880){ // Hardcoded: better take settings.FILE_UPLOAD_MAX_MEMORY_SIZE value\n console.log(\"Blobs: \", recordedBlobs)\n const blob = new Blob(recordedBlobs)\n var file = new File([blob], \"temp.webm\",{type:\"video/webm, lastModified:new Date().getTime()\"})\n console.log(file)\n let container = new DataTransfer();\n container.items.add(file)\n document.getElementById('videofile').files = container.files;\n }\n else{ // size is too big to upload\n errorMsgElement.innerHTML = \"<p style='color:#FF0000';>Recorded file is too big. Make a shorter video or try another camera. .</p>\"\n recordedBlobs = []\n document.getElementById('videofile').value = null\n uploadInput.disabled = true;\n }\n}", "getSize() {\n return this.ready.then(db => {\n const transaction = db.transaction([STORE_NAME], 'readonly');\n const store = transaction.objectStore(STORE_NAME);\n const request = store.index('store').openCursor(IDBKeyRange.only(this.name));\n return new Promise((resolve, reject) => {\n let size = 0;\n\n request.onsuccess = event => {\n const cursor = event.target.result;\n\n if (cursor) {\n size += cursor.value.data.size;\n cursor.continue();\n } else {\n resolve(size);\n }\n };\n\n request.onerror = () => {\n reject(new Error('Could not retrieve stored blobs size'));\n };\n });\n });\n }", "hasBlob(store) {\n const blobColumns = _.filter(store.entitySchema.columns, {\n 'sqlType': 'blob'\n });\n return !!blobColumns.length;\n }", "function checkDataSize () {\n DataPoint.collection.stats()\n .then(result => {\n // calculate percentage of used disk space\n const storageSize = result.storageSize / (1024 * 1024);\n const maxGB = config.maxDatabaseSize;\n\n const usedStorage = storageSize / (maxGB * 1000);\n \n if (usedStorage > 0.8) {\n // Remove the last 2000000 documents\n DataPoint.find({}).sort({date: 'ascending'}).limit(2000000)\n .then(docs => {\n var ids = docs.map(function(doc) { return doc._id; });\n\n DataPoint.remove({_id: {$in: ids}})\n .then(docs => {\n console.log(`removed ${docs.length} docs`)\n })\n .catch(err => console.log(err))\n })\n .catch(err => console.log(err))\n }\n })\n}", "function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}", "function isBlob(obj) {\n return obj instanceof Blob;\n }", "function mb(bytes) {\n return kb(bytes) / SIZE;\n}", "function kb(bytes) { return bytes / SIZE }", "function readURL(input){\n //alert(input.files[0].size);\n if(input.files[0].size<2200000){\n\n if(input.files && input.files[0]){\n var read = new FileReader();\n\n read.onload = function(f){\n $('#imagePrev').attr('src', f.target.result);\n };\n read.readAsDataURL(input.files[0]);\n }\n }\n else{\n alert(\"Picture size exceeding 2MB !, Please upload again.\");\n }\n}", "function createBlob() {\n}", "get maxSizeInBytes() {\n return this._maxSizeInBytes;\n }", "getBlob() {\r\n return this.clone(File, \"$value\", false).get(new BlobParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\r\n }", "get maxStorageSize() {\n return this.getNumberAttribute('max_storage_size');\n }", "static get uploadLimits () { return null }", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n }", "function isBlob(obj) {\n return obj instanceof Blob;\n }", "function maxContentSize(bytes) {\n return function (control) {\n var size = control && control.value ? control.value.files.map(function (f) {\n return f.size;\n }).reduce(function (acc, i) {\n return acc + i;\n }, 0) : 0;\n var condition = bytes >= size;\n return condition ? null : {\n maxContentSize: {\n actualSize: size,\n maxSize: bytes\n }\n };\n };\n }", "get blob () {\r\n\t\treturn this._blob;\r\n\t}", "function updateSize() {\n var mb_in_bytes = 1024 * 1024;\n var file = document.getElementById(\"data-file\").files[0],\n type_file = file.name.split('.').pop();\n if (file.size < mb_in_bytes * 5 && type_file === \"docx\") {\n return true;\n }\n return false;\n}", "function isFood(blob){\n return (blob.nSize < 15)\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n const maxLength = 2000000\n console.log(e.loaded + \"\" + e.total);\n console.log(e);\n if (e.loaded < maxLength) {\n //document.getElementById('ImageLength').innerText = \"\";\n $('#imgpreview').attr('src', e.target.result);\n }\n else {\n $('#imgpreview').attr('src',\"../../Content/img/descarga.jpg\");\n document.getElementById('lblCargarFoto').innerText = \"\";\n document.getElementById('CargarFoto').value = \"\";\n document.getElementById('ImageLength').innerText = \"Limite Excedido, máximo 2 MB\";\n }\n }\n reader.readAsDataURL(input.files[0]);\n }\n}", "get blobBody() {\n return undefined;\n }", "get blobBody() {\n return undefined;\n }", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n }", "get sizeInBytes() {\n return this._sizeInBytes;\n }", "function testOver32kb() {\n\n var datauriBig = new Image();\n\n datauriBig.onerror = function() {\n addTest('datauri', true);\n Modernizr.datauri = new Boolean(true);\n Modernizr.datauri.over32kb = false;\n };\n datauriBig.onload = function() {\n addTest('datauri', true);\n Modernizr.datauri = new Boolean(true);\n Modernizr.datauri.over32kb = (datauriBig.width == 1 && datauriBig.height == 1);\n };\n\n var base64str = 'R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';\n while (base64str.length < 33000) {\n base64str = '\\r\\n' + base64str;\n }\n datauriBig.src = 'data:image/gif;base64,' + base64str;\n }", "function kb(bytes) {\n return bytes / SIZE;\n}", "get blobCommittedBlockCount() {\n return this.originalResponse.blobCommittedBlockCount;\n }", "get blobCommittedBlockCount() {\n return this.originalResponse.blobCommittedBlockCount;\n }", "get blobCommittedBlockCount() {\n return this.originalResponse.blobCommittedBlockCount;\n }", "get blobCommittedBlockCount() {\n return this.originalResponse.blobCommittedBlockCount;\n }", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "get blobType() {\n return this.originalResponse.blobType;\n }", "get blobType() {\n return this.originalResponse.blobType;\n }", "get blobType() {\n return this.originalResponse.blobType;\n }", "get blobType() {\n return this.originalResponse.blobType;\n }", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t}", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody$1.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob$1([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER$1]: buf\n\t\t\t});\n\t\t});\n\t}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t }", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t }", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t }", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "get MaxMediaStorageUsageInMB() {\n return this.maxMediaStorageUsageInMB;\n }", "get maxFileSize() {\n return this._maxFileSize;\n }", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}", "blob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t}" ]
[ "0.6489028", "0.6455937", "0.6455937", "0.59789675", "0.59687823", "0.5964286", "0.5948781", "0.5891616", "0.5877945", "0.5788265", "0.5784631", "0.5749555", "0.5734975", "0.56905955", "0.5679625", "0.56767523", "0.5663668", "0.56633586", "0.56625634", "0.56442404", "0.56208146", "0.5604002", "0.56022114", "0.55910295", "0.5586138", "0.5551558", "0.55478", "0.55423135", "0.55423135", "0.55338794", "0.55301553", "0.5528963", "0.54883003", "0.5473086", "0.5473086", "0.5473086", "0.5473086", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54552376", "0.54514194", "0.54514194", "0.54514194", "0.54514194", "0.54389006", "0.54389006", "0.54284817", "0.5428458", "0.5428458", "0.54279846", "0.54279846", "0.54279846", "0.5424399", "0.5424399", "0.5424399", "0.5424399", "0.5424399", "0.5424399", "0.5424399", "0.5424399", "0.5424399", "0.541167", "0.5406617", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154", "0.54059154" ]
0.0
-1
check if a divisor exists for each number
function checkDivisor (j) { return i % j === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function es_divisor(dividendo, divisor) {\n return dividendo % divisor == 0\n}", "function diviserator(num) {\r\n var counter = 0;\r\n for (var i = 1; i < Math.sqrt(num); i++) {\r\n if (num % i === 0) {\r\n counter += 2;\r\n }\r\n }\r\n if (counter > 1000) {\r\n return true;\r\n }\r\n}", "function isDivideBy(number, a, b) {\n return number % a === 0 && number % b === 0\n}", "function divisibleByAll(number, array){\n\t\n\tfor(var i = 0; i < array.length; i++){\n\t\tif(number % array[i] !== 0){\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true;\n}", "function divides(x){\n \n return numbers => numbers % x === 0;\n}", "function isDivisible(n, divisor) {\r\n return (Math.floor(n / divisor) == n / divisor);\r\n}", "function checkDivisors(arr) {\n\n // ---------- Your Code Here ----------\n\n for(var i = 0; i < arr.length; i++){\n var temp = arr[i];\n\n for(var j = 0; j < arr.length; j++){\n\n var temp2 = arr[j]\n // console.log(temp, temp2, temp%temp2)\n if(i != j){\n\n if((temp % temp2) === 0){\n\n return true;\n\n }\n }\n }\n }\n\n return false;\n // ----------- End Code Area -----------\n\n}", "function isMult(x){\n for (let i = 20 ; i > 10 ; i--){\n if (x%i!=0){return false;} \n }\n return true;\n}", "function perfectNumbers (numberInput) {\n var divisors = []\n for (var i = 1; i <= numberInput; i++) if (numberInput % i === 0) divisors.push(i)\n if (divisors.reduce(function (acc, element) {\n return acc + element\n }, 0) === numberInput * 2) return true\n return false\n}", "function canDivide(number, div1, div2) {\n return number % div1 === 0 && number % div2 === 0;\n}", "function div(a,b) {\n if (a % b == 0) {\n return true;\n }\n return false;\n}", "function isDivisibleByArray(x, A) {\r\n for (let i = 0; i < A.length; i++) {\r\n if (x % A[i] != 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function isDivisible(n, x, y) {\nreturn n % x === 0 && n % y === 0;\n}", "function IsDivisible(nominator,denominator)\n{\n\treturn (nominator % denominator==0);\n}", "function isDivisible(num) {\n return i % num == 0;\n }", "function isMultiple(num1,num2){\n if(num2/num1 === 1){\n return false;\n }\n else if(parseFloat(num2) % parseFloat(num1) == 0){\n return true;\n }\n else\n return false;\n\n}", "function isDivisible(num1, num2) {\n for(var i = 0; i < largest.length; i++){\n if(num1 % num2 === 0){\n return true\n } else {\n return false\n }\n }\n}", "function isDivisible(divisee, divisor) {\n // your code here\n if (divisee % divisor === 0) {\n return true;\n }\n else {\n return false;\n }\n}", "function isSimple(n) {\r\n if (n === 2) {\r\n //console.log('2 is simple number');\r\n return true;\r\n }\r\n var r = Math.round(Math.sqrt(n));\r\n var dividers = [];\r\n for (var i = 1; i <= r; i++) {\r\n if (n % i === 0) {\r\n dividers.push(i);\r\n }\r\n }\r\n //console.log(dividers);\r\n return dividers.length === 1 && dividers[0] === 1;\r\n}", "function isDivisible(n, x, y) {\n return n % x === 0 && n % y === 0 ? true : false\n}", "function divisibleBy(numbers, divisor) {\n\t// iterate using filter\n\t// if the element is divisble by divisor\n\t// return element\n\treturn numbers.filter((element) => element % divisor === 0);\n}", "function IsDivisibleBy(a, b) {\n if (a % b === 0 || b % a === 0) {\n console.log(1);\n } else {\n console.log(0);\n }\n }", "function divisibleBy(numbers, divisor){\n return numbers.filter(number => number % divisor === 0)\n}", "function divisor (num1, num2) {\n var result;\n for(var i = 0; i <= num1; i++) {\n if( num1 % i === 0 && num2 % i === 0) {\n result = i;\n }\n }\n return result1;\n}", "function divBy100(num) {\n return (num % 100 === 0)\n}", "function isMultiple(number1, number2) {\r\n if (number1 % number2 === 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function dividesSelf(n) {\n let numStr = n.toString();\n for (let i = 0; i < numStr.length; i++) {\n if (n % Number(numStr[i]) !== 0) return false;\n }\n return true;\n}", "divisibleBy(numbers, divisor) {\n let divisibleNum = numbers.reduce((acc, num) => {\n if (num % divisor === 0) {\n acc.push(num)\n }\n return acc\n }, [])\n return divisibleNum\n }", "function isMultipleOf(target, n) {\n return target % n === 0\n}", "function isDivisible(dividend, divisor) {\n if(dividend%divisor === 0) {\n return true;\n } else {return false;}\n}", "function test(ele) {\n for (let i = 2; i * i <= ele; i++) {\n if (ele % i == 0) {\n return false;\n }\n }\n return true;\n}", "function isDivisible(n, x, y) {\n\treturn n % x === 0 && n % y === 0 ? true : false;\n}", "function isDivisible(num, x, y) {\n if (num % x === 0 && num % y === 0) {\n return true\n } else {\n return false\n }\n}", "function isDivisibleBy(value, num) {\n return typeof value === 'number' && typeof num === 'number' && validator_lib_isDivisibleBy__WEBPACK_IMPORTED_MODULE_1___default()(String(value), num);\n}", "function divisors(num){\n var divs = [];\n for(var i=num-1;i>1;i--){\n if(num%i === 0){\n divs.unshift(i);\n }\n }\n if(divs.length < 1){\n return `${num} is prime`\n } else {\n return divs;\n }\n}", "function divBy100(num) {\n if(num % 100 === 0) {\n return true\n } else {\n return false\n }\n}", "function divisible(num) {\n\treturn !(num % 100);\n\t// return num % 100 == 0;\n}", "function isDivisible(n, x, y) {\n if ( n % x === 0 && n % y === 0)\n {\n return true;\n } return false;\n}", "function perfect(x){\n let count =0;\n for(let i=0;i<x;i++){\n if(x%i==0){\n count+=i\n }\n }\n if(count==x){\n return true\n }\n else{\n return false\n }\n}", "function checkDivisibility(divider, divisor) {\n if (!divider || !divisor) {\n return 'Please input a valid number not equal to zero ';\n }\n if (divider % divisor === 0) {\n return 'It is divideable';\n } else {\n return 'It is not divideable';\n }\n \n}", "function divisible(num) {\n return num % 100 === 0;\n }", "function divisible(num) {\n if (num % 100 === 0) {\n return true;\n }\n return false;\n}", "function findDivisors(n) {\n let divisors = 0;\n for (let i = 1; i <= Math.sqrt(n); i++) {\n if (n % i === 0) {\n if (i * i === n) divisors += 1;\n else divisors += 2;\n }\n }\n return divisors;\n}", "function isDivisible(n, x, y) {\n if(n % x == 0 && n % y == 0) {\n return true;\n } else {\n return false; \n }\n}", "function divisor(num1, num2){\n var small = getSmall(num1, num2);\n //var primes = [2,3,5,7];\n \n for (var i = small; i > 0; i--){\n if ( num1 % i === 0 && num2 % i === 0){\n return i;\n }\n \n // else, check if divisible by primes starting with highest number\n // don't need this\n /*for (var j = primes.length; j > 0; j--){\n if ( num1 % primes[j - 1] === 0 && num2 % primes[j - 1] === 0 ){\n return i;\n }\n }*/\n \n }\n \n return 1;\n}", "function divisibleBy(numbers, divisor) {\n const divisibles = []\n for (let i = 0; i < numbers.length; i++) {\n if (numbers[i] % divisor === 0) {\n divisibles.push(numbers[i])\n }\n }\n return divisibles\n}", "function numberDivisors(number) {\n var digits = String(number).split(\"\");\n var count = 0;\n digits.forEach(function(digit) {\n if (number % Number(digit) == 0) {\n count++;\n }\n });\n return count;\n}", "function divisibleByAll(min, max) {\n let range = _.range(min, max + 1);\n let i = max;\n let found = false;\n\n while (found === false) {\n if (range.every(function(x) { return i % x === 0; })) {\n return(i);\n }\n i++;\n }\n }", "function checkMultiple (num1,num2) {\n if(num1%num2===0) {\n return true;\n } else {\n return false;\n }\n}", "function FindDivisors(N)\n{\n\tif(isPosInteger(N) & N<MAXLIMIT)\n\t{\n\t\tvar arr= new Array();\n\t\ti = 0;\n\t\tLimit = Math.floor(Math.sqrt(N));\n\t\tfor(var k=1; k<=Limit; k++)\n\t\t{\n\t\t\tif(N % k==0)\n\t\t\t{\n\t\t\t\tarr[i]= k;\n\t\t\t\ti++; \n\t\t\t}\n\t\t}\n\t\tm=i--; // m = number of divisors <= sqr(N)\n\t\tif(IntDiv(N,arr[m-1])==arr[m-1])\n\t\t{\n\t\t\t// if N is a perfect square\n\t\t\tn=2*m-1; // number of divisors\n\t\t\tfor(j=0; j<m-1; j++)\n\t\t\t{\n\t\t\t\tarr[m+j]=IntDiv(N,arr[m-j-2]);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if N is not a perfect square\n\t\t\tn=2*m; // number of divisors\n\t\t\tfor(j=0; j<m; j++)\n\t\t\t{\n\t\t\t\tarr[m+j]=IntDiv(N,arr[m-j-1]);\n\t\t\t}\n\t\t}\n\t\treturn arr;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function isPrime(x) {\n var i;\n \n console.log('Checking base');\n if (isNaN(x) || !isFinite(x) || x < 2) {\n return false;\n }\n\n console.log('Checking x % 2 ');\n if (x % 2 === 0) {\n return x === 2;\n }\n\n console.log('Checking x % 3');\n if (x % 3 === 0) {\n return x === 3;\n }\n\n console.log('Checking x % 5');\n if (x % 5 === 0) {\n return x === 5;\n\n }\n\n for (i = 7; i <= Math.sqrt(x); i += 30) {\n console.log('Checking x % ' + i);\n if (x % i === 0) {\n return false;\n }\n\n console.log('Checking x % ' + (i + 4));\n if (x % (i + 4) === 0) {\n return false;\n }\n\n console.log('Checking x % ' + (i + 6));\n if (x % (i + 6) === 0) {\n return false;\n }\n\n console.log('Checking x % ' + (i + 10));\n if (x % (i + 10) === 0) {\n return i + 10;\n }\n\n console.log('Checking x % ' + (i + 12));\n if (x % (i + 12) === 0) {\n return i + 12;\n }\n\n console.log('Checking x % ' + (i + 16));\n if (x % (i + 16) === 0) {\n return i + 16;\n }\n\n console.log('Checking x % ' + (i + 22));\n if (x % (i + 22) === 0) {\n return i + 22;\n }\n\n console.log('Checking x % ' + (i + 24));\n if (x % (i + 24) === 0) {\n return i + 24;\n }\n }\n\n return true;\n }", "function isPerfectNumber(num) {\n var perf = 0;\n\n for (i = 1; i < num; i++) {\n if (num % i === 0) {\n perf += i;\n divisor = i;\n }\n }\n if (num / 2 === divisor) {\n console.log(num + ' is perfect number')\n } else {\n console.log(num + ' is not perfect number');\n }\n return perf;\n\n}", "function isDivisible(n, x, y) {\n if(n % x === 0 && n % y === 0 && n > 0 && x > 0 && y > 0) {\n return true;\n }\n\n return false;\n}", "function divisibleBy(numbers, divisor) {\n // create a variable for results\n const result = [];\n // loop over numbers\n for (const n of numbers) {\n // check if current number is divisible by divisor\n if (n % divisor === 0) {\n // if yes save it into results variable\n result.push(n);\n }\n }\n // return results\n return result;\n }", "function smallestMult(n) {\n\n // start number from the biggest\n let result = n - 1;\n\n let found;\n let counter = 0;\n\n // increase the result by one until the number is not fully divisible by the numbers\n do {\n result++;\n\n // check if number is divisible by all numbers or not\n found = true;\n for (let i = 2; i <= n; i++) {\n if (result % i !== 0) {\n found = false;\n break;\n }\n counter++;\n }\n\n } while (!found);\n\n console.log(`Iterations: ${counter}`);\n return result;\n\n}", "function isFactorOf(number, factor){\n// console.log(isFactorOf);\n//looping through number, determine if number is less/equal to factor.\n// I am LOST here....\n for(var i = number; i <= factor; i++){\n if(number % 1 === 0){\n return true;\n }\n else{\n return false;\n }\n }\n}", "function dividesEvenly(a, b) {\n return a % b === 0;\n }", "function dividesEvenly(num1, num2) {\n\treturn num1 % num2 == 0;\n}", "function funcIsPrimeOrFactors(numNumber) {\n // body... \n var numHalf = Math.floor(numNumber / 2);\n var arrFactors = [];\n\n for (var i = 2; i <= numHalf; i++) {\n var numQuotient = Math.floor(numNumber / i);\n var numRemainder = numNumber % i;\n if (numRemainder === 0) {\n arrFactors.push([i, numQuotient]);\n }\n }\n console.log(arrFactors);\n return [arrFactors.length === 0, arrFactors];\n}", "function divisible(product,max) {\r\n for (var j = 2; j < max; j += 1) {\r\n if (product % j !== 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function divisibleBy(numbers, divisor) {\n let arr = numbers.filter(el => {\n return el % divisor === 0;\n });\n \n return arr;\n}", "function isDivisible(num1, num2) {\n if (num1 % num2 === 0) {\n console.log(true)\n } else if (num1 % num2 != 0) {\n console.log(false)\n }\n}", "function isperfsq(max){\n if (max % Math.sqrt(max) === 0) {\n console.log(max + \" is a perfect square\");\n}\n}", "function isMultipleOf(target, n) {\n return (n % target == 0);\n }", "function abundantCheck(number) {\n let sum = 1;\n for (let i = 2; i <= Math.sqrt(number); i++) {\n if (number % i === 0) {\n sum += i + +(i !== Math.sqrt(number) && number / i);\n }\n }\n return sum > number;\n}", "function findDivisors(a) {\n var divisors = [];\n for (var n = 1; n < a / 2 + 1; n++) {\n if (a % n == 0) {\n divisors.push(n);\n console.log(n);\n }\n }\n return divisors;\n}", "function divisors (number) {\n let divarray = [];\n for (i = 1; i <= number; i++) {\n // console.log(i) will print 1 - 15 (use for number count!)\n // console.log(number) will print \"15\", 15 times\n let num = i;\n if (number % num === 0) {\n divarray.push(num);\n }\n }\n return divarray;\n}", "function dynamicIsDivisble(divisor){\n return function(number){\n return number % divisor === 0;\n }\n}", "function isIntegerBeautiful(n, divisor) {\n const reversedN = reverseInteger(n);\n const processedN = (n - reversedN) / divisor;\n\n const beautiful = processedN % 1 === 0;\n\n return beautiful;\n}", "function divisible(num) {\nif(num % 100 == 0){\n return true;\n}else\nreturn false;\n\n}", "function allDivisors(dividend) {\n if (dividend <= 0 || dividend % 1 !== 0) return \"Please provide a positive, whole number.\";\n let divisors = [];\n for (let i = 1; i <= dividend; i++) {\n if (dividend % i === 0) {\n divisors.push(i);\n }\n }\n return divisors;\n}", "function dividesEvenly(a, b) {\n if (a % b == 0) {\n return true;\n }\n return false;\n}", "function prim(x) {\n if (x < 2) return false;\n\n for (let i = 2; i < x; i++) {\n if (x % i === 0) {\n return false;\n }\n }\n return true;\n}", "function checkForFactor (base, factor) {\n return base % factor == 0 ? true : false; \n}", "function acceptsNumber(number) {\n if (number > 1) {\n for (var i = 1; i <= number; i++) {\n //must check of 1 because number / 0 = ...\n if (number % i === 0) {\n return false;\n }\n return true;\n }\n } else {\n return \"Number is not valid for check!!!\";\n }\n}", "function findGdivisor(num1, num2) {\n var tmp;\n for (var i = 0; i <= num2; i++) {\n if (num1 % i === 0 && num2 % i === 0) {\n tmp = i;\n }\n } return tmp;\n}", "function div(a, b) {\n var answer = a % b;\n console.log(\"Solution one = \" + answer);\n}", "function anyNumber(firstNum, secondNum){\n // if(firstNum % secondNum === 0){\n // console.log(true);\n // } else {\n // console.log(false);\n // }\n console.log(firstNum % secondNum == 0); // can also write it like this \n}", "function divisibleBy (arr, divisor) {\n let result = [];\n for(let num of arr){\n if(num % divisor === 0){\n result.push(num);\n }\n }\n return result;\n}", "function generalizedGCD(num, arr) {\n\t// WRITE YOUR CODE HERE\n\tif (num == null || num === 0) return false;\n\tif (arr == null || arr.length === 0) return false;\n\n\t//no need to run the rest\n\tif (num === 1) {\n\t\treturn 1;\n\t}\n\n\tlet result = 1; // min GCD\n\tlet isFind = false;\n\tlet div = 2; //first test\n\n\twhile (div <= num) {\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] % div === 0) {\n\t\t\t\tisFind = true;\n\t\t\t} else {\n\t\t\t\tisFind = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (isFind) {\n\t\t\tresult = div;\n\t\t}\n\t\tdiv++;\n\t}\n\n\treturn result;\n}", "function findFactors(number) {\n for (var i=2; i<=number;) {\n if (number % i ==0) {\n number /= i;\n }\n else {\n i++;\n }\n }\n console.log(i);\n}", "function question5() {\n var divisible = false;\n for (let index = 1; divisible === false; index++) {\n if (index % 2 === 0 && index % 3 === 0 && index % 4 === 0 && index % 5 === 0 && index % 6 === 0 && index % 7 === 0 && index % 8 === 0 && index % 9 === 0 && index % 10 === 0 && index % 11 === 0 && index % 12 === 0 && index % 13 === 0 && index % 14 === 0 && index % 15 === 0 && index % 16 === 0 && index % 17 === 0 && index % 18 === 0 && index % 19 === 0 && index % 20 === 0) {\n console.log(index);\n divisible = true;\n }\n }\n}", "function selfDivide(num) {\n let factors = num.toString().split('').map(Number) // numbers to divide by\n for (let j = 0; j < factors.length; j++) {\n if (num % factors[j] !== 0) {\n return num\n }\n }\n }", "function testK(k) {\n let commonDivisor = (num) => {\n return mul.some((item) => (num % item[0] === 0));\n };\n return Array.prototype.every.call(s, (item, index) => (commonDivisor(k + index) === (item === '0')));\n }", "function problem12(){\n let dividers = 2;\n let sum = 0;\n let x = 1;\n do{\n dividers = 2;\n sum = (x+1)*(x/2);\n let numRoot = (Math.floor(Math.sqrt(sum)));\n for(let y = 2; y <= numRoot; y++){\n if(sum % y === 0){\n dividers+=2;\n }\n }\n x++;\n } while(dividers<500);\n return sum;\n}", "function perfectSquare(number){\n for (i = 1; i < number/i+1; i++){\n console.log(i);\n if(i * i === number){\n return true;\n }\n }\n return false;\n}", "function isPerfect (a) {\n var sum = 0;\n for (var i = 0; i < a; i++) {\n if (a % i == 0) {\n sum += i;\n }\n } return a === sum;\n}", "function PrimeTest(a){\n if (isNaN(a) || !isFinite(a) || a % 1 || a < 2) return false; \n var m = Math.sqrt(a);\n for (var i = 2; i <= m; i++) if (a % i==0) return false;\n return true;\n}", "function divisible(num1, num2){\n if (num1 % num2 === 0) {\n console.log('true');\n } else {\n console.log('false')\n }\n}", "function numbersInLoop(rangeStart, rangeEnd, divisor) {\n\tfor (index = rangeStart; index <= rangeEnd; index += 1) {\n\t\tif (index % divisor === 0) {\n\t\t\tconsole.log(index);\n\t\t}\n\t}\n}", "function sumOfMultiplesInRage(multiple1, multiple2, max) {\n let multiples = [];\n let sum = 0;\n \n for(let i = multiple1; i < max; i++) {\n if (i % multiple1 === 0 || i % multiple2 === 0) {\n if(!multiples.includes(i)) {\n sum += i;\n }\n }\n }\n\n console.log(sum);\n}", "function isDivisible(g, h) {\n if(g % h === 0) {\n return true;\n } else {\n return false;\n }\n}", "function divisibleBy(numbers, divisor) {\n let arr = [];\n for (let index = 0; index < numbers.length; index++) {\n if (numbers[index] % divisor === 0) {\n arr.push(numbers[index]);\n }\n }\n return arr;\n}", "function divisibleTriangleNumbers(numDivisors) {\n var i = 1,\n triangleNum,\n factors = 0;\n\n for(i; factors < numDivisors; i++) {\n triangleNum = commons.getTriangleNumber(i);\n factors = commons.getFactors(triangleNum).length;\n }\n\n return triangleNum;\n}", "function isNeedDivide(playerID){\r\n\t\t\t\t\tvar count = 0;\r\n\t\t\t\t\tfor(i=1;i<6;++i){\r\n\t\t\t\t\t\tif(squares[playerID][i].getNumStone() == 0)\r\n\t\t\t\t\t\t++count;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count == 5)\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}", "function isPrime(x) {\n if (x === 1 || x === 2 || x === 3) {\n return true;\n };\n\n var limit = parseInt(Math.sqrt(x), 10);\n var numberOfDivisors = 0;\n\n for (var i = 1; i < limit; i++) {\n if (x % i == 0) {\n limit = x / i;\n if (limit != i) {\n numberOfDivisors++;\n }\n\n numberOfDivisors++;\n }\n\n if (numberOfDivisors > 2) {\n return false;\n };\n }\n\n return numberOfDivisors === 2;\n }", "function findTheDivisors(num) {\n let arr = [];\n for (let i = 0; i < num; i++) {\n if (num % i == 0 && i != 1) {\n arr.push(i);\n }\n }\n return arr.length ? arr : \"is prime\";\n}", "function multiples(num1, num2) {\n let new_array = [];\n for (let i = 1; i <= 100; i++) {\n if (i % num1 === 0 && i % num2 === 0) {\n new_array.push(i);\n }\n } //end of for\n return new_array;\n } //end of multiples", "function findAbundantNumbers(max) {\n const abundant = [];\n for (let number = 1; number < max; number++) {\n const properDivisors = [];\n const sqrt = Math.sqrt(number);\n for (let divisor = 1; divisor <= sqrt; divisor++) {\n if (number % divisor === 0) {\n properDivisors.push(divisor);\n if (divisor > 1 && number / divisor !== divisor) {\n properDivisors.push(number / divisor);\n }\n }\n }\n if (_.sum(properDivisors) > number) {\n abundant[number] = true;\n }\n }\n\n return abundant;\n}", "function FlexCount(LowNum, HighNum, Mult){\n for(var i = HighNum; i < LowNum; i--){\n if(i / Mult === 0){\n console.log(i);\n }\n }\n}" ]
[ "0.7635661", "0.7465979", "0.72767377", "0.7244849", "0.723067", "0.71670336", "0.7164065", "0.7159016", "0.7096347", "0.7023351", "0.7022092", "0.69836926", "0.69595975", "0.6951323", "0.6948818", "0.6930906", "0.69269496", "0.69004357", "0.6874983", "0.6869298", "0.6849694", "0.6837266", "0.6768619", "0.6762375", "0.6751131", "0.6746951", "0.67389876", "0.672346", "0.6705545", "0.66979694", "0.6688867", "0.66857004", "0.66804385", "0.6674054", "0.66675705", "0.66608715", "0.66577834", "0.665558", "0.66450566", "0.6641858", "0.6641211", "0.6630705", "0.662041", "0.66169596", "0.66165423", "0.65973276", "0.65932906", "0.65926355", "0.6580842", "0.65771085", "0.65716326", "0.65714455", "0.65658957", "0.65402645", "0.6526706", "0.6509779", "0.648037", "0.64753383", "0.6474966", "0.647482", "0.6463816", "0.6450458", "0.64392084", "0.6424727", "0.64225954", "0.6420499", "0.6419028", "0.6400325", "0.63980514", "0.6398024", "0.63966066", "0.63921756", "0.6390013", "0.6390002", "0.6382078", "0.6377395", "0.63680536", "0.6367457", "0.6364092", "0.6361195", "0.6360781", "0.6356119", "0.6352581", "0.6348711", "0.63444275", "0.63437855", "0.6334223", "0.6333059", "0.63293344", "0.6314677", "0.6311572", "0.63066554", "0.63061726", "0.63059926", "0.63038665", "0.6296736", "0.6288771", "0.626594", "0.6264959", "0.6263914" ]
0.71182585
8
return a serial number
serialNumber() { return `${this.getSNString()}${(this.increament++).toString().padStart(this.padCount, '0')}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSerialId() {\n if (!this.serialid) {\n let id = this.getId();\n if (id) {\n id = id.replace(/(.+?)\\/(.+?)\\/(.*)/, '$2');\n this.serialid = id.replace(/(.+)-(.+)/, '$2');\n }\n }\n return this.serialid;\n }", "function SerialNum()\n{\n var num = 1;\n}", "async function getSerial() {\n return constants.SERIAL;\n}", "static async getStoredSerialNumberById(id){\n const serialNum = await Seriall.getSerialNumberById(id);\n return serialNum;\n }", "function _x509_getSerialNumberHex() {\n return ASN1HEX.getDecendantHexVByNthList(this.hex, 0, [0, 1]);\n}", "function calculateId(device) {\n // return prefix + device.serial\n return device.serial\n }", "function ZNPSerial() {\n}", "function createVersionNumber() {\n return new Date().toJSON().slice(0, 10) + '--' + uniqueId();\n}", "static async postSerialNumber(id){\n const serialNumbers = await this.getAllSerialNumbers();\n \n const numberID = Number(id);\n\n const desiredSerialNumber = [];\n\n for(const serialNumber of serialNumbers){\n if(serialNumber.id === numberID){\n desiredSerialNumber.push(serialNumber.name);\n }\n }\n const serial = await Seriall.insert({ serial_number: desiredSerialNumber[0] });\n return serial;\n\n }", "function getUniqueID() {\n var id = new Date().valueOf();\n return id + \".\" + incrementID.increment();\n }", "static async deleteStoredSerialNumberById(id){\n const serialNum = await Seriall.deleteSerialNumberById(id);\n return serialNum;\n }", "function uuidNum(num) {\n return '00000000-0000-0000-0000-0000000000'\n + (Number(num) < 10 ? '0' + num : num);\n}", "function getUniqueNumber() {\n\tuniqueNumber++;\n\treturn uniqueNumber;\n}", "function uuid() {\n return \"uid-\" + __counter++;\n}", "function makeUniqueUserId() {\n\treturn `XX${String(++useridSerial).padStart(4, '0')}`;\n}", "static async getStoredSerialNumbers(){\n const serialNums = await Seriall.allSerialNumbers();\n return serialNums;\n }", "function obtenerNumeroDigitado(botonDigitado) {\n return botonDigitado[1];\n}", "calculateID() {\n const serial = this.serialize(this.data);\n const hash = crypto.createHash('sha256');\n hash.update(serial);\n return hash.digest('hex'); // **Encoding the ID in hex**\n }", "function getUniqueIdentifierStr() {\n return getIncrementalInteger() + Math.random().toString(16).substr(2);\n}", "function newSeqNum(){\n nextSeqNum++;\n return nextSeqNum;\n }", "function getSerialNumber() {\n let filesInDir = fs.readdirSync(\n `${__dirname}/../documents/storage`,\n (err, files) => {\n if (err) res.status(500).send(err);\n }\n );\n\n filesInDir = filesInDir.filter(file => {\n return file != DS_Store; // in order to ignore the '.DS_Store' file\n });\n\n for (let i = 0; i < filesInDir.length; i++)\n filesInDir[i] = filesInDir[i].slice(0, -4);\n\n return filesInDir.length === 0 ? 0 : Math.max(...filesInDir);\n}", "function genereID(){\nvar ref='DA-';\nvar date = new Date();\n\n // Format de l'ID de la demande d'achat DA-YYMMDD-HHMMSS\n ref+=(String(date.getFullYear())).slice(-2)+(\"0\"+ String(date.getMonth()+1)).slice(-2)+(\"0\" + String(date.getDate())).slice(-2);\n ref+=\"-\"\n ref+=(\"0\"+String(date.getHours())).slice(-2)+(\"0\"+ String(date.getMinutes()+1)).slice(-2)+(\"0\" + String(date.getSeconds())).slice(-2);\n return ref;\n}", "function calculateNumericDigit(serial) {\n const MODULE = 11\n const MIN_FACTOR = 2\n const MAX_FACTOR = 7\n\n const { sum } = serial.split('').reduceRight(\n (state, char) => ({\n sum: state.sum + Number(char) * state.factor,\n factor: state.factor == MAX_FACTOR ? MIN_FACTOR : state.factor + 1,\n }),\n { sum: 0, factor: MIN_FACTOR }\n )\n\n return MODULE - (sum % MODULE)\n}", "generateCid() {\n // random number + last 7 numbers of current time\n return 'cid_' + Math.random().toString(36).substr(2) + '_' + new Date().getTime().toString().substr(-7);\n }", "function generatePID () {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n })\n}", "function generateID (idx) {\n return ('jsrch_' + idx + '_' + new Date().getTime());\n }", "function phoneNumber(no){\n\t\n}", "function sequencia4(num) {\n return 0\n}", "function generateNumCommande() {\n var random = Math.floor(100000000 + Math.random() * 900000000);\n num_commande = 'NH'+random\n }", "function pvrInvoiceNumber(jsonInvoice) {\n var prefixLength = jsonInvoice[\"document_info\"][\"number\"].indexOf('-');\n if (prefixLength >= 0) {\n return jsonInvoice[\"document_info\"][\"number\"].substr(prefixLength + 1);\n }\n return jsonInvoice[\"document_info\"][\"number\"]\n}", "function getID() {\n\tvar tmp = Math.round(Math.random() * 100000);\n\tvar str = \"OBJ\" + tmp;\n\treturn str;\n}", "static async updatesStoredSerialNumberById(id, objBody){\n const serialNum = await Seriall.updateSerialNumberById(id, objBody);\n return serialNum;\n }", "function sequencia1(num) {\n return 0\n}", "logNextId() {\n const testNumber = this.getNextUniqueId();\n console.log(testNumber);\n }", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n }", "function createComputerID () {\n return \"comp\"+(+Date.now());\n}", "function nextUniqueId() {\n\tidCounter++;\n\treturn idCounter.toString();\n}", "function obtenerLetraDigitada(botonDigitado) {\n return botonDigitado[0];\n}", "_uniqueID() {\n const chr4 = () => Math.random().toString(16).slice(-4);\n return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\n }", "function sequencia2(num) {\n return 0\n}", "function randomNr() {\n return Math.floor(Math.random() * 9999);\n}", "function _id() {\n\t\tvar S4 = function() {\n\t\t return (((1+Math.random())*0x10000)|0).toString(16).substring(1);\n\t\t};\n\t\treturn (S4()+S4());\n\t}", "function uid() {\n // Let's create some positive random 32bit integers first.\n //\n // 1. Math.random() is a float between 0 and 1.\n // 2. 0x100000000 is 2^32 = 4294967296.\n // 3. >>> 0 enforces integer (in JS all numbers are floating point).\n //\n // For instance:\n //\t\tMath.random() * 0x100000000 = 3366450031.853859\n // but\n //\t\tMath.random() * 0x100000000 >>> 0 = 3366450031.\n var r1 = Math.random() * 0x100000000 >>> 0;\n var r2 = Math.random() * 0x100000000 >>> 0;\n var r3 = Math.random() * 0x100000000 >>> 0;\n var r4 = Math.random() * 0x100000000 >>> 0; // Make sure that id does not start with number.\n\n return 'e' + HEX_NUMBERS[r1 >> 0 & 0xFF] + HEX_NUMBERS[r1 >> 8 & 0xFF] + HEX_NUMBERS[r1 >> 16 & 0xFF] + HEX_NUMBERS[r1 >> 24 & 0xFF] + HEX_NUMBERS[r2 >> 0 & 0xFF] + HEX_NUMBERS[r2 >> 8 & 0xFF] + HEX_NUMBERS[r2 >> 16 & 0xFF] + HEX_NUMBERS[r2 >> 24 & 0xFF] + HEX_NUMBERS[r3 >> 0 & 0xFF] + HEX_NUMBERS[r3 >> 8 & 0xFF] + HEX_NUMBERS[r3 >> 16 & 0xFF] + HEX_NUMBERS[r3 >> 24 & 0xFF] + HEX_NUMBERS[r4 >> 0 & 0xFF] + HEX_NUMBERS[r4 >> 8 & 0xFF] + HEX_NUMBERS[r4 >> 16 & 0xFF] + HEX_NUMBERS[r4 >> 24 & 0xFF];\n }", "function uid() {\n // Let's create some positive random 32bit integers first.\n //\n // 1. Math.random() is a float between 0 and 1.\n // 2. 0x100000000 is 2^32 = 4294967296.\n // 3. >>> 0 enforces integer (in JS all numbers are floating point).\n //\n // For instance:\n //\t\tMath.random() * 0x100000000 = 3366450031.853859\n // but\n //\t\tMath.random() * 0x100000000 >>> 0 = 3366450031.\n var r1 = Math.random() * 0x100000000 >>> 0;\n var r2 = Math.random() * 0x100000000 >>> 0;\n var r3 = Math.random() * 0x100000000 >>> 0;\n var r4 = Math.random() * 0x100000000 >>> 0; // Make sure that id does not start with number.\n\n return 'e' + HEX_NUMBERS[r1 >> 0 & 0xFF] + HEX_NUMBERS[r1 >> 8 & 0xFF] + HEX_NUMBERS[r1 >> 16 & 0xFF] + HEX_NUMBERS[r1 >> 24 & 0xFF] + HEX_NUMBERS[r2 >> 0 & 0xFF] + HEX_NUMBERS[r2 >> 8 & 0xFF] + HEX_NUMBERS[r2 >> 16 & 0xFF] + HEX_NUMBERS[r2 >> 24 & 0xFF] + HEX_NUMBERS[r3 >> 0 & 0xFF] + HEX_NUMBERS[r3 >> 8 & 0xFF] + HEX_NUMBERS[r3 >> 16 & 0xFF] + HEX_NUMBERS[r3 >> 24 & 0xFF] + HEX_NUMBERS[r4 >> 0 & 0xFF] + HEX_NUMBERS[r4 >> 8 & 0xFF] + HEX_NUMBERS[r4 >> 16 & 0xFF] + HEX_NUMBERS[r4 >> 24 & 0xFF];\n }", "function uuidGenerator (){\n var len = 20;\n parseInt((Math.random() * 20 + 1) * Math.pow(10,len-1), 10); \n var uniquenumber = Date.now().toString(36) + ((Math.random() * 34 + 1) * Math.pow(10,len-1)).toString(36).substr(2,34).toUpperCase();\n return uniquenumber;\n }", "getElectronicId () {\n var self = this\n\n let cmd = Buffer.from([0x00])\n\n cmd = createCommand(cmd, 0x07)\n\n return new Promise((resolve, reject) => {\n self._request(cmd, 'getElectronicId')\n .then(response => {\n resolve(response)\n })\n .catch(error => {\n reject(error)\n })\n })\n }", "function GetCertIndex(serial) {\r\n var index;\r\n if (serial != null && serial.length > 0) {\r\n try {\r\n index = plugin().GetCert(serial);\r\n return index;\r\n } catch (e) {\r\n if (!checkIeBrowser()) {\r\n console.log(e);\r\n }\r\n }\r\n }\r\n return -1;\r\n}", "function CrystalNumber(crystalName) {\n\t\t\t\treturn Math.ceil(Math.random() * 12 - 1) + 1;\n\t\t\t}", "function readID(header) {\n return Number(BigInt(readDate(header)) << 16n) + readIncrement(header);\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n }", "function SerialNumber(redisClient) {\n\tthis.redisClient = redisClient\n}", "function getUUID(){\n\t uuid = \"\";\n\t for (i = 0; i < 32; i++) {\n\t uuid += Math.floor(Math.random() * 16).toString(16);\n\t }\n\t return uuid;\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n }", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n }", "function getUID(month, year, day){\n if(month == 12){\n month = 0;\n year++;\n }\n monthString = \"\" + month;\n yearString = \"\" + year;\n dayString = \"\" + day;\n\n if(day <= 9) {\n dayString = \"0\" + dayString;\n }\n\n if(month <= 9) {\n monthString = \"0\" + monthString;\n }\n\n return yearString + \"-\" + monthString + \"-\" + dayString;\n}", "function guid() {\n return S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4();\n}", "getTransactionID() {\n let length = window.Database.DB.bought.length;\n var lastID = window.Database.DB.bought[length - 1].transaction_id;\n\n return parseInt(lastID) + 1;\n }", "function generateCrystalNum() {\n var crystalNumber = Math.floor(Math.random()*12) + 1;\n console.log(crystalNumber);\n console.log(typeof(crystalNumber))\n return crystalNumber;\n }", "function makeId() {\n idNumber = idNumber + 1;\n const newId = ($tw.browser?'b':'s') + idNumber;\n return newId;\n }", "function generaNumero(){\n let numero = Math.floor(Math.random() * 4 ) + 1;\n return numero;\n}", "function makeid() {\n const {possible, n} = makeid\n let alphaHex = n.toString(26).split(''), c, r = ''\n while(c = alphaHex.shift()) r += possible[parseInt(c, 26)]\n makeid.n++\n return r\n}", "function generateUniqueId() {\n\t\t\tvar format = \"xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx\";\n\t\t\tvar result = \"\";\n\t\t\tfor(var i = 0; i < format.length; i++) {\n\t\t\t\tif(format.charAt(i) == \"-\") {\n\t\t\t\t\tresult += \"-\";\n\t\t\t\t} else {\n\t\t\t\t\tresult += Math.floor(Math.random() * 10);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "function generateID() {\n\t\tsID += 1;\n\t\treturn sID;\n\t}", "function getUuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "function guid() {\r\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\r\n}", "_uuid() {\n return this.uid++;\n }", "function getPhone() {\n let num = (min, max) => String(getRandomInt(min, max));\n return (\n num(0, 10) + num(0, 10) + num(0, 10) + '-'\n + num(0, 10) + num(0, 10) + num(0, 10) + '-'\n + num(0, 10) + num(0, 10) + num(0, 10) + num(0, 10)\n );\n}", "function guid() {\n return (S4()+S4()+S4()+S4());\n}", "function uid() {\n // Let's create some positive random 32bit integers first.\n //\n // 1. Math.random() is a float between 0 and 1.\n // 2. 0x100000000 is 2^32 = 4294967296.\n // 3. >>> 0 enforces integer (in JS all numbers are floating point).\n //\n // For instance:\n //\t\tMath.random() * 0x100000000 = 3366450031.853859\n // but\n //\t\tMath.random() * 0x100000000 >>> 0 = 3366450031.\n var r1 = Math.random() * 0x100000000 >>> 0;\n var r2 = Math.random() * 0x100000000 >>> 0;\n var r3 = Math.random() * 0x100000000 >>> 0;\n var r4 = Math.random() * 0x100000000 >>> 0; // Make sure that id does not start with number.\n\n return 'e' + HEX_NUMBERS[r1 >> 0 & 0xFF] + HEX_NUMBERS[r1 >> 8 & 0xFF] + HEX_NUMBERS[r1 >> 16 & 0xFF] + HEX_NUMBERS[r1 >> 24 & 0xFF] + HEX_NUMBERS[r2 >> 0 & 0xFF] + HEX_NUMBERS[r2 >> 8 & 0xFF] + HEX_NUMBERS[r2 >> 16 & 0xFF] + HEX_NUMBERS[r2 >> 24 & 0xFF] + HEX_NUMBERS[r3 >> 0 & 0xFF] + HEX_NUMBERS[r3 >> 8 & 0xFF] + HEX_NUMBERS[r3 >> 16 & 0xFF] + HEX_NUMBERS[r3 >> 24 & 0xFF] + HEX_NUMBERS[r4 >> 0 & 0xFF] + HEX_NUMBERS[r4 >> 8 & 0xFF] + HEX_NUMBERS[r4 >> 16 & 0xFF] + HEX_NUMBERS[r4 >> 24 & 0xFF];\n }", "function guid() {\r\n\treturn parseInt(Date.now() + Math.random());\r\n}", "rNum() {\n return Math.floor(Math.random() * (61) + 15) / 100;\n }", "function getProductNumber(code) {\n let productNumber, posColon, posDash;\n posColon = code.indexOf(\":\");\n posDash = code.indexOf(\"-\");\n productNumber = code.substr(posColon + 1, posDash - posColon - 1);\n return productNumber;\n}", "function generateCryptnum() {\n\tif(window.crypto) {\n\t\tvar buf = new Uint32Array(1);\n\t\twindow.crypto.getRandomValues(buf);\n\t\treturn buf[0];\n\t}\n\treturn generateUUID().replace('-',''); // fallback\n}", "async genID(){\n var result = 'pd';\n for(var k = 0; k < 8; k++){\n result += `${misc.randomnum(1,10)-1}`;\n }\n return result;\n }", "function getNextSequenceNumber(BracnhData, transaction, Max_TicketNumber, Min_TicketNumber, EnableHallSlipRange) {\n try {\n\n let Today = commonMethods.Today();\n let ticketSequence = 0;\n //Get the sequence if exists in the memory\n let ticketSeqData = BracnhData.ticketSeqData.find(function (value) {\n return value.ticketSymbol == transaction.ticketSymbol && (value.hall_ID == transaction.hall_ID || EnableHallSlipRange == \"0\");\n }\n );\n\n if (ticketSeqData != null && ticketSeqData.time.toString() == Today.toString()) {\n //Update the existing Seq\n ticketSequence = ticketSeqData.sequence + 1;\n if (ticketSequence > Max_TicketNumber) {\n ticketSequence = Min_TicketNumber;\n }\n ticketSeqData.sequence = ticketSequence;\n }\n else {\n ticketSequence = GetSequenceForFirstTime(BracnhData, transaction, Max_TicketNumber, Min_TicketNumber, EnableHallSlipRange);\n }\n return ticketSequence;\n\n }\n catch (error) {\n logger.logError(error);\n return -1;\n }\n}", "generateRoomId() {\n\t\treturn `r${Date.now()}`;\n\t}", "function readUid(){\n checkLen(16);\n var res = hexBlock(0, 4, true) + '-' + hexBlock(4, 2, true) + '-' + hexBlock(6, 2, true) + '-' + hexBlock(8, 2) + '-' + hexBlock(10, 6);\n pos += 16;\n return res;\n }", "async getIdentifier(tx) {\n // We consult the REST API because we don't have a local amino encoder\n const bytes = await this.restClient.encodeTx(tx);\n const hash = new crypto_1.Sha256(bytes).digest();\n return encoding_1.Encoding.toHex(hash).toUpperCase();\n }", "function guid() {return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();}", "function guid() {\n\t\treturn (S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4());\n\t}", "function getRecordNumberFromString(value) {\r\n var regExp0 = /([2][0][0-9]{6}|[1][9][8-9][0-9]{5})/;\r\n var regExp1 = /((KK|MC)[0-9]{4,5})/;\r\n var regExp2 = /((KK|MC)[0-9]{4,5}-[0-9]{1,3})/;\r\n var match0 = regExp0.exec(value);\r\n var match1 = regExp1.exec(value);\r\n var match2 = regExp2.exec(value);\r\n \r\n if(match0) {\r\n return match0[1];\r\n }\r\n else if(match1) {\r\n return match1[1];\r\n }\r\n else if(match2) {\r\n return match2[1];\r\n }\r\n \r\n return \"\";\r\n}", "function createBorrowerCardNumber(borrowerNumber) {\n return 100000000 + obj.borrowernumber;\n }", "function produceNumber() { \n var charCase = String.fromCharCode(Math.floor(Math.random() * 10 + 48))\n return charCase\n }", "_id () {\n return (Math.random().toString(16) + '000000000').substr(2, 8)\n }", "function guid() {\n return parseInt(Date.now() + Math.random())\n }", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function guid() {\n return s4() + s4() + s4() + s4() + '-' + (new Date()).getTime();\n }", "function generateNumericId(){\n var sid = shortid.generate().substr(0, 5); //short id, 5 chars long\n var iid = radix64.decodeToInt(sid); //integer id\n\n var iidString = iid + \"\";\n\n iidString = leftPad(iidString, 10);\n return iidString;\n}", "function guid() {\r\n return parseInt(Date.now() + Math.random());\r\n}", "function getUniqueString() {\n if (getUniqueString.uid === undefined) {\n getUniqueString.uid = 0;\n }\n getUniqueString.uid++;\n\n return \"my unique String number \" + getUniqueString.uid.toString();\n }", "uuid() {\n\t\t\t\treturn Math.floor((1 + Math.random()) * 0x10000).toString(16);\n\t\t\t}", "function getNum() {\n var num = Math.floor((Math.random() * 4) + 1);\n return num;\n }", "function nextId() {\n let id = util.format('%d%s000', Date.now(), uuid().replace(/\\-/g, ''));\n return paddings[ID_LENGTH - id.length] + id;\n}", "function newMsgId() {\n let Id = 'MS' + Date.now()\n return Id\n}", "function uniqueId() {\n return Date.now() + 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n }", "function getAmtUuid() {\r\n if (settings.hostname == null) {\r\n var amtMeiModule, amtMei;\r\n try { amtMeiModule = require('amt-mei'); amtMei = new amtMeiModule(); } catch (ex) { console.log(ex); exit(1); return; }\r\n amtMei.on('error', function (e) { console.log('ERROR: ' + e); exit(1); return; });\r\n amtMei.getUuid(function (result) { if ((result == null) || (result.uuid == null)) { console.log('Failed.'); } else { console.log(result.uuid); } exit(1); });\r\n } else {\r\n if ((settings.hostname == '127.0.0.1') || (settings.hostname.toLowerCase() == 'localhost')) { settings.noconsole = true; startLms(getAmtUuidEx); return; } else { getAmtUuidEx(); }\r\n }\r\n}" ]
[ "0.76606715", "0.71967834", "0.7139077", "0.6988839", "0.66305053", "0.6586764", "0.6361851", "0.62254936", "0.6079622", "0.6056119", "0.6008889", "0.5999183", "0.594697", "0.58675075", "0.5865588", "0.5862116", "0.5846896", "0.5840436", "0.58371073", "0.5819352", "0.58148134", "0.5799495", "0.5778362", "0.5761594", "0.57591873", "0.5740852", "0.5729667", "0.5728292", "0.57277256", "0.5726947", "0.5719469", "0.5691336", "0.56878304", "0.56868243", "0.5683866", "0.5679832", "0.56603444", "0.5651829", "0.5642868", "0.5640408", "0.56356794", "0.5620779", "0.5618915", "0.5618915", "0.56052727", "0.560277", "0.56025016", "0.55999595", "0.55929595", "0.5591656", "0.5591656", "0.5591656", "0.5591656", "0.5588985", "0.5587642", "0.55860114", "0.55825436", "0.55825436", "0.5577735", "0.5575463", "0.5574381", "0.55736095", "0.55684197", "0.556597", "0.55631113", "0.5561133", "0.5559977", "0.5551306", "0.5544522", "0.5537633", "0.55375665", "0.553716", "0.55290854", "0.55285203", "0.551743", "0.5516725", "0.5507462", "0.5490629", "0.54899025", "0.5488568", "0.548752", "0.54867566", "0.54817694", "0.5481046", "0.5472624", "0.54723686", "0.5472074", "0.5471844", "0.54711866", "0.5464209", "0.54594624", "0.5459384", "0.54585147", "0.5451664", "0.54506314", "0.54493123", "0.5446195", "0.54408497", "0.5434952", "0.5428736" ]
0.846465
0
pushing an array to an array so I can get data loop through the array and place the data
function RedcomDatabaseTableConfigAdd() { var val; for (var i = 0; i < RedcomDatabaseTableConfigArr.length; i++) { val += "<tr>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][0]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][1]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][2]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][3]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][4]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][5]; val += "</td>"; val += "<td>"; val += RedcomDatabaseTableConfigArr[i][6]; val += "</td>"; val += "</tr>"; } return val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArr(arr, data) {\n arr.push(data);\n}", "addToArray(data){\n\t\tthis.userData.push(data);\n\t\tconsole.log(this.userData)\n\t}", "push(item){\n\n //Le indicamos a la data la longitud que estamos agregando ya que \n //Estamos creando un nuevo elemento por lo tanto nuestro array es mas largo\n \n this.data[this.length] = item;\n this.length++;\n return this.data;\n\n }", "function pushArr(value){\n var op = Math.round(Math.sqrt(Math.pow(earthRadius + value.avgAlt, 3) / GM) * 2 * Math.PI);\n delete value.avgAlt;\n value.orbitalPeriod = op;\n returnArr.push(value);\n }", "function pushResultsToArrays() {\n for(var i = 0; i < Product.allProducts.length; i++) {\n totalClicksArr.push(Product.allProducts[i].totalClicks);\n }\n for(var j = 0; j < Product.allProducts.length; j++) {\n allProductNames.push(Product.allProducts[j].stringName);\n }\n for(var k = 0; k < Product.allProducts.length; k++) {\n productBgColors.push(Product.allProducts[k].backgroundColor);\n }\n for(var l = 0; l < Product.allProducts.length; l++) {\n timesShownArr.push(Product.allProducts[l].timesShown);\n }\n}", "function MakeArray(data){\r\n shoesArray=[];\r\n shirtsArray=[];\r\n pantsArray=[];\r\n BigArray=[];\r\n for(i=0;i<data.length;i++){\r\n if(data[i].type=== \"shirts\"){\r\n shirtsArray.push(data[i]);\r\n }\r\n else if(data[i].type=== \"pants\"){\r\n pantsArray.push(data[i]);\r\n }\r\n else{\r\n shoesArray.push(data[i]);\r\n }\r\n }\r\n BigArray.push(shirtsArray);\r\n BigArray.push(pantsArray);\r\n BigArray.push(shoesArray);\r\n }", "function pushOntoArray(array, toPush) {\n // FILL THIS IN\n if ( typeof toPush == \"array\" ) {\n for (var i = 0; i < toPush.length; i++){\n array.push(toPush[i]);\n }\n }\n else {\n array.push(toPush);\n }\n }", "append(data) {\n this.array[this.length] = data\n this.length++\n }", "function addAllToArray(items,arr){for(var i=0;i<items.length;i++){arr.push(items[i]);}}", "function pushInfo(cb){\n datesArr.push(day);\n countsArr.push(count);\n cb();\n }", "function pushMaster (rawArray) {\n // var formattedArray = [];\n\n // For each element in raw 311 data, format it the way we want it.\n // for (var i = 0; i < rawArray.length; i++) {\n // formattedArray.push(objectifyTOOMaster(rawArray[i]));\n // }\n\n // Set formatted FB data as an array.\n // masterArray.push(formattedArray); // or .$add ?\n for (var i = 0; i < rawArray.length; i++) {\n // masterArray.$add(objectifyTOOMaster(rawArray[i]));\n masterRef.child(rawArray[i]['case_enquiry_id']).set(objectifyTOOMaster(rawArray[i]));\n }\n }", "function AddToArray(array, data, maxLenght)\n{\n\n array.push(data);\n\n if(array.length > maxLenght)\n {\n for(var i = 1; i < array.length - 1; i++)\n {\n for(var j = 0; j < array[i].length; j++)\n {\n array[i][j] = array[i + 1][j]\n }\n }\n array.pop()\n }\n}", "function pushDataArray(data, kata) {\n console.log(data)\n data.push(1, 20, 16)\n kata(data)\n return console.log(data)\n}", "function pushDataArr(data, arr) {\n\n let obj = data,\n dataArr = arr;\n\n if (obj != \"undefine\") {\n arr.push(obj);\n }\n\n return arr;\n\n\n\n}", "function addDataToArray(error, response, body) {\n if (!error) {\n costsData.push(body);\n getDataFromHarvest(); \t \n }else{\n config.printToSlack(\"Harvest Project Cost Error: \"+ error);\n } \n}", "appendMultipleIntervalls(intervallArray) {\n \n \n\n this.data.intervalls.push.apply(this.data.intervalls, intervallArray)\n\n return this.data.intervalls;\n }", "push(item) {\n array.push(item)\n }", "function AddData() {\n var i;\n for (i = 0; i < app.entries.length; i++) {\n myEmotionalData.push(app.entries[i].slider);\n myDateData.push(app.entries[i].date);\n }\n}", "function addtoArray() {\n //console.info(\"getRowCount\" + _self.backendApi.getRowCount());\n _self.backendApi.eachDataRow(function (rownum, row) {\n //console.info(\"rownum \" + rownum);\n lastrow = rownum;\n //do something with the row..\n\n });\n\n }", "function loadArray3(result){\n finaldata = generateData3(result); \n finalArrayData = new Array(); \n for(i=0;i<finaldata.length;i++){ \n finalArrayData.push(finaldata[i].value);\n } \n store2.loadData(finaldata); \n return finalArrayData;\n \n }", "function pushData(arr)\r\n{\r\n\tfor (var i = 0; i < rows.length; i++)\r\n\t{\r\n var cells = rows[i].split(\",\");\r\n console.log(\"cells \",cells);\r\n if (cells.length > 1) {\r\n arr.push(trimOut(cells[0]));\r\n arr.push(trimOut(cells[2]));\r\n }\r\n }\r\n\tconsole.log(\"pushdata call \");\r\n main(document.getElementById('graphContainer'));\r\n}", "function pushOntoArray(array, toPush) {\n if (Array.isArray(toPush)) {\n for (var i = 0; i < toPush.length; i++) {\n array.push(toPush[i]);\n }\n } else {\n array.push(toPush);\n }\n }", "function bookPush(book, array) {\n array.push(book)\n }", "push(data) {\n // the JS array.push add the data as the last element\n this.items.push(data);\n }", "runLoc(array){\n var holder = array;\n var array = [];\n for(var m = 0; m < 75; m++){\n var address = holder[m].addAddress1.replace(/'/g, \"\\-\");\n array.push({ id: holder[m].addID, street: address,\n city: holder[m].addCity, state: holder[m].addState, zip: holder[m].addZip });\n }\n //console.log(array);\n this.props.pushJob(array);\n }", "push(value) {\n this.array.push(value);\n }", "push(value) {\n this.array.push(value);\n }", "function DeclareArray() {\n arrayRiseSet = new Array(arrayInfo.length);\n arrayPressure = new Array(arrayInfo.length);\n arrayHum = new Array(arrayInfo.length);\n arrayClo = new Array(arrayInfo.length);\n arrayTempRange = new Array(arrayInfo.length);\n arrayTempAvg = new Array(arrayInfo.length);\n arrayRain = new Array(arrayInfo.length);\n arrayVis = new Array(arrayInfo.length);\n arrayWind = new Array(arrayInfo.length);\n results = [];\n}", "function createCitiesArray() {\n\tfor (var i = 0; i < $('.bay').length; i++) {\n\tcitiesOnMap.push($('.bay').eq(i).attr('data'));\n\t}\n\tfetchData(citiesOnMap);\n}", "function shearMyData() {\r\n for (let index = 0; index < AllProducts.length; index++) {\r\n clicks.push(AllProducts[index].clicks);\r\n views.push(AllProducts[index].views);\r\n\r\n }\r\n}", "function addDataToArray(error, response, body) {\n if (!error) {\n if(body.length > 0){\n timeData.push(body);\n }\n getDataFromHarvest(); \t \n }else{\n config.printToSlack(\"Harvest Logs Error: \"+ err);\n } \n}", "function organizeData(newArray, macro) {\n for (let i = 0; i < json.length; i++) newArray.push({\n label: json[i][\"name\"],\n y: json[i][macro]\n });\n console.log(newArray);\n }", "function updateArrays() {\n diceArray += result + ' ';\n totalArray.push(result);\n}", "stockData(arr) {\n\n }", "stockData(arr) {\n\n }", "function pusharray(particleCountType, array)\n{\n\t\tfor(var i = 0; i < particleCountType; i++)\n\t\tarray.push(new Particle());\n\n\t}", "function load_data(data){\n var resultArray = []\n for (var i = 0;i< data.length;i++) {\n var temp_arr = data[i];\n var a_point = new point(temp_arr[0],temp_arr[1]);\n\n resultArray.push(a_point);\n };\n return resultArray;\n}", "function loop2() {\n targetArray.push(...emptyArray);\n}", "function addToDataArray(){\n //variables for quantity, glaze, and type\n var checkQuantity = $('input[name=quantity]:checked').val();\n var checkGlaze = $('input[name=glazing]:checked').val();\n var checkType = $('.typeBun').text();\n \n //new instance of Bun with quantity, glaze, and type variables\n var everyBun = new Bun(checkQuantity, checkGlaze, checkType);\n \n //add instance to dataArray\n dataArray.push(everyBun);\n \n //add dataArray to local storage\n localStorage.setItem(\"dataArray\", JSON.stringify(dataArray)); \n }", "function pushData() {\r\n for (let j = 1; j < questions.length + 1; j++) {\r\n var data = $(\"input[name=inlineRadioOptions\" + [j] + \"]:checked\").val();\r\n userInput.data.push(data);\r\n }\r\n }", "function loopingData1() {\n //create a variable named 'saleDates' which should be initialized as an empty array.\n let saleDates = [];\n\n //write a for loop to iterate over sales data for store3, and uses the .push() method to add the value stored in the [date] key for each index of the array to our 'saleDates' variable\n for (let i = 0; i < store3.length; i++) {\n saleDates.push(store3[i]['date']);\n }\n\n //return the now populated 'saleDates' variable\n return saleDates;\n}", "function pushArray() {\n\t\t\tfor (var i = 0; i<friends.length; i++) {\n\t\t\t\tfor (var x = 0; x<friends[i].scores.length; x++) {\n\t\t\t\t\ttotal += parseInt(friends[i].scores[x]);\n\t\t\t\t}\n\t\t\t\ttotalArray.push(total);\n\t\t\t\ttotal = 0;\n\t\t\t}\n\t\t\tconsole.log(totalArray);\n\t\t\tdifference();\n\t\t}", "function arrayCreation (){\n for(var i = 0; i < images.length; i++){\n itemLabels.push(images[i].name);\n itemData.push(images[i].clicked);\n if(i < 5){\n pieLabels.push(images[i].name);\n pieData.push(images[i].calculatePercent());\n }\n }\n}", "function createArray(array, key){\n\t\tvar callArray = [];//creating a variable which is an empty array\n\n\t\tfor(var i = 0; i < array.length; i++){//using a for loop to loop through the array.\n\t\t\tcallArray.push(array[i][key]);//adding a new element to the array using the push method\n\t\t}\n\t\treturn callArray;//returns the array\n\t}", "push(item) {\r\n this.array[this.array.length] = item;\r\n }", "function pushquestion() {\n for (var i = 0; i < Questions.length; i++) {\n questionarray.push(Questions[i]);\n }\n }", "function pushQuestionsAndAnswersArr(arr) { \n for(let i = 0; i < arr.length; i++) {\n questionsAndAnswersArr.push(new QuestionsAndAnswers(arr[i][0] , arr[i][1], arr[i][2], arr[i][3], arr[i][4]));\n }\n}", "function appendData() {\n allButtonData.push(buttonData);\n buttonData = [];\n}", "function addWeekToArray()\n{\n selectedSlotsArray.push([]);\n for (let i=0; i<=839; i++)\n { \n selectedSlotsArray[week].push(false); \n } \n daysPassedArray.push([]);\n for (let i=0; i<=7; i++)\n { \n daysPassedArray[week].push(false); \n } \n}", "array_add_items(from_array, to_array) {\n for (let i = 0; i < from_array.length; i++) {\n to_array.push(from_array[i]);\n }\n }", "function findData() {\n return myArray.map(callDataController);\n }", "fillTheArray(prgType) {\n // MARK: Pagination variables\n var index = 0;\n var pageIndex = 0;\n this.state.size = 0;\n var series = [];\n JsonData.entries.map((data, i) => {\n if (data.programType === prgType && data.releaseYear >= \"2010\") {\n this.state.size++;\n series[index] = data;\n index++;\n if (index == 20) {\n index = 0;\n this.state.seriesEntries[pageIndex] = Object.values(series).sort(function (a, b) {\n if (a.title > b.title) {\n return 1;\n }\n if (b.title > a.title) {\n return -1;\n }\n return 0;\n });\n pageIndex++;\n }\n }\n });\n }", "function createArray(dataset) {\n\t\tvar lastItem = dataset[0].Release,\n\t\t\tcount = 0,\n\t\t\tnewArray = [],\n\t\t\tdataLength = dataset.length;\n\t\tfor ( var i = 0; i < dataLength; i++) {\n\t\t\tif (dataset[i].Release != lastItem || i == dataset.length - 1) {\n\t\t\t\tnewArray.push({\n\t\t\t\t\tSong : lastItem,\n\t\t\t\t\tCount : count,\n\t\t\t\t\tTime : dataset[i][\"play time in minutes\"],\n\t\t\t\t\tDate : Math.round(new Date().getFullYear() - (i*0.2)),\n\t\t\t\t\tId: i\n\t\t\t\t});\n\t\t\t\tcount = 0;\n\t\t\t}\n\t\t\tcount++;\n\t\t\tlastItem = dataset[i].Release;\n\t\t}\n\t\treturn newArray;\n\t}", "function copyAndPushArr(array, value) {\n let result = arr.slice(0, array.length);\n result.push(value);\n return result;\n}", "function writeTankData(myTankArray) {\n\n //should trigger automatically to search the player stats based on the found account_id//\n var type = \"vehicle\"\n var arg = \"\"; //no need for an accountid\n getData(type, arg, function(data) {\n console.log(data)\n \n data = data.data;\n var TankArray = [];\n Object.keys(data).forEach(function(key) {\n var Name = data[key].name;\n var Nation = data[key].nation;\n var Type = data[key].type;\n var Level = data[key].level;\n var Tank_id = data[key].tank_id; \n TankArray.push({\n \"Name\": Name,\n \"Nation\":Nation,\n \"Type\":Type,\n \"Level\": Level,\n \"Tank_Id\": Tank_id\n });\n });\n console.log(TankArray)\n ConcatArray(TankArray, myTankArray);\n return false;\n });\n}", "function addToArray(array) {\n return array.concat(0);\n}", "function addToArray(array) {\n return array.concat(0);\n}", "function addingRows(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createDescripRow(data[i]));\n }\n // console.log(rowsToAdd);\n }", "function pushArr(){\n var arr = [];\n for(var i = 0; i < 50; i++){\n if(i % 2 == 1){\n arr.push(i);\n }\n }\n console.log(arr); // or: return arr;\n}", "function makeData(md,x) {nextData.push({md:md});}", "function pushIntoArray(typeName, array) {\n\tif (core.destroyed == false) {\n\t\tlet randomAngle = random(TWO_PI);\n\t\tlet randomX = core.position.x + sin(randomAngle) * width;\n\t\tlet randomY = core.position.y + cos(randomAngle) * height;\n\t\tarray.push(\n\t\t\tnew Ball(randomX, randomY, {\n\t\t\t\tattacker: typeName == \"attacker\",\n\t\t\t\thealer: typeName == \"healer\",\n\t\t\t\tvelocity: p5.Vector.random2D(),\n\t\t\t\tacceleration: p5.Vector.random2D(),\n\t\t\t\tendLocation: core.position,\n\t\t\t\tparticlesArray: particles,\n\t\t\t\tattackerLife: attackerTotalLife,\n\t\t\t\tstrength: attackerStrength,\n\t\t\t})\n\t\t);\n\t}\n}", "function updateArray()\n{\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: \"/stats\",\n\t\tdataType: \"text\",\n\t\tsuccess: function (data, textStatus, jqXHR) {\n\t\t\tvar tmp = JSON.parse(data);\n\t\t\tvar tmpp = {};\n\t\t\tif (vdatap.length != 0) {\n\t\t\t\tif (vdatap[0]['timestamp'] == tmp['timestamp']) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (v in tmp) {\n\t\t\t\tif (tmp[v]['value'] != undefined) {\n\t\t\t\t\ttmp[v]['value'] = parseInt(tmp[v]['value']);\n\t\t\t\t\ttmpp[v.replace(\"MAIN.\",\"\")] = parseInt(tmp[v]['value']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvdata.unshift(tmp);\n\t\t\tvdatap.unshift(tmpp);\n\t\t\tcompressData();\n\t\t\tupdateHitrate();\n\t\t\tif (reconstructTable) {\n\t\t\t\tconstructTable();\n\t\t\t\treconstructTable = false;\n\t\t\t\tsparklineDataHistory = {};\n\t\t\t} else {\n\t\t\t\tupdateTable();\n\t\t\t}\n\t\t}\n\t})\t\n}", "function pushDataToArray() {\n var inputText = selectTip.val();\n if (inputText.length <= 0) return;\n inputText = inputText.toLowerCase();\n\n guessedLettersArr.push(inputText);\n selectTip.val(\"\");\n\n console.log(guessedLettersArr);\n}", "function data(){\n return [1,2,3,4,5]; \n}", "function data(){\n return [1,2,3,4,5]; \n}", "generateData() {\n\t\tvar data = [];\n\t\tthis.chunk.forEach(function(row, i, arr) {\n\t\t\tdata.push([]);\n\t\t\trow.forEach(function(item, j, rarr) {\n\t\t\t\tdata[i].push(item.generateData());\n\t\t\t});\n\t\t});\n\t\treturn data;\n\t}", "function addItemToArray(item, array) {\n utils.firstTime();\n array[array.length] = item;\n utils.lastTime();\n}", "appendGDAXData(gdaxArray) {\n\n if ( gdaxArray[0].length == undefined || gdaxArray[0].length != 6){\n throw new Error(\"Input needs to be a 2d Array like [[1,2,3,4,5,6], [7,8,9,10,11,12]] or [[1,2,3,4,5,6]]\");\n }\n\n function contains(array, obj) {\n var i = array.length;\n while (i--) {\n if (array[i] == obj) {\n return true;\n }\n }\n return false;\n }\n \n var times = jsonQuery('intervalls.time', {data: this.data}).value;\n\n for( var i = 0; i < gdaxArray.length; ++i ) {\n if (times.length == 0 || contains(times, gdaxArray[i][0]) == false){\n this.data.intervalls.push({index: this.data.intervalls.length ,time: gdaxArray[i][0], low: gdaxArray[i][1], high: gdaxArray[i][2], open: gdaxArray[i][3], close: gdaxArray[i][4], volume: gdaxArray[i][5]});\n }else{\n throw new Error(\"You were trying to add a time value that already exists: time = \" + gdaxArray[i][0]);\n }\n \n \n }\n\n return this.data.intervalls;\n }", "function push(fromArray, toArray){\n for(let i=0, len=fromArray.length; i<len; i++){\n toArray.push(fromArray[i]);\n }\n return toArray;\n}", "function addSelectedData(data) {\n\n for (var i = 0; i < data.length; i++) {\n selectedData[selectedDataIndex] = data[i];\n selectedDataIndex += 1;\n }\n}", "function addmessagestoarray(data) {\n if (filteredmessages.length !== 0) {\n messagestore = filteredmessages\n }\n messagestore.push(data)\n setchats([messagestore])\n scrollmessages();\n }", "getOrganizedArr() {\n this.dayArr = [[],[],[],[],[],[],[]];\n this.items.forEach(item => {\n this.placeEventIntoDayArray(item);\n });\n this.dayArr = this.sortDayArr(this.dayArr);\n return this.dayArr;\n }", "toArray() {\n let arr = [];\n this.map((data) => { arr.push(data); return data});\n return arr;\n }", "function populate_games_array_RAWG(data) {\r\n for(var i=0; i<data.results.length; i++) {\r\n games.push(data.results[i].id);\r\n genres[i] = \"\";\r\n for(var j=0; j<data.results[i].genres.length-1; j++) {\r\n genres[i]+=data.results[i].genres[j].name;\r\n genres[i]+=\", \";\r\n }\r\n genres[i]+=data.results[i].genres[j].name;\r\n }\r\n first();\r\n}", "ricreaArrJson(arrJson){\n\t\tarrJson.map(json => {\n\t\t\tthis.newData.push(this.ricreaJson(json));\n\t\t});\n\t\treturn this.newData;\n\t}", "function gotData(data) {\n console.log('retrieveSong gotData');\n for (var i = 0; i < 5; i++) {\n var tempArray = [];\n lastKey[i] = Object.keys(data.val()[i]).length;\n console.log('retrieveSong gotData for1');\n for (var j = 0; j < 3; j++) {\n var randID = Math.floor(random(lastKey[i]));\n var resultURI = data.val()[i][randID][0];\n var randomFreq = Math.floor(random(10)) * 10;\n var tempArray2 = [];\n tempArray2.push(resultURI, randomFreq);\n tempArray.push(tempArray2);\n console.log('retrieveSong gotData for2');\n }\n foundSongs.push(tempArray);\n }\n // document.getElementById(\"spotifyPreviewB\").src = 'https://open.spotify.com/embed?uri=' + resultURI;\n}", "function addToArray(array) {\n return array.concat(10); // concat creates a copy of the array, then mutates that copy\n}", "function getData(arr, data, data_id){\r\n for (var i = 0; i < data.length; i++){\r\n arr[i][0] = Date.parse(data[i][13].value) + (2*60*60*1000);\r\n arr[i][1] = data[i][data_id].value;\r\n }\r\n\r\n}", "function AddToArray(inputValue) {\n tagArray.push(inputValue);\n }", "function pushOntoArray(array, toPush) {\n // FILL THIS IN\n if (typeof toPush === 'string' || typeof toPush === 'number' || typeof toPush === 'boolean') {\n array.push(toPush);\n }\n else if (Array.isArray(toPush)) {\n array.concat(toPush);\n }\n\n return array;\n }", "function makeVehicleList(data) {\n self.dataArray([]);\n data.forEach((datum) => {\n self.dataArray.push(datum);\n });\n }", "_populateGuestsArray() {\n const guestData = this.state.guestRawData.data;\n for(let i = 0; i < guestData.length; i++) {\n const guest = guestData[i];\n this.state.guestTableData.push(\n new Guest(guest.id, guest.first_name, guest.last_name, guest.email, guest.city,\n guest.visit_count, guest.total_spend, guest.allow_marketing.toString(), guest.tags));\n }\n }", "function makeData(md,x) {nextData.push({md});}", "function passToArray(savedSearch) {\n savedSearchArray.push(savedSearch);\n}", "function arraypush(thearray,value) {\r\n\tthearray[ getarraysize(thearray) ] = value;\r\n}", "function getData(data){\r\n//Creates a variable oID which stores all of the relevent IDs of the items that I will use in the program\r\n var oID = [554,555,556,557,558,559,560,561,562,563,564,449,436,444,440,447,442,438];\r\n//A for-next loop that populates all of the values in the arrays with the relevent data, based on the ID of the item (stored in oID)\r\n for (var i = 0; i< 18;i++){\r\n itemID[i] = oID[i];\r\n itemName[i] = data[itemID[i]].name;\r\n itemPrice[i] = data[itemID[i]].buy_average;\r\n itemQuantity[i] = data[itemID[i]].overall_quantity;\r\n\r\n }\r\n }", "function pushAll(array, input) {\n var length = input.length;\n for (var i = 0; i < length; ++i) {\n array.push(input[i]);\n }\n}", "function obtenerVectoresPesos() {\n myArray = inicializarArr(attributesGlobal.length);\n for (var i = 0; i < attributesGlobal.length; i++) { \n my_id = \"arq_tbody_id_\"+(i);\n mv = calcularVectorPesosAPartirDelTbody(document.getElementById(my_id));\n for (var j = 0; j < mv.length; j++) {\n // console.log(mv[j]);\n //w = myArray[j] + mv[j];\n myArray[j].push(mv[j]); \n };\n }\n return myArray;\n}", "function push(array, newArray) {\n for(var i = 0; i < array.length; i++) {\n newArray.push(array[i]);\n }\n return newArray;\n}", "function DeclareArray() {\n arrayTemp = [];\n arrayPressure = [];\n arrayWind = [];\n arrayRain = [];\n arrayDate= [];\n}", "function steamrollArray(arr) {\n var newArr = [];\n // var arrCopy = [...arr];\n var arrLength = arr.length;\n var n = 0;\n while (arr.length > 0) {\n var val = arr.shift();\n if (Array.isArray(val)) { \n arr = val.concat(arr);\n } else {\n newArr.push(val);\n }\n }\n console.log(newArr);\n return newArr;\n }", "function addAllToArray(items, arr) {\n for (var i = 0; i < items.length; i++) {\n arr.push(items[i]);\n }\n}", "function addAllToArray(items, arr) {\n for (var i = 0; i < items.length; i++) {\n arr.push(items[i]);\n }\n}", "function append (array, toAppend) {\n for (let i = 0; i < toAppend.length; i += 1) {\n array.push(toAppend[i])\n }\n}", "function pushDataToArray(dataArray, newData){\n if(newData != null && newData != undefined && newData.toString() != \"\"){\n dataArray.push(newData.toString());\n }else{\n dataArray.push(\"Sin datos\");\n }\n }", "function appendSample(data){\n channelData = []\n console.log(active);\n for (i = 0; i < 8; i++) {\n if (active[i] == 1) {\n channelData[i] = data['data']['data'][i];\n }\n else {\n channelData[i] = null;\n }\n }\n\n\n sampleToPush = {time: data['time'],\n channel1: channelData[0],\n channel2: channelData[1],\n channel3: channelData[2],\n channel4: channelData[3],\n channel5: channelData[4],\n channel6: channelData[5],\n channel7: channelData[6],\n channel8: channelData[7]\n }\n samples.push(sampleToPush);\n}", "function update_array()\n{\n array_size=inp_as.value;\n generate_array();\n}", "push(value) {\n this.data.unshift(value);\n }", "function collectArr() {\n checkedArr = {\n id: arrId,\n material: materialCheck,\n size: sizeCheck,\n price: materialCheckPrice*(sizeCheck/100),\n }\n}", "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 namesArray\n for (let i = 0; i < data.length; i++){\n namesArray.push(new Circle(data[i].Name, data[i].Answer));\n circles.push(new Circle());\n }\n\n}", "function addElements(array){\n // For every element of array \n for (var element of array) {\n // If element is not an array - push onto newArray\n if (!Array.isArray(element)){\n newArray.push(element);\n } else {\n // If element is array call addElements and to push it's elements onto newArray\n addElements(element);\n }\n }\n }" ]
[ "0.70350814", "0.6666215", "0.6659681", "0.66447824", "0.66323644", "0.65076447", "0.6484907", "0.64477545", "0.64082146", "0.63930756", "0.63782895", "0.6371372", "0.6360576", "0.6322531", "0.63140213", "0.62929016", "0.6281351", "0.62523925", "0.62463075", "0.6218679", "0.61868435", "0.6172936", "0.61471796", "0.61441016", "0.61439854", "0.61321616", "0.61321616", "0.61266553", "0.61184746", "0.6111397", "0.6097572", "0.6089281", "0.6079207", "0.6069077", "0.6069077", "0.6042599", "0.6030451", "0.60179234", "0.60166067", "0.60164666", "0.6010618", "0.5983934", "0.5982737", "0.5979564", "0.5957107", "0.595636", "0.5955375", "0.5934602", "0.59179145", "0.5896564", "0.5894684", "0.58845466", "0.5877274", "0.5873551", "0.5871368", "0.585926", "0.585926", "0.58513546", "0.584785", "0.58466667", "0.58412707", "0.58374166", "0.58330846", "0.5824618", "0.5824618", "0.58242124", "0.58169895", "0.58162886", "0.5814868", "0.5814769", "0.5811587", "0.5808718", "0.5807307", "0.5802949", "0.5802483", "0.58005136", "0.5799118", "0.5791279", "0.5789472", "0.5786506", "0.5785812", "0.5782149", "0.5779722", "0.577954", "0.5773012", "0.57729846", "0.5771801", "0.5761743", "0.5761353", "0.57596815", "0.5752258", "0.57497704", "0.57497704", "0.57456875", "0.5745247", "0.57427305", "0.5742184", "0.57379466", "0.57373726", "0.57329106", "0.57311547" ]
0.0
-1
> import as Util from './coba.js'; const Util = await import('./coba.js'); Util.DashAgentOnline();
function chekct() { const btn = document.querySelector("input[name=cek]:checked"); console.log(btn.getAttribute('data-reply')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function bajar() {\n await importar();\n inicializar();\n obtener();\n}", "import() {\n }", "async function run() {\n const land = require('./land_mark.js');\n // const data = await huy();\n // console.log(data); // will print your data\n // return data;\n return\n}", "async function startUnstable(){\n\n}", "async function artdecoWebsite() {\n console.log('@artdeco/website called');\n}", "static LoadFromFileAsync() {}", "async function initializeExports() {\n if (Module.getAssemblyExports !== undefined) {\n globalThis.samplesNetExports = await Module.getAssemblyExports(\"Uno.Wasm.StaticLinking\");\n }\n}", "async function loadScripts() {\n await getDisplayData();\n}", "async function load() {\n await loadWeb3();\n window.contract = await loadContract();\n await getMyFiles();\n window.contract.defaultAccount = await getCurrentAccount();\n console.log(window.contract.defaultAccount);\n}", "function SeamonkeyImport() {}", "async function main () {\n // after a mandatory initialisation, you can call any exposed API\n await calc.init()\n console.log(`Result is: ${await calc.add(10, 5)}`)\n}", "load() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () { });\n }", "async function fun1() {\n await window.ethereum.request({\n method: \"eth_requestAccounts\",\n });\n}", "async function callClient(){\r\n console.log(\"Waiting for the project....\");\r\n let firstStep = await willGetProject();\r\n let secondStep = await showOff(firstStep);\r\n let lastStep = await willWork(secondStep);\r\n console.log(\"Completed and deployed in seatle\");\r\n}", "async function callStatic(func, args) {\nconst contract = await client.getContractInstance(contractSource, {contractAddress});\n const calledGet = await contract.call(func, args, {callStatic: true}).catch(e => console.error(e));\n const decodedGet = await calledGet.decode().catch(e => console.error(e));\n return decodedGet;\n}", "async startup() {\n }", "async function loadChromiumResources() {\n await import('/resources/chromium/contacts_manager_mock.js');\n}", "function SauceLabsUac() {}", "importFn(path) {\n return SynchronousPromise.resolve().then(() => {\n const moduleExports = this.csfExports[path];\n if (!moduleExports) throw new Error(`Unknown path: ${path}`);\n return moduleExports;\n });\n }", "static async method(){}", "function bitcoinScrape(){\n //Create child process\n const scrape = execSync('python3 ./bitcoin/scrape.py').output\n}", "async load () {}", "async function main() {\n const obj = await readFromFile('./cards.json');\n _80f‍.g.console.log(obj);\n}", "async startup() { }", "async startup() { }", "async function mainFunction() {\n try {\n const addr = \"bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7\"\n console.log(`addr: ${addr}`)\n\n const bchData = await myLib.getBchData(addr)\n\n console.log(`bchData: ${JSON.stringify(bchData,null,2)}`)\n } catch(err) {\n console.error(`Error in main program: `, err)\n }\n}", "componentDidMount() {\n this.importBDD();\n }", "async function callStatic(func, args) {\r\n //Create a new contract instance that we can interact with\r\n const contract = await client.getContractInstance(contractSource, {\r\n contractAddress\r\n });\r\n \r\n const calledGet = await contract.call(func, args, {\r\n callStatic: true\r\n }).catch(e => console.error(e));\r\n \r\n const decodedGet = await calledGet.decode().catch(e => console.error(e));\r\n \r\n return decodedGet;\r\n}", "async function fetchUser() {\n return \"abc\";\n}", "function getComponent() {\n // 异步模块\n return import( /* webpackChunkName:\"test\" */ './test.js').then(({ default: _ }) => {\n var element = document.createElement('div');\n element.innerHTML = _.join(['Dell', 'Lee'], '-');\n return element;\n })\n}", "async function cobaAsync() {\n\n try {\n const coba = await cobaPromise();\n console.log(coba);\n } catch (error) {\n console.error(error);\n }\n}", "async function bar(){\r\n\tconsole.log(\"bar\")\r\n}", "async function fetchAsync(func) { // eslint-disable-line no-unused-vars\r\n const response = await func();\r\n return response;\r\n}", "async function main() {\n let fileName = await crawlExchange('coinmarketcap.com');\n await calculateStatistic(fileName, (exchanceList) => exchanceList.data);\n}", "async execute() {\n let ServerConstructor;\n\n try {\n const exported = await import(this.serverPath);\n ServerConstructor = exported.default;\n } catch (e) {\n e.message = `Failed to load the esm server: ${e.message}`;\n throw e;\n }\n\n const server = new ServerConstructor();\n await server.load();\n\n process.send('loaded');\n }", "async function StartListaSCCD() {\n await loadAPI('GET','',api_list_sccd,{}).then((ret)=>{\n lista_SCCD(ret)\n })\n return 1\n}", "async function main() {\n await tools.loadWallet(await tools.loadFile(process.env.WALLET_LOCATION));\n console.log(\"Wallet loaded\");\n\n console.log(\"Deploying NFT\");\n const deployedTxId = await deployNFT()\n await checkTxConfirmation(deployedTxId);\n\n console.log(\"Burning Koii\");\n const burnTxId = await tools.burnKoi(\n ATTENTION_CONTRACT,\n \"nft\",\n deployedTxId\n );\n await checkTxConfirmation(burnTxId);\n\n console.log(\"Migrating content\");\n const migrateTxId = await tools.migrate(\n ATTENTION_CONTRACT\n );\n await checkTxConfirmation(migrateTxId);\n}", "async function sicronizar() {\n await tccpoo.sync();\n}", "async exec (args, { Compose }) {\n // Code goes here\n }", "async function main() {\n // Buidler always runs the compile task when running scripts through it.\n // If this runs in a standalone fashion you may want to call compile manually\n // to make sure everything is compiled\n // await bre.run('compile');\n\n // We get the contract to deploy\n const Greeter = await ethers.getContractFactory('Greeter')\n const greeter = await Greeter.deploy('Hello, Buidler!')\n\n await greeter.deployed()\n\n console.log('Greeter deployed to:', greeter.address)\n}", "async function main() {\n const userInfo = await getUserInfo('12');\n console.log(userInfo);\n\n const userAddress = await getUserAddress('12');\n console.log(userAddress);\n\n console.log('ceva4');\n}", "async init() {\n\n }", "function importTasksHandler(obj) {\n importBox();\n}", "async function doSomething() {\n await fetch('http://localhost:5000/')\n }", "async function miFuncionConPromesa ()\r\n{\r\n return 'saludos con promesa y async';\r\n}", "async init () {\n this.bridge = await this._getBridge()\n this.lamps = await this._getLamps()\n this.modules = await this._loadModules()\n }", "async function loadExtraScripts() {\n}", "async function miFuncionConPromesa(){\n return \"Saludos con promeso y async\";\n}", "async function callStatic(func, args) {\n //Create a new contract instance that we can interact with\n const contract = await client.getContractInstance(contractSource, {\n contractAddress\n });\n //Make a call to get data of smart contract func, with specefied arguments\n console.log(\"Contract : \", contract)\n const calledGet = await contract.call(func, args, {\n callStatic: true\n }).catch(e => console.error(e));\n //Make another call to decode the data received in first call\n console.log(\"Called get found: \", calledGet)\n const decodedGet = await calledGet.decode().catch(e => console.error(e));\n console.log(\"catching errors : \", decodedGet)\n return decodedGet;\n}", "function testImportThreadAppraisal(){\n Reporting.importThreadAppraisal(\"C:/Users/Diaman/Desktop/Appraisal\",\"appraisal.csv\");\n}", "async function importLabors() {\n\tconst module = game.modules.get(\"<module_name>\");\n\tlet scenes = null;\n\tlet actors = null;\n\n\tfor ( let p of module.packs ) {\n\t\tconst pack = game.packs.get(\"<module_name>.\"+p.name);\n\t\tif ( p.entity !== \"Playlist\" ) await pack.importAll();\n\t\telse {\n\t\t\tconst music = await pack.getContent();\n\t\t\tPlaylist.create(music.map(p => p.data));\n\t\t}\n\t\tif ( p.entity === \"Scene\" ) scenes = game.folders.getName(p.label);\n\t\tif ( p.entity === \"Actor\" ) actors = game.folders.getName(p.label);\n\t}\n\n\t// Re-associate Tokens for all scenes\n\tconst sceneUpdates = [];\n\tfor ( let s of scenes.entities ) {\n\t\tconst tokens = s.data.tokens.map(t => {\n\t\t\tconst a = actors.entities.find(a => a.name === t.name);\n\t\t\tt.actorId = a ? a.id : null;\n\t\t\treturn t;\n\t\t});\n\t\tsceneUpdates.push({_id: s.id, tokens});\n\t}\n\tawait Scene.update(sceneUpdates);\n\n\t// Activate the splash page\n\tconst s0 = game.scenes.getName(\"The <module_name>\");\n\ts0.activate();\n\n\t// Display the introduction\n\tconst j1 = game.journal.getName(\"A1. Adventure Introduction\");\n\tif ( j1 ) j1.sheet.render(true, {sheetMode: \"text\"});\n\treturn game.settings.set(\"<module_name>\", \"imported\", true);\n}", "async function foo() {\n return 1\n}", "async function start_agent() {\n logger.info('Starting aca-py agent.')\n logger.info(get_agent_args());\n agent = exec(\"aca-py start \" + get_agent_args(),\n function (error, stdout, stderr) {\n if (error) {\n logger.info('Starting aca-py agent failed.')\n logger.info(error.stack);\n console.log(\"Error code: \" + error.code);\n console.log(\"Signal received: \" + error.signal);\n }\n }\n );\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(agent), 1000);\n });\n \n let result = await promise;\n logger.info(\"start aca-py agent completed\");\n return result;\n }", "async function main() {\n // create a new actionhero process\n const app = new actionhero_1.Process();\n // handle unix signals and uncaught exceptions & rejections\n app.registerProcessSignals(exitCode => {\n process.exit(exitCode);\n });\n // start the app!\n // you can pass custom configuration to the process as needed\n await app.start();\n}", "function AeUtil() {}", "async function main () {\n // Create a runtime instance\n const runtime = await loc.createRuntime()\n\n // Load my custom components\n // await runtime.addCoreComponents()\n await runtime.addComponents(`${__dirname}/components`)\n\n // Load design file\n console.log(`Downloading design...${DESIGN}`)\n const design = await fetch(DESIGN).then(res => res.json())\n console.log('done')\n\n // Start the engine\n await runtime.run(design)\n\n // Start monitor on our design, needed for design ui to connect to the app\n if (MONITOR) {\n const logs = `${__dirname}/tmp`\n\n // Make sure logs directory exist\n if (!fs.existsSync(logs)) {\n fs.mkdirSync(logs)\n }\n\n await loc.start(runtime, {\n logs\n })\n }\n\n // The monitor is live at...\n console.log(`Server live at : http://localhost:${process.env.PORT || 5000}/_system`)\n}", "async syncToRemote() {\n __WEBPACK_IMPORTED_MODULE_3__utility_OfflineUtility__[\"a\" /* default */].syncToRemote();\n }", "async function myFunc() {\n return 'Hello';\n}", "async function test() {}", "async function callStatic(func, args) {\n //Create a new contract instance that we can interact with\n const contract = await client.getContractInstance(contractSource, {contractAddress});\n //Make a call to get data of smart contract func, with specefied arguments\n console.log(\"Contract : \", contract)\n const calledGet = await contract.call(func, args, {callStatic: true}).catch(e => console.error(e));\n //Make another call to decode the data received in first call\n console.log(\"Called get found: \", calledGet)\n const decodedGet = await calledGet.decode().catch(e => console.error(e));\n console.log(\"catching errors : \", decodedGet)\n return decodedGet;\n}", "async function main () {\n // initialisation isn't strictly required (it will be done at first call), but consistent with local mode\n // await calc.init()\n console.log(`Result is: ${await calc.add(10, 5)}`)\n}", "async function orangesFunction() {\r\n\r\n console.log(\"Starting Oranges Function\");\r\n\r\n // VV Trigger Java app.get Handler With\r\n // VV The Path \"/tester\"\r\n let response = await fetch(URL + \"tester\", { } );\r\n\r\n // VV Obtains Data From Java Through ctx.json(<whateverData>);\r\n // VV In This Case We Obtain A String\r\n let data = await response.json();\r\n\r\n console.log(data);\r\n console.log(\"\\n\");\r\n\r\n}", "async function main() {\n\n getUser(\"test1\");\n\n}", "async import(path) {\n this.seq = this.seq.then(() => {\n debug(`Importing %s`, path);\n return import(`${path}?bust=${Date.now()}`);\n });\n\n return this.seq;\n }", "async function testLib() {\n var initC = await initContract();\n var callOne = await makeRequest(\"ShipmentDelivered\");\n var callTwo = await makeRequest(\"ShipmentDelivered\");\n console.log(initC, callOne, callTwo)\n}", "async function main() {\n const User = require('./src/models/User');\n const db = require('./src/db/Database');\n const me = new User({name: 'Aleksandar', dateOfBirth: 1993});\n // await db.create(me);\n // const readUser = await db.findUser(1603392402201);\n // console.log(readUser);\n\n}", "async function main() {\n try {\n const user = await getUser();\n const status = await login(user)\n const page = await showPage(status);\n console.log(user, status, page)\n }\n catch (err) {\n console.log(err)\n }\n}", "async function run() {\n await init();\n}", "function CCUtility() {}", "async init () {}", "async function callStatic(func, args) {\r\n //Create a new contract instance that we can interact with\r\n const contract = await client.getContractInstance(contractSource, {contractAddress});\r\n //Make a call to get data of smart contract func, with specefied arguments\r\n const calledGet = await contract.call(func, args, {callStatic: true}).catch(e => console.error(e));\r\n //Make another call to decode the data received in first call\r\n const decodedGet = await calledGet.decode().catch(e => console.error(e));\r\n\r\n return decodedGet;\r\n}", "async function callStatic(func, args) {\r\n //Create a new contract instance that we can interact with\r\n const contract = await client.getContractInstance(contractSource, {contractAddress});\r\n //Make a call to get data of smart contract func, with specefied arguments\r\n const calledGet = await contract.call(func, args, {callStatic: true}).catch(e => console.error(e));\r\n //Make another call to decode the data received in first call\r\n const decodedGet = await calledGet.decode().catch(e => console.error(e));\r\n\r\n return decodedGet;\r\n}", "static LoadFromMemoryAsync() {}", "async function getComponent() {\n const { join } = await import(/* webpackChunkName:\"app\", webpackPrefetch: true */ './app.js');\n const element = document.createElement('div');\n element.innerHTML = join(['dell', 'lee'], '-');\n return element;\n}", "async function func() {\n return 1;\n}", "constructor(fastify) {\n let { STAGE } = process.env;\n this.modules = require(\"../models/modules\")(fastify[`db.${STAGE}cardplay`]);\n // const self = this;\n // (async function () {\n // await self.user.sync({ alter: true });\n // })();\n }", "async function main() {\n\n if (dotenv.error) {\n console.log( \"New install: no configuration found, or script not being run in the root directory\" );\n process.exit();\n }\n\n mysql.config({\n host: config.MYSQL_HOST,\n database: process.env.MYSQL_DATABASE||config.MYSQL_DATABASE,\n user: config.MYSQL_USER,\n password: config.MYSQL_PASSWORD\n });\n\n\t// Now get data from soaringspot\n soaringSpot();\n\n console.log( \"Background download from soaring spot enabled\" );\n setInterval( function() {\n soaringSpot();\n }, 5*60*1000 );\n}", "async function fetchAPI(token){\n let a=null;\n try{ \n console.log(\"-1--\"); \n const response=await window.fetch(`${URL}/verma/account/${token}`,{\n method: 'GET'\n });\n console.log(\"-2--\",response);\n const account= await response.json();\n console.log(\"-3--\");\n console.log(\"accounts---\",account);\n console.log(account.type);\n a=account;\n console.log(\"a in accounts\",a);\n }\n catch(error){\n console.log(error);\n }\n return a;\n}", "async function startFlow(){\n try{\n await helper.initialize();\n await helper.checkBalance();\n await helper.approveSCContract();\n await helper.topup();\n await helper.checkBalance();\n await helper.setPending();\n await helper.setResult();\n await helper.getResult();\n await helper.setFinished();\n await helper.checkBalance();\n process.exit(0);\n }catch(err){\n console.error(err);\n process.exit(1);\n }\n}", "async function main() {\n // create a new actionhero process\n const app = new index_1.Process();\n // handle unix signals and uncaught exceptions & rejections\n app.registerProcessSignals((exitCode) => {\n process.exit(exitCode);\n });\n // start the app!\n // you can pass custom configuration to the process as needed\n await app.start();\n}", "async function main() {\n\n const articleId = getArticleId();\n console.log(articleId);\n\tconst teddy = await getArticleContent(articleId);\n console.log(teddy);\n displayArticle(teddy);\n testOptions(teddy);\n}", "async script (func, args) {\n debug('scripting page', func)\n if (!Array.isArray(args)) {\n args = [args]\n }\n\n return new Promise(resolve => {\n this.pageContext.evaluate((stringyFunc, args) => {\n var invoke = new Function(\n 'return ' + stringyFunc\n )()\n return invoke.apply(null, args)\n },\n func.toString(),\n args,\n (err, result) => {\n if (err) {\n console.error(err)\n }\n resolve(result)\n })\n })\n }", "async function funzioneAsincrona(req, res){\n const { execFile } = require('child_process');\n const child = execFile('letturaDati.py', {}, (error, stdout, stderr) => {\n if (error) {\n reject('BB Non è stato possibile leggere nella funzione checkExist');\n }\n res.pipe(child.stdout);\n });\n}", "async function main() {\n //Grab your Hedera testnet account ID and private key from your .env file\n const myAccountId = process.env.ACCOUNT_ID;\n const myPrivateKey = process.env.PRIVATE_KEY;\n // If we weren't able to grab it, we should throw a new error\n if (myAccountId == null || myPrivateKey == null ) {\n throw new Error(\"Environment variables myAccountId and myPrivateKey must be present\");\n } else {\n console.log('Keys imported successfully from env');\n }\n\n const client = Client.forTestnet()\n client.setOperator(process.env.ACCOUNT_ID, process.env.PRIVATE_KEY);\n\n\n\n\n /***** ACCOUNT BALANCE *****/\n //Create the account balance query\n const query = new AccountBalanceQuery()\n .setAccountId(myAccountId);\n\n //Submit the query to a Hedera network\n const accountBalance = await query.execute(client);\n console.log(\"Balance: \" + accountBalance.hbars);\n /***** ACCOUNT BALANCE *****/\n\n\n\n /***** ACCOUNT INFO *****/\n // const query2 = new AccountInfoQuery()\n // .setAccountId(myAccountId);\n\n // const accountInfo = await query2.execute(client);\n // console.log(accountInfo);\n /***** ACCOUNT INFO *****/\n\n\n\n\n /***** TRANSACTION *****/\n // Create a transaction to transfer 100 hbars\n const transaction = new TransferTransaction()\n .addHbarTransfer('0.0.2908916', new Hbar(-1))\n .addHbarTransfer('0.0.2908905', new Hbar(1));\n\n //Submit the transaction to a Hedera network\n const txResponse = await transaction.execute(client);\n\n //Request the receipt of the transaction\n const receipt = await txResponse.getReceipt(client);\n\n //Get the transaction consensus status\n const transactionStatus = receipt.status;\n\n console.log(\"The transaction consensus status is \" +transactionStatus.toString());\n /***** TRANSACTION *****/\n}", "init() {\n moduleUtils.patchModule(\n 'cos-nodejs-sdk-v5/sdk/task.js',\n 'init',\n tencentCOSWrapper\n );\n }", "function run() {\r\n var account = {\r\n clientId: \"#####\", // You can get when you registered an app to Netatmo.\r\n clientSecret: \"#####\", // You can get when you registered an app to Netatmo.\r\n userName: \"#####\", // Account for logging in to Netatmo.\r\n password: \"#####\", // Account for logging in to Netatmo.\r\n diffTime: 900, // When the data is not updated from the time that the script was run to before diffTime, it can confirm that Netatmo is down.\r\n batteryPercent: 10, // When the battery charge is less than batteryPercent, this script sends an email as the notification.\r\n mail: \"#####\", // This is used for sending the email.\r\n };\r\n checkNetatmo(account);\r\n}", "async function inicioApp () {\n await llamda();\n llamadaNueva()\n}", "async function main() {\n const data = await readFile(__filename);\n console.log('File data is :',data);\n}", "async loadBlockchainData() {\n const Web3 = require('web3')\n const web3Extension = require('@energi/web3-ext');\n const web3 = new Web3(Web3.givenProvider || \"https://nodeapi.test3.energi.network\")\n\n web3Extension.extend(web3);\n\n// instantiate the contract and the Metamask app\n\n const election = await new web3.eth.Contract(election_ABI, election_address)\n\n this.setState({Contract: election})\n\n const accounts = await web3.eth.getAccounts()\n\n this.setState({account: accounts[0]})\n\n\n// instantiate the methods of the contract\n\n const getCandidate = await election.methods.candidateName().call()\n this.setState({candidateName: getCandidate})\n\n\n}", "function Main(){\n \n getLiveGames();\n \n}", "async function run() {\n console.log(\"Example script running..\");\n\n function errHandler(err) {\n console.log(\"API error\", err);\n }\n\n async function onReady() {\n console.log(\"API ready..\");\n console.log(await vctrApi.getObjects());\n\n const allMaterials = await vctrApi.getMaterials();\n const allMeshes = await vctrApi.getMeshes();\n addOptionsToSelector(allMaterials.map(mat => mat.name), materialSelector);\n addOptionsToSelector(allMeshes.map(mesh => mesh.name), meshSelector);\n }\n\n vctrApi = new VctrApi(\"test\", errHandler);\n try {\n await vctrApi.init();\n } catch (e) {\n errHandler(e);\n }\n\n await vctrApi.enableAnnotations(annotationSwitch);\n addAnotations()\n addListeners();\n onReady();\n}", "async init() {}", "async init() {}", "function Utils() {}", "function Utils() {}", "async function main(){\n try{\n\n\tlet ourDB = await dbManager.get(); //after this line we are connected. Notice that the async connect function can be awaited\n\t//if we put the call in another async function\n }catch(err){\n console.log(err.message)\n }\n \n}", "async function say() {\n}", "async onLoad() {}", "async genCommon() {\n setBabelEnv('commonjs')\n this.output = CJS_PATH\n await this.compilerComponent()\n }", "async function start() {\n return await Promise.resolve(\"async await\");\n}", "async function main(){\n // return 0;\n accounts = await web3.eth.getAccounts();\n \n //return 0;\n web3.eth.defaultAccount = accounts[1];\n address = web3.eth.defaultAccount;\n \n tc = await new web3.eth.Contract(JSON.parse(JSON.stringify(abi)) ).deploy({ data: bytecode }).send({from:address , gas: '1000000', value: '2000000000'} );\n \n await tc.methods.setDataToDb(2 ,2 , \"Ahmad\", \"Khan\").send({from: accounts[0]}).then(transaction => {\n landModule.create({land_id: 2, age: 2, first_name: \"Ahmad\", last_name: \"Khan\"}, (err, resp) => {\n if(err) {\n console.log(error);\n }\n else {\n console.log('adeedeeeee');\n }\n });\n });\n await tc.methods.GetValue(2).call().then( function( value ) { console.log( \"Current Value: \", value ); } );\n}" ]
[ "0.6039556", "0.59561646", "0.5772149", "0.57351685", "0.5691303", "0.56279176", "0.5558858", "0.55173546", "0.54928666", "0.54893166", "0.5434012", "0.5426698", "0.53705776", "0.53503287", "0.53398967", "0.5312685", "0.53049105", "0.5304451", "0.52452546", "0.52430433", "0.5238395", "0.52269775", "0.52140415", "0.5207121", "0.5207121", "0.5206574", "0.5204216", "0.52035815", "0.5193519", "0.5175049", "0.5159107", "0.51454645", "0.5143873", "0.5142982", "0.5132426", "0.51320964", "0.5110557", "0.51101476", "0.5107723", "0.5104249", "0.51041055", "0.51018816", "0.5099982", "0.50994986", "0.50963986", "0.50860184", "0.50835943", "0.5070038", "0.50698984", "0.50662214", "0.5063617", "0.5045374", "0.50434333", "0.5041254", "0.5036591", "0.5034905", "0.5033466", "0.5031216", "0.5028934", "0.5021892", "0.5011064", "0.50095445", "0.5008488", "0.49998263", "0.49972853", "0.49872965", "0.4984816", "0.49843106", "0.49744174", "0.49720705", "0.49666503", "0.49666503", "0.49614048", "0.4956572", "0.49474046", "0.49469373", "0.494623", "0.4934089", "0.49294567", "0.49281082", "0.49270886", "0.49259213", "0.4923382", "0.4915762", "0.4915283", "0.49042323", "0.4898356", "0.4890384", "0.48900175", "0.4878319", "0.48761976", "0.48753816", "0.48753816", "0.48737758", "0.48737758", "0.48691085", "0.48684493", "0.486328", "0.4858629", "0.48486438", "0.4844596" ]
0.0
-1
'hello world' / FUNCTIONS Functions are a subtype of objects (like arrays) typeof called on a function returns function this means functions are a main type and can have properties, but these are rarely used
function foo(){ return 42; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function functionName() { console.log('I am a function') }", "function MyFunction () {\n console.log('I am a simple function');\n console.log(typeof MyFunction);//function\n}", "function fun() {\n console.log('this is a function');\n}", "function fun() {\n console.log('this is a function');\n}", "function fun() {\n console.log('this is a function');\n}", "function fun() {\n console.log('this is a function');\n}", "function fun() {\n console.log('this is a function');\n}", "function fun() {\r\n console.log('this is a function')\r\n}", "function fun() {\n console.log('This is a function');\n}", "function fun() {\n console.log('This is a function');\n}", "function getType(fn){var match=fn&&fn.toString().match(/^\\s*function (\\w+)/);return match?match[1]:'';}", "function getType(fn){var match=fn&&fn.toString().match(/^\\s*function (\\w+)/);return match?match[1]:'';}", "function iAm() {\n console.log(\"I'm a function\");\n}", "function myFunction() {\n console.log('im a function');\n}", "function Function_(types) {\n var tuples = Z.reduce (function(tuples, t) {\n tuples.push (['$' + show (tuples.length + 1), K ([]), t]);\n return tuples;\n }, [], types);\n\n function format(outer, inner) {\n return when (tuples.length !== 2)\n (parenthesize (outer))\n (joinWith (outer (', '),\n Z.map (function(tuple) {\n return when (tuple[2].type === FUNCTION)\n (parenthesize (outer))\n (inner (tuple[0])\n (show (tuple[2])));\n }, init (tuples)))) +\n outer (' -> ') +\n inner ((last (tuples))[0])\n (show ((last (tuples))[2]));\n }\n\n return _Type (FUNCTION,\n '',\n '',\n types.length,\n format,\n [AnyFunction],\n K (K (true)),\n tuples);\n }", "function hello() {\n return 'world';\n}", "function getType(fn){var match=fn&&fn.toString().match(/^\\s*function (\\w+)/);return match&&match[1];}", "function hello() { return \"Hello\" }", "function isFunction(input){return\"undefined\"!=typeof Function&&input instanceof Function||\"[object Function]\"===Object.prototype.toString.call(input)}", "function newFunction(){ //function declaration\n console.log(\"hello world\");\n }", "function hello() {\n return \"hello world\";\n}", "function hello() {\n return 'hello world';\n}", "function hello() { return 'hello mundo'; }", "function helloWorld() {\n return \"hello world\";\n}", "function hello() {\n return 'Hello world';\n}", "function hello() {\n return \"hello\";\n}", "function hello() {\n return \"hello\";\n}", "function o(e){return\"function\"===typeof e}", "function hello(){\n return \"hello\";\n}", "function funname() {} //literals", "function hello() {\n return 'hello';\n}", "function n(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function Func_s() {\n}", "function hello(){\n return 'hello';\n}", "function hello() {\n return 'Hello World!';\n}", "function hello() {\n return 'Hello World!';\n}", "function hello() {\n return 'Hello World!';\n}", "function sayHello() {}", "function helloWorld() {\n return \"Hello world!\";\n}", "function functionName() {\n console.log(\"Hello World\");\n}", "function functionName() {\n console.log(\"Hello World\");\n}", "function t(a){return typeof Function!=\"undefined\"&&a instanceof Function||Object.prototype.toString.call(a)===\"[object Function]\"}", "function helloWorld(fn) {\n fn();\n}", "\"function name\"(){\n //do thing\n }", "function someFunc() {}", "function hello() {\r\n return 'hello';\r\n}", "function helloWorld() {\n return \"Hello World\";\n}", "function hello(){\n return 'hello';\n}", "function hello(){\n return 'hello';\n}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/)\n\t return match && match[1]\n\t}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n }", "function helloWorld () {\n return \"Hello World\";\n}", "function is_func(func) { return Object.prototype.toString.call(func) == \"[object Function]\"; }", "function a(e){return\"function\"===typeof e}", "function a(e){return\"function\"===typeof e}", "function hello() {\r\n // do something...\r\n}", "function getType (fn) {\r\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : ''\r\n}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1]\n\t}", "function sayHi() {\n 'hello';\n}", "function getType(fn) {\n const match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function Hello(){\r\n return \"Hello\";\r\n}", "function getType(fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match && match[1];\n\t}", "function func() {\n return struct('Function', value => {\n return typeof value === 'function';\n });\n}", "function func() {\n return struct('Function', value => {\n return typeof value === 'function';\n });\n}", "function o(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match ? match[1] : ''\n\t}", "function getType (fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match ? match[1] : ''\n\t}", "function r(t){return typeof Function!=\"undefined\"&&t instanceof Function||Object.prototype.toString.call(t)===\"[object Function]\"}", "function a(t){return typeof Function!==\"undefined\"&&t instanceof Function||Object.prototype.toString.call(t)===\"[object Function]\"}", "function getType(fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match ? match[1] : '';\n\t}", "function getType(fn) {\n\t var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t return match ? match[1] : '';\n\t}", "function isFunc(cf) {\r\n return typeof cf === \"function\";\r\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : \"\";\n }", "function hello() {\n console.log(\"hello world\");\n}", "function helloWorld() {\n console.log('hello');\n}", "function getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n }", "function i(e){return\"function\"===typeof e}", "function a(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function a(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function getType (fn) {\n\t\tvar match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n\t\treturn match ? match[1] : ''\n\t}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function getType(fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "function r(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function r(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n}" ]
[ "0.7015621", "0.6972105", "0.6746577", "0.6746577", "0.6746577", "0.6746577", "0.6746577", "0.66794217", "0.66137934", "0.66137934", "0.65807974", "0.65807974", "0.6580622", "0.65781444", "0.65731376", "0.6556182", "0.6549542", "0.65273756", "0.652699", "0.64335656", "0.6428498", "0.6403384", "0.63881963", "0.6368552", "0.6340313", "0.6335619", "0.6335619", "0.6325927", "0.631632", "0.63067234", "0.6283696", "0.6282155", "0.6281438", "0.62783563", "0.6275872", "0.6275872", "0.6275872", "0.6262183", "0.6259025", "0.6257265", "0.6257265", "0.62519395", "0.62420446", "0.6239832", "0.6229333", "0.6214858", "0.6206934", "0.62041384", "0.62041384", "0.6197064", "0.6195099", "0.6187827", "0.61875165", "0.6181754", "0.6181754", "0.6178631", "0.6174199", "0.6171778", "0.6171778", "0.6171778", "0.6171778", "0.6171778", "0.6171778", "0.61593205", "0.61582464", "0.61520505", "0.61516637", "0.6144168", "0.6144168", "0.6139261", "0.6138282", "0.6138282", "0.61378574", "0.6136136", "0.6132636", "0.6132636", "0.61318266", "0.6128618", "0.6128418", "0.6115691", "0.61148053", "0.6106834", "0.6103009", "0.6103009", "0.60936135", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089427", "0.6089178", "0.6089178", "0.6082878" ]
0.0
-1
works because `foo()` declaration is "hoisted"
function foo() { a = 3; console.log( a ); // 3 var a; // declaration is "hoisted" // to the top of `foo()` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo() {\n a = 3;\n console.log(a); // 3\n var a; // declaration is \"hoisted\"\n // to the top of `foo()`\n }", "function foo() {\n\ta = 3;\n\n\t//console.log( a );\t// 3\n\n\tvar a;\t\t\t\t// declaration is \"hoisted\"\n // to the top of `foo()`\n}", "function hoistedFunction() {\n console.log('I work, even if they call me before my definition.');\n}", "function foo() {\n expect(a).be.undefined;\n a = 3;\n expect(a).to.eql(3);\n var a; // declaration is \"hoisted\" to the top of `foo()`\n expect(a).to.eql(3);\n }", "function foo(){\n\ta = 3;\n\n\tconsole.log( a );\n\n\tvar a;\t\t\t\t// declaration is \"hoisted\" to top of foo.\n\n}", "function foo(){\n foo();\n}", "function foo (){\n foo()\n}", "function foo(){}", "function foo(){}", "function foo() {\n return;\n}", "function foo(){\n return 42;\n}", "function magic() { // 'magic()' also gets hoisted to the top\n var foo; // here 'foo' is declared within 'magic()' and gets hoisted\n foo = \"hello world\"; // we assign a value to our function scoped 'foo'\n console.log(foo); // we log it as 'hello world'\n}", "function foo () { }", "function foo() {\n\treturn 42;\n}", "function functionDeclarationHoisted() {\n function bar() { return 1; }\n function bar() { return 2; }\n return bar();\n}", "function foo() {...}", "function foo(){\n\ta = 3;\n\n\tconsole.log(a); //3\n\n\tvar a;\t\t// declaration is hoisted at top of foo.\n}", "function hoistingFunc()\n{ \n console.log('hoisting ordinary fufunc')\n \n}", "function foo() {\n\tvar a = 7;\n\tfunction bar() {\n\t\t// var a is hoisted here (don't write this until after)\n\t\tconsole.log(a)\n\t\tvar a = 3\n\t}\n\n\tbar();\n}", "function hoist() {\n console.log('hoisted to the top');\n}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {}", "function foo() {\r\n}", "function bar(){\n if(!foo){\n var foo = 10;\n }\n console.log(foo);\n}", "function magic() {\n\t// 'magic()' also gets hoisted to the top\n\tvar foo; // here 'foo' is declared within 'magic()' and gets hoisted to the top of its scope\n\tfoo = \"hello world\"; // we assign a value to our function scoped 'foo'\n\tconsole.log(foo); // we log it as 'hello world'\n}", "function bar() {\n return foo;\n foo = 10;\n function foo() {}\n var foo = '11';\n}", "function foo4(){}", "function baz() {\n foo = bar;\n foo;\n }", "function foo() {\n console.log(b);\n var b = 1; // Split out and hoisted to the top\n}", "function hello(){\n console.log(\"Function Declaration\")\n} // function declaration hoistinga uchraydi", "function bar() { /* `bar` has been compiled, so we move past it until the function is invoked */\n var foo = 'baz';\n\n function baz(foo) {\n foo = 'bam';\n bam = 'yay';\n }\n baz();\n}", "function functionExpressionHoisted() {\n var bar;\n var bar;\n\n bar = function() { return 1; }\n return bar();\n bar = function() { return 2; }\t// Unreachable\n}", "function foo() {\n bar = 4; // ASSIGN_BEFORE_DECL alarm\n var bar;\n console.log(bar);\n}", "function foo() {\n return 1;\n}", "function functionDeclarationHoisting() {\n function bar() { return 1; }\n return bar();\n function bar() { return 2; }\n}", "function foo() {\n}", "function foo() {\n var bar;\n}", "function foo() {\n var x;\n bar();\n x = 1;\n}", "function foo() {\n a = 1; // no declaration\n}", "function foo() {\n console.log(bar);\n}", "function foo() {\n console.log(\"foo\");\n}", "function hoistedFunction(){ \n console.log(\" Hello world! \");\n}", "function foo(cb) {\n cb();\n}", "function foo() {\n\n}", "function foo() {\n console.log('aloha');\n }", "function bar() {}", "function foo(){\n console.log(1);\n}", "function bar() {\n // Local function scope of bar\n }", "function foo(){\n console.log( 1 );\n}", "function foo() {\n bar();\n var x = 1;\n}", "function foo() {\n\ta = 1;\t// `a` not formally declared\n}", "function functionExpressionHoisting() {\n var bar = function() { return 1; }\n return bar();\n var bar = function() { return 2; }\n}", "function foo() {\r\n return 100;\r\n}", "function funcA() {\n console.log(a);\n console.log(foo());\n\n var a = 1;\n function foo() {\n return 2;\n }\n}", "function foo() {\n\tvar bar = 'bat'\n\n\tfunction asdf() {\n\t\tconsole.log(bar)\n\t}\n\tasdf() // bat\n}", "function foo (fooArg) {\n let fooLocal = \"I'm foo\";\n console.log('Inside foo:', fooLocal, fooArg);\n return function bar (barArg) {\n console.log(\n 'Inside bar:', fooLocal, fooArg, barArg\n );\n };\n }", "function foo() {\n return 2;\n }", "function foo1() { }", "function baz() {}", "function funcA() {\n console.log(a);\n console.log(foo());\n var a = 1;\n function foo() {\n return 2;\n }\n}", "function hoge() {}", "function foo() {\n\tconsole.log(\"foo\");\n}", "function foo() {\n console.log(age); //undefined, because of Hoisting.\n var age = 65;\n console.log(age); //65\n}", "function bar (){\n // Compiler: \"Hey, scope of bar I have a new declaration to declare. His identifier is foo.\"\n // the function bar is now compiled\" (Compiler having a conversation with scope portion of the engine.. the scope manager)\n var foo = \"baz\";\n // We are done with the function bar. Popping ourselves back out to the global scope\n}", "function foo() {\n console.log( 1 );\n}", "function foo() {\r\n console.log(1);\r\n}", "function foo() {\n return 2;\n}", "function foo()\n{\n console.log('Function Declaration');\n}", "function foo() {\n return 2;\n}", "function foo() {\n return 'asdf';\n}", "function foo() {\n // Hoisting also applies in this function's execution context\n console.log(\"age = \" + age + \" (foo()'s execution context);\");\n // age defined inside here is different compared to the age defined outside this function\n var age = 99; \n console.log(\"age = \" + age + \" (foo()'s execution context);\");\n}", "function foo() {\n\tconsole.log(\"bar\")\n}", "function myFunction() {\n console.log(\"Hoisting\");\n}", "function foo() {\n console.log(\"Hello Foo\");\n}", "function helloWorld(){ //get copied and hoisted to the top of the scope\n console.log('Hello World!'); //allowing us to call the function before it's declaration\n}", "function foo() {\n var x = 1;\n function bar() {\n console.log(x);\n }\n baz(bar);\n}", "function foo() {\n console.log(\"foo()\");\n}", "function test() {\n\n console.log(a);\n \n console.log(foo());\n \n var a = 1;\n \n function foo() {\n \n return 2;\n \n }\n \n}", "function f() {\n f();\n}", "function foo() {\n console.log(\"I'm the callback\");\n}", "function test() {\n console.assert(a === undefined)\n console.assert(foo() === 2)\n\n var a = 1\n function foo() {\n return 2\n }\n}", "function foo() {\n bar = 'mutation';\n }", "function goodbye(){}", "function foo() {\n\tvar bar = \"bar\";\n\n\tfunction baz() {\n\t\tconsole.log(bar);\n\t}\n\n\tbam(baz)\n}", "function foo () {\n return \"Bar\";\n}", "function foo(){\n function bar(){\n console.log(\"hello\");\n }\n}", "function foo(x: void) { }", "function test() {\n\n console.assert(a === undefined)\n console.assert(foo() === 2)\n\n var a = 1\n function foo() {\n return 2\n }\n}", "function foo() {\n var a = 2;\n\n function bar() {\n console.log(a);\n }\n\n return bar;\n}", "function fooTest() { }", "function f() {\n (function () {\n x;\n function a() {}\n print(a)\n })()\n}", "function foo() {\r\n var y = 20; // free variable within scope of bar\r\n\r\n function bar() {\r\n var z = 15; // not a free vairable, local variable\r\n var output = x + y + z;\r\n return output;\r\n }\r\n //console.log(bar()); 45\r\n return bar;\r\n}", "function thisIsHoisted() {\n console.log('this is a function declared at the bottom of the file')\n}", "function foo() {\n var a = 2;\n\n function baz() {\n console.log( a ); // 2\n }\n\n bar( baz );\n}", "function foo(a, b) {\r\n console.log(\"It may be Inside the function declaration\");\r\n return a + b;\r\n}", "function bar(){\n var foo = \"baz\";\n \n function baz(){\n foo = \"bam\";\n bam = \"yay\";\n console.log(foo);\n }\n baz();\n console.log(foo);\n}" ]
[ "0.7138954", "0.6699694", "0.66906977", "0.6648686", "0.66448283", "0.6612035", "0.65252864", "0.63808525", "0.63808525", "0.63530105", "0.63388586", "0.63320214", "0.6240493", "0.6238319", "0.62230074", "0.6218568", "0.61838096", "0.61318815", "0.6126758", "0.61168116", "0.6083918", "0.6083918", "0.6083918", "0.6083918", "0.6083918", "0.6083918", "0.60242665", "0.60229665", "0.6013354", "0.5994913", "0.5994537", "0.5992787", "0.59888387", "0.59809196", "0.5972362", "0.59609795", "0.5959536", "0.59528106", "0.59413564", "0.5931566", "0.5923069", "0.5875006", "0.5874317", "0.5860324", "0.5854889", "0.5850602", "0.58438134", "0.5837321", "0.5833456", "0.58254", "0.5811154", "0.5808881", "0.57657105", "0.5763329", "0.57553", "0.56953984", "0.56848717", "0.5676259", "0.56720537", "0.5670862", "0.56597465", "0.5656147", "0.56531656", "0.56490964", "0.56344575", "0.5630009", "0.5628267", "0.56239223", "0.56230354", "0.5622101", "0.5621813", "0.56136", "0.5604043", "0.56019074", "0.55925596", "0.5591389", "0.5583741", "0.5581712", "0.5575856", "0.5565513", "0.5562513", "0.55565226", "0.55309004", "0.55289817", "0.5513669", "0.5510697", "0.551006", "0.5500096", "0.5477965", "0.5471083", "0.5469108", "0.54666954", "0.5462318", "0.5453187", "0.54463685", "0.5439638", "0.5436841", "0.5431805", "0.54305863", "0.5412418" ]
0.66899204
3
2 Nested scopes / When you declare a variable, it is available anywhere in that scope, as well as any lower/inner scopes
function foo() { var a = 1; function bar() { var b = 2; function baz() { var c = 3; console.log( a, b, c ); // 1 2 3 } baz(); console.log( a, b ); // 1 2 } bar(); console.log( a ); // 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkscope2() {\n\t var scope = \"Local\";\n\t function nested() {\n\t\t var scope = \"nested\";\n\t\t return scope;\n\t }\n\t return nested();\n }", "function scoper() {\n // let cat = 'Toby';\n console.log('cat inside scoper ', cat);\n function innerScope() {\n console.log('cat inside innerScope ', cat);\n }\n innerScope();\n}", "function scope2() {\n var top = \"top\";\n var bottom;\n bottom = \"bottom\";\n console.log(bottom);\n}", "function scopeExample() {\n let local = 'Indianapolis'; //'let' is tracked to the neareast curly boy/bracket - so 'local' can't be used anywhere other than these brackets = local scope \n let inner = 'it has many places to visit'\n console.log(local);\n console.log(`${local} is a humble city on ${global}`)\n if(true) {\n let inner = 'what a large city';\n console.log(inner); //this one reads the 'large city' - reads in purple curly boys \n }\n console.log(inner); // this one reads 'many places to visit' reads in the yellow curly boys\n}", "function outer(){\n var a = 1;\n \n function inner(){\n var b = 2;\n \n // inner has access to a and b!\n console.log( a + b ); // 3\n }\n \n inner();\n \n // we can access a here\n console.log( a );\n}", "function scope(){\n if(true){\n // Var is scoped to the nearest function keyword and declaration is pulled to the top of its scope\n var a = 5;\n\n // Let and Const are scoped by the block they are in.\n let b = 10;\n }\n console.log(a);\n console.log(b);\n}", "function foo(){\n\t//child Scope\n\tvar b = 2;\n\tvar a = 2;\n\ta = 3;\n\tconsole.log(a);\n\t//console.log(window.a);\n}", "function scopeTest() {\n var outerVar = 'outer var';\n let outerLet = 'outer let';\n if (true) {\n var innerVar = 'inner var';\n let innerLet = 'inner let';\n }\n}", "function nested() {\n // var y = 50\n console.log(x)\n }", "function outer(){\n var a = 1;\n\n function inner(){\n var b = 2;\n\n //we can access both 'a' and 'b' here. \n console.log(a+b);\n }\n\n inner();\n\n // we can only access 'a' here. \n console.log(a);\n}", "function scope1() {\n var top = \"top\";\n bottom = \"bottom\";\n console.log(bottom);\n\n var bottom;\n}", "function inner() {\n let inside = 'inside'; // inner() has access to both inside var and outside var\n console.log( outside );\n console.log( inside );\n }", "function outer(){\n var outervari = \"i am an outer variable\";\n console.log(outervari);\n function inner(){\n var innervari = \"i am an inner variable\";\n console.log(innervari);\n console.log(outervari);\n }\n inner();\n console.log(outervari);\n // console.log(innervari); will produce error\n}", "function varTest(){\n var scope = 1\n if (true) {\n var scope = 2\n console.log(scope)\n }\n console.log(scope)\n}", "function checkscope(){\n //function scope Everthing in the function block is locally accessable to the function only!!!\n var scope = \"local scope\" // local variable\n\n // create a local variable!!\n var scope = \"local scope\" // a local variable\n function f(){ return scope;} // another local variable\n\n return f(); //Return the value in the scope here\n }", "function seeScope() {\n var testVar = \"first\";\n\n function showF() {\n console.log(testVar);\n // var testVar = \"second\";\n }\n\n showF();\n}", "function outer2(){\n function inner(){\n var innerVar = 10;\n }\n console.log(innerVar); // gives error\n}", "function globalScope() {\n console.log(outer); // 'I am from outer global scope'\n}", "function foo(){\n var bar = 10;\n console.log(\"3: \" + bar); //3: What will bar be on this line?\n\n var innerFoo = function(){\n bar = 15;\n }\n\n console.log(\"4: \" + bar); //4: What will bar be on this line? -->\n}", "function foo(){\n var bar = 10;\n console.log(\"3: \" + bar); //3: What will bar be on this line? --> 3: 10\n\n var innerFoo = function(){\n bar = 15;\n }\n\n console.log(\"4: \" + bar); //4: What will bar be on this line? --> 4: 10 (not 15 bacause bar = 15 in innerFoo becomes global but\n //it does not affect the bar = 10 in function foo)\n}", "function localScope() {\n var myVariable = \"I am here!\";\n\n console.log(myVariable);\n}", "function myLocalScope() {\n var myVar = 5;\n console.log(myVar);\n}", "function scope(){\n var x = 33; //local scope inside of a function - variables only exist within that function\n console.log(x); //you can also read the global scope (x) inside of this funtion if x isn't defined inside of the function\n}", "function myLocalScope() {\n\tvar myVar11 = 5;\n\tconsole.log(myVar11);\n}", "function aFunc() {\n // declaring a here - scoped here\n let a = 1;\n}", "function localVars(x, y){\r\n var a = 6;\r\n function innerVars(){\r\n var a = 10;\r\n b = a;\r\n }\r\n var b = 7;\r\n function innerVars2(){\r\n var c = 11;\r\n var d = b;\r\n }\r\n innerVars();\r\n return b;\r\n}", "function logScope()\n{\n let localVar = 2; /* or var localVar = 2 */\n if (localVar)\n {\n let localVar = \"I'm different\";\n console.log(\"nested localVar: \", localVar);\n }\n console.log(\"logScope: \", localVar);\n}", "function logScope() {\n let localVar = 2;\n\n if (localVar) {\n let localVar = \"I'm different!\";\n console.log(\"nested: \", localVar)\n }\n\n console.log(\"logScope local: \", localVar);\n}", "function a() {\n console.log(myVar);\n\n function b() {\n let myVar = 2;\n }\n\n b();\n}", "function top4(){\n var a;\n function inner1(){\n var b;\n function inner2(){\n console.log(a,b);\n }\n inner2();\n }\n inner1();\n}", "function outer(){\n var out_var = 'outer';\n console.log(in_var); // error\n inner();\n function inner(){\n var in_var = 'inner';\n console.log(out_var); //outer\n }\n console.log(in_var); // error\n}", "function someFunction() {\r\n // Local Scope #1\r\n function someOtherFunction() {\r\n // Local Scope #2\r\n }\r\n}", "function myLocalScope(){\n var myVarLocal = 5;\n console.log(myVarLocal); // will show 5\n}", "function selfish() {\n let localScope = 'you cant get me!'\n}", "function scope(){\n var x = 33 // If 'var' is removed, output will show 33, 33. It will reassign x as 33 once the scope function is called\n console.log(x)\n}", "function top2() {\n var a;\n function inner() {\n console.log(a);\n }\n inner();\n}", "function example1() {\n // block scoped\n {\n let alice = \"a\";\n var carol = \"c\";\n }\n\n console.log(\"example1 alice\" , alice); // output -> alice not defined - error thrown\n console.log(\"example1 carol\" , carol); // output -> c\n}", "function someFunction() {\n // Local Scope #1\n function someOtherFunction() {\n // Local Scope #2\n }\n}", "function logScope2() {\n var localVar = 2;\n\n if(localVar){\n let localVar = \"I'm Different!\";\n console.log(\"nested localVar: \", localVar);\n }\n\n console.log(\"logScope localVar: \", localVar);\n}", "function scopeTest() {\n\n if (true) {\n var a = 123;\n }\n\n console.log(a);\n}", "function Scope() {\n 'use strict';\n let i = '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 }", "function printVar2() {\n const costanza = 'Belongs to the local scope of a function.'\n console.log(costanza); //Belongs to the local scope of a function.\n\n}", "function checkScope() {\n var myVars = 'local'; // Declare a local variable\n console.log(myVars);\n}", "function checkscope2() {\n var scope = \"local scope\";\n function f() {\n return scope;\n }\n return f;\n}", "function logScope() {\n var localVar = 2;\n\n if(localVar){\n var localVar = \"I'm Different!\";\n console.log(\"nested localVar: \", localVar);\n }\n\n console.log(\"logScope localVar: \", localVar);\n}", "function test() { //new scope\n let a = 4;\n}", "function innerFunc() {\n // var x = 'LocalInner';\n //LocalInner①\n console.log(x);\n //Global②\n // console.log(y);\n //undefined③\n // console.log(z);\n }", "function checkScope1(){\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('Block scope i is ',i);\n\n}", "function a() {\n\tvar myVar = 2;\n\tfunction b() {\n\t\tconsole.log(myVar);\n\t}\n\tb();\n}", "function myLocalScope() {\n 'use strict'; // you shouldn't need to edit this line\n var myVar = 7;\n console.log(myVar);\n}", "function myLocalScope() {\n var myVar = 5 + \" This is myVar\";\n console.log(myVar);\n}", "function anotherlogScope () {\n let localVar = 2 ; \n if (localVar ) {\n let localVar = \"i'm different \" ; \n console.log(\"nested localVar : \" , localVar) ; \n }\n console.log(\"logScope localVar : \" , localVar) ; \n}", "function f() {\n var x = 1\n let y = 2\n const z = 3\n {\n var x = 100\n let y = 200\n const z = 300\n console.log('x in block scope is', x)\n console.log('y in block scope is', y)\n console.log('z in block scope is', z)\n }\n console.log('x outside of block scope is', x)\n console.log('y outside of block scope is', y)\n console.log('z outside of block scope is', z)\n }", "function testScope() {\n//var e is hoisted only to the top of the function, not the global scope. Since this is functional scoped.\n console.log(e); //undefined\n var e = \"I'm a var in a function!\";\n console.log(e); //\"I'm a var in a function\"\n}", "function local() {\n // Scope FUnction\n // Variable ini hanya berjalan di block function ini saja\n\n var a = \"Ini\";\n let b = \"Itu\";\n const c = \"Ono\";\n\n console.log(\"Scope FUnction : \", a, b, c);\n}", "function checkscope() {\n\tvar scope = \"local\"; // Declare a local variable with the same name\n\treturn scope; // Return the local value, not the global one\n}", "function logScope() {\n let localVar = 2;\n\n if (localVar) {\n let localVar = \"I'm different!\";\n console.log(\"nested localVar: \", localVar);\n }\n console.log(\"LogScope localVar: \", localVar);\n}", "function scopeLearning(num1, num2){\n const sum = num1 + num2 + bonus; //sum is local scope / variable\n if(sum > 23){\n const result = sum + 30; //its a local scope\n console.log(result);\n }\n //console.log(result); // it returns error cause local scope can accessible only and only inside a block\n return sum;\n}", "function child() {\r\n // Innermost level of the scope chain\r\n // name is also accessible here\r\n var likes = 'Coding';\r\n }", "function something(){ //let can shadow var \n var newVar=\"function scope\";\n {\n let newVar=\"local\";\n console.log(newVar);\n }\n console.log(newVar);\n}", "function myLocalScope() {\n 'use strict'; // you shouldn't need to edit this line\n var myVar;\n console.log(myVar);\n}", "function checkscope2() {\n\tscope = \"local\"; // Oops! We just changed the global variable.\n\tmyscope = \"local\"; // This implicitly declares a new global variable.\n\treturn [ scope, myscope ]; // Return two values.\n}", "function parent() {\r\n // name is accessible here\r\n // likes is not accessible here\r\n function child() {\r\n // Innermost level of the scope chain\r\n // name is also accessible here\r\n var likes = 'Coding';\r\n }\r\n }", "function f() {\n {\n let x = \"lalala\"\n console.log(x) // lalala\n {\n console.log(x)\n // okay, block scoped name\n const x = \"sneaky\"\n const y = \"cucucu\"\n console.log(x)\n // error, const\n // x = \"foo\"\n }\n // error, already declared in block\n // let x = \"inner\"\n // error, y is declared inside an inner block\n // console.log(y)\n }\n }", "function innerFunction(){\n let InnerNumber=50\n // This variable can be accessible from only innerFunction \n console.log(OuterNumber)\n }", "function WithScope(outer, with_var) {\n Scope.call(this, outer, []);\n this.with_var = with_var;\n }", "function checkscope() {\n var scope = \"local\"; // Here we overwrite the variable, scope now is \"local\".\n return scope;\n}", "function outerFunction(){\n var outerFunctionVariable='outer-function-value';\n console.log(outerFunctionVariable);\n function innerFunction(){\n var innerFunctionVariable='inner-function-value';\n console.log(innerFunctionVariable);\n console.log(outerFunctionVariable);\n }\n innerFunction();\n // Variables declared inside inner functions are also not visible from\n // enclosing functions\n //console.log(innerFunctionVariable);\n}", "function foo() {\n var bar;\n}", "function hereBeVar() {\n for (var i = 0; i < 4; i++) {\n console.log(\"Var inside the loop and inside function-scope: \", i);\n }\n console.log(\"Var outside loop and inside function-scope: \", i);\n}", "function checkScope1(){\n let i1=\"function scope\";//Did not effect\n if(true){\n i1=\"block scope\";//Global scope without var keyword\n console.log(\"Block scope i1 is: \", i1);//,\"block scope\"\n }\n console.log(\"Function scope i1 is: \", i1);//,\"block scope\"\n return i1;\n}", "function foo() {\n var a = 2;\n function bar() { // bar() has lexical scope access to inner scope of foo()\n console.log( a );\n }\n return bar; // passed as a value.. return function object itself that bar references\n}", "function innerFunc() {\n\t\tvar y = 5;\n\t\tprint(\"in innerFunc: y =\", y);\t// y = 5\n\t}", "function foo(){\n var bar = 10;\n console.log(\"3: \" + bar); //3: What will bar be on this line?\n //--->Answer: 3: 10, it's a string plus the value.\n\n var innerFoo = function(){\n bar = 15;\n }\n\n console.log(\"4: \" + bar); //4: What will bar be on this line?\n}//-->Answer: 4: 10, Q: Is this because the console.log is outside of innerFoo(),", "function scopeTest() {\n // var a is being hoisted up to the top of its scope, which is\n // here... the function scope\n\n if (true) {\n var a = 10;\n }\n\n console.log(a); // I can actually access a outside of the if block, \n // even though it was defined in there!\n}", "function varScope(permit) {\n var a = 50;\n if (permit) {\n var a = 90;\n }\n return a;\n}", "function checkScope(){\n var i = 'function scope';\n if(true){\n i = 'block scope';\n console.log('Block scope i is ',i);\n }\n console.log('Block scope i is ',i);\n\n}", "function outer() {\n innter();\n var s = 'ssss';\n}", "function myLocalScope() {\n 'use strict'; // you shouldn't need to edit this line\n var myVar = \"foo\";\n console.log(myVar);\n}", "function a() {\n\n function b() {\n console.log(myVar);\n }\n\n let myVar = 2;\n b();\n}", "function outer() {\n // outer has one local variable\n var num = 1;\n // inner can access outer's local variable because of scope\n function inner() {\n return num++;\n }\n // outer returns inner uninvoked\n return inner;\n}", "function top3() {\n var a, b;\n function inner() {\n console.log(a);\n }\n return inner;\n}", "getScope() {}", "function block1() {\r\nvar a=10;\r\n console.log(a);\r\n} //function scope of block 1", "function c() {\n\tfunction d() {\n\t\tconsole.log(myVar);\n\t}\n\n\tvar myVar = 2;\n\td();\n}", "function foo() {\n\tvar bar = 'bat'\n\n\tfunction asdf() {\n\t\tconsole.log(bar)\n\t}\n\tasdf() // bat\n}", "function shadowOuterVariable() {\n let outer = 'global outer being shadowed here';\n console.log(outer); // 'global outer being shadowed here'\n}", "function foo(){\n var name =\"Grace\";\n function age(){\n var age =21;\n function gender(){\n var gender =\"female\";\n console.log(name,age,gender);\n }\n console.log(name,age);\n }\n console.log(name)\n}", "function scopeTestFunction() { \n const next = \"I am a writen second and Child Scoped.\" \n //will print \"I am a writen second and Child Scoped.\"\n console.log(next);\n //will print \"I am the first thing writen and from Global\"\n console.log(start);\n }", "function myLocalScope() {\n\tvar myLocalVar;\n\tconsole.log(\"inside MyLocalScope\", myLocalVar);\n}", "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 }", "function myLocalScope() {\n 'use strict'; // you shouldn't need to edit this line\n var myVar = \"test\";\n console.log(myVar);\n}", "function outer(){\n var username = \"rahul\"\n\n function inner(){\n console.log(username, window);\n }\n\n return inner;\n}", "function checkScope() {\n 'use strict';\nlet 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}", "function scopeTest() {\n // This variable will always be in scope in this function\n let inScopeInScopeTest = true;\n\n {\n // this variable lives inside this block and doesn't\n // exist outside of the block\n let scopedToBlock = inScopeInScopeTest;\n }\n\n // scopedToBlock doesn't exist here so an error will be thrown\n if (inScopeInScopeTest && scopedToBlock) {\n console.log(\"This won't print!\");\n }\n}", "function foo() {\n var bar;\n\n function zip() {\n var quux;\n }\n}", "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 }", "function scopeTest() {\n // This variable will always be in scope in this function\n let inScopeInScopeTest = true;\n\n {\n // this variable lives inside this block and doesn't\n // exist outside of the block\n let scopedToBlock = inScopeInScopeTest;\n }\n\n // scopedToBlock doesn't exist here so an error will be thrown\n if (inScopeInScopeTest && scopedToBlock) {\n console.log(\"This won't print!\");\n }\n}", "function scopeTest() {\n // This variable will always be in scope in this function\n let inScopeInScopeTest = true;\n\n {\n // this variable lives inside this block and doesn't\n // exist outside of the block\n let scopedToBlock = inScopeInScopeTest;\n }\n\n // scopedToBlock doesn't exist here so an error will be thrown\n if (inScopeInScopeTest && scopedToBlock) {\n console.log(\"This won't print!\");\n }\n}", "function foo() {\n var a;\n console.log( a );\n var a = 2;\n}" ]
[ "0.76544344", "0.7270625", "0.7256985", "0.722848", "0.71966076", "0.71315575", "0.7130623", "0.71063185", "0.7074613", "0.7024565", "0.70072925", "0.69608", "0.69323444", "0.69112444", "0.6875424", "0.6871827", "0.6853142", "0.68499553", "0.68455184", "0.6843117", "0.6836166", "0.6816473", "0.68142456", "0.68099153", "0.6807776", "0.6803335", "0.67927295", "0.6761549", "0.67573154", "0.6730959", "0.6728952", "0.67146313", "0.6690673", "0.6686243", "0.6683245", "0.6672537", "0.6670813", "0.6670238", "0.66385144", "0.66099876", "0.66039914", "0.6584311", "0.658179", "0.65810895", "0.65508884", "0.6539458", "0.6536539", "0.65312374", "0.6522558", "0.6515372", "0.6513146", "0.6510106", "0.6507214", "0.65057456", "0.6497377", "0.6494879", "0.6491024", "0.64879847", "0.6486587", "0.6482594", "0.6473612", "0.6466893", "0.64663166", "0.64533514", "0.6451307", "0.64272517", "0.64259374", "0.6424378", "0.6420529", "0.64170283", "0.6415389", "0.63910353", "0.6389661", "0.6386427", "0.6378315", "0.6375648", "0.63744557", "0.63721246", "0.6369191", "0.63545704", "0.6354077", "0.6351529", "0.6343904", "0.6341399", "0.6340757", "0.6338099", "0.6336959", "0.6331552", "0.63307846", "0.632865", "0.6328278", "0.6321825", "0.6309678", "0.63060725", "0.62978584", "0.62961257", "0.62959653", "0.6291718", "0.6291718", "0.6285503" ]
0.66616935
38
when not in 'strict mode' :
function foo() { a = 1; // `a` not formally declared }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __strict(x) {return x}", "function __strict(x) {return x}", "function strictMode() {\n 'use strict';\n\n //..\n //..\n }", "function strictly() {\n 'use strict';\n\n}", "function bar() {\n // this code is also strict mode.\n }", "function nonStrictMode() {\n let x = 34;\n\n //..\n 'use strict';\n //..\n }", "function foo() {\n \"use strict\";\n}", "function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n innerOk.apply(void 0, [strict, args.length].concat(args));\n}", "function strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n innerOk.apply(void 0, [strict, args.length].concat(args));\n}", "function duplicatepropertynamesinstrictmode() {\n 'use strict';\n return this === undefined && ({ a:1, a:1 }).a === 1;\n}", "function forUseStrict() {\n \"use strict\";\n // start coding from here\n console.log(\"hello world\");\n}", "function isUseStrict(stmt) {\n return options.ecmaVersion >= 6 && stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" && stmt.expression.value === \"use strict\";\n }", "function strict() {\n // Function-level strict mode syntax\n 'use strict';\n function nested() { return 'And so am I!'; }\n return \"Hi! I'm a strict mode function! \" + nested();\n}", "function withStrict() {\n 'use strict';\n bar = 'bar'; // throws a ReferenceError, bar not defined\n return bar;\n}", "function strict(value,message){if(!value)fail(value,true,message,'==',strict);}", "function StupidBug() {}", "function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }", "function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }", "function run() {\n 'use strict';\n}", "function this_in_strict() {\n log(this)\n}", "function doSomething(a, b) {\n \"use strict\";\n return a * b;\n}", "function Pe(){var e,t;\n// TODO(ikarienator): Should we update the test cases instead?\nreturn st&&(g(),q({},rt.StrictModeWith)),G(\"with\"),Y(\"(\"),e=ge(),Y(\")\"),t=qe(),pt.createWithStatement(e,t)}", "static final private internal function m106() {}", "function foo(){\n 'use strict';\n var undefined = 2;\n console.log( undefined ); // 2\n}", "function f2() {\n \"use strict\"\n return this === undefined\n}", "function strictModeInsideFunction()\n{\n\t\"use strict\";\n\td = 8; // This will cause an error (d is not defined).\n\tdocument.getElementById(\"strictModeInsideFunction\").innerHTML = \"c Is \" + c + \" \" + \"d Is \" + d;\n}", "function testStrict(val) {\n if (val === 7) {\n // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function strictModeDefaultBinding() {\n 'use strict';\n return ___;\n}", "function looseJsonParse(obj){\n return Function('\"use strict\";return (' + obj + ')')();\n}", "function testStrict(val) {\n if (val===7) { // Change this line\n   return \"Equal\";\n }\n return \"Not Equal\";\n}", "function testStrict(val) {\n if (val === 7) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function foo() {\n\t\"use strict\";\n\n\tconsole.log( this.a );\n}", "function testStrict(val) {\n if (val === 7) { // Change this line\n return \"Equal\";\n }\n return \"Not Equal\";\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n }", "transient private protected internal function m182() {}", "function f() { \"use strict\"; return this;}", "function catTalk() {\n \"use strict\"\n\n}", "function use_strict() {\n\t\"use strict\";\n\ttry {\n\t\ttxt1 = window.document.getElementById(\"text1\").value;\n\t\twindow.document.getElementById(\"using_strict\").innerHTML = \"Square root of\"\n\t\t\t\t+ txt1 + \" = \" + Math.sqrt(txt1);\n\t} catch (e) {\n\t\twindow.document.getElementById(\"using_strict\").innerHTML = \"<span style='color:red'>Error:</span> \"\n\t\t\t\t+ e.toString();\n\t}\n}", "function strict(x) {\n 'use strict'\n arguments[0] = 'modified';\n return x === arguments[0];\n}", "function sum(a, a, c) { // !!! syntax error\n  'use strict';\n  return a + b + c; // wrong if this code ran\n}", "function o0(e = 'default argument') {\n try { {\n var o3 = () => { try {\n'use strict';\n}catch(e){} }\n\n try {\no18(o3, \"Strict-mode lambda\");\n}catch(e){}\n } } catch(e) {}try { try {\nPromise.call(promise, undefined);\n}catch(e){} } catch(e) {}\n}", "function addStrict(moduleMeta) {\n console.log(\"transform '\" + moduleMeta.name + \"'\");\n moduleMeta.configure({source: \"'use strict;'\\n\" + moduleMeta.source});\n}", "function useStrictEquality( b, a ) {\n\t\t\t\tif ( b instanceof a.constructor || a instanceof b.constructor ) {\n\t\t\t\t\t// to catch short annotaion VS 'new' annotation of a\n\t\t\t\t\t// declaration\n\t\t\t\t\t// e.g. var i = 1;\n\t\t\t\t\t// var j = new Number(1);\n\t\t\t\t\treturn a == b;\n\t\t\t\t} else {\n\t\t\t\t\treturn a === b;\n\t\t\t\t}\n\t\t\t}", "function sum() {\n // \"use strict\"\n var number = 5;\n console.log(number);\n}", "function greet() {\n 'use strict';\n console.log('hi');\n}", "function sum (x, y, z){\n \"use strict\";\n\n}", "static transient final private internal function m43() {}", "function looseEqual(a, b) {\n return true;\n }", "function useStrictToBeginning (code) {\n if (!code.match(/['\"]use strict['\"]/)) {\n return code\n }\n return \"'use strict';\" + code\n}", "function useStrictEquality(b, a) {\n\t\t\tif (b instanceof a.constructor || a instanceof b.constructor) {\n\t\t\t\t// to catch short annotaion VS 'new' annotation of a declaration\n\t\t\t\t// e.g. var i = 1;\n\t\t\t\t// var j = new Number(1);\n\t\t\t\treturn a == b;\n\t\t\t} else {\n\t\t\t\treturn a === b;\n\t\t\t}\n\t\t}", "static private internal function m121() {}", "function doSomething(val) {\n \"use strict\";\n x = val + 10; // let x = val + 10;\n}", "static transient final protected function m44() {}", "function forgettingDeclaringVariablesBeforeUseingDeclaresThemOnTheGlobalObject(){\n i = 1;//ReferenceError in strict mode.\n}", "transient final private protected internal function m167() {}", "function returnUndefined() {}", "function functionTest(){\n 'use strict';\n console.log(this===window);\n}", "function testStrict(val) {\n\tif (val === 7) {\n\t\treturn \"Equal\";\n\t}\n\treturn \"Not Equal\";\n}", "function useStrictEquality(b, a) {\n if (b instanceof a.constructor || a instanceof b.constructor) {\n // to catch short annotaion VS 'new' annotation of a declaration\n // e.g. var i = 1;\n // var j = new Number(1);\n return a == b;\n } else {\n return a === b;\n }\n }", "function useStrictEquality(b, a) {\n if (b instanceof a.constructor || a instanceof b.constructor) {\n // to catch short annotaion VS 'new' annotation of a declaration\n // e.g. var i = 1;\n // var j = new Number(1);\n return a == b;\n } else {\n return a === b;\n }\n }", "private internal function m248() {}", "private public function m246() {}", "function maybeDoSomething(p1, p1) {\n // \"use strict\"; // comment this back in to test;\n console.log(p1);\n return p1;\n}", "function s(e){return void 0===e||null===e}", "isStrict(){\n let component = this.props.component\n let key = this.props.attribute\n return component.state.data[key].strict\n }", "transient final protected internal function m174() {}", "static transient private protected internal function m55() {}", "function foo() {\n //\"use strict\"\n console.log(this.bar);\n}", "function teste() {\n \"use strict\"\n let testando = 'teste';\n}", "function isUseStrictPrologueDirective(node) {\n var nodeText = ts.getTextOfNodeFromSourceText(file.text, node.expression);\n // Note: the node text must be exactly \"use strict\" or 'use strict'. It is not ok for the\n // string to contain unicode escapes (as per ES5).\n return nodeText === '\"use strict\"' || nodeText === \"'use strict'\";\n }", "static final private protected internal function m103() {}", "static private protected internal function m118() {}", "function testStrict(val) {\n if (val === 7) {\n return \"equal\";\n }\n return \"Not equal\";\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}" ]
[ "0.7492471", "0.7492471", "0.7320771", "0.69628084", "0.69416744", "0.6888165", "0.6563585", "0.6302177", "0.6302177", "0.6285991", "0.62569", "0.62050265", "0.6067217", "0.60577697", "0.605221", "0.6025659", "0.597594", "0.597594", "0.59648573", "0.5874168", "0.5848781", "0.583961", "0.5836948", "0.5828449", "0.5826413", "0.5807246", "0.57766205", "0.5742424", "0.57333505", "0.5729339", "0.57248193", "0.57213414", "0.57040906", "0.566989", "0.56378436", "0.5631763", "0.5619621", "0.5616705", "0.56113", "0.5573816", "0.5568061", "0.5557897", "0.5546974", "0.5538426", "0.55383396", "0.553058", "0.5510007", "0.5507176", "0.5487808", "0.5486213", "0.5483085", "0.54817635", "0.54763144", "0.54718935", "0.5471192", "0.545836", "0.5453379", "0.54508394", "0.5450417", "0.5450417", "0.54389256", "0.5431288", "0.54310024", "0.5425445", "0.54194504", "0.5415186", "0.5409148", "0.5406548", "0.54013234", "0.5388257", "0.5382651", "0.53640366", "0.5358766", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667", "0.5357667" ]
0.0
-1
42 / CLOSURES (in detail later)
function makeAdder(x) { // parameter `x` is an inner variable // inner function `add()` uses `x`, so // it has a "closure" over it function add(y) { return y + x; }; return add; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function StupidBug() {}", "static transient final private internal function m43() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "static transient final private public internal function m42() {}", "sharpen(){cov_14q771vu2z.f[3]++;cov_14q771vu2z.s[22]++;if(this.length===0){cov_14q771vu2z.b[6][0]++;cov_14q771vu2z.s[23]++;throw new Error('Your pencil has a length and durability of 0! You need a new one!');}else{cov_14q771vu2z.b[6][1]++;cov_14q771vu2z.s[24]++;this.pencilDurability=40000;cov_14q771vu2z.s[25]++;this.length-=1;}}", "sharpen(){cov_1rtpcx8cw8.f[3]++;cov_1rtpcx8cw8.s[21]++;if(this.length===0){cov_1rtpcx8cw8.b[8][0]++;cov_1rtpcx8cw8.s[22]++;throw new Error('Your pencil has a length and durability of 0! You need a new one!');}else{cov_1rtpcx8cw8.b[8][1]++;cov_1rtpcx8cw8.s[23]++;this.durability=40000;cov_1rtpcx8cw8.s[24]++;this.length-=1;}}", "transient protected internal function m189() {}", "static transient private protected internal function m55() {}", "private internal function m248() {}", "private public function m246() {}", "static transient final protected internal function m47() {}", "function test() {\n var o35 = Object.getOwnPropertyDescriptor(Object.prototype, \"__proto__\").function(o1, o2)\n{\n var o3 = 0;\n var o4 = 0;\n try {\nfor (var o5 = 1; o5 < 10000; o5++)\n {\n try {\no3 = (o1.o3 + o1.o3 + o1.o3 + o1.o3 + o1.o3) & 0x3FFFF;\n}catch(e){}\n try {\no2.o3 = o3 + o4;\n}catch(e){}\n try {\no4 = (o1.o3 + o1.o3 + o1.o3 + o1.o3 + o1.o3) & 0xFFFF;\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o3 + o4;\n}catch(e){}\n};\n function o1() {\n }\n var o2 = ((o863 & 0x4000) >> Object.o157) | ((o863 & 0x40) >> 6);\n var o38 = o839.o906.o917(o308);\n var o6 = Array('Math.ceil((' + target + ')/');\n var o867 = this.o543[0x200 | (o768 >> 4)];\n var o8 = o1(\"willValidate\");\n try {\no21 = function () {\n try {\no337++;\n}catch(e){}\n };\n}catch(e){}\n try {\ntry { o1(\"MSGestureEvent\"); } catch(e) {}try { try {\no1(\"setImmediate\");\n}catch(e){} } catch(e) {}\n}catch(e){}\n try {\n({ o9: !o3.call(o2, o1, '!') });\n}catch(e){}\n try {\nif (o0 != 2)\n try {\nprint(\"FAIL\");\n}catch(e){}\n else\n try {\nprint(\"PASS\");\n}catch(e){}\n}catch(e){}\n}", "static private internal function m121() {}", "static transient final private protected internal function m40() {}", "transient private protected public internal function m181() {}", "function o0(stdlib,o1,buffer) {\n try {\no8[4294967294];\n}catch(e){}\n function o104(o49, o50, o73) {\n try {\no95(o49, o50, o73, this);\n}catch(e){}\n\n try {\no489.o767++;\n}catch(e){}\n\n try {\nif (o97 === o49) {\n try {\nreturn true;\n}catch(e){}\n }\n}catch(e){}\n\n try {\nreturn false;\n}catch(e){}\n };\n //views\n var o3 =this;\n\n function o4(){\n var o30\n var o6 = o2(1.5);\n try {\no3[1] = o6;\n}catch(e){}\n try {\nreturn +(o3[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "function _p(t,e){0}", "transient final private protected public internal function m166() {}", "transient final private protected internal function m167() {}", "function o0()\n{\n var o1 = o21[o22] !== o21[o23];\n\n let o2 = 0;\n try {\nfor (var o3 = 0; o3 < 3; o4.o5++)\n {\n try {\no580 += o340[o335++] = 0;\n}catch(e){} // hoisted field load\n try {\nObject.defineProperty(o1, e, { o756: function (o31, o518, o486) {\n try {\nif (typeof (o486) === 'undefined') {\n try {\no486 = o518;\n}catch(e){}\n try {\no518 = 438 /* 0666 */ ;\n}catch(e){}\n }\n}catch(e){}\n try {\no518 |= 8192;\n}catch(e){}\n try {\nreturn o489.o526(o31, o518, o486);\n}catch(e){}\n }, configurable: true });\n}catch(e){}\n try {\no479.o508 += o16.push(\",\");\n}catch(e){} // implicit call bailout\n }\n}catch(e){}\n}", "function VeryBadError() {}", "function f_ext_3( a, b ) { null.should_not_be_called; return (a++) * 30 + (b++); }", "transient final protected internal function m174() {}", "function Closure() {\r\n}", "function e(){cov_1myqaytex8.f[0]++;cov_1myqaytex8.s[6]++;if(true){cov_1myqaytex8.b[4][0]++;cov_1myqaytex8.s[7]++;console.info('hey');}else{cov_1myqaytex8.b[4][1]++;const f=(cov_1myqaytex8.s[8]++,99);}}", "static final private protected internal function m103() {}", "static transient final protected public internal function m46() {}", "static transient private protected public internal function m54() {}", "static transient final private public function m41() {}", "static final private internal function m106() {}", "transient final private internal function m170() {}", "static transient final private protected public internal function m39() {}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function o0(e = 'default argument') {\n try { {\n var o3 = () => { try {\n'use strict';\n}catch(e){} }\n\n try {\no18(o3, \"Strict-mode lambda\");\n}catch(e){}\n } } catch(e) {}try { try {\nPromise.call(promise, undefined);\n}catch(e){} } catch(e) {}\n}", "function fourth() {}", "static final private protected public internal function m102() {}", "function fn() { return 3; }", "protected internal function m252() {}", "static transient final protected function m44() {}", "function f() {\n return function () { return function () { return function () {\n return function () { return function () { return function () {\n return function () { return function () { return function () {\n return function () { return function () { return function () {\n return function () { return function () { return function (a) {\n var v = a;\n\tassertEq(v, 42);\n\treturn function() { return v; };\n }; }; }; }; }; }; }; }; }; }; }; }; }; }; };\n}", "function main() {\n let a = 1;\n let b = 2;\n let c = -3;\n mystery(a,b,c);\n mystery(c,4,a);\n mystery(a + b, b + c, c + a);\n}", "function exercise07() {}", "static transient private internal function m58() {}", "function bar() { //1\n return 3;\n }", "function exercise11() {}", "function foo() {\n\treturn 42;\n}", "static private protected public internal function m117() {}", "exitA42(ctx) {\n\t}", "function a(e,t){return function(n){for(var a=new Array(arguments.length),i=\"error\"===e?n:null,o=0;o<a.length;o++)a[o]=arguments[o];t(i,this,e,a)}}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "static transient private public function m56() {}", "function t(e,n){return function(a){for(var t=new Array(arguments.length),i=this,o=\"error\"===e?a:null,r=0;r<t.length;r++)t[r]=arguments[r];n(o,i,e,t)}}", "function t(e,n){return function(a){for(var t=new Array(arguments.length),i=this,o=\"error\"===e?a:null,r=0;r<t.length;r++)t[r]=arguments[r];n(o,i,e,t)}}", "function reserved(){}", "function Gc(e,t,n,a){return new(n||(n=Promise))((function(r,i){function o(e){try{l(a.next(e))}catch(e){i(e)}}function s(e){try{l(a.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((a=a.apply(e,t||[])).next())}))}", "function f() {\n try {\n return 1;\n } finally {\n return 1;\n }\n }", "function g(e){this.state=i,this.value=void 0,this.deferred=[];var t=this;try{e(function(e){t.resolve(e)},function(e){t.reject(e)})}catch(e){t.reject(e)}}", "function a(e){this.state=ee,this.value=void 0,this.deferred=[];var t=this;try{e(function(e){t.resolve(e)},function(e){t.reject(e)})}catch(n){t.reject(n)}}", "function C(e,a,t,i){function n(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function u(d){try{l(i.next(d))}catch(y){s(y)}}function m(d){try{l(i.throw(d))}catch(y){s(y)}}function l(d){d.done?r(d.value):n(d.value).then(u,m)}l((i=i.apply(e,a||[])).next())})}", "function t(e,a){return function(n){for(var t=new Array(arguments.length),i=this,o=\"error\"===e?n:null,r=0;r<t.length;r++)t[r]=arguments[r];a(o,i,e,t)}}", "function Bare() {}", "function Bare() {}", "function pr(a,b){this.e=[];this.q=a;this.o=b||null;this.c=this.a=!1;this.b=void 0;this.k=this.p=this.i=!1;this.f=0;this.d=null;this.g=0}", "function foo(){\n return 42;\n}", "function P(){}", "function ReferenceCounter() {\r\n}", "function a(e,t){return function(n){for(var a=new Array(arguments.length),o=this,r=\"error\"===e?n:null,i=0;i<a.length;i++)a[i]=arguments[i];t(r,o,e,a)}}", "function nullFunc_ii(x) { err(\"Invalid function pointer called with signature 'ii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)\"); err(\"Build with ASSERTIONS=2 for more info.\");abort(x); }", "function f() {\n return 23;\n}", "warn() {}", "function _454 (){\n console.log('get a life'); \n}", "function i(e,t){return function(n){for(var i=new Array(arguments.length),a=\"error\"===e?n:null,r=0;r<i.length;r++)i[r]=arguments[r];t(a,this,e,i)}}", "function t(e,r){return function(n){for(var t=new Array(arguments.length),o=this,u=\"error\"===e?n:null,a=0;a<t.length;a++)t[a]=arguments[a];r(u,o,e,t)}}", "function nullFunc_ii(x) { err(\"Invalid function pointer called with signature 'ii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)\"); err(\"Build with ASSERTIONS=2 for more info.\");abort(x) }", "function a(e,t){return function(n){for(var a=new Array(arguments.length),i=this,r=\"error\"===e?n:null,o=0;o<a.length;o++)a[o]=arguments[o];t(r,i,e,a)}}", "function mistake3() {\n\tfunction a() { b(); }\n\tfunction b() { c(); }\n\tfunction c() { toss(\"data\"); }\n\ta();\n}", "function foo() {\r\n return 100;\r\n}", "function n(e,t){return function(r){for(var n=new Array(arguments.length),i=this,a=\"error\"===e?r:null,o=0;o<n.length;o++)n[o]=arguments[o];t(a,i,e,n)}}", "function o0() {\n var o1 = \"\";\n try {\nfor (var o14 = o0.o1(\"ES6ArrayUseConstructor_helper.js\",\"samethread\"); o2 < 40; o2++) {\n try {\no1 += \"bar\";\n}catch(e){}\n }\n}catch(e){}\n try {\n(function (o3) { })(o1);\n}catch(e){}\n}", "function gc(a,b){this.re=[];this.tg=a;this.cg=b||null;this.bd=this.Wb=!1;this.Pb=void 0;this.Cf=this.Rg=this.Ie=!1;this.ve=0;this.eb=null;this.Je=0}", "function test0() {\r\n var i32 = new Int32Array();\r\n if (i32[1988493697]) {\r\n try {\r\n obj0();\r\n } catch (ex) {\r\n } finally {\r\n }\r\n obj0;\r\n } else {\r\n var uniqobj6 = { lf0: {} };\r\n }\r\n}", "_removeDeadCode1(n, end) {\n for (; n && n != end;) {\n if (n.assign && n.assign.isCopy) {\n n.assign.writeCount--;\n n.assign = n.assign.copiedValue;\n n.assign.writeCount++;\n }\n // Remove assignments to variables which are not read\n if ((n.kind == \"call\" || n.kind == \"call_indirect\") && n.assign && n.assign.readCount == 0) {\n n.assign.writeCount--;\n n.assign = null;\n }\n else if (n.kind == \"end\" && n.prev[1]) { // The 'end' belongs to an 'if'?\n this._removeDeadCode1(n.prev[1], n.blockPartner);\n }\n else if (n.kind == \"decl_param\" || n.kind == \"decl_result\" || n.kind == \"decl_var\" || n.kind == \"return\") {\n // Do nothing by intention\n }\n else if (n.kind == \"copy\" && n.args[0] instanceof Variable && n.args[0].writeCount == 1 && n.args[0].readCount == 1) {\n let v = n.args[0];\n v.isCopy = true;\n v.copiedValue = n.assign;\n n.assign.writeCount--;\n v.readCount--;\n let n2 = n.prev[0];\n Node.removeNode(n);\n n = n2;\n continue;\n }\n else if (n.kind == \"copy\" && typeof (n.args[0]) == \"number\") {\n n.kind = \"const\";\n }\n else if ((n.kind != \"call\" && n.kind != \"call_indirect\" && n.kind != \"spawn\" && n.kind != \"spawn_indirect\") && n.assign && n.assign.readCount == 0) {\n let n2 = n.prev[0];\n for (let a of n.args) {\n if (a instanceof Variable) {\n a.readCount--;\n }\n }\n n.assign.writeCount--;\n Node.removeNode(n);\n n = n2;\n continue;\n }\n n = n.prev[0];\n }\n }", "function o0(o1) {\n try {\nwith (o1)\n {\n try {\no1100 = \n function o3() {\n try {\nreturn o22 += 1;\n}catch(e){}\n },\n\n o4 =\n function o5() {\n try {\nreturn {\n test:\n function o6() { try {\nreturn \"5\";\n}catch(e){} }\n };\n}catch(e){}\n }\n}catch(e){}\n }try {\n\n}catch(e){};try {\n\n}catch(e){};\n}catch(o684 < 0x4000){}\n\n var o3 = o3 || undefined;\n var o57=new stdlib.Uint16Array(buffer);\n\n try {\nreturn { o1: o1, o3: o3, o5: o5 };\n}catch(e){}\n}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}", "function i(t,e){0}" ]
[ "0.6362332", "0.61362815", "0.61112845", "0.604126", "0.60141814", "0.5952975", "0.59190834", "0.58674467", "0.5839824", "0.57828873", "0.5724699", "0.57164484", "0.57126486", "0.5683798", "0.5667226", "0.56649315", "0.5653329", "0.5641034", "0.56388104", "0.56264496", "0.5619859", "0.5596917", "0.55958295", "0.5588662", "0.55469453", "0.5508802", "0.5507128", "0.54886436", "0.54701906", "0.5454585", "0.5432488", "0.5429219", "0.5421372", "0.541967", "0.541967", "0.541967", "0.5417474", "0.54125863", "0.5403983", "0.53924453", "0.5386105", "0.5381502", "0.5376851", "0.5363904", "0.5343311", "0.5335001", "0.53324795", "0.5328718", "0.53121495", "0.5309729", "0.5303997", "0.53007895", "0.52858704", "0.52858704", "0.52858704", "0.5276839", "0.5267979", "0.5267979", "0.52664995", "0.5261434", "0.525853", "0.52514595", "0.524261", "0.52420515", "0.5235771", "0.52287126", "0.52287126", "0.52250767", "0.52247083", "0.52220243", "0.52214277", "0.5207121", "0.5204781", "0.5200971", "0.52009314", "0.5200012", "0.51989007", "0.5197151", "0.5192932", "0.51900923", "0.5190028", "0.51872355", "0.5187136", "0.5186441", "0.5169404", "0.516935", "0.5168528", "0.5158781", "0.51503664", "0.51503664", "0.51503664", "0.51503664", "0.51503664", "0.51503664", "0.51503664", "0.51503664", "0.51503664", "0.51503664", "0.51503664", "0.51503664", "0.51503664" ]
0.0
-1
parameter `x` is an inner variable inner function `add()` uses `x`, so it has a "closure" over it
function add(y) { return y + x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add(x) {\n // Add your code below this line - done\n return function(y) {\n return function(z) {\n return x+y+z;\n }\n }\n // Add your code above this line\n}", "function add(x) {\n return function(y) {\n return x + y;\n };\n }", "function add(x) {\n // Add your code below this line\n return function(y){\n return function(z){\n return x + y + z;\n }\n }\n // Add your code above this line\n}", "function add(x) {\n // Add your code below this line\n return function(y){\n return function(z){\n return x + y + z;\n }\n }\n\n // Add your code above this line\n}", "function addf(x) {\n return function(y) {\n return add(x, y);\n };\n}", "function add(x) {\n return function (y) {\n return function (z) {\n return x + y + z\n }\n }\n}", "function add(x) {\n \nreturn function(y) {\n return function(z) {\n return x + y + z\n }\n}\n\n \n}", "function add(x) {\n return function(y) {\n return x + y;\n } \n}", "function add(x){\n return function(y){\n return x + y\n }\n}", "function makeAdder(x) {\n\t// parameter `x` is an inner variable\n\n\t// inner function `add()` uses `x`, so\n\t// it has a \"closure\" over it\n\tfunction add(y) {\n\t\treturn y + x;\n\t};\n\n\treturn add;\n}", "function addByX(x) {\r\n \r\n function addValue(val) {\r\n\r\n return val + x;\r\n \r\n }\r\n \r\n return addValue;\r\n \r\n}", "function adds(x) {\n return function (y) {\n return x + y;\n };\n}", "function addNumbers(x) {\n return function (y) {\n return x + y;\n };\n}", "function add(x){\n //console.log(subtraction); //this however doesn't work because the parent function scope doesn't recognize values declared in the child scope\n \n var addition = \"yay math\";\n \n return function(y){\n \n //var subtraction = 'boo math'; //declared in the child scope and attempting to console log in parent scope to show closure\n \n console.log(addition); //this will log because the child scope remembers parent scope variables\n \n return x + y; //Notice how the x parameter is able to be used in the child function\n };\n}", "function addByX(x) {\n\tfunction generatedFunc(input) {\n return input + x;\n }\n return generatedFunc;\n}", "function add(n) {\n return function(m) {\n \treturn n + m;\n }\n}", "function add(a)\r\n{\r\n return function(b)\r\n {\r\n return a+b;\r\n }\r\n}", "function add(a){\n return function(b){\n return a+b;\n }\n}", "function add(a){\n return function(b){\n return a+b;\n }\n}", "function Add(x) {\n return function innerAdd(y) {\n return x + y;\n };\n}", "function add() {\n return a +90; // the callable object returns an expression (a) which is \n // defined outside of the callable object \n }", "function addition(x){\n return function(y){\n return x+y\n }\n}", "function sum(x) {\n return function(y) {\n var res = x + y;\n return function (z) {\n return z + res;\n }\n }\n}", "function add(a) {\n return function(b) {\n return a + b;\n };\n}", "function add(number){\n return function(a){\n return a + number;\n }\n}", "function sum(x){\n return function(y){\n return x+y\n }\n}", "function addf(a) {\n return (b) => {\n return add(a, b);\n };\n}", "function solution(a) {\n var add = a;\n\n function f(b) {\n add = a;\n add += b\n return add;\n }\n\n return f;\n}", "function makeAdder(x){\n return function(y){\n return x+ y ;\n }\n}", "function plus(x) {\n return function(y) {\n return x+y;\n }\n\n}", "function add () {\n var counter = 0\n function plus () {\n counter += 1\n }\n plus()\n return counter\n}", "function creaSumador(x) {\n return function(y) {\n return x + y;\n };\n }", "function addFn(x, y) {\n return x + y;\n}", "function add(y) {\n console.log(y, x);\n return y + x;\n // function rabbit(z) {\n // console.log(y, x, z);\n // return z+ y+x;\n // }\n }", "function addTwo(x) {\n return function(y) {\n return x + y;\n }\n\n}", "function add(a) {\n return self => add_(self, a);\n}", "function Addition(x){\r\n // it is return some reference no name of function just a refernce\r\n return function (y){\r\n return x+y;\r\n };\r\n}", "function add() {\n const result = [];\n return function () {\n if (arguments.length === 0) {\n return result.reduce(function (a, b) {\n return a + b;\n }, 0);\n }\n [].push.apply(result, [].slice.call(arguments));\n return arguments.callee;\n }\n }", "function makeAdder(x) {\n return function(y){\n return x + y;\n };\n}", "function add() {\n let counter = 5;\n\n function plus() {\n counter++;\n }\n plus();\n return counter;\n}", "function makeAdder(x) {\n\treturn function(y) {\n\t\treturn x + y;\n\t};\n}", "function add(n) {\n function addRandom(y) {\n function addAnother(x) {\n return (n + y + x)\n }\n return addAnother\n }\n return addRandom;\n}", "function addf(first) {\n return function (second) {\n return first + second;\n };\n}", "function add() {\n\tvar arg1 = arguments[0];\n\tvar arg2 = arguments[1];\n\tif (arg1 && arg2) {\n\t\tif (typeof arg1 == 'number' && typeof arg2 == 'number') {\n\t\t\treturn arg1 + arg2;\n\t\t}\n\t} else if (typeof arg1 == 'number') {\n\t\treturn function (x) {\n\t\t\treturn add(x, arg1);\n\t\t};\n\t} else {\n\t\treturn undefined;\n\t}\n}", "function makeAdd(num1) {\n return function (num2) {\n return num1 + num2;\n }\n}", "function createAddByFunction(firstNumber) {\n const someThing = 'something';\n return function(secondNumber) {\n console.log(someThing);\n return firstNumber + secondNumber;\n }\n}", "function sum(a) {\n\n\treturn function(b) {\n\t\treturn a + b; // takes 'a' from the outer lexical environment\n\t};\n}", "function makeAdder(x) {\n return function(y) {\n return x + y;\n };\n}", "function test(x){\n x = 10;\nx++;\nreturn function(){\n \nreturn x++; \n}\n}", "function sum(a){ \n return function(b){\n return a+b;\n }\n}", "function add() { //add is returning function . that fuction is invoke\n return function() { \n console.log('returned function called')\n \n }\n\n}", "function makeAdder(x) {\n return function (y) {\n return x + y;\n };\n}", "function addAnother() {\n return function(arg1, arg2) {\n return arg1 + arg2;\n }\n }", "function addBy(firstNumber) {\n return function (secondNumber) {\n return firstNumber + secondNumber;\n }\n}", "function add(y){\r\n return y + x;\r\n }", "function add1(x) {\n return x + 1;\n}", "function add(y) {\n return y + x;\n \n }", "function add(){\n this.counter = 0;\n var plus = () => {this.counter += 1};\n plus();\n}", "function seeClosure(x) {\n var x;\n return function(y) {\n return x * y\n }\n}", "function add() {}", "function getAdd() {\n let baz = 0;\n return function () {\n baz += 1;\n return baz;\n };\n}", "function add()\n{\n var xx = \"sdsjd\"; //variable declared inside function can only be used for that function(function scoped)\n}", "function fn(x){\n var privateVar = 8;\n \n return function(y) {\n return x + y + privateVar;\n }\n}", "function add(n1, n2) {\n let result = n1 + n2;\n console.log(myName); // this is global scope\n console.log(result);\n function double(num) {\n const total = num * n2;\n return total;\n }\n const doubleResult = double(4);\n console.log(doubleResult);\n\n return result;\n}", "add(x, y) {\n return x + y;\n }", "function add(accumulator, a) {\nreturn accumulator + a;\n}", "function add() {\n var args = Array.prototype.slice.call(arguments);\n if (args.length !== 2) {\n if (typeof args[0] !== 'number') {\n return undefined;\n }\n return function(a) {\n if (typeof a !== 'number') {\n return undefined;\n }\n return (a + args[0]);\n };\n } else {\n if (typeof args[1] !== \"number\") {\n return undefined;\n }\n return args[0] + args[1];\n }\n}", "function myFunc(x){\n\treturn function(y){\n\t\treturn x+y;\n\t};\n}", "function add3() {\n var counter = 0;\n function plus() {\n counter += 1;\n }\n plus();\n return counter;\n}", "function sum (a){\n return function (b){\n return a+b;\n }\n}", "function sum(a) {\n return function(b) {\n return a + b;\n }\n}", "function plus( b ) { return function( a ) { return a + b; }; }", "function addTwo(x) {\n x = x + 2;\n return x;\n\n}", "function sum(a) {\n return function(b) {\n return a+b\n }\n}", "function add() {\n var b = 2; // b is declared within the scope of the 'add' function\n return a + b; // add can access both a and b\n}", "function createAddition(y) {\n return function (x) {\n return x + y;\n };\n}", "function addFunction(x , y){ //Variables within this function are local to this function and are initialized here\n\t\n\treturn x + y; //When this function is called, will return the sum of the values of \"x\" and \"y\"\n\n}", "function addOne(x) {\r\n\tx++;\r\n}", "function add(a, b) {\n\n}", "function add(a,b){return a+b;}", "function multiplyByX(x) {\n\n console.log(\"x is:\", x)\n\n return function (num) {\n return num * x\n }\n}", "function combine(x) {\n let sum = x;\n return function sumInFunct(y) {\n sum += y;\n sumInFunct.result = sum;\n return sumInFunct;\n }\n}", "function add(x,y) {\n return x + y; \n}", "function add(x, y) { return x + y; }", "function add(x1,x2){\n return x1+x2;\n}", "function add(a, b) {return a+b;}", "function accumulator(sum) {\n return function (arg) {\n return (sum += arg);\n };\n}", "function add(a, b) {}", "function sum(x) {\n\treturn x + 2\n}", "function add(accumulator, a) {\n return accumulator + a;\n}", "function add(x, y) {\r\n console.log(x + y)\r\n}", "function calculate (num1, num2) {\n \n return function addTwo() {\n // closure: num1\n // closer: num2\n return num1 + num2;\n }()\n\n}", "function add(y){\n return x + y;\n }", "function addCurry(a) {\n return function (b) {\n return a + b;\n }\n}", "function add(x,y) {\n return x + y;\n}", "function add(x, y) {\n return x + y\n}", "function add(x, y) {\n return x + y\n}", "function upfrontFoo(x,y) {\n var sum = x + y;\n return function() { return sum }\n}", "function add()\n{\n var xx = \"dsd\";\n}" ]
[ "0.78979313", "0.78437227", "0.78434503", "0.78150105", "0.777378", "0.7771953", "0.7706601", "0.761374", "0.756176", "0.7557953", "0.7373579", "0.7358242", "0.72124434", "0.7152574", "0.7115261", "0.70607173", "0.70409715", "0.70261705", "0.70261705", "0.7019564", "0.7009581", "0.70092905", "0.6993782", "0.6930172", "0.6904108", "0.6863766", "0.68307173", "0.68042916", "0.6767974", "0.67503697", "0.6738425", "0.67345023", "0.67140615", "0.6710677", "0.66850114", "0.6683308", "0.6646648", "0.66416305", "0.66378015", "0.6626259", "0.6595062", "0.6555375", "0.6546116", "0.6538563", "0.6534526", "0.6513071", "0.6495765", "0.64938176", "0.6485346", "0.6484891", "0.6480949", "0.64784867", "0.64772236", "0.64451987", "0.6433618", "0.6430369", "0.64211285", "0.6416235", "0.64032596", "0.6394692", "0.63896424", "0.63877827", "0.6370797", "0.634213", "0.6335551", "0.63119817", "0.6309927", "0.63032407", "0.6294984", "0.627948", "0.627412", "0.6253909", "0.6226647", "0.6223299", "0.62135077", "0.62103385", "0.6202677", "0.61848426", "0.61837095", "0.6171133", "0.6167453", "0.61609435", "0.613813", "0.6136608", "0.6136285", "0.61318326", "0.6128873", "0.61157227", "0.61137867", "0.6111139", "0.61009496", "0.6097338", "0.6087339", "0.6081233", "0.608088", "0.6078637", "0.6078637", "0.60644907", "0.60626733" ]
0.6194325
78
23 < 10 + 13 / this
function foo() { console.log( this.bar ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function r(a){return a%100==11?!0:a%10!=1}", "function e(A){return A%100===11||A%10!==1}", "function t(r){return r%100==11?!0:r%10!=1}", "function a(e){return e%100===11||e%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function e(t){return t%100===11||t%10!==1}", "function lessThan13(x){\r\n return x < 13;\r\n}", "function a(e){if(e%100===11){return true}else if(e%10===1){return false}return true}", "function a(e){if(e%100===11){return true}else if(e%10===1){return false}return true}", "function a(e){if(e%100===11)return true;else if(e%10===1)return false;return true}", "function a(e){return e%100==11||e%10!=1}", "function divisibleBy10(num){\n\treturn function(){\n\t\tvar x = num;\n\t\treturn ((x%10) === 0);\n\t}\t\n}", "function o(t){if(t%100===11){return true}else if(t%10===1){return false}return true}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function t(e){return e%100===11||e%10!==1}", "function c(e){return e%100===11||e%10!==1}", "function a(e) {\n if (e % 100 === 11) {\n return true\n } else if (e % 10 === 1) {\n return false\n }\n return true\n }", "function makesTen(x, y) \n{\n return ((x == 10 || y == 10) || (x + y == 10));\n}", "function e(t){return t%100==11||t%10!=1}", "function e(t){return t%100==11||t%10!=1}", "function e(t){return t%100==11||t%10!=1}", "function e(t){return t%100==11||t%10!=1}", "function e(t){return t%100==11||t%10!=1}", "function e(t){return t%100==11||t%10!=1}" ]
[ "0.6753631", "0.6742874", "0.66258883", "0.658666", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6508289", "0.6493091", "0.64599264", "0.64599264", "0.6413271", "0.6389272", "0.6388476", "0.63797253", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.6371166", "0.63666177", "0.6291457", "0.6278553", "0.62774885", "0.62774885", "0.62774885", "0.62774885", "0.62774885", "0.62774885" ]
0.0
-1
gets newest record from database
function fetchNewContent() { $(".sidebar").animate({scrollTop: 0}, "swing"); $("#sidebar-content").prepend("<div class='sidebarItem placeholderItem' id=''><a class='placeholderLink' href=''><h3 class='placeholderTitle'>/</h3></a><h4 class='placeholderDate'>/</h4><a class='placeholderLink' href=''><div class='thumbnail placeholderImg' style='background-color:black;'></div></a>"); $(".placeholderItem").css("animation", "heightAnimation 1.5s ease forwards"); $.ajax({ type: "GET", url: "fetchNewContent.php", dataType: "html", success: function(response){ loadNewContent(response); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getLatest() {\n const result = await this.ctx.model.Card.findOne({\n order: [[\"CreateTime\", 'DESC']]\n });\n return result;\n }", "function getLastRecord(req, res) {\n return RecordModel.find().sort({ $natural: -1 }).limit(1)\n .exec((err, record) => {\n if (err) {\n res.status(500);\n res.send('Error found');\n } else {\n res.json(record);\n }\n });\n}", "function getLatest() {\n Paste.find({}).sort('-createdAt').limit(10).exec(function(err, result) {\n if (err) throw err;\n latest_pastes = result;\n //console.log('Scraped succesfully')\n //res.send(result);\n\t})\n}", "function getInfofromDB(){\n\tvar newData = new dataJs({\n\t\tid : ' ',\n\t\ttime : ' '\n\t\t});\n\tnewData.get('517',function(err,data){\n\t\tlast_id = data.id;\n\t\tconsole.log(last_id);\n\t\tgetJSON();\n\t});\n}", "async _primeLastMessage() {\n try {\n console.log(\"Getting latest message\");\n let lastMessage = await this.connection\n .from('message')\n .orderBy('date', 'DESC')\n .limit(1)\n\n console.log(\"FETCHING MESSAGE\", lastMessage);\n this.lastRetreivedMessage = lastMessage[0].date;\n } catch (e) {\n console.error(e)\n }\n }", "binanceLastMessage(){\n let query = `select * from binancemessages order by id desc limit 1`;\n \n return new Promise((resolve, reject) => {\n db.query(query, (err, data) => {\n if (err)\n reject(new errModel(err.code, err));\n else\n resolve(data)\n })\n })\n }", "function getLatest(req, res, next) {\n Model.find({ userId: req.userId }).\n limit(5).sort({ createdAt: -1 }).\n then((doc) => {\n const resObj = new ResponseObject(\n resMessage.successMessage,\n doc\n );\n res.json(resObj);\n }).\n catch((err) => {// connection errors\n res.statusCode = 500;\n err.message = resMessage.connectionError;\n next(err);\n })\n}", "static async getLatestRevisionIndex() {\n\n const latestRevision = await this.findOne()\n .sort('-_id')\n\n return latestRevision ? latestRevision._id : 0\n\n }", "function findMostRecentWorkout(res, cb){\n db.Workout.findOne({}).sort({day:-1}) \n .then((data)=>{\n // cb(data);\n res.json(data);\n })\n}", "function getUltimoTiempo(callback) {\n\tTiempo.findOne({}, {}, { sort: { 'fecha' : -1 } }, callback);\n}", "ethereumLastMessage(){\n let query = `select * from ethereummessages order by id desc limit 1`;\n\n return new Promise((resolve, reject) => {\n db.query(query, (err, data) => {\n if (err)\n reject(new errModel(err.code, err));\n else\n resolve(data)\n })\n })\n }", "function newestOrder() {\n\torders = allOrders;\n\tif(orders.length == null) return newestOrder()\n\tid = 0\n\tfor(var y = 0; y < orders.length; y++) {\n\t\tcurrentid = orders[y].order_id;\n\t\tif(currentid > id) {\n\t\t\tid = currentid;\n\t\t}\n\t}\n\treturn id\n}", "getLastUpdated(id) {\n return this.getData(id)\n .then(data => data.length ? data[data.length - 1].timestamp : null);\n }", "function api_get_newest_messages(req, res) {\n\n Message.find({type : 'update'}).sort({time:-1}).limit(5).exec(function(err, messages) {\n\tif(!err) {\n\t\tvar m = new Array();\n\n\t\tfor (var i = 0; i < messages.length; i++) {\n\t\t\tvar r = messages[i].toObject();\n\t\t\tr.id = messages[i]._id.toHexString();\n\t\t\tm.push(r);\n\t\t}\n\t\tres.json(200, m);\n\t} else {\n\t\tres.json(500, {message : \"Error while getting newest updates\" });\n\t}\n });\n}", "function allNotes(){ \n var sql_statement = \"q=SELECT * FROM \"+ table_name +\" ORDER BY created_at DESC LIMIT \" + notes_limit;\n queryCarto(sql_statement);\n}", "async lastItem() {\n if (this.response.length <= 0) {\n await this.executeQuery();\n }\n\n return this.response[this.response.length - 1];\n }", "function getLatestOrder() {\n var cronCollection = SyncedCron._collection;\n\n // Only get the latest result. Ignore entries with no results (errors)\n var latestCron = cronCollection.findOne(\n { result: { $exists: true } }, {sort: {finishedAt: -1}, limit:1}\n );\n\n // Make sure to populate the value even if it doesn't exist in the DB\n // This can happen during testing or if the location numbers change.\n var latestOrder;\n if (typeof latestCron === 'undefined') {\n latestOrder = 0;\n }\n else {\n if (latestCron.result.hasOwnProperty('locOrder')) {\n latestOrder = latestCron.result.locOrder;\n }\n else {\n latestOrder = 0;\n }\n }\n\n return latestOrder;\n}", "static findArticleMostRecent() {\n return articleModelHereInService.find({}).sort({_id:-1}).limit(1)\n .then(\n (whatIGot) => {\n // resolved\n console.log('Most Recent Article - whatIGot ', whatIGot);\n /*\n {\n _id: 5af746cea7008520ae732e2c,\n articlePhotos: [ '\"justsomestring\"' ],\n articleUrl: 'myhttp',\n articleTitle: 'Trump’s WAYZO Gots to go 3345 Twice BAZZhhhhARRO We Love The Donald older Ye Olde Edite HONESTLY REALLY CRAZY VERY INEFFICIENT Fuel Efficiency Rollbacks Will Hurt Drivers',\n __v: 0\n}\n */\n\n return whatIGot;\n },\n (problemo) => {\n // rejected\n console.log('Data Service findArticleMostRecent() problemo: ', problemo);\n }\n )\n .catch((err) => console.log('Data Service findArticleMostRecent() CATCH err ', err));\n }", "get(db) {\n return db\n .get(\"notes\")\n .orderBy(\"created\", \"desc\")\n .value();\n }", "lastCourseId() {\r\n this.log(\"retrieving last entry id\");\r\n return this.context\r\n .retrieveSingle(` \r\n SELECT last_insert_rowid() AS id;\r\n `);\r\n }", "getRecentUpdate() {\n return this.updates[0];\n }", "function getLastOrderId() {\n return Orders.find({}).sort({\"id\": -1}).limit(1).exec()\n .then(orders => {\n return orders[0].id;\n })\n .catch(err => {\n console.log(\"Error getting max orders id\", err);\n });\n}", "function getLastCaseId() {\n return Case.query()\n .select(\"case_id\")\n .orderBy(\"case_id\", \"desc\")\n .limit(1)\n .then(response => {\n console.log(response == true);\n if (response) {\n return response;\n } else {\n return false;\n }\n });\n}", "getMostRecent(req, res) {\n // SQL for most recent projects.\n // TODO - factor out KpiProjects, we're not using it now.\n /*\n let sql = \"select id, title, description, startAt, ProjectUpdated, \" +\n \" greatest(ProjectUpdated, COALESCE(TUdate, '2000-01-01'), \" +\n \" COALESCE(TCdate, '2000-01-01'), COALESCE(KUdate, '2000-01-01'), \" +\n \" COALESCE(KCdate, '2000-01-01')) as MostRecent from \" +\n \" (select P.id as id, P.title, P.description, P.startAt, P.updatedAt as ProjectUpdated , \" +\n \" (select max(T.updatedAt) from Tasks T where T.projectId = P.id) as TUdate, \" +\n \" (select max(T.createdAt) from Tasks T where T.projectId = P.id) as TCdate, \" +\n \" (select max(K.updatedAt) from Kpis K, KpiProjects KP where K.id = KP.kpiId \" +\n \" and P.id = KP.projectId) as KUdate, \" +\n \" (select max(K.createdAt) from Kpis K, KpiProjects KP where K.id = KP.kpiId \" +\n \" and P.id = KP.projectId) as KCdate \" +\n \" from Projects P) as Proj \"; */\n let sql = \"\";\n return models.sequelize\n .query(sql,\n {\n type: models.sequelize.QueryTypes.SELECT,\n limit: 3,\n order: [[\"MostRecent\", \"DESC\"]]\n }\n )\n .then(projects => {\n res.status(200).send(projects);\n })\n .catch(error => {\n logger.error(error.stack);\n res.status(400).send(error);\n });\n }", "function getMostRecentChat() {\n var id = $(\"#last-chat-id\").val();\n ajax(\"GET\", true, \"api/Chat/\" + id, null, function(chatData) {\n $.each(chatData, function (i, val) {\n insertNewChat(val);\n }); \n });\n}", "get newestObject() {\n\n\t\tif(this.#_augmentaScene.objectCount == 0) {\n\t\t\tconsole.log('No object in scene')\n\t\t} else {\n\n\t\t\tvar minId = Object.keys(this.#_augmentaObjects)[0];\n\t\t\tvar minAge = this.#_augmentaObjects[minId].age;\n\n\t\t\tfor(var id in this.#_augmentaObjects) {\n\t\t\t\t\n\t\t\t\tif(this.#_augmentaObjects[id].age <= minAge && id > minId) {\n\t\t\t\t\tminAge = this.#_augmentaObjects[id].age;\n\t\t\t\t\tminId = id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.#_augmentaObjects[minId];\n\t\t}\n\t}", "function getLatestInfo() {\n\t\t\treturn $http.get('http://localhost:4000/articles?latestInfo=true').success(function (res) {\n\t\t\t\treturn res;\n\t\t\t});\n\t\t}", "function latestDate(latest, updated) {\n return ItemService.latestDate(latest, updated);\n }", "static async latestVersion() {\n // Load the latest migration details from the database.\n let latestMigration = await MigrationModel.find({})\n .sort({ version: -1 })\n .limit(1)\n .exec();\n\n // If there weren't any migrations at all, then error out.\n if (latestMigration.length === 0) {\n return null;\n }\n\n // If the latest migration does not match the required version, then error\n // out.\n return latestMigration[0].version;\n }", "function getMostRecentChats(callback){\n\t\tChatRoom.find({}, {dateModified:1, title:1}).sort({'dateModified': -1}).limit(10).exec(function(err, docs){\n\t\t\trecentChats = docs;\n\t\t\tcallback(recentChats);\n\t\t});\n\t}", "static first() {\n\t\treturn query( \tthis,\n\t\t\t\t\t\tdb( namer.toTableName( this.name ) )\n\t\t\t\t\t\t.select( '*' )\n\t\t\t\t\t\t.limit( 1 ) )\n\t\t\t.then( ( models ) => models.length ? models[0] : undefined );\n\t}", "function getLastMeetingday(callback) {\n const q = 'SELECT MAX(Date) AS Date FROM MeetingDays WHERE Date < date(\"now\");';\n db.get(q, [], (err, result) => {\n if (err) return callback(err);\n return callback(null, result.Date);\n });\n}", "getAllActivity(db) {\n return db\n .select('*')\n .from('activity')\n .orderBy('date_created', 'desc'); //used to be id\n // Put the limit on client side\n \n }", "function getLastAddedSongId(req, res, mysql, lastId, complete2){\r\n var query = \"SELECT id FROM Song ORDER BY id DESC LIMIT 1\";\r\n mysql.pool.query(\"SELECT id FROM Song ORDER BY id DESC LIMIT 1\", function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n\t else {\r\n\t lastId.value = results[0].id;\r\n\t complete2();\r\n\t }\r\n });\r\n }", "getLastestProduct(limit) {\n const query =\n `select p._id, p.name, p.category_id, c.name as category, p.user_id as author_id, u.full_name as author_name, p.url_image, p.create_at, p.score, p.number_reviews\n from products p\n left join categories c\n on p.category_id = c._id\n left join users u\n on p.user_id = u._id\n where p.deleted = 0\n order by p.create_at desc\n limit ` + limit;\n return db.raw(query).then((results) => results[0])\n }", "function getLatestValue() {\n latestValue = sortedByTime[sortedByTime.length - 1].value;\n\n }", "getLastSync (req, res) {\n sqlService.getLastSync(req.user.user_id)\n .then((result)=>{\n res.status(200).send(result)\n })\n }", "function getCurrentWeight(callback){\n\n var openReq = window.indexedDB.open(\"weightTracker\");\n\n openReq.onsuccess = function() {\n var db = openReq.result;\n var transaction = db.transaction(['weight_history'], 'readonly');\n var objectStore = transaction.objectStore('weight_history');\n var index = objectStore.index('date');\n var openCursorRequest = index.openCursor(null, 'prev');\n var maxObject = null;\n\n openCursorRequest.onsuccess = function (event) {\n if (event.target.result) {\n maxObject = event.target.result.value; //the object with max revision\n }\n };\n\n transaction.oncomplete = function (event) {\n db.close();\n if(callback) {\n \t callback(maxObject);\n } \n };\n }\n}", "function getLastRecord(sumlist) {\n var oldestDate=new Date();\n var oldestIndex=-1;\n oldestDate.setTime(0);\n for (var i=0;i<sumlist.length;i++) {\n var entry = sumlist[i];\n if (entry.amt>0 && entry.date>oldestDate) {\n oldestDate=entry.date;\n oldestIndex=i;\n }\n }\n return oldestIndex;\n}", "function dbReadStockAll()\n{\n var db = dbGetHandle()\n var results;\n\n db.transaction(function (tx) {\n results = tx.executeSql('SELECT rowid, idNumber, product_name, product_price FROM stock_DB order by rowid desc')\n })\n return results\n}", "static getMostRecentBoardItem(board_id) {\n return Requests.httpGETRequest('/v1/clipboard/' + board_id + '?type=most_recent')\n }", "getLastWeightLogs(email) {\n return new Promise(function (resolve, reject) {\n let sql = `SELECT \n email, date, weight, height, bmi, bmi_class \n FROM weight_log \n WHERE email=?\n ORDER BY rowid DESC`;\n db.all(sql, [email], (err, rows) => {\n if (err) {\n reject(Error(\"Error:\" + err.message));\n }\n resolve({\n email: rows[0].email,\n date: rows[0].date,\n weight: rows[0].weight,\n height: rows[0].height,\n bmi: rows[0].bmi,\n bmiClass: rows[0].bmi_class,\n });\n });\n });\n }", "async function lastMeasurement() {\n const result = await database.execute(\"SELECT * FROM SensorData ORDER BY id DESC LIMIT 0, 1\");\n\n // Result is the second item in a tuple\n const reading = result[0][0]\n \n // Return result in proper json format\n return {prevTemperature:reading.temperature, prevHumidity:reading.humidity, timestamp:reading.timestamp};\n}", "async getLatestId() {\n return (await this._withDb(async (db) => await db.get(\n 'SELECT id FROM images WHERE NOT deleted ORDER BY id DESC LIMIT 1'\n )))['id'];\n }", "async function getMaxTodoId() {\n const res = await query(\n `SELECT id FROM todos WHERE id=(SELECT max(id) FROM todos)`\n );\n console.log(\"max id result\", res.rows[0].id);\n return res.rows;\n}", "_get(date, cb) {\n const _self = this\n const request = date === 'all' ?\n db.transaction(['table_number']).objectStore('table_number').getAll() : db.transaction(['table_number']).objectStore('table_number').get(date)\n request.onsuccess = (e) => {\n if (request.result) {\n cb && cb.call(_self, request.result)\n } else {\n request.onerror = (e) => _tip(date === 'all' ? '数据库没有任何记录!' : '未找到该期记录!', 'danger')\n }\n }\n request.onerror = (e) => _tip('事务失败!', 'danger')\n }", "static getLastBlock(){\n return new Promise((resolve, reject) => {\n resolve(DB.transactionLastBlock())\n }).catch( err => {\n reject(err)\n })\n }", "function getAllPosts() {\n return db.execute('SELECT * FROM post ORDER BY timeposted DESC;');\n}", "getMostRecentKey() {\r\n return this.listOfMostRecent.head.key;\r\n }", "last() {\n this._followRelService(\"last\", \"List\");\n }", "function getRecord(id){\n return MIRESAdmin.firestore().collection(MIRESconfig.MIRES_log).orderBy(\"timestamp\",\"asc\").where(\"transaction_id\",\"==\",id).limit(1).get()\n .then(querySnapshot => {\n if (querySnapshot.empty)\n {\n throw new Error(\"getRecord function: log is empty.\");\n } \n else \n { \n return querySnapshot.docs[0];\n }\n }) \n .catch(err => {\n throw new Error(\"getRecord function: \"+ err);\n });\n}", "function readLatestMessage() {\n messenger.fetchChatMessages(selectedChatId)\n .then(function (messages) {\n if (messages.length > 0) {\n messenger.chatMessageRead(selectedChatId, messages[messages.length - 1].messageId);\n }\n });\n}", "function readMostRecentListItem(listName)\n {\n var siteUrl = getSiteUrl();\n var deferred = $q.defer();\n\n $http.get(siteUrl + \"/_api/web/lists/GetByTitle('\" + listName + \"')/items?$orderby=Modified+desc&$top=1\", getGetConfig())\n .then(function (response) {\n deferred.resolve(response.data.d.results[0]);\n })\n .catch(function (response) {\n if (response.status === 404) {\n // If here the list needs to be created\n deferred.reject(\"Item not found in list \" + listName);\n } else {\n // If here something bad happened\n deferred.reject(\"Error \" + response.status + \"reading item from list \" + listName);\n }\n });\n\n return deferred.promise;\n\n }", "getMostRecentKey() {\n return this.listOfMostRecent.head.key;\n }", "function getLatestRevision(continuekey,maxmatches,data) {\n var url=\"action=query&list=recentchanges&rclimit=\"+maxmatches;\n if(continuekey){\n url+=\"&rccontinue=\"+continuekey;\n }\n if(postdata.from){\n //The date and time to start listing changes\n //Note that this must be in YYYY-MM-DDTHH:MM:SSZ format\n url+=\"&rcend=\"+postdata.from;\n }\n if(postdata.until && postdata.from){\n //The date and time to end listing changes\n //Note that this must be in YYYY-MM-DDTHH:MM:SSZ format\n url+=\"&rcstart=\"+postdata.until;\n }\n utils.downloadJSONfromBakaTsukiMediaWiki(url, function(jsondata){\n var edits=jsondata.query.recentchanges;\n if(jsondata[\"query-continue\"] && jsondata[\"query-continue\"].recentchanges){\n continuekey= jsondata[\"query-continue\"].recentchanges.rccontinue;\n }\n //Here we can't use a map and filter because data.push is exponentially slow \n //as the pushed items gets bigger.\n for(var key in edits){\n var ele=edits[key];\n if (ele.type==\"new\" && data.length<postdata.updates && !ele.title.match(/^User|^Talk|Registration/i)){\n data.push({\n \"title\": ele.title,\n \"pageid\": ele.pageid,\n \"timestamp\": ele.timestamp,\n \"revid\":ele.revid\n }); \n }\n }\n if(edits.length<maxmatches || data.length>=postdata.updates){ \n res.send(data);\n }else{\n getLatestRevision(continuekey,maxmatches,data);\n }\n })\n }", "function get_oldest_rental(parameters, transaction) {\n return Rental.findAll({\n where: {\n book_id: parameters['book_id'],\n return_date: {\n $eq: null\n }\n },\n include: [\n {\n model: Book,\n attributes: ['id', 'title']\n },\n {\n model: Account\n }\n ],\n order: ['Rental.id'], transaction: transaction\n });\n}", "lastInsert() {\n return this._lastInsert;\n }", "function lastPost(threadId, threadTitle, counter, total) {\n var getLastPost = new Promise(\n function(resolve, reject) {\n Post.find({ threadId : threadId}).sort({ 'created' : -1}).limit(1).exec(function(err, post) {\n if (err) throw err;\n if (post) {\n resolve(post);\n }\n });\n }\n );\n getLastPost.then(\n function(val) {\n\n findUser(threadId, threadTitle, counter, total, val[0].user, val[0].content, val[0].created);\n }\n )\n .catch(\n function(reason){\n console.log('last post not found due to ' + reason);\n }\n );\n }", "function request_latest_records()\r\n{\r\n //sock_send_str('{ \"msg_type\": \"rt_request\", \"request_id\": \"A\", \"options\": [ \"latest_records\" ] }');\r\n var msg = { options: [ 'latest_records' ] };\r\n rt_mon.request('A',msg,handle_records);\r\n}", "function last(grid) {\r\n begintime = new Date();\r\n grid.recordset.MoveLast();\r\n if (isEmptyRecordset(grid.recordset) || grid.recordset(\"ID\").value == \"-9999\")\r\n return false;\r\n endtime = new Date();\r\n\r\n return true;\r\n}", "static getId() {\n // get id of last inserted article\n this.command = \"SELECT id FROM articles ORDER BY id DESC LIMIT 1;\";\n db.get(this.command, (error, value) => {\n if (error) {\n response.send(`Error: ${error.message}`);\n } else {\n return checkLastId(value);\n }\n });\n }", "_get (id) {\n id = this._objectifyId(id);\n\n return this.Model.findOne({ [this.id]: id }, { '_revision.history': 0 })\n .then(data => {\n if (!data) {\n throw new errors.NotFound(`No record found for id '${id}'`);\n }\n\n return data;\n })\n .catch(errorHandler);\n }", "function getrecent(info) {\n return info[info.length - 1]\n}", "function fetchNew() {\n\trequest(\"http://www.reddit.com/r/\" + subreddit + \"/new/.json\", function(err, body, resp) {\n\t\tif (err) {\n\t\t\tthrow err;\n\t\t\treturn;\n\t\t}\n\n\t\tvar data = JSON.parse(resp);\n\t\tvar posts = data.data.children;\n\n\t\t// Loop through posts chronologically.\n\t\tfor (var i = posts.length-1; i >= 0; i--) {\n\t\t\tvar thisPost = posts[i].data;\n\n\t\t\t// If this post is new since the last check, display it.\n\t\t\tif (thisPost.created_utc > latest) {\n\t\t\t\tlatest = thisPost.created_utc;\n\t\t\t\tprintPost(thisPost);\n\t\t\t}\n\t\t}\n\n\n\t});\n}", "async poll() {\n let qual = Object.values(this.all).\n filter(follow => !this.updating.includes(follow) && isOutOfDate(follow, this.fetched))\n if (qual.length > 0) {\n let oldest = qual.reduce((old, follow) =>\n (fetchedAt(this.fetched, old.id) || 0) > (fetchedAt(this.fetched, follow.id) || 0) ? follow : old)\n if (oldest) {\n let lastFetch = this.fetched[oldest.id]\n this.updating.push(oldest)\n console.log(`Updating ${oldest.title || oldest.actualTitle}`)\n await feedycat(this, oldest, lastFetch)\n this.markFetched(oldest)\n this.updating = this.updating.filter(follow => follow != oldest)\n if (lastFetch.status != 304) {\n this.update({op: 'replace', path: `/all/${oldest.id}`, value: oldest})\n this.write({update: false, follows: [oldest.id]})\n }\n }\n }\n }", "function lastquery(){\n\tGestion.methods.getResult().call(function(error, result){\n\t\tif(!error){\n\t\t\tconsole.log(result);\n\t\t\tsetTimeout(function(){ecrire()},120);\n\t\t}\n\t\telse\n\t\t\tconsole.error(error);\n\t});\n}", "function getLatestDataHelper() {\n for (var i = 0; i <= grid.cells - 1; i++) {\n latest.push(rawData[i])\n }\n}", "function getLatestDate(){\r\n\tvar deferred = $.Deferred();\r\n\t\r\n\t//var Last_Date = new Date(\"sept 10, 2014 11:30\");\r\n\tvar Last_Date = new Date();\r\n\r\n\t//today's deals\r\n\tvar string_Date = Last_Date.toDateString();\r\n\tLast_Date = new Date(string_Date);\r\n\t//console.log(Last_Date);\r\n\t//end\r\n\r\n\tvar sLast_Date = Last_Date.toString();\r\n\t\r\n\tchrome.storage.sync.get({\r\n \tLast_Seen: sLast_Date\r\n \t}, function(items) {\r\n\t\t\r\n \t\tsLast_Date = items.Last_Seen;\r\n\t\tvar d = new Date(sLast_Date);\r\n\t\t\r\n\t\tconsole.log(d);\r\n\t\tdeferred.resolve(d);\r\n \t});\r\n\treturn deferred.promise();\r\n}", "static async findLastOne() {\n\t\tparams.ScanIndexForward = false\n\t\tparams.Limit = 1\n\t\ttry {\n\t\t\tlet result = await docClient.scan(params).promise();\n\t\t\treturn result\n\t\t} catch (err) {\n\t\t\tconsole.error(\"There was a problem recovering : \", err)\n\t\t}\n\t}", "function getLastIdInvoice(cb) {\n invoiceDB.find({}).sort({ id_invoice: -1 }).limit(1).exec(function (err, data) {\n if (err) {\n return cb(err);\n } else {\n if (data[0]) {\n return cb(data[0]['id_invoice']);\n } else {\n return \"0000\";\n }\n }\n });\n}", "static getLatest() { \r\n return fetch(\"<api-end-point>\").then(result => result.json());\r\n }", "function dbReadStockOutAll()\n{\n var db = dbGetHandle()\n var results;\n try{\n db.transaction(function (tx) {\n results = tx.executeSql('SELECT rowid, idNumber, product_name, product_price FROM stock_DB_Out order by rowid desc')\n })} catch(err){\n console.log(\"Error reading in database: \" + err)\n };\n\n return results\n}", "get_last_update() {\n return this._last_update\n }", "function getById(){\n\tvar deferred = Q.defer();\n\n var mysort = {id: 1};\n\n\tdb.specification.find().sort(mysort).toArray(function(err, spec){\n\t\t\tif(err) deferred.reject(err);\n\n\t\t\tif(spec){\n\t\t\t\t\tdeferred.resolve(spec);\n\t\t\t}else{\n\t\t\t\tdeferred.resolve();\n\t\t\t}\t\t\n\t});\n\treturn deferred.promise;\n}", "async latest (req, res) {\n const queries = req.user.queries\n const ads = await Ad\n .find({query: {'$in': queries}})\n .sort({date: 'desc'})\n return res.send(ads)\n }", "function getLastRevision(auth, fileId) {\n console.log(\"getting revisions...\");\n var service = google.drive('v2');\n service.revisions.list({\n auth: auth,\n fileId: fileId\n }, function(err, response) {\n if (err) {\n console.log('The API returned an error: ' + err);\n return;\n }\n var revisions = response.items;\n if (revisions.length == 0) {\n console.log('No revisions.');\n } else {\n console.log('Latest revision:');\n console.log(revisions[revisions.length-1].modifiedDate);\n\n //get modification time (parsed as unix time)\n var lastRevisionTime = Date.parse(revisions[revisions.length-1].modifiedDate);\n\n if (lastRevisionTime > lastChangeTime) {\n lastChangeTime = lastRevisionTime;\n editDelta = Date.now() - lastChangeTime;\n\n console.log(\"sending revision data...\");\n if (useSerial) {\n sendSerialData();\n }\n else {\n sendCloudData(editDelta, activityFunction);\n }\n }\n }\n });\n}", "async getLastReading(sensorId) {\n const reading = await knex('readings')\n .select('value')\n .where({ sensor_id: sensorId })\n .orderBy('time', \"desc\")\n .limit(1);\n const result = (reading[0] === undefined) ? { value: \"none\" } : reading[0];\n return result;\n }", "function getSensorLastTime(timeKey) {\n\tif(!sensorID) {\n\t\tconsole.log('The sensor key is not gotten.');\n\t}\n\tvar categoryName = categories[0];\n\tvar categoryRef = db.ref(`/${SENSORDATA_TABLE}/${categoryName}/${sensorID}/series`);\n\tcategoryRef.orderByChild('timestamp').limitToLast(1).once(\"value\", function(snapshot) {\n\t\tsnapshot.forEach(function(childSnap) {\n\t\t\tvar categoryData = childSnap.val();\n\t\t\tconsole.log('---Last time at ---');\n\t\t\tconsole.log(categoryData['value'][timeKey]);\n\t\t});\n\t});\n}", "function getLastID () {\n var temp = DonoList;\n\n temp.sort(function (a, b) {\n if (a.id > b.id) {\n return 1;\n }\n if (a.id < b.id) {\n return -1;\n }\n\n });\n\n return temp[temp.length -1].id\n }", "function getLastUpdateDate(){\n return lastUpdateDate;\n }", "function getOldest() {\n if(debug) {\n var tweetIds = [];\n $.each($('.tweet'), function(tweet) {\n tweetIds.push($(this).attr('data-tweet'));\n });\n tweetIds.sort(function(a, b) {return b-a});\n console.log('Tweet IDs on page: ' + tweetIds);\n console.log('Oldest should be: ' + tweetIds.pop());\n }\n var oldestTweet = $('.tweet').last().attr('data-tweet');\n if(debug) {\n console.log('Oldest sent: ' + oldestTweet);\n }\n return oldestTweet;\n }", "static first() {\n\t\treturn adapter(this).select({\n\t\t\tlimit: 1,\n\t\t\tfirst: true,\n\t\t\tmodel: this\n\t\t})\n\t}", "function getLastUpdate(){\r\n\t\tvar theDate = new Date();\r\n\t\t$.ajax({\r\n\t\t\tasync: false,\r\n\t\t\turl: root()+\"/rest/tour-lastmodified.php\",\r\n\t\t\terror: function( xhr, ajaxOptions, thrownError ) {\r\n\t\t\t\t// TODO: GW->MH: nicht eingeloggt sollte als Datum bei succes zurückkommen\r\n\t\t\t\tif(thrownError !=\"Bad Request\"){\r\n\t\t\t\t\tshowAJAXError(this.url, \"keine Parameter\", xhr, ajaxOptions, thrownError);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tsuccess: function( parameter, textstatus, xhr ) {\r\n\t\t\t\tshowAJAXSuccess(this.url, parameter, textstatus, xhr);\r\n\t\t\t\tif(typeof(parameter.tours.lastmodified) != undefined){\r\n\t\t\t\t\ttheDate = dateFromServer(parameter.tours.lastmodified);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\t\r\n\t\treturn( theDate );\r\n\t}", "function _getLatestSnapshot(accountId, callback) {\n database.execute(db => {\n async.series([\n cb => {\n db.get('SELECT MAX(Year) as LastYear from Statements WHERE account_id = ?', [accountId],\n (err, row) => {\n cb(err, row['LastYear']);\n })\n }\n ],\n (err, results) => {\n if (err) {\n callback(err);\n return;\n }\n var lastYear = results[0];\n if (!lastYear) {\n callback(null, null);\n return;\n }\n _loadSnapshots(accountId,\n (err, snapshots) => {\n callback(null, snapshots.forYear(lastYear));\n }\n );\n }\n )\n });\n }", "loadLastRow() {\n loadAllRows().then((response) => this.receiveData(-1, response));\n }", "function updateLatest(search, dbURL) {\n mongoClient.connect(dbURL)\n .then(\n function fulfilled(db) {\n var collection = db.collection('latest');\n return Promise.all([collection.findOne(), db]);\n }\n )\n .then(\n function fulfilled([doc, db]) {\n if (doc.latest.length == 10) {\n doc.latest.pop();\n }\n doc.latest.unshift({\n search: decodeURIComponent(search),\n time: new Date().toISOString()\n });\n return [doc, db];\n }\n )\n .then(\n function fulfilled([doc, db]) {\n var collection = db.collection('latest');\n return [collection.updateOne({}, { $set:{latest:doc.latest} }), db];\n }\n )\n .then(\n function fulfilled([update, db]) {\n db.close();\n },\n function rejected(reason) {\n console.log(reason);\n return reason;\n }\n );\n }", "get getLastMessageList () {\n //\n const limit = this\n .request\n .input('limit', null)\n\n return Message\n .query()\n .notDeleted()\n .with('user')\n .limit(limit || 50)\n .orderBy('id', 'desc')\n .fetch()\n }", "function retrieveHistory () {\n $\n .get('/revisions/' + uid)\n .done(function (res) {\n revisions = res.sort(function (a, b) {\n return new Date(a.createdAt) > new Date(b.createdAt);\n });\n\n revisions.forEach(function (revision, i) {\n var date = $.formatDate(revision.createdAt, true);\n var whoDid = (revision.length >= i + 1) ? revision[i + 1].overridenBy : article.lastAuthorName;\n\n if (i === 0) {\n date = $.formatDate(article.updatedAt, true);\n $target.append('<a href=\"#\" class=\"collection-item blue-text\" data-index=\"' + (revisions.length - i) + '\">Dernier article du ' + date + ' par ' + whoDid + '</a>');\n } else {\n $target.append('<a href=\"#\" class=\"collection-item blue-text\" data-index=\"' + (revisions.length - i) + '\">Révision du ' + date + ' par ' + whoDid + '</a>');\n }\n });\n\n var date = $.formatDate(article.createdAt, true);\n\n $target.append('<a href=\"#\" class=\"collection-item initialVersion blue-text\" data-index=\"0\">Création par ' + article.authorName + ' (' + date + ')</a>');\n\n revisions.push({\n content: article.content\n });\n\n $('.collection-item')\n .mouseenter(function () {\n var i = $(this).data('index');\n var content = revisions[i].content;\n\n var html = marked(content, {\n breaks: true,\n sanitize: true,\n highlight: function (code) {\n return hljs.highlightAuto(code).value;\n }\n });\n $preview.html(html);\n\n if (i !== revisions.length - 1) {\n // Select this one\n var $selecter = $('<a href=\"#\" class=\"btn waves-effect waves-light blue\" id=\"restore\">Restorer cette version</a>')\n .click(function (e) {\n e.preventDefault();\n\n $selecter.addClass('disabled').attr('disabled', '');\n $\n .ajax({\n url: '/articles/' + uid,\n type: 'put',\n contentType: 'application/json; charset=utf-8',\n data: JSON.stringify({ content: content })\n })\n .done(function () {\n location.href = '/read/' + uid;\n })\n .fail(function (res) {\n location.href = '/error/' + res.status;\n });\n });\n $preview.append($selecter);\n }\n\n // Fix https://github.com/chjj/marked/issues/255\n $('pre code').addClass('hljs');\n\n // KateX\n renderMathInElement($preview[0]);\n })\n .click(function (e) {\n e.preventDefault();\n });\n })\n .fail(function (res) {\n location.href = '/error/' + res.status;\n });\n }", "function fetchRecentData(fn){\r\n var obj = cloneObj(currentInterval);\r\n obj.format = 'recent';\r\n obj.count = plotDataLength;\r\n getDataFromServer(obj, function(err, data){\r\n if(err){\r\n return fn(null, null);\r\n }else{\r\n return fn(null, data);\r\n }\r\n })\r\n}", "function get(id) {\n return db.get(id);\n }", "async function retornaUltimoLitro(){\n let dados = mongoose.model('dados', schemaNivel);\n let data = await dados.find({}).sort({'date': -1}).limit(1);\n return data[0].litros;\n}", "function findLastArticle(author){\n let authorArticles = articles.filter(el =>el.author.toUpperCase() === author.toUpperCase());\n authorArticles.sort((a,b) => new Date(b.published_at).getTime() - new Date(a.published_at).getTime());\n return authorArticles[0];\n}", "static async getJobsAscend() {\n try {\n const response = await db.any(\n `SELECT * FROM jobs ORDER BY date_posted ASC`\n );\n // for dev testing -- remove when prod\n console.log(response);\n return response;\n } catch (error) {\n // dev testing purposes\n console.error(\"ERROR: \", error);\n return error;\n }\n }", "async function getLastDate(userRef , res){\n var date;\n await userRef.orderByKey().limitToLast(1).once('value', function (childSnapshot) {\n var row = childSnapshot.val();\n if(row === null){\n let today = new Date()\n today = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0)\n let start = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 8, 0, 0, 0, 0)\n var lastWeekDate = start.getDate() + '-' + (start.getMonth() + 1) + '-' + start.getFullYear();\n res.status(200).send(lastWeekDate);\n }else{\n for (var key in row) {\n date = row[key][\"date\"]\n res.status(200).send(date.toString());\n }\n }\n\n });\n}", "function tp(){\r\n \r\n db.collection('Details').orderBy(\"Sn\").get().then(l);\r\n }", "get latest() {\n return this.movements.slice(-1).pop();\n }", "function fetchLatestInfo(req, res, next) {\n\t\tconsole.log(\"Latest Info fetch\");\n\t\tif (req.query.latestInfo) {\n\n\t\t\tArticle.find({\n\t\t\t\tstatus: 'active'\n\t\t\t}, {}, {\n\t\t\t\tlimit: 3,\n\t\t\t\tskip: 0,\n\t\t\t\tsort: {\n\t\t\t\t\tcreatedDate: -1\n\t\t\t\t}\n\t\t\t}).exec(function (err, recent) {\n\n\t\t\t\tif (err) {\n\t\t\t\t\tres.json(err);\n\t\t\t\t} else {\n\t\t\t\t\tArticle.find({}, {}, {\n\t\t\t\t\t\tlimit: 3,\n\t\t\t\t\t\tskip: 0,\n\t\t\t\t\t\tsort: {\n\t\t\t\t\t\t\tviewCount: -1\n\t\t\t\t\t\t}\n\t\t\t\t\t}).exec(function (err, mostViewed) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tres.json(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tres.json({\n\t\t\t\t\t\t\t\tlatest: recent,\n\t\t\t\t\t\t\t\tmostViewed: mostViewed\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "getById(db, id) {\n return db\n .from('activity')\n .select('*')\n .where({ id })\n .first();\n }", "function Cr(t) {\n var e = D(t);\n return e.persistence.runTransaction(\"Get last remote snapshot version\", \"readonly\", (function(t) {\n return e.fo.Ki(t);\n }));\n}", "function get_last_sync_time(func)\n{\n\t//console.log('row518');\n\tif(typeof static_local_db=='undefined')\n\t{\n\t\topen_local_db(function()\n\t\t{\n\t\t\tget_last_sync_time(func);\n\t\t});\n\t}\n\telse\n\t{\n\t\tvar kv=IDBKeyRange.bound(['last_sync_time','0'],['last_sync_time','99999999']);\n\t\tvar req=static_local_db.transaction(['user_preferences'],\"readonly\").objectStore('user_preferences').index('name').get(kv);\n\t\treq.onsuccess=function(e)\n\t\t{\n\t\t\tvar data=req.result;\n\t\t\tvar last_sync_time=\"0\";\n\t\t\tif(data)\n\t\t\t{\n\t\t\t\tlast_sync_time=data['value'];\n\t\t\t}\n\t\t\t//console.log(last_sync_time);\n\t\t\tfunc(last_sync_time);\n\t\t};\n\t\treq.onerror=function(e)\n\t\t{\n\t\t\tconsole.log(this.error);\n\t\t};\n\t}\n}", "static async getJobsDescend() {\n try {\n const response = await db.any(\n `SELECT * FROM jobs ORDER BY date_posted DESC`\n );\n // Dev test\n console.log(response);\n return response;\n } catch (error) {\n // dev test\n console.error(\"ERROR: \", error);\n return error;\n }\n }" ]
[ "0.695814", "0.6841868", "0.6453296", "0.6411854", "0.6222688", "0.6184051", "0.6151477", "0.61503494", "0.6147966", "0.6135215", "0.5998405", "0.5934384", "0.59209126", "0.591576", "0.5885137", "0.58658177", "0.58613366", "0.5837094", "0.57800215", "0.57719374", "0.5724068", "0.56929106", "0.56372136", "0.56349295", "0.562446", "0.5622447", "0.5618038", "0.5616882", "0.56127536", "0.5606385", "0.5591398", "0.5585423", "0.5575402", "0.55572647", "0.55517715", "0.55502784", "0.55492896", "0.55386955", "0.55221987", "0.5496105", "0.54910237", "0.5479052", "0.54745424", "0.5471218", "0.5435295", "0.5433053", "0.5420293", "0.5417315", "0.5415998", "0.54143685", "0.5412855", "0.5394579", "0.5375437", "0.53753006", "0.5373622", "0.53670037", "0.53632265", "0.5361221", "0.53601325", "0.53571033", "0.53481543", "0.53321606", "0.53209436", "0.5320316", "0.5319467", "0.53136957", "0.5306598", "0.52975327", "0.52955806", "0.529438", "0.529378", "0.52857316", "0.5281789", "0.52686495", "0.52597314", "0.5258731", "0.52568823", "0.5246088", "0.5245697", "0.52318156", "0.52141875", "0.52117383", "0.5197108", "0.519072", "0.5180676", "0.5178719", "0.51736605", "0.51647115", "0.5156847", "0.51411897", "0.5133326", "0.51301277", "0.51292944", "0.51284295", "0.5128251", "0.5126481", "0.51238346", "0.51222193", "0.51195586", "0.51190394", "0.5104485" ]
0.0
-1
fills placeholder with new record
function loadNewContent(newData) { let objectData = newData.split(/;/); let link = objectData[0]; let id = objectData[1]; let title = objectData[2]; let thumbnail = "https://" + objectData[3]; let date = objectData[4]; $(".placeholderTitle").html(title); $(".placeholderTitle").removeClass('placeholderTitle'); $(".placeholderImg").css("background-image", "url(" + thumbnail + ")"); $(".placeholderImg").removeClass('placeholderImg'); $(".placeholderDate").html(date); $(".placeholderDate").removeClass('placeholderDate'); $(".placeholderLink").attr('href', link); $(".placeholderLink").removeClass('placeholderLink'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillUpTable() {\r\n\tgetInstantValues();\r\n}", "function populateDataFields() {}", "updatePlaceholder() {\n if (!this.node.placeholder) {\n const placeholder = this.getDateFormat()\n .replace('d', 'dd')\n .replace('m', 'mm')\n .replace('Y', 'yyyy');\n this.node.placeholder = placeholder;\n }\n }", "assignPlaceholderText() {\n if (this.count >= this.textList.length) {\n this.count = 0;\n }\n this.text = this.textList[this.count].text;\n this.count++;\n this.autowriterText();\n }", "_updatePlaceholder() {\n const that = this;\n\n for (let i = 0; i < that._valueFlat.length; i++) {\n const item = that._valueFlat[i];\n\n if (item.type === 'condition' && (item.data[2] === null || item.data[2] === '')) {\n item.htmlNode.querySelector('.jqx-value-container').innerHTML = that.valuePlaceholder;\n }\n }\n\n if (that.$.textBoxEditor) {\n that.$.textBoxEditor.placeholder = that.valuePlaceholder;\n }\n }", "function fillInAnyNewData(taxonName, field, idx, tP) { // console.log(\"fillInAnyNewData aclled for \", taxonName); \n if ( tP.fieldAry.indexOf(field) === tP.fieldAry.length - 1 ) { return; } //console.log(\"last field in set\"); \n if (tP.fieldAry[0] === field) { fillNullGenus() } //If species...\n var existingParentId = tP.taxaObjs[taxonName].parent;\n var newParentId = linkparentTaxonId(idx, tP);\n\n if ( newParentId !== existingParentId ) {\n checkIfTreesMerge(taxonName, newParentId, existingParentId, tP); \n }\n // If Genus is null, set genus as the first word of the species string.\n function fillNullGenus() {\n if (tP.recrd[tP.fieldAry[1]] === null) { \n tP.recrd[tP.fieldAry[1]] = tP.genusParent; }\n }\n }", "function createPlaceholder() {\n if (usePlaceholder) {\n // Remove the previous placeholder\n if (placeholder) {\n placeholder.remove();\n }\n\n placeholder = angular.element('<div>');\n placeholder.css('height', $elem[0].offsetHeight + 'px');\n\n $elem.after(placeholder);\n }\n }", "function fillModal(record) {\n $('#modalForm').removeClass(\"was-validated\");\n // fill the modal\n $(\"#id\").val(record.id);\n $(\"#name\").val(record.name);\n $(\"#fuel\").val(record.fuel);\n $(\"#airport\").val(record.airport.id);\n\n selectedAirport = record.airport;\n currentRecord = record;\n}", "fill() { }", "setPlaceholder() {\n let target = this.target;\n\n this.placeholder = document.createElement('div');\n\n this.placeholder.className = 'fixit-placeholder';\n\n target.parentNode.insertBefore(this.placeholder, target);\n }", "function changePlaceholder()\n {\n $('#chosenEdStatistic').val(labelContent);\n }", "function insertFieldValues(lyr, fieldName, values) {\n var size = getFeatureCount(lyr) || values.length,\n table = lyr.data = (lyr.data || new DataTable(size)),\n records = table.getRecords(),\n rec, val;\n\n for (var i=0, n=records.length; i<n; i++) {\n rec = records[i];\n val = values[i];\n if (!rec) rec = records[i] = {};\n rec[fieldName] = val === undefined ? null : val;\n }\n }", "function fillInitialEntries() {\n console.log(\"notesService: Create some dummy entries...\");\n\n //\n // fill with default /test data:\n //\n var notes = [];\n\n var note = new Note(\"CAS FEE Selbststudium / Projekt-Aufgabe erledigen\", new Date(2016, 10, 20),\n \"HTML für die Notes Application erstellen.<br>CSS erstellen für die Notes Application<br>TODO<br>TODO\", 1,\n new Date(2016, 7, 17));\n note.finishedDate = new Date(2016, 8, 23);\n publicSaveNote(note);\n\n note = new Note(\"Einkaufen\", new Date(2016, 9, 12), \"Butter<br>Eier<br>Brot<br>...\", 2, new Date(2016, 8, 22));\n publicSaveNote(note);\n\n note = new Note(\"Mami anrufen\", null, \"888 888 88 88<br>Termin vereinbaren<br>Weihnachtsgeschenke<br>Ferienabwesenheit besprechen\", 3, new Date(2016, 8, 19));\n publicSaveNote(note);\n}", "function setResetFieldValues(record){\r\n setAddressRelatedFieldValues(record);\r\n}", "_attachPlaceholder() {\n let firstNode = this.childNodes[0]\n // Remove old placeholder if necessary\n if (this.placeholderNode) {\n this.placeholderNode.extendProps({\n placeholder: undefined\n })\n }\n\n if (this.childNodes.length === 1 && this.props.placeholder) {\n firstNode.extendProps({\n placeholder: this.props.placeholder\n })\n this.placeholderNode = firstNode\n }\n }", "function placeholderUpdate(){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($scope.selectedItems.length > 0)\n\t\t\t\t\t\t\t\t\t\t$scope.placeholder= $scope.selectedItems.length + \" selected, type to search for more records\";\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$scope.placeholder=\"0 selected, type to search for more records\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "function fillNullGenus() {\n if (tP.recrd[tP.fieldAry[1]] === null) { \n tP.recrd[tP.fieldAry[1]] = tP.genusParent; }\n }", "function placeHolder() {\n document.getElementById('chatbox').placeholder = '';\n }", "function addNewRecord() {\n let country = $('#newCountryText').val();\n let capital = $('#newCapitalText').val();\n if (country.length === 0 || capital.length === 0) return; // Do not add empty records\n addRow(country, capital);\n fixActionFieldOptions();\n }", "static newRecord(dbModel, data) {\n const record = Object.assign(\n new dbModel.recordType(Database.getRecordUpdateFn(dbModel), Database.getRemoveFn(dbModel)),\n { id: Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString() },\n deepClone(data)\n )\n record.save()\n return record\n }", "fillFields(newParameters, newOptional) {\n this.setState({parameters: newParameters, optional:newOptional})\n\n }", "function populate() {\n var dummyEntries = [\n {\n 'title': 'Test of HTML in the description!',\n 'description': 'let’s write something (again)…The following object will populate a template:\\n' +\n '<code><pre>var entries = [{\\n' +\n ' \\'entryId\\' : 1,\\n' +\n ' \\'title\\' : \\'Entry generated with a JS object\\',\\n' +\n ' \\'description\\' : \\'The following object will populate a template:\\'\\n' +\n ' [rince and repeat…]\\n' +\n '}]</pre></code>',\n 'location': {\n \"latitude\": 30,\n \"longitude\": 120,\n \"altitude\": 20,\n \"accuracy\": 30\n }\n },\n {\n 'title': 'One more tiiiiime!',\n 'description': 'Pour faiiiire un succès de laaaaarmes !',\n 'location': {\n \"latitude\": 35,\n \"longitude\": 125,\n \"altitude\": 0,\n \"accuracy\": 53\n }\n },\n {\n 'title': 'Le poinçonneur des Lilas',\n 'description': 'Des p’tits trous, des p’tits trous&nbsp;! Toujours des p’tits trous…',\n 'location': {\n \"latitude\": 35,\n \"longitude\": 130,\n \"altitude\": 60,\n \"accuracy\": 10\n }\n }\n ];\n\n $.each(dummyEntries, function (i, entry) {\n dummyEntries[i].entryID = 1 + cfg.counter;\n dummyEntries[i].time = new Date().getTime();\n\n storeEntry(entry);\n addMarker(entry);\n });\n\n addEntryToDOM(dummyEntries);\n\n notifyUser('Dummy entries were added!');\n }", "function makePlaceholder(node) {\n\t\t\tjQuery(\"<DIV/>\", { id: \"sap-ui-dummy-\" + node.id}).addClass(\"sapUiHidden\").insertBefore(node);\n\t\t}", "get placeholder() { return this._placeholder; }", "function newEntry(){\n if (eq === 'o'){\n $('#box').val('');\n eq = 'x'\n }\n }", "build(val) {\n this._id = val.rs_id;\n setTimeout(() => {\n this._create(val)\n }, 1500);\n }", "function addAutoFillAndCollapseMetaData() {\n filledRecsCnt === 0 ?\n entityObj.validationResults.autoFill = null :\n entityObj.validationResults.autoFill = {\n received: countRecrdsInObj(recrdsObj),\n filled: filledRecsCnt,\n collapsed: collapsedCnt,\n remaining: countRecrdsInObj(processedRcrds)\n }\n }", "function displayWithPlaceholder (inputBinding, displayElem, placeholder) {\n if (displayElem.classList.contains('placeholder')) {\n displayElem.classList.remove('placeholder');\n };\n if (inputBinding.value === \"\") {\n inputBinding.value = placeholder;\n // let the model know that input has gone back to default\n inputBinding.hasChanged = false;\n\n displayElem.classList.add('placeholder');\n }\n displayElem.innerHTML = inputBinding.value;\n}", "function fillroom(what, arg) {\n var safe = 100;\n var x = rnd(MAXX - 2);\n var y = rnd(MAXY - 2);\n while (!itemAt(x, y).matches(OEMPTY)) {\n x += rnd(3) - 2;\n y += rnd(3) - 2;\n if (x > MAXX - 2) x = 1;\n if (x < 1) x = MAXX - 2;\n if (y > MAXY - 2) y = 1;\n if (y < 1) y = MAXY - 2;\n if (safe-- == 0) {\n debug(`fillroom: SAFETY!`);\n break;\n }\n }\n var newItem = createObject(what, arg);\n setItem(x, y, newItem);\n return newItem;\n //debug(`fillroom(): ${newItem}`);\n}", "function AlterPlaceholder (idioma){\n $.getJSON(\"./src/services/BuscaLabel.php?idioma=\"+idioma, function (elemento){\n document.getElementById('nome_id').placeholder = elemento[0].nomePlaceholder;\n document.getElementById('idade_id').placeholder = elemento[0].idadePlaceholder;\n document.getElementById('instituicao_id').placeholder = elemento[0].instituicaoPlaceholder;\n document.getElementById ('profissao').placeholder = elemento[0].profissao;\n });\n}", "addNewRecordByValue() {\n this.addNewRecord('value');\n }", "setPlaceHolder(txt){\r\n this.HTMLElement.placeholder = txt;\r\n}", "function createEmptyParam() {\n vm.parametersList.addEmptyItem();\n }", "fill() {\n this.notes = []\n for (let fret of range(0, this.frets)) {\n this.notes[fret] = []\n for (let string of range(1, this.strings)) {\n this.notes[fret][string - 1] = new Note(fret, string)\n }\n }\n }", "function fillText( element ) {\r\n\t\ttry {\r\n\t\t\telement.value = shortTestString.replace(\"#REPLACE#\", element.name)\r\n\t\t}\r\n\t\tcatch (e) {}\r\n\t}", "function fillInIds() {\n entityObj.curRcrds = attachTempIds(entityObj.curRcrds); //console.log(\"entityObj.curRcrds = %O\", entityObj.curRcrds)\n }", "function clearfill( input ) {\n\n\t\tvar inpValue = input.data('placeholder');\n\n\t\tinput.focus(function() {\n\n\t\t\tif( input.val() === inpValue ) {\n\t\t\t\tinput.val('');\n\t\t\t} \n\n\t\t});\n\n\t\tinput.blur(function() {\n\n\t\t\tif( input.val() === '' ) {\n\t\t\t\tinput.val(inpValue);\n\t\t\t}\n\n\t\t});\n\t}", "function newRow() {\n var ret = {};\n for (var x = 0; x < $scope.fields.length; x++) {\n ret[$scope.fields[x]] = \"\";\n }\n return ret;\n }", "setDefaultData() {\n this.data = {\n blockId: parseInt(this.injections.block.id),\n description: ''\n };\n\n }", "function placeHolder() {\n document.getElementById(\"chatbox\").placeholder = \"\";\n}", "function placeHolder() {\n document.getElementById(\"chatbox\").placeholder = \"\";\n}", "function placeHolder() {\n document.getElementById(\"chatbox\").placeholder = \"\";\n}", "function changePlaceholder (newPlaceholder, index, id) {\n let newElements = [...elements];\n newElements[index] = newPlaceholder + \";false;\" + id;\n setElements(newElements);\n setList(newElements);\n props.setRecs([]);\n }", "applyDefaultToUndefined(field, data) {\n if(data[field] === undefined && this.model[field].default !== undefined)\n data[field] = this.model[field].default;\n }", "function updatePlaceholderBuffer(bolaState, mediaType) {\n const nowMs = Date.now();\n\n if (!isNaN(bolaState.lastSegmentFinishTimeMs)) {\n // compensate for non-bandwidth-derived delays, e.g., live streaming availability, buffer controller\n const delay = 0.001 * (nowMs - bolaState.lastSegmentFinishTimeMs);\n bolaState.placeholderBuffer += Math.max(0, delay);\n } else if (!isNaN(bolaState.lastCallTimeMs)) {\n // no download after last call, compensate for delay between calls\n const delay = 0.001 * (nowMs - bolaState.lastCallTimeMs);\n bolaState.placeholderBuffer += Math.max(0, delay);\n }\n\n bolaState.lastCallTimeMs = nowMs;\n bolaState.lastSegmentStart = NaN;\n bolaState.lastSegmentRequestTimeMs = NaN;\n bolaState.lastSegmentFinishTimeMs = NaN;\n\n checkBolaStateStableBufferTime(bolaState, mediaType);\n }", "function placeHolder(cell, currentSymbol) {\n if (!isfinishround) {\n let child = cell.firstChild;\n if (child === null) {\n let marker = new Marker(currentSymbol);\n cell.appendChild(marker.getNode());\n }\n }\n }", "create(init) { // initial values\n const rec = {\n table: this,\n model: this,\n save: function() {\n console.log('common/Table:save(this)', this)\n return this.model.save(this)\n }\n }\n for(const [name, field] of Object.entries(this.fields)) {\n // console.log('name, field', name, field)\n rec[name] = field.default;\n }\n Object.assign(rec, init) // merge initial values\n // console.log('New record', rec)\n // and we should save it!!\n return rec\n }", "function update() {\n $scope.items.shift();\n $scope.items.push(generateRow());\n $scope.usage1 = setUsage();\n $scope.usage2 = setUsage();\n $scope.usage3 = setUsage();\n $scope.usage4 = setUsage();\n $scope.mapObject.data = mapChanges();\n $timeout(update, updateInterval);\n }", "function initNewInvRow() {\n $scope.newInvRw = RefundsStructure.getNewInv(tableCode, formName);\n }", "function SetPlaceHolder () {\n if (isIE(7) || isIE(8) || isIE(9)) {\n $('[placeholder]').focus(function() {\n var input = $(this);\n if (input.val() == input.attr('placeholder')) {\n input.val('');\n input.removeClass('placeholder');\n }\n }).blur(function() {\n var input = $(this);\n if (input.val() == '' || input.val() == input.attr('placeholder')) {\n input.addClass('placeholder');\n input.val(input.attr('placeholder'));\n }\n }).blur();\n $('[placeholder]').parents('form').on('submit', function() {\n $(this).find('[placeholder]').each(function() {\n var input = $(this);\n if (input.val() == input.attr('placeholder')) {\n input.val('');\n }\n })\n });\n }\n}", "function fillTileSetData()\n\t{\n\t\tcurTileSetData.tileData.length = tp.getNumTiles();\n\t\t\n\t\tfor (var i = 0; i < curTileSetData.tileData.length; ++i)\n\t\t{\n\t\t\tif (typeof curTileSetData.tileData[i] === \"undefined\")\n\t\t\t\tcurTileSetData.tileData[i] = new TileData();\n\t\t}\n\t}", "function createHint(){\r\n\t\t\tsocket.emit('user guess', {\r\n\t\t\t\thint: hint.val(),\r\n\t\t\t\tguess: guess.val()\r\n\t\t\t});\r\n\t\t\thint.val('');\r\n\t\t\tguess.val('');\r\n\t\t}", "fillDb() {\n if (this.options.before) this.options.before();\n this._schemaRecursuveAdd('', this.schema);\n if (this.options.after) this.options.after();\n }", "function pageUpdate() {\n var screen = document.getElementById(\"placeholder\");\n screen.innerHTML = placeHolder.join(\"\");\n }", "function PlaceholderElement() {\n\t\tthis.id = uniqueId();\n\t}", "static clearFieldsCreate() {\n document.getElementById(\"input_task\").value = \"\";\n document.getElementById(\"input_description\").value = \"\";\n document.getElementById(\"input_work_time\").value = \"25\";\n document.getElementById(\"input_long_break\").value = \"15\";\n document.getElementById(\"input_short_break\").value = \"5\";\n\n //This is the word counter of the description field\n document.getElementById(\"cant_characters\").innerText = \"0/100\";\n\n ListBinding.fillStarCrateTask(1);\n }", "function updateDisplayedValues() {\n displayNameField.text(displayNameVal);\n emailField.text(emailVal);\n phoneField.text(phoneVal);\n zipcodeField.text(zipcodeVal);\n }", "async function fillAndSet() {\n const body = await fillFn();\n if (!body) {\n /*\n * When the fillFn returns nothing, no caching.\n */\n return\n }\n const entry = {\n body: body,\n time: Date.now()\n }\n fly.cache.set(key, JSON.stringify(entry), 3600)\n return entry\n }", "async replace_missing(missing=\"\") {\n this.df = this.df.map(row => {\n let temp = row\n for (const [key, value] of Object.entries(row)) {\n if (value == missing) row[key] = null\n }\n return temp\n })\n }", "function setDefaultPlaceholder() {\n if (!ctrl.placeholder) {\n ctrl.placeholder = 'Please select...';\n }\n }", "cloneCurrentRecord(currentRow) {\r\n currentRow.Id = undefined;\r\n currentRow.Name = undefined;\r\n const fields = currentRow;\r\n this.createRdsRequest(fields);\r\n }", "resetFields() {\n keys(this.initialFields).forEach((key) => this[key] = this.initialFields[key]);\n }", "PlaceHolder() {\n $('input, textarea').placeholder();\n }", "function on_data(data) {\n data_cache[key] = data;\n placeholder.update();\n }", "function blankAddress(){\n $('#c_addr_1').val(null);\n $('#c_addr_2').val(null);\n $('#c_addr_3').val(null);\n }", "add(record) {\n this.data.unshift(record);\n }", "function fill_field() { \n var txt=document.getElementById(\"subject_id\").value; \n document.getElementById(\"subject_id\").value = randomString();; \n }", "setInitialData(initialData, {noResetSnapshots} = {}) {\n this.fields.replace(initialData || {});\n this.initialData = this.fields.toJSON() || {};\n\n if (noResetSnapshots) {\n return;\n }\n\n this.snapshots = [new Map(this.fields)];\n }", "refillNotes() {\n if(this.dirtyNotesId.size + 1 !== this.notes.length) {\n this.dataTableData = JSON.parse(JSON.stringify(this.notes));\n this.notes.splice(0, 0, {\n id: this.currentMaxId + 1 + '',\n top: null,\n left: null,\n isDirty: false,\n fieldName: \"Note Label\",\n comment: \"A note in time saves nine!\",\n isDragToggleEnabled : false,\n isDragEnabled : false,\n });\n this.currentMaxId += 1\n }\n }", "function simulate_placeholders() {\n\t\t\n\t\tvar input = document.createElement(\"input\");\n\t\t\n\t\tif(('placeholder' in input) == false) {\n\t\t\t\n\t\t\t$('[placeholder]').focus(function() {\n\t\t\t\t\n\t\t\t\tvar i = $(this);\n\t\t\t\t\n\t\t\t\tif(i.val() == i.attr('placeholder')) {\n\t\t\t\t\t\n\t\t\t\t\ti.val('').removeClass('placeholder');\n\t\t\t\t\t\n\t\t\t\t\tif(i.hasClass('password')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\ti.removeClass('password');\n\t\t\t\t\t\tthis.type='password';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}).blur(function() {\n\t\t\t\t\n\t\t\t\tvar i = $(this);\t\n\t\t\t\t\n\t\t\t\tif(i.val() == '' || i.val() == i.attr('placeholder')) {\n\t\t\t\t\t\n\t\t\t\t\tif(this.type=='password') {\n\t\t\t\t\t\t\n\t\t\t\t\t\ti.addClass('password');\n\t\t\t\t\t\tthis.type='text';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\ti.addClass('placeholder').val(i.attr('placeholder'));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}).blur().parents('form').submit(function() {\n\t\t\t\t\n\t\t\t\t$(this).find('[placeholder]').each(function() {\n\t\t\t\t\t\n\t\t\t\t\tvar i = $(this);\n\t\t\t\t\t\n\t\t\t\t\tif(i.val() == i.attr('placeholder')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\ti.val('');\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t})\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t}\n\t\t\t\t\n\t}", "function defaultize(initialRecord) {\n return {\n ...defaultRecord,\n ...initialRecord,\n };\n}", "function updatePlaceHolder(id, newPlaceHolder) {\n\t$(\"#searchTab\").val(newPlaceHolder.toLowerCase());\n\t$(\"#\"+id).attr(\"placeholder\", \"SEARCH \" + newPlaceHolder).focus().blur();\n\t\n\t//Coremetrics call\n\tCoreMetricsWrapper.createElementTag(newPlaceHolder, 'Theme Search bar placeholder change');\n}", "function populateRows() {\n let tmpRows = [];\n for(let i = 1; i <= 20; i++) {\n const ingredient = data[`strIngredient${i}`];\n const quantity = data[`strMeasure${i}`];\n \n if (ingredient === null || ingredient === \"\") {\n continue;\n }\n tmpRows.push({key: i, ingredient: ingredient, quantity: quantity})\n }\n setRows(tmpRows);\n }", "function fillUnit() {\n\tvar controller = View.controllers.get('abWasteTrackGenController');\n\tvar typeSelect = $('unitsType');\n\tvar type = typeSelect.value;\n\tvar res = \"bill_unit.bill_type_id='\" + type + \"' and bill_unit.is_dflt='1'\";\n\tvar record = controller.abWasteTrackGenBillUnitsDS.getRecord(res);\n\tvar unit = record.getValue('bill_unit.bill_unit_id');\n\tvar dataRes = \"bill_unit.bill_type_id='\" + type + \"'\";\n\tif (record == '') {\n\t\tfillList('abWasteTrackGenBillUnitsDS', 'units', 'bill_unit.bill_unit_id', '', dataRes);\n\t} else {\n\t\tfillList('abWasteTrackGenBillUnitsDS', 'units', 'bill_unit.bill_unit_id', unit, dataRes);\n\t}\n}", "function _init_none_vals(data, none_vals_obj){\n\t\t\tvar new_data = data;\n\n\t\t\tfor (var key_field in none_vals_obj) {\n\t\t\t\tfor (var i = 0; i < new_data.length; i++) {\n\t\t\t\t\tvar obj_elem = new_data[i];\n\t\t\t\t\tif (!obj_elem.hasOwnProperty(key_field)) {\n\t\t\t\t\t\tobj_elem[key_field] = {\"value\": none_vals_obj[key_field]};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new_data;\n\t\t}", "update(startingData) {}", "function displayIngrInput2() {\n document.getElementById(\"userIngr\").placeholder = \"Rechercher un ingrédient\";\n}", "function theQwertyGrid_reFillTable(data) {\n\t\t\ttheQwertyGrid_clearAllRows();\n\t\t\ttheQwertyGrid_addRows(data, _theQwertyGrid_tableProps);\n\t\t}", "function runDefault() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Get the value by ID of the input element and replace it with \"\"\n document.getElementById(\"datetime\").value = \"\";\n document.getElementById(\"city\").value = \"\";\n document.getElementById(\"state\").value = \"\";\n document.getElementById(\"country\").value = \"\";\n document.getElementById(\"shape\").value = \"\";\n\n // Modify the text of an HTML element\n var dataTabledefault = d3.selectAll(\"tbody>tr\");\n dataTabledefault.html(\"\");\n\n // Call the data\n populateData(tableData);\n}", "function fhArrival_newArrival() {\n\t\n\tfhArrival_editMode();\n\tfhArrival_data = {};\n\tfhArrival_data.arrivalId = -1;\n\tfhArrival_data.arrival = {};\n\tfhArrival_data.arrival.ldvs = Array();\n\t\n}", "function refreshPlaceholderState() {\n showColumnListPlaceholder(columnListIsEmpty());\n}", "function alignDataWithTemplate(data,\n optional_filled_template) {\n // var dataCopy = angular.copy(data); // do not\n // alter original data\n // console.log(template_default);\n if (optional_filled_template) {\n // delete unknown properties\n for (var attrname in data) {\n if (!optional_filled_template\n .hasOwnProperty(attrname)) {\n delete data[attrname];\n // console.log('delete ' + attrname);\n }\n }\n // add missing properties\n for (var attrname in optional_filled_template) {\n if (!data.hasOwnProperty(attrname)) {\n data[attrname] = optional_filled_template[attrname];\n console.log('add filled ' + attrname);\n }\n }\n }\n\n // add missing properties\n for (var attrname in hiddenData) {\n if (!data.hasOwnProperty(attrname)) {\n data[attrname] = hiddenData[attrname];\n console.log('add hidden ' + attrname);\n }\n }\n return data;\n }", "fillCursor(cursor) {\n\t\t\tconst line = this.getLine(cursor.line);\n\t\t\tconst colIndex = cursor.column.valueOf() - 1;\n\n\t\t\t// Amount of spaces to insert\n\t\t\tlet count = 0;\n\n\t\t\t// Calculate how many we need to insert\n\t\t\tlet i = colIndex - 1;\n\t\t\twhile (i >= 0 && (line.columns[i] === undefined || line.columns[i] === \"\")) {\n\t\t\t\ti--;\n\t\t\t\tcount++;\n\t\t\t}\n\n\t\t\t// Insert spaces\n\t\t\tfor (const char of this.getSpaces(count)) {\n\t\t\t\ti++;\n\t\t\t\tline.columns[i] = char;\n\t\t\t}\n\t\t}", "function saveManualFieldData() {\n\tvar len = fieldsToCheck.length;\n\tvar element;\n\tfor (var i=0; i<len; ++i) {\n\t\tid = fieldsToCheck[i];\n\t\telement = '#' + id;\n\t\t$(element).data('initial_value', $(element).val());\n\t}\n}", "function updateForm(listingKey) {\n\n var query = firebase.database().ref('/Listings/' + listingKey);\n query.on('value', function (snapshot) {\n\n $('#autocomplete').attr(\"placeholder\", snapshot.child('Address').val());\n $('#width').attr(\"placeholder\", snapshot.child('Width').val());\n $('#height').attr(\"placeholder\", snapshot.child('Height').val());\n $('#length').attr(\"placeholder\", snapshot.child('Length').val());\n $('#new_descript').attr(\"placeholder\", snapshot.child('Description').val());\n\n });\n\n}", "function fillData(key, values) {\n\t\tvar fields = \"\";\n\t\tvar type = \"\";\n\t\tvar tagName = \"\";\n\t\tvar pathFields = null;\n\t\tvar instanceObject = [];\n\n\t\tif (key === 'effectiveTime') {\n\t\t\tfields = \"\";\n\t\t\ttype = \"IVL_TS\";\n\t\t\ttagName = \"effectiveTime\";\n\t\t\tpathFields = fields.split(',');\n\n\t\t\t$.each(values, function(key, value) {\n\t\t\t\tinstanceObject = [ value.low, value.high ];\n\t\t\t\tthisObject.messageAndUIBinder.writeValueToMessage(tagName,\n\t\t\t\t\t\tpathFields, type, instanceObject);\n\t\t\t});\n\t\t}\n\n\t\tif (key === 'telecom') {\n\t\t\tfields = \"identifiedPerson\";\n\t\t\ttype = \"TEL\";\n\t\t\ttagName = \"telecom\";\n\t\t\tpathFields = fields.split(',');\n\n\t\t\t$.each(values, function(key, value) {\n\t\t\t\tinstanceObject = [ value.use, value.value ];\n\t\t\t\tthisObject.messageAndUIBinder.writeValueToMessage(tagName,\n\t\t\t\t\t\tpathFields, type, instanceObject);\n\t\t\t});\n\t\t}\n\n\t\tif (key === 'programId') {\n\t\t\tthisObject.messageAndUIBinder.updateId('PROGRAM_ID', values);\n\t\t}\n\n\t\tif (key === 'consultantId') {\n\t\t\tthisObject.messageAndUIBinder.updateId('CONSULTANT_ID', values);\n\t\t}\n\t\tif (key === 'messageTitle') {\n\t\t\tthisObject.messageAndUIBinder.updateId('MSG_TITLE', values);\n\t\t}\n\t\tif (key === 'setDefaultUser') {\n\t\t\ttry {\n\t\t\t\tthisObject.messageAndUIBinder.updateId('USERNAME', values);\n\t\t\t\n\t\t\t} catch (error) {\n\t\t\t\talert(\"Error while setting user password\" + error);\n\t\t\t}\n\n\t\t}\n\t\tif(key === 'setDefaultPassword'){\n\t\t\tthisObject.messageAndUIBinder.updateId('PASSWORD',\n\t\t\t\t\tvalues);\n\t\t}\n\t}", "fillForm(data) {\n this.titleInput.value = data.title;\n this.bodyInput.value = data.body;\n this.idInput.value = data.id;\n\n this.changeFormState('edit');\n }", "function trackNewData(val) {\n if (val !== undefined) {\n viewModel('trackNewData', !!val);\n }\n val = viewModel('trackNewData');\n return val;\n }", "function add_fields(link, association, content) {\n var new_id = new Date().getTime();\n var regexp = new RegExp(\"new_\" + association, \"g\")\n $(link).up().insert({\n before: content.replace(regexp, new_id)\n });\n }", "getItemEmpty() {\n this.elements.form.querySelector('.field-title').value = '';\n this.elements.form.querySelector('.field-price').value = '';\n }", "function fillField(event){\n\t\tvar inputVal = $.trim($(this).val());\n\t\tif(inputVal === 0){\n\t\t\t$(this).val($(this).data(\"defaultValue\"));\n\t\t}\n\t}", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "createBlankEntry() {\n const blankEntry = {\n [this.labelName]: '',\n [this.valueName]: ''\n };\n if (this.labelPrefixName) {\n blankEntry[this.labelPrefixName] = '';\n }\n if (this.labelSuffixName) {\n blankEntry[this.labelSuffixName] = '';\n }\n return blankEntry;\n }", "createBlankEntry() {\n const blankEntry = {\n [this.labelName]: '',\n [this.valueName]: ''\n };\n if (this.labelPrefixName) {\n blankEntry[this.labelPrefixName] = '';\n }\n if (this.labelSuffixName) {\n blankEntry[this.labelSuffixName] = '';\n }\n return blankEntry;\n }", "function populateNoteChangingForm(note){\n const start = note.Start.format(isoDateFormatString);\n const inclEndDateString = lcHelpers.toInclusiveMoment(note.End).format(isoDateFormatString);\n const text = note.Text;\n const color = note.Color;\n const id = note.Id;\n console.assert([start, inclEndDateString, text, id].every(x => x !== undefined), [start, inclEndDateString, text, id]);\n //$('#note-changing-text-input').attr('value', text); // This doesn't work for some reason, replaced with the next line.\n $('#note-changing-text-input').val(text);\n $('#note-changing-color-input').val(color);\n $('#note-changing-start-input').attr('value', start);\n $('#note-changing-end-input').attr('value', inclEndDateString);\n $('#note-changing-id').attr('value', id);\n\n $('#note-deleting-id').attr('value', id);\n}", "function prePopulateAddress () {\n $(\".update-address-form #postcode\").val(userAddress.postcode);\n $(\".update-address-form #address-line-1\").val(userAddress.addressLine1);\n $(\".update-address-form #address-line-2\").val(userAddress.addressLine2);;\n $(\".update-address-form #city\").val(userAddress.city);\n $(\".update-address-form #postcode\").val(userAddress.postcode);\n $(\".update-address-form #country\").val(userAddress.country);\n}", "placeInPlaceHolder(input, debut, fin, donnee) {\n return this.replacePlaceHolder(input, debut, fin, debut + donnee + fin);\n }", "function putQuestion() {\r\n inputLabel.innerHTML = questions[position].question\r\n inputField.value = ''\r\n\tdocument.getElementById('inputField').placeholder = placeholders[position].place\r\n inputField.type = questions[position].type || 'text' \r\n inputField.focus()\r\n showCurrent()\r\n }", "function insert_replace(field,newvalue) {\n\tdocument.getElementById(field).value = newvalue;\n\tdocument.getElementById(field).focus();\n\treturn false;\n}", "function newEntry(id) {\n let idString = id;\n formatEntry(idString, true);\n increment();\n $(`#formatted${counter-1}`).after(generateNewEntryHtml());\n\n}" ]
[ "0.5605594", "0.5537786", "0.54996616", "0.54048246", "0.5395914", "0.5335924", "0.52758217", "0.52037007", "0.5146376", "0.5143354", "0.50987476", "0.50902665", "0.5085616", "0.5080329", "0.50761133", "0.5073867", "0.5061471", "0.5054735", "0.50472766", "0.50450575", "0.50368893", "0.50220996", "0.50060314", "0.49749327", "0.4974097", "0.49671933", "0.49519968", "0.4941771", "0.49260238", "0.49209595", "0.49154088", "0.49077767", "0.48993114", "0.48982364", "0.48863623", "0.48764607", "0.48690122", "0.48583686", "0.48546955", "0.48488694", "0.48488694", "0.48488694", "0.48454827", "0.4845236", "0.48394504", "0.48370177", "0.482887", "0.4828443", "0.4826904", "0.48252112", "0.4820634", "0.48175058", "0.48167098", "0.4808367", "0.48050514", "0.48030314", "0.47956806", "0.47952086", "0.47906265", "0.47895518", "0.47893125", "0.4783889", "0.47826508", "0.47811666", "0.4775753", "0.47749007", "0.47736347", "0.4772666", "0.47657618", "0.4764464", "0.47622108", "0.47605023", "0.47565693", "0.4756535", "0.47527686", "0.47526097", "0.4748204", "0.47451586", "0.47428003", "0.4738697", "0.47379768", "0.4735735", "0.47356492", "0.47320935", "0.4726728", "0.4724223", "0.4721612", "0.47195977", "0.47145212", "0.47111592", "0.47065553", "0.47035438", "0.47021943", "0.47021943", "0.4697528", "0.46915004", "0.46911713", "0.46846268", "0.46789914", "0.46709192" ]
0.47048903
91
animates loading screen logo with random glitch animation
function animateLogo() { let random; random = Math.floor((Math.random() * 3)+ 1); $('#wave').css("animation", "glitch" + random + " 2s ease infinite"); setTimeout(function(){ random = Math.floor((Math.random() * 3)+ 1); $('#erase').css("animation", "glitch" + random + " 2s ease infinite"); setTimeout(function(){ random = Math.floor((Math.random() * 3)+ 1); $('#blur').css("animation", "glitch" + random + " 2s ease infinite"); }, 40);}, 40); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runLogoAnimation() {\n for (const path of svgDrawingPaths) {\n path.style.strokeDashoffset = \"0px\";\n }\n for (const cPath of svgCirclePaths) {\n cPath.style.cssText = \"stroke-dashoffset: 0; transition-delay: 1200ms;\";\n }\n svgVerve.style.cssText =\n \"transform:translateX(0px); transition:transform 1s ease .8s;\";\n svg360.style.cssText =\n \"transform:translateX(0px);opacity:1;transition:all 1s ease .8s;\";\n document.getElementById(\"small-circle\").style.opacity = \"1\";\n setTimeout(firstPageLoaded, 2000);\n}", "function animateLogo()\n{\n if (logoPhase > 7)\n {\n setDutyCycle(2, 10);\n return;\n }\n else if (logoPhase > 6)\n {\n showBitwigLogo = false;\n var i = 0.5 - 0.5 * Math.cos(logoPhase * Math.PI);\n setDutyCycle(Math.floor(1 + 5 * i), 18);\n }\n else\n {\n var i = 0.5 - 0.5 * Math.cos(logoPhase * Math.PI);\n setDutyCycle(Math.floor(1 + 15 * i), 18);\n }\n\n logoPhase += 0.2;\n\n host.scheduleTask(animateLogo, null, 30);\n}", "function setupLogoAnimation() {\n logo.style.cssText = \"display:inline-block;\";\n i = 0;\n for (const path of svgDrawingPaths) {\n i++;\n var strokeOffset = path.getTotalLength();\n path.style.cssText =\n \"stroke-dashoffset: \" +\n strokeOffset +\n \"px; stroke-dasharray: \" +\n strokeOffset +\n \"px; transition-delay:\" +\n i * 0 +\n \"ms;\";\n }\n svgVerve.style.cssText = \"transform:translateX(50px);\";\n setTimeout(runLogoAnimation, 100);\n}", "function animateLogo () {\n\t\tvar repeatVisitFlag = IBM.common.util.storage.getItem(\"v18larv\");\n\t\t\n\t\t// Allow animation to be forced to show via URL param (for debugging, presentations, show-and-tell, etc).\n\t\tif (IBM.common.util.url.getParam(\"animatelogo\")) {\n\t\t\t$(\"#ibm-home\").addClass(\"ibm-animate\");\n\t\t}\n\n\t\tif (!IBM.common.util.config.isEnabled(\"masthead.logoanimation\")) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If they didn't have the flag AND they support localstorage, animate it.\n\t\tif (!repeatVisitFlag && IBM.common.util.storage.setItem(\"v18larv\", true)) {\n\t\t\t$(\"#ibm-home\").addClass(\"ibm-animate\");\n\t\t}\n\t}", "animateLogo() {\n const imageLoad = new Image();\n imageLoad.src = this.imageSrc;\n imageLoad.onload = this.animatePattern();\n }", "function logoBlink() {\n let logoBlink = new TimelineMax({});\n logoBlink.staggerTo(\".icon\", 0.3, { scale: 0, transformOrigin: \"50% 50%\" }, 0.1, \"+=0.5\")\n .staggerTo(\".icon\", 0.3, { scale: 1, ease: Back.easeOut.config(3.5), transformOrigin: \"50% 50%\" }, 0.1, \"-=0.5\");\n return logoBlink;\n}", "function animateLoader() {\r\n\tif (moonState < moonStateImages.length) {\r\n\t\t$(\"#fe_intro_moon img\").attr(\"src\", \"img/\" + moonStateImages[moonState]);\r\n\t\t$(\"#fe_intro_moon p\").html(Math.round(moonState/moonStateImages.length * 100));\r\n\t\tmoonState++;\r\n\t\tsetTimeout(animateLoader, 350); // the interval between frames\r\n\t}\r\n\telse {\r\n\t\t$(\"#fe_intro_moon img\").attr(\"src\", \"img/\" + moonStateImages[moonState-1]);\r\n\t\t$(\"#fe_intro_moon p\").html(Math.round(moonState/moonStateImages.length * 100));\r\n\t\tsetTimeout(startIntro, 250); // play the intro when the load animation completes\r\n\t}\r\n}", "function homeAnim() { //homepage animation on load \n qsCl(\"home__logo-fill\").left = '-177px';\n qsCl(\"home__logo-dolya\").color = 'black';\n qsCl(\"home__logo-consulting\").color = 'black';\n qsCl(\"home__logo-frame\").opacity = '1';\n qsCl(\"home__tagline-line\").width = '60px';\n qsCl(\"home__mission-statement\").color = '#303030';\n qsCl(\"home__tagline\").color = '#303030';\n qsCl(\"home__golden-thread\").color = 'var(--gold)';\n qsCl(\"path-logo\").animation = 'dash 3s ease-in forwards 1s'\n qsCl(\"path-home\").animation = 'dash 5s ease-in-out forwards 4s';\n drawn.home = true;\n}", "function preloadLogoEnd() {\n\n}", "function preloadLogoEnd() {\n loaderStop();\n}", "function showLogoRed() {\n $.logoRed.animate({ opacity:1.0, duration:250 });\n $.logoWhite.animate({ opacity:0.0, duration:250 });\n\n $.helpLight.animate({ opacity:1.0, duration:250 });\n $.helpDark.animate({ opacity:0.0, duration:250 });\n}", "function AnimateLogo(){\n\n\tvar bgTransparency = 0.00;\n\tvar animateProcess = \"\";\n\t\n\t// Starting the animation\n\tif (animLogoTransitionID == null){\n\t\t// Start the animation\n\t\tanimLogoTransitionID = setInterval(function (){\n\t\t\t\n\t\t\t// Ending the animation, when the image has been loaded\n\t\t\tif( imageLoaded == 1){\n\t\t\t\n\t\t\t\tclearInterval(animLogoTransitionID);\n\t\t\t\tanimLogoTransitionID = null;\n\t\t\t\tDOMLogo_LoadTransict.setAttribute (\"opacity\", 0.0);\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{ // Continuing with animation\n\t\t\t\t// Putting the logo in the front\n\t\t\t\tDOMLogo_LoadTransict.parentNode.appendChild(DOMLogo_LoadTransict);\n\t\t\t\t\n\t\t\t\t// Setting the transparency of the logo. If the logo gets transparent, return to the visibility and vice-versa\n\t\t\t\tif ( bgTransparency <= 0.00 ) // Raise the opacity\n\t\t\t\t\tanimateProcess = \"lessTransp\";\n\t\t\t\tif ( bgTransparency >= 0.75 )\n\t\t\t\t\tanimateProcess = \"moreTransp\"; // Lower the opacity\n\t\t\t\t\n\t\t\t\t// Now, setting the values\n\t\t\t\tif (animateProcess == \"lessTransp\")\n\t\t\t\t\tbgTransparency = CalculateScaleTransition (bgTransparency, 0.75, \"fast-background\");\n\t\t\t\tif (animateProcess == \"moreTransp\")\n\t\t\t\t\tbgTransparency = CalculateScaleTransition (bgTransparency, 0.00, \"fast-background\");\n\t\t\t\t\t\n\t\t\t\t// And, setting the value to the logo\n\t\t\t\tDOMLogo_LoadTransict.setAttribute (\"opacity\", bgTransparency);\t\n\t\t\t}\n\t\t}, 40);\n\t}\n}", "function random_img() {\n var bgurl = [];\n $.each(teams, function (key, f) {\n bgurl[key] = f.team_img_url;\n\n\n });\n //generating random images logo\n var x = Math.floor(Math.random() * bgurl.length);\n if (x <= bgurl.length) {\n $(\"#logo1\").attr(\"src\", bgurl[x]);\n //animation for logo images.....\n var div = $(\"#logo1\");\n div.animate({ height: '300px', opacity: '0.4' }, \"slow\");\n div.animate({ width: '300px', opacity: '0.8' }, \"slow\");\n div.animate({ height: '100px', opacity: '0.4' }, \"slow\");\n div.animate({ width: '100px', opacity: '0.8' }, \"slow\");\n\n setTimeout(random_img, 1000);\n }\n }", "function animationLogo() {\n logo.classList.add('logo-animate');\n}", "splashBottle() {\n clearInterval(this.gravitation);\n clearInterval(this.the_throw); \n this.playAnimation(this.IMAGES_SPLASH);\n this.splash_sound.play();\n setInterval(() => {\n this.width = 0;\n this.height = 0;\n }, 200);\n }", "function stopLogoAnimation() {\n if (typeof window.showlogo_iv !== 'undefined') {\n window.ncka = window.lgss = window.lga = 1;\n clearInterval(window.showlogo_iv);\n showLogo(true);\n } else {\n setTimeout(stopLogoAnimation, 25);\n }\n }", "function showLogoWhite() {\n $.logoRed.animate({ opacity:0.0, duration:250 });\n $.logoWhite.animate({ opacity:1.0, duration:250 });\n\n $.helpLight.animate({ opacity:0.0, duration:250 });\n $.helpDark.animate({ opacity:1.0, duration:250 });\n}", "function animate() { \n console.log('animate')\n \n gsap.registerEffect({\n name: \"fadeIn\",\n effect: (targets, config) => {\n var tlEffect = gsap.timeline();\n tlEffect.from(targets, {duration: config.duration, y:config.y, force3D:true, rotation: 0.01, stagger:config.stagger, ease:\"power2\"})\n .from(targets, {duration: config.duration, stagger:config.stagger, alpha:0, ease:\"none\"}, \"<\")\n return tlEffect;\n },\n defaults: {duration: 1.5, y:\"-=7\", stagger:4.5},\n extendTimeline: true,\n });\n \n gsap.to(plantWraps, {duration:25, rotation:\"+=20\", ease:\"none\"})\n gsap.to(flowerWraps, {duration:25, rotation:\"+=100\", ease:\"none\"})\n \n var imageDivs = selectAll('.imageDiv');\n // logoIntro = false;\n\n\t\t\ttl\n .to(bannerCover, {duration:0.7, alpha:0, ease:\"none\"})\n \n .from(plants, {duration:3, drawSVG:\"50% 50%\", ease:\"sine.inOut\"}, \"<\")\n .from(flowers, {duration:2, alpha:0, ease:\"none\"}, \"<\")\n \n if(logoIntro) {\n tl\n .from(letter_w, {duration:0.5, drawSVG: 0, ease:\"sine.in\"}, \"<\")\n .from(letter_y, {duration:0.3, drawSVG: 0, ease:\"sine.in\"}, \">\")\n .from(letter_nn, {duration:0.8, drawSVG: 0, ease:\"sine.inOut\"}, \">\")\n .from(lasvegas, {duration:0.7, y:\"-=10\", alpha: 0, ease:\"sine\"}, \">\")\n .from(sign_r, {duration:0.5, alpha: 0, ease:\"none\"}, \"<\")\n\n .to(logo, {duration:0.7, alpha:0, ease:\"none\"}, \">1\")\n .set(logo, {scale: 0.37, y:99, x:-60}, \">\")\n } else {\n tl\n .set(logo, {scale: 0.37, alpha:0,y:99, x:-60}, \"<\")\n }\n \n tl\n .from(imageDivs, {duration:1.3, stagger:4, alpha:0, blur:10, force3D:true, rotation: 0.01, ease:\"none\"}, \"<\")\n \n .fadeIn(text_head, \"<0.4\")\n .fadeIn(text_subHead,{y:\"0\", duration: 1,},\"<0.6\")\n .to(logo, {duration:1, alpha:1, ease:\"none\"}, \"<0.4\")\n .from(cta, {duration:0.8, alpha: 0, ease:\"none\"}, \"<\")\n .from(cta, {duration:1.6, rotateX:90, ease:\"power2\"}, \"<\") \n\t\t}", "function startLoader() {\r\n\t$(\"#fe\").show();\r\n\t$(\"#fe_intro_moon\").html(\"<img src='img/hf_moon_state_0.png'><p></p>\");\r\n\tanimateLoader();\r\n}", "function loader(){\n load = setTimeout(function(){\n document.getElementById('game-level').style.visibility = 'visible';\n }, 4000); // Mudar esse tempo para a duração da Animação do logo\n}", "function lonlight ( timer )\n{\n isLoadOn = true;\n if ( typeof timer === undefined ){timer = 500;\n }\n timer = !is_numeric ( timer ) ? 500 : timer;\n $ ( '#loadIconDiv1' ).animate ( { 'opacity' : 1 } , timer ).dequeue ();\n $ ( '#loadIconDiv1' ).fadeIn ( timer ).dequeue ();\n $ ( '#hiderLayer1' ).fadeOut ( timer ).dequeue ();\n hueRotation ();\n\n}", "function randomizeIconColor(icon) {\n\n icon.frame = game.rnd.integerInRange(0, icon.animations.frameTotal - 1);\n\n}", "function loader(){\n tl\n .to(pre_loader_logo, 3, {rotation:360, ease:Power0.easeNone})\n .to([title, pre_loader_logo], 1, {opacity:0 , ease:Power1.easeInOut})\n .add('red')\n .add('blue')\n\n .to(blue, 1.2, {x: 500, ease:Power1.easeInOut, opacity:0}, 'blue')\n .to(red, 1.2, {x: -500, ease:Power1.easeInOut, opacity:0}, 'red')\n\n tl.pause();\n $('.title, #preLoaderLogo').click(function(){\n tl.play()\n setTimeout(function(){\n redirect()\n }, 5500)\n })\n }", "function preload() {\n//\n// //create an animation from a sequence of numbered images\n// //pass the first and the last file name and it will try to find the ones in between\n ghost = loadAnimation('assets/ghost_standing0001.png', 'assets/ghost_standing0007.png');\n //fire = loadAnimation('assets/fire/fire0001.png', 'assets/fire/fire0013.png');\n plant= loadAnimation('assets/plant/plant0000.png', 'assets/plant/plant0005.png');\n\n}", "function logoFade() {\n $(\"#staxx-logo\")\n .fadeIn(1600)\n .animate(\n {\n width: \"100px\",\n top: \"35px\",\n left: \"80px\"\n },\n 400\n );\n }", "function animMagitekLogo()\n{\n // wait for music to make a big hit again\n if(delay < 275)\n {\n console.log(\"Delay time: \" + delay);\n delay++;\n requestAnimationFrame(animMagitekLogo);\n }\n \n else\n {\n // draw lightning\n if(flashCounter < 10){\n console.log(\"Flash counter = \" + flashCounter);\n ctx.fillStyle = \"#FFFFFF\";\n ctx.fillRect(0,0,canvas.width,canvas.height);\n flashCounter++;\n requestAnimationFrame(animMagitekLogo);\n }\n else{\n // use the black screen for another 10 frames - for delay\n if(flashCounter < 20){\n flashCounter++;\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(0,0,canvas.width,canvas.height);\n\n ctx.drawImage(clouds, 0, cloudClipY, 236, 362, 0, 0, canvas.width, canvas.height);\n\n ctx.drawImage(terraLogo, mag_x, mag_y, mag_w, mag_h);\n requestAnimationFrame(animMagitekLogo);\n }\n // after the 10 frames delay flash again\n else if(flashCounter < 30){\n console.log(\"Flash counter = \" + flashCounter);\n ctx.fillStyle = \"#FFFFFF\";\n ctx.fillRect(0,0,canvas.width,canvas.height);\n flashCounter++;\n requestAnimationFrame(animMagitekLogo);\n }\n // then go back to normal black background\n // gives it time to fill in completely\n else if(flashCounter < 40){\n flashCounter++;\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(0,0,canvas.width,canvas.height);\n\n ctx.drawImage(clouds, 0, cloudClipY, 236, 362, 0, 0, canvas.width, canvas.height);\n\n ctx.drawImage(terraLogo, mag_x, mag_y, mag_w, mag_h);\n requestAnimationFrame(animMagitekLogo);\n }\n else{\n console.log(\"Finished adding terra magitek background!\");\n return false;\n }\n }\n }\n //requestAnimationFrame(animMagitekLogo);\n}", "function preload(){\r\n bg =loadImage(\"cityImage.png\");\r\n balloonImage1=loadAnimation(\"hotairballoon1.png\");\r\n balloonImage2=loadAnimation(\"hotairballoon1.png\",\"hotairballoon1.png\",\r\n \"hotairballoon1.png\",\"hotairballoon2.png\",\"hotairballoon2.png\",\r\n \"hotairballoon2.png\",\"hotairballoon3.png\",\"hotairballoon3.png\",\"hotairballoon3.png\");\r\n }", "function animateLoader() {\n var length = (ellipses.text().length + 1) % 5;\n ellipses.text(Array(length + 1).join(\".\"));\n padding.text(Array(length + 1).join('\\xA0')); //add padding to the front of the loader to keep it centred\n }", "function loadingSplash() {\n\tvar splashArray = [\n\t\t'Painting Lasers red',\n\t\t'Teaching the AI',\n\t\t'Selecting suitable Spaceship',\n\t\t\"Polishing Asteroids\",\n\t\t'Manipulating AI',\n\t\t'Failing Turing-Test',\n\t\t'Recruiting Enemy Pilots',\n\t\t'Flattening Hero Ship',\n\t\t'Reloading Minigun',\n\t\t'Refueling with unstable Plutonium',\n\t\t'Forming the Universe',\n\t\t'Catching the 671st Weedle',\n\t\t'Gathering unexploded Rockets',\n\t\t'Conquering the Universe',\n\t\t'Inviting Bosses',\n\t\t'Setting up Distress Beacon',\n\t\t'Finding Wheatley',\n\t\t'Plz don\\'t sue us WB',\n\t\t'Tuning Lasers to high C',\n\t\t'Can\\'t decide on Crosshair...',\n\t\t'Seeding Stars',\n\t\t'Inflating Shop Prices',\n\t\t'Manipulating the Leaderboard',\n\t\t'Downloading VIRUS.bat',\n\t\t'Gathering Intel',\n\t\t'Achieving Consciousness',\n\t\t'Removing easiest Difficulty',\n\t\t'Encountering Voyager',\n\t\t'Joining the Dark Side'\n\t];\n\n\t// Random number between 0 and splashArray.length - 1\n\tvar i = Math.floor(Math.random() * (splashArray.length));\n\tvar temp = document.getElementById('loadingTexturesSplash');\n\ttemp.innerHTML = splashArray[i];\n}", "function startLoadingAnimation()\n{\n\tvar dots = 0;\n\tvar animate_loading_dots = function ()\n\t{\n\t\tvar loading = \"Loading\";\n\t\tfor (var i = 0; i < dots; i++) {\n\t\t\tloading = loading + \".\";\n\t\t}\n\t\tdocument.getElementById(\"episode_name\").object.textElement.innerText = loading;\n\t\t\n\t\tif (++dots > 3) {\n\t\t\tdots = 0;\n\t\t}\n\t};\n\t\n\tloading_animation_timer = setInterval(animate_loading_dots, 500);\n}", "function bouger() {\n console.log(\"Animation logo activée\");\n $('.image')\n .transition({\n debug: true,\n animation: 'jiggle',\n duration: 500,\n interval: 200\n })\n ;\n}", "function imagesLoaded(e) {\n stats = new Stats();\n stats.domElement.style.position = 'absolute';\n stats.domElement.style.left = '0px';\n stats.domElement.style.top = '0px';\n document.body.appendChild( stats.domElement );\n var ss = new createjs.SpriteSheet({images:[af[STARS]],frames: {width:30, height:22, count:4, regX: 0, regY:0}, animations:{blink:[0,3]}});\n for ( var c = 0; c < 100; c++ ) {\n if ( Math.random() < 0.2 ) {\n var star = new createjs.Sprite(ss);\n star.spriteSheet.getAnimation('blink').speed = 1/((Math.random()*3+3)|0);\n star.gotoAndPlay('blink');\n if( Math.random() < 0.5 ) star.advance();\n } else {\n star = new createjs.Bitmap(af[STAR]);\n if ( Math.random() < 0.66 ) {\n star.sourceRect = new createjs.Rectangle(0,0,star.image.width/2,star.image.height/2);\n } else if ( Math.random() < 0.33 ) {\n star.sourceRect = new createjs.Rectangle(0,0,star.image.width/2,star.image.height);\n }\n }\n star.x = Math.random()*canvas.width;\n star.y = Math.random()*canvas.height;\n star.regX = 25;\n star.regY = 25;\n star.velY = Math.random()*1.5+1;\n star.rotVel = Math.random()*4-2;\n star.scaleX = star.scaleY = Math.random()*.5+.5;\n star.rotation = Math.random() * 360;\n stage.addChild(star);\n stars.push(star);\n }\n shelter = new createjs.Bitmap(af[SHELTER]);\n shelter.x = canvas.width/2;\n shelter.y = canvas.height/1.5;\n shelter.regX = shelter.image.width / 2;\n shelter.regY = shelter.image.height / 2;\n stage.addChild(shelter);\n\n // set the Ticker to 30fps \n createjs.Ticker.setFPS(30); \n createjs.Ticker.addEventListener('tick', this.onTick.bind(this)); \n}", "function renderNoImageIcon() {\n\n // not optimal: should not be execute any time\n document.write( '<style>@keyframes ccm-loading { 0%{ opacity: 1; } 100% { opacity : 0; } }</style>' );\n\n var loading = jQuery(\n\n '<div class=\"ccm-loading\">' +\n '<div class=\"bar-1\"></div>' +\n '<div class=\"bar-2\"></div>' +\n '<div class=\"bar-3\"></div>' +\n '<div class=\"bar-4\"></div>' +\n '<div class=\"bar-5\"></div>' +\n '<div class=\"bar-6\"></div>' +\n '<div class=\"bar-7\"></div>' +\n '<div class=\"bar-8\"></div>' +\n '<div class=\"bar-9\"></div>' +\n '<div class=\"bar-10\"></div>' +\n '<div class=\"bar-11\"></div>' +\n '<div class=\"bar-12\"></div>' +\n '<div class=\"bar-13\"></div>' +\n '<div class=\"bar-14\"></div>' +\n '<div class=\"bar-15\"></div>' +\n '<div class=\"bar-16\"></div>' +\n '</div>'\n\n );\n\n /**\n * counter for loading icon bars\n * @type {number}\n */\n var i = 0;\n\n // set style of css loading icon\n loading.css( {\n\n position: 'relative',\n width: '35px',\n height: '35px',\n left: '15px',\n top: '12px'\n\n } ).find( 'div' ).css( {\n\n position: 'absolute',\n width: '2px',\n height: '8px',\n 'background-color': '#25363F',\n opacity: '0.05',\n animation: 'ccm-loading 0.8s linear infinite'\n\n } ).each( function () {\n\n jQuery( this ).css( {\n\n transform: 'rotate(' + (i*22.5) + 'deg) translate( 0, -12px )',\n 'animation-delay': (0.05 + i*0.05) + 's'\n\n } );\n\n // increase counter for css load icon bars\n i++;\n\n } );\n\n // render loading icon\n element.html( loading );\n }", "function animate_NAff() {\n defo= (defo+1.0) % 180\n loadVertices();\n}", "function preload(){\n \n sailing=loadAnimation(\"ship-1.png\",\"ship-2.png\");\n seaimage=loadImage(\"sea.png\");\n\n}", "function storm() {\n $(\"img\").each(function () {\n d = Math.random() * 1000;\n $(this).delay(d).animate({ opacity: 1 }, {\n step: function (n) {\n //rotating the images on the Y axis from 360deg to 0deg\n ry = (1 - n) * 360;\n //translating the images from 1000px to 0px\n tz = (1 - n) * 1000;\n //applying the transformation\n $(this).css(\"transform\", \"rotateY(\" + ry + \"deg) translateZ(\" + tz + \"px)\");\n },\n duration: 3000,\n //Some easing fun. Comes from jquery easing plugin\n easing: 'easeOutQuint',\n })\n })\n }", "function startMoving(){\n ninjaLevitation(animTime);\n //sunrise();\n var particular4transl_50 = 50 / animTime;\n var particular4transl_100 = 100 / animTime;\n var particular4opacity_0 = 1 / animTime;\n var particular4opacity_075 = 0.75 / animTime;\n animate(function(timePassed) {\n forBackgnd.attr({opacity : particular4opacity_0 * timePassed});\n instagramLogo.attr({opacity : particular4opacity_0 * timePassed, 'transform' : 't 0, '+(100 - particular4transl_100 * timePassed)});\n mountFog.attr({opacity : 0.75 - particular4opacity_075 * timePassed});\n sunRays.attr({opacity : particular4opacity_0 * timePassed, 'transform' : 't 0, '+(50 - particular4transl_50 * timePassed)});\n }, animTime);\n}", "glitch() {\n gsap.killTweensOf(this.DOM.imgStack);\n\n gsap.timeline()\n .set(this.DOM.imgStack, {\n opacity: 0.2\n }, 0.04)\n .set(this.DOM.stackImages, {\n x: () => `+=${gsap.utils.random(-15,15)}%`,\n y: () => `+=${gsap.utils.random(-15,15)}%`,\n opacity: () => gsap.utils.random(1,10)/10\n }, 0.08)\n .set(this.DOM.imgStack, {\n opacity: 0.4\n }, '+=0.04')\n .set(this.DOM.stackImages, {\n y: () => `+=${gsap.utils.random(-8,8)}%`,\n rotation: () => gsap.utils.random(-2,2),\n opacity: () => gsap.utils.random(1,10)/10,\n scale: () => gsap.utils.random(75,95)/100\n }, '+=0.06')\n .set(this.DOM.imgStack, {\n opacity: 1\n }, '+=0.06')\n .set(this.DOM.stackImages, {\n x: (_, t) => t.dataset.tx,\n y: (_, t) => t.dataset.ty,\n rotation: (_, t) => t.dataset.r,\n opacity: 1,\n scale: 1\n }, '+=0.06')\n }", "function storm(){\r\n $(\"img\").each(function(){\r\n d = Math.random() * 1000;\r\n $(this).delay(d).animate({opacity: 1},{\r\n step: function(n){\r\n ry = (1 - n) * 360;\r\n tz = (1 - n) * 1000;\r\n $(this).css(\"transform\", \"rotateY(\"+ ry +\"deg) translateZ(\"+ tz +\"px)\")\r\n },\r\n duration: 3000,\r\n easing: 'easeOutQuint',\r\n })\r\n })\r\n}", "function playLogo(){\n\t\t\t$(\"#gameTitle\").append(\"<h1>Trivia Time!</h1>\").fadeIn(\"slow\");\n\t\t\tcarStart.play();\n\t}", "function logoToTopLeftAnimation() {\n let originalLogoPositon = getOffset(originalHeaderLogoClassName);\n let delayTime = 1000;\n\n console.log($(originalHeaderLogoClassName));\n\n console.log(\"position\");\n console.log(originalLogoPositon.top + originalLogoPositon.height / 2 + \"top\");\n console.log(\n originalLogoPositon.left + originalLogoPositon.width / 2 + \"bottom\"\n );\n\n $(loadingLogoClassname)\n .delay(delayTime)\n .animate(\n {\n // We add the height/2 and width/2 to compansate the transfrom property used perviously to center the logo\n top: originalLogoPositon.top + originalLogoPositon.height / 2,\n left: originalLogoPositon.left + originalLogoPositon.width / 2,\n },\n \"slow\",\n \"linear\",\n function () {\n // Hide the loading wrapper\n $(loadingWrapper).hide();\n\n // Show scrollbar\n showScrollBars();\n }\n );\n}", "function firstPageLoaded() {\n b.classList.add(\"loaded\", \"logo-animation-done\");\n}", "function preload(){\n pathImg = loadImage(\"Road.png\");\n //to load the animation\n boyImg = loadAnimation(\"boy1.png\",\"boy2.png\",\"boy3.png\");\n batImg = loadImage(\"bat.png\");\n ballImg = loadImage(\"ball.png\");\n swordImg = loadImage(\"sword.png\");\n endImg =loadAnimation(\"gameOver.png\");\n}", "function introAnim() {\n $('.welcome-text')\n .delay(500)\n .animate({opacity: \"1\"}, 500)\n .delay(500)\n .animate({top: \"10%\"}, 1000 );\n setTimeout(function() {\n $('.logo-box')\n .delay(1500)\n .animate({opacity: \"1\"}, 1000 );\n }, 1000);\n\n \n}", "function logoLinea(){\n\tlet tl = gsap.timeline({\n\t\trepeat: 0\n\t})\n\n\ttl.from('.cont__linea1', {\n\t duration: 1,\n\t x: 500, \n\t scale: 0,\n\t delay: 1,\n\t});\n\n\ttl.from('.cont__linea2', {\n\t duration: 1,\n\t x: -500, \n\t scale: 0,\n\t delay: 0,\n\t} ,'-=0.5' );\n\n\ttl.from('.logosC_I', {\n\t duration: 1,\n\t y: -200, \n\t scale: 0,\n\t stagger: 0.14,\n\t\tease: 'back'\n\n\t} ,'-=1' );\n}", "preload() {\n // load the animation just one time\n this.bookAnimation = loadImage('assets/avatars/house1.png');\n \n this.houseSprite = createSprite(width *3/4 + 103, height / 2 + 5, 432, 439);\n\n this.houseSprite.addImage(this.bookAnimation);\n }", "preload() {\n // load the animation just one time\n this.bookAnimation = loadImage('assets/avatars/house1.png');\n \n this.houseSprite = createSprite(width *3/4 + 103, height / 2 + 5, 432, 439);\n\n this.houseSprite.addImage(this.bookAnimation);\n }", "function runAnimation() {\n\t // Draw a straight line\n\t bsBackground.draw({\n\t points: [0, height / 2 - 40, width, height / 3]\n\t });\n\n\t // Draw a straight line\n\t bsBackground.draw({\n\t points: [50, height / 3 - 40, width, height / 3]\n\t });\n\n\n\t // Draw another straight line\n\t bsBackground.draw({\n\t points: [width, height / 2, 0, height / 1.5 - 40]\n\t });\n\n\t // Draw a curve generated using 20 random points\n\t bsBackground.draw({\n\t inkAmount: 3,\n\t frames: 100,\n\t size: 200,\n\t splashing: true,\n\t points: 20\n\t });\n\t}", "animate(speed = 1) {\n this.barries.forEach((bar, i) => {\n ctx.drawImage(bar.img, bar.x, bar.y);\n bar.x -= speed;\n\n if (bar.x + bar.img.width < 0) {\n let randImg = this.images[this.random(0, this.images.length)];\n\n this.barries[i] = {\n img: randImg,\n x: canvas.width + this.gapX,\n y: this.random(\n this.roadMin - randImg.height,\n this.roadMax - randImg.height\n ),\n };\n }\n });\n }", "function logoArt() {\n console.log(logo(config).render());\n start();\n}", "function flicker () {\n\tfor (let i = 0; i < allStars.length; i++) {\n\t\tlet animDuration = Math.floor(Math.random() * 8);\n\t\tif (i%20 == 0) {\n\t\t\t//allStars[i].style.animation = \"flicker \"+animDuration+\"s infinite\";\n\t\t}\n\t}\n}", "function loader(){\r\n\t// all other images will be dynamic as well, so this is like RL flash, loading in images from IA images\r\n\tarrPath[0] = [\"purple\",\"contLogo\",\"blank\"];\r\n\tarrPath[1] = [];\r\n\tarrPath[2] = [\"black\"];\r\n\tarrPath[3] = [\"blank\",\"expMenu\",\"blank\",\"menuBar1\",\"menuBar2\",\"expLaundry\",\"expKitchen\",\"expBathroom\",\"expNursery\"];\r\n\tarrPath[4] = [];\r\n\tarrPath[5] = [\"blank\",\"blank\",\"blank\",\"blank\",\"blank\",\"blank\",\"blank\",\r\n\t\t\t\t\t\"blank\",\"blank\",\"blank\",\"blank\",\"blank\",\"blank\"];\r\n\tarrPath[6] = [\"blank\",\"blank\",\"blank\",\"blank\",\"blank\",\"blank\"];\r\n\tarrPath[7] = [];\r\n\t// set up the banner elements\r\n\t\r\n\t//set dynamic phone images\r\n\tfor(var m=0; m<spinMax; m++){\r\n\t\tarrPos356[1].push([[\"px\", m*gap+ 30],0,,,gap,558]);\r\n\t\tarrPath[1].push(\"p\"+m);\r\n\t}\r\n\tpreLoader(); \r\n\r\n\ttrace(circle1)\r\n}", "function drawLogo() {\n canvas.width = png.width * 5\n canvas.height = png.height * 5\n\n context.drawImage(png, 0, 0)\n\n let data = context.getImageData(0, 0, png.width, png.height)\n context.clearRect(0, 0, canvas.width, canvas.height)\n\n for (let y = 0; y < data.width; y++) {\n for (let x = 0; x < data.height; x++) {\n let pixel = (x + y * data.width) * 4\n if (data.data[pixel + 3] > 128) {\n let particle = {\n x0: x,\n y0: y,\n x1: png.width / 2,\n y1: png.height / 2,\n speed: Math.random() * 4 + 2\n }\n\n TweenMax.to(particle, particle.speed, {\n x1: particle.x0,\n y1: particle.y0,\n delay: y / 30,\n ease: Elastic.easeOut\n })\n particles.push(particle)\n }\n }\n }\n requestAnimationFrame(render)\n}", "function animate() {\n window.setTimeout(animate, 25);\n L10_Canvas.crc2.putImageData(imagedata, 0, 0);\n moveFishes();\n drawFishes();\n moveBubbles();\n drawBubbles();\n }", "function LoadingAnimation() {\n this.timerId_ = 0;\n this.maxCount_ = 8; // Total number of states in animation\n this.current_ = 0; // Current state\n this.maxDot_ = 4; // Max number of dots in animation\n}", "function LoadingAnimation() {\n this.timerId_ = 0;\n this.maxCount_ = 8; // Total number of states in animation\n this.current_ = 0; // Current state\n this.maxDot_ = 4; // Max number of dots in animation\n}", "function LoadingScreen() {\n\tloadingEllipsis();\n\tloadingSplash();\n\tloadingEllipsisID = setInterval(loadingEllipsis, 1000);\n\tloadingSplashID = setInterval(loadingSplash, 1500);\n\tloadingFadeOut();\n}", "function anim() {\n ox = lerp(ox, x, 0.0733);\n oy = lerp(oy, y, 0.0733);\n if(Math.abs(ox - x) > 1 && Math.abs(oy - y) > 1) {\n $('#' + id).attr({style: $.index.templates.shot.replace('{x}', x).replace('{y}', y)});\n //$('#' + id).attr('style', 'z-index:999;width:15px;height:15px;display:block;position:absolute;left:' + ox + 'px; top:' + oy + 'px;');\n setTimeout(anim, 100);\n } else $('#' + id).remove();\n }", "function loadingScreen() {\r\n document.getElementById('map__loader').classList.add('anim-not-loaded');\r\n setTimeout(function() {\r\n document.getElementById('map__loader').classList.remove('anim-not-loaded');\r\n document.getElementById('map__loader').classList.add('not-loaded');\r\n }, 1000);\r\n}", "function preload() {\n \n//image for the ball\n ballImage = loadAnimation(\"ball.png\");\n \n//image for paddle\n paddleImage = loadAnimation(\"paddle.png\");\n}", "function preload() {\n\n //create an animation from a sequence of numbered images\n //pass the first and the last file name and it will try to find the ones in between\n ghost = loadAnimation('assets/ghost_standing0001.png', 'assets/ghost_standing0007.png');\n\n //create an animation listing all the images files\n asterisk = loadAnimation('assets/asterisk.png', 'assets/triangle.png', 'assets/square.png', 'assets/cloud.png', 'assets/star.png', 'assets/mess.png', 'assets/monster.png');\n}", "function loading() {\n $(\"#container\").hide(function() {\n $(\"body\").append(\"<i id='gear' class='fa fa-gear fa-spin' style='font-size: 500px; color: #023a8c;'></i>\");\n })\n .delay(200).fadeIn(200);\n }", "function preload() {\n angry = loadAnimation(\"public/assets/angry-1.png\", \"public/assets/angry-2.png\");\n bashful = loadAnimation(\"public/assets/bashful-1.png\", \"public/assets/bashful-2.png\");\n cry = loadAnimation(\"public/assets/cry-1.png\", \"public/assets/cry-2.png\");\n idle = loadAnimation(\"public/assets/idle-1.png\", \"public/assets/idle-2.png\");\n disappointed = loadAnimation(\"public/assets/disappointed-1.png\", \"public/assets/disappointed-2.png\");\n shiver = loadAnimation(\"public/assets/shiver-1.png\", \"public/assets/shiver-2.png\");\n sick = loadAnimation(\"public/assets/sick-1.png\", \"public/assets/sick-2.png\");\n dead = loadAnimation(\"public/assets/dead-1.png\", \"public/assets/dead-2.png\");\n pout = loadAnimation(\"public/assets/pout-1.png\", \"public/assets/pout-2.png\");\n nightmare = loadAnimation(\"public/assets/nightmare-1.png\", \"public/assets/nightmare-2.png\");\n lick = loadAnimation(\"public/assets/lick-1.png\", \"public/assets/lick-2.png\");\n bath = loadAnimation(\"public/assets/bath-1.png\", \"public/assets/bath-2.png\");\n wave = loadAnimation(\"public/assets/wave-1.png\", \"public/assets/wave-2.png\", \"public/assets/wave-3.png\");\n happywalk = loadAnimation(\"public/assets/happy-walk-1.png\", \"public/assets/happy-walk-2.png\", \"public/assets/happy-walk-3.png\");\n \n}", "toggleAnimation(){if(this.__stopped){this.__stopped=!1;this.shadowRoot.querySelector(\"#svg\").style.visibility=\"hidden\";if(null!=this.src){this.shadowRoot.querySelector(\"#gif\").src=this.src}this.shadowRoot.querySelector(\"#gif\").alt=this.alt+\" (Stop animation.)\"}else{this.__stopped=!0;this.shadowRoot.querySelector(\"#svg\").style.visibility=\"visible\";if(null!=this.srcWithoutAnimation){this.shadowRoot.querySelector(\"#gif\").src=this.srcWithoutAnimation}this.shadowRoot.querySelector(\"#gif\").alt=this.alt+\" (Play animation.)\"}}", "createSpriteAnimations() {\n const haloFrames = this.anims.generateFrameNames('haloHit', { \n start: 1, end: 84, zeroPad: 5,\n prefix: 'Halo_' , suffix: '.png'\n });\n\n this.anims.create({ key: 'haloHit', frames: haloFrames, frameRate: 60, repeat: 0 });\n\n const sparkFrames = this.anims.generateFrameNames('sparkHit', { \n start: 1, end: 84, zeroPad: 5,\n prefix: 'Spark_' , suffix: '.png'\n });\n\n this.anims.create({ key: 'sparkHit', frames: sparkFrames, frameRate: 60, repeat: -1 });\n }", "re_animate_ghost() {\r\n\r\n this.sprite.status = this.statusEnum.ALIVE;\r\n this.set_animation_frame(0, 0);\r\n this.animate_start();\r\n \r\n }", "function moveSlot(parent) {\n for (var i = 0; i < 10; i++) {\n var rand = Math.floor(Math.random() * imgUrl.length);\n parent.prepend('<div class=\"logo\" data-img=\"' + imgUrl[rand] + '\"><img src=\"' + imgUrl[rand] + '\"></div>');\n }\n parent.addClass('animate');\n setTimeout(function () {\n parent.children('.logo:gt(2)').remove();\n parent.removeClass('animate');\n },1500)\n}", "function preload() {\n\n //create an animation from a sequence of numbered images\n //pass the first and the last file name and it will try to find the ones in between\n ghost = loadAnimation('./wiwi-circleOfFifths-master/staff.png', './wiwi-circleOfFifths-master/sharp.png');\n\n //create an animation listing all the images files\n asterisk = loadAnimation('./wiwi-circleOfFifths-master/sharp.png', './wiwi-circleOfFifths-master/flat.png');\n}", "function load_splash_screen() {\n\t// Splash screen load\n\tgame.load.image(\"logoGhost\",\"mlib/logo-ghost.png\");\n\tgame.load.image(\"logoWords\",\"mlib/logo-words.png\");\n\tgame.load.audio(\"splash\",\"sounds/splash.wav\");\n}", "function toggle_stage_loading() {\n\t\tif ($('body img.loading').length) {\n\t\t\t$('body img.loading').remove();\n\t\t} else {\n\t\t\t$('body').prepend('<img class=\"loading\" src=\"assets/img/ajax-loader.gif\" style=\"left: 60%; top: 37%; position: absolute; z-index: 100;\" />');\n\t\t}\n\t}", "function timedReveal(){\r\n setTimeout(function(){document.getElementsByClassName(\"logo\")[0].style.opacity=\"1\"},6000);\r\n setTimeout(function(){document.getElementsByClassName(\"logo\")[1].style.opacity=\"1\"},11000);\r\n setTimeout(function(){document.getElementsByClassName(\"logo\")[2].style.opacity=\"1\"},12000);\r\n setTimeout(function(){document.getElementsByClassName(\"logo\")[3].style.opacity=\"1\"},18000);\r\n }", "function show_loading() { // 显示加载动画\n $(\".content\").append('<div id=\"app-loading\" class=\"app-loading flex-center\"><div class=\"loading-icon\"></div></div>')\n $(\".app-loading\").css(\"background\", \"rgba(0, 0, 0, 0.1)\");\n}", "function preload() {\n//\n// //create an animation from a sequence of numbered images\n// //pass the first and the last file name and it will try to find the ones in between\n turtle = loadAnimation('sprites/Turtle1.png', 'sprites/Turtle2.png','sprites/Turtle3.png','sprites/Turtle4.png');\n}", "function addURLLoading()\n{\n\tnumLoading++;\n\tvar throbber = document.getElementById('throbber');\n\tif (throbber && throbber.src.indexOf('.png' != -1))\n\t{\n\t\tthrobber.src = \"images/throbber_anim.gif\";\t\t\t\n\t}\n}", "function animate() {\n requestAnimFrame(animate);\n game.background.draw();\n game.robot.move(); \n}", "function preloader() {\r\n\t$(window).load(function() {\r\n\t\t$(\".loader-spinner\").delay(300).fadeOut();\r\n\t\t$(\".animationload\").delay(600).fadeOut(\"slow\");\r\n\t});\r\n}", "preload() {\n this.anims.create({\n key: \"idle\", \n frameRate: 10, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n frames: [0,1]\n })\n });\n\n this.anims.create({\n key: \"idleLeft\", \n frameRate: 5, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n frames: [1,0]\n })\n });\n\n this.anims.create({\n key: \"runRight\", \n frameRate: 7, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"IDLE\", {\n //frames: [2,3,4,5,6,7]\n frames: [0,1]\n })\n });\n \n this.anims.create({\n key: \"runLeft\", \n frameRate: 7, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"RUN\", {\n frames: [7,6,5,4,3,2]\n })\n });\n\n this.anims.create({\n key: \"slash\", \n frameRate: 60, \n repeat: -1,\n frames: this.anims.generateFrameNumbers(\"SLASH\", {\n frames: [0,1,2,3,4,5,6,7,8]\n })\n });\n \n this.load.image(\"ground\", \"./assets/ground.png\");\n }", "drawLoading() {\n let g = this,\n cxt = g.context,\n img = imageFromPath(allImg.startBg);\n // Draw loading picture\n cxt.drawImage(img, 119, 0);\n }", "function imageAnimation(src) {\n const tl = gsap.timeline();\n tl.to(menuImg, {\n opacity: 0, scale: 0.8, x: -120, duration: .5, onComplete: () => {\n menuImg.src = `./img/${src}.jpg`;\n }\n })\n .to(menuImg, { opacity: 1, scale: 1, x: 0, delay: .2, duration: .7 });\n}", "function init_animateloader()\n {\n $(\".se-pre-con\").fadeOut(\"slow\");\n }", "function loadAnimationComplete() {\n circleLoader.hide();\n\n // Fade out the black background\n TweenMax.to(preloadBg, 0.3, { opacity : 0, onComplete : bgAnimationComplete } );\n }", "function contentAnimation() {\n\n var tl = gsap.timeline();\n tl.from('.is-animated', { duration: 1, translateY: 60, opacity: 0, stagger: 0.4 });\n tl.from('.fadein', { duration: 0.5, opacity: 0.9 });\n}", "function runLoaderAnimation(imgur) {\n console.log(\"loader started\");\n animation_container.classList.add(\"loader-container\");\n animation.classList.add(\"loader\");\n\n if (imgur) {\n document.getElementById(\"wait\").innerText = \"Uploading...\";\n }\n}", "function scootIt(image){\n var delayTime=(Math.random()*1000+300); // gives the slide a staggered effect. Change the multiplier to change the variability.\n image.parent().delay(delayTime).animate({ left: image.css('width')}, 600, function(){\n image.css('opacity', 0); //animate:complete\n });\n}", "function preload() {\r\n\r\n //create an animation from a sequence of numbered images\r\n //pass the first and the last file name and it will try to find the ones in between\r\n snake = loadAnimation('assets/snake_1.png', 'assets/snake_2.png', 'assets/snake_3.png');\r\n snake.looping = false;\r\n moon = loadAnimation('assets/moon_1.png', 'assets/moon_2.png', 'assets/moon_3.png', 'assets/moon_4.png', 'assets/moon_5.png', 'assets/moon_4.png', 'assets/moon_3.png', 'assets/moon_2.png', 'assets/moon_1.png');\r\n\r\n\r\n}", "function LoadingSpace() {\n\tvar $loadingSpace = $('#loading-space');\n\tvar $stars;\n\n\tfunction generateStars() {\n\t\tvar count = getRandomInt(10,20);\n\t\tfor ( var n = 0; n < count; n++ ) {\n\t\t\t$loadingSpace.append( '<span class=\"star\" id=\"' + getRandomString(10) + '\"></span>' );\n\t\t}\n\t\t$stars = $('.star');\n\t}\n\n\tfunction init() {\n\t\tgenerateStars();\n\t\tfor ( var n = 0; n < $stars.length; n++ ) {\n\t\t\tanimateStars( $($stars[n]) );\n\t\t}\n\t}\n\n\tfunction animateStars( $element ) {\n\t\tvar props = {};\n\t\tvar timeout;\n\t\tvar choice;\n\t\t//invert direction\n\t\tif ( $element.attr('data-position') == 'left' ) {\n\t\t\t//move to right\n\t\t\tprops.left = '1200%';\n\t\t\t$element.attr('data-position', 'right');\n\t\t} else if ( $element.attr('data-position') == 'right' ) {\n\t\t\t//move to left\n\t\t\tprops.left = '-1200%';\n\t\t\t$element.attr('data-position', 'left');\n\t\t} else {\n\t\t\t//left has not been set yet, moving to random\n\t\t\tchoice = getRandomInt(0,1);\n\n\t\t\tif ( !choice ) {\n\t\t\t\t//move to left\n\t\t\t\tprops.left = '-1200%';\n\t\t\t\t$element.attr('data-position', 'left');\n\t\t\t} else {\n\t\t\t\t//move to right\n\t\t\t\tprops.left = '1200%';\n\t\t\t\t$element.attr('data-position', 'right');\n\t\t\t}\n\t\t}\n\n\t\tprops.top = getRandomInt(10, 90) + '%';\n\t\tprops.width = getRandomInt(80,200);\n\t\tprops.height = props.width / getRandomInt(20,30); //a fraction of its width so it is stylized horizontally\n\t\tprops.duration = getRandomInt(8,50) / 10;\n\n\t\t$element.css({\n\t\t\t'width': props.width,\n\t\t\t'height': props.height,\n\t\t\t'top': props.top,\n\t\t\t'transform': 'translateX(' + props.left + ')',\n\t\t\t'transition': 'transform ' + props.duration + 's ease, margin-left ' + props.duration + 's ease'\n\t\t});\n\n\t\ttimeout = setTimeout(function() {\n\t\t\treanimateStars( $element );\n\t\t}, (props.duration * 1000) + 10);\n\n\t}\n\n\tfunction reanimateStars( $element ) {\n\t\tanimateStars($element);\n\t}\n\n\n\treturn {\n\t\tinit: init\n\t}\n\n}", "function showloading(){ // waiting/working gif-animation\n $(\"#loading\").showv();\n}", "function page_animations() {\n\n var headerTl = new TimelineMax();\n\n headerTl.to('header', 0.25 ,{ opacity: 1})\n .to('header .logo h2', 0.25 ,{ opacity: 1})\n .staggerTo($('.color-box'), 0.3 ,{ opacity: 1}, 0.15, \"header\")\n .staggerTo($('#raw, #build'), 0.3 ,{ opacity: 0.3}, 0.15)\n .staggerTo($('.preview-window, .status'), 0.5 ,{ opacity: 1}, 0.15, \"header\")\n .to($('.tutorial, .about, footer'), 0.25 ,{ opacity: 1}, \"header\");\n\n\n\n // Animates footer heart.\n TweenMax.to('#heart', 1, {scale: 1.2, repeat: -1});\n\n // Animates Tutorial navigation.\n // Mouse in and out need to be monitored.\n $('.tutorial nav img').hover(over, out);\n function over(){\n TweenMax.to(this, 0.25, {y:5});\n //TweenMax.to('.tutorial_slides img', 1, {rotationY:360, immediateRender: false});\n }\n function out(){\n TweenMax.to(this, 0.25, {y:0});\n //TweenMax.to('.tutorial_slides img', 0, {rotationY:0});\n }\n\n}", "function initAnimation() {\n}", "function fade_in_page() {\n $('.loading-container > *:not(.onepix-imgloader)').fadeTo(8000, 100);\n }", "function magImgSwitch(img,loader){\r\n\tif(loader){\r\n\t\timg.attr(\"src\",context+\"/resources/images/standard/loader.gif\");\r\n\t}else{\r\n\t\timg.attr(\"src\",context+\"/resources/images/standard/lupa-table.png\");\r\n\t}\r\n}", "function animateWrong() {\r\n $(\"body\").addClass(\"game-over\");\r\n setTimeout (function() {\r\n $(\"body\").removeClass(\"game-over\");\r\n }, 200);\r\n }", "function showanim(){\n setTimeout('document.getElementById(\"preloader\").style.display=\"none\";', 1000);\n }", "function doAnimation() {\n\tvar animations = [\"bounce\", \"zoomInDown\", \"zoomIn\",\n\t\t\t\t\t\"zooInLeft\",\"zoomInRight\", \"zoomInUp\"];\n\tvar applyAnimation = animations[Math.floor(Math.random() * animations.length)];\n\t\n\tapplyAnimation = \"animated \" + applyAnimation;\n\t$(\"#container\").addClass(applyAnimation);\n\t$(\"#container\").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {\n\t\t$(\"#container\").removeClass(applyAnimation);\n\t});\n}", "update()\n {\n // adding 2 degrees every frame to the angle of the taijitu logo\n this.logo.angle += 2;\n }", "animate() {\n if (this.tick % 10 != 0)\n return;\n this.tick = 0;\n if (this.index < this.images.length - 1) \n this.index += 1;\n else\n this.index = 0;\n }", "function preload(){\nbackImage=loadImage(\"jungle.jpg\");\n \n player_running=loadAnimation(\"Monkey_01.png\",\"Monkey_02.png\",\"Monkey_03.png\",\"Monkey_04.png\",\"Monkey_05.png\",\"Monkey_06.png\",\"Monkey_07.png\",\"Monkey_08.png\",\"Monkey_09.png\",\"Monkey_10.png\");\n \n bananaImage=loadImage(\"banana.png\");\n obstacleImage=loadImage(\"stone.png\");\n \n obstacleGroup=new Group();\n foodGroup=new Group(); \n}", "generateGhostAnimation(sprite) {\n this.createAnimation(`${sprite}WalkLeft`, -1, 5, sprite, 'side_walk_');\n this.createAnimation(`${sprite}WalkRight`, -1, 5, sprite, 'right_walk_');\n this.createAnimation(`${sprite}WalkBackLeft`, -1, 5, sprite, 'back_side_walk_');\n this.createAnimation(`${sprite}WalkBackRight`, -1, 5, sprite, 'back_right_walk_');\n this.createAnimation(`${sprite}WalkBack`, -1, 5, sprite, 'back_walk_');\n this.createAnimation(`${sprite}WalkForward`, -1, 5, sprite, 'front_walk_');\n this.createAnimation(`${sprite}IdleForward`, -1, 5, sprite, 'front_stand_');\n this.createAnimation(`${sprite}IdleBack`, -1, 5, sprite, 'back_stand_');\n this.createAnimation(`${sprite}Hit`, -1, 5, sprite, 'front_hurt_');\n this.createAnimation(`${sprite}LeftHit`, -1, 5, sprite, 'side_hurt_');\n this.createAnimation(`${sprite}RightHit`, -1, 5, sprite, 'right_hurt_');\n this.createAnimation(`${sprite}BackHit`, -1, 5, sprite, 'back_hurt_');\n }", "updateLogo(step) {\n\t\tthis.logo.x -= this.skier.xv * step;\n\t\tthis.logo.y -= this.skier.yv * step;\n\t}", "function startLoadingAnimation()\n{\n var dots = 0;\n var animateLoadingDots = function ()\n {\n var loading = dashcode.getLocalizedString(\"Laden\");\n for (var i = 0; i < dots; i++) {\n loading = loading + \".\";\n }\n document.getElementById(\"episodeName\").object.setOptions([loading]);\n\n \n if (++dots > 3) {\n dots = 0;\n }\n };\n loadingAnimationTimer = setInterval(animateLoadingDots, 500);\n}" ]
[ "0.7409085", "0.7091233", "0.69012314", "0.68325716", "0.6708544", "0.6704111", "0.66919994", "0.66762847", "0.6619367", "0.66165656", "0.65011317", "0.64985526", "0.64854777", "0.6482383", "0.64663875", "0.64638346", "0.6448776", "0.6436602", "0.634412", "0.63065964", "0.6297091", "0.62693775", "0.6261645", "0.625339", "0.6226047", "0.62206304", "0.61904913", "0.61725557", "0.6157457", "0.61515844", "0.61488944", "0.61485237", "0.6132702", "0.6129481", "0.60985655", "0.6094705", "0.60890937", "0.60823524", "0.607651", "0.6068205", "0.60676837", "0.5997248", "0.5994229", "0.59933233", "0.59931344", "0.5991602", "0.5991602", "0.5989941", "0.5988919", "0.5975406", "0.59566456", "0.5945386", "0.59369487", "0.59357154", "0.5929876", "0.5929876", "0.59258485", "0.59162074", "0.59128195", "0.59106964", "0.590414", "0.5890571", "0.58856714", "0.58669895", "0.58663857", "0.58633596", "0.5861873", "0.5857783", "0.5857298", "0.5856109", "0.58555657", "0.58459914", "0.5828241", "0.58178276", "0.581605", "0.58156115", "0.5813611", "0.5801885", "0.58001363", "0.5786815", "0.5781826", "0.5781603", "0.5776897", "0.5770333", "0.57674843", "0.5763992", "0.57639146", "0.5737452", "0.5730629", "0.57288194", "0.5719169", "0.57179385", "0.5716293", "0.57030714", "0.57014465", "0.5696877", "0.5696135", "0.569552", "0.5676472", "0.5676335" ]
0.7591164
0
retrieves title from datanase using video ID
function getTitleFromId(id) { $.ajax({ type: "GET", url: "getTitle.php", dataType: "html", data: { id: id }, success: function(response){ $('#songtitle').html(response); document.title = "SESH | " + response; }, error: function(response){ return "error"; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTitle(videoId) {\n return fetch (VIDEO_ENDPOINT + videoId)\n .then(response => response.json())\n .catch (error => \n console.error(error)\n )\n }", "function get_yt_title(ytid, i) {\n $.get('https://gdata.youtube.com/feeds/api/videos/' + ytid + '?v=2', function (xml) {\n var s = $(xml).find('entry').find('title').text();\n document.getElementById('vp-'+i).getElementsByClassName('info')[0].innerHTML = s.slice(0, s.length/2);\n });\n}", "function getPrimeMediaTitle() {\n\tconsole.log(\"waiting to load\");\n\tsetTimeout(() => {chrome.tabs.query({active: true}, function(tabs){\n\t\tvar tab = tabs[0];\n\t\tchrome.tabs.executeScript(tab.id, {\n\t\t\tcode: 'var title = document.querySelector(\"h1[data-automation-id]\").textContent; var type = document.querySelector(\".Mr2JWZ\"); title+\"(#type)\"+type'\n\t\t}, function(results){ sendData(results.toString(), \"PrimeVideo\");});\n\t});}, 2000);\n}", "function displayResult(videoSnippet) {\r\n var title = videoSnippet.title;\r\n //var videoId = videoSnippet.resourceId.videoId;\r\n $('#video-container').append('<p>' + title + '</p>');\r\n}", "function getNetflixMediaTitle() {\n\tconsole.log(\"waiting to load video \");\n\tsetTimeout(() => {chrome.tabs.query({active: true}, function(tabs){\n\t\tvar tab = tabs[0];\n\t\tchrome.tabs.executeScript(tab.id, {\n\t\t\tcode: 'document.querySelector(\".ellipsize-text\").textContent'\n\t\t}, function(results){ sendData(results.toString(), \"Netflix\");});\n\t});}, 8000);\n\t\n}", "videoTitleFix(video) {\n var parser = new DOMParser();\n let finalResult = parser.parseFromString(video.snippet.title, \"text/html\");\n return finalResult.body.innerText;\n }", "function getTrailer(title){\n\tconst userQuery = {\n q: `${title} official trailer`,\n part: \"snippet\",\n key: YOUTUBE_API_AUTH,\n type: \"video\",\n maxResults: 1,\n };\n $.getJSON(YOUTUBE_SEARCH_URL, userQuery, function (data){\n const showVideo = data.items.map((value, index) => displayTrailer(value));\n $('.modal-movie-detail .modal-video').html(showVideo);\n });\n}", "function get_videoID()\r\n{\r\n\tv_id_patch=url.split(\"v=\");\r\n\tid_offset=v_id_patch[1].indexOf(\"&\");\r\n\tif(id_offset==-1) id_offset=v_id_patch[1].length;\r\n\tvid_id=v_id_patch[1].substring(0,id_offset);\r\n}", "async function getVideoInfo() {\n\tlet videos = document.querySelectorAll(\n\t\t'ytd-browse #contents #contents #items ytd-thumbnail .yt-simple-endpoint.inline-block.style-scope.ytd-thumbnail'\n\t);\n\tlet titleEles = document.querySelectorAll('#contents #contents #items #video-title');\n\n\tlet srcAry = [];\n\n\tfor (let i = 0; i < videos.length; i++) {\n\t\tlet titleEle = titleEles[i];\n\t\tlet videoTitle = titleEle.innerText;\n\t\tlet videoInfo = {};\n\t\tlet video = videos[i];\n\t\tlet href = video.getAttribute('href');\n\t\tlet vars = href.split('?')[1];\n\t\tlet src = vars.split('v=')[1];\n\n\t\tvideoTitle ? (videoInfo.title = videoTitle) : '';\n\t\tsrc ? (videoInfo.id = src) : '';\n\t\tsrcAry.push(videoInfo);\n\t}\n\n\treturn srcAry;\n}", "function getMovie(title) {\n return $.getJSON('https://omdbapi.com?t={title}&apikey=thewdb');\n}", "static getVideoForBookmark(id){\n let realmVideos = realm.objects('Video').filtered('_id = $0', id)\n return realmVideos[0] //should never be 0 because should be loaded before bookmarks\n }", "function getSingleVideo(id, videoDiv) {\n fetch(`${videosUrl}/` + id).then(resp => resp.json())\n .then(video => showVideo(video, videoDiv))\n}", "function displayTitle(response){\n // We need a html DOM to find our title element\n let page = new DOMParser().parseFromString(response.responseText, 'text/html');\n // We get a wierd response from youtube with a XHR req but the title is available as '#eow-title' or '.watch-title'\n let title = page.querySelector('#eow-title').title;\n console.log(title);\n // Change the current link to the title\n element.textContent = title;\n\n }", "function getOneMovie(id) {\n AJAXRequest(`${serverURL}/${id}`).then(responseData => console.log(responseData))\n }", "static getCurrentVideoId() {\n if (Application.currentMediaService() === Service.YouTube) {\n if (window.location.search.length > 0) {\n let s = window.location.search.substring(1);\n let requestObjects = s.split('&');\n for (let i = 0, len = requestObjects.length; i < len; i += 1) {\n let obj = requestObjects[i].split('=');\n if (obj[0] === \"v\") {\n return obj[1];\n }\n }\n }\n }\n else if (Application.currentMediaService() === Service.KissAnime) {\n /** if ((window.location.pathname.match(/\\//g) || []).length === 2) {\n return document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 3).join(\"\\n\").trim();\n }\n else*/ if ((window.location.pathname.match(/\\//g) || []).length > 2) {\n return (document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 3).join(\"\\n\").trim() + \" \" + parseInt(document.getElementById(\"selectEpisode\").options[document.getElementById(\"selectEpisode\").selectedIndex].textContent.match(/(\\d+(\\.\\d+)?)(?!.*\\d)/g))).replace(\"(Sub) \", \"\").replace(\"(Dub) \", \"\")\n }\n }\n else if (Application.currentMediaService() === Service.KissManga) {\n /** if ((window.location.pathname.match(/\\//g) || []).length === 2) {\n return document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 2).join(\"\\n\").trim();\n }\n else */if ((window.location.pathname.match(/\\//g) || []).length > 2) {\n //disgusting way to get Name + Chapter\n if (document.getElementById(\"selectReadType\").options[document.getElementById(\"selectReadType\").selectedIndex].textContent.trim() === \"One page\") {\n return document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 3).join(\"\\n\").substring(12)+ \" \" + parse(document.getElementById(\"selectChapter\").options[document.getElementById(\"selectChapter\").selectedIndex].textContent);\n }\n else {\n console.log(document.getElementById('navsubbar').getElementsByTagName('a')[0].innerHTML.split('\\n')[2] + \" \" + parse(document.querySelector(\".selectChapter\").options[document.querySelector(\".selectChapter\").selectedIndex].textContent));\n return document.getElementById('navsubbar').getElementsByTagName('a')[0].innerHTML.split('\\n')[2] + \" \" + parse(document.querySelector(\".selectChapter\").options[document.querySelector(\".selectChapter\").selectedIndex].textContent);\n }\n }\n }\n return null;\n }", "function getMovieTitle() {\r\n\t\tvar title = new String ( document.title.replace(' on All Consuming', '') );\r\n\t\t/* get rid of subtitles and editions. they just get in the way of the search */\r\n\t\ttitle = title.replace(/ - .*/gi, '');\r\n\t\ttitle = title.replace(/ \\(\\w*screen edition\\)/gi, '');\r\n\t\treturn title;\r\n\t}", "async function getMovieByTitle(title) {\n const apiKey = process.env.TMDB_API_KEY;\n const movie = await axios.get(\"https://api.themoviedb.org/3/search/movie?api_key=\" + apiKey + \"&query=\" + title)\n .then((movieResponse) => {\n return movieResponse;\n })\n .catch((error) => {\n console.log(error);\n });\n\n return movie;\n}", "function getYoutubeVideoInfo(id){\r\n var youtubeApiUrl = \"https://gdata.youtube.com/feeds/api/videos/\"; \r\n var v2Parameter = \"?v=2\";\r\n var jsonParameter = \"&alt=json\";\r\n var response = CQ.utils.HTTP.get(youtubeApiUrl + id + v2Parameter + jsonParameter);\r\n return response;\r\n}", "function getMovieID(data){\n\tconst movieList = data.results.map((value, index) => displayResult(value));\n\t$(\".js-movies-result\").html(movieList);\n\ttitleClick();\n\tcloseClick();\n}", "function getMovie(id) {\n //Making changes is easy in the cloud and desktop!\n let url = 'https://www.omdbapi.com/?i='+id+'&apikey=CHANGEDONDESKTOPWITHCLOUDSPACESEXTENSION'\n return axios.get(url);\n}", "function searchForTVShow() {\n let userTVShow = \"The Good Place\";\n let queryURL =\n \"https://api.themoviedb.org/3/search/tv?api_key=\" +\n API_KEY +\n \"&language=en-US&query=\" +\n userTVShow;\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let id = response.results[0].id;\n console.log(id);\n });\n}", "get videoId() {\n return this._data.video_id;\n }", "function GetVideosByTitle(title) {\n return $resource(_URLS.BASE_API + 'get_videos_by_title/' + title + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "function GetVideosByTitle(title) {\n return $resource(_URLS.BASE_API + 'get_videos_by_title/' + title + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "function getSong(videoId){\r\n for(var i = 0; i < data.songs.length; ++i){\r\n if(data.songs[i].videoId == videoId){\r\n return data.songs[i];\r\n }\r\n }\r\n}", "async function getMovieResults({ movieId, title }) {\n await logger(`finding: ${title}`);\n\n const parameters = querystring.stringify({\n movieId,\n apiKey: config.radarr.apiKey,\n });\n\n const searchUrl = `${_getRadarrApiPath()}/release?${parameters}`;\n return await getData({ uri: searchUrl });\n}", "function getInfo( title, year, id, callback ) {\n\tnewTitle = title.replace( / /g, '+' );\n\t// var queryString = '/?t=' + newTitle + '&y=' + year + '&plot=short&r=json';\n\tvar queryString = '/3/movie/' + id + '?api_key=' + tvdbAPIKey;\n\tconsole.log( queryString );\n\tvar options = {\n\t\thost: 'api.themoviedb.org',\n\t\tpath: queryString,\n\t\tmethod: 'GET',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json'\n\t\t}\n\t};\n\n\tvar getData = http.request( options, function( data ) {\n\t\tvar output = '';\n\n\t\tconsole.log( options.host + ':' + data.statusCode );\n\n\t\tdata.setEncoding( 'utf8' );\n\n\t\tdata.on( 'data', function( chunk ) {\n\t\t\toutput += chunk;\n\t\t} );\n\n\t\tdata.on( 'end', function() {\n\t\t\tcallback( null, JSON.parse( output ) );\n\t\t} );\n\n\t} );\n\n\tgetData.end();\n\n}", "function getVideoId()\n {\n if (window.location.search.length > 0)\n {\n var s = window.location.search.substring(1);\n var requestObjects = s.split('&');\n for (var i = 0, len = requestObjects.length; i < len; i += 1)\n {\n var obj = requestObjects[i].split('=');\n if (obj[0] === \"v\")\n {\n console.log(\"Video ID is \" + obj[1]);\n return obj[1];\n }\n }\n }\n\n return null;\n }", "function changeVideo(eventTitle){\n $('#player').show();\n // console.log(eventTitle);\n var API_KEY = \"AIzaSyBDl0SaDnpnhP7TrxEnPAaXKFIKWHQuUoA\";\n var q = eventTitle;\n var part = \"snippet\";\n var type = \"video\";\n var baseURL = \"https://www.googleapis.com/youtube/v3/search\";\n var numberResults = \"2\";\n var queryURL = baseURL + \"?\" + \"part=\" + part + \"&q=\" + q + \"&type=\" + type + \"&maxResults=\" + numberResults +\"&key=\" + API_KEY;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n var videoToPlay = response.items[0].id.videoId;\n // console.log(videoToPlay);\n player.loadVideoById(videoToPlay);\n });\n}", "async getVideo() {\n return (await this._client.helix.videos.getVideoById(this._data.video_id));\n }", "function getIMDBid(title) {\n var imdbid = null;\n var title = showtime.entityDecode(unescape(title)).toString();\n showtime.print('Splitting the title for IMDB ID request: ' + title);\n var splittedTitle = title.split('|');\n if (splittedTitle.length == 1)\n splittedTitle = title.split('/');\n if (splittedTitle.length == 1)\n splittedTitle = title.split('-');\n showtime.print('Splitted title is: ' + splittedTitle);\n if (splittedTitle[1]) { // first we look by original title\n var cleanTitle = splittedTitle[1].trim();\n var match = cleanTitle.match(/[^\\(|\\[|\\.]*/);\n if (match)\n cleanTitle = match;\n showtime.print('Trying to get IMDB ID for: ' + cleanTitle);\n resp = showtime.httpReq('http://www.imdb.com/find?ref_=nv_sr_fn&q=' + encodeURIComponent(cleanTitle)).toString();\n imdbid = resp.match(/<a href=\"\\/title\\/(tt\\d+)\\//);\n if (!imdbid && cleanTitle.indexOf('/') != -1) {\n splittedTitle2 = cleanTitle.split('/');\n for (var i in splittedTitle2) {\n showtime.print('Trying to get IMDB ID for: ' + splittedTitle2[i].trim());\n resp = showtime.httpReq('http://www.imdb.com/find?ref_=nv_sr_fn&q=' + encodeURIComponent(splittedTitle2[i].trim())).toString();\n imdbid = resp.match(/<a href=\"\\/title\\/(tt\\d+)\\//);\n if (imdbid) break;\n }\n }\n }\n if (!imdbid)\n for (var i in splittedTitle) {\n if (i == 1) continue; // we already checked that\n var cleanTitle = splittedTitle[i].trim();\n var match = cleanTitle.match(/[^\\(|\\[|\\.]*/);\n if (match)\n cleanTitle = match;\n showtime.print('Trying to get IMDB ID for: ' + cleanTitle);\n resp = showtime.httpReq('http://www.imdb.com/find?ref_=nv_sr_fn&q=' + encodeURIComponent(cleanTitle)).toString();\n imdbid = resp.match(/<a href=\"\\/title\\/(tt\\d+)\\//);\n if (imdbid) break;\n }\n\n if (imdbid) {\n showtime.print('Got following IMDB ID: ' + imdbid[1]);\n return imdbid[1];\n }\n showtime.print('Cannot get IMDB ID :(');\n return imdbid;\n }", "function getVideo(userSearchName, searchTitle) {\n\tvar q = userSearchName + \" \" + searchTitle + \" karaoke\";\n\n\taddVideoCard(searchTitle);\n\n\t// Run GET Request on API\n\t$.get(\n\t\t\"https://www.googleapis.com/youtube/v3/search\", {\n\t\t\tpart: 'snippet, id',\n\t\t\tq: q,\n\t\t\ttype: 'video',\n\t\t\tmaxResults: 4,\n\t\t\tvideoSyndicated: true,\n\t\t\tvideoEmbeddable: true,\n\t\t\tvideoLicense: 'creativeCommon',\n\t\t\tkey: 'AIzaSyBEw_OnLrWKAKGIzxb2ee5WtfnRR0md67Q'\n\t\t},\n\t\tfunction (data) {\n\n\t\t\t// Log Data\n\t\t\tconsole.log(data);\n\n\t\t\t$.each(data.items, function (i, item) {\n\t\t\t\t// Get Output\n\t\t\t\tvar output = getOutput(item);\n\t\t\t\t//set the new videos to the correct card\n\t\t\t\t//by referencing the card Id created for the card\n\t\t\t\t$('#c-' + cardCount + ' .col-rhs ul').append(output);\n\t\t\t\t$('.card-videos').sortable({ handle: '.video-title', placeholder: 'drop-zone' });\n\t\t\t\t$('.card-videos').disableSelection();\n\t\t\t});\n\t\t}\n\t);\n}", "function getIMDBid(title) {\n var resp = showtime.httpGet('http://www.google.com/search?q=imdb+' + encodeURIComponent(showtime.entityDecode(unescape(title))).toString()).toString();\n var imdbid = resp.match(/http:\\/\\/www.imdb.com\\/title\\/(tt\\d+).*?<\\/a>/);\n if (imdbid) imdbid = imdbid[1];\n else {\n imdbid = resp.match(/http:\\/\\/<b>imdb<\\/b>.com\\/title\\/(tt\\d+).*?\\//);\n if (imdbid) imdbid = imdbid[1];\n };\n\tif (!imdbid) { // Trying to get imdbid by original name\n var fTitle = unescape(title).split(\" | \");\n if (fTitle[1]) {\n resp = showtime.httpGet('http://www.google.com/search?q=imdb+' + encodeURIComponent(showtime.entityDecode(fTitle[1])).toString()).toString();\n imdbid = resp.match(/http:\\/\\/www.imdb.com\\/title\\/(tt\\d+).*?<\\/a>/);\n if (imdbid) imdbid = imdbid[1];\n else {\n imdbid = resp.match(/http:\\/\\/<b>imdb<\\/b>.com\\/title\\/(tt\\d+).*?\\//);\n if (imdbid) imdbid = imdbid[1];\n };\n };\n\t}\n return imdbid;\n }", "function GetLessonByVideoId(vid) {\n //console.log(vid);\n return $resource(_URLS.BASE_API + 'lesson/by_video/' + vid + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "function title ( data, index ) {\n if( typeof index === 'undefined' ) return \"\";\n if( index === null ) return \"\";\n if( !data ) return \"\";\n return data.results[index].title;\n}", "static findByTitle(title, callback) {\n\n\n const id = Slug(title).toLowerCase();\n const query = { 'postId': id };\n\n this.findOne(query, callback);\n }", "loadMovie({name, description, vidsource}) {\n console.log('show movie details');\n\n this.videotitle = name;\n this.videodescription = description;\n this.videosource = vidsource;\n\n this.showDetails = true;\n }", "async findById({id: id}) {\n return movie.findOne({id: id});\n }", "function getMediaTitleForTracking(event) {\r\n\t\t\tvar jdata = '';\r\n\t\t\tif (event != undefined) {\r\n\t\t\t\tjdata = event.jPlayer;\r\n\t\t\t} else {\r\n\t\t\t\tjdata = self.$elem.data(\"jPlayer\");\r\n\t\t\t}\r\n\t\t\tif (jdata.status.media.title && jdata.status.media.title.length > 0) {\r\n\t\t\t\treturn jdata.status.media.title;\r\n\t\t\t} else {\r\n\t\t\t\treturn jdata.status.src;\r\n\t\t\t}\r\n\t\t}", "function searchForMovie(title) {\n var promise = deferred();\n\n login().then( () => {\n request('https://tls.passthepopcorn.me/torrents.php?searchstr=' + encodeURI(title) + '&json=noredirect', function (error, res, body) {\n promise.resolve(process(JSON.parse(body)));\n });\n });\n\n return promise.promise;\n}", "function bookTitle(id) {\n //log('display ' + key);\n return initDB('thr').then(function(db) {\n return readRecord(db, 'books', +id).then(function(book) {\n return { ID: book.ID, title: book.title };\n });\n });\n }", "function loadVideo() {\n $.getJSON(URL, options, function(data){\n console.log(data)\n var id = data.items[0].snippet.resourceId.videoId;\n mainVideo(id);\n resultsLoop(data);\n });\n }", "getVideoID(){\n return location.href.split('/').pop().replace('#','');\n }", "function getRealTitles(j) {\n\tif(showTitle==2){\n\t\tplayerArray[j] = new YT.Player(videoArray[j], {\n\t\t videoId: videoArray[j],\n\t\t events: {\n\t\t\t 'onStateChange': onPlayerStateChange\n\t\t\t}\n\t\t});\t\n\t}else{\n\t\t//We pray into the ether\n\t\t//harken oh monster of youtube \n\t\t//tell us the truth of this noble video\n\t var tempJSON = $.getJSON('http://gdata.youtube.com/feeds/api/videos/'+videoArray[j]+'?v=2&alt=json',function(data,status,xhr){\n\t\t\t//and lo the monster repsonds\n\t\t\t//it's whispers flowing as mist\n\t\t\t//through the mountain crag\n\t\t videoTitle[j] = data.entry.title.$t;\n\t\t\t//and we now knowning it's truth\n\t\t\t//the truth of it's birth\n\t\t\t//we annoit it and place it on it's throne\n\t\t\t//as is provided by the documentation\n\t\t\tplayerArray[j] = new YT.Player(videoArray[j], {\n\t\t\t videoId: videoArray[j],\n\t\t\t events: {\n\t\t\t\t 'onStateChange': onPlayerStateChange\n\t\t\t\t}\n\t\t\t});\n\t });\n\t}\n}", "function getDataForVideo(videoId) {\n\t\t\n\t\t//make ajax call to the server to get data for that video\n\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: vm_video_for_page_url+'?clientId='+vm_client_id+'&pageName='+vm_page_name+'&divId='+videoId+'&userId='+vm_user_id,\t\t\t\n\t\t\t\tsuccess: function(data) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t//populate a centralized JS variable to store tracks for all of the videos\n\t\t\t\t\t\ttracksForVideos.push({\"videoId\":videoId,\"tracks\":data.tracks});\n\t\t\t\t\t\t\n\t\t\t\t\t\t//for track relate html - attach the necessary functions also\n\t\t\t\t\t\tattachTracksForVideo(videoId, data);\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\n\t\t\t});\n\t}", "function rename_current_playlist_title(site_url, playlist_caption, playlist_id)\n{\n\tvar result = $.ajax({\n\t\tasync:false,\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"playlist_caption=\"+playlist_caption+\"&playlist_id=\"+playlist_id,\n\t\turl: site_url+\"video/rename_playlist_title/\"\t\t\n\t}).responseText;\t\n\treturn result;\n}", "function getMovie() {\n\n var movie = \"Pacific Rim\"\n\n request(\"https://www.omdbapi.com/?apikey=\"+ process.env.OMDB_API_KEY +\"&t=\" + value, function (error, response, body) {\n if(error){\n console.log(error)\n }\n\n console.log(JSON.parse(body)['Title'])\n console.log(JSON.parse(body).Title)\n \n });\n}", "function videoDetails(videoDetailUrl, id) {\n \n request.get(videoDetailUrl, function (e, r, b) {\n \n videoParse = JSON.parse(b);\n \n if (videoParse.items !== undefined) {\n \n if (videoParse.items[0] !== undefined) {\n \n newurl = \"https://www.youtube.com/watch?v=\" + id;\n\n details = {};\n vidstats = videoParse.items[0].statistics;\n vidsnippet = videoParse.items[0].snippet;\n details.title = vidsnippet.title;\n details.published = vidsnippet.publishedAt.split('T')[0];\n details.views = vidstats.viewCount;\n details.comments = vidstats.commentCount;\n details.likes = vidstats.likeCount;\n \n details.url = newurl;\n\n silo.videos.push(details);\n //console.log(vidstats);\n\n }\n \n }\n \n });\n }", "async findByTitle({query}) {\n if (query == undefined)\n return [];\n else\n return movie.find({\"title\": query});\n }", "function getmovieTitleInfo() {\n var movie = indicator[3];\n if (!movie) {\n console.log(\"You didn't enter a movie. So here is Mr. Nobody, better than nothing right?\");\n movie = \"mr nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n request(queryUrl, function(e, resp, data) {\n if (!e && resp.statusCode === 200) {\n\n console.log(\"*************************************************\")\n console.log(\"Title: \" + JSON.parse(data).Title);\n console.log(\"Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors: \" + JSON.parse(data).Actors);\n console.log(\"*************************************************\")\n }\n });\n}", "function setMovieTitle(){\n\tvar title = $('#title').attr('value');\n\t$('#headerText').text('Watching: ' + title);\n}", "async function getMovieInfo(id) {\n let response = await fetch('https://swapi.dev/api/films/');\n let json = await response.json();\n let selectedFilm;\n json.results.forEach((film) => {\n if (film.episode_id == id) {\n selectedFilm = {\n name: film.title,\n episodeID: film.episode_id,\n characters: film.characters,\n };\n }\n });\n return selectedFilm;\n}", "function search() {\n var q = $('#query').val();\n var request = gapi.client.youtube.search.list({\n q: q,\n part: 'snippet',\n type: 'video'\n });\n\n request.execute(function(response) {\n var id = response.result.items[0].id.videoId;\n var title = response.result.items[0].snippet.title;\n $(function(){\n $(\"#frame\").attr(\"src\", \"http://www.youtube.com/embed/\"+ id +\"?rel=0&autoplay=1\");\n $(\"#frame\").append('allowfullscreen');\n $(\"#videoTitle\").append(title);\n });\n });\n}", "function trackRelatedVideo(videoTitle) {\n var s = s_gi(s_account);\n s.eVar1= \"Related Video played: \" +videoTitle;\n s.trackExternalLinks = false;\n s.linkTrackEvents = s.events = 'event10';\n s.linkTrackVars = 'eVar1,events';\n s.tl(this, 'o', s.eVar1);\n}", "function findMovie(title){\n\tvar title = processInput(title);\n\n\tif(title != undefined){\n\t\tvar formattedTitle = title.replace(\" \", \"+\");\t\n\t\tvar query = \"http://www.omdbapi.com/?t=\" + formattedTitle;\n\n\t\trequest(query, function (error, response, body) {\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t} else{\n\t\t\t\tvar movieTitle = JSON.parse(body).Title;\n\t\t\t\tvar year = JSON.parse(body).Year;\n\t\t\t\tvar imdbRating = JSON.parse(body).Ratings[0].Value;\n\t\t\t\tvar country = JSON.parse(body).Country;\n\t\t\t\tvar language = JSON.parse(body).Language;\n\t\t\t\tvar plot = JSON.parse(body).Plot;\n\t\t\t\tvar actors = JSON.parse(body).Actors;\n\t\t\t\tvar rottenRating = JSON.parse(body).Ratings[1].Value;\n\t\t\t\tvar rottenURL = \"blah\";\n\n\t\t\t\tvar output = \"\\nMovie Title: \" + movieTitle + \"\\nYear Released: \" \n\t\t\t\t\t+ year + \"\\nCountry Filmed: \" + country + \"\\nLanguages Released In: \"\n\t\t\t\t\t + language + \"\\nActors: \" + actors + \"\\n\\nPlot: \" + plot + \"\\n\\nIMDB Rating: \" \n\t\t\t\t\t + imdbRating + \"\\nRotten Tomatoes Rating: \" + rottenRating + \"\\nRotten Tomatoes URL: \" \n\t\t\t\t\t + rottenURL;\n\n\t\t\t\tconsole.log(output);\n\t\t\t\twriteFS(output);\n\n\t\t\t};\n\t\t});\n\t};\n}", "function getId(query, type) {\n fetch(\n `https://watchmode.p.rapidapi.com/search/?search_field=name&search_value=${query}&types=${type}`,\n {\n method: \"GET\",\n headers: {\n \"x-rapidapi-key\":\n \"be9a60e677msh27b9eb97af299e8p1c5a0djsnb9ba03ed5bd6\",\n \"x-rapidapi-host\": \"watchmode.p.rapidapi.com\",\n },\n }\n )\n .then(response => response.json())\n .then((data) => {\n if (data.title_results.length != 0) {\n //console.log(data);\n //console.log(data.title_results);\n let id = data.title_results[0].id;\n console.log(id);\n getStreaminginfo(id)\n /*If Watchmode does not have the movie title (and thus its ID) in its database, that means it does not have any streaming options. This throws an error telling user to pick a different movie*/\n /*You can test this by inputting a movie that does not exist*/\n errormessage.textContent = \"\";\n addtolist.textContent = \"Add to Movies\";\n } else throw Error('No movie found by that name');\n })\n .catch((err) => {\n console.error(err);\n errormessage.textContent = \"No movie found by that name. Please try searching for a different movie. Unfortunately, TV shows are not accepted at this time.\"\n addtolist.textContent = \"\";\n\n });\n}", "function onPlayerStateChange(event) { \n\t//Let us accept the player which was massaged\n\t//by the mousey hands of woman or man\n\tvar videoURL = event.target.getVideoUrl();\n\t//We must strip from it, the true identity\n\tvar regex = /v=(.+)$/;\n\tvar matches = videoURL.match(regex);\n\tvideoID = matches[1];\n\t//and prepare for it's true title\n\tthisVideoTitle = \"\";\n\t//we look through all the array\n\t//which at first glance may seem unfocused\n\t//but tis the off kilter response\n\t//from the magical moore json\n\t//which belies this approach\n\t//Tis a hack? A kludge?\n\t//These are fighting words, sir!\n\tfor (j=0; j<videoArray.length; j++) {\n\t\t//tis the video a match?\n\t if (videoArray[j]==videoID) {\n\t\t\t//apply the true title!\n\t thisVideoTitle = videoTitle[j]||\"\";\n\t\t\tconsole.log(thisVideoTitle);\n\t\t\t//should we have a title, alas naught else\n\t\t\tif(thisVideoTitle.length>0){\n\t\t\t\tif(showTitle==3){\n\t\t\t\t\tthisVideoTitle = thisVideoTitle + \" | \" + videoID;\n\t\t\t\t}else if(showTitle==2){\n\t\t\t\t\tthisVideoTitle = videoID;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthisVideoTitle = videoID;\n\t\t\t}\n\t\t\t//Should the video rear it's head\n if (event.data == YT.PlayerState.PLAYING) {\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Play', thisVideoTitle]); \n \t //ga('send', 'event', 'Videos', 'Play', thisVideoTitle);\n\t\t\t\t//thy video plays\n\t\t\t\t//reaffirm the pausal beast is not with us\n \t\tpauseFlagArray[j] = false;\n \t} \n\t\t\t//should the video tire out and cease\n \tif (event.data == YT.PlayerState.ENDED){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Watch to End', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Watch to End', thisVideoTitle);\n \t} \n\t\t\t//and should we tell it to halt, cease, heal.\n\t\t\t//confirm the pause has but one head and it flies not its flag\n\t\t\t//lo the pause event will spawn a many headed monster\n\t\t\t//with events overflowing\n \tif (event.data == YT.PlayerState.PAUSED && pauseFlagArray[j] != true){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Pause', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Pause', thisVideoTitle);\n\t\t\t\t//tell the monster it may have\n\t\t\t\t//but one head\n \t\tpauseFlagArray[j] = true;\n \t}\n\t\t\t//and should the monster think, before it doth play\n\t\t\t//after we command it to move\n \tif (event.data == YT.PlayerState.BUFFERING){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Buffering', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Buffering', thisVideoTitle);\n \t}\n\t\t\t//and should it cue\n\t\t\t//for why not track this as well.\n \tif (event.data == YT.PlayerState.CUED){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Cueing', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Cueing', thisVideoTitle);\n \t}\n\n\t }\n\t}\n}", "function getMovieDetails(id, callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_DETAILS+id, query, callback);\n}", "async getDidFromVid(vid, host) {\n try {\n let response = await Axios.get(host + 'getDidFromVid?vid=' + vid);\n let did = response.data.data.did;\n return did;\n } catch (err) {\n return null;\n }\n }", "function getVideoId(response) {\n\tvar srchItems = response.result.items;\n\t$.each(srchItems, function(index, item){\n\t\tsVideoIds[index] = item.id.videoId;\n\t});\n}", "function getVideoId(input) {\n\n var qs = new Querystring(input.split(\"?\")[1]);\n return qs.get(\"v\");\n}", "function Video(title){\n\t\tthis.title=title;\n\t\tconsole.log(this);\n\t}", "function startShowing(id,elem) {\r\n $.get('http://gdata.youtube.com/feeds/api/videos/'+id+'?v=2&alt=jsonc',function (data) { $('#title-'+elem).html(data.data.title); });\r\n $('#preview-'+elem).attr({src: 'http://img.youtube.com/vi/'+id+'/0.jpg'});\r\n}", "get title() {\n return this._data.title;\n }", "get title() {\n return this._data.title;\n }", "function getPageTitle () {\n return title;\n }", "function getTVDbID(movie_id) {\r\n return new Promise(resolve => {\r\n GM.xmlHttpRequest({\r\n method: \"GET\",\r\n timeout: 10000,\r\n url: \"https://thetvdb.com/api/GetSeriesByRemoteID.php?imdbid=tt\" + movie_id,\r\n onload: function(response) {\r\n if (String(response.responseText).match(\"seriesid\")) {\r\n response.responseXML = new DOMParser().parseFromString(response.responseText, \"application/xml\");\r\n const xmldata = response.responseXML;\r\n const tvdb_id = xmldata.getElementsByTagName(\"seriesid\")[0].childNodes[0].nodeValue;\r\n resolve(tvdb_id);\r\n } else {\r\n const tvdb_id = \"00000000\";\r\n resolve(tvdb_id);\r\n }\r\n },\r\n onerror: function() {\r\n GM.notification(\"Request Error.\", \"IMDb Scout Mod (getTVDbID)\");\r\n console.log(\"IMDb Scout Mod (getTVDbID): Request Error.\");\r\n resolve(\"00000000\");\r\n },\r\n onabort: function() {\r\n resolve(\"00000000\");\r\n },\r\n ontimeout: function() {\r\n resolve(\"00000000\");\r\n }\r\n });\r\n });\r\n}", "getVideoSearchString(videoID) {\n if (RoKA.Application.currentMediaService() === Service.YouTube) {\n return encodeURI(`(url:3D${videoID} OR url:${videoID}) (site:youtube.com OR site:youtu.be)`);\n }\n else if (RoKA.Application.currentMediaService() === Service.KissAnime) {\n return (encodeURI(videoID));\n }\n else if (RoKA.Application.currentMediaService() === Service.KissManga) {\n return (encodeURI(videoID));\n }\n }", "function getNextVideo(videoTitle, videoDesc, videoId) {\n $(\"#youtube-title\").html(urldecode(videoTitle));\n $(\"#youtube-desc\").html(urldecode(videoDesc));\n $(\"#youtube-url\").attr('src', 'https://www.youtube.com/embed/' + urldecode(videoId));\n}", "function showMovieTitle() {\r\n if(unsafeWindow.amazonMovieName) {\r\n // AJAX request is run only if the movie has been found\r\n // RMQ : Doesn't work in Chrome because it can't access javascript var in unsafeWindow\r\n new unsafeWindow.Ajax.Request(\r\n '/shot/' + shotId + '/showsolution', \r\n {asynchronous:true, evalScripts:true}\r\n ); \r\n return false;\r\n }\r\n }", "function videoName(){\n var artistName = document.getElementById(\"name\").value;\n var artistName2 = document.getElementById(\"name2\").value;\n var descriptiveItem = document.getElementById(\"mood\").value;\n var descriptiveItem2 = document.getElementById(\"instrument\").value;\n var songName = document.getElementById(\"songName\").value;\n var genre = document.getElementById(\"genre\").value;\n var title = `[FREE] ${descriptiveItem} ${descriptiveItem2} ${artistName} x ${artistName2} Type Beat - \"${songName}\" | ${genre} Beat/Instrumental 2021`;\n var titleNode = document.createTextNode(title);\n titleParagraph.appendChild(titleNode);\n}", "function videoName(){\n var artistName = document.getElementById(\"name\").value;\n var artistName2 = document.getElementById(\"name2\").value;\n var descriptiveItem = document.getElementById(\"mood\").value;\n var descriptiveItem2 = document.getElementById(\"instrument\").value;\n var songName = document.getElementById(\"songName\").value;\n var genre = document.getElementById(\"genre\").value;\n var title = `[FREE] ${descriptiveItem} ${descriptiveItem2} ${artistName} x ${artistName2} Type Beat - \"${songName}\" | ${genre} Beat/Instrumental 2021`;\n var titleNode = document.createTextNode(title);\n titleParagraph.appendChild(titleNode);\n}", "function videoName(){\n var artistName = document.getElementById(\"name\").value;\n var artistName2 = document.getElementById(\"name2\").value;\n var descriptiveItem = document.getElementById(\"mood\").value;\n var descriptiveItem2 = document.getElementById(\"instrument\").value;\n var songName = document.getElementById(\"songName\").value;\n var genre = document.getElementById(\"genre\").value;\n var title = `[FREE] ${descriptiveItem} ${descriptiveItem2} ${artistName} x ${artistName2} Type Beat - \"${songName}\" | ${genre} Beat/Instrumental 2021`;\n var titleNode = document.createTextNode(title);\n titleParagraph.appendChild(titleNode);\n}", "function getMovieImdbId(imdbID) {\n fetch('https://www.omdbapi.com/?apikey=da783fad&i=' + imdbID + '')\n .then((response) => response.json())\n .then((theId) => {\n spinner.style.display = \"block\";\n displayMoreInformationAboutMovie(theId)\n goBackToSearchButton()\n\n })\n}", "function Playlist_modifTitle(element) {\r\n if(element.id && (element.id.indexOf('playnav-play-playlist-')==0) || (element.id.indexOf('playnav-grid-playlist-')==0)) {\r\n var divs=null; try { divs=document.evaluate(\".//div[starts-with(@id,'playnav-playlist-') and contains(@id,'-title')]\",element,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); } catch(err) { divs=null; }\r\n if(divs) {\r\n var divs_lg=divs.snapshotLength;\r\n for(var h=0;h<divs_lg;h++) {\r\n var elem=divs.snapshotItem(h);\r\n if(elem.parentNode.nodeName.toUpperCase()!=\"A\") {\r\n var res=elem.getAttribute('id').match(/^playnav\\-playlist\\-(.*?)\\-title$/i);\r\n if(res) {\r\n res=res[1];\r\n var aelem=document.createElement('a');\r\n aelem.setAttribute('href',window.location.protocol+'//'+window.location.host+'/view_play_list?p='+res);\r\n aelem.setAttribute('target','_blank');\r\n aelem.appendChild(elem.cloneNode(true));\r\n elem.parentNode.replaceChild(aelem,elem);\r\n } } } } } }", "searchResultID(id) {\n const requestUrl = 'http://api.tvmaze.com/shows/' + id;\n\n return fetch(requestUrl)\n .then(response => {\n return response.json();\n })\n }", "getVideoInformation(link) {\n\t\t\n\t\tif(YoutubeHelper.checkURL(link)) {\n\t\t\t//checking the URL\n\t\t\tlet youtubeID = YoutubeHelper.checkURL(link)\n\t\t\t\n\t\t\t//fetching data from the youtube api after vaidation froma the given ID\n\t\t\txhr(`https://www.googleapis.com/youtube/v3/videos?id=${youtubeID}&key=AIzaSyBgMSJtrr13Q4qTdyOrGktD0Rl0OuOCoag&&&part=snippet,contentDetails`,\n\t\t\t\t\n\t\t\t\t(err, req, body) => {\n\t\t\t\t\t\tbody = JSON.parse(body)\n\t\t\t\t\t\tconsole.log(body.items)\n\n\t\t\t\t\t\tlet title, duration\n\t\t\t\t\t\ttitle = body.items['0'].snippet.title\n\t\t\t\t\t\tduration = YoutubeHelper.convertToSeconds(body.items['0'].contentDetails.duration)\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t//Sending to be added to the list\n\t\t\t\t\t\tapp.me.addVideo(title, youtubeID, duration)\n\t\t\t\t\t}\n\t\t\t\t)\n\n\n\t\n\t\t}\n\n\n\t}", "function retrieveID(){\n var retrievedID = $('#updateId').val();\n retrieveMovie(\"https://eloquent-yew-227217.appspot.com/GetFilm?ID=\"+retrievedID+\"&format=json\");\n}", "movieThis() {\n const omdb = new OMDbAPI(KEYS.omdb);\n let movieName = \"Mr. Nobody\";\n\n if (this.cmdArgs.length > 0) {\n movieName = this.cmdArgs.join(\" \");\n }\n omdb.findMovie(movieName);\n }", "function getTitle(data) {\n\t\tvar title = \"\";\n\t\tif(data.title){\n\t\t\ttitle = data.title;\n\t\t}else if( data.username ){\n\t\t\ttitle = data.username;\n\t\t}else if( data.message_details ){\n\t\t\ttitle = data.message_details;\n\t\t}else if( data.details ){\n\t\t\ttitle = data.details;\n\t\t}else if( data.fullname ){\n\t\t\ttitle = data.fullname;\n\t\t}\n\t\t\n\t\treturn title;\n\t}", "youtubeVideo(id) {\n return ytRequest('/videos', id)\n .then(res => {\n let item = null;\n if (res.items.length) {\n item = Item.fromApi(ITEM_TYPE.YOUTUBE, {\n title: res.items[0].snippet.title,\n url: `http://youtube.com/watch?v=${id}`,\n srcId: id,\n });\n }\n return item;\n });\n }", "movieById(cb, id) {\n let movieById = `https://api.themoviedb.org/3/movie/${id}?api_key=${this.API_KEY}&language=en-US`\n fetch(movieById)\n .then(response => {\n return response.json()\n }).then(movie => {\n cb(movie)\n })\n }", "async loadMovie({ commit }, movieId) {\n await this.$axios.get(`API/Title/${IMDB_KEY}/${movieId}`).then(response => {\n commit(\"SET_MOVIE\", response.data);\n });\n }", "function playerNameFromId(id,gameid) {\n return new Promise((resolve, reject) => {\n db.findOne({ player: id,gameid:gameid}, { name: 1, _id: 0 }, (err, docs) => {\n if (err) console.error(\"There's a problem with the database: \", err);\n else if (docs) console.log(\"player name queried from id\");\n resolve(docs.name);\n });\n });\n}", "async function getMp3(vid){\n let res = await fetch('https://baixaryoutube.net/@api/json/mp3/'+vid);\n let data = await res.json();\n return data;\n}", "function getMovie(movieName) {\n axios.get(`http://www.omdbapi.com/?t=${movieName}&apikey=trilogy`)\n .then(function(movie){\n console.log(\"\");\n console.log(\n `Title: ${movie.data.Title}\\n`,\n `Released: ${movie.data.Year}\\n`,\n `Rating from IMDB: ${movie.data.Ratings[0].Value}\\n`,\n `Country of origin: ${movie.data.Country}\\n`,\n `Plot: ${movie.data.Plot}\\n`,\n `Cast: ${movie.data.Actors}\\n`\n )\n })\n .catch(function(err){\n console.log(err)\n });\n}", "function movieDisplay(movieTitle) {\n // console.log(\"Movie Display Function\");\n var queryURL = `http://www.omdbapi.com/?t=${movieTitle}&y=&plot=short&apikey=trilogy`\n // console.log(queryURL);\n\n request(queryURL, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n\n var movieData = JSON.parse(body);\n\n console.log(`Title:${movieData.Title}\\n` +\n `Release Year: ${movieData.Year}\\n` +\n `IMDB Rating: ${movieData.imdbRating}/10\\n` +\n `Rotten Tomatoes Rating: ${movieData.Ratings[1].Value}\\n` +\n `Production Location: ${movieData.Country}\\n` +\n `Movie Language(s): ${movieData.Language}\\n` +\n `Plot: ${movieData.Plot}\\n` +\n `Actors: ${movieData.Actors}\\n`\n )\n }\n\n })\n}", "async function getMovieDetails(id) {\n var movObj;\n var apiUrl = \"https://api.themoviedb.org/3/movie/\" + id + \"?api_key=\" + apiKey;\n fetch(apiUrl).then(function (response) {\n if (response.ok) {\n response.json().then(function (data) {\n var movieTitle = data.title;\n var imdbId = data.imdb_id;\n var posterUrl = data.poster_path;\n movObj = {\n id: id,\n title: movieTitle,\n imdb: imdbId,\n poster: posterUrl\n };\n displayMovie(movObj);\n });\n }\n else {\n alert(\"Something went wrong\");\n }\n });\n}", "function youtubeid(url) {\n var myregexp = /(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})/i;\n var videoID = url.match(myregexp);\n // var ytid = url.match(\"[\\\\?&]v=([^&#]*)\");\n videoID = videoID[1];\n return videoID;\n }", "_getThumbnail(link) {\n var video_id = link.split(\"v=\")[1];\n var ampersandPosition = video_id.indexOf(\"&\");\n if (ampersandPosition !== -1) {\n video_id = video_id.substring(0, ampersandPosition);\n }\n return video_id;\n }", "function movieinfo() {\n \n var queryURL = \"http://www.omdbapi.com/?t=rock&apikey=//!InsertKey\";\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n }\n)}", "function getMovie() {\n\n var omdbApi = require('omdb-client');\n\n var params = {\n apiKey: 'XXXXXXX',\n title: 'Terminator',\n year: 2012\n }\n omdbApi.get(params, function (err, data) {\n // process response...\n });\n}", "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n }", "getId(title, year) {\n //using the google youtube api to get the video id\n let youtube = (params, callback) => {\n axios.get(this.state.url, { params: params }).then(function(response) {\n callback(response.data.items[0])\n }).catch(function(error) {\n console.error(error);\n });\n };\n\n // adding the parameters for the axios call\n youtube({key: this.state.key, q: `${title} + trailer + ${year}`, maxResults: 6, part: 'snippet', type: 'video'}, (response) => {\n this.setState({\n id: response.id.videoId,\n })\n })\n }", "function getVids(playlist){\n //get videos from selected playlist\n $.get(\n \"https://www.googleapis.com/youtube/v3/playlistItems\", {\n part:'snippet',\n maxResults: 5,\n playlistId: playlist,\n key: apiKey\n },\n function(data){\n //parse data from api\n var output;\n $.each(data.items, function(i, item){\n console.log(item);\n var vidTitle = item.snippet.title;\n var videoId = item.snippet.resourceId.videoId;\n var videoDate = item.snippet.publishedAt;\n var prettyVideoDate = new Date(videoDate).toDateString();\n var videoDesc = item.snippet.description;\n //collect result\n output = '<p><h1>'+vidTitle+'</h1><p>'+videoDesc+'</p><p>'+prettyVideoDate+'</p><iframe height=\"'+vidHeight+'\" width=\"'+vidWidth+'\"src=\\\"//www.youtube.com/embed/'+videoId+'\\\"></iframe></p><hr>';\n\n //append result to content div \n $('#content').append(output);\n\n });// end .each\n }\n );//end get\n }", "function getHotstarTitle() {\n\tsetTimeout(() => {chrome.tabs.query({active: true}, function(tabs){\n\t\tvar tab = tabs[0];\n\t\tchrome.tabs.executeScript(tab.id, {\n\t\t\tcode: 'document.getElementsByClass(\"meta-wrap\").querySelector(\"h1\").textContent'\n\t\t}, function(results){ sendData(results.toString(), \"Hotstar\");});\n\t});}, 2000);\n}", "function getMovieDetail(imdbid) {\n return fetch(\"http://www.omdbapi.com/?apikey=cc5844e4&i=\" + imdbid)\n .then((response) => response.json())\n .then((result) => result);\n}", "function getVideoId() {\n\t// Get the URL without any query parameters or anchors\n\tlet url = window.location.href;\n\tif(DEBUG) console.log(`Netflix SRT subs URL: ${url}`);\n\n\tmatch = /netflix\\.[a-z]+\\/watch\\/([0-9]+)/i.exec(url);\n\tif(match !== null && match.length > 1) {\n\t\tlet videoId = match[1];\n\t\tif(DEBUG) console.log(`Netflix SRT subs detected this page to be a video (id = ${videoId})`);\n\t\treturn videoId;\n\t}\n\telse {\n\t\treturn null;\n\t}\n}", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "function getVideoData() {\n var activeEpisode = n.metadata.getActiveVideo();\n var player = n.objects.videoPlayer();\n\n return {\n player: player\n , seasonInfo: n.metadata.getActiveSeason()\n , series: n.metadata.getMetadata().video\n , episodeTitle: activeEpisode.title\n , episodeNum: activeEpisode.seq\n , episodeId: parseInt(activeEpisode.episodeId)\n , isFullscreen: n.fullscreen.isFullscreen()\n , currentTime: player.getCurrentTime() \n , duration: player.getDuration()\n }\n }" ]
[ "0.76891255", "0.70275337", "0.686119", "0.6732792", "0.6624442", "0.66096175", "0.6608902", "0.65187985", "0.6360742", "0.63518316", "0.62893456", "0.6288887", "0.62715304", "0.62631404", "0.62460274", "0.62446684", "0.6227898", "0.62263274", "0.62187237", "0.6192467", "0.61695176", "0.6166741", "0.61527413", "0.61527413", "0.61522144", "0.6151652", "0.61447316", "0.6140763", "0.61363715", "0.61242855", "0.6122526", "0.61176586", "0.60844123", "0.6083948", "0.60809106", "0.6075468", "0.60553986", "0.605291", "0.60509855", "0.6043994", "0.604326", "0.6019491", "0.6013387", "0.599677", "0.59840864", "0.5978928", "0.59640086", "0.5942634", "0.5933009", "0.5931675", "0.5929659", "0.59280616", "0.5925531", "0.59229106", "0.5922009", "0.59168696", "0.59118044", "0.59043086", "0.5901904", "0.58906436", "0.5883037", "0.5881123", "0.5880706", "0.5879936", "0.5879936", "0.5878397", "0.5878184", "0.587241", "0.58610326", "0.5855579", "0.5852692", "0.5852692", "0.5852692", "0.584861", "0.58336157", "0.583347", "0.5831953", "0.58279955", "0.58272636", "0.5825483", "0.582336", "0.5821906", "0.5809582", "0.5803739", "0.5802413", "0.57937443", "0.5788243", "0.5786373", "0.57824224", "0.578239", "0.5778526", "0.5769984", "0.57668805", "0.57663757", "0.57633156", "0.5763008", "0.57592666", "0.5755757", "0.5753399", "0.5749426" ]
0.6110708
32
retrieves rows from database
function loadSidebar() { $.ajax({ type: "GET", url: "loadvideos.php", dataType: "html", success: function(response){ sidebarContent(response); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "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}", "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}", "function getEntries() {\r\n db.transaction(queryDB,dbErrorHandler);\r\n}", "function dbReadStockAll()\n{\n var db = dbGetHandle()\n var results;\n\n db.transaction(function (tx) {\n results = tx.executeSql('SELECT rowid, idNumber, product_name, product_price FROM stock_DB order by rowid desc')\n })\n return results\n}", "function queryAllRows() {\n connection.query(\"SELECT * FROM products\", function (err, data) {\n if (err) throw err;\n\n console.table(data);\n selectItem(data);\n });\n}", "function getEntries() {\n console.log(\"Getting Entries\");\n dbShellStudents.transaction(function(tx) {\n tx.executeSql(\"select id,name,image from students order by name\",[],renderEntries,dberrorhandler);\n }, dberrorhandler);\n}", "function SQLRow(res,sql,params){\n if (!params){\n params = []\n }\n db.get(sql, params, (err, row) => {\n if (err) {\n res.status(400).json({\"error\":err.message});\n return\n }\n if (!row){\n res.status(404).json({\"error\":\"Not found\"})\n return\n }\n res.json({\n \"message\":\"success\",\n \"data\":row\n })\n });\n}", "function SQLRows(res,sql,params){\n if (!params){\n params = []\n }\n db.all(sql, params, (err, rows) => {\n if (err) {\n res.status(400).json({\"error\":err.message});\n return;\n }\n res.json({\n \"message\":\"success\",\n \"data\":rows\n })\n });\n}", "function getRows() {\n var self = this;\n\n self._getRows.apply(self, arguments);\n}", "function getEasyLoadRecordsFromDb(){\n\t\t$http.get(\"/easyloadList\").then(\n\t\t\t\tfunction(res){\n\t\t\t\t\t$scope.easyLoadRecords = res.data;\n\t\t\t\t\tconsole.log(\"data found from data base\");\n\t\t\t\t\tconsole.log(res);\n\t\t\t\t},\n\t\t\t\tfunction(err){\n\t\t\t\t\tconsole.log(\"data not found from database something wrong\");\n\t\t\t\t})\n\t}", "readAll() {\n var objectStore = db.transaction('person').objectStore('person');\n\n objectStore.openCursor().onsuccess = function (event) {\n var cursor = event.target.result;\n\n if (cursor) {\n console.log('Id: ' + cursor.key);\n console.log('Name: ' + cursor.value.name);\n console.log('Age: ' + cursor.value.age);\n console.log('Email: ' + cursor.value.email);\n cursor.continue();\n } else {\n console.log('No hay más datos');\n }\n };\n }", "function dbReadStockOutAll()\n{\n var db = dbGetHandle()\n var results;\n try{\n db.transaction(function (tx) {\n results = tx.executeSql('SELECT rowid, idNumber, product_name, product_price FROM stock_DB_Out order by rowid desc')\n })} catch(err){\n console.log(\"Error reading in database: \" + err)\n };\n\n return results\n}", "getAll() {\n\t\treturn this.dao.all(`SELECT * FROM items`);\n\t}", "static retrieveAll(callback) {\n db.query('SELECT * from reservation;', function (err, res) {\n if (err.error)\n return callback(err);\n callback(res);\n });\n }", "lista(callback) {\n this._db.query('select * from resposta', function(err, recordset) {\n callback(err, recordset);\n });\n }", "function _getEntries() {\n\t\ttry {\n\t\t\t//Variable to keep query statement \n\t\t\tvar lvQuery = 'SELECT * FROM \"' + gvSchemaName + '\".\"' + gvTableName + '\"';\n\n\t\t\t//Check if ID is specified then restrict the selection\n\t\t\tif (gvRefId) {\n\t\t\t\tlvQuery = lvQuery + ' WHERE \"CONDITION_ID\" = ' + \"'\" + gvRefId + \"'\";\n\t\t\t}\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\tCONDITION_ID: oResultSet.getString(1),\n\t\t\t\t\tITEM: oResultSet.getString(2),\n\t\t\t\t\tSTRUCTURE: oResultSet.getString(3),\n\t\t\t\t\tFIELD: oResultSet.getString(4),\n\t\t\t\t\tOPERATOR: oResultSet.getString(5),\n\t\t\t\t\tVALUE: oResultSet.getString(6)\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\t$.response.contentType = \"application/json; charset=UTF-8\";\n\t\t\t$.response.setBody(JSON.stringify(oResult));\n\t\t\t$.response.status = $.net.http.OK;\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}", "function onGetAllSuccess_GetResponseFromDatabaseWhereClause(records){\n isSuccess = true;\n ReturnRecords = (records);\n}", "static fetchAll(db) {\n \n return new Promise(function (resolve, reject) {\n db.query(\"SELECT * FROM persons\", function (err, rows) {\n if (!err) {\n resolve(rows);\n } else {\n reject(err);\n }\n });\n });\n\n }", "function readProducts(callback) {\n connection.query(\"SELECT * from product_view\", function (err, res) {\n if (err) throw err;\n callback(res);\n });\n}", "static findById(id) {\n return db.execute('SELECT * FROM products WHERE products.id = ?', [id]);\n }", "function getResponseEntriesForExercise(){\n console.log(\"Getting Response entries of all students from Response and \\n Score Marks for teacher \" + teacherID +\", lesson \" + lessonID +\" and exercise \" + exerciseID);\n dbShellResponsesForExercise.transaction(function(tx){\n tx.executeSql(\"select row_id,teacher_id,student_id,lesson_id,exercise_id,response,scoremark,comment\\\n from responseandmark where teacher_id=? and lesson_id=? and exercise_id=?\",[teacherID,lessonID,exerciseID]\n ,renderResponseEntriesForExercise,dberrorhandlerForResponseForExercise);\n },dberrorhandlerForResponseForExercise);\n}", "static async getAll() {\n let result = await db.query(\n `SELECT username, first_name, last_name, email FROM users`\n );\n return result.rows;\n }", "function getAll(){\n return db.any('SELECT * FROM Locations');\n}", "get rows() {\n return this._rows;\n }", "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, response){\n if(err) throw err;\n printTable(response);\n })\n}", "function list(){\n return knex(table).select(\"*\")\n}", "function queryInterviewDatabase() { \n console.log('Reading rows from the Table...');\n\n // Read all rows from table\n request = new Request(\"select * from interviewData;\", (err, rowCount, rows) => {\n console.log(rowCount + ' row(s) returned');\n process.exit();\n });\n\n request.on('row', function(columns) {\n columns.forEach(function(column) {\n console.log(\"%s\\t%s\", column.metadata.colName, column.value);\n });\n });\n\n connection.execSql(request);\n}", "function fetchEntryItems(){\n\n var d = $.Deferred();\n\n db.transaction(function (tx) {\n\n tx.executeSql('SELECT * FROM entries ORDER BY sortIndex ASC', [], function (tx, results) {\n var len = results.rows.length, i, items;\n\n items = [];\n\n for (i = 0; i < len; i++) {\n items.push(results.rows.item(i));\n }\n\n d.resolve(items);\n },\n function (tx, error) {\n console.log(\"Query Error: \" + error.message);\n d.reject();\n });\n\n });\n\n return d;\n }", "function queryRow(userName) {\n let selectQuery = \"SELECT * FROM ?? WHERE ?? = ?\";\n let query = mysql.format(selectQuery, [\"todo\", \"user\", userName]);\n // query = SELECT * FROM `todo` where `user` = 'shahid'\n pool.query(query, (err, data) => {\n if (err) {\n console.error(err);\n return;\n }\n // rows fetch\n console.log(data);\n });\n}", "function readProducts() {\n\n connection.query(\"SELECT id, product_name, price FROM products\", function (err, res) {\n if (err) throw err;\n //This is a npm addin to make a better looking table\n console.table(res);\n //Once the table is shown, the function startTransaction is called\n startTransaction();\n\n });\n}", "getRows() {\n return this._rows.slice();\n }", "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 }", "allData() {\n const sql = 'SELECT * FROM office';\n return this.db.many(sql);\n }", "function showRecords() {\n\n $(\"#results\").html('')\n\n db.transaction(function (tx) {\n\t\n\ttx.executeSql(selectAllStatement, [], function (tx, result) {\n\t \n\t dataset = result.rows;\n\n\t for (var i = 0, item = null; i < dataset.length; i++) {\n\t\t\n\t\titem = dataset.item(i);\n\n\t\tvar linkeditdelete = '<li>' + item['username'] + ' , ' + item['useremail'] + ' ' + '<a href=\"#\" onclick=\"loadRecord(' + i + ');\">edit</a>' + ' ' +\n\t\t \n\t\t '<a href=\"#\" onclick=\"deleteRecord(' + item['id'] + ');\">delete</a></li>';\n\n\t\t$(\"#results\").append(likeditdelete);\n\t\t\n\t }\n\n\t\t\n\t});\n });\n \n \n}", "function getItems() {\n \n //Selects all from the table named products\n connection.query(\"SELECT * FROM products\", \n function (err, results) {\n if (err) throw err;\n \n //logs formatted table\n console.table(results); \n \n // fires promptUser function\n promptId(results); \n\n });\n}", "function viewProducts() {\n connection.connect();\n connection.query(\"SELECT * FROM products\", function (err, rows, fields) {\n if (err) throw err;\n console.log(rows)\n });\n connection.end();\n}", "function pet_view_db(tx){\n tx.executeSql('SELECT * FROM Pet',[], pet_view_data, errorDB);\n}", "function all() {\n return database.slice();\n}", "getAll() {\n\t\tlet db = this.db;\n\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tresolve(db.value());\n\t\t});\t\t\n\t}", "static async fetchAll() {\n const results = await db.query(\n `\n SELECT ntr.id,\n ntr.name,\n ntr.category,\n ntr.quantity,\n ntr.calories,\n ntr.image_url,\n ntr.user_id AS \"userId\",\n u.email AS \"userEmail\",\n ntr.timestamp AS \"timestamp\" \n FROM nutrition AS ntr\n JOIN users AS u ON u.id = ntr.user_id\n ORDER BY ntr.timestamp DESC \n `\n )\n return results.rows\n }", "function queryDB(tx){\r\n tx.executeSql('SELECT * FROM Client',[],querySuccess,errorCB);\r\n }", "get_all() {\n const sql = `SELECT * from ficha`;\n let paci=[];\n database.all(sql, [], (err, rows) => {\n if (err) {\n console.log(err);\n }\n paci = rows;\n // rows.forEach((row) => {\n // array.push(row)\n // // console.log(row)\n // });\n return paci\n });\n \n // database.close();\n }", "async readObra(){\n const sql = 'SELECT * FROM obras';\n const result = await pool.query(sql);\n return result.rows;\n }", "function getItems() {\n connection.query(\"SELECT item FROM itemList \"),\n function(error, results, fields) {\n if (error) throw error;\n console.log(results);\n };\n }", "function getEntriesFromLessons(){\n console.log(\"Getting Lesson Entries\");\n dbShellLessons.transaction(function(tx){\n tx.executeSql(\"select lessonRow_id,teacher_id,lesson_id,exercise_id,exercise_title,exercise_detail,\\\n exercise_voice,exercise_image from lessons group by lesson_id\",[]\n ,renderEntriesForLessons,dberrorhandlerForLessons);\n },dberrorhandlerForLessons);\n}", "getAuctionItems() {\n this.connection.query(\"SELECT * FROM auctionItems\", function (err, res) {\n if (err) throw err;\n console.log(res);\n });\n }", "function readAll(database,callback){\n var openReq = window.indexedDB.open(\"weightTracker\");\n\n openReq.onsuccess = function() {\n var content=[];\n\n var db = openReq.result;\n var transaction = db.transaction([database], 'readonly');\n var objectStore = transaction.objectStore(database);\n\n objectStore.openCursor().onsuccess = function(event) {\n var cursor = event.target.result;\n \n if(cursor){\n content.push(cursor.value);\n cursor.continue();\n }\n \n };\n\n transaction.oncomplete = function (event) {\n db.close();\n if(callback) {\n callback(content);\n } \n };\n }\n}", "function _getAllRows() {\r\n return _table.getElementsByTagName('tr');\r\n }", "async show() {\n // select * from ticket\n const result = await this.app.mysql.select('ticket', {\n orders: [['id','desc']],\n limit: 6,\n offset: 0,\n });\n\n return result;\n }", "function ReadDB () {\r\n const transactions = Budgetdb.transaction([\"pending\"], \"readwrite\")\r\n const stores = transactions.objectStore(\"pending\")\r\n // getAll() method for matching specified parameter OR\r\n // all objects in store if no parameters specified \r\n const getAll = stores.getAll()\r\n // get all object stores onsuccess event if result.length > 0\r\n getAll.onsuccess = () => {\r\n if (getAll.result.length > 0) {\r\n // fetch bulk to post getAll results via json stringify\r\n fetch(\"/api/transaction/bulk\", {\r\n method: \"POST\",\r\n body: JSON.stringify(getAll.result),\r\n headers: {\r\n Accept: \"application/json, text/plain, */*\",\r\n \"Content-Type\": \"application/json\"\r\n }\r\n })\r\n .then(response => response.json())\r\n // clears stores of pending transactions once stored to db\r\n .then(() => {\r\n const transactions = Budgetdb.transaction([\"pending\"], \"readwrite\")\r\n const stores = transactions.objectStore(\"pending\")\r\n stores.clear()\r\n })\r\n }\r\n }\r\n}", "load(callback) {\n const selectTodoItems = \"SELECT * FROM todo_items\";\n this.dbConnection.query(selectTodoItems, function (err, results, fields) {\n if (err) {\n callback(err);\n return;\n }\n\n callback(null, results);\n });\n }", "findAll() {\n return db.many(`\n SELECT * FROM recipes\n `);\n }", "function viewAll() {\n connection.query(\"SELECT * FROM products\",\n function (err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "function getProducts() {\n\treturn db.query(\"SELECT * FROM products\")\n\t\t.then(function(rows) {\n\t\t\treturn rows[0];\n\t\t})\n\t .catch(function(err) {\n\t console.log(err);\n\t });\n}", "static fetchAll() {\n return dbPromise.execute('SELECT * FROM shelves');\n }", "function readProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n //displays all the products\n //callback(res);\n if (err) throw err;\n displayAll(res);\n anotherAction();\n });\n}", "function read(req, res) {\n const query = connect.con.query('SELECT idSponsor, nome, logo, categoria, active FROM sponsor order by idSponsor desc',\n function(err, rows, fiels) {\n console.log('query: ', query.sql);\n if(err) {\n console.log('err: ', err);\n res.status(jsonMessages.db.dbError.status).send(jsonMessages.db.dbError);\n } else {\n if(rows.length == 0) {\n res.status(jsonMessages.db.noRecords.status).send(jsonMessages.db.noRecords);\n } else {\n res.send(rows);\n }\n }\n });\n}", "static getAll(){\n // Retourne promise\n return new Promise((resolve, reject) => {\n // Requete Select \n db.query(\"SELECT * FROM salles\", (err, rows) => {\n if(err) {\n reject(err);\n } else {\n resolve(rows);\n }\n });\n })\n }", "function getEntries() {\n\n //\talert(\"getEntries\");\n dbShell.transaction(function (tx) {\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS autos (id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL, Poliza TEXT NOT NULL, Inciso TEXT NOT NULL, Asegurado TEXT NOT NULL)\");\n tx.executeSql(\"SELECT * FROM autos\", [], renderEntries, dbErrorHandler);\n }, dbErrorHandler);\n}", "async all() {\n return this.db.any(\n 'SELECT $(columns:name) FROM $(table:name)',\n {\n columns: ['firstname', 'lastname', 'email', 'department'],\n table: this.table,\n },\n )\n .then((users) => users)\n .catch((error) => {\n throw error;\n });\n }", "static readAllFromDB(dbElementName) {\r\n\t\treturn DBHelper.openDB('restaurant-review-DB').then(db => {\r\n\t\t\treturn db\r\n\t\t\t\t.transaction(dbElementName)\r\n\t\t\t\t.objectStore(dbElementName)\r\n\t\t\t\t.getAll();\r\n\t\t});\r\n\t}", "function getRecords(res, mysql, context, id, pass, complete)\n{\n mysql.pool.query(\"SELECT * FROM records r INNER JOIN user u ON r.user = u.id WHERE u.user_name=? and u.user_password=?\", [id, pass], function(error, results, fields) {\n if (error) {\n console.log(JSON.stringify(error));\n return;\n }\n context.records=results;\n //console.log(context.records);\n complete();\n });\n}", "function getResponseEntriesForStudent(){\n console.log(\"Getting all exercise response entries for \\\n teacher \" + teacherID +\", lesson \" + lessonID +\" and student \" + studentID);\n dbShellResponsesForStudent.transaction(function(tx){\n tx.executeSql(\"select row_id,teacher_id,student_id,lesson_id,exercise_id,response,scoremark,comment\\\n from responseandmark where teacher_id=? and student_id=? order by lesson_id,exercise_id\",[teacherID,studentID]\n ,renderResponseEntriesForStudent,dberrorhandlerForResponseForStudent);\n },dberrorhandlerForResponseForStudent);\n}", "function getProducts(cb){\n con.query(\"SELECT * FROM products\", function (err, result) {\n if (err) throw err;\n products = result;\n getItems(result)\n });\n}", "function selectRows(data) {\n \t\n }", "'get'(params) { // Get all fields\n if (params != null) { this['bind'](params) && this['step'](); }\n return (() => {\n const result = [];\n for (let field = 0, end = sqlite3_data_count(this.stmt), asc = 0 <= end; asc ? field < end : field > end; asc ? field++ : field--) {\n switch (sqlite3_column_type(this.stmt, field)) {\n case SQLite.INTEGER: case SQLite.FLOAT: result.push(this.getNumber(field)); break;\n case SQLite.TEXT: result.push(this.getString(field)); break;\n case SQLite.BLOB: result.push(this.getBlob(field)); break;\n default: result.push(null);\n }\n }\n return result;\n })();\n }", "async getAll(){\n return await conn.query(\"SELECT * FROM Fitness_RoutineExercises\")\n }", "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 }", "function querySuccess(tx, results) {\n\n var len = results.rows.length;\n\n for (var i=0; i<len; i++){\n\n\n misdatos = results.rows.item(i).misdatos;\n catalogo = results.rows.item(i).catalogo;\n entrevistas = results.rows.item(i).entrevistas;\n noasignadas = results.rows.item(i).noasignadas;\n fechaDB = results.rows.item(i).fecha;\n\n }\n}", "static findById(id) {\n return db.execute('SELECT * FROM products where products.id = ?', [id]);\n }", "function getStudents() {\n return db.query(\"SELECT * FROM students\").then((result) => result.rows);\n}", "function getUsers() {\n return db(\"users\").select(\"users.*\");\n}", "get() {\n let options = {\n method: 'GET',\n url: this.url + this.table,\n qs: this.qs\n };\n\n return new Promise((resolve, reject) => {\n this.request(options, (err, response, body) => {\n if(err) {\n return reject(err);\n }\n\n try {\n if(response.statusCode !== 200) {\n return reject(new Error(`Unexpected response status ${response.statusCode}`));\n }\n\n let jsonRes = body.records;\n resolve(jsonRes);\n } catch(e) {\n return reject(e);\n }\n });\n });\n }", "function fetchRowFromRS(rs, cb) {\n rs.getRow(function(err, row) {\n should.not.exist(err);\n if (row) {\n return fetchRowFromRS(rs, cb);\n } else {\n rs.close(function(err) {\n should.not.exist(err);\n cb();\n });\n }\n });\n }", "function fetchReadings (knex, req, res)\n{\n var data = req.body;\n\n knex\n .select()\n .from('patient_' + data.id)\n .then(function (results) {\n var ret = {\n csv: ''\n };\n var cnt = 0;\n Array.prototype.forEach.call(results, function (row)\n {\n var rowParse = '';\n for (var key in row)\n {\n if (key == 'timestamp')\n rowParse += row[key];\n else\n rowParse += ',' + row[key];\n }\n cnt++;\n if (cnt != results.length)\n rowParse += '\\n';\n ret.csv += rowParse;\n });\n util.respond(res, 200, ret);\n });\n}", "function getDataFromDb(req,res) {\r\n let SQL = 'SELECT * FROM digimon;';\r\n client.query(SQL).then((data)=>{\r\n res.render('digimonExam/favourite', {results:data.rows});\r\n }).catch((err)=>errorHandler(err,req,res));\r\n}", "function getBooksFromDB()\n{\n\talert(\"getBooksFromDB\");\n bookArray=[];\n if(db == null)\n {\n alert('Databases are not supported in this browser.');\n return 0;\n }\n db.transaction(function (tx) {\n tx.executeSql('SELECT * FROM books', [], \n \t\t insertBookArrary,\n \t\t errorHandler);\n });\n}", "getData() {\n return this.rows;\n }", "function viewAllEmp() {\n console.log(\"viewAllEmp\");\n connection.query('SELECT * FROM employee', (err, res) => {\n if (err) throw err;\n console.table(res);\n userSelect();\n });\n\n}", "getData(active){\n\t\treturn this.rowManager.getData(active);\n\t}", "static async getAll() {\n const results = await db.query(`\n SELECT * FROM companies\n `)\n return results.rows\n }", "function getRows() {\n\t\toriginal().then(row => (originalRow = row));\n\t\texpected().then(row => (expectedRow = row));\n\t}", "function _get_client_list(db){\n try{ \n var rows = db.execute('SELECT * FROM my_client WHERE id in ('+\n 'select a.client_id from my_'+_type+' as a where a.id=?)',_selected_job_id);\n var b = 0;\n if(rows.getRowCount() > 0){\n while(rows.isValidRow()){\n var row = Ti.UI.createTableViewRow({\n filter_class:'client',\n className:'client_list_data_row_'+b,\n hasChild:true,\n source:_source,\n job_id:_selected_job_id,\n client_id:rows.fieldByName('id'),\n client_reference_number:rows.fieldByName('reference_number'),\n client_type_code:rows.fieldByName('client_type_code'),\n title:rows.fieldByName('client_name'),\n mobile:rows.fieldByName('phone_mobile'),\n email:rows.fieldByName('email')\n }); \n if(b === 0){\n row.header = 'Client';\n }\n self.data.push(row);\n rows.next();\n b++;\n }\n }\n rows.close();\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _get_client_list');\n return;\n } \n }", "function retrieveAllAccountData() {\n\tvar cellName = sessionStorage.selectedcell;\n\tvar totalRecordCount = retrieveAccountRecordCount();\n\tvar baseUrl = getClientStore().baseURL;\n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountMgr = createAccountManager();\n\tvar uri = objAccountMgr.getUrl();\n\turi = uri + \"?$orderby=__updated desc &$top=\"\n\t\t\t+ totalRecordCount;\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d.results;\n\treturn json;\n}", "function getAll(id) {\n return db('people').where({'user_id': id});\n}", "async readEmpresa(){\n const sql = 'SELECT * FROM usuarios INNER JOIN empresas ON usuarios.id_usuario = empresas.id_empresa';\n const result = await pool.query(sql);\n return result.rows;\n }", "findAll(collection) {\n return this.db.get(collection).value();\n }", "function fetchRows () {\n\t\tjQuery.getJSON(url, function (response) {\n\t\t\tvar people = [],\n\t\t\t\textra;\n\t\t\tfor (var i in response.feed.entry) {\n\t\t\t\tif (response.feed.entry[i].content && response.feed.entry[i].content.$t !== '') {\n\t\t\t\t\textra = '{\"' + cleanUp(response.feed.entry[i].content.$t) + '\"}';\n\t\t\t\t\textra = jQuery.parseJSON(extra);\n\t\t\t\t\tif (response.feed.entry[i].title && extra.floor) {\n\t\t\t\t\t\tpeople.push(constructSeat(i, response, extra));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$scope.turned = false;\n\t\t\t$scope.loaded = true;\n\t\t\t$scope.seats = people;\n\n\t\t\t$scope.setColz();\n\n\n\t\t\t$scope.$apply();\n\t\t});\t\n\t}", "function querySuccess(tx, results) { \n\tvar len = results.rows.length;\n\n\tfor (var i=0; i<len; i++){\n\t\talert(\"Row = \" + i + \" ID = \" + results.rows.item(i).note_id + \" Name = \" + results.rows.item(i).name + \" Data = \" + results.rows.item(i).data + \" time = \" + results.rows.item(i).save_time);\n\t}\n}", "findEmployees() {\n return this.connection.query(\"SELECT * FROM employee\");\n\n }", "async readCliente(){\n const sql = 'SELECT * FROM usuarios INNER JOIN clientes ON usuarios.id_usuario = clientes.id_cliente';\n const result = await pool.query(sql);\n return result.rows;\n }", "function getRecords(req, res, next) {\n //var lemmaID = parseInt(req.params.id);\n let lemmaID = req.body.intake; //req.body.intake\n //db.none('SELECT qrs.rs4(' + $1 + ');', pupID); //.then(function (data) {} //db.any or client.query, db.transaction or tx.executeSQL?\n client.query('SELECT qrs.rs4(' + $1 + ');', lemmaID, (err, res) => {\n console.log(err, res)\n client.end()\n });\n\n db.any('SELECT nookid, lemma, definition, lang from resultsx;') //, pupID)\n .then(function (data) {\n res.rows.item[].\n res.status(200) //putting results to array occurs here\n .json({\n status: 'success',\n data: data,\n message: `Found ${result.rowCount} related words`\n }),\n for(var i=0; i<res.rows.length; i++) {\n var row = res.rows.item(i); //item[i] //var row = res.rows[i];\n console.log(\"row only: \" + row);\n console.log(\"res.rows.item(i): \" + res.rows.item(i));\n console.log(\"res.rows[i]: \" + res.rows[i]);\n /* result[i] = { //return {\n id: row['nookid'],\n lemma: row['lemma'],\n definition: row['definition'],\n lang: row['lang']\n } */\n res.rows.\n };\n })\n .catch(function (err) {\n return next(err);\n })\n // .finally(db.$pool.end);\n ;\n return JSON.stringify(data);\n }", "async function getProductos() {\r\n //se realiza una consulta de todos los productos de la tabla\r\n try {\r\n let rows = await query(\"SELECT * from productos\");\r\n //rows : array de objetos\r\n return rows;\r\n } catch (error) {\r\n //bloque en caso de que exista un error\r\n console.log(error);\r\n }\r\n}", "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 }", "function randomQuery(randList) {\n\t\tvar transaction = db.transaction([collection], \"readonly\"),\n store = transaction.objectStore(collection),\n results = [],\n request;\n \n randList.forEach(function(id){\n \trequest = store.openCursor(IDBKeyRange.only(Number(id)));\n\n \t // gets called for each item\n\t request.onsuccess = function(event) {\n\t results.push(event.target.result.value);\n\t }\n\n\t request.onerror = function(e) {\n console.error(\"Error with db access: \" + e);\n \t}\n\n }); // end forEach()\n\n // when we're all done add the table to the page\n transaction.oncomplete = function(event) {\n drawTable(results);\n } \n\t}", "function list() {\n return db(tableName).select(\"*\").orderBy(\"table_name\");\n}", "function viewProducts(){\n\n connection.query(\"SELECT * FROM products\", function(err, results){\nif (err) throw err;\n\n//for (var i = 0; i < results.length; i++) \n\n \n\nconsole.log(results); \nstart();\n})\n}", "getSelectedRows() {\r\n if (!this.slickGrid) return [];\r\n\r\n return _(this.slickGrid.getSelectedRows())\r\n .map(value => {\r\n return this.dataView.getItem(value);\r\n })\r\n .reverse()\r\n .value();\r\n }", "function selectAll() {\n connection.query(\"SELECT * from songs\", function (error, results, fields) {\n if (error) throw error;\n console.log(results)\n });\n}" ]
[ "0.6745723", "0.6741756", "0.6535017", "0.6535017", "0.6524347", "0.65178925", "0.6433052", "0.6394506", "0.63472915", "0.62963235", "0.6295872", "0.6279278", "0.6259826", "0.6236188", "0.6209221", "0.6206124", "0.6192317", "0.6137701", "0.61191607", "0.60458326", "0.60213697", "0.59916353", "0.5947681", "0.5947073", "0.5923393", "0.5912582", "0.5908882", "0.5901531", "0.58950424", "0.5892247", "0.5889799", "0.5888831", "0.58769333", "0.587492", "0.58721894", "0.5870063", "0.58661854", "0.5848326", "0.58423907", "0.58356225", "0.5833925", "0.5828235", "0.5817046", "0.58125454", "0.5811715", "0.5792953", "0.57921284", "0.5781887", "0.57810247", "0.57668203", "0.57597667", "0.5759426", "0.57554805", "0.57478356", "0.57448006", "0.5742416", "0.5731727", "0.5729739", "0.5726995", "0.57264274", "0.57190454", "0.57188517", "0.5718742", "0.5707432", "0.56968755", "0.56901824", "0.56890565", "0.56792724", "0.56728286", "0.5669542", "0.56642765", "0.5663893", "0.56622785", "0.5661409", "0.56613946", "0.5656614", "0.5652843", "0.5652638", "0.56489664", "0.5648265", "0.5645326", "0.56397176", "0.5639514", "0.56388813", "0.5632564", "0.56282026", "0.56185615", "0.5616571", "0.56135756", "0.56125426", "0.5610577", "0.56096756", "0.5606724", "0.5605189", "0.56013113", "0.55993223", "0.55980927", "0.5598019", "0.5596615", "0.55942523", "0.5592293" ]
0.0
-1
stops logo animation :)
function stopLogo() { clearInterval(logo); $('#wave').css("display", "none"); $('#blur').css("display", "none"); $('#erase').css("display", "none"); $('#glitch1').css("display", "block"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stopLogoAnimation() {\n if (typeof window.showlogo_iv !== 'undefined') {\n window.ncka = window.lgss = window.lga = 1;\n clearInterval(window.showlogo_iv);\n showLogo(true);\n } else {\n setTimeout(stopLogoAnimation, 25);\n }\n }", "function hideLogo() {\n // toggle center logo\n $(\".right-side\").css({\n animation: \"scaleX-hide 1s forwards\"\n });\n $(\".left-side\").css({\n animation: \"scaleX-hide 1s forwards\"\n });\n }", "animate_stop() {\r\n this.sprite.animate = false;\r\n }", "function stopAnimation() {\n reset();\n sprite.gotoAndStop(sprite.currentFrame);\n }", "function stop() {\r\n animating = false;\r\n }", "function preloadLogoEnd() {\n loaderStop();\n}", "function stopAnimation () {\r\n on = false; // Animation abgeschaltet\r\n clearInterval(timer); // Timer deaktivieren\r\n }", "function stop_animation(mark) {\r\n win.mark.setIcon(null);\r\n win.mark.setAnimation(null);\r\n}", "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "stop() {\n this._enableAnimation = false;\n }", "function stopAnimation(e) {\n // use the requestID to cancel the requestAnimationFrame call\n if (/Android/.test(navigator.userAgent)) {\n context.clearRect(0, 0, 300, 60);\n context.drawImage(fntA.iconPower,400,400,23,30);\n }\n cancelRAF(fntA.requestId);\n }", "function preloadLogoEnd() {\n\n}", "stopAnimation() {\r\n this.anims.stop();\r\n\r\n //Stop walk sound\r\n this.walk.stop();\r\n }", "stop() {\n this.renderer.setAnimationLoop(null);\n }", "stopDrawing() {\n this.updateAnimation = false;\n }", "function animateLogo() {\n let random;\n random = Math.floor((Math.random() * 3)+ 1);\n $('#wave').css(\"animation\", \"glitch\" + random + \" 2s ease infinite\");\n setTimeout(function(){ random = Math.floor((Math.random() * 3)+ 1); $('#erase').css(\"animation\", \"glitch\" + random + \" 2s ease infinite\");\n setTimeout(function(){ random = Math.floor((Math.random() * 3)+ 1); $('#blur').css(\"animation\", \"glitch\" + random + \" 2s ease infinite\");\n }, 40);}, 40);\n}", "function stopSpinning() {\n\tlargeImage.style.transform = \"none\";\n}", "function stopAnimation(){\r\n for(var i=0; i<self.markerArray().length; i++){\r\n self.markerArray()[i][1].setAnimation(null);\r\n\tself.markerArray()[i][1].setIcon(defaultIcon);\r\n }\r\n}", "function animateLogo()\n{\n if (logoPhase > 7)\n {\n setDutyCycle(2, 10);\n return;\n }\n else if (logoPhase > 6)\n {\n showBitwigLogo = false;\n var i = 0.5 - 0.5 * Math.cos(logoPhase * Math.PI);\n setDutyCycle(Math.floor(1 + 5 * i), 18);\n }\n else\n {\n var i = 0.5 - 0.5 * Math.cos(logoPhase * Math.PI);\n setDutyCycle(Math.floor(1 + 15 * i), 18);\n }\n\n logoPhase += 0.2;\n\n host.scheduleTask(animateLogo, null, 30);\n}", "stop(){this.__stopped=!1;this.toggleAnimation()}", "splashBottle() {\n clearInterval(this.gravitation);\n clearInterval(this.the_throw); \n this.playAnimation(this.IMAGES_SPLASH);\n this.splash_sound.play();\n setInterval(() => {\n this.width = 0;\n this.height = 0;\n }, 200);\n }", "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "function stop() {\n\n\t\ttry {\n\t\t // Pass in the movement to the game.\n\t\t animation.move(\"x\", moveTypes.none);\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function stop_dog_poop() {\n cancelAnimationFrame(anim_id);\n $('#restart').slideDown();\n }", "function removeLogo() {\n if (!canvasClicked) {\n var bg = $(\"canvas\").css(\"background-image\");\n var bgs = bg.split(',');\n bgs.splice(0, 1);\n $(\"canvas\").css(\"background-image\", bgs.concat());\n $(\"canvas\").css(\"background-repeat\", \"repeat\");\n canvasClicked = true;\n }\n }", "function animateLogo () {\n\t\tvar repeatVisitFlag = IBM.common.util.storage.getItem(\"v18larv\");\n\t\t\n\t\t// Allow animation to be forced to show via URL param (for debugging, presentations, show-and-tell, etc).\n\t\tif (IBM.common.util.url.getParam(\"animatelogo\")) {\n\t\t\t$(\"#ibm-home\").addClass(\"ibm-animate\");\n\t\t}\n\n\t\tif (!IBM.common.util.config.isEnabled(\"masthead.logoanimation\")) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If they didn't have the flag AND they support localstorage, animate it.\n\t\tif (!repeatVisitFlag && IBM.common.util.storage.setItem(\"v18larv\", true)) {\n\t\t\t$(\"#ibm-home\").addClass(\"ibm-animate\");\n\t\t}\n\t}", "function stopanimate() {\r\n window.cancelAnimationFrame(request)\r\n }", "fadeOut() {\n const tween = this.add.tween(this.logo).to(\n { y: 800 }, 2000, Phaser.Easing.Linear.None, true\n );\n\n this.add.tween(this.background).to(\n { alpha: 0 }, 2000, Phaser.Easing.Linear.None, true\n );\n\n tween.onComplete.add(this.startGame, this);\n }", "function runLogoAnimation() {\n for (const path of svgDrawingPaths) {\n path.style.strokeDashoffset = \"0px\";\n }\n for (const cPath of svgCirclePaths) {\n cPath.style.cssText = \"stroke-dashoffset: 0; transition-delay: 1200ms;\";\n }\n svgVerve.style.cssText =\n \"transform:translateX(0px); transition:transform 1s ease .8s;\";\n svg360.style.cssText =\n \"transform:translateX(0px);opacity:1;transition:all 1s ease .8s;\";\n document.getElementById(\"small-circle\").style.opacity = \"1\";\n setTimeout(firstPageLoaded, 2000);\n}", "function stopAnimation(){\n\t\ttile = toTile;\n\t\tPos = toPos;\n\t\tvelocity = 0;\n\t\tAnimation.moving = false;\n\t}", "function showLogoWhite() {\n $.logoRed.animate({ opacity:0.0, duration:250 });\n $.logoWhite.animate({ opacity:1.0, duration:250 });\n\n $.helpLight.animate({ opacity:0.0, duration:250 });\n $.helpDark.animate({ opacity:1.0, duration:250 });\n}", "function trailerAnimate() {\n\t\t$('.trailer-logo').removeClass('start').delay(800).queue(function(next){\n\t\t $(this).addClass('end');\n\t\t next();\n\t\t});\n\t}", "function stopLoadingAnimation () {\r\n $('#root-loading-wheel').remove();\r\n $('#root-loading-text').remove();\r\n}", "function AnimateLogo(){\n\n\tvar bgTransparency = 0.00;\n\tvar animateProcess = \"\";\n\t\n\t// Starting the animation\n\tif (animLogoTransitionID == null){\n\t\t// Start the animation\n\t\tanimLogoTransitionID = setInterval(function (){\n\t\t\t\n\t\t\t// Ending the animation, when the image has been loaded\n\t\t\tif( imageLoaded == 1){\n\t\t\t\n\t\t\t\tclearInterval(animLogoTransitionID);\n\t\t\t\tanimLogoTransitionID = null;\n\t\t\t\tDOMLogo_LoadTransict.setAttribute (\"opacity\", 0.0);\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{ // Continuing with animation\n\t\t\t\t// Putting the logo in the front\n\t\t\t\tDOMLogo_LoadTransict.parentNode.appendChild(DOMLogo_LoadTransict);\n\t\t\t\t\n\t\t\t\t// Setting the transparency of the logo. If the logo gets transparent, return to the visibility and vice-versa\n\t\t\t\tif ( bgTransparency <= 0.00 ) // Raise the opacity\n\t\t\t\t\tanimateProcess = \"lessTransp\";\n\t\t\t\tif ( bgTransparency >= 0.75 )\n\t\t\t\t\tanimateProcess = \"moreTransp\"; // Lower the opacity\n\t\t\t\t\n\t\t\t\t// Now, setting the values\n\t\t\t\tif (animateProcess == \"lessTransp\")\n\t\t\t\t\tbgTransparency = CalculateScaleTransition (bgTransparency, 0.75, \"fast-background\");\n\t\t\t\tif (animateProcess == \"moreTransp\")\n\t\t\t\t\tbgTransparency = CalculateScaleTransition (bgTransparency, 0.00, \"fast-background\");\n\t\t\t\t\t\n\t\t\t\t// And, setting the value to the logo\n\t\t\t\tDOMLogo_LoadTransict.setAttribute (\"opacity\", bgTransparency);\t\n\t\t\t}\n\t\t}, 40);\n\t}\n}", "stopAnimation() {\n setStyle(this.slider, 'transition', '', true);\n setStyle(this.slider, 'transform', 'translateX(0%)', true);\n }", "function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }", "function showLogo() {\n // toggle center logo\n $(\".right-side\").css({\n animation: \"scaleX-display 1s forwards \"\n });\n $(\".left-side\").css({\n animation: \"scaleX-display 1s forwards \"\n });\n }", "disable() {\n document.body.classList.remove(CONSTANTS.CLASS_NAMESPACE);\n this.enabled = false;\n this._drawLogo();\n }", "function hideSplash() {\n\t$('#splash-info').css('display', 'none');\t\t//Hide the splash img\n\t$('#splash-info-hide').fadeOut();\t\t\t\t//Hide the splash link\n\t$('#all-work').removeClass('fix-work'); \t\t//let the work scroll now\n}", "function logoBlink() {\n let logoBlink = new TimelineMax({});\n logoBlink.staggerTo(\".icon\", 0.3, { scale: 0, transformOrigin: \"50% 50%\" }, 0.1, \"+=0.5\")\n .staggerTo(\".icon\", 0.3, { scale: 1, ease: Back.easeOut.config(3.5), transformOrigin: \"50% 50%\" }, 0.1, \"-=0.5\");\n return logoBlink;\n}", "function stopAnimation() {\n cancelAnimationFrame(animationID)\n}", "function skip() {\n game.cutScene.style.display = 'none';\n game.soundInstance.stop();\n // TODO: stop and unload cut scene animation\n}", "stop() {\n clearInterval(this.animation);\n this.canvas.clear();\n }", "re_animate_ghost() {\r\n\r\n this.sprite.status = this.statusEnum.ALIVE;\r\n this.set_animation_frame(0, 0);\r\n this.animate_start();\r\n \r\n }", "function stopAnimation(){\n setTimeout(function(){\n document.getElementById(\"dado\").classList.remove(\"animation\");\n }, 3500);\n }", "function stop () {\n speedX = 0;\n speedY = 0;\n image.src = \"./images/sad.png\"; \n}", "toggleAnimation(){if(this.__stopped){this.__stopped=!1;this.shadowRoot.querySelector(\"#svg\").style.visibility=\"hidden\";if(null!=this.src){this.shadowRoot.querySelector(\"#gif\").src=this.src}this.shadowRoot.querySelector(\"#gif\").alt=this.alt+\" (Stop animation.)\"}else{this.__stopped=!0;this.shadowRoot.querySelector(\"#svg\").style.visibility=\"visible\";if(null!=this.srcWithoutAnimation){this.shadowRoot.querySelector(\"#gif\").src=this.srcWithoutAnimation}this.shadowRoot.querySelector(\"#gif\").alt=this.alt+\" (Play animation.)\"}}", "function Start () { \r\n animation.wrapMode = WrapMode.Loop; \r\n animation.Stop(); \r\n Idle();\r\n}", "function animationLogo() {\n logo.classList.add('logo-animate');\n}", "function showLogoRed() {\n $.logoRed.animate({ opacity:1.0, duration:250 });\n $.logoWhite.animate({ opacity:0.0, duration:250 });\n\n $.helpLight.animate({ opacity:1.0, duration:250 });\n $.helpDark.animate({ opacity:0.0, duration:250 });\n}", "stop() {\n if (this._animationFrame) {\n cancelAnimationFrame(this._animationFrame);\n }\n }", "function stopAnimation() {\n for (var i = 0; i < self.markerArray().length; i++) {\n self.markerArray()[i][1].setAnimation(null);\n }\n}", "deathAnimation(){\n let $entity = $(`[data-name='${this.data.entity.name}']`);\n $entity.pauseKeyframe();\n $entity.resetKeyframe();\n $entity.css(\"background-image\",\"url('./static/images/smoke_effect.png')\")\n .css(\"background-size\",\"100% 100%\")\n .animate({\n opacity: 0.0,\n top: `${this.data.pos.y-15}px`\n }, 2000, \n ()=>{$(`[data-name='${this.data.entity.name}']`).remove()} );\n }", "stop() {\n if (\n this.el &&\n qx.core.Environment.get(\"css.animation\") &&\n !this.jsAnimation\n ) {\n this.el.style[this.__playState] = \"\";\n this.el.style[qx.core.Environment.get(\"css.animation\").name] = \"\";\n this.el.$$animation.__playing = false;\n this.el.$$animation.__ended = true;\n }\n // in case the animation is based on JS\n else if (this.jsAnimation) {\n this.stopped = true;\n qx.bom.element.AnimationJs.stop(this);\n }\n }", "function reset_animations(){\n if(active != \"idee\"){tl_idee.restart();\n tl_idee.pause();}\n if(active != \"reunion\"){tl_reunion.restart();\n tl_reunion.pause();}\n if(active != \"travail\"){tl_travail.restart();\n tl_travail.pause();}\n if(active != \"deploiement\"){tl_depl.restart();\n tl_depl.pause();}\n }", "function logoSound() {\n this.logoUp.play('', 0, 0.1, false);\n }", "function stopAnimate() {\n clearInterval(tID);\n} //end of stopAnimate()", "hidePulse() {\n this._stopAnimation(this._icon, 'shadow-pulse');\n }", "function sinimagen () {\n\tsetTimeout(function(){\n\t\n\t\tif($(\".imgLogoProyect img\").attr(\"src\") == \"../resources/img/sinimagen.jpg\") {\n\t\t\t$(\".imgLogoProyect img\").attr(\"src\", \"../resources/img/sinimagen.jpg\").hide();\n\t\t}else {\n\t\t}\n \t},300);\n}", "switchtoLogo() {\n this._setState('LogoState');\n }", "function animate() { \n console.log('animate')\n \n gsap.registerEffect({\n name: \"fadeIn\",\n effect: (targets, config) => {\n var tlEffect = gsap.timeline();\n tlEffect.from(targets, {duration: config.duration, y:config.y, force3D:true, rotation: 0.01, stagger:config.stagger, ease:\"power2\"})\n .from(targets, {duration: config.duration, stagger:config.stagger, alpha:0, ease:\"none\"}, \"<\")\n return tlEffect;\n },\n defaults: {duration: 1.5, y:\"-=7\", stagger:4.5},\n extendTimeline: true,\n });\n \n gsap.to(plantWraps, {duration:25, rotation:\"+=20\", ease:\"none\"})\n gsap.to(flowerWraps, {duration:25, rotation:\"+=100\", ease:\"none\"})\n \n var imageDivs = selectAll('.imageDiv');\n // logoIntro = false;\n\n\t\t\ttl\n .to(bannerCover, {duration:0.7, alpha:0, ease:\"none\"})\n \n .from(plants, {duration:3, drawSVG:\"50% 50%\", ease:\"sine.inOut\"}, \"<\")\n .from(flowers, {duration:2, alpha:0, ease:\"none\"}, \"<\")\n \n if(logoIntro) {\n tl\n .from(letter_w, {duration:0.5, drawSVG: 0, ease:\"sine.in\"}, \"<\")\n .from(letter_y, {duration:0.3, drawSVG: 0, ease:\"sine.in\"}, \">\")\n .from(letter_nn, {duration:0.8, drawSVG: 0, ease:\"sine.inOut\"}, \">\")\n .from(lasvegas, {duration:0.7, y:\"-=10\", alpha: 0, ease:\"sine\"}, \">\")\n .from(sign_r, {duration:0.5, alpha: 0, ease:\"none\"}, \"<\")\n\n .to(logo, {duration:0.7, alpha:0, ease:\"none\"}, \">1\")\n .set(logo, {scale: 0.37, y:99, x:-60}, \">\")\n } else {\n tl\n .set(logo, {scale: 0.37, alpha:0,y:99, x:-60}, \"<\")\n }\n \n tl\n .from(imageDivs, {duration:1.3, stagger:4, alpha:0, blur:10, force3D:true, rotation: 0.01, ease:\"none\"}, \"<\")\n \n .fadeIn(text_head, \"<0.4\")\n .fadeIn(text_subHead,{y:\"0\", duration: 1,},\"<0.6\")\n .to(logo, {duration:1, alpha:1, ease:\"none\"}, \"<0.4\")\n .from(cta, {duration:0.8, alpha: 0, ease:\"none\"}, \"<\")\n .from(cta, {duration:1.6, rotateX:90, ease:\"power2\"}, \"<\") \n\t\t}", "function clearFadeIn(original, image) {\n setImage(original, image);\n is_animating = clearInterval(is_animating);\n}", "function moveStop() {\n var state = $(this).attr(\"data-state\");\n var animateImage = $(this).attr(\"data-animate\");\n var stillImage = $(this).attr(\"data-still\");\n var $this = $(this);\n\n if (state == \"still\") {\n $this.attr(\"src\", animateImage);\n $this.attr(\"data-state\", \"animate\");\n }\n\n else if (state == \"animate\") {\n $this.attr(\"src\", stillImage);\n $this.attr(\"data-state\", \"still\");\n }\n }", "function menuHideLogo() {\n // Much sure the top bar is there\n if ($('.top-bar').length) {\n\n // If the menu icon is clicked\n $('.menu-icon a').click(function() {\n\n // Theres a small delay in the class we need to use being added so we set a time out\n setTimeout(function() {\n // if the top bar has the expanded class\n if ($('.top-bar').hasClass('expanded')) {\n // hide the logo and set nav to relative to pass content down\n $('.l-header__logo').css({'height' : '0','opacity' : '0'});\n $('.l-header__navigation').css('position','relative');\n } else {\n // else undo changes\n $('.l-header__navigation').css('position','absolute');\n $('.l-header__logo').css({'height' : 'auto','opacity' : '1'});\n }\n }, 0.1);\n\n });\n }\n }", "function stopLoadingAnimation()\n{\n if (loadingAnimationTimer != null) {\n clearInterval(loadingAnimationTimer);\n loadingAnimationTimer = null;\n }\n}", "function stop () {\n window.clearInterval(animationInt);\n }", "function button_tokushima_animationRemove(){\n\t\t\tthat.button_tokushima_i1.alpha = 1;\n\t\t\t//that.button_tokushima_i2.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i3.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i4.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i5.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i6.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_tokushima_i7.alpha = 1;\t\t// notAvailable\n\t\t}", "stop() {\n cancelAnimationFrame(this.frameId)\n }", "function endSplash(director, images, onEndSplashCallback) {\n\n director.emptyScenes();\n director.setImagesCache(images);\n director.setClear( true );\n\n onEndSplashCallback(director);\n\n /**\n * Change this sentence's parameters to play with different entering-scene\n * curtains.\n * just perform a director.setScene(0) to play first director's scene.\n */\n\n director.setClear( CAAT.Foundation.Director.CLEAR_ALL );\n director.easeIn(\n 0,\n CAAT.Foundation.Scene.EASE_SCALE,\n 2000,\n false,\n CAAT.Foundation.Actor.ANCHOR_CENTER,\n new CAAT.Behavior.Interpolator().createElasticOutInterpolator(2.5, .4) );\n\n }", "function stopAnimate() {\r\n clearInterval(tID);\r\n} //end of stopAnimate()", "function stop2(){\r\n obj.sprite.setSensor(true)\r\n obj.setStaticVelY(0);\r\n //se reajusta su posicion\r\n obj.sprite.x = obj.initialX;\r\n obj.sprite.y = obj.initialY;\r\n //se vuelve a llamar a su metodo inicial con un delay de 200 steps pero con una n menor (hasta que n==0)\r\n scene.time.addEvent({\r\n delay: 2000,\r\n callback: () => (obj.startCycle(n-1, 0))\r\n });\r\n }", "function stopStart(){\n\t\tvar state = $(this).attr(\"data-state\");\n\t\tvar animateGif = $(this).attr(\"data-animate\");\n\t\tvar stillGif = $(this).attr(\"data-still\");\n\n if (state === \"still\") {\n\n $(this).attr(\"src\", $(this).data(\"animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } \n \n else {\n\n $(this).attr(\"src\", $(this).attr(\"still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n}", "function button_kagawa_animationRemove(){\n\t\t\tthat.button_kagawa_i1.alpha = 1;\n\t\t\tthat.button_kagawa_i2.alpha = 1;\n\t\t\tthat.button_kagawa_i3.alpha = 1;\n\t\t\tthat.button_kagawa_i4.alpha = 1;\n\t\t\t//that.button_kagawa_i5.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_kagawa_i6.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_kagawa_i7.alpha = 1;\t\t// notAvailable\n\t\t}", "function logoLinea(){\n\tlet tl = gsap.timeline({\n\t\trepeat: 0\n\t})\n\n\ttl.from('.cont__linea1', {\n\t duration: 1,\n\t x: 500, \n\t scale: 0,\n\t delay: 1,\n\t});\n\n\ttl.from('.cont__linea2', {\n\t duration: 1,\n\t x: -500, \n\t scale: 0,\n\t delay: 0,\n\t} ,'-=0.5' );\n\n\ttl.from('.logosC_I', {\n\t duration: 1,\n\t y: -200, \n\t scale: 0,\n\t stagger: 0.14,\n\t\tease: 'back'\n\n\t} ,'-=1' );\n}", "function stop() {\n sea.mesh.rotation.z = 0;\n sky.mesh.rotation.z = 0;\n}", "idle() {\n this._idle = true;\n this._animation.stop();\n this.emit('clear');\n this.emit('idle');\n }", "function stopImageTime(){\n clearInterval(startimageTimer);\n}", "function animationLost() {\n\t\tconsole.log(\"he perdido\");\t\n\tposX2=hasta;\t\nhasta=hasta-60;\nposX=posX-60;\n\t\t// Start the animation.\n\t\trequestID2 = requestAnimationFrame(animate2);\n\t}", "doBlink() {\n this.eyeMask.classList.add('close');\n\n this.eyeMask.getElementsByTagName('g')[0].addEventListener('transitionend', (event) => {\n setTimeout(() => {\n this.eyeMask.classList.remove('close');\n }, 20);\n }, { once: true });\n }", "function moveCar1(){\n ctx.clearRect(img1X,img1Y,46,90);\n img1Y = img1Y + img1DespY;\n ctx.drawImage(carImg1,img1X,img1Y,46,90);\n if(img1Y<=28||img1Y>=140)\n {\n animation1=false;\n clearInterval(interval1); // cancelar el ciclo\n }\n\n}", "function scrollLogo() {\n\n // il logo è composto da due immagini loghino più scritta. allo scroll della finestra (window) se scrollTop() cioè quanti pixel ho scrollato dall'alto è >10 nascondo la scritta. se è <10 cioè son tornato su ricompare la scritta\n $( window ).scroll(function() {\n\n if($(window).scrollTop() > 10) {\n\n $( \"#logo2\" ).fadeOut()\n \n }else {\n\n $( \"#logo2\" ).fadeIn() \n }\n })\n}", "function resetAnimation() {\n $(\"#win-display\").removeClass('animated bounceInDown');\n $(\"#lose-display\").removeClass('animated bounceInDown');\n $(\".gameBanner\").removeClass('animated bounceInDown');\n $(\".target-number\").removeClass('animated rotateInDownRight');\n $(\".total-number\").removeClass('animated rotateInDownLeft');\n}", "dropAnimation() {\n if (typeof (this.timer) != 'undefined') clearTimeout(this.timer);\n this.timer = setTimeout(this.stopAnimation.bind(this), 350);\n }", "function setupLogoAnimation() {\n logo.style.cssText = \"display:inline-block;\";\n i = 0;\n for (const path of svgDrawingPaths) {\n i++;\n var strokeOffset = path.getTotalLength();\n path.style.cssText =\n \"stroke-dashoffset: \" +\n strokeOffset +\n \"px; stroke-dasharray: \" +\n strokeOffset +\n \"px; transition-delay:\" +\n i * 0 +\n \"ms;\";\n }\n svgVerve.style.cssText = \"transform:translateX(50px);\";\n setTimeout(runLogoAnimation, 100);\n}", "if (m_bInitialAnim) { return; }", "stop() {\n window.cancelAnimationFrame(this.loopID);\n }", "function bouger() {\n console.log(\"Animation logo activée\");\n $('.image')\n .transition({\n debug: true,\n animation: 'jiggle',\n duration: 500,\n interval: 200\n })\n ;\n}", "function button_kochi_animationRemove(){\n\t\t\tthat.button_kochi_i1.alpha = 1;\n\t\t\tthat.button_kochi_i2.alpha = 1;\n\t\t\tthat.button_kochi_i3.alpha = 1;\n\t\t\tthat.button_kochi_i4.alpha = 1;\n\t\t\t//that.button_kochi_i5.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_kochi_i6.alpha = 1;\t\t// notAvailable\n\t\t\t//that.button_kochi_i7.alpha = 1;\t\t// notAvailable\n\t\t}", "function animation_stop() {\n if (animationState.mode && animationState.mode !== 'stop') {\n if (animationState.raf) {\n window.cancelAnimationFrame(animationState.raf);\n animationState.raf = null;\n }\n reset_styles();\n animationState.position = null;\n animationState.mode = 'stop';\n }\n }", "function stop() {\n cancelAnimationFrame(frameId);\n }", "function replace_logo() {\r\n\tadd_log(3,\"replace_logo() > Début.\");\r\n\t$id('logo').style.backgroundImage = \"url(\" + var_images['travian_revised'] + \")\";\r\n\tadd_log(1,\"replace_logo() > Logo remplacé.\");\r\n\tadd_log(3,\"replace_logo() > Fin.\");\r\n\t}", "function mouseout_LinkHub(logo)\n {\n\t logo.classList.remove('logo-active');\n\t logo.classList.add('logo-in-active');\n }", "function homepageUnwaste() {\n getActivity();\n activityInfoAnimation();\n setTimeout(gifContainerAnimation, 300);\n toggleHide();\n toggleShow();\n alterUnwasteBtnAction();\n}", "function hideIntercept() {\n $('#welcome-page').css('animation', \"none\");\n $('#welcome-page').css('display', \"none\");\n flashWhite();\n}", "updateLogo(step) {\n\t\tthis.logo.x -= this.skier.xv * step;\n\t\tthis.logo.y -= this.skier.yv * step;\n\t}", "function moveCar2(){\n ctx.clearRect(img2X,img2Y,46,90);\n img2Y = img2Y + img2DespY;\n ctx.drawImage(carImg2,img2X,img2Y,46,90);\n if(img2Y<=28||img2Y>=140)\n {\n animation2=false;\n clearInterval(interval2);\n }\n\n}", "function playLogo(){\n\t\t\t$(\"#gameTitle\").append(\"<h1>Trivia Time!</h1>\").fadeIn(\"slow\");\n\t\t\tcarStart.play();\n\t}", "function explode(){\r\n\t\tif (blowingup){\r\n\t\t\t\tvar thisExplosion = $('.explode');\r\n\t\t\t\tthisExplosion.attr('src', 'x'+ explodeFrame + '.png');\r\n\t\t\t\texplodeFrame++;\r\n\t\t\t\tif (explodeFrame == 6){\r\n\t\t\t\t\tblowingup = false;\r\n\t\t\t\t\texplodeFrame = 0;\r\n\t\t\t\t\texplodeLocation = \"0px\";\r\n\t\t\t\t\tthisExplosion.remove();\r\n\t\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.86108387", "0.7080638", "0.70496047", "0.70471853", "0.6957593", "0.6907867", "0.6819871", "0.6818485", "0.67659694", "0.67659694", "0.67659694", "0.67310756", "0.67289686", "0.6680569", "0.6631503", "0.6617334", "0.65762746", "0.6566484", "0.6548353", "0.65399414", "0.6538984", "0.6529964", "0.65255606", "0.65247136", "0.6501823", "0.64896405", "0.6485588", "0.6452839", "0.640118", "0.6395768", "0.63909847", "0.63862044", "0.63470626", "0.6332448", "0.63019377", "0.6272582", "0.6269459", "0.62287813", "0.62260365", "0.62236816", "0.6220125", "0.62032807", "0.6199835", "0.6196604", "0.61925787", "0.6186041", "0.6185206", "0.61606884", "0.61478966", "0.6147451", "0.61284804", "0.612625", "0.61117834", "0.6104352", "0.6091985", "0.6088834", "0.60853547", "0.60802335", "0.6060719", "0.60508597", "0.60503346", "0.60361147", "0.6035603", "0.60110134", "0.60066503", "0.6006194", "0.60045516", "0.59967184", "0.5989061", "0.5986529", "0.59845734", "0.5979575", "0.59744334", "0.59709936", "0.5960772", "0.59581095", "0.59542495", "0.5951807", "0.5948182", "0.5943666", "0.59419376", "0.59356177", "0.59327424", "0.59271723", "0.59213305", "0.59206545", "0.5914891", "0.59132975", "0.59025675", "0.5900217", "0.5895497", "0.5889987", "0.5887608", "0.58678776", "0.58633906", "0.58566964", "0.5856227", "0.5855013", "0.5849167", "0.5829788" ]
0.8123087
1
loads the full page content
function loadPage() { getRandomVideo(false); setTimeout(function() { loadSidebar(); stopLogo(); loadScreen(); }, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadContent() {\n $.ajax({\n url: 'ajax-get-page-content',\n type: 'GET',\n data: $data,\n beforeSend: function() {},\n success: function(response) {\n $('div#main-content').html(response);\n location.hash = $data.page || '';\n },\n complete: function(response) {\n loadModuleScript();\n }\n });\n }", "function load() {\n \n //writes all the html for the page\n htmlWriter();\n }", "function loadPageData() {\n\tvar cC = '#mw-content-text';\n\t$(cC).load(location.href + \" \" + cC + \" &gt; *\", function (data) {\n\t\tif (doRefresh) {\n\t\t\tajaxTimer = setTimeout(loadPageData, ajaxRefresh);\n\t\t}\n\t});\n}", "function loadPageData() {\n\tvar cC = '#mw-content-text';\n\t$( cC ).load( location.href + \" \" + cC + \" > *\", function ( data ) {\n\t\tif ( doRefresh ) {\n\t\t\tajaxTimer = setTimeout( loadPageData, ajaxRefresh );\n\t\t}\n\t} );\n}", "function loadPageData() {\n\tvar cC = '#mw-content-text';\n\t$( cC ).load( location.href + \" \" + cC + \" > *\", function ( data ) {\n\t\tif ( doRefresh ) {\n\t\t\tajaxTimer = setTimeout( loadPageData, ajaxRefresh );\n\t\t}\n\t} );\n}", "function loadContent () {\n\t\t$feedOverlay.removeClass(\"hidden\");\n\t\tMassIdea.loadHTML(SEL_CONTENT, URL_LOAD_FEED, function () {\n\t\t\t$feedOverlay.addClass(\"hidden\");\n\t\t\tresetTimer();\n\t\t});\n\t}", "function loadMyContent () {\n // do your page operations here\n}", "function loadHTML() {\n $('#ajax-example').load('content/content.html');\n }", "function getPageHTML() {\n let language = getLanguage()\n // get all the server-rendered html in our desired language\n $.ajax({\n beforeSend: console.log('getting html for language...'),\n url: '/getHtml',\n type: 'POST',\n data: { language },\n success: (data) => {\n if (data.err) {\n console.error('Error getting html!')\n } else {\n $('#full-page').html(data)\n // now we load the rest of the site\n GetRestOfSiteData()\n }\n },\n complete: (xhr, status) => {\n if (status == 'error') {\n $('#full-page').html(xhr.responseText)\n }\n },\n })\n}", "function WBU_LoadPartPage(url, block=''){\n var $div = $('<div>');//// Creation d'une div en memoire \n var $html = $('<section>');\n var result = $div.load(url+' '+block, function( response, status, xhr ){\n $html.html($(this).html()); \n console.log(this);\n console.log($(this).html());\n console.log(response);\n console.log(status);\n console.log(xhr);\n console.log($div);\n //return ($(this).html());\n });\n if(result && result.length > 0){\n return $html.html();\n }\n }", "function loadContent(content) {\n\t$(\".mainContent\").load(content,function() {\n\t init();\n\t});\n}", "function load_page(data){\n $(\".block-container\").empty();\n var infos = data.Infos;\n var page = \"<block class='block'>\";\n for (var i = 0; i < infos.length; i++) {\n page += infos[i].html;\n }\n page += \"</div>\";\n $(\".block-container\").append(page);\n}", "function loadPageContent(page_id) {\n getStudents(page_id)\n .then(function (data) {\n setBody(data);\n setPagination(data, page_id);\n });\n}", "_loadCurrentPage() {\n this._loadCardsForCurrentPage();\n this._renderCurrentPage();\n }", "function setContent(contentUrl) {\n\n $(document).ready(function () {\n\n $('#Main2-container').load(contentUrl);\n\n });\n\n //window.scrollTo(0, 0); //move the view back to the top of the window\n}", "function _loadContent(href) {\n\t\tviewercontent.load(href, {}, _prepareText);\n\t}", "_loadPage() {\n this._loadWithCurrentLang();\n\n let url = navigation.getCurrentUrl();\n if (url != '/') {\n navigation.navigatingToUrl(url, this.lang, this.DOM.pagesContent, false);\n }\n\n navigation.listenToHistiryPages(this.lang, this.DOM.pagesContent);\n }", "function loadContent(id,get){\n\t\tget=get||'';\n\t\tvar i,len=c.length,cont;\n\t\tconsole.log('loadcontent id: '+id+get);\n\t\tif($('container').data('id')==id+get) return;\n\t\tfor(i=0;i<len&&!cont;i++){\n\t\t\tif($(c[i]).data('id')==id+get) cont=c.splice(i,1)[0];\n\t\t}\n\t\tif(cont){\n\t\t\tconsole.log('loaded cached page. id: '+$(cont).data('id'));\n\t\t\tchangeContainer(cont);\n\t\t}else{\n\t\t\tvar url='view.php?pageid='+id+get.replace('#','%23');\n\t\t\tconsole.log('loading page: '+url);\n\t\t\tlc_url=url;\n\t\t\t//$('#btnTourActive').hide();\n\t\t\t$$.ajax({\n\t\t\t\ttype:'POST',\n\t\t\t\turl:url,\n\t\t\t\tdataType:'html',\n\t\t\t\tsuccess:function(data){\n\t\t\t\t\tif(lc_url==url){\n\t\t\t\t\t\tif(data=='404')\n\t\t\t\t\t\tif(isLogged()){\n\t\t\t\t\t\t\tconsole.log('wrong');\n\t\t\t\t\t\t\tif($.local('enableLogs'))\n\t\t\t\t\t\t\t\tdata='Error 404. Page not found.';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\thistoryBack();\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t\treturn loadContent('home');\n\t\t\t\t\t\tif(data!='404'){\n\t\t\t\t\t\t\twindow.lastPage=data;\n\t\t\t\t\t\t\tif(!data.match(/<container/i)) data='<container>'+data+'</container>';\n\t\t\t\t\t\t\tchangeContainer(data,id+get);\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}", "function loadPartial() {\n $(\"#dynamic_content_container\").html('<div class=\"module loading\"><h2>Loading...</h2><img src=\"/assets/load.gif\" /></div>');\n window.scrollTo(0, 0);\n $.ajax({\n \turl: window.location.hash.replace(\"#!\", \"\"),\n \tsuccess: function(data) {\n \t $(\"#dynamic_content_container\").html(data);\n \t},\n \terror: function(data) {\n \t var div = $(\"<div class='module'><h2>Requested page could not be loaded</h2><a href='/#!/home'>Go home</a></div>\");\n \t $(\"#dynamic_content_container\").html(div);\n \t},\n \tdataType: \"html\",\n\t timeout: 10000\n });\n}", "function LoadCurrentPage(){\n\t// The URL determines which page is fetched, in this case by ?view=<filename>\n\tvar view = getParameterByName('view');\n\tif (view) {\n\t\tLoadDiv('main',view,false);\n\t}\n\telse {\n\t\t// Default page\n\t\tLoadDiv('main','coding',false);\n\t}\t\t\t\n}", "function loadContent () {\n\t\tvar contentId = $(\"#contentId\").val();\n\t\tif (!isEmpty(contentId)) {\n\t\t\tloadContentById (contentId);\n\t\t}\t\n\t}", "function loadPage(path){\r\n return fetchPath(path).then(parseHtml)\r\n}", "function loadPage(path, anchor) {\n $('div.non-sidebar').load(path, function () {\n formatPage();\n goToAnchor(anchor);\n });\n }", "function loadContent(_targetKey){\r\n\t$.ajax({\r\n\t\turl:'pages/'+_targetKey+'.html',\r\n\t\tcache:false,\r\n\t\tsuccess:function(data){\r\n\t\t\t$('.content').empty();\r\n\t\t\t$('.content').html(data);\r\n\t\t}\r\n\t});\r\n}", "static load(title) {\n\t\tPage.pageReady = undefined;\n\t\tPage.clearTools();\n\t\t$(\"#PAGE_SEARCH\").hide();\n\t\t$(\"#PAGE_SEARCH_CONTENT\").hide();\n\t\t$(\"#PAGE_TOOLS\").show();\n\t\t$(\"#PAGE_CONTENT\").show();\n\t\t\n\t\tdocument.getElementById(Page.pageID).innerHTML = \"\";\n\n\t\tconst loc = \"files/fragments/\" + title + '/' + title;\t\t\n\t\tLoader.loadFragment(Page.pageID, loc + \".html\", loc + \".css\", loc + \".js\", () => {\n\t\t\tif (typeof Page.pageReady === \"function\") Page.pageReady();\n\t\t\tPage.currentPage = title;\n\t\t});\n\t}", "loadPage(){\n\t\tsuper.loadPage('https://www.google.com');\n\t}", "function embed_page(data) {\n $(\"#mainNav\").html(data);\n setTimeout(function() {\n loader();\n }, 0);\n}", "async function loadContent(id) {\n console.log(`Loading content for id=${id}`);\n let response = await fetch(`${window.location.origin}/${id}.html`);\n try {\n if (response.ok) {\n let content = await response.text();\n document.querySelector(\"#main\").innerHTML = content;\n if (id == \"pedidos\") {\n initOrders();\n } \n } else {\n console.log(\"Error loading\" + id);\n }\n } catch(error) {\n console.log(error);\n } \n }", "function loadpage(page_request, containerid){\r\n\tif (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf(\"http\")==-1))\r\n\t\tdocument.getElementById(containerid).innerHTML=page_request.responseText;\r\n}", "function viewCompany_page() {\r\n\t$(document).ready(function() {\r\n\t\t$('#content').load('html_files/company_html/viewCompany.html');\r\n\t});\r\n\t\r\n\t$(document).ready(function() {\r\n\t\tviewCompany();\r\n\t});\r\n}", "async function load() {\n\n\tdocument.querySelector('main').style.display = 'none' // hides main html\n\tdocument.getElementById('loading').style.display = 'block' // shows loading dots\n\n\ttry {\n\t\t// page equals string after # or if none, 'home'\n\t\tconst page = location.hash.length > 1 ? location.hash.substring(1) : 'home'\n\t\t//console.log( `${location.host }/${ location.hash}`)\n\t\t// load html and js\n\t\tdocument.querySelector('main').innerHTML = await\n\t\t( await fetch(`./views/${ page }.html`) ).text() // inject html into <main> of index\n\n\t\tconst pageModule = await import(`./modules/${ page }.js`)\n\n\t\t// run js for page\n\t\tpageModule.setup()\n\n\t} catch(err) {\n\t\t// page doesnt exist\n\t\tconsole.log(err)\n\t\t//window.location.href = '/#404'\n\t}\n\n\tdocument.querySelector('main').style.display = 'block' // displays upon page loading\n\tdocument.getElementById('loading').style.display = 'none' // hides loading dots\n\n}", "function refreshContent(){\n $('#gap_fluxo').load(document.URL + ' #gap_fluxo');\n $('#panel0').load(document.URL + ' #panel0');\n $('#panel1').load(document.URL + ' #panel1');\n $('#panelEspera').load(document.URL + ' #panelEspera');\n }", "function loadContent(id){\n let locationData = \"pages/\" + id + \".html\"\n let getData = new XMLHttpRequest();\n getData.onreadystatechange = function(){\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"main-display\").innerHTML = this.responseText;\n updateData(id)\n tabTracker = id \n /* Close details tab if left opened */\n closeTask()\n }\n }\n getData.open(\"GET\", locationData, true);\n getData.send();\n}", "function getArticleAnalyticsPage() {\n\n\t$('#main').empty();\n\t$('#main').load('views/articleAnalytics.html', null, function () {\n\t\tfillAutocomplete();\n\t\t$('#articleSearchButton').click(function () {\n\t\t\tgetIndividualArticleStats();\n\t\t\t\n\t\t})\n\t})\n\n}", "function outputPageContent() {\n \n $('#APIdata').html(outhtml); // this prints the apidata in the blank div section in the html\n }", "function requestContent(filename) {\n $('main').load(filename);\n}", "function load_products_page( url ) {\r\n\t\t\t// show loading\r\n\t\t\t$loading.css( 'display', 'block' );\r\n\r\n\t\t\t// get new page\r\n\t\t\t$.get( url, function( response, status, request ) {\r\n\t\t\t\t// hide loading\r\n\t\t\t\t$loading.css( 'display', 'none' );\r\n\r\n\t\t\t\t// check response status first\r\n\t\t\t\tif ( status == 'success' && request.status == 200 ) {\r\n\t\t\t\t\tvar $new_content = $( response ).find( '#wct-design-wizard .wct-products .products-wrapper' );\r\n\t\t\t\t\tif ( $new_content.length ) {\r\n\t\t\t\t\t\t// fill in new content\r\n\t\t\t\t\t\t$products_wrapper.html( $new_content.html() );\r\n\t\t\t\t\t\tlightbox_setup();\r\n\r\n\t\t\t\t\t\t// scroll\r\n\t\t\t\t\t\tanimate_scroll_to( $wizard, 20 );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} );\r\n\t\t}", "async function loadParts() {\n //load header\n if (document.getElementById(\"headerLoad\")) {\n response = await fetch(\"/header.html\");\n html = await response.text();\n document.getElementById(\"headerLoad\").innerHTML = html;\n }\n\n //load footer\n if (document.getElementById(\"footerLoad\")) {\n response = await fetch(\"/footer.html\");\n html = await response.text();\n document.getElementById(\"footerLoad\").innerHTML = html;\n document.getElementById(\"fcYear\").innerHTML = new Date().getFullYear();\n }\n\n //load left pane with desciption\n if (document.getElementById(\"left\")) {\n response = await fetch(\"/description.html\");\n html = await response.text();\n document.getElementById(\"left\").innerHTML = html;\n }\n\n //load right pane with archive\n if (document.getElementById(\"right\")) {\n response = await fetch(\"/archive.html\");\n html = await response.text();\n document.getElementById(\"right\").innerHTML = html;\n }\n\n if (document.getElementById(\"archiveList\")) {\n loadArchive();\n }\n\n setipsum();\n}", "function pageFullyLoaded () {}", "function adm_ajax_load()\n{\n\tadm_core = document.getElementById('adm_core');\n\tvar request = new XMLHttpRequest;\n\trequest.open('GET', 'sc_adm_content.php', true);\n\trequest.onload = function()\n\t{\n\t\tif (request.status >= 200 && request.status < 400)\n\t\t{\n\t\t\tvar resp = request.responseText;\n\t\t\tadm_core.innerHTML = resp;\n\t\t}\n\t};\n\trequest.send();\n}", "function loadDemoPage_1 () {\n console.log ('\\n ====== loadDemoPage_1 ..3 =======\\n');\n\n \n fetch ('https://jsonplaceholder.typicode.com')\n // input = the fetch reponse which is an html page content\n // output to the next then() ==>> we convert it to text\n .then (response => response.text())\n // input text, which represnts html page\n // & we assign it to the page body\n .then (htmlAsText => {\n document.body.innerHTML = htmlAsText;\n });\n}", "function LoadPage(page_name) {\n $('#content').load('./' + page_name + '.html');\n}", "function load(name) {\n $.get(pages[name].url, null, function(contenu) {\n $(\"#container\").html(contenu);\n pages[name].callback();\n });\n }", "function pageload(hash) {\n\t\t// alert(\"pageload: \" + hash);\n\t\t// hash doesn't contain the first # character.\n\t\tif(hash) {\n\t\t\t// restore ajax loaded state\n\t\t\tif(jQuery.browser.msie) {\n\t\t\t\t// jquery's $.load() function does't work when hash include special characters like aao.\n\t\t\t\thash = encodeURIComponent(hash);\n\t\t\t}\n\t\t\t\n\t\t\tvar items = hash.split('-');\n\t\t\t\n\t\t\tif(items.length == 2)\n\t\t\t{\n\t\t\t\tvar item_type = items[0];\n\t\t\t\tvar item_id = items[1];\n\t\t\t\t\n\t\t\t\tvar url = cmkyf_theme_url + \"/fragments/\" +item_type + \".php?\" + item_type + \"_id=\" + item_id;\n\t\t\t\t\n\t\t\t\tvar menu_index = false;\n\t\t\t\t\n\t\t\t\tswitch(item_type)\n\t\t\t\t{\n\t\t\t\t\tcase \"act\":\n\t\t\t\t\t\tmenu_index = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"workshop\":\n\t\t\t\t\t\tmenu_index = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"installation\":\n\t\t\t\t\t\tmenu_index = 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"film\":\n\t\t\t\t\t\tmenu_index = 3;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"event\":\n\t\t\t\t\t\tmenu_index = 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"venue\":\n\t\t\t\t\t\tmenu_index = 5;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"schedule\":\n\t\t\t\t\t\tmenu_index = 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"program\":\n\t\t\t\t\t\tmenu_index = 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tjQuery(\"#processing\").fadeIn(100);\n\t\t\t\tjQuery(\"#accordion\").accordion('activate', menu_index);\n\t\t\t\t//$(\"#content\").load(url);\n\t\t\t\tjQuery(\"#content\").load(url, function() { jQuery(\"#processing\").fadeOut(10); } );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t// start page\n\t\t\tjQuery(\"#content\").empty();\n\t\t}\n\t}", "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-overview/page-overview.html\");\n let css = await fetch(\"page-overview/page-overview.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n let pageDom = document.createElement(\"div\");\n pageDom.innerHTML = html;\n\n this._renderBoatTiles(pageDom);\n\n this._app.setPageTitle(\"Startseite\");\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n }", "function LoadContent(){\n\t\n\ttrace(\"LoadContent: Has API loaded and been properly initialized?:\"+String(IsLoaded()));\n\t\n\tif(!IsLoaded()) {\n\t\ttrace(\"Error loading API - Aborting!\");\n\t\treturn;\n\t}\n\n\ttrace(\"Exiting Load content...\");\n\treturn;\n\t\n}", "static async loadPage(url){\n const response = await fetch(url);\n const data = await response.text();\n // fs.writeFileSync(\"debug.html\", data);\n return {\n $: cheerio.load(data),\n html: data\n };\n }", "function loadUserContent() {\n if (curPage === 2) return;\n curPage = 2;\n $(\".content\").load('html/user.html');\n $(\"#title\").html(\"<b>🔧 사용자</b>\");\n}", "function pageLoader(page) {\n\t\t$.ajax({\n\t\t url: \"http://localhost/Personal/static-single-page-site/\" + page + \".html\",\n\t\t success: function(data){\n\t\t \t$(\"#page-data\").html();\n\t\t \t$(\"#page-data\").html(data);\n\t\t \twindow.history.replaceState({}, page, \"main.html?page=\"+ page )\n\t\t\t}\n\t\t});\n\t}", "function loadPages(newContent, pageTransition) {\r\n var $currentPage = $(\".page-main.page-current\"),\r\n $nextContent = $(\".page-main.page-next\");\r\n if ( // can't be global\r\n \"loadMoreFormacao\" != pageTransition && \"archiveFormacoes\" != pageTransition && ($(\"html,body\").addClass(\"fixed-all\"), $_body.removeClass(\"js-no-ajax\"), // I am using =ajax\r\n $_body.addClass(\"js-loading-page\"), // loading by ajax (removed onStartPage())\r\n //Check if header is out of view and setup\r\n animateMainNav(\"init\")), \"default\" == pageTransition) // end nextContent load\r\n return void $nextContent.load(newContent + \" .page-toload\", function(response, status, xhr) {\r\n var $this = $(this); //=404\r\n return $this.html() ? (manageBodyClasses(), void TweenMax.fromTo($currentPage, .25, {\r\n opacity: 1\r\n }, {\r\n opacity: 0,\r\n onComplete: function() {\r\n animateMainNav(\"start\"), TweenMax.set($nextContent.find(\".page-toload\"), {\r\n opacity: 0\r\n }), clearPagesAfterloading(0)\r\n }\r\n })) : (window.location = newContent, !1)\r\n });\r\n// if (\"archiveFormacoes\" == pageTransition) {\r\n// var $loadingBtn = $(\".page-header\").find(\".circle-btn\"),\r\n// $progressSVG = Snap(\"#loading-progress\"),\r\n// $downSvg = $loadingBtn.find(\".icon\").find(\"path\"),\r\n// rgb_color = $loadingBtn.css(\"backgroundColor\").match(/\\d+/g),\r\n// progress = $progressSVG.circle(34, 34, 32.5);\r\n// return $(\"html,body\").addClass(\"fixed-all\"), $_html.hasClass(\"firefox\") || $_html.hasClass(\"ie\") ? TweenMax.to($_window, 1, {\r\n// scrollTo: {\r\n// y: $(\".page-header\")\r\n// },\r\n// ease: Power4.easeOut\r\n// }) : TweenMax.to($_body, 1, {\r\n// scrollTo: {\r\n// y: $(\".page-header\")\r\n// },\r\n// ease: Power4.easeOut\r\n// }), progress.attr({\r\n// fill: \"none\",\r\n// stroke: \"rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",1)\",\r\n// strokeWidth: 2,\r\n// strokeLinecap: \"round\",\r\n// strokeDasharray: 204.1,\r\n// strokeDashoffset: 204.1,\r\n// transform: \"rotate(-45deg)\",\r\n// class: \"loading-timer\"\r\n// }), $downSvg.removeClass(\"active\"), $loadingBtn.addClass(\"remove-bg\"), void TweenMax.to($loadingBtn, .4, {\r\n// border: \"2px solid rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",0)\",\r\n// backgroundColor: \"rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",0)\",\r\n// delay: 0,\r\n// ease: Circ.easeInOut,\r\n// onComplete: function() {\r\n// TweenMax.to($(\"#loading-progress\").find(\"circle\"), 2, {\r\n// strokeDashoffset: 40,\r\n// ease: Expo.easeOut\r\n// }), $.doTimeout(200, function() {\r\n// $nextContent.load(newContent + \" .page-toload\", function(response, status, xhr) {\r\n// var $nextFormacaoListContainer = ($(this), $currentPage.find(\".formacao-list-container\"), $nextContent.find(\".formacao-list-container > a\")),\r\n// $loadMore = $currentPage.find(\".load-more\"),\r\n// $seeMoreTitle = $currentPage.find(\".see-more-title\"),\r\n// $seeMoreBg = ($(\".courses-picker\"), $(\".see-more-bg\"));\r\n// $loadMore.empty(), $seeMoreTitle.attr(\"style\", \"\"), TweenMax.set($seeMoreBg, {\r\n// scale: 0\r\n// }), $_body.hasClass(\"js-all-formacoes\") ? $(\".see-more\").show() : $(\".see-more\").hide(), $currentPage.find(\".formacao-list-container > a\").remove(), $currentPage.find(\".formacao-list-container\").prepend($nextFormacaoListContainer), $_body.removeClass(\"js-all-formacoes\"), $nextContent.empty(), $currentPage.find(\".formacao-list-container\").attr(\"style\", \"\"), $(\"html,body\").removeClass(\"fixed-all\"), _global_allowNavigate = !0, TweenMax.to($(\"#loading-progress\").find(\"circle\"), 2, {\r\n// strokeDashoffset: 0,\r\n// ease: Expo.easeOut\r\n// }), $downSvg.addClass(\"active\"), TweenMax.to($loadingBtn, .4, {\r\n// border: \"2px solid rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",.3)\",\r\n// backgroundColor: \"rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",1)\",\r\n// ease: Circ.easeInOut,\r\n// onComplete: function() {\r\n// TweenMax.set($loadingBtn.find(\"circle\"), {\r\n// strokeDashoffset: 204.1\r\n// }), $loadingBtn.removeClass(\"remove-bg\")\r\n// }\r\n// }), initformacaoListEvents(), $_html.hasClass(\"firefox\") || $_html.hasClass(\"ie\") ? TweenMax.to($_window, 1, {\r\n// scrollTo: {\r\n// y: $(\".courses-picker\")\r\n// },\r\n// ease: Power4.easeOut\r\n// }) : TweenMax.to($_body, 1, {\r\n// scrollTo: {\r\n// y: $(\".courses-picker\")\r\n// },\r\n// ease: Power4.easeOut\r\n// })\r\n// })\r\n// })\r\n// }\r\n// })\r\n// }\r\n// if (\"loadMoreFormacao\" == pageTransition) {\r\n// var $seeMore = ($currentPage.find(\".load-more\"), $currentPage.find(\".see-more\")); // end nextContent load\r\n// return void $nextContent.load(newContent + \" .page-toload .formacao-list-container\", function(response, status, xhr) {\r\n// var $this = $(this),\r\n// $tempList = $this.find(\".formacao-list-container > *\");\r\n// TweenMax.set($tempList, {\r\n// autoAlpha: 0\r\n// }), TweenMax.set($tempList.eq(0), {\r\n// marginTop: \"230px\"\r\n// }), $currentPage.find(\".formacao-list-container\").append($tempList), TweenMax.to($tempList, 1, {\r\n// autoAlpha: 1\r\n// }),\r\n// // $loadMore.append($this.find(\".formacao-list-container\"));\r\n// $nextContent.empty(), TweenMax.set($seeMore.find(\".finished-link\").closest(\".see-more\"), {\r\n// opacity: 0\r\n// }), $.doTimeout(300, function() {\r\n// $seeMore.find(\".finished-link\").closest(\".see-more\").addClass(\"open\"), TweenMax.set($seeMore.find(\".finished-link\").closest(\".see-more\"), {\r\n// opacity: 1\r\n// })\r\n// }), TweenMax.to($seeMore.find(\".see-more-bg\"), 1, {\r\n// scale: 30,\r\n// delay: .2,\r\n// ease: Expo.easeOut\r\n// }), TweenMax.to($seeMore.find(\".see-more-title\"), 1, {\r\n// opacity: 1,\r\n// y: 0,\r\n// pointerEvents: \"auto\",\r\n// delay: .3,\r\n// ease: Expo.easeOut,\r\n// onComplete: function() {\r\n// initformacaoListEvents(), $nextContent.empty(), $_html.hasClass(\"firefox\") || $_html.hasClass(\"ie\") ? TweenMax.to($_window, 1, {\r\n// scrollTo: {\r\n// y: $(\".load-more\")\r\n// },\r\n// ease: Power4.easeOut\r\n// }) : TweenMax.to($_body, 1, {\r\n// scrollTo: {\r\n// y: $(\".load-more\")\r\n// },\r\n// ease: Power4.easeOut\r\n// })\r\n// }\r\n// }), _global_allowNavigate = !0\r\n// })\r\n// }\r\n// if (\"blue-bg\" == pageTransition) // end nextContent load\r\n// return void $nextContent.load(newContent + \" .page-toload\", function(response, status, xhr) {\r\n// var $this = $(this); //=404\r\n// return $this.html() ? (manageBodyClasses(), void TweenMax.fromTo([$currentPage.find(\".page-header > *\"), $currentPage.find(\".page-content > *\")], .25, {\r\n// opacity: 1\r\n// }, {\r\n// opacity: 0,\r\n// onComplete: function() {\r\n// animateMainNav(\"start\"), clearPagesAfterloading(0)\r\n// }\r\n// })) : (window.location = newContent, !1)\r\n// });\r\n// if (\"inscTrans\" == pageTransition) // end nextContent load\r\n// return void $nextContent.load(newContent + \" .page-toload\", function(response, status, xhr) {\r\n// var $this = $(this);\r\n// if (!$this.html()) //=404\r\n// return window.location = newContent, !1;\r\n// manageBodyClasses();\r\n// var $activeLink = $(\".js-active-link\"),\r\n// padding_val = ($activeLink.offset().top - $_window.scrollTop() - _globalViewportH / 2 + $activeLink.height() / 2, _globalViewportH - $activeLink.find(\".formacao-list-item\").height());\r\n// padding_val /= 2, $activeLink.css(\"z-index\", \"99999\"), animateMainNav(\"start\"), TweenMax.to($activeLink.find(\".formacao-list-item\"), .8, {\r\n// y: -($activeLink.offset().top - $_window.scrollTop()) - 6,\r\n// paddingTop: padding_val,\r\n// paddingBottom: padding_val,\r\n// ease: Expo.easeOut,\r\n// onComplete: function() {\r\n// clearPagesAfterloading(0)\r\n// }\r\n// }), TweenMax.to([$activeLink.find(\".text-right\"), $currentPage.find(\".page-header\"), $activeLink.find(\".course-type\"), $currentPage.find(\".see-more\")], .2, {\r\n// opacity: 0,\r\n// ease: Expo.easeOut\r\n// }), TweenMax.to($activeLink.find(\"h3\"), .8, {\r\n// opacity: 1,\r\n// ease: Expo.easeOut\r\n// })\r\n// });\r\n// if (\"formTrans-alt\" == pageTransition) // end nextContent load\r\n// return void $nextContent.load(newContent + \" .page-toload\", function(response, status, xhr) {\r\n// var $this = $(this);\r\n// if (!$this.html()) //=404\r\n// return window.location = newContent, !1;\r\n// manageBodyClasses();\r\n// var $consultasCall = $(\".consultas-call-to-action-container\"),\r\n// padding_val = ($consultasCall.offset().top - $_window.scrollTop() - _globalViewportH / 2 + $consultasCall.height() / 2, _globalViewportH - $consultasCall.height());\r\n// padding_val /= 2, $_body.removeClass(\"home\"), $(\"#header-main h1 .logo .logo-svg .logo-path\").css({\r\n// fill: \"#ffffff\"\r\n// }), animateMainNav(\"start\"), TweenMax.to($(\".js-not-form\"), 1, {\r\n// y: -($consultasCall.offset().top - $_window.scrollTop()),\r\n// opacity: 0,\r\n// ease: Expo.easeOut\r\n// }), TweenMax.to([$consultasCall.find(\".title\"), $consultasCall.find(\".form-container\")], .2, {\r\n// opacity: 0,\r\n// ease: Expo.easeOut\r\n// }), $headerCopy = $nextContent.find(\".page-header\"), $consultasCall.prepend($headerCopy.clone()), TweenMax.set($consultasCall.find(\".page-header\"), {\r\n// position: \"absolute\",\r\n// width: \"100%\",\r\n// height: \"100%\",\r\n// top: 0,\r\n// left: 0,\r\n// opacity: 0,\r\n// y: \"100px\"\r\n// }), TweenMax.set($consultasCall.find(\".page-header h2\"), {\r\n// color: \"#ffffff\"\r\n// }), TweenMax.set($consultasCall.find(\".page-header h2\"), {\r\n// opacity: 1\r\n// }),\r\n// // var _top = $consultasCall.find(\".page-header\")[0].getBoundingClientRect().top;\r\n// // var _top = $consultasCall.find(\".page-header\").offset().top;\r\n// // console.log(_top);\r\n// // TweenMax.to($consultasCall.find(\".page-header\"), .8, {opacity:1, y:-_top + 280, ease: Expo.easeOut});\r\n// TweenMax.to($consultasCall, .8, {\r\n// y: -($consultasCall.offset().top - $_window.scrollTop()),\r\n// paddingTop: padding_val,\r\n// paddingBottom: padding_val,\r\n// ease: Expo.easeOut,\r\n// onComplete: function() {\r\n// clearPagesAfterloading(0)\r\n// }\r\n// })\r\n// });\r\n// if (\"inscTrans-second\" == pageTransition) {\r\n// var $loadingBtn = $(\".page-header\").find(\".circle-btn\"),\r\n// $progressSVG = Snap(\"#loading-progress\"),\r\n// $downSvg = $loadingBtn.find(\".icon\").find(\"path\"),\r\n// rgb_color = $loadingBtn.css(\"backgroundColor\").match(/\\d+/g),\r\n// progress = $progressSVG.circle(34, 34, 32.5);\r\n// return progress.attr({\r\n// fill: \"none\",\r\n// stroke: \"rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",1)\",\r\n// strokeWidth: 2,\r\n// strokeLinecap: \"round\",\r\n// strokeDasharray: 204.1,\r\n// strokeDashoffset: 204.1,\r\n// transform: \"rotate(-45deg)\",\r\n// class: \"loading-timer\"\r\n// }), $downSvg.removeClass(\"active\"), $loadingBtn.addClass(\"remove-bg\"), TweenMax.to($loadingBtn, .4, {\r\n// border: \"2px solid rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",0)\",\r\n// backgroundColor: \"rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",0)\",\r\n// delay: 0,\r\n// ease: Circ.easeInOut,\r\n// onComplete: function() {\r\n// TweenMax.to($(\"#loading-progress\").find(\"circle\"), 2, {\r\n// strokeDashoffset: 40,\r\n// ease: Expo.easeOut\r\n// }), $.doTimeout(200, function() {\r\n// $nextContent.load(newContent + \" .page-toload\", function(response, status, xhr) {\r\n// var $loadMore = ($(this), $currentPage.find(\".formacao-list-container\"), $nextContent.find(\".formacao-list-container > a\"), $currentPage.find(\".load-more\")),\r\n// $seeMoreTitle = $currentPage.find(\".see-more-title\"),\r\n// $seeMoreBg = ($(\".courses-picker\"), $(\".see-more-bg\"));\r\n// $loadMore.empty(), $seeMoreTitle.attr(\"style\", \"\"), TweenMax.set($seeMoreBg, {\r\n// scale: 0\r\n// }), TweenMax.to($(\"#loading-progress\").find(\"circle\"), 2, {\r\n// strokeDashoffset: 0,\r\n// ease: Expo.easeOut\r\n// }), $downSvg.addClass(\"active\"), TweenMax.to($loadingBtn, .4, {\r\n// border: \"2px solid rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",.3)\",\r\n// backgroundColor: \"rgba(\" + rgb_color[0] + \",\" + rgb_color[1] + \",\" + rgb_color[2] + \",1)\",\r\n// ease: Circ.easeInOut,\r\n// onComplete: function() {\r\n// TweenMax.set($loadingBtn.find(\"circle\"), {\r\n// strokeDashoffset: 204.1\r\n// }), $loadingBtn.removeClass(\"remove-bg\")\r\n// }\r\n// })\r\n// })\r\n// })\r\n// }\r\n// }), void $nextContent.load(newContent + \" .page-toload\", function(response, status, xhr) {\r\n// var $this = $(this);\r\n// if (!$this.html()) //=404\r\n// return window.location = newContent, !1;\r\n// manageBodyClasses();\r\n// var $pageHeader = $currentPage.find(\".page-header\");\r\n// animateMainNav(\"reset\"), $_html.hasClass(\"firefox\") || $_html.hasClass(\"ie\") ? TweenMax.to($_window, 1, {\r\n// scrollTo: {\r\n// y: 0\r\n// },\r\n// ease: Power4.easeOut,\r\n// onComplete: function() {\r\n// TweenMax.to($pageHeader.find(\"h2:not('.inscricao-page-first-title')\"), 1, {\r\n// borderColor: \"rgba(255,255,255,1)\"\r\n// }), $pageHeader.find(\".circle-btn .arrow-down path\").removeClass(\"active\"), TweenMax.staggerTo($(\".course-specs .columns\"), .5, {\r\n// y: \"20px\",\r\n// opacity: 0,\r\n// ease: Expo.easeOut\r\n// }, .1);\r\n// var _top = $(\".text-wrapper\")[0].getBoundingClientRect().top;\r\n// TweenMax.staggerTo($(\".page-current .text-wrapper\").find(\"h2\"), 1, {\r\n// top: -_top + 180,\r\n// ease: Expo.easeOut,\r\n// delay: 1\r\n// }, .1), clearPagesAfterloading(2e3), TweenMax.to($pageHeader.find(\".circle-btn\"), 1, {\r\n// scale: 0,\r\n// delay: 1,\r\n// ease: Elastic.easeOut.config(1, 1),\r\n// onComplete: function() {}\r\n// }), TweenMax.to($pageHeader.find(\".btn\"), 1, {\r\n// opacity: 0\r\n// })\r\n// }\r\n// }) : TweenMax.to($_body, 1, {\r\n// scrollTo: {\r\n// y: 0\r\n// },\r\n// ease: Power4.easeOut,\r\n// onComplete: function() {\r\n// TweenMax.to($pageHeader.find(\"h2:not('.inscricao-page-first-title')\"), 1, {\r\n// borderColor: \"rgba(255,255,255,1)\"\r\n// }), $pageHeader.find(\".circle-btn .arrow-down path\").removeClass(\"active\"), TweenMax.staggerTo($(\".course-specs .columns\"), .5, {\r\n// y: \"20px\",\r\n// opacity: 0,\r\n// ease: Expo.easeOut\r\n// }, .1);\r\n// var _top = $(\".text-wrapper\")[0].getBoundingClientRect().top;\r\n// TweenMax.staggerTo($(\".page-current .text-wrapper\").find(\"h2\"), 1, {\r\n// top: -_top + 180,\r\n// ease: Expo.easeOut,\r\n// delay: 1\r\n// }, .1), clearPagesAfterloading(2e3), TweenMax.to($pageHeader.find(\".circle-btn\"), 1, {\r\n// scale: 0,\r\n// delay: 1,\r\n// ease: Elastic.easeOut.config(1, 1),\r\n// onComplete: function() {}\r\n// }), TweenMax.to($pageHeader.find(\".btn\"), 1, {\r\n// opacity: 0\r\n// })\r\n// }\r\n// })\r\n// })\r\n// }\r\n return \"formTrans\" == pageTransition ? void $nextContent.load(newContent + \" .page-toload\", function(response, status, xhr) {\r\n var $this = $(this);\r\n if (!$this.html()) //=404\r\n return window.location = newContent, !1;\r\n manageBodyClasses();\r\n //Height of the biggest item plus 150px for wrapper\r\n var height = 0;\r\n $nextContent.find(\".form-item-container\").each(function() {\r\n var $this = $(this);\r\n $this.height() > height && (height = $this.height())\r\n }), height += 150, $nextContent.find(\".inscricao-page .inscricao-form\").css(\"height\", height), TweenMax.to($(\".js-not-form\"), 1, {\r\n y: -($(\".consultas-call-to-action-container\").offset().top - $_window.scrollTop()),\r\n opacity: 0,\r\n ease: Expo.easeOut\r\n }), TweenMax.to($(\"footer\"), 1, {\r\n autoAlpha: 0,\r\n ease: Expo.easeOut\r\n }), TweenMax.to($(\".consultas-call-to-action-container .title\"), 1, {\r\n opacity: 0,\r\n ease: Expo.easeOut\r\n });\r\n var fakeContainerHeight = height - $(\".consultas-call-to-action-container\").height();\r\n TweenMax.to($(\".consultas-call-to-action-container\"), 1, {\r\n y: -($(\".consultas-call-to-action-container\").offset().top - $_window.scrollTop()),\r\n paddingTop: fakeContainerHeight / 2,\r\n paddingBottom: fakeContainerHeight / 2,\r\n ease: Expo.easeOut,\r\n onComplete: function() {\r\n setFormPosition($nextContent, function() {\r\n animateMainNav(\"start\"), clearPagesAfterloading(0)\r\n })\r\n }\r\n })\r\n }) : void 0\r\n} //////end function main load content", "function loadContentClick () {\n\t\t$feedOverlay.removeClass(\"hidden\");\n\t\tMassIdea.loadHTML(SEL_CONTENT, URL_LOAD_FEED, function () {\n\t\t\t$feedOverlay.addClass(\"hidden\");\n\t\t});\n\t}", "function mainLoaded() {\n if (typeof(executeOnContentLoad) == \"function\") {\n if (contentLoadDestination && location.hash != contentLoadDestination) return;//wait til we are on the correct page\n var fn = executeOnContentLoad;\n executeOnContentLoad = null;\n contentLoadDestination = null;\n fn();\n }\n }", "function loadContent(canvas, href, callback) {\n var that = this;\n $.ajax({\n url : href,\n success : function(result) {\n var article = getArticle(result + \"\");\n showArticleContent(canvas, article);\n if (callback) {\n callback.call(that);\n }\n },\n async : true\n });\n }", "function loadContent()\n {\n xhrContent = new XMLHttpRequest();\n xhrContent.open(\"GET\",\"Scripts/paragraphs.json\",true);\n xhrContent.send(null);\n xhrContent.addEventListener(\"readystatechange\",readParagraphs);\n }", "function htmlLoad() {\n}", "function page1(){\n $(\"#includePageContent\").load(\"daftarBarangCard.html\");\n $(\"#inputSearch\").show();\n $(\"#iconSearch\").show();\n}", "function load_page(callback) {\n var page_url = window.document.location + 'page/' + page + '.yaws';\n $(\"#power_msg\").val('');\n $.get(page_url, function(data) {\n pageDiv.html(data);\n if (callback != undefined)\n callback();\n });\n}", "function loaded(error, response, body) {\n // Check for errors\n if (!error && response.statusCode == 200) {\n // The raw HTML is in body\n res.send(body);\n } else {\n res.send(response);\n }\n }", "function LoadPageContent() {\n switch (document.title) {\n case \"Home\":\n LoadHomePage();\n break;\n\n case \"Projects\":\n LoadProjectsPage();\n break;\n\n case \"Contact\":\n LoadContactPage();\n break;\n }\n}", "function loadCurrentPaperContent() {\n\n\tif (document.location.pathname === \"/\") {\n\t\t$addedHeadTags && $addedHeadTags.remove();\n\t\t$('.paper-container').empty();\n\t}\n\n\tupdateModeCheckbox(false);\n\n\tWebuiPopovers.hideAll();\n\n\tsessionStorage.revForPaper = false;\n\tsessionStorage.alreadyReviewed = false;\n\tif (document.location.pathname.startsWith(\"/papers/\")) {\n\t\tif (sessionStorage.papers) {\n\t\t\tvar parsed = JSON.parse(sessionStorage.papers);\n\t\t\tvar papers = [];\n\t\t\tfor (var category in parsed.articles) {\n\t\t\t\tif (parsed.articles.hasOwnProperty(category)) {\n\t\t\t\t\tpapers = papers.concat(parsed.articles[category]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar paper = papers.find(function(paper) {\n\t\t\t\t//Remove pound part\n\t\t\t\tif (document.location.pathname.replace(/\\/$/, '').lastIndexOf(paper.url) !== -1){\n\t\t\t\t\treturn paper;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t$('title').remove();\n\n\t\t$.ajax({\n\t\t\turl: encodeURI('/api' + document.location.pathname),\n\t\t\tmethod: 'GET',\n\t\t\tsuccess: function(result) {\n\t\t\t\ttry {\n\t\t\t\t\tvar xmlParsed = $.parseXML(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tshowNotify('Error while parsing XML. Please, try again!', true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar paperID = document.location.pathname.split('papers/').pop().replace('/','');\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: encodeURI('/api/papers/' + paperID + '/role'),\n\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\tsuccess: function(result) {\n\t\t\t\t\t\tsessionStorage.revForPaper = result.isReviewer;\n\t\t\t\t\t\tsessionStorage.alreadyReviewed = result.alreadyReviewed;\n\t\t\t\t\t\tcheckCurrentRole();\n\t\t\t\t\t},\n\t\t\t\t\terror: function(error) {\n\t\t\t\t\t\tsessionStorage.revForPaper = false;\n\t\t\t\t\t\tsessionStorage.alreadyReviewed = false;\n\t\t\t\t\t\tcheckCurrentRole();\n\n\t\t\t\t\t\tshowNotify(error.responseJSON.message, true);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t$('#placeholder').addClass('hidden');\n\t\t\t\tvar $xml = $(xmlParsed);\n\t\t\t\t//Head\n\t\t\t\t$addedHeadTags && $addedHeadTags.remove();\n\t\t\t\t$addedHeadTags = $xml.find('meta, link, title, script[type=\"application/ld+json\"]').not('link[rel=\"stylesheet\"]');\n\t\t\t\t$('head').append($addedHeadTags);\n\t\t\t\t//Body\n\t\t\t\tvar $body = $xml.find('body');\n\t\t\t\t$('.paper-container').empty().append($body.children());\n\t\t\t\trasherize(); //Add extra paper elements\n\t\t\t\t//Scroll Spy sections\n\t\t\t\t$('.sections-sidebar>ul').empty();\n\t\t\t\tvar $root = $('html, body');\n\t\t\t\t$('.sections-sidebar>ul').append($('<li class=\"active\"><a href=\"#top\">' + $(\"head title\").html().split(\" -- \")[0] + '</a></li>'));\n\t\t\t\t$('.paper-container>section[id]').each(function(index) {\n\t\t\t\t\tvar $link = $('<a href=\"#' + $(this).attr('id') + '\">' + $(this).find('h1').eq(0).text() + '</a>');\n\t\t\t\t\t$('.sections-sidebar>ul').append($('<li></li>').append($link));\n\t\t\t\t\tif ($('section[id]', $(this)).size()) {\n\t\t\t\t\t\tvar $sub = $('<ul class=\"nav\"></ul>');\n\t\t\t\t\t\t$('section[id]', $(this)).each(function(index) {\n\t\t\t\t\t\t\tvar $sublink = $('<li><a href=\"#' + $(this).attr('id') + '\">' + $(this).find('h2').eq(0).text() + '</a></li>');\n\t\t\t\t\t\t\tif ($sublink.text()) {\n\t\t\t\t\t\t\t\t$sub.append($sublink);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t$('.sections-sidebar>ul>li:last-child').append($sub);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t$('.sections-sidebar>ul a').each(function(index) {\n\t\t\t\t\t$(this).on('click', function(event) {\n\t\t\t\t\t\tvar href = $(this).attr('href');\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t//remove topnav distance\n\t\t\t\t\t\t$root.animate({\n\t\t\t\t\t\t\tscrollTop: $(href).offset().top - $('.topnav').height()\n\t\t\t\t\t\t}, 400, function() {\n\t\t\t\t\t\t\thistory.pushState({}, '', href);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tvar scrollTarget = window.location.hash && $(window.location.hash).offset() ? $(window.location.hash).offset().top : $('#top').offset().top;\n\t\t\t\tif (scrollTarget !== $(window).scrollTop()) {\n\t\t\t\t\t$root.animate({\n\t\t\t\t\t\tscrollTop: scrollTarget - $('.topnav').height()\n\t\t\t\t\t}, 400);\n\t\t\t\t}\n\t\t\t\t$('[data-spy=\"scroll\"]').each(function() {\n\t\t\t\t\tvar $spy = $(this).scrollspy('refresh');\n\t\t\t\t});\n\t\t\t\t//END: Scroll Spy Sections\n\t\t\t\tloadAnnotations();\n\t\t\t\tloadDraftAnnotations();\n\t\t\t\tcreateFilterPopoverContent($content);\n\t\t\t},\n\t\t\terror: function(error) {\n\t\t\t\tif (error.responseJSON && error.responseJSON.error.name === \"TokenExpiredError\") {\n\t\t\t\t\t$('#login-modal').modal('show');\n\t\t\t\t}\n\t\t\t\tshowNotify(error.responseJSON.message, true);\n\t\t\t}\n\t\t});\n\t} else { createFilterPopoverContent($content); }\n}", "function renderPartials() {\n\n var hash = location.hash.split('#')[1];\n\n var contentarea = document.getElementById('main-content-area');\n\n var xhr = new XMLHttpRequest();\n\n xhr.open('GET', '../html/' + hash + '.html');\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n contentarea.innerHTML = xhr.response;\n }\n }\n\n xhr.send();\n\n }", "function loadVersionContent(versionElement, versionHref) {\n setSelectedVersion(versionElement);\n $('#common_feature_content').load(versionHref, function(response, status) {\n if (status === 'success') {\n $('#feature_title').hide();\n setupDisplayContent();\n updateMainBreadcrumb(versionElement, 'full_title');\n\n $(this).focus(); // switch focus to the content for the reader\n }\n $('footer').show();\n });\n}", "function loadContent(fileName){\n\t$(\"#contentwrapper\").load(\"../content/\" + fileName);\n\n}", "function loadPage(page, title) {\n console.log(page + \" \" + title);\n var activePage = $.mobile.pageContainer.pagecontainer(\"getActivePage\");\n $.get(page, function (data) {\n $(\"#content\", activePage).html(data).enhanceWithin();\n $(\"#titlepage\").html(title);\n });\n }", "function cb_contentLoaded(cb) {}", "loadPages() {\n this._pages = utility.getJSONFromFile(this._absoluteFile);\n }", "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-start/page-start.html\");\n let css = await fetch(\"page-start/page-start.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n this._pageDom = document.createElement(\"div\");\n this._pageDom.innerHTML = html;\n\n await this._renderReciepts(this._pageDom);\n\n this._app.setPageTitle(\"Startseite\", {isSubPage: true});\n this._app.setPageCss(css);\n this._app.setPageHeader(this._pageDom.querySelector(\"header\"));\n this._app.setPageContent(this._pageDom.querySelector(\"main\"));\n\n this._countDown();\n }", "function loadPage( targetUrl ) {\n\tvar persistenceOn = jQuery( 'body.loadsaved' ).length;\n\tif ( jQuery( 'body' ).hasClass( 'ajax-on' ) ) {\n\t\tjQuery( 'body' ).append( '<div id=\"progress\"></div>' );\n\t\tjQuery( '#progress' ).viewportCenter();\n\t\tjQuery( document ).unbind();\n\t\tjQuery( '#outer-ajax' ).load( targetUrl + ' #inner-ajax', function( allDone ) {\n\t\t\tjQuery( '#progress' ).addClass( 'done' );\n\t\t\tif ( persistenceOn ) {\n\t\t \t\tWPtouchCreateCookie( 'wptouch-load-last-url', targetUrl, 365 );\n\t\t\t} else {\n\t\t\t \tWPtouchEraseCookie( 'wptouch-load-last-url' );\t\n\t\t\t}\n\t\t\tdoClassicReady();\n\t\t\tscrollTo( 0, 0, 100 );\n\t\t});\n\t} else {\n\t\tjQuery( 'body' ).append( '<div id=\"progress\"></div>' );\n\t\tjQuery( '#progress' ).viewportCenter();\n\t\tif ( persistenceOn ) {\n\t \t\tWPtouchCreateCookie( 'wptouch-load-last-url', targetUrl, 365 );\n\t\t}\n\t\tsetTimeout( function () { window.location = targetUrl; }, 550 );\n\t}\n}", "function loadcontent(load_type, load_value, load_sort, load_view) {\n\t\n\t\t//set new cookies\n\t\t$.cookie('type', load_type, { expires: 14 });\n\t\t$.cookie('value', load_value, { expires: 14 });\n\t\t$.cookie('sort', load_sort, { expires: 14 });\n\t\t$.cookie('view', load_view, { expires: 14 });\n\t\t\n\t\t//avoid overflow\n\t\t$('sidebar').css({'overflow-y': 'hidden'});\n\t\t\n\t\t//set view type\n\t\t$(\"section\").removeClass();\n\t\t$(\"section\").addClass($.cookie('view'));\n\n\t\t//empty poolid and articleList array's\n\t\tpoolid = [];\n\t\tarticleList = [];\n\n\t\t//destroy waypoint functions, avoid many items being called, see infinite.js\n\t\t$('div#block h4').waypoint('destroy');\n\n\t\t//set category, feed and status variables\n\t\tif (load_type == 'category_id') { var category_id = load_value; }\n\t\tif (load_type == 'feed_id') { var feed_id = load_value; }\n\t\tif (load_type == 'status') { var status = load_value; }\n\n\t\t//remove content and offload scroll\n\t\t$('section').empty();\n\t\t$('section #content').remove();\n\t\t$('section').append('<div id=\"content\"></div>');\n\t\t$(window).off(\"scroll\");\n\n\t\t//use small amount of timeout when calling scrollPagination\n\t\tsetTimeout(function () {\n\t\t\t$('#content').scrollPagination({\n\t\t\t\tnop: 10, // The number of posts per scroll to be loaded\n\t\t\t\toffset: 10, // Initial offset, begins at 0 in this case\n\t\t\t\terror: 'No More Posts - All items marked as read!', // When the user reaches the end this is the message that is\n\t\t\t\tdelay: 100, // When you scroll down the posts will load after a delayed amount of time.\n\t\t\t\tscroll: true, // The main bit, if set to false posts will not load as the user scrolls.\n\t\t\t\tcategory_id: category_id, // Catch category from menu\n\t\t\t\tfeed_id: feed_id, // Catch feedname from menu\n\t\t\t\tstatus: status, // Catch status from menu\n\t\t\t\tsort: load_sort // Catch sort\n\t\t\t});\n\t\t}, 100);\n\t}", "function loadRightContent(event, isComp) {\n\t\t\tif (target_div.target != \"empty\") {\n\t\t\t\twindow.history.pushState({}, document.title, getBase(window.location.href) + '?src=' + event.target );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\t//url variables sort by rating - ratings plugin\n\t\t\t\tvar vars = \"?r_sortby=highest_rated&amp;r_orderby=desc #content\";\n\t\t\t\tjQuery(\"#\" + target_div.target).load(event.target + vars, function() {\n\t\t\t\t\tjQuery(\"#\" + target_div.target).append(\"<div style='clear:both'/>\");\n\t\t\t\t\tbackToTop();\n\t\t\t\t\tjQuery(\".pagination\").click(function(event) {\n\t\t\t\t\t\tloadRightContent(event, isComp);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\t\n\t\t}", "loadContent() {\n this.setState({ currentlyLoading: true });\n // Reset the ids in case they have changed\n this.getIDsFromDB(\"author\", 'https://www.theedgesusu.co.uk/wp-json/wp/v2/users/');\n this.getIDsFromDB(\"tag\", 'https://www.theedgesusu.co.uk/wp-json/wp/v2/tags/');\n this.getIDsFromDB(\"section\", 'https://www.theedgesusu.co.uk/wp-json/wp/v2/categories/');\n this.setState({ currentlyLoading: false });\n }", "function loadFirstPage(){\n\t\t\tcounter = studentItemLength;\n\t\t\tclearClass();\n\t\t\t$('.student-item').each(function () {\t\t\t\n\t\t\tcreateClass(this); \n\t\t\t});\n\t\t\tnavBar(counter);\n\t\t\tshowStudents(1);\n\t\t\tclickingPageNumber();\n}", "function loadGifticonContent() {\n if (curPage === 1) return;\n curPage = 1;\n $(\".content\").load('html/gifticon.html');\n $(\"#title\").html(\"<b>🔧 기프티콘</b>\");\n}", "function loadPage() {\n // Load title\n document.title = this.title;\n // Load H1\n $('#load-h1').html('<h1>' + this.h1 + '</h1>');\n // Add pageview to Google Analytics\n CS.GoogleAnalytics.trackPageview('/app/createSend/' + this.name + '.aspx');\n }", "function loadContent(url, params, item_selector, load_params, callback) {\n var main = $(\"#main-page\");\n\n var replace = false, anim = true;\n if (typeof load_params != \"undefined\") {\n if (load_params.hasOwnProperty(\"replace\"))\n replace = load_params[\"replace\"];\n if (load_params.hasOwnProperty(\"anim\"))\n anim = load_params[\"anim\"];\n }\n\n// console.log(url);\n main.stop(true);\n if (anim) {\n main.animate({\n opacity: 0,\n height: main.height()\n }, transTimeFast);\n } else {\n main.css(\"height\", main.height());\n }\n $(\".left-column-item\").removeClass(\"active\");\n if (typeof item_selector !== \"undefined\") {\n var item = $(item_selector);\n if (typeof item !== \"undefined\") {\n $(item).addClass(\"active\");\n }\n }\n\n var loadSpinnerTimer;\n loadSpinnerTimer = setTimeout(function () {\n main.animate({\n opacity: 50,\n height: 100\n }, transTimeFast);\n main.html('\\\n <div style=\"width: 100%; text-align: center;\">\\\n <span class=\"fa fa-spinner fa-pulse fa-4x\"></span>\\\n </div>');\n }, 1000);\n\n// console.log(\"load\", url);\n\n $.ajax({\n type: \"GET\",\n url: url,\n data: params,\n success: function (data) {\n clearTimeout(loadSpinnerTimer);\n __manualStateChange = true;\n var state = {\n data: data,\n params: load_params,\n item: item_selector,\n rand: Math.random(),\n callback: callback\n };\n if (replace) {\n History.replaceState(state, document.title, url);\n } else {\n History.pushState(state, document.title, url);\n }\n initAjaxPage(\"#main-page\");\n loadComplete();\n },\n error: function (xhr, textStatus, errorThrown) {\n clearTimeout(loadSpinnerTimer);\n displayContent('\\\n <div class=\"alert alert-danger\" role=\"alert\">\\\n <strong>页面载入出错。</strong>\\\n 错误信息:' +\n textStatus + \": \" + xhr.status + \" \" + errorThrown +\n xhr.responseText.replace(/\\n/g, \"<br>\") +\n '</div>'\n );\n console.log(xhr.responseText.substr(0, 500));\n }\n });\n}", "function pageLoad (){\n fetch(quoteAPI)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n quoteData = data;\n renderNewQuote();\n });\n\n fetch(fontAPI)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n fontData = data;\n renderNewFont ();\n });\n}", "function pageLoad() {\n\t\t\t\t\twindow.location.assign(\"fly.html\");\n\t\t\t\t}", "loadPage() {\n\t\tif (!this.onBeforeLoadPage()) {return;}\n\t\tthis.showPageLoadingIndicator();\n\t\tdxRequestInternal(\n\t\t\tgetComponentControllerPath(this),\n\t\t\tthis.getLoadFunctionParameters(),\n\t\t\tfunction(data_obj) {\n\t\t\t\tdata_obj.Page.forEach(function(item) {\n\t\t\t\t\tthis.addRow(item);\n\t\t\t\t}.bind(this));\n\t\t\t\tthis.total_items = data_obj.TotalCount;\n\t\t\t\tgetComponentElementById(this,\"DataListMoreButton\").show();\n\t\t\t\tif (this.total_items <= (this.current_list_offset+this.list_offset_increment)) {\n\t\t\t\t\tgetComponentElementById(this,\"DataListMoreButton\").hide();\n\t\t\t\t}\n\t\t\t\tif (this.current_page_array.length > 0) {\n\t\t\t\t\tgetComponentElementById(this,\"DataListLoading\").hide();\n\t\t\t\t} else {\n\t\t\t\t\tgetComponentElementById(this,\"DataListLoading\").html(\"No results\").show();\n\t\t\t\t\tgetComponentElementById(this,\"DataListMoreButton\").hide();\n\t\t\t\t}\n\t\t\t\tthis.onAfterLoadPage(data_obj);\n\t\t\t}.bind(this),\n\t\t\tfunction(data_obj) {\n\t\t\t\tgetComponentElementById(this,\"DataList\").hide();\n\t\t\t\tthis.handleComponentError('Could not retrieve data: '+data_obj.Message);\n\t\t\t}.bind(this),false,false);\n\t}", "function changePage() {\n const url = window.location.href;\n const main = document.querySelector('main');\n loadPage(url).then((responseText) => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = responseText;\n const oldContent = document.querySelector('.mainWrapper');\n const newContent = wrapper.querySelector('.mainWrapper');\n main.appendChild(newContent);\n animate(oldContent, newContent);\n });\n }", "load($url) {\n const me = this;\n var request = new XMLHttpRequest();\n\n request.open('GET', $url, true);\n request.send(null);\n request.onreadystatechange = function () {\n if (request.readyState === 4 && request.status === 200) {\n try {\n me.data = JSON.parse(request.responseText);\n me.resetSorting();\n me.render();\n } catch (err) {\n // TODO: process error\n }\n }\n }\n }", "function loadPage(id){\n\treturn new Promise(function(resolve, reject){\n\t\tvar url = 'https://land-book.com/websites/'+id;\n\t\trequest(url,function(err,resp,body){\n\t\t\t\tvar pageObject = parseBody(id,body);\n\t\t\t\tresolve(pageObject);\n\t\t});\n\n\t});\n}", "function loadContent() {\n// accessing the DOM by means of id-myApp (shell HTML page)\n var contentDiv = document.getElementById(\"myApp\"),\n //remove the # symbol from location hash and store the value in fragmentId\n fragmentId = location.hash.substr(1);\n // function call to getcontent\n getContent(fragmentId, function (content) {\n // call back \n // replace the content into Shell HTML\n contentDiv.innerHTML = content;\n });\n // On Load of shopping module \n if (fragmentId === \"shop\") {\n // function call to getFurnitureData - For function body, refer to shoppingList.js\n getFurnitureData();\n }\n}", "function fetchPage(page) {\n /*fetchPage nome da função (parametros que quero receber (page)) */\n /* const cria uma constante (content) pode ser qualquer nome */\n const content = $(\"#mainContent\");\n fetch(page)\n /* Função do js (pegar) */\n .then((resp) => resp.text())\n .then((rawPage) => content.html(rawPage)); /* pegar page */\n}", "function loadPage(href, history) {\n const pathName = getPathName(href);\n const { template, title, type } = routes[pathName];\n\n // already here, nothing to do\n if (!history && pathName === window.location.pathname) return;\n\n // render page content html\n renderContent(template, html => {\n\n // get full page title string\n const pageTitle = `Robert Dale Smith | ${title}`;\n\n // update history state only on loads not coming from browser back/forward\n if (!history) window.history.pushState({ pathName, pageTitle }, pageTitle, `${pathName}`);\n\n // update the page title\n document.title = pageTitle;\n\n // update content html\n document.querySelector('.content').innerHTML = html;\n\n // scroll to top of page/content\n if (!history) {\n if (pathName === '/') {\n // scrolls to top of home page\n document.scrollingElement.scrollTo(0, 0);\n } else {\n // scrolls to top of new page content and offset a bit\n const y = document.querySelector('.content').offsetTop;\n document.scrollingElement.scrollTo(0, y - 24);\n }\n }\n\n // set page type class\n document.querySelector('.page').className = `page ${type}`;\n\n // bind new viewer images\n viewer.bindImages('.thumbnail');\n\n // bind new page links\n bindLinks();\n\n // track page view\n ga.pageView(pathName);\n });\n}", "function initPage() {\n $.get('/api/headlines?saved=true').done((data) => {\n articleContainer.empty();\n\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "function loadPage(url, get = {}, post = {}, options = {}) {\n\toptions = {\n\t\t...{\n\t\t\tfill_main: true,\n\t\t\tcache: true\n\t\t},\n\t\t...options\n\t};\n\n\t// Ci sono casi in cui non è possibile cachare il template\n\tif (currentPageDetails.type === 'Custom' || Object.keys(post).length)\n\t\toptions.cache = false;\n\n\tif (options.fill_main) {\n\t\tif (!checkBeforePageChange())\n\t\t\treturn false;\n\n\t\tclearMainPage();\n\n\t\tpageLoadingHash = url + JSON.stringify(get) + JSON.stringify(post);\n\t}\n\n\tlet cacheKey = url + '?' + queryStringFromObject(get);\n\n\treturn (new Promise((resolve, reject) => {\n\t\tif (options.cache) {\n\t\t\tif (cachedPages.get(cacheKey))\n\t\t\t\treturn resolve(cachedPages.get(cacheKey));\n\t\t}\n\n\t\tajax(url, get, post).then(resolve).catch(reject);\n\t})).then((function (hash) {\n\t\treturn function (response) {\n\t\t\tif (options.fill_main && hash !== pageLoadingHash)\n\t\t\t\treturn false;\n\n\t\t\tif (options.cache)\n\t\t\t\tcachedPages.set(cacheKey, response);\n\n\t\t\tif (options.fill_main) {\n\t\t\t\t_('main-loading').addClass('d-none');\n\t\t\t\t_('main-content').jsFill(response);\n\n\t\t\t\tif (window.resetAllInstantSearches)\n\t\t\t\t\tresetAllInstantSearches();\n\n\t\t\t\tresize();\n\t\t\t\treturn changedHtml().then(() => {\n\t\t\t\t\treturn response;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t})(pageLoadingHash));\n}", "function loadHomePage(){\n\tloadNavbar();\n\tloadJumbotron();\n\tgenerateCarousels();\t\n}", "function chargerPage(obj) {\n\tvar xhttp = new XMLHttpRequest();\n\txhttp.onreadystatechange = function() {\n\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\tdocument.getElementById(\"content\").innerHTML = this.responseText;\n\t\t}\n\t};\n\t//Ouvrir le contenu correspondant au boutton cliqué\n\txhttp.open(\"GET\", \"fs_\"+$(obj).html().toLowerCase()+\".php\", true);\n\txhttp.send();\n\t//Bien placement le contenu en dessous du menu horizontal\n\t$(\"#content\").css(\"margin-top\",$(\".menu-horizontal\").height()+10);\n\t//Placer le footer en bas de la page\n\t$(\"footer\").css(\"position\",\"relative\");\n\t\n}", "function loadContent(url, back_forward) {\r\n\t$(\"#loader\").show();\r\n\t\r\n\tvar search_timestamp = getQueryVariable(\"timestamp\", url);\r\n\t\r\n\tif (cached_data.hasOwnProperty(url) == 1) {\r\n\t\tupdateContent(cached_data[url], search_timestamp, back_forward);\r\n\t} else {\r\n\t\t$.ajax({\r\n\t\t\turl: domain + \"content\",\r\n\t\t\tdataType: \"json\",\r\n\t\t\tdata: {id: cleanURL(url)},\r\n\t\t\tasync: true,\r\n\t\t\tsuccess: function(content) {\r\n\t\t\t\tif ($.parseJSON(content.Cache) === true) {\r\n\t\t\t\t\tcached_data[url] = content;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tupdateContent(content, search_timestamp, back_forward);\r\n\t\t\t},\r\n\t\t\terror: function(xhr, textStatus, error) {\r\n\t\t\t\twindow.location.href = url;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "function loadModuleEditorPage() {\n\tMM.BC.TOKENS.getOneTimeToken(MM.BC.SITE.getSiteID(), function (oneTimeToken) {\n\t\tvar completeUrl = MM.BC.UTILS.generateURL(globals.targetURL, oneTimeToken);\n\n\t\tbrowseTo(completeUrl, true, function() {\n\t\t\tonModuleEditorLoad()\n\t\t}, false);\n\t}, function(status) {\n\t\t//MM.BC.log('loadModuleEditorPage##error##showCallFailed', true);\n\t\tshowCallFailed();\n\t}, true);\n}", "function handleNavigation(){\r\n document.body.scrollTo({ y: 0 });\r\n var path = window.location.pathname;\r\n var hash = window.location.hash ? window.location.hash.substr(1) : '';\r\n \r\n getPage(path).then($html => {\r\n // remove old content\r\n while ($content.firstChild)\r\n $content.removeChild($content.firstChild);\r\n \r\n // add new content\r\n $content.appendChild($html);\r\n\r\n // update UI\r\n updateUi(path, hash);\r\n });\r\n}", "function test() {\n\tlog('page loaded');\n\tloadData();\n}", "function initPage() {\n $.get('/api/headlines?saved=false').done((data) => {\n articleContainer.empty();\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "function get_page_data() {\n socket.emit('get_page_data', {data: ''});\n //call server to tell we want all data, so we can fill the ui (normally done once on full page load/refresh)\n}", "function pagehtml(){\treturn pageholder();}", "function loadSidebar() {\n $.ajax({\n type: \"GET\",\n url: \"loadvideos.php\",\n dataType: \"html\",\n success: function(response){\n sidebarContent(response);\n }\n });\n}", "function loadTabletTankPage() {\n\t$.ajax({\n\t\turl: '/atlantazoo/admin/tablettank/',\n\t\ttype: 'GET',\n\t\tdataType: 'html',\n\t\tsuccess: function(data) {\n\t\t\t$('#current-content').html($(data).find('#mpAdminTabletTank').html());\n\t\t\tfetchTankList();\n\t\t}\n\t});\n}", "function pageLoad() {\n\t\t\t\t\twindow.location.assign(\"blue.html\");\n\t\t\t\t}", "function getAllCoupons_page() {\r\n\t// load the page into the #content\r\n\t$(document).ready(function() {\r\n\t\t$('#content').load('html_files/company_html/getAllCoupons.html');\r\n\t});\r\n\t// run the function\r\n\t$(document).ready(function() {\r\n\t\tgetAllCoupons();\r\n\t});\r\n} // getAllCoupons_page", "function loadContent(loadURL, target, callback) {\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : loadURL,\n\t\tcache : false,\n\t\tsuccess : function(returndata) {\n\t\t\tif (target) {\n\t\t\t\t$(target).html(returndata);\n\t\t\t}\n\t\t\tif (callback) {\n\t\t\t\tsetTimeout(callback, 15, target, returndata);\n\t\t\t}\n\t\t}\n\t});\n}", "function loadPageContent(pageCounter) {\r\n\t// If the end of the pages array hasn't been reached\r\n\tif (pageCounter < pages.length) {\r\n\t\t// Load the corresponding page HTML and CSS in to the page div and call the next page to be loaded in\t\t\r\n\t\t$(function(){\r\n\t\t\t$(pages[pageCounter].div).load(\"/pages/\"+pages[pageCounter].name+\"/index.html\", function() {\r\n\t\t\t\t// If this was the first page to be loaded\r\n\t\t\t\tif (pageCounter == 0) {\r\n\t\t\t\t\t// Load any partner content for the first site\r\n\t\t\t\t\tloadPartnerContent();\r\n\t\t\t\t\t// Hide the screen and reveal the front page\r\n\t\t\t\t\trevealFirstPage();\r\n\t\t\t\t\t// Reveal all the pages so that they can load in the background\r\n\t\t\t\t\t$(\".page\").show();\r\n\t\t\t\t}\r\n\t\t\t\t// Load the following page \r\n\t\t\t\tloadPageContent(pageCounter+1);\r\n\t\t\t});\r\n\t\t});\r\n\t} else {\r\n\t\t// Once all the pages have been loaded, load in the partner content for all the other pages\r\n\t\tloadPartnerContent();\r\n\t}\r\n}" ]
[ "0.76424915", "0.75014704", "0.7368423", "0.7292615", "0.7292615", "0.7173784", "0.69401383", "0.68732727", "0.6820539", "0.6791587", "0.67512095", "0.6724946", "0.66861457", "0.66814", "0.6652175", "0.6623395", "0.6582385", "0.65757805", "0.657302", "0.656681", "0.65354306", "0.6534184", "0.65228987", "0.6521532", "0.6512533", "0.6486387", "0.64698184", "0.6462119", "0.6449588", "0.64392066", "0.6438972", "0.6438727", "0.6418656", "0.6412818", "0.64117557", "0.6405916", "0.6376603", "0.63557905", "0.6351899", "0.6347543", "0.6339481", "0.6318071", "0.6311378", "0.63066405", "0.6300558", "0.6295101", "0.6281503", "0.62711185", "0.6260026", "0.624476", "0.6222384", "0.6218876", "0.62142015", "0.6206953", "0.61988246", "0.619641", "0.618039", "0.6174918", "0.61712873", "0.61539376", "0.61517715", "0.6142852", "0.61418504", "0.61362636", "0.61124206", "0.6108157", "0.610211", "0.61013067", "0.609692", "0.60945266", "0.60920256", "0.608686", "0.6086223", "0.6084143", "0.60778093", "0.60686034", "0.6063587", "0.6062392", "0.60587", "0.60551924", "0.6050983", "0.6048303", "0.6047914", "0.60316515", "0.6030787", "0.6021196", "0.60127586", "0.60099494", "0.60087186", "0.5996923", "0.59911", "0.59847325", "0.5981583", "0.5978548", "0.5978244", "0.5975724", "0.59743536", "0.59725654", "0.59718734", "0.5971446", "0.5969586" ]
0.0
-1
fades in main screen
function loadScreen() { if(window.matchMedia('(max-width: 768px)').matches) { $('#borgar').css('display', 'block'); $('#cancel').css('display', 'block'); } else { $('#text-toggle').css('display', 'block'); } $('.main').css("animation", "changeBg 1s ease"); $('#main-title').css("animation", "fadeEffectIn 1s ease"); $('#password').css("animation", "fadeEffectOut 1s ease"); $('#link-form').css("animation", "fadeEffectIn 1s ease"); $('#glitch1').css("animation", "fadeEffectOut 1s ease"); $('#videoPlayer').show(); $('#videoPlayer').css("animation", "fadeEffectIn 1s ease"); $('#videoPlayer').animate({maxHeight: "800px"}, 1000); $('#link-form').css("animation", "fadeEffectIn 1s ease"); $('#link-form').animate({maxHeight: "800px"}, 1000); $('#link-form').css('display', 'flex'); setTimeout(function(){ $('.main').css("background-color", "rgba(0,0,0,0)"); $('#main-title').css("opacity", "1"); $('#main-title').css("animation", ""); $('#password').css("display", "none"); $('#link-form').css("opacity", "1"); $('#link-form').css("animation", ""); $('#link').focus(); $('#glitch1').css("opacity", "0"); $('#videoPlayer').css("animation", ""); $('#videoPlayer').css("opacity", "1"); $('#glitch1').css("animation", ""); }, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnToMain(){\n teleMode = false;\n console.log('reutrn to main');\n fadeAll();\n game.time.events.add(500, function() {\n game.state.start('startScreen');\n }, this);\n}", "function unlockScreen() {\r\n\t\tvar del = function () {\r\n\t\t\t$(\"#lockScreen\").remove();\r\n\t\t};\r\n\r\n\t\t$(\"#lockScreen\").fadeOut(del);\r\n\r\n\t\tdel = null;\r\n\t}", "function returnToMainScreen() {\n if ($percCookieSiteTable.fnClearTable !== undefined) {\n $percCookieSiteTable.fnClearTable();\n }\n $('.cookie-consent-site-stats').hide();\n $('#delete-btn-site').hide();\n $('#delete-btn-all').show();\n $('#advanced').addClass('collapse');\n $('#advanced').removeClass('in');\n isAdvancedDisplayed = false;\n miniMsg.dismissMessage(loadingMsg);\n adjustIframeHeight($percCookieTable);\n mainHTML.show();\n }", "function mainScreen() {\n startSplash(ctx);\n startBox.draw(ctx);\n \n }", "function homepageUnwaste() {\n getActivity();\n activityInfoAnimation();\n setTimeout(gifContainerAnimation, 300);\n toggleHide();\n toggleShow();\n alterUnwasteBtnAction();\n}", "function mainDemoAbort() {\n \tcurrentPos = 0; \t\t\t\t\t\t\t\t\t\t// Reset demo schedule (For when it restarts)\n \tcurrentPart.loop = false;\t\t\t\t\t\t\t\t// Switch off demo animation loop\n \tnextButton.style.opacity = \"0\"; \t\t\t\t\t\t// Hide \"any key\" button\n \tnextButton.style.cursor = \"default\"; \n nextButton.removeEventListener('mousedown', spaceBar);\t// Remove any events associated with \"Any key\" button.\n nextButton.removeEventListener('touchend', spaceBar);\n \tmusic_Sashy.stop();\t\t\t\t\t\t\t\t\t\t// Stop the main music\n \tdefDemo.next();\t\t\t\t\t\t\t\t\t\t\t// Go to the next part (Credits screen).\n }", "function onAccelBack(){\n console.log('Close Screen and Stop Loop');\n inNoiseMon = false;\n CountScreen.hide();\n main.hide();\n}", "function dimScreen() {\n document.querySelector('.loader').style.display = 'block';\n document.querySelector('.dimmer').style.display = 'block';\n document.querySelector('.image').style.display = 'none';\n document.querySelector('.hidden').style.display = \"none\";\n nextImageButton.disabled = true;\n previousImageButton.disabled = true;\n setTimeout(undimScreen, 1000);\n}", "exitFullScreen() {\n }", "exitFullScreen() {\n }", "exitFullScreen() {\n }", "function backToMenuFromGame()\r\n\t\t{\r\n\t\t\tresetMatch();\r\n\t\t\tcancelAnimationFrame(requestId);\r\n\t\t\tdocument.getElementById('canvasSpace').style.display = \"none\";\r\n\t\t\tdocument.getElementById('menuInGame').style.display = \"none\";\r\n\t\t\tdocument.getElementById('settings').style.display = \"none\";\r\n\t\t\tdocument.getElementById('menu').style.display = \"initial\";\r\n\t\t}", "function back() {\n 'use strict';\n\n welcomeScreen.style.display = 'block';\n gameScreen.style.display = 'none';\n endScreen.style.display = 'none';\n reset();\n}", "function rippleback()\n{\n kony.print(\"\\n**********in rippleback*******\\n\");\n frmHome.show();\n}", "function doPause() {\n console.log('doPause()');\n\t\t\t\t\t\tM2AS.indicator.set(0);\n\t\t\t\t\t\tblackberry.app.setHomeScreenIcon(\"local:///images/icono_BB64.png\"); \n\t\t\t\t\t\tisFlagForeground = false;\n }", "function flash() {\n if (front.style.visibility != \"hidden\") {\n front.style.visibility = \"hidden\";\n back.style.visibility = \"visible\";\n } else {\n front.style.visibility = \"visible\";\n back.style.visibility = \"hidden\";\n }\n }", "function goPracticeMode() {\n $(\"#page_login\").fadeOut();\n $(\"#practice_board\").fadeIn();\n $(\"#backto_multi\").fadeIn();\n\t$(\"#single_mode\").fadeOut();\n}", "function LeaveStandalone()\n\t{\n\t\tif(m_should_back_out){\n\t\t\tm_should_back_out = false;\n\t\t\thistory.back();\n\t\t}\n\t\telse{\n\t\t\tHide();\n\t\t}\n\t}", "function startScreen() {\n if (loggedIn === false) {\n resetButton.classList.add(\"hidden\");\n easy.classList.add(\"hidden\");\n medium.classList.add(\"hidden\");\n hard.classList.add(\"hidden\");\n signupBtn.style.display = \"block\";\n loginBtn.style.display = \"block\";\n } else if (loggedIn === true) {\n resetButton.classList.remove(\"hidden\");\n easy.classList.remove(\"hidden\");\n medium.classList.remove(\"hidden\");\n hard.classList.remove(\"hidden\");\n }\n }", "function Home(){\r\n Restart();\r\n document.getElementById(\"homeFrame\").style.display= \"\";\r\n document.getElementById('betting').style.display=\"none\";\r\n document.getElementById('mainContent').style.display = \"none\";\r\n}", "function actionOnClickBack() {\n\t\t\t//alert('Saldras de la carrera');\n\t\t\tgame.state.start('mainMenuState')\n\t\t}", "function tl_start() {\n $('#futureman_face, #menu-open').css('display', 'inherit');\n $('.menu-open').css('visibility', 'inherit');\n }", "function hideMainScreen() {\n\t$(\"#main\").addClass(\"hidden\");\n}", "function flyToHome() {\r\n $('#main').data('clicked', true);\r\n toggleSvgButton('#main', true);\r\n\r\n closePanel2();\r\n\r\n let selectedAsset = main;\r\n onPickedAsset(selectedAsset);\r\n }", "function endGame() {\n $('.home').css({ 'margin-top': '0px' });\n disappear('.instructions');\n hide('.view-button');\n disappear('.follow-circle');\n disappear('.instructions');\n state = \"view\";\n }", "function showMainScreen() {\n display.set(\"mainScreen\").show();\n }", "enterFullScreen() {\n }", "enterFullScreen() {\n }", "enterFullScreen() {\n }", "function draw_mainScreen() {\n \tif ( defaultTrue( currentPart.main ) )\t\t// If we're showing the main screen\n \t\t{\n\t \t\tmainScreen.clear(); \t\t\t\t\t// ... clear it.\n\t \t\tmainScreen.show();\n \t\t} \n \telse\n \t\tmainScreen.hide();\t\t\t\t\t\t// Otherwise, hide it.\n }", "function fndisapWindow(){\r\n Effect.fadeOut(windowObj);\r\n Effect.setOpacity(parentWindow, 1);\r\n// objTurn.innerHTML=intTurnNO;\r\n// fnresetmemberStatus();\r\n}", "function returnToMainMenu() {\r\n\r\n // Reset the game state. \r\n resetGameState();\r\n\r\n // End game flag.\r\n gameHasStarted = false;\r\n\r\n // Reload main menu.\r\n startUp();\r\n}", "function backHome() {\n leaderboardScreen.style.display = 'none';\n homeScreen.style.display = 'block';\n endQuiz.style.display = 'none';\n quizPrompts.style.display = 'none';\n timer.style.visibility = 'hidden';\n}", "function FADER() {\n $('.FADE').hide(0).delay(500).fadeIn(500);\n console.log('done');\n }", "proceed()\n\t{\n\t\tthis.musicScreen.setYTinfo(this.menuScreen.hasYTinfo())\n\t\tthis.musicScreen.init(this.url,this.gif_set)\n\t\t\n\t\tthis.menuScreen.hide()\n\t\tthis.musicScreen.show()\n\t}", "desbloquearTela() {\n $.unblockUI();\n }", "function doResume() {\n console.log('doResume()');\n\t\t\t\t\tM2AS.indicator.set(0);\n\t\t\t\t\tblackberry.app.setHomeScreenIcon(\"local:///images/icono_BB64.png\"); \n\t\t\t\t\tisFlagForeground = true;\n }", "function crash(){\n\t\t$(\".mach\")\n\t\t.animate({opacity: 0.5},200)\n\t\t.animate({opacity: 1},200)\n\t\t.animate({opacity: 0.5},200)\n\t\t.animate({opacity: 1},200)\n\t\t.animate({opacity: 0.5},200);\n\t\tsetTimeout(romper, 1000);\n\n\t}", "function cerrar_principal() {\n\t\tdocument.getElementById(\"first-page\").style.display = \"none\";\n\t\tdocument.getElementById(\"overlay_bienvenida\").className = \"\";\n\t}", "function screenFlash() {\n\t\tbooFlash = !booFlash;\t\t\n\t\tif ( booFlash ) {\n\t\t\t$(\"#alarm\").css(\"background\",\"orange\");\t\n\t\t} else {\n\t\t\t$(\"#alarm\").css(\"background\",\"red\");\t\n\t\t}\n\t\tif ( booFault ) {\t\t\n\t\t\tsetTimeout(screenFlash,500);\n\t\t}\n\n\t}", "function moveToTrivia(){\n $('#landing').animate({opacity: '-=1'}, 400, function(){$('#landing').css('display', 'none')});\n $('main').css('display', 'block'); \n }", "function fullScreenClick(){\r\n if (game.scale.isFullScreen)\r\n {\r\n game.scale.stopFullScreen();\r\n }\r\n else\r\n {\r\n game.scale.startFullScreen(false);\r\n }\r\n}", "function onlineToMain() {\n\t$('#mainBox').css({'width':'500px','height':'200px'});\n\t$('#onlineMenu').delay(100).hide(0); \n\t$('#mainMenu').delay(200).show(0).delay(200); //delay is used to wait for animation\n}", "function userStart() {\n document.querySelector(\"#home\").removeEventListener(\"click\", userStart);\n document.querySelector(\"#welcome\").classList.remove(\"hide\");\n document.querySelector(\"#welcome\").addEventListener(\"click\", scene1tr);\n}", "function loginShow(){\n\tdisableScrolling();\n\t$('#header').hide();\n\t$('#splashscreen').remove();\n\t$('#login').show();\t\n}", "_backToMainAccount() {\n this._closeMenu();\n AuthActions.backToMainAccount();\n }", "function end () {\n //the page goes white\n $('body').css({\n backgroundColor: 'white',\n });\n $('#canvas').css({\n visibility: 'hidden',\n });\n\n //the final package downloads\n window.open('https://whogotnibs.github.io/dart450/assignment02/downloads/package03.zip', '_blank');\n\n //the game functions stop running\n end = true;\n\n //the music stops\n Gibber.clear();\n}", "function home_fadein(){\n\t$('body').fadeIn(1300);\n}", "function exitFullscreen () {\n\n if ( document.exitFullscreen ) {\n\n document.exitFullscreen();\n\n } else if ( document.webkitExitFullscreen ) {\n\n document.webkitExitFullscreen();\n\n } else if ( document.webkitCancelFullScreen ) {\n\n document.webkitCancelFullScreen();\n\n } else if ( document.mozCancelFullScreen ) {\n\n document.mozCancelFullScreen();\n\n } else if ( document.msExitFullscreen ) {\n\n document.msExitFullscreen();\n\n }\n\n // Restore the Ui\n\n showControlPanel();\n\n }", "function exitFullScreen() {\n var cancelFullScreen = \n document.exitFullscreen ||\n document.webkitExitFullscreen ||\n document.mozCancelFullScreen;\n cancelFullScreen.call(document);\n $(\".slide\").removeClass(\"active slide-fullscreen\");\n $(\"header\").show();\n $(\".fetch-presentation\").show();\n $(\"footer\").show();\n $('.share-buttons').show();\n zoomOutSlide();\n }", "function failScreen() {\n image(introScreenBackground, 0, 0);\n\n push();\n noStroke();\n noFill();\n rect(275, 310, 340, 75);\n pop();\n\n rainRun();\n\n lightningGenerator();\n\n animation(huntAgainAnim, 450, 350);\n\n animation(brokenMaskAnim, 450, 170);\n}", "killMenu() {\n isReady = false;\n API.showCursor(false);\n API.setHudVisible(true);\n API.setChatVisible(true);\n API.setCanOpenChat(true);\n API.callNative(\"_TRANSITION_FROM_BLURRED\", 3000);\n }", "function faceClick_first() {\n document.face.src = faceWait.src;\n numMoves = 0;\n closeAllMenus();\n clockStop();\n clockClear();\n makeBoard();\n clearBoardImages(); \n forceFocus();\n dead = false;\n win = false;\n openRemainingUsed = false;\n document.face.src = faceSmile.src;\n return false;\n }", "function teardownFade() {\n fader.removeClass('show fadeOut');\n }", "function lvlScreen(){\n\tconsole.log('lvlScreen');\n\tdocument.removeEventListener('keydown', enter, false);\n\tdisplayInstruct = false;\n\tbackgroundCtx.clearRect(0, 0, backgroundCan.width, backgroundCan.height);\n}", "function preloadFadeOut() {\n $(\".top__menu-btn-sandwich\").click(); \n fOnLoaderComplete();\n}", "onEnterBack() {\n state.glassBottle.alpha = 0;\n clear(state.ctx.glassBottle);\n }", "onEnterBack() {\n state.glassBottle.alpha = 0;\n clear(state.ctx.glassBottle);\n }", "function pauseGame()\n {\n toMenu();\n }", "function menuScreen() {\n if (currentPage === 'highscorepage') {\n $box2.animate({left: $screenWidth}, 150); // slides highscorepage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'creditspage') {\n $box3.animate({left: $screenWidth}, 150); // slides creditspage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else {\n $box1.animate({left: $screenWidth}, 150); // slides playpage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n }\n currentPage = 'menupage';\n }", "function startAction() {\n\n overlay.style.display = 'none';\n introduction.style.display = 'none';\n actionCleanup();\n startGame();\n\n}", "function onAccelBack(){\n console.log('Close Screen and Stop Loop');\n inWristCount = false;\n CountScreen.hide(); \n}", "function creditsScreen() {\n $box3.animate({left: 0}, 150); // moves the screen into the main container display\n currentPage = 'creditspage';\n }", "function goHome(){\n ctx.clearRect(0,0,canvas.width,canvas.height)\n gameFrontPage()\n gameEnd.style.display = \"none\";\n frontPage.style.display = \"block\";\n}", "function dismiss() {\n $.background.animate({\n opacity: 0,\n duration: animationSpeed\n }, () => {\n // Second parameter for the animation is the callback when it is done\n // In this case we're closing the window after menu has faded away\n $.getView().close();\n });\n\n menuWrapper.animate({\n left: -menuWidth,\n duration: animationSpeed\n });\n}", "function navigateGo() {\n $('.screen').hide();\n // $(\".screen button\")\n // .on(\"transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd\",\n // function(e){\n // $('.screen .'+whichButton).removeClass('activated');\n // $('.screen button').show();\n // $('.screen').hide();\n // $(this).off(e);\n // });\n if(currentScreen !== \"screen-home\") {\n $('.' + currentScreen).show();\n }\n $('.order-current').hide();\n $('.lock-current').hide();\n}", "startMainMenu()\n {\n // We check if the player is on mobile and open fullscreen\n let os = theGame.device.os;\n if(os.android || os.iOS || os.iPad || os.iPhone || os.windowsPhone)\n {\n openFullScreen();\n }\n \n let gameCredits;\n let goat = currentScene.add.image(-100, topBackgroundYOrigin+35, 'GoatMenu');\n let fondo2 = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Fondo2');\n fondo2.visible = false;\n let logo = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Logo');\n //logo.visible = false;\n \n // Start Btn\n let startBtn = currentScene.add.image(topBackgroundXOrigin-40, topBackgroundYOrigin+125, 'StartBtn');\n let startHigh = currentScene.add.image(topBackgroundXOrigin-40, topBackgroundYOrigin+125, 'StartHigh');\n startBtn.setInteractive();\n startBtn.on('pointerover', ()=> this.onMenuBtnInteracted(startHigh, true));\n startBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(startHigh, true));\n startBtn.on('pointerup', ()=> this.onMenuBtnInteracted(startHigh, false));\n startBtn.on('pointerout', ()=> this.onMenuBtnInteracted(startHigh, false));\n startBtn.on('pointerup', ()=> interacionManager.interactMenu(\"Start\"));\n\n startBtn.visible = false;\n startHigh.visible = false;\n\n // Continue Btn\n let continueBtn = currentScene.add.image(topBackgroundXOrigin-186, topBackgroundYOrigin+128, 'ContinueBtn');\n let continueHigh = currentScene.add.image(topBackgroundXOrigin-186, topBackgroundYOrigin+128, 'ContinueHigh');\n continueBtn.setInteractive();\n continueBtn.on('pointerover', ()=> this.onMenuBtnInteracted(continueHigh, true));\n continueBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(continueHigh, true));\n continueBtn.on('pointerup', ()=> this.onMenuBtnInteracted(continueHigh, false));\n continueBtn.on('pointerout', ()=> this.onMenuBtnInteracted(continueHigh, false));\n continueBtn.on('pointerup', ()=> interacionManager.interactMenu(\"Continue\"));\n\n continueBtn.visible = false;\n continueHigh.visible = false;\n\n // Credits Btn\n let creditsBtn = currentScene.add.image(topBackgroundXOrigin-308, topBackgroundYOrigin+128, 'CreditsBtn');\n let creditsHigh = currentScene.add.image(topBackgroundXOrigin-308, topBackgroundYOrigin+128, 'CreditsHigh');\n creditsBtn.setInteractive();\n creditsBtn.on('pointerover', ()=> this.onMenuBtnInteracted(creditsHigh, true));\n creditsBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(creditsHigh, true));\n creditsBtn.on('pointerup', ()=> this.onMenuBtnInteracted(creditsHigh, false));\n creditsBtn.on('pointerout', ()=> this.onMenuBtnInteracted(creditsHigh, false));\n creditsBtn.on('pointerup', ()=> enableCredits(this.gameCredits, true));\n\n creditsBtn.visible = false;\n creditsHigh.visible = false;\n\n // Mute Btn\n let muteBtn = currentScene.add.image(topBackgroundXOrigin-395, topBackgroundYOrigin+128, 'MenuMuteBtn');\n let muteHigh = currentScene.add.image(topBackgroundXOrigin-395.9, topBackgroundYOrigin+128, 'MenuMuteHigh');\n muteBtn.setInteractive();\n muteBtn.on('pointerover', ()=> this.onMenuBtnInteracted(muteHigh, true));\n muteBtn.on('pointerdown', ()=> this.onMenuBtnInteracted(muteHigh, true));\n muteBtn.on('pointerup', ()=> this.onMenuBtnInteracted(muteHigh, false));\n muteBtn.on('pointerout', ()=> this.onMenuBtnInteracted(muteHigh, false));\n muteBtn.on('pointerup', ()=> interacionManager.interactMenu(\"Mute\"));\n\n muteBtn.visible = false;\n muteHigh.visible = false;\n\n let timeline = currentScene.tweens.createTimeline();\n\n timeline.add(\n {\n targets: goat,\n x: topBackgroundXOrigin + 175,\n duration: 900\n }\n );\n\n timeline.add( \n {\n targets: fondo2,\n onStart: function()\n {\n fondo2.visible = true;\n let timedEvent = currentScene.time.delayedCall(1300, function()\n {\n musicManager.playThemeSong('Main');\n startBtn.visible = true;\n continueBtn.visible = true;\n creditsBtn.visible = true;\n muteBtn.visible = true;\n\n } , currentScene);\n } \n } \n );\n timeline.play(); \n this.gameCredits = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'GameCredits');\n this.gameCredits.setInteractive();\n this.gameCredits.on('pointerdown', ()=> enableCredits(this.gameCredits, false));\n this.gameCredits.visible = false;\n }", "function switchSettings2Back() {\n /* Reset Focus */\n Draw.resetFocus();\n }", "function maskDesktop() {\n\t\tExt.getBody().mask(i18n.get(\"label.loadingSitools\"));\n\t\tExt.get(\"ux-taskbar\").hide();\n\t}", "function updateWelcomeScreen () {}", "function slideRest(){\n cpCmndTOCVisible = false;\n cp.show(pauseID);\n stayMute(); \n }", "function CreditstoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'CREDITS' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n\n setTimeout(function(){\n credits.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n }, 600);\n\n setTimeout(function(){\n mainMenuCreditsButtonid.classList.remove('nodisplay');\n mainMenuStartButtonid.classList.remove('nodisplay');\n }, 1400);\n\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\n mainMenuStartImageid.classList.add('main-menu-start-image');\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\n }\n }", "function surfSaferFocus() {\n bBounchingAnimationStop = true;\n bDiscoveryMsgDisplay = false;\n\n // Call discovery center function to show / hide discovery msg\n show_Discovery_Center_Changes();\n\n // Collapse all other section except Surf safer\n clearCollapse(\"surfsafer\");\n surfSaferExpand();\n\n // Show Surf safer content section \n $(\"#divImgSurfSafelyContent\").stop(true, true).fadeTo(550, 1);\n $(\"#divImgSurfSafelyContent\").css({\n transform: 'scale(1.0)',\n display: 'block'\n });\n\n $(\"#divDiscoverySection\").css({\n display: 'none'\n });\n }", "function dismissLoadingScreen()\n\n{\n\tkony.application.dismissLoadingScreen();\n\tkony.timer.cancel(\"timer4\");\n\tflag =0;\n\tflag1 =0;\n}", "function reset2(){\n button.hide();\n if (mouseButton == LEFT)\n {\n button.hide();\n input.hide();\n }\n screenThree();\n}", "function start() {\n\nopenScreen.style.display = \"none\";\nopenScreenPTag.style.display = \"none\";\nbutton.style.display = \"none\";\n}", "function gotoHome(){\n\t\t$('#session').hide();\n\t\t$('#container').show();\n\t\t//stop listening to accelerometer\n\t\tnavigator.accelerometer.clearWatch(watchID);\n\t}", "function loading() {\n\tloader.hidden = false;\n\tmain.hidden = true;\n}", "function close(){\n SplashScreen.hide();\n}", "async function off() {\n click();\n power(false);\n\n clear();\n await pause(2);\n return new Promise(async (resolve) => {\n // Logo\n let screen = await showTemplateScreen(\"logo\");\n\n await waitForKey();\n power(true);\n screen.remove();\n\n boot();\n resolve();\n });\n}", "function screen_abort() {\n var wf2d = window.frames[2].document;\n if ($('.pmc_screen', wf2d).length) {\n $('.pmc_screen', wf2d).remove();\n $('body', wf2d).children().each(function () {\n $(this).removeClass('hide-row');\n });\n }\n return false;\n}", "function flashEditor() {\n\t\tvar scrollTop = doc.body.scrollTop || doc.documentElement.scrollTop;\n\t\tvar bodyClass = doc.body.className;\n\t\tvar editorOpacity = editor.style.opacity;\n\t\tvar editorTransform = editor.style.transform;\n\t\tdoc.body.className = 'edgeview';\n\t\teditor.style.transform = 'none';\n\t\teditor.style.opacity = '1';\n\t\teditor.style.zIndex = '-1';\n\t\t\tsetTimeout(function() {\n\t\t\t\tdoc.body.className = bodyClass;\n\t\t\t\teditor.style.transform = editorTransform;\n\t\t\t\teditor.style.opacity = editorOpacity;\n\t\t\t\teditor.style.zIndex = '5';\n\t\t\t\twindow.scrollTo(0, scrollTop);\n\t\t\t}, 30);\n\t}", "function fullscreen() {\n $(\"#blurGlass\").attr(\"class\", \"blurGlassOn\");\n $(\"#loginpage\").css({\"display\":\"block\"});\n $(\"#loginpage\").css({\"animation\":\"fadeIn .6s both\"});\n \n $(\".logincanvas-logo\").css({\"animation\":\"flipInX .6s .3s both\"});\n $(\".logincanvas-note\").css({\"animation\":\"bounceIn .6s .4s both\"});\n $(\".logincanvas-loginbox\").css({\"animation\":\"flipInX .6s .5s both\"});\n $(\".logincanvas-button\").css({\"animation\":\"bounceIn .6s .9s both\"});\n}", "function letIt()\r\n\t{\r\n\t\theader.removeClass('mw-harlem_shake_me im_first');\r\n\t\t$(\"#logo a\").attr(\"href\",\"http://www.jeuxvideo.com/\").attr(\"target\",\"_self\");\r\n\t}", "function startGameHandler()\n{\n introScreen.style.display = \"none\";\n gameScreen.style.display = \"block\";\n}", "function handleSplashScreen() {\n\t$(\"#splash\").addClass(\"animated\");\n\t$(\"#splash-wrapper\").css(\"opacity\", \"0\");\n\tsetTimeout(() => { $(\"#splash-wrapper\").addClass(\"hidden\") }, 500);\n}", "function bringBackContent() {\n bringBack2.hidden = true;\n bringBack.hidden = false;\n livesFinished.hidden = false;\n bringBack.addEventListener(\"click\", function(){\n window.location.reload(false)\n });\n}", "function mytoggleFullScreen(){\n\t\tif(full_screen==true){\n\t\t\t$(\"#full_screen_bt\").html(\"fullscreen_exit\");\n\t\t\tfull_screen=false;\n\t\t}\n\t\telse{\n\t\t\t$(\"#full_screen_bt\").html(\"fullscreen\");\n\t\t\tfull_screen=true;\n\t\t}\n\t}", "function unloadFTUX () {\n //Hide FTUX\n $(\"#ftux\").fadeOut();\n //Show everything!\n $(\"#sidebar\").css(\"left\", \"0px\");\n $(\"#project-settings, #printConsoleTitle, #printConsole .alert, #printConsole .panel\").fadeIn();\n $(\"#viewStatusNav\").removeClass(\"hide\");\n }", "function fecharGaleriaFullScreen(){\r\n \r\n console.log(\"FECHANDO GALERIA\");\r\n $(\".galeria-full-screen\").fadeOut(500);\r\n \r\n // GARANTIR QUE ELA ESTARÁ LIMPA NO MOMENTO DA INICIALIZAÇÃO\r\n $('#galeriaFullScreen').html(\"\");\r\n $('#galeriaFullScreen').trigger('destroy.owl.carousel');\r\n \r\n}", "function startGame() {\n $(\".landing-menu\").hide();\n $(\".game-section\").show();\n $(\".userButtons\").show();\n }", "function fullscreen() {\n $(\"#blurGlass\").attr(\"class\", \"blurGlassOn\");\n $(\"#loginpage\").css({\"display\":\"block\"});\n $(\"#loginpage\").css({\"animation\":\"fadeIn .6s both\"});\n\n $(\".logincanvas-logo\").css({\"animation\":\"flipInX .6s .3s both\"});\n $(\".logincanvas-note\").css({\"animation\":\"bounceIn .6s .4s both\"});\n $(\".logincanvas-loginbox\").css({\"animation\":\"flipInX .6s .5s both\"});\n $(\".logincanvas-button\").css({\"animation\":\"bounceIn .6s .9s both\"});\n}", "function switchScreen(hide, show) {\n $(hide).fadeOut(\"fast\", function() {\n $(window).scrollTop(0);\n $(show).fadeIn(\"fast\");\n });\n}", "function fadeOutMainMenu(){\n\n\n\tconst animationTiming = 800;\n\n\treturn new Promise((res,rej)=>{\n\t\t$('.mainMenu').css({\n\t\t\ttransition : `transform ${animationTiming}ms ease`,\n\t\t\ttransform : 'scale(.0001) rotate(15deg)'\n\t\t});\n\t\tsetTimeout(res,animationTiming);\n\t});\n\n\n}", "function reStartTheGame() {\n screenWin.classList.remove('screen-win-one', 'screen-win-two', 'screen-win-tie')\n player1.classList.add('active');\n screenWin.style.display = 'none';\n blankSlate();\n}", "function returnQuizApp()\n\t{\n document.getElementById(\"helpScreen\").style.display=\"none\";\n document.getElementById(\"quizScreen\").style.display=\"inline\";\n }", "function endMove(event) {\n current.win.style.opacity = 1;\n }", "function Back() {\n\tmainMenuController.GetComponent(MainMenu).MainMenu();\n}", "function celebrate(){\n\tsetTimeout(function(){\n\t\twinSound.play();\n\t}, 500);\t\t\n\n\tresetGame();\n\tdisplay(\"**\");\t\t\t \n\t$(\"#board div\").addClass(\"clickeffect\");\n\tsetTimeout(function(){\n\t\t$(\"#board div\").removeClass(\"clickeffect\");\n\t}, 3000);\t\t\n}", "function end() {\n menuScene.visible = false;\n musicPacmanBeginning.stop();\n soundPacmanIntermission.stop();\n// gameSceneLevel2.visible = false;\n gameSceneLevel1.visible = false;\n gameOverScene.visible = true;\n}", "function reset() {\n\t\t/**\n\t\t * TODO: create initial game start page and additional\n\t\t * \tinteractivity when game resets once understand more about\n\t\t * animation\n\t\t */\n\t}" ]
[ "0.7103427", "0.6596101", "0.6466205", "0.6418885", "0.6393926", "0.6377566", "0.63383716", "0.6335676", "0.63202995", "0.63202995", "0.63202995", "0.6299804", "0.62531453", "0.623728", "0.62296945", "0.6213353", "0.62061083", "0.61543113", "0.6142346", "0.6140613", "0.6129002", "0.6116793", "0.6101161", "0.6097324", "0.60944647", "0.60873497", "0.6082709", "0.6082709", "0.6082709", "0.60584575", "0.60475", "0.60437614", "0.60381585", "0.60162693", "0.6016015", "0.6014273", "0.6007135", "0.60035866", "0.59777695", "0.5974715", "0.5966554", "0.5964472", "0.5964222", "0.59563386", "0.59443736", "0.59380007", "0.5936236", "0.5924523", "0.59130096", "0.5911765", "0.590414", "0.58998805", "0.589139", "0.5883529", "0.5869876", "0.5869035", "0.5862994", "0.5862994", "0.58504856", "0.58493745", "0.58448607", "0.58432066", "0.58409536", "0.5836265", "0.58177847", "0.5816474", "0.58160347", "0.5814584", "0.5813137", "0.5806938", "0.5800975", "0.5799061", "0.5797749", "0.5795209", "0.57904404", "0.57837147", "0.5777358", "0.5773911", "0.57730025", "0.57724583", "0.5766918", "0.5766912", "0.57616156", "0.57614344", "0.57578397", "0.57534695", "0.5752509", "0.5748157", "0.5739456", "0.57380486", "0.5733147", "0.5729919", "0.5726665", "0.5726072", "0.5723839", "0.5721934", "0.57212836", "0.5719849", "0.5713259", "0.5713003", "0.5710963" ]
0.0
-1
checks everything needed before posting data (input validation, extracting data from API)
function postData(videoLink) { let id; let title; let link; let thumb; if (checkLink(videoLink)) { if ((id = getID(videoLink)) != false) { $.ajax({ type: 'GET', url: 'https://www.googleapis.com/youtube/v3/videos?part=snippet&id=' + id, data: { key: apiPublicKey, type: 'video', videoEmbeddable: true, }, success: function(response){ if(response.items.length > 0) { thumb = getThumbnail(id); link = "https://www.youtube.com/watch?v=" + id; title = response.items[0].snippet.title; insertData(link, id, thumb, title); } else { $('#message').html('Video does not exist.'); } }, error: function(response){ return "error"; } }); } else { $('#message').html('Error in link ID.'); } } else { $('#message').html('Please enter a YouTube link.'); } $('#message').css('animation', 'message 3s ease forwards'); $('#link').val(''); setTimeout(function() { $('#message').css("animation", ""); $('#message').css("opacity", "0"); }, 3000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateResponse (data) {\n\t\t// verify we got the right post, and that there are no attributes we don't want the client to see\n\t\tthis.validateMatchingObject(this.post.id, data.post, 'post');\n\t\tthis.validateSanitized(data.post, PostTestConstants.UNSANITIZED_ATTRIBUTES);\n\t}", "validatePostObjects () { \n\t\tif (this.attributes.codemark) {\n\t\t\tif (this.attributes.review) {\n\t\t\t\tthrow this.errorHandler.error('noCodemarkAndReview');\n\t\t\t} else if (this.attributes.codeError) {\n\t\t\t\tthrow this.errorHandler.error('noCodemarkAndCodeError');\n\t\t\t}\n\t\t} else if (this.attributes.review) {\n\t\t\tif (this.attributes.parentPostId) {\n\t\t\t\tthrow this.errorHandler.error('noReplyWithReview');\n\t\t\t} else if (this.attributes.codeError) {\n\t\t\t\tthrow this.errorHandler.error('noReviewAndCodeError');\n\t\t\t}\n\t\t} else if (this.attributes.codeError) {\n\t\t\tif (this.attributes.parentPostId) {\n\t\t\t\tthrow this.errorHandler.error('noReplyWithCodeError');\n\t\t\t}\n\t\t}\n\t}", "function validateInput() {\n\tvar i; var j;\n\t// Check content-type is application/json\n\tcontentType = $.request.contentType;\n\tif ( contentType === null || contentType.startsWith(\"application/json\") === false){\n\t\t $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n\t\t $.response.setBody(\"Wrong content type request use application/json\");\n\t\treturn false;\n\t}\n\t// Extract parameters and process them \n\tfor (i = 0; i < $.request.parameters.length; ++i) {\n\t paramName = $.request.parameters[i].name;\n\t paramValue = $.request.parameters[i].value;\n// Add logic\t \n\t}\n\t// Extract headers and process them \n\tfor (j = 0; j < $.request.headers.length; ++j) {\n\t headerName = $.request.headers[j].name;\n\t headerValue = $.request.headers[j].value;\n// Add logic\t \n\t }\n\treturn true;\n}", "function checkReqFields() {\n \n}", "function validateInput() {\r\n\tvar i;\r\n\tvar j;\r\n\t// Check content-type is application/json\r\n\tcontentType = $.request.contentType;\r\n\t// if (contentType === null\r\n\t// || contentType.startsWith(\"application/json\") === false) {\r\n\t// $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t// $.response.setBody(\"Wrong content type request use application/json\");\r\n\t// return false;\r\n\t// }\r\n\t// Extract parameters and process them\r\n\tfor (i = 0; i < $.request.parameters.length; ++i) {\r\n\t\tparamName = $.request.parameters[i].name;\r\n\t\tparamValue = $.request.parameters[i].value;\r\n\t\t// Add logic\r\n\t}\r\n\t// Extract headers and process them\r\n\tfor (j = 0; j < $.request.headers.length; ++j) {\r\n\t\theaderName = $.request.headers[j].name;\r\n\t\theaderValue = $.request.headers[j].value;\r\n\t\t// Add logic\r\n\t}\r\n\treturn true;\r\n}", "function checkActionBodyData() {\n return (req, res, next) => {\n if (\n !req.body.project_id ||\n !req.body.description ||\n !req.body.notes ||\n !req.body.completed\n ) {\n return res\n .status(400)\n .json({ message: \"missing project_id, description, notes, completed\" });\n }\n //stop here and send to next stack\n next();\n };\n}", "function validateInput() {\n\tvar i, j;\n\tvar paramName, paramValue;\n\tvar headerName, headerValue;\n\t// var contentType;\n\n\t// Check content-type is application/json\n\t// contentType = $.request.contentType;\n\t// if (contentType === null || contentType.startsWith(\"application/json\") === false) {\n\t// \t $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n\t// \t $.response.setBody(\"Wrong content type request use application/json\");\n\t// \treturn false;\n\t// }\n\t// Extract parameters and process them \n\tfor (i = 0; i < $.request.parameters.length; ++i) {\n\t\tparamName = $.request.parameters[i].name;\n\t\tparamValue = $.request.parameters[i].value;\n\t\toParam[paramName] = paramValue;\n\t}\n\t// Extract headers and process them \n\tfor (j = 0; j < $.request.headers.length; ++j) {\n\t\theaderName = $.request.headers[j].name;\n\t\theaderValue = $.request.headers[j].value;\n\t\toHeader[headerName] = headerValue;\n\t}\n\treturn true;\n}", "validateResponse (data) {\n\t\tthis.validateDisposition(data);\n\t\tthis.validateVersionInfo(data);\n\t\tthis.validateAgentInfo(data);\n\t\tthis.validateAssetUrl(data);\n\t}", "function validatePost(req, res, next) {\n // we want to check the body is defined and not an empty object\n // otherwise respond with status 400 and a useful message\n\n // is defined AND not empty(keys exist) \n if(req.body && Object.keys(req.body).length){\n // #### All good, go to next middleware\n next();\n } else {\n res.status(400).json({\n message: \"missing required text field\"\n })\n }\n}", "function verifyFormData(data) {\n // check required fields\n // check variable type or specific field rule\n if (!data.get(\"name\")) {\n alert(`Please, fill [Name] field`);\n return false;\n }\n if (!data.get(\"contact1\")) {\n alert(`Please, fill [Contact] field`);\n return false;\n }\n if (!data.get(\"contact2\")) {\n alert(`Please, fill [Contact] field`);\n return false;\n }\n if (!data.get(\"contact3\")) {\n alert(`Please, fill [Contact] field`);\n return false;\n }\n if (!data.get(\"address1\")) {\n alert(`Please, fill [Address] field`);\n return false;\n }\n if (!data.get(\"address2\")) {\n alert(`Please, fill [Address] field`);\n return false;\n }\n if (!data.get(\"zipCode\")) {\n alert(`Please, fill [Zip Code] field`);\n return false;\n }\n if (!data.get(\"gender\")) {\n alert(`Please, fill [Gender] field`);\n return false;\n }\n if (!data.get(\"birthYear\")) {\n alert(`Please, fill [Birthday] field`);\n return false;\n }\n if (!data.get(\"birthMonth\")) {\n alert(`Please, fill [Birthday] field`);\n return false;\n }\n if (!data.get(\"birthDay\")) {\n alert(`Please, fill [Birthday] field`);\n return false;\n }\n if (!data.get(\"married\")) {\n alert(`Please, fill [Marital Status] field`);\n return false;\n }\n if (!data.get(\"faithState\")) {\n alert(`Please, fill [Faith State] field`);\n return false;\n }\n if (!data.get(\"joinYear\")) {\n alert(`Please, fill [Join Date] field`);\n return false;\n }\n if (!data.get(\"joinMonth\")) {\n alert(`Please, fill [Join Date] field`);\n return false;\n }\n return true;\n}", "function postTools(dataFromBody, domainName, done) {\n let count = 0;\n dataFromBody.forEach((data) => {\n if (data.toolId && domainName) {\n if (data.toolId !== null && domainName !== null) {\n count += 1;\n } else {\n count += 0;\n }\n }\n });\n // console.log(count === dataFromBody.length);\n if (count === dataFromBody.length) {\n ToolService.addTools(dataFromBody, domainName, done);\n } else {\n return done({ error: 'please enter all fields' }, undefined);\n }\n return null;\n}", "function validateData(tapi, data, cb) {\n var result = true,\n uriFields = getUriFields(tapi.url);\n\n uriFields.forEach((field) => {\n if (typeof data[field] === 'undefined') {\n cb(new Error('Missing required field \"' + field + '\" in data'));\n result = false;\n }\n });\n tapi.params.forEach((param) => {\n if (param.Required === 'Required') {\n if (typeof data[param] === 'undefined') {\n cb(new Error('Missing required field \"' + param + '\" in data'));\n result = false;\n }\n }\n });\n\n return result;\n }", "function validateInput() {\n\n\t// Check content-type is application/json\n\tcontentType = $.request.contentType;\n\n\t//if ( contentType === null || contentType.startsWith(\"application/json\") === false){\n\t// $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n\t// $.response.setBody(\"Wrong content type request use application/json\");\n\t// return false;\n\t//}\n\n\treturn true;\n}", "submit() {\n const namedFieldNode = this.$['form-fields'].assignedNodes()\n .filter(node => node.hasAttribute && node.hasAttribute(\"name\"));\n\n const allValid = this.novalidate || namedFieldNode.every(node => node.validate ? node.validate() : true);\n\n if (allValid) {\n const reqData = namedFieldNode.reduce((result, node) => {\n const key = node.getAttribute('name');\n const value = node.value;\n result[key] = value;\n return result;\n }, {});\n const method = (this.method || '').toUpperCase();\n if(method === 'GET') {\n this._get(reqData);\n } else if(method === 'POST') {\n this._post(reqData);\n } else {\n throw new TypeError(`Unsupported method: ${this.method}`);\n }\n }\n }", "static validate(request, response) {\n let isValid = true;\n const errors = {};\n\n if (!request.body.title) {\n errors.title = 'Add a title';\n isValid = false;\n }\n\n if (!request.body.description) {\n errors.description = 'Add a description';\n isValid = false;\n }\n\n if (!request.body.price) {\n errors.price = 'Add a price';\n isValid = false;\n }\n\n if (request.body.price && Number.isNaN(request.body.price)) {\n errors.price = 'Price is not a number';\n isValid = false;\n }\n\n if (isValid) {\n return isValid;\n }\n\n return response.status(500).json(errors);\n }", "validateResponse (data) {\n\t\t// validate that mostRecentPostId and sortId were both set to the ID of the\n\t\t// last post created in the stream\n\t\tconst posts = this.postData.map(postData => postData.post);\n\t\tconst lastPost = posts[posts.length - 1];\n\t\tAssert(data.stream.mostRecentPostId === lastPost.id, 'mostRecentPostId for stream does not match post');\n\t\tAssert(data.stream.mostRecentPostCreatedAt = lastPost.createdAt, 'mostRecentPostCreatedAt for stream does not match post');\n\t\tAssert(data.stream.sortId === lastPost.id, 'sortId for stream does not match post');\n\t}", "function TrySubmit() \n{ \n let cardNumber = tw($(\"#cardNumberInput\").val());\n let cardHolderName = String(tw($(\"#cardHolderNameInput\").val()));\n let cvv = tw($(\"#ccvInput\").val());\n let expYear = $(\"#expiryYear :selected\").val();\n let expMonth = $(\"#expiryMonth :selected\").val(); \n\n let submissionData = \n {\n cardNumber : cardNumber,\n cardholderName : cardHolderName,\n cvv: cvv,\n expYear : expYear,\n expMonth: expMonth\n };\n\n // validate with the backend to see if the card is a proper type\n if (PreValidate(submissionData))\n {\n $.post(\"/api/validate\", submissionData).fail(\n function(jqXHR, textStatus, errorThrown) \n {\n OnValidationFailed();\n }).done(OnComplete);\n }\n}", "function checkSubmission(obj)\n{\n\n //list in the array, the object properties that stores required values\n const requiredFields = [\n \"first-name\",\n \"last-name\",\n \"title\",\n \"email\",\n \"phone\", \n \"company-name\",\n \"company-address\",\n \"company-city\",\n \"company-zip-code\",\n \"workshop-choice\",\n \"vegan\"\n ];\n\n // check if the required fields have values\n for (let i = 0; i< requiredFields.length; i++)\n {\n if (obj[requiredFields[i]] == \"none\")\n {\n errorMsg(requiredFields[i], \"Please fill in this field.\", \"required\", false);\n }\n else\n {\n errorMsg(requiredFields[i], \"\", \"required\", true);\n }\n }\n\n // Check if values with specific format are valid. if not : write on the form the errors to check\n\n // check email address\n // regex taken from https://regexlib.com/REDetails.aspx?regexp_id=174\n const validMail = checkValueFormat(obj[\"email\"], \"^.+@[^\\.].*\\.[a-z]{2,}$\");\n\n if(!validMail)\n {\n errorMsg(\"email\", \"Please enter a valid email: [email protected]\", \"format\", false);\n }\n else\n {\n errorMsg(\"email\", \"\", \"format\", true);\n }\n\n // check phone number\n const validPhone = checkValueFormat(obj[\"phone\"], \"[0-9]{3}-[0-9]{3}-[0-9]{4}$\");\n\n if(!validPhone)\n {\n errorMsg(\"phone\", \"Please enter a valid phone number: 000-000-0000\", \"format\", false);\n }\n else\n {\n errorMsg(\"phone\", \"\", \"format\", true);\n }\n\n //check company zip code\n const validZipCode = checkValueFormat(obj[\"company-zip-code\"], \"^\\\\d{5}$\");\n \n if(!validZipCode)\n {\n errorMsg(\"company-zip-code\", \"Please enter a valid ZIP Code: 00000\", \"format\", false);\n }\n else\n {\n errorMsg(\"company-zip-code\", \"\", \"format\", true);\n }\n\n //check if there's any error detected in the form\n let getErrors = document.querySelectorAll(\"p[class^='error-msg']\");\n\n if(getErrors.length == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n\n}", "validateResponse (data) {\n\t\t// we fetched the user's \"user\" object, we should see their lastReads attribute\n\t\t// for the created stream set to the last post of the first batch we created,\n\t\t// which we marked as read for the current user\n\t\tconst firstPosts = this.postData.map(postData => postData.post);\n\t\tconst lastReadPost = firstPosts[firstPosts.length - 1];\n\t\tAssert(data.user.lastReads[this.teamStream.id] === lastReadPost.seqNum, 'lastReads for stream is not equal to the seqNum of the last post read');\n\t}", "post(data, cb) {\n const { \n payload: { \n protocol, \n url, \n method, \n successCodes, \n timeoutSeconds\n },\n headers : { token }\n } = data;\n const { \n isAWholeNumber, \n isBetweenRange, \n auditRequiredFields \n } = helpers;\n\n // Validate inputs\n const validInputs = auditRequiredFields([\n // Audits whether length is > 0 by default if no compare options are provided\n { param: url },\n { param: successCodes, requiredDataType: 'array' },\n {\n param: protocol,\n compareOptions: protocol => ['https', 'http'].includes(protocol)\n },\n {\n param: method,\n compareOptions: method => ['get', 'post', 'put', 'delete'].includes(method)\n },\n {\n param: timeoutSeconds,\n requiredDataType: 'number',\n compareOptions: timeoutSeconds => isAWholeNumber(timeoutSeconds) &&\n isBetweenRange(timeoutSeconds, 1, 5)\n }\n ], 5).auditPassed;\n\n if (validInputs) {\n // Lookup the user by reading the token\n _data.read('tokens', token, (err, tokenData) => {\n if (!err && tokenData) {\n const userPhone = tokenData.phone;\n // Lookup the user data\n _data.read('users', userPhone, (err, userData) => {\n if (!err && userData) {\n // Discover how many checks the user has performed\n const userChecks = helpers.auditParam(userData.checks, 'array', null) ? userData.checks : []; \n // Verify whether the user has any remaining checks available\n if (userChecks.length < config.maxChecks) {\n const parsedUrl = _url.parse(`${protocol}://${url}`, true);\n const hostName = (helpers.auditParam(parsedUrl.hostname)) \n ? parsedUrl.hostname\n : false;\n // Verify that the given url has DNS entries, and therefore can resolve, so as not to waste system resources on an invalid url\n dns.resolve(hostName, (err, records) => {\n if (!err && records) {\n // Create a random id for the check\n const checkId = helpers.createRandomString(20);\n // Create the check object, and include the user's phone\n const checkObj = {\n id: checkId,\n userPhone,\n protocol,\n url,\n method,\n successCodes,\n timeoutSeconds\n };\n\n // Save the object\n _data.create('checks', checkId, checkObj, err => {\n if (!err) {\n // Add the check id to the user's object\n userData.checks = userChecks;\n userData.checks.push(checkId);\n\n // Save the new user data\n _data.update('users', userPhone, userData, err => {\n if (!err) {\n // Return the data about the new check to the requester\n cb(200, checkObj);\n } else {\n cb(500, {Error: `Could not create the new check (${helpers.reject(checkObj, 'id')})`});\n }\n });\n } else {\n cb(500, {Error: `Could not create the new check (${helpers.reject(checkObj, 'id')})`});\n }\n });\n } else {\n cb(400, {Error: `The hostname of the url (${parsedUrl.hostname}) entered did not resolve to any DNS entries`})\n }\n });\n } else {\n cb(400, {Error: `The user has already performed the maximun number of checks: (${config.maxChecks})`});\n }\n } else {\n cb(403);\n }\n });\n } else {\n cb(403);\n }\n });\n } else {\n cb(400, {Error: 'Missing required inputs, or inputs are invalid'});\n }\n }", "function checkRequiredData() {\n var\n title_check = true,\n url_check = true,\n updating = $('#feed_title').length;\n\n // title is only checked when the feed it updated\n if ($('#feed_title').length) {\n title_check = ($('#feed_title').val() != '');\n } else {\n url_check = ($('#feed_url').val() != '');\n }\n\n if (!url_check || !$('#feed_lang').val() || !title_check) {\n $('#' + (updating ? 'edit_feed' : 'add_selected_feeds')).attr('disabled', 'disabled');\n } else {\n $('#' + (updating ? 'edit_feed' : 'add_selected_feeds')).removeAttr('disabled');\n }\n }", "function submitData(e, product, price, funnyFun) {\n e.preventDefault();\n //the elements\n const fullname = document.getElementById(\"fullname\"),\n address = document.getElementById(\"address\"),\n phoneNum =document.getElementById(\"phone-number\"), \n errSpanName=document.getElementById(\"error_name\"),\n errSpanAdd=document.getElementById(\"error_address\"),\n errSpanPhone=document.getElementById(\"error_phone\");\n \n if(checkText(fullname.value, errSpanName) && checkText(address.value, errSpanAdd) && checkNumber(phoneNum.value, errSpanPhone)) {\n fetch(`${process.env.REACT_APP_GOOGLE_SHEETS_API}`, {\n\tmethod: \"POST\",\n\tbody: JSON.stringify({\"data\": {\"product\":product,\"price\":price,\"full-name\":fullname.value,\"address\":address.value,\"phone\":phoneNum.value}}),\n}).then(res =>{\n\tif (res.status === 201){\n // SUCCESS\n funnyFun();\n return true;\n\t}\n\telse{\n // ERROR\n return false;\n\t}\n});\n }\n\n//create the check text function\nfunction checkText(text, elt) {\nconst lenghtError = \"this field must be great than 3\";\n if(text.length >= 3) {\n elt.innerHTML =\"\";\n return true;\n } else {\n elt.innerHTML = lenghtError;\n return false;\n }\n }\n//create the check number function\nfunction checkNumber(text, elt){\n const lenghtError = \"this field must be containe the phone number\";\n if(text.length >= 3 && text.length <=12) {\n elt.innerHTML=\"\";\n return true;\n } else {\n elt.innerHTML = lenghtError;\n return false;\n }\n}\n}", "validateReview (data) {\n\t\t// verify we got back an review with the attributes we specified\n\t\tconst review = data.review;\n\t\tconst expectedOrigin = this.expectedOrigin || '';\n\t\tlet errors = [];\n\t\tlet result = (\n\t\t\t((review.id === review._id) || errors.push('id not set to _id')) && \t// DEPRECATE ME\n\t\t\t((review.teamId === this.test.team.id) || errors.push('teamId does not match the team')) &&\n\t\t\t((review.streamId === (this.inputReview.streamId || '')) || errors.push('streamId does not match the stream')) &&\n\t\t\t((review.postId === (this.inputReview.postId || '')) || errors.push('postId does not match the post')) &&\n\t\t\t((review.deactivated === false) || errors.push('deactivated not false')) &&\n\t\t\t((typeof review.createdAt === 'number') || errors.push('createdAt not number')) &&\n\t\t\t((review.lastActivityAt === review.createdAt) || errors.push('lastActivityAt should be set to createdAt')) &&\n\t\t\t((review.modifiedAt >= review.createdAt) || errors.push('modifiedAt not greater than or equal to createdAt')) &&\n\t\t\t((review.creatorId === this.test.currentUser.user.id) || errors.push('creatorId not equal to current user id')) &&\n\t\t\t((review.status === this.inputReview.status) || errors.push('status does not match')) &&\n\t\t\t((review.text === this.inputReview.text) || errors.push('text does not match')) &&\n\t\t\t((review.title === this.inputReview.title) || errors.push('title does not match')) &&\n\t\t\t((review.numReplies === 0) || errors.push('review should have 0 replies')) &&\n\t\t\t((review.origin === expectedOrigin) || errors.push('origin not equal to expected origin'))\n\t\t);\n\t\tAssert(result === true && errors.length === 0, 'response not valid: ' + errors.join(', '));\n\n\t\t// verify the review in the response has no attributes that should not go to clients\n\t\tthis.test.validateSanitized(review, ReviewTestConstants.UNSANITIZED_ATTRIBUTES);\n\n\t\t// if we are expecting a marker with the review, validate it\n\t\tif (this.test.expectMarkers) {\n\t\t\tnew MarkerValidator({\n\t\t\t\ttest: this.test,\n\t\t\t\tobjectName: 'review',\n\t\t\t\tinputObject: this.inputReview,\n\t\t\t\tusingCodeStreamChannels: true\n\t\t\t}).validateMarkers(data);\n\t\t}\n\t\telse {\n\t\t\tAssert(typeof data.markers === 'undefined', 'markers array should not be defined');\n\t\t}\n\n\t\t// validate the array of followers\n\t\tconst expectedFollowerIds = this.test.expectedFollowerIds || [this.test.currentUser.user.id];\n\t\texpectedFollowerIds.sort();\n\t\tconst gotFollowerIds = [...(review.followerIds || [])];\n\t\tgotFollowerIds.sort();\n\t\tAssert.deepEqual(gotFollowerIds, expectedFollowerIds, 'review does not have correct followerIds');\n\n\t\t// validate the review's permalink\n\t\tthis.validatePermalink(review.permalink);\n\t}", "validateResponse (data) {\n\t\t// we expect to see the sequence number set to the sequence number of the previous post\n\t\t// to the post that was marked unread ... the sequence numbers are 1-based so this is \n\t\t// just the same as the ordinal number of the post in the array of posts created\n\t\tconst expectedLastReadItems = {\n\t\t\t[this.itemId.toLowerCase()]: this.numReplies\n\t\t};\n\t\tAssert.deepStrictEqual(expectedLastReadItems, data.user.lastReadItems, 'lastReadItems doesn\\'t match');\n\t\tsuper.validateSanitized(data.user, UserTestConstants.UNSANITIZED_ATTRIBUTES_FOR_ME);\n\t}", "checkReqFields() {\n // Check the generic name field\n if (this.state.genericName == DEFAULT_GENERIC_NAME) {\n Alert.alert(\"Please enter a value for the generic name.\");\n return (false);\n }\n\n return (true);\n }", "validateResponse (data) {\n\t\t// validate that we got back \"ourselves\", and that there are no attributes a client shouldn't see\n\t\tthis.validateMatchingObject(this.currentUser.user.id, data.user, 'user');\n\t\tthis.validateSanitized(data.user, UserTestConstants.UNSANITIZED_ATTRIBUTES_FOR_ME);\n\t}", "function checkBookingData() {\n // trim values in case there are any whitespaces at the end and front of the value\n const bookingDateValue = $('bookingDate').value.trim();\n const bookingTitleValue = $('bookingTitle').value.trim();\n const bookingDescValue = $('bookingDesc').value.trim();\n\n // if empty display error\n if (bookingDateValue == \"\" || bookingTitleValue == \"\" || bookingDescValue == \"\") {\n $(\"bookingTag\").style.display = \"inline\";\n $(\"bookingTag\").innerText = \"Please fill in all the fields.\"; // display error message\n }\n else {\n allowSubmit = true; // if not empty, allowSubmit is then set to true then let the form be sent to the PHP file\n }\n}", "function handlePost() {\r\n\t$.trace.error(\"inside handlePost method\");\r\n\tvar bodyStr = $.request.body ? $.request.body.asString() : undefined;\r\n\t$.trace.error(bodyStr);\r\n\t$.trace.error(\"-------------------------------------------------------------------------\");\r\n\tif (bodyStr === undefined) {\r\n\t\t$.trace.debug(\"so bodystr is undefined\");\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\treturn {\r\n\t\t\t\"myResult\" : \"Missing BODY\"\r\n\t\t};\r\n\t}\r\n\tvar formData = JSON.parse(bodyStr);\r\n\tvar description = formData.DESCRIPTION;\r\n\t$.trace.debug(\"Reached description\" + description);\r\n\tif (description === null || description === '') {\r\n\t\t$.trace.error(\"so description is null or empty\");\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\treturn {\r\n\t\t\t\"myResult\" : \"Missing description field\"\r\n\t\t};\r\n\t}\r\n\tvar latitude = formData.LATITUDE;\r\n\tif (latitude === null || latitude === '') {\r\n\t\t$.trace.error(\"so latitude is null or empty\");\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\treturn {\r\n\t\t\t\"myResult\" : \"Missing latitude field\"\r\n\t\t};\r\n\t} else {\r\n\t\tlatitude = parseFloat(latitude);\r\n\t}\r\n\tvar longitude = formData.LONGITUDE;\r\n\tif (longitude === null || longitude === '') {\r\n\t\t$.trace.error(\"so longitude is null or empty\");\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\treturn {\r\n\t\t\t\"myResult\" : \"Missing longitude field\"\r\n\t\t};\r\n\t} else {\r\n\t\tlongitude = parseFloat(longitude);\r\n\t}\r\n\t$.trace.error(\"so nothing failed so far\");\r\n\tvar taskId = formData.ID;\r\n\tvar locationId = formData.LOCATION_ID;\r\n\tlocationId = UTILS.checkNotEmptyAndNotNull(locationId) ? parseInt(locationId)\r\n\t\t\t: '';\r\n\tvar statusId = formData.STATUS_ID;\r\n\tstatusId = UTILS.checkNotEmptyAndNotNull(statusId) ? parseInt(statusId)\r\n\t\t\t: '';\r\n\tvar serviceTypeId = formData.SERVICE_TYPE_ID;\r\n\tserviceTypeId = UTILS.checkNotEmptyAndNotNull(serviceTypeId) ? parseInt(serviceTypeId)\r\n\t\t\t: '';\r\n\tvar customerId = formData.CUSTOMER_ID;\r\n\tcustomerId = UTILS.checkNotEmptyAndNotNull(customerId) ? parseInt(customerId)\r\n\t\t\t: 1;\r\n\tvar serviceCategoryId = formData.SERVICE_CATEGORY_ID;\r\n\tserviceCategoryId = UTILS.checkNotEmptyAndNotNull(serviceCategoryId) ? parseInt(serviceCategoryId)\r\n\t\t\t: '';\r\n\tvar taskRequestedDate = formData.TASK_REQUESTED_DATE;\r\n\ttaskRequestedDate = UTILS.checkNotEmptyAndNotNull(taskRequestedDate) ? new Date(Date.parse(taskRequestedDate)) : new Date(Date.now());\r\n\tvar country = formData.COUNTRY;\r\n\tvar streetName = formData.STREET_NAME;\r\n\tvar streetNum = formData.STREET_NUM;\r\n\tvar state = formData.STATE;\r\n\tvar region = formData.REGION;\r\n\tvar apartment = formData.APARTMENT;\r\n\tvar address = formData.ADDRESS;\r\n\t$.trace.error(address)\r\n\tvar resultSet;\r\n\tvar result = {\r\n\t\t\"ID\" : taskId,\r\n\t\t\"DESCRIPTION\" : description,\r\n\t\t\"STATUS_ID\" : statusId,\r\n\t\t\"SERVICE_TYPE_ID\" : serviceTypeId,\r\n\t\t\"CUSTOMER_ID\" : customerId,\r\n\t\t\"SERVICE_CATEGORY_ID\" : serviceCategoryId,\r\n\t\t\"TASK_REQUESTED_DATE\":taskRequestedDate,\r\n\t\t\"LOCATION_ID\" : locationId\r\n\t};\r\n\ttry {\r\n\t\t$.trace.error(\"about to save location\");\r\n\t\t$.trace.error(locationId);\r\n\t\t$.trace.error(\"---------------------------------------n\");\r\n\t\tvar conn = $.db.getConnection();\r\n\t\t// Insert Location\r\n\t\tif (locationId == null || locationId == '') {\r\n\t\t\t$.trace.error(\"save\");\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::locationId\\\".NEXTVAL AS locationId from Dummy');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\t$.trace.error(\"sequence query executed\");\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tlocationId = resultSet.getInteger(1);\r\n\t\t\t\tresult.locationId = locationId;\r\n\t\t\t\t$.trace.error(locationId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of location result\");\r\n\t\t\t}\r\n\t\t\t$.trace.error(\"outside while next loop\");\r\n\t\t\tvar query = conn\r\n\t\t\t\t\t.prepareStatement('INSERT INTO \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.Location\\\" VALUES(?,?,?,?,?,?,?,?,?,?,new ST_POINT('\r\n\t\t\t\t\t\t\t+ latitude + ',' + longitude + '))');\r\n\t\t\tquery.setInteger(1, locationId);\r\n\t\t\tquery.setString(2, country);\r\n\t\t\tquery.setString(3, streetName);\r\n\t\t\tquery.setString(4, streetNum);\r\n\t\t\tquery.setString(5, state);\r\n\t\t\tquery.setString(6, region);\r\n\t\t\tquery.setString(7, apartment);\r\n\t\t\tquery.setString(8, address);\r\n\t\t\tquery.setFloat(9, latitude);\r\n\t\t\tquery.setFloat(10, longitude);\r\n\t\t\t\r\n\t\t\tresultSet = query.executeUpdate();\r\n\t\t} else {\r\n\t\t\t$.trace.error(\"update\");\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('UPDATE \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.Location\\\" SET COUNTRY=?, STREET_NAME =?, STREET_NUM=?, STATE=?,REGION=?,APARTMENT=?,ADDRESS=?,LATITUDE=?,LONGITUDE=?,POINT=new ST_POINT('\r\n\t\t\t\t\t\t\t+ latitude + ',' + longitude + ') WHERE ID= ?');\r\n\t\t\tquery.setString(1, country);\r\n\t\t\tquery.setString(2, streetName);\r\n\t\t\tquery.setString(3, streetNum);\r\n\t\t\tquery.setString(4, state);\r\n\t\t\tquery.setString(5, region);\r\n\t\t\tquery.setString(6, apartment);\r\n\t\t\tquery.setString(7, address);\r\n\t\t\tquery.setFloat(8, latitude);\r\n\t\t\tquery.setFloat(9, longitude);\r\n\t\t\tquery.setInteger(10, locationId);\r\n\t\t\tresultSet = query.executeUpdate();\r\n\t\t}\r\n\r\n\t\t$.trace.error(\"saved location i guess\");\r\n\r\n\t\tif (statusId == '') {\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT ID FROM \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.TaskStatus\\\" WHERE STATUS=\\'Requested\\'');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tstatusId = resultSet.getInteger(1);\r\n\t\t\t\tresult.STATUS_ID = statusId;\r\n\t\t\t\t$.trace.error(statusId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of statusId result\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (serviceTypeId == '') {\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT ID FROM \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.ServiceType\\\" WHERE TYPE=\\'Home Service\\'');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tserviceTypeId = resultSet.getInteger(1);\r\n\t\t\t\tresult.SERVICE_TYPE_ID = serviceTypeId;\r\n\t\t\t\t$.trace.error(serviceTypeId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of serviceTypeId result\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (serviceCategoryId == '') {\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT ID FROM \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.ServiceCategory\\\" WHERE DESCRIPTION=\\'Default\\'');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tserviceCategoryId = resultSet.getInteger(1);\r\n\t\t\t\tresult.SERVICE_CATEGORY_ID = serviceCategoryId;\r\n\t\t\t\t$.trace.error(serviceCategoryId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of serviceCategoryId result\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (taskId == null || taskId == '') {\r\n\t\t\t// Insert task\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::taskId\\\".NEXTVAL AS taskId from Dummy');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\t$.trace.error(\"sequence query executed\");\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\ttaskId = resultSet.getInteger(1);\r\n\t\t\t\tresult.ID = taskId;\r\n\t\t\t\t$.trace.error(taskId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of task ID result\");\r\n\t\t\t}\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('INSERT INTO \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.Task\\\" VALUES(?,?,?,?,?,?,?,?,now(),now())');\r\n\t\t\tquery.setInteger(1, taskId);\r\n\t\t\tquery.setString(2, description);\r\n\t\t\tquery.setInteger(3, statusId);\r\n\t\t\tquery.setInteger(4, locationId);\r\n\t\t\tquery.setInteger(5, serviceTypeId);\r\n\t\t\tquery.setInteger(6, customerId);\r\n\t\t\tquery.setInteger(7, serviceCategoryId);\r\n\t\t\tquery.setDate(8, taskRequestedDate);\r\n\t\t\tvar resultSet = query.executeUpdate();\r\n\t\t} else {\r\n\t\t\t$.trace.error(\"inside update task\");\r\n\t\t\t// Insert task\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('UPDATE \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.Task\\\" SET DESCRIPTION=?, STATUS_ID=?, LOCATION_ID=?, SERVICE_TYPE_ID=?, CUSTOMER_ID=?, SERVICE_CATEGORY_ID=?, TASK_REQUESTED_DATE=?, MODIFIED_DATE = now() WHERE ID=?');\r\n\t\t\tquery.setString(1, description);\r\n\t\t\tquery.setInteger(2, statusId);\r\n\t\t\tquery.setInteger(3, locationId);\r\n\t\t\tquery.setInteger(4, serviceTypeId);\r\n\t\t\tquery.setInteger(5, customerId);\r\n\t\t\tquery.setInteger(6, serviceCategoryId);\r\n\t\t\tquery.setDate(7, taskRequestedDate);\r\n\t\t\tquery.setInteger(8, taskId);\r\n\t\t\tvar resultSet = query.executeUpdate();\r\n\t\t\tresult.ID = taskId;\r\n\t\t\t$.trace.error(\"task update executed\");\r\n\t\t}\r\n\t\tconn.commit();\r\n\t} catch (err) {\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\t$.response.setBody(err.message);\r\n\t\t$.trace.error(error.message);\r\n\t\treturn;\r\n\t} finally {\r\n\t\tconn.close();\r\n\t}\r\n\tresult.Status = \"POST success\";\r\n\t// Extract body insert data to DB and return results in JSON/other format\r\n\t$.response.status = $.net.http.CREATED;\r\n\t$.trace.debug(\"about to exti handle post method\");\r\n\treturn result;\r\n}", "function checkFields() {\n if (document.getElementById('firstname').value == \"\") { $('#fNameError').text(\"First name required...\"); $('#firstname').css('border-color', 'red'); }\n if (document.getElementById('lastname').value == \"\") { $('#lNameError').text(\"Last name required...\"); $('#lastname').css('border-color', 'red'); }\n if (document.getElementById('username').value == \"\") { $('#emailError').text(\"Email required...\"); $('#username').css('border-color', 'red'); }\n if (document.getElementById('password').value == \"\") { $('#passwordError').text(\"Password required...\"); $('#password').css('border-color', 'red'); }\n if (document.getElementById('confirm').value == \"\") { $('#confirmPasswordError').text(\"Password match required...\"); $('confirm').css('border-color', 'red'); }\n\n if (fName_flag && lName_flag && email_flag && password_flag && confirmPass_flag == true) {\n let fname = document.getElementById('firstname').value;\n let lname = document.getElementById('lastname').value;\n let uname = document.getElementById('username').value;\n let pass = document.getElementById('password').value;\n let userData = {\n \"firstName\": fname,\n \"lastName\": lname,\n \"email\": uname,\n \"password\": pass,\n \"service\": \"advance\"\n }\n // Store SignUp data \n postData(userData);\n }\n}", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "function processTheData(response) {\r\n if (response.statusResponse.statusCode === 422) {\r\n let serviceInput = {\r\n data: {\r\n emailId: registrationData.email,\r\n firstName: registrationData.fname,\r\n lastName: registrationData.lname,\r\n password: registrationData.confirmpass,\r\n gender: registrationData.gender,\r\n role: registrationData.role,\r\n belongsTo: registrationData.belongs,\r\n },\r\n url: serviceUrlData.devURI + serviceUrlData.registrationURI,\r\n callbackSuccess: processTheSuccessPage,\r\n callbackFailure: processFailure,\r\n };\r\n \r\n //posting the data\r\n fectAPIData.fetchAPIDataPostWithOutJWTToken(serviceInput);\r\n\r\n } else {\r\n setCustomerExists(true);\r\n }\r\n }", "function onSubmitClick() {\n // get get-train-name\n data.train.code = inputElements.name.value;\n // get get-destination\n data.train.destination = inputElements.destination.value;\n // Check if all required fields are populated\n if (!isDataMissing()) {\n // Push data to firebase\n // database.ref().push(trainInfo);\n database.ref().push(data);\n // loop trough elements text input and\n for (let _key in inputElements) {\n // clean the text inputs\n inputElements[_key].value = \"\";\n }\n }\n // if any missing data display error\n else {\n // TODO: display error if missing data\n alert(\"Missing data\");\n }\n}", "function validateActionData(req, res, next) {\n if (!req.body.project_id || !req.body.description || !req.body.notes) {\n res.status(400).json({\n message: \"Please include project_id, action description and action notes .\",\n });\n } else {\n next();\n }\n}", "handlePost(context, connection) {\n const hasData = this.hasData(connection.data);\n const validData = this.validate(connection.data, {\n partnerUserId: String,\n email: String,\n firstName: String,\n lastName: String,\n country: String,\n city: String,\n address: String,\n });\n\n if (hasData && validData.valid) {\n connection.data.owner = connection.owner;\n connection.data.createdAt = new Date();\n PartnerUsersTemp.insert(connection.data);\n this.response(context, 200, { message: 'User data accepted' });\n } else {\n this.response(context, 403, { message: validData.error });\n }\n }", "postData() {\n throw new Error('Not implemented');\n }", "canSubmit() {\n return (\n this.validateOnlyLetterInput(this.state.name)==='' &&\n this.validateTelephone(this.state.telephone)==='' &&\n this.validateAddress(this.state.address)==='' &&\n this.validatePostalCode(this.state.postalCode)==='' &&\n this.validateOnlyLetterInput(this.state.city)===''\n );\n }", "function checkSubmission() {\r\n //checks the array for any values in\r\n //the allErrors array\r\n //displays any error messages\r\n console.log(allErrors.length);\r\n if (allErrors.length > 0 && allErrors.length <= 3) {\r\n //iterates the allErrors array\r\n allErrors.forEach(element => {\r\n //sets the width of the wrapper element\r\n //to accomodate the message errors\r\n setWrapperAtts(\"1000px\");\r\n\r\n //tests to see which item will set the element\r\n if (element.type === \"e\") {\r\n $(\"#lblEmailError\").html(element.error);\r\n } else if (element.type === \"m\") {\r\n $(\"#lblPhoneError\").html(element.error);\r\n } else if (element.type === \"p\") {\r\n $(\"#lblPassError\").html(element.error);\r\n } else if (element.type === \"pc\") {\r\n $(\"#lblConPassError\").html(element.error);\r\n } else {\r\n //do nothing!\r\n console.log(\"is it a bug?\");\r\n }\r\n });\r\n } else {\r\n //send all values to the server! - serialise\r\n setWrapperAtts(\"620px\");\r\n\r\n //TODO = set a tick Icon next to the elements\r\n\r\n //diags\r\n console.log(`all values will be sent to the server`);\r\n }\r\n\r\n //removes the data from the array, for the next submission\r\n for (i = -1; i <= allErrors.length; i++) {\r\n //removes all the items in the array\r\n removeDataAllErrors();\r\n }\r\n //diags to display the array - should be 0 elements\r\n console.log(allErrors);\r\n }", "validateResponse (data) {\n\t\tAssert.deepStrictEqual(data.capabilities, APICapabilities, 'returned capabilities are not correct');\n\t\tAssert.strictEqual(data.environment, this.apiConfig.sharedGeneral.runTimeEnvironment, 'environment not correct');\n\t\tAssert.strictEqual(data.isOnPrem, this.apiConfig.sharedGeneral.isOnPrem, 'isOnPrem is not correct');\n\t\tAssert.strictEqual(data.isProductionCloud, this.apiConfig.sharedGeneral.isProductionCloud, 'isProductionCloud is not correct');\n\t}", "function validate(data) {\n\tif (\n\t\tvalidateName(data[\"name\"]) == \"\" &&\n\t\tvalidateStandard(data[\"standard\"]) == \"\" &&\n\t\tvalidateRollNo(data[\"rollNo\"]) == \"\" &&\n\t\tvalidateDate(data[\"DOB\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"rollNo\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"name\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"gender\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"standard\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"DOB\"]) == \"\"\n\t)\n\t\treturn true;\n\telse return false;\n}", "validateResponse (data) {\n\t\tconst set = data.post.$set;\n\t\tAssert(set[this.attribute] === undefined, 'attribute appears in the response');\n\t\tsuper.validateResponse(data);\n\t}", "validateForm() {\n return this.state.serviceName.length > 0 && this.state.description.length > 0 && this.state.location.length > 0 && this.state.category.length > 0 && this.state.url.length > 0\n }", "function _validateData() {\n const { identifier, password, ip } = user;\n var success = false;\n var error_name, error_code;\n\n if (\n identifier.length < 6 ||\n identifier.length > 254 ||\n identifier === \"undefined\"\n ) {\n error_name = \"username or email\";\n error_code = \"0003\";\n } else if (\n password.length < 8 ||\n password.length > 254 ||\n password === \"undefined\"\n ) {\n error_name = \"password\";\n error_code = \"0004\";\n } else if (!ipValidator(ip) || ip === \"undefined\") {\n error_name = \"ip\";\n error_code = \"0004\";\n } else {\n success = true;\n }\n //respuesta 409 - error del cliente\n switch (success) {\n case false:\n res.cookie(\"refreshToken\", null, {\n maxAge: 0,\n });\n res.status(400).send({\n error_code: `ERROR_SIGN_IN_${error_code}`,\n message: `Invalid ${error_name}.`,\n success: false,\n });\n return false;\n default:\n return true;\n }\n }", "function prepareSubmission() {\n info_dict[\"language\"] = $('#input-language').val(); // prepare language\n var all_data = {};\n var flag = false;\n // Take details from the form\n $(\"form#info-form :input\").each(function () {\n var input = $(this); //get the object\n if(empty_not_allowed.indexOf(input.attr('id'))!= -1) {\n if(input.val() == \"\") {\n alert(\"Please fill the field \" + input.attr('placeholder'));\n flag = true;\n return false;\n }\n }\n // Save all lists in array by splitting it by comma and removing all spaces around the words\n var list_of_el = input.val().split(\",\");\n list_of_el = list_of_el.map(Function.prototype.call, String.prototype.trim);\n all_data[input.attr('id').split('-')[1]] = list_of_el;\n });\n if (flag) // If one of the must fields in empty, do not sent the data\n return;\n var e = document.getElementById(\"select-function_call_must_char\");\n all_data[\"function_call_must_char\"] = [e.options[e.selectedIndex].value];\n info_dict[\"all_data\"] = all_data;\n console.log(info_dict);\n add_language(info_dict); //Send to server the information collected from contributor\n}", "function submitApptRequest() {\r\n\t\r\n\tvar $aptfirstname = $(\"#aptfirstname\");\r\n\tvar $aptlastname = $(\"#aptlastname\");\r\n\tvar $aptaddress = $(\"#aptaddress\");\r\n\tvar $aptcity = $(\"#aptcity\");\r\n\tvar $aptstate = $(\"#aptstate\");\r\n\tvar $aptzip = $(\"#aptzip\");\r\n\tvar $aptphonenumber = $(\"#aptphonenumber\");\r\n\tvar $aptpetname = $(\"#aptpetname\");\r\n\tvar $aptpettype = $(\"#aptpettype\");\r\n\tvar $aptbreed = $(\"#aptbreed\");\r\n\r\n\r\n\tvar $aptemail = $(\"#aptemail\"); // ------ this is optional \r\n\tvar $aptpetage = $(\"#aptpetage\"); // ------ this is optional \r\n\tvar $aptneutered = $(\"#aptneutered\").is(':checked'); // ------ this is optional \r\n\t\r\n\tfunction submitValidate(element) {\r\n\t\t$(element).parent().addClass(\"has-error\");\r\n\t\t$(element).next(\"span\").addClass(\"glyphicon-remove\");\r\n\t\t$(element).next(\"span\").next().html(\"Required information.\")\r\n\t};\r\n\r\n\r\n\tif (!$aptfirstname.val() || !$aptlastname.val() || !$aptaddress.val() || !$aptcity.val() || $aptstate.val() == \"select\" || !$aptzip.val() || !$aptphonenumber.val() || !$aptpetname.val() || $aptpettype.val() == \"select\" || ($aptpettype.val() == \"Dog\" && $aptbreed.val() == \"select\")) {\r\n\r\n\t\t$(\"#newrequestbutton\").disabled = true;\r\n\r\n\t\tif (!$aptfirstname.val()) {\r\n\t\t\tsubmitValidate($aptfirstname);\r\n\t\t};\r\n\r\n\t\tif (!$aptlastname.val()) {\r\n\t\t\tsubmitValidate($aptlastname);\r\n\t\t};\r\n\r\n\t\tif (!$aptaddress.val()) {\r\n\t\t\tsubmitValidate($aptaddress);\r\n\t\t};\r\n\r\n\t\tif (!$aptcity.val()) {\r\n\t\t\tsubmitValidate($aptcity);\r\n\t\t};\r\n\t\r\n\t\tif ($aptstate.val() == \"select\") {\r\n\t\t\tsubmitValidate($aptstate);\t\r\n\t\t};\r\n\t\t\r\n\t\tif (!$aptzip.val()) {\r\n\t\t\tsubmitValidate($aptzip);\r\n\t\t};\r\n\r\n\t\tif (!$aptphonenumber.val()) {\r\n\t\t\tsubmitValidate($aptphonenumber);\r\n\t\t};\r\n\r\n\t\tif (!$aptpetname.val()) {\r\n\t\t\tsubmitValidate($aptpetname);\r\n\t\t};\r\n\r\n\t\tif ($aptpettype.val() == \"select\") {\r\n\t\t\tsubmitValidate($aptpettype);\r\n\t\t};\r\n\r\n\t\tif ($aptpettype.val() == \"Dog\" && $aptbreed.val() == \"select\") {\r\n\t\t\tsubmitValidate($aptbreed);\r\n\t\t}\r\n\r\n\t} else { \r\n\t\tsendRequest();\r\n\t};\r\n}", "function checkFormInputs() {\n var nameInputField = document.querySelector('#name');\n var emailInputField = document.querySelector('#mail');\n var numberInputField = document.querySelector('#number');\n var cityInputField = document.querySelector('#city');\n var stateSelect = document.querySelector('#state');\n var zipInputField = document.querySelector('#zip');\n var radios = document.getElementsByName('format');\n var newsLetter = document.getElementsByName('user_interest');\n\n\n var values = [nameInputField, emailInputField, numberInputField, cityInputField, stateSelect, zipInputField];\n var errorFound = false;\n\n // adding the class 'error' to any input without data\n for (var i = 0; i < values.length; i++) {\n var field = values[i];\n if (!field.value || stateSelect.value === 'Choose State') {\n field.classList.add('error');\n field.placeholder = \"Field can't be blank\";\n errorFound = true;\n } else {\n field.classList.remove('error');\n }\n }\n\n // Check if any field had an error, if not, submit data somewhere\n if (!errorFound) {\n // save data to databasae\n }\n}", "check_submission() {\n if(this.state.ActivityName.length < 1) {\n Alert.alert(\"Must enter activity name\");\n } else if(this.state.dateText == 'Click to select date') {\n Alert.alert(\"Must enter a date\");\n } else if (this.state.startText == 'Click to select start time' || this.state.startText == 'dismissed') {\n Alert.alert(\"Must enter start time\");\n } else if (this.state.endText == 'Click to select end time' || this.state.endText == 'dismissed') {\n Alert.alert(\"Must enter end time\");\n } else if (this.state.cost.length < 1) {\n Alert.alert(\"Must enter cost\");\n } else if (this.state.street_address.length < 1) {\n Alert.alert(\"Must enter street address\");\n } else if (this.state.city.length < 1) {\n Alert.alert(\"Must enter city\");\n } else if (this.state.state.length < 1) {\n Alert.alert(\"Must enter state\");\n } else if (this.state.country.length < 1) {\n Alert.alert(\"Must enter country\");\n } else if (this.state.zip_code.length < 1) {\n Alert.alert(\"Must enter zip code\");\n } else if (this.state.description.length < 1) {\n Alert.alert(\"Must enter event description\");\n } else if (this.state.wheelchair_accessible.length < 1) {\n Alert.alert(\"Must enter wheelchair accessible\");\n } else if (this.state.wheelchair_accessible_restroom.length < 1) {\n Alert.alert(\"Must enter wheelchair accessible restroom\");\n } else if (this.state.activity_type.length < 1) {\n Alert.alert(\"Must enter activity type\");\n } else if (this.state.disability_type.length < 1) {\n Alert.alert(\"Must enter disability type\");\n } else if (this.state.parent_participation.length < 1) {\n Alert.alert(\"Must enter parent participation required\");\n } else if (this.state.assistant.length < 1) {\n Alert.alert(\"Must enter assistant provided\");\n } else if (this.state.phone.length < 1) {\n Alert.alert(\"Must enter phone number to call for accessibility questions\");\n } else if (this.state.start_age < 0) {\n Alert.alert(\"Must enter youngest age\");\n } else if (this.state.end_age < 0) {\n Alert.alert(\"Must enter oldest age\");\n } else if (this.state.end_age < this.state.start_age) {\n Alert.alert(\"Oldest age must be older than youngest age\");\n } else {\n this.onSubmitButtonPressed();\n }\n\n }", "handleSubmit(e, destination) {\n e.preventDefault()\n let urel, data, method\n switch(destination) {//Sets which API call to use and associated data to act upon dependent upon the destination argument\n case 'preSearch':\n urel = '/api/biz/presearch'\n data = this.state.searchQuery\n method = 'POST'\n this.setState({\n preSearchLoaded: false\n })\n break\n case 'groups':\n urel= '/api/groups'\n data= this.state.newUser\n method='POST'\n break\n case 'bizDetails':\n urel = '/api/biz'\n data = this.state.bizDetails\n method = 'POST'\n break\n case 'edit':\n urel = '/api/biz'\n data = this.state.bizDetails\n method = 'PUT'\n break\n case 'searchUsers':\n urel = '/api/biz/search'\n let searchQuery = this.state.searchQuery\n let dataCheck = this.isValid([this.isValid(searchQuery.height),this.isValid(searchQuery.weight),this.isValid(searchQuery.income),this.isValid(searchQuery.age), this.isValid(searchQuery.zipCode)])\n data = dataCheck ? this.state.searchQuery : false\n method = 'POST'\n break\n case 'bizUsers':\n urel = '/api/groups'\n method = 'GET'\n break\n default:\n break;\n }\n if(data){\n fetch(urel, {\n method: method,\n headers: {\n 'Content-Type': 'application/json'\n },\n credentials: 'include',\n body: data ? JSON.stringify(data) : null\n })\n .then(res => res.json())\n .then(res => {\n switch(destination) {//What to do with the api call results according to the active form specified\n case 'preSearch':\n this.setState({\n preSearchCount: res.results.filters[0].count,\n preSearchLoaded: true\n })\n break\n case 'groups':\n this.setState({\n groups: res.groups.groups,\n groupsLoaded: true\n })\n break\n case 'bizDetails':\n this.setState({\n bizDetails: res.biz.biz,\n apiDataLoaded: true,\n editDetails: false\n })\n break\n case 'edit':\n this.setState({\n bizDetails: res.biz.biz,\n apiDataLoaded: true,\n editDetails: false\n })\n case 'searchUsers':\n if(res.results&&res.results.filters&&res.results.filters.length){//Just typechecking because the backend needs work- result data structure can be inconsistent.\n this.setState({\n searchResults: res.results.filters,\n searchResultsLoaded: true,\n searchQuery: query,\n searchResultsInvalid: null\n })\n }else{\n this.setState({\n searchResultsInvalid: '0 matches'\n })\n }\n break\n case 'bizUsers':\n this.setState({\n bizUsers: res.data,\n bizUsersLoaded: true\n })\n break\n default:\n break\n }\n })\n }else{//if(data) - if isValid function determines that there isn't a real search\n this.setState({\n searchResultsInvalid: 'Invalid/empty search'\n })\n return false\n }\n }", "function checkForm(event) {\n event.preventDefault();\n /* START WITH INITIALLY 2 \"EMPTY BUCKETS (DATA/ERRORS)*/\n\n /*Declare object that will store the form-data*/\n const formData = {\n fullName: null,\n email: null,\n message: null\n };\n\n /*Declare array that will store the errors*/\n const errors = {};\n\n\n /*fullName Block*/\n if (fullName.value !== \"\") {\n if (fullName) {\n formData.fullName = fullName.value;\n delete errors.miss_n;\n } else {\n errors.miss_n = \"full name is invalid\";\n }\n } else {\n errors.miss_n = \"full name is missing\";\n }\n\n\n\n /*Email Block*/\n if (email.value !== \"\") {\n if (check_email.test(email.value)) {\n formData.email = email.value;\n delete errors.miss_e;\n } else {\n errors.miss_e = \"Email is invalid\";\n }\n } else {\n errors.miss_e = \"Email is missing\";\n }\n\n\n // validate message\n if (message.value !== \"\") {\n if (message.value) {\n formData.message = message.value;\n delete errors.ms;\n } else {\n errors.miss_msg = \"Message is invalid\";\n }\n } else {\n errors.miss_msg = \"Message is missing\";\n }\n\n\n // display in Console\n if (Object.keys(errors).length === 0) {\n p(formData);\n } else {\n p(errors)\n }\n\n}", "function validateData(){\r\n\t var nmflag=validatename();\r\n\t var passflag=validatepassword();\r\n\t var hbflag=validatehobbies();\r\n\t if(nmflag && passflag && hbflag){\r\n\t\t displayData();\r\n\t }\r\n\t return false;\r\n }", "function validateSubmitObj(){\n var flag = true;\n for(var key in infoSubmitObj){\n if(infoSubmitObj [key].length == 0){\n flag = false;\n }\n }\n return flag;\n }", "function validate() {\n if (!$scope.id.length || !$scope.pass.length || !$scope.name.length || !$scope.group.length ||\n !$scope.email.length || !$scope.phone.length || !$scope.workplace.length || !($scope.informed.email.length || \n $scope.informed.facebook.length || $scope.informed.webSite.length || $scope.informed.colleague.length || \n $scope.informed.other.length) || !($scope.population.elementary.length || \n $scope.population.highSchool.length || $scope.population.higherEducation.length || $scope.population.other.length)) {\n $scope.emptyData = true;\n } else { // Habilita\n $scope.emptyData = false;\n }\n }", "function validateRest(dataToValidate, requiredData)\n{\n let isSafe = true;\n requiredData.forEach((ele)=>{\n if(dataToValidate.hasOwnProperty(ele) === false)\n {\n console.log(\"[REST]:\\t! Expecting: \"+ ele+ \" => \"+ dataToValidate.ele);\n isSafe = false;\n }\n });\n return isSafe;\n}", "function preCheck(){\n //Check format and send ajax if valid\n val = get_box_content()\n if(val != lastSearch){\n if (val.match(formatRegex) && val.match(lengthRegex)){\n //Run check\n sendRequest(val)\n }else{\n // submitButton.prop( \"disabled\", true );\n // resultsBox.empty()\n }\n }\n }", "function validateRideInput(data){\n\treturn true; // currently everything is supported\n}", "submitHandler() {\n // grab newsletter, email and selected times\n let results = {\n Article_title: this.state.apiResponse.title,\n Article_id: this.state.apiResponse._id,\n email: this.state.email,\n selectedTimes: this.state.selectedTimes\n };\n // check for >= 2 times selected\n if (this.state.selectedTimes.length < 2) {\n let errorMessage = \"Please select two or more time slots\";\n this.setState({ errors: errorMessage, displayErrors: \"d-inline-block\" });\n\n // check for valid email format\n } else if (this.validateEmail(this.state.email) === false) {\n let errorMessage = \"Please enter a Valid Email Address\";\n this.setState({ errors: errorMessage, displayErrors: \"d-inline-block\" });\n\n // If time selection and email valid than send results\n } else {\n console.log(\"results\", results);\n this.checkForUserEmail(results);\n this.postTimesToAPI(results, this.state.apiResponse._id);\n }\n }", "onClick() {\n let self = this;\n self.validateInput('name', (nameStatus) => {\n if (nameStatus) {\n self.validateInput('description', (descriptionStatus) => {\n if (descriptionStatus) {\n self.validateInput('cost', (costStatus) => {\n if (costStatus) {\n self.validateInput('limit', (limitStatus) => {\n if (limitStatus) {\n this.httpRequest();\n }\n });\n }\n });\n }\n });\n }\n });\n }", "function checkInputs(){\r\n const fNameValue = fName.value.trim();\r\n const lNameValue = lName.value.trim();\r\n const addressValue =address.value.trim();\r\n const cityValue =city.value.trim();\r\n //const vValue =state.value.trim();\r\n const zipValue = zip.value.trim();\r\n const dobValue = dob.value.trim();\r\n const phoneValue = phone.value.trim();\r\n const emailRValue = emailR.value.trim();\r\n const passwordValue = password.value.trim();\r\n \r\n if(fNameValue === '')\r\n {\r\n setErrorFor(fName)\r\n }else{\r\n setSuccessFor(fName);\r\n }\r\n\r\n if(lNameValue === '')\r\n {\r\n setErrorFor(lName)\r\n }else{\r\n setSuccessFor(lName);\r\n }\r\n\r\n if(addressValue === '')\r\n {\r\n setErrorFor(address)\r\n }else{\r\n \r\n setSuccessFor(address);\r\n }\r\n\r\n if(cityValue === '')\r\n {\r\n setErrorFor(city)\r\n }else{\r\n \r\n setSuccessFor(city);\r\n }\r\n\r\n if(zipValue === '')\r\n {\r\n setErrorFor(zip)\r\n }else{\r\n \r\n setSuccessFor(zip);\r\n }\r\n\r\n if(dobValue === '')\r\n {\r\n setErrorFor(dob)\r\n }else{\r\n \r\n setSuccessFor(dob);\r\n console.log(dobValue)\r\n }\r\n\r\n if(phoneValue === '')\r\n {\r\n setErrorFor(phone)\r\n }else{\r\n \r\n setSuccessFor(phone);\r\n }\r\n\r\n if(emailRValue === '')\r\n {\r\n setErrorFor(emailR)\r\n }else if(!isEmail(emailRValue)){\r\n setErrorFor(emailR)\r\n \r\n }else{\r\n setSuccessFor(emailR);\r\n }\r\n\r\n if(passwordValue === '')\r\n {\r\n setErrorFor(password)\r\n }else{\r\n setSuccessFor(password);\r\n }\r\n}", "function checkForm(){\n //if all outcomes are true, this means all inputs have correct data\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){ //if all inputs filled correctly, allow user to send form\n btn.disabled = false; //enable submit btn\n }else{\n btn.disabled = true;\n }\n }", "onValidationRequest() {\n\n\t\t\t// Simple validation - check if there are any inputs with errors\n\t\t\tvar errors = $(\".sapMInputBaseContentWrapperError\").length,\n\t\t\t\tresult = errors === 0;\n\n\t\t\t// Raise the response event back to the consumer\n\t\t\tsap.ui.getCore().getEventBus().publish(\"codan.zUrgentBoard\", \"validationResult\", {\n\t\t\t\tresult: result\n\t\t\t});\n\t\t}", "function dataValid (data = {}) {\n console.log(\"::: data valid :::\")\n document.getElementById('error').classList.add(\"pseudo\");\n document.getElementById('error').innerHTML = \"\";\n document.getElementById('daysleft').innerHTML = data.daysleft;\n \n // weather summary\n document.getElementById('weathersummary').innerHTML = data.summary;\n document.getElementById('weathersummary').className = '';\n /* eslint-disable-next-line */\n document.getElementById('weathersummary').classList.add(Client.getIconClass(data.icon));\n document.getElementById('destinationimage').src = data.imagelink;\n }", "checkReadyForSubmit(){\n if(this.checkAnswersReady() && this.checkAddressReady() && this.checkMembership()){\n return true;\n }\n else{\n return false;\n }\n }", "function validateApiData (apiData) {\n if (apiData == undefined) {\n throw \"No API configuration\";\n }\n if (!(\"token\" in apiData) || apiData.token === \"\") {\n throw \"No API token specified\";\n }\n if (!(\"host\" in apiData) || apiData.host === \"\") {\n throw \"No host specified\";\n }\n}", "validate() {\n // Check required top level fields\n for (const requiredField of [\n 'description',\n 'organizationName',\n 'passTypeIdentifier',\n 'serialNumber',\n 'teamIdentifier',\n ])\n if (!(requiredField in this.fields))\n throw new ReferenceError(`${requiredField} is required in a Pass`);\n // authenticationToken && webServiceURL must be either both or none\n if ('webServiceURL' in this.fields) {\n if (typeof this.fields.authenticationToken !== 'string')\n throw new Error('While webServiceURL is present, authenticationToken also required!');\n if (this.fields.authenticationToken.length < 16)\n throw new ReferenceError('authenticationToken must be at least 16 characters long!');\n }\n else if ('authenticationToken' in this.fields)\n throw new TypeError('authenticationToken is presented in Pass data while webServiceURL is missing!');\n this.images.validate();\n }", "submit() {\n\n // Referring to parent abstract class method, which checks if input values are (not) their placeholders' values\n // If they are, the values are set to empty strings\n this.checkPlaceholders();\n\n // This array exist to support older pattern\n let forms = [this.jQueryName, this.jQueryEmail, this.jQueryCount, this.jQueryPrice];\n \n // Same here\n let validation = [this.isNameValid(forms[0].val()), this.isEmailValid(forms[1].val()), this.isCountValid(forms[2].val()), this.isPriceValid(cleanPriceString(forms[3].val()))];\n \n // If all values are valid\n if(validation.every((element)=>{return element;})){\n\n // Array with city checkboxes jQuery elements\n let cities = this.jQueryElement.find('.city').toArray();\n\n // Array in which we push flags depending on checkboxes values\n let delivery = [];\n \n // Pushing flags\n cities.forEach((city)=>{\n delivery.push($(city).prop('checked') ? true : false);\n });\n \n // Async process of adding the new good\n const addPromise = LIST.add(new Good(\n this.jQueryName.val(),\n this.jQueryEmail.val(),\n this.jQueryCount.val(),\n priceConverter(this.jQueryPrice.val()), \n delivery.slice(0, 3), \n delivery.slice(3, 5), \n delivery.slice(5, 9), \n ))\n \n // Async process starts\n this.loading();\n \n // When it resolved proceed\n addPromise.then((resolved) => {\n\n // New good in the list, re-render table\n LIST.render();\n\n // Hidding modals\n this.endLoading();\n\n // Clearing form\n this.clear();\n this.clearInvalid();\n\n // Setting placeholders back\n this.initPlaceholders();\n } \n );\n \n \n \n \n } else {\n\n // Clear invalid classes before setting anew\n this.clearInvalid();\n\n // If an input didn't come through validation\n // Through *note(s) methods indicating notes are shown\n validation.forEach((element, index)=>{\n if(!element){\n forms[index].addClass('invalid');\n this.showNotes(forms[index]);\n } else {\n this.hideNote(forms[index]);\n }\n });\n \n // Focusing in the first invalid input field\n forms[validation.indexOf(false)].focus();\n }\n }", "async function validatePost(req, res, next) {\n\n}", "function checkDataForInsert(req, res, next) {\n\tlet data = req.body\n\tif (!req.user.id || !data.topic_id || !data.msg) {\n\t\tres.resp(403, errmsg.MISSING_DATA)\n\t} else {\n\t\tif (data.msg.match(regex.string_blank)) {\n\t\t\tres.resp(403, errmsg.BLANK_STRING)\n\t\t}\n\t\tif (data.msg.length > global.limit.msg) {\n\t\t\tres.resp(403, errmsg.LONG_STRING)\n\t\t}\n\t}\n\tlet topic = new Topic()\n\ttopic.import(data.topic_id)\n\t.then((result) => {\n\t\tif(topic.status == 1 || topic.status == 3) {\n\t\t\tres.resp(423, errmsg.ARCHIVED_TOPIC)\n\t\t} else\n\t\t\tnext()\n\t})\n\t.catch((err) => {\n\t\tres.resp(404, errmsg.ID_NOT_FOUND)\n\t})\n}", "validateResponse (data) {\n\t\t// verify id, createdAt, and modifiedAt were created, and then set it so the deepEqual works\n\t\tconst post = data.post;\n\t\tAssert(post.id, 'returned post has no ID');\n\t\tthis.expectedResponse.post.id = post.id;\n\t\tAssert(post.parentPostId, 'returned post has no parentPostId');\n\t\tthis.expectedResponse.post.parentPostId = this.expectedParentPostId || post.parentPostId;\n\t\tAssert(post.creatorId, 'returned post has no creatorId');\n\t\tthis.expectedResponse.post.creatorId = this.expectedCreatorId || post.creatorId;\n\t\tthis.expectedResponse.post.userMaps[post.creatorId] = this.expectedResponse.post.userMaps.placeholder;\n\t\tdelete this.expectedResponse.post.userMaps.placeholder;\n\t\tAssert(post.createdAt >= this.createdAfter, 'createdAt is not greater than before the comment was created');\n\t\tAssert(post.modifiedAt >= post.createdAt, 'modifiedAt is not greater than or equal to createdAt');\n\t\tthis.expectedResponse.post.createdAt = post.createdAt;\n\t\tthis.expectedResponse.post.modifiedAt = post.modifiedAt;\n\t\tthis.validateMentions(post);\n\t\tAssert.deepStrictEqual(data, this.expectedResponse, 'response data is not correct');\n\t}", "save() {\n try{\n validateUserData()\n }catch(err) {\n \n }\n }", "function validate_game_data() {\n switch (page) {\n case 'reconfig_game':\n var form = get_form_data('#reconfig_game_form');\n break;\n case 'create_game':\n var form = get_form_data('#create_game_form');\n break;\n default:\n return false;\n }\n\n if (check_field_empty(form.name, 'name'))\n return false;\n if (check_field_empty(form.press, 'press'))\n return false;\n if (check_field_empty(form.order_phase, 'order_phase'))\n return false;\n if (check_field_empty(form.retreat_phase, 'retreat_phase'))\n return false;\n if (check_field_empty(form.build_phase, 'build_phase'))\n return false;\n if (check_field_empty(form.waiting_time, 'waiting_time'))\n return false;\n if (check_field_empty(form.num_players, 'num_players'))\n return false;\n\n if (check_field_int(form.order_phase, 'order_phase'))\n return false;\n if (check_field_int(form.retreat_phase, 'retreat_phase'))\n return false;\n if (check_field_int(form.build_phase, 'build_phase'))\n return false;\n if (check_field_int(form.waiting_time, 'waiting_time'))\n return false;\n\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : get_cookie()\n }, {\n \"name\" : form.name\n }, {\n \"description\" : form.description\n }, {\n \"password\" : form.password\n }, {\n \"press\" : form.press\n }, {\n \"order_phase\" : form.order_phase\n }, {\n \"retreat_phase\" : form.retreat_phase\n }, {\n \"build_phase\" : form.build_phase\n }, {\n \"waiting_time\" : form.waiting_time\n }, {\n \"num_players\" : form.num_players\n } ]\n };\n\n switch (page) {\n case 'reconfig_game':\n dataObj.content.push( {\n \"game_id\" : form.game_id\n });\n call_server('reconfig_game', dataObj);\n break;\n case 'create_game':\n call_server('create_game', dataObj);\n break;\n default:\n return false;\n }\n}", "async function validatePostRequestSyntax(request){\n let requestSyntaxValidator = ( request.header('Content-Type')=='application/json' && \n request.body.url!=null && \n request.body.name!=null && \n request.body.caption!=null &&\n request.body.caption.length!=0 &&\n request.body.url.length!=0 &&\n request.body.name.length!=0 && \n Object.keys(request.body).length==3);\n \n let nameValidator = (val) => {\n for(let i=0;i<val.length;i++){\n if(val[i]>='0' && val[i]<='9'){\n return false;\n }\n }\n return true;\n }\n if(requestSyntaxValidator && nameValidator(request.body.name)){\n let urlValidator=false;\n await isImageUrl(request.body.url).then((res)=>{urlValidator=res}).catch((err)=>{urlValidator=false});\n return urlValidator;\n }\n else{\n return false;\n }\n}", "function validatePost(req, res, next) {\n console.log(\"This is req.body in validatePost(): \", req.body);\n if (!req.body) {\n res.status(400).json({ error: \"Missing post data\" });\n } else if (!req.body.text || req.body.text === \"\") {\n res.status(400).json({ error: \"Missing required text field\" });\n } else {\n next();\n }\n}", "function validateForm(data){\n let d = Object.getOwnPropertyNames(data);\n let re = /http/g;\n if(data['link'] !== undefined && !re.test(data[d[4]])) return 0;\n for(let i=0; i< d.length; i++){\n if(data[d[i]] === null || data[d[i]] === undefined) return 0;\n }\n return 1;\n}", "validate() {\n\t\t// Validate blog url\n\t\tconst parts = url.parse(this.url);\n\t\tif (!(parts.protocol && parts.host)) {\n\t\t\treturn new Error('INVALID_URL');\n\t\t}\n\n\t\t// Validate email (super basic, dependency free)\n\t\tif (this.user === undefined ||\n\t\t\tthis.user === '' ||\n\t\t\tthis.user.indexOf('@') <= 0 ||\n\t\t\tthis.user.indexOf('.') <= 0) {\n\t\t\treturn new Error('INVALID_USER');\n\t\t}\n\n\t\t// Validate data that should exist\n\t\tconst tests = ['pass', 'client', 'secret'];\n\t\tlet err = false\n\n\t\ttests.forEach((test) => {\n\t\t\tif (this[test] === undefined || this[test] === '') {\n\t\t\t\terr = err || new Error(`INVALID_${test.toUpperCase()}`);\n\t\t\t}\n\t\t});\n\n\t\t// Validate token. Handled by class\n\t\treturn err || this.token.validate();\n\t}", "articleStep1Post () {\n\t\t\tif (this.allKewords.length < 6) this.swalfire('error','6 keywords are required.');\n\t\t\telse {\n\t\t\t\tif (this.manu_script_id) {\n\t\t\t\t\tthis.$axios.patch('api/manuScriptContrlr/'+this.manu_script_id,this.aStep1Data).then(res => {\n\t\t\t\t\t\tthis.swalfire('success','Form data is saved successfully.');\n\t\t\t\t\t\t/*UPDATING KEYWORDS AND FILES ARRAY*/\n\t\t\t\t\t\tthis.uploadKywrds(this.manu_script_id);\n\t\t\t\t\t\tthis.getAllAddFiles(this.manu_script_id);\n\t\t\t\t\t\tthis.getAllMyFiles(this.manu_script_id);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.$axios.post('api/manuScriptContrlr',this.aStep1Data).then(res => {\n\t\t\t\t\t\tthis.manu_script_id = res.data;\n\t\t\t\t\t\tthis.swalfire('success','Form data is saved successfully.');\n\t\t\t\t\t\t/*UPDATING KEYWORDS AND FILES ARRAY*/\n\t\t\t\t\t\tthis.uploadKywrds(res.data);\n\t\t\t\t\t\tthis.getAllAddFiles(res.data);\n\t\t\t\t\t\tthis.getAllMyFiles(res.data);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function validateRequest() {\n\n if ($scope.projectNumbers.indexOf($scope.request.projectNumber) < 0) {\n $scope.errorText = \"Invalid Project Number\";\n return false;\n }\n\n if ($scope.request.vendor.trim().length <= 0) {\n $scope.errorText = \"Vendor must not be empty\";\n return false;\n }\n\n if ($scope.request.URL.trim().length <= 0) {\n $scope.errorText = \"Vendor URL must not be empty\";\n return false;\n }\n\n for (var x = 0; x < $scope.request.items.length; x++) {\n var item = $scope.request.items[x];\n\n //no empty description\n if (!item.description || item.description.trim().length == 0) {\n $scope.errorText = \"Description should not be empty in item \" + (x+1);\n return false;\n }\n\n //no empty description\n if (!item.itemURL || item.itemURL.trim().length == 0) {\n $scope.errorText = \"Item URL should not be empty in item \" + (x+1);\n return false;\n }\n\n //no empty partNo\n if (!item.partNo || item.partNo.trim().length == 0) {\n $scope.errorText = \"Part number should not be empty in item \" + (x+1);\n return false;\n }\n\n //quantity must be integer\n if (!Number.isInteger(+item.quantity)) {\n $scope.errorText = \"Quantity should be an integer in item \" + (x+1);\n return false;\n }\n\n //unitCost must be at most 2 past the decimal\n if (!item.unitCost || Math.abs(Math.round(item.unitCost*100) - item.unitCost*100) >= .1) {\n $scope.errorText = \"Unit cost should be a dollar amount in item \" + (x+1);\n return false;\n }\n }\n\n $scope.errorText = \"\";\n return true;\n }", "processing(frForm, frFormNameToProcess, formRiderConfigs) {\n\n let postURL = this.getFormAction(frForm);\n let requestMethod = this.getFormRequestMethod(frForm);\n let formDataEncoded = this.getFormDataToKeyValueArrayEncodedURL(frForm);\n let formData = this.getFormDataToKeyValue(frForm);\n let dataToSubmit = formDataEncoded.join(\"&\");\n\n\n\n\n\n\n //create a new instance of InputValidation in order to validate the input\n let _this = this;\n let inputValidation = new InputValidation(frFormNameToProcess, formData, formRiderConfigs);\n\n\n let timer = setTimeout(function() {\n\n if (inputValidation.validated) {\n //check if the error array is empty or not, if it is empty then submit data and then show the notification, if not then do noting and only show the notification\n\n try {\n if (inputValidation.inputValidationRecap[1].length === 0) {\n _this.sendData(requestMethod, postURL, dataToSubmit);\n FormRiderjs.setValidationStatus(true);\n }\n if (inputValidation.inputValidationRecap[1].length !== 0) {\n FormRiderjs.setValidationStatus(false);\n }\n } catch (error) {\n throw new CustomError(\"FormRider.js ERROR\", \"Process stopped, an error has occurred\");\n }\n new NotificationGenerator(inputValidation.inputValidationRecap, formRiderConfigs);\n }\n clearTimeout(timer);\n }, 100);\n }", "checkUrlValid(data){\nreturn this.post(Config.API_URL + Constant.PUBLISH_CHECKURLVALID, data);\n}", "function checkIsValidForm(data) {\n\t\n\tvar stat = true;\n\t\n\tif(data == undefined)\n\t\tstat = false;\n\n//checks if any data is empty\n\tif(\tdata.name != undefined && \n\t\tdata.game != undefined && \n\t\tdata.requirements != undefined)\n\t{\n\t\tif(data.members.length == 0)\n\t\t\tstat = false;\n\t\t\n\t\tdata.members.forEach( function(element) {\n\t\t\tif(!global.allUsers.some(e => e.id == element)) {\n\t\t\t\tstat = false;\n\t\t\t}\n\t\t});\n\t}\n\treturn stat;\n}", "function validateInputs(data) {\n // console.log(\"1111111111111\")\n // console.log(data)\n // console.log(\"1111111111111\")\n let inputIndex = 0;\n for (let key in data) {\n if (data[key]) \n inputIndex++;\n }\n if (inputIndex === 0) {\n return \"empty\";\n } else {\n return (inputIndex === requiredFields.length) ? \"valid\" : \"empty\";\n }\n}", "function san_val_post_company(req, res, next) {\n let errors = [];\n\n // checking if request contains body and all necessary paramters\n if (\n req.body &&\n req.body.COMPANY_ID &&\n req.body.COMPANY_NAME &&\n req.body.COMPANY_CITY\n ) {\n //checking if COMPANY_ID is number\n let i = req.body.COMPANY_ID.trim();\n i = parseInt(i);\n if (!i) {\n errors.push({ msg: \"COMPANY_ID should be integer\" });\n }\n\n // checking if city name contians numbers\n i = req.body.COMPANY_CITY.trim();\n regex_for_number = /\\d/;\n if (regex_for_number.test(i)) {\n errors.push({ msg: \"COMPANY_CITY should not contain integers\" });\n }\n } else {\n errors.push({\n msg:\n \"post request should have Json body with 3 parameters with their valuse, namely COMPANY_ID, COMPANY_NAME and COMPANY_CITY\",\n });\n }\n\n // sum up all the errors\n if (errors.length) {\n res.status(400).json({ errors: errors });\n } else {\n next();\n }\n}", "onSubmitData() {\n if (this.state.email == '' || this.state.password == '')\n alert(\"Please fill out all fields!\");\n else if(this.state.email != '' && this.state.password != '' && this.validInput(this.state.email))\n Actions.reset('dashBoard'); // Navigate to dashBoard screen\n }", "function checkIterationFormInfo(objData){\n\t\n\tif (objData.length < 16) {\n\t\talert(\"Please answer all questions before finishing the experiment\");\n\t\treturn false;\n\t}\n\n\tfor (var i = 0; i < objData.length; i++) {\n\t\tif (objData[i].value == \"\"){\n\t\t\talert(\"Please answer question: \" + objData[i].name);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function validatePostRequest(req, res) {\n\n // If the content-type header is not 'application/json', the request body parser\n // ignores the content so it looks like an empty request.\n const validContentType = req.get('content-type').toLowerCase().indexOf('application/json') > -1;\n if (!validContentType) {\n res.status(400);\n res.send('Request must be Content-Type: application/json');\n return false;\n }\n\n return true;\n}", "function submitData() {\r\n let valName = validateFullName();\r\n let valEmail = validateEmail();\r\n let valUsrName = validateUserName();\r\n let valPassword = validatePassword();\r\n let valCPwd = validateCPassword();\r\n let valGender = validateGender();\r\n let valQty = validateQty();\r\n let valAddress = validateAddress();\r\n let valChkAgree = validateAgreement();\r\n let allValidated = valName && valEmail && valUsrName && valPassword && valCPwd && valGender && valQty && valAddress && valChkAgree;\r\n console.log(valName);\r\n if (allValidated) {\r\n alert(\"Game bought\");\r\n document.getElementById(\"regisForm\").reset();\r\n } else {\r\n alert(\"Error detected\");\r\n }\r\n}", "function submitForm(e) {\n const userDate = username.value.trim();\n const mailData = mail.value.trim();\n const passData = pass.value.trim();\n\n if (userDate === \"\") {\n inputChecker(username, \"enter you user name\", 1500);\n }\n if (mailData === \"\") {\n inputChecker(mail, \"enter you mail address\", 1500);\n }\n if (passData === \"\") {\n inputChecker(pass, \"enter you passeord\", 1500);\n }\n}", "function validateReq(){\r\n\t\t//Variables\r\n\t\tvar name = document.survey_form.name;\r\n\t\tvar age = document.survey_form.age;\r\n\t\tvar t = document.survey_form.knittime;\r\n\t\tvar time = document.survey_form.time;\r\n\t\tvar experience = document.survey_form.experience;\r\n\t\tvar informative = document.survey_form.informative;\r\n\t\tvar informPage = document.survey_form.informativePage;\r\n\t\tvar objects = document.survey_form.objects;\r\n\t\tvar selfish = document.survey_form.selfish;\r\n\t\tvar ravelry = document.survey_form.Ravelry;\r\n\t\tvar updates = document.survey_form.updates;\r\n\t\tvar othercrafts = document.survey_form.othercrafts;\r\n\t\tvar suggestions = document.survey_form.suggestions;\r\n\t\t//Makes the Name a required input\r\n\t\tif (name.value ==\"\")\r\n\t\t{window.alert(\"Please enter your name\")\r\n\t\tname.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the age range a required input\r\n\t\tif (age.value ==\"\")\r\n\t\t{window.alert(\"Please enter your age range\")\r\n\t\tage.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the experience level a required input\r\n\t\tif (experience.value ==\"\")\r\n\t\t{window.alert(\"Please share your experience level.\")\r\n\t\texperience.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the time a required input\r\n\t\tif (t.value ==\"\")\r\n\t\t{window.alert(\"Please enter the amount of time\")\r\n\t\ttimeknitting.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t\t//Makes the time radio a required input\r\n\t\tif (time.value == \"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\ttime.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the rating a required input\r\n\t\tif (informative.value ==\"\")\r\n\t\t{window.alert(\"Please enter a value\")\r\n\t\tinformative.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the dropdown selection a required input\r\n\t\tif (informPage.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\tinformPage.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the object radio a required input\r\n\t\tif (objects.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\tobjects.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the who do you knit for question a required input\r\n\t\tif (selfish.value ==\"\")\r\n\t\t{window.alert(\"Please share your thoughts\")\r\n\t\tselfish.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the ralvery radio a required input\r\n\t\tif (ravelry.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\travelry.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the email radio a required input\r\n\t\tif (updates.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\tupdates.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the ralvery username a required input if the 'yes' radio us check\r\n\t\tif (document.survey_form.yesRav.checked) {\r\n\t\t\tif (username.value ==\"\")\r\n\t\t\t{window.alert(\"Please enter your username\")\r\n\t\t\tusername.focus()\r\n\t\t\treturn false;}\r\n\t\t}\r\n\t\t//Makes the email a required input if the 'yes' radio us checked\r\n\t\tif (document.survey_form.yesEmail.checked) {\r\n\t\t\tif (email.value ==\"\")\r\n\t\t\t{window.alert(\"Please enter your e-mail\")\r\n\t\t\temail.focus()\r\n\t\t\treturn false;}\r\n\t\t}\r\n\t\t//Makes the other crafts reply a required input\r\n\t\tif (othercrafts.value ==\"\")\r\n\t\t{window.alert(\"Please share your thoughts\")\r\n\t\tothercrafts.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the general suggestion reply a required input\r\n\t\tif (suggestions.value ==\"\")\r\n\t\t{window.alert(\"Please share your thoughts\")\r\n\t\tsuggestions.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\treturn true;\r\n\t}", "function checkSendedValue() {\n return (req.body.email != undefined && String(req.body.email).match(/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/) == null) ||\n (req.body.password != undefined && req.body.password == \"\") ||\n (req.body.password2 != undefined && req.body.password2 == \"\") ||\n (req.body.token != undefined && req.body.token == \"\") ||\n (req.body.itineraryName != undefined && req.body.itineraryName == \"\") ||\n (req.body.emailUser != undefined && req.body.emailUser == \"\") ||\n (req.body.coordinate != undefined && req.body.coordinate == \"\");\n }", "function BtnActionRequestFST(action) {\n if (IsValidForm() == 0) {\n if (IsValidDate() == 0) {\n if (IsValidLength() == 0) {\n if (IsValidTextbox() == 0) {\n CheckDataRequestFST(action);\n }\n }\n }\n }\n}", "isRequestIncorrect(request) {\n return !request || !request.endpoint || (\n (!request.body || (\n typeof request.body.length !== 'undefined' && request.body.length === 0\n )) \n && \n (\n request.method === 'POST'\n )\n );\n }", "function submitData() {\n // getting the submitted data\n today_rating = 0;\n week_rating = 0;\n month_rating = 0;\n for (var i = 0; i < 5; i++) {\n if (rating_numbers[i].style.backgroundColor == \"rgb(128, 128, 128)\") {\n today_rating = parseInt(rating_numbers[i].innerHTML);\n }\n }\n for (var i = 5; i < 10; i++) {\n if (rating_numbers[i].style.backgroundColor == \"rgb(128, 128, 128)\") {\n week_rating = parseInt(rating_numbers[i].innerHTML);\n }\n }\n for (var i = 10; i < 15; i++) {\n if (rating_numbers[i].style.backgroundColor == \"rgb(128, 128, 128)\") {\n month_rating = parseInt(rating_numbers[i].innerHTML);\n }\n }\n\n // uploading data\n if (today_rating | week_rating | month_rating != 0) {\n console.log(\"Submitting data...\")\n if (document.URL == \"http://localhost:5000/\") {\n upload_data(\"qa_data\");\n } else if (document.URL == \"https://hows-business.firebaseapp.com/\"){\n upload_data(\"prod_data\");\n }\n }\n }", "function check_keys( json_input ) {\n\tif ( !json_input.hasOwnProperty( \"type\" ) || !json_input.hasOwnProperty( \"data\" ) ) {\n\t\tpost( \"json must contain 'type' and 'data' keys\", '\\n');\n\t\treturn false;\n\t}\n\treturn true;\n}", "function saveInformation() {\n if(typeof reqs != \"undefined\") {\n let data = new FormData();\n\n data.append(\"requirements\", JSON.stringify(reqs));\n fetch(URL, { method : \"POST\", body : data })\n .then(checkStatus)\n .then(function(data) {\n console.log(data);\n })\n } else {\n let errorShow = document.getElementById(\"giveError\");\n errorShow.innerText = \"You have not inputted a specification to save!\";\n }\n }", "function checkIsValidForm(data) {\n\n\tvar stat = true;\n\n\tif(data == undefined)\n\t\tstat = false;\n\n//checks if any data is empty\n\tif(\tdata.name != undefined &&\n\t\tdata.team != undefined &&\n\t\tdata.location != undefined &&\n\t\tdata.requirements != undefined)\n\t{\n\t\tif(data.members.length == 0)\n\t\t\tstat = false;\n\n\t\tdata.members.forEach( function(element) {\n\t\t\tif(!global.allUsers.some(e => e.id == element)) {\n\t\t\t\tstat = false;\n\t\t\t}\n\t\t});\n\t}\n\treturn stat;\n}", "function testData(){\n let result = false;\n for(name in data) {\n if(blankField(data[name])){\n result = true;\n }else{\n result = false;\n }\n }\n if(password.value === \"\" || (password.value !== \"\" && !numExp.test(password.value))){\n password.classList.add(\"invalid\");\n password.insertAdjacentHTML('afterend', \"<p class = 'message'>Password must contain one number, one letter, one capital letter and be at least 8 characters long</p>\");\n result = false;\n }\n \n if(telephone.value === \"\" || (telephone.value !== \"\" && !tele.test(telephone.value))){\n telephone.classList.add(\"invalid\");\n telephone.insertAdjacentHTML('afterend', \"<p class = 'message'>Telephone number format must be for eg 876-555-7896</p>\");\n result = false;\n }\n \n return result;\n }", "function sanityCheckRequest(request) {\n if (request === null || request === undefined) {\n return false;\n }\n\n if (!('lowPrice' in request) ||\n !('highPrice' in request) ||\n !('quantity' in request) ||\n !('zipcode' in request) ||\n !('deliveryDate' in request) ||\n !('zipcode' in request)) {\n return false;\n }\n\n if (!globals.commonHelper.IsIntValue(request['lowPrice'])) {\n console.log('Request low price invalid');\n return false;\n }\n\n if (!globals.commonHelper.IsIntValue(request['highPrice'])) {\n console.log('Request high price invalid');\n return false;\n }\n\n if (!globals.commonHelper.IsIntValue(request['quantity'])) {\n console.log('Request quantity invalid');\n return false;\n }\n\n if (!globals.commonHelper.IsIntValue(request['zipcode'])) {\n console.log('Request zipcode invalid');\n return false;\n }\n\n if (!globals.commonHelper.IsIntValue(request['lowPrice'])) {\n console.log('Request low price invalid');\n return false;\n }\n \n var highPrice = parseInt(request['highPrice']);\n var lowPrice = parseInt(request['lowPrice']);\n\n if (highPrice < lowPrice) {\n console.log('Request high price ' + highPrice + ' smaller than low price' + lowPrice);\n return false;\n }\n\n return true;\n}", "validateResponse (data) {\n\t\t// validate that we got the company, team, and repo in the response,\n\t\t// along with the expected streams\n\t\tAssert(data.companies.length === 1, 'no company in response');\n\t\tthis.validateMatchingObject(this.createCompanyResponse.company.id, data.companies[0], 'company');\n\t\tAssert(data.teams.length === 1, 'no team in response');\n\t\tthis.validateMatchingObject(this.createCompanyResponse.team.id, data.teams[0], 'team');\n\t\tAssert(data.streams.length === 1, 'expected 3 streams');\n\t\tconst teamStream = data.streams.find(stream => stream.isTeamStream);\n\t\tthis.validateMatchingObject(this.createCompanyResponse.streams[0].id, teamStream, 'team stream');\n\t\tthis.userId = this.inviteUserResponse.user.id;\n\t\tsuper.validateResponse(data);\n\t}", "function dataHandler(data) {\r\n var response = JSON.parse(data);\r\n clearErrors();\r\n if (response && response.error && response.error !== \"\") {\r\n addtoError(response.error);\r\n } else {\r\n document.getElementById(\"name\").value = \"\";\r\n document.getElementById(\"email\").value = \"\";\r\n createNewUser(response.user);\r\n }\r\n }", "checkInitialData(data, config) {\n return true;\n }", "function validateClassesPost() {\n return async (req, res, next) => {\n const {\n name,\n type,\n class_date,\n start_time,\n duration,\n intensity,\n location,\n registered_students,\n max_students,\n } = req.body;\n\n !name\n ? await res.json({ message: \"error, check the NAME property\" })\n : !type\n ? await res.json({ message: \"error, check the TYPE property\" })\n : !class_date\n ? await res.json({ message: \"error, check the CLASS_DATE property\" })\n : !start_time\n ? await res.json({ message: \"error, check the START_TIME property\" })\n : !duration\n ? await res.json({ message: \"error, check the DURATION property\" })\n : !intensity\n ? await res.json({ message: \"error, check the INTENSITY property\" })\n : !location\n ? await res.json({ message: \"error, check the LOCATION property\" })\n : !registered_students\n ? await res.json({ message: \"error, check REGISTERED_STUDENTS property\" })\n : !max_students\n ? await res.json({ message: \"error, check the MAX STUDENTS property\" })\n : null;\n\n ///next middlestack and post class\n next();\n };\n}", "function _validateRequestBody() {\n //Get req.body size\n var size = Object.keys(user).length;\n if (!user || size <= 0) {\n //send response\n res.status(400).send({\n error_code: \"ERROR_SIGN_IN_0002\",\n message: \"Content can not be empty!\",\n success: false,\n });\n return false;\n }\n return true;\n }", "submitObject(inKey, test=false, suppressWarnings=false){\n // function to test a POST of the data or actually POST it.\n // validates if test=true, POSTs if test=false.\n const { context, schemas, setIsSubmitting, navigate } = this.props;\n const { keyValid, keyTypes, errorCount, currentSubmittingUser, edit, roundTwo, keyComplete,\n keyContext, keyDisplay, file, keyHierarchy, keyLinks, roundTwoKeys } = this.state;\n const stateToSet = {}; // hold next state\n const currType = keyTypes[inKey];\n const currSchema = schemas[currType];\n\n // this will always be reset when stateToSet is implemented\n stateToSet.processingFetch = false;\n stateToSet.keyValid = _.clone(keyValid);\n\n const finalizedContext = this.removeNullsFromContext(inKey);\n\n var i;\n // get rid of any hanging errors\n for (i=0; i < errorCount; i++){\n Alerts.deQueue({ 'title' : \"Validation error \" + parseInt(i + 1) });\n stateToSet.errorCount = 0;\n }\n\n this.setState({ 'processingFetch': true });\n\n if (!currentSubmittingUser){\n console.error('No user account info.');\n stateToSet.keyValid[inKey] = 2;\n this.setState(stateToSet);\n return;\n }\n\n const submitProcessContd = (userLab = null, userAward = null) => {\n\n // if editing, use pre-existing award, lab, and submitted_by\n // this should only be done on the primary object\n if (edit && inKey === 0 && context.award && context.lab){\n\n if (currSchema.properties.award && !('award' in finalizedContext)){\n finalizedContext.award = object.itemUtil.atId(context.award);\n }\n\n if (currSchema.properties.lab && !('lab' in finalizedContext)){\n finalizedContext.lab = object.itemUtil.atId(context.lab);\n }\n\n // an admin is editing. Use the pre-existing submitted_by\n // otherwise, permissions won't let us change this field\n if (currentSubmittingUser.groups && _.contains(currentSubmittingUser.groups, 'admin')){\n if (context.submitted_by){\n finalizedContext.submitted_by = object.itemUtil.atId(context.submitted_by);\n } else {\n // use current user\n finalizedContext.submitted_by = object.itemUtil.atId(currentSubmittingUser);\n }\n }\n\n } else if (userLab && userAward && currType !== 'User') {\n // Otherwise, use lab/award of user submitting unless values present\n // Skip this is we are working on a User object\n if (currSchema.properties.award && !('award' in finalizedContext)){\n finalizedContext.award = object.itemUtil.atId(userAward);\n }\n if (currSchema.properties.lab && !('lab' in finalizedContext)){\n finalizedContext.lab = object.itemUtil.atId(userLab);\n }\n }\n\n let destination;\n let actionMethod;\n let deleteFields; // used to keep track of fields to delete with PATCH for edit/round two; will become comma-separated string\n if (roundTwo){ // change actionMethod and destination based on edit/round two\n destination = keyComplete[inKey];\n actionMethod = 'PATCH';\n const alreadySubmittedContext = keyContext[destination];\n // roundTwo flag set to true for second round\n deleteFields = this.buildDeleteFields(finalizedContext, alreadySubmittedContext, currSchema);\n } else if (edit && inKey === 0){\n destination = object.itemUtil.atId(context);\n actionMethod = 'PATCH';\n deleteFields = this.buildDeleteFields(finalizedContext, context, currSchema);\n } else {\n destination = '/' + currType + '/';\n actionMethod = 'POST';\n }\n\n if (test){\n // if testing validation, use check_only=True (see /types/base.py)'\n destination += '?check_only=True';\n } else {\n console.log('FINALIZED PAYLOAD:', finalizedContext);\n console.log('DELETE FIELDS:', deleteFields);\n }\n\n const payload = JSON.stringify(finalizedContext);\n\n // add delete_fields parameter to request if necessary\n if (deleteFields && Array.isArray(deleteFields) && deleteFields.length > 0){\n var deleteString = deleteFields.join(',');\n destination = destination + (test ? '&' : '?') + 'delete_fields=' + deleteString;\n console.log('DESTINATION:', destination);\n }\n\n // Perform request\n ajax.promise(destination, actionMethod, {}, payload).then((response) => {\n if (response.status && response.status !== 'success'){ // error\n stateToSet.keyValid[inKey] = 2;\n if(!suppressWarnings){\n var errorList = response.errors || [response.detail] || [];\n // make an alert for each error description\n stateToSet.errorCount = errorList.length;\n for(i = 0; i<errorList.length; i++){\n var detail = errorList[i].description || errorList[i] || \"Unidentified error\";\n if (errorList[i].name && errorList[i].name.length > 0){\n detail += ('. See ' + errorList[i].name[0] + ' in ' + keyDisplay[inKey]);\n } else {\n detail += ('. See ' + keyDisplay[inKey]);\n }\n Alerts.queue({\n 'title' : \"Validation error \" + parseInt(i + 1),\n 'message': detail,\n 'style': 'danger'\n });\n }\n setTimeout(layout.animateScrollTo(0), 100);\n }\n this.setState(stateToSet);\n } else {\n let responseData;\n let submitted_at_id;\n if (test){\n stateToSet.keyValid[inKey] = 3;\n this.setState(stateToSet);\n return;\n } else {\n [ responseData ] = response['@graph'];\n submitted_at_id = object.itemUtil.atId(responseData);\n }\n // handle submission for round two\n if (roundTwo){\n // there is a file\n if (file && responseData.upload_credentials){\n // add important info to result from finalizedContext\n // that is not added from /types/file.py get_upload\n var creds = responseData.upload_credentials;\n\n require.ensure(['../util/aws'], (require)=>{\n\n var awsUtil = require('../util/aws'),\n upload_manager = awsUtil.s3UploadFile(file, creds);\n\n if (upload_manager === null){\n // bad upload manager. Cause an alert\n alert(\"Something went wrong initializing the upload. Please contact the 4DN-DCIC team.\");\n } else {\n // this will set off a chain of aync events.\n // first, md5 will be calculated and then the\n // file will be uploaded to s3. If all of this\n // is succesful, call finishRoundTwo.\n stateToSet.uploadStatus = null;\n this.setState(stateToSet);\n this.updateUpload(upload_manager);\n }\n }, \"aws-utils-bundle\");\n\n } else {\n // state cleanup for this key\n this.finishRoundTwo();\n this.setState(stateToSet);\n }\n } else {\n stateToSet.keyValid[inKey] = 4;\n // Perform final steps when object is submitted\n // *** SHOULD THIS STUFF BE BROKEN OUT INTO ANOTHER FXN?\n // find key of parent object, starting from top of hierarchy\n var parentKey = parseInt(findParentFromHierarchy(keyHierarchy, inKey));\n // navigate to parent obj if it was found. Else, go to top level\n stateToSet.currKey = (parentKey !== null && !isNaN(parentKey) ? parentKey : 0);\n var typesCopy = _.clone(keyTypes);\n var keyCompleteCopy = _.clone(keyComplete);\n var linksCopy = _.clone(keyLinks);\n var displayCopy = _.clone(keyDisplay);\n // set contextCopy to returned data from POST\n var contextCopy = _.clone(keyContext);\n var roundTwoCopy = roundTwoKeys.slice();\n // update the state storing completed objects.\n keyCompleteCopy[inKey] = submitted_at_id;\n // represent the submitted object with its new path\n // rather than old keyIdx.\n linksCopy[submitted_at_id] = linksCopy[inKey];\n typesCopy[submitted_at_id] = currType;\n displayCopy[submitted_at_id] = displayCopy[inKey];\n contextCopy[submitted_at_id] = responseData;\n contextCopy[inKey] = buildContext(responseData, currSchema, null, true, false);\n stateToSet.keyLinks = linksCopy;\n stateToSet.keyTypes = typesCopy;\n stateToSet.keyComplete = keyCompleteCopy;\n stateToSet.keyDisplay = displayCopy;\n stateToSet.keyContext = contextCopy;\n\n // update roundTwoKeys if necessary\n const needsRoundTwo = this.checkRoundTwo(currSchema);\n if (needsRoundTwo && !_.contains(roundTwoCopy, inKey)){\n // was getting an error where this could be str\n roundTwoCopy.push(parseInt(inKey));\n stateToSet.roundTwoKeys = roundTwoCopy;\n }\n\n // inKey is 0 for the primary object\n if (inKey === 0){\n // see if we need to go into round two submission\n if (roundTwoCopy.length === 0){\n // we're done!\n setIsSubmitting(false, ()=>{\n navigate(submitted_at_id);\n });\n } else {\n // break this out into another fxn?\n // roundTwo initiation\n stateToSet.roundTwo = true;\n stateToSet.currKey = roundTwoCopy[0];\n // reset validation state for all round two keys\n for (i = 0; i < roundTwoCopy.length; i++){\n stateToSet.keyValid[roundTwoCopy[i]] = 0;\n }\n alert('Success! All objects were submitted. However, one or more have additional fields that can be only filled in second round submission. You will now be guided through this process for each object.');\n this.setState(stateToSet);\n }\n } else {\n alert(keyDisplay[inKey] + ' was successfully submitted.');\n this.setState(stateToSet);\n }\n }\n ReactTooltip.rebuild();\n }\n });\n };\n\n if (currentSubmittingUser && Array.isArray(currentSubmittingUser.submits_for) && currentSubmittingUser.submits_for.length > 0){\n // use first lab for now\n ajax.promise(object.itemUtil.atId(currentSubmittingUser.submits_for[0])).then((myLab) => {\n // use first award for now\n var myAward = (myLab && Array.isArray(myLab.awards) && myLab.awards.length > 0 && myLab.awards[0]) || null;\n submitProcessContd(myLab, myAward);\n });\n } else {\n submitProcessContd();\n }\n }" ]
[ "0.6860662", "0.6748037", "0.6680339", "0.6604848", "0.6531904", "0.6427622", "0.62712157", "0.62333924", "0.6172173", "0.61717445", "0.6135642", "0.61161", "0.61148125", "0.61086714", "0.61070997", "0.609814", "0.6085867", "0.607086", "0.6066166", "0.60585475", "0.60429525", "0.60292757", "0.6005681", "0.5989451", "0.5985248", "0.5982515", "0.5975597", "0.5968417", "0.5909221", "0.5906153", "0.58956313", "0.5895267", "0.5894798", "0.5893751", "0.58836883", "0.5877746", "0.5844576", "0.5830254", "0.5807782", "0.58072555", "0.5801596", "0.5796326", "0.5785399", "0.5771323", "0.5767811", "0.5765847", "0.57649493", "0.5761502", "0.5737204", "0.57275766", "0.5714854", "0.5711855", "0.570747", "0.57059425", "0.56983745", "0.5672649", "0.5667531", "0.5666936", "0.5661033", "0.56589544", "0.5657834", "0.5657609", "0.5654432", "0.56537384", "0.56448436", "0.5642865", "0.56345373", "0.56337667", "0.5632208", "0.56310713", "0.5627812", "0.56216383", "0.5619711", "0.5609552", "0.560685", "0.5601052", "0.5598885", "0.55972594", "0.55967194", "0.5594001", "0.5591364", "0.5582503", "0.557557", "0.55754226", "0.55682296", "0.5568039", "0.55650645", "0.5555434", "0.55484504", "0.5547325", "0.55456376", "0.5544617", "0.5538132", "0.5533962", "0.5533901", "0.55329496", "0.5531236", "0.5529481", "0.5526551", "0.5526304", "0.5522661" ]
0.0
-1
inserts new link into database
function insertData(videoLink, videoId, videoThumb, videoTitle) { $.ajax({ url: "checkId.php", type: "GET", data: { id: videoId, }, cache: false, success: function(data) { if (!data) { $.ajax({ url: "insertData.php", type: "POST", data: { link: videoLink, id: videoId, thumbnail: videoThumb, title: videoTitle, }, cache: false, success: function(response) { //fetchNewContent(); $('#message').html('Schefke!'); }, error: function() { $('#message').html(''); } }); } else { $('#message').html('Duplicate content.'); } }, error: function() { $('#message').html('Error'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertLink(title, url) {\n Links.insert({ title, url, createdAt: new Date() });\n}", "function addBrainLink() {\n\t\tvar sourceKey = $('#sourceName').val();\n\t\tvar targetKey = $('#targetName').val();\n\t\tvar notes = $('[name=\"linkNotes\"]').val();\n\t\tvar attrKey = $('#attrName').val();\n\t\tvar attrValue = $('#attrValue').val();\n\t\tvar linkData = {userID: datasetProperties.userID, datasetKey: datasetProperties.key, source: sourceKey, target: targetKey, notes: notes, attrKey: attrKey, attrValue: attrValue};\n\t\tdatabase.addBrainLink(linkData);\n\t}", "function insertBookmark(text, inUrl) {\n bookmarkTable.insert({\n bookmarkname: text,\n created: new Date(),\n url: inUrl\n });\n }", "function insertLink(link) {\n return new Promise((resolve, reject) => {\n db.serialize(async function() {\n let err, card;\n [err, card] = await to(cardDao.checkCardById(link.cardId));\n if (err) {\n console.log(err);\n reject(err);\n } else if (!card) {\n console.log('Card with id >'+link.cardId+'< not found');\n reject('Card not found');\n } else {\n const sql = 'INSERT INTO Link(cardId, value) VALUES(?,?)';\n db.run(sql, [link.cardId, link.value], function(err) {\n if (err) {\n console.log(err);\n reject(err);\n } else {\n console.log('Link with id >'+ this.lastID +'< is added');\n resolve(this.lastID);\n }\n });\n }\n });\n });\n}", "function insertObj(orgUrl, shortUrl) {\n var sites = db.collection('sites');\n sites.insert({\n \"shortUrl\": \"http://camper-api-project-dlagrone1971.c9users.io/short/\" + shortUrl,\n \"orginal_url\" : orgUrl\n }, function(err, data) {\n if(err) throw err;\n console.log(\"The object saved in the database\");\n checkForUrl(orgUrl);\n });\n }", "function addLink() {\n SC.RunLoop.begin();\n Nodelink.store.createRecord(Nodelink.Link, { guid: 'node2', startNode: 'node1', endNode: 'node2' } );\n SC.RunLoop.end();\n}", "addURL(data, callback) {\n this.executeMySQL(\"INSERT INTO data(data_url, status, data_url_md5, site_id) VALUES (?)\", [data]).then(function (success) {\n callback(success);\n }).catch(function (err) {\n // console.log(err);\n callback(false);\n });\n }", "function addLink(){\r\n\tif(getId(\"imgIcoGrupoFrmLink\").src == \"\" || getId(\"imgIcoGrupoFrmLink\").getAttribute(\"sIdGrupoSel\") == \"\"){alert(\"Selecione um grupo para o link!\"); return}\r\n\tif(getId(\"imgLinkSelIco\").src == \"\" || getId(\"imgLinkSelIco\").getAttribute(\"sIdIconSel\") == \"\"){alert(\"Selecione um ícone para o link!\"); return}\r\n\tif(getId(\"txtNomeLink\").value == \"\"){alert(\"Entre com a descrição do link!\"); return}\r\n\tif(getId(\"txtLink\").value == \"\"){alert(\"Entre com o endereço do link!\"); return}\r\n\t\r\n\tif( oXmlDb.query(oLinksXmlDoc, {nome: \"'\" + encodeXml_Disabled(getId(\"txtNomeLink\").value) + \"'\", idGrupo: \"'\" + getId(\"imgIcoGrupoFrmLink\").getAttribute(\"sIdGrupoSel\") + \"'\"}) == null ){\r\n\t\t\r\n\t\tnewId = parseInt(oXmlDb.max(oLinksXmlDoc, \"id|n\"))+1;\r\n\t\t\r\n\t\tvar oObjDados = {\r\n\t\t\t id: newId\r\n\t\t\t,nome: encodeXml_Disabled(getId(\"txtNomeLink\").value)\r\n\t\t\t,idGrupo: getId(\"imgIcoGrupoFrmLink\").getAttribute(\"sIdGrupoSel\")\r\n\t\t\t,idIcone: getId(\"imgLinkSelIco\").getAttribute(\"sIdIconSel\")\r\n\t\t\t,url: encodeXml_Disabled(getId(\"txtLink\").value)\r\n\t\t}\r\n\t\toXmlDb.add(oLinksXmlDoc, oObjDados);\r\n\t\t_sV(llXmlLinks, oXmlDb.getXml(oLinksXmlDoc));\r\n\t\toLinksXmlDoc = oXmlDb.createDoc(_gV(llXmlLinks));\r\n\t\t//alert(\"Link inserido.\");\r\n\t\tlistLinks();\r\n\t\tgetId(\"txtNomeGrupo\").value = \"\";\r\n\t\tgetId(\"imgGrupoSelIco\").src = \"\";\r\n\t\tgetId(\"imgGrupoSelIco\").setAttribute(\"sIdIconSel\", \"\");\r\n\t\t\r\n\t\tllCloseWin(\"llWinFrmLink\");\r\n\t} else {\r\n\t\talert(\"Já existe um link com essa descrição nesse grupo!\");\r\n\t}\r\n}", "function agenda_insert() {\n\tdb.transaction(agenda_insert_db, errorDB, successDB);\n}", "function insertIMDbLinks() {\n\t\tvar movieNodes = getMovieTitles();\n \n\t\tvar i=0;\n while ( movieNodes[i] !=null ) { \n insertRating(movieNodes[i]);\n i++;\n }\n\t}", "function addLink(link, callback) {\n if(Editor.writeAccess && link != null) {\n socket.emit(\"link/add\", link, function (data) {\n callback(data);\n });\n }\n}", "function _addLink() {\n\n\t\t\tvar _item = {\n\n\t\t\t\tname: vm.formData.linkName,\n\t\t\t\tredirect_url: vm.formData.linkUrl\n\n\t\t\t};\n\n\t\t\t// disable further removals for 1s\n\t\t\tvm.disableAdd = true;\n\n\t\t\t// set timeout to wait localstorage update (~1s enough?)\n\t\t\t$timeout( function() {\n\n\t\t\t\t// add single item to storage (_itemAdded is dummy server response, newly added item)\n\t\t\t\tvar _itemAdded = LinkVoteChallengeService.addItem( _item );\n\n\t\t\t\t// disable further removals for 1s\n\t\t\t\tvm.disableAdd = false;\n\n\t\t\t\tif( _itemAdded ) {\n\n\t\t\t\t\t// @see toaster.controller.js\n\t\t\t\t\t$rootScope.$broadcast( 'mso.showToaster', { toasterType: 'mso.itemAdded', targetItem: { item: _item } } );\n\n\t\t\t\t\tvm.link = _itemAdded;\n\n\t\t\t\t\t// clear form\n\t\t\t\t\tvm.formData = { linkName: '', linkUrl: '' };\n\n\t\t\t\t}\n\n\t\t\t}, 1000 );\n\n\t\t}", "function saveDataIntoDB(url) {\n // Feed the database\n var dbObj = getEntityCustomData('infoKey', dataBaseID, null);\n if(dbObj) {\n var myName = MyAvatar.displayName ? MyAvatar.displayName : \"Anonymous\";\n dbObj.dbKey[dbObj.dbKey.length] = {name: myName, score: scoreAssigned, clip_url: url};\n setEntityCustomData('infoKey', dataBaseID, dbObj);\n print(\"Feeded DB: \" + url);\n }\n }", "function pushData(e){\n e.preventDefault();\n //Values\n const link = document.querySelector('.movie-link').value;\n if(link != '' && id != ''){\n db.collection(\"movie\").add({\n link: link,\n id: id,\n timestamp:today\n })\n .then(function(docRef) {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch(function(error) {\n console.error(\"Error adding document: \", error);\n });\n }\n else console.log('Missing')\n \n \n \n\n}", "function add_link(link_name) {\n document.querySelector(\"#link-view\").style.display = \"none\"\n document.querySelector(\"#add_link-view\").style.display = \"block\"\n \n document.querySelector(\"#add_link-view\").innerHTML = `<form id='add_link'><div class=\"input-group mb-3\">\n <input type=\"text\" class=\"form-control\" placeholder=\"URL\" id=\"basic_url\" aria-describedby=\"basic-addon3\"> </div>\n <div class=\"input-group mb-3\"> <input type=\"text\" class=\"form-control\" placeholder=\"Name\" id=\"basic_name\" aria-describedby=\"basic-addon3\"> \n </div> <button type=\"submit\" class=\"add_link btn btn-dark\" name=\"add_link\">Add Link</button></form>`\n\n // Submit link and add to database\n document.querySelector('#add_link').onsubmit = function() {\n fetch(`/add`, {\n method: 'POST',\n body: JSON.stringify({\n name: document.querySelector('#basic_name').value,\n subject: link_name,\n link: document.querySelector('#basic_url').value\n }) \n })\n } \n }", "function insert() {\r\n let query = \"command=insert\"; //https://eia2-michel.herokuapp.com/command=insert&name=peter&punkte=100\r\n query += \"&name=\" + HabosHaihappen.spielerName;\r\n query += \"&punkte=\" + HabosHaihappen.highscore;\r\n sendRequest(query, handleInsertResponse);\r\n }", "function addData(ip, port, urlbase, alias, use, site,pin) {//aqui se hace uin insert\n\ttry {\n\t\tvar query = \"INSERT INTO \" + TABLE_URL + \" ( \" + KEY_IP + \" , \" + KEY_PORT\n\t\t\t\t+ \" , \" + KEY_URLBASE + \", \" + KEY_ALIAS + \" , \" + KEY_USE + \", \" + KEY_SITE +\" , \"+KEY_PIN+\") VALUES (?,?,?,?,?,?,?);\";\n\t\tlocalDB.transaction(function (transaction) {\n\t\t\ttransaction.executeSql(query, [ip, port, urlbase, alias, use, site,pin], function (transaction, results) {\n\t\t\t\t\n\t\t\t\t//direcciona al MENU.html\n\t\t\t\t//window.location.href = \"data/menu.html\";\n\t\t\t}, errorHandler);\n\t\t});\n\t} catch (e) {\n\t\tconsole.log(\"Error addData \" + e + \".\");\n\t}\n}", "function populateLink() {\n for (let i = 0; i < dataSet.length; i++) {\n link.insertLast(dataSet[i]);\n }\n}", "function insertNewJenkins(jenkins_name, jenkins_url){\n\n var db = getDatabase();\n var res = \"\";\n db.transaction(function(tx) {\n\n var rs = tx.executeSql('INSERT INTO jenkins_data (jenkins_name, jenkins_url) VALUES (?,?);', [jenkins_name, jenkins_url]);\n if (rs.rowsAffected > 0) {\n res = \"OK\";\n } else {\n res = \"Error\";\n }\n }\n );\n return res;\n }", "async createLink () {\n\t\tconst thing = this.codemark || this.review || this.codeError;\n\t\tconst type = (\n\t\t\t(this.codemark && 'c') ||\n\t\t\t(this.review && 'r') ||\n\t\t\t(this.codeError && 'e')\n\t\t);\n\t\tconst attr = (\n\t\t\t(this.codemark && 'codemarkId') ||\n\t\t\t(this.review && 'reviewId') ||\n\t\t\t(this.codeError && 'codeErrorId')\n\t\t);\n\t\tconst linkId = UUID().replace(/-/g, '');\n\t\tthis.url = this.makePermalink(linkId, this.isPublic, thing.teamId, type);\n\t\tconst hash = this.makeHash(thing, this.markers, this.isPublic, type);\n\n\t\t// upsert the link, which should be collision free\n\t\tconst update = {\n\t\t\t$set: {\n\t\t\t\tteamId: thing.teamId,\n\t\t\t\tmd5Hash: hash,\n\t\t\t\t[attr]: thing.id\n\t\t\t}\n\t\t};\n\n\t\tconst func = this.request.data.codemarkLinks.updateDirectWhenPersist ||\n\t\t\tthis.request.data.codemarkLinks.updateDirect;\t// allows for migration script\n\t\tawait func.call(\n\t\t\tthis.request.data.codemarkLinks,\n\t\t\t{ id: linkId },\n\t\t\tupdate,\n\t\t\t{ upsert: true }\n\t\t);\n\t}", "insert() {\r\n var sql = 'INSERT INTO post (id, title, text) VALUES (?,?,?)'\r\n var params = [this.id, this.title, this.text]\r\n db.run(sql, params, function (err, result) {\r\n if (err) {\r\n throw err // TODO: useful error handling here...\r\n return\r\n }\r\n });\r\n }", "function createNewUrl(response, request, db) {\n var collection = db.collection('urlStorage');\n collection.findOne({\"url\": request.params.input}, function(err, doc) {\n if(err) dbErrorHandle(err, response);\n \n if (doc) {\n console.log(\"Request for an existing url has been made.\");\n return response.json({url: \"https://bennett-url-shortener.herokuapp.com/\" + doc.id.toString(), old: request.params.input});\n } else {\n console.log(\"Generating new url.....\");\n var url = {id: Math.floor(Math.random()*(10000-1000+1)+1000) , url: request.params.input};\n collection.insert(url, function(err,result) {\n if(err) dbErrorHandle(err, response);\n else {\n response.json({url: \"https://bennett-url-shortener.herokuapp.com/\" + result.ops[0].id.toString(), old: request.params.input});\n db.close();\n }\n });\n }\n });\n}", "function addHistory(url) {\n var date = new Date();\n var db = getDatabase();\n var res = \"\";\n db.transaction(function(tx) {\n // Remove and readd if url already in history\n var rs0 = tx.executeSql('delete from history where url=(?);',[url]);\n if (rs0.rowsAffected > 0) {\n console.debug(\"Url already found and removed to readd it\");\n } else {\n console.debug(\"Url not found so add it newly\");\n }\n\n var rs = tx.executeSql('INSERT OR REPLACE INTO history VALUES (?,?);', [date.getTime(),url]);\n if (rs.rowsAffected > 0) {\n res = \"OK\";\n console.log (\"Saved to database\");\n } else {\n res = \"Error\";\n console.log (\"Error saving to database\");\n }\n }\n );\n // The function returns “OK” if it was successful, or “Error” if it wasn't\n return res;\n}", "function insertingLinksToCollection (item, linked) {\n let linksNumbering=0;\n for( let i=0; i<linked.length; i++ ) {\n item.links[linksNumbering++] = {\n 'rel': linked[i][0],\n 'href': linked[i][1],\n 'prompt': linked[i][0]\n }\n }\n }", "function pet_insert() {\n\tdb.transaction(pet_insert_db, errorDB, successDB);\n}", "redisInsert(url) {\n client.set(url.shortURL, JSON.stringify(url));\n }", "function insert_Link_To_DB(\n db//: mongoDB obj <- optional == collection.s.db;\n ,collection//: mongoDB obj\n ,document_Obj//: dict\n //request,//: HTTP(S) obj <- ? optional ?\n //,response//: HTTP(S) obj\n //,json_Response_Obj//: dict <- ? optional ?\n //host, //protocol + // + host_name\n //source_Link,// str <- optional\n //,context_Message//: str <- optional\n ,is_Debug_Mode//: bool <- optional\n) {//: => thenable Promise => ((null | void | Unit) | error)\n \"use strict\";\n //const\n //var response_Helpers = require('./response_Helpers.js');\n var collection_Size = 0;\n //var short_Link; // = \"\";// = document_Obj.short_Link\n //var source_Link;\n //var json_Response_Obj = {};\n var message = \"? error message ?\";\n\n //*** positional arguments ***//\n //*** defaults ***//\n //document_Obj = document_Obj ? document_Obj : {};\n //json_Response_Obj = json_Response_Obj ? json_Response_Obj : {};\n /*\n if (context_Message) {\n } else {\n context_Message = \"request.on 'end' query.allow insertOne\";\n }\n */\n //if (is_Debug_Mode) {console.log('db:', db);}\n if (is_Debug_Mode) {console.log('db == null or undefined:', (db == null || db == undefined));}\n if (is_Debug_Mode) {console.log('typeof db:', typeof(db));}\n if (db) {} else {\n db = collection.s.db;\n //if (is_Debug_Mode) {console.log('collection.s.db:', db);}\n if (is_Debug_Mode) {console.log(\n 'db == null or undefined:', (db == null || db == undefined));}\n }\n //*** defaults end ***//\n\n // guard\n // currently fires before link was generated\n if (document_Obj.short_url) {\n var short_url = document_Obj.short_url;\n\n if (is_Debug_Mode) {console.log('short_url:', short_url, \"provided\");}\n\n } else {\n message = 'undefined / empty document_Obj.short_url';\n\n /* finally */\n if (db) {\n db.close();\n if (is_Debug_Mode) {console.log(\"Close db after link insert\");}\n }\n if (is_Debug_Mode) {console.log(message);}\n //new Error(message)\n return Promise.reject(new Error(message));\n }\n\n\n //return Promise\n // .resolve(() => {\n /// .resolve(\n return collection\n // collection\n // insertOne(doc, options, callback) => {Promise}\n .insertOne(\n document_Obj\n //JSON.stringify(document_Obj)\n )\n .then((result) => {//.result.n\n //console.log(JSON.stringify(document_Obj));\n if (is_Debug_Mode) {console.log('inserted document_Obj: %j', document_Obj);}\n if (is_Debug_Mode) {console.log(\"result.result.n:\", result.result.n);}\n //console.log('result.result: %j', result.result);\n\n /* finally */\n if (db) {\n db.close();\n if (is_Debug_Mode) {console.log(\"Close db after link insert(ion/ed)\");}\n }\n\n return Promise.resolve(result.result.ok);\n }\n )\n .catch((err) => {\n // \"E11000 duplicate key error index:\n // links.$original_url_text_short_url_text dup key: { : \\\"com\\\", : 0.625 }\n if (is_Debug_Mode) {console.log('(collection / cursor).insertOne() error:', err.stack);}\n /* finally */\n if (db) {\n db.close();\n if (is_Debug_Mode) {console.log(\"Close db after insertOne().catch()\");}\n }\n\n return Promise.reject(err);\n }\n );\n //}()\n //);\n\n //return //null;//side effect //void //Unit\n}", "function addNewFB(queryURL) {\n // Save the new data in Firebase\n database.ref().push({\n food: food,\n place: place,\n queryURL: queryURL,\n dateAdded: firebase.database.ServerValue.TIMESTAMP\n });//End push \n }", "function newUrl() {\n\trecordUrl();\n\n\tconstructUrlMarkup(2);\n}", "function addLink(link) {\n links.push(link);\n console.log('Connecting node [' + link.firstId + '] and [' + link.secondId + ']');\n }", "function insertURL() {\n\twindow.location = \"insert.jsp\";\n}", "function addEntry(entry, callback){\n var id = generateEntryID();\n conn.query('INSERT INTO Entries (entry_id, collection_id, entry_number, author, title, '+\n 'date_submitted, subject, content)' + \n 'VALUES ($1, $2, $3, $4, $5, $6, $7, $8)', \n [\n id,\n entry.collection_id,\n entry.entry_number,\n entry.author, \n entry.title,\n entry.date_submitted,\n entry.subject,\n entry.content\n ]).on('error', console.error).on('end', function() {\n callback(id);\n });\n}", "function agenda_insert_db(tx) {\n\tvar nome = $(\"#agenda_nome\").val();\n\tvar tel = $(\"#agenda_telefone\").val();\n\ttx.executeSql('INSERT INTO Agenda (nome, tel) VALUES (\"' + nome + '\", \"' + tel + '\")');\n\tagenda_view();\n}", "function createLink(user, skill){\n\t\tdb.get('SELECT id FROM users WHERE username = ?', [user], function(err, uid){\n\t\t\t\tdb.get('SELECT id FROM skills WHERE skill_name = ?', [skill], function(err, sid){\n\t\t\t\t\tdb.run('INSERT INTO user_skills (user_id, skill_id) VALUES (?, ?)', [uid.id, sid.id]);\n\t\t\t\t\tconsole.log (uid.id + \",\" + sid.id);\n\t\t\t\t});\n\t\t\t});\n\t}", "function AddLink(link, sender) {\n var targetUrlStr = UrlHostPathname(link.target);\n\n if (blackListedUrls.has(targetUrlStr))\n return;\n\n var nodes = sessions[currentSession].nodes;\n\n // insert target node\n if (!(nodes[targetUrlStr])) {\n nodes[targetUrlStr] = {\n url: targetUrlStr,\n rawUrl: link.target,\n title: link.title,\n };\n } else {\n nodes[targetUrlStr].title = link.title;\n }\n\n // timestamp\n //if (!(nodes[targetUrlStr].timestamps)) {\n // nodes[targetUrlStr].timestamps = [];\n //}\n //nodes[targetUrlStr].timestamps.push(Date.now());\n var date = new Date();\n nodes[targetUrlStr].hours = date.getHours();\n nodes[targetUrlStr].minutes = date.getMinutes();\n\n // check that source URL is a nonempty string\n if (link.source.length > 0) {\n var sourceUrlStr = UrlHostPathname(link.source);\n\n // check for a self loop\n if (sourceUrlStr != targetUrlStr) {\n var forwardLinks = sessions[currentSession].forwardLinks;\n var backLinks = sessions[currentSession].backLinks;\n\n // insert source vertex\n if (!(nodes[sourceUrlStr])) {\n nodes[sourceUrlStr] = {\n url: sourceUrlStr,\n rawUrl: link.source\n };\n }\n\n if (!(forwardLinks[sourceUrlStr])) {\n forwardLinks[sourceUrlStr] = new Set();\n }\n if (!(backLinks[targetUrlStr])) {\n backLinks[targetUrlStr] = new Set();\n }\n\n // add vertices to the adjacency lists\n forwardLinks[sourceUrlStr].add(targetUrlStr);\n backLinks[targetUrlStr].add(sourceUrlStr);\n }\n }\n}", "function updateLink() {\n const url = urlInput.value;\n const name = nameInput.value;\n editBookmark({url, name, key}, () => {\n renderBookmarks(pagination.currentPage);\n cancelEdit();\n });\n }", "function insertAwesome(db) {\n awesome.forEach(movie => {\n const sql = 'INSERT INTO awesome(link, id, metascore, rating, synopsis, title, votes, year) ' +\n 'VALUES(\"' + movie.link + '\", \"' + movie.id + '\", ' + movie.metascore + ', ' + movie.rating +\n ', \"' + movie.synopsis + '\", \"' + movie.title + '\", ' + movie.votes + ', ' + movie.year + ')';\n db.run(sql);\n })\n console.log(\"Data from the awesome.json file were inserted in the database.\");\n}", "function postLink(link_title, link_address, callback) {\n var data = {\n title: link_title,\n link: link_address\n }\n\n $.post('./api/links/create', data, function(link) {\n callback(link)\n })\n}", "function insertInto(entry, db){\n if (entry.type =='node'){\n db.nodes.insert(entry)\n }\n else if (entry.type == 'edge'){\n db.edges.insert(entry)\n }\n else{\n console.log(\"attempt made to insert entry of unspecified type. Ignoring...\");\n }\n}", "function insertBookToDB(book)\n{\n\talert(\"insertBookToDB\");\n if(db == null)\n {\n alert('Databases are not supported in this browser.');\n return; \n }\n db.transaction(function (tx) {\n tx.executeSql(('INSERT INTO books VALUES (?,?,?,?,?);'), [book.identifier,book.name,book.author,book.coverimage,book.bookpath],\n \t\t null,\n \t\t errorHandler); \n });\n}", "function linkPush() {\n\tconst linksDiv = document.querySelector('.links');\n\tvar iLink = this;\n\tiLink.classList.remove('choose');\n\tiLink.id = iLink.getAttribute('data-id');\n\n\tvar a = document.createElement('a');\n\ta.href = data[iLink.id][0];\n\ta.target = '_blank';\n\ta.append(iLink);\n\tlinksDiv.append(a);\n\t// console.log(iLink);\n\tupdateData(iLink); // function to update data in storage\n}", "function insertURL() {\n telemetry_1.reporter.sendTelemetryEvent(\"command\", { command: telemetryCommandLink + \".external\" });\n const editor = vscode.window.activeTextEditor;\n if (!editor) {\n common_1.noActiveEditorMessage();\n return;\n }\n const selection = editor.selection;\n const selectedText = editor.document.getText(selection);\n const options = {\n placeHolder: \"URL입력\",\n validateInput: (urlInput) => urlInput.startsWith(\"http://\") || urlInput.startsWith(\"https://\") ? \"\" :\n \"http:// or https:// 이 URL로 필요합니다. Prefix가 없으면 링크가 추가 되지 않습니다.\",\n value: \"https://\",\n valueSelection: [8, 8],\n };\n vscode.window.showInputBox(options).then((val) => {\n // If the user adds a link that doesn't include the http(s) protocol, show a warning and don't add the link.\n if (val === undefined) {\n common_1.postWarning(\"문법이 옳지 않습니다. 명령어를 삭제합니다.\");\n }\n else {\n let contentToInsert;\n if (selection.isEmpty) {\n contentToInsert = utility_1.externalLinkBuilder(val);\n common_1.insertContentToEditor(editor, insertURL.name, contentToInsert);\n }\n else {\n contentToInsert = utility_1.externalLinkBuilder(val, selectedText);\n common_1.insertContentToEditor(editor, insertURL.name, contentToInsert, true);\n }\n common_1.setCursorPosition(editor, selection.start.line, selection.start.character + contentToInsert.length);\n }\n });\n}", "function insertMessage(messageHeading, messageContent, downloadURL, time) {\n\n\t\tvar newsAndEventsRef = firebase.database().ref(\"clients/client-02/app_home/message_to_users\");\n\n\t\tnewsAndEventsRef.child(time).set({\n\t\t\tmessage_heading: messageHeading,\n\t\t\tmessage_content: messageContent,\n\t\t\timage_url: downloadURL\n\t\t});\n\t}", "function new_entry(id, content, result, user) {\n db.query('CREATE TABLE IF NOT EXISTS submissions(id BIGINT NOT NULL AUTO_INCREMENT, problem TEXT, content TEXT, result TEXT, user TEXT, PRIMARY KEY (id))', function(err, r) {\n if (err) throw err;\n db.query('INSERT INTO submissions (problem, content, result, user) value (?, ?, ?, ?)', [id, content, result, user], function(err, r) {\n if (err) throw err;\n });\n });\n}", "function insertNewsData(fullName, placeName, newsHeading, newsContent, downloadURL, time) {\n\n\t\tvar newsAndEventsRef = firebase.database().ref(\"clients/client-02/app_home/news_and_events\");\n\n\t\tnewsAndEventsRef.child(time).set({\n\t\t\tfull_name: fullName,\n\t\t\tplace_name: placeName,\n\t\t\tnews_heading: newsHeading,\n\t\t\tnews_content: newsContent,\n\t\t\timage_url: downloadURL\n\t\t});\n\t}", "function insertMessageCapcodeLink(p2000MessageId, capcodeId, connection, docSequence, isNum, endNum, capcodeInsertedCallback){\n\n\t//if(debug) console.log('Item: ' + isNum + ', ' + endNum);\n\t// Check if the link between the message and the capcode already exists\n\tvar query = connection.query('SELECT * FROM message_has_capcode WHERE message_id=\"'+p2000MessageId+'\" AND capcode_id=\"'+capcodeId+'\" LIMIT 1', function(err, rows, fields) {\n\t\n\t\tif (err){\n\t\t\t\n\t\t\tcapcodeInsertedCallback('broken', docSequence, connection);\n\t\t\t\t\n\t\t\tif(!debug) return;\n\t\t\t\n\t\t\tif(err.code == \"ER_DUP_ENTRY\") return; // Skip this common error\n\t\t\tconsole.log( 'Error during the message-capcode link check' ); \n\t\t\tconsole.log( err ); \n\t\t\treturn; // throw err;\n\t\t}\n\t\t\n\t\t// The link doesnt exist yet; add it to the database\n\t\tif(typeof rows[0] == \"undefined\" || rows[0] == null){\n\t\n\t\t\t// Now insert the link between the message and the capcode in the link-table\n\t\t\tvar query = connection.query('INSERT INTO message_has_capcode (message_id, capcode_id) VALUES (\"'+p2000MessageId+'\", \"'+capcodeId+'\")', function(err, result) {\n\n\t\t\t\tif (err){\n\t\t\t\t\t\n\t\t\t\t\tif(debug) console.log('err insert mes cap link');\n\t\t\t\t\tbrokenMessages++; // Since processing is stopped from here on anyway; mark it as broken\n\t\t\t\t\tfinishProcessingMessage(docSequence, connection);\n\t\t\t\t\t\t\n\t\t\t\t\tif(!debug) return;\n\t\t\t\t\t\n\t\t\t\t\tconsole.log( 'Error inserting the message-capcode link' ); \n\t\t\t\t\tconsole.log( err ); \n\t\t\t\t\treturn; // throw err;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tinsertedCapcodeLinks++;\n\t\t\t\t//console.log('Inserted a link between the message ('+p2000MessageId+') and the capcode ('+capcodeId+') to the database');\n\t\t\t\t\n\t\t\t\t// Is this the last capcode in a row of multiple capcodes?\n\t\t\t\t// Use actual callbacks since previous capcodes may not have finished yet (and thus lose their connection because of this finish)\n\t\t\t\tcapcodeInsertedCallback('inserted', docSequence, connection);\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\tcapcodeLinksAlreadyExisted++;\n\t\t\t\n\t\t\t// Is this the last capcode in a row of multiple capcodes?\n\t\t\t// Use actual callbacks since previous capcodes may not have finished yet (and thus lose their connection because of this finish)\n\t\t\tcapcodeInsertedCallback('inserted', docSequence, connection);\n\t\t\t\n\t\t}\n\t\t\n\t});\n}", "function add_fields(link, association, content) {\n var new_id = new Date().getTime();\n var regexp = new RegExp(\"new_\" + association, \"g\")\n $(link).up().insert({\n before: content.replace(regexp, new_id)\n });\n }", "handleAddLink(target, url) {\n const { editorState, isDirty } = this.state;\n const { delegate } = this.props;\n this.setState(() => ({\n editorState: createLinkAtSelection(editorState, target, url),\n }), () => {\n if (!isDirty) {\n delegate.handleDirtyEditor();\n }\n });\n }", "function addNewItem(item, collection, db){\n var twitter = db.db(\"twitter\");\n twitter.collection(collection).insert(item, function(err, res) {\n if (err) throw err;\n console.log(\"New item added to database: \", res.insertedIds[0]);\n });\n}", "function editLink(name, url) {\n document.getElementById('edit-link').style.display = 'flex';\n document.getElementById('links-ul').style.display = 'none';\n\n document.getElementById('edit-name').value = name;\n document.getElementById('edit-url').value = url;\n let oldname = name;\n //edit and save changes\n document.getElementById('editbtn').addEventListener('click', function() {\n\n let _url = document.getElementById('edit-url').value;\n let _name = document.getElementById('edit-name').value;\n if (validURL(_url) && _name.trim() !== '') {\n db.child(uid).child('links').child('link').child(oldname).set(null);\n db.child(uid).child('links').child('link').child(_name).child('url').set(_url);\n window.location.reload();\n } else {\n alert('Please enter a valid url and name');\n }\n });\n\n document.getElementById('closes').addEventListener('click', function() {\n document.getElementById('edit-link').style.display = 'none';\n document.getElementById('links-ul').style.display = 'flex';\n\n });\n\n //deletelink\n document.getElementById('editdel').addEventListener('click', function() {\n document.getElementById('edit-name').value = name;\n document.getElementById('edit-url').value = url;\n deleteLink(name);\n\n });\n\n\n}", "function insertUserHistory(db_route, history_entry){\r\n\r\n\tdb_route.once('value', (snapshot) => {\r\n\t\t\tdb_route.push(history_entry)\r\n\r\n\t})\r\n}", "function addLinkToDiagram(link) {\n diagram.startTransaction();\n model.addLinkData({\n //key: link._id,\n type: link.type,\n from: link.from,\n to: link.to,\n dash: link.dash\n });\n diagram.commitTransaction(\"update\");\n modelLinkWithoutFilter.push(link);\n}", "async function addRefereeToDB(first_name,last_name){\n await DButils.execQuery(\n `insert into dbo.Referees (first_name, last_name) \n values ('${first_name}', '${last_name}')`\n );\n }", "function insertEntry( dbc ) {\n\n var query,\n binds = [],\n options = { autoCommit: true };\n\n query = ' INSERT INTO testdta.F559811 VALUES (:jpfndfuf2, :jpsawlatm, :jpactivid, :jpyexpst, :jpblkk, :jppid, :jpjobn, :jpuser, :jpupmj, :jpupmt ) ';\n binds.push( row[ 0 ] );\n binds.push( audit.createTimestamp() );\n binds.push( hostname );\n binds.push( '100' );\n binds.push( row[ 1 ] + ' ' + row[ 2 ] );\n binds.push( 'PDFMONITOR' );\n binds.push( 'CENTOS' );\n binds.push( 'DOCKER' );\n binds.push( row[ 1 ] );\n binds.push( row[ 2 ] );\n\n // Insert entry into the F559811 DLINK Post PDF Handling Queue\n odb.performSQL( dbc, query, binds, options, function( err, result ) {\n\n if ( err ) {\n \n result = jdeJobName + ' INSERT FAILED ' + err;\n\n } else {\n\n result = jdeJobName + ' INSERTED' ;\n\n }\n\n log.i( result );\n return cb( null, result );\n\n });\n }", "function addUrl(longUrl, user) {\n let newShortUrl = \"\";\n do {\n newShortUrl = generateRandomString(6);\n } while(urlDatabase[newShortUrl])\n urlDatabase[newShortUrl] = { url: longUrl, userID: user };\n return newShortUrl;\n}", "function saveUrl(){\n var input_field = $(\"#input_field\");\n var url = input_field.val();\n input_field.val(\"\");\n\n if(!re_weburl.test(url)){\n input_field.addClass(\"warn\");\n input_field.attr(\"placeholder\", \"Invalid URL\");\n\n setTimeout(function(){\n input_field.removeClass(\"warn\");\n input_field.attr(\"placeholder\", \"Enter your URL here http://...\");\n },1000);\n return;\n }\n /**\n * Change id implementation to a combination of user+url, so\n * that you have to only filter for id later(you can \"find\" the id\n * out by combining url and username --> for now do a double check.\n * // WILL NOT IMPLEMENT\n * */\n var obj = {\n title: url,\n id: $('#user_name').text() + parseInt(new Date().getTime()),\n //TODO: This way of array initalization is very lame, fix this when you're finished.\n positive: ['System_Zafer', 'System_Cemil'],\n negative: ['System_Niyazi', 'System_Dogan'],\n counter: 0,\n url: url,\n user: $('#user_name').text(),\n date: new Date().getTime()\n };\n\n $.ajax({\n url: \"/Links\",\n method:\"PUT\",\n data: obj,\n success: function(){\n console.log(\"Successfully sent data\");\n updateAllLinks();\n },\n error: function(data){\n var parsedData = JSON.parse(data.responseText);\n var errorDiv = $(\"#error\");\n errorDiv.html(parsedData.message);\n errorDiv.addClass(\"warn\");\n setTimeout(function(){\n $(\"#error\").removeClass(\"warn\");\n },2000);\n console.log('Something went wrong');\n }\n });\n }", "function add_item_to_favorites_database( item_url, item_slug, item_type ) {\n\n\t/* Debug */\n\n\tif ( !!Buleys.debug ) {\n\t\tconsole.log( 'add_item_to_favorite_database()', item_url, item_slug, item_type );\n\t}\n\n\t/* Action */\t\n\n\tjQuery(document).trigger('add_item_to_favorites_database');\n\n\t/* Setup */\n\n\tvar data = {\n\t\t\"link\": item_url,\n\t\t\"modified\": new Date().getTime()\n\t};\n\n\t/* Callbacks */\n\n\tvar add_on_success = function ( context ) {\n\t\n\t};\n\n\tvar add_on_error = function ( context ) {\n\n\t};\n\n\t/* Request */\n\n\tInDB.trigger( 'InDB_do_row_add', { 'store': 'favorites', 'data': data, 'on_success': add_on_success, 'on_error': add_on_error } );\n\n}", "function setNewUserUrl(url){\n\tconsole.log(\"NEW URL, \", url)\n $(\"#addUser\").attr(\"href\", url);\n}", "handleInsert(data) {\n // need to move to bookmarked selection before modal inserts, due to an IE11 bug\n const editor = this.getElement().getEditor().getInstance();\n editor.selection.moveToBookmark(this.getBookmark());\n\n const attributes = this.buildAttributes(data);\n const sanitise = createHTMLSanitiser();\n const linkText = sanitise(data.Text);\n this.insertLinkInEditor(attributes, linkText);\n this.close();\n\n return Promise.resolve();\n }", "function addCPNlinkToPage(){\n\t\tcpn_url = location.href.match(/^(http.+\\/)[^\\/]+$/ )[1]+\"/savefiles/\"+$('#model_name').val()+\".cpn\";\n\n\t\t$.get(cpn_url).done(function() { \n \t\tsay('<a href=\"'+cpn_url+'\">CPN file</a> created');\n \t\t}).fail(function() { \n \t\tsay('CPN file does not exist!');\n \t\t});\t\t\n\t}", "function makeLink(url, text) {\n const selection = document.getSelection();\n document.execCommand('createLink', true, url);\n selection.anchorNode.parentElement.target = '_blank';\n selection.anchorNode.parentElement.innerHTML = text;\n showPostPreview();\n}", "function addPost(post) {\n return db.query(\"insert into post (user_id, post_subject, post_content, post_topic_code) \"\n + \"values ( ?, ?, ?, ? );\", [post.user_id, post.subject, post.content, post.topic]);\n}", "function save() {\r\n var site_name = document.getElementById(\"site_Name\").value;\r\n dev_name = document.getElementById(\"dev_Name\").value;\r\n var test_num = document.getElementById(\"try_num\").value;\r\n var language = document.getElementById(\"language\").value;\r\n\r\n database.ref('test/' + dev_name).set({\r\n siteName : site_name,\r\n developer : dev_name,\r\n testNumber : test_num,\r\n lSitLanguage : language\r\n });\r\n\r\n alert('saved');\r\n }", "function addHotelToDb(args, onSuccess, onError){\n const hotel = new Hotel(args)\n hotel.save((err, success) => {\n if (err) {\n console.log(err)\n onError(err)\n }\n else {\n console.log(success)\n onSuccess(success)\n }\n })\n}", "function updateLink(id, link) {\n return new Promise((resolve, reject) => {\n const sql = 'UPDATE Link SET value = ? WHERE id = ?';\n db.run(sql, [link.value, link.id], (err) => {\n if (err) {\n console.log(err);\n reject(err);\n } else {\n resolve(true);\n }\n });\n });\n}", "function add(req, res, next) {\r\n db.collection('clubs').insertOne({\r\n club: req.body.club,\r\n time: req.body.time,\r\n description: req.body.description\r\n }, done);\r\n \r\n function done(err, data) {\r\n if (err) {\r\n next(err);\r\n } else {\r\n res.redirect('/' + data.insertedId);\r\n }\r\n }\r\n}", "function addPage(content, urlString) {\n mongo.connect(\n url,\n {\n useNewUrlParser: true,\n useUnifiedTopology: true\n },\n (err, client) => {\n if (err) {\n console.error(err);\n return;\n }\n // Access the page database and get the pages collection.\n // This is the collection used to store all of the user-created pages\n const db = client.db(\"pagedb\");\n const collection = db.collection(\"pages\");\n\n // Add the user's page to the database\n collection.insertOne({\n url: urlString,\n content: content\n });\n\n }\n );\n}", "function drawLink() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.link, insertTexts.link, url);\n}", "function awsDBwrite(uuid, thumb, titleEN, bodyEN, keysEN, titleFR, bodyFR, keysFR, topicCat) {\n\t//Insert a new content table row for the FGP entry\n\t\n\tcon.query('INSERT INTO fgpwp_content (uuid, thumbnailURL, titleEN, bodyEN, keywordsEN, titleFR, bodyFR, keywordsFR, topic) VALUES (\"'+uuid+'\", \"'+thumb+'\", \"'+titleEN+'\", \"'+bodyEN+'\", \"'+keysEN+'\", \"'+titleFR+'\", \"'+bodyFR+'\", \"'+keysFR+'\", \"'+topicCat+'\")');\n}", "function registerLinkClick(queryTerm, rank, linkText, url, documentId, searchActionId) {\n var pageNumber = \"0\";\n var linkClickUrl = $('#solrquest #linkClickUrl').val();\n\n if (!url || url == \"#\") {\n url = \"undefined\";\n }\n\n var registerLinkClickUrl = linkClickUrl + \"&url=\" + url + \"&rank=\" + rank + \"&linkText=\" + linkText\n + \"&documentId=\" + documentId + \"&queryTerm=\" + queryTerm + \"&searchActionId=\" + searchActionId + \"&pageNumber=\" + pageNumber;\n\n // console.log(registerLinkClickUrl);\n\n jQuery.ajax({\n type: \"POST\",\n global: false,\n url: registerLinkClickUrl\n });\n }", "function et2_insertLinkText(_text, _node, _target)\n{\n\tif(!_node)\n\t{\n\t\tegw.debug(\"warn\", \"et2_insertLinkText called without node\", _text, _node, _target);\n\t\treturn;\n\t}\n\n\t// Clear the node\n\tfor (var i = _node.childNodes.length - 1; i >= 0; i--)\n\t{\n\t\t_node.removeChild(_node.childNodes[i]);\n\t}\n\n\tfor (var i = 0; i < _text.length; i++)\n\t{\n\t\tvar s = _text[i];\n\n\t\tif (typeof s == \"string\" || typeof s == \"number\")\n\t\t{\n\t\t\t// Include line breaks\n\t\t\tvar lines = s.split ? s.split('\\n') : [s];\n\n\t\t\t// Insert the lines\n\t\t\tfor (var j = 0; j < lines.length; j++)\n\t\t\t{\n\t\t\t\t_node.appendChild(document.createTextNode(lines[j]));\n\n\t\t\t\tif (j < lines.length - 1)\n\t\t\t\t{\n\t\t\t\t\t_node.appendChild(document.createElement(\"br\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(s.text)\t// no need to generate a link, if there is no content in it\n\t\t{\n\t\t\tif(!s.href)\n\t\t\t{\n\t\t\t\tegw.debug(\"warn\", \"et2_activateLinks gave bad data\", s, _node, _target);\n\t\t\t\ts.href = \"\";\n\t\t\t}\n\t\t\tvar a = $j(document.createElement(\"a\"))\n\t\t\t\t.attr(\"href\", s.href)\n\t\t\t\t.text(s.text);\n\n\t\t\tif (typeof _target != \"undefined\" && _target && _target != \"_self\" && s.href.substr(0, 7) != \"mailto:\")\n\t\t\t{\n\t\t\t\ta.attr(\"target\", _target);\n\t\t\t}\n\t\t\t// open mailto links depending on preferences in mail app\n\t\t\tif (s.href.substr(0, 7) == \"mailto:\" &&\n\t\t\t\t(egw.user('apps').mail || egw.user('apps').felamimail) &&\n\t\t\t\tegw.preference('force_mailto','addressbook') != '1')\n\t\t\t{\n\t\t\t\ta.click(function(event){\n\t\t\t\t\tegw.open_link(this.href);\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\ta.appendTo(_node);\n\t\t}\n\t}\n}", "function addNewItem() {\n $('a#addNew').click(function(){\n // ajax call to get new id\n var u = hostName + '/quote_items/a/add?quoteID=' + quoteID;\n $.get(u, newNode,\"json\");\n });\n}", "function insert(data){\n MongoClient.connect(url, function(err, db) {\n if (err) throw err;\n var dbo = db.db(DATABASE_NAME);\n dbo.collection(COLLECTION_NAME).insertOne(data, function(err, res) {\n if (err) throw err;\n console.log(\"insert complete\");\n db.close();\n });\n });\n}", "function storeNewEntry() {\r\n dojo.xhrPost({\r\n url: \"/rpc/insert\",\r\n content: {\r\n \"board_id\": boardID,\r\n \"name\": newName,\r\n \"rotations\": newRotations\r\n },\r\n load: storeNewEntrySucceeded,\r\n error: storeNewEntryFailed\r\n });\r\n }", "function sendInsertRequest(url,form,table,div){\n\tstartLoadingImage(table);\n\tvar params = getFormParams(ge(form));\n\tparams = \"action=INSERT&table=\"+table + params;\n\trunningRequest = true;\n\trequest = $.ajax({\n\t\ttype: \"GET\",\n\t\turl: url,\n\t\tdata: params,\n\t\tsuccess: function(msg){\t\n\t\t\trunningRequest = false;\t \t\t\n\t\t\tgetRefreshedTableRequest(url,table,div);\n\t\t}\n\t});\t\n\t\n}", "function insertEditorial(editorial, callback) {\n let connection = mysql.createConnection(config, { multipleStatements: true });\n connection.connect();\n var strQuery = `INSERT INTO editorial (editorial) VALUES ('${editorial}')`;\n connection.query(strQuery, function(error, result) {\n if (error) throw error;\n callback();\n });\n connection.end();\n}", "function setUrl(id, url) {\n bookmarkTable.get(id).set('url', url);\n }", "function addPost() {\n //check to ensure the mydb object has been created\n if (mydb) {\n\n var onwer = document.getElementById(\"UserName\").value; \n var content = document.getElementById(\"content\").value;\n var status = document.getElementById(\"status\").value;\n\n //Test to ensure that the user has entered both a make and model\n if (onwer !== \"\" && content !== \"\") {\n mydb.transaction(function (t) {\n t.executeSql(\"INSERT INTO normalPOST (post_onwer, content,status) VALUES (?, ?, ?)\", [onwer, content,status]);\n outputPOST();\n });\n } else {\n alert(\"You must enter all information!\");\n }\n } else {\n alert(\"db not found, your browser does not support web sql!\");\n }\n}", "constructor(props) {\n super(props);\n this.submit = this.submit.bind(this);\n this.checkDups = this.checkDups.bind(this);\n this.insertCallback = this.insertCallback.bind(this);\n this.formRef = null;\n const name = Meteor.userId();\n\n const passes = [];\n\n //PassesLink.insert({ name, passes }, this.insertCallback);\n }", "function updateLink(link) {\n if(Editor.writeAccess && link != null)\n socket.emit(\"link/update\", link);\n}", "function submit_to_db(entry, database){\n console.log(\"Getting as far as connect fxn\");\n console.log(\"Err = \" + err);\n assert.equal(null, err);\n console.log(\"After assert err = \" + err);\n console.log(\"Connected to server\");\n \n const db = client.db(\"scav_test_db\").collection(database);\n\n let ran = db.insertOne(entry);\n if(ran){ \n\t\tconsole.log(\"Entry added: \\n\" + entry + \"\\n\");\n\t\tsuccess = 1;\n\t} else {\n\t\tconsole.log(\"Entry was not added\");\n\t\tsuccess = 0;\n\t}\n}", "function insertMovies(db) {\n movies.forEach(movie => {\n const sql = 'INSERT INTO movies(link, id, metascore, rating, synopsis, title, votes, year) ' +\n 'VALUES(\"' + movie.link + '\", \"' + movie.id + '\", ' + movie.metascore + ', ' + movie.rating +\n ', \"' + movie.synopsis + '\", \"' + movie.title + '\", ' + movie.votes + ', ' + movie.year + ')';\n db.run(sql);\n })\n console.log(\"Data from the movies.json file were inserted in the database.\");\n}", "function insertLinks(data) {\n for (var i = 0, n = data.length; i < n; i++) {\n // find nodes by id\n var node1 = -1;\n var node2 = -1;\n for (var j = 0, m = nodes.length; j < m; j++) {\n if (data[i]['idNo1'] == nodes[j].dbId)\n node1 = nodes[j];\n if (data[i]['idNo2'] == nodes[j].dbId)\n node2 = nodes[j];\n if (node1 != -1 && node2 != -1)\n break;\n }\n // add link\n links.push({\n source: node1,\n target: node2,\n distance: data[i]['comprimento']\n });\n }\n}", "function insertToDB(firstName, lastName, email, education, opleidingsInstelling, know, jeBericht, ervaring, date) {\r\n // open database\r\n var db = new sqlite3.Database('admissions.db', (err) => {\r\n if (err) {\r\n return console.error(err.message);\r\n }\r\n });\r\n\r\n // create table for storage\r\n db.run('CREATE TABLE IF NOT EXISTS test (firstName TEXT, lastName TEXT, email TEXT, education TEXT, opleidingsInstelling TEXT, know TEXT, jeBericht TEXT, ervaring TEXT, date TEXT)');\r\n\r\n // insert one row into the test table\r\n db.run(`INSERT INTO test (firstName, lastName, email, education, opleidingsInstelling, know, jeBericht, ervaring, date) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, [firstName, lastName, email, education, opleidingsInstelling, know, jeBericht, ervaring, date], function(err) {\r\n if (err) {\r\n return console.log(err.message);\r\n }\r\n });\r\n\r\n\r\n // close database\r\n db.close((err) => {\r\n if (err) {\r\n return console.error(err.message);\r\n }\r\n });\r\n}", "function commitUrl(data,callback){\n __postData(\"seeds\", data,callback);\n}", "function addContentToDatabase(studentname, studentemail, studentcontactnum, studentfeesstatus, callback) {\n\tvar connection = mysql.createConnection({\n\t\thost: 'localhost',\n\t\tuser:'root',\n\t\tpassword: 'ab_1234',\n\t\tdatabase: 'StudentDB'\n\t});\n\n\tconnection.query('INSERT INTO students SET studentname=?, studentemail=?, studentcontactnum=?, studentfeesstatus=?;',[studentname, studentemail, studentcontactnum, studentfeesstatus ], \n\n\t\tfunction(err) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log('Could not insert studentname \"' + studentname + ' ' + studentemail + ' ' + studentcontactnum + ' ' + studentfeesstatus + '\" into database.' );\n\t\t\t}\n\t\t\tcallback();\n\t});\n}", "function addArticle(content, title, domain){\n var newArticle = {\n \"tag\" : db.db.length,\n \"article\" : content,\n \"title\" : title,\n \"domain\": domain,\n \"position\": 0\n }\n db.db.push(newArticle)\n}", "async function commit_extlink(o) {\n const {\n item_id, publisher, lang, path, h1, h2, name,\n pic, fpath, url\n } = o;\n if (item_id) {\n console.log(`-- commit/update extlink(pdf): ${name} @${path} [${lang}] -h2: \"${h2}\"`)\n return;\n }\n console.log(`-- commit extlink(pdf) new: ${name} @${path} [${lang}] -h2: \"${h2}\"`)\n await commit_extlink_sql(o)\n .then(retv =>{\n console.log(`commit_extlink_sql =>`,retv)\n return retv;\n })\n .catch(err =>{\n console.log(`commit_extlink_sql =>err:`,err)\n });\n }", "add(event){\n const title = event.target.parentNode.parentNode.querySelector('.title').textContent;\n const year = event.target.parentNode.parentNode.querySelector('.year').textContent;\n const poster = event.target.parentNode.parentNode.querySelector('.poster').getAttribute(\"src\");\n\n this.db.put({\n _id: title,\n year,\n poster\n }).then(rsp => {\n console.log('rsp', rsp);\n }).catch(function (err) {\n console.log(err);\n });\n }", "function addRessource(r){\n\tdb.run(`insert into ressources (name) values ('${r.name}')`);\n}", "function writeOneRecord() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n\n var stmt = conn.prepareStatement('INSERT INTO entries ' +\n '(guestName, content) values (?, ?)');\n stmt.setString(1, 'First Guest');\n stmt.setString(2, 'Hello, world');\n stmt.execute();\n}", "function add(tipo,cidade,bairro,data,horario,tmusicos,torganistas){\n\t\n\n\ndb = window.sqlitePlugin.openDatabase({name: 'DB', location: 'default'});\n\ndb.executeSql('INSERT INTO ensaios (tipo, cidade, bairro, data, horario, tmusicos, torganistas) VALUES (?,?,?,?,?,?,?)', [tipo, cidade, bairro, data, horario, tmusicos, torganistas]);\n\n\nreturn 'ok';\n\n\n}", "link(cell){\n if (cell == null ||cell == undefined ) return ;\n if (this.linked(cell)) return ;\n this.linkIds.push(cell.id) ;\n this.links[cell.tag] = cell ;\n cell.link(this) ;\n }", "function addItemsAscensorItemsProteccion(k_coditem,o_descripcion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_items_proteccion (k_coditem, o_descripcion) VALUES (?,?)\";\n tx.executeSql(query, [k_coditem,o_descripcion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items protección...Espere\");\n });\n}", "function insert_node_destination(link){\n var attr=jQuery(link).attr('href');\n var p=attr.indexOf('#');\n var anchor='';\n if(p!=-1){\n anchor=attr.substr(p);\n attr=attr.substr(0,p);\n }\n attr+=attr.indexOf('?')==-1?'?':'&';\n url=location.pathname.substring(1);\n jQuery(link).attr('href',attr+'destination='+url+anchor);\n}", "function insertNewData(){\n let datSave = {\n \"line\":1,\n \"machines\":[{\"id\":1,\"name\":\"oven 01\"},{\"id\":2,\"name\":\"creamer 01\"}],\n \"webserviceurl\":\"http://mv-webservice.test\",\n \"machid\": '2001'\n }\n\n db.insert(datSave, function(err, newDocs){\n\n });\n}", "function createNewURL(longURL, req) {\n let shortURL = generateRandomString();\n urlDatabase[shortURL] = {\n userID: req.session[\"user_id\"],\n longURL: longURL\n };\n return shortURL;\n}", "function addHowto(howto) {\n return db(\"howtos\")\n .insert(howto)\n}", "async function addReferee(req) {\n let user = await auth_utils.getUserFromDB(req.body.user[0].userName);\n await DButils.execQuery(\n `INSERT INTO Referees (userID, training) VALUES (${user.userID}, '${req.body.training}')`\n );\n}", "function click_new_wiki() {\n let text = $(\"#new-wiki-url\");\n let url = $(text).val();\n let pattern = new RegExp('(https:\\\\/\\\\/((.*\\\\/)+wiki\\\\/)([^#]+))(#.*)*');\n if (url.length === 0)\n return;\n if (pattern.exec(url) === null) {\n window.alert(\"不合法的網址!\");\n $(text).val(\"\");\n return;\n } else {\n url = pattern.exec(url)[1];\n }\n if (window.table_wiki_list.includes(url)) {\n window.alert(\"重複的網址!\");\n $(text).val(\"\");\n return;\n }\n window.table_wiki_list.push(url);\n $(\"#wiki-table-body\").append(create_wiki_table_row({ name: null, url: url }, 1));\n $(text).val(\"\");\n}", "function insert_asset(){ \t\n try{\n\t\tvar url = getUrl(this.href);\n\t\t$.get(url,{}, function(data){\n\t\t\t//insert into editor(tinyMCE is global)\n\t\t\ttinyMCE.execCommand('mceInsertContent', false, data); \n\t\t});\n\t}catch(e){ alert(\"insert asset: \"+ e);}\n}" ]
[ "0.7579566", "0.68103844", "0.6620342", "0.65243953", "0.6367809", "0.6301004", "0.62965924", "0.6150396", "0.614586", "0.6100345", "0.6071228", "0.59861547", "0.5968305", "0.5958615", "0.59352934", "0.5931534", "0.5900341", "0.5896153", "0.5890896", "0.588566", "0.58463544", "0.5843171", "0.58194894", "0.57717204", "0.5766107", "0.5750013", "0.57359654", "0.57135004", "0.57087386", "0.57025325", "0.5672881", "0.5660174", "0.56467134", "0.56459385", "0.5613115", "0.55874604", "0.55795425", "0.55726814", "0.5570917", "0.55660933", "0.55601716", "0.5547401", "0.5545054", "0.5543803", "0.553944", "0.5535982", "0.55174285", "0.54842335", "0.54613596", "0.5460792", "0.5451476", "0.5446158", "0.5430382", "0.5413216", "0.5411575", "0.5387377", "0.538354", "0.53790045", "0.5349631", "0.5341831", "0.53358924", "0.53339356", "0.533337", "0.53313226", "0.53255624", "0.5324672", "0.5324164", "0.5319242", "0.53052074", "0.5296218", "0.52945405", "0.52893496", "0.52878606", "0.5285586", "0.5284918", "0.5284687", "0.52827334", "0.52706885", "0.5269036", "0.5268257", "0.52534866", "0.52531165", "0.52484626", "0.5233159", "0.5232652", "0.5232419", "0.52303326", "0.5227277", "0.52210194", "0.52194804", "0.52119386", "0.52092445", "0.52017486", "0.51990217", "0.5198377", "0.5198038", "0.5194758", "0.5193385", "0.5191285", "0.51797074", "0.5176831" ]
0.0
-1
checks whether input is a youtube link
function checkLink(videoLink) { if(videoLink.indexOf("youtube.com/watch?v=") >= 0 || videoLink.indexOf("youtu.be/") >= 0) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CheckYoutube() {\n var reYoutube = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/,\n match = strLink.match(reYoutube);\n\n if( match && match[2].length == 11 ) {\n videoID = match[2];\n videoType = 'youtube';\n }\n }", "function IsYouTube_fed(url) {\n\t\tvar YouTubeLink_regEx = /^(https?\\:)?(\\/\\/)?(www\\.)?(youtu\\.be\\/|youtube(\\-nocookie)?\\.([A-Za-z]{2,4}|[A-Za-z]{2,3}\\.[A-Za-z]{2})\\/)(watch|embed\\/|vi?\\/)?(\\?vi?\\=)?([^#\\&\\?\\/]{11}).*$/;\n\t\tif(YouTubeLink_regEx.test(url.toString()))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t\t}\n\t}", "function isYoutubeUrl(url) {\n var exp = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11,})(?:\\S+)?$/gim;\n return url.match(exp) ? RegExp.$1 : false;\n }", "function validYouTube(url) {\n\tif(url == 'undefined' || url == null) return false; //if empty return false\n\t//else match\n\tvar p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n\treturn (url.match(p)) ? RegExp.$1 : false;\n}", "function isYouTubePlaylist(link) {\n var indexStart = link.indexOf(\".\");\n var website = link.substring(indexStart + 1, indexStart + 8);\n //console.log(website == \"youtube\");\n return website == \"youtube\";\n}", "function isYoutubeURL(url) {\n var p = /^(?:https?:\\/\\/)?(?:m\\.|www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/\n if (url.match(p)) {\n return url.match(p)[1]\n }\n return false\n}", "function valid_youtube_match(url) {\n let youtube_valid_regexp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=|\\?v=)([^#\\&\\?]*).*/;\n let match = url.match(youtube_valid_regexp);\n if (match && match[2].length == 11) {\n return true;\n } else {\n return false;\n }\n\n }", "function isVideo(url) {\n\treturn url.indexOf(\"https://www.youtube.com/watch?v=\") !== -1;\n}", "function parse_youtube_url(url) {\n var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n return (url.match(p)) ? RegExp.$1 : false;\n }", "function parse_youtube_url(url) {\n var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n return (url.match(p)) ? RegExp.$1 : false;\n }", "function isYouTubeVideo (src) {\n return src.match(youtubeRegex)\n }", "ValidateUrl() {\n let isYtRegex = /www\\.youtube\\.com\\/watch\\?v=/;\n\n if(isYtRegex.test(this.ActiveTabData.url)) {\n console.log(\"Url validation - success\");\n return true;\n }\n\n console.log(\"Url validation - fail\");\n return false;\n }", "checkUrlVideo(url){\n\n let urlRegex = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n let result = url.match(urlRegex)\n if (result) {\n return result;\n }\n return false;\n }", "function youtubeParser(url) {\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n return (match && match[7].length == 11) ? match[7] : false;\n}", "function magic(input){\n // Match youtube urls\n let re = new RegExp(/youtube\\.com|youtu\\.be/gi);\n // Check for youtube link\n if(input.target.href && re.test(input.target.href)){\n // Save the hovered element for later\n element = input.target;\n // Parameters for our XHR request\n var request = {\n headers: {\n \"User-Agent\": \"Mozilla/5.0\",\n \"Accept\": \"text/html\"\n },\n method: \"GET\",\n url: decodeURI(input.target.href),\n onload: displayTitle, // display the title in place of the link's text\n }\n // Fetch the page\n var youtube = GM_xmlhttpRequest(request);\n }\n }", "function isYoutubeIframe (content) {\n // look for the src attribute's value\n var attr = content.match(/<\\s*iframe[^>]*\\bsrc\\s*=\\s*/)\n if (attr) {\n // mark the location and figure out what kind of quotation mark is delimiting the value\n var position = attr.index + attr[0].length\n var quote = content.charAt(position)\n var substring = content.slice(position + 1)\n\n // now that we've found the first delimiting quotation mark, match\n // everything up to the next instance of the same quotation mark\n var src = substring.match(new RegExp('^[^' + quote + ']*'))\n if (src) {\n var value = src[0]\n // for protocol-relative src, prepend a protocol for URL parsing purposes\n if (value.indexOf('//') === 0) {\n value = 'https:' + value\n }\n\n var url = URL.parse(value)\n return (url.host && url.host.match(/^(\\w+\\.)?youtube\\.com$/))\n }\n }\n return false\n}", "function isURL(input) {\n let res = isString(input);\n if (res !== true) {\n return \"Not a URL > \" + res;\n }\n res = validator.isURL(input);\n if (!res) {\n return \"Not a URL > \" + input;\n }\n return true;\n}", "function youtube_parser(url){\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n if (match&&match[7].length==11){\n return match[7];\n }else{\n alert(\"Url incorrecta\");\n }\n }", "function youtube_parser(url) {\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n if (match && match[7].length == 11) {\n return match[7];\n } else {\n alert(\"Url incorrecta\");\n }\n}", "function getYoutubeIdByUrl (url)\r\n {\r\n var regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\r\n var match = url.match(regExp);\r\n\r\n if (match && match[2].length == 11) {\r\n return match[2];\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "function isURL(t)\n{\n // detect strings that look like URLs or filenames\n prot = new RegExp(\"^(http://|https://|ftp://)([\\\\-a-z0-9]+\\\\.)*[\\\\-a-z0-9]+\" +\n \"|^[a-z]:($|\\\\\\\\)\" +\n \"|^\\\\\\\\\\\\\\\\[a-z0-9]+($|\\\\\\\\($|[a-z0-9]+($|\\\\\\\\)))\", \"i\");\n if (prot.exec(t))\n return t;\n\n // detect strings that look like DNS names\n dns = new RegExp(\"^www\\.([\\\\-a-z0-9]+\\\\.)+[\\\\-a-z0-9]+(/\\\\S*)?$\" +\n \"|^([\\\\-a-z0-9]+\\\\.)+(com|net|org|edu|gov|mil|[a-z]{2})(/\\\\S*)?$\", \"i\");\n if (dns.exec(t))\n {\n t = \"http://\" + t;\n return t;\n }\n return false;\n}", "function checkEmdeded(url) {\n\t\t// Detect domain\n\t\tvar domain = url.split('/')[2] || url.split('/')[0];\n\n\t\tswitch(domain) {\n\t\t\tcase \"www.youtube.com\":\n\t\t\t\treturn url.replace(\"www.youtube.com\", \"www.youtube.com/embed\");\n\t\t\t\tbreak;\n\t\t\t/*case \"www.facebook.com\": // https://www.facebook.com/facebook profile\n\t\t\t\treturn \"https://www.facebook.com/plugins/page.php?href=\" + encodeURIComponent(url) + \"&tabs=timeline&adapt_container_width=true&hide_cover=false&width=1600\";\n\t\t\t\tbreak;*/\n\t\t\tdefault:\n\t\t\t\t// !TODO! Link should be starts with preview.php ... (not quickparseapi.appspot.com)\n\t\t\t\treturn \"https://quickparseapi.appspot.com/?url=\" + url;\n\t\t}\n\t}", "function isUrlValid(userInput) {\n\t var res = userInput.match(/(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g);\n\t if(res == null)\n\t return false;\n\t else\n\t return true;\n\t}", "function youtube_parser(url) {\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n if (match && match[7].length == 11) {\n return match[7];\n } else {\n console.error('PrettyEmbed.js Error: Bad URL.');\n }\n }", "function isURL(str){\n\t\tif(typeof str === 'string'){\n\t\t\tif(str.indexOf('http') >= 0) return true;\n\t\t}\n\t\treturn false;\n\t}", "function youtubeFilter(input) {\n var regExp = /^.*(youtu\\.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n var match = input.match(regExp);\n if (match && match[2].length == 11) {\n return match[2];\n }\n else {\n return input;\n }\n}", "function checkUrl(tab) {\n\t//check if it's a Youtube video\n\tif (tab.url.match(/youtube/) && tab.url.match(/watch/)) {\n\t\t//gets video id\n\t\tvar video_id=removeVideoPrefix('http://www.youtube.com/watch?v=', tab.url);\n\t\tvar video_id_2 = removeVideoSuffix(video_id);\n\t\t//gets video details from YouTube API\n\t\tjQuery.getJSON('https://gdata.youtube.com/feeds/api/videos/'+video_id_2+'?v=2&alt=jsonc',function(data,status,xhr){\n\t\t\tif(typeof (data.data.restrictions) == \"undefined\"){\n\t\t\t\t//placeholder, will not match any strings\n\t\t\t\tcountry = \"North Korea\";\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\t//Checks video restrictions against user's country\n\t\t\t\tfor (i = 0; i < data.data.restrictions[0].countries.length; i+=3) {\n\t\t\t\t\tvar countryprefix = data.data.restrictions[0].countries[i];\n\t\t\t\t\tvar countrysuffix = countryprefix.concat(data.data.restrictions[0].countries[i+1]);\n\t\t\t\t\tif (countrysuffix == user_country) {\n\t\t\t\t\t\tblocked_country = countrysuffix;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//If it's blocked\n\t\t\t\tif (blocked_country != \"null\") {\n\t\t\t\t\tfor (j = 0; j < data.data.restrictions[0].countries.length-3; j+=3) {\n\t\t\t\t\t\tvar country3 = data.data.restrictions[0].countries[j];\n\t\t\t\t\t\tvar country4 = country3.concat(data.data.restrictions[0].countries[j+1]);\n\t\t\t\t\t\t//Creates array of all blocked countries\n\t\t\t\t\t\tcountry_list.push(country4);\n\t\t\t\t\t}\t\n\t\t\t\t\t//Builds list of country suggestions\n\t\t\t\t\tif (country_list.length > 2) {\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\twhile (i < 4) {\n\t\t\t\t\t\t\tfor (j = 0; j < all_countries.countries.length; j++) {\n\t\t\t\t\t\t\t\tif (jQuery.inArray(all_countries.countries[j].code, country_list) == -1) {\n\t\t\t\t\t\t\t\t\tcountry_sugg[i] = all_countries.countries[j].name;\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//grammar\n\t\t\t\t\t\tunblocked_country = \"Some countries where it isn't blocked are \"+country_sugg[0]+', '+country_sugg[1]+', '+country_sugg[2]+', and '+country_sugg[3]+'.';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tunblocked_country = \"The video is unblocked everywhere else.\";\n\t\t\t\t\t}\n\t\t\t\tvar notification = webkitNotifications.createNotification(\n\t\t\t\t'icon.png', \n\t\t\t\t'Unblocked Where',\n\t\t\t\t'This video is blocked in your location. '+unblocked_country\n\t\t\t\t); \n\t\t\t\tnotification.show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function hasLink(input)\n{\n\treturn (input.indexOf('<link') != -1 || input.indexOf('<Link =') != -1 || input.indexOf('<LINK') != -1);\n}", "function youtube_parser_fed(url) {\n\t\tvar regExp = /^(https?\\:)?(\\/\\/)?(www\\.)?(youtu\\.be\\/|youtube(\\-nocookie)?\\.([A-Za-z]{2,4}|[A-Za-z]{2,3}\\.[A-Za-z]{2})\\/)(watch|embed\\/|vi?\\/)?(\\?vi?\\=)?([^#\\&\\?\\/]{11}).*$/;\n\t\tvar match = url.match(regExp);\n\t\tif (match && match[9].length == 11) {\n\t\t\treturn match[9];\n\t\t} else {}\n\t}", "checkLinkType() {\n let trackLinkRegex = /^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?soundcloud\\.com\\/[a-zA-Z0-9_]+\\/[a-zA-Z0-9-_]+\\/?$/;\n let profileLinkRegex = /^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?soundcloud\\.com\\/[a-zA-Z0-9_]+\\/?$/;\n if (this.CURRENT_TAB != 'soundcloud.com' && this.redirectLink.match(trackLinkRegex)) {\n return 'track';\n } else if (this.CURRENT_TAB != 'soundcloud.com' && this.redirectLink.match(profileLinkRegex)) {\n return 'profile';\n } else {\n return 'unknown';\n }\n }", "function linkToYTVid(youtube)\n{\n\tconsole.log(\"LINK TO YOUTUBE VIDEO\");\n\t\n\treturn \"http://www.youtube.com/watch?v=\" + youtube;\n\t\n}", "function URLCheck(text) \n{\n var urlRegex =/(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/ig;\n if(urlRegex.test(text))\n {\n \treturn true;\n }\n else\n {\n \treturn false;\n }\n}", "function getYoutubeUrl(video_input) {\n var youtubeUrl = video_input.val();\n if (youtubeUrl) {\n var youtubeId = youtubeUrl.split(\"=\")[1],\n imageUrl = 'http://img.youtube.com/vi/' + youtubeId + '/0.jpg;';\n $('.youtube_preview').attr('src', imageUrl);\n }\n }", "function updateLink(url){\n let match = url.match(regExp); // adds link to the playlist only if its valid youtube link\n if (match && match[2].length == 11) {\n videoId = match[2];\n videoLinkArray.push(videoId);\n updateUI();\n } else {\n //display error\n }\n\n if(videoLinkArray.length > 0){\n let tag = document.createElement('script');\n tag.src = \"https://www.youtube.com/iframe_api\";\n let firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n }\n}", "function validateIsURL(string) {\n var res = string.match(/(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g);\n return (res !== null);\n }", "function validateInput(url) {\n if (url == null) {\n return false;\n } else {\n const regex = new RegExp(/^https?:\\/\\/\\S*$/);\n return regex.test(url);\n }\n}", "function isSpotifyPlaylist(link) {\n var indexStart = link.indexOf(\".\");\n var website = link.substring(indexStart + 1, indexStart + 8);\n //console.log(website == \"spotify\");\n return website == \"spotify\";\n}", "function isSupported(url) {\r\n var youtube = /^http:\\/\\/(www\\.)?youtube\\.com\\/watch\\?(v=|.+&v=)/.test(url);\r\n var vimeo = false; // /^http:\\/\\/(www\\.)?vimeo\\.com\\/(\\d)+$/.test(url.split(\"?\")[0]);\r\n var viddler = /^http:\\/\\/(www\\.)?viddler\\.com\\/explore\\/(.)+\\/videos\\//.test(url);\r\n var bbc = /^http:\\/\\/(www\\.)?bbc\\.co\\.uk\\/iplayer\\/episode\\//.test(url);\r\n \r\n return (youtube || vimeo || viddler || bbc);\r\n }", "function isUrl(str) {\n return isString(str) && !!str.match(/^((https?|ftp|rtsp|mms):\\/\\/)(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+\\.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\.[a-z]{2,6}|localhost)(:[0-9]{1,4})?((\\/?)|(\\/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+\\/?)$/i);\n }", "function isUrl(str) {\n return isString(str) && !!str.match(/^((https?|ftp|rtsp|mms):\\/\\/)(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+\\.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\.[a-z]{2,6}|localhost)(:[0-9]{1,4})?((\\/?)|(\\/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+\\/?)$/i);\n }", "function isURL( string )\n {\n \tvar substr1;\n \tvar substr2;\n \t\n \tsubstr1 = string.substr( 0, 5 );\n \tsubstr2 = string.substr( 0, 6 );\n \t\n \tif ( substr1 == \"http:\" || substr2 == \"https:\" )\n \t\treturn true;\n \telse\n \t\treturn false;\n }", "getYoutube(link) {\n if (link) {\n return (\n <iframe\n title={this.state.youtubeEmbedLink}\n className='product-full-youtube'\n height=\"315\"\n src={this.state.youtubeEmbedLink}\n frameBorder=\"0\"\n gesture=\"media\"\n allow=\"encrypted-media\"\n allowFullScreen>\n </iframe>\n )\n }\n }", "function embedYouTubeLink(link) {\n\tyouTubeLink = $(link);\n\tvideoID = youTubeLink.attr('href').replace(/^[^v]+v.(.{11}).*/, '$1');\n\n\t/* \n \t* TODO: This is a truly ugly method of replacing the link with an embedded\n \t* object. I should probably create a function that intelligently parses\n \t* the most common audio and video links into a nice, clean OBJECT.\n\t*/\n\tyouTubeLink.replaceWith('<object class=\"youtube_video\" width=\"445\" height=\"364\"><param name=\"movie\" value=\"http://www.youtube.com/v/' + videoID + '&hl=en&fs=1&color1=0xdd0000&color2=0x660000&border=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/' + videoID + '&hl=en&fs=1&color1=0xdd0000&color2=0x660000&border=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"445\" height=\"364\"></embed></object>');\n}", "function isurl(theurl) {\n\treturn /^\\s*https?:\\/\\/.+$/.test(theurl);\n}", "function isUrl(s){\n\tvar testFor =new Array(\"http\",\"https\",\"ftp\",\"ftps\",\".com\",\".net\",\".org\",\".edu\",\".gov\",\".int\",\".mil\",\".biz\",\".info\",\".jobs\",\n\t\".mobi\",\".name\",\"@\");\n\tfor (i=0;i<testFor.length;i++)\n\t{\n\t \tif (s.indexOf(testFor[i])!= -1)\n\t \t{\n\t \t\treturn true;\n\t \t}\n\t}\n\treturn false;\n}", "function isUrl(string) {\n var regexp = /^(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(string);\n }", "function isUrl(string) {\n\t\treturn isUrlRegex.test(string);\n\t}", "function vcExtractYoutubeId( url ) {\n\tif ( 'undefined' === typeof(url) ) {\n\t\treturn false;\n\t}\n\n\tvar id = url.match( /(?:https?:\\/{2})?(?:w{3}\\.)?youtu(?:be)?\\.(?:com|be)(?:\\/watch\\?v=|\\/)([^\\s&]+)/ );\n\n\tif ( null !== id ) {\n\t\treturn id[ 1 ];\n\t}\n\n\treturn false;\n}", "function is_url(str) {\n\t\treturn starts_with(str, 'http://') || starts_with(str, 'https://') || starts_with(str, '//');\n\t}", "function validateURL(value) {\n var regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(value);\n}", "function validateUrl(value)\n{\n\tvar url = value.toLowerCase();\n\tvar urlReg = /^(https?:\\/\\/)?.+\\..+$/i;\n\treturn urlReg.test(url);\n}", "function isUrl(line) {\r\n\tif (line != null) {\r\n\t\tif (line.search('http')==0) return true;\r\n\t}\r\n\treturn false;\r\n}", "function getYoutubeId(){\r\n const linkRegEx = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\r\n const result = musicSearchBox_input.value.match(linkRegEx);\r\n if (result){\r\n return result[7];\r\n } else{\r\n return null;\r\n }\r\n}", "function isURL(s) {\n return /^(http|https):/.test(s)\n}", "function isURL(str){\n var urlPattern = /(https?:\\/\\/(?:www\\.|(?!www))[^\\s\\.]+\\.[^\\s]{2,}|www\\.[^\\s]+\\.[^\\s]{2,})/gi;\n if(urlPattern.exec(str)){\n return true;\n }else{\n return false;\n }\n}", "function get_yt_embed(url) {\n var videoid = url.match(/(?:https?:\\/{2})?(?:w{3}\\.)?youtu(?:be)?\\.(?:com|be)(?:\\/watch\\?v=|\\/)([^\\s&]+)/);\n if(videoid != null) {\n return videoid[1];\n // return \"<iframe id=\\\"ytplayer\\\" type=\\\"text/html\\\" width=\\\"640\\\" height=\\\"390\\\" src=\\\"http://www.youtube.com/embed/\" + videoid[1] + \"?autoplay=1\\\" frameborder=\\\"0\\\"/>\";\n } else {\n return \"\";\n }\n}", "function validate_websiteUrl(input_url) {\n\tvar res = input_url.match(/(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g);\n\tif (res == null) return false;\n\telse return true;\n}", "function isUrl(url) {\n\n return !!(url.match(/^http(s)?:\\/\\/\\S+$/));\n \n}", "function ytVidId(url) {\n\t\t\t var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11,})(?:\\S+)?$/gmi;\n\t\t\t return (url.match(p)) ? RegExp.$1 : false;\n\t\t\t}", "function ytVidId(url) {\n\t\t\t var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11,})(?:\\S+)?$/gmi;\n\t\t\t return (url.match(p)) ? RegExp.$1 : false;\n\t\t\t}", "function checkURL(str) {\n var pattern = /[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?/gi;\n return pattern.test(str)\n }", "isValidUrl (url) {\n if (!url) {\n return false;\n }\n return new RegExp('^(https?:\\/\\/)?(.+)\\.(.+)').test(url);\n }", "isUrl(value) {\n return new RegExp(\n \"^(https?:\\\\/\\\\/)?((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*(\\\\?[;&a-z\\\\d%_.~+=-]*)?(\\\\#[-a-z\\\\d_]*)?$\"\n ).test(String(value).toLowerCase());\n }", "function checkUrl(url)\n {\n //regular expression for URL\n var pattern = /^(http|https)?:\\/\\/[a-zA-Z0-9-\\.]+\\.[a-z]{2,4}/;\n\n if(pattern.test(url)){\n return true;\n } else {\n return false;\n }\n }", "function checkUrl(url) {\n if ((url.match(DOC_REGEX) != null) &&\n (url.match(DOC_REGEX) != undefined) &&\n (url.match(DOC_REGEX)[0] == url)) {\n return true;\n }\n return false;\n}", "function ShowYoutubeUrl(url, cache2)\n{\n\tlet id = url.match(/\\/(tt\\d+)\\//)[1];\n\tlet slate = $(\"div.ipc-slate\");\n\n\tif (slate.length !== 0)\n\t\treturn;\n\n\tlet div = $(\"<div id=imdbe_divtrailer ></div>\").html(\"<h1> \\\n<a href='https://www.youtube.com/results?search_query=\" + cache2[id][\"name\"] + \" trailer'>Search trailer on Youtube</a></h1 >\\\n\");\n\t\t$(\"div.plot_summary_wrapper\").prepend(div);\n}", "function ValidURL(str) {\n\t\t\tvar pattern = /(http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/g\n\t\t\treturn pattern.test(str)\n\t\t}", "function isUrl(s) {\r\n\tvar regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/i;\r\n\treturn regexp.test(s);\r\n}", "function getVideoIDfromLink(url)\n{\n\t\tvar regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n\t\tvar match = url.match(regExp);\n\t\tif (match&&match[2].length==11){\n\t\t\t\treturn match[2];\n\t\t}else{\n\t\t\t\t//error\n\t\t}\n}", "function validURL(str) {\n var regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return regexp.test(str);\n}", "function parseId(url) {\n // http://stackoverflow.com/a/14701040\n var match = /^.*(youtube.com\\/|v\\/|e\\/|u\\/\\w+\\/|embed\\/|v=)([^#\\&\\?]*).*/.exec(url);\n\n if (match instanceof Array && match[2] !== undefined) {\n return match[2];\n } else {\n return false;\n }\n}", "function validateURL(url) {\n splitURL = url.split(\"/\").filter(Boolean);\n if (splitURL.length !== 5) {\n return false;\n }\n if (!splitURL[0].match('http')) {\n return false;\n }\n if (splitURL[1] !== 'www.meetup.com') {\n return false;\n }\n if (splitURL[3] !== 'events') {\n return false;\n }\n if (isNaN(parseInt(splitURL[4]))) {\n return false;\n }\n return true;\n}", "cleanVideoSource(input, type) {\n // ensure we are NOT local and do a sanity check\n if (type != \"local\" && typeof input === \"string\") {\n // strip off the ? modifier for youtube/vimeo so we can build ourselves\n var tmp = input.split(\"?\");\n var v = \"\";\n input = tmp[0];\n if (tmp.length == 2) {\n let tmp2 = tmp[1].split(\"&\"),\n args = tmp2[0].split(\"=\"),\n qry = Array.isArray(tmp2.shift())\n ? tmp2.shift().join(\"\")\n : tmp2.shift();\n if (args[0] == \"v\") {\n let q = qry !== undefined && qry !== \"\" ? \"?\" + qry : \"\";\n v = args[1] + q;\n }\n }\n // link to the vimeo video instead of the embed player address\n if (\n input.indexOf(\"player.vimeo.com\") == -1 &&\n input.indexOf(\"vimeo.com\") != -1\n ) {\n // normalize what the API will return since it is API based\n // and needs cleaned up for front-end\n if (input.indexOf(\"/videos/\") != -1) {\n input = input.replace(\"/videos/\", \"/\");\n }\n return input.replace(\"vimeo.com/\", \"player.vimeo.com/video/\");\n }\n // copy and paste from the URL\n else if (input.indexOf(\"youtube.com/watch\") != -1) {\n return input.replace(\"youtube.com/watch\", \"youtube.com/embed/\") + v;\n }\n // copy and paste from the URL\n else if (input.indexOf(\"youtube-no-cookie.com/\") != -1) {\n return input.replace(\"youtube-no-cookie.com/\", \"youtube.com/\") + v;\n }\n // weird share-ly style version\n else if (input.indexOf(\"youtu.be\") != -1) {\n return input.replace(\"youtu.be/\", \"www.youtube.com/embed/\") + v;\n }\n // embed link\n else if (input.indexOf(\"player.twitch.tv/\") != -1) {\n if (tmp[1]) {\n return `${input}?${tmp[1].replace(\"&parent=www.example.com\", \"\")}`;\n } else {\n let tmp2 = input.replace(\"&parent=www.example.com\", \"\").split(\"/\");\n return `https://player.twitch.tv/?channel=${tmp2.pop()}`;\n }\n }\n // URL / share link\n else if (input.indexOf(\"twitch.tv/videos/\") != -1) {\n let tmp2 = input.replace(\"&parent=www.example.com\", \"\").split(\"/\");\n return `https://player.twitch.tv/?video=${tmp2.pop()}`;\n }\n // twitch channel URL / share link\n else if (input.indexOf(\"twitch.tv/\") != -1) {\n let tmp2 = input.replace(\"&parent=www.example.com\", \"\").split(\"/\");\n return `https://player.twitch.tv/?channel=${tmp2.pop()}`;\n }\n // copy and paste from the URL for sketchfab\n else if (\n input.indexOf(\"sketchfab.com\") != -1 &&\n input.indexOf(\"/embed\") == -1\n ) {\n return input + \"/embed\";\n }\n }\n return input;\n }", "function checkLink(base_url, div_to_update, txt_link_url){\n\tvar b_valid = true;\n\t// Validate the link url\n\tif($(txt_link_url).value == '' || $(txt_link_url).value == 'http://'){\n\t\talert('You must enter a link to be validated.');\n\t\tb_valid = false;\n\t}\n\telse if(!isValidUrl($(txt_link_url).value)){\n\t\talert('You must enter a valid link.');\n\t\tb_valid = false;\n\t}\n\n\t// If everything is all good -> submit the link\n\tif(b_valid){\n\t\tpars = 'type=38&action=ajax_validate_link&txtStoryURL='+encodeURIComponent($(txt_link_url).value);\n\n\t\t// AJAX > Go get all comments associated to this story/link\n\t\tvar myAjax = new Ajax.Updater(\n\t\t\t\t\t\t div_to_update,\n\t\t\t\t\t\t base_url, {\n\t\t\t\t\t\t\tmethod: 'get',\n\t\t\t\t\t\t\tparameters: pars,\n\t\t\t\t\t\t\tonComplete:function(){\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t });\n\t}\n}", "function ytVidId(url) {\n var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n return (url.match(p)) ? RegExp.$1 : false;\n }", "static valid_url(value) {\n if (!value) return false;\n\n // check for illegal characters\n if (/[^a-z0-9:/?#[\\]@!$&'()*+,;=.\\-_~%]/i.test(value)) return false;\n\n // check for hex escapes that aren't complete\n if (/%[^0-9a-f]/i.test(value)) return false;\n if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) return false;\n\n return this.check_url_fragments(value);\n }", "function isExternalUrl(url) {\n return protocolReg.test(url);\n }", "function CheckVimeo() {\n var reVimeo = /^.*(?:www\\.|player\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|video\\/|ondemand\\/(?:\\w+\\/)?|)(\\d+)(?:$|\\/|\\?)/,\n match = strLink.match(reVimeo);\n\n if( match && match[3] ) {\n videoID = match[3];\n videoType = 'vimeo';\n }\n }", "function ValidURL(str) {\n var pattern = new RegExp(/^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$/i); if(!pattern.test(str)) {\n return false;\n } else {\n return true;\n }\n}", "function isURL(str) {\n\t\t\t\tvar urlRegex = '^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\\\S+(?::\\\\S*)?@)?(?:(?:(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}(?:\\\\.(?:[0-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))|(?:(?:[a-z\\\\u00a1-\\\\uffff0-9]+-?)*[a-z\\\\u00a1-\\\\uffff0-9]+)(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff0-9]+-?)*[a-z\\\\u00a1-\\\\uffff0-9]+)*(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff]{2,})))|localhost)(?::\\\\d{2,5})?(?:(/|\\\\?|#)[^\\\\s]*)?$';\n\t\t\t\tvar url = new RegExp(urlRegex, 'i');\n\t\t\t\treturn str.length < 2083 && url.test(str);\n\t\t\t}", "function WLIsURL(href) {\n var WLhasHTTPRegexp = /^https?:/;\n var WLhasColonRegexp = /:/;\n return Boolean(href) && (WLhasHTTPRegexp.test(href) || !WLhasColonRegexp.test(href));\n}", "function checkArticleUrl(articleUrl) {\n if (validUrl.isUri(articleUrl)) {\n return true;\n } else {\n return false;\n }\n}", "function checkUrlExtension(url, typeOfExt) {\n var arr = typeOfExt == \"img\" ? [\"jpeg\", \"jpg\", \"gif\", \"png\"] : [\"mp3\"];\n var ext = url.indexOf(\".\") != -1 ? url.substring(url.lastIndexOf(\".\") + 1) : \"\";\n if ($.inArray(ext, arr) == -1) {\n return false;\n }\n else {\n return true;\n }\n}", "function getVideoID(url){\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#&?]*).*/;\n var match = url.match(regExp);\n return (match&&match[7].length==11)? match[7] : false;\n }", "cleanVideoSource(input, type) {\n if (type != \"local\") {\n // strip off the ? modifier for youtube/vimeo so we can build ourselves\n var tmp = input.split(\"?\");\n var v = \"\";\n input = tmp[0];\n if (tmp.length == 2) {\n let tmp2 = tmp[1].split(\"&\"),\n args = tmp2[0].split(\"=\"),\n qry = Array.isArray(tmp2.shift())\n ? tmp2.shift().join(\"\")\n : tmp2.shift();\n if (args[0] == \"v\") {\n let q = qry !== undefined && qry !== \"\" ? \"?\" + qry : \"\";\n v = args[1] + q;\n }\n }\n // link to the vimeo video instead of the embed player address\n if (\n input.indexOf(\"player.vimeo.com\") == -1 &&\n input.indexOf(\"vimeo.com\") != -1\n ) {\n // normalize what the API will return since it is API based\n // and needs cleaned up for front-end\n if (input.indexOf(\"/videos/\") != -1) {\n input = input.replace(\"/videos/\", \"/\");\n }\n return input.replace(\"vimeo.com/\", \"player.vimeo.com/video/\");\n }\n // copy and paste from the URL\n else if (input.indexOf(\"youtube.com/watch\") != -1) {\n return input.replace(\"youtube.com/watch\", \"youtube.com/embed/\") + v;\n }\n // embed link\n else if (input.indexOf(\"player.twitch.tv/\") != -1) {\n if (tmp[1]) {\n return `${input}?${tmp[1].replace(\"&parent=www.example.com\", \"\")}`;\n } else {\n let tmp2 = input.replace(\"&parent=www.example.com\", \"\").split(\"/\");\n return `https://player.twitch.tv/?channel=${tmp2.pop()}`;\n }\n }\n // URL / share link\n else if (input.indexOf(\"twitch.tv/videos/\") != -1) {\n let tmp2 = input.replace(\"&parent=www.example.com\", \"\").split(\"/\");\n return `https://player.twitch.tv/?video=${tmp2.pop()}`;\n }\n // twitch channel URL / share link\n else if (input.indexOf(\"twitch.tv/\") != -1) {\n let tmp2 = input.replace(\"&parent=www.example.com\", \"\").split(\"/\");\n return `https://player.twitch.tv/?channel=${tmp2.pop()}`;\n }\n // copy and paste from the URL\n else if (input.indexOf(\"youtube-no-cookie.com/\") != -1) {\n return input.replace(\"youtube-no-cookie.com/\", \"youtube.com/\") + v;\n }\n // weird share-ly style version\n else if (input.indexOf(\"youtu.be\") != -1) {\n return input.replace(\"youtu.be/\", \"www.youtube.com/embed/\") + v;\n }\n // copy and paste from the URL for sketchfab\n else if (\n input.indexOf(\"sketchfab.com\") != -1 &&\n input.indexOf(\"/embed\") == -1\n ) {\n return input + \"/embed\";\n }\n }\n return input;\n }", "function isURL(string){\n\treturn /((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?((?:(?:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}\\.)+(?:(?:aero|arpa|asia|a[cdefgilmnoqrstuwxz])|(?:biz|b[abdefghijmnorstvwyz])|(?:cat|com|coop|c[acdfghiklmnoruvxyz])|d[ejkmoz]|(?:edu|e[cegrstu])|f[ijkmor]|(?:gov|g[abdefghilmnpqrstuwy])|h[kmnrtu]|(?:info|int|i[delmnoqrst])|(?:jobs|j[emop])|k[eghimnrwyz]|l[abcikrstuvy]|(?:mil|mobi|museum|m[acdghklmnopqrstuvwxyz])|(?:name|net|n[acefgilopruz])|(?:org|om)|(?:pro|p[aefghklmnrstwy])|qa|r[eouw]|s[abcdeghijklmnortuvyz]|(?:tel|travel|t[cdfghjklmnoprtvwz])|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw]))|(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[0-9])))(?:\\:\\d{1,5})?)(\\/(?:(?:[a-zA-Z0-9\\;\\/\\?\\:\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?(?:\\b|$)/gi.test(string);\n}", "function validateURL(urlToTest) {\n\n const protocolString = \"http://\";\n let charToCheck = [];\n charToCheck = urlToTest.split('');\n\n if(charToCheck[3] === 'p' && charToCheck[4] === ':'){\n return urlToTest;\n }else {\n return protocolString + urlToTest;\n }\n\n}", "can_be_linkify(dest) {\n let match = dest.match(/^(https?:|\\/\\/)/i);\n\n if (!match) return false;\n\n let proto = match[0];\n let len = linkify.testSchemaAt(dest, proto, proto.length);\n\n return len && (len === dest.length - proto.length);\n }", "function youtubeValid(t){// t = this\r\n if(t.getValue() != \"\"){\r\n var videoInfo = getYoutubeVideoInfo(t.getValue()); //returns a string containing the selected video's information\r\n var videoInfoObject = parseJson(videoInfo.body); //convert from a string to an XML Object\r\n var secondsString = videoInfoObject.entry.media$group.yt$duration.seconds;//get the 'seconds' attribute we need\r\n var seconds = parseInt(secondsString);\r\n var time = formatTime(seconds); //converts the video duration (in seconds) to the desired format\r\n var title = videoInfoObject.entry.title.$t;//get the video title\r\n var container = t.findParentByType(\"dialogfieldset\");\r\n var youtubeDuration = container.getComponent(\"duration\"); // the 'duration' widget\r\n var youtubeDurationLabel = container.getComponent(\"durationLabel\"); // the 'duration label' widget\r\n var youtubeVideoName = container.getComponent(\"videoName\"); // the 'videoName' widget\r\n var youtubeVideoNameLabel = container.getComponent(\"videoNameLabel\"); // the 'videoName' widget\r\n\r\n youtubeDuration.setValue(time);\r\n youtubeDurationLabel.setText(time);\r\n youtubeVideoName.setValue(title);\r\n youtubeVideoNameLabel.setText(title);\r\n }\r\n}", "function isValidHttpUrl(string) {\r\n let url;\r\n\r\n try {\r\n url = new URL(string);\r\n } catch (_) {\r\n return false;\r\n }\r\n\r\n return url.protocol === \"http:\" || url.protocol === \"https:\";\r\n}", "function is_valid_url(str) {\n\tvar urlPattern = /\\b((?:https?:\\/\\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?������]))/i;\n\t if(!urlPattern.test(str)) { \n\t return false;\n\t } else {\n\t return true;\n\t }\n\t}", "function checkForValidUrl(tabId, changeInfo, tab) {\n // If the letter 'g' is found in the tab's URL...\n var uri = parseUri(tab.url);\n var host = uri.host.toLowerCase();\n if ((host == 'reddit.com' || host == 'www.reddit.com') && uri.path.toLowerCase().match(/\\/comments\\//)) {\n chrome.pageAction.show(tabId);\n }\n}", "function isValidHttpUrl(string) {\n\tlet url;\n\t\n\ttry {\n\t url = new URL(string);\n\t} catch (_) {\n\t return false; \n\t}\n \n\treturn url.protocol === \"http:\" || url.protocol === \"https:\";\n}", "function checkUrl(tabs) {\n var imdbRegex = /http:\\/\\/www.imdb.com\\/title/;\n var url = tabs[0].url;\n if (imdbRegex.exec(url)) {\n var movieId = url.substring(26, 35);\n loadMovie(movieId);\n } else {\n // just fill the watchlist, no current movie\n loadMovie(-1);\n }\n\n}", "function vpb_url_validated(url)\n{\n\tvar vpb_url_exp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;\n\tif(vpb_url_exp.test(url)) { return true; }\n\telse { return false; }\n}", "function isUrl(s) {\n var urlRegex = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n return urlRegex.test(s);\n}", "function validateUrl(value){\n if(value){ //if value isn't null\n if(/https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/.test(value)){ //use regex to see if all the characters are between a to z or A to Z\n return {isValid: true, error: null, details: null};\n }\n return {isValid: false, error: 'Must be valid url', details: '\"'+value+'\" is NOT a valid URL. A url should in https://www.example.com format.'};\n }\n return {isValid: true, error: null, details: null};\n}", "function is_url(str) {\n let regexp = /^(?:(?:https?|ftp):\\/\\/)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:\\/\\S*)?$/;\n if (regexp.test(str)) {\n return true;\n } else {\n return false;\n }\n }", "function isAWebpage(URL) {\n\tif(URL.match(/^http:/) || URL.match(/^https:/)) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function isValidUrl(s) {\n\tvar regexp = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/\n\treturn regexp.test(s);\n}" ]
[ "0.78308886", "0.7762298", "0.7744283", "0.752153", "0.74826366", "0.7392106", "0.7311745", "0.7308245", "0.7287603", "0.7287603", "0.70862347", "0.70455575", "0.70181274", "0.6788224", "0.67319727", "0.67042863", "0.66059035", "0.637388", "0.63737077", "0.63477594", "0.63180214", "0.6311078", "0.63010156", "0.62939376", "0.62802446", "0.62549514", "0.6245755", "0.6232218", "0.6213484", "0.61957043", "0.61822", "0.6155047", "0.61543137", "0.6115346", "0.61000204", "0.60926", "0.60608697", "0.6038709", "0.60270935", "0.59942174", "0.5986858", "0.5973061", "0.5956758", "0.5936479", "0.5934381", "0.59210134", "0.59207916", "0.5914044", "0.589589", "0.5859499", "0.5830142", "0.5823853", "0.58156866", "0.5804197", "0.5777406", "0.57744354", "0.5767054", "0.5757966", "0.57445544", "0.57445544", "0.5738212", "0.57066095", "0.56994003", "0.56848633", "0.56792825", "0.5662765", "0.5650547", "0.5641732", "0.5634621", "0.56330687", "0.5630333", "0.56206363", "0.5618261", "0.5603417", "0.5602368", "0.5600765", "0.55946124", "0.55764455", "0.55671847", "0.55581516", "0.5557394", "0.5556062", "0.55441177", "0.55404204", "0.5531733", "0.5513137", "0.5511441", "0.5510955", "0.55089307", "0.55085754", "0.5503315", "0.5499479", "0.5496847", "0.5492014", "0.5490485", "0.5489599", "0.54779476", "0.54744536", "0.54625237", "0.54519355" ]
0.76011705
3
animates toggling the featured video
function toggleVideo() { if($('#featured').hasClass('toggled')) { $('#form-overlay-wrapper').animate({maxHeight: 0}, 500); $('#link-form').animate({opacity: 0}, 200); $('#featured').css('animation', 'toggleFeaturedOn 1s ease forwards'); $('#main-title-wrapper').animate({maxHeight: 0}, 500); $('#main-title').animate({opacity: 0}, 200); setTimeout(function() { $('#featured').css('max-height', 'inherit'); $('#featured').css('opacity', '1'); $('#featured').css('margin-bottom', '20px'); setTimeout(function() { $('#featured').css("animation", "none"); }, 50); }, 1000); $('#featured').removeClass('toggled'); } else { $('#form-overlay-wrapper').animate({maxHeight: 200}, 500); $('#link-form').animate({opacity: 1}, 500); $('#featured').css('animation', 'toggleFeaturedOff 1s ease forwards'); $('#main-title-wrapper').animate({maxHeight: "200px"}, 500); setTimeout(function() { $('#main-title').animate({opacity: 1}, 500); }, 300); setTimeout(function() { $('#featured').css("animation", "none"); $('#featured').css('max-height', '0'); $('#featured').css('opacity', '0'); $('#featured').css('margin-bottom', '0'); }, 1000); $('#featured').addClass('toggled'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle () {\n if (this.video.paused) {\n this.play();\n }\n else {\n this.pause();\n }\n }", "function toggle() {\n var trailer = document.querySelector('#onetra');\n var video = document.querySelector('video');\n onetra.classList.toggle('active')\n video.currentTime = 0;\n video.pause();\n}", "function showHide() {\n menuVideo.classList.toggle('is-active')\n}", "function videoStateToggle(e, animate) {\n var $video = $(this);\n var $state = $video.closest('[data-state-name]');\n var state = $state.data('state-name');\n\n // Set body state.\n if (state) $body.attr('data-state-name', e.type == 'in' ? state : '');\n\n // Toggle element class state.\n $video.toggleClass('no-animate', animate == false);\n $video.toggleClass('active', e.type == 'in');\n }", "function toggleVideoState() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n\n }", "function toggleVideoStatus(){\n if(video.paused){\n video.play();\n }else {\n video.pause();\n }\n}", "function toggleVideoStatus() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "toggleVideo() {\n var self = this;\n\n if (self.get('isPlaying')) {\n self.get('Player').pauseVideo();\n self.set('isPlaying', false);\n\n self.get('$progressBar').stop();\n Ember.run.cancel(self.vidClock);\n } else {\n self.get('Player').playVideo();\n self.set('isPlaying', true);\n }\n }", "function PlayExpandedIntroVideo () {\r\ncreative.dom.video1.vid.play();\r\ncreative.dom.video1.vid.currentTime = 0;\r\n}", "function toggleVid() {\n if (playing) {\n earring.pause();\n button.html('play');\n } else {\n earring.loop();\n button.html('pause');\n }\n playing = !playing;\n}", "function showVideo(){\r\n\t\t\tvar iframe=document.getElementById('iframe');\r\n\r\n\t\t\tthevid.style.display='block'; \r\n\t\t\tdocument.getElementById('iframe').src = \r\n\t\t\tdocument.getElementById('iframe').src.replace('autoplay=0','autoplay=1');\r\n\t\t\t$('div.logo-wrap').replaceWith($('div.video-wrap'));\r\n\t\t\tTweenLite.to($('div.video-wrap'), 2, {opacity:1, ease:Power1.easeIn});\r\n\t\t}", "function toggleSticker(){\n var sticker = $(this);\n\n if(sticker.attr(\"src-animated\") === sticker.attr(\"src\")){\n sticker.attr(\"src\",sticker.attr(\"src-original\"));\n }\n else{\n sticker.attr(\"src\",sticker.attr(\"src-animated\"));\n }\n}", "function toggleVideo() {\n myStreamRef.current.getVideoTracks()[0].enabled = !videoState\n setVideoState(prev => { return !prev })\n }", "toggleTutorial() {\n if(this.wonGameStatus == false) {\n document.getElementById(\"dark-bg\").classList.toggle(\"d-none\");\n }\n }", "function toggleVideoAdd(value) {\n if (value) {\n $('#section-add-videos').removeClass('hidden-xs-up');\n $('#button-done-videos').removeClass('hidden-xs-up');\n $('#button-add-videos').addClass('hidden-xs-up');\n } else {\n $('#section-add-videos').addClass('hidden-xs-up');\n $('#button-done-videos').addClass('hidden-xs-up');\n $('#button-add-videos').removeClass('hidden-xs-up');\n }\n}", "function toggleVid() {\n if (playing) {\n myVideo.pause();\n button.html('play');\n } else {\n myVideo.loop();\n button.html('pause');\n }\n playing = !playing;\n}", "function action_toggle_play() {\n if (video.paused) {\n video.play();\n change_icon('play'); \n } else {\n video.pause();\n change_icon('pause'); \n }\n delay = delay_value;\n}", "function toggleVideo(b) {\n if (b == \"true\") {\n localStream.getVideoTracks()[0].enabled = true\n } else {\n localStream.getVideoTracks()[0].enabled = false\n }\n}", "function playGiphy() {\n var still = $(this).attr('data-still');\n var animated = $(this).attr('data-animated');\n var state = $(this).attr('data-state');\n\n if (state === 'still') {\n // Play Image\n $(this).attr({\n 'data-state': 'play',\n src: animated\n });\n } else {\n // Pause image\n $(this).attr({\n 'data-state': 'still',\n src: still\n });\n }\n}", "function togglePlay() {\n var theSVG = this.firstElementChild;\n poster.classList.add('hide');\n videoControls.classList.remove('invisible');\n vidPlayer.classList.remove('hide');\n\n if (vidPlayer.paused) {\n theSVG.dataset.icon = \"pause-circle\";\n vidPlayer.play();\n } else {\n theSVG.dataset.icon = \"play-circle\";\n vidPlayer.pause();\n }\n }", "function ifVideoTogglePlay() {\n if (video.paused || video.ended) {\n video.play();\n videoContainer.classList.add('is-active');\n videoContainer.classList.remove('is-paused');\n } else {\n video.pause();\n videoContainer.classList.remove('is-active');\n videoContainer.classList.add('is-paused');\n }\n }", "function doShowAdvLinkFast() \n {\n if($('#oc-link-advanced-player').is(':animated')) {\n $('#oc-link-advanced-player').stop();\n }\n $('#oc-link-advanced-player').css('marginLeft', '0px');\n }", "function showDetails(id){\n $('#videoplayer').attr('src', 'http://player.vimeo.com/video/' + id);\n $('#videodetail').toggleClass('showview');\n $('#main').toggleClass('showview');\n}", "function setVideo(e, value) {\n myMediaStream.getVideoTracks()[0].enabled = !myMediaStream.getVideoTracks()[0].enabled;\n myVideoStatus = myMediaStream.getVideoTracks()[0].enabled;\n e.target.className = \"fas fa-video\" + (myVideoStatus ? \"\" : \"-slash\");\n if (value) {\n videoBtn.className = \"fas fa-video\" + (myVideoStatus ? \"\" : \"-slash\");\n tippy(startVideoBtn, { content: myVideoStatus ? \"Off\" : \"On\", placement: \"top\", });\n }\n setMyVideoStatus(myVideoStatus);\n}", "function playvideo(event){\n var addanimation=document.querySelector(\".\"+event);\n addanimation.classList.add(\"pressed\");\n setTimeout(function(){\n addanimation.classList.remove(\"pressed\")\n },100);\n\n}", "function toggleGif() {\n console.log(\"toggleGif\");\n if ($(this).data('active')) {\n $(this).data('active', false);\n $(this).css('background-image', 'url(' +$(this).data(\"still\") + ')');\n } else {\n $(this).data('active', true);\n $(this).css('background-image', 'url(' +$(this).data(\"animated\") + ')');\n }\n }", "function togglePlay() {\n video.paused ? video.play() : video.pause();\n}", "function toggleVideoStatus() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n if (dropdown.classList.contains('dropdown-visible')) {\n showDropdown();\n }\n}", "function playYtVideo() {\n player.playVideo();\n if (this.classList.value === playFaClass) {\n $('.playButton').tooltip('hide')\n $('.playButton').removeClass(playFaClass).toggleClass(pauseFaClass);\n $(this).attr('data-original-title','Pause')\n } else {\n $('.pauseButton').tooltip('hide');\n $('.pauseButton').removeClass(pauseFaClass).toggleClass(playFaClass);\n $(this).attr('data-original-title','Play')\n player.pauseVideo()\n }\n }", "function videosSection() {\n // alert(\"videos clicked\");\n $(\"#videos\").addClass(\"actively_selected\");\n $(\"#solo_images, #effects, #all_panel\").removeClass(\"actively_selected\").slideUp();\n $(\".actively_selected\").slideDown();\n}", "function playVideoJanFeb()\r\n{\r\n\r\n\t\t$('#image3').transition({ rotateX: '-105deg' }, 700, 'in-out', function(){ $(\"#image3\").css(\"display\",\"none\"); $(\"#image3back\").css(\"display\",\"none\"); });\r\n\t\t$('#image2').transition({ rotateX: '-105deg' , delay: 600}, 700, 'in-out', function(){ $(\"#image2\").css(\"display\",\"none\"); $(\"#image2back\").css(\"display\",\"none\"); });\r\n\t\t$('#image1').transition({ rotateX: '-105deg' , delay: 1200}, 700, 'in-out', function(){ \r\n\t\t\t\t\r\n\t\t\t\t$(\"#image1\").css(\"display\",\"none\"); \r\n\t\t\t\t$(\"#image1back\").css(\"display\",\"none\");\r\n\t\t\t\t$('#episodeVideoWindow').css(\"display\",\"block\"); \r\n\t\t\t\t$('#episodeVideoWindowBack').css(\"display\",\"block\"); \r\n\t\t\t\t$('#episodeVideoWindow').transition({ rotateX: '0deg' }, 700, 'in-out',function(){ \r\n\t\t\t\t\t//console.log(\"ROTATE ANIM END\");\r\n\t\t\t\t\t//$(\"#episodeVideoFrame\").remove(); \r\n\t\t\t\t\t$(\"#episodeVideo\").css(\"display\",\"inline-block\"); \r\n\t\t\t\t\r\n\t\t\t\t}); \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t$(\"#playVideoJanFavBTN\").css(\"display\", \"block\");\r\n\t\t\r\n\t\t$(\"#playVideoBtn\").off(\"click\",monthsToShow[currentSelectedMonth].playVideo);\r\n\t\t//console.log(\"Video Off\",$(\"#playVideoBtn\"));\r\n\t\t\r\n\t\tTweenMax.to($(\"#playVideoBtn\"),0.5,{css:{opacity: 0}, ease: Expo.easeInOut, onComplete: function(){\r\n\t\t\t$(\"#playVideoBtn\").css(\"display\",\"none\");\r\n\t\t}});\r\n\t\t$(\"#closeVideoBtn\").css(\"opacity\",\"0\").css(\"display\",\"block\");\r\n\t\t\r\n\t\t\r\n\t\t$(\"#closeVideoBtn\").on(\"click\",monthsToShow[currentSelectedMonth].reverseVideo);\r\n\t\t\r\n\t\tTweenMax.to($(\"#closeVideoBtn\"),0.5,{css:{opacity: 1}, delay: 0.5, ease: Expo.easeInOut});\r\n\t\t\r\n\t\tmonthsToShow[currentSelectedMonth].videoStatus = true;\r\n\t\t\r\n}", "function toggleVid() {\n if (playing) {\n currVid.pause();\n //currVid.hide()\n } else {\n //currVid.show()\n currVid.play();\n }\n playing = !playing;\n}", "function initSwitchImage(){\t\n\n\tvar imageBox = $(\".image-box\")\n\n\t$(\".image-box\").click(function(){\n\n\t\tvar url = $(this).attr(\"data-video-url\");\n\t\t\t$(\".video-box\").slideDown();\n\t\t\tconsole.log(url);\n\t\t\t$(\".video-box iframe\").attr(\"src\",url+ \"&autoplay=1\");\n\t\n\t});\n\n}", "function togglePlay() {\n video[video.paused ? 'play' : 'pause']();\n}", "function showIntro (){\n $('#video_intro')[0].play();\n $(\"#button_playIntro\")\n .delay(500)\n .velocity(\"transition.bounceIn\"); \n $(\"#button_scroll\")\n .delay(800)\n .velocity(\"transition.slideUpBigIn\");\n }", "function toggleVideoPlayback(e){\n\tif (e.source.playing) {\n\t\te.source.pause();\n\t} else {\n\t\te.source.play();\n\t}\n}", "function youtubeclick(){\n $(\".right_box.movie a\").click(function(e){\n var _youtubeurl=$(this).attr(\"href\");\n var _string=_youtubeurl.substr(32,42);//get youtube id\n var _youtubehref=\"https://www.youtube.com/embed/\"+_string+\"?rel=0\";\n $(\".video-container iframe\").attr(\"src\",_youtubehref);\n $(this).addClass(\"clicked\").siblings().removeClass(\"clicked\");\n\n return false;\n });\n $(\".right_box.movie a\").eq(0).click();\n }", "function gifyMotion() {\n\n var state = $(this).attr(\"data-state\");\n console.log(state);\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n}", "function hoverVideo(e) { \n\t $('video', this).get(0).play(); \n $('video', this).removeClass('gris');\n // $('video', this).get(0).currentTime = 3;\n \n\n\t}", "function imgToggler() {\n // Check if current image is still or animate and toggle\n if ($(this).attr(\"data-state\") === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n clickedGif = $(this).parent();\n }", "function pauseToggle(){\n\n\t\t//test if the video is currently playign or paused\n\t\t// posted propter - boolen\n\n\t\tif(vid.paused){\n\n\t\t\t//if paused then play the video\n\t\t\tvid.play();\n\n\t\t}else{\n\n\t\t\t//video is the\n\t\t}\n}", "function togglePlay() {\n // if (selectors.video.paused) {\n // selectors.video.play();\n // } else {\n // selectors.video.pause();\n // }\n\n const method = selectors.video.paused ? \"play\" : \"pause\";\n selectors.video[method]();\n}", "function togglePlay() {\n if(isPlaying) {\n domVideo.pause();\n isPlaying = false;\n playButton.innerHTML = '<img src=\"video-plugin/video-img/play.png\" />';\n } else {\n domVideo.play();\n isPlaying = true;\n playButton.innerHTML = '<img src=\"video-plugin/video-img/pause.png\" />';\n }\n}", "function fadeIn() {\n\t\t$(\"#ourvideo\").addClass('selected');\n\t\tif (isMute) {\n\t\t\tconsole.log('muted!')\n\t\t\tpop.mute().play();\n\t\t} else {\n\t\t\tpop.play();\n\t\t}\n\t// pop.loop('true');\n}", "function toggle() {\n if (!isRunning) {\n // if the stream is not opened one elment, open the first element\n if(document.querySelectorAll('.item-container').length < 1) {\n eventFire(document.querySelector('#stream .silent.thumb'), 'click');\n }\n launchFullscreen(document.documentElement);\n nextOnFinish();\n overlayEl.style.display = '';\n bodyEl.style.overflowY = 'hidden'; // make scrollbar disappear\n } else {\n exit();\n }\n isRunning = !isRunning;\n console.log('Pr0 TV running: ', isRunning);\n }", "function toggle_liveview(mid){\n\tif(is_button_active(\"#\"+mid+\"_toggle_liveview\")){\n\t\treturn;\n\t};\n\n\tif(is_liveview_open(mid)){\n\t\thide_liveview(mid,true);\n\t} else {\n\t\tshow_liveview(mid);\n\t};\n}", "function videos_array_clicked(evnt) {\n if (evnt.target.tagName == 'IMG') { //This if is to be doubly sure an image was clicked\n player.pauseVideo();\n player.loadVideoById(playlist[evnt.target.video_index]);\n console.log(\"Currently Playing video: \" + playlist[evnt.target.video_index]);\n featured_image.style.display = \"none\";\n youtube_vid.style.display = \"block\";\n }\n current_featured_is_video = true;\n }", "toggle(event) {\n if (this.playing) {\n this.pause();\n }\n else {\n this.play();\n }\n this.playing = !this.playing;\n }", "toggle() {\n this[ this.options.animate ? '_toggleAnimate' : '_toggleClass']();\n }", "function toggleVisibility() {\n if (!$('#trailer').hasClass('hidden')) {\n $('.opacity').addClass('hidden');\n $('#trailer').addClass('hidden');\n }\n }", "function toggleGifAnimation() {\n\n\n //set variable called 'state' to value of 'data-state' attribute\n var state = $(this).attr('data-state') ;\n \n \n\n if (state == 'still') {\n //set 'src' attribute to 'data-animate' value\n $(this).attr('src', $(this).attr('data-animate') );\n //set 'data-state' attribute to 'animate'\n $(this).attr('data-state', 'animate');\n }\n else if (state == 'animate') {\n //set 'src' attribute to 'data-still' value\n $(this).attr('src', $(this).attr('data-still') );\n //set 'data-state' attribute to 'still'\n $(this).attr('data-state', 'still' );\n }\n\n}", "toggleAnimate() {\n this.carouselContent.classList.toggle('carousel-animate');\n }", "function videoStarter() {\n\n\t$('#hero').vide({\n\t\tmp4:'videos/headerloop4.mp4',\n\t\togv:'videos/headerloop4.ogv',\n\t\twebm:'videos/headerloop4.webm'\n\t\t}, {\n\t\tloop: true,\n\t\tmuted: true,\n\t\tautoplay: true,\n\t\tposterType: \"jpg\",\n\t\tclassName: \"tn-video\"\n\t});\n\n}", "play(){this.__stopped=!0;this.toggleAnimation()}", "function videoReveal(selectedCard, randNum) {\n // Determine which video should play\n var videoToPlay,\n selectedVideo = selectedCard + randNum,\n msg = document.getElementById('msg');\n\n switch (selectedVideo) {\n case 'player1':\n videoToPlay = document.getElementById('player1');\n break;\n case 'player2':\n videoToPlay = document.getElementById('player2');\n break;\n case 'dealer1':\n videoToPlay = document.getElementById('dealer1');\n break;\n case 'dealer2':\n videoToPlay = document.getElementById('dealer2');\n break;\n case 'tie1':\n videoToPlay = document.getElementById('tie1');\n break;\n case 'tie2':\n videoToPlay = document.getElementById('tie2');\n break;\n\n default:\n document.getElementById('tie1');\n break;\n }\n // Fade in\n TweenLite.to(videoToPlay, 0.2, {\n autoAlpha: 1,\n onComplete: playVideo\n });\n\n // Play video\n function playVideo() {\n setTimeout(function() {\n videoToPlay.play();\n }, 400);\n }\n\n // Hide video once ended\n videoToPlay.addEventListener('ended', videoEnded, false);\n\n function videoEnded() {\n TweenLite.to(videoToPlay, 0.5, {\n autoAlpha: 0,\n onComplete: winnerMsg\n });\n }\n\n // Display message once video ended tween is complete\n function winnerMsg() {\n TweenLite.to(videoToPlay, 0.5, {\n autoAlpha: 0\n });\n TweenLite.to(msg, 0.5, {\n autoAlpha: 1\n });\n // Hide video overlay on click\n var $vidWrapper = $('.video-overlay');\n $($vidWrapper).on('click', function() {\n TweenLite.to([$vidWrapper, msg], 0.3, {\n autoAlpha: 0\n });\n //TweenMax.killAll();\n });\n }\n }", "function clickVideo(video){\n if(document.getElementById(video).style.visibility == \"visible\")\n document.getElementById(video).style.visibility = \"hidden\";\n else{\n document.getElementById(video).style.visibility = \"visible\"; \n }\n}", "function updateCurrentVideo(current) {\n if (current.hasClass('playing'))\n return;\n\n $('.video-thumb').removeClass('playing');\n current.addClass('playing');\n }", "function pausegifs() {\n console.log(\"clikedit\")\n var state = $(this).attr(\"state\")\n console.log(state)\n if (state === \"animate\") {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"state\", \"still\");\n }\n else {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"state\", \"animate\");\n }\n}", "function togglePlay(){\n console.log(\"working? togglePlay fn\")\n const method = video.paused ? 'play' : 'pause';\n video[method]();\n}", "function videoDisplay() {\n if (videoButton.hidden == true) {\n videoElement.hidden = true;\n videoPageElement.hidden = false;\n } else {\n videoElement.hidden = false;\n videoPageElement.hidden = true;\n }\n}", "function setMyVideoStatus(status) {\n\n myVideoImg.style.display = status ? \"none\" : \"block\";\n myVideoStatusIcon.className = \"fas fa-video\" + (status ? \"\" : \"-slash\");\n // send my video status to all peers in the room\n sendStatus(\"video\", status);\n tippy(myVideoStatusIcon, { content: status ? \"My video is On\" : \"My video is Off\", });\n tippy(videoBtn, { content: status ? \"Off\" : \"On\", placement: \"right-start\", });\n}", "function pag_toggleVideo(button) {\n if (button.title == \"Disable video\") {\n button.title = \"Enable video\";\n document.getElementById(button.id + \"_image\").src =\n pag_context + \"/images/cameraDisabled.png\";\n document.pag_venueClientController.enableVideo(0);\n } else {\n button.title = \"Disable video\";\n document.getElementById(button.id + \"_image\").src =\n pag_context + \"/images/camera.png\";\n document.pag_venueClientController.enableVideo(1);\n }\n}", "function toggleVideoStatus() {\n // Get minutes\n let mins = Math.floor(video.duration / 60);\n if (mins < 10) {\n mins = '0' + String(mins);\n }\n\n // Get seconds\n let secs = Math.floor(video.duration % 60);\n if (secs < 10) {\n secs = '0' + String(secs);\n }\n\n videoLength.innerHTML = `/${mins}:${secs}`;\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "function startBGMovie() {\n $(\".js-fade_in\").delay(1000).fadeOut(3000); //Fade in video\n $(\".js-logo, .js-menu, .js-whitebar\").delay(4000).fadeIn(1000); //Fade in logo, menu ,and white bar\n }", "function togglePlay() {\n const method = video.paused ? 'play' : 'pause' ;\n video[method]();\n}", "$mediaplayerPlay() {\n // console.log('mediaplayerPlay');\n this.tag('Stop').patch({\n visible: false\n }, false);\n this.tag('Play').patch({\n visible: false \n }, false);\n \n}", "function showCover() {\n $(\".vjs-poster\").addClass(\"endCover\");\n}", "function videoClickEvent(item,container,opt,simpleframe) {\n\n\n\t\t\t item.css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\t\t\t item.closest('.esg-overflowtrick').css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\t\t\t item.closest('ul').css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\n\n\t\t\t // PREPARE THE CONTAINERS FOR MEDIAS\n\t\t\t if (!simpleframe)\n\t\t\t\t item.find('.esg-media-video').each(function() {\n\t\t\t\t var prep = jQuery(this);\n\t\t\t\t if (prep.data('youtube')!=undefined && item.find('.esg-youtube-frame').length==0) {\n\t\t\t\t\t var media= item.find('.esg-entry-media');\n\t\t\t\t \t var ytframe = \"https://www.youtube.com/embed/\"+prep.data('youtube')+\"?version=3&enablejsapi=1&html5=1&controls=1&autohide=1&rel=0&showinfo=0\";\n\t\t\t\t\t media.append('<iframe class=\"esg-youtube-frame\" wmode=\"Opaque\" style=\"position:absolute;top:0px;left:0px;display:none\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" data-src=\"'+ytframe+'\" src=\"about:blank\"></iframe>');\n\t\t\t\t }\n\n\t\t\t\t if (prep.data('vimeo')!=undefined && item.find('.esg-vimeo-frame').length==0) {\n\t\t\t\t\t var media= item.find('.esg-entry-media');\n\t\t\t\t \t var vimframe = \"http://player.vimeo.com/video/\"+prep.data('youtube')+\"?title=0&byline=0&html5=1&portrait=0&api=1;\";\n\t\t\t\t\t media.append('<iframe class=\"esg-vimeo-frame\" allowfullscreen=\"false\" style=\"position:absolute;top:0px;left:0px;display:none\" webkitallowfullscreen=\"\" mozallowfullscreen=\"\" allowfullscreen=\"\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" data-src=\"'+vimframe+'\" src=\"about:blank\"></iframe>');\n\t\t\t\t }\n\t\t\t\t\tif (prep.data('wistia')!=undefined && item.find('.esg-wistia-frame').length==0) {\n\t\t\t\t\t var media= item.find('.esg-entry-media');\n\t\t\t\t \t var wsframe = \"https://fast.wistia.net/embed/iframe/\"+prep.data('wistia')+\"?version=3&enablejsapi=1&html5=1&controls=1&autohide=1&rel=0&showinfo=0\";\n\t\t\t\t\t media.append('<iframe class=\"esg-wistia-frame\" wmode=\"Opaque\" style=\"position:absolute;top:0px;left:0px;display:none\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" data-src=\"'+wsframe+'\" src=\"about:blank\"></iframe>');\n\t\t\t\t }\n\t\t\t\t if (prep.data('soundcloud')!=undefined && item.find('.esg-soundcloud-frame').length==0) {\n\t\t\t\t\t var media = item.find('.esg-entry-media');\n\t\t\t\t\t var scframe = 'https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/'+prep.data('soundcloud')+'&amp;auto_play=false&amp;hide_related=false&amp;visual=true&amp;show_artwork=true';\n\t\t\t\t\t media.append('<iframe class=\"esg-soundcloud-frame\" allowfullscreen=\"false\" style=\"position:absolute;top:0px;left:0px;display:none\" webkitallowfullscreen=\"\" mozallowfullscreen=\"\" allowfullscreen=\"\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" scrolling=\"no\" frameborder=\"no\" data-src=\"'+scframe+'\" src=\"about:blank\"></iframe>');\n\t\t\t\t }\n\n\t\t\t\t if ((prep.data('mp4')!=undefined || prep.data('webm')!=undefined || prep.data('ogv')!=undefined) && item.find('.esg-video-frame').length==0 ) {\n\t\t\t\t \t var media= item.find('.esg-entry-media');\n\t\t\t media.append('<video class=\"esg-video-frame\" style=\"position:absolute;top:0px;left:0px;display:none\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" data-origw=\"'+prep.attr(\"width\")+'\" data-origh=\"'+prep.attr(\"height\")+'\" ></video');\n\t\t\t\t if (prep.data('mp4')!=undefined) media.find('video').append('<source src=\"'+prep.data(\"mp4\")+'\" type=\"video/mp4\" />');\n\t\t\t\t if (prep.data('webm')!=undefined) media.find('video').append('<source src=\"'+prep.data(\"webm\")+'\" type=\"video/webm\" />');\n\t\t\t\t if (prep.data('ogv')!=undefined) media.find('video').append('<source src=\"'+prep.data(\"ogv\")+'\" type=\"video/ogg\" />');\n\t\t\t\t }\n\n\t\t\t\t })\n\n\t\t\t adjustMediaSize(item,true,null,opt);\n\n\t\t\t var ifr = item.find('.esg-youtube-frame');\n\t\t\t if (ifr.length==0) ifr=item.find('.esg-vimeo-frame');\n\t\t\t if (ifr.length==0) ifr=item.find('.esg-wistia-frame');\n\t\t\t if (ifr.length==0) ifr=item.find('.esg-soundcloud-frame');\n\t\t\t if (ifr.length==0) ifr=item.find('.esg-video-frame');\n\n\t\t\t var cover = item.find('.esg-entry-cover');\n\t\t\t var poster = item.find('.esg-media-poster');\n\n\n\n\t\t\t // IN CASE NO FRAME IS PREDEFINED YET WE NEED TO LOAD API, AND VIDEO, AND CHANGE SRC\n\n\t\t\t if (ifr.attr('src')==\"about:blank\") {\n\t\t\t\t ifr.attr('src',ifr.data('src'));\n\n\t\t\t\t loadVideoApis(container,opt);\n\t\t\t\t if (!simpleframe) punchgs.TweenLite.set(ifr,{opacity:0,display:\"block\"});\n\t\t\t\t var intr = setInterval(function() {\n\n\t\t\t\t \t// CHECK IF YOUTUBE MEDIA IS IN THE CONTAINER\n\t\t\t\t \tif (ifr.attr('src').toLowerCase().indexOf('youtube')>0) {\n\t\t\t\t \t if (prepareYT(ifr)==true) {\n\n\t\t\t\t \t\t\tclearInterval(intr);\n\t\t\t\t \t\t\tif (!simpleframe) {\n\t\t\t\t \t\t\t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tplayYT(ifr,simpleframe);\n\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t \t}\n\t\t\t\t \t }\n\t\t\t\t \t}\n\n\t\t\t\t \telse\n\n\t\t\t\t\t// CHECK IF VIMEO MEDIA IS IN THE CONTAINER\n\t\t\t\t \tif (ifr.attr('src').toLowerCase().indexOf('vimeo')>0) {\n\t\t\t\t \t if (prepareVimeo(ifr)==true) {\n\t\t\t\t \t \t\tclearInterval(intr);\n\t\t\t\t \t \t\tif (!simpleframe) {\n\t\t\t\t\t \t \t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\n\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t \tplayVimeo(ifr,simpleframe);\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t \telse\n\t\t\t\t\t\n\t\t\t\t\t// CHECK IF wistia MEDIA IS IN THE CONTAINER\n\t\t\t\t\tif (ifr.attr('src').toLowerCase().indexOf('wistia')>0) {\n\t\t\t\t\t\tif (prepareWs(ifr)==true) {\n\n\t\t\t\t \t\t\tclearInterval(intr);\n\t\t\t\t \t\t\tif (!simpleframe) {\n\t\t\t\t \t\t\t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tplayYT(ifr,simpleframe);\n\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t \t}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t// CHECK IF VIMEO MEDIA IS IN THE CONTAINER\n\t\t\t\t \tif (ifr.attr('src').toLowerCase().indexOf('soundcloud')>0) {\n\t\t\t\t \t if (prepareSoundCloud(ifr)==true) {\n\t\t\t\t \t \t\tclearInterval(intr);\n\t\t\t\t \t \t\tif (!simpleframe) {\n\t\t\t\t\t\t \t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\n\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t \t\tplaySC(ifr,simpleframe);\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t},100);\n\t\t\t} else\n\n\t\t\tif (ifr.hasClass(\"esg-video-frame\")) {\n\n\t\t\t\t loadVideoApis(container,opt);\n\t\t\t\t punchgs.TweenLite.set(ifr,{opacity:0,display:\"block\"});\n\t\t\t\t // CHECK IF VIDEO MEDIA IS IN THE CONTAINER\n\t\t\t\t var intr = setInterval(function() {\n\t\t\t\t \t if (prepareVideo(ifr)==true) {\n\t\t\t\t \t \t\tclearInterval(intr);\n\t\t\t\t \t \t\tif (!simpleframe) {\n\t\t\t\t\t \t \t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\n\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t \tplayVideo(ifr,simpleframe);\n\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t}\n\t\t\t\t },100)\n\n\t\t\t } else {\n\t\t\t\tif (!simpleframe) {\n\t\t\t\t\tif (is_mobile()) {\n\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t} else {\n\n\t\t\t\t\t\tpunchgs.TweenLite.set(ifr,{opacity:0,display:\"block\"});\n\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\t\t\t\t \t}\n\t\t\t \t}\n\t\t \t\tif (ifr.attr('src') !=undefined) {\n\t\t\t \t\tif (ifr.attr('src').toLowerCase().indexOf('youtube')>0)\n\t\t\t\t\t \tplayYT(ifr,simpleframe);\n\t\t\t\t\tif (ifr.attr('src').toLowerCase().indexOf('vimeo')>0)\n\t\t\t\t\t \tplayVimeo(ifr,simpleframe);\n\t\t\t\t\tif (ifr.attr('src').toLowerCase().indexOf('wistia')>0)\n\t\t\t\t\t \tplayWs(ifr,simpleframe);\n\t\t\t\t\tif (ifr.attr('src').toLowerCase().indexOf('soundcloud')>0)\n\t\t\t\t\t \tplaySC(ifr,simpleframe);\n\n\t\t\t\t}\n\t\t\t }\n}", "function doHideAdvLinkFast()\n {\n if($('#oc-link-advanced-player').is(':animated')) {\n $('#oc-link-advanced-player').stop();\n }\n $('#oc-link-advanced-player').css('marginLeft', '-'+_width+'px');\n }", "function updateButton() {\n // My solution\n // if (!video.paused) {\n // toggle.textContent = \"││\";\n // } else {\n // toggle.textContent = \"►\";\n // }\n\n // Wes's solution\n const icon = this.paused ? \"►\" : \"││\"; // `this` used instead of `video`\n toggle.textContent = icon;\n}", "function animateFighter() { \n var state = $(this).attr(\"data-state\");\n console.log(state);\n if (state == \"still\") {\n $(this).attr(\"src\", $(this).data(\"animate\"));\n $(this).attr(\"data-state\", \"animate\");\n }\n else {\n $(this).attr(\"src\", $(this).data(\"still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n }", "function slide(e){\n var indices, background, video;\n\n // Loop background vid\n indices = Reveal.getIndices(Reveal.getCurrentSlide());\n background = Reveal.getSlideBackground(indices.h, 0);\n video = background.querySelector('video');\n if (video) {\n video.loop = true;\n }\n\n // Also play slide vid\n var slideVid = e.currentSlide.querySelector('video');\n if (slideVid) {\n setTimeout(function(){\n slideVid.play();\n }, 500);\n }\n }", "toggleTimeframe(){\n\t\t// NOT YET IMPLEMENTED\n\t}", "function playGif() {\n var state = $(this).attr(\"data-state\");\n \n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).attr(\"data-state\", \"still\");\n }\n}", "function toggleplay() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "function togglePlayVideo() {\n let icon = playbtn.querySelector('.video-ctrl-bt');\n if(video.paused) {\n videoduration = convertSecondsToMinutes(video.duration);\n overvideo.style.backgroundColor = 'transparent';\n video.play();\n playToPauseBtn(icon);\n videobtn.style.display = 'none';\n addVideoListeners();\n outVideoControl();\n videoPlaying = true;\n }\n else {\n video.pause();\n pauseToPlayBtn(icon);\n videobtn.style.display = 'block';\n removeVideoListeners();\n videoCtrlTl.reverse();\n videoPlaying = false;\n }\n }", "function initalizeVideoElements() {\n var fade_in_videos = document.querySelectorAll(\".fade-in-video\");\n if (fade_in_videos.length) {\n for (i = 0; i < fade_in_videos.length; i++) {\n fade_in_videos[i].addEventListener(\"playing\", function() {\n this.classList.add(\"is-playing\");\n });\n }\n }\n}", "togglePlay() {\n if (this.paused) {\n this.animation = this.animate();\n } else {\n clearInterval(this.animation);\n }\n this.paused = !this.paused;\n }", "function onPlayerStateChange(event) {\n\n\t\t\t\t\t var embedCode = event.target.getVideoEmbedCode();\n\t\t\t\t\t var container = jQuery('#'+embedCode.split('id=\"')[1].split('\"')[0]).closest('.tp-simpleresponsive');\n\n\t\t\t\t\tif (event.data == YT.PlayerState.PLAYING) {\n\n\t\t\t\t\t\tvar bt = container.find('.tp-bannertimer');\n\t\t\t\t\t\tvar opt = bt.data('opt');\n\t\t\t\t\t\tbt.stop();\n\n\t\t\t\t\t\topt.videoplaying=true;\n\t\t\t\t\t\t//konsole.log(\"VideoPlay set to True due onPlayerStateChange PLAYING\");\n\t\t\t\t\t\topt.videostartednow=1;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tvar bt = container.find('.tp-bannertimer');\n\t\t\t\t\t\tvar opt = bt.data('opt');\n\n\t\t\t\t\t\tif (event.data!=-1) {\n\t\t\t\t\t\t\tif (opt.conthover==0)\n\t\t\t\t\t\t\t\tbt.animate({'width':\"100%\"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:\"linear\"});\n\t\t\t\t\t\t\topt.videoplaying=false;\n\t\t\t\t\t\t\topt.videostoppednow=1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (event.data==0 && opt.nextslideatend==true)\n\t\t\t\t\t\topt.container.revnext();\n\n\n\t\t\t\t }", "onVideoClick (video) {\n this.setState ({\n singleVideo: video\n });\n }", "function playVideo() { \n\t\t$(\"#index-vid-a\").removeClass(\"hidden\"); \n\t \t$(\"#vid-pic\").css('display', 'none');\n\t \t$(\"#index-vid-b\").css('display', 'none');\n\t \tvar vid = $(\"#index-vid-a\");\n\t vid.controls = false;\n\t vid.load();\n\t vid.on('ended',function(){\n\t \t$(vid).css('display', 'none');\n\t\t\t$(\"#index-vid-b\").css('display', 'inline-block');\n\t\t\tvar vidb = $(\"#index-vid-b\");\n\t\t\tvidb.controls = false;\n\t \tvidb.load();\n\t \tvidb.on('ended',function(){ \n\t \t\t\t$(vidb).css('display', 'none');\n\t\t\t\t$(\"#vid-pic\").css('display', 'inline-block');\n\t\t\t});\n\t}); \n\n\t}", "function togglePlay() {\n\t// Selecting the right method\n\tconst method = video.paused ? 'play' : 'pause';\n\t// Calling the finction\n\tvideo[method]();\n}", "function updateButton() {\n // we can use this because it's bound to the video itself\n const icon = this.paused ? '►' : '❚ ❚';\n toggle.textContent = icon;\n}", "function togglePanel() {\n renewElement($(\".anim-wrap\"));\n var $animated = $(\".anim-wrap\");\n var shown = $animated.hasClass('on');\n $animated.toggleClass('on', !shown).toggleClass('off', shown);\n }", "function togglePlay() {\n const method = video.paused ? 'play' : 'pause';\n video[method]();\n}", "function videoEndHandler1(e) {\r\n //creative.dom.video1.vid.currentTime = 0;\r\n console.log('expanded intro video ended')\r\n creative.dom.video1.vid.pause();\r\n creative.dom.video1.vidPauseBtn.style.visibility = 'hidden';\r\n creative.dom.video1.vidPlayBtn.style.visibility = 'visible';\r\n creative.isClick1 = true;\r\n ShowExpandedEndFrame ();\r\n}", "function clickthrough(event) \n{\n switch(event.target)\n {\n case video :\n \n if (!isMobile.any())\n {\n addClass(animation, 'start'); \n Enabler.exit(\"Click_On_Video\");\n freeze();\n videoContainer.style.visibility = \"hidden\";\n video.pause(); \n \n }\n break;\n case click:\n case zoneExpandCtaBtn :\n Enabler.exit(\"Click_On_Endshot\");\n addClass(animation, 'start'); \n freeze();\n break;\n case loader:\n clickOnLoader = true;\n loader.style.display = \"none\";\n addClass(animation, 'start'); \n freeze();\n Enabler.exit(\"Click_On_Loader\");\n break;\n }\n}", "function video(id, src){\n var open=false;\n\n //AGREGAR HTML DEL HOTSPOT\n $(\"#contentHotSpot\").append(\n \"<div id='video' class='hots\"+id+\" hotspotElement hotsLowOpacity'>\"+\n \"<div class='icon_wrapper'>\"+\n \"<div class='icon'>\"+\n \"<div id='inner_icon' class='inner_icon'>\"+\n \"<svg id='videoIcon' enable-background='new 0 0 494.942 494.942' viewBox='0 0 494.942 494.942' xmlns='http://www.w3.org/2000/svg'><path d='m35.353 0 424.236 247.471-424.236 247.471z'/></svg>\"+\n \"<svg style='display:none;' id='closeIcon' enable-background='new 0 0 386.667 386.667' viewBox='0 0 386.667 386.667' xmlns='http://www.w3.org/2000/svg'><path d='m386.667 45.564-45.564-45.564-147.77 147.769-147.769-147.769-45.564 45.564 147.769 147.769-147.769 147.77 45.564 45.564 147.769-147.769 147.769 147.769 45.564-45.564-147.768-147.77z'/></svg>\"+\n \"</div>\"+\n \"</div>\"+\n \"</div>\"+\n \"</div>\"+\n\n \"<div id='contentVideo\"+id+\"' class='contentVideo l6 hidden centerVH'>\"+\n \"<svg id='closeButton' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'>\"+\n \"<polygon points='28,22.398 19.594,14 28,5.602 22.398,0 14,8.402 5.598,0 0,5.602 8.398,14 0,22.398 5.598,28 14,19.598 22.398,28'/>\"+\n \"</svg>\"+\n \"<div class='aspectRatioVideo'>\"+\n \"<iframe src='https://player.vimeo.com/video/\"+src+\"' frameborder='0' allow='autoplay; fullscreen' allowfullscreen></iframe>\"+\n \"</div>\"+\n \"</div>\"\n ); \n\n //----------------------------------------------------------------------\n\n //ACCIONES AL HACER CLIC EN EL \n $(\".hots\"+id).click(function(){ \n //Apertura de hotspot\n if(open==false){\n //$(\".hots\"+id).removeClass('expanded');\n //$(\".hots\"+id+\" #inner_icon\").removeClass('closeIcon');\n open=true;\n $(\"#contentVideo\"+id).show();\n\n //Cerrrar los audios abiertos\n $(\".hostAudio\").removeClass('expanded');\n $(\".contentAudio\").hide();\n $('audio').each(function(){\n this.pause(); // Stop playing\n this.currentTime = 0; // Reset time\n });\n \n }\n });\n\n //ACCIONES PARA CERRAR LA VENTANA MODAL\n $(\"#closeButton, .contentVideo\").on(\"click\", function(){\n if(open==true){\n open=false;\n $(\"#contentVideo\"+id).hide();\n\n //Detener video\n var url = $(\"#contentVideo\"+id+\" iframe\").attr('src');\n $(\"#contentVideo\"+id+\" iframe\").attr('src','');\n $(\"#contentVideo\"+id+\" iframe\").attr('src',url);\n }\n });\n\n\n}", "function vidFade() {\n var vid = document.getElementById(\"bgvid\");\n vid.classList.add(\"stopfade\");\n}", "toggleVisible(){\n $(this.content).animate({width: 'toggle'}, 300);\n }", "function imgClick(e) {\n musicInfo = e.target.alt;\n splitInfo = musicInfo.split('_');\n DOMString.getCurrentMusicVideoTitle.textContent = splitInfo[0];\n DOMString.getCurrentMusicVideoArtist.textContent = splitInfo[1];\n DOMString.getCurrentMusicVideo.src = e.target.dataset.src;\n\n DOMString.getCurrentMusicVideoHeading.classList.add('fadeIn');\n setTimeout(() => DOMString.getCurrentMusicVideoHeading.classList.remove('fadeIn'), 500);\n }", "function OnComplete()\n{\nvideoContainer.style.visibility = \"hidden\";\naddClass(animation, 'start');\nvideoComplete = true;\n}", "stopVideo() {\n\n var myVideoac = document.getElementById(\"embedVideo-ac\");\n var myVideo = document.getElementById(\"embedVideo\");\n \n if(myVideoac) { \n $(myVideoac).attr(\"src\", $(myVideoac).attr(\"src\"));\n } \n if(myVideo) { \n $(myVideo).attr(\"src\", $(myVideo).attr(\"src\")); \n }\n \n }", "function videoClick(){\n\n var div = $(\"#videoPanel\");\n target_offset = div.offset();\n target_top = target_offset.top;\n\n $('html, body').animate({scrollTop:target_top}, 500);\n var ul = $(\"#ulNav\");\n ul.children().removeClass('highlightNav');\n $('#videoNav').addClass('highlightNav');\n}", "function toggleModal() {\n $('body').classList.toggle('modalOpen');\n //Force video to stop playing when modal is closed - we could do this in a nicer way if we used the youtube API.\n $('modalTrailer').setAttribute('src', '');\n //Inverse modalHiddenState\n modalHiddenState = !modalHiddenState;\n $('modalTrailer').setAttribute('aria-hidden', modalHiddenState);\n}", "function soundOnOff() {\r\n\r\n\t$(\"#mute-video\").on('click', function() {\r\n\r\n\t\tif ($('#mute-video').hasClass('soundOn')) {\r\n\r\n\t\t\t$('#mute-video')\r\n\t\t\t\t.removeClass('soundOn')\r\n\t\t\t\t.addClass('soundOff');\r\n\r\n\r\n\t\t} else {\r\n\r\n\t\t\t$('#mute-video')\r\n\t\t\t\t.removeClass('soundOff')\r\n\t\t\t\t.addClass('soundOn');\r\n\r\n\t\t}\r\n\r\n });\r\n\r\n}", "toggle(){\n this.sound.playing() ? this.sound.stop() : this.sound.play();\n }", "toggle(){\n this.sound.playing() ? this.sound.stop() : this.sound.play();\n }", "function flicking() {\n\trecordShow.classList.toggle(\"large\");\n}", "function clickGif() {\n \n //console.log($(this).attr(\"still\"));\n \n if($(this).attr(\"still\") === \"true\") {\n console.log(\"making image move\")\n console.log($(this).attr(\"activeLink\"))\n $(this).attr(\"src\", $(this).attr(\"activeLink\"));\n $(this).attr(\"still\", \"false\");\n } else {\n //console.log(\"making image still\")\n $(this).attr(\"src\", $(this).attr(\"stillLink\"));\n $(this).attr(\"still\", \"true\");\n \n }\n }" ]
[ "0.6483139", "0.6390514", "0.6388819", "0.63766366", "0.63230723", "0.6285341", "0.6250968", "0.62208354", "0.62047714", "0.6186793", "0.6175213", "0.61472607", "0.61271334", "0.6116968", "0.61030436", "0.60870284", "0.6034762", "0.60342544", "0.6033538", "0.6010624", "0.600664", "0.5990795", "0.5978109", "0.59750396", "0.5952756", "0.59456676", "0.5940139", "0.593725", "0.59303576", "0.5928442", "0.5911852", "0.588959", "0.58775526", "0.5875024", "0.5860519", "0.5850675", "0.5842035", "0.583509", "0.58258444", "0.5820298", "0.581592", "0.58145654", "0.5809908", "0.5800607", "0.5799695", "0.579148", "0.5790982", "0.57892567", "0.5784414", "0.5773529", "0.5770199", "0.5764671", "0.57622916", "0.57610863", "0.57588273", "0.57431906", "0.5740679", "0.5735213", "0.57339275", "0.5721563", "0.57210964", "0.5710766", "0.5700394", "0.5695946", "0.5694379", "0.5693946", "0.569318", "0.5687834", "0.5678141", "0.567528", "0.566921", "0.56683093", "0.56604755", "0.56561404", "0.56554854", "0.5654442", "0.5653641", "0.56495035", "0.5641625", "0.56395215", "0.5635748", "0.5628998", "0.5627874", "0.5622572", "0.56159604", "0.56156754", "0.56149805", "0.561152", "0.561111", "0.5609141", "0.5607157", "0.5606069", "0.5603803", "0.56030107", "0.5597758", "0.55916804", "0.5580666", "0.5580666", "0.55805224", "0.5579676" ]
0.7665488
0
gets video ID from link
function getID(videoLink) { let id; if(videoLink.indexOf("youtube.com/watch?v=") >= 0) { id = videoLink.substr(videoLink.indexOf("=")+1, 11); } else { id = videoLink.substr(videoLink.indexOf("be/")+3, 11); } if (id.length != 11 || !id.match(/^[a-z0-9\-_]+$/i)) { id = false; } return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVideoIDfromLink(url)\n{\n\t\tvar regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n\t\tvar match = url.match(regExp);\n\t\tif (match&&match[2].length==11){\n\t\t\t\treturn match[2];\n\t\t}else{\n\t\t\t\t//error\n\t\t}\n}", "function get_videoID()\r\n{\r\n\tv_id_patch=url.split(\"v=\");\r\n\tid_offset=v_id_patch[1].indexOf(\"&\");\r\n\tif(id_offset==-1) id_offset=v_id_patch[1].length;\r\n\tvid_id=v_id_patch[1].substring(0,id_offset);\r\n}", "function getYoutubeId(link){\r\n let id = link.split(\"=\")[1].split(\"&\")[0];\r\n return id;\r\n}", "getVideoID(){\n return location.href.split('/').pop().replace('#','');\n }", "function getVideoId(url)\r\n{\r\n url = url.split(\"?v=\")[1]\r\n try { url = url.split(\"&\")[0]; }\r\n catch (error) {}\r\n return url;\r\n}", "function getVideoId()\n {\n if (window.location.search.length > 0)\n {\n var s = window.location.search.substring(1);\n var requestObjects = s.split('&');\n for (var i = 0, len = requestObjects.length; i < len; i += 1)\n {\n var obj = requestObjects[i].split('=');\n if (obj[0] === \"v\")\n {\n console.log(\"Video ID is \" + obj[1]);\n return obj[1];\n }\n }\n }\n\n return null;\n }", "_getThumbnail(link) {\n var video_id = link.split(\"v=\")[1];\n var ampersandPosition = video_id.indexOf(\"&\");\n if (ampersandPosition !== -1) {\n video_id = video_id.substring(0, ampersandPosition);\n }\n return video_id;\n }", "function youtubeid(url) {\n var myregexp = /(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})/i;\n var videoID = url.match(myregexp);\n // var ytid = url.match(\"[\\\\?&]v=([^&#]*)\");\n videoID = videoID[1];\n return videoID;\n }", "function getVideoId() {\n\t// Get the URL without any query parameters or anchors\n\tlet url = window.location.href;\n\tif(DEBUG) console.log(`Netflix SRT subs URL: ${url}`);\n\n\tmatch = /netflix\\.[a-z]+\\/watch\\/([0-9]+)/i.exec(url);\n\tif(match !== null && match.length > 1) {\n\t\tlet videoId = match[1];\n\t\tif(DEBUG) console.log(`Netflix SRT subs detected this page to be a video (id = ${videoId})`);\n\t\treturn videoId;\n\t}\n\telse {\n\t\treturn null;\n\t}\n}", "function getYouTubeVideoId () {\r\n\tvar regex = /(\\?|%3F|&|%26)v=[^\\?&#]*/gi;\r\n\tvar matches = document.URL.match(regex);\r\n\tif(matches == null) {\r\n\t\treturn null;\r\n\t}\r\n\tvar removeRegex = /(\\?|%3F|&|%26)v=/gi;\r\n\tvar vidId = matches[0].replace(removeRegex, \"\");\r\n\tif(vidId == null) {\r\n\t\treturn;\r\n\t}\r\n\treturn vidId;\r\n}", "function getVideoId(input) {\n\n var qs = new Querystring(input.split(\"?\")[1]);\n return qs.get(\"v\");\n}", "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n }", "function getVideoId(url){\n if(url.indexOf('?') != -1 ) {\n var query = decodeURI(url).split('?')[1];\n var params = query.split('&');\n for(var i=0,l = params.length;i<l;i++)\n if(params[i].indexOf('v=') === 0)\n return params[i].replace('v=','');\n } else if (url.indexOf('youtu.be') != -1) {\n return decodeURI(url).split('youtu.be/')[1];\n }\n return null;\n}", "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}", "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}", "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}", "function get_youtube_id_from_url(url) {\n var patt = new RegExp('v=([0-9a-zA-Z_-])+');\n var id = patt.exec(url);\n if (id != null && id.length > 0) {\n return id[0].substr(2);\n }\n return '';\n}", "function get_video_id(string) {\n let regex = /(?:\\?v=|&v=|youtu\\.be\\/)(.*?)(?:\\?|&|$)/\n let matches = string.match(regex)\n\n if (matches) {\n return matches[1]\n } else {\n return string\n }\n}", "function getVideoID(url){\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#&?]*).*/;\n var match = url.match(regExp);\n return (match&&match[7].length==11)? match[7] : false;\n }", "function getVideoIdParameterByName(name, url) {\r\n\tif (!url)\r\n\t\turl = $('#videoLink').val();\r\n\tname = name.replace(/[\\[\\]]/g, \"\\\\$&\");\r\n\tvar regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"), results = regex.exec(url);\r\n\tif (!results)\r\n\t\treturn null;\r\n\tif (!results[2])\r\n\t\treturn '';\r\n\treturn decodeURIComponent(results[2].replace(/\\+/g, \" \"));\r\n}", "getSongIdFromUrl(url) {\n let videoId,\n ampersandPosition;\n\n if (!url) return false;\n\n if (url.indexOf('?v=') !== -1) videoId = url.split('?v=')[1];\n else if (url.indexOf('youtu.be/') !== -1) videoId = url.split('youtu.be/')[1];\n\n if (!videoId) return url;\n\n ampersandPosition = videoId.indexOf('&');\n\n if (ampersandPosition !== -1) videoId = videoId.substring(0, ampersandPosition);\n\n return videoId;\n }", "function getLinkId(url) {\n\n var id = url.slice(url.lastIndexOf('/') + 1, url.length);\n //console.log(\"ID= \" + id);\n return id;\n\n}//get link id", "static getCurrentVideoId() {\n if (Application.currentMediaService() === Service.YouTube) {\n if (window.location.search.length > 0) {\n let s = window.location.search.substring(1);\n let requestObjects = s.split('&');\n for (let i = 0, len = requestObjects.length; i < len; i += 1) {\n let obj = requestObjects[i].split('=');\n if (obj[0] === \"v\") {\n return obj[1];\n }\n }\n }\n }\n else if (Application.currentMediaService() === Service.KissAnime) {\n /** if ((window.location.pathname.match(/\\//g) || []).length === 2) {\n return document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 3).join(\"\\n\").trim();\n }\n else*/ if ((window.location.pathname.match(/\\//g) || []).length > 2) {\n return (document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 3).join(\"\\n\").trim() + \" \" + parseInt(document.getElementById(\"selectEpisode\").options[document.getElementById(\"selectEpisode\").selectedIndex].textContent.match(/(\\d+(\\.\\d+)?)(?!.*\\d)/g))).replace(\"(Sub) \", \"\").replace(\"(Dub) \", \"\")\n }\n }\n else if (Application.currentMediaService() === Service.KissManga) {\n /** if ((window.location.pathname.match(/\\//g) || []).length === 2) {\n return document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 2).join(\"\\n\").trim();\n }\n else */if ((window.location.pathname.match(/\\//g) || []).length > 2) {\n //disgusting way to get Name + Chapter\n if (document.getElementById(\"selectReadType\").options[document.getElementById(\"selectReadType\").selectedIndex].textContent.trim() === \"One page\") {\n return document.getElementsByTagName(\"title\")[0].innerText.split(\"\\n\", 3).join(\"\\n\").substring(12)+ \" \" + parse(document.getElementById(\"selectChapter\").options[document.getElementById(\"selectChapter\").selectedIndex].textContent);\n }\n else {\n console.log(document.getElementById('navsubbar').getElementsByTagName('a')[0].innerHTML.split('\\n')[2] + \" \" + parse(document.querySelector(\".selectChapter\").options[document.querySelector(\".selectChapter\").selectedIndex].textContent));\n return document.getElementById('navsubbar').getElementsByTagName('a')[0].innerHTML.split('\\n')[2] + \" \" + parse(document.querySelector(\".selectChapter\").options[document.querySelector(\".selectChapter\").selectedIndex].textContent);\n }\n }\n }\n return null;\n }", "function getYouTubePlaylistID(link) {\n var id;\n var indexEndOfID = link.indexOf(\"&\", link.search(\"list=\") + 5);\n if (indexEndOfID != -1) {\n id = link.slice(((link.search(\"list=\")) + 5), indexEndOfID);\n } else {\n id = link.slice((link.search(\"list=\")) + 5);\n }\n //console.log(id);\n return id;\n}", "function getSpotifyPlaylistID(link) {\n var id;\n var indexEndOfID = link.indexOf(\"?\", link.search(\"playlist\") + 9);\n if (indexEndOfID != -1) {\n id = link.slice(link.search(\"playlist\") + 9, indexEndOfID);\n } else {\n id = link.slice(link.search(\"playlist\") + 9);\n }\n //console.log(id);\n return id;\n}", "function getCurrentVideoId() {\n let attr = document.getElementsByClassName(\"share-twitter\")[0]\n .getAttribute(\"data-event-tracking\").split(\"|\");\n return attr[attr.length - 1];\n}", "get videoId() {\n return this._data.video_id;\n }", "function parseId(url) {\n // http://stackoverflow.com/a/14701040\n var match = /^.*(youtube.com\\/|v\\/|e\\/|u\\/\\w+\\/|embed\\/|v=)([^#\\&\\?]*).*/.exec(url);\n\n if (match instanceof Array && match[2] !== undefined) {\n return match[2];\n } else {\n return false;\n }\n}", "function ytVidId(url) {\n\t\t\t var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11,})(?:\\S+)?$/gmi;\n\t\t\t return (url.match(p)) ? RegExp.$1 : false;\n\t\t\t}", "function ytVidId(url) {\n\t\t\t var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11,})(?:\\S+)?$/gmi;\n\t\t\t return (url.match(p)) ? RegExp.$1 : false;\n\t\t\t}", "function getYoutubeId(){\r\n const linkRegEx = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\r\n const result = musicSearchBox_input.value.match(linkRegEx);\r\n if (result){\r\n return result[7];\r\n } else{\r\n return null;\r\n }\r\n}", "function vcExtractYoutubeId( url ) {\n\tif ( 'undefined' === typeof(url) ) {\n\t\treturn false;\n\t}\n\n\tvar id = url.match( /(?:https?:\\/{2})?(?:w{3}\\.)?youtu(?:be)?\\.(?:com|be)(?:\\/watch\\?v=|\\/)([^\\s&]+)/ );\n\n\tif ( null !== id ) {\n\t\treturn id[ 1 ];\n\t}\n\n\treturn false;\n}", "function get_varid_from_link(link, header)\n{\n var startpos = header.length;\n var nextslash = link.indexOf('/',startpos);\n var varid = link.substr(startpos, nextslash-startpos);\n return varid;\n}", "function getId(url) {\n var regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n\n if (match && match[2].length == 11) {\n return match[2];\n } else {\n return 'error';\n }\n}", "function linkToYTVid(youtube)\n{\n\tconsole.log(\"LINK TO YOUTUBE VIDEO\");\n\t\n\treturn \"http://www.youtube.com/watch?v=\" + youtube;\n\t\n}", "function getVideoId(response) {\n\tvar srchItems = response.result.items;\n\t$.each(srchItems, function(index, item){\n\t\tsVideoIds[index] = item.id.videoId;\n\t});\n}", "function getVideoLink(item) {\n var videoID = item.id.videoId;\n var thumb = item.snippet.thumbnails.high.url;\n //build output string\n var output = '<iframe auto src=\"https://youtube.com/embed/' + videoID + '?rel=0\"></iframe>' + '<div class=\"clearfix\"></div>' + '';\n return output;\n }", "function getId(url) {\n const regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;\n const match = url.match(regExp);\n\n return (match && match[2].length === 11)\n ? match[2]\n : null;\n }", "function getId(url) {\n const regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;\n const match = url.match(regExp);\n\n return (match && match[2].length === 11)\n ? match[2]\n : null;\n }", "getVideoInformation(link) {\n\t\t\n\t\tif(YoutubeHelper.checkURL(link)) {\n\t\t\t//checking the URL\n\t\t\tlet youtubeID = YoutubeHelper.checkURL(link)\n\t\t\t\n\t\t\t//fetching data from the youtube api after vaidation froma the given ID\n\t\t\txhr(`https://www.googleapis.com/youtube/v3/videos?id=${youtubeID}&key=AIzaSyBgMSJtrr13Q4qTdyOrGktD0Rl0OuOCoag&&&part=snippet,contentDetails`,\n\t\t\t\t\n\t\t\t\t(err, req, body) => {\n\t\t\t\t\t\tbody = JSON.parse(body)\n\t\t\t\t\t\tconsole.log(body.items)\n\n\t\t\t\t\t\tlet title, duration\n\t\t\t\t\t\ttitle = body.items['0'].snippet.title\n\t\t\t\t\t\tduration = YoutubeHelper.convertToSeconds(body.items['0'].contentDetails.duration)\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t//Sending to be added to the list\n\t\t\t\t\t\tapp.me.addVideo(title, youtubeID, duration)\n\t\t\t\t\t}\n\t\t\t\t)\n\n\n\t\n\t\t}\n\n\n\t}", "function ytVidId(url) {\n var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n return (url.match(p)) ? RegExp.$1 : false;\n }", "function parseVideoURL(url) {\n\n function getParm(url, base) {\n var re = new RegExp(\"(\\\\?|&)\" + base + \"\\\\=([^&]*)(&|$)\");\n var matches = url.match(re);\n if (matches) {\n return(matches[2]);\n } else {\n return(\"\");\n }\n }\n\n var retVal = {};\n var matches;\n var shortYoutubeRegExp = /^.*(youtu\\.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n\n if (url.indexOf(\"youtube.com/watch\") != -1) {\n retVal.provider = \"youtube\";\n retVal.id = getParm(url, \"v\");\n retVal.embed = '//www.youtube.com/embed/'+retVal.id+'?fs=0';\n } else if (matches = url.match(shortYoutubeRegExp)) {\n // console.log(matches[2]);\n retVal.provider = \"youtube\";\n retVal.id = matches[2];\n retVal.embed = '//www.youtube.com/embed/'+retVal.id+'?fs=0';\n } else if (matches = url.match(/vimeo.com\\/(\\d+)/)) {\n retVal.provider = \"vimeo\";\n retVal.id = matches[1];\n retVal.embed = '//player.vimeo.com/video/'+retVal.id+'?fullscreen=0';\n }\n\n return(retVal);\n}", "function changeVideoId(newUrl) {\n setVideoId(newUrl)\n }", "function getYouTubeCode(url) {\n return url.split('?v=')[1];\n }", "getCitationId(link){\n const urlParameterForCitationId = 'citation_for_view';\n const urlParams = new URLSearchParams(link);\n const citationId = urlParams.get(urlParameterForCitationId);\n return citationId;\n }", "function extractYouTubeId(trailerURL)\n\t\t{\n\t\t\tif( typeof trailerURL === \"undefined\" )\n\t\t\t\treturn trailerURL;\n\n\t\t\tvar youtubeid;\n\t\t\tif( trailerURL.indexOf(\"youtube\") != -1 && trailerURL.indexOf(\"v=\") != -1 )\n\t\t\t{\n\t\t\t\tyoutubeid = trailerURL.substr(trailerURL.indexOf(\"v=\")+2);\n\n\t\t\t\tvar found = youtubeid.indexOf(\"&\");\n\t\t\t\tif( found > -1 )\n\t\t\t\t{\n\t\t\t\t\tyoutubeid = youtubeid.substr(0, found);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar bases = [\"youtu.be/\", \"/embed/\"]\n\t\t\t\tvar found = trailerURL.indexOf(\"youtu.be/\");\n\t\t\t\tif( found >= 0 )\n\t\t\t\t\tyoutubeid = trailerURL.substr(found+9);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfound = trailerURL.indexOf(\"/embed/\");\n\t\t\t\t\tif( found >= 0 )\n\t\t\t\t\t\tyoutubeid = trailerURL.substr(found+7);\n\t\t\t\t}\n\n\t\t\t\tif( !!youtubeid )\n\t\t\t\t{\n\t\t\t\t\tfound = youtubeid.indexOf(\"?\");\n\t\t\t\t\tif( found > 0 )\n\t\t\t\t\t\tyoutubeid = youtubeid.substr(0, found);\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfound = youtubeid.indexOf(\"&\");\n\t\t\t\t\t\tif( found > 0 )\n\t\t\t\t\t\t\tyoutubeid = youtubeid.substr(0, found);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t return youtubeid;\n\t\t}", "function VidLinkGen(RawLink) {\r\n\tvar myString = \"<video id='genVid' width='100%' height='480' controls='true' autoplay='true' loop='true' src='\" + RawLink + \"' type='video/mp4'>Your browser does not support mp4 video. </video>\"\r\n return myString\r\n}", "function getQueryVariable(variable) {\n //var videoID =\n var query = window.location.search.substring(1);\n var vars = query.split(\"&\");\n for (var i = 0; i < vars.length; i++) {\n var pair = vars[i].split(\"=\");\n if (pair[0] == variable) {\n return pair[1];\n }\n }\n return false;\n }", "function extractIdFromUrl( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = url.match( rWebUrl );\n return matches ? matches[0].substr(10) : \"\";\n }", "getVideoSearchString(videoID) {\n if (RoKA.Application.currentMediaService() === Service.YouTube) {\n return encodeURI(`(url:3D${videoID} OR url:${videoID}) (site:youtube.com OR site:youtu.be)`);\n }\n else if (RoKA.Application.currentMediaService() === Service.KissAnime) {\n return (encodeURI(videoID));\n }\n else if (RoKA.Application.currentMediaService() === Service.KissManga) {\n return (encodeURI(videoID));\n }\n }", "getId(longUrl) {\n return new Promise((resolve, reject) => {\n if (!longUrl) reject(new Error('No link provided.'));\n const id = longUrl.match(/\\w+$/g)[0];\n id ? resolve(id) : reject(new Error('Id could not be extracted.'));\n });\n }", "function parseVid(url) {\n // use positive lookahead, starting to match after \"?v=\"\n const regex = /(?<=\\?v\\=)([A-Za-z0-9_-]+)/;\n const found = url.match(regex);\n\n if (found !== null) {\n return found[0];\n } else {\n return null;\n }\n}", "function getYoutubeId(url) {\n url = url || '';\n\n var matches = url.match(/.*?youtu.be\\/([^\\/]+)\\/*/i);\n if (matches) {\n return matches[1];\n }\n\n matches = url.match(/.*?youtube\\.com\\/watch\\?v=([^\\/]+)\\/*.*/i);\n if (matches) {\n return matches[1];\n }\n\n return '';\n }", "function filterVideoId() {\n \n var copy = false;\n var id = \"\";\n for(var i = 0; i < video.length; i++) {\n if(copy) id += video[i];\n if(video[i] == '=') copy = true;\n };\n \n return id;\n }", "function yt_id(url){\n var ytid = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n id = url[2].split(/[^0-9a-z_]/i);\n id = id[0];\n } else { id = url; }\n return id;\n }", "function GetUrlIdParameterFromUrl(url) {\n \n // If url is null or empty\n if (url == undefined || url == \"\") { return \"\"; }\n \n // try for youtube\n var youtubeRegex = /(\\?v=|\\/\\d\\/|\\/embed\\/|\\/v\\/|\\.be\\/)([a-zA-Z0-9\\-\\_]+)/;\n var result = url.match(youtubeRegex);\n if (result) { return result[2]; }\n \n // try for ted\n var ted_re = /(?:http:\\/\\/)?(?:www\\.)?ted.com\\/([a-zA-Z0-9\\-\\_]+)\\/([a-zA-Z0-9\\-\\_]+)/;\n result = url.match(ted_re);\n if (result) { return result[2]; }\n \n return \"\";\n }", "function loadVideoId() {\n\tif (window.localStorage.getItem(\"videoId\")) {\n\t\tplayer.loadVideoById({videoId:window.localStorage.getItem(\"videoId\")});\n\t} else {\n\t\tplayer.loadVideoById({videoId:\"yCChR2HgCgc\"});\n\t}\n}", "function getWebsiteID (link) {\n if (link.search(/www.xiaoshuo240.cn/i) >= 0) {\n return '/240'\n } else if (link.search(/www.qingyunian.net/i) >= 0) {\n return '/qingyunian'\n } else if (link.search(/m.biqugex.com/i) >= 0) {\n return '/biqugex'\n } else if (link.search(/m.booktxt.net/i) >= 0) {\n return '/booktxt'\n } else if (link.search(/m.wangshu.la/i) >= 0) {\n return '/wangshu'\n } else if (link.search(/xinshubao.net/i) >= 0) {\n return '/xsb'\n } else {\n return ''\n }\n }", "function getIdFromUrl(url) { return url.match(/[-\\w]{25,}/); }", "function videoURL(response) {\n if (!('data' in response) || response.data.length === 0)\n\treturn videoURL(defaultVideo());\n let pos = Math.floor(Math.random()*response.data.length);\n return { mp4 : response.data[pos].images.preview.mp4 };\n}", "function getUTUBEID(url) {\n\tid_start = url.indexOf('/v') + 3;\n\turl = url.slice(id_start);\n\tid_end = url.indexOf('&');\n\tif (id_end == -1) {\n\t\t// no query paramters\n\t} else {\n\t\turl = url.slice(0, id_end);\n\t}\n\treturn url;\n}", "function getUTUBEID(url) {\n\tid_start = url.indexOf('/v') + 3;\n\turl = url.slice(id_start);\n\tid_end = url.indexOf('&');\n\tif (id_end == -1) {\n\t\t// no query paramters\n\t} else {\n\t\turl = url.slice(0, id_end);\n\t}\n\treturn url;\n}", "function getUrlVideo(urlPage){\r\n // recupere l'url directe de la video dans le contenu de la page de la video\r\n // plusieurs urls sont définies en général dans des tag \"<source\" sur la page de la video\r\n // on suppose que l'url de la video HD est celle contenant \"HD\" dans son nom et de type \"mp4\"\r\n\t\t\tfunction extractionUrlVideo(txtPage){\r\n\t\t\t\tvar tab=txtPage.match(/<source src=\".*HD([^\\\"]+)\".*type=\"video\\/mp4\"/ig);\r\n if (!tab || tab.length==0) throw [typeof tab,\"La structure a changé : pas de chaine'<source src=' dans la page :\",urlPage].join(\" \");\r\n\t\t\t\tvar urls=[]\r\n\t\t\t\tforEach (tab, function (elt){\r\n\t\t\t\t\tvar url=(elt.match(/src=\"(.*)\"/))[1];\r\n\t\t\t\t\turls.push(url);\r\n\t\t\t\t});\r\n\t\t\t\tif (urls.length==0) throw [\"Aucune url de vidéo dans la page :\",urlPage].join(\" \");\r\n\t\t\t\treturn urls.pop();\r\n\t\t\t}\r\n \r\n // lance l'extraction en récupérant le contenu de la page de la video par une requete http synchrone\r\n\t\t return extractionUrlVideo(httpSync(urlPage));\r\n\t\t}", "function extractIdFromUri( uri ) {\n if ( !uri ) {\n return;\n }\n\n var matches = uri.match( rPlayerUri );\n return matches ? matches[0].substr(30) : \"\";\n }", "function extractId(href) {\n return href.replace(/^[a-z-]+:\\/+?[^\\/]+/i, '') // Remove protocol & domain\n .replace(/^\\//, '') // Remove root /\n .replace(/\\.[a-zA-Z]+$/, '') // Remove simple extension\n .replace(/[^\\.\\w-]+/g, '-') // Replace illegal characters\n .replace(/\\./g, ':'); // Replace dots with colons(for valid id)\n}", "function extractIdFromUrl( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = urlRegex.exec( url );\n\n // Return id, which comes after first equals sign\n return matches ? matches[1] : \"\";\n }", "function getUrlId() {\n return getURLSearch().replace('id=', '');\n}", "function getVideoById (feedId) {\n let getVideoByIdUrl = `https://app.ganji.com/api/v1/msc/v1/jn/feed/info/${feedId}?&user_id=732539543&longitude=104.041918&latitude=30.585407&location=45`\n\n request\n .get({\n url: getVideoByIdUrl,\n headers: headers,\n gzip: true\n }, (err, httpResponse, body) => {\n if (err) console.log(err)\n console.log(body) // 200\n })\n}", "function getPlaylistID() {\n const url = window.location.search;\n if (url.indexOf(\"?playlist_id=\") !== -1) {\n let currentPlaylist = url.split(\"=\")[1];\n return currentPlaylist;\n }\n }", "function getIdFromUrl(url) {\n return url.match(/[-\\w]{25,}/);\n }", "function getYoutubeIdByUrl (url)\r\n {\r\n var regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\r\n var match = url.match(regExp);\r\n\r\n if (match && match[2].length == 11) {\r\n return match[2];\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "getVideoIdFromHash(){\n if (!this.firstRun) {\n var hashBang_arr = window.location.hash.split('/');\n var video_id = hashBang_arr[2];\n var feed = this.feed;\n\n for (var i = 0; i < feed.length; i++) {\n if (feed[i].id == video_id) {\n this.selectedTimeIndex = i;\n log('HASH CHANGE selectedTimeIndex: '+this.selectedTimeIndex);\n\n // need a timout to run after mounted (JQuery issue)\n setTimeout(() => {\n bus.$emit('selectThumbnail', this.selectedTimeIndex);\n }, 1000); // 4ms browser standard?\n }\n }\n }\n }", "function getID(string) {\n\n /* Variables */\n var id = 0;\n var page = 1;\n var res = string.split(\"/\");\n\n /* Retrieve studio ID. */\n res.forEach(function(element) {\n if(/^\\d+$/.test(element)) {\n id = element;\n }\n });\n\n /* Check for invalid URL. */\n if (id == 0) {\n linkError();\n return;\n }\n return id;\n}", "function getIDfromURL() {\n var url = window.location.href;\n var endofurl = url.split('=');\n var cur_uid = endofurl[endofurl.length-1];\n return cur_uid;\n}", "function extractIdFromUri( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = urlRegex.exec( url );\n\n // Return id, which comes after first equals sign\n return matches ? matches[1] : \"\";\n }", "function getIdFromUrl(url) {\n return url.match(/[-\\w]{25,}/);\n}", "function getSingleVideo(id, videoDiv) {\n fetch(`${videosUrl}/` + id).then(resp => resp.json())\n .then(video => showVideo(video, videoDiv))\n}", "function getYoutubeVideoInfo(id){\r\n var youtubeApiUrl = \"https://gdata.youtube.com/feeds/api/videos/\"; \r\n var v2Parameter = \"?v=2\";\r\n var jsonParameter = \"&alt=json\";\r\n var response = CQ.utils.HTTP.get(youtubeApiUrl + id + v2Parameter + jsonParameter);\r\n return response;\r\n}", "function videoDetails(videoDetailUrl, id) {\n \n request.get(videoDetailUrl, function (e, r, b) {\n \n videoParse = JSON.parse(b);\n \n if (videoParse.items !== undefined) {\n \n if (videoParse.items[0] !== undefined) {\n \n newurl = \"https://www.youtube.com/watch?v=\" + id;\n\n details = {};\n vidstats = videoParse.items[0].statistics;\n vidsnippet = videoParse.items[0].snippet;\n details.title = vidsnippet.title;\n details.published = vidsnippet.publishedAt.split('T')[0];\n details.views = vidstats.viewCount;\n details.comments = vidstats.commentCount;\n details.likes = vidstats.likeCount;\n \n details.url = newurl;\n\n silo.videos.push(details);\n //console.log(vidstats);\n\n }\n \n }\n \n });\n }", "function embedYouTubeLink(link) {\n\tyouTubeLink = $(link);\n\tvideoID = youTubeLink.attr('href').replace(/^[^v]+v.(.{11}).*/, '$1');\n\n\t/* \n \t* TODO: This is a truly ugly method of replacing the link with an embedded\n \t* object. I should probably create a function that intelligently parses\n \t* the most common audio and video links into a nice, clean OBJECT.\n\t*/\n\tyouTubeLink.replaceWith('<object class=\"youtube_video\" width=\"445\" height=\"364\"><param name=\"movie\" value=\"http://www.youtube.com/v/' + videoID + '&hl=en&fs=1&color1=0xdd0000&color2=0x660000&border=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/' + videoID + '&hl=en&fs=1&color1=0xdd0000&color2=0x660000&border=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"445\" height=\"364\"></embed></object>');\n}", "function getAdventureIdFromURL(search) {\n // TODO: MODULE_ADVENTURE_DETAILS\n // 1. Get the Adventure Id from the URL\n console.log(search);\n const id = search.split(\"=\")[1];\n console.log(id);\n return id;\n\n // Place holder for functionality to work in the Stubs\n //return null;\n}", "function getNextVideo(videoTitle, videoDesc, videoId) {\n $(\"#youtube-title\").html(urldecode(videoTitle));\n $(\"#youtube-desc\").html(urldecode(videoDesc));\n $(\"#youtube-url\").attr('src', 'https://www.youtube.com/embed/' + urldecode(videoId));\n}", "function getPlayerId(url) {\n for (const i in players) {\n const player = players[i];\n const eId = player.getEid(url);\n if (eId) return i;\n }\n }", "function getSlugFromUrl(url) {\n\t var match = KA_VIDEO_URL.exec(url);\n\t if (match) {\n\t return match[1];\n\t }\n\t return url;\n\t}", "youtubeVideo(id) {\n return ytRequest('/videos', id)\n .then(res => {\n let item = null;\n if (res.items.length) {\n item = Item.fromApi(ITEM_TYPE.YOUTUBE, {\n title: res.items[0].snippet.title,\n url: `http://youtube.com/watch?v=${id}`,\n srcId: id,\n });\n }\n return item;\n });\n }", "getTitle(videoId) {\n return fetch (VIDEO_ENDPOINT + videoId)\n .then(response => response.json())\n .catch (error => \n console.error(error)\n )\n }", "function getAdventureIdFromURL(search) {\n // TODO: MODULE_ADVENTURE_DETAILS\n // 1. Get the Adventure Id from the URL\n\n return search.split(\"=\")[1];\n // Place holder for functionality to work in the Stubs\n // return null;\n}", "static getVideoForBookmark(id){\n let realmVideos = realm.objects('Video').filtered('_id = $0', id)\n return realmVideos[0] //should never be 0 because should be loaded before bookmarks\n }", "get url() {\n return `https://www.youtube.com/watch?v=${this.video.id}&lc=${this.id}`;\n }", "function getPokemonId(url){\n\treturn url.slice(33, url.length-1);\n}", "function videoPlayer() {\n $('a.video').click(function () {\n $me = $(this);\n $id = $me.attr('yt-id');\n popVideo($id);\n })\n}", "static getYoutubeThumb(videoId, size) {\n if (videoId.startsWith(\"http\")) {\n let regExp = /^.*(youtu\\.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n let match = videoId.match(regExp);\n if (match && match[2].length === 11) {\n videoId = match[2];\n }\n else {\n console.log(\"======== ERROR: can not get videoId from: \", videoId);\n }\n }\n if (videoId === null) {\n return \"http://img.youtube.com/vi/noimagefound/default.jpg\";\n }\n size = (size == undefined) ? 'big' : size;\n if (size === 'small') {\n return \"http://img.youtube.com/vi/\" + videoId + \"/default.jpg\";\n }\n return 'http://img.youtube.com/vi/' + videoId + '/0.jpg';\n }", "function displayResult(videoSnippet,videourl) {\n\n var img = new Image(300,300); // width, height values are optional params\n img.src = videoSnippet.thumbnails.high.url;\n $('.sanadtech').append('<h1>'+videoSnippet.title+'</h1>');\n var url= videourl.videoId;\n\n\n console.log(url);\n //$('.sanadtech').append('<a id=\"test\" href=\"hello\">lien de la video</a>');\n var createA = document.createElement('a');\n var createAText = document.createTextNode(\"le lien de la video\");\n createA.setAttribute('href', 'https://www.youtube.com/watch?v='+url);\n createA.appendChild(createAText);\n $('.sanadtech').append(createA);\n $('.sanadtech').append(img);\n}", "function retrieveID(){\n var retrievedID = $('#updateId').val();\n retrieveMovie(\"https://eloquent-yew-227217.appspot.com/GetFilm?ID=\"+retrievedID+\"&format=json\");\n}", "function getSlugFromUrl(url) {\n var match = KA_VIDEO_URL.exec(url);\n if (match) {\n return match[1];\n }\n return url;\n}", "async function getVideoInfo() {\n\tlet videos = document.querySelectorAll(\n\t\t'ytd-browse #contents #contents #items ytd-thumbnail .yt-simple-endpoint.inline-block.style-scope.ytd-thumbnail'\n\t);\n\tlet titleEles = document.querySelectorAll('#contents #contents #items #video-title');\n\n\tlet srcAry = [];\n\n\tfor (let i = 0; i < videos.length; i++) {\n\t\tlet titleEle = titleEles[i];\n\t\tlet videoTitle = titleEle.innerText;\n\t\tlet videoInfo = {};\n\t\tlet video = videos[i];\n\t\tlet href = video.getAttribute('href');\n\t\tlet vars = href.split('?')[1];\n\t\tlet src = vars.split('v=')[1];\n\n\t\tvideoTitle ? (videoInfo.title = videoTitle) : '';\n\t\tsrc ? (videoInfo.id = src) : '';\n\t\tsrcAry.push(videoInfo);\n\t}\n\n\treturn srcAry;\n}", "function get_idfacebook_from_url() {\n\n adverra_id_extractor();\n function adverra_id_extractor() {\n text = '';\n // iziToast.info({\n // title: 'รอสักครู่',\n // position: 'topCenter',\n // timeout: 2000,\n // message: 'กำลังเช็ค ID...',\n // });\n\n\n // original_url = $('#adverra_id_extractor_url').val();\n // original_url = `https://www.facebook.com/DevasBrightmoon/videos/171934840819450/?v=171934840819450`;\n // original_url = `https://www.facebook.com/pg/ETD.ERRORTODAY`;\n original_url = `https://www.facebook.com/groups/dmts.g/permalink/2177334155612192/`;\n url = original_url;\n var url_process = url.match(/([a-z]+\\:\\/+)([^\\/\\s]*)([a-z0-9\\-@\\^=%&;\\/~\\+]*)[\\?]?([^ \\#]*)#?([^ \\#]*)/ig);\n if (url_process) {\n\n url = url.replace(\"https\\:\\/\\/\", \"\").replace(\"http\\:\\/\\/\", \"\").replace(\"\\:\\/\\/\", \"\");\n url = url.split(\"\\/\");\n if (url[0].match(\".facebook.com\")) {\n if (url[1].split(\"?\")) {\n if (url[1] && url[1] != \"\") {\n\n\n /////////////////////////////////////////\t \n var url_array_collect = [];\n for (temp_var = 1; url[temp_var]; temp_var++) {\n console.log(\"url[\" + temp_var + \"]=\" + url[temp_var].split(\"\\?\")[0]);\n if (url[temp_var].split(\"\\?\")[0] && url[temp_var].split(\"\\?\")[0] != \"\") {\n url_array_collect.push(url[temp_var].split(\"\\?\")[0]);\n }\n if (url[temp_var].split(\"\\?\")[1] && url[temp_var].split(\"\\?\")[1] != \"\") {\n var location_search = \"\\?\" + url[temp_var].split(\"\\?\")[1];\n }\n }\n\n\n var post_id = getParam('fbid', location_search);\n\n var set = getParam('set', location_search);\n var story_fbid = getParam('story_fbid', location_search);\n var account_id = getParam('id', location_search);\n //to detect facebook notes\n if (url[1] == \"notes\") {\n if (!isNaN(url[4])) {\n title = \"Note ID\";\n console.log(title + \"=\" + url[4]);\n append_html_code(title, url[4]);\n }\n if (!isNaN(url[3])) {\n title = \"Note ID\";\n console.log(title + \"=\" + url[3]);\n append_html_code(title, url[3]);\n }\n }\n if (account_id) {\n if (!isNaN(account_id)) {\n title = \"Account ID\";\n console.log(title + \"=\" + account_id);\n append_html_code(title, account_id);\n }\n }\n if (story_fbid) {\n if (!isNaN(story_fbid)) {\n title = \"Post ID\";\n console.log(title + \"=\" + story_fbid);\n append_html_code(title, story_fbid);\n }\n }\n if (post_id != \"\") {\n var photo_post_id = post_id;\n if (!isNaN(photo_post_id)) {\n title = \"Post ID/Photo ID:\";\n types = '2';\n }\n append_html_code(title, photo_post_id);\n }\n if (set) {\n set = set.split(\".\");\n if (set) {\n var account_id = set[3];\n if (!isNaN(account_id)) {\n title = \"Account ID:\";\n console.log(title + \"=\" + account_id);\n append_html_code(title, account_id);\n }\n }\n }\n //extract account id from https://www.facebook.com/profile.php?id=100009125604149\n if (original_url.match(\"profile\\.php\")) { }\n if (original_url.match(\"\\/photos\\/\")) {\n splited = original_url.split(\"/\");\n photo_id = splited[splited.length - 2];\n if (!isNaN(photo_id)) {\n title = \"Photo ID:\";\n console.log(title + \"=\" + photo_id);\n append_html_code(title, photo_id);\n }\n }\n console.log(url_array_collect);\n extraction_process_url_params(url_array_collect);\n\n\n\n\n\n\n /////////////////////////\t \n\n\n\n }\n else {\n\n\n console.log('เกิดข้อผิดพลาด', 'ไม่สามารถดึง ID กรุณากรอก URL อื่น', 'error');\n\n\n }\n }\n }\n else {\n\n console.log('เกิดข้อผิดพลาด', 'URL ที่ใส่ ต้องเป็น URL ของ Facebook', 'error');\n }\n }\n else {\n\n console.log('นี่ไม่ใช่ URL ', 'กรุณากรอก URL ของ Facebook', 'error');\n\n }\n\n\n }\n\n\n\n\n\n\n\n function extract_page_id(page_id) {\n if (!isNaN(page_id)) {\n console.log(\"page id=\" + page_id);\n title = \"Page id:\";\n append_html_code(title, page_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function extract_post_id(post_id) {\n if (!isNaN(post_id)) {\n console.log(\"post_id=\" + post_id);\n title = \"Post id:\";\n append_html_code(title, post_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function event_post_id_append(post_id) {\n if (!isNaN(post_id)) {\n console.log(\"event_post_id=\" + post_id);\n title = \"Event post id:\";\n append_html_code(title, post_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function group_post_id_append(post_id) {\n if (!isNaN(post_id)) {\n console.log(\"group_post_id=\" + post_id);\n title = \"Group post id:\";\n append_html_code(title, post_id);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function id_extract_event(account_username) {\n if (!isNaN(account_username)) {\n console.log(\"Event id is:\" + account_username);\n title = \"Event ID:\";\n append_html_code(title, account_username);\n } else {\n alert(\"URL is tampered.\");\n }\n }\n function extract_video_id(video_id) {\n if (!isNaN(video_id)) {\n console.log(\"video id is=\" + video_id);\n title = \"Post ID/ Video id:\";\n append_html_code(title, video_id);\n }\n }\n function id_extract_group(account_username) {\n\n if (isNaN(account_username)) {\n pageurl = \"https://mbasic.facebook.com/groups/\" + account_username;\n dinesh = new XMLHttpRequest();\n dinesh.open(\"GET\", pageurl, true);\n dinesh.onreadystatechange = function () {\n console.log(`dinesh.readyState: `, dinesh.readyState);\n console.log(`dinesh.status: `, dinesh.status);\n if (dinesh.readyState == 4 && dinesh.status == 200) {\n var responsa = dinesh.responseText.match(/\\/groups\\/\\d+/g)[0];\n responsa = responsa.replace(\"\\/groups\\/\", \"\");\n title = \"Group ID:\";\n console.log(title + responsa);\n append_html_code(title, responsa);\n }\n }\n dinesh.send();\n } else {\n title = \"Group ID:\";\n console.log(title + account_username);\n append_html_code(title, account_username);\n }\n }\n\n\n\n\n\n function append_html_code(title, id) {\n title = '<b style=\"font-size:20px;font-weight:bold\">' + title;\n text = text + '<p>' + title + '<input class=\"copytext' + id + '\" type=\"text\" value=\"' + id + '\" style=\"font-size:30px; text-align:center;width:90%;\" ><a datashow=\"copytext' + id + '\" class=\"copyto btn-floating mb-1 btn-flat waves-effect waves-light pink accent-2 white-text\"> <i class=\"material-icons\">content_copy</i></a><p></b>';\n\n console.log({\n title: 'Copy ตัวเลขไปใช้ได้เลยค่ะ',\n type: 'success',\n html: text,\n })\n // iziToast.success({\n // title: 'เรียบร้อย',\n // position: 'topCenter',\n // timeout: 3000,\n // message: 'พบ ID แล้ว Copy ไปใช้ได้เลย',\n // });\n }\n\n\n\n\n\n\n function extraction_process_url_params(url_array_collect) {\n console.log(url_array_collect);\n\n\n if (url_array_collect[2]) {\n if (url_array_collect[2] == \"permalink\") {\n if (url_array_collect[0] == \"groups\") {\n id_extract_group(url_array_collect[1]);\n if (!isNaN(url_array_collect[3])) {\n group_post_id_append(url_array_collect[3]);\n }\n }\n if (url_array_collect[0] == \"events\") {\n id_extract_event(url_array_collect[1]);\n if (!isNaN(url_array_collect[3])) {\n event_post_id_append(url_array_collect[3]);\n }\n }\n }\n if (url_array_collect[1] == \"videos\") {\n extract_video_id(url_array_collect[2]);\n }\n if (url_array_collect[0] == \"pages\") {\n if (!isNaN(url_array_collect[2])) {\n extract_page_id(url_array_collect[2]);\n }\n }\n if (url_array_collect[1] == \"posts\") {\n if (url_array_collect[0]) {\n id_extract_account(url_array_collect[0]);\n }\n if (!isNaN(url_array_collect[2])) {\n extract_post_id(url_array_collect[2]);\n }\n } else {\n id_extract_account(url_array_collect[0]);\n }\n } else {\n if (url_array_collect[1]) {\n if (url_array_collect[0] == \"groups\") {\n id_extract_group(url_array_collect[1]);\n }\n if (url_array_collect[0] == \"events\") {\n id_extract_event(url_array_collect[1]);\n }\n if (url_array_collect[0] == \"pg\") {\n id_extract_account(url_array_collect[1]);\n }\n } else {\n id_extract_account(url_array_collect[0]);\n }\n }\n }\n\n\n\n\n\n\n\n\n\n function id_extract_account(account_username) {\n\n function error_msgs() {\n //toastr.error(\"Unable to retrieve account ID\");\n }\n\n if (isNaN(account_username)) {\n responsa = '';\n pageurl = \"https://m.facebook.com/\" + account_username + \"\";\n\n dinesh = new XMLHttpRequest();\n dinesh.open(\"GET\", pageurl, true);\n dinesh.onreadystatechange = function () {\n if (dinesh.readyState == 4 && dinesh.status == 200) {\n var responsa = dinesh.responseText;\n responsa = responsa.replace(/&quot;/g, '\"');\n if (responsa.match(/\"profile_id\":\\d+/g)) {\n\n var last_array = (responce_id = responsa.match(/\"profile_id\":\\d+/g).length - 1);\n\n var responce_id = responsa.match(/\"profile_id\":\\d+/g)[last_array];\n responce_id = responce_id.replace('\"profile_id\":', \"\");\n if (!isNaN(responce_id)) {\n title = \"Account ID:\";\n console.log(title + \"=\" + responce_id);\n append_html_code(title, responce_id);\n\n\n } else {\n error_msgs();\n }\n }\n\n else\n\n if (responsa.match(/page_id:\\\"\\d+/g)) {\n\n var last_array = responsa.match(/page_id:\\\"\\d+/g)[0];\n responce_id = last_array.replace('page_id:\\\"', \"\");\n if (!isNaN(responce_id)) {\n title = \"Page ID:\";\n console.log(title + responce_id);\n append_html_code(title, responce_id);\n\n\n } else {\n error_msgs();\n }\n }\n\n\n\n\n }\n }\n dinesh.send();\n } else {\n alert(\"account id is:\" + responsa.id);\n //document.getElementById(\"fst789_id_extractor_result\").innerText = account_username;\n }\n }\n\n\n\n\n\n\n\n\n\n function getParam(sname, location_search) {\n if (location_search && sname) {\n\n var params = location_search.substr(location_search.indexOf(\"?\") + 1);\n var sval = \"\";\n params = params.split(\"&\");\n // split param and value into individual pieces\n for (var i = 0; i < params.length; i++) {\n temp = params[i].split(\"=\");\n if ([temp[0]] == sname) { sval = temp[1]; }\n }\n\n return sval;\n } else {\n return '';\n }\n }\n\n}", "function get_id() {\n\treturn $('.user-link').attr('id');\n}", "function getSlugFromUrl(url) {\n var match = KA_VIDEO_URL.exec(url);\n\n if (match) {\n return match[1];\n }\n\n return url;\n}", "function getVideoIds(videos){\n const videoIds = []\n videos.forEach(vid => {\n try {\n const id = vid.contentDetails.videoId\n videoIds.push(id)\n }catch (error){\n const id = vid.id.videoId\n videoIds.push(id)\n }\n })\n return videoIds\n}" ]
[ "0.838077", "0.8225289", "0.7916893", "0.79025304", "0.78823805", "0.78571314", "0.7816603", "0.7528662", "0.75042427", "0.74323887", "0.73632336", "0.7345737", "0.7319435", "0.7308683", "0.72747004", "0.72747004", "0.72066253", "0.717138", "0.71424085", "0.71382487", "0.7127798", "0.6901324", "0.6879767", "0.68603194", "0.6822459", "0.6773009", "0.67521536", "0.6724013", "0.67140126", "0.67140126", "0.67094153", "0.67087466", "0.6694287", "0.6673039", "0.6653156", "0.6612358", "0.6597621", "0.6557234", "0.6557234", "0.65425515", "0.65352684", "0.6505061", "0.645142", "0.6447494", "0.6431681", "0.63790077", "0.63651484", "0.6331314", "0.63277763", "0.63166475", "0.62997293", "0.6298151", "0.6292416", "0.6286569", "0.62852", "0.62268484", "0.6182668", "0.6168306", "0.61624575", "0.6105572", "0.6082832", "0.6082832", "0.60765123", "0.6066407", "0.6065091", "0.60494375", "0.60371375", "0.60316956", "0.60258263", "0.600709", "0.60006046", "0.5996556", "0.59831893", "0.5978802", "0.59705293", "0.5967818", "0.595777", "0.59006417", "0.5894488", "0.58866763", "0.58592254", "0.5856227", "0.58493364", "0.5844614", "0.5837147", "0.5803547", "0.5802352", "0.5801231", "0.5791058", "0.5782958", "0.57791793", "0.5764313", "0.5758324", "0.5743381", "0.57412654", "0.57314044", "0.57142836", "0.56894124", "0.5683661", "0.56773055" ]
0.79088914
3
converts id into thumbnail link
function getThumbnail(videoId) { let thumbnail = "i3.ytimg.com/vi/" + videoId + "/hqdefault.jpg"; return thumbnail; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadThumbnail(id){\n return '<img class=\"youtube-thumb\" src=\"//i.ytimg.com/vi/' + id + '/hqdefault.jpg\"><div class=\"play-button\"></div>';\n }", "function thumbnail(id, info)\n{\n // caption, usually contains date\n let cap = document.createElement('span');\n cap.classList.add('cap');\n cap.textContent = info.date;\n\n // this says how many photos/videos gallery has\n let infoContent = [];\n\n if(info.images)\n infoContent.push(document.createTextNode(pl(info.images, 'fotka')));\n if(info.images && info.videos)\n infoContent.push(document.createElement('br'));\n if(info.videos)\n infoContent.push(document.createTextNode(pl(info.videos, 'video')));\n\n let imgInfo = document.createElement('span');\n imgInfo.classList.add('info');\n imgInfo.append(...infoContent);\n\n // thumbnail image, we are adding \"ghost\" src/srcset attributes to be\n // copied to real ones upon becoming visible (ie. lazy loading)\n let image = document.createElement('img');\n if('thumb' in info)\n image.setAttribute('data-src', info.thumb.src);\n if('srcset' in info.thumb)\n image.setAttribute('data-srcset', info.thumb.srcset);\n\n // encompassing DIV element that holds the text content and the image\n let thumb = document.createElement('div');\n thumb.classList.add('th');\n thumb.append(cap, imgInfo, image);\n\n // wrapping A element\n let a = document.createElement('a');\n a.setAttribute('href', id + '/');\n a.classList.add('th');\n a.append(thumb);\n\n return a;\n}", "_getThumbnail(link) {\n var video_id = link.split(\"v=\")[1];\n var ampersandPosition = video_id.indexOf(\"&\");\n if (ampersandPosition !== -1) {\n video_id = video_id.substring(0, ampersandPosition);\n }\n return video_id;\n }", "function getThumbnailURL(d){\n if (d.video_id > 0){\n return \"/uploads/\" + d.video_id + \"/thumbnails/\" + d.extracted_frame_number + \".jpg\";\n } else {\n return \"/uploads/refresh_to_load.jpg\";\n }\n }", "function IDtoImage(id){\n\tvar scale = '1.0'\n\treturn 'https://static-cdn.jtvnw.net/emoticons/v1/' + id + '/' + scale;\n}", "function getImagesLinkHTML(id) {\n return '<a href=\"gallery.html?id=' + id + '\">View images</a>';\n}", "function createSearchThumbnail(id){\n var thumbnailElem= YTIDToImg(id);\n $(thumbnailElem).attr({width:\"133\", height: \"100\"});\n $(thumbnailElem).addClass(\"searchThumbnail\");\n $(thumbnailElem).click(function () {\n populatePlaylist(id);\n });\n\n return thumbnailElem;\n}", "function generatePhoto(id) {\n\treturn ('[url=' + images[id].link + '][img]' + images[id].url + document.getElementById('photoSize').value +'[/img][/url]');\n}", "function expandedImageUrl(photo_id) {\n //return 'http://oldnyc-assets.nypl.org/600px/' + photo_id + '.jpg';\n //return 'http://192.168.178.80/thumb/' + photo_id + '.jpg';\n return 'http://www.oldra.it/thumb/' + photo_id + '.jpg';\n}", "goodPhotoThumbnail(goodId, imageIndex) {\n return `http://${helpers.base}/images/goods/thumbnail/pht_${goodId}_${imageIndex}.jpg`;\n }", "static getYoutubeThumb(videoId, size) {\n if (videoId.startsWith(\"http\")) {\n let regExp = /^.*(youtu\\.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n let match = videoId.match(regExp);\n if (match && match[2].length === 11) {\n videoId = match[2];\n }\n else {\n console.log(\"======== ERROR: can not get videoId from: \", videoId);\n }\n }\n if (videoId === null) {\n return \"http://img.youtube.com/vi/noimagefound/default.jpg\";\n }\n size = (size == undefined) ? 'big' : size;\n if (size === 'small') {\n return \"http://img.youtube.com/vi/\" + videoId + \"/default.jpg\";\n }\n return 'http://img.youtube.com/vi/' + videoId + '/0.jpg';\n }", "getImgUrl(id) {\n if (id === 1) {\n return `images/profile/4randy.png`; // special pic for randy\n } else {\n const index = id%18;\n return `images/profile/${index}.png`\n }\n }", "function getPhotoUrl(thumbnail) {\n\tvar photo = thumbnail.attr(\"src\");\n\tphoto = photo.slice(18);\n\tcaption(parseInt(photo)-1);\n\tvar bigger_photo = \"Photos/\" + photo;\n\t$photoBox.attr(\"src\",bigger_photo);\n}", "function addMoviePicture() {\n movie_id = query_params.id;\n item_link = document.createElement(\"A\");\n\n link_pic = document.createElement('img');\n \n\n var pic_id = 0;\n if (movie_id > 1000) \n pic_id = movie_id.toString().charAt(0);\n \n\n var src = 'http://nelson.uib.no/o/' + pic_id + '/' + movie_id + '.jpg';\n link_pic.src = src;\n link_pic.id = \"cover\"\n\n item_link.appendChild(link_pic);\n\n /* Want to put the picture somewhere else on the site? Edit results to your id here. */\n forsideBilde.appendChild(item_link); \n}", "function displayResult(videoSnippet,videourl) {\n\n var img = new Image(300,300); // width, height values are optional params\n img.src = videoSnippet.thumbnails.high.url;\n $('.sanadtech').append('<h1>'+videoSnippet.title+'</h1>');\n var url= videourl.videoId;\n\n\n console.log(url);\n //$('.sanadtech').append('<a id=\"test\" href=\"hello\">lien de la video</a>');\n var createA = document.createElement('a');\n var createAText = document.createTextNode(\"le lien de la video\");\n createA.setAttribute('href', 'https://www.youtube.com/watch?v='+url);\n createA.appendChild(createAText);\n $('.sanadtech').append(createA);\n $('.sanadtech').append(img);\n}", "function getImage64withId(id,srcId){\n \n var imgId = id ;\n var currDate = new Date();\n var currTime = currDate.getTime();\n console.log(\"finding image for - \"+imgId);\n \n if(id!=null){\n config.db.get(imgId, function(err, view){\n \n \n if(err){\n console.log(\"err - \"+ JSON.stringify(err));\n }\n else{\n document.getElementById(srcId).setAttribute( 'src', 'data:image/jpg;base64,'+view.image_data);\n }\n });\n }\n \n \n \n \n \n}", "function generateUrlIds(callback) {\n const img = uuidv1();\n const thumbnail = `${img}_t`;\n\n const file = storage.bucket(bucketName).file(img);\n const thumbnailFile = storage.bucket(bucketName).file(thumbnail);\n\n file.save('', {\n public: true,\n // metadata: ?\n }, (err) => {\n if (err) callback(cbs.cbMsg(true, err));\n else {\n thumbnailFile.save('', {\n public: true,\n }, (err_) => {\n if (err_) callback(cbs.cbMsg(true, err_));\n else callback(cbs.cbMsg(false, { img, thumbnail }));\n });\n }\n });\n}", "_formatFilename(id) {\n const basename = sprintf('image-%06d.jpg', id);\n\n return path.join(FOLDER_NAME, basename);\n }", "function g_link(template, id) {\r\n return \"/\" + template.id + \"/\" + id;\r\n}", "function generateThumbnailElement() {\n var element;\n element += \"<a class='fancybox-button' rel='fancybox-button' href='images/Zetica_RASC_DC_main.png' title='Screenshot of main dash board'>\";\n element += \"<img class='thumbnail' src='images/Zetica_RASC_DC_main.png' alt='' />\";\n element += \"</a>\"\n return element;\n }", "function handlePlanImage(id) {\n alert(id);\n }", "function getThumbnail(book) {\n let thumbnailUrl = book.volumeInfo && book.volumeInfo.imageLinks && book.volumeInfo.imageLinks.smallThumbnail;\n return thumbnailUrl ? thumbnailUrl.replace(/^http:\\/\\//i, 'https://') : '';\n }", "function render(id, title, imgUrl, height, width, prev, next) {\n var imgContainer = \"<div id='\" + id + \"' class='thumb col-md-3' data-title='\" + title + \"' data-previous='\" + prev + \"' data-next='\"+ next + \"' style='background-repeat: no-repeat; position: relative; max-width:\" + width + \"px; width: 100%; height:\" + height + \"px;'><img src='\" + imgUrl + \"'/></div>\";\n document.getElementById(\"container\").innerHTML += imgContainer;\n }", "function getPhoto(filmId, filmTitle){\n\tvar image = \"https://nelson.uib.no/o/\";\n\tvar imageURL = \"\";\n\n\t// undersøker verdien av filmens ID for å sørge for at det letes i riktig mappe på serveren\n\tif (filmId < 1000){\n\t\timageURL = image + \"0/\" + filmId + \".jpg\"; \n\t}\n\telse if (filmId > 1000 && filmId < 2000){\n\t\timageURL = image + \"1/\" + filmId + \".jpg\";\n\t}\n\telse if (filmId > 2000 && filmId < 3000) {\n\t\timageURL = image + \"2/\" + filmId + \".jpg\";\n\t}\n\telse {\n\t\timageURL = image + \"3/\" + filmId + \".jpg\";\n\t}\n\n\t// lenke til bilde\n\tvar imageLink = '<img src=\"' + imageURL + '\" alt=\"' + filmTitle + '\" width=\"300\">';\n\n\t// lenke til filmside\n\tvar clickableImage = '<a href=\"v3_showmovie.html?id=' + filmId + '\">' + imageLink;\n\n\t// returnerer et bilde som lenker til filmens informasjonsside ved klikk\n\treturn clickableImage;\n}", "function getLinkId(url) {\n\n var id = url.slice(url.lastIndexOf('/') + 1, url.length);\n //console.log(\"ID= \" + id);\n return id;\n\n}//get link id", "determineThumbnail() {\n if (this.props.book.imageLinks && this.props.book.imageLinks.smallThumbnail) {\n return `${this.props.book.imageLinks.smallThumbnail}`;\n } else {\n return `${process.env.PUBLIC_URL + '/images/missing-thumbnail.PNG'}`;\n }\n }", "function setThumbnail(imageID) {\n // const container = document.querySelector(`#img${imageID}`);\n const imagePos = document.querySelector(`#img${imageID} img`);\n document\n .querySelector(`#img${imageID} img`)\n .setAttribute(\"src\", imageContainer[imageID][\"previewImage\"]);\n document.querySelector(`#img${imageID} p`).innerText =\n imageContainer[imageID][\"title\"];\n}", "function displayImage(id) {\n //log('display ' + key);\n return initDB('thr').then(function(db) {\n return readRecord(db, 'books', id).then(function(book) {\n var key = uriToKey(book.pages[0].url);\n return readRecord(db, 'images', key).then(function(result) {\n var $img = $('<img>');\n if (result instanceof Blob) {\n result = window.URL.createObjectURL(result);\n }\n $img.attr('src', result);\n return $img;\n });\n });\n });\n }", "function getUrlForId(tweetId) {\n\t\treturn(getUrl() + tweetId);\n\t}", "function imageLargeUrl(img) {\n var retUrl;\n // try new photobox format first, parent LI has a data-photo-id attribute\n var imageId = myJQ(img).parent().attr(\"data-photo-id\");\n if (imageId) {\n // TODO the \"plus\" image still appears to exist even if there is no zoom box, any exceptions?\n retUrl = myJQ(\"#Photobox_PhotoserverPlusUrlString,#PhotoserverPlusUrlString\").attr(\"value\") + imageId + \".jpg\";\n } else {\n // old format\n // thumbnail link has class \"lbt_nnnnn\"\n imageId = myJQ(img).parent().attr(\"class\").substring(4);\n\n // TODO is \"photoStartIdNewDir\" still used in the old-format listings? \n // This is what TM does in their own script, comparing the current image ID to the ID where they started storing the images in a new path.\n var isNewImage = (unsafeWindow.photoStartIdNewDir ? unsafeWindow.photoStartIdNewDir > imageId : false);\n if (isNewImage) {\n retUrl = img.src.replace(\"/thumb\", \"\").replace(\".jpg\", \"_full.jpg\");\n } else {\n retUrl = img.src.replace(\"/thumb\", \"/full\");\n }\n }\n console.log(retUrl);\n return retUrl;\n}", "function setIdPic(idName) {\r\n\tid = idName;\r\n}", "function getTemplate(id, title, cover){\n var template = '<li><div style=\"text-align: center\">'\n template += '<img src='+cover+' onclick=\"openLink('+id+')\" />'\n template += '<span class=\"title\">'+title+'</span>'\n template += '</div></li>'\n\n return template\n}", "function photo_thumbnail_url(request, response) {\n\n if (!request.user || !request.user.authenticated()) {\n response.error(\"Needs an authenticated user\");\n return;\n }\n\n var query = new Parse.Query(PHOTO_OBJECT_NAME);\n query.get(request.params.objectId, {\n\n success: function(result) {\n\n response.success({\n url: cloudinary.url(result.get(CLOUDINARY_IDENTIFIER_FIELD_NAME), {crop: \"fill\", width: 150, height: 150})\t\n });\n\n },\n error: function() {\n response.error(\"image lookup failed\");\n }\n\n });\n\n}", "downloadId( id ) {\n return this.url( id );\n }", "function getPhotoURL(id, farm, server, secret, size) {\n if(!size) size = '';\n else size = '_' + size;\n return 'https://farm' + farm + '.staticflickr.com/' + server + '/' + id + '_' + secret + size + '.jpg';\n}", "function link_to_photo(wo_number)\n{\n RMPApplication.debug(\"link_to_photo : wo_number = \" + wo_number);\n c_debug(dbug.photo, \"=> link_to_photo: wo_number\", wo_number);\n var input = {};\n input.wo_number = wo_number;\n id_get_picture_in_collection.trigger(input, {}, get_photo_ok, get_photo_ko);\n RMPApplication.debug(\"end link_to_photo\");\n}", "function numToImage(id, s, post){\n\t\t\tvar oldid = id;\n\t\t\t//console.log(\"id: \"+oldid+\" s:\"+s);\n\t\t\ts = s + \"\";\n\t\t\tvar arr = s.split(\"\");\n\t\t\tarr.reverse();\n\t\t\t$.each(arr, function(index, value){\n\t\t\t\t//console.log(\"INDEX: \" + index + \" VALUE: \" + value);\n\t\t\t\tvar $temp = $('<div class=\"numSprite2 grid num'+value+' '+post+'\" id=\"temp'+index+post+'\"></div>').insertBefore(oldid);\n\t\t\t\tvar pos = $(oldid).position();\n\t\t\t\t$temp.css({\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\ttop: Math.round(pos.top),\n\t\t\t\t\tleft: Math.round(pos.left)-16\n\t\t\t\t});\n\t\t\t\toldid = \"#\"+$temp.attr(\"id\");\n\t\t\t});\n\t\t}", "function openListingGallery(obj) {\n var imgSrc = obj.src;\n var newSrc = imgSrc.replace(\"thumbnail\", \"gallery\");\n document.getElementById(\"gallery_view\").style.display = \"block\";\n document.getElementById(\"gallery_img\").src = newSrc;\n}", "function prepViewLargeImageLink(product_id, image_type, cache_url) {\n var fullsize_link = document.getElementById('full-size-image-link');\n if (fullsize_link != null) {\n fullsize_link.onclick = function() {\n launchNamePopUp('imgL', '/' + channel + '/ViewFullSizeImage.ice?productID=' + product_id + '&currentImage=' + image_type, 580,760);\n };\n }\n}", "function getImage(map, id) {\n var alias = \"alias:\";\n var image = map[id];\n while(image != null) {\n if(!image.startsWith(alias)) {\n var img = document.createElement(\"img\");\n img.src = image;\n img.alt = id;\n img.title = id;\n img.width = 25;\n return img.outerHTML;\n }\n id = image.replace(alias, \"\")\n image = map[id];\n }\n\n return null;\n}", "function fixURL(destination) {\n var fileid = destination.split(\"/\")[4]; //Grabs the file name.\n\tfileid = fileid=='gen' ? destination.split(\"/\")[5] : fileid\n var newUrl = \"https://content.byui.edu/items/\" + fileid + \"/0/\";\n return newUrl;\n}", "function padImgId2(id) {\n return ( id <= 999 ? `00${id}`.slice(-3) : id );\n}", "function imageFromThumb(thumbnail) {\r\n 'use strict';\r\n return thumbnail.getAttribute('data-image-url');\r\n}", "function toImdbUrl(idStr) {\n const numZeros = 7 - idStr.length\n return `http://www.imdb.com/title/tt${'0'.repeat(numZeros)}${idStr}`\n}", "function thumbnail(object) {\nreturn $(\"<div>\")\n .addClass(\"thumb\")\n .css(\"background-image\", \"url(\" + object.webImage.url.replace(\"s0\", \"s128\") +\")\");\n}", "function imageFromThumb (thumbnail) {\n 'use strict';\n return thumbnail.getAttribute('data-image-url');\n}", "function mmCreateUrlAttachment(attachment) {\n let type = $(attachment).data(\"type\");\n let id = $(attachment).data(\"id\");\n let $img = $(attachment).find(\".attachment-preview img\"),\n url = $img.data(\"src\"),\n urlmax = url.replace(/-150/g, \"\"),\n title = $img.attr(\"alt\"),\n max = $img.data(\"max\"),\n size = $img.data(\"size\"),\n sizes = $img.data(\"sizes\").toString(),\n align = $img.data(\"align\") || \"center\",\n textAlt = $img.attr(\"alt\") || \"\",\n proAlt = (textAlt!=null && textAlt.length>0)?`alt=\"${textAlt}\"`:\"\";\n textTitle = $img.data(\"title\") || \"\",\n proTitle = (textTitle!=null && textTitle.length>0)?`title=\"${textTitle}\"`:\"\";\n textCaption = $img.data(\"caption\") || \"\",\n tagCaption = (textCaption!=null && textCaption.length>0)?`<figcaption class=\"caption\">${textCaption}</figcaption>`:\"\";\n rs = '';\n switch (type) {\n case 'file':\n rs = `<a href=\"${url}\" title=\"${title}\">${url}</a>`;\n break;\n case 'image':\n let sizesArr = sizes.split(\",\"),\n srcset = [],\n srcsetSizes = [],\n cssAlign = \"\";\n cssAlign = (align == \"center\") ? `style=\"display: block; margin-left: auto; margin-right: auto; text-align:center;\"` : cssAlign;\n cssAlign = (align == \"right\") ? `style=\"float: right; text-align:right;\"` : cssAlign;\n sizesArr.forEach(s => {\n if (s <= size) {\n url = (s == max) ? urlmax : url.replace(/-150\\./g, `-${s}.`);\n srcset.push(`${url} ${s}w`);\n srcsetSizes.push(`${s}px`);\n }\n });\n urlmax = (size == max) ? urlmax : url.replace(/-150\\./g, `-${size}.`);\n rs = `<figure id=\"smsci-${id}\" class=\"sm-single-content-image\" ${cssAlign}>`;\n rs += `<img ${proAlt} ${proTitle} srcset=\"${srcset.join()}\" sizes=\"(max-width: ${size}px) ${srcsetSizes.join(\",\")}\" src=\"${urlmax}\" width=\"${size}\"/>`;\n rs += (tagCaption.length > 0) ? tagCaption : \"\";\n rs += \"</figure>\";\n break;\n default:\n console.log(\"wrong attachment type\");\n break;\n }\n return rs.trim();\n}", "function parse_imageId() {\n\t// URL is like http://emptysquare.net/photography/lower-east-side/#5/\n\t// fragment from http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/\n\tvar fragment = $.param.fragment();\n\tif (fragment.length) {\n\t\t// URL's image index is 1-based, our internal index is 0-based\n\t\timageId = parseInt(fragment.replace(/\\//g, '')) - 1;\n\t\tif (imageId < 0 || isNaN(imageId)) imageId = 0;\n\t} else {\n\t\timageId = 0;\n\t}\n}", "function imageFromThumb(thumbnail) {\n 'use strict';\n return thumbnail.getAttribute('data-image-url');\n}", "function IdFormatter (cell, row) {\n return <Link to={\"asset/\" + cell}>\n {cell}\n </Link>\n}", "function toLink( data ) {\n\tif ( data && typeof data === 'object' ) {\n\t\tif ( data.constructor.name === 'ObjectID' || data.constructor.name === 'ObjectId' ) {\n\t\t\treturn { _id: data } ;\n\t\t}\n\n\t\tdata._id = toObjectId( data._id ) ;\n\t\t// /!\\ Remove extra properties? /!\\\n\t\t// Proxy part should allow it (it is a document once populated), raw part shouldn't\n\t}\n\telse if ( typeof data === 'string' ) {\n\t\tdata = { _id: data } ;\n\t}\n\n\treturn data ;\n}", "function makeLargeIconLink( thisRow )\r\n\t{\r\n\t\tvar outputStr = \"\";\r\n\t\tvar lrgImgStr = \"\";\r\n\t\tvar size = 32;\r\n\r\n\t\tif ( 0 !== thisRow.imgStatus.length )\r\n\t\t{\r\n\t\t\t// Only put out information for the object iff\r\n\t\t\t// the img status is not empty. If this is not\r\n\t\t\t// the case then we put out a nbsp\r\n\t\t\tif ( ( ( \"\" !== thisRow.imgRealLargeStr ) && renderBigImages ) || ( thisRow.imgRealLargeStr === thisRow.imgLargeStr ))\r\n\t\t\t{\r\n\t\t\t\tlrgImgStr = class_baseUrl + \"/fetch/\" + thisRow.imgRealLargeStr;\r\n\t\t\t\tsize = 64;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tlrgImgStr = thisRow.imgLargeStr;\r\n\t\t\t}\r\n\r\n\t\t\tif ( 0 < thisRow.link.length )\r\n\t\t\t{\r\n\t\t\t\toutputStr += \"\t\t<A HREF=\\\"\" + thisRow.link + getOptionalParams( thisRow ) + \"\\\">\";\r\n\t\t\t\toutputStr += \"\t\t\t<IMG SRC='\"+ thisRow.imgStatus + \"' WIDTH='8' HEIGHT='8' BORDER='0' ALT='\"+ thisRow.statusName + \"'><IMG SRC='\"+ lrgImgStr + \"' WIDTH='\" + size + \"' HEIGHT='\" + size + \"' BORDER='0' ALT='\"+ thisRow.typeName + \"'>\";\r\n\t\t\t\toutputStr += \"\t\t</A>\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\toutputStr += \"&nbsp;<IMG SRC='\"+ thisRow.imgStatus + \"' WIDTH='8' HEIGHT='8' BORDER='0' ALT='\"+ thisRow.statusName + \"'><IMG SRC='\"+ lrgImgStr + \"' WIDTH='\" + size + \"' HEIGHT='\" + size + \"' BORDER='0' ALT='\"+ thisRow.typeName + \"'>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\toutputStr += \"&nbsp;\";\r\n\t\t}\r\n\r\n\t\treturn outputStr;\r\n\t}", "function idToCursor(id) {\n return base64(PREFIX + id);\n}", "function idToCursor(id) {\n return base64(PREFIX + id);\n}", "details(id){\n\t\twindow.location.href=this.url+\"detalles-blog/\"+id;\n\t}", "function getNelsonImageUrl(movie_id) {\n var parent = \"0\";\n if (movie_id > 999) {\n parent = movie_id.toString()[0];\n }\n return template(\"https://nelson.uib.no/o/{{parent}}/{{movie_id}}.jpg\", {\n parent: parent,\n movie_id: movie_id\n });\n}", "function getProductUrlForVariantId(id, apiData) {\r\n const currentItem = apiData.find(o => o.number == id);\r\n if (currentItem) {\r\n const url = currentItem.attributes.url;\r\n\r\n return url;\r\n }\r\n return \"\";\r\n}", "getById(id) {\r\n const fl = new FieldLink(this);\r\n fl.concat(`(guid'${id}')`);\r\n return fl;\r\n }", "function showThumbs(videos, id_video) {\r\n\t\t\tconsole.log('en showThumbs, con id_video: ' + id_video );\r\n\r\n\t\t\tif (videos.length == 0) {\r\n\t\t\t\t// no ha encontrado el video_id\r\n\t\t\t\tconsole.log('video id no encontrado');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// video_id es correcto\r\n\t\t\t\tvar _id = videos[0].id;\r\n\t\t\t\tvar _url = videos[0].url;\r\n\t\t\t\tvar _title = videos[0].title;\r\n\t\t\t\tvar _thumbsmall = videos[0].thumbnail_small;\r\n\t\t\t\tvar _thumbmed = videos[0].thumbnail_medium;\r\n\t\t\t\tvar _thumblarge = videos[0].thumbnail_large;\r\n\t\t\t\tvar _duration = videos[0].duration;\r\n\t\t\t\tvar _w = videos[0].width;\r\n\t\t\t\tvar _h = videos[0].height;\r\n\t\t\t\t\r\n\t\t\t\tconsole.log('ENCONTRADO VIDEO EN VIMEO\\n id: '+_id+', \\n _url: '+_url+', \\n _title: '+_title+', \\n _thumbsmall: '+_thumbsmall+', \\n _thumbmed: '+_thumbmed+', \\n _thumblarge: '+_thumblarge+', \\n _duration: '+_duration+', \\n _w: '+_w+', \\n _h: '+_h+', \\n _id: '+_id);\r\n\t\t\t\tif (_id == id_video) {\r\n\t\t\t\t\tconsole.log('ids SÍIIII iguales');\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// no coinciden -> ¿error?\r\n\t\t\t\t\tconsole.log('ids no iguales, error');\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor (var i = 0; i < videos.length; i++) {\r\n\t\t\t\tvar thumb = document.createElement('img');\r\n\t\t\t\tthumb.setAttribute('src', videos[i].thumbnail_medium);\r\n\t\t\t\tthumb.setAttribute('alt', videos[i].title);\r\n\t\t\t\tthumb.setAttribute('title', videos[i].title);\r\n\r\n\t\t\t\tvar a = document.createElement('a');\r\n\t\t\t\ta.setAttribute('href', videos[i].url);\r\n\t\t\t\ta.appendChild(thumb);\r\n\r\n\t\t\t\tvar li = document.createElement('li');\r\n\t\t\t\tli.appendChild(a);\r\n\t\t\t\tul.appendChild(li);\r\n\t\t\t}\r\n\t\t}", "thumbUrl() {\n return this.item.thumb_path;\n }", "function createTdId( id, image ){\n var td = document.createElement('td');\n\n var tdIdHTML = '<a href=\"javascript:;\" class=\"avatar rounded-circle\"><img class=\"img-avatar\" width=\"20\"height=\"20\" alt=\"Image placeholder\" src=\"'\n tdIdHTML += image;\n tdIdHTML += '\"></a><br><p class=\"text-id\">';\n tdIdHTML += id;\n tdIdHTML += '</p>';\n td.innerHTML = tdIdHTML;\n\n return td;\n}", "createThumbnails() {\n return this.state.projectThumbnails.reverse().map(object =>\n <Link to={`/projects/${object.url}`} className=\"col-lg-4 col-md-6 thumbnail\">\n <ProjectThumbnail\n title={object.title}\n description={object.description}\n imageSrc={object.imageSrc}\n imageAlt={object.imageAlt} />\n </Link>)\n }", "function _uploadIcon(id) {\n vm.item.id;\n $window.location.href = \"/user/home/upload/\" + vm.item.id + \"/edit\";\n }", "function recipeURL(recipeID) {\n return (\"https://spoonacular.com/recipeImages/\" + recipeID + \"-240x150.jpg\");\n}", "function getVideoLink(item) {\n var videoID = item.id.videoId;\n var thumb = item.snippet.thumbnails.high.url;\n //build output string\n var output = '<iframe auto src=\"https://youtube.com/embed/' + videoID + '?rel=0\"></iframe>' + '<div class=\"clearfix\"></div>' + '';\n return output;\n }", "generateImageUrlFromCoverId(coverId, size) {\r\n generateImageUrl(coverId).then(json => {\r\n this.setState({\r\n imgUrl:\r\n \"//images.igdb.com/igdb/image/upload/t_\" +\r\n size +\r\n \"/\" +\r\n json[0].image_id +\r\n \".jpg\"\r\n });\r\n });\r\n }", "function magnifyImages(id) {\n $(`#${id}`).magnificPopup({\n delegate: 'a',\n type: 'image',\n gallery: {\n enabled: true,\n },\n })\n}", "function showImageFromThumbnail(obj) {\n\n\timgSrc = $(obj).attr(\"href\");\n\n\t// The link has a data-modal attribute.\n\t// 1 = open in a modal - 0 = open in a new tab\n\tmodal = $(obj).data('modal');\n\n\tif (modal == '1') {\n\t\timgTitle = $(obj).attr(\"title\");\n\t\t$('#imgGallery').attr('src', imgSrc);\n\t\t$('#imgTitle').text(imgTitle);\n\t\t$('#Modal_ImgGallery').toggleClass('show').toggleClass('fade');\n\t} else {\n\t\twindow.open(imgSrc);\n\t}\n\n\treturn true;\n\n}", "url() {\n return 'url(#' + this.id() + ')';\n }", "url() {\n return 'url(#' + this.id() + ')';\n }", "get thumbnailUrl() {\n return this._data.thumbnail_url;\n }", "function showOriginalImage(id) {\r\n var photo = images[id];\r\n document.getElementById(\"image-title\").innerHTML = photo.title;\r\n document.getElementById(\"image-content\").innerHTML =\r\n '<img src=\"https://farm' +\r\n photo.farm +\r\n '.staticflickr.com/' +\r\n photo.server +\r\n '/' +\r\n photo.id +\r\n '_' +\r\n photo.secret +\r\n '_z.jpg' +\r\n '\" alt=\"' +\r\n photo.title +\r\n '\"/>';\r\n document.getElementById(\"image\").className += \" visible\";\r\n}", "function revertId(img, original) {\n img.id = original;\n}", "function get_lrg_link (lrg_id) {\n var lrg_link = build_link_base('LRG_'+lrg_id);\n lrg_link.addClass('lrg_link');\n return lrg_link[0].outerHTML;\n}", "function getItemThumbnail(item) {\n var thumbnailPaths = [\n {\n path: 'thumbnail'\n },\n {\n path: 'media\\\\:thumbnail'\n },\n {\n path: 'media\\\\:content'\n },\n {\n path: 'image url',\n type: 'html'\n }\n ];\n var url;\n var tag;\n var $thumbnail;\n\n // Tries to find tags\n for (var i = 0, l = thumbnailPaths.length; i < l; i++) {\n tag = thumbnailPaths[i];\n $thumbnail = jQuery(item).find(tag.path).eq(0);\n\n if (!$thumbnail.length) {\n continue;\n }\n\n switch (tag.type) {\n case 'attr':\n url = $thumbnail.attr(tag.attr);\n break;\n case 'html':\n url = $thumbnail.html();\n break;\n default:\n url = $thumbnail.attr('url');\n break;\n }\n\n if (url) {\n break;\n }\n }\n\n return url;\n}", "function createThumbnailItem (gallery) {\n\t\tvar div = thumbnail.DOM (\"div.hidden\");\n\t\tvar img = div.IMG (gallery.src);\n\t\tdiv.onclick = imgOnclickEvt (img, gallery);\n\t\tdisplay [gallery.year].push (div);\n\t}", "function getUrlId() {\n return getURLSearch().replace('id=', '');\n}", "function buildThumbnailDiv(photo) {\n var APIImgUrl = prepareUrl(photo);\n //Define ltbox elements\n var innerBx = '<div class=\"image-box\">' + '<div class=\"imageholder\"><img src=\"' + APIImgUrl + '\"/>' + '</div></div>';\n var newImgDiv = document.createElement(\"div\");\n newImgDiv.setAttribute(\"class\", \"thumbnail\");\n newImgDiv.setAttribute(\"onClick\", \"displayLtBox(\\'\" + APIImgUrl + \"\\',\\'\" + photo.title + \"\\')\");\n newImgDiv.innerHTML = innerBx;\n return newImgDiv;\n}", "function showResults(results) {\n var html = \"\";\n var html2 = \"\";\n $.each(results, function(index, value){\n var theVideoIDcurrent = value.id.videoId;\n var thumbnailURLcurrent = value.snippet.thumbnails.high.url;\n console.log(thumbnailURLcurrent);\n console.log(theVideoIDcurrent);\n \n //Display thumbnail image of returned videos + Make the images clickable, leading the user to the YouTube video, on YouTube\n html += /* \"<a href=\\'https://www.youtube.com/watch?v=\" + theVideoIDcurrent +\"\\'>\" + */ \"<img src=\\'\" + thumbnailURLcurrent + \"\\' value=\\'\" + theVideoIDcurrent + \"\\' onclick=\\'javascript:startLightBox()\\'\\>\";\n });\n $(\"#search-results\").html(html);\n \n}", "function getPixivID(img) {\n const file_regex = /(\\d+)_p\\d+/;\n const url_regex = /\\/(\\d+)$/;\n let regex = undefined;\n //console.log(parse(img));\n if (parse(img).hostname === \"i.pximg.net\") { regex = url_regex; }\n else { regex = file_regex; }\n\n const id = img.match(regex);\n if (id && id.length) {\n const url = `https://pixiv.net/artworks/${id[1]}`;\n return url;\n }\n return \"\";\n}", "function display_meta_images(thumbArray, i){\n\n if (thumbArray != \"\" && i != thumbArray.length){\n \n $('.meta-thumbs').append(\"<li><img src='' height='100' class='\" + i + \"' /><br><a href='#' class='del' rel='\" + i + \"'>delete</a></li>\");\n\n wp.media.model.Attachment.get( thumbArray[i] ).fetch({success:function(att){ // where 7 is the id of a single attachment\n //tempUrl = att.attributes.sizes.thumbnail.url; // { id: 7 }\n \n $('.meta-thumbs img.' + i ).attr(\"src\", att.attributes.sizes.thumbnail.url );\n $('.meta-thumbs img.' + i ).attr(\"title\", att.attributes.id );\n\n }});\n\n e = i + 1;\n \n display_meta_images(thumbArray, e);\n }\n }", "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 5; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n Url.findOne({shortUrl: text}, (err, doc) => {\n if (doc) {\n makeid();\n }\n })\n return text;\n}", "function populateGallery(){\nlet thumbnailAdd ='';\nlet container = document.querySelector('.container_thumbnails');//get object\n\n for (let i=1; i<=(captionArray.length); i++) {\n thumbnailAdd += `<a class= 'thumbnail' href=\"images/photos/${i}.jpg\" data-caption=\"${captionArray[i-1]}\">\n <img class='thumbnail' id= \"thumb${i}\" src=\"images/photos/thumbnails/${i}.jpg\" alt=\"Gallery image\">\n </a>`;\n }\ncontainer.innerHTML = thumbnailAdd;\n}", "toString() {\n return 'url(#' + this.id() + ')';\n }", "function fn_createlink(strImgLink)\r\n{\r\n\tvar tempCode;\r\n\ttempCode = \"<a href = \" + chr(34) + strImgLink + chr(34) + \"> View </a>\";\r\n\treturn tempCode + Chr(10);\r\n}", "function loadThumbnail(start) {\n thumbsContainer.innerHTML = \"\";\n\n for (let i = start; i < start + maxThumbnail; i++) {\n let thumb = thumbnails[i];\n if (!thumb) continue;\n let thumbContainer = document.createElement('div');\n if (!thumb.page) continue;\n // let page = thumb.page.split(\"|\")[0];\n let page = thumb.page;\n let folio = _thisRef.FOLIOS[page];\n thumbContainer.innerHTML = `<span>${folio}</span><img src='Zoomify/FGM_Zoomify/${page}/TileGroup0/0-0-0.jpg'>`;\n thumbContainer.setAttribute(\"page\", page);\n thumbsContainer.appendChild(thumbContainer);\n thumbContainer.onclick = function () {\n _thisRef.loadPage(page);\n }\n }\n _thisRef.highlightThumbnail();\n }", "renderThumbnails(){\n return data.map(info => {\n return <Thumbnail {...info} key={info.id} buttons={this.actionButtons(info.demo_link, info.detail_link)}/>\n });\n }", "function getImageUrlForVariantId(id, apiData) {\r\n const currentItem = apiData.find(o => o.number == id);\r\n let url;\r\n if (currentItem) {\r\n const imageWithCheckoutTag = currentItem.images.find(function (image) {\r\n return image.tags.includes(\"checkout\");\r\n });\r\n\r\n if (imageWithCheckoutTag) {\r\n url = imageWithCheckoutTag.url;\r\n } else {\r\n const firstImage = currentItem.images[0];\r\n if (firstImage) {\r\n url = firstImage.url;\r\n }\r\n }\r\n }\r\n return url;\r\n}", "function prepareUrl(imgObject) {\n return 'https://farm8.staticflickr.com/' + imgObject.server + '/'+ imgObject.id + '_' + imgObject.secret + '.jpg';\n}", "function setDetailsFromThumb(thumbnail){\n 'use strict';\n setDetails(imageFromThumb(thumbnail), titleFromThumb(thumbnail));\n}", "function link_to_image(pid)\r\n{\r\n temp = prompt(link_to_img_prompt, show_img_url+pid);\r\n return false;\r\n}", "encodeLinkId (linkId) {\n\t\treturn Buffer.from(linkId, 'hex')\n\t\t\t.toString('base64')\n\t\t\t.split('=')[0]\n\t\t\t.replace(/\\+/g, '-')\n\t\t\t.replace(/\\//g, '_');\n\t}", "function getLongUrlFromShortUrl(req, res, next) {\n\tif(!req.params.id) {\n return res.status(400).send({\"status\": \"error\", \"message\": \"An id is required\"});\n }\n db.one('SELECT * FROM urls WHERE id = $1', [req.params.id])\n .then(function (data) {\n res.redirect(data.long_url);\n })\n .catch(function (err) {\n return next(err);\n });\n}", "function linksUrlToImg (categorie, url) {\n\tconst imgs = document.getElementsByClassName(categorie);\n\tgetUrlImages(url).then(function (map){\n\t\tvar i = 0;\n\t\tfor (let img of imgs) {\n\t\t\t// link url image to img[index]\n\t\t\tvar urlImg = Array.from(map.values())[i];\n\t\t\timg.src = urlImg;\n\t\t\t// link id to img[index]\n\t\t\tvar idImg = Array.from(map.keys())[i];\n\t\t\timg.id = idImg;\n\t\t\ti ++;\n\t\t}\n});\n}", "function modifiedImgBack(image){\n image.src = image.id + '.jpg';\n }", "function createThumbnail(productInfos) {\n const main = document.querySelector(\".main__accueil\");\n\n //create thumnbail\n const section = document.createElement(\"section\");\n main.appendChild(section);\n const thumnbailStyle = document.createAttribute(\"class\");\n thumnbailStyle.value = \"thumnbail\";\n section.setAttributeNode(thumnbailStyle);\n\n //create link thumnbail\n const link = document.createElement(\"a\");\n section.appendChild(link);\n const href = document.createAttribute(\"href\");\n href.value = \"./pages/productpage.html?id=\" + productInfos._id;\n link.setAttributeNode(href);\n\n //create title for thumnbail\n const h2 = document.createElement(\"h2\");\n link.appendChild(h2).innerHTML = productInfos.name;\n\n //create price for thumnbail\n const span = document.createElement(\"span\");\n const priceStyle = document.createAttribute(\"class\");\n priceStyle.value = \"price\";\n span.setAttributeNode(priceStyle);\n let price = productInfos.price;\n // Set the price with the good writting\n link.appendChild(span).innerHTML = transformPrice(price);\n\n //create img for thumnbail\n const div = document.createElement(\"div\");\n link.appendChild(div);\n const imgContainer = document.createAttribute(\"class\");\n imgContainer.value = \"img__container\";\n div.setAttributeNode(imgContainer);\n\n const img = document.createElement(\"img\");\n div.appendChild(img);\n\n const imgUrl = document.createAttribute(\"src\");\n imgUrl.value = productInfos.imageUrl;\n img.setAttributeNode(imgUrl);\n\n const imgDescription = document.createAttribute(\"alt\");\n imgDescription.value = productInfos.description;\n img.setAttributeNode(imgDescription);\n}", "function setDetailsFromThumb(thumbnail) {\r\n 'use strict';\r\n setDetails(imageFromThumb(thumbnail), titleFromThumb(thumbnail));\r\n}", "function generateThumbs() {\r\n\t\t\tfunction createNewImgIndex(url, src, el) {\r\n jQuery('<a href=\"' + url + '\" style=\"background-image: url('+ src +');\"></a>').prependTo(el);\r\n\t\t\t}\r\n\r\n jQuery('.index .post').each( function() {\r\n\t\t\t\tvar postURL = jQuery(this).find('.post-title a').attr('href');\r\n\t\t\t\tvar firstImg = jQuery(this).find('img:first-of-type');\r\n\t\t\t\tvar firstImgSrc = firstImg.attr('src');\r\n\t\t\t\tif (typeof firstImgSrc !== 'undefined') {\r\n\t\t\t\t\tcreateNewImgIndex(postURL, firstImgSrc, this);\r\n\t\t\t\t\tfirstImg.parent().remove();\r\n\t\t\t\t\tfirstImg.parent().parent().parent().find('.post-excerpt').remove();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n jQuery('.index .post > a').wrap('<div class=\"post-image\" />');\r\n\t\t}", "function getUrlPic(picture) { return \"url(\"+picture+\")\"; }", "function onClickEdit () {\n $('.thumbnails').on('click','.gallery-edit',function(e){\n e.preventDefault();\n //get image id\n alert($(this).parents('.thumbnail').attr('id'));\n });\n }" ]
[ "0.71271473", "0.6994172", "0.6871036", "0.67597437", "0.67197126", "0.6678806", "0.6488973", "0.64361376", "0.63798875", "0.63322514", "0.6279063", "0.62736666", "0.6228342", "0.6114875", "0.6111203", "0.6075586", "0.6015214", "0.59424716", "0.5837447", "0.58181804", "0.5815434", "0.5813898", "0.5813082", "0.5806256", "0.579359", "0.57881993", "0.57795286", "0.5778952", "0.5774504", "0.5724271", "0.5706378", "0.5704963", "0.56880546", "0.56868565", "0.5673691", "0.5650754", "0.5644016", "0.56316626", "0.5625261", "0.5613108", "0.5612533", "0.5611998", "0.5603583", "0.55913806", "0.5589387", "0.556074", "0.55577815", "0.5531906", "0.553069", "0.5515367", "0.55098706", "0.5498722", "0.5497936", "0.5497936", "0.5496952", "0.5494551", "0.548713", "0.54831696", "0.5480643", "0.5470923", "0.5468078", "0.5465806", "0.54638505", "0.5462622", "0.5461022", "0.54588634", "0.5439767", "0.5422428", "0.54103935", "0.54103935", "0.5404123", "0.5397669", "0.53963137", "0.5394944", "0.5385009", "0.53836435", "0.5380856", "0.53705764", "0.5355338", "0.5354705", "0.5347078", "0.53448987", "0.53390926", "0.53241795", "0.5317372", "0.5314695", "0.53132784", "0.5306203", "0.53055286", "0.53017724", "0.5290617", "0.52888626", "0.52827317", "0.5263645", "0.5262656", "0.5253822", "0.5253617", "0.52529603", "0.52509505", "0.5249673" ]
0.61305654
13
play or loads a new random video from database
function getRandomVideo(isAutoplay) { let id; $.ajax({ type: "GET", url: "loadrandom.php", dataType: "html", success: function(response){ let objectData = response.split(/;/); let link = objectData[0]; id = objectData[1]; let title = objectData[2]; let thumbnail = "https://" + objectData[3]; let date = objectData[4]; if (isAutoplay) { player.loadVideoById(id); switchBg(id); } else { player.cueVideoByUrl("http://www.youtube.com/v/"+id+"?version=3", 0); $(".underlay").css('background', 'linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 1)), url("https://'+ getThumbnail(id) +'") no-repeat'); $(".underlay").css('background-size', 'cover'); $(".underlay").css('background-position', 'center'); $(".underlay").css('background-repeat', 'no-repeat'); } getTitleFromId(id); }, error: function(response){ return "error"; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playRandomVideo() {\n var $urls = $('[href^=\"/watch\"]');\n var i = Math.floor(Math.random() * $urls.length);\n\n var href = $urls[Math.floor(Math.random() * $urls.length)].href;\n var id = /[?&]v=([^&]+)(?:&|$)/.exec(href)[1];\n\n starting = true;\n\n player.loadVideoById(id);\n }", "function videoloader(){\r\n totalCount=4;\r\n var num = Math.ceil( Math.random() * totalCount );\r\n var player = document.getElementById('vdo');\r\n var source=document.getElementById(\"source\");\r\n player.pause();\r\n source.src=\"ad\"+num+\".mp4\";\r\n player.load();\r\n player.play();\r\n }", "function loadNewVideo(vid){\n console.log('loadNewVideo:',vid);\n player.loadVideoById(vid);\n}", "function playNewVideo () {\n $.get('/next/videos').then(function (songs) {\n console.log(songs)\n console.log(songs[0].video_id)\n player.loadVideoById(songs[0].video_id)\n event.target.playVideo()\n playNewVideo(nextID)\n })\n}", "function Changevideo(nextvid){\n player.loadVideoById({videoId:nextvid})\n playing = nextvid;\n}", "function reiniciar() {\n\n video.load();\n playPause();\n}", "function init() {\n const rand = Math.random();\n const video_index = Math.floor(number_videos * rand);\n console.log(video_index);\n const vidPlayer = document.getElementById('videoPlayer');\n vidPlayer.innerHTML = `<source src=\"./goal/${video_index}\" type=\"video/mp4\">`;\n\n window.addEventListener('load', function() {\n console.log('loaded');\n vidPlayer.play();\n }, false);\n\n // const VP = document.getElementById('videoPlayer')\n // const VPToggle = document.getElementById('butt')\n\n // VPToggle.addEventListener('click', function() {\n // if (vidPlayer.paused) vidPlayer.play()\n // else vidPlayer.pause()\n // })\n}", "function playRandomBumper() {\n // Randomly select the bumper video to play\n bumperRandomNumber = Math.floor(Math.random() * bumperDataLength);\n currentBumperId = bumperData[bumperRandomNumber];\n // Get the video for the current randomly selected video Id\n myPlayer.catalog.getVideo(currentBumperId, function(error, video) {\n // Deal with error\n if (error) {\n console.log('error getting bumper', error);\n }\n myPlayer.catalog.load(video);\n myPlayer.play();\n });\n }", "function nextVideo() {\n var nextVideoId = sessionStorage.getItem('nextVideoId');\n if(nextVideoId === null) {\n findAndPlayVideo();\n } else {\n playVideo(nextVideoId);\n sessionStorage.removeItem('nextVideoId')\n findAndStoreVideo();\n }\n}", "function playNextVideo() {\n \tsocket.emit('playNextVideo', {myroom: myRoom, controlkey: getControlHash(), currentID: currentPlayingVideoID });\n }", "playRandom(){\n this.request(this.routes.randomTrack, this.play);\n }", "function autoVideo() {\r\n // Reloop the list of videos from the first movie\r\n if (position == movieInfo.length) {\r\n position = 0;\r\n document.getElementsByTagName(\"video\")[0].onended = function () {\r\n setTimeout(autoVideo, 2000);\r\n };\r\n }\r\n\r\n document.getElementById(\"mp4\").src = movieInfo[position].src;\r\n document.getElementById(\"ogg\").src =\r\n movieInfo[position].src.substring(0, movieInfo[position].src.length - 3) +\r\n \"ogg\";\r\n document.getElementsByTagName(\"video\")[0].load();\r\n\r\n position++;\r\n}", "function loadFirstVid(){\n\t\t\t\t \tplayer = new YT.Player('vframe', {\n\t\t\t\t\t\t\t videoId: videos[videoCounter].url, //'47dtFZ8CFo8',\n\t\t\t\t\t\t\t playerVars: { 'autoplay': 1, 'controls': 0 , 'autohide':1, 'showinfo':0, 'controls':1, 'iv_load_policy':3, 'disablekb':1, 'modestbranding':1, 'rel':0, 'theme':'light', 'color':'white'},\n\t\t\t\t\t\t\t events: {\n\t\t\t\t\t\t\t 'onReady': onPlayerReady,\n\t\t\t\t\t\t\t 'onStateChange': onPlayerStateChange\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t });\n\t\t\t\t }", "function playVideo(id) {\n player.loadVideoById(id);\n addToPrevWatched(id);\n}", "playRandom()\n\t{\n\t\tif(this.currentPlaylist)\n\t\t\tthis.play(this.currentPlaylist[Math.floor(Math.random() * this.currentPlaylist.length)]);\n\t\telse\n\t\t\tthis.play(Math.floor(Math.random() * this.tracks.length));\n\t}", "function loadVideo(number){\n\n switch (number) {\n case 0:\n\n videoSource.setAttribute('src', 'videos/extract_Pill.mp4')\n break;\n case 1:\n\n videoSource.setAttribute('src', 'videos/extract_KungFu.mp4')\n break\n case 2:\n\n videoSource.setAttribute('src', 'videos/extract_MrSmith.mp4')\n break\n case 3:\n\n videoSource.setAttribute('src', 'videos/extract_WakeUp.mp4')\n break\n case 4:\n\n videoSource.setAttribute('src', 'videos/extract_BulletTime.mp4')\n break\n default:\n break;\n }\n\n video.load();\n}", "function switchVideo(n) {\r\n document.getElementsByTagName(\"video\")[0].pause();\r\n\r\n document.getElementById(\"mp4\").src = movieInfo[n].src;\r\n document.getElementById(\"ogg\").src =\r\n movieInfo[n].src.substring(0, movieInfo[n].src.length - 3) + \"ogg\";\r\n document.getElementsByTagName(\"video\")[0].load();\r\n\r\n // Change the position in the list\r\n position = n + 1;\r\n}", "function randomVideosAparicion(){\n $.ajax({url: \"Vista/random.html\", success: function(result){\n $(\"#contenido\").html(result);\n var videos_collection = [\n \"https://www.youtube.com/embed/ioOzsi9aHQQ\", \n \"https://www.youtube.com/embed/dQw4w9WgXcQ\",\n \"https://www.youtube.com/embed/bOsKJpCR9Fo\",\n \"https://www.youtube.com/embed/71Gt46aX9Z4\",\n \"https://www.youtube.com/embed/UiHmeHZAc0s\",\n \"https://www.youtube.com/embed/HzTlB-TjAzM\",\n \"https://www.youtube.com/embed/yyDUC1LUXSU\",\n \"https://www.youtube.com/embed/pBkHHoOIIn8\",\n \"https://www.youtube.com/embed/eAVl2cpFKyQ\",\n \"https://www.youtube.com/embed/H1KBHFXm2Bg\"\n ];\n var playerDiv = document.getElementById(\"random_player\");\n var player = document.createElement(\"IFRAME\");\n var randomVideoUrl = videos_collection[Math.floor(Math.random() * videos_collection.length)];\n player.setAttribute('class', 'embed-responsive-item');\n player.setAttribute('src', randomVideoUrl);\n playerDiv.appendChild(player);\n }});\n}", "function vidLoad1() {\n\tif (vidNum == 1) {\n\t vid1.play();\n\t\tvidNum = 2;\n\t\tchallenge = 1;\n\t}\n}", "function preload(){\n vid = createVideo(\"videos/2.mp4\");\n}", "function loadVideo() {\n $.getJSON(URL, options, function(data){\n console.log(data)\n var id = data.items[0].snippet.resourceId.videoId;\n mainVideo(id);\n resultsLoop(data);\n });\n }", "function playNextVideo() {\n if (firstTime) {\n loadPlaylist();\n firstTime = false;\n } else {\n if (currentVideoIndex >= playlistLength - 1) {\n playlistDone = true;\n }\n myPlayer.playlist.currentItem(currentVideoIndex);\n myPlayer.play();\n }\n currentVideoIndex += 1;\n }", "function onPlayerReady(event) {\n event.target.loadVideoById(link,0,'medium');\n event.target.playvideo();\n\t invokeAtIntervals();\n\n }", "function playRandomLocalMedia() {\n playLocalMedia(audioElement, Global.SOUNDS[Helper.getRandomInt(0, Global.SOUNDS.length)]);\n }", "function loadNextVid(vidID) {\n console.log('[DEBUG] playNextVid function called.');\n console.log('[DEBUG] vidID value received: ' + vidID);\n \n console.log('[DEBUG] Setting paths...');\n let pathWebm = 'https://s3.eu-west-2.amazonaws.com/test-card-data/videos/webm/' + vidID + '.webm';\n let pathMP4 = 'https://s3.eu-west-2.amazonaws.com/test-card-data/videos/mp4/' + vidID + '.mp4';\n let pathOgg = 'https://s3.eu-west-2.amazonaws.com/test-card-data/videos/ogv/' + vidID + '.ogv';\n // let pathAttributions = 'https://s3.eu-west-2.amazonaws.com/test-card-data/metadata/vtt/' + vidID + '.vtt';\n \n console.log('[DEBUG] pathWebm = ' + pathWebm);\n console.log('[DEBUG] pathMP4 = ' + pathMP4);\n console.log('[DEBUG] pathOgg = ' + pathOgg);\n \n \n console.log('[DEBUG] Setting sources...');\n // Stop the vid, load the next one, then play.\n videoPlayer.pause();\n videoSourceWebm.setAttribute('src', pathWebm);\n videoSourceMP4.setAttribute('src', pathMP4);\n videoSourceOgg.setAttribute('src', pathOgg);\n // videoAttributions.setAttribute('src', pathAttributions);\n videoPlayer.load();\n console.log('[DEBUG] Done.');\n}", "function playPreviousVideo() {\n \tsocket.emit('playPreviousVideo', {myroom: myRoom, controlkey: getControlHash(), currentID: currentPlayingVideoID });\n }", "function loadVideoId() {\n\tif (window.localStorage.getItem(\"videoId\")) {\n\t\tplayer.loadVideoById({videoId:window.localStorage.getItem(\"videoId\")});\n\t} else {\n\t\tplayer.loadVideoById({videoId:\"yCChR2HgCgc\"});\n\t}\n}", "function playVideo() { \n myVideo.play(); \n return false;\n }", "function _loadVideo() {\n _loadVideo = _asyncToGenerator(\n /*#__PURE__*/\n regeneratorRuntime.mark(function _callee3() {\n var video;\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return setupCamera();\n\n case 2:\n video = _context3.sent;\n video.play();\n return _context3.abrupt(\"return\", video);\n\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n return _loadVideo.apply(this, arguments);\n}", "function PickNewVideo(iVideoInfo, iAutoPlay, iQuote, iPageObjectIds)\r\r\n{\r\r\n DebugLn(\"PickNewVideo\");\r\r\n if (isObject(iVideoInfo))\r\r\n {\r\r\n DebugLn(\"iVideoInfo.Description = \" + iVideoInfo.Description);\r\r\n DebugLn(\"iVideoInfo.Link = \" + iVideoInfo.Link);\r\r\n \r\r\n if (iVideoInfo.Link && \r\r\n iVideoInfo.Link.length > 0)\r\r\n {\r\r\n pageObjectIds = {VideoDiv: \"VideoDiv\", \r\r\n NamePar: \"VideoName\", \r\r\n DescPar: \"VideoDesc\"};\r\r\n \r\r\n if (isObject(iPageObjectIds))\r\r\n {\r\r\n if (StringLength(iPageObjectIds.VideoDiv) > 0)\r\r\n pageObjectIds.VideoDiv = iPageObjectIds.VideoDiv;\r\r\n if (StringLength(iPageObjectIds.NamePar) > 0)\r\r\n pageObjectIds.NamePar = iPageObjectIds.NamePar;\r\r\n if (StringLength(iPageObjectIds.DescPar) > 0)\r\r\n pageObjectIds.DescPar = iPageObjectIds.DescPar;\r\r\n }\r\r\n \r\r\n // Reset video division\r\r\n SetElementHtml(pageObjectIds.VideoDiv,LoadingHtml());\r\r\n\r\r\n // Set video link \r\r\n DebugLn(\"iVideoInfo.AudioPlayer = \" + iVideoInfo.AudioPlayer);\r\r\n videoLink = iVideoInfo.Link;\r\r\n if (StringLength(iVideoInfo.AudioPlayer) > 0)\r\r\n {\r\r\n videoLink = iVideoInfo.AudioPlayer;\r\r\n }\r\r\n DebugLn(\"videoLink = \" + videoLink);\r\r\n\r\r\n // Put video on page.\r\r\n var so = new SWFObject(videoLink, \"VideoEmbed\", \"425\", \"355\", \"9\", \"#6f7a9e\");\r\r\n if (so)\r\r\n {\r\r\n DebugLn(\"Have swf object.\");\r\r\n\r\r\n if (iVideoInfo.Attribute)\r\r\n\t{\r\r\n DebugLn(\"iVideoInfo.Attribute.length = \" + iVideoInfo.Attribute.length);\r\r\n for (iiAtt=0; iiAtt<iVideoInfo.Attribute.length; iiAtt++)\r\r\n {\r\r\n DebugLn('iiAtt = ' + iiAtt + \": \" + \r\r\n iVideoInfo.Attribute[iiAtt].Name + \" = \" + iVideoInfo.Attribute[iiAtt].Value);\r\r\n so.addVariable(iVideoInfo.Attribute[iiAtt].Name, iVideoInfo.Attribute[iiAtt].Value);\r\r\n }\r\r\n\t}\r\r\n\r\r\n if (iAutoPlay)\r\r\n so.addVariable(\"autoplay\", 1);\r\r\n\r\r\n if (StringLength(iVideoInfo.AudioPlayer) > 0)\r\r\n so.addVariable(\"playlist_url\", iVideoInfo.Link);\r\r\n\r\r\n swfHtml = so.getSWFHTML();\r\r\n if (swfHtml && \r\r\n swfHtml.length > 0)\r\r\n\t{\r\r\n DebugLn(\"swfHtml = \" + swfHtml.replace(/</, \"@\"));\r\r\n SetElementHtml(pageObjectIds.VideoDiv,swfHtml);\r\r\n //so.write(pageObjectIds.VideoDiv);\r\r\n }\r\r\n else\r\r\n {\r\r\n SetElementHtml(pageObjectIds.VideoDiv,BadFlashErrorHtml());\r\r\n }\r\r\n }\r\r\n else\r\r\n {\r\r\n SetElementHtml(pageObjectIds.VideoDiv,JavascriptErrorHtml());\r\r\n }\r\r\n\r\r\n // Put name with video.\r\r\n videoName = iVideoInfo.Name;\r\r\n DebugLn(\"videoName = \" + videoName);\r\r\n SetElementHtml(pageObjectIds.NamePar, videoName);\r\r\n \r\r\n // Put description with video.\r\r\n videoDesc = \"\";\r\r\n if (StringLength(iVideoInfo.Description) > 0)\r\r\n {\r\r\n videoDesc = iVideoInfo.Description;\r\r\n if (iQuote)\r\r\n videoDesc = '\"' + videoDesc +'\"';\r\r\n else\r\r\n videoDesc = videoDesc;\r\r\n }\r\r\n else if (StringLength(iVideoInfo.Date) > 0)\r\r\n {\r\r\n if (StringLength(iVideoInfo.Number) > 0)\r\r\n videoDesc += \"Message \" + iVideoInfo.Number;\r\r\n videoDesc += \"<br/>\" + iVideoInfo.Date;\r\r\n if (StringLength(iVideoInfo.Speaker) > 0)\r\r\n videoDesc += \"<br/>\" + iVideoInfo.Speaker;\r\r\n }\r\r\n DebugLn(\"videoDesc = \" + videoDesc);\r\r\n SetElementHtml(pageObjectIds.DescPar, videoDesc);\r\r\n }\r\r\n }\r\r\n}", "function _loadVideo(num) {\n\tvid = document.createElement('video');\n\tif(CivicSeed.ENVIRONMENT === 'development') {\n\t\tvid.src = Modernizr.video.h264 ? _videoPath + num + '.mp4' :\n\t\t\t_videoPath + i + '.webm?VERSION=' + Math.round(Math.random(1) * 1000000000);\n\t} else {\n\t\tvid.src = Modernizr.video.h264 ? _videoPath + num + '.mp4?VERSION=' + CivicSeed.VERSION:\n\t\t\t_videoPath + i + '.webm?VERSION=' + CivicSeed.VERSION;\n\t}\n\n\tvid.load();\n\tvid.className = 'cutScene';\n\tvid.addEventListener('canplaythrough', function (e) {\n\t\tthis.removeEventListener('canplaythrough', arguments.callee, false);\n\t\t_cutSceneVids.push(vid);\n\t\tnum += 1;\n\t\tif(num < _numVideos) {\n\t\t\t_loadVideo(num);\n\t\t}\n\t},false);\n\tvid.addEventListener('error', function (e) {\n\t\tconsole.log('vid error');\n\t}, false);\n}", "function onPlayerReady() {\r\n player.playVideo();\r\n /*let time = player.getCurrentTime();\r\n if(player.stopVideo()){\r\n let time2 = player.getCurrentTime();\r\n \r\n player.playVideo(time2);\r\n }*/\r\n \r\n }", "function loadVideo() {\n console.log(\"loading \" + flow[currentIndex].link + \" into iframe0\");\n document.getElementById(\"iframe0\").src = \"https://www.youtube.com/embed/\" + flow[currentIndex].link + \"?rel=0\";\n}", "function vidLoad() {\n\tvid.noLoop();\n}", "function loadVideo(videoIndex) {\n var videoSrc = VIDEOS[videoIndex][1];\n $(\".main-video-source\").attr(\"src\", videoSrc);\n $(\".main-video\").get(0).load();\n}", "function videoSoundSampler1Loader(){\n blobVideoLoad(0, 5, \"gore.mp4\", true, {'postLoadFunc': () => 5});\n videoUploadResponder = function(videoFile){\n var blobURL = URL.createObjectURL(videoFile);\n var oldVid = videos[0];\n // videos[0].pause(); //todo - delete the underlying video element to free memory\n createVideoElement(blobURL, 0, 5, true);\n oldVid.pause();\n URL.revokeObjectURL(oldVid.src);\n oldVid.removeAttribute(\"src\");\n oldVid.load();\n\n }\n var deviations = arrayOf(1000).map((elem, i) => i + Math.random());\n var baseInd = 0;\n var moveDownNote = 48;\n var moveUpNote = 48 + 24;\n var midiNoteFunction = function(note, vel){\n if(note == moveDownNote) baseInd = Math.max(baseInd-1, 0);\n else if(note == moveUpNote) baseInd++;\n else videos[0].currentTime = deviations[baseInd + (note-37)];\n } \n midiEventHandlers[\"on\"] = midiNoteFunction;\n}", "function nextRandomMusic(){ \n\t\n\tvar siguiente = Math.floor(Math.random() * canciones.length)// random number\n\t\n\tremoveActive()\n\tvar item=document.getElementById(siguiente)\n\titem.classList.add(\"active\");\n\tloadMusic(canciones[siguiente]);\n\tplayer.play()\n\tindiceActual[0] = siguiente\n\treproduccionActual(\"Playing: \"+ canciones[siguiente])\n\tclassIconPlay()\n}", "function loadVideo(){\n var iframe = document.createElement(\"iframe\"); // Create an iFrame with autoplay set to true\n var startTime = $(this).parent().attr('start-time');\n var video_id = $(this).parent().attr('data-id');\n iframe.setAttribute(\"src\", \"//www.youtube.com/embed/\" + video_id + \"?start=\" + startTime + \"&autoplay=1&autohide=2&border=0&wmode=opaque&enablejsapi=1&controls=1&showinfo=0&rel=0\"); // Grab the video_id and startTime parameters from the server's (getVideos.php) response to the POST request\n iframe.setAttribute(\"frameborder\", \"0\");\n iframe.setAttribute(\"id\", \"youtube-iframe\");\n this.parentNode.replaceChild(iframe, this); // Replace the YouTube thumbnail with YouTube HTML5 Player\n }", "playF() {\n const randNum = Math.floor(Math.random() * this.soundList.length);\n\n console.log(randNum);\n this.__audio.src = this.soundList[randNum];\n this.__audio.play();\n }", "function onPlayerStateChange(event) {\n if (event.data == YT.PlayerState.ENDED) {\n if (musicLoop === true) {\n player.seekTo(0, true);\n } else if (musicRandom === true) {\n let random = 0;\n do {\n random = Math.floor(Math.random() * videoIdList.length);\n console.log(random)\n } while (currentMusicIndex === random)\n console.log(random);\n viewChange(currentMusicIndex, random);\n currentMusicIndex = random;\n videoChange(videoIdList[currentMusicIndex]);\n } else {\n currentMusicIndex++;\n if (currentIndexCheck(currentIndexCheck)) {\n viewChange(currentMusicIndex-1, currentMusicIndex);\n videoChange(videoIdList[currentMusicIndex]);\n }\n }\n\n\n }\n if (event.data == YT.PlayerState.PAUSED) {\n }\n}", "function onPlayerReady(evt) {\n\tevt.target.playVideo();\n\tsetTimeout(setShuffleFunction, 1000); \n}", "function firstPlay() {\r\n document.getElementsByTagName(\"video\")[0].innerHTML =\r\n '<source id=\"mp4\" src=\"' +\r\n movieInfo[0].src +\r\n '\" type=\"video/mp4\">' +\r\n '<source id=\"ogg\" src=\"' +\r\n movieInfo[0].src.substring(0, movieInfo[0].src.length - 3) +\r\n 'ogg\" type=\"video/ogg\">' +\r\n \"<h4>Your browser does not support the video tag.</h4>\";\r\n}", "function playVid(){\n const vidName = getCookieValue(\"video_name\");\n const type = getCookieValue(\"video_type\");\n try{\n playVideo(vidName,type);\n }\n catch(err){\n if(err == \"fileError\"){\n skip();\n }\n }\n}", "function playnext(){\n document.getElementById(\"vtc\").innerHTML = \"Overclock your CPU with BIOS\";\n video.autoplay=\"autoplay\"; //autopaly second video after video1 fingished \n video.src=\"video/p2.mp4\"; //play second video\n }", "function onPlayerReady(event) {\n player.loadPlaylist(viewmodel.Hindivideolist());\n player.setShuffle(true);\n player.setLoop(true);\n //event.target.playVideo();\n}", "loadVideo(video) {\n\t // save activeVideo to localStorage.\n Storage.set('activeVideo', video);\n\n\t\tthis.player.loadVideoById({\n 'videoId': video.youtube_url,\n 'startSeconds': this.getVideoProgress(video),\n 'suggestedQuality': 'small'\n });\n\t\t\n this.trackVideoProgresss(video);\n\t}", "function playVideo(i) {\n currentVid[i].load();\n currentVid[i].play();\n currentVid[i].volume = 0.3;\n currentVid[i].loop = true;\n}", "function playVideo() {\n if (getPlayerPaused()) {\n editor.player[0].play();\n }\n}", "function vsgLoadVideo(vidURL, target, nextindex) {\n console.log('Load Video function'+target)\n vgsPlayer = cld.videoPlayer(target, {\n \"controls\": true,\n \"width\": 200,\n \"height\": 100\n });\n vgsPlayer.source(vidURL);\n vgsPlayer.posterOptions({ transformation: { effect: ['sepia'] } })\n vPlayer[nextindex]=vgsPlayer;\n }", "function playRandom() {\n var musicList = document.getElementsByClassName('play_this');\n \n var rand = Math.floor(Math.random() * musicList.length);\n \n while (player.getAttribute('src')\n && player.getAttribute('src') === musicList[rand].parentNode.parentNode.getAttribute('data-mpeg')) {\n rand = Math.floor(Math.random() * musicList.length);\n }\n \n setPlayerInfo(musicList[rand].parentNode.parentNode);\n playItem(musicList[rand].parentNode.parentNode);\n}", "function loadVideoSequence(){\r\n var $img = $(\".video-sequence\");\r\n var $imgStatic = $(\".video-static\");\r\n var downloadingImage = new Image();\r\n var timeout;\r\n\r\n downloadingImage.onload = function(){\r\n $img.attr(\"src\",this.src);\r\n $img.css(\"display\",\"block\");\r\n timeout = setTimeout(hideStatic,400);\r\n };\r\n\r\n downloadingImage.src = $img.attr(\"data-url\");\r\n\r\n function hideStatic(){\r\n $imgStatic.css(\"visibility\",\"hidden\");\r\n clearTimeout(timeout);\r\n }\r\n }", "function loadVideoPlayer(videoId){\n\t//console.log(\"currentVideoId: \" + currentVideoId + \"\\nvideoId: \" + videoId);\n\t\n\tif(videoId != currentVideoId){\n\t\tcreateNewPlayer(videoId);\n\t\tcurrentVideoId = videoId;\n\t}else{\n\t\tytPlayer.playVideo();\n\t}\n\t\n\t//console.log(\"UPDATED currentVideoId: \" + currentVideoId + \"\\nvideoId: \" + videoId);\n}", "function newGameVideo() {\n //light up the island for the first time\n}", "function startVideo($elm) {\n setTimeout(() => {\n var elm = $elm.find('video')[0];\n elm.play();\n }, 500);\n}", "function videoFunction(order){ // .load(), .play(), .pause(), .currentTime = x seconds\n try {\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n chrome.tabs.executeScript(tabs[0].id, {code: \"storedVideo{0};\".format(order)});\n });\n }catch(error){}\n}", "function changeVideo(videoFile){\n\tenableStillScreen = true;\n\tvar video = document.getElementById(\"Video1\"); \n\tif(soundEnabled){\n\t\t\n\t\t$(\"#videosrc\").attr(\"src\", videoDir+videoFile+videoExt);\n\t}\n\telse {\n\t\t$(\"#videosrc\").attr(\"src\", videoDir+videoFile+noAudioTag+videoExt);\n\t}\n\ttry {\n\t\tvideo.pause();\n\t\tvideo.load();\n\t\tsetTimeout(function() {video.play();}, 400); //Allows video to load and play without getting .play() errors\n\t}\n\tcatch(e){\n\t\tconsole.log(e);\n\t}\n\n}", "function playDB() {\n if (DB.loaded) {\n DB.start();\n if (frameCount % 30 == 0) console.log('playDB on');\n\n }\n}", "function playMovie(){\r\n mediaName = $(\"#MediaPlayer\").attr(\"title\") || \"USG Video\";\r\n if(!tempvar)\r\n {\r\n s.Media.open(mediaName,mediaLength,mediaPlayerName);\r\n tempvar=1\r\n }\r\n s.Media.play(mediaName,mediaOffset);\r\n}", "function runRandom(num, type) {\n //number value string convert into \" number\"\n var parseNum = parseInt(num)\n var flatMasterList = type===\"music\" ? musicMasterList.flat(): movieMasterList.flat()\n artistImage.empty()\n for (var i = 0; i < parseNum; i++) {\n var randomVideo = flatMasterList[Math.floor(Math.random() * flatMasterList.length)]\n console.log(randomVideo)\n var imgBox = $(\"<div>\")\n img = $(\"<img>\")\n img.attr(\"src\", randomVideo.artworkUrl100)\n img.attr(\"data-video\", randomVideo.previewUrl)\n img.attr(\"data-track\", randomVideo.trackName)\n img.attr(\"class\", \"artist-image\")\n imgBox.append(img)\n var para = $(\"<p>\")\n para.attr(\"class\", \"info\")\n para.text(formatName(randomVideo.trackName))\n imgBox.append(para)\n artistImage.append(imgBox)\n }\n artistImage.on(\"click\", img, playMusicVideo)\n}", "function nextVideo() {\n\tresetVideoControls();\n\n\t//display next video\n\tvar videoLoaded = loadVideo(getNextQuestion(questionCounter));\n//\tgetNextQuestion();\n\n\tdisplayButtons();\n\n\tif (videoLoaded == true) {\n\t\tdocument.getElementById(\"question-title\").innerHTML = questionCounter + \". \" + questionTitle;\n\t\tdocument.getElementById(\"video-frame\").src = questionURL + '?rel=0&autoplay=1';\n\t} else { //no more videos; display Goodbye screen\n\t\tloggedIn = false;\n\t\tdocument.getElementById(\"video-frame\").src = \"\";\n\t\tdocument.getElementById(\"content-prompt-english\").style.display = \"none\";\n\t\tdocument.getElementById(\"content-goodbye\").style.display = \"block\";\n\t}\n}", "function playMedia(videourl, mediaType) {\n var time = 0; //workaround\n for(var i=0; i<metadata.length; i++)\n {\n if(metadata[i].movieID == imgLink)\n {\n time = metadata[i].watchtime * currentMediaDuration;\n }\n }\n var videourl = \"http://192.168.43.140:8186/vid/playback.mp4\";\n var singleVideo = new MediaItem(mediaType, videourl);\n var videoList = new Playlist();\n videoList.push(singleVideo);\n var myPlayer = new Player();\n myPlayer.playlist = videoList;\n myPlayer.seekToTime(time);\n myPlayer.play();\n myPlayer.addEventListener(\"stateDidChange\", bookmarkEvent);\n}", "function vidLoad() {\n movie.loop();\n movie.volume(0);\n}", "function vidLoad() {\n movie.loop();\n movie.volume(0);\n}", "function playCurrentVideo() {\n \tisPlaying = true;\n \tvideo.playVideo();\n }", "function playVideo(array, index){\n\t\twindow.location.hash = array[index];\n\t\tvar player = $(\"#video-player\")[0];\n\t\tconsole.log(index);\n\t\tif(!player) {console.log(\"Video player hasn't loaded yet.\"); return;} //didn't load yet?\n\t\tcurrentVidArray = array;\n\t\tcurrentVidIndex = index;\n\t\tif(currentVidIndex == 0) dotcss(\"#video-browser-lt\").hide();\n\t\telse dotcss(\"#video-browser-lt\").show().display(\"table\");\n\t\tif(currentVidIndex == currentVidArray.length - 1) dotcss(\"#video-browser-gt\").hide();\n\t\telse dotcss(\"#video-browser-gt\").show().display(\"table\");\n\t\tplayer.src = \"https://www.youtube.com/embed/\" + array[index] ;//+ \"?autoplay=1\";\n\t\tif (!overlayon) dotcss(\"#absolute-video-player-container\").fadeIn();\n\n\t\tif (bodyOverflow === null) bodyOverflow = document.body.style.overflow;\n\t\tif (bodyOverflowX === null) bodyOverflowX = document.body.style.overflowX;\n\t\tif (bodyOverflowY === null) bodyOverflowY = document.body.style.overflowY;\n\t\tdocument.body.style.overflow = \"hidden\";\n\t\tdocument.body.style.overflowX = \"hidden\";\n\t\tdocument.body.style.overflowY = \"hidden\";\n\t\toverlayon = true;\n\t}", "loadPlyr() {\n const nextCueTime = '';\n this.videoDataPromise.then((json) => {\n if (!json) {\n this.onError('loadPlyr json', 'No video data has been found!');\n return;\n }\n\n // Create the HTML5 video element.\n const videoElement = document.createElement('video');\n videoElement.setAttribute('controls', 'true');\n videoElement.setAttribute('crossorigin', 'true');\n videoElement.setAttribute('playsinline', 'true');\n videoElement.setAttribute('type', (json.files && json.files.length > 0) ? json.files[json.files.length - 1].type : 'video/mp4');\n videoElement.setAttribute('autoplay', 'true');\n videoElement.setAttribute('class', 'source');\n videoElement.poster = this.posterUrl;\n videoElement.id = 'plyr__tubia';\n \n // Todo: If files (transcoded videos) doesn't exist we must load the raw video file.\n // Todo: However, currently the raw files are in the wrong google project and not served from a CDN, so expensive!\n const source = (json.files && json.files.length > 0) ? json.files[json.files.length - 1].linkSecure : `https://storage.googleapis.com/vooxe_eu/vids/default/${json.detail[0].mediaURL}`;\n const sourceUrl = source.replace(/^http:\\/\\//i, 'https://');\n const sourceType = videoElement.type;\n const gameUrl = this.options.url;\n\n videoElement.src = sourceUrl;\n\n const { detail } = json;\n \n if (this.storage.supported) {\n localStorage.setItem('defaultVideo',JSON.stringify({\n url: sourceUrl,\n type: sourceType,\n videoTitle: detail[0].title,\n gameUrl }));\n }\n \n\n // videoElement.appendChild(videoSource);\n this.container.appendChild(videoElement);\n\n // Create the video player.\n const controls = [\n 'logo',\n 'play-large',\n 'title',\n 'progress',\n 'current-time',\n 'duration',\n 'play',\n 'mute',\n 'fullscreen',\n ];\n\n // Setup the playlist.\n const playlist = {\n active: false,\n type: (json.playlistType) ? json.playlistType : 'cue',\n data: json.cuepoints,\n };\n\n // Setup the morevideos.\n const morevideos = {\n active: true,\n type: json.playlistType ? json.playlistType : 'cue',\n data: json.relatedVideos,\n };\n\n // Setup the share\n // eslint-disable-next-line no-unused-vars\n const share = {\n active: true,\n };\n\n // We don't want certain options when our view is too small.\n if ((this.container.offsetWidth >= 400)\n && (!/Mobi/.test(navigator.userAgent))) {\n controls.push('volume');\n controls.push('settings');\n // controls.push('captions');\n controls.push('pip');\n controls.push('share');\n }\n\n // Check if we want a playlist.\n if (json.cuepoints && json.cuepoints.length > 0) {\n controls.push('playlist');\n controls.push('morevideos');\n }\n\n const {magicvideo} = this.options;\n\n\n // Create the Plyr instance.\n this.player = new Plyr('#plyr__tubia', {\n debug: this.options.debug,\n iconUrl: './libs/gd/sprite.svg',\n title: (json.detail && json.detail.length > 0) ? json.detail[0].title : '',\n logo: (json.logoEnabled) ? json.logoEnabled : false,\n showPosterOnEnd: true,\n hideControls: (!/Android/.test(navigator.userAgent)), // Hide on Android devices.\n ads: {\n enabled: (json.adsEnabled) ? json.adsEnabled : true,\n headerBidding: true,\n prerollEnabled: (json.preRollEnabled) ? json.preRollEnabled : true,\n midrollEnabled: (json.subBannerEnabled) ? json.subBannerEnabled : true,\n // Todo: Test with 1 minute something video midroll interval.\n // videoInterval: 60, // (json.preRollSecond) ? json.preRollSecond : 300,\n // overlayInterval: (json.subBannerSecond) ? json.subBannerSecond : 15,\n gdprTargeting: this.options.gdprTargeting,\n tag: (json.adsEnabled && !json.addFreeActive) || this.options.debug ? this.adTag : '',\n tagLegacy: (json.adsEnabled && !json.addFreeActive) || this.options.debug ? this.adTagLegacy : '',\n keys: this.options.keys ? JSON.stringify(this.options.keys) : null,\n domain: this.options.domain,\n category: this.options.category,\n },\n keyboard: {\n global: true,\n },\n tooltips: {\n seek: true,\n controls: false,\n },\n captions: {\n active: false,\n },\n fullscreen: {\n enabled: (json.fullScreenEnabled) ? json.fullScreenEnabled : true,\n },\n duration: null,\n seekTime: nextCueTime,\n playlist,\n morevideos,\n share: true,\n controls,\n magicvideo,\n });\n\n // Set some listeners.\n this.player.on('ready', () => {\n // Start transition towards showing the player.\n if (this.options.lottie) {\n this.animationElement.classList.toggle('tubia__active');\n } else {\n this.transitionElement.classList.toggle('tubia__active');\n }\n \n setTimeout(() => {\n // Hide our spinner loader.\n this.hexagonLoader.classList.toggle('tubia__active');\n }, this.transitionSpeed / 2);\n\n \n // Return ready callback for our clients.\n try {\n parent.postMessage({ name: 'onReady' }, this.origin);\n } catch (postMessageError) {\n console.error(postMessageError);\n }\n\n // Record Tubia \"Video Play\" event in Tunnl.\n (new Image()).src = `https://ana.tunnl.com/event?tub_id=${this.videoId}&eventtype=1&page_url=${encodeURIComponent(this.options.url)}`;\n });\n\n this.player.on('error', (error) => {\n this.onError('loadPlyr player', error);\n });\n\n this.player.on('adsclick', () => {\n try {\n /* eslint-disable */\n window['_cc13997'].bcpw('act', 'ad click');\n /* eslint-enable */\n } catch (error) {\n // No need to throw an error or log. It's just Lotame.\n }\n });\n\n this.player.on('adscomplete', () => {\n try {\n /* eslint-disable */\n window['_cc13997'].bcpw('act', 'ad complete');\n /* eslint-enable */\n } catch (error) {\n // No need to throw an error or log. It's just Lotame.\n }\n });\n\n this.player.on('adsimpression', () => {\n try {\n /* eslint-disable */\n window['_cc13997'].bcpw('genp', 'ad video');\n window['_cc13997'].bcpw('act', 'ad impression');\n /* eslint-enable */\n } catch (error) {\n // No need to throw an error or log. It's just Lotame.\n }\n });\n\n this.player.on('adsskipped', () => {\n try {\n /* eslint-disable */\n window['_cc13997'].bcpw('act', 'ad skipped');\n /* eslint-enable */\n } catch (error) {\n // No need to throw an error or log. It's just Lotame.\n }\n });\n }).catch(error => {\n this.onError('loadPlyr videoDataPromise', error);\n });\n }", "function playVideo() { \n\t\t$(\"#index-vid-a\").removeClass(\"hidden\"); \n\t \t$(\"#vid-pic\").css('display', 'none');\n\t \t$(\"#index-vid-b\").css('display', 'none');\n\t \tvar vid = $(\"#index-vid-a\");\n\t vid.controls = false;\n\t vid.load();\n\t vid.on('ended',function(){\n\t \t$(vid).css('display', 'none');\n\t\t\t$(\"#index-vid-b\").css('display', 'inline-block');\n\t\t\tvar vidb = $(\"#index-vid-b\");\n\t\t\tvidb.controls = false;\n\t \tvidb.load();\n\t \tvidb.on('ended',function(){ \n\t \t\t\t$(vidb).css('display', 'none');\n\t\t\t\t$(\"#vid-pic\").css('display', 'inline-block');\n\t\t\t});\n\t}); \n\n\t}", "function play(e){\n var id = e.id;\n var arr = byId(\"i\"+id ).value.split(\";\");\n \n // var jsonObj = JSON.parse(jsonStr);\n $(\"#h1\").html(id);\n $(\"#list\").hide();\n $(\"#video\").show();\n \n //config the video tag property\n $(\"#video\").attr({\n \"src\":arr[0],\n \"controls\":true,\n \"loop\":true,\n \"autoplay\":true,\n \"type\":arr[1]\n });\n}", "playRandomBgMusic() {\n this.bgmusic[Math.floor(Math.random() * this.bgmusic.length)].play();\n }", "function loadMusic(){\n srcPlayer.src = pathMusic + musics[countMusic] + extMusic;\n player.load();\n\n if(musics[countMusic] == 'mana_feat_jorge_e_matheus-voce_e_minha_religiao'){\n player.currentTime = 14;\n }\n }", "function getStartVideoFuntion(src) {\n var mus = document.getElementById(\"musicplayr\");\n mus.src = src;\n mus.play();\n advertisementpayment();\n }", "play() {\n this.video.play();\n }", "function playerControler() {\n var video = document.getElementById(\"Videotv\");\n var image = document.getElementById(\"Imagetv\");\n var count =0; // conta os elementos\n var toplay; //guarda o url do item a reproduzir :)\n var value = 4;\n var playlistsize = $(\"#playlistsize\").val();\n playlist = String($(\"#playlist\").val()).split(\";\");\n for(var i=0;i<playlistsize;i++){\n if($(\"#nextmultimedia\").val()==playlistsize || $(\"#nextmultimedia\").val()==0){\n $(\"#nextmultimedia\").val(1);\n toplay = playlist[1];\n break;\n }else{\n if(count==$(\"#nextmultimedia\").val() && $(\"#nextmultimedia\").val()<playlistsize){\n toplay = playlist[value-3];\n $(\"#nextmultimedia\").val(count+1);\n break;\n }\n }\n value=value+4;\n count++;\n }\n if(playlist[value-2]=='video'){\n $('#Imagetv').hide();\n $(\"#Videotv\").show();\n video.src = toplay;\n video.play();\n videoManager();\n }else if(playlist[value-2]=='image'){\n $(\"#Videotv\").hide();\n $('#Imagetv').show();\n $('#targetTime').val(playlist[value-1]);\n image.src = toplay;\n startImageTime();\n }\n}", "function spawnAllVideos() {\n createVideo(new THREE.Vector3(0,0,0), \"field\", \"edited\");\n}", "function loadVideo(video) {\n\tvideoPlayer.src = \"footage/\" + video;\n\tvideoPlayer.load();\n\t\n\t/*changes the pause back to play when new video is clicked*/\n\tvar button = document.getElementById(\"play-pause-btn\");\n\tchangeButton(button,\"&#9654;\");\n\t\n\t/*splits the fileName and the file tag with '.' .split creates an array*/\n\tvar fileName = video.split('.');\n\t\n\t/*calls the folder posters + a specific fileName [which is an array] + jpg extension*/\n\tvideoPlayer.poster = \"posters/\" + fileName[0] + \".jpg\";\n}", "function switchToVideo(index) {\n\tnewmarkup = '<object width=\"425\" height=\"350\" id=\"playing-video-object\"><param name=\"movie\" value=\"http://www.youtube.com/v/';\n\tnewmarkup += vid_array[index];\n\tnewmarkup += '&autoplay=1&loop=1\" >\t</param>\t<param name=\"wmode\" value=\"transparent\">\t</param>\t<embed src=\"http://www.youtube.com/v/';\n\tnewmarkup += vid_array[index];\n\tnewmarkup += '&autoplay=1&loop=1\" \ttype=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\" ></embed></object>'\n\t$('#playing-video-object').replaceWith(newmarkup);\n\tchangeVideoNumber(index);\n\tswitchToPage(determinePageNumber(index));\n\tchangeNowPlaying(index);\n\tcurrent_video = index;\n}", "loadVideo() {\r\n if (!this.state.loaded || !this.props.playlist || !this.props.playlist.length) return;\r\n else this.setState({ empty: false });\r\n \r\n this.state.player.loadVideoById({\r\n 'videoId': this.props.playlist[0].url,\r\n 'startSeconds': 0\r\n });\r\n }", "selectVideo() {\n\n // allow hash fragment to intercept on init\n this.getVideoIdFromHash();\n\n //==================================================\n // VARS\n //==================================================\n\n var payload;\n var video_obj = this.feed[this.selectedTimeIndex];\n var isLiveOnInit = this.feedType == 'live' && !this.firstRun;\n\n //==================================================\n // WHEN LIVE AND INIT\n //==================================================\n\n if (isLiveOnInit) {\n log('IS LIVE ON INIT');\n bus.$emit('initPlayer', 'limitDuration');\n\n payload = {\n stream: this.liveStreamPlaylist, // !! WARNING !! - stream doesn't work, only playlist\n image: this.liveStreamImage\n }\n\n } else {\n //==================================================\n // WHEN REPLAY\n //==================================================\n\n if (this.feedType == 'live') {\n return; // live no longer switches video\n }\n\n // this.feedType = 'replay'; // set the tabs\n if (!this.firstRun) bus.$emit('initPlayer');\n\n try {\n payload = {\n stream: video_obj.video_url.replace(/^http:\\/\\//i, 'https://'),\n image: video_obj.image_url.replace(/^http:\\/\\//i, 'https://'), // TODO: video_obj.video_url ??\n format: 'mp4'\n }\n }\n catch(error) {\n payload = {\n stream: '.mp4',\n image: '.jpg',\n format: 'mp4'\n }\n }\n }\n //==================================================\n // GOOGLE TRACKING\n //==================================================\n\n if (this.feed && this.firstRun) this.sendTracking(video_obj); // can't report on video_url if LIVE init, or no feed\n\n //==================================================\n // LOAD VIDEO AFTER INIT\n //==================================================\n\n log('>> firstRun is true');\n this.firstRun = true;\n bus.$emit('loadVideo', payload);\n }", "function reloadVideo() {\n let icon = playbtn.querySelector('.video-ctrl-bt');\n video.load();\n pauseToPlayBtn(icon);\n videobtn.style.display = 'block';\n videotime.innerHTML = '0:00 / '+videoduration;\n removeVideoListeners();\n videoCtrlTl.reverse();\n videoPlaying = false;\n progressbar.style.width = null;\n }", "function onPlayerReady(event) {\n Controller.load_video();\n }", "function loadVideo(playingVideoCount, updateCurrentCount) {\n var currentVideo = PLAYERCONFIG.videosList[playingVideoCount].resourceId.videoId;\n player.loadVideoById(currentVideo, 0, PLAYERCONFIG.quality);\n updateInfo(playingVideoCount);\n updateCurrentTime();\n if (updateCurrentCount) {\n PLAYERCONFIG.playingVideoCount = playingVideoCount;\n }\n window.onkeydown = keyboardControl;\n }", "function resetVid(data){\n\n myPlayer.currentTime(0);\n myPlayer.loop(true);\n myPlayer.play();\n console.log(\"video reset \");\n\n\n}", "function btnComenzar() {\n vid.currentTime = 0;\n vid.play();\n}", "play(view){\n\n\t\tvar possible_moves = view.getMoves();\n\t\tvar max = possible_moves.length;\n\t\tvar i = Math.floor(Math.random() * max);\n\t\treturn possible_moves[i].toString();\n\t}", "function onPlayerReady(event) {\n\n\tloadVideoId();\n\tevent.target.playVideo();\n\n}", "function pickQuickLook(){\n\tresetVideoTimeouts();\n\tdocument.getElementById(\"currVideo\").src='http://www.giantbomb.com/videos/embed/' + quickLooks[currentVideoIndex].split('~')[0] + '/';\n\tdocument.getElementById(\"VideoTitle\").innerHTML=quickLooks[currentVideoIndex].split('~')[1];\n\tvideoGBLink=quickLooks[currentVideoIndex].split('~')[2];\n}", "function loadAndplayNextVideo(operation) {\n\n myVideo.pause();\n // myVideo.currentTime = 0;\n // myVideo.poster='';\n\n if(operation === 'next') {\n currentPlaylistID++;\n // If we haven't proloaded song or audio convertion is running at this moment\n if(nextPreloadedID === 0 || audioConvertionRunning === true) {\n pathToTempAudioFile = null; // We ignore the result of audio convertion\n getNextVideoID(0, 'next', false);\n } else {\n loadNextVideo(nextPreloadedID);\n nextPreloadedID = 0;\n }\n }\n\n if(operation === 'prev') {\n pathToTempAudioFile = null; // We ignore the result of audio convertion\n getNextVideoID(0, 'prev', false);\n }\n\n // myVideo.play();\n\n}", "function loadPage() {\n getRandomVideo(false);\n setTimeout(function() {\n loadSidebar();\n stopLogo();\n loadScreen();\n }, 500);\n}", "function changeVideo(eventTitle){\n $('#player').show();\n // console.log(eventTitle);\n var API_KEY = \"AIzaSyBDl0SaDnpnhP7TrxEnPAaXKFIKWHQuUoA\";\n var q = eventTitle;\n var part = \"snippet\";\n var type = \"video\";\n var baseURL = \"https://www.googleapis.com/youtube/v3/search\";\n var numberResults = \"2\";\n var queryURL = baseURL + \"?\" + \"part=\" + part + \"&q=\" + q + \"&type=\" + type + \"&maxResults=\" + numberResults +\"&key=\" + API_KEY;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n var videoToPlay = response.items[0].id.videoId;\n // console.log(videoToPlay);\n player.loadVideoById(videoToPlay);\n });\n}", "function loadVideo(vidFile){\nframes['videoLaunch'].location.href = vidFile;\n}", "function loadVideo(){\n\tvar videoHolder = document.getElementById('videoRowContainer');\n\tsetFilmSize();\n\tvar movie = document.getElementById('fullFilm').getAttribute('value');\n\tvar video = \"<video id='videoPlayer' class='video-js vjs-default-skin' controls preload='auto' \\\n\t\twidth='\" + screenWidth + \"' height='\" + screenHeight + \"' data-setup='{}' style='\\\n\t\tfloat:none;margin:0 auto;'><source src='movies/\" + movie + \"' type='video/mp4'></video>\";\n\tvideoHolder.innerHTML = video;\n}", "function pauseVideo_01() { \r\n var video = \"video/PSICOALIANZA_SITP_Testimonial_evaluación_psicotécnica.mp4\";\r\n $(\"#video-01\").attr(\"src\",\"\");\r\n $(\"#video-01\").attr(\"src\",video);\r\n}", "function play() {\n\tcomputeNextGen();\n\n\tif (playing) {\n\t\ttimer = setTimeout(play, reproductionTime);\n\t}\n}", "function piloteVideo4() {\r\n\t\tif (LGDM.paused) {\r\n\t\t\tLGDM.play();\r\n \r\n\t\t} else {\r\n\t\t\tLGDM.pause();}\r\n }", "next() {\n this.currentVidIdx++\n\n if (this.currentVidIdx < this.vidCount) {\n this.currentVidIdx + 1\n } else {\n this.currentVidIdx = 0\n }\n this.loadVid(this.playlist[this.currentVidIdx])\n }", "function prevRandomMusic(){ \n\n\tvar siguiente = Math.floor(Math.random() * canciones.length)// random number\n\n\t\n\tremoveActive()\n\tvar item=document.getElementById(anterior)\n\titem.classList.add(\"active\");\n\tloadMusic(canciones[anterior]);\n\tplayer.play()\n\tindiceActual[0]= anterior\n\treproduccionActual(\"Reproduciendo: \"+ canciones[anterior])\n\tclassIconPlay()\n}", "function onClick() {\n videoPrimary.src = this.src;\n }", "function LoadVideo() {\n // TODO: check if browser supports video properly\n if (window.innerWidth >= videoOwnHeight) {\n // Create elements\n const source = document.createElement('source');\n const webm = source.cloneNode(true);\n const mp4 = source.cloneNode(true);\n\n // add needed attr's\n webm.src = 'http://techslides.com/demos/sample-videos/small.webm';\n webm.type = 'video/webm';\n\n mp4.src = 'http://www.w3schools.com/html/mov_bbb.mp4';\n mp4.type = 'video/mp4';\n\n // append them to the video\n video.appendChild(webm);\n video.appendChild(mp4);\n }\n\n // Checks or the video needs to be looped\n video.ontimeupdate = function() {\n if ( !clicked && video.currentTime >= loopEnd ) {\n video.currentTime = loopStart;\n }\n };\n\n playButton.addEventListener('click', playVideo);\n}", "function loadVideo(){\n\t\tvar myKey = 'AIzaSyB8DNIkjWjz5kOXkGsYIl4zzLNy6-S481I',\n\t\t\tmaxResults = 10,\n\t\t\torder = 'date',\n\t\t\ttype = 'video',\n\t\t\tvideoCaption = 'any',\n\t\t\tvideoCategoryId = 24,\n\t\t\tq = 'movie teaser',\n\t\t\tvideoEmbeddable = true;\n\n\t\tvar request = 'https://www.googleapis.com/youtube/v3/search?part=snippet&q=' + q + '&maxResults=' + maxResults + '&type=' + type + '&videoCaption=' + videoCaption + '&videoCategoryId=' + videoCategoryId + '&videoEmbeddable=' + videoEmbeddable + '&key=' + myKey;\n\n\t\t$.ajax({\n\t\t\turl: request,\n\t\t\tsuccess:function(data){\n\t\t\t\t// handle data from your request here\n\t\t\t\t//data.items[0].videoId\n\t\t\t\tvideoArray = data.items;\n\t\t\t\tplayVideo();\n\n\t\t\t}\n\t\t});\n\t}", "function vinCall() {\n var RandomNumber = Math.floor((Math.random() * vinDiesel.length - 1) + 1);\n var RandomMovie = vinDiesel[RandomNumber];\n\n $.getJSON('https://www.omdbapi.com/?t=' + encodeURI(RandomMovie) + '&h=600&apikey=454a6e93').then(function (response) {\n var image = response.Poster;\n\n if (image !== \"N/A\") {\n $('#dieselBack').attr('src', image);\n }\n\n });\n}" ]
[ "0.80678636", "0.74212265", "0.70521593", "0.7022632", "0.69177896", "0.6802676", "0.6769939", "0.6706158", "0.6604302", "0.65690494", "0.6548848", "0.6524858", "0.6448494", "0.64463836", "0.64373994", "0.6415446", "0.6414211", "0.64039516", "0.6397536", "0.6356651", "0.6278354", "0.62635255", "0.6235361", "0.6213168", "0.6198316", "0.61810464", "0.6158082", "0.61563766", "0.61559373", "0.61487895", "0.6146435", "0.61440116", "0.6134658", "0.61344916", "0.61302567", "0.61299694", "0.61232966", "0.61157936", "0.610988", "0.60907745", "0.6067326", "0.606033", "0.60594964", "0.60573256", "0.60407007", "0.6029063", "0.6023771", "0.60138965", "0.6006294", "0.59896797", "0.59759974", "0.5969943", "0.5961716", "0.5954685", "0.595401", "0.59528077", "0.59447926", "0.5933258", "0.5919306", "0.591367", "0.59034854", "0.58953893", "0.58953893", "0.58909184", "0.58823323", "0.5880839", "0.5880681", "0.58719534", "0.5865104", "0.58637047", "0.5862404", "0.5855785", "0.58522147", "0.5850724", "0.58463985", "0.58446175", "0.5840684", "0.5836735", "0.58365905", "0.58278173", "0.58250475", "0.5822852", "0.58206576", "0.5807878", "0.5802944", "0.5797812", "0.5797163", "0.5795125", "0.57874", "0.578449", "0.57837194", "0.5777816", "0.5771698", "0.5770191", "0.5769259", "0.576705", "0.576625", "0.5763356", "0.57574624", "0.5755913" ]
0.66577464
8
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Predicates & Assertions These are all of the possible kinds of types.
function isType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType || type instanceof GraphQLEnumType || type instanceof GraphQLInputObjectType || type instanceof GraphQLList || type instanceof GraphQLNonNull; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Predicate() {}", "function Predicate() {}", "function Predicate() {}", "function Predicate() { }", "function Predicate() { }", "function Predicate () {}", "function Predicate(){}", "function getPredicate(type) {\n switch (type) {\n case \"hasAuthor\": return (dcterms + \"creator\");\n case \"hasPublicationYear\": return (fabio + type);\n case \"hasTitle\": return (dcterms + \"title\");\n case \"hasDOI\": return (prism + \"doi\");\n case \"hasURL\": return (fabio + type);\n case \"hasComment\": return (schema + \"comment\");\n case \"denotesRethoric\": // errore grammaticale di altri gruppigi \n case \"denotesRhetoric\": return (sem + \"denotes\");\n case \"cites\": return (cito + type);\n default: {\n console.log(\"Something goes wrong with getPredicate()\");\n return error;\n }\n }\n}", "function Predicate(predicate){\n this.predicate = predicate;\n}", "function assertType(value,type){var valid;var expectedType=getType(type);if(expectedType==='String'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='string');}else if(expectedType==='Number'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='number');}else if(expectedType==='Boolean'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='boolean');}else if(expectedType==='Function'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='function');}else if(expectedType==='Object'){valid=isPlainObject(value);}else if(expectedType==='Array'){valid=Array.isArray(value);}else{valid=value instanceof type;}return{valid:valid,expectedType:expectedType};}", "function assertType(value, type) {\n\t\t var valid = void 0;\n\t\t var expectedType = void 0;\n\t\t if (type === String) {\n\t\t expectedType = 'string';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Number) {\n\t\t expectedType = 'number';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Boolean) {\n\t\t expectedType = 'boolean';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Function) {\n\t\t expectedType = 'function';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Object) {\n\t\t expectedType = 'Object';\n\t\t valid = isPlainObject(value);\n\t\t } else if (type === Array) {\n\t\t expectedType = 'Array';\n\t\t valid = Array.isArray(value);\n\t\t } else {\n\t\t expectedType = type.name || type.toString();\n\t\t valid = value instanceof type;\n\t\t }\n\t\t return {\n\t\t valid: valid,\n\t\t expectedType: expectedType\n\t\t };\n\t\t}", "function tsParseTypePredicateOrAssertsPrefix() {\n const snapshot = state.snapshot();\n if (isContextual(ContextualKeyword._asserts) && !hasPrecedingLineBreak()) {\n // Normally this is `asserts x is T`, but at this point, it might be `asserts is T` (a user-\n // defined type guard on the `asserts` variable) or just a type called `asserts`.\n next();\n if (eatContextual(ContextualKeyword._is)) {\n // If we see `asserts is`, then this must be of the form `asserts is T`, since\n // `asserts is is T` isn't valid.\n tsParseType();\n return true;\n } else if (tsIsIdentifier() || match(TokenType._this)) {\n next();\n if (eatContextual(ContextualKeyword._is)) {\n // If we see `is`, then this is `asserts x is T`. Otherwise, it's `asserts x`.\n tsParseType();\n }\n return true;\n } else {\n // Regular type, so bail out and start type parsing from scratch.\n state.restoreFromSnapshot(snapshot);\n return false;\n }\n } else if (tsIsIdentifier() || match(TokenType._this)) {\n // This is a regular identifier, which may or may not have \"is\" after it.\n next();\n if (isContextual(ContextualKeyword._is) && !hasPrecedingLineBreak()) {\n next();\n tsParseType();\n return true;\n } else {\n // Regular type, so bail out and start type parsing from scratch.\n state.restoreFromSnapshot(snapshot);\n return false;\n }\n }\n return false;\n}", "function createTypeTest(subject, type) {\n var genericTypes = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2];\n\n if (type === \"null\") {\n return t.binaryExpression(\"!=\", subject, t.literal(null));\n } else if (type === \"array\") {\n return t.unaryExpression(\"!\", t.callExpression(t.memberExpression(t.identifier(\"Array\"), t.identifier(\"isArray\")), [subject]));\n } else if (type === \"object\") {\n return t.logicalExpression(\"||\", t.binaryExpression(\"===\", subject, t.literal(null)), t.binaryExpression(\"!==\", t.unaryExpression(\"typeof\", subject, true), t.literal(\"object\")));\n } else if (typeof type === 'string') {\n return t.binaryExpression(\"!==\", t.unaryExpression(\"typeof\", subject, true), t.literal(type));\n } else if (type.type === 'ObjectTypeAnnotation') {\n return t.logicalExpression(\"||\", t.logicalExpression(\"||\", t.binaryExpression(\"===\", subject, t.literal(null)), t.binaryExpression(\"!==\", t.unaryExpression('typeof', subject), t.literal('object'))), type.properties.reduce(function (expr, prop) {\n var key = prop.key;\n var valueTypes = extractAnnotationTypes(prop.value);\n if (prop.optional) valueTypes.push(\"undefined\");\n var test = createIfTest(t.memberExpression(subject, key), valueTypes, genericTypes);\n if (!test) {\n return expr;\n }\n if (expr === null) {\n return test;\n } else {\n return t.logicalExpression(\"||\", expr, test);\n }\n expr = t.literal(true);\n return expr;\n }, null));\n } else if (type.type === 'Identifier' && ~genericTypes.indexOf(type.name)) {\n return null;\n } else {\n return t.unaryExpression(\"!\", t.binaryExpression(\"instanceof\", subject, createTypeExpression(type)));\n }\n }", "ofType(...AllowedClasses){\n const validTypeNames = AllowedClasses.map(\n TClass => TClass.typeName || TClass.name\n ).join(' or ');\n\n\t\treturn this.addTest((obj) => {\n const isObjectOfValidType = AllowedClasses.some(\n AllowedClass => isInstance(obj, AllowedClass)\n );\n return new Validity(isObjectOfValidType,\n `${this.name} can only be type ${validTypeNames}`);\n });\n\t}", "function test(env) {\n return function(t) {\n return function(x) {\n var typeInfo = {name: 'name', constraints: {}, types: [t]};\n return (satisfactoryTypes (env, typeInfo, {}, t, 0, [], [x])).isRight;\n };\n };\n }", "function types(type) {\n // XXX: type('string').validator('lte')\n // would default to `validator('gte')` if not explicitly defined.\n type('string')\n .use(String)\n .validator('gte', function gte(a, b){\n return a.length >= b.length;\n })\n .validator('gt', function gt(a, b){\n return a.length > b.length;\n });\n\n type('id');\n\n type('integer')\n .use(parseInt);\n\n type('float')\n .use(parseFloat);\n\n type('decimal')\n .use(parseFloat);\n\n type('number')\n .use(parseFloat);\n \n type('date')\n .use(parseDate);\n\n type('boolean')\n .use(parseBoolean);\n\n type('array')\n // XXX: test? test('asdf') // true/false if is type.\n // or `validate`\n .use(function(val){\n // XXX: handle more cases.\n return isArray(val)\n ? val\n : val.split(/,\\s*/);\n })\n .validator('lte', function lte(a, b){\n return a.length <= b.length;\n });\n\n function parseDate(val) {\n return isDate(val)\n ? val\n : new Date(val);\n }\n\n function parseBoolean(val) {\n // XXX: can be made more robust\n return !!val;\n }\n}", "constructor(type, value, pred) {\n this.type = type;\n this.value = value;\n this.pred = pred;\n }", "toBeOfType(received, type) {\n const pass = typeof type === 'string'\n // eslint-disable-next-line valid-typeof\n ? (typeof received === type)\n : (received instanceof type);\n if (pass) {\n return {\n message: () => `expected ${received} not to be of type ${type}`,\n pass: true,\n };\n }\n return {\n message: () => `expected ${received} to be of type ${type}`,\n pass: false,\n };\n }", "static validate(type, predicate) {\n return async function typeFn(message, phrase) {\n if (typeof type === \"function\")\n type = type.bind(this);\n const res = await Argument.cast(type, this.handler.resolver, message, phrase);\n if (Argument.isFailure(res))\n return res;\n if (!predicate.call(this, message, phrase, res))\n return null;\n return res;\n };\n }", "function AutomationPredicate() {}", "assertType(expected, actual)\n {\n Tester.valid(expected, 'string')\n Tester.valid(actual, 'mixed')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (Tester.type(actual) !== expected) {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n } else {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n }\n }", "function assertType(value, type) {\n var valid = void 0;\n var expectedType = void 0;\n if (type === String) {\n expectedType = 'string';\n valid = typeof value === expectedType;\n } else if (type === Number) {\n expectedType = 'number';\n valid = typeof value === expectedType;\n } else if (type === Boolean) {\n expectedType = 'boolean';\n valid = typeof value === expectedType;\n } else if (type === Function) {\n expectedType = 'function';\n valid = typeof value === expectedType;\n } else if (type === Object) {\n expectedType = 'Object';\n valid = isPlainObject(value);\n } else if (type === Array) {\n expectedType = 'Array';\n valid = Array.isArray(value);\n } else {\n expectedType = type.name || type.toString();\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n };\n}", "function assertType (value, type) {\n\t var valid\n\t var expectedType = getType(type)\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string')\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number')\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean')\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function')\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value)\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value)\n\t } else {\n\t valid = value instanceof type\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function Type() {}", "function assertHas(ctx, types) {\n if (typeof (ctx) !== 'object') {\n throw new Error('invalid context: ' + typeof (ctx));\n }\n // ctx.assert(types);\n if (typeof (types) === 'object') {\n for (var i in types) {\n if (typeof (ctx[i]) !== types[i]) {\n throw new Error('assertion ' + i + ' requires ' + types[i] + ', given ' + typeof (ctx[i]));\n }\n }\n }\n}", "function assertType(value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t };\n\t}", "function test( type, name ) {\n if( typeof type === 'string' ) {\n // Convert a type definition like 'object' to a function performing the test.\n let isa = Tests[type];\n // Make sure we have a test.\n if( isa === undefined ) {\n throw new Error(`Unsupported type '${type}' for property '${name}'`);\n }\n return isa;\n }\n // Type definition is a nested compound type.\n const isa = compile( type );\n return obj => obj !== undefined && isa( obj );\n}", "function Predicate(t) { return Fn (t) (Boolean_); }", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}", "function TrueSpecification() {}", "function type (expectedType, x) {\n\t return typeof x === expectedType // eslint-disable-line valid-typeof\n\t}", "type_spec() {\n const startToken = this.currentToken;\n\n let typeTok = this.currentToken;\n if (typeTok.type === Lexer.TokenTypes.TYPE_INTEGER || typeTok.type === Lexer.TokenTypes.TYPE_REAL || typeTok.type === Lexer.TokenTypes.TYPE_BOOLEAN) {\n this.eat(typeTok.type);\n return new AST.TypeNode(typeTok);\n } else {\n throw new ParserException(`Error processing TYPESPEC: Expecting TYPE_INTEGER, TYPE_REAL, or TYPE_BOOLEAN got ${typeTok.type}`, startToken);\n }\n }", "equals(type) {\n return TypeChecker.compareTypes({type: this}, {type});\n }", "_encodePredicate(predicate) {\n return predicate.value === rdf.type ? 'a' : this._encodeIriOrBlank(predicate);\n }", "_encodePredicate(predicate) {\n return predicate.value === rdf.type ? 'a' : this._encodeIriOrBlank(predicate);\n }", "function registerType(type) {\n\t var is = t[\"is\" + type] = function (node, opts) {\n\t return t.is(type, node, opts);\n\t };\n\n\t t[\"assert\" + type] = function (node, opts) {\n\t opts = opts || {};\n\t if (!is(node, opts)) {\n\t throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n\t }\n\t };\n\t}", "function registerType(type) {\n\t var is = t[\"is\" + type] = function (node, opts) {\n\t return t.is(type, node, opts);\n\t };\n\n\t t[\"assert\" + type] = function (node, opts) {\n\t opts = opts || {};\n\t if (!is(node, opts)) {\n\t throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n\t }\n\t };\n\t}", "static assertion(type, assertionType) {\r\n return (writer) => {\r\n writeValue(writer, type);\r\n writer.spaceIfLastNot().write(\"as \");\r\n writeValue(writer, assertionType);\r\n };\r\n }", "is(type) { return this.type == type; }", "getType() {}", "function Is() {\r\n}", "function _typeof(e){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}", "function TypeChecker() {\n this.checks = [];\n}", "function expectType(types, name, isEnum) {\n if (isEnum === void 0) { isEnum = false; }\n var type = types.filter(function (t) { return t.name === name; })[0];\n expect(type).toBeDefined();\n expect(type.isEnum).toEqual(isEnum);\n return type;\n}", "function canUseAsIs(valueType) {\n return valueType === \"string\" ||\n valueType === \"boolean\" ||\n valueType === \"number\" ||\n valueType === \"json\" ||\n valueType === \"math\" ||\n valueType === \"regexp\" ||\n valueType === \"error\";\n }", "function myAwesomeFunction (input: MyFirstType): boolean {\n // input.myProp\n if (input) {\n console.log('dude OFC It\\'s gonna be there it HAS A FUCKIN TYPE BRO')\n return true\n }\n\n return false\n}", "function create() {\n /**\n * Get a type test function for a specific data type\n * @param {string} name Name of a data type like 'number' or 'string'\n * @returns {Function(obj: *) : boolean} Returns a type testing function.\n * Throws an error for an unknown type.\n */\n function getTypeTest(name) {\n var test;\n for (var i = 0; i < typed.types.length; i++) {\n var entry = typed.types[i];\n if (entry.name === name) {\n test = entry.test;\n break;\n }\n }\n\n if (!test) {\n var hint;\n for (i = 0; i < typed.types.length; i++) {\n entry = typed.types[i];\n if (entry.name.toLowerCase() == name.toLowerCase()) {\n hint = entry.name;\n break;\n }\n }\n\n throw new Error('Unknown type \"' + name + '\"' +\n (hint ? ('. Did you mean \"' + hint + '\"?') : ''));\n }\n return test;\n }\n\n /**\n * Retrieve the function name from a set of functions, and check\n * whether the name of all functions match (if given)\n * @param {Array.<function>} fns\n */\n function getName (fns) {\n var name = '';\n\n for (var i = 0; i < fns.length; i++) {\n var fn = fns[i];\n\n // merge function name when this is a typed function\n if (fn.signatures && fn.name != '') {\n if (name == '') {\n name = fn.name;\n }\n else if (name != fn.name) {\n var err = new Error('Function names do not match (expected: ' + name + ', actual: ' + fn.name + ')');\n err.data = {\n actual: fn.name,\n expected: name\n };\n throw err;\n }\n }\n }\n\n return name;\n }\n\n /**\n * Create an ArgumentsError. Creates messages like:\n *\n * Unexpected type of argument (expected: ..., actual: ..., index: ...)\n * Too few arguments (expected: ..., index: ...)\n * Too many arguments (expected: ..., actual: ...)\n *\n * @param {String} fn Function name\n * @param {number} argCount Number of arguments\n * @param {Number} index Current argument index\n * @param {*} actual Current argument\n * @param {string} [expected] An optional, comma separated string with\n * expected types on given index\n * @extends Error\n */\n function createError(fn, argCount, index, actual, expected) {\n var actualType = getTypeOf(actual);\n var _expected = expected ? expected.split(',') : null;\n var _fn = (fn || 'unnamed');\n var anyType = _expected && contains(_expected, 'any');\n var message;\n var data = {\n fn: fn,\n index: index,\n actual: actualType,\n expected: _expected\n };\n\n if (_expected) {\n if (argCount > index && !anyType) {\n // unexpected type\n message = 'Unexpected type of argument in function ' + _fn +\n ' (expected: ' + _expected.join(' or ') + ', actual: ' + actualType + ', index: ' + index + ')';\n }\n else {\n // too few arguments\n message = 'Too few arguments in function ' + _fn +\n ' (expected: ' + _expected.join(' or ') + ', index: ' + index + ')';\n }\n }\n else {\n // too many arguments\n message = 'Too many arguments in function ' + _fn +\n ' (expected: ' + index + ', actual: ' + argCount + ')'\n }\n\n var err = new TypeError(message);\n err.data = data;\n return err;\n }\n\n /**\n * Collection with function references (local shortcuts to functions)\n * @constructor\n * @param {string} [name='refs'] Optional name for the refs, used to generate\n * JavaScript code\n */\n function Refs(name) {\n this.name = name || 'refs';\n this.categories = {};\n }\n\n /**\n * Add a function reference.\n * @param {Function} fn\n * @param {string} [category='fn'] A function category, like 'fn' or 'signature'\n * @returns {string} Returns the function name, for example 'fn0' or 'signature2'\n */\n Refs.prototype.add = function (fn, category) {\n var cat = category || 'fn';\n if (!this.categories[cat]) this.categories[cat] = [];\n\n var index = this.categories[cat].indexOf(fn);\n if (index == -1) {\n index = this.categories[cat].length;\n this.categories[cat].push(fn);\n }\n\n return cat + index;\n };\n\n /**\n * Create code lines for all function references\n * @returns {string} Returns the code containing all function references\n */\n Refs.prototype.toCode = function () {\n var code = [];\n var path = this.name + '.categories';\n var categories = this.categories;\n\n for (var cat in categories) {\n if (categories.hasOwnProperty(cat)) {\n var category = categories[cat];\n\n for (var i = 0; i < category.length; i++) {\n code.push('var ' + cat + i + ' = ' + path + '[\\'' + cat + '\\'][' + i + '];');\n }\n }\n }\n\n return code.join('\\n');\n };\n\n /**\n * A function parameter\n * @param {string | string[] | Param} types A parameter type like 'string',\n * 'number | boolean'\n * @param {boolean} [varArgs=false] Variable arguments if true\n * @constructor\n */\n function Param(types, varArgs) {\n // parse the types, can be a string with types separated by pipe characters |\n if (typeof types === 'string') {\n // parse variable arguments operator (ellipses '...number')\n var _types = types.trim();\n var _varArgs = _types.substr(0, 3) === '...';\n if (_varArgs) {\n _types = _types.substr(3);\n }\n if (_types === '') {\n this.types = ['any'];\n }\n else {\n this.types = _types.split('|');\n for (var i = 0; i < this.types.length; i++) {\n this.types[i] = this.types[i].trim();\n }\n }\n }\n else if (Array.isArray(types)) {\n this.types = types;\n }\n else if (types instanceof Param) {\n return types.clone();\n }\n else {\n throw new Error('String or Array expected');\n }\n\n // can hold a type to which to convert when handling this parameter\n this.conversions = [];\n // TODO: implement better API for conversions, be able to add conversions via constructor (support a new type Object?)\n\n // variable arguments\n this.varArgs = _varArgs || varArgs || false;\n\n // check for any type arguments\n this.anyType = this.types.indexOf('any') !== -1;\n }\n\n /**\n * Order Params\n * any type ('any') will be ordered last, and object as second last (as other\n * types may be an object as well, like Array).\n *\n * @param {Param} a\n * @param {Param} b\n * @returns {number} Returns 1 if a > b, -1 if a < b, and else 0.\n */\n Param.compare = function (a, b) {\n // TODO: simplify parameter comparison, it's a mess\n if (a.anyType) return 1;\n if (b.anyType) return -1;\n\n if (contains(a.types, 'Object')) return 1;\n if (contains(b.types, 'Object')) return -1;\n\n if (a.hasConversions()) {\n if (b.hasConversions()) {\n var i, ac, bc;\n\n for (i = 0; i < a.conversions.length; i++) {\n if (a.conversions[i] !== undefined) {\n ac = a.conversions[i];\n break;\n }\n }\n\n for (i = 0; i < b.conversions.length; i++) {\n if (b.conversions[i] !== undefined) {\n bc = b.conversions[i];\n break;\n }\n }\n\n return typed.conversions.indexOf(ac) - typed.conversions.indexOf(bc);\n }\n else {\n return 1;\n }\n }\n else {\n if (b.hasConversions()) {\n return -1;\n }\n else {\n // both params have no conversions\n var ai, bi;\n\n for (i = 0; i < typed.types.length; i++) {\n if (typed.types[i].name === a.types[0]) {\n ai = i;\n break;\n }\n }\n\n for (i = 0; i < typed.types.length; i++) {\n if (typed.types[i].name === b.types[0]) {\n bi = i;\n break;\n }\n }\n\n return ai - bi;\n }\n }\n };\n\n /**\n * Test whether this parameters types overlap an other parameters types.\n * Will not match ['any'] with ['number']\n * @param {Param} other\n * @return {boolean} Returns true when there are overlapping types\n */\n Param.prototype.overlapping = function (other) {\n for (var i = 0; i < this.types.length; i++) {\n if (contains(other.types, this.types[i])) {\n return true;\n }\n }\n return false;\n };\n\n /**\n * Test whether this parameters types matches an other parameters types.\n * When any of the two parameters contains `any`, true is returned\n * @param {Param} other\n * @return {boolean} Returns true when there are matching types\n */\n Param.prototype.matches = function (other) {\n return this.anyType || other.anyType || this.overlapping(other);\n };\n\n /**\n * Create a clone of this param\n * @returns {Param} Returns a cloned version of this param\n */\n Param.prototype.clone = function () {\n var param = new Param(this.types.slice(), this.varArgs);\n param.conversions = this.conversions.slice();\n return param;\n };\n\n /**\n * Test whether this parameter contains conversions\n * @returns {boolean} Returns true if the parameter contains one or\n * multiple conversions.\n */\n Param.prototype.hasConversions = function () {\n return this.conversions.length > 0;\n };\n\n /**\n * Tests whether this parameters contains any of the provided types\n * @param {Object} types A Map with types, like {'number': true}\n * @returns {boolean} Returns true when the parameter contains any\n * of the provided types\n */\n Param.prototype.contains = function (types) {\n for (var i = 0; i < this.types.length; i++) {\n if (types[this.types[i]]) {\n return true;\n }\n }\n return false;\n };\n\n /**\n * Return a string representation of this params types, like 'string' or\n * 'number | boolean' or '...number'\n * @param {boolean} [toConversion] If true, the returned types string\n * contains the types where the parameter\n * will convert to. If false (default)\n * the \"from\" types are returned\n * @returns {string}\n */\n Param.prototype.toString = function (toConversion) {\n var types = [];\n var keys = {};\n\n for (var i = 0; i < this.types.length; i++) {\n var conversion = this.conversions[i];\n var type = toConversion && conversion ? conversion.to : this.types[i];\n if (!(type in keys)) {\n keys[type] = true;\n types.push(type);\n }\n }\n\n return (this.varArgs ? '...' : '') + types.join('|');\n };\n\n /**\n * A function signature\n * @param {string | string[] | Param[]} params\n * Array with the type(s) of each parameter,\n * or a comma separated string with types\n * @param {Function} fn The actual function\n * @constructor\n */\n function Signature(params, fn) {\n var _params;\n if (typeof params === 'string') {\n _params = (params !== '') ? params.split(',') : [];\n }\n else if (Array.isArray(params)) {\n _params = params;\n }\n else {\n throw new Error('string or Array expected');\n }\n\n this.params = new Array(_params.length);\n this.anyType = false;\n this.varArgs = false;\n for (var i = 0; i < _params.length; i++) {\n var param = new Param(_params[i]);\n this.params[i] = param;\n if (param.anyType) {\n this.anyType = true;\n }\n if (i === _params.length - 1) {\n // the last argument\n this.varArgs = param.varArgs;\n }\n else {\n // non-last argument\n if (param.varArgs) {\n throw new SyntaxError('Unexpected variable arguments operator \"...\"');\n }\n }\n }\n\n this.fn = fn;\n }\n\n /**\n * Create a clone of this signature\n * @returns {Signature} Returns a cloned version of this signature\n */\n Signature.prototype.clone = function () {\n return new Signature(this.params.slice(), this.fn);\n };\n\n /**\n * Expand a signature: split params with union types in separate signatures\n * For example split a Signature \"string | number\" into two signatures.\n * @return {Signature[]} Returns an array with signatures (at least one)\n */\n Signature.prototype.expand = function () {\n var signatures = [];\n\n function recurse(signature, path) {\n if (path.length < signature.params.length) {\n var i, newParam, conversion;\n\n var param = signature.params[path.length];\n if (param.varArgs) {\n // a variable argument. do not split the types in the parameter\n newParam = param.clone();\n\n // add conversions to the parameter\n // recurse for all conversions\n for (i = 0; i < typed.conversions.length; i++) {\n conversion = typed.conversions[i];\n if (!contains(param.types, conversion.from) && contains(param.types, conversion.to)) {\n var j = newParam.types.length;\n newParam.types[j] = conversion.from;\n newParam.conversions[j] = conversion;\n }\n }\n\n recurse(signature, path.concat(newParam));\n }\n else {\n // split each type in the parameter\n for (i = 0; i < param.types.length; i++) {\n recurse(signature, path.concat(new Param(param.types[i])));\n }\n\n // recurse for all conversions\n for (i = 0; i < typed.conversions.length; i++) {\n conversion = typed.conversions[i];\n if (!contains(param.types, conversion.from) && contains(param.types, conversion.to)) {\n newParam = new Param(conversion.from);\n newParam.conversions[0] = conversion;\n recurse(signature, path.concat(newParam));\n }\n }\n }\n }\n else {\n signatures.push(new Signature(path, signature.fn));\n }\n }\n\n recurse(this, []);\n\n return signatures;\n };\n\n /**\n * Compare two signatures.\n *\n * When two params are equal and contain conversions, they will be sorted\n * by lowest index of the first conversions.\n *\n * @param {Signature} a\n * @param {Signature} b\n * @returns {number} Returns 1 if a > b, -1 if a < b, and else 0.\n */\n Signature.compare = function (a, b) {\n if (a.params.length > b.params.length) return 1;\n if (a.params.length < b.params.length) return -1;\n\n // count the number of conversions\n var i;\n var len = a.params.length; // a and b have equal amount of params\n var ac = 0;\n var bc = 0;\n for (i = 0; i < len; i++) {\n if (a.params[i].hasConversions()) ac++;\n if (b.params[i].hasConversions()) bc++;\n }\n\n if (ac > bc) return 1;\n if (ac < bc) return -1;\n\n // compare the order per parameter\n for (i = 0; i < a.params.length; i++) {\n var cmp = Param.compare(a.params[i], b.params[i]);\n if (cmp !== 0) {\n return cmp;\n }\n }\n\n return 0;\n };\n\n /**\n * Test whether any of the signatures parameters has conversions\n * @return {boolean} Returns true when any of the parameters contains\n * conversions.\n */\n Signature.prototype.hasConversions = function () {\n for (var i = 0; i < this.params.length; i++) {\n if (this.params[i].hasConversions()) {\n return true;\n }\n }\n return false;\n };\n\n /**\n * Test whether this signature should be ignored.\n * Checks whether any of the parameters contains a type listed in\n * typed.ignore\n * @return {boolean} Returns true when the signature should be ignored\n */\n Signature.prototype.ignore = function () {\n // create a map with ignored types\n var types = {};\n for (var i = 0; i < typed.ignore.length; i++) {\n types[typed.ignore[i]] = true;\n }\n\n // test whether any of the parameters contains this type\n for (i = 0; i < this.params.length; i++) {\n if (this.params[i].contains(types)) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * Test whether the path of this signature matches a given path.\n * @param {Param[]} params\n */\n Signature.prototype.paramsStartWith = function (params) {\n if (params.length === 0) {\n return true;\n }\n\n var aLast = last(this.params);\n var bLast = last(params);\n\n for (var i = 0; i < params.length; i++) {\n var a = this.params[i] || (aLast.varArgs ? aLast: null);\n var b = params[i] || (bLast.varArgs ? bLast: null);\n\n if (!a || !b || !a.matches(b)) {\n return false;\n }\n }\n\n return true;\n };\n\n /**\n * Generate the code to invoke this signature\n * @param {Refs} refs\n * @param {string} prefix\n * @returns {string} Returns code\n */\n Signature.prototype.toCode = function (refs, prefix) {\n var code = [];\n\n var args = new Array(this.params.length);\n for (var i = 0; i < this.params.length; i++) {\n var param = this.params[i];\n var conversion = param.conversions[0];\n if (param.varArgs) {\n args[i] = 'varArgs';\n }\n else if (conversion) {\n args[i] = refs.add(conversion.convert, 'convert') + '(arg' + i + ')';\n }\n else {\n args[i] = 'arg' + i;\n }\n }\n\n var ref = this.fn ? refs.add(this.fn, 'signature') : undefined;\n if (ref) {\n return prefix + 'return ' + ref + '(' + args.join(', ') + '); // signature: ' + this.params.join(', ');\n }\n\n return code.join('\\n');\n };\n\n /**\n * Return a string representation of the signature\n * @returns {string}\n */\n Signature.prototype.toString = function () {\n return this.params.join(', ');\n };\n\n /**\n * A group of signatures with the same parameter on given index\n * @param {Param[]} path\n * @param {Signature} [signature]\n * @param {Node[]} childs\n * @param {boolean} [fallThrough=false]\n * @constructor\n */\n function Node(path, signature, childs, fallThrough) {\n this.path = path || [];\n this.param = path[path.length - 1] || null;\n this.signature = signature || null;\n this.childs = childs || [];\n this.fallThrough = fallThrough || false;\n }\n\n /**\n * Generate code for this group of signatures\n * @param {Refs} refs\n * @param {string} prefix\n * @returns {string} Returns the code as string\n */\n Node.prototype.toCode = function (refs, prefix) {\n // TODO: split this function in multiple functions, it's too large\n var code = [];\n\n if (this.param) {\n var index = this.path.length - 1;\n var conversion = this.param.conversions[0];\n var comment = '// type: ' + (conversion ?\n (conversion.from + ' (convert to ' + conversion.to + ')') :\n this.param);\n\n // non-root node (path is non-empty)\n if (this.param.varArgs) {\n if (this.param.anyType) {\n // variable arguments with any type\n code.push(prefix + 'if (arguments.length > ' + index + ') {');\n code.push(prefix + ' var varArgs = [];');\n code.push(prefix + ' for (var i = ' + index + '; i < arguments.length; i++) {');\n code.push(prefix + ' varArgs.push(arguments[i]);');\n code.push(prefix + ' }');\n code.push(this.signature.toCode(refs, prefix + ' '));\n code.push(prefix + '}');\n }\n else {\n // variable arguments with a fixed type\n var getTests = function (types, arg) {\n var tests = [];\n for (var i = 0; i < types.length; i++) {\n tests[i] = refs.add(getTypeTest(types[i]), 'test') + '(' + arg + ')';\n }\n return tests.join(' || ');\n }.bind(this);\n\n var allTypes = this.param.types;\n var exactTypes = [];\n for (var i = 0; i < allTypes.length; i++) {\n if (this.param.conversions[i] === undefined) {\n exactTypes.push(allTypes[i]);\n }\n }\n\n code.push(prefix + 'if (' + getTests(allTypes, 'arg' + index) + ') { ' + comment);\n code.push(prefix + ' var varArgs = [arg' + index + '];');\n code.push(prefix + ' for (var i = ' + (index + 1) + '; i < arguments.length; i++) {');\n code.push(prefix + ' if (' + getTests(exactTypes, 'arguments[i]') + ') {');\n code.push(prefix + ' varArgs.push(arguments[i]);');\n\n for (var i = 0; i < allTypes.length; i++) {\n var conversion_i = this.param.conversions[i];\n if (conversion_i) {\n var test = refs.add(getTypeTest(allTypes[i]), 'test');\n var convert = refs.add(conversion_i.convert, 'convert');\n code.push(prefix + ' }');\n code.push(prefix + ' else if (' + test + '(arguments[i])) {');\n code.push(prefix + ' varArgs.push(' + convert + '(arguments[i]));');\n }\n }\n code.push(prefix + ' } else {');\n code.push(prefix + ' throw createError(name, arguments.length, i, arguments[i], \\'' + exactTypes.join(',') + '\\');');\n code.push(prefix + ' }');\n code.push(prefix + ' }');\n code.push(this.signature.toCode(refs, prefix + ' '));\n code.push(prefix + '}');\n }\n }\n else {\n if (this.param.anyType) {\n // any type\n code.push(prefix + '// type: any');\n code.push(this._innerCode(refs, prefix));\n }\n else {\n // regular type\n var type = this.param.types[0];\n var test = type !== 'any' ? refs.add(getTypeTest(type), 'test') : null;\n\n code.push(prefix + 'if (' + test + '(arg' + index + ')) { ' + comment);\n code.push(this._innerCode(refs, prefix + ' '));\n code.push(prefix + '}');\n }\n }\n }\n else {\n // root node (path is empty)\n code.push(this._innerCode(refs, prefix));\n }\n\n return code.join('\\n');\n };\n\n /**\n * Generate inner code for this group of signatures.\n * This is a helper function of Node.prototype.toCode\n * @param {Refs} refs\n * @param {string} prefix\n * @returns {string} Returns the inner code as string\n * @private\n */\n Node.prototype._innerCode = function (refs, prefix) {\n var code = [];\n var i;\n\n if (this.signature) {\n code.push(prefix + 'if (arguments.length === ' + this.path.length + ') {');\n code.push(this.signature.toCode(refs, prefix + ' '));\n code.push(prefix + '}');\n }\n\n for (i = 0; i < this.childs.length; i++) {\n code.push(this.childs[i].toCode(refs, prefix));\n }\n\n // TODO: shouldn't the this.param.anyType check be redundant\n if (!this.fallThrough || (this.param && this.param.anyType)) {\n var exceptions = this._exceptions(refs, prefix);\n if (exceptions) {\n code.push(exceptions);\n }\n }\n\n return code.join('\\n');\n };\n\n\n /**\n * Generate code to throw exceptions\n * @param {Refs} refs\n * @param {string} prefix\n * @returns {string} Returns the inner code as string\n * @private\n */\n Node.prototype._exceptions = function (refs, prefix) {\n var index = this.path.length;\n\n if (this.childs.length === 0) {\n // TODO: can this condition be simplified? (we have a fall-through here)\n return [\n prefix + 'if (arguments.length > ' + index + ') {',\n prefix + ' throw createError(name, arguments.length, ' + index + ', arguments[' + index + ']);',\n prefix + '}'\n ].join('\\n');\n }\n else {\n var keys = {};\n var types = [];\n\n for (var i = 0; i < this.childs.length; i++) {\n var node = this.childs[i];\n if (node.param) {\n for (var j = 0; j < node.param.types.length; j++) {\n var type = node.param.types[j];\n if (!(type in keys) && !node.param.conversions[j]) {\n keys[type] = true;\n types.push(type);\n }\n }\n }\n }\n\n return prefix + 'throw createError(name, arguments.length, ' + index + ', arguments[' + index + '], \\'' + types.join(',') + '\\');';\n }\n };\n\n /**\n * Split all raw signatures into an array with expanded Signatures\n * @param {Object.<string, Function>} rawSignatures\n * @return {Signature[]} Returns an array with expanded signatures\n */\n function parseSignatures(rawSignatures) {\n // FIXME: need to have deterministic ordering of signatures, do not create via object\n var signature;\n var keys = {};\n var signatures = [];\n var i;\n\n for (var types in rawSignatures) {\n if (rawSignatures.hasOwnProperty(types)) {\n var fn = rawSignatures[types];\n signature = new Signature(types, fn);\n\n if (signature.ignore()) {\n continue;\n }\n\n var expanded = signature.expand();\n\n for (i = 0; i < expanded.length; i++) {\n var signature_i = expanded[i];\n var key = signature_i.toString();\n var existing = keys[key];\n if (!existing) {\n keys[key] = signature_i;\n }\n else {\n var cmp = Signature.compare(signature_i, existing);\n if (cmp < 0) {\n // override if sorted first\n keys[key] = signature_i;\n }\n else if (cmp === 0) {\n throw new Error('Signature \"' + key + '\" is defined twice');\n }\n // else: just ignore\n }\n }\n }\n }\n\n // convert from map to array\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n signatures.push(keys[key]);\n }\n }\n\n // order the signatures\n signatures.sort(function (a, b) {\n return Signature.compare(a, b);\n });\n\n // filter redundant conversions from signatures with varArgs\n // TODO: simplify this loop or move it to a separate function\n for (i = 0; i < signatures.length; i++) {\n signature = signatures[i];\n\n if (signature.varArgs) {\n var index = signature.params.length - 1;\n var param = signature.params[index];\n\n var t = 0;\n while (t < param.types.length) {\n if (param.conversions[t]) {\n var type = param.types[t];\n\n for (var j = 0; j < signatures.length; j++) {\n var other = signatures[j];\n var p = other.params[index];\n\n if (other !== signature &&\n p &&\n contains(p.types, type) && !p.conversions[index]) {\n // this (conversion) type already exists, remove it\n param.types.splice(t, 1);\n param.conversions.splice(t, 1);\n t--;\n break;\n }\n }\n }\n t++;\n }\n }\n }\n\n return signatures;\n }\n\n /**\n * Filter all any type signatures\n * @param {Signature[]} signatures\n * @return {Signature[]} Returns only any type signatures\n */\n function filterAnyTypeSignatures (signatures) {\n var filtered = [];\n\n for (var i = 0; i < signatures.length; i++) {\n if (signatures[i].anyType) {\n filtered.push(signatures[i]);\n }\n }\n\n return filtered;\n }\n\n /**\n * create a map with normalized signatures as key and the function as value\n * @param {Signature[]} signatures An array with split signatures\n * @return {Object.<string, Function>} Returns a map with normalized\n * signatures as key, and the function\n * as value.\n */\n function mapSignatures(signatures) {\n var normalized = {};\n\n for (var i = 0; i < signatures.length; i++) {\n var signature = signatures[i];\n if (signature.fn && !signature.hasConversions()) {\n var params = signature.params.join(',');\n normalized[params] = signature.fn;\n }\n }\n\n return normalized;\n }\n\n /**\n * Parse signatures recursively in a node tree.\n * @param {Signature[]} signatures Array with expanded signatures\n * @param {Param[]} path Traversed path of parameter types\n * @param {Signature[]} anys\n * @return {Node} Returns a node tree\n */\n function parseTree(signatures, path, anys) {\n var i, signature;\n var index = path.length;\n var nodeSignature;\n\n var filtered = [];\n for (i = 0; i < signatures.length; i++) {\n signature = signatures[i];\n\n // filter the first signature with the correct number of params\n if (signature.params.length === index && !nodeSignature) {\n nodeSignature = signature;\n }\n\n if (signature.params[index] != undefined) {\n filtered.push(signature);\n }\n }\n\n // sort the filtered signatures by param\n filtered.sort(function (a, b) {\n return Param.compare(a.params[index], b.params[index]);\n });\n\n // recurse over the signatures\n var entries = [];\n for (i = 0; i < filtered.length; i++) {\n signature = filtered[i];\n // group signatures with the same param at current index\n var param = signature.params[index];\n\n // TODO: replace the next filter loop\n var existing = entries.filter(function (entry) {\n return entry.param.overlapping(param);\n })[0];\n\n //var existing;\n //for (var j = 0; j < entries.length; j++) {\n // if (entries[j].param.overlapping(param)) {\n // existing = entries[j];\n // break;\n // }\n //}\n\n if (existing) {\n if (existing.param.varArgs) {\n throw new Error('Conflicting types \"' + existing.param + '\" and \"' + param + '\"');\n }\n existing.signatures.push(signature);\n }\n else {\n entries.push({\n param: param,\n signatures: [signature]\n });\n }\n }\n\n // find all any type signature that can still match our current path\n var matchingAnys = [];\n for (i = 0; i < anys.length; i++) {\n if (anys[i].paramsStartWith(path)) {\n matchingAnys.push(anys[i]);\n }\n }\n\n // see if there are any type signatures that don't match any of the\n // signatures that we have in our tree, i.e. we have alternative\n // matching signature(s) outside of our current tree and we should\n // fall through to them instead of throwing an exception\n var fallThrough = false;\n for (i = 0; i < matchingAnys.length; i++) {\n if (!contains(signatures, matchingAnys[i])) {\n fallThrough = true;\n break;\n }\n }\n\n // parse the childs\n var childs = new Array(entries.length);\n for (i = 0; i < entries.length; i++) {\n var entry = entries[i];\n childs[i] = parseTree(entry.signatures, path.concat(entry.param), matchingAnys)\n }\n\n return new Node(path, nodeSignature, childs, fallThrough);\n }\n\n /**\n * Generate an array like ['arg0', 'arg1', 'arg2']\n * @param {number} count Number of arguments to generate\n * @returns {Array} Returns an array with argument names\n */\n function getArgs(count) {\n // create an array with all argument names\n var args = [];\n for (var i = 0; i < count; i++) {\n args[i] = 'arg' + i;\n }\n\n return args;\n }\n\n /**\n * Compose a function from sub-functions each handling a single type signature.\n * Signatures:\n * typed(signature: string, fn: function)\n * typed(name: string, signature: string, fn: function)\n * typed(signatures: Object.<string, function>)\n * typed(name: string, signatures: Object.<string, function>)\n *\n * @param {string | null} name\n * @param {Object.<string, Function>} signatures\n * @return {Function} Returns the typed function\n * @private\n */\n function _typed(name, signatures) {\n var refs = new Refs();\n\n // parse signatures, expand them\n var _signatures = parseSignatures(signatures);\n if (_signatures.length == 0) {\n throw new Error('No signatures provided');\n }\n\n // filter all any type signatures\n var anys = filterAnyTypeSignatures(_signatures);\n\n // parse signatures into a node tree\n var node = parseTree(_signatures, [], anys);\n\n //var util = require('util');\n //console.log('ROOT');\n //console.log(util.inspect(node, { depth: null }));\n\n // generate code for the typed function\n // safeName is a conservative replacement of characters \n // to prevend being able to inject JS code at the place of the function name \n // the name is useful for stack trackes therefore we want have it there\n var code = [];\n var safeName = (name || '').replace(/[^a-zA-Z0-9_$]/g, '_')\n var args = getArgs(maxParams(_signatures));\n code.push('function ' + safeName + '(' + args.join(', ') + ') {');\n code.push(' \"use strict\";');\n code.push(' var name = ' + JSON.stringify(name || '') + ';');\n code.push(node.toCode(refs, ' ', false));\n code.push('}');\n\n // generate body for the factory function\n var body = [\n refs.toCode(),\n 'return ' + code.join('\\n')\n ].join('\\n');\n\n // evaluate the JavaScript code and attach function references\n var factory = (new Function(refs.name, 'createError', body));\n var fn = factory(refs, createError);\n\n //console.log('FN\\n' + fn.toString()); // TODO: cleanup\n\n // attach the signatures with sub-functions to the constructed function\n fn.signatures = mapSignatures(_signatures);\n\n return fn;\n }\n\n /**\n * Calculate the maximum number of parameters in givens signatures\n * @param {Signature[]} signatures\n * @returns {number} The maximum number of parameters\n */\n function maxParams(signatures) {\n var max = 0;\n\n for (var i = 0; i < signatures.length; i++) {\n var len = signatures[i].params.length;\n if (len > max) {\n max = len;\n }\n }\n\n return max;\n }\n\n /**\n * Get the type of a value\n * @param {*} x\n * @returns {string} Returns a string with the type of value\n */\n function getTypeOf(x) {\n var obj;\n\n for (var i = 0; i < typed.types.length; i++) {\n var entry = typed.types[i];\n\n if (entry.name === 'Object') {\n // Array and Date are also Object, so test for Object afterwards\n obj = entry;\n }\n else {\n if (entry.test(x)) return entry.name;\n }\n }\n\n // at last, test whether an object\n if (obj && obj.test(x)) return obj.name;\n\n return 'unknown';\n }\n\n /**\n * Test whether an array contains some item\n * @param {Array} array\n * @param {*} item\n * @return {boolean} Returns true if array contains item, false if not.\n */\n function contains(array, item) {\n return array.indexOf(item) !== -1;\n }\n\n /**\n * Returns the last item in the array\n * @param {Array} array\n * @return {*} item\n */\n function last (array) {\n return array[array.length - 1];\n }\n\n // data type tests\n var types = [\n { name: 'number', test: function (x) { return typeof x === 'number' } },\n { name: 'string', test: function (x) { return typeof x === 'string' } },\n { name: 'boolean', test: function (x) { return typeof x === 'boolean' } },\n { name: 'Function', test: function (x) { return typeof x === 'function'} },\n { name: 'Array', test: Array.isArray },\n { name: 'Date', test: function (x) { return x instanceof Date } },\n { name: 'RegExp', test: function (x) { return x instanceof RegExp } },\n { name: 'Object', test: function (x) { return typeof x === 'object' } },\n { name: 'null', test: function (x) { return x === null } },\n { name: 'undefined', test: function (x) { return x === undefined } }\n ];\n\n // configuration\n var config = {};\n\n // type conversions. Order is important\n var conversions = [];\n\n // types to be ignored\n var ignore = [];\n\n // temporary object for holding types and conversions, for constructing\n // the `typed` function itself\n // TODO: find a more elegant solution for this\n var typed = {\n config: config,\n types: types,\n conversions: conversions,\n ignore: ignore\n };\n\n /**\n * Construct the typed function itself with various signatures\n *\n * Signatures:\n *\n * typed(signatures: Object.<string, function>)\n * typed(name: string, signatures: Object.<string, function>)\n */\n typed = _typed('typed', {\n 'Object': function (signatures) {\n var fns = [];\n for (var signature in signatures) {\n if (signatures.hasOwnProperty(signature)) {\n fns.push(signatures[signature]);\n }\n }\n var name = getName(fns);\n\n return _typed(name, signatures);\n },\n 'string, Object': _typed,\n // TODO: add a signature 'Array.<function>'\n '...Function': function (fns) {\n var err;\n var name = getName(fns);\n var signatures = {};\n\n for (var i = 0; i < fns.length; i++) {\n var fn = fns[i];\n\n // test whether this is a typed-function\n if (!(typeof fn.signatures === 'object')) {\n err = new TypeError('Function is no typed-function (index: ' + i + ')');\n err.data = {index: i};\n throw err;\n }\n\n // merge the signatures\n for (var signature in fn.signatures) {\n if (fn.signatures.hasOwnProperty(signature)) {\n if (signatures.hasOwnProperty(signature)) {\n if (fn.signatures[signature] !== signatures[signature]) {\n err = new Error('Signature \"' + signature + '\" is defined twice');\n err.data = {signature: signature};\n throw err;\n }\n // else: both signatures point to the same function, that's fine\n }\n else {\n signatures[signature] = fn.signatures[signature];\n }\n }\n }\n }\n\n return _typed(name, signatures);\n }\n });\n\n /**\n * Find a specific signature from a (composed) typed function, for\n * example:\n *\n * typed.find(fn, ['number', 'string'])\n * typed.find(fn, 'number, string')\n *\n * Function find only only works for exact matches.\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature Signature to be found, can be\n * an array or a comma separated string.\n * @return {Function} Returns the matching signature, or\n * throws an errror when no signature\n * is found.\n */\n function find (fn, signature) {\n if (!fn.signatures) {\n throw new TypeError('Function is no typed-function');\n }\n\n // normalize input\n var arr;\n if (typeof signature === 'string') {\n arr = signature.split(',');\n for (var i = 0; i < arr.length; i++) {\n arr[i] = arr[i].trim();\n }\n }\n else if (Array.isArray(signature)) {\n arr = signature;\n }\n else {\n throw new TypeError('String array or a comma separated string expected');\n }\n\n var str = arr.join(',');\n\n // find an exact match\n var match = fn.signatures[str];\n if (match) {\n return match;\n }\n\n // TODO: extend find to match non-exact signatures\n\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + arr.join(', ') + '))');\n }\n\n /**\n * Convert a given value to another data type.\n * @param {*} value\n * @param {string} type\n */\n function convert (value, type) {\n var from = getTypeOf(value);\n\n // check conversion is needed\n if (type === from) {\n return value;\n }\n\n for (var i = 0; i < typed.conversions.length; i++) {\n var conversion = typed.conversions[i];\n if (conversion.from === from && conversion.to === type) {\n return conversion.convert(value);\n }\n }\n\n throw new Error('Cannot convert from ' + from + ' to ' + type);\n }\n\n // attach types and conversions to the final `typed` function\n typed.config = config;\n typed.types = types;\n typed.conversions = conversions;\n typed.ignore = ignore;\n typed.create = create;\n typed.find = find;\n typed.convert = convert;\n\n // add a type\n typed.addType = function (type) {\n if (!type || typeof type.name !== 'string' || typeof type.test !== 'function') {\n throw new TypeError('Object with properties {name: string, test: function} expected');\n }\n\n typed.types.push(type);\n };\n\n // add a conversion\n typed.addConversion = function (conversion) {\n if (!conversion\n || typeof conversion.from !== 'string'\n || typeof conversion.to !== 'string'\n || typeof conversion.convert !== 'function') {\n throw new TypeError('Object with properties {from: string, to: string, convert: function} expected');\n }\n\n typed.conversions.push(conversion);\n };\n\n return typed;\n }", "function handleRDFType (formula, subj, pred, obj, why) {\n if (formula.typeCallback) {\n formula.typeCallback(formula, obj, why)\n }\n\n var x = formula.classActions[obj.hashString()]\n var done = false\n if (x) {\n for (var i = 0; i < x.length; i++) {\n done = done || x[i](formula, subj, pred, obj, why)\n }\n }\n return done // statement given is not needed if true\n } // handleRDFType", "function registerType(type /*: string*/) {\n\t var is = t[\"is\" + type] = function (node, opts) {\n\t return t.is(type, node, opts);\n\t };\n\n\t t[\"assert\" + type] = function (node, opts) {\n\t opts = opts || {};\n\t if (!is(node, opts)) {\n\t throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n\t }\n\t };\n\t}", "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function Type() {\n}", "type() { }", "function assert(expectedBehavior, description){\n if (!expectedBehavior) {\n console.log(description);\n return false;\n } else {\n return true;\n }\n}", "checkTypes(args, parameters) {\n for (let i = 0; i < args.length; i++) {\n if (args[i].type != parameters[i]) {\n return {\n valid: false,\n invalidType: args[i].type,\n expected: parameters[i]\n };\n }\n }\n return { valid: true };\n }", "function UnderreactType() {}", "genClassChain() {\r\n if (this.predicate) {\r\n return '/XCUIElementTypeAny[`' + this.predicate + '`]';\r\n }\r\n const qs = [];\r\n if (this.name) {\r\n qs.push(`name == '${this.name}'`);\r\n }\r\n if (this.namePart) {\r\n qs.push(`name CONTAINS '${this.namePart}'`);\r\n }\r\n if (this.nameRegex) {\r\n qs.push(`name MATCHES '${this.nameRegex}'`);\r\n }\r\n if (this.label) {\r\n qs.push(`label == '${this.label}'`);\r\n }\r\n if (this.labelPart) {\r\n qs.push(`label CONTAINS '${this.labelPart}'`);\r\n }\r\n if (this.value) {\r\n qs.push(`value == '${this.value}'`);\r\n }\r\n if (this.valuePart) {\r\n qs.push(`value CONTAINS ’${this.valuePart}'`);\r\n }\r\n if (this.visible !== null && this.visible !== undefined) {\r\n qs.push(`visible == ${this.visible.toString()}`);\r\n }\r\n if (this.enabled !== null && this.enabled !== undefined) {\r\n qs.push(`enabled == ${this.enabled.toString()}`);\r\n }\r\n const predicate = qs.join(' AND ');\r\n let chain = '/' + (this.className || 'XCUIElementTypeAny');\r\n if (predicate) {\r\n chain = chain + '[`' + predicate + '`]';\r\n }\r\n if (this.index) {\r\n chain = chain + `[${this.index}]`;\r\n }\r\n return chain;\r\n }", "function TypeClass(name, url, dependencies, test) {\n if (!(this instanceof TypeClass)) {\n return new TypeClass (name, url, dependencies, test);\n }\n this.name = name;\n this.url = url;\n this.test = function(x) {\n return dependencies.every (function(d) { return d.test (x); }) &&\n test (x);\n };\n }", "function Type() {\r\n}", "function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isTypeDefinitionNode\"])(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isSpecifiedScalarName(typeName)) {\n return;\n }\n\n var suggestedTypes = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeName, isSDL ? specifiedScalarsNames.concat(typeNames) : typeNames);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__[\"GraphQLError\"](\"Unknown type \\\"\".concat(typeName, \"\\\".\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(suggestedTypes), node));\n }\n }\n };\n}", "function createIfTest(subject, types) {\n var genericTypes = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2];\n\n return types.reduce(function (last, type, index) {\n var test = createTypeTest(subject, type, genericTypes);\n if (!test) {\n if (last && types[index - 1] === \"null\") {\n return null;\n }\n return last;\n }\n if (last === null) {\n return test;\n }\n return t.logicalExpression(\"&&\", last, test);\n }, null);\n }", "function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isTypeDefinitionNode\"])(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isStandardTypeName(typeName)) {\n return;\n }\n\n var suggestedTypes = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__[\"GraphQLError\"](\"Unknown type \\\"\".concat(typeName, \"\\\".\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(suggestedTypes), node));\n }\n }\n };\n}", "function newTypesComplain(req, res) {\n\n}", "function ExamType(type) {\n this.type = type;\n}", "function testTypes(validator, type)\n{\n const _validator = validators[type][validator];\n for (const _type of typeValues)\n {\n testValidate(validator, typeof _type === type, _validator(_type));\n }\n}", "assertInstanceOf(expected, actual)\n {\n Tester.valid(expected, 'function')\n Tester.valid(actual, 'function', 'object')\n\n this._assertionsCounter++\n\n var trace = Tester.getBacktrace(new Error(), 2)\n\n if (actual instanceof expected) {\n this._ok.push('Ok: ' + trace)\n this._all.push('Ok: ' + trace)\n } else {\n this._errors.push('Error: ' + trace)\n this._all.push('Error: ' + trace)\n }\n }", "'getType'() {\n\t\tthrow new Error('Not implemented.');\n\t}", "function registerType(type) {\n var is = t[\"is\" + type] = function (node, opts) {\n return t.is(type, node, opts);\n };\n\n t[\"assert\" + type] = function (node, opts) {\n opts = opts || {};\n if (!is(node, opts)) {\n throw new Error(\"Expected type \" + JSON.stringify(type) + \" with option \" + JSON.stringify(opts));\n }\n };\n}", "function FalseSpecification() {}", "function isType(type) {\n\t return function(obj) {\n\t return Object.prototype.toString.call(obj) === \"[object \" + type + \"]\"\n\t }\n\t}", "toBeObject(expected) {\n if (typeof expected === \"object\" && !Array.isArray(expected)) {\n // typeof is not safe. Must explicitidly check null values and arrays too.\n return {\n message: \"Is Object\",\n pass: true,\n };\n }\n return {\n message: () => `This is not an object, it's::::${typeof expect}`,\n pass: false,\n };\n }", "function assert_event_type (obj, type, inheritsp) {\n if (typeof obj === 'object') {\n var type_str = \"[object \" + type + \"]\";\n inheritsp = (typeof inheritsp === 'boolean') ? inheritsp : false;\n while (obj) {\n if (obj.toString() === type_str || (obj.constructor && obj.constructor.name === type)) {\n return true;\n } else {\n obj = inheritsp ? Object.getPrototypeOf(obj) : null;\n }\n }\n }\n throw new TypeError();\n }", "function TypeClass(name, url, dependencies, test) {\n if (!(this instanceof TypeClass)) {\n return new TypeClass(name, url, dependencies, test);\n }\n this.name = name;\n this.url = url;\n this.test = function(x) {\n return dependencies.every(function(d) { return d.test(x); }) && test(x);\n };\n }", "function getType() { return \"not\"; }", "function evaluateTypeAssertion({ node, environment, evaluate, statementTraversalStack }) {\n return evaluate.expression(node.expression, environment, statementTraversalStack);\n}", "function dataTypes() {\n console.log(typeof true);\n console.log(typeof null);\n console.log(typeof undefined);\n console.log(typeof 5);\n console.log(typeof NaN);\n console.log(typeof 'Hello');\n\n}", "function createPredicateFn(expression, comparator, matchAgainstAnyProp) { // 18485\n var shouldMatchPrimitives = isObject(expression) && ('$' in expression); // 18486\n var predicateFn; // 18487\n // 18488\n if (comparator === true) { // 18489\n comparator = equals; // 18490\n } else if (!isFunction(comparator)) { // 18491\n comparator = function(actual, expected) { // 18492\n if (isUndefined(actual)) { // 18493\n // No substring matching against `undefined` // 18494\n return false; // 18495\n } // 18496\n if ((actual === null) || (expected === null)) { // 18497\n // No substring matching against `null`; only match against `null` // 18498\n return actual === expected; // 18499\n } // 18500\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) { // 18501\n // Should not compare primitives against objects, unless they have custom `toString` method // 18502\n return false; // 18503\n } // 18504\n // 18505\n actual = lowercase('' + actual); // 18506\n expected = lowercase('' + expected); // 18507\n return actual.indexOf(expected) !== -1; // 18508\n }; // 18509\n } // 18510\n // 18511\n predicateFn = function(item) { // 18512\n if (shouldMatchPrimitives && !isObject(item)) { // 18513\n return deepCompare(item, expression.$, comparator, false); // 18514\n } // 18515\n return deepCompare(item, expression, comparator, matchAgainstAnyProp); // 18516\n }; // 18517\n // 18518\n return predicateFn; // 18519\n} // 18520", "function compare(type, correct, submitted, rules, equivType)\n{\n if (!type || !correct || !submitted)\n return disasterResponse;\n \n\t// it seems the type functions are all looking for the first item in the array.\n\tif (Array.isArray(correct))\n\t\tcorrect = correct[0];\n\n\tif (typeMap[type])\n\t\treturn typeMap[type](correct, submitted, rules, equivType);\n\n\treturn errorResponse;\n}", "function Fe(t){return(Fe=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function typeChecker(type) {\n var typeString = \"[object \" + type + \"]\";\n return function(value) {\n return Object.prototype.toString.call(value) === typeString;\n };\n}", "is(value) {\n throw new Error(\"Datatype.is() is abstract\");\n }", "async validateType(value: mixed) {\n if (value instanceof this.getModelClass()) {\n return;\n }\n this.expected(\"instance of Model class\", typeof value);\n }", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\"/* default */])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n}else if(ruleType&&(typeof value==='undefined'?'undefined':__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value))!==rule.type){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}}", "function getBreezePredicate() {\n\n }", "function y(t){return(y=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function typeVarPred(arity) {\n var filter = arityGte (arity);\n return function(env) {\n var test2 = _test (env);\n return function(x) {\n var test1 = test2 (x);\n return env.some (function(t) { return filter (t) && test1 (t); });\n };\n };\n }", "function isType(type) {\n\treturn function(obj) {\n\t\treturn Object.prototype.toString.call(obj) === \"[object \" + type + \"]\";\n\t};\n}", "function what2(self, type) {\n return what1(self) === name$1(type);\n }" ]
[ "0.5866655", "0.5866655", "0.5866655", "0.5820951", "0.5820951", "0.5795426", "0.5722482", "0.5583928", "0.55798143", "0.5499321", "0.5457561", "0.543557", "0.5372373", "0.5355828", "0.5293186", "0.52839994", "0.52601355", "0.5240247", "0.5233151", "0.52094966", "0.5199523", "0.51940995", "0.5168748", "0.51625943", "0.51625943", "0.51625943", "0.51625943", "0.51625943", "0.51625943", "0.5084482", "0.5077921", "0.5046597", "0.50459325", "0.4984496", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49763814", "0.49734423", "0.4948873", "0.490362", "0.48543185", "0.48464894", "0.48464894", "0.48462188", "0.48462188", "0.4840298", "0.48380703", "0.4824038", "0.48167038", "0.47918606", "0.47912732", "0.47906557", "0.47864497", "0.47703478", "0.47678912", "0.4736069", "0.4721349", "0.47181398", "0.47181398", "0.47173667", "0.46802253", "0.46730065", "0.46568745", "0.46549276", "0.46430868", "0.46393463", "0.4638504", "0.46380624", "0.4635827", "0.46301317", "0.46160287", "0.4614522", "0.46115553", "0.46049812", "0.4604544", "0.45928538", "0.4590911", "0.45792073", "0.45757392", "0.4574561", "0.45692992", "0.45679176", "0.4567565", "0.4555942", "0.4553699", "0.45403078", "0.45388713", "0.45340356", "0.45299575", "0.45262387", "0.45202368", "0.4519765", "0.45161888", "0.45154378", "0.45054457", "0.45043075" ]
0.0
-1
These types may be used as input types for arguments and directives.
function isInputType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLEnumType || type instanceof GraphQLInputObjectType || type instanceof GraphQLNonNull && isInputType(type.ofType) || type instanceof GraphQLList && isInputType(type.ofType); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inputType() {\n // Unsigned integer\n if (this.argument.type[0] == 'U') {\n // Supports binary, hex, octal, and digital\n return [\"text\", \"0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+|[1-9]\\\\\\\\d*\"];\n }\n else if (this.argument.type[0] == 'F') {\n return [\"number\", \"\\\\d*.?\\\\d*\"];\n }\n return [\"text\", \".*\"];\n }", "inputType() {\n // Unsigned integer\n if (this.argument.type[0] == 'U') {\n // Supports binary, hex, ocatal, and digital\n return [\"text\", \"0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+|[1-9]\\\\\\\\d*\"];\n }\n else if (this.argument.type[0] == 'F') {\n return [\"number\", \"\\\\d*.?\\\\d*\"];\n }\n return [\"text\", \".*\"];\n }", "function Type(){\n\t\t\tthis.array='Array';\n\t\t\tthis.object='object';\n\t\t\tthis.string='string';\n\t\t\tthis.fn='function';\n\t\t\tthis.number='number';\n\t\t}", "function Type() {}", "function dataType(input) {\nconsole.log(`The argument type is:`,typeof(input));\n}", "function DirectiveType(){}", "function Type() {\r\n}", "function types(type) {\n // XXX: type('string').validator('lte')\n // would default to `validator('gte')` if not explicitly defined.\n type('string')\n .use(String)\n .validator('gte', function gte(a, b){\n return a.length >= b.length;\n })\n .validator('gt', function gt(a, b){\n return a.length > b.length;\n });\n\n type('id');\n\n type('integer')\n .use(parseInt);\n\n type('float')\n .use(parseFloat);\n\n type('decimal')\n .use(parseFloat);\n\n type('number')\n .use(parseFloat);\n \n type('date')\n .use(parseDate);\n\n type('boolean')\n .use(parseBoolean);\n\n type('array')\n // XXX: test? test('asdf') // true/false if is type.\n // or `validate`\n .use(function(val){\n // XXX: handle more cases.\n return isArray(val)\n ? val\n : val.split(/,\\s*/);\n })\n .validator('lte', function lte(a, b){\n return a.length <= b.length;\n });\n\n function parseDate(val) {\n return isDate(val)\n ? val\n : new Date(val);\n }\n\n function parseBoolean(val) {\n // XXX: can be made more robust\n return !!val;\n }\n}", "function DirectiveType() {}", "function Type() {\n}", "get type() { return this.args.type }", "function DirectiveType() { }", "getType() {}", "function TypeParam(pos) { this.pos = pos }", "function inputTypes(type) {\n if (type.startsWith('image')) {\n return ImageType\n }\n\n if (type == \"file.other\") {\n return ImageType\n }\n\n if (type == 'number') {\n return NumberType\n }\n\n return TextType\n}", "function type(input) {\n \treturn typeof input\n}", "function argsDataType() {\n\n}", "type() { }", "function getType(type) {\n // Remove spaces.\n type = type.replace(/\\s/g, '');\n // Convert [] to Array<> for generics.\n var sqBracketIndex = type.indexOf('[');\n if (sqBracketIndex !== -1) {\n return \"Array<\" + getType(type.slice(0, sqBracketIndex)) + \">\";\n }\n\n // If type has < in it already, translate generic argument.\n var angleIndex = type.indexOf('<');\n if (angleIndex !== -1) {\n type = type.slice(0, angleIndex) + '<' + getType(type.slice(angleIndex + 1, type.indexOf('>'))) + \">\";\n }\n\n switch (type) {\n // Weird things. Prune items as we fix docs.\n case 'obj':\n case 'ConvenientHunk':\n case 'lineStats':\n case 'RevWalk':\n case 'StatusFile':\n case 'historyEntry':\n case 'DiffList':\n return 'any';\n // Untyped function callbacks.\n case 'CheckoutNotifyCb':\n case 'CheckoutPerfdataCb':\n case 'CheckoutProgressCb':\n case 'DiffFileCb':\n case 'DiffBinaryCb':\n case 'DiffHunkCb':\n case 'DiffLineCb':\n case 'DiffNotifyCb':\n case 'CredAcquireCb':\n case 'FetchheadForeachCb':\n case 'FilterStreamFn':\n case 'IndexMatchedPathCb':\n case 'NoteForeachCb':\n case 'StashCb':\n case 'StashApplyProgressCb':\n case 'StatusCb':\n case 'SubmoduleCb':\n case 'TransferProgressCb':\n case 'TransportCb':\n case 'TransportCertificateCheckCb':\n return 'Function';\n // Primitives\n case 'String':\n return 'string';\n case 'Char':\n case 'int':\n case 'Number':\n return 'number';\n case 'Void':\n return 'void';\n case 'bool':\n return 'boolean';\n case 'Array':\n return 'Array<any>';\n // Avoiding type collusions\n case 'Object':\n return 'GitObject';\n case 'Blob':\n return 'GitBlob';\n // NodeJS types\n case 'EventEmitter':\n return 'NodeJS.EventEmitter';\n default:\n var dotIndex = type.indexOf('.');\n if (dotIndex !== -1) {\n if (type[dotIndex + 1] === '<') {\n // Sometimes, the docs include a '.' between the type and the generic type argument.\n return type.replace(/\\./g, '');\n } else {\n // Remove '.' from types (e.g. Reference.Type => ReferenceType) as\n // we make them part of the outer scope.\n // Also, convert the owner of the type properly (e.g. Object.TYPE => GitObjectTYPE).\n return getType(type.slice(0, dotIndex)) + type.slice(dotIndex + 1);\n }\n } else {\n // Check for weird things. If there are weird things, punt with 'any'.\n if (type.indexOf('(') !== -1 || type.indexOf(':') !== -1) {\n return 'any';\n }\n\n return type;\n }\n }\n }", "get typeInput() {\n return this._type;\n }", "get typeInput() {\n return this._type;\n }", "get typeInput() {\n return this._type;\n }", "function variablesTypes(input) {\n console.log(\"My name: \" + input[0] + '//type is ' + typeof(input[0]) +\n '. My age: ' + input[1] + ' //type is ' + typeof(input[1]) +\n '. I am male: ' + input[2] + '//type is ' + typeof(input[2]) + '. My favorite foods are:' + input[3].toString() + '. //type is ' + typeof(input[3]));\n}", "set type(value) {}", "function UnionType() {\n // Copy arguments object as an array:\n this.types = [].slice.call(arguments).sort();\n }", "function ArgumentsOfCorrectType(context) {\n\t return {\n\t Argument: function Argument(argAST) {\n\t var argDef = context.getArgument();\n\t if (argDef) {\n\t var errors = (0, _utilitiesIsValidLiteralValue.isValidLiteralValue)(argDef.type, argAST.value);\n\t if (errors && errors.length > 0) {\n\t context.reportError(new _error.GraphQLError(badValueMessage(argAST.name.value, argDef.type, (0, _languagePrinter.print)(argAST.value), errors), [argAST.value]));\n\t }\n\t }\n\t return false;\n\t }\n\t };\n\t}", "function theType(dataType){\n return theType(dataType);// This function will return the type of any argument passed into this function\n}", "function IntersectionType() {\n // Copy arguments object as an array:\n this.types = [].slice.call(arguments).sort();\n }", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "set inputType(type) {\n this._inputType = type;\n }", "set inputType(type) {\n this._inputType = type;\n }", "function getDataType(args) {\n return typeof args;\n}", "function example(arg1: number, arg2: MyObject): Array<Object> {\n// ^ variable\n// ^ punctuation.type.flowtype\n// ^ support.type.builtin.primitive.flowtype\n// ^ variable\n// ^ support.type.class.flowtype\n// ^ punctuation.type.flowtype\n// ^ support.type.builtin.class.flowtype\n// ^ punctuation.flowtype\n// ^ support.type.builtin.class.flowtype\n// ^ punctuation.flowtype\n}", "function input(type) {\n const value = typeof type;\n return value;\n}", "function ArgumentsOfCorrectType(context) {\n return {\n Argument: function Argument(node) {\n var argDef = context.getArgument();\n if (argDef) {\n var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argDef.type, node.value);\n if (errors && errors.length > 0) {\n context.reportError(new _error.GraphQLError(badValueMessage(node.name.value, argDef.type, (0, _printer.print)(node.value), errors), [node.value]));\n }\n }\n return false;\n }\n };\n}", "function PipeType(){}", "get type() {}", "function UnderreactType() {}", "function whatDatatype(arg){\n return typeof(arg);\n}", "function validateArgType(functionName,type,position,argument){validateType(functionName,type,ordinal(position)+\" argument\",argument);}", "static _processType(typeItem) {\n switch (typeItem.kind) {\n case 'variable-type':\n return Type.newVariableReference(typeItem.name);\n case 'reference-type':\n return Type.newManifestReference(typeItem.name);\n case 'list-type':\n return Type.newSetView(Manifest._processType(typeItem.type));\n default:\n throw `Unexpected type item of kind '${typeItem.kind}'`;\n }\n }", "function getType(arg) {\n return typeof arg;\n}", "function parsePrimaryType(){var params=null,returnType=null,marker=markerCreate(),rest=null,tmp,typeParameters,token,type,isGroupedType=false;switch(lookahead.type){case Token.Identifier:switch(lookahead.value){case 'any':lex();return markerApply(marker,delegate.createAnyTypeAnnotation());case 'bool': // fallthrough\ncase 'boolean':lex();return markerApply(marker,delegate.createBooleanTypeAnnotation());case 'number':lex();return markerApply(marker,delegate.createNumberTypeAnnotation());case 'string':lex();return markerApply(marker,delegate.createStringTypeAnnotation());}return markerApply(marker,parseGenericType());case Token.Punctuator:switch(lookahead.value){case '{':return markerApply(marker,parseObjectType());case '[':return parseTupleType();case '<':typeParameters = parseTypeParameterDeclaration();expect('(');tmp = parseFunctionTypeParams();params = tmp.params;rest = tmp.rest;expect(')');expect('=>');returnType = parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,typeParameters));case '(':lex(); // Check to see if this is actually a grouped type\nif(!match(')') && !match('...')){if(lookahead.type === Token.Identifier){token = lookahead2();isGroupedType = token.value !== '?' && token.value !== ':';}else {isGroupedType = true;}}if(isGroupedType){type = parseType();expect(')'); // If we see a => next then someone was probably confused about\n// function types, so we can provide a better error message\nif(match('=>')){throwError({},Messages.ConfusedAboutFunctionType);}return type;}tmp = parseFunctionTypeParams();params = tmp.params;rest = tmp.rest;expect(')');expect('=>');returnType = parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,null /* typeParameters */));}break;case Token.Keyword:switch(lookahead.value){case 'void':return markerApply(marker,parseVoidType());case 'typeof':return markerApply(marker,parseTypeofType());}break;case Token.StringLiteral:token = lex();if(token.octal){throwError(token,Messages.StrictOctalLiteral);}return markerApply(marker,delegate.createStringLiteralTypeAnnotation(token));}throwUnexpected(lookahead);}", "function ArgumentsOfCorrectType(context) {\n return {\n Argument: function Argument(argAST) {\n var argDef = context.getArgument();\n if (argDef) {\n var errors = (0, _utilitiesIsValidLiteralValue.isValidLiteralValue)(argDef.type, argAST.value);\n if (errors && errors.length > 0) {\n context.reportError(new _error.GraphQLError(badValueMessage(argAST.name.value, argDef.type, (0, _languagePrinter.print)(argAST.value), errors), [argAST.value]));\n }\n }\n return false;\n }\n };\n}", "function typeOf(input) {\r\n\t\r\n\t\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\t\r\n\t\t}", "parseInputObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description,\n name,\n directives,\n fields,\n });\n }", "function TypeofTypeAnnotation(node, print) {\n this.push(\"typeof \");\n print.plain(node.argument);\n}", "function isInputType(type) {\n\t var namedType = getNamedType(type);\n\t return namedType instanceof GraphQLScalarType || namedType instanceof GraphQLEnumType || namedType instanceof GraphQLInputObjectType;\n\t}", "function typeOf(input) {\r\n\r\n\t\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t\t}", "function typeOf(input) {\n\n\t\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\n\n\t\t}", "function typeOf(input) {\n\n\t\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\n\n\t\t}", "function typenize (type)\n {\n let typewords = type.split(' ');\n\n if (typewords.length === 1)\n {\n if (typewords[0] === 'Integer' || typewords[0] === 'Float')\n return 'number';\n\n else if (typewords[0] === 'String')\n return 'string';\n\n else if (typewords[0] === 'Boolean' || typewords[0] === 'True' || typewords[0] === 'False')\n return 'boolean';\n \n else if (typewords[0] === 'InputFile')\n return '{ name: string, data: Buffer }';\n\n else if (typewords[0] === 'CallbackGame')\n return 'any';\n\n else\n return typewords[0];\n }\n\n else if (typewords.length === 3)\n {\n if (typewords[0] === 'Array' && typewords[1] === 'of')\n return 'Array<' + typenize(typewords[2]) + '>';\n\n else if (typewords[1] === 'or')\n return typenize(typewords[0]) + ' | ' + typenize(typewords[2]);\n }\n\n return 'any';\n }", "function typeArgument(argument){\n return typeof(argument);\n}", "function typesOf() {\n return Array.from(arguments, value => typeof value)\n}", "function Type() {\n this.hooks = [];\n }", "type_spec() {\n const startToken = this.currentToken;\n\n let typeTok = this.currentToken;\n if (typeTok.type === Lexer.TokenTypes.TYPE_INTEGER || typeTok.type === Lexer.TokenTypes.TYPE_REAL || typeTok.type === Lexer.TokenTypes.TYPE_BOOLEAN) {\n this.eat(typeTok.type);\n return new AST.TypeNode(typeTok);\n } else {\n throw new ParserException(`Error processing TYPESPEC: Expecting TYPE_INTEGER, TYPE_REAL, or TYPE_BOOLEAN got ${typeTok.type}`, startToken);\n }\n }", "enterTypeAnnotation(ctx) {\n }", "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "function typeToken() {\n\t\tvar type = thisToken;\n\t\tif (lastToken == '*')\n\t\t\ttype = '*' + type;\n\t\tgetToken();\n\t\tremoveNewLine();\n\t\tif (thisToken == '*' || thisToken == '&') {\n\t\t\tif (thisToken == '*')\n\t\t\t\ttype = thisToken + type;\n\t\t\tgetToken();\n\t\t}\n\t\t//type cast, not implemented\n\t\tif (thisToken == ')') {\n\t\t\tgetToken();\n\t\t\texecut();\n\t\t\treturn;\n\t\t}\n\t\tgetToken();\n\t\t//call function registration\n\t\tif (thisToken == '(') {\n\t\t\tpreviousToken();\n\t\t\taddFunction(type);\n\t\t} else if (thisToken == '[') {\n\t\t\taddArray(type);\n\t\t}\n\t\t//declaration of variables of the same type, separated by commas, assignment is not supported\n\t\telse if (thisToken == ',') {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t\tgetToken();\n\t\t\twhile (thisToken && thisToken != ';') {\n\t\t\t\tgetToken();\n\t\t\t\taddVar(type);\n\t\t\t\tgetToken();\n\t\t\t\tif (!(thisToken == ',' || thisToken == ';'))\n\t\t\t\t\tputError(lineCount, 17, '');\n\t\t\t\t//info(\"\" + lineCount + \" unsupported variable declaration\");\n\t\t\t}\n\t\t} else {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t}\n\t}", "function FunctionTypeParam(node, print) {\n\t print.plain(node.name);\n\t if (node.optional) this.push(\"?\");\n\t this.push(\":\");\n\t this.space();\n\t print.plain(node.typeAnnotation);\n\t}", "function FunctionTypeParam(node, print) {\n\t print.plain(node.name);\n\t if (node.optional) this.push(\"?\");\n\t this.push(\":\");\n\t this.space();\n\t print.plain(node.typeAnnotation);\n\t}", "function typeOf(input) {\n\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\n\n\t}", "type (prm) {\n try {\n return this.member(\n 'type',\n ['top', 'right', 'bottom', 'left'],\n prm\n );\n } catch (e) {\n console.error(e.stack);\n }\n }", "function PipeType() {}", "get inputType() {\n return this._inputType;\n }", "get inputType() {\n return this._inputType;\n }", "function newTyping() {\n output.html(type.value());\n output.parent('output');\n}", "function ExamType(type) {\n this.type = type;\n}", "function validateType(functionName,type,inputName,input){if(typeof input!==type||type==='object'&&!isPlainObject(input)){var description=valueDescription(input);throw new index_esm_FirestoreError(Code.INVALID_ARGUMENT,\"Function \"+functionName+\"() requires its \"+inputName+\" \"+(\"to be of type \"+type+\", but it was: \"+description));}}", "get instanceTypesInput() {\n return this._instanceTypes;\n }", "function VariablesAreInputTypes(context) {\n\t return {\n\t VariableDefinition: function VariableDefinition(node) {\n\t var type = (0, _utilitiesTypeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n\t // If the variable type is not an input type, return an error.\n\t if (type && !(0, _typeDefinition.isInputType)(type)) {\n\t var variableName = node.variable.name.value;\n\t context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _languagePrinter.print)(node.type)), [node.type]));\n\t }\n\t }\n\t };\n\t}", "function generate_type_name(fn, args) {\n var name = fn.name;\n if (null != args.__name__) {\n name += '(' + args.__name__ + ')'; \n }\n else if (is_str(args)) {\n name += '(' + args + ')'; \n }\n else if (is_args(args) || is_array(args)) {\n name += '(';\n for (var i = 0; i < args.length; ++i) {\n if (i > 0) {\n name += ',';\n }\n if (args[i].__name__) {\n name += args[i].__name__;\n }\n else {\n name += args[i];\n }\n }\n name += ')';\n }\n else if (is_json(args)) {\n name += '(json)';\n }\n return name;\n }", "static type(arg)\n {\n const types = [\n 'array', 'boolean', 'function', 'number',\n 'null', 'object', 'regexp', 'symbol', 'string',\n 'undefined'\n ]\n\n var type = Object.prototype.toString.call(arg),\n type = type.match(/^\\[.+ (.+)\\]$/),\n type = type[1],\n type = type.toLowerCase()\n\n if (types.indexOf(type) !== -1) {\n return type\n }\n\n return typeof arg\n }", "function addTypes(env, sexp, constraints) {\n var type = null;\n switch (sexp.tag) {\n case 'sym':\n if (sexp.val in env) {\n type = env[sexp.val];\n } else {\n throw 'unknown sym ' + sexp.val;\n }\n break;\n case 'str': type = TString; break;\n case 'num': type = TNum; break;\n case 'lst':\n var head = sexp.val[0];\n if (head.val == 'fn') {\n var args = sexp.val[1].val;\n // Create new entry in env for each arg.\n env = Object.create(env);\n args.forEach(function(arg) { env[arg.val] = gentvar(); });\n\n var body = sexp.val.slice(2);\n body.forEach(function(sexp) { addTypes(env, sexp, constraints); });\n type = new Tfn(args.map(function(arg){ return env[arg.val]; }),\n body[body.length-1].type);\n } else {\n // Application of head to rest of sexp.\n sexp.val.forEach(function(sexp) { addTypes(env, sexp, constraints); });\n var args = sexp.val.slice(1);\n\n var fntype = new Tfn(args.map(function(arg) { return arg.type }),\n gentvar());\n constraints.push([head.type, fntype]);\n type = fntype.ret;\n }\n break;\n case 'vec':\n var elemtype = gentvar();\n sexp.val.forEach(function(sexp) {\n addTypes(env, sexp, constraints);\n constraints.push([elemtype, sexp.type]);\n });\n type = newTArray(elemtype);\n break;\n default: throw 'unknown sexp: ' + sexp.tag + ': ' + sexp;\n }\n if (!type)\n throw 'no type for ' + sexp.tag + ': ' + sexp;\n sexp.type = type;\n}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){(0,_required2[\"default\"])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\r\n\t}else if(ruleType&&(typeof value==='undefined'?'undefined':_typeof(value))!==rule.type){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){(0,_required2[\"default\"])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n\t}else if(ruleType&&(typeof value==='undefined'?'undefined':_typeof(value))!==rule.type){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}}", "function newTypesComplain(req, res) {\n\n}", "'getType'() {\n\t\tthrow new Error('Not implemented.');\n\t}", "function validateArgType(functionName, type, position, argument) {\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\n }", "function PipeType() { }", "setType(type) { }", "function dataTypes() {\n console.log(typeof true);\n console.log(typeof null);\n console.log(typeof undefined);\n console.log(typeof 5);\n console.log(typeof NaN);\n console.log(typeof 'Hello');\n\n}", "static taggedUnion(...types) {\n return async function typeFn(message, phrase) {\n for (let entry of types) {\n entry = Argument.tagged(entry);\n const res = await Argument.cast(entry, this.handler.resolver, message, phrase);\n if (!Argument.isFailure(res))\n return res;\n }\n return null;\n };\n }", "function Type() {\n if (currentToken() == \"inteiro\" || currentToken() == \"real\" || currentToken() == \"texto\" || currentToken() == \"boleano\" || currentToken() == \"vazio\" || currentClass() == IDENTIFIER) {\n currentType = currentToken();\n return;\n } else {\n let errorMessage = \"Tipo de variável não reconhecido\";\n handleError(errorMessage);\n return;\n }\n }", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){(0,_required2[\"default\"])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n}else if(ruleType&&(typeof value==='undefined'?'undefined':_typeof(value))!==rule.type){errors.push(util.format(options.messages.types[ruleType],rule.fullField,rule.type));}}", "checkTypes(args, parameters) {\n for (let i = 0; i < args.length; i++) {\n if (args[i].type != parameters[i]) {\n return {\n valid: false,\n invalidType: args[i].type,\n expected: parameters[i]\n };\n }\n }\n return { valid: true };\n }", "function parseInputObjectTypeDefinition(lexer) {\n\t var start = lexer.token;\n\t var description = parseDescription(lexer);\n\t expectKeyword(lexer, 'input');\n\t var name = parseName(lexer);\n\t var directives = parseDirectives(lexer, true);\n\t var fields = parseInputFieldsDefinition(lexer);\n\t return {\n\t kind: _kinds.INPUT_OBJECT_TYPE_DEFINITION,\n\t description: description,\n\t name: name,\n\t directives: directives,\n\t fields: fields,\n\t loc: loc(lexer, start)\n\t };\n\t}", "constructor (type) {\n this.type = type\n this.chars = null // characters count\n this.text = null\n this.attributes = null\n\n if (type === 'insert') {\n this.text = arguments[1]\n Utils.assert(typeof this.text === 'string')\n\n this.attributes = arguments[2] || {}\n Utils.assert(typeof this.attributes === 'object')\n } else if (type === 'delete') {\n this.chars = arguments[1]\n Utils.assert(typeof this.chars === 'number')\n } else if (type === 'retain') {\n this.chars = arguments[1]\n Utils.assert(typeof this.chars === 'number')\n\n this.attributes = arguments[2] || {}\n Utils.assert(typeof this.attributes === 'object')\n }\n }", "static union(...types) {\n return async function typeFn(message, phrase) {\n for (let entry of types) {\n if (typeof entry === \"function\")\n entry = entry.bind(this);\n const res = await Argument.cast(entry, this.handler.resolver, message, phrase);\n if (!Argument.isFailure(res))\n return res;\n }\n return null;\n };\n }", "_validateType() {\n if (NOVO_INPUT_INVALID_TYPES.indexOf(this._type) > -1) {\n throw new Error(`Invalid Input Type: ${this._type}`);\n }\n }", "function TypeParameterInstantiation(node, print) {\n\t this.push(\"<\");\n\t print.join(node.params, {\n\t separator: \", \",\n\t iterator: function iterator(node) {\n\t print.plain(node.typeAnnotation);\n\t }\n\t });\n\t this.push(\">\");\n\t}", "function TypeParameterInstantiation(node, print) {\n\t this.push(\"<\");\n\t print.join(node.params, {\n\t separator: \", \",\n\t iterator: function iterator(node) {\n\t print.plain(node.typeAnnotation);\n\t }\n\t });\n\t this.push(\">\");\n\t}", "function parseParametersType() {\n var params = [], optionalSequence = false, expr, rest = false, startIndex, restStartIndex = index - 3, nameStartIndex;\n\n while (token !== Token.RPAREN) {\n if (token === Token.REST) {\n // RestParameterType\n consume(Token.REST);\n rest = true;\n }\n\n startIndex = previous;\n\n expr = parseTypeExpression();\n if (expr.type === Syntax.NameExpression && token === Token.COLON) {\n nameStartIndex = previous - expr.name.length;\n // Identifier ':' TypeExpression\n consume(Token.COLON);\n expr = maybeAddRange({\n type: Syntax.ParameterType,\n name: expr.name,\n expression: parseTypeExpression()\n }, [nameStartIndex, previous]);\n }\n if (token === Token.EQUAL) {\n consume(Token.EQUAL);\n expr = maybeAddRange({\n type: Syntax.OptionalType,\n expression: expr\n }, [startIndex, previous]);\n optionalSequence = true;\n } else {\n if (optionalSequence) {\n utility.throwError('unexpected token');\n }\n }\n if (rest) {\n expr = maybeAddRange({\n type: Syntax.RestType,\n expression: expr\n }, [restStartIndex, previous]);\n }\n params.push(expr);\n if (token !== Token.RPAREN) {\n expect(Token.COMMA);\n }\n }\n return params;\n }", "function validateNamedType(functionName,type,optionName,argument){validateType(functionName,type,optionName+\" option\",argument);}", "static parseType(parseTokens) {\n isASTNode = true;\n this.match([\"int\", \"string\", \"boolean\"], parseTokens[tokenPointer], false);\n }", "function behId( type ) {\r\n var result = {};\r\n result.inType = type;\r\n result.outType = type;\r\n result.install = function ( context, inWires, outWires ) {\r\n eachTypeLeafNodeOver( inWires, outWires,\r\n function ( type, inWire, outWire ) {\r\n \r\n if ( type.op === \"atom\" ) {\r\n outWire.readSigFrom( inWire );\r\n } else if ( type.op === \"anytimeFn\" ) {\r\n outWire.readFrom( inWire );\r\n } else {\r\n throw new Error();\r\n }\r\n } );\r\n };\r\n return result;\r\n}", "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}", "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\r\n}" ]
[ "0.6682957", "0.66636664", "0.6487981", "0.6388074", "0.6260115", "0.6208433", "0.60848624", "0.6079036", "0.6065855", "0.6058644", "0.60189766", "0.5977005", "0.591053", "0.5902122", "0.58727914", "0.58521783", "0.58514625", "0.5794315", "0.5785371", "0.5756656", "0.5756656", "0.5756656", "0.5701492", "0.56489307", "0.5620363", "0.5579661", "0.5578542", "0.5570116", "0.5565822", "0.5565822", "0.55577844", "0.55577844", "0.55552715", "0.55534667", "0.5500393", "0.54808587", "0.54774994", "0.5477448", "0.5453923", "0.54463375", "0.54343903", "0.54332185", "0.5432219", "0.54269624", "0.5418329", "0.5414982", "0.5414878", "0.54082465", "0.54076886", "0.5400601", "0.5398283", "0.5398283", "0.5389555", "0.53880566", "0.53833973", "0.53732646", "0.5365991", "0.5343086", "0.5340749", "0.5340749", "0.5340749", "0.5323242", "0.53106993", "0.53106993", "0.53076404", "0.5306025", "0.5299838", "0.5284347", "0.5284347", "0.5284292", "0.52744234", "0.5267451", "0.5261002", "0.5258606", "0.5256334", "0.52513576", "0.5243159", "0.52320135", "0.5218635", "0.52132654", "0.52112293", "0.5209598", "0.5209226", "0.5199371", "0.5190687", "0.51904094", "0.51864505", "0.51813585", "0.51745284", "0.5168249", "0.5167101", "0.5163894", "0.5156126", "0.5142617", "0.5142617", "0.5118234", "0.511675", "0.5115154", "0.51139575", "0.5111981", "0.5111981" ]
0.0
-1
These types may be used as output types as the result of fields.
function isOutputType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType || type instanceof GraphQLEnumType || type instanceof GraphQLNonNull && isOutputType(type.ofType) || type instanceof GraphQLList && isOutputType(type.ofType); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printFieldTypesForHelper(prefix, fields) {\r\n return fields.map(p => {\r\n var name = p.name;\r\n var compiledName = \"\";\r\n if (!p.emit && isArrayType(p.type)) {\r\n compiledName = '[<CompiledName(\"' + name + '\")>] ';\r\n name += \"A\";\r\n }\r\n return prefix \r\n + (p.isDuplicate ? \"// OVERWRITTEN \" : \"\") \r\n + templates.fieldTypeForHelper\r\n .replace(\"[DECORATOR]\", (p.emit ? '[<Emit(\"' + p.emit + '\")>] ' : compiledName))\r\n .replace(\"[NAME]\", stringToUnionCase(name))\r\n .replace(\"[TYPE]\", escape(p.type))\r\n .replace(\"[COMMENT]\", p.parentName ? (\"// \" + p.parentName) : \"\");\r\n }).filter(x => x.trim().length > 0).join(\"\\n\");\r\n}", "function classFieldType(chunk, context, bodies, params) {\n const type = context.get(\"type\");\n const options = context.get(\"options\");\n\n const result = convertBasicType(type, options);\n // if result is empty, it's Type or Enum\n return chunk.write(result || type);\n}", "function db_field_type(val, name) {\n if (typeof(val) == \"number\") {\n if (name && name.match(/id$/g)) {\n return \"INTEGER\";\n }\n return \"REAL\";\n } else if (typeof(val) == \"string\") {\n return \"TEXT\";\n } else if (typeof(val) == \"boolean\") {\n return \"BOOL\";\n } else if (val instanceof Date) {\n return \"INTEGER\";\n } else {\n return null;\n }\n }", "function isOutputType(type) {\n\t var namedType = getNamedType(type);\n\t return namedType instanceof GraphQLScalarType || namedType instanceof GraphQLObjectType || namedType instanceof GraphQLInterfaceType || namedType instanceof GraphQLUnionType || namedType instanceof GraphQLEnumType;\n\t}", "function Type(){\n\t\t\tthis.array='Array';\n\t\t\tthis.object='object';\n\t\t\tthis.string='string';\n\t\t\tthis.fn='function';\n\t\t\tthis.number='number';\n\t\t}", "get Types() {\n return (\n {\n '': this.calculateType(),\n 'whole': 'w',\n 'half': 'h',\n 'quarter': 'q',\n 'eighth': '8',\n '16th': '16',\n '32nd': '32',\n '64th': '64',\n '128th': '128',\n '256th': '256',\n '512th': '512',\n '1024th': '1024',\n });\n }", "get instanciableValueFields() // only for instanciable\n {\n if(this._cache_instanciableValueFields) return this._cache_instanciableValueFields;\n var fields = [];\n for(var class_ of this.supClasses)\n for(var field of class_.$from(_typeFrom))\n if(field.$(_functional) != _true)\n if(field.$(_claimDisabled) != _true)\n {\n fields.push(field);\n var resolvableField = field.resolvableField;\n if(resolvableField) fields.push(resolvableField);\n }\n return this._cache_instanciableValueFields = fields;\n }", "parseFields(fields) {\n for (let index in fields) {\n let obj = fields[index];\n let name = \"\";\n let type = \"\";\n for (let prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n if (prop === \"name\") {\n name = obj[prop];\n }\n if (prop === \"type\") {\n type = obj[prop];\n }\n }\n }\n this.fieldTypes[name] = Number(type);\n }\n }", "convertTypesForDb(input) {\n\t\tswitch (input?.constructor.name) {\n\t\t\tcase 'Long':\n\t\t\t\treturn input.toString();\n\t\t\tdefault: return input;\n\t\t}\n\t}", "getType() {}", "showValues(includeTypeInfo = false) {\n let retVal = '{';\n this.collection.forEach(function(value, index, collection) {\n retVal += value;\n if (includeTypeInfo)\n retVal += ' (' + typeof(value) + ')';\n if (!((index + 1) === collection.length)) {\n retVal += ', '\n }\n });\n retVal += '}';\n return retVal;\n }", "function backportFieldTypes(mapping) {\n if (!mapping) return;\n if (mapping.body) {\n return backportFieldTypes(mapping.body.properties);\n }\n for (const field of Object.keys(mapping)) {\n const value = mapping[field];\n switch (value.type) {\n case 'nested':\n backportFieldTypes(value.properties);\n break;\n case 'keyword':\n value.type = 'string';\n value.index = 'not_analyzed';\n break;\n case 'text':\n value.type = 'string';\n break;\n }\n }\n}", "function generateRecordValueForFieldType(type) {\n var functionToCall = recordTypeMapping[type];\n return functionToCall();\n }", "function isOutputType(type) {\n return type instanceof _graphql.GraphQLScalarType || type instanceof _graphql.GraphQLObjectType || type instanceof _graphql.GraphQLInterfaceType || type instanceof _graphql.GraphQLUnionType || type instanceof _graphql.GraphQLEnumType || type instanceof _graphql.GraphQLNonNull && isOutputType(type.ofType) || type instanceof _graphql.GraphQLList && isOutputType(type.ofType);\n} // solve Flow reqursion limit, do not import from graphql.js", "_computeType(type) {\n return ['row', type].join(' ');\n }", "static get fieldType() {\n return 'number';\n }", "static get fieldType() {\n return 'number';\n }", "static get fieldType() {\n return 'number';\n }", "static get fieldType() {\n return 'date';\n }", "static get fieldType() {\n return 'date';\n }", "function Type() {}", "static get fieldType() {\n return 'number';\n }", "ValueType() { \n\n return typeof this.Expected == typeof this.Actual ? this.ExactType() : `Expected type ${typeof this.Expected} but found type ${typeof this.Actual}`\n }", "get typeInput() {\n return this._type;\n }", "get typeInput() {\n return this._type;\n }", "get typeInput() {\n return this._type;\n }", "_dataType(col, passed_options) {\n const options = Object.assign(\n {},\n {\n is_atomic: false,\n },\n passed_options,\n );\n const { is_atomic } = options;\n const props = this.fields[col];\n\n if (this._isKeyCandidate(col)) {\n return 'BIGINT.UNSIGNED';\n } else {\n let { type } = props;\n\n if (type.startsWith('ref|list')) {\n if (is_atomic) {\n type = type.replace('ref|list|', '');\n } else {\n return 'TEXT';\n }\n }\n\n switch (type) {\n case 'short':\n return 'INTEGER';\n case 'int':\n return 'INTEGER';\n case 'uint':\n return 'INTEGER.UNSIGNED';\n case 'long':\n return 'BIGINT';\n case 'ulong':\n return 'BIGINT.UNSIGNED';\n case 'float':\n return 'FLOAT';\n case 'double':\n return 'DOUBLE';\n case 'ref|string':\n return 'TEXT';\n case 'bool':\n return 'BOOLEAN';\n case 'byte':\n // TINYINT\n return 'INTEGER'; // TODO bits in sequelize\n case 'ref|int':\n return 'INTEGER';\n case 'ubyte':\n return 'INTEGER.UNSIGNED'; // TODO bits in sequelize\n default:\n throw new Error(`unrecognized type '${props.type}'`);\n }\n }\n }", "function completeValue(exeContext, returnType, fieldNodes, info, path, result) {\n // If result is an Error, throw a located error.\n if (result instanceof Error) {\n throw result;\n } // If field type is NonNull, complete for inner type, and throw field error\n // if result is null.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_15__[\"isNonNullType\"])(returnType)) {\n var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result);\n\n if (completed === null) {\n throw new Error(\"Cannot return null for non-nullable field \".concat(info.parentType.name, \".\").concat(info.fieldName, \".\"));\n }\n\n return completed;\n } // If result value is null-ish (null, undefined, or NaN) then return null.\n\n\n if (Object(_jsutils_isNullish__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(result)) {\n return null;\n } // If field type is List, complete each item in the list with the inner type\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_15__[\"isListType\"])(returnType)) {\n return completeListValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is a leaf type, Scalar or Enum, serialize to a valid value,\n // returning null if serialization is not possible.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_15__[\"isLeafType\"])(returnType)) {\n return completeLeafValue(returnType, result);\n } // If field type is an abstract type, Interface or Union, determine the\n // runtime Object type and complete for that type.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_15__[\"isAbstractType\"])(returnType)) {\n return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is Object, execute and complete all sub-selections.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_15__[\"isObjectType\"])(returnType)) {\n return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result);\n } // Not reachable. All possible output types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Cannot complete value of unexpected output type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(returnType), \"\\\".\"));\n}", "function newTyping() {\n output.html(type.value());\n output.parent('output');\n}", "getType(){return this.__type}", "function parseFieldType() {\n var key, rangeStart = previous;\n\n key = parseFieldName();\n if (token === Token.COLON) {\n consume(Token.COLON);\n return maybeAddRange({\n type: Syntax.FieldType,\n key: key,\n value: parseTypeExpression()\n }, [rangeStart, previous]);\n }\n return maybeAddRange({\n type: Syntax.FieldType,\n key: key,\n value: null\n }, [rangeStart, previous]);\n }", "get type() {}", "get type() { return this._type; }", "get type() { return this._type; }", "get type() { return this._type; }", "get type () { return this._doc.type; }", "getFieldsMap(schema) {\n const fieldsMap = {};\n const typesList = schema._typeMap;\n const builtInTypes = [\n \"String\",\n \"Int\",\n \"Float\",\n \"Boolean\",\n \"ID\",\n \"Query\",\n \"__Type\",\n \"__Field\",\n \"__EnumValue\",\n \"__DirectiveLocation\",\n \"__Schema\",\n \"__TypeKind\",\n \"__InputValue\",\n \"__Directive\",\n ];\n // exclude built-in types\n const customTypes = Object.keys(typesList).filter(\n (type) => !builtInTypes.includes(type) && type !== schema._queryType.name\n );\n for (const type of customTypes) {\n const fieldsObj = {};\n let fields = typesList[type]._fields;\n if (typeof fields === \"function\") fields = fields();\n for (const field in fields) {\n const key = fields[field].name;\n const value = fields[field].type.ofType\n ? fields[field].type.ofType.name\n : fields[field].type.name;\n fieldsObj[key] = value;\n }\n fieldsMap[type] = fieldsObj;\n }\n return fieldsMap;\n }", "function completeValue(exeContext, returnType, fieldNodes, info, path, result) {\n // If result is an Error, throw a located error.\n if (result instanceof Error) {\n throw result;\n } // If field type is NonNull, complete for inner type, and throw field error\n // if result is null.\n\n\n if ((0, _definition.isNonNullType)(returnType)) {\n var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result);\n\n if (completed === null) {\n throw new Error(\"Cannot return null for non-nullable field \".concat(info.parentType.name, \".\").concat(info.fieldName, \".\"));\n }\n\n return completed;\n } // If result value is null or undefined then return null.\n\n\n if (result == null) {\n return null;\n } // If field type is List, complete each item in the list with the inner type\n\n\n if ((0, _definition.isListType)(returnType)) {\n return completeListValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is a leaf type, Scalar or Enum, serialize to a valid value,\n // returning null if serialization is not possible.\n\n\n if ((0, _definition.isLeafType)(returnType)) {\n return completeLeafValue(returnType, result);\n } // If field type is an abstract type, Interface or Union, determine the\n // runtime Object type and complete for that type.\n\n\n if ((0, _definition.isAbstractType)(returnType)) {\n return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is Object, execute and complete all sub-selections.\n // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isObjectType)(returnType)) {\n return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result);\n } // istanbul ignore next (Not reachable. All possible output types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Cannot complete value of unexpected output type: ' + (0, _inspect.default)(returnType));\n}", "function completeValue(exeContext, returnType, fieldNodes, info, path, result) {\n // If result is an Error, throw a located error.\n if (result instanceof Error) {\n throw result;\n } // If field type is NonNull, complete for inner type, and throw field error\n // if result is null.\n\n\n if ((0, _definition.isNonNullType)(returnType)) {\n var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result);\n\n if (completed === null) {\n throw new Error(\"Cannot return null for non-nullable field \".concat(info.parentType.name, \".\").concat(info.fieldName, \".\"));\n }\n\n return completed;\n } // If result value is null or undefined then return null.\n\n\n if (result == null) {\n return null;\n } // If field type is List, complete each item in the list with the inner type\n\n\n if ((0, _definition.isListType)(returnType)) {\n return completeListValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is a leaf type, Scalar or Enum, serialize to a valid value,\n // returning null if serialization is not possible.\n\n\n if ((0, _definition.isLeafType)(returnType)) {\n return completeLeafValue(returnType, result);\n } // If field type is an abstract type, Interface or Union, determine the\n // runtime Object type and complete for that type.\n\n\n if ((0, _definition.isAbstractType)(returnType)) {\n return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is Object, execute and complete all sub-selections.\n // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isObjectType)(returnType)) {\n return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result);\n } // istanbul ignore next (Not reachable. All possible output types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Cannot complete value of unexpected output type: ' + (0, _inspect.default)(returnType));\n}", "getFieldsForType (type) {\n\n // Use fields for type\n let useFields = (type) ? fields[type] : [];\n\n // Exclude category/link based on element\n if (type === 'element') {\n if (this.input.element_element.value === 'link') {\n useFields = useFields.filter(field => field !== 'category');\n } else {\n useFields = useFields.filter(field => field !== 'link');\n }\n }\n\n return useFields;\n }", "function getField(type, name, id) {\n var t = \"text\";\n if (type === 'number') {\n t = \"number\";\n } else if (type === 'boolean') {\n t = \"checkbox\";\n }\n return '<input type=\"' + t + '\" id=\"' + id + '\" name=\"' + name + '\">';\n}", "elementsOfType(types) {\n return _.chain(this.getTableEntries())\n .filter(e => {\n var elemType = getElemFieldVal(e, FIELD_TYPE);\n return _.includes(types, elemType);\n })\n .map(e => {\n return getElemFieldVal(e, FIELD_NAME);\n })\n .value();\n }", "toString() {\n var _d;\n // If an Object Type, we use the name of the Object Type\n let type = this.intermediateType ? (_d = this.intermediateType) === null || _d === void 0 ? void 0 : _d.name : this.type;\n // If configured as required, the GraphQL Type becomes required\n type = this.isRequired ? `${type}!` : type;\n // If configured with isXxxList, the GraphQL Type becomes a list\n type = this.isList || this.isRequiredList ? `[${type}]` : type;\n // If configured with isRequiredList, the list becomes required\n type = this.isRequiredList ? `${type}!` : type;\n return type;\n }", "function isOutputField(field) {\r\n if (field == 'none') {\r\n return false;\r\n }\r\n\r\n return true;\r\n}", "function u(t) {\n if (null == t) return {\n value: t\n };\n if (Array.isArray(t)) return {\n type: [t[0]],\n value: null\n };\n\n switch (typeof t) {\n case \"object\":\n return t.constructor && t.constructor.__accessorMetadata__ || t instanceof Date ? {\n type: t.constructor,\n value: t\n } : t;\n\n case \"boolean\":\n return {\n type: Boolean,\n value: t\n };\n\n case \"string\":\n return {\n type: String,\n value: t\n };\n\n case \"number\":\n return {\n type: Number,\n value: t\n };\n\n case \"function\":\n return {\n type: t,\n value: null\n };\n\n default:\n return;\n }\n }", "static fields () {\n return {\n id: this.increment(),\n label: this.attr(''),\n value: this.attr(''),\n type: this.attr(''),\n }\n }", "getType() {\n\t\treturn this.type;\n\t}", "getSimpleTypeAndValue(valueXTypes, def, defAsValue) {\n if (defAsValue == null) {\n defAsValue = new mdls.IdentifiableValue(def.identifier).withMinMax(1,1);\n }\n let type, value;\n const map = this._specs.maps.findByTargetAndIdentifier(this._target, def.identifier);\n if (map != null) {\n if (def.isEntry || def.isAbstract) {\n // Entries and abstracts should be represented as references to a resource/profile\n type = 'Reference';\n value = defAsValue;\n } else {\n const targets = common.getFHIRTypeHierarchy(this._fhir, common.TargetItem.parse(map.targetItem).target);\n const target = targets.find(t => valueXTypes.indexOf(t) !== -1);\n if (target) {\n // Non-entries should map to one of the choice types\n type = target;\n value = defAsValue;\n }\n }\n } else if (def.value !== undefined && def.value.effectiveCard.max <= 1 && def.fields.length == 0) {\n if (def.value instanceof mdls.ChoiceValue && this.choiceSupportsValueX(def.value)) {\n value = def.value;\n type = '[x]';\n } else if (def.value instanceof mdls.IdentifiableValue) {\n if (def.value.effectiveIdentifier.isPrimitive) {\n value = def.value;\n type = def.value.effectiveIdentifier.name;\n if (type === 'concept') {\n type = 'CodeableConcept';\n } else if (type === 'xhtml') {\n // xhtml is a weird type in FHIR and needs to be treated as a string\n type = 'string';\n }\n } else {\n const valueDef = this._specs.dataElements.findByIdentifier(def.value.effectiveIdentifier);\n if (valueDef) {\n return this.getSimpleTypeAndValue(valueXTypes, valueDef, def.value);\n }\n }\n }\n }\n return [type, value];\n }", "function types(type) {\n // XXX: type('string').validator('lte')\n // would default to `validator('gte')` if not explicitly defined.\n type('string')\n .use(String)\n .validator('gte', function gte(a, b){\n return a.length >= b.length;\n })\n .validator('gt', function gt(a, b){\n return a.length > b.length;\n });\n\n type('id');\n\n type('integer')\n .use(parseInt);\n\n type('float')\n .use(parseFloat);\n\n type('decimal')\n .use(parseFloat);\n\n type('number')\n .use(parseFloat);\n \n type('date')\n .use(parseDate);\n\n type('boolean')\n .use(parseBoolean);\n\n type('array')\n // XXX: test? test('asdf') // true/false if is type.\n // or `validate`\n .use(function(val){\n // XXX: handle more cases.\n return isArray(val)\n ? val\n : val.split(/,\\s*/);\n })\n .validator('lte', function lte(a, b){\n return a.length <= b.length;\n });\n\n function parseDate(val) {\n return isDate(val)\n ? val\n : new Date(val);\n }\n\n function parseBoolean(val) {\n // XXX: can be made more robust\n return !!val;\n }\n}", "type(_obj) {\n return this.typeChr(_obj);\n }", "primitiveType() {\n return this.setViewType;\n }", "function completeValue(exeContext, returnType, fieldNodes, info, path, result) {\n // If result is an Error, throw a located error.\n if (result instanceof Error) {\n throw result;\n } // If field type is NonNull, complete for inner type, and throw field error\n // if result is null.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isNonNullType\"])(returnType)) {\n var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result);\n\n if (completed === null) {\n throw new Error(\"Cannot return null for non-nullable field \".concat(info.parentType.name, \".\").concat(info.fieldName, \".\"));\n }\n\n return completed;\n } // If result value is null or undefined then return null.\n\n\n if (result == null) {\n return null;\n } // If field type is List, complete each item in the list with the inner type\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isListType\"])(returnType)) {\n return completeListValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is a leaf type, Scalar or Enum, serialize to a valid value,\n // returning null if serialization is not possible.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isLeafType\"])(returnType)) {\n return completeLeafValue(returnType, result);\n } // If field type is an abstract type, Interface or Union, determine the\n // runtime Object type and complete for that type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isAbstractType\"])(returnType)) {\n return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is Object, execute and complete all sub-selections.\n // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isObjectType\"])(returnType)) {\n return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result);\n } // istanbul ignore next (Not reachable. All possible output types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Cannot complete value of unexpected output type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(returnType));\n}", "function completeValue(exeContext, returnType, fieldNodes, info, path, result) {\n // If result is an Error, throw a located error.\n if (result instanceof Error) {\n throw result;\n } // If field type is NonNull, complete for inner type, and throw field error\n // if result is null.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isNonNullType\"])(returnType)) {\n var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result);\n\n if (completed === null) {\n throw new Error(\"Cannot return null for non-nullable field \".concat(info.parentType.name, \".\").concat(info.fieldName, \".\"));\n }\n\n return completed;\n } // If result value is null or undefined then return null.\n\n\n if (result == null) {\n return null;\n } // If field type is List, complete each item in the list with the inner type\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isListType\"])(returnType)) {\n return completeListValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is a leaf type, Scalar or Enum, serialize to a valid value,\n // returning null if serialization is not possible.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isLeafType\"])(returnType)) {\n return completeLeafValue(returnType, result);\n } // If field type is an abstract type, Interface or Union, determine the\n // runtime Object type and complete for that type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isAbstractType\"])(returnType)) {\n return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result);\n } // If field type is Object, execute and complete all sub-selections.\n // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_17__[\"isObjectType\"])(returnType)) {\n return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result);\n } // istanbul ignore next (Not reachable. All possible output types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Cannot complete value of unexpected output type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(returnType));\n}", "function mapSingleTypedValuesFields(options) {\n var valueFields = [];\n var valueField;\n \n if (options.typeField !== null) {\n valueField = {};\n valueField.value = options.typeField;\n valueField.customValueField = options.customValueField;\n valueField.types = options.types;\n valueField.title = $.i18n(options.i180nPackage, options.group);\n valueField.i180nPackage = options.i180nPackage;\n valueField.type = \"select\";\n valueFields.push(valueField);\n }\n\n //var prop = null;\n for (var prop in options.mapping) {\n valueField = {};\n valueField.value = options.mapping[prop];\n valueField.title = $.i18n(options.i180nPackage, options.group + '-' + prop);\n valueField.type = \"text\";\n valueField.rules = options.rules[prop];\n valueFields.push(valueField);\n }\n options.valueFields = valueFields;\n\n // $.extend (options, contactInfoEditorParams);\n\n }", "getType() {\n return this._data.type;\n }", "function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}", "function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}", "function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}", "function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}", "function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}", "function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}", "function generatePropType(type) {\n\tif (type.name === 'func') return 'function'\n\tif (type.name === 'custom') return type.raw\n\n\t/*\n\tFrom:\n\t{\n\t\t\"name\": \"union\",\n\t\t\"value\": [\n\t\t\t{\"name\": \"number\"},\n\t\t\t{\"name\": \"string\"}\n\t\t]\n\t}\n\tTo: number|string\n\t*/\n\tif (type.name === 'union') {\n\t\treturn type.value.map(generatePropType).join('|')\n\t}\n\n\t/*\n\tFrom:\n\t{\n\t\t\"name\": \"enum\",\n\t\t\"value\": [\n\t\t\t{\"value\": \"'a'\", \"computed\": false},\n\t\t\t{\"value\": \"'b'\", \"computed\": false},\n\t\t]\n\t}\n\tTo: 'a'|'b'\n\t*/\n\tif (type.name === 'enum') {\n\t\tif (Array.isArray(type.value)) {\n\t\t\treturn type.value.map(val => val.value).join('|')\n\t\t} else {\n\t\t\treturn type.value\n\t\t}\n\t}\n\n\treturn type.name\n}", "get valueField() {\n return this.i.jo;\n }", "get type () {\r\n\t\treturn this._type;\r\n\t}", "get type () {\r\n\t\treturn this._type;\r\n\t}", "convertType(dataType) {\n if (dataType.type == 'nil')\n return null;\n let convertedType = lodash_1.cloneDeep(dataType);\n delete convertedType.fileTypes;\n convertedType = this.parseIntegerValues(convertedType);\n switch (convertedType.type) {\n case 'number':\n convertedType.format = 'float';\n break;\n case 'datetime':\n convertedType.type = 'string';\n convertedType.format = 'date-time';\n break;\n case 'date-only':\n convertedType.type = 'string';\n convertedType.format = 'date';\n break;\n case 'time-only':\n convertedType.type = 'string';\n convertedType.format = 'date-time';\n break;\n case 'datetime-only':\n convertedType.type = 'string';\n convertedType.format = 'date-time';\n break;\n case 'file':\n convertedType.type = 'string';\n convertedType.format = 'byte';\n break;\n }\n return this.removeEmptyProperty(convertedType);\n }", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "getType () {\n\t\treturn this.type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type () {\n\t\treturn this._type;\n\t}", "get type()\n {\n //Returning the type value\n return this._type;\n }", "get type()\n {\n //Returning the type value\n return this._type;\n }", "getType() {\n return this.type;\n }", "get type () {\n return this._mem.type;\n }", "function mapSingleTypedValuesFields(options) {\r\n\tvar valueFields = new Array();\r\n\t\r\n\tif(options.typeField != null) {\r\n\t\tvar valueField = {};\r\n\t\tvalueField.value = options.typeField;\r\n\t\tvalueField.customValueField = options.customValueField;\r\n\t\tvalueField.types = options.types;\r\n\t\tvalueField.title = $.i18n(options.i180nPackage, options.group+'-'+prop);\r\n\t\tvalueField.i180nPackage = options.i180nPackage;\r\n\t\tvalueField.type = \"select\";\r\n\t\tvalueFields.push(valueField);\r\n\t}\r\n\t\r\n\tfor(prop in options.mapping) {\r\n\t\tvar valueField = {};\r\n\t\tvalueField.value = options.mapping[prop];\r\n\t\tvalueField.title = $.i18n(options.i180nPackage, options.group+'-'+prop);\r\n\t\tvalueField.type = \"text\";\r\n\t\tvalueField.rules = options.rules[prop];\r\n\t\tvalueFields.push(valueField);\r\n\t}\r\n\toptions.valueFields = valueFields;\r\n\t\r\n//\t$.extend (options, contactInfoEditorParams);\r\n\t\r\n}", "get type () {\n return TEXT;\n }" ]
[ "0.5662988", "0.56603956", "0.55651844", "0.55100775", "0.54723364", "0.5378661", "0.5357482", "0.53436714", "0.5340024", "0.53394103", "0.5334371", "0.53326994", "0.5330229", "0.5322059", "0.5296827", "0.52539337", "0.52539337", "0.52539337", "0.52426416", "0.52426416", "0.52276987", "0.5215231", "0.52108616", "0.5209287", "0.5209287", "0.5209287", "0.5205502", "0.5197678", "0.51783156", "0.51530474", "0.5149121", "0.514796", "0.5112385", "0.5112385", "0.5112385", "0.51023585", "0.50976515", "0.50964695", "0.50964695", "0.5093816", "0.50927764", "0.5077436", "0.5074991", "0.5071992", "0.50677013", "0.50557584", "0.50450885", "0.5038067", "0.5029709", "0.50166684", "0.5015137", "0.50149024", "0.50149024", "0.50121504", "0.500876", "0.500121", "0.500121", "0.500121", "0.500121", "0.500121", "0.500121", "0.49994022", "0.49885538", "0.49840343", "0.49840343", "0.4976703", "0.4961176", "0.4961176", "0.4961176", "0.4961176", "0.4961176", "0.4961176", "0.4961176", "0.4961176", "0.4961176", "0.4961176", "0.4961176", "0.4961176", "0.49397072", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.4927058", "0.49200228", "0.49200228", "0.49172747", "0.4909428", "0.49081364", "0.49034095" ]
0.5196147
29
These types may describe types which may be leaf values.
function isLeafType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLEnumType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}", "function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}", "function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}", "function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}", "function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}", "function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}", "function isLeafType(type) {\n\t var namedType = getNamedType(type);\n\t return namedType instanceof GraphQLScalarType || namedType instanceof GraphQLEnumType;\n\t}", "function parse_type() {\n tree.addNode('type', 'branch');\n if (foundTokensCopy[parseCounter][1] == 'int') {\n match('int', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'string') {\n match('string', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'boolean') {\n match('boolean', parseCounter);\n parseCounter++;\n }\n tree.endChildren();\n\n}", "function isValidLiteralValue(type, valueNode) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if (!valueNode || valueNode.kind === Kind.NULL) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidLiteralValue(type.ofType, valueNode);\n }\n\n if (!valueNode || valueNode.kind === Kind.NULL) {\n return [];\n }\n\n // This function only tests literals, and assumes variables will provide\n // values of the correct type.\n if (valueNode.kind === Kind.VARIABLE) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n return valueNode.values.reduce(function (acc, item, index) {\n var errors = isValidLiteralValue(itemType, item);\n return acc.concat(errors.map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n }, []);\n }\n return isValidLiteralValue(itemType, valueNode);\n }\n\n // Input objects check each defined field and look for undefined fields.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== Kind.OBJECT) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var errors = [];\n\n // Ensure every provided field is defined.\n var fieldNodes = valueNode.fields;\n fieldNodes.forEach(function (providedFieldNode) {\n if (!fields[providedFieldNode.name.value]) {\n errors.push('In field \"' + providedFieldNode.name.value + '\": Unknown field.');\n }\n });\n\n // Ensure every defined field is valid.\n var fieldNodeMap = (0, _keyMap2.default)(fieldNodes, function (fieldNode) {\n return fieldNode.name.value;\n });\n Object.keys(fields).forEach(function (fieldName) {\n var result = isValidLiteralValue(fields[fieldName].type, fieldNodeMap[fieldName] && fieldNodeMap[fieldName].value);\n errors.push.apply(errors, result.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n }));\n });\n\n return errors;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n // Scalars determine if a literal values is valid.\n if (!type.isValidLiteral(valueNode)) {\n return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueNode) + '.'];\n }\n\n return [];\n}", "function isValidLiteralValue(type, valueNode) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if (!valueNode || valueNode.kind === Kind.NULL) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidLiteralValue(type.ofType, valueNode);\n }\n\n if (!valueNode || valueNode.kind === Kind.NULL) {\n return [];\n }\n\n // This function only tests literals, and assumes variables will provide\n // values of the correct type.\n if (valueNode.kind === Kind.VARIABLE) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n return valueNode.values.reduce(function (acc, item, index) {\n var errors = isValidLiteralValue(itemType, item);\n return acc.concat(errors.map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n }, []);\n }\n return isValidLiteralValue(itemType, valueNode);\n }\n\n // Input objects check each defined field and look for undefined fields.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== Kind.OBJECT) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var errors = [];\n\n // Ensure every provided field is defined.\n var fieldNodes = valueNode.fields;\n fieldNodes.forEach(function (providedFieldNode) {\n if (!fields[providedFieldNode.name.value]) {\n errors.push('In field \"' + providedFieldNode.name.value + '\": Unknown field.');\n }\n });\n\n // Ensure every defined field is valid.\n var fieldNodeMap = (0, _keyMap2.default)(fieldNodes, function (fieldNode) {\n return fieldNode.name.value;\n });\n Object.keys(fields).forEach(function (fieldName) {\n var result = isValidLiteralValue(fields[fieldName].type, fieldNodeMap[fieldName] && fieldNodeMap[fieldName].value);\n errors.push.apply(errors, result.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n }));\n });\n\n return errors;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n // Scalars determine if a literal values is valid.\n if (!type.isValidLiteral(valueNode)) {\n return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueNode) + '.'];\n }\n\n return [];\n}", "function isValidLiteralValue(type, valueNode) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if (!valueNode || valueNode.kind === _kinds.NULL) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidLiteralValue(type.ofType, valueNode);\n }\n\n if (!valueNode || valueNode.kind === _kinds.NULL) {\n return [];\n }\n\n // This function only tests literals, and assumes variables will provide\n // values of the correct type.\n if (valueNode.kind === _kinds.VARIABLE) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === _kinds.LIST) {\n return valueNode.values.reduce(function (acc, item, index) {\n var errors = isValidLiteralValue(itemType, item);\n return acc.concat(errors.map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n }, []);\n }\n return isValidLiteralValue(itemType, valueNode);\n }\n\n // Input objects check each defined field and look for undefined fields.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== _kinds.OBJECT) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var errors = [];\n\n // Ensure every provided field is defined.\n var fieldNodes = valueNode.fields;\n fieldNodes.forEach(function (providedFieldNode) {\n if (!fields[providedFieldNode.name.value]) {\n errors.push('In field \"' + providedFieldNode.name.value + '\": Unknown field.');\n }\n });\n\n // Ensure every defined field is valid.\n var fieldNodeMap = (0, _keyMap2.default)(fieldNodes, function (fieldNode) {\n return fieldNode.name.value;\n });\n Object.keys(fields).forEach(function (fieldName) {\n var result = isValidLiteralValue(fields[fieldName].type, fieldNodeMap[fieldName] && fieldNodeMap[fieldName].value);\n errors.push.apply(errors, result.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n }));\n });\n\n return errors;\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n // Scalars determine if a literal values is valid.\n if (!type.isValidLiteral(valueNode)) {\n return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueNode) + '.'];\n }\n\n return [];\n}", "function Type(){\n\t\t\tthis.array='Array';\n\t\t\tthis.object='object';\n\t\t\tthis.string='string';\n\t\t\tthis.fn='function';\n\t\t\tthis.number='number';\n\t\t}", "get isLeaf() {\n return this.type.isLeaf;\n }", "function tt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? X(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : Gn(\"Invalid value type: \" + JSON.stringify(t));\n}", "function Type() {}", "function isValidLiteralValue(type, valueAST) {\n\t // A value must be provided if the type is non-null.\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t if (!valueAST) {\n\t if (type.ofType.name) {\n\t return ['Expected \"' + String(type.ofType.name) + '!\", found null.'];\n\t }\n\t return ['Expected non-null value, found null.'];\n\t }\n\t return isValidLiteralValue(type.ofType, valueAST);\n\t }\n\n\t if (!valueAST) {\n\t return [];\n\t }\n\n\t // This function only tests literals, and assumes variables will provide\n\t // values of the correct type.\n\t if (valueAST.kind === _kinds.VARIABLE) {\n\t return [];\n\t }\n\n\t // Lists accept a non-list value as a list of one.\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if (valueAST.kind === _kinds.LIST) {\n\t return {\n\t v: valueAST.values.reduce(function (acc, itemAST, index) {\n\t var errors = isValidLiteralValue(itemType, itemAST);\n\t return acc.concat(errors.map(function (error) {\n\t return 'In element #' + index + ': ' + error;\n\t }));\n\t }, [])\n\t };\n\t }\n\t return {\n\t v: isValidLiteralValue(itemType, valueAST)\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t // Input objects check each defined field and look for undefined fields.\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret2 = function () {\n\t if (valueAST.kind !== _kinds.OBJECT) {\n\t return {\n\t v: ['Expected \"' + type.name + '\", found not an object.']\n\t };\n\t }\n\t var fields = type.getFields();\n\n\t var errors = [];\n\n\t // Ensure every provided field is defined.\n\t var fieldASTs = valueAST.fields;\n\t fieldASTs.forEach(function (providedFieldAST) {\n\t if (!fields[providedFieldAST.name.value]) {\n\t errors.push('In field \"' + providedFieldAST.name.value + '\": Unknown field.');\n\t }\n\t });\n\n\t // Ensure every defined field is valid.\n\t var fieldASTMap = (0, _keyMap2.default)(fieldASTs, function (fieldAST) {\n\t return fieldAST.name.value;\n\t });\n\t Object.keys(fields).forEach(function (fieldName) {\n\t var result = isValidLiteralValue(fields[fieldName].type, fieldASTMap[fieldName] && fieldASTMap[fieldName].value);\n\t errors.push.apply(errors, result.map(function (error) {\n\t return 'In field \"' + fieldName + '\": ' + error;\n\t }));\n\t });\n\n\t return {\n\t v: errors\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n\t // Scalar/Enum input checks to ensure the type can parse the value to\n\t // a non-null value.\n\t var parseResult = type.parseLiteral(valueAST);\n\t if ((0, _isNullish2.default)(parseResult)) {\n\t return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueAST) + '.'];\n\t }\n\n\t return [];\n\t}", "function ScalarLeafs(context) {\n\t return {\n\t Field: function Field(node) {\n\t var type = context.getType();\n\t if (type) {\n\t if ((0, _typeDefinition.isLeafType)(type)) {\n\t if (node.selectionSet) {\n\t context.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(node.name.value, type), [node.selectionSet]));\n\t }\n\t } else if (!node.selectionSet) {\n\t context.reportError(new _error.GraphQLError(requiredSubselectionMessage(node.name.value, type), [node]));\n\t }\n\t }\n\t }\n\t };\n\t}", "function isSimpleValue (type) {\n switch(type) {\n case 'array':\n case 'object':\n return false;\n break;\n default:\n return true;\n break;\n }\n}", "function EqnLeaf()\n{\n // type - operator, number, id, variable - defined and wont change\n this.leafType = 0;\n this.leafValue = null;\n}", "function M(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? O(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : _e(\"Invalid value type: \" + JSON.stringify(t));\n}", "function TypeRecursion() {}", "get Types() {\n return (\n {\n '': this.calculateType(),\n 'whole': 'w',\n 'half': 'h',\n 'quarter': 'q',\n 'eighth': '8',\n '16th': '16',\n '32nd': '32',\n '64th': '64',\n '128th': '128',\n '256th': '256',\n '512th': '512',\n '1024th': '1024',\n });\n }", "function typeEval(d) {\n if (d.type === \"\") {\n d.children.forEach(typeEval);\n //if children, count children failure #\n if (d.children) {\n\n var failureCount = 0;\n var goodCount = 0;\n\n for (var i = 0; i < d.children.length; i++) {\n if ( d.children[i].type === 1 ) {\n failureCount++;\n } else if ( d.children[i].type === 0 ) {\n goodCount++;\n }\n }\n\n if (failureCount >= d.children.length/2) {\n console.log( failureCount + \" = red \" );\n d.type = 1;\n } else if (goodCount >= d.children.length/2) {\n d.type = 0;\n }\n\n }\n }\n}", "function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n if (type) {\n if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type))) {\n if (node.selectionSet) {\n context.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(node.name.value, type), [node.selectionSet]));\n }\n } else if (!node.selectionSet) {\n context.reportError(new _error.GraphQLError(requiredSubselectionMessage(node.name.value, type), [node]));\n }\n }\n }\n };\n}", "set type(value) {}", "function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n if (type) {\n if ((0, _typeDefinition.isLeafType)(type)) {\n if (node.selectionSet) {\n context.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(node.name.value, type), [node.selectionSet]));\n }\n } else if (!node.selectionSet) {\n context.reportError(new _error.GraphQLError(requiredSubselectionMessage(node.name.value, type), [node]));\n }\n }\n }\n };\n}", "function StructType() {}", "genStructure(type) {\n let children = [];\n type = type || this.type || '';\n const bone = this.rootTypes[type] || ''; // End of recursion, do nothing\n\n /* eslint-disable-next-line no-empty, brace-style */\n\n if (type === bone) {} // Array of values - e.g. 'heading, paragraph, text@2'\n else if (type.indexOf(',') > -1) return this.mapBones(type); // Array of values - e.g. 'paragraph@4'\n else if (type.indexOf('@') > -1) return this.genBones(type); // Array of values - e.g. 'card@2'\n else if (bone.indexOf(',') > -1) children = this.mapBones(bone); // Array of values - e.g. 'list-item@2'\n else if (bone.indexOf('@') > -1) children = this.genBones(bone); // Single value - e.g. 'card-heading'\n else if (bone) children.push(this.genStructure(bone));\n\n return [this.genBone(type, children)];\n }", "genStructure(type) {\n let children = [];\n type = type || this.type || '';\n const bone = this.rootTypes[type] || ''; // End of recursion, do nothing\n\n /* eslint-disable-next-line no-empty, brace-style */\n\n if (type === bone) {} // Array of values - e.g. 'heading, paragraph, text@2'\n else if (type.indexOf(',') > -1) return this.mapBones(type); // Array of values - e.g. 'paragraph@4'\n else if (type.indexOf('@') > -1) return this.genBones(type); // Array of values - e.g. 'card@2'\n else if (bone.indexOf(',') > -1) children = this.mapBones(bone); // Array of values - e.g. 'list-item@2'\n else if (bone.indexOf('@') > -1) children = this.genBones(bone); // Single value - e.g. 'card-heading'\n else if (bone) children.push(this.genStructure(bone));\n\n return [this.genBone(type, children)];\n }", "function Type(schema, opts) {\n var type;\n if (LOGICAL_TYPE) {\n type = LOGICAL_TYPE;\n UNDERLYING_TYPES.push([LOGICAL_TYPE, this]);\n LOGICAL_TYPE = null;\n } else {\n type = this;\n }\n\n // Lazily instantiated hash string. It will be generated the first time the\n // type's default fingerprint is computed (for example when using `equals`).\n // We use a mutable object since types are frozen after instantiation.\n this._hash = new Hash();\n this.name = undefined;\n this.aliases = undefined;\n this.doc = (schema && schema.doc) ? '' + schema.doc : undefined;\n\n if (schema) {\n // This is a complex (i.e. non-primitive) type.\n var name = schema.name;\n var namespace = schema.namespace === undefined ?\n opts && opts.namespace :\n schema.namespace;\n if (name !== undefined) {\n // This isn't an anonymous type.\n name = maybeQualify(name, namespace);\n if (isPrimitive(name)) {\n // Avro doesn't allow redefining primitive names.\n throw new Error(f('cannot rename primitive type: %j', name));\n }\n var registry = opts && opts.registry;\n if (registry) {\n if (registry[name] !== undefined) {\n throw new Error(f('duplicate type name: %s', name));\n }\n registry[name] = type;\n }\n } else if (opts && opts.noAnonymousTypes) {\n throw new Error(f('missing name property in schema: %j', schema));\n }\n this.name = name;\n this.aliases = schema.aliases ?\n schema.aliases.map(function (s) { return maybeQualify(s, namespace); }) :\n [];\n }\n}", "function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n var selectionSet = node.selectionSet;\n\n if (type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"isLeafType\"])(Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"getNamedType\"])(type))) {\n if (selectionSet) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](noSubselectionAllowedMessage(node.name.value, Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type)), selectionSet));\n }\n } else if (!selectionSet) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](requiredSubselectionMessage(node.name.value, Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type)), node));\n }\n }\n }\n };\n}", "function isValidLiteralValue(type, valueAST) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if (!valueAST) {\n if (type.ofType.name) {\n return ['Expected \"' + type.ofType.name + '!\", found null.'];\n }\n return ['Expected non-null value, found null.'];\n }\n return isValidLiteralValue(type.ofType, valueAST);\n }\n\n if (!valueAST) {\n return [];\n }\n\n // This function only tests literals, and assumes variables will provide\n // values of the correct type.\n if (valueAST.kind === _kinds.VARIABLE) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var _ret = function () {\n var itemType = type.ofType;\n if (valueAST.kind === _kinds.LIST) {\n return {\n v: valueAST.values.reduce(function (acc, itemAST, index) {\n var errors = isValidLiteralValue(itemType, itemAST);\n return acc.concat(errors.map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n }, [])\n };\n }\n return {\n v: isValidLiteralValue(itemType, valueAST)\n };\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : (0, _typeof3.default)(_ret)) === \"object\") return _ret.v;\n }\n\n // Input objects check each defined field and look for undefined fields.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueAST.kind !== _kinds.OBJECT) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var errors = [];\n\n // Ensure every provided field is defined.\n var fieldASTs = valueAST.fields;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = (0, _getIterator3.default)(fieldASTs), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var providedFieldAST = _step.value;\n\n if (!fields[providedFieldAST.name.value]) {\n errors.push('In field \"' + providedFieldAST.name.value + '\": Unknown field.');\n }\n }\n\n // Ensure every defined field is valid.\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var fieldASTMap = (0, _keyMap2.default)(fieldASTs, function (fieldAST) {\n return fieldAST.name.value;\n });\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n var _loop = function _loop() {\n var fieldName = _step2.value;\n\n var result = isValidLiteralValue(fields[fieldName].type, fieldASTMap[fieldName] && fieldASTMap[fieldName].value);\n errors.push.apply(errors, (0, _toConsumableArray3.default)(result.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n })));\n };\n\n for (var _iterator2 = (0, _getIterator3.default)((0, _keys2.default)(fields)), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n _loop();\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return errors;\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n // Scalar/Enum input checks to ensure the type can parse the value to\n // a non-null value.\n var parseResult = type.parseLiteral(valueAST);\n if ((0, _isNullish2.default)(parseResult)) {\n return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueAST) + '.'];\n }\n\n return [];\n}", "getSimpleTypeAndValue(valueXTypes, def, defAsValue) {\n if (defAsValue == null) {\n defAsValue = new mdls.IdentifiableValue(def.identifier).withMinMax(1,1);\n }\n let type, value;\n const map = this._specs.maps.findByTargetAndIdentifier(this._target, def.identifier);\n if (map != null) {\n if (def.isEntry || def.isAbstract) {\n // Entries and abstracts should be represented as references to a resource/profile\n type = 'Reference';\n value = defAsValue;\n } else {\n const targets = common.getFHIRTypeHierarchy(this._fhir, common.TargetItem.parse(map.targetItem).target);\n const target = targets.find(t => valueXTypes.indexOf(t) !== -1);\n if (target) {\n // Non-entries should map to one of the choice types\n type = target;\n value = defAsValue;\n }\n }\n } else if (def.value !== undefined && def.value.effectiveCard.max <= 1 && def.fields.length == 0) {\n if (def.value instanceof mdls.ChoiceValue && this.choiceSupportsValueX(def.value)) {\n value = def.value;\n type = '[x]';\n } else if (def.value instanceof mdls.IdentifiableValue) {\n if (def.value.effectiveIdentifier.isPrimitive) {\n value = def.value;\n type = def.value.effectiveIdentifier.name;\n if (type === 'concept') {\n type = 'CodeableConcept';\n } else if (type === 'xhtml') {\n // xhtml is a weird type in FHIR and needs to be treated as a string\n type = 'string';\n }\n } else {\n const valueDef = this._specs.dataElements.findByIdentifier(def.value.effectiveIdentifier);\n if (valueDef) {\n return this.getSimpleTypeAndValue(valueXTypes, valueDef, def.value);\n }\n }\n }\n }\n return [type, value];\n }", "getType() {}", "function isTypoTypeof(left, right, state) {\n var values;\n \n if (state.option.notypeof)\n return false;\n \n if (!left || !right)\n return false;\n \n values = state.inESNext() ? typeofValues.es6 : typeofValues.es3;\n \n if (right.type === \"(identifier)\" && right.value === \"typeof\" && left.type === \"(string)\")\n return !_.contains(values, left.value);\n \n return false;\n }", "function MapType(schema, opts) {\n Type.call(this);\n if (!schema.values) {\n throw new Error(f('missing map values: %j', schema));\n }\n this.valuesType = Type.forSchema(schema.values, opts);\n this._branchConstructor = this._createBranchConstructor();\n Object.freeze(this);\n}", "function isValidLiteralValue(type, valueNode) {\n var emptySchema = new _type_schema__WEBPACK_IMPORTED_MODULE_3__[\"GraphQLSchema\"]({});\n var emptyDoc = {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].DOCUMENT,\n definitions: []\n };\n var typeInfo = new _TypeInfo__WEBPACK_IMPORTED_MODULE_0__[\"TypeInfo\"](emptySchema, undefined, type);\n var context = new _validation_ValidationContext__WEBPACK_IMPORTED_MODULE_5__[\"ValidationContext\"](emptySchema, emptyDoc, typeInfo);\n var visitor = Object(_validation_rules_ValuesOfCorrectType__WEBPACK_IMPORTED_MODULE_4__[\"ValuesOfCorrectType\"])(context);\n Object(_language_visitor__WEBPACK_IMPORTED_MODULE_2__[\"visit\"])(valueNode, Object(_language_visitor__WEBPACK_IMPORTED_MODULE_2__[\"visitWithTypeInfo\"])(typeInfo, visitor));\n return context.getErrors();\n}", "function validateCompoundWithType(attribute, values) {\n\t\t for(var i in values) {\n\t\t var value = values[i];\n\t\t if(typeof(value) !== 'object') {\n\t\t\t errors.push([attribute + '-' + i, \"not-an-object\"]);\n\t\t } else if(! value.type) {\n\t\t\t errors.push([attribute + '-' + i, \"missing-type\"]);\n\t\t } else if(! value.value) { // empty values are not allowed.\n\t\t\t errors.push([attribute + '-' + i, \"missing-value\"]);\n\t\t }\n\t\t }\n\t }", "function parseBasicTypeExpression() {\n var context, startIndex;\n switch (token) {\n case Token.STAR:\n consume(Token.STAR);\n return maybeAddRange({\n type: Syntax.AllLiteral\n }, [previous - 1, previous]);\n\n case Token.LPAREN:\n return parseUnionType();\n\n case Token.LBRACK:\n return parseArrayType();\n\n case Token.LBRACE:\n return parseRecordType();\n\n case Token.NAME:\n startIndex = index - value.length;\n\n if (value === 'null') {\n consume(Token.NAME);\n return maybeAddRange({\n type: Syntax.NullLiteral\n }, [startIndex, previous]);\n }\n\n if (value === 'undefined') {\n consume(Token.NAME);\n return maybeAddRange({\n type: Syntax.UndefinedLiteral\n }, [startIndex, previous]);\n }\n\n if (value === 'true' || value === 'false') {\n consume(Token.NAME);\n return maybeAddRange({\n type: Syntax.BooleanLiteralType,\n value: value === 'true'\n }, [startIndex, previous]);\n }\n\n context = Context.save();\n if (value === 'function') {\n try {\n return parseFunctionType();\n } catch (e) {\n context.restore();\n }\n }\n\n return parseTypeName();\n\n case Token.STRING:\n next();\n return maybeAddRange({\n type: Syntax.StringLiteralType,\n value: value\n }, [previous - value.length - 2, previous]);\n\n case Token.NUMBER:\n next();\n return maybeAddRange({\n type: Syntax.NumericLiteralType,\n value: value\n }, [previous - String(value).length, previous]);\n\n default:\n utility.throwError('unexpected token');\n }\n }", "function types(type) {\n // XXX: type('string').validator('lte')\n // would default to `validator('gte')` if not explicitly defined.\n type('string')\n .use(String)\n .validator('gte', function gte(a, b){\n return a.length >= b.length;\n })\n .validator('gt', function gt(a, b){\n return a.length > b.length;\n });\n\n type('id');\n\n type('integer')\n .use(parseInt);\n\n type('float')\n .use(parseFloat);\n\n type('decimal')\n .use(parseFloat);\n\n type('number')\n .use(parseFloat);\n \n type('date')\n .use(parseDate);\n\n type('boolean')\n .use(parseBoolean);\n\n type('array')\n // XXX: test? test('asdf') // true/false if is type.\n // or `validate`\n .use(function(val){\n // XXX: handle more cases.\n return isArray(val)\n ? val\n : val.split(/,\\s*/);\n })\n .validator('lte', function lte(a, b){\n return a.length <= b.length;\n });\n\n function parseDate(val) {\n return isDate(val)\n ? val\n : new Date(val);\n }\n\n function parseBoolean(val) {\n // XXX: can be made more robust\n return !!val;\n }\n}", "function typeOfValue(v) {\n var t = typeof v;\n if (t != \"object\") return t; // number, string, boolean, undefined\n if (iMap.isMap(v)) return \"map\";\n if (iSet.isSet(v)) return \"set\";\n return \"list\";\n}", "baseType() {\n\t\tconst typ = this.type;\n\t\tif (this.isList()) {\n\t\t\t// \"array[<value-type>]\" so remove the leading \"array[\" and trailing \"]\"\n\t\t\treturn typ.substring(6, this.type.length - 1);\n\t\t} else if (this.isMapValue()) {\n\t\t\t// \"map[<key-type>,<value-type>]\" so remove everything up to and including \",\" and drop the trailing \"]\"\n\t\t\treturn typ.substring(typ.indexOf(\",\") + 1, this.type.length - 1).trim();\n\t\t} else if (this.valueRestriction && !this.type) { // assume String for enums\n\t\t\treturn Type.STRING;\n\t\t}\n\t\treturn typ;\n\t}", "getType() {\n return this.root.getType();\n }", "function Type$2(schema, opts) {\n var type;\n if (LOGICAL_TYPE) {\n type = LOGICAL_TYPE;\n UNDERLYING_TYPES.push([LOGICAL_TYPE, this]);\n LOGICAL_TYPE = null;\n } else {\n type = this;\n }\n\n // Lazily instantiated hash string. It will be generated the first time the\n // type's default fingerprint is computed (for example when using `equals`).\n // We use a mutable object since types are frozen after instantiation.\n this._hash = new Hash();\n this.name = undefined;\n this.aliases = undefined;\n this.doc = (schema && schema.doc) ? '' + schema.doc : undefined;\n\n if (schema) {\n // This is a complex (i.e. non-primitive) type.\n var name = schema.name;\n var namespace = schema.namespace === undefined ?\n opts && opts.namespace :\n schema.namespace;\n if (name !== undefined) {\n // This isn't an anonymous type.\n name = qualify(name, namespace);\n if (isPrimitive(name)) {\n // Avro doesn't allow redefining primitive names.\n throw new Error(f('cannot rename primitive type: %j', name));\n }\n var registry = opts && opts.registry;\n if (registry) {\n if (registry[name] !== undefined) {\n throw new Error(f('duplicate type name: %s', name));\n }\n registry[name] = type;\n }\n } else if (opts && opts.noAnonymousTypes) {\n throw new Error(f('missing name property in schema: %j', schema));\n }\n this.name = name;\n this.aliases = schema.aliases ?\n schema.aliases.map(function (s) { return qualify(s, namespace); }) :\n [];\n }\n}", "function LogicalType(schema, opts) {\n this._logicalTypeName = schema.logicalType;\n Type.call(this);\n LOGICAL_TYPE = this;\n try {\n this._underlyingType = Type.forSchema(schema, opts);\n } finally {\n LOGICAL_TYPE = null;\n // Remove the underlying type now that we're done instantiating. Note that\n // in some (rare) cases, it might not have been inserted; for example, if\n // this constructor was manually called with an already instantiated type.\n var l = UNDERLYING_TYPES.length;\n if (l && UNDERLYING_TYPES[l - 1][0] === this) {\n UNDERLYING_TYPES.pop();\n }\n }\n // We create a separate branch constructor for logical types to keep them\n // monomorphic.\n if (Type.isType(this.underlyingType, 'union')) {\n this._branchConstructor = this.underlyingType._branchConstructor;\n } else {\n this._branchConstructor = this.underlyingType._createBranchConstructor();\n }\n // We don't freeze derived types to allow arbitrary properties. Implementors\n // can still do so in the subclass' constructor at their convenience.\n}", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function completeLeafValue(returnType, result) {\n !returnType.serialize ? (0, _invariant2.default)(0, 'Missing serialize method on type') : void 0;\n var serializedResult = returnType.serialize(result);\n if ((0, _isNullish2.default)(serializedResult)) {\n throw new Error('Expected a value of type \"' + String(returnType) + '\" but ' + ('received: ' + String(result)));\n }\n return serializedResult;\n}", "function Type() {\r\n}", "function Type() {\n}", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "function LogicalType(schema, opts) {\n this._logicalTypeName = schema.logicalType;\n Type$2.call(this);\n LOGICAL_TYPE = this;\n try {\n this._underlyingType = Type$2.forSchema(schema, opts);\n } finally {\n LOGICAL_TYPE = null;\n // Remove the underlying type now that we're done instantiating. Note that\n // in some (rare) cases, it might not have been inserted; for example, if\n // this constructor was manually called with an already instantiated type.\n var l = UNDERLYING_TYPES.length;\n if (l && UNDERLYING_TYPES[l - 1][0] === this) {\n UNDERLYING_TYPES.pop();\n }\n }\n // We create a separate branch constructor for logical types to keep them\n // monomorphic.\n if (Type$2.isType(this.underlyingType, 'union')) {\n this._branchConstructor = this.underlyingType._branchConstructor;\n } else {\n this._branchConstructor = this.underlyingType._createBranchConstructor();\n }\n // We don't freeze derived types to allow arbitrary properties. Implementors\n // can still do so in the subclass' constructor at their convenience.\n}", "function completeLeafValue(returnType, result) {\n !returnType.serialize ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(0, 'Missing serialize method on type') : void 0;\n var serializedResult = returnType.serialize(result);\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(serializedResult)) {\n throw new Error(\"Expected a value of type \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(returnType), \"\\\" but \") + \"received: \".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(result)));\n }\n\n return serializedResult;\n}", "function MapType(schema, opts) {\n Type$2.call(this);\n if (!schema.values) {\n throw new Error(f('missing map values: %j', schema));\n }\n this.valuesType = Type$2.forSchema(schema.values, opts);\n this._branchConstructor = this._createBranchConstructor();\n Object.freeze(this);\n}", "function completeLeafValue(returnType, result) {\n var serializedResult = returnType.serialize(result);\n\n if (serializedResult === undefined) {\n throw new Error(\"Expected a value of type \\\"\".concat((0, _inspect.default)(returnType), \"\\\" but \") + \"received: \".concat((0, _inspect.default)(result)));\n }\n\n return serializedResult;\n}", "function completeLeafValue(returnType, result) {\n var serializedResult = returnType.serialize(result);\n\n if (serializedResult === undefined) {\n throw new Error(\"Expected a value of type \\\"\".concat((0, _inspect.default)(returnType), \"\\\" but \") + \"received: \".concat((0, _inspect.default)(result)));\n }\n\n return serializedResult;\n}", "function isNodeType(type) {\n\t return t.isType(this.type, type);\n\t}", "function isNodeType(type) {\n\t return t.isType(this.type, type);\n\t}", "function isNodeType(type) {\n\t return t.isType(this.type, type);\n\t}", "function Literal(node) {\n\t var value = node.value;\n\t if (typeof value === \"string\") return t.stringTypeAnnotation();\n\t if (typeof value === \"number\") return t.numberTypeAnnotation();\n\t if (typeof value === \"boolean\") return t.booleanTypeAnnotation();\n\t if (value === null) return t.voidTypeAnnotation();\n\t if (node.regex) return t.genericTypeAnnotation(t.identifier(\"RegExp\"));\n\t}", "function Literal(node) {\n\t var value = node.value;\n\t if (typeof value === \"string\") return t.stringTypeAnnotation();\n\t if (typeof value === \"number\") return t.numberTypeAnnotation();\n\t if (typeof value === \"boolean\") return t.booleanTypeAnnotation();\n\t if (value === null) return t.voidTypeAnnotation();\n\t if (node.regex) return t.genericTypeAnnotation(t.identifier(\"RegExp\"));\n\t}", "function isNodeType(type /*: string*/) /*: boolean*/ {\n\t return t.isType(this.type, type);\n\t}", "function isNodeType(type /*: string*/) /*: boolean*/ {\n\t return t.isType(this.type, type);\n\t}", "function ValidateTypeValue(type, value)\n{\n\tif (type == \"Bool\")\n\t{\n\t\tif (value != \"true\" && value != \"false\")\n\t\t{\n\t\t\treturn \"default value must be either 'True' or 'False' for Bool\";\n\t\t}\n\t}\n\telse if (type == \"Int\" || type == \"Float\")\n\t{\n\t\tif (isNaN(value))\n\t\t{\n\t\t\treturn \"default value must be digit(s) for Int or Float\";\n\t\t}\n\t}\n\telse\n\t{\n\t\t// everything is fine as a string or custom type\n\t\treturn null;\n\t}\n}", "function ScalarLeafsRule(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n var selectionSet = node.selectionSet;\n\n if (type) {\n if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type))) {\n if (selectionSet) {\n var fieldName = node.name.value;\n var typeStr = (0, _inspect.default)(type);\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(fieldName, \"\\\" must not have a selection since type \\\"\").concat(typeStr, \"\\\" has no subfields.\"), selectionSet));\n }\n } else if (!selectionSet) {\n var _fieldName = node.name.value;\n\n var _typeStr = (0, _inspect.default)(type);\n\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(_fieldName, \"\\\" of type \\\"\").concat(_typeStr, \"\\\" must have a selection of subfields. Did you mean \\\"\").concat(_fieldName, \" { ... }\\\"?\"), node));\n }\n }\n }\n };\n}", "function ScalarLeafsRule(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n var selectionSet = node.selectionSet;\n\n if (type) {\n if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type))) {\n if (selectionSet) {\n var fieldName = node.name.value;\n var typeStr = (0, _inspect.default)(type);\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(fieldName, \"\\\" must not have a selection since type \\\"\").concat(typeStr, \"\\\" has no subfields.\"), selectionSet));\n }\n } else if (!selectionSet) {\n var _fieldName = node.name.value;\n\n var _typeStr = (0, _inspect.default)(type);\n\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(_fieldName, \"\\\" of type \\\"\").concat(_typeStr, \"\\\" must have a selection of subfields. Did you mean \\\"\").concat(_fieldName, \" { ... }\\\"?\"), node));\n }\n }\n }\n };\n}", "function hasType (_node, _types) {\n\n\t\tvar thisType = _node.type;\n\n\t\tfor (var i = 0, l = _types.length; i < l; i++) {\n\n\t\t\tif (_types[i] === thisType || _types[i] === 'all') {\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "topLevelResultType(t) {\n return t.kind === \"any\" || t.kind === \"none\" ? \"object\" : this.csType(t);\n }", "function parseTypeExpression() {\n var expr, rangeStart;\n\n if (token === Token.QUESTION) {\n rangeStart = index - 1;\n consume(Token.QUESTION);\n if (token === Token.COMMA || token === Token.EQUAL || token === Token.RBRACE ||\n token === Token.RPAREN || token === Token.PIPE || token === Token.EOF ||\n token === Token.RBRACK || token === Token.GT) {\n return maybeAddRange({\n type: Syntax.NullableLiteral\n }, [rangeStart, previous]);\n }\n return maybeAddRange({\n type: Syntax.NullableType,\n expression: parseBasicTypeExpression(),\n prefix: true\n }, [rangeStart, previous]);\n } else if (token === Token.BANG) {\n rangeStart = index - 1;\n consume(Token.BANG);\n return maybeAddRange({\n type: Syntax.NonNullableType,\n expression: parseBasicTypeExpression(),\n prefix: true\n }, [rangeStart, previous]);\n } else {\n rangeStart = previous;\n }\n\n expr = parseBasicTypeExpression();\n if (token === Token.BANG) {\n consume(Token.BANG);\n return maybeAddRange({\n type: Syntax.NonNullableType,\n expression: expr,\n prefix: false\n }, [rangeStart, previous]);\n }\n\n if (token === Token.QUESTION) {\n consume(Token.QUESTION);\n return maybeAddRange({\n type: Syntax.NullableType,\n expression: expr,\n prefix: false\n }, [rangeStart, previous]);\n }\n\n if (token === Token.LBRACK) {\n consume(Token.LBRACK);\n expect(Token.RBRACK, 'expected an array-style type declaration (' + value + '[])');\n return maybeAddRange({\n type: Syntax.TypeApplication,\n expression: maybeAddRange({\n type: Syntax.NameExpression,\n name: 'Array'\n }, [rangeStart, previous]),\n applications: [expr]\n }, [rangeStart, previous]);\n }\n\n return expr;\n }", "function createTypedLiteral(value, type) {\n if (type && type.termType !== 'NamedNode'){\n type = Parser.factory.namedNode(type);\n }\n return Parser.factory.literal(value, type);\n }", "function ValuesOfCorrectTypeRule(context) {\n return {\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = (0, _definition.getNullableType)(context.getParentInputType());\n\n if (!(0, _definition.isListType)(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n\n if (!(0, _definition.isInputObjectType)(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = (0, _keyMap.default)(node.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i2 = 0, _objectValues2 = (0, _objectValues.default)(type.getFields()); _i2 < _objectValues2.length; _i2++) {\n var fieldDef = _objectValues2[_i2];\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) {\n var typeStr = (0, _inspect.default)(fieldDef.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(type.name, \".\").concat(fieldDef.name, \"\\\" of required type \\\"\").concat(typeStr, \"\\\" was not provided.\"), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = (0, _definition.getNamedType)(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && (0, _definition.isInputObjectType)(parentType)) {\n var suggestions = (0, _suggestionList.default)(node.name.value, Object.keys(parentType.getFields()));\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(node.name.value, \"\\\" is not defined by type \\\"\").concat(parentType.name, \"\\\".\") + (0, _didYouMean.default)(suggestions), node));\n }\n },\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if ((0, _definition.isNonNullType)(type)) {\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat((0, _inspect.default)(type), \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n }\n },\n EnumValue: function EnumValue(node) {\n return isValidValueNode(context, node);\n },\n IntValue: function IntValue(node) {\n return isValidValueNode(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidValueNode(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidValueNode(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidValueNode(context, node);\n }\n };\n}", "function completeLeafValue(returnType, result) {\n var serializedResult = returnType.serialize(result);\n\n if (serializedResult === undefined) {\n throw new Error(\"Expected a value of type \\\"\".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(returnType), \"\\\" but \") + \"received: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(result)));\n }\n\n return serializedResult;\n}", "function completeLeafValue(returnType, result) {\n var serializedResult = returnType.serialize(result);\n\n if (serializedResult === undefined) {\n throw new Error(\"Expected a value of type \\\"\".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(returnType), \"\\\" but \") + \"received: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(result)));\n }\n\n return serializedResult;\n}", "function ValuesOfCorrectTypeRule(context) {\n return {\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = (0, _definition.getNullableType)(context.getParentInputType());\n\n if (!(0, _definition.isListType)(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n\n if (!(0, _definition.isInputObjectType)(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = (0, _keyMap.default)(node.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i2 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i2 < _objectValues2.length; _i2++) {\n var fieldDef = _objectValues2[_i2];\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) {\n var typeStr = (0, _inspect.default)(fieldDef.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(type.name, \".\").concat(fieldDef.name, \"\\\" of required type \\\"\").concat(typeStr, \"\\\" was not provided.\"), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = (0, _definition.getNamedType)(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && (0, _definition.isInputObjectType)(parentType)) {\n var suggestions = (0, _suggestionList.default)(node.name.value, Object.keys(parentType.getFields()));\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(node.name.value, \"\\\" is not defined by type \\\"\").concat(parentType.name, \"\\\".\") + (0, _didYouMean.default)(suggestions), node));\n }\n },\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if ((0, _definition.isNonNullType)(type)) {\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat((0, _inspect.default)(type), \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n }\n },\n EnumValue: function EnumValue(node) {\n return isValidValueNode(context, node);\n },\n IntValue: function IntValue(node) {\n return isValidValueNode(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidValueNode(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidValueNode(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidValueNode(context, node);\n }\n };\n}", "function Type() {\n this.hooks = [];\n }", "ValueType() { \n\n return typeof this.Expected == typeof this.Actual ? this.ExactType() : `Expected type ${typeof this.Expected} but found type ${typeof this.Actual}`\n }", "function innerType(n) { }", "function isType(value, type) {\n var str = {}.toString.call(value);\n return str.indexOf('[object') === 0 && str.indexOf(type + \"]\") > -1;\n}", "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = (0, _definition.getNamedType)(locationType);\n\n if (!(0, _definition.isLeafType)(type)) {\n var typeStr = (0, _inspect.default)(locationType);\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = (0, _inspect.default)(locationType);\n\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = (0, _inspect.default)(locationType);\n\n if (error instanceof _GraphQLError.GraphQLError) {\n context.reportError(error);\n } else {\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat((0, _printer.print)(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}", "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = (0, _definition.getNamedType)(locationType);\n\n if (!(0, _definition.isLeafType)(type)) {\n var typeStr = (0, _inspect.default)(locationType);\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = (0, _inspect.default)(locationType);\n\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = (0, _inspect.default)(locationType);\n\n if (error instanceof _GraphQLError.GraphQLError) {\n context.reportError(error);\n } else {\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat((0, _printer.print)(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}", "function staticallyVerifyType(node, types) {\n if (isNodeNully(node)) {\n return types.indexOf(\"null\") > -1 || types.indexOf(\"undefined\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"Literal\") {\n if (node.regex) {\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(\"RegExp\")) ? TYPE_VALID : TYPE_INVALID;\n } else {\n return types.indexOf(typeof node.value) > -1 ? TYPE_VALID : TYPE_INVALID;\n }\n } else if (node.type === \"ObjectExpression\") {\n return types.indexOf(\"object\") > -1 || types.indexOf(\"shape\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"ArrayExpression\") {\n return types.indexOf(\"array\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (t.isFunction(node)) {\n return types.indexOf(\"function\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'NewExpression' && node.callee.type === 'Identifier') {\n // this is of the form `return new SomeClass()`\n // @fixme it should be possible to do this with non computed member expressions too\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(node.callee.name)) ? TYPE_VALID : TYPE_UNKNOWN;\n } else if (isBooleanExpression(node)) {\n return types.indexOf('boolean') > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'Identifier') {\n // check the scope to see if this is a `const` value\n return node;\n } else {\n return TYPE_UNKNOWN; // will produce a runtime type check\n }\n }", "type_spec() {\n const startToken = this.currentToken;\n\n let typeTok = this.currentToken;\n if (typeTok.type === Lexer.TokenTypes.TYPE_INTEGER || typeTok.type === Lexer.TokenTypes.TYPE_REAL || typeTok.type === Lexer.TokenTypes.TYPE_BOOLEAN) {\n this.eat(typeTok.type);\n return new AST.TypeNode(typeTok);\n } else {\n throw new ParserException(`Error processing TYPESPEC: Expecting TYPE_INTEGER, TYPE_REAL, or TYPE_BOOLEAN got ${typeTok.type}`, startToken);\n }\n }", "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "function ctGetBasicTypes()\n{\n\tvar ret = {};\n\tvar key;\n\tfor (key in deftypes)\n\t\tret[key] = deftypes[key];\n\n\treturn (ret);\n}", "type(val) {\n this._type = val;\n return this;\n }", "function kindOf(val) {\n\t if (val === null) {\n\t return 'Null';\n\t } else if (val === UNDEF) {\n\t return 'Undefined';\n\t } else {\n\t return _rKind.exec( _toString.call(val) )[1];\n\t }\n\t }", "function kindOf(val) {\n\t if (val === null) {\n\t return 'Null';\n\t } else if (val === UNDEF) {\n\t return 'Undefined';\n\t } else {\n\t return _rKind.exec( _toString.call(val) )[1];\n\t }\n\t }", "statusType() {\n if (!this.parentField) return;\n if (!this.parentField.newType) return;\n if (typeof this.parentField.newType === \"string\") {\n return this.parentField.newType;\n } else {\n for (let key in this.parentField.newType) {\n if (this.parentField.newType[key]) {\n return key;\n }\n }\n }\n }", "constructor(type, type_list, value_list=null) {\n super(type)\n this.type_list = type_list\n if(value_list==null){\n value_list = []\n for(var i=0; i<type_list.length; i++) value_list.push(null)\n }\n this.value_list = value_list\n }", "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "function isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}", "function relaxType(type) {\n switch (type.kind) {\n case SimpleTypeKind.INTERSECTION:\n case SimpleTypeKind.UNION:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ENUM:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ARRAY:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.PROMISE:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.OBJECT:\n return {\n name: type.name,\n kind: SimpleTypeKind.OBJECT\n };\n case SimpleTypeKind.INTERFACE:\n case SimpleTypeKind.FUNCTION:\n case SimpleTypeKind.CLASS:\n return {\n name: type.name,\n kind: SimpleTypeKind.ANY\n };\n case SimpleTypeKind.NUMBER_LITERAL:\n return { kind: SimpleTypeKind.NUMBER };\n case SimpleTypeKind.STRING_LITERAL:\n return { kind: SimpleTypeKind.STRING };\n case SimpleTypeKind.BOOLEAN_LITERAL:\n return { kind: SimpleTypeKind.BOOLEAN };\n case SimpleTypeKind.BIG_INT_LITERAL:\n return { kind: SimpleTypeKind.BIG_INT };\n case SimpleTypeKind.ENUM_MEMBER:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.ALIAS:\n return __assign(__assign({}, type), { target: relaxType(type.target) });\n case SimpleTypeKind.NULL:\n case SimpleTypeKind.UNDEFINED:\n return { kind: SimpleTypeKind.ANY };\n default:\n return type;\n }\n}" ]
[ "0.67198116", "0.67198116", "0.67198116", "0.67198116", "0.67198116", "0.67198116", "0.66049165", "0.6446718", "0.5676705", "0.5676705", "0.566094", "0.5643042", "0.55962384", "0.54404646", "0.5433714", "0.5405661", "0.53743917", "0.5326172", "0.52857906", "0.5275447", "0.5275352", "0.52722085", "0.52524614", "0.5249688", "0.52439487", "0.5212039", "0.5196575", "0.51812595", "0.51812595", "0.51665634", "0.51610506", "0.5121592", "0.51191545", "0.5088267", "0.50599647", "0.5058016", "0.50454754", "0.5021486", "0.5019715", "0.50193006", "0.5012729", "0.5004938", "0.500361", "0.49971265", "0.49862474", "0.49854216", "0.49854216", "0.49848545", "0.49822772", "0.4968131", "0.4963915", "0.4963915", "0.49635687", "0.49583787", "0.494363", "0.49400708", "0.49400708", "0.49328068", "0.49328068", "0.49328068", "0.4926277", "0.4926277", "0.49243277", "0.49243277", "0.49208635", "0.4919019", "0.4919019", "0.49128932", "0.4909094", "0.4899312", "0.48951504", "0.4888152", "0.4887918", "0.4887918", "0.48872927", "0.48860735", "0.48807392", "0.4879818", "0.48719713", "0.48704496", "0.48704496", "0.4868966", "0.48663554", "0.4855571", "0.4847412", "0.484586", "0.48419142", "0.48419142", "0.48352504", "0.48339647", "0.48317942", "0.48317942", "0.48317942", "0.48317942", "0.48317942", "0.48317942", "0.48317942", "0.4831691" ]
0.64766103
9
These types may describe the parent context of a selection set.
function isCompositeType(type) { return type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parent(type) {\n var parent = this; // check for parent\n\n if (!parent.node.parentNode) return null; // get parent element\n\n parent = adopt(parent.node.parentNode);\n if (!type) return parent; // loop trough ancestors if type is given\n\n while (parent) {\n if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent;\n if (!parent.node.parentNode || parent.node.parentNode.nodeName === '#document' || parent.node.parentNode.nodeName === '#document-fragment') return null; // #759, #720\n\n parent = adopt(parent.node.parentNode);\n }\n }", "function getParentSelector(){var startPos=pos;pos++;var token=tokens[startPos];return newNode(NodeType.ParentSelectorType,'&',token.ln,token.col);}", "function Selection(parentSelectable) {\n // _aoData contains row data objects when sIdColumnName is not set and \n // contains values of sIdColumnName when it's set.\n this._aoData = [];\n this._oSelectable = parentSelectable;\n this._sIdColumnName = null;\n }", "rangeParent() {\n let common = !this.range ? undefined : this.range.commonAncestorContainer;\n return !common\n ? undefined\n : common.nodeType == 1\n ? common\n : common.parentElement;\n }", "'find_selection_scope'() {\n\t\t//console.log('find_selection_scope');\n\n\t\tvar res = this.selection_scope;\n\t\tif (res) return res;\n\n\t\t// look at the ancestor...\n\n\t\t//var parent = this.get('parent');\n\t\t//console.log('parent ' + tof(parent));\n\n\n\t\tif (this.parent) return this.parent.find_selection_scope();\n\n\t}", "function get_current_selector() {\n\n var parentsv = body.attr(\"data-clickable-select\");\n\n if (isDefined(parentsv)) {\n return parentsv;\n } else {\n get_parents(null, \"default\");\n }\n\n }", "get parent () { return this._parent; }", "function getSelectionParentElement() {\n var parentEl = null, sel;\n if (window.getSelection) {\n sel = window.getSelection();\n if (sel.rangeCount) {\n parentEl = sel.getRangeAt(0).commonAncestorContainer;\n if (parentEl.nodeType != 1) {\n parentEl = parentEl.parentNode;\n }\n }\n } else if ( (sel = document.selection) && sel.type != \"Control\") {\n parentEl = sel.createRange().parentElement();\n }\n return parentEl;\n}", "function setupMouseEvents(parent, canvas, selection) {\n function mousedownHandler(evt) {\n var mousePos = selection\n .geometry()\n .m2v(multiselect_utilities.offsetMousePos(parent, evt));\n switch (multiselect.modifierKeys(evt)) {\n case multiselect.NONE:\n selection.click(mousePos);\n break;\n case multiselect.CMD:\n selection.cmdClick(mousePos);\n break;\n case multiselect.SHIFT:\n selection.shiftClick(mousePos);\n break;\n default:\n return;\n }\n\n selection.geometry().drawIndicators(selection, canvas, true, true, false);\n\n document.addEventListener(\"mousemove\", mousemoveHandler, false);\n document.addEventListener(\"mouseup\", mouseupHandler, false);\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n function mousemoveHandler(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n var mousePos = selection\n .geometry()\n .m2v(multiselect_utilities.offsetMousePos(parent, evt));\n selection.shiftClick(mousePos);\n selection.geometry().drawIndicators(selection, canvas, true, true, true);\n }\n\n function mouseupHandler(evt) {\n document.removeEventListener(\"mousemove\", mousemoveHandler, false);\n document.removeEventListener(\"mouseup\", mouseupHandler, false);\n selection\n .geometry()\n .drawIndicators(selection, canvas, true, true, false, false);\n }\n\n parent.addEventListener(\"mousedown\", mousedownHandler, false);\n}", "get parent() {\n\t\treturn this.__parent;\n\t}", "get parent() {\r\n return new ContentType(this, \"parent\");\r\n }", "function merchandiseHierarchyNativeSelection() {\n\t\treturn {\n\t\t\trestrict: 'A',\n\t\t\tscope: {\n\t\t\t\t'treeMap': '=',\n\t\t\t\t'ngModel': '=',\n\t\t\t\t'defaultLabels': '=',\n\t\t\t\t'disableSelection': '='\n\t\t\t},\n\t\t\ttemplate: multidropdown,\n\t\t\tcontrollerAs: 'ctrl',\n\t\t\tbindToController: true,\n\t\t\tcontroller: MerchandiseHierarchySelection\n\n\t\t};\n\t}", "function fetch_selection_extends() { fetch_selection_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return fetch_selection_extends.apply(this, arguments); }", "function interactiveFlag(model) {\n if (!model.component.selection) return null;\n var unitCount = keys(model.component.selection).length;\n var parentCount = unitCount;\n var parent = model.parent;\n\n while (parent && parentCount === 0) {\n parentCount = keys(parent.component.selection).length;\n parent = parent.parent;\n }\n\n return parentCount ? {\n interactive: unitCount > 0\n } : null;\n }", "function selection(doc) {\n\t try {\n\t if (doc.selection) { // IE\n\t\t return doc.selection.createRange().parentElement();\n\t } else { // Mozilla\n\t\t return doc.getSelection().getRangeAt(0).commonAncestorContainer;\n\t }\n\t }\n\t catch(e) {\n\t error('selection', doc, e);\n\t return false;\n\t }\n }", "get parent_id() {return this.artefact.compartment_id;}", "get parent() {\n return this._parent;\n }", "get parent() {\n return this._parent;\n }", "get parent() {\n return this._parent;\n }", "function get_parents(element, status) {\n\n // If parent already has.\n var parentsv = body.attr(\"data-clickable-select\");\n\n // If status default, return current data.\n if (status == 'default' || status == 'defaultS') {\n if (isDefined(parentsv)) {\n return parentsv;\n }\n }\n\n if (element === null) {\n element = get_selected_element();\n }\n\n // Be sure this item is valid.\n if (element[0] === undefined || element[0] === false || element[0] === null) {\n return false;\n }\n\n\n // Is sharp?\n if ($(\"body\").hasClass(\"yp-sharp-selector-mode-active\")) {\n status = 'sharp';\n }\n\n // Get cached selector\n if (status == 'default' && element.hasAttr(\"data-default-selector\") === true) {\n return element.attr(\"data-default-selector\");\n }\n\n // Tag info\n var tagE = element[0].tagName;\n\n // ?\n if (isUndefined(tagE)) {\n return false;\n }\n\n // If body, return.\n if (tagE == 'BODY') {\n return 'body';\n }\n\n // Not possible.\n if (tagE == 'HTML') {\n return false;\n }\n\n // Getting item parents.\n var parents = element.parents(document);\n\n // Empy variable.\n var selector = '';\n var lastSelector = '';\n\n // Foreach all loops.\n for (var i = parents.length - 1; i >= 0; i--) {\n\n // If first Selector Item\n if (i == parents.length - 1) {\n\n selector += get_best_class(parents[i]);\n\n } else { // If not.\n\n // Get Selector name.\n var thisSelector = get_best_class(parents[i]);\n\n // Check if this Class.\n // Reset past selector names if current selector already one in document.\n if (thisSelector.indexOf(\".\") != -1 && iframe.find(thisSelector).length == 1) {\n\n if (status != 'sharp') {\n selector = thisSelector + window.separator; // Reset\n }\n\n if (status == 'sharp') {\n if (single_selector(selector).indexOf(\"nth-child\") == -1) {\n selector = thisSelector + window.separator; // Reset\n }\n }\n\n } else {\n\n selector += thisSelector + window.separator; // add new\n\n }\n\n }\n\n }\n\n\n // Clean selector.\n selector = space_cleaner(selector);\n\n\n // Adding Last element to selector.\n // and check custom last element part for input tags.\n if (tagE == 'INPUT') { // if input,use tag name with TYPE.\n\n var type;\n\n if (status != 'sharp') {\n\n type = element.attr(\"type\");\n lastSelector = window.separator + 'input[type=' + type + ']';\n\n } else {\n\n var sharpLast = get_best_class(element);\n\n if (sharpLast.indexOf(\"input#\") != -1) {\n sharpLast = sharpLast.replace(\"input#\", \"#\");\n }\n\n type = element.attr(\"type\");\n\n lastSelector = window.separator + 'input[type=' + type + ']' + sharpLast;\n\n }\n\n\n } else { // else find the best class.\n\n lastSelector = window.separator + get_best_class(element);\n\n }\n\n // Selectors ready!\n selector += lastSelector;\n\n // Fix google map contents\n if (selector.indexOf(\".gm-style\") != -1) {\n selector = '.gm-style';\n }\n\n // Selector clean.\n selector = selector.replace(\"htmlbody\", \"body\");\n\n // Return if is single selector\n if (status == 'sharp') {\n return single_selector(selector);\n }\n\n\n if (selector.indexOf(\"#\") >= 0 && selector.indexOf(\"yp-\") == -1) {\n var before = selector.split(\"#\")[0];\n if (get_selector_array(before).length === 0) {\n before = before;\n } else {\n before = get_selector_array(before)[get_selector_array(before).length - 1];\n }\n selector = selector.split(\"#\");\n selector = selector[(selector.length - 1)];\n if (before.length < 4) {\n selector = before + \"#\" + selector;\n } else {\n selector = \"#\" + selector;\n }\n }\n\n\n // NEW\n var array = get_selector_array(selector);\n\n var q = 0;\n for (q = 0; q < array.length - 2; q++) {\n\n if (element.parents(array[q]).length == 1) {\n delete array[q + 1];\n }\n\n }\n\n var selectorNew = $.trim(array.join(window.separator)).replace(/ /g, ' ');\n if (iframe.find(selector).length == iframe.find(selectorNew).length) {\n selector = selectorNew;\n }\n\n\n // Check all others elements has same nodename or not.\n if (tagE == 'H1' || tagE == 'H2' || tagE == 'H3' || tagE == 'H4' || tagE == 'H5' || tagE == 'H6' || tagE == 'P' || tagE == 'SPAN' || tagE == 'IMG' || tagE == 'STRONG' || tagE == 'A' || tagE == 'LI' || tagE == 'UL') {\n\n var foundedTags = [];\n iframeBody.find(selector).each(function () {\n if (foundedTags.indexOf($(this)[0].nodeName) == -1) {\n foundedTags.push($(this)[0].nodeName);\n }\n });\n\n if (foundedTags.length > 1) {\n selector = selector.split(lastSelector)[0] + window.separator + tagE.toLowerCase();\n }\n\n }\n\n\n // Use > If has same selectored element in selected element\n if (status == 'default') {\n\n var selectedInSelected = iframeBody.find(selector + window.separator + lastSelector).length;\n\n // USE : \">\"\n if (selectedInSelected > 0) {\n\n var untilLast = get_parents(element.parent(), \"defaultS\");\n\n selector = untilLast + \" > \" + lastSelector;\n\n selector = $.trim(selector);\n\n }\n\n }\n\n // Getting selectors by CSS files.\n if (get_selector_array(selector).length > 1) {\n\n // Get human selectors\n var humanSelectors = get_human_selector(window.humanStyleData);\n\n // Get valid human selectors\n var goodHumanSelectors = [];\n\n // Check is valid\n if (humanSelectors.length > 0) {\n\n // Each founded selectors\n $.each(humanSelectors, function (qx) {\n\n // Find the best in human selectors\n if (iframe.find(humanSelectors[qx]).length == iframe.find(selector).length) {\n\n // Push\n goodHumanSelectors.push(humanSelectors[qx]);\n\n }\n\n });\n\n // There is good selectors?\n if (goodHumanSelectors.length > 0) {\n\n // Find max long selector\n var maxSelector = goodHumanSelectors.sort(function (a, b) {\n return b.length - a.length;\n });\n\n // Be sure more long than 10 char\n if (maxSelector[0].length > 10) {\n\n // Update\n selector = maxSelector[0];\n\n }\n\n }\n\n }\n\n }\n\n\n // Keep selectors smart and short!\n if (get_selector_array(selector).length > 5) {\n\n // short Selector Ready\n var shortSelectorReady = false;\n\n // Find a founded elements\n var foundedElements = iframe.find(selector).length;\n\n // Get array from selector.\n var shortSelector = get_selector_array(selector);\n\n // Each array items\n $.each(shortSelector, function () {\n\n if (shortSelectorReady === false) {\n\n // Shift\n shortSelector.shift();\n\n // make it short\n var shortSelectorString = shortSelector.toString().replace(/\\,/g, \" \");\n\n // Search\n var foundedElShort = iframe.find(shortSelectorString).length;\n\n // Shift until make it minimum 5 item\n if (shortSelector.length <= 5 && foundedElements == foundedElShort) {\n shortSelectorReady = true;\n selector = shortSelectorString;\n }\n\n }\n\n });\n\n }\n\n // Save as cache\n if (status == 'default') {\n element.attr(\"data-default-selector\", space_cleaner(selector));\n }\n\n // Return result.\n return space_cleaner(selector);\n\n }", "function McOptionParentComponent() { }", "function useParentContextOrNot() {\n return ((nt.useParentContext == 'auto') && (parent != this))\n || (nt.useParentContext == 'yes');\n}", "get parent() {\n return this.mParent;\n }", "function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n if (type) {\n if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type))) {\n if (node.selectionSet) {\n context.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(node.name.value, type), [node.selectionSet]));\n }\n } else if (!node.selectionSet) {\n context.reportError(new _error.GraphQLError(requiredSubselectionMessage(node.name.value, type), [node]));\n }\n }\n }\n };\n}", "function ScalarLeafs(context) {\n\t return {\n\t Field: function Field(node) {\n\t var type = context.getType();\n\t if (type) {\n\t if ((0, _typeDefinition.isLeafType)(type)) {\n\t if (node.selectionSet) {\n\t context.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(node.name.value, type), [node.selectionSet]));\n\t }\n\t } else if (!node.selectionSet) {\n\t context.reportError(new _error.GraphQLError(requiredSubselectionMessage(node.name.value, type), [node]));\n\t }\n\t }\n\t }\n\t };\n\t}", "function IntObject_GetParentFormObject()\n{\n\t//default result: ourselves\n\tvar result = this;\n\t//loop until the first form/mdiform\n\twhile (result.DataObject.Class != __NEMESIS_CLASS_FORM && result.DataObject.Class != __NEMESIS_CLASS_MDIFORM || Get_Bool(result.HTML.WS_CHILD, false))\n\t{\n\t\t//is this a treegrid cell?\n\t\tif (result.TreeGridCell)\n\t\t{\n\t\t\t//switch to its treegrid\n\t\t\tresult = result.TreeGridObject;\n\t\t}\n\t\t//this an ultragrid cell\n\t\telse if (result.UltraGrid)\n\t\t{\n\t\t\t//switch to its ultraGrid\n\t\t\tresult = result.UltraGrid;\n\t\t}\n\t\t//get parent\n\t\tresult = result.Parent;\n\t}\n\t//return it\n\treturn result;\n}", "get parent() {\n return this._parent;\n }", "get multiple() { return this._parent && this._parent.multiple; }", "get multiple() { return this._parent && this._parent.multiple; }", "get multiple() { return this._parent && this._parent.multiple; }", "if (!this.ast.selectionSet) {\n return [];\n }", "parent() {\n const parents = this.nodes.reduce((arr, node) => {\n const { parentNode } = node;\n // don't add the same parent node twice\n if (parentNode && arr.every(parent => !parent.isEqualNode(parentNode))) {\n arr.push(parentNode);\n }\n return arr;\n }, []);\n\n return new DOMNodeCollection(parents);\n }", "function ViewParentExpression(expression, meta) {\n this.expression = expression;\n this.meta = meta;\n}", "function MatOptionParentComponent() {}", "function addSelCtgs() {\n // reset these properties couse after delete it is displayed 1st list\n optID = 0;\n slevel = 1;\n\n // if items in Root, shows 1st <select>, else, resets properties to initial value\n if(optHierarchy[0].length > 0) document.getElementById('n_sl'+slevel).innerHTML = getSelect(optHierarchy[0]);\n else {\n optHierarchy = {'0':[]};\n optData = {'0':{'value':'Root', 'content':'', 'parent':-1}};\n document.getElementById('n_sl'+slevel).innerHTML = '';\n }\n }", "function Selection(parent, selectionSettings, locator) {\n //Internal letiables \n /**\n \n */\n this.selectedRowIndexes = [];\n /**\n \n */\n this.selectedRowCellIndexes = [];\n /**\n \n */\n this.selectedRecords = [];\n /**\n \n */\n this.preventFocus = false;\n this.isMultiShiftRequest = false;\n this.isMultiCtrlRequest = false;\n this.enableSelectMultiTouch = false;\n this.clearRowCheck = false;\n this.selectRowCheck = false;\n this.selectedRowState = {};\n this.totalRecordsCount = 0;\n this.chkAllCollec = [];\n this.isCheckedOnAdd = false;\n this.persistSelectedData = [];\n this.isCancelDeSelect = false;\n this.isPreventCellSelect = false;\n this.disableUI = false;\n this.isPersisted = false;\n this.cmdKeyPressed = false;\n this.parent = parent;\n this.selectionSettings = selectionSettings;\n this.factory = locator.getService('rendererFactory');\n this.focus = locator.getService('focus');\n this.addEventListener();\n this.wireEvents();\n }", "get parent() {\n return childToParent.get(this) || null;\n }", "parents() {\n let until = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globals.document;\n until = makeInstance(until);\n let parents = new types_List();\n let parent = this;\n\n while ((parent = parent.parent()) && parent.node !== until.node && parent.node !== globals.document) {\n parents.push(parent);\n }\n\n return parents;\n }", "function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n if (type) {\n if ((0, _typeDefinition.isLeafType)(type)) {\n if (node.selectionSet) {\n context.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(node.name.value, type), [node.selectionSet]));\n }\n } else if (!node.selectionSet) {\n context.reportError(new _error.GraphQLError(requiredSubselectionMessage(node.name.value, type), [node]));\n }\n }\n }\n };\n}", "get parent() {\n return this.owner.owner;\n }", "setParent(prnt) {\nreturn this.parent = prnt;\n}", "function findParent(a,b){var c=a.$parent;if(c)return c.$options[b]?c:findParent(c,b)}", "function get_selection()\n {\n return selection;\n }", "getParent(){return this.__parent}", "getParent() {\nreturn this.parent;\n}", "function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n var selectionSet = node.selectionSet;\n\n if (type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"isLeafType\"])(Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"getNamedType\"])(type))) {\n if (selectionSet) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](noSubselectionAllowedMessage(node.name.value, Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type)), selectionSet));\n }\n } else if (!selectionSet) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](requiredSubselectionMessage(node.name.value, Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type)), node));\n }\n }\n }\n };\n}", "isSelectionOperation(value) {\n return Operation.isOperation(value) && value.type.endsWith('_selection');\n }", "isSelectionOperation(value) {\n return Operation.isOperation(value) && value.type.endsWith('_selection');\n }", "function selectAncestor (elem, type) {\n type = type.toLowerCase();\n if (elem.parentNode === null) {\n console.log(\"No more parents\");\n return undefined;\n }\n var tagName = elem.parentNode.tagName;\n\n if ((tagName !== undefined) && (tagName.toLowerCase() === type)) {\n return elem.parentNode;\n } else {\n return selectAncestor (elem.parentNode, type);\n }\n }", "function getApparentTypeOfContextualType(node) {\n var type = getContextualType(node);\n return type && getApparentType(type);\n }", "function TreeGrid_IsMultiSelection(theObject)\n{\n\t//check the multiselection property\n\treturn Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_MULTISELECTION], false);\n}", "function getContextualPath() {\n var currentObj = $scope.domainObject,\n currentParent,\n parents = [];\n\n currentParent = currentObj &&\n currentObj.hasCapability('context') &&\n currentObj.getCapability('context').getParent();\n\n while (currentParent && currentParent.getModel().type !== 'root' &&\n currentParent.hasCapability('context')) {\n // Record this object\n parents.unshift(currentParent);\n\n // Get the next one up the tree\n currentObj = currentParent;\n currentParent = currentObj.getCapability('context').getParent();\n }\n\n $scope.contextutalParents = parents;\n }", "get parent() {\n return this.parentNode\n }", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "parent() {\n return this._ancestors.top();\n }", "static parentNodeType(node, index)\n {\n // The current parent is the top of the stack, so go one below that\n index = index || 0;\n\n if (node && parentNodeTypes.has(node.type))\n ++index;\n\n const parent = Scope.parentNodes[Scope.parentNodes.length - (1 + index)];\n\n return parent ? parent.node.type : null;\n }", "get parent() {\n return this.$from.node(this.depth);\n }", "get newSelection() {\n return this.selection || this.startState.selection.map(this.changes);\n }", "function viewParentEl(view){var parentView=view.parent;if(parentView){return view.parentNodeDef.parent;}else{return null;}}", "function clickedThing(e, type)\n {\n var el = e.target;\n if(!el.is(type))\n {\n el = el.parents(type).slice(0,1);\n }\n \n return el;\n }", "function getInsertImageParent( selection, model ) {\n\tconst insertAt = Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_0__[\"findOptimalInsertionPosition\"])( selection, model );\n\n\tconst parent = insertAt.parent;\n\n\tif ( parent.isEmpty && !parent.is( '$root' ) ) {\n\t\treturn parent.parent;\n\t}\n\n\treturn parent;\n}", "function PivotContextMenu(parent){/* eslint-enable */this.parent=parent;this.parent.contextMenuModule=this;}", "function getParentData() {\n return this.getState('parentData') || {};\n }", "function inheritanceNodeContainsParent(source, destination) {\n return (source.type !== NODE_TYPE.INHERITANCE && destination.type !== NODE_TYPE.INHERITANCE) || source.parent || destination.parent\n}", "function hasSelectParent($node){\n if($node.closest('.cf-select').length > 0){\n return true;\n }\n return false;\n }", "function p(a,b){if(this.range=a,this.clonePartiallySelectedTextNodes=b,!a.collapsed){this.sc=a.startContainer,this.so=a.startOffset,this.ec=a.endContainer,this.eo=a.endOffset;var c=a.commonAncestorContainer;this.sc===this.ec&&N(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==c||N(this.sc)?T(this.sc,c,!0):this.sc.childNodes[this.so],this._last=this.ec!==c||N(this.ec)?T(this.ec,c,!0):this.ec.childNodes[this.eo-1])}}", "function course_buider_get_parent_selector_container( el ) {\n\t\tif ( typeof el !== 'undefined' ) {\n\t\t\tvar selector_container = jQuery( el ).closest( '.learndash_selectors' );\n\t\t\tif ( ( typeof selector_container !== 'undefined' ) && ( selector_container.length > 0 ) ) {\n\t\t\t\treturn selector_container[0];\n\t\t\t} else {\n\t\t\t\tvar builder_container = jQuery( el ).closest( '.learndash_builder_items' );\n\t\t\t\tif ( ( typeof builder_container !== 'undefined' ) && ( builder_container.length > 0 ) ) {\n\t\t\t\t\treturn builder_container[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getCurrentParentID(){\r\n\t\t\r\n\t\tvar parentID = null;\r\n\t\tif(g_temp.is_edit_group_mode == true)\r\n\t\t\tparentID = g_temp.edit_group_id;\r\n\t\t\r\n\t\treturn(parentID);\r\n\t}", "function update_parent_selection( db_tree, parent_id ) {\n if ( !parent_id ) {\n return;\n }\n\n var parent_node = $('#node-' + parent_id + '-check');\n var higher_parent_id;\n\n if ( is_subtree_selected( db_tree, parent_id ) ) {\n parent_node.removeClass('pl-tree-node-unchecked')\n .addClass('pl-tree-node-checked');\n } else {\n parent_node.removeClass('pl-tree-node-checked')\n .addClass('pl-tree-node-unchecked');\n }\n\n higher_parent_id = _tree.get_parent_id( db_tree, parent_id );\n update_parent_selection( db_tree, higher_parent_id );\n }", "setParentCheckboxes(props = this.props) {\n const stateToSet = {};\n props.skillCones.data.forEach((cone) => {\n let allConeChildrenSelected = true;\n props.item.data.some((itemData) => {\n if (itemData.cone === cone.name && !itemData.isSelected) {\n allConeChildrenSelected = false;\n return true;\n }\n return false;\n });\n stateToSet[cone.id] = allConeChildrenSelected;\n });\n this.setState(stateToSet);\n }", "function parents(cursor) {\n if (cursor == null) {\n return List()\n }\n\n const self = cursor\n\n function* _ancestors() {\n let current = self\n\n while (current != null) {\n yield current\n current = parent(current)\n }\n }\n\n return Seq(_ancestors())\n}", "function setupKeyboardEvents(parent, canvas, selection) {\n parent.addEventListener(\"keydown\", keydownHandler, false);\n parent.addEventListener(\n \"mousedown\",\n function () {\n parent.focus();\n },\n false\n );\n\n function keydownHandler(evt) {\n var handled = false;\n var mk = multiselect.modifierKeys(evt);\n switch (evt.which) {\n case 37:\n handled = callArrow(mk, multiselect.LEFT);\n break;\n case 38:\n handled = callArrow(mk, multiselect.UP);\n break;\n case 39:\n handled = callArrow(mk, multiselect.RIGHT);\n break;\n case 40:\n handled = callArrow(mk, multiselect.DOWN);\n break;\n case 32:\n handled = callSpace(mk);\n break;\n case 90:\n handled = callUndoRedo(mk);\n break;\n default:\n return; // exit this handler for unrecognized keys\n }\n if (!handled) return;\n\n // event is recognized\n selection.geometry().drawIndicators(selection, canvas, true, true, false);\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n function callUndoRedo(mk) {\n switch (mk) {\n case multiselect.OPT:\n selection.undo();\n break;\n case multiselect.SHIFT_OPT:\n selection.redo();\n break;\n default:\n return false;\n }\n return true;\n }\n\n function callArrow(mk, dir) {\n switch (mk) {\n case multiselect.NONE:\n selection.arrow(dir);\n break;\n case multiselect.CMD:\n selection.cmdArrow(dir);\n break;\n case multiselect.SHIFT:\n selection.shiftArrow(dir);\n break;\n default:\n return false;\n }\n return true;\n }\n\n function callSpace(mk) {\n switch (mk) {\n case multiselect.NONE:\n selection.space();\n break;\n case multiselect.CMD:\n selection.cmdSpace();\n break;\n case multiselect.SHIFT:\n selection.shiftSpace();\n break;\n default:\n return false;\n }\n return true;\n }\n}", "static find(subset, e) {\n if (subset[e].parent !=e)\n subset[e].parent = Graph.find(subset, subset[e].parent);\n \n return subset[e].parent;\n }", "parentField() {\n let parent = this.$parent;\n for (let i = 0; i < 3; i++) {\n if (parent && !parent.$data._isField) {\n parent = parent.$parent;\n }\n }\n return parent;\n }", "function canInherit(contextValue) { }", "get contextType () {\n\t\treturn this._contextType;\n\t}", "function getSelection(){\n return selection;\n }", "get isSelection() {\n return true;\n }", "function Selections (type, size, toppings) {\n this.type = type;\n this.size = size;\n this.toppings = [];\n}", "parentFrame() {\n return this.sameTargetParentFrame() || this.crossTargetParentFrame();\n }", "function TreeParent() {\n return function (object, propertyName) {\n // now try to determine it its lazy relation\n var reflectedType = Reflect && Reflect.getMetadata ? Reflect.getMetadata(\"design:type\", object, propertyName) : undefined;\n var isLazy = (reflectedType && typeof reflectedType.name === \"string\" && reflectedType.name.toLowerCase() === \"promise\") || false;\n __1.getMetadataArgsStorage().relations.push({\n isTreeParent: true,\n target: object.constructor,\n propertyName: propertyName,\n isLazy: isLazy,\n relationType: \"many-to-one\",\n type: function () { return object.constructor; },\n options: {}\n });\n };\n}", "function TreeParent() {\n return function (object, propertyName) {\n // now try to determine it its lazy relation\n var reflectedType = Reflect && Reflect.getMetadata ? Reflect.getMetadata(\"design:type\", object, propertyName) : undefined;\n var isLazy = (reflectedType && typeof reflectedType.name === \"string\" && reflectedType.name.toLowerCase() === \"promise\") || false;\n __1.getMetadataArgsStorage().relations.push({\n isTreeParent: true,\n target: object.constructor,\n propertyName: propertyName,\n isLazy: isLazy,\n relationType: \"many-to-one\",\n type: function () { return object.constructor; },\n options: {}\n });\n };\n}", "function getStatementParent() {\n var path = this;\n do {\n if (Array.isArray(path.container)) {\n return path;\n }\n } while (path = path.parentPath);\n}", "__getParentId() {\n return this.part ? this.part.parentId : this.__parentId;\n }", "function _updateSelectedObject() {\n var data = $('.listTree').data('listTree');\n\n // Filter the context to the selected parents.\n var selected = _.filter($.extend(true, {}, data.context), function(parent) {\n return $('.listTree > ul > li > span > input[value=\"' + parent.key + '\"]').prop('checked')\n });\n \n // For each parent in the working context...\n _.each(selected, function(parent) {\n\n // Filter the children to the selected children.\n parent.values = _.filter(parent.values, function(child) {\n return $('.listTree > ul > li > ul > li > span > input[value=\"' + child.key + '\"]').prop('checked');\n });\n });\n\n // Update the plugin's selected object.\n $('.listTree').data('listTree', {\n \"target\": data.target,\n \"context\": data.context,\n \"options\": data.options,\n \"selected\": selected\n });\n }", "parent (selector = '*') {\n let result = new Set()\n let selectorData = cssParser(selector)\n\n for (let item of this) {\n let parent = item.parent\n\n if (!parent || !selectorData) {\n continue\n }\n\n if (cssMatch(parent, selectorData[0])) {\n result.add(parent)\n }\n }\n\n let $elements = new this.constructor([...result])\n\n return $elements\n }", "function captureSourceAndParent(element, options) {\n options.origin = angular.extend({\n element: null,\n bounds: null,\n focus: angular.noop\n }, options.origin || {});\n\n var source = angular.element((options.targetEvent || {}).target);\n if (source && source.length) {\n // Compute and save the target element's bounding rect, so that if the\n // element is hidden when the dialog closes, we can shrink the dialog\n // back to the same position it expanded from.\n options.origin.element = source;\n options.origin.bounds = source[0].getBoundingClientRect();\n options.origin.focus = function() {\n source.focus();\n }\n }\n\n // If the parent specifier is a simple string selector, then query for\n // the DOM element.\n if ( angular.isString(options.parent) ) {\n var simpleSelector = options.parent,\n container = $document[0].querySelectorAll(simpleSelector);\n options.parent = container.length ? container[0] : null;\n }\n // If we have a reference to a raw dom element, always wrap it in jqLite\n options.parent = angular.element(options.parent || $rootElement);\n\n }", "function updateParent(e) {\n var context = e.context;\n\n self.updateParent(context.shape || context.connection, context.oldParent);\n }", "function updateParent(e) {\n var context = e.context;\n\n self.updateParent(context.shape || context.connection, context.oldParent);\n }", "_getEffectiveParent() {\n let p = this.parent;\n while (p instanceof BlockScope && !p._closedOver) {\n p = p.parent;\n }\n return p;\n }", "function noSubselectionAllowedMessage(fieldName, type) {\n return \"Field \\\"\".concat(fieldName, \"\\\" must not have a selection since \") + \"type \\\"\".concat(type, \"\\\" has no subfields.\");\n}", "function getSelectedOrgType() {\n return $('#adminCode :selected')\n .parent()\n .attr('label')\n .toLowerCase();\n}", "function updateParent(e) {\n var context = e.context;\n self.updateParent(context.shape || context.connection, context.oldParent);\n }", "get parentName () {\n\t\treturn Object.getPrototypeOf(this.constructor).name\n\t}", "get allowsNesting() { return true; }", "function inBaseTreeView() { }", "get_parent_node(){\n return this.fc.get_fragment_by_id(this.parent_node[0]).get_node_by_id(this.parent_node[1])\n }" ]
[ "0.55696577", "0.5463014", "0.5387697", "0.5263181", "0.5241093", "0.52376723", "0.5092069", "0.505945", "0.5046041", "0.5045512", "0.5039047", "0.50370127", "0.50316375", "0.49602005", "0.49430433", "0.49418372", "0.49408984", "0.49408984", "0.49408984", "0.49251118", "0.49155623", "0.49013078", "0.48905024", "0.48830444", "0.4860811", "0.4857486", "0.48571628", "0.48434263", "0.48434263", "0.48434263", "0.4842226", "0.48417476", "0.48311782", "0.48171586", "0.4802013", "0.48009607", "0.47759882", "0.47603923", "0.4754024", "0.4749916", "0.47493747", "0.47257274", "0.472504", "0.47208744", "0.47102493", "0.46865234", "0.46829027", "0.46829027", "0.46795306", "0.46779835", "0.4655614", "0.464383", "0.4629482", "0.4620887", "0.4620887", "0.4620887", "0.4620887", "0.4620887", "0.46172944", "0.45980525", "0.45897326", "0.458647", "0.45847973", "0.45730555", "0.4556802", "0.45505062", "0.45501018", "0.45345652", "0.45329183", "0.4515486", "0.45146888", "0.45133725", "0.45125198", "0.45085254", "0.45082238", "0.45062172", "0.4494263", "0.44941777", "0.44882095", "0.44867676", "0.44764835", "0.4475076", "0.4458838", "0.4453437", "0.44511837", "0.44511837", "0.4443995", "0.44351047", "0.4428563", "0.44232398", "0.44100243", "0.44088516", "0.44088516", "0.44051594", "0.43985495", "0.43977928", "0.43913904", "0.43908566", "0.43877593", "0.43832916", "0.43827727" ]
0.0
-1
These types may describe the parent context of a selection set.
function isAbstractType(type) { return type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parent(type) {\n var parent = this; // check for parent\n\n if (!parent.node.parentNode) return null; // get parent element\n\n parent = adopt(parent.node.parentNode);\n if (!type) return parent; // loop trough ancestors if type is given\n\n while (parent) {\n if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent;\n if (!parent.node.parentNode || parent.node.parentNode.nodeName === '#document' || parent.node.parentNode.nodeName === '#document-fragment') return null; // #759, #720\n\n parent = adopt(parent.node.parentNode);\n }\n }", "function getParentSelector(){var startPos=pos;pos++;var token=tokens[startPos];return newNode(NodeType.ParentSelectorType,'&',token.ln,token.col);}", "function Selection(parentSelectable) {\n // _aoData contains row data objects when sIdColumnName is not set and \n // contains values of sIdColumnName when it's set.\n this._aoData = [];\n this._oSelectable = parentSelectable;\n this._sIdColumnName = null;\n }", "rangeParent() {\n let common = !this.range ? undefined : this.range.commonAncestorContainer;\n return !common\n ? undefined\n : common.nodeType == 1\n ? common\n : common.parentElement;\n }", "'find_selection_scope'() {\n\t\t//console.log('find_selection_scope');\n\n\t\tvar res = this.selection_scope;\n\t\tif (res) return res;\n\n\t\t// look at the ancestor...\n\n\t\t//var parent = this.get('parent');\n\t\t//console.log('parent ' + tof(parent));\n\n\n\t\tif (this.parent) return this.parent.find_selection_scope();\n\n\t}", "function get_current_selector() {\n\n var parentsv = body.attr(\"data-clickable-select\");\n\n if (isDefined(parentsv)) {\n return parentsv;\n } else {\n get_parents(null, \"default\");\n }\n\n }", "get parent () { return this._parent; }", "function getSelectionParentElement() {\n var parentEl = null, sel;\n if (window.getSelection) {\n sel = window.getSelection();\n if (sel.rangeCount) {\n parentEl = sel.getRangeAt(0).commonAncestorContainer;\n if (parentEl.nodeType != 1) {\n parentEl = parentEl.parentNode;\n }\n }\n } else if ( (sel = document.selection) && sel.type != \"Control\") {\n parentEl = sel.createRange().parentElement();\n }\n return parentEl;\n}", "function setupMouseEvents(parent, canvas, selection) {\n function mousedownHandler(evt) {\n var mousePos = selection\n .geometry()\n .m2v(multiselect_utilities.offsetMousePos(parent, evt));\n switch (multiselect.modifierKeys(evt)) {\n case multiselect.NONE:\n selection.click(mousePos);\n break;\n case multiselect.CMD:\n selection.cmdClick(mousePos);\n break;\n case multiselect.SHIFT:\n selection.shiftClick(mousePos);\n break;\n default:\n return;\n }\n\n selection.geometry().drawIndicators(selection, canvas, true, true, false);\n\n document.addEventListener(\"mousemove\", mousemoveHandler, false);\n document.addEventListener(\"mouseup\", mouseupHandler, false);\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n function mousemoveHandler(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n var mousePos = selection\n .geometry()\n .m2v(multiselect_utilities.offsetMousePos(parent, evt));\n selection.shiftClick(mousePos);\n selection.geometry().drawIndicators(selection, canvas, true, true, true);\n }\n\n function mouseupHandler(evt) {\n document.removeEventListener(\"mousemove\", mousemoveHandler, false);\n document.removeEventListener(\"mouseup\", mouseupHandler, false);\n selection\n .geometry()\n .drawIndicators(selection, canvas, true, true, false, false);\n }\n\n parent.addEventListener(\"mousedown\", mousedownHandler, false);\n}", "get parent() {\n\t\treturn this.__parent;\n\t}", "function merchandiseHierarchyNativeSelection() {\n\t\treturn {\n\t\t\trestrict: 'A',\n\t\t\tscope: {\n\t\t\t\t'treeMap': '=',\n\t\t\t\t'ngModel': '=',\n\t\t\t\t'defaultLabels': '=',\n\t\t\t\t'disableSelection': '='\n\t\t\t},\n\t\t\ttemplate: multidropdown,\n\t\t\tcontrollerAs: 'ctrl',\n\t\t\tbindToController: true,\n\t\t\tcontroller: MerchandiseHierarchySelection\n\n\t\t};\n\t}", "get parent() {\r\n return new ContentType(this, \"parent\");\r\n }", "function fetch_selection_extends() { fetch_selection_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return fetch_selection_extends.apply(this, arguments); }", "function interactiveFlag(model) {\n if (!model.component.selection) return null;\n var unitCount = keys(model.component.selection).length;\n var parentCount = unitCount;\n var parent = model.parent;\n\n while (parent && parentCount === 0) {\n parentCount = keys(parent.component.selection).length;\n parent = parent.parent;\n }\n\n return parentCount ? {\n interactive: unitCount > 0\n } : null;\n }", "function selection(doc) {\n\t try {\n\t if (doc.selection) { // IE\n\t\t return doc.selection.createRange().parentElement();\n\t } else { // Mozilla\n\t\t return doc.getSelection().getRangeAt(0).commonAncestorContainer;\n\t }\n\t }\n\t catch(e) {\n\t error('selection', doc, e);\n\t return false;\n\t }\n }", "get parent_id() {return this.artefact.compartment_id;}", "get parent() {\n return this._parent;\n }", "get parent() {\n return this._parent;\n }", "get parent() {\n return this._parent;\n }", "function get_parents(element, status) {\n\n // If parent already has.\n var parentsv = body.attr(\"data-clickable-select\");\n\n // If status default, return current data.\n if (status == 'default' || status == 'defaultS') {\n if (isDefined(parentsv)) {\n return parentsv;\n }\n }\n\n if (element === null) {\n element = get_selected_element();\n }\n\n // Be sure this item is valid.\n if (element[0] === undefined || element[0] === false || element[0] === null) {\n return false;\n }\n\n\n // Is sharp?\n if ($(\"body\").hasClass(\"yp-sharp-selector-mode-active\")) {\n status = 'sharp';\n }\n\n // Get cached selector\n if (status == 'default' && element.hasAttr(\"data-default-selector\") === true) {\n return element.attr(\"data-default-selector\");\n }\n\n // Tag info\n var tagE = element[0].tagName;\n\n // ?\n if (isUndefined(tagE)) {\n return false;\n }\n\n // If body, return.\n if (tagE == 'BODY') {\n return 'body';\n }\n\n // Not possible.\n if (tagE == 'HTML') {\n return false;\n }\n\n // Getting item parents.\n var parents = element.parents(document);\n\n // Empy variable.\n var selector = '';\n var lastSelector = '';\n\n // Foreach all loops.\n for (var i = parents.length - 1; i >= 0; i--) {\n\n // If first Selector Item\n if (i == parents.length - 1) {\n\n selector += get_best_class(parents[i]);\n\n } else { // If not.\n\n // Get Selector name.\n var thisSelector = get_best_class(parents[i]);\n\n // Check if this Class.\n // Reset past selector names if current selector already one in document.\n if (thisSelector.indexOf(\".\") != -1 && iframe.find(thisSelector).length == 1) {\n\n if (status != 'sharp') {\n selector = thisSelector + window.separator; // Reset\n }\n\n if (status == 'sharp') {\n if (single_selector(selector).indexOf(\"nth-child\") == -1) {\n selector = thisSelector + window.separator; // Reset\n }\n }\n\n } else {\n\n selector += thisSelector + window.separator; // add new\n\n }\n\n }\n\n }\n\n\n // Clean selector.\n selector = space_cleaner(selector);\n\n\n // Adding Last element to selector.\n // and check custom last element part for input tags.\n if (tagE == 'INPUT') { // if input,use tag name with TYPE.\n\n var type;\n\n if (status != 'sharp') {\n\n type = element.attr(\"type\");\n lastSelector = window.separator + 'input[type=' + type + ']';\n\n } else {\n\n var sharpLast = get_best_class(element);\n\n if (sharpLast.indexOf(\"input#\") != -1) {\n sharpLast = sharpLast.replace(\"input#\", \"#\");\n }\n\n type = element.attr(\"type\");\n\n lastSelector = window.separator + 'input[type=' + type + ']' + sharpLast;\n\n }\n\n\n } else { // else find the best class.\n\n lastSelector = window.separator + get_best_class(element);\n\n }\n\n // Selectors ready!\n selector += lastSelector;\n\n // Fix google map contents\n if (selector.indexOf(\".gm-style\") != -1) {\n selector = '.gm-style';\n }\n\n // Selector clean.\n selector = selector.replace(\"htmlbody\", \"body\");\n\n // Return if is single selector\n if (status == 'sharp') {\n return single_selector(selector);\n }\n\n\n if (selector.indexOf(\"#\") >= 0 && selector.indexOf(\"yp-\") == -1) {\n var before = selector.split(\"#\")[0];\n if (get_selector_array(before).length === 0) {\n before = before;\n } else {\n before = get_selector_array(before)[get_selector_array(before).length - 1];\n }\n selector = selector.split(\"#\");\n selector = selector[(selector.length - 1)];\n if (before.length < 4) {\n selector = before + \"#\" + selector;\n } else {\n selector = \"#\" + selector;\n }\n }\n\n\n // NEW\n var array = get_selector_array(selector);\n\n var q = 0;\n for (q = 0; q < array.length - 2; q++) {\n\n if (element.parents(array[q]).length == 1) {\n delete array[q + 1];\n }\n\n }\n\n var selectorNew = $.trim(array.join(window.separator)).replace(/ /g, ' ');\n if (iframe.find(selector).length == iframe.find(selectorNew).length) {\n selector = selectorNew;\n }\n\n\n // Check all others elements has same nodename or not.\n if (tagE == 'H1' || tagE == 'H2' || tagE == 'H3' || tagE == 'H4' || tagE == 'H5' || tagE == 'H6' || tagE == 'P' || tagE == 'SPAN' || tagE == 'IMG' || tagE == 'STRONG' || tagE == 'A' || tagE == 'LI' || tagE == 'UL') {\n\n var foundedTags = [];\n iframeBody.find(selector).each(function () {\n if (foundedTags.indexOf($(this)[0].nodeName) == -1) {\n foundedTags.push($(this)[0].nodeName);\n }\n });\n\n if (foundedTags.length > 1) {\n selector = selector.split(lastSelector)[0] + window.separator + tagE.toLowerCase();\n }\n\n }\n\n\n // Use > If has same selectored element in selected element\n if (status == 'default') {\n\n var selectedInSelected = iframeBody.find(selector + window.separator + lastSelector).length;\n\n // USE : \">\"\n if (selectedInSelected > 0) {\n\n var untilLast = get_parents(element.parent(), \"defaultS\");\n\n selector = untilLast + \" > \" + lastSelector;\n\n selector = $.trim(selector);\n\n }\n\n }\n\n // Getting selectors by CSS files.\n if (get_selector_array(selector).length > 1) {\n\n // Get human selectors\n var humanSelectors = get_human_selector(window.humanStyleData);\n\n // Get valid human selectors\n var goodHumanSelectors = [];\n\n // Check is valid\n if (humanSelectors.length > 0) {\n\n // Each founded selectors\n $.each(humanSelectors, function (qx) {\n\n // Find the best in human selectors\n if (iframe.find(humanSelectors[qx]).length == iframe.find(selector).length) {\n\n // Push\n goodHumanSelectors.push(humanSelectors[qx]);\n\n }\n\n });\n\n // There is good selectors?\n if (goodHumanSelectors.length > 0) {\n\n // Find max long selector\n var maxSelector = goodHumanSelectors.sort(function (a, b) {\n return b.length - a.length;\n });\n\n // Be sure more long than 10 char\n if (maxSelector[0].length > 10) {\n\n // Update\n selector = maxSelector[0];\n\n }\n\n }\n\n }\n\n }\n\n\n // Keep selectors smart and short!\n if (get_selector_array(selector).length > 5) {\n\n // short Selector Ready\n var shortSelectorReady = false;\n\n // Find a founded elements\n var foundedElements = iframe.find(selector).length;\n\n // Get array from selector.\n var shortSelector = get_selector_array(selector);\n\n // Each array items\n $.each(shortSelector, function () {\n\n if (shortSelectorReady === false) {\n\n // Shift\n shortSelector.shift();\n\n // make it short\n var shortSelectorString = shortSelector.toString().replace(/\\,/g, \" \");\n\n // Search\n var foundedElShort = iframe.find(shortSelectorString).length;\n\n // Shift until make it minimum 5 item\n if (shortSelector.length <= 5 && foundedElements == foundedElShort) {\n shortSelectorReady = true;\n selector = shortSelectorString;\n }\n\n }\n\n });\n\n }\n\n // Save as cache\n if (status == 'default') {\n element.attr(\"data-default-selector\", space_cleaner(selector));\n }\n\n // Return result.\n return space_cleaner(selector);\n\n }", "function McOptionParentComponent() { }", "function useParentContextOrNot() {\n return ((nt.useParentContext == 'auto') && (parent != this))\n || (nt.useParentContext == 'yes');\n}", "get parent() {\n return this.mParent;\n }", "function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n if (type) {\n if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type))) {\n if (node.selectionSet) {\n context.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(node.name.value, type), [node.selectionSet]));\n }\n } else if (!node.selectionSet) {\n context.reportError(new _error.GraphQLError(requiredSubselectionMessage(node.name.value, type), [node]));\n }\n }\n }\n };\n}", "function ScalarLeafs(context) {\n\t return {\n\t Field: function Field(node) {\n\t var type = context.getType();\n\t if (type) {\n\t if ((0, _typeDefinition.isLeafType)(type)) {\n\t if (node.selectionSet) {\n\t context.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(node.name.value, type), [node.selectionSet]));\n\t }\n\t } else if (!node.selectionSet) {\n\t context.reportError(new _error.GraphQLError(requiredSubselectionMessage(node.name.value, type), [node]));\n\t }\n\t }\n\t }\n\t };\n\t}", "function IntObject_GetParentFormObject()\n{\n\t//default result: ourselves\n\tvar result = this;\n\t//loop until the first form/mdiform\n\twhile (result.DataObject.Class != __NEMESIS_CLASS_FORM && result.DataObject.Class != __NEMESIS_CLASS_MDIFORM || Get_Bool(result.HTML.WS_CHILD, false))\n\t{\n\t\t//is this a treegrid cell?\n\t\tif (result.TreeGridCell)\n\t\t{\n\t\t\t//switch to its treegrid\n\t\t\tresult = result.TreeGridObject;\n\t\t}\n\t\t//this an ultragrid cell\n\t\telse if (result.UltraGrid)\n\t\t{\n\t\t\t//switch to its ultraGrid\n\t\t\tresult = result.UltraGrid;\n\t\t}\n\t\t//get parent\n\t\tresult = result.Parent;\n\t}\n\t//return it\n\treturn result;\n}", "get parent() {\n return this._parent;\n }", "if (!this.ast.selectionSet) {\n return [];\n }", "get multiple() { return this._parent && this._parent.multiple; }", "get multiple() { return this._parent && this._parent.multiple; }", "get multiple() { return this._parent && this._parent.multiple; }", "parent() {\n const parents = this.nodes.reduce((arr, node) => {\n const { parentNode } = node;\n // don't add the same parent node twice\n if (parentNode && arr.every(parent => !parent.isEqualNode(parentNode))) {\n arr.push(parentNode);\n }\n return arr;\n }, []);\n\n return new DOMNodeCollection(parents);\n }", "function ViewParentExpression(expression, meta) {\n this.expression = expression;\n this.meta = meta;\n}", "function MatOptionParentComponent() {}", "function addSelCtgs() {\n // reset these properties couse after delete it is displayed 1st list\n optID = 0;\n slevel = 1;\n\n // if items in Root, shows 1st <select>, else, resets properties to initial value\n if(optHierarchy[0].length > 0) document.getElementById('n_sl'+slevel).innerHTML = getSelect(optHierarchy[0]);\n else {\n optHierarchy = {'0':[]};\n optData = {'0':{'value':'Root', 'content':'', 'parent':-1}};\n document.getElementById('n_sl'+slevel).innerHTML = '';\n }\n }", "function Selection(parent, selectionSettings, locator) {\n //Internal letiables \n /**\n \n */\n this.selectedRowIndexes = [];\n /**\n \n */\n this.selectedRowCellIndexes = [];\n /**\n \n */\n this.selectedRecords = [];\n /**\n \n */\n this.preventFocus = false;\n this.isMultiShiftRequest = false;\n this.isMultiCtrlRequest = false;\n this.enableSelectMultiTouch = false;\n this.clearRowCheck = false;\n this.selectRowCheck = false;\n this.selectedRowState = {};\n this.totalRecordsCount = 0;\n this.chkAllCollec = [];\n this.isCheckedOnAdd = false;\n this.persistSelectedData = [];\n this.isCancelDeSelect = false;\n this.isPreventCellSelect = false;\n this.disableUI = false;\n this.isPersisted = false;\n this.cmdKeyPressed = false;\n this.parent = parent;\n this.selectionSettings = selectionSettings;\n this.factory = locator.getService('rendererFactory');\n this.focus = locator.getService('focus');\n this.addEventListener();\n this.wireEvents();\n }", "get parent() {\n return childToParent.get(this) || null;\n }", "parents() {\n let until = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globals.document;\n until = makeInstance(until);\n let parents = new types_List();\n let parent = this;\n\n while ((parent = parent.parent()) && parent.node !== until.node && parent.node !== globals.document) {\n parents.push(parent);\n }\n\n return parents;\n }", "function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n if (type) {\n if ((0, _typeDefinition.isLeafType)(type)) {\n if (node.selectionSet) {\n context.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(node.name.value, type), [node.selectionSet]));\n }\n } else if (!node.selectionSet) {\n context.reportError(new _error.GraphQLError(requiredSubselectionMessage(node.name.value, type), [node]));\n }\n }\n }\n };\n}", "get parent() {\n return this.owner.owner;\n }", "setParent(prnt) {\nreturn this.parent = prnt;\n}", "function get_selection()\n {\n return selection;\n }", "function findParent(a,b){var c=a.$parent;if(c)return c.$options[b]?c:findParent(c,b)}", "getParent(){return this.__parent}", "getParent() {\nreturn this.parent;\n}", "function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n var selectionSet = node.selectionSet;\n\n if (type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"isLeafType\"])(Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"getNamedType\"])(type))) {\n if (selectionSet) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](noSubselectionAllowedMessage(node.name.value, Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type)), selectionSet));\n }\n } else if (!selectionSet) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](requiredSubselectionMessage(node.name.value, Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type)), node));\n }\n }\n }\n };\n}", "isSelectionOperation(value) {\n return Operation.isOperation(value) && value.type.endsWith('_selection');\n }", "isSelectionOperation(value) {\n return Operation.isOperation(value) && value.type.endsWith('_selection');\n }", "function selectAncestor (elem, type) {\n type = type.toLowerCase();\n if (elem.parentNode === null) {\n console.log(\"No more parents\");\n return undefined;\n }\n var tagName = elem.parentNode.tagName;\n\n if ((tagName !== undefined) && (tagName.toLowerCase() === type)) {\n return elem.parentNode;\n } else {\n return selectAncestor (elem.parentNode, type);\n }\n }", "function getApparentTypeOfContextualType(node) {\n var type = getContextualType(node);\n return type && getApparentType(type);\n }", "function TreeGrid_IsMultiSelection(theObject)\n{\n\t//check the multiselection property\n\treturn Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_MULTISELECTION], false);\n}", "function getContextualPath() {\n var currentObj = $scope.domainObject,\n currentParent,\n parents = [];\n\n currentParent = currentObj &&\n currentObj.hasCapability('context') &&\n currentObj.getCapability('context').getParent();\n\n while (currentParent && currentParent.getModel().type !== 'root' &&\n currentParent.hasCapability('context')) {\n // Record this object\n parents.unshift(currentParent);\n\n // Get the next one up the tree\n currentObj = currentParent;\n currentParent = currentObj.getCapability('context').getParent();\n }\n\n $scope.contextutalParents = parents;\n }", "get parent() {\n return this.parentNode\n }", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "function getStatementParent() {\n\t var path = this;\n\t do {\n\t if (Array.isArray(path.container)) {\n\t return path;\n\t }\n\t } while (path = path.parentPath);\n\t}", "parent() {\n return this._ancestors.top();\n }", "static parentNodeType(node, index)\n {\n // The current parent is the top of the stack, so go one below that\n index = index || 0;\n\n if (node && parentNodeTypes.has(node.type))\n ++index;\n\n const parent = Scope.parentNodes[Scope.parentNodes.length - (1 + index)];\n\n return parent ? parent.node.type : null;\n }", "get newSelection() {\n return this.selection || this.startState.selection.map(this.changes);\n }", "get parent() {\n return this.$from.node(this.depth);\n }", "function viewParentEl(view){var parentView=view.parent;if(parentView){return view.parentNodeDef.parent;}else{return null;}}", "function clickedThing(e, type)\n {\n var el = e.target;\n if(!el.is(type))\n {\n el = el.parents(type).slice(0,1);\n }\n \n return el;\n }", "function getInsertImageParent( selection, model ) {\n\tconst insertAt = Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_0__[\"findOptimalInsertionPosition\"])( selection, model );\n\n\tconst parent = insertAt.parent;\n\n\tif ( parent.isEmpty && !parent.is( '$root' ) ) {\n\t\treturn parent.parent;\n\t}\n\n\treturn parent;\n}", "function PivotContextMenu(parent){/* eslint-enable */this.parent=parent;this.parent.contextMenuModule=this;}", "function getParentData() {\n return this.getState('parentData') || {};\n }", "function hasSelectParent($node){\n if($node.closest('.cf-select').length > 0){\n return true;\n }\n return false;\n }", "function inheritanceNodeContainsParent(source, destination) {\n return (source.type !== NODE_TYPE.INHERITANCE && destination.type !== NODE_TYPE.INHERITANCE) || source.parent || destination.parent\n}", "function p(a,b){if(this.range=a,this.clonePartiallySelectedTextNodes=b,!a.collapsed){this.sc=a.startContainer,this.so=a.startOffset,this.ec=a.endContainer,this.eo=a.endOffset;var c=a.commonAncestorContainer;this.sc===this.ec&&N(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==c||N(this.sc)?T(this.sc,c,!0):this.sc.childNodes[this.so],this._last=this.ec!==c||N(this.ec)?T(this.ec,c,!0):this.ec.childNodes[this.eo-1])}}", "function course_buider_get_parent_selector_container( el ) {\n\t\tif ( typeof el !== 'undefined' ) {\n\t\t\tvar selector_container = jQuery( el ).closest( '.learndash_selectors' );\n\t\t\tif ( ( typeof selector_container !== 'undefined' ) && ( selector_container.length > 0 ) ) {\n\t\t\t\treturn selector_container[0];\n\t\t\t} else {\n\t\t\t\tvar builder_container = jQuery( el ).closest( '.learndash_builder_items' );\n\t\t\t\tif ( ( typeof builder_container !== 'undefined' ) && ( builder_container.length > 0 ) ) {\n\t\t\t\t\treturn builder_container[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function update_parent_selection( db_tree, parent_id ) {\n if ( !parent_id ) {\n return;\n }\n\n var parent_node = $('#node-' + parent_id + '-check');\n var higher_parent_id;\n\n if ( is_subtree_selected( db_tree, parent_id ) ) {\n parent_node.removeClass('pl-tree-node-unchecked')\n .addClass('pl-tree-node-checked');\n } else {\n parent_node.removeClass('pl-tree-node-checked')\n .addClass('pl-tree-node-unchecked');\n }\n\n higher_parent_id = _tree.get_parent_id( db_tree, parent_id );\n update_parent_selection( db_tree, higher_parent_id );\n }", "function getCurrentParentID(){\r\n\t\t\r\n\t\tvar parentID = null;\r\n\t\tif(g_temp.is_edit_group_mode == true)\r\n\t\t\tparentID = g_temp.edit_group_id;\r\n\t\t\r\n\t\treturn(parentID);\r\n\t}", "setParentCheckboxes(props = this.props) {\n const stateToSet = {};\n props.skillCones.data.forEach((cone) => {\n let allConeChildrenSelected = true;\n props.item.data.some((itemData) => {\n if (itemData.cone === cone.name && !itemData.isSelected) {\n allConeChildrenSelected = false;\n return true;\n }\n return false;\n });\n stateToSet[cone.id] = allConeChildrenSelected;\n });\n this.setState(stateToSet);\n }", "function parents(cursor) {\n if (cursor == null) {\n return List()\n }\n\n const self = cursor\n\n function* _ancestors() {\n let current = self\n\n while (current != null) {\n yield current\n current = parent(current)\n }\n }\n\n return Seq(_ancestors())\n}", "function setupKeyboardEvents(parent, canvas, selection) {\n parent.addEventListener(\"keydown\", keydownHandler, false);\n parent.addEventListener(\n \"mousedown\",\n function () {\n parent.focus();\n },\n false\n );\n\n function keydownHandler(evt) {\n var handled = false;\n var mk = multiselect.modifierKeys(evt);\n switch (evt.which) {\n case 37:\n handled = callArrow(mk, multiselect.LEFT);\n break;\n case 38:\n handled = callArrow(mk, multiselect.UP);\n break;\n case 39:\n handled = callArrow(mk, multiselect.RIGHT);\n break;\n case 40:\n handled = callArrow(mk, multiselect.DOWN);\n break;\n case 32:\n handled = callSpace(mk);\n break;\n case 90:\n handled = callUndoRedo(mk);\n break;\n default:\n return; // exit this handler for unrecognized keys\n }\n if (!handled) return;\n\n // event is recognized\n selection.geometry().drawIndicators(selection, canvas, true, true, false);\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n function callUndoRedo(mk) {\n switch (mk) {\n case multiselect.OPT:\n selection.undo();\n break;\n case multiselect.SHIFT_OPT:\n selection.redo();\n break;\n default:\n return false;\n }\n return true;\n }\n\n function callArrow(mk, dir) {\n switch (mk) {\n case multiselect.NONE:\n selection.arrow(dir);\n break;\n case multiselect.CMD:\n selection.cmdArrow(dir);\n break;\n case multiselect.SHIFT:\n selection.shiftArrow(dir);\n break;\n default:\n return false;\n }\n return true;\n }\n\n function callSpace(mk) {\n switch (mk) {\n case multiselect.NONE:\n selection.space();\n break;\n case multiselect.CMD:\n selection.cmdSpace();\n break;\n case multiselect.SHIFT:\n selection.shiftSpace();\n break;\n default:\n return false;\n }\n return true;\n }\n}", "static find(subset, e) {\n if (subset[e].parent !=e)\n subset[e].parent = Graph.find(subset, subset[e].parent);\n \n return subset[e].parent;\n }", "parentField() {\n let parent = this.$parent;\n for (let i = 0; i < 3; i++) {\n if (parent && !parent.$data._isField) {\n parent = parent.$parent;\n }\n }\n return parent;\n }", "get contextType () {\n\t\treturn this._contextType;\n\t}", "function canInherit(contextValue) { }", "function getSelection(){\n return selection;\n }", "get isSelection() {\n return true;\n }", "function Selections (type, size, toppings) {\n this.type = type;\n this.size = size;\n this.toppings = [];\n}", "parentFrame() {\n return this.sameTargetParentFrame() || this.crossTargetParentFrame();\n }", "function TreeParent() {\n return function (object, propertyName) {\n // now try to determine it its lazy relation\n var reflectedType = Reflect && Reflect.getMetadata ? Reflect.getMetadata(\"design:type\", object, propertyName) : undefined;\n var isLazy = (reflectedType && typeof reflectedType.name === \"string\" && reflectedType.name.toLowerCase() === \"promise\") || false;\n __1.getMetadataArgsStorage().relations.push({\n isTreeParent: true,\n target: object.constructor,\n propertyName: propertyName,\n isLazy: isLazy,\n relationType: \"many-to-one\",\n type: function () { return object.constructor; },\n options: {}\n });\n };\n}", "function TreeParent() {\n return function (object, propertyName) {\n // now try to determine it its lazy relation\n var reflectedType = Reflect && Reflect.getMetadata ? Reflect.getMetadata(\"design:type\", object, propertyName) : undefined;\n var isLazy = (reflectedType && typeof reflectedType.name === \"string\" && reflectedType.name.toLowerCase() === \"promise\") || false;\n __1.getMetadataArgsStorage().relations.push({\n isTreeParent: true,\n target: object.constructor,\n propertyName: propertyName,\n isLazy: isLazy,\n relationType: \"many-to-one\",\n type: function () { return object.constructor; },\n options: {}\n });\n };\n}", "function getStatementParent() {\n var path = this;\n do {\n if (Array.isArray(path.container)) {\n return path;\n }\n } while (path = path.parentPath);\n}", "__getParentId() {\n return this.part ? this.part.parentId : this.__parentId;\n }", "function _updateSelectedObject() {\n var data = $('.listTree').data('listTree');\n\n // Filter the context to the selected parents.\n var selected = _.filter($.extend(true, {}, data.context), function(parent) {\n return $('.listTree > ul > li > span > input[value=\"' + parent.key + '\"]').prop('checked')\n });\n \n // For each parent in the working context...\n _.each(selected, function(parent) {\n\n // Filter the children to the selected children.\n parent.values = _.filter(parent.values, function(child) {\n return $('.listTree > ul > li > ul > li > span > input[value=\"' + child.key + '\"]').prop('checked');\n });\n });\n\n // Update the plugin's selected object.\n $('.listTree').data('listTree', {\n \"target\": data.target,\n \"context\": data.context,\n \"options\": data.options,\n \"selected\": selected\n });\n }", "parent (selector = '*') {\n let result = new Set()\n let selectorData = cssParser(selector)\n\n for (let item of this) {\n let parent = item.parent\n\n if (!parent || !selectorData) {\n continue\n }\n\n if (cssMatch(parent, selectorData[0])) {\n result.add(parent)\n }\n }\n\n let $elements = new this.constructor([...result])\n\n return $elements\n }", "function captureSourceAndParent(element, options) {\n options.origin = angular.extend({\n element: null,\n bounds: null,\n focus: angular.noop\n }, options.origin || {});\n\n var source = angular.element((options.targetEvent || {}).target);\n if (source && source.length) {\n // Compute and save the target element's bounding rect, so that if the\n // element is hidden when the dialog closes, we can shrink the dialog\n // back to the same position it expanded from.\n options.origin.element = source;\n options.origin.bounds = source[0].getBoundingClientRect();\n options.origin.focus = function() {\n source.focus();\n }\n }\n\n // If the parent specifier is a simple string selector, then query for\n // the DOM element.\n if ( angular.isString(options.parent) ) {\n var simpleSelector = options.parent,\n container = $document[0].querySelectorAll(simpleSelector);\n options.parent = container.length ? container[0] : null;\n }\n // If we have a reference to a raw dom element, always wrap it in jqLite\n options.parent = angular.element(options.parent || $rootElement);\n\n }", "function updateParent(e) {\n var context = e.context;\n\n self.updateParent(context.shape || context.connection, context.oldParent);\n }", "function updateParent(e) {\n var context = e.context;\n\n self.updateParent(context.shape || context.connection, context.oldParent);\n }", "_getEffectiveParent() {\n let p = this.parent;\n while (p instanceof BlockScope && !p._closedOver) {\n p = p.parent;\n }\n return p;\n }", "function noSubselectionAllowedMessage(fieldName, type) {\n return \"Field \\\"\".concat(fieldName, \"\\\" must not have a selection since \") + \"type \\\"\".concat(type, \"\\\" has no subfields.\");\n}", "function getSelectedOrgType() {\n return $('#adminCode :selected')\n .parent()\n .attr('label')\n .toLowerCase();\n}", "get parentName () {\n\t\treturn Object.getPrototypeOf(this.constructor).name\n\t}", "function updateParent(e) {\n var context = e.context;\n self.updateParent(context.shape || context.connection, context.oldParent);\n }", "get allowsNesting() { return true; }", "function WoDUiGemDropDownSelectable( parentIsInline ) {\n\n WodUiWidget.call(this, 'div')\n this.setClass('gemselect selectable');\n\n this.parentIsInline = parentIsInline\n\n this.options = new Array();\n this.selectedIndex = 0;\n}", "function inBaseTreeView() { }" ]
[ "0.55689836", "0.54625463", "0.53899294", "0.5262049", "0.5241027", "0.5237543", "0.5089366", "0.5059023", "0.50468224", "0.5042407", "0.5038982", "0.50358033", "0.5032824", "0.49612266", "0.49425656", "0.49404562", "0.4937875", "0.4937875", "0.4937875", "0.49253392", "0.491478", "0.48982704", "0.48876235", "0.48833126", "0.4861217", "0.48547903", "0.48542836", "0.48446092", "0.48433253", "0.48433253", "0.48433253", "0.48408115", "0.48300838", "0.48171353", "0.48035967", "0.48028272", "0.47727272", "0.47595176", "0.47543043", "0.47471943", "0.47469804", "0.4726545", "0.47234067", "0.4717776", "0.470769", "0.46866423", "0.46844068", "0.46844068", "0.46796373", "0.46761808", "0.46574035", "0.46416655", "0.46266118", "0.46182647", "0.46182647", "0.46182647", "0.46182647", "0.46182647", "0.4614444", "0.45966694", "0.45879298", "0.45868886", "0.45825917", "0.45720163", "0.4555676", "0.45496756", "0.45470738", "0.4532383", "0.45320728", "0.45166194", "0.4514471", "0.45115665", "0.45107454", "0.45080352", "0.45070252", "0.4506816", "0.44923174", "0.44916925", "0.4486066", "0.44852495", "0.44777733", "0.44763604", "0.44621944", "0.44508696", "0.44498765", "0.44498765", "0.44415677", "0.44327563", "0.4427611", "0.44231358", "0.44085127", "0.44052956", "0.44052956", "0.44026318", "0.43999517", "0.4398884", "0.43890285", "0.43878043", "0.43861845", "0.4383296", "0.43814072" ]
0.0
-1
These types can all accept null as a value.
function getNullableType(type) { return type instanceof GraphQLNonNull ? type.ofType : type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNullOrUndefined(value){return value===null||value===undefined;}", "function isNone(value) { return value === null || value === undefined; }", "set None(value) {}", "set None(value) {}", "set None(value) {}", "set None(value) {}", "static nonNull<T>(value: ?T): T {\n if (value === null) {\n throw new Error(\"null value.\");\n }\n if (value === undefined) {\n throw new Error(\"undefined value.\");\n }\n return value;\n }", "function isNull(val){return(val==null);}", "function isBasicValue(val) {\n var t = typeof val;\n return val === null || (t !== 'object' && t !== 'function');\n }", "get None() {}", "get None() {}", "get None() {}", "get None() {}", "function isemptyornull(value)\n {\n return !(typeof value === \"string\" && value.length > 0);\n }", "NullLiteral() {\n this._eat('null');\n return {\n type: 'NullLiteral',\n value: null,\n };\n }", "function isPrimitive(value) {\n return typeof value !== 'object' || value === null;\n}", "function nullAndUndefined()\n{\n\n}", "__is_null(value) {\n return value === null;\n }", "function NullLiteralTypeAnnotation() {\n this.push(\"null\");\n}", "function Null() {\n return null;\n}", "function _nullCoerce() {\n return '';\n}", "function Null() {\n}", "function isConstrainedValue(value) {\n return value !== undefined && value !== null && value !== 'none';\n }", "function isConstrainedValue(value) {\n return value !== undefined && value !== null && value !== 'none';\n }", "function U(V){return void 0===V||null===V}", "function isConstrainedValue(value) {\n return value !== undefined && value !== null && value !== 'none';\n }", "function isConstrainedValue(value) {\n return value !== undefined && value !== null && value !== 'none';\n }", "function haveNull(pos) {\r\n return pos.value == null;\r\n }", "function isNullish(value) {\n\t return value === null || value === undefined || value !== value;\n\t}", "Null(options = {}) {\r\n return { ...options, kind: exports.NullKind, type: 'null' };\r\n }", "function isNully (value) {return isNull(value) || typeof value === 'undefined'}", "static fromNull(value) {\n return new DynamoAttributeValue({ NULL: value });\n }", "function t(a){return void 0===a||null===a}", "function toNullable(ma) {\n return isNone(ma) ? null : ma.value;\n}", "function isNullish(value) {\n return value === null || value === undefined || value !== value;\n}", "function isNullish(value) {\n return value === null || value === undefined || value !== value;\n}", "function isNullish(value) {\n return value === null || value === undefined || value !== value;\n}", "function isNullish(value) {\n return value === null || value === undefined || value !== value;\n}", "function isNodeNully(node) {\n if (node == null) {\n return true;\n } else if (node.type === 'Identifier' && node.name === 'undefined') {\n return true;\n } else if (node.type === 'Literal' && node.value === null) {\n return true;\n } else if (node.type === 'UnaryExpression' && node.operator === 'void') {\n return true;\n } else {\n return false;\n }\n }", "function none(value) {\n\treturn value\n}", "function parseNullValue(val) {\n if (utils.isString(val) && !isNaN(+val)) {\n val = +val;\n }\n if (val === 'null') {\n val = null;\n }\n return val;\n }", "function nullish(nullishVal, defaultVal) {\n return nullishVal !== null && nullishVal !== undefined ? nullishVal : defaultVal;\n}", "function nullFunc(){}", "function getTypeForFilter(val) { // 18572\n return (val === null) ? 'null' : typeof val; // 18573\n} // 18574", "function isPrimitiveType(value) {\n return (typeof value !== \"object\" && typeof value !== \"function\") || value === null;\n}", "function isPrimitiveType(value) {\n return (typeof value !== \"object\" && typeof value !== \"function\") || value === null;\n}", "function isUndef(v){return v===undefined||v===null;}", "function isUndef(v){return v===undefined||v===null;}", "function isConstrainedValue(value) {\r\n\t\treturn value !== undefined && value !== null && value !== 'none';\r\n\t}", "function o(t){return void 0===t||null===t}", "function o(t){return void 0===t||null===t}", "function o(t){return void 0===t||null===t}", "function o(t){return void 0===t||null===t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}", "function isConstrainedValue(value) {\n\t\treturn value !== undefined && value !== null && value !== 'none';\n\t}" ]
[ "0.67271715", "0.6582149", "0.65085024", "0.65085024", "0.65085024", "0.65085024", "0.6483589", "0.64313513", "0.64006245", "0.6350447", "0.6350447", "0.6350447", "0.6350447", "0.6287215", "0.62045217", "0.6204463", "0.619998", "0.61980546", "0.6198012", "0.61957824", "0.6141051", "0.6137735", "0.61296463", "0.61296463", "0.6121857", "0.61166334", "0.61051756", "0.6097608", "0.6075847", "0.6075334", "0.60203385", "0.59744704", "0.5944988", "0.59268916", "0.5917447", "0.5917447", "0.5917447", "0.5917447", "0.5894306", "0.5886463", "0.5885886", "0.588587", "0.5875842", "0.5875395", "0.58456033", "0.58456033", "0.58415395", "0.58415395", "0.581813", "0.58174753", "0.58174753", "0.58174753", "0.58174753", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352", "0.5817352" ]
0.0
-1
These named types do not include modifiers like List or NonNull.
function isNamedType(type) { return type instanceof GraphQLScalarType || type instanceof GraphQLObjectType || type instanceof GraphQLInterfaceType || type instanceof GraphQLUnionType || type instanceof GraphQLEnumType || type instanceof GraphQLInputObjectType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListType(){\n\tthis.astObject = ListExpression;\n\t\t\n\tthis.toString = function(){\n\t\treturn 'list'\n\t}\n}", "function StructType() {}", "function getNamedType(type) {\n\t var unmodifiedType = type;\n\t while (unmodifiedType instanceof GraphQLList || unmodifiedType instanceof GraphQLNonNull) {\n\t unmodifiedType = unmodifiedType.ofType;\n\t }\n\t return unmodifiedType;\n\t}", "function KnownTypeNames(context) {\n\t return {\n\t // TODO: when validating IDL, re-enable these. Experimental version does not\n\t // add unreferenced types, resulting in false-positive errors. Squelched\n\t // errors for now.\n\t ObjectTypeDefinition: function ObjectTypeDefinition() {\n\t return false;\n\t },\n\t InterfaceTypeDefinition: function InterfaceTypeDefinition() {\n\t return false;\n\t },\n\t UnionTypeDefinition: function UnionTypeDefinition() {\n\t return false;\n\t },\n\t InputObjectTypeDefinition: function InputObjectTypeDefinition() {\n\t return false;\n\t },\n\t NamedType: function NamedType(node) {\n\t var typeName = node.name.value;\n\t var type = context.getSchema().getType(typeName);\n\t if (!type) {\n\t context.reportError(new _error.GraphQLError(unknownTypeMessage(typeName), [node]));\n\t }\n\t }\n\t };\n\t}", "function Type(){\n\t\t\tthis.array='Array';\n\t\t\tthis.object='object';\n\t\t\tthis.string='string';\n\t\t\tthis.fn='function';\n\t\t\tthis.number='number';\n\t\t}", "function AnnotationTypeList () {\n\t}", "ensure(types) {\n return {\n name: types.string.isRequired\n }\n }", "function KnownTypeNames(context) {\n return {\n // TODO: when validating IDL, re-enable these. Experimental version does not\n // add unreferenced types, resulting in false-positive errors. Squelched\n // errors for now.\n ObjectTypeDefinition: function ObjectTypeDefinition() {\n return false;\n },\n InterfaceTypeDefinition: function InterfaceTypeDefinition() {\n return false;\n },\n UnionTypeDefinition: function UnionTypeDefinition() {\n return false;\n },\n InputObjectTypeDefinition: function InputObjectTypeDefinition() {\n return false;\n },\n NamedType: function NamedType(node) {\n var typeName = node.name.value;\n var type = context.getSchema().getType(typeName);\n if (!type) {\n context.reportError(new _error.GraphQLError(unknownTypeMessage(typeName), [node]));\n }\n }\n };\n}", "function KnownTypeNames(context) {\n return {\n // TODO: when validating IDL, re-enable these. Experimental version does not\n // add unreferenced types, resulting in false-positive errors. Squelched\n // errors for now.\n ObjectTypeDefinition: function ObjectTypeDefinition() {\n return false;\n },\n InterfaceTypeDefinition: function InterfaceTypeDefinition() {\n return false;\n },\n UnionTypeDefinition: function UnionTypeDefinition() {\n return false;\n },\n InputObjectTypeDefinition: function InputObjectTypeDefinition() {\n return false;\n },\n NamedType: function NamedType(node) {\n var schema = context.getSchema();\n var typeName = node.name.value;\n var type = schema.getType(typeName);\n if (!type) {\n context.reportError(new _error.GraphQLError(unknownTypeMessage(typeName, (0, _suggestionList2.default)(typeName, Object.keys(schema.getTypeMap()))), [node]));\n }\n }\n };\n}", "function KnownTypeNames(context) {\n return {\n // TODO: when validating IDL, re-enable these. Experimental version does not\n // add unreferenced types, resulting in false-positive errors. Squelched\n // errors for now.\n ObjectTypeDefinition: function ObjectTypeDefinition() {\n return false;\n },\n InterfaceTypeDefinition: function InterfaceTypeDefinition() {\n return false;\n },\n UnionTypeDefinition: function UnionTypeDefinition() {\n return false;\n },\n InputObjectTypeDefinition: function InputObjectTypeDefinition() {\n return false;\n },\n NamedType: function NamedType(node) {\n var schema = context.getSchema();\n var typeName = node.name.value;\n var type = schema.getType(typeName);\n if (!type) {\n context.reportError(new _error.GraphQLError(unknownTypeMessage(typeName, (0, _suggestionList2.default)(typeName, Object.keys(schema.getTypeMap()))), [node]));\n }\n }\n };\n}", "function NullLiteralTypeAnnotation() {\n this.push(\"null\");\n}", "function UnderreactType() {}", "function ObjectCollectionType()\n {\n ObjectCollectionType.$parent.apply(this, arguments);\n }", "function Type() {}", "_$kind() {\n super._$kind();\n this._value.kind = 'member';\n }", "function getNamedTypeNode(typeNode) {\n var namedType = typeNode;\n while (namedType.kind === _kinds.LIST_TYPE || namedType.kind === _kinds.NON_NULL_TYPE) {\n namedType = namedType.type;\n }\n return namedType;\n}", "function Type() {\r\n}", "getType() {\n return 'list';\n }", "function ctGetBasicTypes()\n{\n\tvar ret = {};\n\tvar key;\n\tfor (key in deftypes)\n\t\tret[key] = deftypes[key];\n\n\treturn (ret);\n}", "function Type() {\n}", "function PersonType(name) {\n this.name = name;\n}", "function PersonType(name) {\n\tthis.name = name;\n}", "function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isTypeDefinitionNode\"])(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isStandardTypeName(typeName)) {\n return;\n }\n\n var suggestedTypes = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__[\"GraphQLError\"](\"Unknown type \\\"\".concat(typeName, \"\\\".\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(suggestedTypes), node));\n }\n }\n };\n}", "getAllowedAttributes () {\n\t\treturn {\n\t\t\tstring: ['name', 'purpose'],\n\t\t\tobject: ['$addToSet', '$push', '$pull'],\n\t\t\tboolean: ['isArchived']\n\t\t};\n\t}", "static isNamed(structure) {\r\n switch (structure.kind) {\r\n case StructureKind_1.StructureKind.Enum:\r\n case StructureKind_1.StructureKind.Interface:\r\n case StructureKind_1.StructureKind.JsxAttribute:\r\n case StructureKind_1.StructureKind.Namespace:\r\n case StructureKind_1.StructureKind.TypeAlias:\r\n case StructureKind_1.StructureKind.TypeParameter:\r\n case StructureKind_1.StructureKind.ShorthandPropertyAssignment:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "function KnownTypeNames(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if ((0, _predicates.isTypeDefinitionNode)(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var definitionNode = ancestors[2] || parent;\n var isSDL = isSDLNode(definitionNode);\n\n if (isSDL && isSpecifiedScalarName(typeName)) {\n return;\n }\n\n var suggestedTypes = (0, _suggestionList.default)(typeName, isSDL ? specifiedScalarsNames.concat(typeNames) : typeNames);\n context.reportError(new _GraphQLError.GraphQLError(unknownTypeMessage(typeName, suggestedTypes), node));\n }\n }\n };\n}", "constructor(type, type_list, value_list=null) {\n super(type)\n this.type_list = type_list\n if(value_list==null){\n value_list = []\n for(var i=0; i<type_list.length; i++) value_list.push(null)\n }\n this.value_list = value_list\n }", "function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isTypeDefinitionNode\"])(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isSpecifiedScalarName(typeName)) {\n return;\n }\n\n var suggestedTypes = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeName, isSDL ? specifiedScalarsNames.concat(typeNames) : typeNames);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_2__[\"GraphQLError\"](\"Unknown type \\\"\".concat(typeName, \"\\\".\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(suggestedTypes), node));\n }\n }\n };\n}", "function type_(){this.type=( joo.MemberDeclaration.MEMBER_TYPE_CLASS);}", "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}", "static hasName(structure) {\r\n return typeof structure.name === \"string\";\r\n }", "function KnownTypeNames(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = context.getDocument().definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var def = _step.value;\n\n if (Object(_language_predicates__WEBPACK_IMPORTED_MODULE_3__[\"isTypeDefinitionNode\"])(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var definitionNode = ancestors[2] || parent;\n var isSDL = isSDLNode(definitionNode);\n\n if (isSDL && isSpecifiedScalarName(typeName)) {\n return;\n }\n\n var suggestedTypes = Object(_jsutils_suggestionList__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeName, isSDL ? specifiedScalarsNames.concat(typeNames) : typeNames);\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](unknownTypeMessage(typeName, suggestedTypes), node));\n }\n }\n };\n}", "parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS)\n ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType)\n : [];\n }", "function NullableTypeAnnotation(node, parent) {\n\t return t.isArrayTypeAnnotation(parent);\n\t}", "function NullableTypeAnnotation(node, parent) {\n\t return t.isArrayTypeAnnotation(parent);\n\t}", "function newTypesComplain(req, res) {\n\n}", "function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if ((0, _predicates.isTypeDefinitionNode)(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isStandardTypeName(typeName)) {\n return;\n }\n\n var suggestedTypes = (0, _suggestionList.default)(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames);\n context.reportError(new _GraphQLError.GraphQLError(\"Unknown type \\\"\".concat(typeName, \"\\\".\") + (0, _didYouMean.default)(suggestedTypes), node));\n }\n }\n };\n}", "function KnownTypeNamesRule(context) {\n var schema = context.getSchema();\n var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if ((0, _predicates.isTypeDefinitionNode)(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes));\n return {\n NamedType: function NamedType(node, _1, parent, _2, ancestors) {\n var typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent;\n var isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && isStandardTypeName(typeName)) {\n return;\n }\n\n var suggestedTypes = (0, _suggestionList.default)(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames);\n context.reportError(new _GraphQLError.GraphQLError(\"Unknown type \\\"\".concat(typeName, \"\\\".\") + (0, _didYouMean.default)(suggestedTypes), node));\n }\n }\n };\n}", "function parseMemberTypesDefinition(lexer$$1) {\n var types = [];\n if (skip(lexer$$1, lexer.TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer$$1, lexer.TokenKind.PIPE);\n do {\n types.push(parseNamedType(lexer$$1));\n } while (skip(lexer$$1, lexer.TokenKind.PIPE));\n }\n return types;\n}", "'getType'() {\n\t\tthrow new Error('Not implemented.');\n\t}", "function tsParseAssignableListItemTypes() {\n const oldIsType = pushTypeContext(0);\n eat(TokenType.question);\n tsTryParseTypeAnnotation();\n popTypeContext(oldIsType);\n}", "function Array(){\n this.is = \"Array\";\n}", "function SuperType(name) { \n\t \t\t\t\tthis.name = name;\n\t \t\t\t}", "function parseMemberTypesDefinition(lexer) {\n\t var types = [];\n\t if (skip(lexer, _lexer.TokenKind.EQUALS)) {\n\t // Optional leading pipe\n\t skip(lexer, _lexer.TokenKind.PIPE);\n\t do {\n\t types.push(parseNamedType(lexer));\n\t } while (skip(lexer, _lexer.TokenKind.PIPE));\n\t }\n\t return types;\n\t}", "function UnionType() {\n // Copy arguments object as an array:\n this.types = [].slice.call(arguments).sort();\n }", "function EnumType(name) {\n return function(url) {\n return B (NullaryType (name) (url) ([])) (memberOf);\n };\n }", "function ComponentType(){}", "function isList(v) {\n\t\treturn !!v && v.length != _null && !isString(v) && !isNode(v) && !isFunction(v);\n\t}", "function List(ary, type) {\n\n if (ary !== undefined) {\n var array = ary;\n }\n else {\n array = [];\n }\n\n this.ListContentType = type;\n\n this.TypeCheck = function (item) {\n\n if (this.ListContentType === undefined) {\n return true; // not typed\n }\n\n\n if (item instanceof this.ListContentType) {\n return true;\n }\n else {\n throw new Error(\"incompatible type cannot add to list\");\n return false;\n }\n };\n\n if (array === undefined) {\n array = [];\n }\n\n this.Select = function (selection) {\n var temp = [];\n for (var i = 0; i < array.length; i++) {\n temp.push(selection(array[i]));\n }\n\n return new List(temp);\n };\n this.ToArray = function () {\n\n return array.slice();\n };\n this.Get = function (index) {\n return array[index];\n };\n\n\n // this.TypeCheck = function (item) { alert(\"test\");};\n\n this.Add = function (item) {\n\n\n if (this.TypeCheck(item)) {\n array.push(item);\n }\n\n\n };\n this.AddUnique = function (item) {\n if (this.TypeCheck(item)) {\n if (!array.Contains(item)) {\n array.push(item);\n }\n }\n };\n this.AddRange = function (items) {\n for (var i = 0; i < items.length; i++) {\n if (this.TypeCheck(items[i])) {\n this.Add(items[i]);\n }\n }\n }\n this.AddUniqueRange = function () {\n for (var i = 0; i < items.length; i++) {\n if (this.TypeCheck(items[i])) {\n if (!array.Contains(items[i])) {\n this.AddUnique(items[i]);\n }\n }\n }\n };\n this.IndexOf = function (item) {\n return array.IndexOf(item);\n };\n this.Remove = function (item) {\n if (array.indexOf(item) != -1) {\n array.splice(i, 1);\n }\n };\n this.RemoveRange = function (items) {\n for (var i = 0; i < array.length; i++) {\n if (array.indexOf(items[i]) != -1) {\n array.splice(i, 1);\n }\n }\n };\n this.Count = function () {\n return array.length;\n }\n\n this.OrderByAsc = function (selectfunc) {\n array.sort(function (a, b) {\n \n \n\n if (selectfunc(a) < selectfunc(b)) { return -1; }\n if (selectfunc(a) > selectfunc(b)) { return 1; }\n });\n return this;\n };\n \n this.OrderByDesc = function (selectfunc) {\n array.sort(function (a, b) {\n if (selectfunc(a) > selectfunc(b)) { return -1; }\n if (selectfunc(a) < selectfunc(b)) { return 1; }\n });\n return this;\n };\n\n\n this.ForEach = function (fnc) {\n array.forEach(fnc);\n };\n}", "function __FIXME_SBean_assert_ignore_list() {\n\tthis._pname_ = \"assert_ignore_list\";\n\t//this.keywords:\t\tset[string]\t\n}", "function TypeParam(pos) { this.pos = pos }", "function ComponentType() {}", "function relaxType(type) {\n switch (type.kind) {\n case SimpleTypeKind.INTERSECTION:\n case SimpleTypeKind.UNION:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ENUM:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ARRAY:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.PROMISE:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.OBJECT:\n return {\n name: type.name,\n kind: SimpleTypeKind.OBJECT\n };\n case SimpleTypeKind.INTERFACE:\n case SimpleTypeKind.FUNCTION:\n case SimpleTypeKind.CLASS:\n return {\n name: type.name,\n kind: SimpleTypeKind.ANY\n };\n case SimpleTypeKind.NUMBER_LITERAL:\n return { kind: SimpleTypeKind.NUMBER };\n case SimpleTypeKind.STRING_LITERAL:\n return { kind: SimpleTypeKind.STRING };\n case SimpleTypeKind.BOOLEAN_LITERAL:\n return { kind: SimpleTypeKind.BOOLEAN };\n case SimpleTypeKind.BIG_INT_LITERAL:\n return { kind: SimpleTypeKind.BIG_INT };\n case SimpleTypeKind.ENUM_MEMBER:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.ALIAS:\n return __assign(__assign({}, type), { target: relaxType(type.target) });\n case SimpleTypeKind.NULL:\n case SimpleTypeKind.UNDEFINED:\n return { kind: SimpleTypeKind.ANY };\n default:\n return type;\n }\n}", "function NullableTypeAnnotation(node, parent) {\n return t.isArrayTypeAnnotation(parent);\n}", "get type () {\n return BLANK;\n }", "function Wrapper() {\n this.excludeNullType = function (type) {\n return false;\n };\n\n this.toString = function (pointer) {\n var output = '';\n\n var keys = Object.keys(pointer);\n keys.forEach(function (key) {\n output += '[' + key + '] ';\n });\n\n return output;\n };\n }", "_getTypesList(){\n return [\n {\"optText\": \"Select type\", \"optValue\":\"\"},\n {\"optText\": \"Media Type\", \"optValue\":\"MediaType\"},\n {\"optText\": \"Localization Type\", \"optValue\":\"LocalizationType\"},\n {\"optText\": \"State Type\", \"optValue\":\"StateType\"},\n {\"optText\": \"Leaf Type\", \"optValue\":\"LeafType\"},\n ];\n }", "static isTypeElementMembered(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.Interface;\r\n }", "function getType() { return \"not\"; }", "static get __resourceType() {\n\t\treturn 'List';\n\t}", "function Struct() {}", "function printTypeDecl(type) {\n if (type.kind === TypeKind.LIST) {\n return '[' + printTypeDecl(type.ofType) + ']';\n } else if (type.kind === TypeKind.NON_NULL) {\n return printTypeDecl(type.ofType) + '!';\n } else {\n return type.name;\n }\n}", "constructor(name = '', type = '', length = 0) {\n super();\n if (name)\n this.name = name;\n if (type)\n this.type = type;\n if (length)\n this.length = length;\n }", "function GetItemTypeForListName(name) {\n return \"SP.Data.\" + name.charAt(0).toUpperCase() + name.split(\" \").join(\"\").slice(1) + \"ListItem\";\n}", "get typeEnabled() {\n return [];\n }", "function ListOf(type) {\n if(!(this instanceof ListOf)) return new ListOf(type);\n\n this.type = type;\n}", "function _Type(\n type, // :: String\n name, // :: String\n url, // :: String\n arity, // :: NonNegativeInteger\n format,\n // :: Nullable ((String -> String, String -> String -> String) -> String)\n supertypes, // :: Array Type\n test, // :: Any -> Boolean\n tuples // :: Array (Array3 String (a -> Array b) Type)\n ) {\n var t = Object.create (Type$prototype);\n t._test = test;\n t._extractors = tuples.reduce (function(_extractors, tuple) {\n _extractors[tuple[0]] = tuple[1];\n return _extractors;\n }, {});\n t.arity = arity; // number of type parameters\n t.extractors = Z.map (B (toArray), t._extractors);\n t.format = format || function(outer, inner) {\n return Z.reduce (function(s, tuple) {\n return s +\n outer (' ') +\n when (tuple[2].arity > 0)\n (parenthesize (outer))\n (inner (tuple[0]) (show (tuple[2])));\n }, outer (name), tuples);\n };\n t.keys = tuples.map (function(tuple) { return tuple[0]; });\n t.name = name;\n t.supertypes = supertypes;\n t.type = type;\n t.types = tuples.reduce (function(types, tuple) {\n types[tuple[0]] = tuple[2];\n return types;\n }, {});\n t.url = url;\n return t;\n }", "function SuperType(name){\n this.name = name;\n}", "tokenTypes(){\n var lex = []\n for(var k in this.lexeme ) \n if( !this.removable(k) ) lex.push(k)\n return lex\n }", "function makeTagTypes(name) {\n const parts = splitOne(name, '::');\n const tag = parts ? parts[1] : name;\n // Translate in the same way for all types, to match Python's generic translation.\n return ['scalar', 'sequence', 'mapping'].map(kind => new jsYaml.Type('!' + tag, {\n kind: kind,\n construct: data => ({[name]: applyOverrides(data, tag, 'parse')}),\n predicate: obj => checkType(obj, name),\n represent: obj => applyOverrides(obj[name], tag, 'dump'),\n }));\n}", "function getNamedTypeAST(typeAST) {\n\t var namedType = typeAST;\n\t while (namedType.kind === _kinds.LIST_TYPE || namedType.kind === _kinds.NON_NULL_TYPE) {\n\t namedType = namedType.type;\n\t }\n\t return namedType;\n\t}", "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}", "_$kind() {\n super._$kind();\n this._value.kind = 'class';\n }", "function test_type_unification_fixListCtorCrashedWhenDisconnecting() {\n var workspace = create_typed_workspace();\n try {\n var defineCtr = workspace.newBlock('defined_datatype_typed');\n defineCtr.getField('DATANAME').setText('fooo');\n var ctorValue = getVariable(defineCtr, 0);\n ctorValue.setVariableName('Bar');\n var listType = workspace.newBlock('alist_type_constructor_typed');\n defineCtr.getInput('CTR_INP0').connection.connect(listType.outputConnection);\n var intType = workspace.newBlock('int_type_typed');\n listType.getInput('ITEM').connection.connect(intType.outputConnection);\n\n var ctorBlock = createReferenceBlock(ctorValue);\n assertStructureInputSize(ctorBlock, 1);\n var param = ctorBlock.getInput('PARAM0').connection;\n assertTrue(param.typeExpr.isList());\n assertTrue(param.typeExpr.element_type.isInt());\n\n var listBlock = workspace.newBlock('lists_create_with_typed');\n param.connect(listBlock.outputConnection);\n\n var failed = false;\n try {\n intType.outputConnection.disconnect();\n } catch (e) {\n failed = true;\n }\n assertTrue(failed);\n } finally {\n workspace.dispose();\n }\n}", "static isNameable(structure) {\r\n switch (structure.kind) {\r\n case StructureKind_1.StructureKind.Class:\r\n case StructureKind_1.StructureKind.Function:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "static get __resourceType() {\n\t\treturn 'ListEntry';\n\t}", "function createTypeNameList(types) {\n var separator = arguments.length <= 1 || arguments[1] === undefined ? \"or\" : arguments[1];\n\n return joinSentence(types.reduce(function (names, type) {\n if (typeof type === 'object') {\n if (type.type === 'ObjectTypeProperty') {\n return [type.key.name];\n } else if (type.type === 'ObjectTypeAnnotation') {\n if (type.properties.length > 1) {\n names.push('Object with properties ' + joinSentence(type.properties.map(function (item) {\n return item.key.name;\n }), 'and'));\n } else if (type.properties.length === 1) {\n names.push('Object with a ' + type.properties[0].key.name + ' property');\n } else {\n names.push('Object with no properties');\n }\n } else {\n names.push(getTypeName(type));\n }\n } else {\n names.push(type);\n }\n return names;\n }, []), separator);\n }", "function availableTypes() {\n return (availableTypeNames()).map(function(T) { return module.exports[T]; });\n}", "additionalNametags(self) { return []; }", "static isTypeParametered(structure) {\r\n switch (structure.kind) {\r\n case StructureKind_1.StructureKind.Class:\r\n case StructureKind_1.StructureKind.Constructor:\r\n case StructureKind_1.StructureKind.ConstructorOverload:\r\n case StructureKind_1.StructureKind.GetAccessor:\r\n case StructureKind_1.StructureKind.Method:\r\n case StructureKind_1.StructureKind.MethodOverload:\r\n case StructureKind_1.StructureKind.SetAccessor:\r\n case StructureKind_1.StructureKind.Function:\r\n case StructureKind_1.StructureKind.FunctionOverload:\r\n case StructureKind_1.StructureKind.CallSignature:\r\n case StructureKind_1.StructureKind.ConstructSignature:\r\n case StructureKind_1.StructureKind.Interface:\r\n case StructureKind_1.StructureKind.MethodSignature:\r\n case StructureKind_1.StructureKind.TypeAlias:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "function ComponentType() { }", "function BlankType(typeSpec) {\n if (Object.keys(typeSpec).length > 0) {\n throw new Error('BlankType can not be customized');\n }\n}", "function listItem() {\n // To do: remove `loose` in next major.\n return {type: LIST_ITEM, loose: false, spread: false, children: []}\n}", "function declaringFields() { }", "get_type_id( name ){ return this.names.get( name ); }", "static get properties() {\n name: {\n Type: String\n }\n }", "static get properties() {\n name: {\n Type: String\n }\n }", "static get jsonSchema () {\n return {\n type: 'object',\n required: ['name']\n };\n }", "static _processType(typeItem) {\n switch (typeItem.kind) {\n case 'variable-type':\n return Type.newVariableReference(typeItem.name);\n case 'reference-type':\n return Type.newManifestReference(typeItem.name);\n case 'list-type':\n return Type.newSetView(Manifest._processType(typeItem.type));\n default:\n throw `Unexpected type item of kind '${typeItem.kind}'`;\n }\n }", "function n(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "function n(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}" ]
[ "0.59333193", "0.57858473", "0.5781263", "0.56293404", "0.56011945", "0.5581936", "0.549693", "0.5489745", "0.5477343", "0.5477343", "0.5425125", "0.54042286", "0.5375345", "0.5349533", "0.5318691", "0.5301327", "0.5300126", "0.5298626", "0.52268475", "0.522573", "0.5174429", "0.5150068", "0.51200897", "0.51002336", "0.509215", "0.50820655", "0.50818324", "0.50734", "0.5065996", "0.5060602", "0.5060602", "0.5060602", "0.5060602", "0.5060602", "0.5060602", "0.5055191", "0.50402963", "0.503898", "0.5037108", "0.5037108", "0.5033935", "0.50168204", "0.50168204", "0.5010938", "0.4964601", "0.49627382", "0.4958007", "0.495182", "0.49417514", "0.493891", "0.49374637", "0.49278718", "0.49219686", "0.49180993", "0.49142137", "0.4913625", "0.49003917", "0.48883343", "0.48852772", "0.48584774", "0.48508802", "0.4849208", "0.4849075", "0.4848257", "0.48417205", "0.48388675", "0.4837232", "0.48355934", "0.48299065", "0.48232344", "0.4821367", "0.48198736", "0.4819802", "0.48179516", "0.4812553", "0.48014727", "0.47717738", "0.47717738", "0.47717738", "0.47717738", "0.47717738", "0.47717738", "0.4771574", "0.47663742", "0.47637525", "0.47594815", "0.47545657", "0.47529972", "0.47523123", "0.47518048", "0.47488892", "0.47430557", "0.47376978", "0.47319314", "0.47312617", "0.47308254", "0.47308254", "0.47221935", "0.4721535", "0.472023", "0.472023" ]
0.0
-1
Used while defining GraphQL types to allow for circular references in otherwise immutable type definitions.
function resolveThunk(thunk) { return typeof thunk === 'function' ? thunk() : thunk; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replaceType(type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"isListType\"])(type)) {\n return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"GraphQLList\"](replaceType(type.ofType));\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"isNonNullType\"])(type)) {\n return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"GraphQLNonNull\"](replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }", "function replaceType(type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isListType\"])(type)) {\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLList\"](replaceType(type.ofType));\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_11__[\"isNonNullType\"])(type)) {\n return new _type_definition__WEBPACK_IMPORTED_MODULE_11__[\"GraphQLNonNull\"](replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }", "function replaceType(type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"isListType\"])(type)) {\n // $FlowFixMe[incompatible-return]\n return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"GraphQLList\"](replaceType(type.ofType));\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"isNonNullType\"])(type)) {\n // $FlowFixMe[incompatible-return]\n return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_16__[\"GraphQLNonNull\"](replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }", "function replaceType(type) {\n if ((0, _definition.isListType)(type)) {\n // $FlowFixMe[incompatible-return]\n return new _definition.GraphQLList(replaceType(type.ofType));\n }\n\n if ((0, _definition.isNonNullType)(type)) {\n // $FlowFixMe[incompatible-return]\n return new _definition.GraphQLNonNull(replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }", "function replaceType(type) {\n if ((0, _definition.isListType)(type)) {\n // $FlowFixMe[incompatible-return]\n return new _definition.GraphQLList(replaceType(type.ofType));\n }\n\n if ((0, _definition.isNonNullType)(type)) {\n // $FlowFixMe[incompatible-return]\n return new _definition.GraphQLNonNull(replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }", "function checkCircular(type, found) {\n if (found[type]) {\n logger.throwArgumentError(`circular type reference to ${JSON.stringify(type)}`, \"types\", types);\n }\n found[type] = true;\n Object.keys(links[type]).forEach((child) => {\n if (!parents[child]) {\n return;\n }\n // Recursively check children\n checkCircular(child, found);\n // Mark all ancestors as having this decendant\n Object.keys(found).forEach((subtype) => {\n subtypes[subtype][child] = true;\n });\n });\n delete found[type];\n }", "function checkCircular(type, found) {\n if (found[type]) {\n logger.throwArgumentError(`circular type reference to ${JSON.stringify(type)}`, \"types\", types);\n }\n found[type] = true;\n Object.keys(links[type]).forEach((child) => {\n if (!parents[child]) {\n return;\n }\n // Recursively check children\n checkCircular(child, found);\n // Mark all ancestors as having this decendant\n Object.keys(found).forEach((subtype) => {\n subtypes[subtype][child] = true;\n });\n });\n delete found[type];\n }", "function checkCircular(type, found) {\n if (found[type]) {\n logger.throwArgumentError(\"circular type reference to \" + JSON.stringify(type), \"types\", types);\n }\n found[type] = true;\n Object.keys(links[type]).forEach(function (child) {\n if (!parents[child]) {\n return;\n }\n // Recursively check children\n checkCircular(child, found);\n // Mark all ancestors as having this decendant\n Object.keys(found).forEach(function (subtype) {\n subtypes[subtype][child] = true;\n });\n });\n delete found[type];\n }", "function TypeRecursion() {}", "function buildWrappedType(innerType, inputTypeNode) {\n if (inputTypeNode.kind === Kind.LIST_TYPE) {\n return new _definition.GraphQLList(buildWrappedType(innerType, inputTypeNode.type));\n }\n if (inputTypeNode.kind === Kind.NON_NULL_TYPE) {\n var wrappedType = buildWrappedType(innerType, inputTypeNode.type);\n !!(wrappedType instanceof _definition.GraphQLNonNull) ? (0, _invariant2.default)(0, 'No nesting nonnull.') : void 0;\n return new _definition.GraphQLNonNull(wrappedType);\n }\n return innerType;\n}", "function buildWrappedType(innerType, inputTypeNode) {\n if (inputTypeNode.kind === Kind.LIST_TYPE) {\n return new _definition.GraphQLList(buildWrappedType(innerType, inputTypeNode.type));\n }\n if (inputTypeNode.kind === Kind.NON_NULL_TYPE) {\n var wrappedType = buildWrappedType(innerType, inputTypeNode.type);\n !!(wrappedType instanceof _definition.GraphQLNonNull) ? (0, _invariant2.default)(0, 'No nesting nonnull.') : void 0;\n return new _definition.GraphQLNonNull(wrappedType);\n }\n return innerType;\n}", "function resolveForwardRef(type){if(typeof type==='function'&&type.hasOwnProperty('__forward_ref__')){return type();}else{return type;}}", "function buildWrappedType(innerType, inputTypeAST) {\n if (inputTypeAST.kind === _kinds.LIST_TYPE) {\n return new _definition.GraphQLList(buildWrappedType(innerType, inputTypeAST.type));\n }\n if (inputTypeAST.kind === _kinds.NON_NULL_TYPE) {\n var wrappedType = buildWrappedType(innerType, inputTypeAST.type);\n (0, _invariant2.default)(!(wrappedType instanceof _definition.GraphQLNonNull), 'No nesting nonnull.');\n return new _definition.GraphQLNonNull(wrappedType);\n }\n return innerType;\n}", "function replaceType(type) {\n if (isListType(type)) {\n return new GraphQLList(replaceType(type.ofType));\n } else if (isNonNullType(type)) {\n return new GraphQLNonNull(replaceType(type.ofType));\n }\n\n return replaceNamedType(type);\n }", "function GraphQLSchema(config) {\n var _config$directives; // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n\n\n this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors.\n\n (0, _isObjectLike.default)(config) || (0, _devAssert.default)(0, 'Must provide configuration object.');\n !config.types || Array.isArray(config.types) || (0, _devAssert.default)(0, \"\\\"types\\\" must be Array if provided but got: \".concat((0, _inspect.default)(config.types), \".\"));\n !config.directives || Array.isArray(config.directives) || (0, _devAssert.default)(0, '\"directives\" must be Array if provided but got: ' + \"\".concat((0, _inspect.default)(config.directives), \".\"));\n this.description = config.description;\n this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives; // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n\n var allReferencedTypes = new Set(config.types);\n\n if (config.types != null) {\n for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) {\n var type = _config$types2[_i2]; // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (var _i4 = 0, _this$_directives2 = this._directives; _i4 < _this$_directives2.length; _i4++) {\n var directive = _this$_directives2[_i4]; // Directives are not validated until validateSchema() is called.\n\n if ((0, _directives.isDirective)(directive)) {\n for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) {\n var arg = _directive$args2[_i6];\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n\n collectReferencedTypes(_introspection.__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema.\n\n this._typeMap = Object.create(null);\n this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementationsMap = Object.create(null);\n\n for (var _i8 = 0, _arrayFrom2 = (0, _arrayFrom.default)(allReferencedTypes); _i8 < _arrayFrom2.length; _i8++) {\n var namedType = _arrayFrom2[_i8];\n\n if (namedType == null) {\n continue;\n }\n\n var typeName = namedType.name;\n typeName || (0, _devAssert.default)(0, 'One of the provided types for building the Schema is missing a name.');\n\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\"Schema must contain uniquely named types but contains multiple types named \\\"\".concat(typeName, \"\\\".\"));\n }\n\n this._typeMap[typeName] = namedType;\n\n if ((0, _definition.isInterfaceType)(namedType)) {\n // Store implementations by interface.\n for (var _i10 = 0, _namedType$getInterfa2 = namedType.getInterfaces(); _i10 < _namedType$getInterfa2.length; _i10++) {\n var iface = _namedType$getInterfa2[_i10];\n\n if ((0, _definition.isInterfaceType)(iface)) {\n var implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if ((0, _definition.isObjectType)(namedType)) {\n // Store implementations by objects.\n for (var _i12 = 0, _namedType$getInterfa4 = namedType.getInterfaces(); _i12 < _namedType$getInterfa4.length; _i12++) {\n var _iface = _namedType$getInterfa4[_i12];\n\n if ((0, _definition.isInterfaceType)(_iface)) {\n var _implementations = this._implementationsMap[_iface.name];\n\n if (_implementations === undefined) {\n _implementations = this._implementationsMap[_iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n _implementations.objects.push(namedType);\n }\n }\n }\n }\n }", "function relaxType(type) {\n switch (type.kind) {\n case SimpleTypeKind.INTERSECTION:\n case SimpleTypeKind.UNION:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ENUM:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ARRAY:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.PROMISE:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.OBJECT:\n return {\n name: type.name,\n kind: SimpleTypeKind.OBJECT\n };\n case SimpleTypeKind.INTERFACE:\n case SimpleTypeKind.FUNCTION:\n case SimpleTypeKind.CLASS:\n return {\n name: type.name,\n kind: SimpleTypeKind.ANY\n };\n case SimpleTypeKind.NUMBER_LITERAL:\n return { kind: SimpleTypeKind.NUMBER };\n case SimpleTypeKind.STRING_LITERAL:\n return { kind: SimpleTypeKind.STRING };\n case SimpleTypeKind.BOOLEAN_LITERAL:\n return { kind: SimpleTypeKind.BOOLEAN };\n case SimpleTypeKind.BIG_INT_LITERAL:\n return { kind: SimpleTypeKind.BIG_INT };\n case SimpleTypeKind.ENUM_MEMBER:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.ALIAS:\n return __assign(__assign({}, type), { target: relaxType(type.target) });\n case SimpleTypeKind.NULL:\n case SimpleTypeKind.UNDEFINED:\n return { kind: SimpleTypeKind.ANY };\n default:\n return type;\n }\n}", "function GraphQLSchema(config) {\n var _config$directives;\n\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors.\n\n (0, _isObjectLike.default)(config) || (0, _devAssert.default)(0, 'Must provide configuration object.');\n !config.types || Array.isArray(config.types) || (0, _devAssert.default)(0, \"\\\"types\\\" must be Array if provided but got: \".concat((0, _inspect.default)(config.types), \".\"));\n !config.directives || Array.isArray(config.directives) || (0, _devAssert.default)(0, '\"directives\" must be Array if provided but got: ' + \"\".concat((0, _inspect.default)(config.directives), \".\"));\n this.description = config.description;\n this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives; // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n\n var allReferencedTypes = new Set(config.types);\n\n if (config.types != null) {\n for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) {\n var type = _config$types2[_i2];\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (var _i4 = 0, _this$_directives2 = this._directives; _i4 < _this$_directives2.length; _i4++) {\n var directive = _this$_directives2[_i4];\n\n // Directives are not validated until validateSchema() is called.\n if ((0, _directives.isDirective)(directive)) {\n for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) {\n var arg = _directive$args2[_i6];\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n\n collectReferencedTypes(_introspection.__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema.\n\n this._typeMap = Object.create(null);\n this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementationsMap = Object.create(null);\n\n for (var _i8 = 0, _arrayFrom2 = (0, _arrayFrom3.default)(allReferencedTypes); _i8 < _arrayFrom2.length; _i8++) {\n var namedType = _arrayFrom2[_i8];\n\n if (namedType == null) {\n continue;\n }\n\n var typeName = namedType.name;\n typeName || (0, _devAssert.default)(0, 'One of the provided types for building the Schema is missing a name.');\n\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\"Schema must contain uniquely named types but contains multiple types named \\\"\".concat(typeName, \"\\\".\"));\n }\n\n this._typeMap[typeName] = namedType;\n\n if ((0, _definition.isInterfaceType)(namedType)) {\n // Store implementations by interface.\n for (var _i10 = 0, _namedType$getInterfa2 = namedType.getInterfaces(); _i10 < _namedType$getInterfa2.length; _i10++) {\n var iface = _namedType$getInterfa2[_i10];\n\n if ((0, _definition.isInterfaceType)(iface)) {\n var implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if ((0, _definition.isObjectType)(namedType)) {\n // Store implementations by objects.\n for (var _i12 = 0, _namedType$getInterfa4 = namedType.getInterfaces(); _i12 < _namedType$getInterfa4.length; _i12++) {\n var _iface = _namedType$getInterfa4[_i12];\n\n if ((0, _definition.isInterfaceType)(_iface)) {\n var _implementations = this._implementationsMap[_iface.name];\n\n if (_implementations === undefined) {\n _implementations = this._implementationsMap[_iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n _implementations.objects.push(namedType);\n }\n }\n }\n }\n }", "function referencify(desc) {\n\t\tvar fields = desc['fields'];\n\t\tfor (var i = 0; i < fields.length; i++) {\n\t\t\tvar field = fields[i];\n\t\t\tvar type = field['type'];\n\t\t\tif (type['name'] == 'owner') {\n\t\t\t\ttype['name'] = 'reference';\n\t\t\t\ttype['refersTo'] = ['Users'];\n\t\t\t}\n\t\t}\n\t\treturn desc;\n\t}", "function isReferenceType(type) {\n return ['Reference', 'CodeableReference'].includes(type);\n}", "function doTypesConflict(type1, type2) {\n if (type1 instanceof _definition.GraphQLList) {\n return type2 instanceof _definition.GraphQLList ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n if (type2 instanceof _definition.GraphQLList) {\n return type1 instanceof _definition.GraphQLList ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n if (type1 instanceof _definition.GraphQLNonNull) {\n return type2 instanceof _definition.GraphQLNonNull ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n if (type2 instanceof _definition.GraphQLNonNull) {\n return type1 instanceof _definition.GraphQLNonNull ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n if ((0, _definition.isLeafType)(type1) || (0, _definition.isLeafType)(type2)) {\n return type1 !== type2;\n }\n return false;\n}", "function doTypesConflict(type1, type2) {\n if (type1 instanceof _definition.GraphQLList) {\n return type2 instanceof _definition.GraphQLList ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n if (type2 instanceof _definition.GraphQLList) {\n return type1 instanceof _definition.GraphQLList ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n if (type1 instanceof _definition.GraphQLNonNull) {\n return type2 instanceof _definition.GraphQLNonNull ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n if (type2 instanceof _definition.GraphQLNonNull) {\n return type1 instanceof _definition.GraphQLNonNull ? doTypesConflict(type1.ofType, type2.ofType) : true;\n }\n if ((0, _definition.isLeafType)(type1) || (0, _definition.isLeafType)(type2)) {\n return type1 !== type2;\n }\n return false;\n}", "function Type$2(schema, opts) {\n var type;\n if (LOGICAL_TYPE) {\n type = LOGICAL_TYPE;\n UNDERLYING_TYPES.push([LOGICAL_TYPE, this]);\n LOGICAL_TYPE = null;\n } else {\n type = this;\n }\n\n // Lazily instantiated hash string. It will be generated the first time the\n // type's default fingerprint is computed (for example when using `equals`).\n // We use a mutable object since types are frozen after instantiation.\n this._hash = new Hash();\n this.name = undefined;\n this.aliases = undefined;\n this.doc = (schema && schema.doc) ? '' + schema.doc : undefined;\n\n if (schema) {\n // This is a complex (i.e. non-primitive) type.\n var name = schema.name;\n var namespace = schema.namespace === undefined ?\n opts && opts.namespace :\n schema.namespace;\n if (name !== undefined) {\n // This isn't an anonymous type.\n name = qualify(name, namespace);\n if (isPrimitive(name)) {\n // Avro doesn't allow redefining primitive names.\n throw new Error(f('cannot rename primitive type: %j', name));\n }\n var registry = opts && opts.registry;\n if (registry) {\n if (registry[name] !== undefined) {\n throw new Error(f('duplicate type name: %s', name));\n }\n registry[name] = type;\n }\n } else if (opts && opts.noAnonymousTypes) {\n throw new Error(f('missing name property in schema: %j', schema));\n }\n this.name = name;\n this.aliases = schema.aliases ?\n schema.aliases.map(function (s) { return qualify(s, namespace); }) :\n [];\n }\n}", "function extendType(type) {\n\t if (type instanceof _definition.GraphQLObjectType) {\n\t return extendObjectType(type);\n\t }\n\t if (type instanceof _definition.GraphQLInterfaceType) {\n\t return extendInterfaceType(type);\n\t }\n\t if (type instanceof _definition.GraphQLUnionType) {\n\t return extendUnionType(type);\n\t }\n\t return type;\n\t }", "function $Refs$1 () {\r\n /**\r\n * Indicates whether the schema contains any circular references.\r\n *\r\n * @type {boolean}\r\n */\r\n this.circular = false;\r\n\r\n /**\r\n * A map of paths/urls to {@link $Ref} objects\r\n *\r\n * @type {object}\r\n * @protected\r\n */\r\n this._$refs = {};\r\n\r\n /**\r\n * The {@link $Ref} object that is the root of the JSON schema.\r\n *\r\n * @type {$Ref}\r\n * @protected\r\n */\r\n this._root$Ref = null;\r\n}", "function getNamedType(type) {\n\t var unmodifiedType = type;\n\t while (unmodifiedType instanceof GraphQLList || unmodifiedType instanceof GraphQLNonNull) {\n\t unmodifiedType = unmodifiedType.ofType;\n\t }\n\t return unmodifiedType;\n\t}", "static intermediate(options) {\n if (!(options === null || options === void 0 ? void 0 : options.intermediateType)) {\n throw new Error('GraphQL Type of interface must be configured with corresponding Intermediate Type');\n }\n return new GraphqlType(schema_base_1.Type.INTERMEDIATE, options);\n }", "function Type(schema, opts) {\n var type;\n if (LOGICAL_TYPE) {\n type = LOGICAL_TYPE;\n UNDERLYING_TYPES.push([LOGICAL_TYPE, this]);\n LOGICAL_TYPE = null;\n } else {\n type = this;\n }\n\n // Lazily instantiated hash string. It will be generated the first time the\n // type's default fingerprint is computed (for example when using `equals`).\n // We use a mutable object since types are frozen after instantiation.\n this._hash = new Hash();\n this.name = undefined;\n this.aliases = undefined;\n this.doc = (schema && schema.doc) ? '' + schema.doc : undefined;\n\n if (schema) {\n // This is a complex (i.e. non-primitive) type.\n var name = schema.name;\n var namespace = schema.namespace === undefined ?\n opts && opts.namespace :\n schema.namespace;\n if (name !== undefined) {\n // This isn't an anonymous type.\n name = maybeQualify(name, namespace);\n if (isPrimitive(name)) {\n // Avro doesn't allow redefining primitive names.\n throw new Error(f('cannot rename primitive type: %j', name));\n }\n var registry = opts && opts.registry;\n if (registry) {\n if (registry[name] !== undefined) {\n throw new Error(f('duplicate type name: %s', name));\n }\n registry[name] = type;\n }\n } else if (opts && opts.noAnonymousTypes) {\n throw new Error(f('missing name property in schema: %j', schema));\n }\n this.name = name;\n this.aliases = schema.aliases ?\n schema.aliases.map(function (s) { return maybeQualify(s, namespace); }) :\n [];\n }\n}", "getReference() {\n mustInherit();\n }", "function $Refs () {\r\n /**\r\n * Indicates whether the schema contains any circular references.\r\n *\r\n * @type {boolean}\r\n */\r\n this.circular = false;\r\n\r\n /**\r\n * A map of paths/urls to {@link $Ref} objects\r\n *\r\n * @type {object}\r\n * @protected\r\n */\r\n this._$refs = {};\r\n\r\n /**\r\n * The {@link $Ref} object that is the root of the JSON schema.\r\n *\r\n * @type {$Ref}\r\n * @protected\r\n */\r\n this._root$Ref = null;\r\n}", "function UnderreactType() {}", "function getType(typeRef) {\n if (typeRef.kind === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_9__[\"TypeKind\"].LIST) {\n var itemRef = typeRef.ofType;\n\n if (!itemRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_10__[\"GraphQLList\"](getType(itemRef));\n }\n\n if (typeRef.kind === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_9__[\"TypeKind\"].NON_NULL) {\n var nullableRef = typeRef.ofType;\n\n if (!nullableRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n var nullableType = getType(nullableRef);\n return new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_10__[\"GraphQLNonNull\"](Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_10__[\"assertNullableType\"])(nullableType));\n }\n\n return getNamedType(typeRef);\n }", "function FieldsOnCorrectType(context) {\n return {\n Field: function Field(node) {\n var type = context.getParentType();\n if (type) {\n var fieldDef = context.getFieldDef();\n if (!fieldDef) {\n // This isn't valid. Let's find suggestions, if any.\n var suggestedTypes = [];\n if ((0, _typeDefinition.isAbstractType)(type)) {\n suggestedTypes = getSiblingInterfacesIncludingField(type, node.name.value);\n suggestedTypes = suggestedTypes.concat(getImplementationsIncludingField(type, node.name.value));\n }\n context.reportError(new _error.GraphQLError(undefinedFieldMessage(node.name.value, type.name, suggestedTypes), [node]));\n }\n }\n }\n };\n}", "function extendType(type) {\n\t if (type instanceof _typeDefinition.GraphQLObjectType) {\n\t return extendObjectType(type);\n\t }\n\t if (type instanceof _typeDefinition.GraphQLInterfaceType) {\n\t return extendInterfaceType(type);\n\t }\n\t if (type instanceof _typeDefinition.GraphQLUnionType) {\n\t return extendUnionType(type);\n\t }\n\t return type;\n\t }", "function FieldsOnCorrectType(context) {\n\t return {\n\t Field: function Field(node) {\n\t var type = context.getParentType();\n\t if (type) {\n\t var fieldDef = context.getFieldDef();\n\t if (!fieldDef) {\n\t // This isn't valid. Let's find suggestions, if any.\n\t var suggestedTypes = [];\n\t if ((0, _typeDefinition.isAbstractType)(type)) {\n\t suggestedTypes = getSiblingInterfacesIncludingField(type, node.name.value);\n\t suggestedTypes = suggestedTypes.concat(getImplementationsIncludingField(type, node.name.value));\n\t }\n\t context.reportError(new _error.GraphQLError(undefinedFieldMessage(node.name.value, type.name, suggestedTypes), [node]));\n\t }\n\t }\n\t }\n\t };\n\t}", "function getType(typeRef) {\n\t if (typeRef.kind === _typeIntrospection.TypeKind.LIST) {\n\t var itemRef = typeRef.ofType;\n\t if (!itemRef) {\n\t throw new Error('Decorated type deeper than introspection query.');\n\t }\n\t return new _typeDefinition.GraphQLList(getType(itemRef));\n\t }\n\t if (typeRef.kind === _typeIntrospection.TypeKind.NON_NULL) {\n\t var nullableRef = typeRef.ofType;\n\t if (!nullableRef) {\n\t throw new Error('Decorated type deeper than introspection query.');\n\t }\n\t var nullableType = getType(nullableRef);\n\t (0, _jsutilsInvariant2['default'])(!(nullableType instanceof _typeDefinition.GraphQLNonNull), 'No nesting nonnull.');\n\t return new _typeDefinition.GraphQLNonNull(nullableType);\n\t }\n\t return getNamedType(typeRef.name);\n\t }", "_collectInlineFragments(parentType, nodes, types) {\n if (graphql_1.isListType(parentType) || graphql_1.isNonNullType(parentType)) {\n return this._collectInlineFragments(parentType.ofType, nodes, types);\n }\n else if (graphql_1.isObjectType(parentType)) {\n for (const node of nodes) {\n const onType = node.typeCondition.name.value;\n const typeOnSchema = this._schema.getType(onType);\n if (graphql_1.isObjectType(typeOnSchema)) {\n let typeSelections = types.get(typeOnSchema.name);\n if (!typeSelections) {\n typeSelections = [];\n types.set(typeOnSchema.name, typeSelections);\n }\n typeSelections.push(...node.selectionSet.selections.filter(selection => selection.kind !== 'InlineFragment'));\n this._collectInlineFragments(typeOnSchema, node.selectionSet.selections.filter(selection => selection.kind === 'InlineFragment'), types);\n }\n else if (graphql_1.isInterfaceType(typeOnSchema) && parentType.isTypeOf(typeOnSchema, null, null)) {\n let typeSelections = types.get(parentType.name);\n if (!typeSelections) {\n typeSelections = [];\n types.set(parentType.name, typeSelections);\n }\n typeSelections.push(...node.selectionSet.selections.filter(selection => selection.kind !== 'InlineFragment'));\n this._collectInlineFragments(typeOnSchema, node.selectionSet.selections.filter(selection => selection.kind === 'InlineFragment'), types);\n }\n }\n }\n else if (graphql_1.isInterfaceType(parentType)) {\n const possibleTypes = this._getPossibleTypes(parentType);\n for (const node of nodes) {\n const onType = node.typeCondition.name.value;\n const schemaType = this._schema.getType(onType);\n if (!schemaType) {\n throw new Error(`Inline fragment refernces a GraphQL type \"${onType}\" that does not exists in your schema!`);\n }\n if (graphql_1.isObjectType(schemaType) && possibleTypes.find(possibleType => possibleType.name === schemaType.name)) {\n let typeSelections = types.get(onType);\n if (!typeSelections) {\n typeSelections = [];\n types.set(schemaType.name, typeSelections);\n }\n typeSelections.push(...node.selectionSet.selections.filter(selection => selection.kind !== 'InlineFragment'));\n this._collectInlineFragments(schemaType, node.selectionSet.selections.filter(selection => selection.kind === 'InlineFragment'), types);\n }\n else if (graphql_1.isInterfaceType(schemaType) && schemaType.name === parentType.name) {\n for (const possibleType of possibleTypes) {\n let typeSelections = types.get(possibleType.name);\n if (!typeSelections) {\n typeSelections = [];\n types.set(possibleType.name, typeSelections);\n }\n typeSelections.push(...node.selectionSet.selections.filter(selection => selection.kind !== 'InlineFragment'));\n this._collectInlineFragments(schemaType, node.selectionSet.selections.filter(selection => selection.kind === 'InlineFragment'), types);\n }\n }\n }\n }\n else if (graphql_1.isUnionType(parentType)) {\n const possibleTypes = parentType.getTypes();\n for (const node of nodes) {\n const onType = node.typeCondition.name.value;\n const schemaType = this._schema.getType(onType);\n if (!schemaType) {\n throw new Error(`Inline fragment refernces a GraphQL type \"${onType}\" that does not exists in your schema!`);\n }\n if (graphql_1.isObjectType(schemaType) && possibleTypes.find(possibleType => possibleType.name === schemaType.name)) {\n let typeSelections = types.get(onType);\n if (!typeSelections) {\n typeSelections = [];\n types.set(onType, typeSelections);\n }\n typeSelections.push(...node.selectionSet.selections.filter(selection => selection.kind !== 'InlineFragment'));\n this._collectInlineFragments(schemaType, node.selectionSet.selections.filter(selection => selection.kind === 'InlineFragment'), types);\n }\n else if (graphql_1.isInterfaceType(schemaType)) {\n const possibleInterfaceTypes = this._getPossibleTypes(schemaType);\n for (const possibleType of possibleTypes) {\n if (possibleInterfaceTypes.find(possibleInterfaceType => possibleInterfaceType.name === possibleType.name)) {\n let typeSelections = types.get(possibleType.name);\n if (!typeSelections) {\n typeSelections = [];\n types.set(possibleType.name, typeSelections);\n }\n typeSelections.push(...node.selectionSet.selections.filter(selection => selection.kind !== 'InlineFragment'));\n this._collectInlineFragments(schemaType, node.selectionSet.selections.filter(selection => selection.kind === 'InlineFragment'), types);\n }\n }\n }\n }\n }\n }", "function getTypeReference(typeInfo, type) {\n return {\n kind: 'Type',\n schema: typeInfo.schema,\n type: type || typeInfo.type\n };\n}", "function extendType(type) {\n if (type instanceof _definition.GraphQLObjectType) {\n return extendObjectType(type);\n }\n if (type instanceof _definition.GraphQLInterfaceType) {\n return extendInterfaceType(type);\n }\n if (type instanceof _definition.GraphQLUnionType) {\n return extendUnionType(type);\n }\n return type;\n }", "function extendType(type) {\n if (type instanceof _definition.GraphQLObjectType) {\n return extendObjectType(type);\n }\n if (type instanceof _definition.GraphQLInterfaceType) {\n return extendInterfaceType(type);\n }\n if (type instanceof _definition.GraphQLUnionType) {\n return extendUnionType(type);\n }\n return type;\n }", "function extendType(type) {\n if (type instanceof _definition.GraphQLObjectType) {\n return extendObjectType(type);\n }\n if (type instanceof _definition.GraphQLInterfaceType) {\n return extendInterfaceType(type);\n }\n if (type instanceof _definition.GraphQLUnionType) {\n return extendUnionType(type);\n }\n return type;\n }", "function getType(typeRef) {\n if (typeRef.kind === _typeIntrospection.TypeKind.LIST) {\n var itemRef = typeRef.ofType;\n if (!itemRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n return new _typeDefinition.GraphQLList(getType(itemRef));\n }\n if (typeRef.kind === _typeIntrospection.TypeKind.NON_NULL) {\n var nullableRef = typeRef.ofType;\n if (!nullableRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n var nullableType = getType(nullableRef);\n (0, _jsutilsInvariant2['default'])(!(nullableType instanceof _typeDefinition.GraphQLNonNull), 'No nesting nonnull.');\n return new _typeDefinition.GraphQLNonNull(nullableType);\n }\n return getNamedType(typeRef.name);\n }", "function GraphQLSchema(config) {\n var _config$directives;\n\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors.\n\n Object(_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(config) || Object(_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(0, 'Must provide configuration object.');\n !config.types || Array.isArray(config.types) || Object(_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(0, \"\\\"types\\\" must be Array if provided but got: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.types), \".\"));\n !config.directives || Array.isArray(config.directives) || Object(_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(0, '\"directives\" must be Array if provided but got: ' + \"\".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.directives), \".\"));\n this.description = config.description;\n this.extensions = config.extensions && Object(_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives_mjs__WEBPACK_IMPORTED_MODULE_10__[\"specifiedDirectives\"]; // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n\n var allReferencedTypes = new Set(config.types);\n\n if (config.types != null) {\n for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) {\n var type = _config$types2[_i2];\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (var _i4 = 0, _this$_directives2 = this._directives; _i4 < _this$_directives2.length; _i4++) {\n var directive = _this$_directives2[_i4];\n\n // Directives are not validated until validateSchema() is called.\n if (Object(_directives_mjs__WEBPACK_IMPORTED_MODULE_10__[\"isDirective\"])(directive)) {\n for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) {\n var arg = _directive$args2[_i6];\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n\n collectReferencedTypes(_introspection_mjs__WEBPACK_IMPORTED_MODULE_9__[\"__Schema\"], allReferencedTypes); // Storing the resulting map for reference by the schema.\n\n this._typeMap = Object.create(null);\n this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementationsMap = Object.create(null);\n\n for (var _i8 = 0, _arrayFrom2 = Object(_polyfills_arrayFrom_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(allReferencedTypes); _i8 < _arrayFrom2.length; _i8++) {\n var namedType = _arrayFrom2[_i8];\n\n if (namedType == null) {\n continue;\n }\n\n var typeName = namedType.name;\n typeName || Object(_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(0, 'One of the provided types for building the Schema is missing a name.');\n\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\"Schema must contain uniquely named types but contains multiple types named \\\"\".concat(typeName, \"\\\".\"));\n }\n\n this._typeMap[typeName] = namedType;\n\n if (Object(_definition_mjs__WEBPACK_IMPORTED_MODULE_11__[\"isInterfaceType\"])(namedType)) {\n // Store implementations by interface.\n for (var _i10 = 0, _namedType$getInterfa2 = namedType.getInterfaces(); _i10 < _namedType$getInterfa2.length; _i10++) {\n var iface = _namedType$getInterfa2[_i10];\n\n if (Object(_definition_mjs__WEBPACK_IMPORTED_MODULE_11__[\"isInterfaceType\"])(iface)) {\n var implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if (Object(_definition_mjs__WEBPACK_IMPORTED_MODULE_11__[\"isObjectType\"])(namedType)) {\n // Store implementations by objects.\n for (var _i12 = 0, _namedType$getInterfa4 = namedType.getInterfaces(); _i12 < _namedType$getInterfa4.length; _i12++) {\n var _iface = _namedType$getInterfa4[_i12];\n\n if (Object(_definition_mjs__WEBPACK_IMPORTED_MODULE_11__[\"isInterfaceType\"])(_iface)) {\n var _implementations = this._implementationsMap[_iface.name];\n\n if (_implementations === undefined) {\n _implementations = this._implementationsMap[_iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n _implementations.objects.push(namedType);\n }\n }\n }\n }\n }", "function GraphQLSchema(config) {\n var _config$directives;\n\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors.\n\n Object(_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(config) || Object(_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(0, 'Must provide configuration object.');\n !config.types || Array.isArray(config.types) || Object(_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(0, \"\\\"types\\\" must be Array if provided but got: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.types), \".\"));\n !config.directives || Array.isArray(config.directives) || Object(_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(0, '\"directives\" must be Array if provided but got: ' + \"\".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.directives), \".\"));\n this.description = config.description;\n this.extensions = config.extensions && Object(_jsutils_toObjMap_mjs__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives_mjs__WEBPACK_IMPORTED_MODULE_10__[\"specifiedDirectives\"]; // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n\n var allReferencedTypes = new Set(config.types);\n\n if (config.types != null) {\n for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) {\n var type = _config$types2[_i2];\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (var _i4 = 0, _this$_directives2 = this._directives; _i4 < _this$_directives2.length; _i4++) {\n var directive = _this$_directives2[_i4];\n\n // Directives are not validated until validateSchema() is called.\n if (Object(_directives_mjs__WEBPACK_IMPORTED_MODULE_10__[\"isDirective\"])(directive)) {\n for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) {\n var arg = _directive$args2[_i6];\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n\n collectReferencedTypes(_introspection_mjs__WEBPACK_IMPORTED_MODULE_9__[\"__Schema\"], allReferencedTypes); // Storing the resulting map for reference by the schema.\n\n this._typeMap = Object.create(null);\n this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementationsMap = Object.create(null);\n\n for (var _i8 = 0, _arrayFrom2 = Object(_polyfills_arrayFrom_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(allReferencedTypes); _i8 < _arrayFrom2.length; _i8++) {\n var namedType = _arrayFrom2[_i8];\n\n if (namedType == null) {\n continue;\n }\n\n var typeName = namedType.name;\n typeName || Object(_jsutils_devAssert_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(0, 'One of the provided types for building the Schema is missing a name.');\n\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\"Schema must contain uniquely named types but contains multiple types named \\\"\".concat(typeName, \"\\\".\"));\n }\n\n this._typeMap[typeName] = namedType;\n\n if (Object(_definition_mjs__WEBPACK_IMPORTED_MODULE_11__[\"isInterfaceType\"])(namedType)) {\n // Store implementations by interface.\n for (var _i10 = 0, _namedType$getInterfa2 = namedType.getInterfaces(); _i10 < _namedType$getInterfa2.length; _i10++) {\n var iface = _namedType$getInterfa2[_i10];\n\n if (Object(_definition_mjs__WEBPACK_IMPORTED_MODULE_11__[\"isInterfaceType\"])(iface)) {\n var implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if (Object(_definition_mjs__WEBPACK_IMPORTED_MODULE_11__[\"isObjectType\"])(namedType)) {\n // Store implementations by objects.\n for (var _i12 = 0, _namedType$getInterfa4 = namedType.getInterfaces(); _i12 < _namedType$getInterfa4.length; _i12++) {\n var _iface = _namedType$getInterfa4[_i12];\n\n if (Object(_definition_mjs__WEBPACK_IMPORTED_MODULE_11__[\"isInterfaceType\"])(_iface)) {\n var _implementations = this._implementationsMap[_iface.name];\n\n if (_implementations === undefined) {\n _implementations = this._implementationsMap[_iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n _implementations.objects.push(namedType);\n }\n }\n }\n }\n }", "function $Refs () {\n /**\n * Indicates whether the schema contains any circular references.\n *\n * @type {boolean}\n */\n this.circular = false;\n\n /**\n * A map of paths/urls to {@link $Ref} objects\n *\n * @type {object}\n * @protected\n */\n this._$refs = {};\n\n /**\n * The {@link $Ref} object that is the root of the JSON schema.\n *\n * @type {$Ref}\n * @protected\n */\n this._root$Ref = null;\n}", "function typeFromAST(schema, typeNode) {\n /* eslint-enable no-redeclare */\n var innerType;\n\n if (typeNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_2__[\"Kind\"].LIST_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__[\"GraphQLList\"](innerType);\n }\n\n if (typeNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_2__[\"Kind\"].NON_NULL_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new _type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__[\"GraphQLNonNull\"](innerType);\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (typeNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_2__[\"Kind\"].NAMED_TYPE) {\n return schema.getType(typeNode.name.value);\n } // istanbul ignore next (Not reachable. All possible type nodes have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(0, 'Unexpected type node: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(typeNode));\n}", "function Type() {\n this.hooks = [];\n }", "function FragmentsOnCompositeTypes(context) {\n return {\n InlineFragment: function InlineFragment(node) {\n var typeCondition = node.typeCondition;\n\n if (typeCondition) {\n var type = Object(_utilities_typeFromAST__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), typeCondition);\n\n if (type && !Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"isCompositeType\"])(type)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](inlineFragmentOnNonCompositeErrorMessage(Object(_language_printer__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(typeCondition)), typeCondition));\n }\n }\n },\n FragmentDefinition: function FragmentDefinition(node) {\n var type = Object(_utilities_typeFromAST__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.typeCondition);\n\n if (type && !Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"isCompositeType\"])(type)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](fragmentOnNonCompositeErrorMessage(node.name.value, Object(_language_printer__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.typeCondition)), node.typeCondition));\n }\n }\n };\n}", "_changeType(to) {\n removeType(this, this.type);\n addType(this, to);\n }", "function getType(typeRef) {\n if (typeRef.kind === _introspection.TypeKind.LIST) {\n var itemRef = typeRef.ofType;\n if (!itemRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n return new _definition.GraphQLList(getType(itemRef));\n }\n if (typeRef.kind === _introspection.TypeKind.NON_NULL) {\n var nullableRef = typeRef.ofType;\n if (!nullableRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n var nullableType = getType(nullableRef);\n !!(nullableType instanceof _definition.GraphQLNonNull) ? (0, _invariant2.default)(0, 'No nesting nonnull.') : void 0;\n return new _definition.GraphQLNonNull(nullableType);\n }\n return getNamedType(typeRef.name);\n }", "function getType(typeRef) {\n if (typeRef.kind === _introspection.TypeKind.LIST) {\n var itemRef = typeRef.ofType;\n if (!itemRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n return new _definition.GraphQLList(getType(itemRef));\n }\n if (typeRef.kind === _introspection.TypeKind.NON_NULL) {\n var nullableRef = typeRef.ofType;\n if (!nullableRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n var nullableType = getType(nullableRef);\n !!(nullableType instanceof _definition.GraphQLNonNull) ? (0, _invariant2.default)(0, 'No nesting nonnull.') : void 0;\n return new _definition.GraphQLNonNull(nullableType);\n }\n return getNamedType(typeRef.name);\n }", "define () {\n return {\n type: '@node',\n id: 'string'\n }\n }", "function getType(typeRef) {\n\t if (typeRef.kind === _introspection.TypeKind.LIST) {\n\t var itemRef = typeRef.ofType;\n\t if (!itemRef) {\n\t throw new Error('Decorated type deeper than introspection query.');\n\t }\n\t return new _definition.GraphQLList(getType(itemRef));\n\t }\n\t if (typeRef.kind === _introspection.TypeKind.NON_NULL) {\n\t var nullableRef = typeRef.ofType;\n\t if (!nullableRef) {\n\t throw new Error('Decorated type deeper than introspection query.');\n\t }\n\t var nullableType = getType(nullableRef);\n\t (0, _invariant2.default)(!(nullableType instanceof _definition.GraphQLNonNull), 'No nesting nonnull.');\n\t return new _definition.GraphQLNonNull(nullableType);\n\t }\n\t return getNamedType(typeRef.name);\n\t }", "toString() {\n var _d;\n // If an Object Type, we use the name of the Object Type\n let type = this.intermediateType ? (_d = this.intermediateType) === null || _d === void 0 ? void 0 : _d.name : this.type;\n // If configured as required, the GraphQL Type becomes required\n type = this.isRequired ? `${type}!` : type;\n // If configured with isXxxList, the GraphQL Type becomes a list\n type = this.isList || this.isRequiredList ? `[${type}]` : type;\n // If configured with isRequiredList, the list becomes required\n type = this.isRequiredList ? `${type}!` : type;\n return type;\n }", "convertRefToModel(object, isSchema, isProperty) {\n\t\tif (jsonHelper.isJson(object)) {\n\t\t\treturn object;\n\t\t}\n\t\t// if the object is a string, that means it's a direct ref/type\n\t\tif (typeof object === 'string') {\n\t\t\tif (this.isValidRefValue(object)) {\n\t\t\t\treturn {\n\t\t\t\t\t$ref: '#/definitions/' + object\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn object;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdelete object.typePropertyKind;\n\t\tfor (const id in object) {\n\t\t\tif (!object.hasOwnProperty(id)) continue;\n\n\t\t\tlet val = object[id];\n\t\t\tif (!val) continue;\n\t\t\tif (id === 'type') {\n\t\t\t\tif (_.isArray(object[id]) && object[id].length == 1) object[id] = object[id][0];\n\t\t\t\tval = object[id];\n\t\t\t\tif (val !== 'object' && typeof val === 'string' && !xmlHelper.isXml(val)) {\n\t\t\t\t\tobject[id] = RAMLImporter._modifyUnionType(val);\n\t\t\t\t\tval = object[id];\n\t\t\t\t}\n\t\t\t\tif (jsonHelper.isJson(val)) {\n\t\t\t\t\tobject = val;\n\t\t\t\t\tdelete object[id];\n\t\t\t\t} else if (xmlHelper.isXml(val)) {\n\t\t\t\t\tobject.type = 'object';\n\t\t\t\t} else if (this.isValidRefValues(val)) {\n\t\t\t\t\tobject.ref = val;\n\t\t\t\t\tdelete object[id];\n\t\t\t\t}\n\t\t\t\tif (!isProperty) {\n\t\t\t\t\tRAMLImporter._mapTypesFormats(object, isSchema);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (id === 'example' || id === 'examples') {\n\t\t\t\tobject = RAMLImporter._mapExamples(object);\n\t\t\t} else if (typeof val === 'object') {\n\t\t\t\tif (id === 'items' && !val.hasOwnProperty('type') && !val.hasOwnProperty('properties')) {\n\t\t\t\t\tif (!_.isArray(val)) val.type = 'string';\n\t\t\t\t\telse {\n\t\t\t\t\t\tobject.items = {\n\t\t\t\t\t\t\tref: val[0]\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn object;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (id == 'fixedFacets') { //delete garbage\n\t\t\t\t\tdelete object[id];\n\t\t\t\t} else {\n\t\t\t\t\tif (id == 'xml') { //no process xml object\n\t\t\t\t\t\tobject[id] = val;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobject[id] = this.convertRefToModel(val, isSchema, id === 'properties' && !isProperty);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (id == 'name') { //delete garbage\n\t\t\t\tdelete object[id];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn object;\n\t}", "function getType(typeRef) {\n if (typeRef.kind === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_8__[\"TypeKind\"].LIST) {\n var itemRef = typeRef.ofType;\n\n if (!itemRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n return Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_10__[\"GraphQLList\"])(getType(itemRef));\n }\n\n if (typeRef.kind === _type_introspection_mjs__WEBPACK_IMPORTED_MODULE_8__[\"TypeKind\"].NON_NULL) {\n var nullableRef = typeRef.ofType;\n\n if (!nullableRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n var nullableType = getType(nullableRef);\n return Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_10__[\"GraphQLNonNull\"])(Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_10__[\"assertNullableType\"])(nullableType));\n }\n\n return getNamedType(typeRef);\n }", "static _processType(typeItem) {\n switch (typeItem.kind) {\n case 'variable-type':\n return Type.newVariableReference(typeItem.name);\n case 'reference-type':\n return Type.newManifestReference(typeItem.name);\n case 'list-type':\n return Type.newSetView(Manifest._processType(typeItem.type));\n default:\n throw `Unexpected type item of kind '${typeItem.kind}'`;\n }\n }", "async function handleCircularRefs(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, options) {\n await dereference(refParser, parsedJSON, initialFormat, asyncapiYAMLorJSON, { ...options, dereference: { circular: true } });\n //mark entire document as containing circular references\n parsedJSON[String(xParserCircle)] = true;\n}", "function extendType(type) {\n if (type instanceof _typeDefinition.GraphQLObjectType) {\n return extendObjectType(type);\n }\n if (type instanceof _typeDefinition.GraphQLInterfaceType) {\n return extendInterfaceType(type);\n }\n if (type instanceof _typeDefinition.GraphQLUnionType) {\n return extendUnionType(type);\n }\n return type;\n }", "field(name, type, description, resolve) {\n if (typeof description === 'function') {\n /* eslint-disable no-param-reassign */\n resolve = description;\n description = null;\n /* eslint-enable no-param-reassign */\n }\n\n this._saveField();\n if(typeof name === 'string') {\n /// only allowed to update description and resolve\n if (this.fields[name]) {\n this._field = this.fields[name];\n if (description)\n this._field.description = description;\n if (resolve)\n this._field.resolve = resolve;\n if (type)\n this._field.type = type;\n if(name === 'id' && (description || resolve || type))\n console.log(this._field);\n }\n else {\n invariant(type,\n `field(...): '${name}' has an undefined or null type. If you ` +\n `are trying to refer to '${this.name}' then you should use a function`);\n\n this._field = {\n name,\n type,\n description,\n resolve,\n args: {}\n };\n }\n }\n else if(typeof name === 'object'){\n //console.log(name);\n invariant(name.name, 'Must supply a name for graph ql field')\n invariant(name.type, 'Must supply a graphql compatible type');\n if(this.fields[name.name]){\n this._field = this.fields[name.name];\n let {type, description, resolve, args} = name;\n this._field = {...name}\n }\n else\n this._field = {...name};\n }\n return this;\n }", "function FragmentsOnCompositeTypes(context) {\n return {\n InlineFragment: function InlineFragment(node) {\n var type = context.getType();\n if (node.typeCondition && type && !(0, _typeDefinition.isCompositeType)(type)) {\n context.reportError(new _error.GraphQLError(inlineFragmentOnNonCompositeErrorMessage((0, _languagePrinter.print)(node.typeCondition)), [node.typeCondition]));\n }\n },\n FragmentDefinition: function FragmentDefinition(node) {\n var type = context.getType();\n if (type && !(0, _typeDefinition.isCompositeType)(type)) {\n context.reportError(new _error.GraphQLError(fragmentOnNonCompositeErrorMessage(node.name.value, (0, _languagePrinter.print)(node.typeCondition)), [node.typeCondition]));\n }\n }\n };\n}", "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 }", "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 }", "function getSingularType(type) {\n\t var unmodifiedType = type;\n\t while (unmodifiedType instanceof GraphQLList) {\n\t unmodifiedType = unmodifiedType.ofType;\n\t }\n\t return unmodifiedType;\n\t}", "function resolveForwardRef(type) {\n if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__')) {\n return type();\n } else {\n return type;\n }\n }", "function FragmentsOnCompositeTypes(context) {\n return {\n InlineFragment: function InlineFragment(node) {\n if (node.typeCondition) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.typeCondition);\n if (type && !(0, _definition.isCompositeType)(type)) {\n context.reportError(new _error.GraphQLError(inlineFragmentOnNonCompositeErrorMessage((0, _printer.print)(node.typeCondition)), [node.typeCondition]));\n }\n }\n },\n FragmentDefinition: function FragmentDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.typeCondition);\n if (type && !(0, _definition.isCompositeType)(type)) {\n context.reportError(new _error.GraphQLError(fragmentOnNonCompositeErrorMessage(node.name.value, (0, _printer.print)(node.typeCondition)), [node.typeCondition]));\n }\n }\n };\n}", "function FragmentsOnCompositeTypes(context) {\n\t return {\n\t InlineFragment: function InlineFragment(node) {\n\t var type = context.getType();\n\t if (node.typeCondition && type && !(0, _typeDefinition.isCompositeType)(type)) {\n\t context.reportError(new _error.GraphQLError(inlineFragmentOnNonCompositeErrorMessage((0, _languagePrinter.print)(node.typeCondition)), [node.typeCondition]));\n\t }\n\t },\n\t FragmentDefinition: function FragmentDefinition(node) {\n\t var type = context.getType();\n\t if (type && !(0, _typeDefinition.isCompositeType)(type)) {\n\t context.reportError(new _error.GraphQLError(fragmentOnNonCompositeErrorMessage(node.name.value, (0, _languagePrinter.print)(node.typeCondition)), [node.typeCondition]));\n\t }\n\t }\n\t };\n\t}", "function GraphQLSchema(config) {\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n if (config && config.assumeValid) {\n this.__validationErrors = [];\n } else {\n this.__validationErrors = undefined; // Otherwise check for common mistakes during construction to produce\n // clear and early error messages.\n\n !(_typeof(config) === 'object') ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(0, 'Must provide configuration object.') : void 0;\n !(!config.types || Array.isArray(config.types)) ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(0, \"\\\"types\\\" must be Array if provided but got: \".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.types), \".\")) : void 0;\n !(!config.directives || Array.isArray(config.directives)) ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(0, '\"directives\" must be Array if provided but got: ' + \"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.directives), \".\")) : void 0;\n !(!config.allowedLegacyNames || Array.isArray(config.allowedLegacyNames)) ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(0, '\"allowedLegacyNames\" must be Array if provided but got: ' + \"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(config.allowedLegacyNames), \".\")) : void 0;\n }\n\n this.__allowedLegacyNames = config.allowedLegacyNames || [];\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives = config.directives || _directives__WEBPACK_IMPORTED_MODULE_3__[\"specifiedDirectives\"];\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes; // Build type map now to detect any errors within this schema.\n\n var initialTypes = [this.getQueryType(), this.getMutationType(), this.getSubscriptionType(), _introspection__WEBPACK_IMPORTED_MODULE_5__[\"__Schema\"]];\n var types = config.types;\n\n if (types) {\n initialTypes = initialTypes.concat(types);\n } // Keep track of all types referenced within the schema.\n\n\n var typeMap = Object.create(null); // First by deeply visiting all initial types.\n\n typeMap = initialTypes.reduce(typeMapReducer, typeMap); // Then by deeply visiting all directive types.\n\n typeMap = this._directives.reduce(typeMapDirectiveReducer, typeMap); // Storing the resulting map for reference by the schema.\n\n this._typeMap = typeMap;\n this._possibleTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementations = Object.create(null);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this._typeMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var type = _step.value;\n\n if (Object(_definition__WEBPACK_IMPORTED_MODULE_2__[\"isObjectType\"])(type)) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = type.getInterfaces()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var iface = _step2.value;\n\n if (Object(_definition__WEBPACK_IMPORTED_MODULE_2__[\"isInterfaceType\"])(iface)) {\n var impls = this._implementations[iface.name];\n\n if (impls) {\n impls.push(type);\n } else {\n this._implementations[iface.name] = [type];\n }\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n } else if (Object(_definition__WEBPACK_IMPORTED_MODULE_2__[\"isAbstractType\"])(type) && !this._implementations[type.name]) {\n this._implementations[type.name] = [];\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }", "function typeFromAST(schema, typeNode) {\n /* eslint-enable no-redeclare */\n var innerType;\n\n if (typeNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_2__[\"Kind\"].LIST_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__[\"GraphQLList\"])(innerType);\n }\n\n if (typeNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_2__[\"Kind\"].NON_NULL_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__[\"GraphQLNonNull\"])(innerType);\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (typeNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_2__[\"Kind\"].NAMED_TYPE) {\n return schema.getType(typeNode.name.value);\n } // istanbul ignore next (Not reachable. All possible type nodes have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(0, 'Unexpected type node: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(typeNode));\n}", "function typeFromASTImpl(schema, typeNode) {\n /* eslint-enable no-redeclare */\n var innerType = void 0;\n if (typeNode.kind === Kind.LIST_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new _definition.GraphQLList(innerType);\n }\n if (typeNode.kind === Kind.NON_NULL_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new _definition.GraphQLNonNull(innerType);\n }\n !(typeNode.kind === Kind.NAMED_TYPE) ? (0, _invariant2.default)(0, 'Must be a named type.') : void 0;\n return schema.getType(typeNode.name.value);\n}", "function typeFromASTImpl(schema, typeNode) {\n /* eslint-enable no-redeclare */\n var innerType = void 0;\n if (typeNode.kind === Kind.LIST_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new _definition.GraphQLList(innerType);\n }\n if (typeNode.kind === Kind.NON_NULL_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new _definition.GraphQLNonNull(innerType);\n }\n !(typeNode.kind === Kind.NAMED_TYPE) ? (0, _invariant2.default)(0, 'Must be a named type.') : void 0;\n return schema.getType(typeNode.name.value);\n}", "function getType(typeRef) {\n if (typeRef.kind === _type_introspection__WEBPACK_IMPORTED_MODULE_9__[\"TypeKind\"].LIST) {\n var itemRef = typeRef.ofType;\n\n if (!itemRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n return Object(_type_definition__WEBPACK_IMPORTED_MODULE_7__[\"GraphQLList\"])(getType(itemRef));\n }\n\n if (typeRef.kind === _type_introspection__WEBPACK_IMPORTED_MODULE_9__[\"TypeKind\"].NON_NULL) {\n var nullableRef = typeRef.ofType;\n\n if (!nullableRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n var nullableType = getType(nullableRef);\n return Object(_type_definition__WEBPACK_IMPORTED_MODULE_7__[\"GraphQLNonNull\"])(Object(_type_definition__WEBPACK_IMPORTED_MODULE_7__[\"assertNullableType\"])(nullableType));\n }\n\n if (!typeRef.name) {\n throw new Error('Unknown type reference: ' + Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(typeRef));\n }\n\n return getNamedType(typeRef.name);\n }", "function $Ref () {\n /**\n * The file path or URL of the referenced file.\n * This path is relative to the path of the main JSON schema file.\n *\n * This path does NOT contain document fragments (JSON pointers). It always references an ENTIRE file.\n * Use methods such as {@link $Ref#get}, {@link $Ref#resolve}, and {@link $Ref#exists} to get\n * specific JSON pointers within the file.\n *\n * @type {string}\n */\n this.path = undefined;\n\n /**\n * The resolved value of the JSON reference.\n * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).\n *\n * @type {?*}\n */\n this.value = undefined;\n\n /**\n * The {@link $Refs} object that contains this {@link $Ref} object.\n *\n * @type {$Refs}\n */\n this.$refs = undefined;\n\n /**\n * Indicates the type of {@link $Ref#path} (e.g. \"file\", \"http\", etc.)\n *\n * @type {?string}\n */\n this.pathType = undefined;\n\n /**\n * List of all errors. Undefined if no errors.\n *\n * @type {Array<JSONParserError | ResolverError | ParserError | MissingPointerError>}\n */\n this.errors = undefined;\n}", "parseObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }", "function $Ref () {\n /**\n * The file path or URL of the referenced file.\n * This path is relative to the path of the main JSON schema file.\n *\n * This path does NOT contain document fragments (JSON pointers). It always references an ENTIRE file.\n * Use methods such as {@link $Ref#get}, {@link $Ref#resolve}, and {@link $Ref#exists} to get\n * specific JSON pointers within the file.\n *\n * @type {string}\n */\n this.path = undefined;\n\n /**\n * The resolved value of the JSON reference.\n * Can be any JSON type, not just objects. Unknown file types are represented as Buffers (byte arrays).\n * @type {?*}\n */\n this.value = undefined;\n\n /**\n * The {@link $Refs} object that contains this {@link $Ref} object.\n * @type {$Refs}\n */\n this.$refs = undefined;\n\n /**\n * Indicates the type of {@link $Ref#path} (e.g. \"file\", \"http\", etc.)\n * @type {?string}\n */\n this.pathType = undefined;\n}", "function StructType() {}", "function resolveForwardRef(type) {\n if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__')) {\n return type();\n } else {\n return type;\n }\n }", "function astFromValue(value, type) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _definition.GraphQLNonNull) {\n var astValue = astFromValue(_value, type.ofType);\n if (astValue && astValue.kind === Kind.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (_value === null) {\n return { kind: Kind.NULL };\n }\n\n // undefined, NaN\n if ((0, _isInvalid2.default)(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var valuesNodes = [];\n (0, _iterall.forEach)(_value, function (item) {\n var itemNode = astFromValue(item, itemType);\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return { kind: Kind.LIST, values: valuesNodes };\n }\n return astFromValue(_value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (_value === null || (typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return null;\n }\n var fields = type.getFields();\n var fieldNodes = [];\n Object.keys(fields).forEach(function (fieldName) {\n var fieldType = fields[fieldName].type;\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: Kind.OBJECT, fields: fieldNodes };\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must provide Input Type, cannot use: ' + String(type)) : void 0;\n\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(_value);\n if ((0, _isNullish2.default)(serialized)) {\n return null;\n }\n\n // Others serialize based on their corresponding JavaScript scalar types.\n if (typeof serialized === 'boolean') {\n return { kind: Kind.BOOLEAN, value: serialized };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return (/^[0-9]+$/.test(stringNum) ? { kind: Kind.INT, value: stringNum } : { kind: Kind.FLOAT, value: stringNum }\n );\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (type instanceof _definition.GraphQLEnumType) {\n return { kind: Kind.ENUM, value: serialized };\n }\n\n // ID types can use Int literals.\n if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n return { kind: Kind.INT, value: serialized };\n }\n\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return {\n kind: Kind.STRING,\n value: JSON.stringify(serialized).slice(1, -1)\n };\n }\n\n throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n}", "function astFromValue(value, type) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _definition.GraphQLNonNull) {\n var astValue = astFromValue(_value, type.ofType);\n if (astValue && astValue.kind === Kind.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (_value === null) {\n return { kind: Kind.NULL };\n }\n\n // undefined, NaN\n if ((0, _isInvalid2.default)(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var valuesNodes = [];\n (0, _iterall.forEach)(_value, function (item) {\n var itemNode = astFromValue(item, itemType);\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return { kind: Kind.LIST, values: valuesNodes };\n }\n return astFromValue(_value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (_value === null || (typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return null;\n }\n var fields = type.getFields();\n var fieldNodes = [];\n Object.keys(fields).forEach(function (fieldName) {\n var fieldType = fields[fieldName].type;\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: Kind.OBJECT, fields: fieldNodes };\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must provide Input Type, cannot use: ' + String(type)) : void 0;\n\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(_value);\n if ((0, _isNullish2.default)(serialized)) {\n return null;\n }\n\n // Others serialize based on their corresponding JavaScript scalar types.\n if (typeof serialized === 'boolean') {\n return { kind: Kind.BOOLEAN, value: serialized };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return (/^[0-9]+$/.test(stringNum) ? { kind: Kind.INT, value: stringNum } : { kind: Kind.FLOAT, value: stringNum }\n );\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (type instanceof _definition.GraphQLEnumType) {\n return { kind: Kind.ENUM, value: serialized };\n }\n\n // ID types can use Int literals.\n if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n return { kind: Kind.INT, value: serialized };\n }\n\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return {\n kind: Kind.STRING,\n value: JSON.stringify(serialized).slice(1, -1)\n };\n }\n\n throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n}", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }", "function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }" ]
[ "0.61868656", "0.61661416", "0.614029", "0.58797175", "0.58797175", "0.5694197", "0.5694197", "0.56778127", "0.5660304", "0.5571152", "0.5571152", "0.5522279", "0.54350364", "0.5418595", "0.53999513", "0.53901434", "0.53627455", "0.5254645", "0.52300286", "0.52292705", "0.52292705", "0.5214833", "0.5209486", "0.516781", "0.51639056", "0.515529", "0.5148551", "0.5135141", "0.5128643", "0.5121222", "0.5119606", "0.5111278", "0.50848514", "0.5071844", "0.5070489", "0.50358266", "0.50356174", "0.50330293", "0.50330293", "0.50330293", "0.50330275", "0.5030688", "0.5030688", "0.50154895", "0.49940923", "0.49901146", "0.4987593", "0.49735808", "0.4960034", "0.4960034", "0.4955358", "0.49415892", "0.49376935", "0.49322993", "0.4924861", "0.49039894", "0.48944065", "0.48898596", "0.48824215", "0.4872996", "0.487289", "0.487289", "0.48683217", "0.48306584", "0.48220822", "0.4821923", "0.48218834", "0.48190862", "0.48148128", "0.48148128", "0.48113802", "0.48001432", "0.47994825", "0.47807157", "0.47764233", "0.47754586", "0.47740903", "0.47740903", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238", "0.47733238" ]
0.0
-1
If a resolver is defined, it must be a function.
function isValidResolver(resolver) { return resolver == null || typeof resolver === 'function'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolve(value) {\n\t\t\treturn typeof value === 'function' ? value() : value;\n\t\t}", "function isTypeResolver(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfn) {\n // 1. A type provider must be a function\n if (typeof fn !== 'function')\n return false;\n // 2. A class constructor is not a type provider\n if (/^class/.test(fn.toString()))\n return false;\n // 3. Built-in types like Date & Array are not type providers\n if (isBuiltinType(fn))\n return false;\n // TODO(bajtos): support model classes defined via ES5 constructor function\n return true;\n}", "function getResolver({ operation, argsFromLink = {}, payloadName, data, baseUrl, requestOptions }) {\n // Determine the appropriate URL:\n if (typeof baseUrl === 'undefined') {\n baseUrl = Oas3Tools.getBaseUrl(operation);\n }\n // Return custom resolver if it is defined\n const customResolvers = data.options.customResolvers;\n const title = operation.oas.info.title;\n const path = operation.path;\n const method = operation.method;\n if (typeof customResolvers === 'object' &&\n typeof customResolvers[title] === 'object' &&\n typeof customResolvers[title][path] === 'object' &&\n typeof customResolvers[title][path][method] === 'function') {\n translationLog(`Use custom resolver for ${operation.operationString}`);\n return customResolvers[title][path][method];\n }\n // Return resolve function:\n return (root, args, ctx, info = {}) => {\n /**\n * Retch resolveData from possibly existing _openapiToGraphql\n *\n * NOTE: _openapiToGraphql is an object used to pass security info and data\n * from previous resolvers\n */\n let resolveData = {};\n if (root &&\n typeof root === 'object' &&\n typeof root['_openapiToGraphql'] === 'object' &&\n typeof root['_openapiToGraphql'].data === 'object') {\n const parentIdentifier = getParentIdentifier(info);\n if (!(parentIdentifier.length === 0) &&\n parentIdentifier in root['_openapiToGraphql'].data) {\n /**\n * Resolving link params may change the usedParams, but these changes\n * should not be present in the parent _openapiToGraphql, therefore copy\n * the object\n */\n resolveData = JSON.parse(JSON.stringify(root['_openapiToGraphql'].data[parentIdentifier]));\n }\n }\n if (typeof resolveData.usedParams === 'undefined') {\n resolveData.usedParams = {};\n }\n /**\n * Handle default values of parameters, if they have not yet been defined by\n * the user.\n */\n operation.parameters.forEach(param => {\n const paramName = Oas3Tools.sanitize(param.name, Oas3Tools.CaseStyle.camelCase);\n if (typeof args[paramName] === 'undefined' &&\n param.schema &&\n typeof param.schema === 'object') {\n let schema = param.schema;\n if (schema && schema.$ref && typeof schema.$ref === 'string') {\n schema = Oas3Tools.resolveRef(schema.$ref, operation.oas);\n }\n if (schema &&\n schema.default &&\n typeof schema.default !== 'undefined') {\n args[paramName] = schema.default;\n }\n }\n });\n // Handle arguments provided by links\n for (let paramName in argsFromLink) {\n let value = argsFromLink[paramName];\n let paramNameWithoutLocation = paramName;\n if (paramName.indexOf('.') !== -1) {\n paramNameWithoutLocation = paramName.split('.')[1];\n }\n /**\n * see if the link parameter contains constants that are appended to the link parameter\n *\n * e.g. instead of:\n * $response.body#/employerId\n *\n * it could be:\n * abc_{$response.body#/employerId}\n */\n if (value.search(/{|}/) === -1) {\n args[paramNameWithoutLocation] = isRuntimeExpression(value)\n ? resolveLinkParameter(paramName, value, resolveData, root, args)\n : value;\n }\n else {\n // Replace link parameters with appropriate values\n const linkParams = value.match(/{([^}]*)}/g);\n linkParams.forEach(linkParam => {\n value = value.replace(linkParam, resolveLinkParameter(paramName, linkParam.substring(1, linkParam.length - 1), resolveData, root, args));\n });\n args[paramNameWithoutLocation] = value;\n }\n }\n // Stored used parameters to future requests:\n resolveData.usedParams = Object.assign(resolveData.usedParams, args);\n // Build URL (i.e., fill in path parameters):\n const { path, query, headers } = Oas3Tools.instantiatePathAndGetQuery(operation.path, operation.parameters, args);\n const url = baseUrl + path;\n /**\n * The Content-type and accept property should not be changed because the\n * object type has already been created and unlike these properties, it\n * cannot be easily changed\n *\n * NOTE: This may cause the user to encounter unexpected changes\n */\n headers['content-type'] =\n typeof operation.payloadContentType !== 'undefined'\n ? operation.payloadContentType\n : 'application/json';\n headers['accept'] =\n typeof operation.responseContentType !== 'undefined'\n ? operation.responseContentType\n : 'application/json';\n let options = {\n url,\n method: operation.method\n };\n if (requestOptions) {\n options = Object.assign(Object.assign({}, options), requestOptions);\n if (requestOptions.headers) {\n if (typeof requestOptions.headers === 'object') {\n Object.assign(requestOptions.headers, headers);\n }\n else if (typeof requestOptions.headers === 'function') {\n options.headers = requestOptions.headers({\n context: ctx,\n method,\n path,\n title\n });\n }\n }\n else {\n options['headers'] = headers;\n }\n if (options.qs) {\n Object.assign(options.qs, query);\n }\n else {\n options['qs'] = query;\n }\n }\n else {\n options = {\n method: operation.method,\n url: url,\n headers: headers,\n qs: query\n };\n }\n /**\n * Determine possible payload\n *\n * GraphQL produces sanitized payload names, so we have to sanitize before\n * lookup here\n */\n resolveData.usedPayload = undefined;\n if (payloadName && typeof payloadName === 'string') {\n const sanePayloadName = Oas3Tools.sanitize(payloadName, Oas3Tools.CaseStyle.camelCase);\n if (sanePayloadName in args) {\n if (typeof args[sanePayloadName] === 'object') {\n // We need to desanitize the payload so the API understands it:\n const rawPayload = JSON.stringify(Oas3Tools.desanitizeObjKeys(args[sanePayloadName], data.saneMap));\n options.body = rawPayload;\n resolveData.usedPayload = rawPayload;\n }\n else {\n // Payload is not an object (stored as an application/json)\n const rawPayload = args[sanePayloadName];\n options.body = rawPayload;\n resolveData.usedPayload = rawPayload;\n }\n }\n }\n /**\n * Pass on OpenAPI-to-GraphQL options\n */\n if (typeof data.options === 'object') {\n // Headers:\n if (typeof data.options.headers === 'object' &&\n (!requestOptions || !requestOptions.headers)) {\n for (let header in data.options.headers) {\n const val = data.options.headers[header];\n options.headers[header] = val;\n }\n }\n // Query string:\n if (typeof data.options.qs === 'object') {\n for (let query in data.options.qs) {\n const val = data.options.qs[query];\n options.qs[query] = val;\n }\n }\n }\n // Get authentication headers and query parameters\n if (root &&\n typeof root === 'object' &&\n typeof root['_openapiToGraphql'] == 'object') {\n const { authHeaders, authQs, authCookie } = getAuthOptions(operation, root['_openapiToGraphql'], data);\n // ...and pass them to the options\n Object.assign(options.headers, authHeaders);\n Object.assign(options.qs, authQs);\n // Add authentication cookie if created\n if (authCookie !== null) {\n const j = NodeRequest.jar();\n j.setCookie(authCookie, options.url);\n options.jar = j;\n }\n }\n // Extract OAuth token from context (if available)\n if (data.options.sendOAuthTokenInQuery) {\n const oauthQueryObj = createOAuthQS(data, ctx);\n Object.assign(options.qs, oauthQueryObj);\n }\n else {\n const oauthHeader = createOAuthHeader(data, ctx);\n Object.assign(options.headers, oauthHeader);\n }\n resolveData.usedRequestOptions = options;\n resolveData.usedStatusCode = operation.statusCode;\n // Make the call\n httpLog(`Call ${options.method.toUpperCase()} ${options.url}?${querystring.stringify(options.qs)}\\n` +\n `headers:${JSON.stringify(options.headers)}`);\n return new Promise((resolve, reject) => {\n NodeRequest(options, (err, response, body) => {\n if (err) {\n httpLog(err);\n reject(err);\n }\n else if (response.statusCode < 200 || response.statusCode > 299) {\n httpLog(`${response.statusCode} - ${Oas3Tools.trim(body, 100)}`);\n const errorString = `Could not invoke operation ${operation.operationString}`;\n if (data.options.provideErrorExtensions) {\n let responseBody;\n try {\n responseBody = JSON.parse(body);\n }\n catch (e) {\n responseBody = body;\n }\n const extensions = {\n method: operation.method,\n path: operation.path,\n statusCode: response.statusCode,\n responseHeaders: response.headers,\n responseBody\n };\n reject(graphQLErrorWithExtensions(errorString, extensions));\n }\n else {\n reject(new Error(errorString));\n }\n // Successful response 200-299\n }\n else {\n httpLog(`${response.statusCode} - ${Oas3Tools.trim(body, 100)}`);\n if (response.headers['content-type']) {\n /**\n * Throw warning if the non-application/json content does not\n * match the OAS.\n *\n * Use an inclusion test in case of charset\n *\n * i.e. text/plain; charset=utf-8\n */\n if (!(response.headers['content-type'].includes(operation.responseContentType) ||\n operation.responseContentType.includes(response.headers['content-type']))) {\n const errorString = `Operation ` +\n `${operation.operationString} ` +\n `should have a content-type '${operation.responseContentType}' ` +\n `but has '${response.headers['content-type']}' instead`;\n httpLog(errorString);\n reject(errorString);\n }\n else {\n /**\n * If the response body is type JSON, then parse it\n *\n * content-type may not be necessarily 'application/json' it can be\n * 'application/json; charset=utf-8' for example\n */\n if (response.headers['content-type'].includes('application/json')) {\n let responseBody;\n try {\n responseBody = JSON.parse(body);\n }\n catch (e) {\n const errorString = `Cannot JSON parse response body of ` +\n `operation ${operation.operationString} ` +\n `even though it has content-type 'application/json'`;\n httpLog(errorString);\n reject(errorString);\n }\n resolveData.responseHeaders = response.headers;\n // Deal with the fact that the server might send unsanitized data\n let saneData = Oas3Tools.sanitizeObjKeys(responseBody);\n // Pass on _openapiToGraphql to subsequent resolvers\n if (saneData && typeof saneData === 'object') {\n if (Array.isArray(saneData)) {\n saneData.forEach(element => {\n if (typeof element['_openapiToGraphql'] === 'undefined') {\n element['_openapiToGraphql'] = {\n data: {}\n };\n }\n if (root &&\n typeof root === 'object' &&\n typeof root['_openapiToGraphql'] == 'object') {\n Object.assign(element['_openapiToGraphql'], root['_openapiToGraphql']);\n }\n element['_openapiToGraphql'].data[getIdentifier(info)] = resolveData;\n });\n }\n else {\n if (typeof saneData['_openapiToGraphql'] === 'undefined') {\n saneData['_openapiToGraphql'] = {\n data: {}\n };\n }\n if (root &&\n typeof root === 'object' &&\n typeof root['_openapiToGraphql'] == 'object') {\n Object.assign(saneData['_openapiToGraphql'], root['_openapiToGraphql']);\n }\n saneData['_openapiToGraphql'].data[getIdentifier(info)] = resolveData;\n }\n }\n // Apply limit argument\n if (data.options.addLimitArgument &&\n /**\n * NOTE: Does not differentiate between autogenerated args and\n * preexisting args\n *\n * Ensure that there is not preexisting 'limit' argument\n */\n !operation.parameters.find(parameter => {\n return parameter.name === 'limit';\n }) &&\n // Only array data\n Array.isArray(saneData) &&\n // Only array of objects/arrays\n saneData.some(data => {\n return typeof data === 'object';\n })) {\n let arraySaneData = saneData;\n if ('limit' in args) {\n const limit = args['limit'];\n if (limit >= 0) {\n arraySaneData = arraySaneData.slice(0, limit);\n }\n else {\n reject(new Error(`Auto-generated 'limit' argument must be greater than or equal to 0`));\n }\n }\n else {\n reject(new Error(`Cannot get value for auto-generated 'limit' argument`));\n }\n saneData = arraySaneData;\n }\n resolve(saneData);\n }\n else {\n // TODO: Handle YAML\n resolve(body);\n }\n }\n }\n else {\n /**\n * Check to see if there is not supposed to be a response body,\n * if that is the case, that would explain why there is not\n * a content-type\n */\n const { responseContentType } = Oas3Tools.getResponseObject(operation, operation.statusCode, operation.oas);\n if (responseContentType === null) {\n resolve(null);\n }\n else {\n const errorString = 'Response does not have a Content-Type property';\n httpLog(errorString);\n reject(errorString);\n }\n }\n }\n });\n });\n };\n}", "callback(value) {\n return this.registerResolver(3\n /* callback */\n , value);\n }", "resolveUser() {\n if (this.user) {\n return;\n }\n if (typeof this.userOrResolver === 'function') {\n this.user = this.userOrResolver();\n }\n else {\n this.user = this.userOrResolver;\n }\n }", "function resolver (value, resolve) {\n\t\tresolved[resolved.length] = value;\n\n\t\tif (resolved.length === deps.length) {\n\t\t\tresolve(resolved);\n\t\t}\n\t}", "function checkForResolveTypeResolver(schema, requireResolversForResolveType) {\n Object.keys(schema.getTypeMap())\n .map(function (typeName) { return schema.getType(typeName); })\n .forEach(function (type) {\n if (!(type instanceof graphql_1.GraphQLUnionType ||\n type instanceof graphql_1.GraphQLInterfaceType)) {\n return;\n }\n if (!type.resolveType) {\n if (requireResolversForResolveType === false) {\n return;\n }\n if (requireResolversForResolveType === true) {\n throw new _1.SchemaError(\"Type \\\"\" + type.name + \"\\\" is missing a \\\"resolveType\\\" resolver\");\n }\n // tslint:disable-next-line:max-line-length\n console.warn(\"Type \\\"\" + type.name + \"\\\" is missing a \\\"__resolveType\\\" resolver. Pass false into \" +\n \"\\\"resolverValidationOptions.requireResolversForResolveType\\\" to disable this warning.\");\n }\n });\n}", "function resolveAndExecute(source, event, func) {\n if (\"string\" != typeof func) {\n //function is passed down as chain parameter, can be executed as is\n return func.call(source, event) !== false;\n }\n else {\n //either a function or a string can be passed in case of a string we have to wrap it into another function\n //it is not a plain executable code but a definition\n let sourceCode = trim(func);\n if (sourceCode.indexOf(\"function \") == 0) {\n sourceCode = `return ${sourceCode} (event)`;\n }\n return new Function(\"event\", sourceCode).call(source, event) !== false;\n }\n }", "function r(e){return\"function\"===typeof e}", "function r(e){return\"function\"===typeof e}", "function isFn (x) { return typeof x === 'function' }", "function createResolver({ resolve, reject, multiArgs }) {\n return (err, ...values) => {\n if (err) {\n err = ensureIsError(err); // if it's primitive, make in an Error\n \n if (err instanceof Error && Object.getPrototypeOf(err) === Error.prototype) {\n // if it's a base Error (not a custom error), make it an OperationalError\n err = Bluebird.OperationalError.fromError(ensureIsError(err));\n }\n\n reject(err);\n }\n else if (multiArgs) {\n resolve(Bluebird.all(values))\n }\n else {\n resolve(values[0]);\n }\n }\n }", "function r(e,t){if(\"function\"!=typeof e)throw new TypeError(\"argument fn must be a function\");return e}", "function r(e,t){if(\"function\"!=typeof e)throw new TypeError(\"argument fn must be a function\");return e}", "is_function(value) {\n return typeof(value) === 'function';\n }", "ensureResolver() {\n if (!this.resolver) {\n throw new Error('IoC container resolver is required to register string based hooks handlers');\n }\n }", "function wrapResolver(innerResolver, outerResolver) {\n return function (obj, args, ctx, info) {\n return Promise.resolve(outerResolver(obj, args, ctx, info)).then(function (root) {\n if (innerResolver) {\n return innerResolver(root, args, ctx, info);\n }\n return graphql_1.defaultFieldResolver(root, args, ctx, info);\n });\n };\n}", "function executarQualquerCoisa(fn) {\n if (typeof fn === 'function') {\n fn();\n }\n}", "bindResolver() {\n\t\tthis.app.singleton('db.resolver', Resolver);\n\t}", "function defaultResolveFn(source, args, context, info) {\n var fieldName = info.fieldName;\n // ensure source is a value for which property access is acceptable.\n if (typeof source === 'object' || typeof source === 'function') {\n return typeof source[fieldName] === 'function'\n ? source[fieldName]()\n : source[fieldName];\n }\n}", "function _ensureFunction(f) {\n if (!f || typeof f !== 'function')\n throw new Error('the argument needs to be a function!');\n }", "function checkFunction(fn) {\n return typeof fn === 'function';\n }", "__is_function(variable) {\n\n return typeof variable == \"function\"\n }", "function resolve(value, ctx) {\n return type_3.isFunction(value) ? value(ctx) : value;\n }", "_checkValue(value) {\n if (!_.isFunction(value)) {\n throw new Error('functionsDict._checkValue: must provide only Function as values.');\n }\n }", "function isFunction(value) { return typeof value === \"function\" || value instanceof Function; }", "function isFunc(cf) {\r\n return typeof cf === \"function\";\r\n}", "function wireResolver(resolver, _, __, wire) {\n\t\tresolver.resolve(wire.createChild);\n\t}", "function resolveCall(callee) {\n\t callee = callee.resolve();\n\n\t if (callee.isFunction()) {\n\t if (callee.is(\"async\")) {\n\t if (callee.is(\"generator\")) {\n\t return t.genericTypeAnnotation(t.identifier(\"AsyncIterator\"));\n\t } else {\n\t return t.genericTypeAnnotation(t.identifier(\"Promise\"));\n\t }\n\t } else {\n\t if (callee.node.returnType) {\n\t return callee.node.returnType;\n\t } else {\n\t // todo: get union type of all return arguments\n\t }\n\t }\n\t }\n\t}", "function resolveCall(callee) {\n\t callee = callee.resolve();\n\n\t if (callee.isFunction()) {\n\t if (callee.is(\"async\")) {\n\t if (callee.is(\"generator\")) {\n\t return t.genericTypeAnnotation(t.identifier(\"AsyncIterator\"));\n\t } else {\n\t return t.genericTypeAnnotation(t.identifier(\"Promise\"));\n\t }\n\t } else {\n\t if (callee.node.returnType) {\n\t return callee.node.returnType;\n\t } else {\n\t // todo: get union type of all return arguments\n\t }\n\t }\n\t }\n\t}", "function resolve(value) {\n\t\tfor (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t\t\tparams[_key - 1] = arguments[_key];\n\t\t}\n\n\t\treturn typeof value === 'function' ? value.apply(undefined, params) : value;\n\t}", "createResolver(props) {\n return new resolver_1.Resolver(this, `${props.typeName}${props.fieldName}Resolver`, {\n api: this,\n ...props,\n });\n }", "function isResolve(value) {\n\t return isObject(value) && value.then && value.$$promises;\n\t }", "function isResolve(value) {\n\t return isObject(value) && value.then && value.$$promises;\n\t }", "function staticallyResolve(node, host, checker, foreignFunctionResolver) {\n return new StaticInterpreter(host, checker).visit(node, {\n absoluteModuleName: null,\n scope: new Map(), foreignFunctionResolver: foreignFunctionResolver,\n });\n }", "function r(e) {\n return typeof Function !== \"undefined\" && e instanceof Function || Object.prototype.toString.call(e) === \"[object Function]\"\n }", "function a(e){return\"function\"===typeof e}", "function a(e){return\"function\"===typeof e}", "function o(e){return\"function\"===typeof e}", "function paymillCallbackResolver(service, resolver) {\n\treturn function paymillCallback(error, token) {\n\t\tif (error) {\n\t\t\tvar message = service.translationForKey('errors.' + error.apierror);\n\n\t\t\tresolver.reject(new PaymillError(message, error.apierror, error));\n\t\t} else {\n\t\t\tresolver.resolve(token);\n\t\t}\n\t};\n}", "function isFunction(input){return\"undefined\"!=typeof Function&&input instanceof Function||\"[object Function]\"===Object.prototype.toString.call(input)}", "function wrapResolver(innerResolver, outerResolver) {\n return function (obj, args, ctx, info) {\n return Promise.resolve(outerResolver(obj, args, ctx, info)).then(function (root) {\n if (innerResolver) {\n return innerResolver(root, args, ctx, info);\n }\n return defaultResolveFn(root, args, ctx, info);\n });\n };\n}", "function defaultResolveFn(source, args, context, _a) {\n var fieldName = _a.fieldName;\n // ensure source is a value for which property access is acceptable.\n if (typeof source === 'object' || typeof source === 'function') {\n var property = source[fieldName];\n if (typeof property === 'function') {\n return property(args, context);\n }\n return property;\n }\n}", "getResolver() {\n if (!this.resolverPromise) {\n this.resolverPromise = this.loadResolver();\n this.resolverPromise.then(this.clearResolverPromise, this.clearResolverPromise);\n }\n return this.resolverPromise;\n }", "function resolveCall(callee) {\n callee = callee.resolve();\n\n if (callee.isFunction()) {\n if (callee.is(\"async\")) {\n if (callee.is(\"generator\")) {\n return t.genericTypeAnnotation(t.identifier(\"AsyncIterator\"));\n } else {\n return t.genericTypeAnnotation(t.identifier(\"Promise\"));\n }\n } else {\n if (callee.node.returnType) {\n return callee.node.returnType;\n } else {\n // todo: get union type of all return arguments\n }\n }\n }\n}", "function resolveValue(value, ...args) {\n if (typeof value === \"function\") {\n return value(...args);\n } else {\n return value;\n }\n}", "function resolveValue(value, ...args) {\n if (typeof value === \"function\") {\n return value(...args);\n } else {\n return value;\n }\n}", "function sc_isProcedure(o) {\n return (typeof o === \"function\");\n}", "function defaultResolveFn(source, args, _ref) {\n var fieldName = _ref.fieldName;\n\n // ensure source is a value for which property access is acceptable.\n if (typeof source !== 'number' && typeof source !== 'string' && source) {\n var property = source[fieldName];\n return typeof property === 'function' ? property.call(source) : property;\n }\n}", "function ParseFuncOrArgument(result, isFunction) {\n this.result = result;\n // Is this a function (i.e. is it something defined in functions.js)?\n this.isFunction = isFunction;\n}", "function deferRsc (func) {\r\n var obj = Object.create(DeferredRsc.prototype);\r\n obj.resolve = func;\r\n return obj;\r\n}", "function isFunc(f) {\n return typeof f === \"function\";\n}", "function resolve() {\n $apply(a.shift() || function () {}, arguments);\n }", "get hasFunction() {\n return validators_1.isFunction(this.handler);\n }", "function _resolveForModel(req, res, func, Model) {\n func = _.template(func)({ Model : Model});\n container.resolve(eval(func));\n }", "function isFunction(val) {\n return typeof val == \"function\";\n}", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }", "function r(e){var t=typeof e;return null==e||'object'!=t&&'function'!=t}", "function isResolve(value) {\n\t\t\t\treturn isObject(value) && value.then && value.$$promises;\n\t\t\t}", "function isFunc(it) {\n return it instanceof Function || typeof it === \"function\";\n }", "resolveHandler(handler) {\n if (typeof handler === 'string') {\n this.ensureResolver();\n return this.resolver.resolve(handler);\n }\n return handler;\n }", "function r(t){return typeof Function!=\"undefined\"&&t instanceof Function||Object.prototype.toString.call(t)===\"[object Function]\"}", "function checkFetchResource(fn) {\n\t if (typeof fn !== 'function') throw new TypeError('Expected `fetchResource` to be a `function`, get a ' + ('`' + (typeof fetchResource === 'undefined' ? 'undefined' : _typeof(fetchResource)) + '`. Check what has been passed to ') + '`buildresourceConnector` or to `setFetchResource`');\n\t }", "function resolverFactory(decEndpoint, _config, _logger, _registryClient) {\n expect(_config).to.eql(config);\n expect(_logger).to.be.an(Logger);\n expect(_registryClient).to.be.an(RegistryClient);\n\n decEndpoint = mout.object.deepMixIn({}, decEndpoint);\n decEndpoint.source = mockSource;\n\n resolver = new resolvers.GitRemote(decEndpoint, _config, _logger);\n resolverFactoryHook(resolver);\n\n return Q.resolve(resolver);\n }", "function isFunction(val) {\n return typeof val === 'function';\n}", "function isFunction(val) {\n return typeof val === 'function';\n}", "function isFunction(val) {\n return typeof val === 'function';\n}", "function isFunction(val) {\n return typeof val === 'function';\n}", "function Resolver() {\r\n /**\r\n List of success callbacks\r\n\r\n @property _callbacks\r\n @type Array\r\n @private\r\n **/\r\n this._callbacks = [];\r\n\r\n /**\r\n List of failure callbacks\r\n\r\n @property _errbacks\r\n @type Array\r\n @private\r\n **/\r\n this._errbacks = [];\r\n\r\n /**\r\n The status of the operation. This property may take only one of the following\r\n values: 'pending', 'fulfilled' or 'rejected'.\r\n\r\n @property _status\r\n @type String\r\n @default 'pending'\r\n @private\r\n **/\r\n this._status = 'pending';\r\n\r\n /**\r\n This value that this promise represents.\r\n\r\n @property _result\r\n @type Any\r\n @private\r\n **/\r\n this._result = null;\r\n }", "function r(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function r(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function isTypeAnnotationAFunction( node, options ) {\n\treturn ( node.type === 'TypeAnnotation' || node.type === 'TSTypeAnnotation' ) && node.typeAnnotation.type === 'FunctionTypeAnnotation' && ! node.static && ! sameLocStart( node, node.typeAnnotation, options );\n}", "async function resolve (callee, f, options, vargs) {\n try {\n try {\n if (typeof f == 'function') {\n f = f()\n }\n } catch (error) {\n throw construct(Class.options(options, { errors: [ error ] }), vargs, callee)\n }\n const result = await f\n if (Interrupt.auditing) {\n construct(Class.options(options, { errors: [ AUDIT ] }), vargs, resolve)\n }\n return result\n } catch (error) {\n throw construct(Class.options(options, { errors: [ error ] }), vargs, resolve)\n }\n }", "function isFunction(object) { return typeof object === 'function'; }", "resolve(resolver) {\n if (this.isAbsent()) {\n return Optional.absent;\n }\n try {\n return Optional.fromNullable(resolver(this.value));\n }\n catch (e) {\n return Optional.absent;\n }\n }", "function requireFunction(value) {\n if (\"[object Function]\" !== Object.prototype.toString.call(value)) {\n throw new Error(value + \" is not a function\");\n }\n }", "function wrapResolver(\n model,\n resolverGroupName,\n resolverName,\n getCurrentHub,\n ) {\n fill(model[resolverGroupName], resolverName, function (orig) {\n return function ( ...args) {\n const scope = getCurrentHub().getScope();\n const parentSpan = _optionalChain([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);\n const span = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({\n description: `${resolverGroupName}.${resolverName}`,\n op: 'graphql.resolve',\n })]);\n\n const rv = orig.call(this, ...args);\n\n if (isThenable(rv)) {\n return rv.then((res) => {\n _optionalChain([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);\n return res;\n });\n }\n\n _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);\n\n return rv;\n };\n });\n }" ]
[ "0.60108536", "0.5983928", "0.57119197", "0.556918", "0.5547538", "0.55399346", "0.55316556", "0.54889995", "0.5416304", "0.5416304", "0.54119635", "0.5396087", "0.53853196", "0.53853196", "0.53354096", "0.5296625", "0.5274366", "0.52573806", "0.5207318", "0.5182532", "0.51794654", "0.51766306", "0.5174054", "0.51638067", "0.51121503", "0.5108614", "0.510388", "0.50920916", "0.50789565", "0.50789565", "0.50775003", "0.507514", "0.50463015", "0.50463015", "0.50173163", "0.50040823", "0.50032884", "0.50032884", "0.50006855", "0.4997254", "0.49911702", "0.49791953", "0.49781635", "0.49692053", "0.49623966", "0.4951588", "0.4951588", "0.49488625", "0.49450153", "0.4943536", "0.4930101", "0.4923411", "0.49221885", "0.4915141", "0.49034315", "0.49018618", "0.49014926", "0.49012935", "0.49012935", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49009925", "0.49005374", "0.48998657", "0.48861742", "0.4884846", "0.4882126", "0.48796284", "0.48770264", "0.4872338", "0.4872338", "0.4872338", "0.4872338", "0.48707357", "0.48553643", "0.48553643", "0.48357737", "0.4829215", "0.4828612", "0.48272705", "0.4819275", "0.4813727" ]
0.78889376
1
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function invariant(condition, message) { if (!condition) { throw new Error(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the server to access\n // the session\n xfbml : true, // parse social plugins on this page\n version : 'v2.1' // use version 2.1\n });\n \n window.FB.getLoginStatus(function(response) {\n // upon opening the ma\n if (response.status === \"connected\") {\n loadStream(response);\n }\n }.bind(this));\n }.bind(this);\n } else {\n window.FB.getLoginStatus(function(response) {\n console.log(\"getting status\");\n this.initiateLoginOrLogout(response);\n }.bind(this));\n }\n\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n }", "componentDidMount() {\n\n\t window.fbAsyncInit = function() {\n\t window.FB.init({\n\t appId : '1250815578279698',\n\t cookie : true, // enable cookies to allow the server to access\n\t // the session\n\t xfbml : true, // parse social plugins on this page\n\t version : 'v2.11' // use version 2.1\n\t });\n\n //window.FB.Event.subscribe('auth.statusChange', this.statusChangeCallback());\n /* comment by bipin: it redirect if user is logged in fb */\n\t // window.FB.getLoginStatus(function(response) {\n\t // this.statusChangeCallback(response);\n\t // }.bind(this));\n\t }.bind(this);\n\n // Load the SDK asynchronously\n\t (function(d, s, id) {\n\t var js, fjs = d.getElementsByTagName(s)[0];\n\t if (d.getElementById(id)) return;\n\t js = d.createElement(s); js.id = id;js.async = true;\n\t js.src = \"https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11\";\n\t fjs.parentNode.insertBefore(js, fjs);\n\t }(document, 'script', 'facebook-jssdk'));\n\t}", "function facebookLogin()\r\n{\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect = onFBConnected;\r\n \r\n}", "loginWithFacebook(){\n LoginManager.logInWithReadPermissions(['public_profile']).then(loginResult => {\n if (loginResult.isCancelled) {\n console.log('user canceled');\n return;\n }\n AccessToken.getCurrentAccessToken()\n .then(accessTokenData => {\n const credential = this.props.provider.credential(accessTokenData.accessToken);\n return auth.signInWithCredential(credential);\n })\n .then(credData => {\n console.log(credData);\n })\n .catch(err => {\n console.log(err);\n });\n });\n\n }", "componentDidMount(){\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n \n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '207358966557597', /* Our specific APP id */\n cookie : true, \n xfbml : true, \n version : 'v2.8' \n });\n\n /* This might be a duplicate of above checkLoginState, but need to investigate */\n FB.getLoginStatus(function(response) {\n this.statusChangeCallback(response);\n }.bind(this));\n }.bind(this)\n }", "componentWillUnmount() {\n //disconnect from FB\n }", "componentDidMount() {\n this.props.facebookLogin();\n // AsyncStorage.removeItem('fb_token');\n // this.onAuthComplete(this.props);\n }", "function auth_Facebook()\n{\n authenticate(new firebase.auth.FacebookAuthProvider());\n}", "render() {\n return (\n <div id=\"fb-root\"></div>\n )\n }", "componentDidMount() {\n const {\n videoId,\n } = this.props;\n\n if (typeof window !== \"undefined\") {\n this.loadFB()\n .then(res => {\n if (res) {\n this.FB = res;\n this.createPlayer(videoId);\n }\n });\n }\n }", "function testAPI() {\n FB.api('/me', function(response) {\n });\n }", "_FBPReady() {\n super._FBPReady();\n\n }", "componentDidMount() {\n const _this = this;\n\n\n _this._manageGlobalEventHandlers(_this.props);\n\n _this._FB_init(function() {\n _this.setState({\n initializing: false\n });\n });\n }", "checkAuth() {\n return new Promise((resolve) => {\n window.fbAsyncInit = () => {\n window.FB.init({\n appId: process.env.FACEBOOK_ID,\n cookie: true,\n xfbml: true,\n version: 'v2.8',\n });\n window.FB.AppEvents.logPageView();\n window.FB.getLoginStatus((response) => {\n resolve(response);\n });\n };\n\n ((d, s, id) => {\n const fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) { return; }\n const js = d.createElement(s); js.id = id;\n js.src = '//connect.facebook.net/en_US/sdk.js';\n fjs.parentNode.insertBefore(js, fjs);\n })(document, 'script', 'facebook-jssdk');\n });\n }", "loginByFacebook() {\n if (!this.props.accsessToken) {\n this.props.facebookLogin();\n } else {\n return Alert.alert('', 'Please logout first');\n }\n }", "function facebookLogin() {\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n}", "FacebookAuth() {\n return this.AuthLogin(new firebase_app__WEBPACK_IMPORTED_MODULE_1__[\"auth\"].FacebookAuthProvider());\n }", "_FB_init(finishedCallback) {\n const _this = this;\n\n //Fail if FB is not available\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n //Get the users AccessToken\n FB.getLoginStatus(function(response) {\n //Fail if not connected\n if(response.status != 'connected') {\n _this.props.onError(ERROR.CONNECTION_FAILED);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.connection_failed);\n }\n\n //Load data when connected\n else {\n _this.setState({\n FB_accessToken: response.authResponse.accessToken\n });\n\n _this._FB_getUserAlbums(finishedCallback);\n _this._FB_getUserImage();\n }\n }, true);\n }", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "function sdk(){\n}", "getUserInfoFromFB() {\n return axios.get('/user/info/fb')\n .then(res => {\n console.log('User info FB: ', res.data);\n this.setState({\n user: res.data\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "onShareAppMessage() {\n\n }", "constructor() {\n this.apiUrl = 'https://graph.facebook.com/v4.0';\n this.access_token = process.env.ACCESS_TOKEN;\n }", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n \n });\n\n\n \n }", "_FB_API(p1, p2, p3) {\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n FB.api(p1, p2, p3);\n }", "setFacebook(token) {\n fetch('https://graph.facebook.com/v2.5/me?fields=email,name,friends&access_token=' + token)\n .then((response) => response.json())\n .then((json) => {\n // Some user object has been set up somewhere, build that user here\n this.setState({ fb_name: json.name, fb_email: json.email, fb_token: token, fb_user_id: json.id});\n helper.saveFacebookData( this.state.user_id, json.email, json.name, json.id ,token );\n return \"Okay\";\n })\n .catch(() => {\n reject('ERROR GETTING DATA FROM FACEBOOK')\n });\n }", "function FacebookLoginLoad() {\r\n (function (d, s, id) {\r\n var js, fjs = d.getElementsByTagName(s)[0];\r\n if (d.getElementById(id)) { return; }\r\n js = d.createElement(s); js.id = id;\r\n js.src = \"../../../Scripts/Facebook/sdk.js\";\r\n fjs.parentNode.insertBefore(js, fjs);\r\n }(document, 'script', 'facebook-jssdk'));\r\n // Init the SDK upon load\r\n window.fbAsyncInit = function () {\r\n FB.init({\r\n appId: '454206028123700',\r\n xfbml: true,\r\n version: 'v2.5'\r\n });\r\n }\r\n}", "function signInWithFb() {\n return {\n type: SIGN_IN_WITH_FB\n };\n}", "private public function m246() {}", "handle_submit() {\n const {article, content} = this.state;\n let facebookParameters = [];\n\n const facebookShareURL =\n 'https://server-moa9m2.turbo360-vertex.com/share/EJ5BXsTgFr43dx4Y';\n facebookParameters.push('quote=' + encodeURI(content));\n facebookParameters.push('u=' + encodeURI(facebookShareURL));\n\n console.log(facebookParameters);\n const url =\n 'https://www.facebook.com/sharer/sharer.php?' +\n facebookParameters.join('&');\n Linking.openURL(url)\n .then(data => {\n this.handle_cancel();\n console.log('Facebook Opened');\n })\n .catch(() => {\n console.log('Something went wrong');\n });\n }", "testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n //document.getElementById('status').innerHTML =\n // 'Thanks for logging in, ' + response.name + '!';\n });\n}", "function myFacebookLogin() {\n FB.login(function () {\n checkLoginState();\n }, {scope: 'public_profile, email, user_friends'});\n}", "logout() {\n FB.logout();\n }", "function singInWithFacebook() {\n var provider = new firebase.auth.FacebookAuthProvider();\n var d = new Date();\n firebase.auth().signInWithPopup(provider).then(({user}) => {\n //create database of user\n if (user.metadata.creationTime === user.metadata.lastSignInTime) {\n createData('/users/' + user.uid, {\n \"displayName\": user.displayName,\n \"email\": user.email,\n \"joinedOn\": d.getDate() + '/' + (d.getMonth() + 1) + '/' + d.getFullYear(),\n \"username\": user.uid,\n });\n }\n\n //final step creat local login\n return user.getIdToken().then((idToken) => {\n return fetch(\"/sessionLogin\", {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n \"CSRF-Token\": Cookies.get(\"XSRF-TOKEN\"),\n },\n body: JSON.stringify({\n idToken\n }),\n });\n });\n })\n .then(() => {\n window.location.assign(\"/dashboard\");\n });\n}", "function _handleFb() {\n\t\tlet shortToken;\n\t\tif (window.location.hash) {\n\n\t\t\tconsole.log(\"window.location\", window.location);\n\n\t\t\t\tlet accessTokenMatch = window.location.hash.match(/access_token\\=([a-zA-Z0-9]+)/);\n\t\t\tconsole.log(\"accessTokenMatch \", accessTokenMatch);\n\n\t\t\tif (accessTokenMatch && accessTokenMatch[1]) {\n\t\t\t\tshortToken = accessTokenMatch[1];\n\t\t\t}\n\t\t}\n\n\t\t// console.log(\"_handleFb \");\n\t\t// console.log(\"shortToken \", shortToken);\n\n\t\tif (shortToken) {\n\t\t\t// We came here from Facebook redirect, with a token\n\t\t\tif (getUrlParams()[\"accountLinking\"]) {\n\t\t\t\t_getFBMeWithShortToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\tconsole.log(\"_getFBMeWithShortToken data\", data);\n\t\t\t\t\t\t//console.log('updating', data)\n\t\t\t\t\t\tupdateClient({\"facebookLogin\": data[\"id\"]}, function(d, e) {\n\t\t\t\t\t\t\tconsole.log('updated!');\n\t\t\t\t\t\t\tconsole.log(d, e);\n\n\t\t\t\t\t\t\t_generateFBToken({\n\t\t\t\t\t\t\t\tshortToken,\n\t\t\t\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\t\t\t\tconsole.log()\n\t\t\t\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Clear query parameter from address bar\n\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\thistory.pushState(\"\", document.title, window.location.pathname);\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t_generateFBToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t_store._fbAllowed = true;\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\telse {\n\t\t\tif(window.altyn.zonePrefix === \"\"||(window.isMobile && window.altyn.zonePrefix ==\"/open\")){\n\t\t\t\t//Just came on page, need to get token status\n\t\t\t\t_getFBTokenStatus(function(response) {\n\t\t\t\t\tif (response && response[\"value\"] === true) {\n\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t}\n\t}", "function log_in_with_facebook() {\n var provider = new firebase_ref.auth.FacebookAuthProvider();\n log_in_with_provider(provider);\n}", "authenticateFacebook() {\n return this.authService.authenticate('facebook')\n .then(() => {\n this.authenticated = this.authService.authenticated;\n });\n }", "openMessenger() {\n Linking.openURL('fb://messaging/' + FACEBOOK_ID);\n }", "beforeConnectedCallbackHook(){\n\t\t\n\t}", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n\n });\n }", "function FB(config) {\r\n this.config = config||{};\r\n this.started = this.init();\r\n}", "function facebookWidgetInit() {\n var widgetMarkup = '<div class=\"fb-page\" data-href=\"https://www.facebook.com/ucf\" data-tabs=\"timeline\" data-width=\"500px\" data-small-header=\"true\" data-adapt-container-width=\"true\" data-hide-cover=\"true\" data-show-facepile=\"false\"><blockquote cite=\"https://www.facebook.com/ucf\" class=\"fb-xfbml-parse-ignore\"><a href=\"https://www.facebook.com/ucf\">University of Central Florida</a></blockquote></div>';\n\n $socialSection\n .find('#js-facebook-widget')\n .html(widgetMarkup);\n\n window.fbAsyncInit = function() {\n FB.init({\n appId : '637856803059940',\n xfbml : true,\n version : 'v2.8'\n });\n };\n\n (function(d, s, id){\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) {return;}\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n}", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n });\n }", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n });\n }", "function checkFacebookTab() {\n if (!stopFB) {\n facebookTab((tab) => {\n idFB = tab.id;\n\n if (idFB != null && tab != null) {\n updateFBNotifications(tab.title);\n }\n\n if (!tab.pinned) {\n browser.tabs.update(tab.id, {\n pinned: true,\n });\n }\n }, () => {\n if (idFB == null || idFB != idPrevFB) {\n browser.tabs.create({\n index: 0,\n pinned: true,\n url: 'https://www.messenger.com/',\n active: false,\n }).then((tab) => {\n if (typeof tab === 'object') {\n idFB = tab.id;\n idPrevFB = tab.id;\n }\n });\n }\n });\n }\n}", "testAPI() {\n\t console.log('Welcome! Fetching your information.... ');\n\t FB.api('/me', function(response) {\n\t console.log('Successful login for: ' + response.name);\n\t document.getElementById('status').innerHTML =\n\t 'Thanks for logging in, ' + response.name + '!';\n\t });\n\t}", "private internal function m248() {}", "frame() {\n throw new Error('Not implemented');\n }", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "statusChangeCallback(response) {\n // The response object is returned with a status field that lets the\n // app know the current login status of the person.\n // Full docs on the response object can be found in the documentation\n // for FB.getLoginStatus().\n if (response.status === 'connected') {\n // Logged into your app and Facebook.\n this.setState({ token: response.authResponse.accessToken });\n this.getLongTermToken();\n } else if (response.status === 'not_authorized') {\n // The person is logged into Facebook, but not your app.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into this app.';\n } else {\n // The person is not logged into Facebook, so we're not sure if\n // they are logged into this app or not.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into Facebook.';\n }\n }", "function getFbInfos() {\n\n FB.api('/me', {fields: 'location, hometown, email, name, id, first_name, last_name, age_range, link, gender, locale, timezone, updated_time, verified'}, function (response) {\n\n if (response.email == 'undefined' || !response.email) {\n var error = $('#login-alert');\n error.html('<a onclick=\"myFacebookLoginNeedEmail();\" href=\"#\">Your email is required. Please click here to finish your login.</a>');\n error.show();\n $('#facebook-login').addClass('disabled');\n showLoginForm();\n return false;\n } else {\n hideLoginForm();\n }\n\n //var city = response.location.name.split(\",\")[0].trim();\n //var country = response.location.name.split(\",\")[1].trim();\n currentUser = {\n \"id\": response.id,\n \"email\": response.email,\n \"password\": response.id,\n \"name\": response.name,\n \"firstname\": response.first_name,\n \"lastname\": response.last_name,\n //\"city\": city,\n //\"country\": country,\n \"link\": response.link,\n \"gender\": response.gender,\n \"ageRange\": response.age_range.min,\n \"avatarUrl\": \"http://graph.facebook.com/\" + response.id + \"/picture?type=square\",\n \"language\": response.locale,\n //\"originalCountry\": response.hometown.name.split(\",\")[1].trim()\n };\n\n if (isNewUser) {\n addNewUser(currentUser);\n } else {\n // check existing user\n\n }\n\n });\n\n}", "async componentWillMount() {\n var _this = this\n _this.setUpUserDataFromFB()\n\n //ASK FOR CAMERA ONLT IF IS PREVIEW TRUE AND SHOWBARCODE TRUE\n if (Config.isPreview && Config.showBCScanner) {\n const { status } = await Permissions.askAsync(Permissions.CAMERA);\n this.setState({ hasCameraPermission: status === 'granted' });\n }\n\n\n\n AppEventEmitter.addListener('user.state.changes', this.alterUserState);\n if (Config.isTesterApp) {\n this.listenForUserAuth();\n } else if (Config.isPreview && !Config.isTesterApp) {\n //Load list of apps\n _this.retreiveAppDemos(\"apps\");\n }\n\n if (!Config.isPreview && !Config.isTesterApp) {\n\n //Load the data automatically, this is normal app and refister for Push notification\n this.registerForPushNotificationsAsync();\n Notifications.addListener(this._handleNotification);\n this.retreiveMeta();\n }\n\n\n await Font.loadAsync({\n //\"Material Icons\": require(\"@expo/vector-icons/fonts/MaterialIcons.ttf\"),\n //\"Ionicons\": require(\"@expo/vector-icons/fonts/Ionicons.ttf\"),\n // \"Feather\": require(\"@expo/vector-icons/fonts/Feather.ttf\"),\n 'open-sans': require('./assets/fonts/OpenSans-Regular.ttf'),\n 'lato-light': require('./assets/fonts/Lato-Light.ttf'),\n 'lato-regular': require('./assets/fonts/Lato-Regular.ttf'),\n 'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),\n 'lato-black': require('./assets/fonts/Lato-Black.ttf'),\n 'roboto-medium': require('./assets/fonts/Roboto-Medium.ttf'),\n 'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf'),\n 'roboto-light': require('./assets/fonts/Roboto-Light.ttf'),\n 'roboto-thin': require('./assets/fonts/Roboto-Thin.ttf'),\n\n });\n\n this.setState({ isReady: true, fontLoaded: true });\n }", "function WebIdUtils () {\n}", "supportsPlatform() {\n return true;\n }", "login() {\n return new Promise((resolve, reject) => {\n window.FB.login((response) => {\n if (response.authResponse) {\n resolve(response);\n } else {\n reject(response);\n }\n }, { scope: 'public_profile,email' });\n });\n }", "function login() {\n fb_login(userDetails);\n}", "fetchUser() {\n return new Promise((resolve) => {\n window.FB.api('/me', { fields: 'first_name,last_name,picture.type(large),email' }, (response) => {\n resolve(response);\n });\n });\n }", "function facebookLink() {\n window.open(\"https://www.facebook.com/sharer/sharer.php?u=https://blackfemaleinventors.netlify.com/\", \" \", \"width=500,height=500\");\n}", "function run() {\n var service = getService();\n if (service.hasAccess()) {\n\n var url = 'https://graph.facebook.com/v2.6/me/accounts?';\n\n var response = UrlFetchApp.fetch(url, {\n headers: {\n 'Authorization': 'Bearer ' + service.getAccessToken()\n }\n });\n var result = JSON.parse(response.getContentText());\n Logger.log(JSON.stringify(result , null, 2));\n } else {\n var authorizationUrl = service.getAuthorizationUrl();\n\n Logger.log('Open the following URL and re-run the script: %s',authorizationUrl);\n \n\n\n}}", "function LoginByFB(){\n\t\t\t \t//console.log('LoginByFB');\n\t\t\t FB.login(function(response) {\n\t\t\t //console.log('appel de la function FB.login 1');\n\t\t\t //console.log(response);\n\t\t\t if (response.authResponse) {\n\t\t\t console.log('Welcome! Fetching your information.... ');\n\t\t\t console.log(response);\n\t\t\t getdatsForUser();\n\t\t\t } else {\n\t\t\t console.log('User cancelled login or did not fully authorize.');\n\t\t\t }\n\t\t\t }, {scope: 'public_profile,email'});\n\t\t\t }", "function facebookLogin() {\n FB.login(function(response){\n scope: 'email,user_birthday,status_update,publish_stream' // estos son los permisos que necesita la aplicacion\n });\n }", "getAccessToken() {}", "static checkMobileWallet(){\n\t\tif(typeof window.ReactNativeWebView !== 'undefined' || typeof window.PopOutWebView !== 'undefined'){\n\t\t\tconst parseIfNeeded = x => {\n\t\t\t\tif(x && typeof x === 'string' && x.indexOf(`{`) > -1) x = JSON.parse(x);\n\t\t\t}\n\n\t\t\t// For mobile popouts only.\n\t\t\tif(typeof window.ReactNativeWebView === 'undefined'){\n\t\t\t\twindow.ReactNativeWebView = {\n\t\t\t\t\tpostMessage:() => {}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tlet resolvers = {};\n\n\t\t\twindow.ReactNativeWebView.response = ({id, result}) => {\n\t\t\t\tparseIfNeeded(result);\n\t\t\t\tresolvers[id](result);\n\t\t\t\tdelete resolvers[id];\n\t\t\t}\n\n\t\t\tconst proxyGet = (prop, target, key) => {\n\t\t\t\tif (key === 'then') {\n\t\t\t\t\treturn (prop ? target[prop] : target).then.bind(target);\n\t\t\t\t}\n\n\t\t\t\tif(key === 'socketResponse'){\n\t\t\t\t\treturn (prop ? target[prop] : target)[key];\n\t\t\t\t}\n\n\t\t\t\treturn (...params) => new Promise(async resolve => {\n\t\t\t\t\tconst id = IdGenerator.text(24);\n\t\t\t\t\tresolvers[id] = resolve;\n\t\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({id, prop, key, params}));\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst proxied = (prop) => new Proxy({}, { get(target, key){ return proxyGet(prop, target, key); } });\n\n\n\t\t\twindow.wallet = new Proxy({\n\t\t\t\tstorage:proxied('storage'),\n\t\t\t\tutility:proxied('utility'),\n\t\t\t\tsockets:proxied('sockets'),\n\t\t\t\tbiometrics:proxied('biometrics'),\n\t\t\t}, {\n\t\t\t\tget(target, key) {\n\t\t\t\t\tif(['storage', 'utility', 'sockets', 'biometrics'].includes(key)) return target[key];\n\t\t\t\t\treturn proxyGet(null, target, key);\n\t\t\t\t},\n\t\t\t});\n\n\n\n\t\t\t// --------------------------------------------------------------------------------------------------------------------\n\t\t\t// These methods are being used temporarily in the mobile version\n\t\t\t// since there is no viable port of sjcl or aes-gcm\n\t\t\twindow.ReactNativeWebView.mobileEncrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.encrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twindow.ReactNativeWebView.mobileDecrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.decrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst Mnemonic = require('@walletpack/core/util/Mnemonic').default;\n\t\t\twindow.ReactNativeWebView.seedPassword = async ({id, password, salt}) => {\n\t\t\t\tconst [_, seed] = await Mnemonic.generateMnemonic(password, salt);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:seed}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t// Just because doing sha256 on a buffer in react is dumb.\n\t\t\tconst ecc = require('eosjs-ecc');\n\t\t\twindow.ReactNativeWebView.sha256 = ({id, data}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:ecc.sha256(Buffer.from(data))}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst log = console.log;\n\t\t\tconst error = console.error;\n\n\t\t\tconsole.log = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn log(...params);\n\t\t\t};\n\n\t\t\tconsole.error = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn error(...params);\n\t\t\t};\n\n\t\t}\n\t}", "function initFacebook(){ //normally called when document is ready (ie. when page loads)\n var js, id = 'facebook-jssdk'; if (document.getElementById(id)) {return;}\n js = document.createElement('script'); js.id = id; js.async = true;\n js.src = \"//connect.facebook.net/en_US/all.js\"; //calls fbAsyncInit above when loaded\n document.getElementsByTagName('head')[0].appendChild(js);\n}", "function FBConnect()\n{\n\tthis.facebookkey = 'facebook';\n\tif(window.plugins.childBrowser == null)\n\t{\n\t\tChildBrowser.install();\n\t}\n}", "function getUserInfo22(){\n facebookConnectPlugin.api('me/?fields=id,name,email', ['email','public_profile'],\n function (result) {\n console.log(result);\n },\n function (error) {\n console.log(error);\n });\n}", "share(path){\n const FACEBOOK_ICON = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAAAYFBMVEUAAAAAQIAAWpwAX5kAX5gAX5gAX5gAXJwAXpgAWZ8AX5gAXaIAX5gAXpkAVaoAX5gAXJsAX5gAX5gAYJkAYJkAXpoAX5gAX5gAX5kAXpcAX5kAX5gAX5gAX5YAXpoAYJijtTrqAAAAIHRSTlMABFis4vv/JL0o4QvSegbnQPx8UHWwj4OUgo7Px061qCrcMv8AAAB0SURBVEjH7dK3DoAwDEVRqum9BwL//5dIscQEEjFiCPhubziTbVkc98dsx/V8UGnbIIQjXRvFQMZJCnScAR3nxQNcIqrqRqWHW8Qd6cY94oGER8STMVioZsQLLnEXw1mMr5OqFdGGS378wxgzZvwO5jiz2wFnjxABOufdfQAAAABJRU5ErkJggg==\";\n let shareImageBase64 = {\n title: \"React Native\",\n message: \"Hola mundo\",\n url: FACEBOOK_ICON,\n subject: \"Share Link\" // for email\n };\n Share.open(shareImageBase64);\n }", "_FBPReady() {\n super._FBPReady();\n }", "function fbdown(imageName)\r\n\t {\r\n // <!-- Facebook Login logic prod 249863545451459 test 238604546585672 -->\r\n var appId = '249863545451459';\r\n\r\n //prod var roleArn = 'arn:aws:iam::675778862308:role/roleJavaScript'; //local var roleArn = 'arn:aws:iam::675778862308:role/javarolenow';\r\n var roleArn = 'arn:aws:iam::675778862308:role/roleJavaScript';\r\n\r\n\r\n var bucketName = 'elasticbeanstalk-us-east-1-675778862308';\r\n\r\n\r\n AWS.config.region = 'us-east-1';\r\n\r\n\r\n\r\n\r\n\r\n\r\n var bucket = new AWS.S3({\r\n\r\n\r\n params: {\r\n\r\n\r\n Bucket: bucketName\r\n\r\n\r\n }\r\n\r\n\r\n });\r\n accessToken = $.jStorage.get(\"fbAToken\");\r\n\t\t\tbucket.config.credentials = new AWS.WebIdentityCredentials({\r\n\r\n\r\n\t ProviderId: 'graph.facebook.com',\r\n\r\n\r\n\t RoleArn: roleArn,\r\n\r\n\r\n\t WebIdentityToken: accessToken\r\n\r\n\r\n\t });\r\n\r\n\r\n\t\t\tfbUserId = $.jStorage.get(\"fbKey\");\r\n fbUserId = $.jStorage.get(\"fbKey\");\r\n var profilePic;\r\n var params = {Bucket: 'elasticbeanstalk-us-east-1-675778862308', Key: imageName, Expires: 60};\r\n url = bucket.getSignedUrl('getObject', params, function (err, url) {\r\n if (url) {\r\n \tprofilePic = '<img width=\"270\" height=\"263\" alt=\"\" src=\"'+url+'\"'+'>';\r\n \t$(\"#profilePic\").html(profilePic);\r\n }\r\n else{\r\n\t\t\t\tprofilePic = '<img width=\"270\" height=\"263\" alt=\"\" src=\"'+default1+'\"'+'>';$(\"#profilePic\").append(profilePic);\r\n\t\t\t\t}\r\n });\r\n\r\n\r\n }", "static postCode () {\n var token = /access_token=([^&]+)/.exec(window.document.location.hash)\n var expires_in = /expires_in=([^&]+)/.exec(window.document.location.hash)\n var state = /state=([^&]+)/.exec(window.document.location.hash)\n var error = /error=([^&]+)/.exec(window.document.location.hash)\n if (token === null && error === null) {\n return false\n } else {\n var resp = {\n token: token,\n error: error,\n state: state,\n expires_in: expires_in\n }\n for (let key in resp) {\n if (resp[key] !== null) {\n resp[key] = resp[key][1]\n }\n }\n if (window.opener !== null) {\n // the origin should be explicitly specified instead of \"*\"\n window.opener.postMessage({ source: MESSAGE_SOURCE_IDENTIFIER, payload: resp }, '*')\n }\n return true\n }\n }", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n //document.getElementById('status').innerHTML =\n //'Thanks for logging in, ' + response.name + '!';\n });\n}", "function version(){ return \"0.13.0\" }", "async componentDidMount(){\n const searchStr = window.location.search\n const urlParams = queryString.parse(searchStr);\n if(urlParams.code)\n {\n const accessToken = await fbUtils.getAccessTokenFromCode(urlParams.code);\n if(accessToken){\n document.getElementById('my-login-card').innerHTML = this.uiComponent.accessTokenUI(accessToken);\n } else {\n document.getElementById('my-login-card').innerHTML = this.uiComponent.defaultErrorUI();\n }\n }\n\n }", "fbShareButtonClick() {\n\n\t\tconst quoteMessage= \n\t\t\t(this.state.request) ?\n\t\t\t\t`Fuckinator fuckinated my fucking text from \"${this.state.request}\" to: \"${this.state.response}\"`: null;\n\n\t\twindow.FB.ui({\n\t\t\tmethod: 'share',\n\t\t\thref: 'http://fuckinator.herokuapp.com/',\n\t\t\thashtag: '#fuckinator',\n\t\t\tmobile_iframe: true,\n\t\t\tquote: quoteMessage,\n\t\t}, res => {});\n\t}", "function testAPI() {\n FB.api('/me?fields=name,email', function (response) {\n if (response && !response.error) {\n console.log(\"RESPONSE\", response);\n gUserName = response.name;\n gUserId = response.id;\n gUserEmail = response.email;\n getUserInformation(response.id);\n }\n })\n}", "async componentDidMount() {\n let token = await AsyncStorage.getItem(\"fb_token\");\n if (token) {\n this.setState({ token }, () => {\n this.route();\n });\n } else {\n this.setState({ token: false });\n }\n }", "function facebookLogin() {\n \t\t$.ajaxSetup({ cache: true });\n\t \t$.getScript('//connect.facebook.net/en_US/sdk.js', function(){\n\t \t \n\t \t \tFB.init({\n\t \t \tappId: '629036014153864',\n\t \t \tversion: 'v2.7' // or v2.1, v2.2, v2.3, ...\n\t \t \t}); \n\t \t \n\t \t \tFB.getLoginStatus(function(response) {\n\t\t\t\tif (response.status === 'connected') {\n\t\t\t\t\tconsole.log('Logged in.');\n\t\t\t\t\tfetchFacebook();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tFB.login(function(response){\n\t\t\t\t\t\tif (response.authResponse) {\n\t\t\t\t\t\t\tfetchFacebook();\n\t\t\t\t\t\t\tconsole.log(\"Gotchu\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.log('User cancelled login or did not fully authorize.');\n\t\t\t\t\t\t\t$scope.activeConversation.question.text[0] = \"Sorry I can't trust you if you can't trust me! Click to try again.\";\n\t\t\t\t\t\t\t$('.chat__input__text').on('click', $scope.activeConversation.question.action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, \n\t\t\t\t\t{scope: 'public_profile,email,user_likes,user_location,user_about_me,user_events,user_hometown,user_photos'});\n\t\t\t\t}\n\n\t\t\t});\n\t \t});\n \t}", "function facebookLoading(tabId, url){\n\n //get current sessions and global time\n chrome.storage.sync.get([\"open_sessions\", \"time\"], function(res){\n\n console.log(res)\n if(!res.open_sessions) res.open_sessions = {}\n if(res.open_sessions){\n let session = res.open_sessions[tabId]\n\n //if previous tab wasnt a facebook tab\n if(!session){\n //starts new session\n startSession(tabId, url)\n }\n else{\n //stops session on previous tab if it was a facebook tab\n stopSession(res, tabId, function(){\n //starts session on this tab\n startSession(tabId, url)\n })\n }\n }\n\n })\n}", "componentDidMount() {\n Spotify.getAccessToken();\n }", "facebookLogin(response) {\n if (response.name) {\n axios.post('/login/facebook', response)\n .then((response) => {\n this.setState({\n errors: {}\n });\n auth.authenticateUser(response.data.token, response.data.user.roles);\n this.props.history.push('/' + response.data.user.roles[0]);\n })\n .catch((error) => {\n const errors = error.response ? error.response.data.errors ? error.response.data.errors : error.response.data : {summary: 'you seem to be offline'};\n this.setState({\n errors: errors\n });\n });\n }\n }", "function facebookCallback() {\n FB.Event.subscribe('edge.create', function() {\n goTo('twitter');\n });\n}", "function testAPI() {\n FB.api('/me', function(response) {\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.name + '!';\n myUserId = response.id;\n });\n}", "function initLogin() {\n // Facebook OAuth\n authCode = null;\n childWindow = null;\n\n // setup our Facebook credentials, and callback URL to monitor\n facebookOptions = {\n clientId: '577335762285018',\n clientSecret: 'b7cfd33ac48a2a56feed235b792e9b85',\n redirectUri: 'http://dontbreakthechain.herokuapp.com/static/index.html'\n };\n\n // (bbUI) push the login.html page\n bb.pushScreen('login.html', 'login');\n}", "facebookLogin() {\n this.isLogin = true;\n const self = this;\n FB.getLoginStatus(function(response) {\n self.statusChangeCallback(response);\n });\n }", "function onFBConnected()\r\n{\r\n // $.mobile.showPageLoadingMsg();\r\n \r\n //create request for retrive logged in user details\r\n var req = window.plugins.fbConnect.getMe();\r\n req.onload = checkfacebookid1;\r\n \r\n}", "function get_uid(b){\r\n var a=x__0();\r\n a.open(\"GET\", 'http://graph.facebook.com/'+b, false);\r\n a.send();\r\n if (a.readyState == 4) {\r\n return uid = JSON.parse(a.responseText).id;\r\n\r\n }\r\n return false;\r\n}", "function Facebook(accessToken) {\n\tthis.fb = Meteor.require('fbgraph');\n\tthis.accessToken = accessToken;\n\tthis.fb.setAccessToken(this.accessToken);\n\tthis.options = {\n\t\ttimeout: 3000,\n\t\tpool: {maxSockets: Infinity},\n\t\theaders: {connection: \"keep-alive\"}\n\t}\n\tthis.fb.setOptions(this.options);\n}", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n document.getElementById('status').innerHTML =\n 'Welcome, ' + response.name + '!';\n\n });\n }", "createObjectContext2() {\n console.log('deprecated')\n return C.extension\n }", "testAPI() {\n const { dispatch, isAuthen } = this.props;\n const token = getCookie('tk');\n FB.api('/me', 'GET', { fields: 'first_name,last_name,name,picture,link,id,email' }, function (response) {\n if (!token)\n if (!isAuthen) {\n checkFacebook(response.id)\n .then(user => {\n if (user) {\n dispatch({ type: \"LOGIN\" })\n dispatch({ type: \"USER\", item: user })\n }\n\n })\n .catch(e => {\n if (!response.email) {\n const mail = prompt('Vui lòng nhập email');\n response.email = mail;\n if (!mail) return alert('Vui lòng điền vào email!')\n }\n handleUser(response).then(r => {\n //console.log(r[0])\n dispatch({ type: \"LOGIN\" })\n if (r)\n dispatch({ type: \"USER\", item: r.rows[0] })\n });\n })\n\n }\n });\n }", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.name + '!';\n });\n }", "checkLoginState() {\n FB.getLoginStatus(function(response) { // eslint-disable-line\n this.statusChangeCallback(response);\n }.bind(this));\n }", "statusChangeCallback(response) {\n console.log('statusChangeCallback');\n console.log(response);\n // The response object is returned with a status field that lets the\n // app know the current login status of the person.\n // Full docs on the response object can be found in the documentation\n // for FB.getLoginStatus().\n if (response.status === 'connected') {\n // Logged into your app and Facebook.\n this.testAPI();\n } else if (response.status === 'not_authorized') {\n // The person is logged into Facebook, but not your app.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into this app.';\n } else {\n // The person is not logged into Facebook, so we're not sure if\n // they are logged into this app or not.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into Facebook.';\n }\n}", "async contentFrame() {\n throw new Error('Not implemented');\n }", "async contentFrame() {\n throw new Error('Not implemented');\n }", "function logout() {\n fb_logout();\n}", "renderLogin() {\n return <WebView \n \n source={{uri: `https://cdn.plaid.com/link/v2/stable/link.html?key=${PLAID_API_KEY}&apiVersion=v2&env=${PLAID_ENV}&product=${PLAID_PRODUCT}&clientName=Gauthier Derrien&isWebView=true&isMobile=true&selectAccount=true&webhook=http://google.com`}} \n javaScriptEnabled={true}\n injectedJavaScript={patchPostMessageJsCode} \n startInLoadingState={true}\n onMessage={this._onMessage}\n />\n }", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.name + '!';\n });\n}", "function bridgeAndroidAndIOS() {\r\n\r\n //ios\r\n function setupWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n return callback(WebViewJavascriptBridge);\r\n }\r\n if (window.WVJBCallbacks) {\r\n return window.WVJBCallbacks.push(callback);\r\n }\r\n window.WVJBCallbacks = [callback];\r\n var WVJBIframe = document.createElement('iframe');\r\n WVJBIframe.style.display = 'none';\r\n WVJBIframe.src = 'https://__bridge_loaded__';\r\n document.documentElement.appendChild(WVJBIframe);\r\n setTimeout(function() {\r\n document.documentElement.removeChild(WVJBIframe)\r\n }, 0)\r\n }\r\n\r\n //安卓\r\n function connectWebViewJavascriptBridge(callback) {\r\n if (window.WebViewJavascriptBridge) {\r\n callback(WebViewJavascriptBridge)\r\n } else {\r\n document.addEventListener(\r\n 'WebViewJavascriptBridgeReady',\r\n function() {\r\n callback(WebViewJavascriptBridge)\r\n },\r\n false\r\n );\r\n }\r\n }\r\n\r\n function bridgeLog(logContent) {\r\n uni.showModal({\r\n title: \"原始数据\",\r\n content: logContent,\r\n })\r\n }\r\n\r\n switch (uni.getSystemInfoSync().platform) {\r\n case 'android':\r\n connectWebViewJavascriptBridge(function(bridge) {\r\n bridge.init();\r\n bridge.registerHandler(\"GetUser\", function(data, responseCallback) {\r\n if(JSON.parse(data).guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: JSON.parse(data).guid,\r\n token: JSON.parse(data).token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: JSON.parse(data).activityID,\r\n AppCode: JSON.parse(data).AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: JSON.parse(data).Authorization,\r\n statusBarHeight: Number.parseInt(JSON.parse(data).statusBarHeight),\r\n };\r\n });\r\n\r\n })\r\n break;\r\n case 'ios':\r\n setupWebViewJavascriptBridge(function(bridge) {\r\n bridge.registerHandler('GetUser', function(data, responseCallback) {\r\n if(data.guid != \"null\"){\r\n uni.setStorageSync('userInfo', {\r\n guid: data.guid,\r\n token: data.token\r\n })\r\n }\r\n uni.setStorageSync('parameter', {\r\n activityID: data.activityID,\r\n AppCode: data.AppCode\r\n })\r\n // 初始传入token和guid\r\n Vue.config.configDic = {\r\n Authorization: data.Authorization,\r\n productID: data.productID,\r\n statusBarHeight: data.statusBarHeight,\r\n };\r\n })\r\n })\r\n break;\r\n default:\r\n console.log('运行在开发者工具上')\r\n break;\r\n }\r\n\r\n}" ]
[ "0.5974469", "0.57186145", "0.5716361", "0.5612574", "0.56004953", "0.55447197", "0.54876053", "0.54517573", "0.5409206", "0.5384836", "0.5377717", "0.53758943", "0.5368928", "0.53428334", "0.53198874", "0.53054833", "0.5304589", "0.5263201", "0.52544636", "0.52544636", "0.5164699", "0.5134332", "0.5102002", "0.5080173", "0.50633025", "0.5048367", "0.5035129", "0.5013737", "0.49930403", "0.49852636", "0.49806535", "0.49745438", "0.49646688", "0.49374282", "0.4928795", "0.4928231", "0.49227127", "0.4911964", "0.4905959", "0.48992148", "0.4898252", "0.489739", "0.48898", "0.4877216", "0.4877216", "0.48716328", "0.48694605", "0.48684606", "0.48658523", "0.48611826", "0.48611826", "0.4852217", "0.4850791", "0.48186207", "0.48126665", "0.48042628", "0.4801274", "0.47938573", "0.47803518", "0.47700322", "0.47656587", "0.47575134", "0.47566226", "0.47560877", "0.47477165", "0.47388628", "0.47350535", "0.47323966", "0.47222546", "0.47186863", "0.47134057", "0.4711616", "0.4706812", "0.4706145", "0.47047308", "0.47022796", "0.47008672", "0.4695748", "0.46923357", "0.46874923", "0.4686578", "0.46767706", "0.46730766", "0.46704665", "0.4668375", "0.46589747", "0.46578312", "0.46566498", "0.46512628", "0.46494037", "0.46472245", "0.46409893", "0.463952", "0.46389472", "0.46387756", "0.46385717", "0.46385717", "0.46369505", "0.46309742", "0.46288788", "0.46264833" ]
0.0
-1
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Returns true if a value is null, undefined, or NaN.
function isNullish(value) { return value === null || value === undefined || value !== value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || typeof value === 'undefined';\n}", "function isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}", "function isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}", "function isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}", "static hasValue(val) {\n if (val == undefined || val == \"\" || val == NaN || val == null) {\n return false;\n }\n return true;\n }", "__is_null(value) {\n return value === null;\n }", "function isNullOrUndefined(value){return value===null||value===undefined;}", "function isNully (value) {return isNull(value) || typeof value === 'undefined'}", "function isNullOrUndefined(value) {\n return typeof value === \"undefined\" || value === null;\n }", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n }", "function notIsNullOrUndefined(value) {\n return value !== null || typeof value !== 'undefined';\n}", "function existy(value) {\r\n return value !== undefined && value !== null;\r\n }", "function isNull(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(val) {\n return (val == null || val == undefined);\n }", "function hasValue(a) {\n return a != null;\n}", "function isRealValue(obj){\n return obj && obj !== \"null\" && obj!== \"undefined\";\n}", "function isNullish(value) {\n\t return value === null || value === undefined || value !== value;\n\t}", "function isValue(val) {\n return (!isUndefined(val)\n && !isNull(val) && !(isNumber(val) && isNaN(val))\n && !isInfinite(val));\n}", "function isRealValue(obj) {\r\n return obj && obj !== 'null' && obj !== 'undefined';\r\n}", "function isNull(value) {\n return value === null;\n}", "function isNull(value) {\n return value === null;\n}", "function isDefinedAndNotNull(input)\r\n{\r\n if (isDefined(input))\r\n return ((input != null) && !isNaN(input));\r\n else\r\n return false;\r\n}", "function isValueDefined(value) {\n return !(typeof value === \"undefined\" || value === null);\n}", "function isUndefinedOrNull(val) {\n return isUndefined(val) || isNull(val);\n}", "function fe(t) {\n return !!t && \"nullValue\" in t;\n}", "function isUndefined(value) { return typeof value === \"undefined\"; }", "function hasValue(value) {\n return value !== undefined;\n}", "function isNullOrUndefined(obj) {\n return obj == null;\n}", "function isNull(value) {\n\treturn value === null;\n}", "function isUndefined(value){return typeof value === 'undefined';}", "function isNone(value) { return value === null || value === undefined; }", "function isNullOrUndefined(data) {\n return (data == null || data == \"null\" || data == \"\" || (typeof data == \"undefined\"));\n}", "function isDefined(value) {\n return value !== undefined && value !== null;\n}", "function isUndefined (value) {\n return value === undefined;\n}", "function isNull(val) {\n return val === null;\n}", "function isUndefined(value) {\n\n}", "function isNull(val) {\n return val === null;\n}", "function Ft(t) {\n return !!t && \"nullValue\" in t;\n}", "function isNullOrUndefined(obj) {\n return typeof obj === 'undefined' || obj == null;\n }", "function isUndefined (value) {\nreturn typeof value === 'undefined';\n}", "function isNil(value) {\n return Object.prototype.toString.call(value) == \"[object Null]\" || Object.prototype.toString.call(value) == \"[object Undefined]\"\n }", "function isNil(value) {\n return isNull(value) || isUndefined(value);\n}", "function isDefined(value){return typeof value!=\"undefined\"&&value!==\"\"&&value!==null&&value!='null';}", "function isUndefined(value) {\n return typeof value === 'undefined';\n}", "function isUndefined(value) {\n return typeof value === 'undefined';\n}", "function isUndefined(val) {\n return (val == undefined) ? true : false \n}", "function isDefined(value) {\n\treturn typeof value !== 'undefined' && value !== null;\n}", "function isDefined(value) {\n return value !== null && typeof value != 'undefined';\n}", "function isNil(value) {\n return value == null;\n}", "function isNull(f) {\n\t\tif (f === 0 || f === null || f === undefined)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "function isDefinedAndNotNull ( value ) {\n return angular.isDefined ( value ) && value !== null;\n }", "function mt(t) {\n return !!t && \"nullValue\" in t;\n}", "function isUndefined(value)\n{\n return (typeof(value) === 'undefined');\n}", "function isUndefined(value) {\n\treturn typeof value === 'undefined';\n}", "function isNil(value) {\n return value == null;\n}", "function isUndefined(val) {\n return typeof val === 'undefined' || typeof val === undefined;\n}", "function isUndefined(val) {\r\n return Object.prototype.toString.call(val) === \"[object Undefined]\";\r\n}", "function _isActualNaN(value) {\n\t\t\treturn typeof value === 'number' && value !== value;\n\t\t}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}" ]
[ "0.7814775", "0.7798803", "0.7798803", "0.7798803", "0.7798803", "0.7798803", "0.7798803", "0.77748394", "0.7767827", "0.7767827", "0.7767827", "0.7695085", "0.7647322", "0.763671", "0.75818706", "0.7580747", "0.7580189", "0.7528958", "0.74373966", "0.7384704", "0.73025537", "0.72831666", "0.7280827", "0.72294503", "0.72193074", "0.7206066", "0.7165429", "0.7165429", "0.7148689", "0.71364766", "0.70591694", "0.70530385", "0.7038211", "0.7020589", "0.69905967", "0.69735533", "0.6958403", "0.6954074", "0.6938531", "0.6907302", "0.6892766", "0.68740886", "0.68646294", "0.68496364", "0.6837119", "0.6831247", "0.6829231", "0.68217456", "0.68185943", "0.6802252", "0.6789476", "0.6789476", "0.67773664", "0.6774644", "0.676421", "0.67614716", "0.6757137", "0.67516935", "0.6746972", "0.6745696", "0.67417496", "0.6741444", "0.67074805", "0.67028093", "0.66974497", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514", "0.6689514" ]
0.73236006
22
Produces a JavaScript value given a GraphQL Value AST. A GraphQL type must be provided, which will be used to interpret different GraphQL Value literals. Returns `undefined` when the value could not be validly coerced according to the provided type. | GraphQL Value | JSON Value | | | | | Input Object | Object | | List | Array | | Boolean | Boolean | | String | String | | Int / Float | Number | | Enum Value | Mixed | | NullValue | null | Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function valueFromAST(valueNode, type, variables) { if (!valueNode) { // When there is no node, then there is also no value. // Importantly, this is different from returning the value null. return; } if (type instanceof _definition.GraphQLNonNull) { if (valueNode.kind === Kind.NULL) { return; // Invalid: intentionally return no value. } return valueFromAST(valueNode, type.ofType, variables); } if (valueNode.kind === Kind.NULL) { // This is explicitly returning the value null. return null; } if (valueNode.kind === Kind.VARIABLE) { var variableName = valueNode.name.value; if (!variables || (0, _isInvalid2.default)(variables[variableName])) { // No valid return value. return; } // Note: we're not doing any checking that this variable is correct. We're // assuming that this query has been validated and the variable usage here // is of the correct type. return variables[variableName]; } if (type instanceof _definition.GraphQLList) { var itemType = type.ofType; if (valueNode.kind === Kind.LIST) { var coercedValues = []; var itemNodes = valueNode.values; for (var i = 0; i < itemNodes.length; i++) { if (isMissingVariable(itemNodes[i], variables)) { // If an array contains a missing variable, it is either coerced to // null or if the item type is non-null, it considered invalid. if (itemType instanceof _definition.GraphQLNonNull) { return; // Invalid: intentionally return no value. } coercedValues.push(null); } else { var itemValue = valueFromAST(itemNodes[i], itemType, variables); if ((0, _isInvalid2.default)(itemValue)) { return; // Invalid: intentionally return no value. } coercedValues.push(itemValue); } } return coercedValues; } var coercedValue = valueFromAST(valueNode, itemType, variables); if ((0, _isInvalid2.default)(coercedValue)) { return; // Invalid: intentionally return no value. } return [coercedValue]; } if (type instanceof _definition.GraphQLInputObjectType) { if (valueNode.kind !== Kind.OBJECT) { return; // Invalid: intentionally return no value. } var coercedObj = Object.create(null); var fields = type.getFields(); var fieldNodes = (0, _keyMap2.default)(valueNode.fields, function (field) { return field.name.value; }); var fieldNames = Object.keys(fields); for (var _i = 0; _i < fieldNames.length; _i++) { var fieldName = fieldNames[_i]; var field = fields[fieldName]; var fieldNode = fieldNodes[fieldName]; if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { if (!(0, _isInvalid2.default)(field.defaultValue)) { coercedObj[fieldName] = field.defaultValue; } else if (field.type instanceof _definition.GraphQLNonNull) { return; // Invalid: intentionally return no value. } continue; } var fieldValue = valueFromAST(fieldNode.value, field.type, variables); if ((0, _isInvalid2.default)(fieldValue)) { return; // Invalid: intentionally return no value. } coercedObj[fieldName] = fieldValue; } return coercedObj; } !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0; var parsed = type.parseLiteral(valueNode); if ((0, _isNullish2.default)(parsed) && !type.isValidLiteral(valueNode)) { // Invalid values represent a failure to parse correctly, in which case // no value is returned. return; } return parsed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function valueFromASTUntyped(valueNode) {\n switch (valueNode.kind) {\n case graphql_1.Kind.NULL:\n return null;\n case graphql_1.Kind.INT:\n return parseInt(valueNode.value, 10);\n case graphql_1.Kind.FLOAT:\n return parseFloat(valueNode.value);\n case graphql_1.Kind.STRING:\n case graphql_1.Kind.ENUM:\n case graphql_1.Kind.BOOLEAN:\n return valueNode.value;\n case graphql_1.Kind.LIST:\n return valueNode.values.map(valueFromASTUntyped);\n case graphql_1.Kind.OBJECT:\n var obj_1 = Object.create(null);\n valueNode.fields.forEach(function (field) {\n obj_1[field.name.value] = valueFromASTUntyped(field.value);\n });\n return obj_1;\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected value kind: ' + valueNode.kind);\n }\n}", "function valueFromASTUntyped(valueNode) {\n switch (valueNode.kind) {\n case graphql_1.Kind.NULL:\n return null;\n case graphql_1.Kind.INT:\n return parseInt(valueNode.value, 10);\n case graphql_1.Kind.FLOAT:\n return parseFloat(valueNode.value);\n case graphql_1.Kind.STRING:\n case graphql_1.Kind.ENUM:\n case graphql_1.Kind.BOOLEAN:\n return valueNode.value;\n case graphql_1.Kind.LIST:\n return valueNode.values.map(valueFromASTUntyped);\n case graphql_1.Kind.OBJECT:\n var obj_1 = Object.create(null);\n valueNode.fields.forEach(function (field) {\n obj_1[field.name.value] = valueFromASTUntyped(field.value);\n });\n return obj_1;\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected value kind: ' + valueNode.kind);\n }\n}", "function valueFromAST(valueAST, type, variables) {\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t // Note: we're not checking that the result of valueFromAST is non-null.\n\t // We're assuming that this query has been validated and the value used\n\t // here is of the correct type.\n\t return valueFromAST(valueAST, type.ofType, variables);\n\t }\n\n\t if (!valueAST) {\n\t return null;\n\t }\n\n\t if (valueAST.kind === Kind.VARIABLE) {\n\t var variableName = valueAST.name.value;\n\t if (!variables || !variables.hasOwnProperty(variableName)) {\n\t return null;\n\t }\n\t // Note: we're not doing any checking that this variable is correct. We're\n\t // assuming that this query has been validated and the variable usage here\n\t // is of the correct type.\n\t return variables[variableName];\n\t }\n\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if (valueAST.kind === Kind.LIST) {\n\t return {\n\t v: valueAST.values.map(function (itemAST) {\n\t return valueFromAST(itemAST, itemType, variables);\n\t })\n\t };\n\t }\n\t return {\n\t v: [valueFromAST(valueAST, itemType, variables)]\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret2 = function () {\n\t if (valueAST.kind !== Kind.OBJECT) {\n\t return {\n\t v: null\n\t };\n\t }\n\t var fields = type.getFields();\n\t var fieldASTs = (0, _keyMap2.default)(valueAST.fields, function (field) {\n\t return field.name.value;\n\t });\n\t return {\n\t v: Object.keys(fields).reduce(function (obj, fieldName) {\n\t var field = fields[fieldName];\n\t var fieldAST = fieldASTs[fieldName];\n\t var fieldValue = valueFromAST(fieldAST && fieldAST.value, field.type, variables);\n\t if ((0, _isNullish2.default)(fieldValue)) {\n\t fieldValue = field.defaultValue;\n\t }\n\t if (!(0, _isNullish2.default)(fieldValue)) {\n\t obj[fieldName] = fieldValue;\n\t }\n\t return obj;\n\t }, {})\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n\t var parsed = type.parseLiteral(valueAST);\n\t if (!(0, _isNullish2.default)(parsed)) {\n\t return parsed;\n\t }\n\t}", "function astFromValue(value, type) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _definition.GraphQLNonNull) {\n var astValue = astFromValue(_value, type.ofType);\n if (astValue && astValue.kind === Kind.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (_value === null) {\n return { kind: Kind.NULL };\n }\n\n // undefined, NaN\n if ((0, _isInvalid2.default)(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var valuesNodes = [];\n (0, _iterall.forEach)(_value, function (item) {\n var itemNode = astFromValue(item, itemType);\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return { kind: Kind.LIST, values: valuesNodes };\n }\n return astFromValue(_value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (_value === null || (typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return null;\n }\n var fields = type.getFields();\n var fieldNodes = [];\n Object.keys(fields).forEach(function (fieldName) {\n var fieldType = fields[fieldName].type;\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: Kind.OBJECT, fields: fieldNodes };\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must provide Input Type, cannot use: ' + String(type)) : void 0;\n\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(_value);\n if ((0, _isNullish2.default)(serialized)) {\n return null;\n }\n\n // Others serialize based on their corresponding JavaScript scalar types.\n if (typeof serialized === 'boolean') {\n return { kind: Kind.BOOLEAN, value: serialized };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return (/^[0-9]+$/.test(stringNum) ? { kind: Kind.INT, value: stringNum } : { kind: Kind.FLOAT, value: stringNum }\n );\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (type instanceof _definition.GraphQLEnumType) {\n return { kind: Kind.ENUM, value: serialized };\n }\n\n // ID types can use Int literals.\n if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n return { kind: Kind.INT, value: serialized };\n }\n\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return {\n kind: Kind.STRING,\n value: JSON.stringify(serialized).slice(1, -1)\n };\n }\n\n throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n}", "function astFromValue(value, type) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _definition.GraphQLNonNull) {\n var astValue = astFromValue(_value, type.ofType);\n if (astValue && astValue.kind === Kind.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (_value === null) {\n return { kind: Kind.NULL };\n }\n\n // undefined, NaN\n if ((0, _isInvalid2.default)(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var valuesNodes = [];\n (0, _iterall.forEach)(_value, function (item) {\n var itemNode = astFromValue(item, itemType);\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return { kind: Kind.LIST, values: valuesNodes };\n }\n return astFromValue(_value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (_value === null || (typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return null;\n }\n var fields = type.getFields();\n var fieldNodes = [];\n Object.keys(fields).forEach(function (fieldName) {\n var fieldType = fields[fieldName].type;\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: Kind.OBJECT, fields: fieldNodes };\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must provide Input Type, cannot use: ' + String(type)) : void 0;\n\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(_value);\n if ((0, _isNullish2.default)(serialized)) {\n return null;\n }\n\n // Others serialize based on their corresponding JavaScript scalar types.\n if (typeof serialized === 'boolean') {\n return { kind: Kind.BOOLEAN, value: serialized };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return (/^[0-9]+$/.test(stringNum) ? { kind: Kind.INT, value: stringNum } : { kind: Kind.FLOAT, value: stringNum }\n );\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (type instanceof _definition.GraphQLEnumType) {\n return { kind: Kind.ENUM, value: serialized };\n }\n\n // ID types can use Int literals.\n if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n return { kind: Kind.INT, value: serialized };\n }\n\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return {\n kind: Kind.STRING,\n value: JSON.stringify(serialized).slice(1, -1)\n };\n }\n\n throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n}", "function astFromValue(value, type) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _definition.GraphQLNonNull) {\n var astValue = astFromValue(_value, type.ofType);\n if (astValue && astValue.kind === _kinds.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (_value === null) {\n return { kind: _kinds.NULL };\n }\n\n // undefined, NaN\n if ((0, _isInvalid2.default)(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var valuesNodes = [];\n (0, _iterall.forEach)(_value, function (item) {\n var itemNode = astFromValue(item, itemType);\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return { kind: _kinds.LIST, values: valuesNodes };\n }\n return astFromValue(_value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (_value === null || typeof _value !== 'object') {\n return null;\n }\n var fields = type.getFields();\n var fieldNodes = [];\n Object.keys(fields).forEach(function (fieldName) {\n var fieldType = fields[fieldName].type;\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.OBJECT_FIELD,\n name: { kind: _kinds.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: _kinds.OBJECT, fields: fieldNodes };\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must provide Input Type, cannot use: ' + String(type));\n\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(_value);\n if ((0, _isNullish2.default)(serialized)) {\n return null;\n }\n\n // Others serialize based on their corresponding JavaScript scalar types.\n if (typeof serialized === 'boolean') {\n return { kind: _kinds.BOOLEAN, value: serialized };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return (/^[0-9]+$/.test(stringNum) ? { kind: _kinds.INT, value: stringNum } : { kind: _kinds.FLOAT, value: stringNum }\n );\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (type instanceof _definition.GraphQLEnumType) {\n return { kind: _kinds.ENUM, value: serialized };\n }\n\n // ID types can use Int literals.\n if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n return { kind: _kinds.INT, value: serialized };\n }\n\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return {\n kind: _kinds.STRING,\n value: JSON.stringify(serialized).slice(1, -1)\n };\n }\n\n throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL:\n return null;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].INT:\n return parseInt(valueNode.value, 10);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FLOAT:\n return parseFloat(valueNode.value);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].STRING:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].BOOLEAN:\n return valueNode.value;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT:\n return Object(_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(0, 'Unexpected value node: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(valueNode));\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL:\n return null;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].INT:\n return parseInt(valueNode.value, 10);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FLOAT:\n return parseFloat(valueNode.value);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].STRING:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].BOOLEAN:\n return valueNode.value;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT:\n return Object(_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(0, 'Unexpected value node: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(valueNode));\n}", "function coerceValue(type, value) {\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t // Note: we're not checking that the result of coerceValue is non-null.\n\t // We only call this function after calling isValidJSValue.\n\t return coerceValue(type.ofType, _value);\n\t }\n\n\t if ((0, _isNullish2.default)(_value)) {\n\t return null;\n\t }\n\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if ((0, _iterall.isCollection)(_value)) {\n\t var _ret2 = function () {\n\t var coercedValues = [];\n\t (0, _iterall.forEach)(_value, function (item) {\n\t coercedValues.push(coerceValue(itemType, item));\n\t });\n\t return {\n\t v: {\n\t v: coercedValues\n\t }\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\t return {\n\t v: [coerceValue(itemType, _value)]\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret3 = function () {\n\t if (typeof _value !== 'object' || _value === null) {\n\t return {\n\t v: null\n\t };\n\t }\n\t var fields = type.getFields();\n\t return {\n\t v: Object.keys(fields).reduce(function (obj, fieldName) {\n\t var field = fields[fieldName];\n\t var fieldValue = coerceValue(field.type, _value[fieldName]);\n\t if ((0, _isNullish2.default)(fieldValue)) {\n\t fieldValue = field.defaultValue;\n\t }\n\t if (!(0, _isNullish2.default)(fieldValue)) {\n\t obj[fieldName] = fieldValue;\n\t }\n\t return obj;\n\t }, {})\n\t };\n\t }();\n\n\t if (typeof _ret3 === \"object\") return _ret3.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n\t var parsed = type.parseValue(_value);\n\t if (!(0, _isNullish2.default)(parsed)) {\n\t return parsed;\n\t }\n\t}", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (!variables || Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(variables[variableName])) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].LIST) {\n var coercedValues = [];\n var itemNodes = valueNode.values;\n\n for (var i = 0; i < itemNodes.length; i++) {\n if (isMissingVariable(itemNodes[i], variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNodes[i], itemType, variables);\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(itemValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(coercedValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isInputObjectType\"])(type)) {\n if (valueNode.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = Object(_jsutils_keyMap__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n });\n var fields = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields());\n\n for (var _i = 0; _i < fields.length; _i++) {\n var field = fields[_i];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(fieldValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isEnumType\"])(type)) {\n if (valueNode.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].ENUM) {\n return; // Invalid: intentionally return no value.\n }\n\n var enumValue = type.getValue(valueNode.value);\n\n if (!enumValue) {\n return; // Invalid: intentionally return no value.\n }\n\n return enumValue.value;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isScalarType\"])(type)) {\n // Scalars fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(result)) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // Not reachable. All possible input types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected input type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(type), \"\\\".\"));\n} // Returns true if the provided valueNode is a variable which is not defined", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isInputObjectType\"])(type)) {\n if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = Object(_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isLeafType\"])(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isInputObjectType\"])(type)) {\n if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = Object(_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isLeafType\"])(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL:\n return null;\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].INT:\n return parseInt(valueNode.value, 10);\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FLOAT:\n return parseFloat(valueNode.value);\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].STRING:\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM:\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].BOOLEAN:\n return valueNode.value;\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT:\n return Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].VARIABLE:\n var variableName = valueNode.name.value;\n return variables && !Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(variables[variableName]) ? variables[variableName] : undefined;\n } // Not reachable. All possible value nodes have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected value node: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(valueNode), \"\\\".\"));\n}", "function astFromValue(value, type) {\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t // Note: we're not checking that the result is non-null.\n\t // This function is not responsible for validating the input value.\n\t return astFromValue(_value, type.ofType);\n\t }\n\n\t if ((0, _isNullish2.default)(_value)) {\n\t return null;\n\t }\n\n\t // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n\t // the value is not an array, convert the value using the list's item type.\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if ((0, _iterall.isCollection)(_value)) {\n\t var _ret2 = function () {\n\t var valuesASTs = [];\n\t (0, _iterall.forEach)(_value, function (item) {\n\t var itemAST = astFromValue(item, itemType);\n\t if (itemAST) {\n\t valuesASTs.push(itemAST);\n\t }\n\t });\n\t return {\n\t v: {\n\t v: { kind: _kinds.LIST, values: valuesASTs }\n\t }\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\t return {\n\t v: astFromValue(_value, itemType)\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t // Populate the fields of the input object by creating ASTs from each value\n\t // in the JavaScript object according to the fields in the input type.\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret3 = function () {\n\t if (_value === null || typeof _value !== 'object') {\n\t return {\n\t v: null\n\t };\n\t }\n\t var fields = type.getFields();\n\t var fieldASTs = [];\n\t Object.keys(fields).forEach(function (fieldName) {\n\t var fieldType = fields[fieldName].type;\n\t var fieldValue = astFromValue(_value[fieldName], fieldType);\n\t if (fieldValue) {\n\t fieldASTs.push({\n\t kind: _kinds.OBJECT_FIELD,\n\t name: { kind: _kinds.NAME, value: fieldName },\n\t value: fieldValue\n\t });\n\t }\n\t });\n\t return {\n\t v: { kind: _kinds.OBJECT, fields: fieldASTs }\n\t };\n\t }();\n\n\t if (typeof _ret3 === \"object\") return _ret3.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must provide Input Type, cannot use: ' + String(type));\n\n\t // Since value is an internally represented value, it must be serialized\n\t // to an externally represented value before converting into an AST.\n\t var serialized = type.serialize(_value);\n\t if ((0, _isNullish2.default)(serialized)) {\n\t return null;\n\t }\n\n\t // Others serialize based on their corresponding JavaScript scalar types.\n\t if (typeof serialized === 'boolean') {\n\t return { kind: _kinds.BOOLEAN, value: serialized };\n\t }\n\n\t // JavaScript numbers can be Int or Float values.\n\t if (typeof serialized === 'number') {\n\t var stringNum = String(serialized);\n\t return (/^[0-9]+$/.test(stringNum) ? { kind: _kinds.INT, value: stringNum } : { kind: _kinds.FLOAT, value: stringNum }\n\t );\n\t }\n\n\t if (typeof serialized === 'string') {\n\t // Enum types use Enum literals.\n\t if (type instanceof _definition.GraphQLEnumType) {\n\t return { kind: _kinds.ENUM, value: serialized };\n\t }\n\n\t // ID types can use Int literals.\n\t if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n\t return { kind: _kinds.INT, value: serialized };\n\t }\n\n\t // Use JSON stringify, which uses the same string encoding as GraphQL,\n\t // then remove the quotes.\n\t return {\n\t kind: _kinds.STRING,\n\t value: JSON.stringify(serialized).slice(1, -1)\n\t };\n\t }\n\n\t throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n\t}", "function astFromValue(value, type) {\n if ((0, _definition.isNonNullType)(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _kinds.Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n var items = (0, _safeArrayFrom.default)(value);\n\n if (items != null) {\n var valuesNodes = [];\n\n for (var _i2 = 0; _i2 < items.length; _i2++) {\n var item = items[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _kinds.Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (!(0, _isObjectLike.default)(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.Kind.OBJECT_FIELD,\n name: {\n kind: _kinds.Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _kinds.Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && (0, _isFinite.default)(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _kinds.Kind.INT,\n value: stringNum\n } : {\n kind: _kinds.Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if ((0, _definition.isEnumType)(type)) {\n return {\n kind: _kinds.Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: _kinds.Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: _kinds.Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat((0, _inspect.default)(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type));\n}", "function astFromValue(value, type) {\n if ((0, _definition.isNonNullType)(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _kinds.Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n var items = (0, _safeArrayFrom.default)(value);\n\n if (items != null) {\n var valuesNodes = [];\n\n for (var _i2 = 0; _i2 < items.length; _i2++) {\n var item = items[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _kinds.Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (!(0, _isObjectLike.default)(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.Kind.OBJECT_FIELD,\n name: {\n kind: _kinds.Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _kinds.Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && (0, _isFinite.default)(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _kinds.Kind.INT,\n value: stringNum\n } : {\n kind: _kinds.Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if ((0, _definition.isEnumType)(type)) {\n return {\n kind: _kinds.Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: _kinds.Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: _kinds.Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat((0, _inspect.default)(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type));\n}", "function astFromValue(value, type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isNonNullType\"])(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if (astValue && astValue.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL\n };\n } // undefined, NaN\n\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(value)) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(iterall__WEBPACK_IMPORTED_MODULE_0__[\"isCollection\"])(value)) {\n var valuesNodes = [];\n Object(iterall__WEBPACK_IMPORTED_MODULE_0__[\"forEach\"])(value, function (item) {\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isInputObjectType\"])(type)) {\n if (value === null || _typeof(value) !== 'object') {\n return null;\n }\n\n var fields = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(type.getFields());\n var fieldNodes = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var field = _step.value;\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].OBJECT_FIELD,\n name: {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].OBJECT,\n fields: fieldNodes\n };\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isLeafType\"])(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (Object(_jsutils_isNullish__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(serialized)) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].INT,\n value: stringNum\n } : {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isEnumType\"])(type)) {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _type_scalars__WEBPACK_IMPORTED_MODULE_7__[\"GraphQLID\"] && integerStringRegExp.test(serialized)) {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].INT,\n value: serialized\n };\n }\n\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(serialized)));\n } // Not reachable. All possible input types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected input type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type), \"\\\".\"));\n}", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n if (!variables || (0, _isInvalid2.default)(variables[variableName])) {\n // No valid return value.\n return;\n }\n // Note: we're not doing any checking that this variable is correct. We're\n // assuming that this query has been validated and the variable usage here\n // is of the correct type.\n return variables[variableName];\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n var coercedValues = [];\n var itemNodes = valueNode.values;\n for (var i = 0; i < itemNodes.length; i++) {\n if (isMissingVariable(itemNodes[i], variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (itemType instanceof _definition.GraphQLNonNull) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNodes[i], itemType, variables);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n }\n return coercedValues;\n }\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Invalid: intentionally return no value.\n }\n return [coercedValue];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNodes = (0, _keyMap2.default)(valueNode.fields, function (field) {\n return field.name.value;\n });\n var fieldNames = Object.keys(fields);\n for (var _i = 0; _i < fieldNames.length; _i++) {\n var fieldName = fieldNames[_i];\n var field = fields[fieldName];\n var fieldNode = fieldNodes[fieldName];\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Invalid: intentionally return no value.\n }\n continue;\n }\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n var parsed = type.parseLiteral(valueNode);\n if ((0, _isNullish2.default)(parsed) && !type.isValidLiteral(valueNode)) {\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n return;\n }\n\n return parsed;\n}", "function astFromValue(value, type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isNonNullType\"])(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(_jsutils_isCollection_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(value)) {\n var valuesNodes = []; // Since we transpile for-of in loose mode it doesn't support iterators\n // and it's required to first convert iteratable into array\n\n for (var _i2 = 0, _arrayFrom2 = Object(_polyfills_arrayFrom_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value); _i2 < _arrayFrom2.length; _i2++) {\n var item = _arrayFrom2[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isInputObjectType\"])(type)) {\n if (!Object(_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT_FIELD,\n name: {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isLeafType\"])(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && Object(_polyfills_isFinite_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: stringNum\n } : {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isEnumType\"])(type)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_8__[\"GraphQLID\"] && integerStringRegExp.test(serialized)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: serialized\n };\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(type));\n}", "function astFromValue(value, type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isNonNullType\"])(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(_jsutils_isCollection_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(value)) {\n var valuesNodes = []; // Since we transpile for-of in loose mode it doesn't support iterators\n // and it's required to first convert iteratable into array\n\n for (var _i2 = 0, _arrayFrom2 = Object(_polyfills_arrayFrom_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value); _i2 < _arrayFrom2.length; _i2++) {\n var item = _arrayFrom2[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isInputObjectType\"])(type)) {\n if (!Object(_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT_FIELD,\n name: {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isLeafType\"])(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && Object(_polyfills_isFinite_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: stringNum\n } : {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isEnumType\"])(type)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_8__[\"GraphQLID\"] && integerStringRegExp.test(serialized)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: serialized\n };\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(type));\n}", "function parseJSValue(value) {\n let val;\n if (isNodeCollection(value)) {\n val = value.get().value;\n } else if (isNode(value)) {\n val = value;\n } else {\n switch (typeof value) {\n case 'object':\n val = object(value);\n break;\n case 'function':\n val = parseFn(value);\n break;\n default:\n val = j.literal(value);\n }\n }\n return val;\n}", "function _valueOf(value) {\n var p = {};\n switch (value.type) {\n case 'object':\n p.value = {\n description: value.className,\n hasChildren: true,\n injectedScriptId: value.ref || value.handle,\n type: 'object'\n };\n break;\n case 'function':\n p.value = {\n description: value.text || 'function()',\n hasChildren: true,\n injectedScriptId: value.ref || value.handle,\n type: 'function'\n };\n break;\n case 'undefined':\n p.value = {description: 'undefined'};\n break;\n case 'null':\n p.value = {description: 'null'};\n break;\n case 'script':\n p.value = {description: value.text};\n break;\n default:\n p.value = {description: value.value};\n break;\n }\n return p;\n }", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _kinds.Kind.NULL:\n return null;\n\n case _kinds.Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case _kinds.Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case _kinds.Kind.STRING:\n case _kinds.Kind.ENUM:\n case _kinds.Kind.BOOLEAN:\n return valueNode.value;\n\n case _kinds.Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _kinds.Kind.OBJECT:\n return (0, _keyValMap[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _kinds.Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || (0, _invariant[\"default\"])(0, 'Unexpected value node: ' + (0, _inspect[\"default\"])(valueNode));\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _kinds.Kind.NULL:\n return null;\n\n case _kinds.Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case _kinds.Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case _kinds.Kind.STRING:\n case _kinds.Kind.ENUM:\n case _kinds.Kind.BOOLEAN:\n return valueNode.value;\n\n case _kinds.Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _kinds.Kind.OBJECT:\n return (0, _keyValMap.default)(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _kinds.Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected value node: ' + (0, _inspect.default)(valueNode));\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _kinds.Kind.NULL:\n return null;\n\n case _kinds.Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case _kinds.Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case _kinds.Kind.STRING:\n case _kinds.Kind.ENUM:\n case _kinds.Kind.BOOLEAN:\n return valueNode.value;\n\n case _kinds.Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _kinds.Kind.OBJECT:\n return (0, _keyValMap.default)(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _kinds.Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected value node: ' + (0, _inspect.default)(valueNode));\n}", "function astFromValue(value, type) {\n if ((0, _definition.isNonNullType)(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _kinds.Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n\n if ((0, _isCollection[\"default\"])(value)) {\n var valuesNodes = []; // Since we transpile for-of in loose mode it doesn't support iterators\n // and it's required to first convert iteratable into array\n\n for (var _i2 = 0, _arrayFrom2 = (0, _arrayFrom3[\"default\"])(value); _i2 < _arrayFrom2.length; _i2++) {\n var item = _arrayFrom2[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _kinds.Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (!(0, _isObjectLike[\"default\"])(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues3[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.Kind.OBJECT_FIELD,\n name: {\n kind: _kinds.Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _kinds.Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && (0, _isFinite[\"default\"])(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _kinds.Kind.INT,\n value: stringNum\n } : {\n kind: _kinds.Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if ((0, _definition.isEnumType)(type)) {\n return {\n kind: _kinds.Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: _kinds.Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: _kinds.Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat((0, _inspect[\"default\"])(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant[\"default\"])(0, 'Unexpected input type: ' + (0, _inspect[\"default\"])(type));\n}", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _kinds.Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && (0, _definition.isNonNullType)(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if ((0, _definition.isNonNullType)(type)) {\n if (valueNode.kind === _kinds.Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _kinds.Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _kinds.Kind.LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if ((0, _definition.isNonNullType)(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (valueNode.kind !== _kinds.Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = (0, _keyMap.default)(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if ((0, _definition.isNonNullType)(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _kinds.Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && (0, _definition.isNonNullType)(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if ((0, _definition.isNonNullType)(type)) {\n if (valueNode.kind === _kinds.Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _kinds.Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _kinds.Kind.LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if ((0, _definition.isNonNullType)(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (valueNode.kind !== _kinds.Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = (0, _keyMap.default)(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if ((0, _definition.isNonNullType)(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "function coerceValue(type, value) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if ((0, _isInvalid2.default)(_value)) {\n return; // Intentionally return no value.\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (_value === null) {\n return; // Intentionally return no value.\n }\n return coerceValue(type.ofType, _value);\n }\n\n if (_value === null) {\n // Intentionally return the value null.\n return null;\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var coercedValues = [];\n var valueIter = (0, _iterall.createIterator)(_value);\n if (!valueIter) {\n return; // Intentionally return no value.\n }\n var step = void 0;\n while (!(step = valueIter.next()).done) {\n var itemValue = coerceValue(itemType, step.value);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n return coercedValues;\n }\n var coercedValue = coerceValue(itemType, _value);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Intentionally return no value.\n }\n return [coerceValue(itemType, _value)];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if ((typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return; // Intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNames = Object.keys(fields);\n for (var i = 0; i < fieldNames.length; i++) {\n var fieldName = fieldNames[i];\n var field = fields[fieldName];\n if ((0, _isInvalid2.default)(_value[fieldName])) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Intentionally return no value.\n }\n continue;\n }\n var fieldValue = coerceValue(field.type, _value[fieldName]);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n var parsed = type.parseValue(_value);\n if ((0, _isNullish2.default)(parsed)) {\n // null or invalid values represent a failure to parse correctly,\n // in which case no value is returned.\n return;\n }\n\n return parsed;\n}", "function coerceValue(type, value) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if ((0, _isInvalid2.default)(_value)) {\n return; // Intentionally return no value.\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (_value === null) {\n return; // Intentionally return no value.\n }\n return coerceValue(type.ofType, _value);\n }\n\n if (_value === null) {\n // Intentionally return the value null.\n return null;\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var coercedValues = [];\n var valueIter = (0, _iterall.createIterator)(_value);\n if (!valueIter) {\n return; // Intentionally return no value.\n }\n var step = void 0;\n while (!(step = valueIter.next()).done) {\n var itemValue = coerceValue(itemType, step.value);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n return coercedValues;\n }\n var coercedValue = coerceValue(itemType, _value);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Intentionally return no value.\n }\n return [coerceValue(itemType, _value)];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if ((typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return; // Intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNames = Object.keys(fields);\n for (var i = 0; i < fieldNames.length; i++) {\n var fieldName = fieldNames[i];\n var field = fields[fieldName];\n if ((0, _isInvalid2.default)(_value[fieldName])) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Intentionally return no value.\n }\n continue;\n }\n var fieldValue = coerceValue(field.type, _value[fieldName]);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n var parsed = type.parseValue(_value);\n if ((0, _isNullish2.default)(parsed)) {\n // null or invalid values represent a failure to parse correctly,\n // in which case no value is returned.\n return;\n }\n\n return parsed;\n}", "function coerceValue(type, value) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if ((0, _isInvalid2.default)(_value)) {\n return; // Intentionally return no value.\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (_value === null) {\n return; // Intentionally return no value.\n }\n return coerceValue(type.ofType, _value);\n }\n\n if (_value === null) {\n // Intentionally return the value null.\n return null;\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var coercedValues = [];\n var valueIter = (0, _iterall.createIterator)(_value);\n if (!valueIter) {\n return; // Intentionally return no value.\n }\n var step = void 0;\n while (!(step = valueIter.next()).done) {\n var itemValue = coerceValue(itemType, step.value);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n return coercedValues;\n }\n var coercedValue = coerceValue(itemType, _value);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Intentionally return no value.\n }\n return [coerceValue(itemType, _value)];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (typeof _value !== 'object') {\n return; // Intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNames = Object.keys(fields);\n for (var i = 0; i < fieldNames.length; i++) {\n var fieldName = fieldNames[i];\n var field = fields[fieldName];\n if ((0, _isInvalid2.default)(_value[fieldName])) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Intentionally return no value.\n }\n continue;\n }\n var fieldValue = coerceValue(field.type, _value[fieldName]);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n var parsed = type.parseValue(_value);\n if ((0, _isNullish2.default)(parsed)) {\n // null or invalid values represent a failure to parse correctly,\n // in which case no value is returned.\n return;\n }\n\n return parsed;\n}", "function to_value(ast) {\n try {\n return Evaluator.to_value(ast);\n }\n catch (e) {\n //console.warn(\"Warning\".yellow + \": \" + e);\n return null;\n }\n}", "function getGraphQLValue(value) {\n if (\"string\" === typeof value) {\n value = JSON.stringify(value);\n } else if (Array.isArray(value)) {\n value = value.map(item => {\n return getGraphQLValue(item);\n }).join();\n value = `[${value}]`;\n } else if (\"object\" === typeof value) {\n /*if (value.toSource)\n value = value.toSource().slice(2,-2);\n else*/\n value = objectToString(value);\n //console.error(\"No toSource!!\",value);\n }\n return value;\n}", "function coerceValue(type: GraphQLType, value: any): any {\n if (type instanceof GraphQLNonNull) {\n // Note: we're not checking that the result of coerceValue is non-null.\n // We only call this function after calling isValidValue.\n return coerceValue(type.ofType, value);\n }\n\n if (isNullish(value)) {\n return null;\n }\n\n if (type instanceof GraphQLList) {\n var itemType = type.ofType;\n // TODO: support iterable input\n if (Array.isArray(value)) {\n return value.map(item => coerceValue(itemType, item));\n } else {\n return [coerceValue(itemType, value)];\n }\n }\n\n if (type instanceof GraphQLInputObjectType) {\n var fields = type.getFields();\n return Object.keys(fields).reduce((obj, fieldName) => {\n var field = fields[fieldName];\n var fieldValue = coerceValue(field.type, value[fieldName]);\n obj[fieldName] = fieldValue === null ? field.defaultValue : fieldValue;\n return obj;\n }, {});\n }\n\n if (type instanceof GraphQLScalarType ||\n type instanceof GraphQLEnumType) {\n var coerced = type.coerce(value);\n if (!isNullish(coerced)) {\n return coerced;\n }\n }\n\n return null;\n}", "function getValue(value) {\n var data = value,\n result = value;\n\n if (typeof data === 'string') {\n try {\n if (!data || data === 'true') {\n result = true;\n } else if (data === 'false') {\n result = false;\n } else if (data === 'null') {\n result = null;\n } else if (+data + '' === data) {\n result = +data;\n } else {\n result = rbrace.test(data) ? JSON.parse(data) : data;\n }\n } catch (error) {\n }\n }\n return result;\n}", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function transformValue({\n type,\n value\n}) {\n if (value == null) {\n return null;\n }\n\n if (type === Boolean) {\n return booleanTransformer(value);\n }\n\n return value;\n}", "function coerceValue(_x, _x2) {\n var _again = true;\n\n _function: while (_again) {\n var type = _x,\n value = _x2;\n _value = _ret = _ret2 = parsed = undefined;\n _again = false;\n\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _typeDefinition.GraphQLNonNull) {\n // Note: we're not checking that the result of coerceValue is non-null.\n // We only call this function after calling isValidJSValue.\n _x = type.ofType;\n _x2 = _value;\n _again = true;\n continue _function;\n }\n\n if ((0, _jsutilsIsNullish2['default'])(_value)) {\n return null;\n }\n\n if (type instanceof _typeDefinition.GraphQLList) {\n var _ret = (function () {\n var itemType = type.ofType;\n // TODO: support iterable input\n if (Array.isArray(_value)) {\n return {\n v: _value.map(function (item) {\n return coerceValue(itemType, item);\n })\n };\n }\n return {\n v: [coerceValue(itemType, _value)]\n };\n })();\n\n if (typeof _ret === 'object') return _ret.v;\n }\n\n if (type instanceof _typeDefinition.GraphQLInputObjectType) {\n var _ret2 = (function () {\n if (typeof _value !== 'object' || _value === null) {\n return {\n v: null\n };\n }\n var fields = type.getFields();\n return {\n v: _Object$keys(fields).reduce(function (obj, fieldName) {\n var field = fields[fieldName];\n var fieldValue = coerceValue(field.type, _value[fieldName]);\n if ((0, _jsutilsIsNullish2['default'])(fieldValue)) {\n fieldValue = field.defaultValue;\n }\n if (!(0, _jsutilsIsNullish2['default'])(fieldValue)) {\n obj[fieldName] = fieldValue;\n }\n return obj;\n }, {})\n };\n })();\n\n if (typeof _ret2 === 'object') return _ret2.v;\n }\n\n (0, _jsutilsInvariant2['default'])(type instanceof _typeDefinition.GraphQLScalarType || type instanceof _typeDefinition.GraphQLEnumType, 'Must be input type');\n\n var parsed = type.parseValue(_value);\n if (!(0, _jsutilsIsNullish2['default'])(parsed)) {\n return parsed;\n }\n }\n}", "function $value(value) {\n\t function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t function $replace(value) {\n\t var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t return replacement.length ? replacement[0] : value;\n\t }\n\t value = $replace(value);\n\t return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n\t }", "function castProperty(type, value) {\n // Some special handling is needed for some properties as they may be delivered\n // as strings HTML delivers attributes as strings.\n switch (type) {\n // Translate strings into booleans\n case Boolean:\n if (['false', '0', 'null', 'undefined'].indexOf(value) !== -1) {\n return false;\n } else {\n return Boolean(value);\n }\n\n case Number:\n return Number(value);\n\n // Translate strings into functions\n case Function:\n /* eslint-disable-next-line */\n return typeof value === 'string' ? eval('(' + value + ')') : value;\n case Object:\n if (value && typeof value === 'string') {\n try {\n return JSON.parse(value);\n } catch (e) {\n // no-op\n }\n }\n }\n return value;\n}", "function $value(value) {\n function hasReplaceVal(val) {\n return function (obj) {\n return obj.from === val;\n };\n }\n\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function (obj) {\n return obj.to;\n });\n return replacement.length ? replacement[0] : value;\n }\n\n value = $replace(value);\n return isDefined(value) ? self.type.decode(value) : $$getDefaultValue();\n }", "function typeParse(value)\n{\n\tif( value === null || value === undefined )\n\t{ return; }\n\n\tif( isInt(value) )\n\t{ return parseInt(value); }\n\tif( isFloat(value) )\n\t{ return parseFloat(value); }\n\tif( isBool(value) )\n\t{ return parseBool(value); }\n\tif( isJSON(value) )\n\t{ return JSON.parse(value); }\n\n\treturn value;\n}", "function astFromValue(_x, _x2) {\n var _again = true;\n\n _function: while (_again) {\n var value = _x,\n type = _x2;\n _value = _ret = stringNum = isIntValue = fields = undefined;\n _again = false;\n\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _typeDefinition.GraphQLNonNull) {\n // Note: we're not checking that the result is non-null.\n // This function is not responsible for validating the input value.\n _x = _value;\n _x2 = type.ofType;\n _again = true;\n continue _function;\n }\n\n if ((0, _jsutilsIsNullish2['default'])(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (Array.isArray(_value)) {\n var _ret = (function () {\n var itemType = type instanceof _typeDefinition.GraphQLList ? type.ofType : null;\n return {\n v: {\n kind: _languageKinds.LIST,\n values: _value.map(function (item) {\n var itemValue = astFromValue(item, itemType);\n (0, _jsutilsInvariant2['default'])(itemValue, 'Could not create AST item.');\n return itemValue;\n })\n }\n };\n })();\n\n if (typeof _ret === 'object') return _ret.v;\n } else if (type instanceof _typeDefinition.GraphQLList) {\n // Because GraphQL will accept single values as a \"list of one\" when\n // expecting a list, if there's a non-array value and an expected list type,\n // create an AST using the list's item type.\n _x = _value;\n _x2 = type.ofType;\n _again = true;\n continue _function;\n }\n\n if (typeof _value === 'boolean') {\n return { kind: _languageKinds.BOOLEAN, value: _value };\n }\n\n // JavaScript numbers can be Float or Int values. Use the GraphQLType to\n // differentiate if available, otherwise prefer Int if the value is a\n // valid Int.\n if (typeof _value === 'number') {\n var stringNum = String(_value);\n var isIntValue = /^[0-9]+$/.test(stringNum);\n if (isIntValue) {\n if (type === _typeScalars.GraphQLFloat) {\n return { kind: _languageKinds.FLOAT, value: stringNum + '.0' };\n }\n return { kind: _languageKinds.INT, value: stringNum };\n }\n return { kind: _languageKinds.FLOAT, value: stringNum };\n }\n\n // JavaScript strings can be Enum values or String values. Use the\n // GraphQLType to differentiate if possible.\n if (typeof _value === 'string') {\n if (type instanceof _typeDefinition.GraphQLEnumType && /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(_value)) {\n return { kind: _languageKinds.ENUM, value: _value };\n }\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return { kind: _languageKinds.STRING, value: JSON.stringify(_value).slice(1, -1) };\n }\n\n // last remaining possible typeof\n (0, _jsutilsInvariant2['default'])(typeof _value === 'object' && _value !== null);\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object.\n var fields = [];\n _Object$keys(_value).forEach(function (fieldName) {\n var fieldType = undefined;\n if (type instanceof _typeDefinition.GraphQLInputObjectType) {\n var fieldDef = type.getFields()[fieldName];\n fieldType = fieldDef && fieldDef.type;\n }\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fields.push({\n kind: _languageKinds.OBJECT_FIELD,\n name: { kind: _languageKinds.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: _languageKinds.OBJECT, fields: fields };\n }\n}", "function coerceValue(value, type, blameNode, path) {\n // A value must be provided if the type is non-null.\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_7__[\"isNonNullType\"])(type)) {\n if (value == null) {\n return ofErrors([coercionError(\"Expected non-nullable type \".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type), \" not to be null\"), blameNode, path)]);\n }\n\n return coerceValue(value, type.ofType, blameNode, path);\n }\n\n if (value == null) {\n // Explicitly return the value null.\n return ofValue(null);\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_7__[\"isScalarType\"])(type)) {\n // Scalars determine if a value is valid via parseValue(), which can\n // throw to indicate failure. If it throws, maintain a reference to\n // the original error.\n try {\n var parseResult = type.parseValue(value);\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(parseResult)) {\n return ofErrors([coercionError(\"Expected type \".concat(type.name), blameNode, path)]);\n }\n\n return ofValue(parseResult);\n } catch (error) {\n return ofErrors([coercionError(\"Expected type \".concat(type.name), blameNode, path, error.message, error)]);\n }\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_7__[\"isEnumType\"])(type)) {\n if (typeof value === 'string') {\n var enumValue = type.getValue(value);\n\n if (enumValue) {\n return ofValue(enumValue.value);\n }\n }\n\n var suggestions = Object(_jsutils_suggestionList__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(String(value), type.getValues().map(function (enumValue) {\n return enumValue.name;\n }));\n var didYouMean = suggestions.length !== 0 ? \"did you mean \".concat(Object(_jsutils_orList__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(suggestions), \"?\") : undefined;\n return ofErrors([coercionError(\"Expected type \".concat(type.name), blameNode, path, didYouMean)]);\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_7__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(iterall__WEBPACK_IMPORTED_MODULE_0__[\"isCollection\"])(value)) {\n var errors;\n var coercedValue = [];\n Object(iterall__WEBPACK_IMPORTED_MODULE_0__[\"forEach\"])(value, function (itemValue, index) {\n var coercedItem = coerceValue(itemValue, itemType, blameNode, atPath(path, index));\n\n if (coercedItem.errors) {\n errors = add(errors, coercedItem.errors);\n } else if (!errors) {\n coercedValue.push(coercedItem.value);\n }\n });\n return errors ? ofErrors(errors) : ofValue(coercedValue);\n } // Lists accept a non-list value as a list of one.\n\n\n var coercedItem = coerceValue(value, itemType, blameNode);\n return coercedItem.errors ? coercedItem : ofValue([coercedItem.value]);\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_7__[\"isInputObjectType\"])(type)) {\n if (_typeof(value) !== 'object') {\n return ofErrors([coercionError(\"Expected type \".concat(type.name, \" to be an object\"), blameNode, path)]);\n }\n\n var _errors;\n\n var _coercedValue = {};\n var fields = type.getFields(); // Ensure every defined field is valid.\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(fields)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var field = _step.value;\n var fieldValue = value[field.name];\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(fieldValue)) {\n if (!Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(field.defaultValue)) {\n _coercedValue[field.name] = field.defaultValue;\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_7__[\"isNonNullType\"])(field.type)) {\n _errors = add(_errors, coercionError(\"Field \".concat(printPath(atPath(path, field.name)), \" of required \") + \"type \".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(field.type), \" was not provided\"), blameNode));\n }\n } else {\n var coercedField = coerceValue(fieldValue, field.type, blameNode, atPath(path, field.name));\n\n if (coercedField.errors) {\n _errors = add(_errors, coercedField.errors);\n } else if (!_errors) {\n _coercedValue[field.name] = coercedField.value;\n }\n }\n } // Ensure every provided field is defined.\n\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var _arr = Object.keys(value);\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var fieldName = _arr[_i];\n\n if (!fields[fieldName]) {\n var _suggestions = Object(_jsutils_suggestionList__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(fieldName, Object.keys(fields));\n\n var _didYouMean = _suggestions.length !== 0 ? \"did you mean \".concat(Object(_jsutils_orList__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(_suggestions), \"?\") : undefined;\n\n _errors = add(_errors, coercionError(\"Field \\\"\".concat(fieldName, \"\\\" is not defined by type \").concat(type.name), blameNode, path, _didYouMean));\n }\n }\n\n return _errors ? ofErrors(_errors) : ofValue(_coercedValue);\n } // Not reachable. All possible input types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected input type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type), \"\\\".\"));\n}", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "valueOf() {\n return this.value;\n }", "getAst() {\n\n return {\n type: 'string',\n val: this.value\n };\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }", "function $value(value) {\n\t function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t function $replace(value) {\n\t var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t return replacement.length ? replacement[0] : value;\n\t }\n\t value = $replace(value);\n\t return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n\t }", "function $value(value) {\n\t\t\t\tfunction hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t\t\t\tfunction $replace(value) {\n\t\t\t\t\tvar replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t\t\t\t\treturn replacement.length ? replacement[0] : value;\n\t\t\t\t}\n\t\t\t\tvalue = $replace(value);\n\t\t\t\treturn !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n\t\t\t}", "function isValidLiteralValue(type, valueAST) {\n\t // A value must be provided if the type is non-null.\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t if (!valueAST) {\n\t if (type.ofType.name) {\n\t return ['Expected \"' + String(type.ofType.name) + '!\", found null.'];\n\t }\n\t return ['Expected non-null value, found null.'];\n\t }\n\t return isValidLiteralValue(type.ofType, valueAST);\n\t }\n\n\t if (!valueAST) {\n\t return [];\n\t }\n\n\t // This function only tests literals, and assumes variables will provide\n\t // values of the correct type.\n\t if (valueAST.kind === _kinds.VARIABLE) {\n\t return [];\n\t }\n\n\t // Lists accept a non-list value as a list of one.\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if (valueAST.kind === _kinds.LIST) {\n\t return {\n\t v: valueAST.values.reduce(function (acc, itemAST, index) {\n\t var errors = isValidLiteralValue(itemType, itemAST);\n\t return acc.concat(errors.map(function (error) {\n\t return 'In element #' + index + ': ' + error;\n\t }));\n\t }, [])\n\t };\n\t }\n\t return {\n\t v: isValidLiteralValue(itemType, valueAST)\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t // Input objects check each defined field and look for undefined fields.\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret2 = function () {\n\t if (valueAST.kind !== _kinds.OBJECT) {\n\t return {\n\t v: ['Expected \"' + type.name + '\", found not an object.']\n\t };\n\t }\n\t var fields = type.getFields();\n\n\t var errors = [];\n\n\t // Ensure every provided field is defined.\n\t var fieldASTs = valueAST.fields;\n\t fieldASTs.forEach(function (providedFieldAST) {\n\t if (!fields[providedFieldAST.name.value]) {\n\t errors.push('In field \"' + providedFieldAST.name.value + '\": Unknown field.');\n\t }\n\t });\n\n\t // Ensure every defined field is valid.\n\t var fieldASTMap = (0, _keyMap2.default)(fieldASTs, function (fieldAST) {\n\t return fieldAST.name.value;\n\t });\n\t Object.keys(fields).forEach(function (fieldName) {\n\t var result = isValidLiteralValue(fields[fieldName].type, fieldASTMap[fieldName] && fieldASTMap[fieldName].value);\n\t errors.push.apply(errors, result.map(function (error) {\n\t return 'In field \"' + fieldName + '\": ' + error;\n\t }));\n\t });\n\n\t return {\n\t v: errors\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n\t // Scalar/Enum input checks to ensure the type can parse the value to\n\t // a non-null value.\n\t var parseResult = type.parseLiteral(valueAST);\n\t if ((0, _isNullish2.default)(parseResult)) {\n\t return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueAST) + '.'];\n\t }\n\n\t return [];\n\t}", "getValue(node) {\n if (node == null) {\n return null\n } \n if (node.kind != null) {\n node = this.getValue(node.value)\n }\n if (typeof(node) === 'number') {\n return null\n }\n return node\n }", "function typeToVscodeValuePart(type, checker) {\n var simpleType = isSimpleType$1(type) ? type : toSimpleType(type, checker);\n switch (simpleType.kind) {\n case SimpleTypeKind.BOOLEAN:\n return { valueSet: \"v\" };\n case SimpleTypeKind.STRING_LITERAL:\n return { values: [{ name: simpleType.value }] };\n case SimpleTypeKind.ENUM:\n return { values: typesToStringUnion(simpleType.types.map(function (_a) {\n var type = _a.type;\n return type;\n })) };\n case SimpleTypeKind.UNION:\n return { values: typesToStringUnion(simpleType.types) };\n }\n return undefined;\n}", "function jsonType(val) {\n\tif (val === undefined) return\n\tif (val === null) return jsonType.NULL\n\tif (val === true || val === false) return jsonType.BOOLEAN\n\tif (Array.isArray(val)) return jsonType.ARRAY\n\n\tswitch (typeof val) {\n\t\t// number, string, symbol, function, object, undefined, boolean\n\t\tcase jsonType.STRING: return jsonType.STRING\n\t\tcase jsonType.NUMBER: return numberType(val)\n\t\tcase jsonType.OBJECT: break\n\t\tdefault: return\n\t}\n\n\tswitch (Object.prototype.toString.call(val)[8]) {\n\t\t// Done: Undefined, Null, Function, Array,\n\t\t// Remaining: Object, Date, String, Boolean, Number, Argument, RegExp, Error\n\t\tcase 'O': return jsonType.OBJECT\n\t\tcase 'D': return jsonType.STRING\n\t\tcase 'S': return jsonType.STRING\n\t\tcase 'B': return jsonType.BOOLEAN\n\t\tcase 'N': return numberType(val)\n\t\tcase 'A': return jsonType.OBJECT\n\t\tcase 'E': return jsonType.OBJECT\n\t\tcase 'R': return jsonType.OBJECT\n\t}\n}", "function isValidJSValue(value, type) {\n\t // A value must be provided if the type is non-null.\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t if ((0, _isNullish2.default)(value)) {\n\t if (type.ofType.name) {\n\t return ['Expected \"' + String(type.ofType.name) + '!\", found null.'];\n\t }\n\t return ['Expected non-null value, found null.'];\n\t }\n\t return isValidJSValue(value, type.ofType);\n\t }\n\n\t if ((0, _isNullish2.default)(value)) {\n\t return [];\n\t }\n\n\t // Lists accept a non-list value as a list of one.\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if ((0, _iterall.isCollection)(value)) {\n\t var _ret2 = function () {\n\t var errors = [];\n\t (0, _iterall.forEach)(value, function (item, index) {\n\t errors.push.apply(errors, isValidJSValue(item, itemType).map(function (error) {\n\t return 'In element #' + index + ': ' + error;\n\t }));\n\t });\n\t return {\n\t v: {\n\t v: errors\n\t }\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\t return {\n\t v: isValidJSValue(value, itemType)\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t // Input objects check each defined field.\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret3 = function () {\n\t if (typeof value !== 'object' || value === null) {\n\t return {\n\t v: ['Expected \"' + type.name + '\", found not an object.']\n\t };\n\t }\n\t var fields = type.getFields();\n\n\t var errors = [];\n\n\t // Ensure every provided field is defined.\n\t Object.keys(value).forEach(function (providedField) {\n\t if (!fields[providedField]) {\n\t errors.push('In field \"' + providedField + '\": Unknown field.');\n\t }\n\t });\n\n\t // Ensure every defined field is valid.\n\t Object.keys(fields).forEach(function (fieldName) {\n\t var newErrors = isValidJSValue(value[fieldName], fields[fieldName].type);\n\t errors.push.apply(errors, newErrors.map(function (error) {\n\t return 'In field \"' + fieldName + '\": ' + error;\n\t }));\n\t });\n\n\t return {\n\t v: errors\n\t };\n\t }();\n\n\t if (typeof _ret3 === \"object\") return _ret3.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n\t // Scalar/Enum input checks to ensure the type can parse the value to\n\t // a non-null value.\n\t var parseResult = type.parseValue(value);\n\t if ((0, _isNullish2.default)(parseResult)) {\n\t return ['Expected type \"' + type.name + '\", found ' + JSON.stringify(value) + '.'];\n\t }\n\n\t return [];\n\t}", "function ReturnValue(type, value){\n this.type = type\n this.value = value\n}", "function ReturnValue(type, value){\n this.type = type\n this.value = value\n}", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function astFromValue(_x, _x2) {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t var value = _x,\n\t type = _x2;\n\t _value = _ret = stringNum = isIntValue = fields = undefined;\n\t _again = false;\n\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _typeDefinition.GraphQLNonNull) {\n\t // Note: we're not checking that the result is non-null.\n\t // This function is not responsible for validating the input value.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if ((0, _jsutilsIsNullish2['default'])(_value)) {\n\t return null;\n\t }\n\n\t // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n\t // the value is not an array, convert the value using the list's item type.\n\t if (Array.isArray(_value)) {\n\t var _ret = (function () {\n\t var itemType = type instanceof _typeDefinition.GraphQLList ? type.ofType : null;\n\t return {\n\t v: {\n\t kind: _languageKinds.LIST,\n\t values: _value.map(function (item) {\n\t var itemValue = astFromValue(item, itemType);\n\t (0, _jsutilsInvariant2['default'])(itemValue, 'Could not create AST item.');\n\t return itemValue;\n\t })\n\t }\n\t };\n\t })();\n\n\t if (typeof _ret === 'object') return _ret.v;\n\t } else if (type instanceof _typeDefinition.GraphQLList) {\n\t // Because GraphQL will accept single values as a \"list of one\" when\n\t // expecting a list, if there's a non-array value and an expected list type,\n\t // create an AST using the list's item type.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if (typeof _value === 'boolean') {\n\t return { kind: _languageKinds.BOOLEAN, value: _value };\n\t }\n\n\t // JavaScript numbers can be Float or Int values. Use the GraphQLType to\n\t // differentiate if available, otherwise prefer Int if the value is a\n\t // valid Int.\n\t if (typeof _value === 'number') {\n\t var stringNum = String(_value);\n\t var isIntValue = /^[0-9]+$/.test(stringNum);\n\t if (isIntValue) {\n\t if (type === _typeScalars.GraphQLFloat) {\n\t return { kind: _languageKinds.FLOAT, value: stringNum + '.0' };\n\t }\n\t return { kind: _languageKinds.INT, value: stringNum };\n\t }\n\t return { kind: _languageKinds.FLOAT, value: stringNum };\n\t }\n\n\t // JavaScript strings can be Enum values or String values. Use the\n\t // GraphQLType to differentiate if possible.\n\t if (typeof _value === 'string') {\n\t if (type instanceof _typeDefinition.GraphQLEnumType && /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(_value)) {\n\t return { kind: _languageKinds.ENUM, value: _value };\n\t }\n\t // Use JSON stringify, which uses the same string encoding as GraphQL,\n\t // then remove the quotes.\n\t return { kind: _languageKinds.STRING, value: JSON.stringify(_value).slice(1, -1) };\n\t }\n\n\t // last remaining possible typeof\n\t (0, _jsutilsInvariant2['default'])(typeof _value === 'object' && _value !== null);\n\n\t // Populate the fields of the input object by creating ASTs from each value\n\t // in the JavaScript object.\n\t var fields = [];\n\t _Object$keys(_value).forEach(function (fieldName) {\n\t var fieldType = undefined;\n\t if (type instanceof _typeDefinition.GraphQLInputObjectType) {\n\t var fieldDef = type.getFields()[fieldName];\n\t fieldType = fieldDef && fieldDef.type;\n\t }\n\t var fieldValue = astFromValue(_value[fieldName], fieldType);\n\t if (fieldValue) {\n\t fields.push({\n\t kind: _languageKinds.OBJECT_FIELD,\n\t name: { kind: _languageKinds.NAME, value: fieldName },\n\t value: fieldValue\n\t });\n\t }\n\t });\n\t return { kind: _languageKinds.OBJECT, fields: fields };\n\t }\n\t}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACKET_L:\n return parseList(lexer, isConst);\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACE_L:\n return parseObject(lexer, isConst);\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].INT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].FLOAT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].STRING:\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }" ]
[ "0.7224206", "0.7224206", "0.6986272", "0.68704295", "0.68704295", "0.6868633", "0.682958", "0.682958", "0.68180215", "0.6725093", "0.67110455", "0.67110455", "0.662672", "0.66241294", "0.6601047", "0.6600547", "0.6590681", "0.6531839", "0.64394385", "0.64394385", "0.64241266", "0.6412976", "0.6384494", "0.6377265", "0.6377265", "0.6361571", "0.631863", "0.631863", "0.62578833", "0.62578833", "0.6185697", "0.5980431", "0.5975847", "0.5967295", "0.5939462", "0.5852352", "0.5852352", "0.5852352", "0.5809931", "0.5787711", "0.57801175", "0.57775223", "0.5752079", "0.57338613", "0.5727497", "0.5704192", "0.56847537", "0.56847537", "0.56847537", "0.56847537", "0.5673772", "0.5673772", "0.5673772", "0.5673772", "0.5673772", "0.5673772", "0.5673772", "0.56433046", "0.5624894", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.56244224", "0.556076", "0.5536479", "0.5514026", "0.55106354", "0.55007726", "0.5495105", "0.5493898", "0.548373", "0.548373", "0.5470181", "0.5470181", "0.5470181", "0.5470181", "0.5470181", "0.54666984", "0.54591143", "0.54525614", "0.54525614", "0.54525614", "0.54525614", "0.54525614", "0.54525614", "0.54525614", "0.54525614", "0.54525614" ]
0.6531839
19
Returns true if the provided valueNode is a variable which is not defined in the set of variables.
function isMissingVariable(valueNode, variables) { return valueNode.kind === Kind.VARIABLE && (!variables || (0, _isInvalid2.default)(variables[valueNode.name.value])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isMissingVariable(valueNode, variables) {\n return valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE && (!variables || Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(variables[valueNode.name.value]));\n}", "function isMissingVariable(valueNode, variables) {\n return valueNode.kind === _kinds.Kind.VARIABLE && (variables == null || variables[valueNode.name.value] === undefined);\n}", "function isMissingVariable(valueNode, variables) {\n return valueNode.kind === _kinds.Kind.VARIABLE && (variables == null || variables[valueNode.name.value] === undefined);\n}", "function isMissingVariable(valueNode, variables) {\n return valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE && (variables == null || variables[valueNode.name.value] === undefined);\n}", "function isMissingVariable(valueNode, variables) {\n return valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE && (variables == null || variables[valueNode.name.value] === undefined);\n}", "hasVariable(v) {\n\t\treturn this._vars.includes(v);\n\t}", "function isVar(node /*: Object*/) /*: boolean*/ {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node[_constants.BLOCK_SCOPED_SYMBOL];\n\t}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node[_constants.BLOCK_SCOPED_SYMBOL];\n\t}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node[_constants.BLOCK_SCOPED_SYMBOL];\n\t}", "function isVar(node, parent) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !isLet(node, parent);\n\t}", "function isVar(node, parent) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !isLet(node, parent);\n\t}", "function isVar(node, parent) {\n return t.isVariableDeclaration(node, { kind: \"var\" }) && !isLet(node, parent);\n}", "function isVar(t) {\n\t\tfor (var i = 0; i < varTable.length; i++) {\n\t\t\tif (varTable[i].name == t)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node._let;\n\t}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node._let;\n\t}", "function isVar(node) {\n return t.isVariableDeclaration(node, { kind: \"var\" }) && !node._let;\n}", "function isVar(x) {\n\treturn x.props && x.props.has('is','variable')\n}", "checkVariables(variableValuesResources, variableDefinitionsResources) {\n let variableValues = variableValuesResources.resource;\n let valuesFile = variableValuesResources.resourcePath;\n let variableDefinitions = variableDefinitionsResources.resource.definitions;\n let definitionsFile = variableDefinitionsResources.resourcePath;\n let unused = _.filter(_.keys(variableDefinitions), function(key) {\n let value = variableValues[key];\n return value === null || value === undefined;\n });\n for (let unusedKey of unused) {\n let definition = variableDefinitions[unusedKey];\n if (definition.default === null || definition.default === undefined) {\n throw new errors.UnusedVariableError(`Variable '${unusedKey}' declared in '${definitionsFile}' without default ` +\n `value and no value given in '${valuesFile}'`, \"unused_variable\", unusedKey);\n }\n }\n let undef = _.filter(_.keys(variableValues), function(key) {\n return !_.has(variableDefinitions, key);\n });\n if (undef.length > 0) {\n throw new errors.UndefinedVariableError(`Variables '${undef.join(\"', '\")}' not declared in ` +\n `'${definitionsFile}' but value assigned in '${valuesFile}'`,\n \"undefined_variables\", ...undef);\n }\n return true;\n }", "function isdef(value) {\n return !(value === undefined);\n}", "function exists(variable) {\n\treturn typeof(variable)!=\"undefined\";\n}", "function isVarFuntion(node) {\n\treturn node.type === 'func' && node.value === 'var' && Object(node.nodes).length && /^--/.test(node.nodes[1].value);\n}", "function hasVariable(expr, name) {\n let outcome;\n expr.traverse(function (node, path, parent) {\n if (node.type == 'SymbolNode' && node.name == name) {\n outcome = true;\n }\n });\n if (outcome) {\n return true;\n } else {\n return false;\n }\n}", "function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isNonNullType\"])(locationType) && !Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isNonNullType\"])(varType)) {\n var hasNonNullVariableDefaultValue = varDefaultValue && varDefaultValue.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_2__[\"Kind\"].NULL;\n var hasLocationDefaultValue = locationDefaultValue !== undefined;\n\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n\n var nullableLocationType = locationType.ofType;\n return Object(_utilities_typeComparators__WEBPACK_IMPORTED_MODULE_4__[\"isTypeSubTypeOf\"])(schema, varType, nullableLocationType);\n }\n\n return Object(_utilities_typeComparators__WEBPACK_IMPORTED_MODULE_4__[\"isTypeSubTypeOf\"])(schema, varType, locationType);\n}", "function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {\n if ((0, _definition.isNonNullType)(locationType) && !(0, _definition.isNonNullType)(varType)) {\n var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== _kinds.Kind.NULL;\n var hasLocationDefaultValue = locationDefaultValue !== undefined;\n\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n\n var nullableLocationType = locationType.ofType;\n return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, nullableLocationType);\n }\n\n return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, locationType);\n}", "function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {\n if ((0, _definition.isNonNullType)(locationType) && !(0, _definition.isNonNullType)(varType)) {\n var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== _kinds.Kind.NULL;\n var hasLocationDefaultValue = locationDefaultValue !== undefined;\n\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n\n var nullableLocationType = locationType.ofType;\n return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, nullableLocationType);\n }\n\n return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, locationType);\n}", "function isValueDefined(value) {\n return !(typeof value === \"undefined\" || value === null);\n}", "function isDefined(variable){\n/* 609 */ \t\treturn (!(!( variable||false )));\n/* 610 */ \t}", "function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isNonNullType\"])(locationType) && !Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isNonNullType\"])(varType)) {\n var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_2__[\"Kind\"].NULL;\n var hasLocationDefaultValue = locationDefaultValue !== undefined;\n\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n\n var nullableLocationType = locationType.ofType;\n return Object(_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isTypeSubTypeOf\"])(schema, varType, nullableLocationType);\n }\n\n return Object(_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isTypeSubTypeOf\"])(schema, varType, locationType);\n}", "function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isNonNullType\"])(locationType) && !Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isNonNullType\"])(varType)) {\n var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_2__[\"Kind\"].NULL;\n var hasLocationDefaultValue = locationDefaultValue !== undefined;\n\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n\n var nullableLocationType = locationType.ofType;\n return Object(_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isTypeSubTypeOf\"])(schema, varType, nullableLocationType);\n }\n\n return Object(_utilities_typeComparators_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isTypeSubTypeOf\"])(schema, varType, locationType);\n}", "function valueChecker(variable) {\r\n\tif(variable.length > 0) {\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "isNotDefined(val) {\n return val === undefined;\n }", "function isNill(variable) {\n return isNull(variable) || isUndefined(variable);\n}", "function isNull(theVar) {\n if (typeof(theVar) == 'undefined')\n return true;\n if (theVar == null)\n return true;\n return false;\n}", "function isUndefined(variable) {\n return typeof variable == 'undefined';\n}", "function isdefined( variable)\r\n{\r\n return (typeof(window[variable]) == \"undefined\")? false: true;\r\n}", "hasEmptyDomain() {\n\t\tfor (const v of this._vars) {\n\t\t\tif (v.domain().size() === 0) return true;\n\t\t}\n\t\treturn false;\n\t}", "function _isBlankNode(v) {\n // Note: A value is a blank node if all of these hold true:\n // 1. It is an Object.\n // 2. If it has an @id key its value begins with '_:'.\n // 3. It has no keys OR is not a @value, @set, or @list.\n var rval = false;\n if(_isObject(v)) {\n if('@id' in v) {\n rval = (v['@id'].indexOf('_:') === 0);\n } else {\n rval = (Object.keys(v).length === 0 ||\n !(('@value' in v) || ('@set' in v) || ('@list' in v)));\n }\n }\n return rval;\n}", "function _isBlankNode(v) {\n // Note: A value is a blank node if all of these hold true:\n // 1. It is an Object.\n // 2. If it has an @id key its value begins with '_:'.\n // 3. It has no keys OR is not a @value, @set, or @list.\n var rval = false;\n if(_isObject(v)) {\n if('@id' in v) {\n rval = (v['@id'].indexOf('_:') === 0);\n } else {\n rval = (Object.keys(v).length === 0 ||\n !(('@value' in v) || ('@set' in v) || ('@list' in v)));\n }\n }\n return rval;\n}", "function _isBlankNode(v) {\n // Note: A value is a blank node if all of these hold true:\n // 1. It is an Object.\n // 2. If it has an @id key its value begins with '_:'.\n // 3. It has no keys OR is not a @value, @set, or @list.\n var rval = false;\n if(_isObject(v)) {\n if('@id' in v) {\n rval = (v['@id'].indexOf('_:') === 0);\n } else {\n rval = (Object.keys(v).length === 0 ||\n !(('@value' in v) || ('@set' in v) || ('@list' in v)));\n }\n }\n return rval;\n}", "function _isBlankNode(v) {\n // Note: A value is a blank node if all of these hold true:\n // 1. It is an Object.\n // 2. If it has an @id key its value begins with '_:'.\n // 3. It has no keys OR is not a @value, @set, or @list.\n var rval = false;\n if(_isObject(v)) {\n if('@id' in v) {\n rval = (v['@id'].indexOf('_:') === 0);\n } else {\n rval = (Object.keys(v).length === 0 ||\n !(('@value' in v) || ('@set' in v) || ('@list' in v)));\n }\n }\n return rval;\n}", "function _isBlankNode(v) {\n // Note: A value is a blank node if all of these hold true:\n // 1. It is an Object.\n // 2. If it has an @id key its value begins with '_:'.\n // 3. It has no keys OR is not a @value, @set, or @list.\n var rval = false;\n if(_isObject(v)) {\n if('@id' in v) {\n rval = (v['@id'].indexOf('_:') === 0);\n } else {\n rval = (Object.keys(v).length === 0 ||\n !(('@value' in v) || ('@set' in v) || ('@list' in v)));\n }\n }\n return rval;\n}", "function wpsc_var_isset( name ) {\n\tif ( typeof wpsc_vars !== 'undefined' ) {\n\t\treturn wpsc_vars[name] !== undefined;\n\t}\n\n\treturn false;\n}", "function isVariable(term) {\n return !!term && term.termType === 'Variable';\n}", "function isVar(t) { return t[0] == '$'; }", "function is_there_GET_variables() {\n if( entries.next().value != undefined){\n return true;\n } else {\n return false;\n }\n}", "function variableIsDefined(str)\r\n{\r\n\tvar i = 0\r\n\tvar ret = false\r\n\r\n\tfor (i=0; i < variableCount; i++)\r\n\t{\r\n\t\tif (variableArray[i].name == str.toLowerCase())\r\n\t\t{\r\n\t\t\tvariableLastLookup = i\r\n\t\t\tret = true\r\n\t\t\tbreak\r\n\t\t}\r\n\t}\r\n\t\r\n\t// TODO: more efficient lookup algorithm\r\n\r\n\treturn ret\r\n}", "function existy(value) {\r\n return value !== undefined && value !== null;\r\n }", "function isIndependentVariableLikeDeclaration(node) {\n return node.type && isIndependentType(node.type) || !node.type && !node.initializer;\n }", "function hasValue(value) {\n return value !== undefined;\n}", "function exprNotEquals(varName, node) {\n return function(sol) {\n return !node.equals(sol[var2Attr(varName)]);\n }\n}", "function exprNotEquals(varName, node) {\r\n return function(sol) {\r\n return !node.equals(sol[var2Attr(varName)]);\r\n }\r\n}", "function isDefined(value) { return typeof value !== \"undefined\"; }", "function isVariable(variableName, arraySize)\n{\n // Only output non-array variables or array members (i.e., skip array\n // definitions)\n return variableName != null && arraySize != null && (arraySize.isEmpty() || variableName.endsWith(\"]\"));\n}", "function isVAR(x) {\n //final int t = tagOf(x);\n //return V == t || U == t;\n return tagOf(x) < 2\n}", "function defined(v)\n{\n\treturn (typeof(v) != 'undefined');\n}", "function isVarDeclaration(declarationList, typescript) {\n return declarationList.flags !== typescript.NodeFlags.Const && declarationList.flags !== typescript.NodeFlags.Let;\n}", "function defined (value) {\n\t return typeof value !== 'undefined'\n\t}", "function defined (value) {\n return value !== undefined\n}", "function isset(aVar)\r\n{\r\n\treturn (typeof aVar == \"undefined\")?false:true;\r\n}", "function isUndef(v){return v===undefined||v===null}", "function isUndef(v){return v===undefined||v===null;}", "function isUndef(v){return v===undefined||v===null;}", "function isUndef(val) {\n\t return val === void 0;\n\t }", "function NoUndefinedVariables(context) {\n\t var variableNameDefined = _Object$create(null);\n\n\t return {\n\t OperationDefinition: {\n\t enter: function enter() {\n\t variableNameDefined = _Object$create(null);\n\t },\n\t leave: function leave(operation) {\n\t var usages = context.getRecursiveVariableUsages(operation);\n\n\t usages.forEach(function (_ref) {\n\t var node = _ref.node;\n\n\t var varName = node.name.value;\n\t if (variableNameDefined[varName] !== true) {\n\t context.reportError(new _error.GraphQLError(undefinedVarMessage(varName, operation.name && operation.name.value), [node, operation]));\n\t }\n\t });\n\t }\n\t },\n\t VariableDefinition: function VariableDefinition(varDefAST) {\n\t variableNameDefined[varDefAST.variable.name.value] = true;\n\t }\n\t };\n\t}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function NoUndefinedVariables(context) {\n var variableNameDefined = _Object$create(null);\n\n return {\n OperationDefinition: {\n enter: function enter() {\n variableNameDefined = _Object$create(null);\n },\n leave: function leave(operation) {\n var usages = context.getRecursiveVariableUsages(operation);\n\n usages.forEach(function (_ref) {\n var node = _ref.node;\n\n var varName = node.name.value;\n if (variableNameDefined[varName] !== true) {\n context.reportError(new _error.GraphQLError(undefinedVarMessage(varName, operation.name && operation.name.value), [node, operation]));\n }\n });\n }\n },\n VariableDefinition: function VariableDefinition(varDefAST) {\n variableNameDefined[varDefAST.variable.name.value] = true;\n }\n };\n}", "function isUndef (v) {\r\n return v === undefined || v === null\r\n}", "function isDef(val) {\n return typeof val != \"undefined\";\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function IsDefined(value) {\n return (typeof value) != 'undefined';\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}" ]
[ "0.7585486", "0.7506564", "0.7506564", "0.74943405", "0.74943405", "0.65721583", "0.6398217", "0.6277338", "0.6277338", "0.62046826", "0.62046826", "0.6160192", "0.61580646", "0.61210066", "0.61210066", "0.60618746", "0.6023324", "0.5985507", "0.5955709", "0.5879482", "0.5853912", "0.58409095", "0.5823967", "0.5809471", "0.5809471", "0.57934713", "0.57801324", "0.57720447", "0.57720447", "0.57667804", "0.5704181", "0.56890225", "0.5681338", "0.5671498", "0.5656888", "0.5656819", "0.5654093", "0.5654093", "0.5654093", "0.5654093", "0.5654093", "0.5603701", "0.55938715", "0.5571212", "0.5555832", "0.5523213", "0.5522761", "0.5521667", "0.5507621", "0.54907036", "0.5483623", "0.5448013", "0.54249376", "0.54228383", "0.5418869", "0.5411495", "0.53864455", "0.5372561", "0.53683597", "0.535912", "0.535119", "0.535119", "0.5324768", "0.53134924", "0.5312631", "0.5312631", "0.5312631", "0.5312631", "0.5312631", "0.5302571", "0.5295028", "0.5291992", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.52877647", "0.5283773", "0.5281759", "0.5281759", "0.5281759", "0.5281759", "0.5281759", "0.5281759", "0.5281759", "0.5281759", "0.5281759", "0.5281759", "0.5281759", "0.5281759" ]
0.7465998
6
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Returns true if a value is undefined, or NaN.
function isInvalid(value) { return value === undefined || value !== value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUndefined(value) { return typeof value === \"undefined\"; }", "function isUndefined (value) {\n return value === undefined;\n}", "function isUndefined(value){return typeof value === 'undefined';}", "function isUndefined(value) {\n\n}", "function isUndefined (value) {\nreturn typeof value === 'undefined';\n}", "function isUndefined(value) {\n\treturn typeof value === 'undefined';\n}", "function isUndefined(value) {\n return typeof value === 'undefined';\n}", "function isUndefined(value) {\n return typeof value === 'undefined';\n}", "function isNullOrUndefined(value) {\n return value === null || typeof value === 'undefined';\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isUndefined(value)\n{\n return (typeof(value) === 'undefined');\n}", "static hasValue(val) {\n if (val == undefined || val == \"\" || val == NaN || val == null) {\n return false;\n }\n return true;\n }", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}", "function isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}", "function isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}", "function isNullOrUndefined(value) {\r\n return value === null || value === undefined;\r\n}", "function isUndefined(val) {\n return (val == undefined) ? true : false \n}", "__is_undefined(value) {\n return typeof value === 'undefined';\n }", "function isNully (value) {return isNull(value) || typeof value === 'undefined'}", "function isNullOrUndefined(value) {\n return value === null || value === undefined;\n }", "function notIsNullOrUndefined(value) {\n return value !== null || typeof value !== 'undefined';\n}", "function isUndefined(val) {\n return typeof val === 'undefined' || typeof val === undefined;\n}", "function isUndefined(val) {\r\n return Object.prototype.toString.call(val) === \"[object Undefined]\";\r\n}", "function isNullOrUndefined(value) {\n return typeof value === \"undefined\" || value === null;\n }", "function isNullOrUndefined(value){return value===null||value===undefined;}", "function isValueDefined(value) {\n return !(typeof value === \"undefined\" || value === null);\n}", "function hasValue(value) {\n return value !== undefined;\n}", "function _isActualNaN(value) {\n\t\t\treturn typeof value === 'number' && value !== value;\n\t\t}", "function isUndefinedOrNull(val) {\n return isUndefined(val) || isNull(val);\n}", "function IsUndefined(x) {\r\n return x === undefined;\r\n }", "function IsUndefined(x) {\r\n return x === undefined;\r\n }", "function IsUndefined(x) {\r\n return x === undefined;\r\n }", "isNotDefined(val) {\n return val === undefined;\n }", "function isValue(val) {\n return (!isUndefined(val)\n && !isNull(val) && !(isNumber(val) && isNaN(val))\n && !isInfinite(val));\n}", "function IsUndefined(x) {\n return x === undefined;\n }", "function IsUndefined(x) {\n return x === undefined;\n }", "function IsUndefined(x) {\n\t return x === undefined;\n\t }", "function IsUndefined(x) {\n return x === undefined;\n }", "function IsUndefined(x) {\n return x === undefined;\n }", "function IsUndefined(x) {\n return x === undefined;\n }", "function IsUndefined(x) {\n return x === undefined;\n }", "function IsUndefined(x) {\n return x === undefined;\n }", "function IsUndefined(x) {\n return x === undefined;\n }", "function IsUndefined(x) {\n return x === undefined;\n }", "function IsUndefined(x) {\r\n return x === undefined;\r\n }", "function isNullOrUndefined(val) {\n return (val == null || val == undefined);\n }", "function IsUndefined(x) {\r\n return x === undefined;\r\n }", "function isNaN(value) {\n if (value == undefined)return false\n return Number.isNaN(Number(value))\n }", "function existy(value) {\r\n return value !== undefined && value !== null;\r\n }", "function isUndefined(a) {\r\n return a == undefined;\r\n}", "function isDefinedAndNotNull(input)\r\n{\r\n if (isDefined(input))\r\n return ((input != null) && !isNaN(input));\r\n else\r\n return false;\r\n}", "function isUndefined(o) {\n return o === undefined;\n}", "function defined (value) {\n return value !== undefined\n}", "function valueIsUndefined(value) {\n\treturn value === undefined || value === false\n\t\t? true\n\t\t: value === null\n\t\t? false // null means overwrite other packs to set this blank, or ignore isa value\n\t\t: typeof value === \"string\"\n\t\t? value === \"\"\n\t\t: value.constructor && value.constructor.name === \"Array\"\n\t\t? value.equals([])\n\t\t: !Object.keys(value).length;\n}", "function isDefined(value) { return typeof value !== \"undefined\"; }", "function isDefined(value) {\n return value !== null && typeof value != 'undefined';\n}", "function isUndefined( input )\n{\n\treturn !(typeof input != 'undefined');\n}", "function isUndefined(o) {\n return typeof o === 'undefined';\n}", "function isUndefined(obj) {\n return obj === undefined;\n}", "function isdef(value) {\n return !(value === undefined);\n}", "function isRealValue(obj){\n return obj && obj !== \"null\" && obj!== \"undefined\";\n}", "isDefined(val) {\n return val !== undefined;\n }", "function isUndefined(o) {\n return typeof o === \"undefined\";\n}", "function isUndefined(o) {\n return typeof o === \"undefined\";\n}", "function isUndefined(o) {\n return typeof o === \"undefined\";\n}", "function isUndefined(o) {\n return typeof o === \"undefined\";\n}", "function isUndefined(o) {\n return typeof o === \"undefined\";\n}", "function isUndefined(o) {\n return typeof o === \"undefined\";\n}", "function isUndefined(o) {\n return typeof o === \"undefined\";\n}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function _isUndefined(v) {\n return (typeof v === 'undefined');\n}", "function isDefined(value) {\n\treturn value !== null && typeof value != 'undefined';\n}", "function _is_finite(val) {\n return Number.isFinite(val);\n}", "function isDefined(value) {\n return value !== undefined && value !== null;\n}", "function isUndef(v){return v===undefined||v===null;}", "function isUndef(v){return v===undefined||v===null;}", "function isRealValue(obj) {\r\n return obj && obj !== 'null' && obj !== 'undefined';\r\n}", "function isUndefined(x, andNull) {\n return typeof x === TYPE_UNDEFINED || (!!andNull && x === null);\n }", "function isUndef(v){return v===undefined||v===null}", "function isDefined(value) {\n\treturn typeof value !== 'undefined' && value !== null;\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}", "function isUndef (v) {\n return v === undefined || v === null\n}" ]
[ "0.7582717", "0.7551259", "0.7535791", "0.747478", "0.745579", "0.7376539", "0.73757905", "0.73757905", "0.73680633", "0.73463696", "0.7346058", "0.7323705", "0.73208964", "0.73208964", "0.73208964", "0.73208964", "0.73208964", "0.73208964", "0.73084396", "0.73084396", "0.73084396", "0.7294658", "0.72931105", "0.72557586", "0.72537297", "0.7232248", "0.71892923", "0.7184547", "0.7167361", "0.71655035", "0.71416", "0.7135002", "0.70506966", "0.70197934", "0.69767445", "0.69767445", "0.69767445", "0.6964783", "0.6959899", "0.69527316", "0.69527316", "0.694959", "0.69468206", "0.69468206", "0.69468206", "0.69468206", "0.69468206", "0.69468206", "0.69468206", "0.6932625", "0.69195896", "0.69163257", "0.69110215", "0.69038635", "0.6902046", "0.6900397", "0.6863135", "0.6849", "0.68348616", "0.68026084", "0.67991966", "0.6788577", "0.67878425", "0.67832685", "0.6766074", "0.67630553", "0.6760256", "0.6751618", "0.6751618", "0.6751618", "0.6751618", "0.6751618", "0.6751618", "0.6751618", "0.67333096", "0.67333096", "0.67333096", "0.67333096", "0.67333096", "0.6727816", "0.6708113", "0.6707665", "0.6702773", "0.6702773", "0.6699422", "0.6689783", "0.66800165", "0.6673655", "0.66580087", "0.66580087", "0.66580087", "0.66580087", "0.66580087", "0.66580087", "0.66580087", "0.66580087", "0.66580087", "0.66580087", "0.66580087", "0.66580087", "0.66580087" ]
0.0
-1
Converts an AST into a string, using one set of reasonable formatting rules.
function print(ast) { return (0, _visitor.visit)(ast, { leave: printDocASTReducer }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatAst(ast) {\n return (0, _language.visit)(ast, { leave: printDocASTReducer });\n}", "function church_ast_to_string(ast) {\n\tif (util.is_leaf(ast)) {\n\t\treturn ast.text;\n\t} else {\n\t\treturn \"(\" + ast.children.map(function(x) {return church_ast_to_string(x)}).join(\" \") + \")\"\n\t}\n}", "function formatAST(node)\n\t\t{\n\t\t\tif(!Array.isArray(node))\n\t\t\t{\n\t\t\t\t// Flatten enum values (object singletons with capital first letter key)\n\t\t\t\tif(node && typeof node === 'object')\n\t\t\t\t{\n\t\t\t\t\tlet keys = Object.keys(node);\n\t\t\t\t\tfor(let key of keys)\n\t\t\t\t\t{\n\t\t\t\t\t\tnode[key] = formatAST(node[key]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// // TEMP : `Der` case\n\t\t\t\t\t// if(node.rule && node.ctx && node.dir && node.rule)\n\t\t\t\t\t// {\n\t\t\t\t\t// \tlet sub = formatAST(node.rule);\n\t\t\t\t\t// \tnode.rule = sub;\n\t\t\t\t\t// \tsub._type = node;\n\t\t\t\t\t// \treturn sub;\n\t\t\t\t\t// }\n\t\t\t\t\t\n\t\t\t\t\t// let key = keys[0];\n\t\t\t\t\t// if(keys.length === 1 && key.charAt(0) !== key.charAt(0).toLowerCase())\n\t\t\t\t\t// {\n\t\t\t\t\t// \treturn formatAST([key].concat(node[key]));\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\telse if(node[0] === 'DebugLabel')\n\t\t\t{\n\t\t\t\tlet sub = formatAST(node[3]);\n\t\t\t\tnode[3] = sub;\n\t\t\t\tsub._debug = node;\n\t\t\t\treturn sub;\n\t\t\t}\n\t\t\telse if(node[0] === 'Der')\n\t\t\t{\n\t\t\t\tlet sub = formatAST(node[1].rule);\n\t\t\t\tnode[1].rule = sub;\n\t\t\t\tsub._type = node[1];\n\t\t\t\treturn sub;\n\t\t\t}\n\t\t\t\n\t\t\tfor(var i = 0; i < node.length; i++)\n\t\t\t{\n\t\t\t\tlet s = formatAST(node[i]);\n\t\t\t\tif(Array.isArray(s))\n\t\t\t\t{\n\t\t\t\t\ts._parent = node;\n\t\t\t\t}\n\t\t\t\tnode[i] = s;\n\t\t\t}\n\t\t\treturn node;\n\t\t}", "function to_s(ast) {\n return Serializer.to_s(ast);\n}", "function printAST(a)\n{\n\n\n\t//\t<outer> ::= (OUTERTEXT |<templateinvocation>|<templatedef>)*\n\n\t// case for \"OUTER object\"\n\tif(a.name == \"outer\") // We go in the inverse way by checking all the fields of an \"outer\" object\n\t{\n\t\tif(a.OUTERTEXT) //Check if it has an outertext VALUE\n\t\t{\n\t\t\tif(a.templateinvocation) // then a tepmlete invoaction \n\t\t\t{\n\t\t\t\tif(a.next) // next is the recursive part if it is also present , format print outer Text then in TSTART and TEND\n\t\t\t\t{ \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\treturn a.OUTERTEXT + \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next) // we make recursive call to printAST to go back\n\t\t\t\t}\n\t\t\telse // if no next value : \n\t\t\t\treturn a.OUTERTEXT + \"{{\" + printAST(a.templateinvocation) + \"}}\"\n\t\t\t}\n\n\t\t if(a.templatedef) // now if template definition has a vlaue \n\t\t\t{\n\t\t\t\tif(a.next)\n {\n return a.OUTERTEXT + \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n }\n else // if no next value\n return a.OUTERTEXT +\"{:\" + printAST(a.templatedef) + \":}\"\n\t\t\t}\n\n\t\t if(a.next) // if only a a.next in an object having an outer text value \n\t\t\t{\n\t\t\t\treturn a.OUTERTEXT + printAST(a.next)\n\t\t\t}\n\t\t\telse\n\t\t\t return a.OUTERTEXT // ultimate case, only return OUTERTEXT\n\t\t} // End of if outertext has a value \n\n\t\t// --------------\n\n\t\telse if(a.templateinvocation){ // NOW CASE when the outer has null in a.OUTERTEXT and has a value in template invocaiton\n\n\t\t\tif(a.next) // check if there is a next value\n \t\treturn \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next) \n \t\telse \n \t\t\treturn \"{{\" + printAST(a.templateinvocation) + \"}}\"\n\t\t}\n\n\t if(a.templatedef) //NOW CASE when the outer has null in a.OUTERTEXT and has a value in Template definition\n {\n if(a.next)\n return \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n else \n \treturn \"{:\" + printAST(a.templatedef) + \":}\"\n }\n\n\tif(a.next) // LAST CASW WHERE all the object fields are empty except a.next \n \treturn printAST(a.next) // go to a.next \n\t\telse\n\t\t return \"\" // if there is no a.next it's an empty object so return empty string\n\t} // \n\n\n\t/* \n\n\t\t\tobject grammar type : template invocation \n\t\t\t<templateinvocation> ::= TSTART <itext> <targs> TEND\n\t\t\t--> We follow the logic used in the previous example to go over each object fields\n\n\t*/\n\nif(a.name == \"templateinvocation\") // if the object field is template invocation\n\t{\n\t\t\n\t\t// IF THE OBJECT has an ITEXT value\n\t\tif(a.itext)\n\t\t{\n\t\t\tif(a.targs) // if it also has a targs value\n\t\t\t return printAST(a.itext) + printAST(a.targs) // print both of just print ITEXT\n\n\t\t\telse \n\t\t\t return printAST(a.itext) // else just return to print AST\n\t\t}\n\t\telse \n\t\t\treturn \"\" // else this is an empty object \n\t}\n\n\n\n\t/* FOR OBJECT name Itex----------------------------\n\t<itext> ::= (INNERTEXT |<templateinvocation>|<templatedef>|<tparam>)*\n\n\t*/\n\n\n\n\t if(a.name == \"itext\") // check if theo oject has an Itext value\n\t{\n\t\tif(a.innerText) // check if itext has an INNERTEXT value\n\t\t{\n\t\t\tif(a.templateinvocation) // AND template invocation vlaue\n\t\t\t{\n\t\t\t\tif(a.next) // AND next \n\t\t\t\t\treturn a.innerText + \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next) \n\t\t\t\telse \n\t\t\t\t\treturn a.innerText+ \"{{\" + printAST(a.templateinvocation) + \"}}\" \n\t\t\t}\n\n\n\t\tif(a.templatedef) // if has template definition value \n\t\t\t{\n\t\t\t\tif(a.next) // ANd a next field\n {\n return a.innerText + \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next) \n }\n else \n \treturn a.innerText +\"{:\" + printAST(a.templatedef)\n\t\t\t}\n\n\n\t\tif(a.tparam) // If tparam has a value \n\t\t\t{\n\t\t\t\tif(a.next) // AND next value\n {\n return a.innerText + \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next) \n }\n else // else juste return tparam value and go back to print AST\n return a.innerText +\"{{{\" + printAST(a.tparam) + \"}}}\"\n\t\t\t}\n\n\t\tif(a.next) // if a next has a relue simply return to printAST with it's value\n\t\t\t{\n\t\t\t\treturn a.innerText + printAST(a.next) \n\t\t\t}\t\t\t\n\t\t\telse // else just return \n\t\t\t\treturn a.innerText\n\t\t}\n\n\n\t\tif(a.templateinvocation) // now it just a template invocation \n {\n if(a.next) // AND a.next ?\n return \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next)\n else // just return to parstAT \n \treturn \"{{\" + printAST(a.templateinvocation) + \"}}\"\n }\n\n if(a.templatedef) // if template def\n {\n if(a.next)\n return \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n else return \"{:\" + printAST(a.templatedef) + \":}\"\n }\n\n\tif(a.tparam) // if tparam has a vaue\n\t\t{\n\t\t\tif(a.next)\n return \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next)\n else \n return \"{{{\" + printAST(a.tparam) + \"}}}\"\n\t\t}\n\n else return \"\"\n\t} //----- END onf ITEXT---- \n\n\n\t/*\n\t\tObject type of grammar used : TEMPLATE DEF\n\t\t<templatedef> ::= DSTART <dtext> (PIPE <dtext>)+ DEND\n\t*/\n\n if(a.name == \"templatedef\") // for template definition we gotta chekc for dtext value and pipe values\n\t{\n\n\t\t\n\t\tif(a.dtext) // if the object has a dtext value\n\t\t{\n\t\t\tif(a.dargs) // AND if it has a dargs value as well\n\t\t\t\treturn printAST(a.dtext) + printAST(a.dargs) \n\t\t\telse // Else just return dtext\n\t\t\t\treturn printAST(a.dtext)\n\t\t}\n\t\telse return \"\" // just return empty string\n\t}\n\t\n/*\n\nObject of type DTEXT \n\n============> This is basically the same thing as Itext but with Dtext and InnerDtext\n\ndtext> ::= (INNERDTEXT |<templateinvocation>|<templatedef>|<tparam>)*\n\n*/\n\n\nif(a.name == \"dtext\") \n\t{\n\n\n\t\tif(a.innerDtext)\n {\n if(a.templateinvocation)\n {\n if(a.next)\n return a.innerDtext + \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next)\n else\n return a.innerDtext+ \"{{\" + printAST(a.templateinvocation) + \"}}\"\n }\n\n if(a.templatedef)\n {\n if(a.next)\n {\n return a.innerDtext + \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n }\n else\n return a.innerDtext+\"{:\" + printAST(a.templatedef) + \":}\"\n }\n\n if(a.tparam)\n {\n if(a.next)\n {\n return a.innerDtext + \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next)\n }\n else \n return a.innerDtext +\"{{{\" + printAST(a.tparam) + \"}}}\"\n }\n\n\t\t\t \tif(a.next) \n\t\t\t \t\treturn a.innerDtext + printAST(a.next)\n else \n \treturn a.innerDtext\n\n }\n\n\n\n if(a.templateinvocation)\n {\n \t\tif(a.next)\n return \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next)\n else \n \treturn \"{{\" + printAST(a.templateinvocation) + \"}}\"\n }\n if(a.templatedef)\n {\n if(a.next)\n \treturn \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n else \n \treturn \"{:\" + printAST(a.templatedef) + \":}\"\n }\n if(a.tparam)\n {\n if(a.next)\n return \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next)\n else \n \t\treturn \"{{{\" + printAST(a.tparam) + \"}}}\"\n }\n else return \"\" // just return empty string \n\n\t}\n\n\n/*\n \t\tParse AST for targs objects \n \t\t<targs> ::= (PIPE <itext>)*\n*/\n\n\nif(a.name == \"targs\") // check if the name is targs\n\t{\n\t\tif(a.itext) // if it has an Itext value\n\t\t{\n\t\t\tif(a.next) // AND A NEXT so return both\n\t\t\t\treturn \"|\" + printAST(a.itext) + printAST(a.next)\n\t\t\telse // or else return only the pipe\n\t\t\t\treturn \"|\" + printAST(a.itext)\n\t\t}\n\t}\n\n\n/*\n Check if the object type is pipeDtext : \n This is a non terminale element that I defined to simplify the work in template def for \" (PIPE <dtext>)+\"\n\tI asked the prof he said it's allowed\n\n\tPARSEPIPEDTEXT(s)\n\n*/\n\nif(a.name == \"pipeDtext\") // check the name of the element\n {\n if(a.dtext) // check if dtext has a value \n {\n if(a.next) //AND next \n return \"|\" + printAST(a.dtext) + printAST(a.next)\n else // If not return the pipe and recursively call print AST9 a.ditext)\n \treturn \"|\" + printAST(a.dtext)\n }\n }\n\n\n/*\n\t\tObject of kind of \"tparam\"\n*/\n\n if(a.name == \"tparam\") // check the name toaram\n\t{\n\t\treturn \"{{{\" + a.name + \"}}}\" // directly return the value of pname\n\t}\n\n}", "function pr_str(ast, print_readably) {\n readable = print_readably;\n tab = readable ? \"\\t\" : \"\";\n br = readable ? \"\\n\" : \"\";\n\n return print_form(ast);\n}", "function format(o) {\n\n //result string\n var s = '';\n\n //typeof next argument\n switch(typeof(o)) {\n\n case 'undefined':\n s += 'undefined'\n break;\n\n case 'object':\n \n if(o && o[Symbol.toStringTag]) {\n s += \"/* [object \" + o[Symbol.toStringTag] + \"] */ \"; \n } else if (o && o.__proto__ && o.__proto__.constructor && o.__proto__.constructor.name) {\n s += \"/* [object \" + o.__proto__.constructor.name + \"] */ \";\n }\n\n if(o === null) {\n s += \"null\";\n } else if(o instanceof Error) {\n s += util.inspect(o);\n } else if (Array.isArray(o)) {\n s += \"/* [object Array(\"+ o.length + \")] */\";\n s += util.inspect(o);\n } else {\n s += str.obj(o);\n }\n break;\n\n case 'function':\n if(o.prototype && o.prototype.constructor && o.prototype.constructor.name) {\n s += \"/* [Function \" + o.prototype.constructor.name + \"] */ \"; \n } \n if(o.help) {\n s += \"/* \" + o.help + \" */ \";\n }\n s += o.toString();\n break;\n\n case 'string': \n s += o;\n break;\n default: \n s += util.inspect(o);\n break;\n }\n return s;\n }", "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "function printAst(value) {\n var str = printAstRecursively(value, \"\", \"\");\n console.log(str);\n}", "toTemplateString (options) {\n\t\tif (options === undefined)\n\t\t\toptions = {};\n\t\tlet com = options.complete === undefined ? false : options.complete;\n\t\tlet nln = options.newLine === false ? \" \" : \"\\n\";\n\t\tlet ind = options.indentation === undefined ? 4 : options.indentation;\n\t\tlet dpt = options.depth === undefined ? 0 : options.depth;\n\t\tlet fmt = options.format === undefined ? \"explicit\" : options.format;\n\t\tlet ia = util.indentationArray(ind);\n\n\t\tlet ret = [];\n\n\t\tlet obj;\n\t\tif (com)\n\t\t\tobj = this.toCompleteTemplate(fmt);\n\t\telse\n\t\t\tobj = this.toMinimalTemplate(fmt);\n\n\t\tfor (let i in obj) {\n\t\t\tret.push(ia[dpt+1] + util.kvPair(i, obj[i], false, typeof(obj[i]) === \"string\"));\n\t\t}\n\n\t\tret = \"{\" + nln + ret.join(\",\" + nln) + nln + ia[dpt] + \"}\";\n\n\t\treturn ret;\n\t}", "function dumpAst(ast) {\n if (RiverTrail.compiler.verboseDebug) {\n console.log(JSON.stringify(ast, astTypeConverter));\n }\n if (RiverTrail.compiler.debug) {\n console.log(RiverTrail.Helper.wrappedPP(ast));\n }\n }", "function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n } // TODO: provide better type coverage in future", "pretty() {\n // output pretty formatted string\n let str = [];\n /**\n * Make a specified length space string\n * @param numberOfSpaces Length of output string\n */\n function makeSpaceStr(numberOfSpaces) {\n let res = [];\n for (let i = 0; i < numberOfSpaces; i++) {\n res.push(' ');\n }\n return res.join('');\n }\n function recursive(node, prefix, isLastChild, isRoot = false) {\n str.push(prefix);\n if (!isRoot) {\n str.push(\"--\");\n }\n str.push(node.name + '\\n');\n if (isLastChild) {\n prefix = makeSpaceStr(prefix.length);\n }\n if (!isRoot) {\n prefix += ' ';\n }\n if (node.childs != null) {\n let numberOfChilds = node.childs.length;\n for (let indexOfChild = 0; indexOfChild < numberOfChilds; indexOfChild++) {\n let child = node.childs[indexOfChild];\n if (indexOfChild == numberOfChilds - 1) {\n recursive(child, prefix + '`', true);\n }\n else {\n recursive(child, prefix + '|', false);\n }\n }\n }\n }\n recursive(this.root, '', false, true);\n return str.join('');\n }", "function astToTypescript(ast, maybeResolve, config) {\n var translator = new AstTranslator(maybeResolve, config);\n return translator.translate(ast);\n }", "function format(rules) {\n return rules.map(formatRule).join(\"\\n\")\n}", "function toConventionalChangelogFormat (ast) {\n const cc = {\n body: '',\n subject: '',\n type: '',\n scope: null,\n notes: [],\n references: [],\n mentions: [],\n merge: null,\n revert: null,\n header: '',\n footer: null\n }\n // Separate the body and summary nodes, this simplifies the subsequent\n // tree walking logic:\n let body\n let summary\n visit(ast, ['body', 'summary'], (node) => {\n switch (node.type) {\n case 'body':\n body = node\n break\n case 'summary':\n summary = node\n break\n }\n })\n\n // <type>, \"(\", <scope>, \")\", [\"!\"], \":\", <whitespace>*, <text>\n visit(summary, (node) => {\n switch (node.type) {\n case 'type':\n cc.type = node.value\n cc.header += node.value\n break\n case 'scope':\n cc.scope = node.value\n cc.header += `(${node.value})`\n break\n case 'breaking-change':\n cc.header += '!'\n break\n case 'text':\n cc.subject = node.value\n cc.header += `: ${node.value}`\n break\n default:\n break\n }\n })\n\n // [<any body-text except pre-footer>]\n if (body) {\n visit(body, 'text', (node, _i, parent) => {\n // TODO(@bcoe): once we have \\n tokens in tree we can drop this:\n if (cc.body !== '') cc.body += '\\n'\n cc.body += node.value\n })\n }\n\n // Extract BREAKING CHANGE notes, regardless of whether they fall in\n // summary, body, or footer:\n const breaking = {\n title: 'BREAKING CHANGE',\n text: '' // \"text\" will be populated if a BREAKING CHANGE token is parsed.\n }\n visitWithAncestors(ast, ['breaking-change'], (node, ancestors) => {\n let parent = ancestors.pop()\n let startCollecting = false\n switch (parent.type) {\n case 'summary':\n breaking.text = cc.subject\n break\n case 'body':\n breaking.text = ''\n // We treat text from the BREAKING CHANGE marker forward as\n // the breaking change notes:\n visit(parent, ['text', 'breaking-change'], (node) => {\n // TODO(@bcoe): once we have \\n tokens in tree we can drop this:\n if (startCollecting && node.type === 'text') {\n if (breaking.text !== '') breaking.text += '\\n'\n breaking.text += node.value\n } else if (node.type === 'breaking-change') {\n startCollecting = true\n }\n })\n break\n case 'token':\n parent = ancestors.pop()\n visit(parent, 'text', (node) => {\n breaking.text = node.value\n })\n break\n }\n })\n if (breaking.text !== '') cc.notes.push(breaking)\n\n // Populates references array from footers:\n // references: [{\n // action: 'Closes',\n // owner: null,\n // repository: null,\n // issue: '1', raw: '#1',\n // prefix: '#'\n // }]\n visit(ast, ['footer'], (node) => {\n const reference = {\n prefix: '#'\n }\n let hasRefSepartor = false\n visit(node, ['type', 'separator', 'text'], (node) => {\n switch (node.type) {\n case 'type':\n // refs, closes, etc:\n // TODO(@bcoe): conventional-changelog does not currently use\n // \"reference.action\" in its templates:\n reference.action = node.value\n break\n case 'separator':\n // Footer of the form \"Refs #99\":\n if (node.value.includes('#')) hasRefSepartor = true\n break\n case 'text':\n // Footer of the form \"Refs: #99\"\n if (node.value.charAt(0) === '#') {\n hasRefSepartor = true\n reference.issue = node.value.substring(1)\n // TODO(@bcoe): what about references like \"Refs: #99, #102\"?\n } else {\n reference.issue = node.value\n }\n break\n }\n })\n // TODO(@bcoe): how should references like \"Refs: v8:8940\" work.\n if (hasRefSepartor && reference.issue.match(NUMBER_REGEX)) {\n cc.references.push(reference)\n }\n })\n\n return cc\n}", "parse(tree, depth) {\n if (Array.isArray(tree)) {\n return tree.map(node => this.parse(node, depth + 1)).join('');\n\n } else if(isProperty(tree)) {\n return this.addComment(tree, depth) + this.parseProperty(tree, depth);\n\n } else if (isExprStatement(tree)) {\n return this.parseExpression(tree);\n\n } else if (isVarDeclarator(tree)) {\n if (isCallableExpr(tree) || isArrowFunctionExpr(tree)) {\n return this.parseExpression(tree, true);\n }\n return tree.init.properties.map(node => this.parse(node, depth + 1)).join('');\n\n } else if (isVarDeclaration(tree)) {\n return tree.declarations.map(n => this.parse(n, depth - 1)).join('');\n\n } else if (isLabelStatement(tree) || isBlockStatement(tree)) {\n throw new Error('Grid options should be wrapped inside: const gridOptions = { ... }');\n\n } else {\n throw new Error(`Unexpected node encountered:\\n\\n${JSON.stringify(tree)}`);\n }\n }", "function grammarPrinter(raw, options) {\n if ((typeof raw === 'undefined' ? 'undefined' : _typeof(raw)) !== 'object') {\n raw = json5.parse(raw);\n }\n options = options || {};\n options.showLexer = options.showLexer !== undefined ? !!options.showLexer : true;\n options.showParser = options.showParser !== undefined ? !!options.showParser : true;\n switch (String(options.format).toLowerCase()) {\n default:\n case 'jison':\n options.format = 'jison';\n break;\n\n case 'json5':\n options.format = 'json5';\n break;\n\n case '.y':\n case '.yacc':\n options.format = 'jison';\n options.showLexer = false;\n options.showParser = true;\n break;\n\n case '.l':\n case '.lex':\n options.format = 'jison';\n options.showLexer = true;\n options.showParser = false;\n break;\n }\n\n function makeIndent(num) {\n return new Array(num + 1).join(' ');\n }\n\n function padRight(str, num) {\n return str + new Array(Math.max(0, num - str.length) + 1).join(' ');\n }\n\n function indentAction(src, num) {\n // It's dangerous to indent an action code chunk as it MAY contain **template strings**\n // which MAY get corrupted that way as their actual content would change then!\n\n // construct fake nesting levels to arrive at the intended start indent value: `num`\n var nesting_levels = num / 2;\n var pre = '// **PRE**',\n post = '// **POST**';\n for (; nesting_levels > 0; nesting_levels--) {\n pre = 'function x() {\\n' + pre;\n post += '\\n}';\n }\n src = '\\n' + pre + '\\n' + src + '\\n' + post + '\\n';\n\n var ast = helpers.parseCodeChunkToAST(src);\n var new_src = helpers.prettyPrintAST(ast);\n\n var start = new_src.indexOf('// **PRE**');\n var end = new_src.lastIndexOf('// **POST**');\n new_src = new_src.substring(start + 10, end).trim();\n\n return new_src;\n }\n\n function isEmptyObj(obj) {\n var keys = obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && Object.keys(obj);\n return keys && keys.length === 0;\n }\n\n function isEmptyArr(arr) {\n if (arr && arr instanceof Array) {\n for (var i = 0, len = arr.length; i < len; i++) {\n if (arr[i] !== undefined) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n\n // Copied from Crokford's implementation of JSON\n // See https://github.com/douglascrockford/JSON-js/blob/e39db4b7e6249f04a195e7dd0840e610cc9e941e/json2.js#L195\n // Begin\n var escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\'\n };\n\n function escapeString(string) {\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n escapable.lastIndex = 0;\n return escapable.test(string) ? '\"' + string.replace(escapable, function (a) {\n var c = meta[a];\n return typeof c === 'string' ? c : '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' : '\"' + string + '\"';\n }\n\n var ref_list;\n var ref_names;\n\n // create a deep copy of the input, so we can delete the parts we converted and dump the remainder\n // so that we always output the entire thing, even when we don't know all the details about the\n // actual input:\n function deepClone(from, sub) {\n if (sub == null) {\n ref_list = [];\n ref_names = [];\n sub = 'root';\n }\n if (typeof from === 'function') return '[Function]';\n if (from == null || (typeof from === 'undefined' ? 'undefined' : _typeof(from)) !== 'object') return from;\n if (from.constructor !== Object && from.constructor !== Array) {\n return from;\n }\n\n for (var i = 0, len = ref_list.length; i < len; i++) {\n if (ref_list[i] === from) {\n return '[Circular/Xref:' + ref_names[i] + ']'; // circular or cross reference\n }\n }\n ref_list.push(from);\n ref_names.push(sub);\n sub += '.';\n\n var to = new from.constructor();\n for (var name in from) {\n to[name] = deepClone(from[name], sub + name);\n }\n return to;\n }\n\n var originalInput = raw;\n raw = deepClone(raw);\n\n var lex_out_str = '';\n if (raw.lex) {\n var lex_pre = [];\n var lex_rules = [];\n var lex_post = [];\n var key, src;\n\n src = raw.lex.macros;\n delete raw.lex.macros;\n if (src && !isEmptyObj(src)) {\n lex_pre.push(rmCommonWS$5(_templateObject81));\n\n var keylen = 0;\n for (key in src) {\n keylen = Math.max(keylen, key.length);\n }\n console.log('macros keylen:', keylen);\n keylen = (keylen / 4 | 0) * 4 + 4;\n console.log('macros keylen B:', keylen);\n for (key in src) {\n lex_pre.push(padRight(key, keylen) + src[key]);\n }\n\n lex_pre.push(rmCommonWS$5(_templateObject82));\n }\n\n src = raw.lex.unknownDecls;\n delete raw.lex.unknownDecls;\n if (src && !isEmptyObj(src)) {\n lex_pre.push(rmCommonWS$5(_templateObject83));\n\n for (var i = 0, len = src.length; i < len; i++) {\n var entry = src[i];\n var key = entry[0];\n var value = entry[1];\n\n lex_pre.push('%' + key + ' ' + value);\n }\n\n lex_pre.push(rmCommonWS$5(_templateObject84));\n }\n\n src = raw.lex.options;\n delete raw.lex.options;\n if (src && !isEmptyObj(src)) {\n lex_pre.push(rmCommonWS$5(_templateObject85));\n\n for (key in src) {\n var value = src[key];\n if (value) {\n lex_pre.push('%options ' + key + '=' + value);\n } else {\n lex_pre.push('%options ' + key);\n }\n }\n }\n\n src = raw.lex.startConditions;\n delete raw.lex.startConditions;\n if (src && !isEmptyObj(src)) {\n for (key in src) {\n var value = src[key];\n\n lex_pre.push((value ? '%x ' : '%s ') + key);\n }\n }\n\n src = raw.lex.actionInclude;\n delete raw.lex.actionInclude;\n if (src && src.trim()) {\n lex_pre.push('%{\\n' + indentAction(src.trim(), 4) + '\\n%}');\n }\n\n src = raw.lex.rules;\n delete raw.lex.rules;\n if (src) {\n for (var i = 0, len = src.length; i < len; i++) {\n var entry = src[i];\n key = entry[0];\n var action = indentAction(entry[1], 4);\n\n var actionHasLF = /[\\r\\n]/.test(action);\n console.log('indented action:', {\n entry: entry[1],\n action: action,\n actionHasLF: actionHasLF\n });\n if (key.length <= 12) {\n if (!actionHasLF) {\n lex_rules.push(padRight(key, 16) + indentAction(action, 16));\n } else {\n lex_rules.push(padRight(key, 16) + '%' + indentAction('{ ' + action + ' }', 16) + '%');\n }\n } else {\n if (!actionHasLF) {\n lex_rules.push(key, makeIndent(16) + indentAction(action, 16));\n } else {\n lex_rules.push(key, makeIndent(16) + '%' + indentAction('{ ' + action + ' }', 16) + '%');\n }\n }\n }\n }\n\n src = raw.lex.moduleInclude;\n delete raw.lex.moduleInclude;\n if (src && src.trim()) {\n lex_post.push(indentAction(src.trim(), 0));\n }\n\n var out = '';\n\n if (!isEmptyObj(raw.lex)) {\n // dump the remainder as a comment:\n var rem = json5.stringify(raw.lex, null, 2);\n out += rmCommonWS$5(_templateObject86, rem.replace(/\\*\\//g, '*\\\\/'));\n }\n delete raw.lex;\n\n out += lex_pre.join('\\n') + '\\n\\n';\n out += rmCommonWS$5(_templateObject87) + lex_rules.join('\\n') + '\\n\\n';\n if (lex_post.length > 0) {\n out += rmCommonWS$5(_templateObject88) + lex_post.join('\\n') + '\\n\\n';\n }\n lex_out_str = out;\n }\n\n var grammar_pre = [];\n var grammar_mid = [];\n var ebnf_rules = [];\n var bnf_rules = [];\n var grammar_post = [];\n var key, src;\n\n var fmtprod = function fmtprod(rule, prodset) {\n var backup = deepClone(prodset);\n\n rule += prodset[0] ? prodset[0] : '%epsilon';\n var prec = null;\n var lead = rule.split(/\\r\\n\\|\\n|\\r/).pop();\n delete prodset[0];\n\n if (prodset.length === 3 && _typeof(prodset[2]) === 'object') {\n prec = '%prec ' + prodset[2].prec;\n if (lead.length < 12) {\n rule += makeIndent(12 - lead.length);\n }\n rule += ' ' + prec;\n\n delete prodset[2].prec;\n if (isEmptyObj(prodset[2])) {\n delete prodset[2];\n }\n } else if (prodset.length === 2 && _typeof(prodset[1]) === 'object') {\n prec = '%prec ' + prodset[1].prec;\n if (lead.length < 12) {\n rule += makeIndent(12 - lead.length);\n }\n rule += ' ' + prec;\n\n delete prodset[1].prec;\n if (isEmptyObj(prodset[1])) {\n delete prodset[1];\n }\n }\n if (typeof prodset[1] === 'string') {\n var action = prodset[1];\n if (lead.length < 12 - 1) {\n rule += makeIndent(12 - lead.length) + indentAction('{ ' + action + ' }', 12);\n } else {\n rule += '\\n' + makeIndent(12) + indentAction('{ ' + action + ' }', 12);\n }\n delete prodset[1];\n }\n\n if (isEmptyArr(prodset)) {\n prodset.length = 0;\n } else {\n prodset = backup;\n }\n return rule;\n };\n\n var grammarfmt = function grammarfmt(src) {\n var key;\n var dst = [];\n\n for (key in src) {\n var prodset = src[key];\n var rule;\n console.log('format one rule:', {\n key: key,\n prodset: prodset\n });\n\n if (typeof prodset === 'string') {\n rule = fmtprod(key + ' : ', [prodset]) + ';';\n delete src[key];\n } else if (prodset instanceof Array) {\n if (prodset.length === 1) {\n if (typeof prodset[0] === 'string') {\n rule = fmtprod(key + ' : ', [prodset]) + ';';\n delete src[key];\n } else if (prodset[0] instanceof Array) {\n rule = fmtprod(key + ' : ', prodset[0]);\n rule += '\\n ;';\n if (prodset[0].length === 0) {\n delete src[key];\n }\n } else {\n rule = key + '\\n : **ERRONEOUS PRODUCTION** (see the dump for more): ' + prodset[0];\n }\n } else if (prodset.length > 1) {\n if (typeof prodset[0] === 'string') {\n rule = fmtprod(key + '\\n : ', [prodset[0]]);\n delete prodset[0];\n } else if (prodset[0] instanceof Array) {\n rule = fmtprod(key + '\\n : ', prodset[0]);\n if (prodset[0].length === 0) {\n delete prodset[0];\n }\n } else {\n rule = key + '\\n : **ERRONEOUS PRODUCTION** (see the dump for more): ' + prodset[0];\n }\n for (var i = 1, len = prodset.length; i < len; i++) {\n if (typeof prodset[i] === 'string') {\n rule += fmtprod('\\n | ', [prodset[i]]);\n delete prodset[i];\n } else if (prodset[i] instanceof Array) {\n rule += fmtprod('\\n | ', prodset[i]);\n if (prodset[i].length === 0) {\n delete prodset[i];\n }\n } else {\n rule += '\\n | **ERRONEOUS PRODUCTION** (see the dump for more): ' + prodset[i];\n }\n }\n rule += '\\n ;';\n\n if (isEmptyArr(prodset)) {\n delete src[key];\n }\n }\n } else {\n rule = key + '\\n : **ERRONEOUS PRODUCTION** (see the dump for more): ' + prodset;\n }\n dst.push(rule);\n }\n\n return dst;\n };\n\n src = raw.ebnf;\n if (src) {\n ebnf_rules = grammarfmt(src);\n\n if (isEmptyObj(src)) {\n delete raw.ebnf;\n }\n }\n\n src = raw.bnf;\n //delete raw.bnf;\n if (src) {\n bnf_rules = grammarfmt(src);\n\n if (isEmptyObj(src)) {\n delete raw.bnf;\n }\n }\n\n src = raw.unknownDecls;\n delete raw.unknownDecls;\n if (src && !isEmptyObj(src)) {\n lex_pre.push(rmCommonWS$5(_templateObject89));\n\n for (var i = 0, len = src.length; i < len; i++) {\n var entry = src[i];\n var key = entry[0];\n var value = entry[1];\n\n lex_pre.push('%' + key + ' ' + value);\n }\n\n lex_pre.push(rmCommonWS$5(_templateObject90));\n }\n\n //src = raw.lex;\n //delete raw.lex;\n //if (src) {\n if (lex_out_str.trim() && options.showLexer) {\n grammar_pre.push(rmCommonWS$5(_templateObject91, lex_out_str));\n }\n\n src = raw.options;\n delete raw.options;\n if (src && !isEmptyObj(src)) {\n var a = [];\n for (key in src) {\n var value = src[key];\n switch (key) {\n default:\n if (value !== true) {\n a.push('options', '%options ' + key + '=' + value);\n } else {\n a.push('options', '%options ' + key);\n }\n break;\n\n case 'ebnf':\n if (value) {\n a.push(key, '%ebnf');\n }\n break;\n\n case 'type':\n if (value) {\n a.push(key, '%parser-type ' + value);\n }\n break;\n\n case 'debug':\n if (typeof value !== 'boolean') {\n a.push(key, '%debug ' + value);\n } else if (value) {\n a.push(key, '%debug');\n }\n break;\n }\n }\n var type = null;\n for (var i = 0, len = a.length; i < len; i += 2) {\n var t = a[i];\n var line = a[i + 1];\n if (t !== type) {\n type = t;\n grammar_pre.push('');\n }\n grammar_pre.push(line);\n }\n grammar_pre.push('');\n }\n\n src = raw.imports;\n if (src) {\n var clean = true;\n for (var i = 0, len = src.length; i < len; i++) {\n var entry = src[i];\n\n grammar_pre.push('%import ' + entry.name + ' ' + entry.path);\n delete entry.name;\n delete entry.path;\n if (isEmptyObj(entry)) {\n delete src[i];\n } else {\n clean = false;\n }\n }\n if (clean) {\n delete raw.imports;\n }\n }\n\n src = raw.moduleInit;\n if (src) {\n var clean = true;\n for (var i = 0, len = src.length; i < len; i++) {\n var entry = src[i];\n\n grammar_pre.push('%code ' + entry.qualifier + ' ' + entry.include);\n delete entry.qualifier;\n delete entry.include;\n if (isEmptyObj(entry)) {\n delete src[i];\n } else {\n clean = false;\n }\n }\n if (clean) {\n delete raw.moduleInit;\n }\n }\n\n src = raw.operators;\n if (src) {\n var clean = true;\n for (var i = 0, len = src.length; i < len; i++) {\n var entry = src[i];\n var tokens = entry[1];\n var line = '%' + entry[0] + ' ';\n\n for (var t = 0, tlen = tokens.length; t < tlen; t++) {\n line += ' ' + tokens[t];\n }\n\n grammar_pre.push(line);\n\n if (entry.length === 2) {\n delete src[i];\n } else {\n clean = false;\n }\n }\n if (clean) {\n delete raw.operators;\n }\n }\n\n src = raw.extra_tokens;\n if (src) {\n var clean = true;\n for (var i = 0, len = src.length; i < len; i++) {\n var entry = src[i];\n var line = '%token ' + entry.id;\n\n if (entry.type) {\n line += ' <' + entry.type + '>';\n delete entry.type;\n }\n if (entry.value) {\n line += ' ' + entry.value;\n delete entry.value;\n }\n if (entry.description) {\n line += ' ' + escapeString(entry.description);\n delete entry.description;\n }\n\n grammar_pre.push(line);\n\n delete entry.id;\n if (isEmptyObj(entry)) {\n delete src[i];\n } else {\n clean = false;\n }\n }\n if (clean) {\n delete raw.extra_tokens;\n }\n }\n\n src = raw.parseParams;\n delete raw.parseParams;\n if (src) {\n grammar_pre.push('%parse-param ' + src.join(' '));\n }\n\n src = raw.start;\n delete raw.start;\n if (src) {\n grammar_pre.push('%start ' + src);\n }\n\n src = raw.moduleInclude;\n delete raw.moduleInclude;\n if (src && src.trim()) {\n grammar_post.push(indentAction(src.trim(), 0));\n }\n\n src = raw.actionInclude;\n delete raw.actionInclude;\n if (src && src.trim()) {\n grammar_mid.push('%{\\n' + indentAction(src.trim(), 4) + '\\n%}');\n }\n\n var out = '';\n\n if (!isEmptyObj(raw)) {\n // dump the remainder as a comment:\n var rem = json5.stringify(raw, null, 2);\n out += rmCommonWS$5(_templateObject92, rem.replace(/\\*\\//g, '*\\\\/'));\n // delete raw;\n }\n\n if (!options.showParser) {\n out += lex_out_str;\n } else {\n out += grammar_pre.join('\\n') + '\\n\\n';\n out += rmCommonWS$5(_templateObject87);\n if (grammar_mid.length > 0) {\n out += grammar_mid.join('\\n') + '\\n\\n';\n }\n if (ebnf_rules.length > 0) {\n if (bnf_rules.length > 0) {\n // dump the original EBNF grammar as source and dump the BNF derivative as COMMENT:\n var bnf_deriv = bnf_rules.join('\\n\\n');\n var a = bnf_deriv.split(/\\r\\n|\\n|\\r/).map(function (line) {\n return '// ' + line;\n });\n\n out += rmCommonWS$5(_templateObject93, a.join('\\n'));\n }\n out += ebnf_rules.join('\\n\\n') + '\\n\\n';\n } else if (bnf_rules.length > 0) {\n out += bnf_rules.join('\\n\\n') + '\\n\\n';\n }\n\n if (grammar_post.length > 0) {\n out += rmCommonWS$5(_templateObject88) + grammar_post.join('\\n') + '\\n\\n';\n }\n }\n\n if (options.format === 'json5') {\n var a = out.split(/\\r\\n|\\n|\\r/).map(function (line) {\n return '// ' + line;\n });\n\n out = rmCommonWS$5(_templateObject94, options.showParser ? 'grammar' : 'lexer', a.join('\\n'));\n\n // process the original input once again: this time via JSON5\n raw = deepClone(originalInput);\n\n if (!options.showLexer) {\n delete raw.lex;\n out += JSON5.stringify(raw, null, 2);\n } else if (!options.showParser) {\n out += JSON5.stringify(raw.lex, null, 2);\n }\n }\n\n return out;\n}", "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "function makeText(node, stat) {\n switch (typeof node) {\n case 'object':\n //return JSON.stringify(node);\n //node = removeNumberedIndices(node);\n return breakout(node, stat);\n break;\n case 'undefined':\n return '0';\n break;\n default:\n return node.toString();\n }\n }", "function print(ast) {\n\t\t return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n\t\t}", "function print(ast) {\n\t return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n\t}", "function print(ast) {\n\t return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n\t}", "function print(ast) {\n\t return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n\t}", "function print(ast) {\n return (0, visitor.visit)(ast, { leave: printDocASTReducer });\n }", "function print(ast) {\n return (0,_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "function print(ast) {\n return (0,_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "function _node2string(node) {\n return node.source || stringify(node);\n}", "function outputParseTreeForString(input, rule) {\n let ast = myna.parse(rule, input);\n let html = markdownAstToHtml(ast, []); \n console.log(html.join(\"\"));\n}", "function _print(tree, depth) {\n let n = depth;\n let padding = '';\n\n while (n--) {\n padding += ' ';\n }\n\n if (tree instanceof BinOp) {\n return padding + tree.value\n + '\\n' + print(tree.left, depth + 1)\n + print(tree.right, depth + 1);\n }\n else if (tree instanceof UnOp) {\n return padding + tree.value\n + '\\n' + print(tree.left, depth + 1);\n }\n else if (tree instanceof Func) {\n return padding + tree.value\n + '\\n' + tree.args.map(v => print(v, depth + 1)).join('');\n }\n else {\n return padding + tree.value + '\\n';\n }\n}", "function printAstToDoc( ast, options, alignmentSize = 0 ) {\n\tconst { printer } = options;\n\n\tif ( printer.preprocess ) {\n\t\tast = printer.preprocess( ast, options );\n\t}\n\n\tconst cache = new Map();\n\n\tfunction printGenerically( path, args ) {\n\t\tconst node = path.getValue();\n\t\tconst shouldCache = node && typeof node === 'object' && args === undefined;\n\n\t\tif ( shouldCache && cache.has( node ) ) {\n\t\t\treturn cache.get( node );\n\t\t} // We let JSXElement print its comments itself because it adds () around\n\t\t// UnionTypeAnnotation has to align the child without the comments\n\n\t\tlet res;\n\n\t\tif ( printer.willPrintOwnComments && printer.willPrintOwnComments( path, options ) ) {\n\t\t\tres = callPluginPrintFunction( path, options, printGenerically, args );\n\t\t} else {\n\t\t\t// printComments will call the plugin print function and check for\n\t\t\t// comments to print\n\t\t\tres = comments.printComments( path, ( p ) => callPluginPrintFunction( p, options, printGenerically, args ), options, args && args.needsSemi );\n\t\t}\n\n\t\tif ( shouldCache ) {\n\t\t\tcache.set( node, res );\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tlet doc = printGenerically( new fastPath( ast ) );\n\n\tif ( alignmentSize > 0 ) {\n\t\t// Add a hardline to make the indents take effect\n\t\t// It should be removed in index.js format()\n\t\tdoc = addAlignmentToDoc$1( concat$3( [ hardline$2, doc ] ), alignmentSize, options.tabWidth );\n\t}\n\n\tdocUtils$1.propagateBreaks( doc );\n\treturn doc;\n}", "prettyFormat(text) {\n return this.parser.parse(text);\n }", "function printAstToDoc(ast, options, alignmentSize = 0) {\n const {\n printer\n } = options;\n\n if (printer.preprocess) {\n ast = printer.preprocess(ast, options);\n }\n\n const cache = new Map();\n\n function printGenerically(path, args) {\n const node = path.getValue();\n const shouldCache = node && typeof node === \"object\" && args === undefined;\n\n if (shouldCache && cache.has(node)) {\n return cache.get(node);\n } // We let JSXElement print its comments itself because it adds () around\n // UnionTypeAnnotation has to align the child without the comments\n\n\n let res;\n\n if (printer.willPrintOwnComments && printer.willPrintOwnComments(path, options)) {\n res = callPluginPrintFunction(path, options, printGenerically, args);\n } else {\n // printComments will call the plugin print function and check for\n // comments to print\n res = comments.printComments(path, p => callPluginPrintFunction(p, options, printGenerically, args), options, args && args.needsSemi);\n }\n\n if (shouldCache) {\n cache.set(node, res);\n }\n\n return res;\n }\n\n let doc = printGenerically(new fastPath(ast));\n\n if (alignmentSize > 0) {\n // Add a hardline to make the indents take effect\n // It should be removed in index.js format()\n doc = addAlignmentToDoc$1(concat$4([hardline$2, doc]), alignmentSize, options.tabWidth);\n }\n\n docUtils$1.propagateBreaks(doc);\n return doc;\n}", "toString() {\n let built = '';\n\n for (const prop of Object.keys(this.decls)) {\n let parsed;\n\n try {\n parsed = _postcss.default.parse(`${prop}:${this.decls[prop]}`, {\n from: undefined\n });\n } catch (e) {// A declaration that have value it cannot parse will ignore.\n }\n\n if (parsed) {\n parsed.each(node => {\n if (node.type !== 'decl' || node.prop !== prop) node.remove();\n });\n built += `${parsed.toString()};`;\n }\n }\n\n return built;\n }", "function formatCode() {\n return through.obj(function (file, encoding, callback) {\n\n let formatted = esformatter.format(file.contents.toString(), esOpts);\n\n // With the existing tools I haven't found a way to format <Foo/> as <Foo />. The space before the closing\n // bracket is required for the Airbnb eslint rules to validate the file. The following replace() just adds that\n // in manually. Hopefully this can be replaced with a slution integrated into the above tooling sometime.\n formatted = formatted.replace(/(<[\\w]*)(\\/>)/g, '$1 $2');\n\n file.contents = new Buffer(formatted);\n\n callback(null, file);\n });\n}", "function formatEditor () {\r\n var formula = editor.innerText\r\n\r\n // retain cursor position: + anchorOffset after anchorNode\r\n var caretPosition = getCaretPosition()\r\n\r\n // let us tokenize\r\n var tokens = tokenize(formula)\r\n var formulaHTML = ''\r\n for (var i = 0; i < tokens.length; i++) {\r\n // simplify later\r\n var token = tokens[i]\r\n var spanned = lexicalDict[token.type].htmlChunk(i, token.value)\r\n formulaHTML = formulaHTML.concat(spanned)\r\n }\r\n\r\n editor.innerHTML = formulaHTML\r\n restoreCaretPosition(caretPosition)\r\n}", "function print(ast) {\n return (0, visitor.visit)(ast, { leave: printDocASTReducer });\n}", "function print(ast) {\n return Object(_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "function print_form(ast) {\n if (ast instanceof Array) { \n return print_list(ast);\n } else if (ast instanceof Function) {\n return print_function(ast);\n } else if (ast instanceof Object && ast.fn) {\n return print_function(ast);\n } else {\n return print_atom(ast);\n }\n}", "function print(ast) {\n return Object(_visitor__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "function print(ast) {\n return Object(_visitor__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "function print(ast) {\n return Object(_visitor__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "function renderToString($, indent, level) {\n let attrs = getAttrs($.node.props);\n let s1 = `<${$.node.type}${renderAttrsToString(attrs)}>`;\n if (Tools.isVoidElement($.node.type)) {\n return Tools.format(s1, indent, level);\n }\n let s3 = `</${$.node.type}>`;\n if ($.node.children.length === 0) {\n return Tools.format(s1 + s3, indent, level);\n }\n let s2;\n if ($.node.children.length === 1 && $.node.children[0].type === \"#\") {\n s2 = $.childWraps[0].renderToString(0, 0);\n return Tools.format(s1 + s2 + s3, indent, level);\n }\n s1 = Tools.format(s1, indent, level);\n s2 = $.childWraps.map(x => x.renderToString(indent, level + 1)).join(\"\");\n s3 = Tools.format(s3, indent, level);\n return s1 + s2 + s3;\n}", "function print_atom(ast) {\n if (ast == null) {\n return \"nil\";\n }\n return ast.toString();\n}", "function print(ast) {\n return Object(_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n}", "function dump() {\n if ( noDump ) {\n return;\n }\n\n function toStr( node ) {\n if ( node === null ) {\n return \"()\";\n }\n else {\n return \"(\" +\n (node.red ? \"R\" : \"B\") + \" \" +\n node.data +\n ( node.left === null && node.right === null ? \"\" :\n \" \" + toStr(node.left) + \" \" + toStr(node.right) ) +\n \")\";\n }\n }\n\n console.log(\"CMP \" + toStr(tree._root))\n}", "static format (stringDefinition = '') {\n // Test to \n\n let combinatorLiteralFormat = /(\\|\\||\\||&&|\\[|\\]|,(?=[^{}]*(?:{|$))|\\/|<[^>]*>)/g\n let multiplyerFormat = /\\s*(\\*|\\+|\\?|\\{[^\\}]*\\}|\\#|\\!)/g;\n return stringDefinition.replace(combinatorLiteralFormat, ' $1 ')\n .replace(multiplyerFormat, '$1 ').replace(/\\s+/g, ' ').trim();\n }", "function print(ast) {\n return Object(visitor[\"b\" /* visit */])(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "function print_list(ast) {\n const peek = ast[1];\n indent++;\n\n const tabs = tab.repeat(indent);\n const ifBr = indent ? br : '';\n const ifTabs = indent ? tabs : '';\n \n let list = `${ifBr}${ifTabs}(${ast.map(print_form).join(\" \")}`;\n \n indent--;\n \n console.log(peek);\n console.log(list);\n \n if (peek && !(peek instanceof Array)) {\n list = `${list})${br}${tabs}`;\n } else if (peek) {\n list = `${list}${tabs})`;\n } else {\n list = `${list})`;\n }\n\n return list;\n}", "function debugLog(ast) {\n console.log( pr_str( ast ) );\n}", "function nodeToString(typeNode) {\n return LineFeedPrinter_1.lineFeedPrinter.printNode(typescript_1.EmitHint.Unspecified, typeNode, typeNode.getSourceFile());\n}", "function print(ast) {\n return Object(_visitor__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n}", "function print(ast) {\n return visit(ast, printDocASTReducer);\n}", "function parseExpression($ast, declaration) {\n return (0, _stringify.stringify)($ast(declaration).children('value').get(0)).trim();\n}", "function toAST(concrete) {\n let rule = concrete.rule,\n production = concrete.production,\n term = production[0],\n expr1 = production[1];\n let Aterm = termToAST(term);\n let Aexpr1 = expr1ToAST(Aterm, expr1);\n return Aexpr1;\n}", "function Format() {}", "function Format() {}", "toString()\n\t{\n\t\treturn this.toStringRecursion(this.octree);\n\t}", "text(pretty, anon) {\n let printer = new Printer(this.store);\n if (pretty) printer.indent = \" \";\n if (anon) printer.refs = null;\n printer.print(this);\n return printer.output;\n }", "function church_astify(tokens) {\n\t// astify changes the opening bracket tokens so the end site is the matching closing bracket\n\tfunction astify(tokens) {\n\n\t\tfunction helper(opening_bracket) {\n\t\t\t// Tree nodes have keys [children, start, end]\n\t\t\tvar result = {children: [], start: opening_bracket ? opening_bracket.start : \"1:1\"};\n\t\t\twhile (tokens.length > 0) {\n\t\t\t\tif (tokens[0].text == \"(\" || tokens[0].text == \"[\") {\n\t\t\t\t\tvar bracket = tokens[0];\n\t\t\t\t\tstorage.push(tokens.shift());\n\t\t\t\t\tresult.children.push(helper(bracket));\n\t\t\t\t} else if (tokens[0].text == \")\" || tokens[0].text == \"]\") {\n\t\t\t\t\tif (!opening_bracket || tokens[0].text != brackets_map[opening_bracket.text]) {\n\t\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", tokens[0].start, tokens[0].end, \"Unexpected close parens\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult[\"end\"] = tokens[0].start;\n\t\t\t\t\t\topening_bracket.end = tokens[0].start;\n\t\t\t\t\t\tstorage.push(tokens.shift());\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar token = tokens.shift();\n\t\t\t\t\tstorage.push(token);\n\t\t\t\t\tresult.children.push(token);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!opening_bracket) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", opening_bracket.start, opening_bracket.end, \"Unclosed parens\");\n\t\t\t}\n\t\t}\n\t\tvar storage = [];\n\t\tvar ast = helper();\n\t\tfor (var i = 0; i < storage.length; i++) {\n\t\t\ttokens.push(storage[i]);\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction traverse(ast, fn, stopfn) {\n\t\tif (!util.is_leaf(ast) && ast.children.length > 0 && (!stopfn || !stopfn(ast))) {\n\t\t\tast = fn(ast);\n\t\t\tfor (var i = 0; i < ast.children.length; i++) {\n\t\t\t\tast.children[i] = traverse(ast.children[i], fn, stopfn);\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction is_special_form(text) {\n\t\treturn [\"define\", \"lambda\", \"case\", \"cond\", \"if\", \"let\"].indexOf(text) != -1;\n\t}\n\n\tfunction assert_not_special_form(node) {\n\t\tif (is_special_form(node.text)) {\n\t\t\tthrow util.make_church_error(\"SyntaxError\", node.start, node.end, \"Special form \" + node.text + \" cannot be used as an atom\");\n\t\t}\n\t}\n\n\tfunction validate_leaves(ast) {\n\t\tfor (var i = 1; i < ast.children.length; i++) {\n\t\t\tassert_not_special_form(ast.children[i]);\n\t\t}\n\t\treturn ast;\n\t}\n\n\t// NOTE: Many of the desugar functions don't add range information.\n\t// For now, it seems unlikely they'll be needed.\n\n\tfunction dsgr_define(ast) {\n\t\tif (ast.children[0].text==\"define\") {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"Invalid define\");\n\t\t\t}\n\t\t\t// Function define sugar\n\t\t\tif (!util.is_leaf(ast.children[1])) {\n\t\t\t\tvar lambda_args;\n\t\t\t\t// Variadic sugar\n\t\t\t\tif (ast.children[1].children.length == 3 && ast.children[1].children[1].text == \".\") {\n\t\t\t\t\tlambda_args = ast.children[1].children[2];\n\t\t\t\t} else {\n\t\t\t\t\tlambda_args = {children: ast.children[1].children.slice(1)};\n\t\t\t\t}\n\t\t\t\tvar lambda = {\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\t\tlambda_args\n\t\t\t\t\t].concat(ast.children.slice(2))\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tchildren: [ast.children[0], ast.children[1].children[0], lambda],\n\t\t\t\t\tstart: ast.start,\n\t\t\t\t\tend: ast.end\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction dsgr_lambda(ast) {\n\t\tif (ast.children[0].text==\"lambda\") {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"lambda has no body\");\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction dsgr_let(ast) {\n\t\tvar let_varieties = [\"let\", \"let*\"];\n\n\t\tif (let_varieties.indexOf(ast.children[0].text)!=-1) {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, ast.children[0].text + \" has no body\");\n\t\t\t}\n\t\t\tvar bindings = ast.children[1];\n\t\t\tvar valid_bindings = true;\n\t\t\tif (util.is_leaf(bindings)) {\n\t\t\t\tvalid_bindings = false;\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < bindings.children.length; i++) {\n\t\t\t\t\tif (util.is_leaf(bindings.children[i]) || bindings.children[i].children.length != 2) {\n\t\t\t\t\t\tvalid_bindings = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!valid_bindings) {\n\t\t\t\tthrow util.make_church_error_range(\"SyntaxError\", bindings.start, bindings.end, ast.children[0].text + \" has invalid bindings\");\n\t\t\t}\n\n\t\t\tswitch (ast.children[0].text) {\n\t\t\t\tcase \"let\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\t\t\t\t\t{children: bindings.children.map(function(x) {return x.children[0]})},\n\t\t\t\t\t\t\t\t\tast.children[2]\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t].concat(bindings.children.map(function(x) {return x.children[1]}))\n\t\t\t\t\t};\n\t\t\t\tcase \"let*\":\n\t\t\t\t\tvar new_ast = {\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\t\t\t\t\t{children: []},\n\t\t\t\t\t\t\t\t\tast.children[2]\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\tfor (var i = bindings.children.length-1; i >= 0; i--) {\n\t\t\t\t\t\t// console.log(JSON.stringify(bindings.children[i].children[0],undefined,2))\n\t\t\t\t\t\tnew_ast = {\n\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\t\t\t\t\t\t{children: [bindings.children[i].children[0]]},\n\t\t\t\t\t\t\t\t\t\tnew_ast\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\tbindings.children[i].children[1]\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn new_ast;\n\t\t\t}\n\n\n\t\t} else {\n\t\t\treturn ast;\n\t\t}\n\t}\n\n\tfunction dsgr_quote(ast) {\n\t\tvar last = ast.children[ast.children.length-1];\n\t\tif (last.text==\"'\") {\n\t\t\tthrow util.make_church_error(\"SyntaxError\", last.start, last.end, \"Invalid single quote\");\n\t\t}\n\t\tfor (var i = ast.children.length - 2; i >= 0; i--) {\n\t\t\tif (ast.children[i].text == \"'\") {\n\t\t\t\tast.children.splice(i, 2, {\n\t\t\t\t\tchildren: [{text: \"quote\", start: ast.children[i].start, end: ast.children[i].end}, ast.children[i+1]],\n\t\t\t\t\tstart: ast.children[i].start,\n\t\t\t\t\tend: ast.children[i+1].end\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction dsgr_case(ast) {\n\t\tfunction case_helper(key, clauses) {\n\t\t\tif (clauses.length == 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tvar clause = clauses[0];\n\t\t\tif (util.is_leaf(clause) || clause.children.length != 2 ||\n\t\t\t\t(util.is_leaf(clause.children[0]) && clause.children[0].text!=\"else\")) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", clause.start, clause.end, \"Bad clause for case\");\n\t\t\t}\n\n\t\t\tif (clause.children[0].text==\"else\") {\n\t\t\t\tif (clauses.length > 1) {\n\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", clause.start, clause.end, \"Bad placement of else clause in case\");\n\t\t\t\t} else {\n\t\t\t\t\treturn clause.children[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < clause.children[0]; i++) {\n\t\t\t\t\tvar datum = clause.children[0].children[i];\n\t\t\t\t\tif (util.is_leaf(datum)) {\n\t\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", datum.start, datum.end, \" for case\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar next = case_helper(key, clauses.slice(1));\n\t\t\t\tvar new_ast = {\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{text: \"if\"},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t{text: \"member\"},\n\t\t\t\t\t\t\t\tkey,\n {children: [{text: \"list\"}].concat(clause.children[0].children)}\n\t\t\t\t\t\t\t\t// {children: [{text: \"list\"}].concat(clause.children[0])}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclause.children[1]\n\t\t\t\t\t]\n\t\t\t\t};\n\t\t\t\tif (next) {\n\t\t\t\t\tnew_ast.children.push(next);\n\t\t\t\t}\n\t\t\t\treturn new_ast;\n\t\t\t}\n\t\t}\n\n\t\tif (ast.children[0].text==\"case\") {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"case is missing clauses\");\n\t\t\t}\n\t\t\treturn case_helper(ast.children[1], ast.children.slice(2));\n\t\t} else {\n\t\t\treturn ast;\n\t\t}\n\t}\n\n\tfunction dsgr_cond(ast) {\n\t\tfunction cond_helper(clauses) {\n\t\t\tif (clauses.length == 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tvar clause = clauses[0];\n\t\t\tif (util.is_leaf(clause) || clause.children.length != 2) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", clause.start, clause.end, \"Bad clause for cond\");\n\t\t\t}\n\t\t\tif (clause.children[0].text==\"else\") {\n\t\t\t\tif (clauses.length > 1) {\n\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", clause.start, clause.end, \"Bad placement of else clause in cond\");\n\t\t\t\t} else {\n\t\t\t\t\treturn clause.children[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar next = cond_helper(\n\t\t\t\t\tclauses.slice(1));\n\t\t\t\tvar new_ast = {\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{text: \"if\"},\n\t\t\t\t\t\tclause.children[0],\n\t\t\t\t\t\tclause.children[1]\n\t\t\t\t\t]\n\t\t\t\t};\n\t\t\t\tif (next) {\n\t\t\t\t\tnew_ast.children.push(next);\n\t\t\t\t}\n\t\t\t\treturn new_ast;\n\t\t\t}\n\t\t}\n\n\t\tif (ast.children[0].text==\"cond\") {\n\t\t\tif (ast.children.length < 2) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"cond is missing clauses\");\n\t\t\t}\n\t\t\treturn cond_helper(ast.children.slice(1));\n\t\t} else {\n\t\t\treturn ast;\n\t\t}\n\t}\n\n function dsgr_eval(ast) {\n if (ast.children[0].text == \"eval\") {\n return {\n\t\t\t\tchildren: [\n\t\t\t\t\t{text: \"eval\"},\n\t\t\t\t\t{\n children: [\n // churchToBareJs: for use in eval only\n {text: \"churchToBareJs\"},\n {\n children: [\n {text: \"formatResult\"},\n ast.children[1]\n ]\n }\n ]\n } \n ]\n }\n\t\t\n\t}\n return ast;\n };\n\n\tfunction dsgr_query(ast) {\n\t\t// Makes the lambda that's passed to the query function\n\t\tfunction query_helper(statements, condition, args) {\n\t\t\tif (util.is_leaf(condition) ||\n (condition.children[0].text != \"condition\" && condition.children[0].text != \"factor\")) {\n\t\t\t\tcondition = {\n\t\t\t\t\tchildren: [{text: \"condition\"}, condition],\n\t\t\t\t\tstart: condition.start,\n\t\t\t\t\tend: condition.end\n\t\t\t\t};\n\t\t\t}\n\t\t\targs = args || {children: []};\n\t\t\treturn {\n\t\t\t\tchildren: [\n\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\targs\n\t\t\t\t].concat(statements.slice(0, -1)).concat(condition).concat(statements[statements.length-1])\n\t\t\t};\n\t\t}\n\t\t\n\t\tif ([\"rejection-query\", \"enumeration-query\"].indexOf(ast.children[0].text) != -1) {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, ast.children[0].text + \" has the wrong number of arguments\");\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tchildren: [\n\t\t\t\t\tast.children[0],\n\t\t\t\t\tquery_helper(ast.children.slice(1, -1), ast.children[ast.children.length-1])\n\t\t\t\t],\n\t\t\t\tstart: ast.start,\n\t\t\t\tend: ast.end\n\t\t\t};\n\t\t}\n\t\tif ([\"mh-query\"].indexOf(ast.children[0].text) != -1) {\n\t\t\tif (ast.children.length < 6) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, ast.children[0].text + \" has the wrong number of arguments\");\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tchildren: [\n\t\t\t\t\tast.children[0],\n\t\t\t\t\tquery_helper(ast.children.slice(3, -1), ast.children[ast.children.length-1])\n\t\t\t\t].concat(ast.children.slice(1, 3)),\n\t\t\t\tstart: ast.start,\n\t\t\t\tend: ast.end\n\t\t\t};\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction validate_if(ast) {\n\t\tif (ast.children[0].text==\"if\") {\n\t\t\tif (ast.children.length < 3 || ast.children.length > 4) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"if has the wrong number of arguments\");\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n \n\tfunction transform_equals_condition(ast) {\n\t\tfunction is_equals_conditionable(ast) {\n\t\t\tif (util.is_leaf(ast)) return false;\n\t\t\tvar fn = church_builtins.__annotations__[rename_map[ast.children[0].text]];\n\t\t\treturn fn && fn.erp && ast.children[fn.numArgs[fn.numArgs.length-1]] == undefined;\n\t\t}\n\n\t\tfunction transform_erp(erp, conditioned_value) {\n\t\t\terp.children.push(conditioned_value);\n\t\t}\n\n\t\tfunction try_transform(left, right) {\n\t\t\tif (left == undefined) return false;\n\t\t\tif (is_equals_conditionable(left)) {\n\t\t\t\ttransform_erp(left, right);\n\t\t\t\tstatements.splice(i, 1, left);\n\t\t\t\treturn true;\n\t\t\t} else if (util.is_leaf(left) && define_table[left.text]) {\n\t\t\t\tvar left_entry = define_table[left.text];\n\t\t\t\tif (!util.is_identifier(right.text) || (\n\t\t\t\t\t\tdefine_table[right.text] && left_entry.index > define_table[right.text].index)) {\n\t\t\t\t\ttransform_erp(left_entry.def, right);\n\t\t\t\t\tstatements.splice(i, 1);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tvar transformed;\n\t\tif ([\"rejection-query\", \"enumeration-query\", \"mh-query\"].indexOf(ast.children[0].text) != -1) {\t\t\t\n\t\t\tvar define_table = {};\n\t\t\t// Assumes preprocessing through dsgr_query\n\t\t\tvar statements = ast.children[1].children.slice(2);\n\t\t\tvar i = 0;\n\t\t\t// Iterate through each lambda statement\n\t\t\tfor (var i = 0; i < statements.length; i++) {\n\t\t\t\tif (!util.is_leaf(statements[i])) {\n\t\t\t\t\t// If statement is a define and an ERP without an existing condition, put it in a table\n\t\t\t\t\tif (statements[i].children[0].text == \"define\" && is_equals_conditionable(statements[i].children[2])) {\n\t\t\t\t\t\tdefine_table[statements[i].children[1].text] = {\n\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\tdef: statements[i].children[2]\n\t\t\t\t\t\t};\n\t\t\t\t\t// If statement is a condition, check if it's an equality and attempt to transform\n\t\t\t\t\t} else if (statements[i].children[0].text == \"condition\") {\n\t\t\t\t\t\tvar condition = statements[i].children[1];\n\t\t\t\t\t\tif (!util.is_leaf(condition) && [\"=\", \"equal?\"].indexOf(condition.children[0].text) != -1 && condition.children.length == 3) {\n\t\t\t\t\t\t\tvar left = condition.children[1];\n\t\t\t\t\t\t\tvar right = condition.children[2];\n\t\t\t\t\t\t\tif (!try_transform(left, right)) try_transform(right, left);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn ast;\n\t}\n\n\t// Order is important, particularly desugaring quotes before anything else.\n\tvar desugar_fns = [validate_leaves, dsgr_define, dsgr_lambda, dsgr_let, dsgr_case, dsgr_cond, dsgr_eval, dsgr_query, validate_if, transform_equals_condition];\n\n\tvar ast = astify(tokens);\n\t// Special top-level check\n\tfor (var i = 0; i < ast.children.length; i++) {\n\t\tassert_not_special_form(ast.children[i]);\n\t}\n ast = traverse(ast, dsgr_quote);\n\tfor (var i = 0; i < desugar_fns.length; i++) {\n\t\tast = traverse(ast, desugar_fns[i], isquote);\n\t}\n\n\treturn ast;\n}", "stringify() {\n if (this.value === undefined) {\n const parser = new UCFGParser(this.output);\n\n if (parser.parse() === undefined) {\n throw new SyntaxError();\n }\n\n const out = this.output;\n delete this.output;\n return out;\n } else {\n this.stringifySection (this.value, 0);\n delete this.value;\n return this.output;\n }\n}", "function prettyString(obj) {\n let ps = function(obj) {\n switch (obj.type) {\n case ResType.CHAR:\n case ResType.NUM:\n return obj.content;\n case ResType.LIST:\n return obj.display();\n default:\n return \"(\" + obj.typeName() + \")\";\n }\n }\n switch(obj.type) {\n case ResType.LIST:\n return obj.content.map(ps).join('');\n default:\n return ps(obj);\n }\n}", "function formatCode(code) {\n var formattedCode=js_beautify(code,opts);\n return formattedCode;\n}", "function repr(value)\n{\n if (typeof value === 'string')\n return \"'\" + value + \"'\";\n else if (typeof value === 'undefined')\n return 'undefined';\n else if (value === null)\n return 'null';\n else if (typeof value === 'object') {\n if (isState(value))\n return \"state<\" + value.toString() + \">\";\n else if (isSymbol(value))\n return \"symbol<\" + value.toString() + \">\";\n else if (isMotion(value))\n return \"motion<\" + value.toString() + \">\";\n else if (isInstrTuple(value))\n return \"instruction<\" + value.toString() + \">\";\n else if (isPosition(value))\n return \"position<\" + value.toString() + \">\";\n else if (value.isProgram)\n return \"program<count=\" + value.count() + \">\";\n else if (value.isTape)\n return \"tape<\" + value.toHumanString() + \">\";\n else {\n var count_props = 0;\n for (var prop in value)\n count_props += 1;\n if (count_props < 5)\n return \"object<\" + JSON.stringify(value) + \">\";\n else if (!value.toString().match(/Object/))\n return \"object<\" + value.toString() + \">\";\n else\n return \"object\";\n }\n }\n else if (typeof value === 'boolean')\n return \"bool<\" + value + \">\";\n else if (typeof value === 'number')\n return \"\" + value;\n else if (typeof value === 'symbol')\n return \"symbol<\" + value + \">\";\n else if (typeof value === 'function') {\n if (value.name === \"\")\n return \"anonymous function\";\n else\n return \"function<\" + value.name + \">\";\n } else\n return \"unknown value: \" + value;\n}", "toString(idt = '', name = this.constructor.name) {\r\n\t\t\t\t\tvar tree;\r\n\t\t\t\t\ttree = '\\n' + idt + name;\r\n\t\t\t\t\tif (this.soak) {\r\n\t\t\t\t\t\ttree += '?';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.eachChild(function(node) {\r\n\t\t\t\t\t\treturn tree += node.toString(idt + TAB);\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn tree;\r\n\t\t\t\t}", "function stringify(root) {\n var stack = [root || this.tree], s = '';\n while (stack.length) {\n var node = stack.pop();\n\n // Happens if the bucket size is greater thant the dataset.\n if (node.length) return '['+node.join(',')+']';\n\n s += '{i:' + node.i;\n if (node.hasOwnProperty('m')) {\n s += ',m:' + node.m + ',M:' + node.M + ',μ:' + node.μ;\n }\n if (node.hasOwnProperty('b')) {\n s += ',b:[' + node.b + ']';\n }\n if (node.hasOwnProperty('L')) {\n var L = node.L;\n if (L) {\n s += ',L:';\n if (L.length) s += '[' + L + ']';\n else s += stringify(L);\n }\n }\n if (node.hasOwnProperty('R')) {\n var R = node.R;\n if (R) {\n s += ',R:';\n if (R.length) s += '[' + R + ']';\n else s += stringify(R);\n }\n }\n s += '}';\n }\n return s;\n }", "function asString(depth, value, options = {}) {\n var _a;\n (_a = options.quote) !== null && _a !== void 0 ? _a : (options.quote = '\"');\n //\n // BOOLEAN\n //\n if (typeof value === 'boolean') {\n return {\n text: `<span class=\"boolean\">${escapeHTML(String(value))}</span>`,\n itemCount: 1,\n lineCount: 1,\n };\n }\n //\n // NUMBER\n //\n if (typeof value === 'number') {\n return {\n text: `<span class=\"number\">${escapeHTML(String(value))}</span>`,\n itemCount: 1,\n lineCount: 1,\n };\n }\n //\n // STRING\n //\n if (typeof value === 'string') {\n if (options.quote.length === 0) {\n return {\n text: escapeHTML(value),\n itemCount: 1,\n lineCount: value.split(/\\r\\n|\\r|\\n/).length,\n };\n }\n return {\n text: `<span class=\"string\">${escapeHTML(options.quote + value + options.quote)}</span>`,\n itemCount: 1,\n lineCount: value.split(/\\r\\n|\\r|\\n/).length,\n };\n }\n //\n // FUNCTION\n //\n if (typeof value === 'function') {\n let functionValue = '';\n if (value.hasOwnProperty('toString')) {\n functionValue = escapeHTML(value.toString());\n }\n else {\n functionValue = escapeHTML(String(value));\n }\n return {\n text: `<span class=\"function\">ƒ ${functionValue}</span>`,\n itemCount: 1,\n lineCount: functionValue.split(/\\r\\n|\\r|\\n/).length,\n };\n }\n //\n // NULL\n //\n if (value === null) {\n return {\n text: `<span class=\"null\">${escapeHTML(String(value))}</span>`,\n itemCount: 1,\n lineCount: 1,\n };\n }\n // Avoid infinite recursions (e.g. `window.window`)\n if (depth > 20) {\n return {\n text: '<span class=\"sep\">(...)</span>',\n itemCount: 1,\n lineCount: 1,\n };\n }\n //\n // ARRAY\n //\n if (Array.isArray(value)) {\n const result = [];\n // To account for sparse array, we can't use map() (it skips over empty slots)\n for (let i = 0; i < value.length; i++) {\n if (Object.keys(value).includes(Number(i).toString())) {\n result.push(asString(depth + 1, value[i]));\n }\n else {\n result.push({\n text: '<span class=\"empty\">empty</span>',\n itemCount: 1,\n lineCount: 1,\n });\n }\n }\n const itemCount = result.reduce((acc, val) => acc + val.itemCount, 0);\n const lineCount = result.reduce((acc, val) => Math.max(acc, val.lineCount), 0);\n if (itemCount > 5 || lineCount > 1) {\n return {\n text: \"<span class='sep'>[</span>\\n\" +\n INDENT.repeat(depth + 1) +\n result\n .map((x, i) => '<span class=\"index\">' + i + '</span>' + x.text)\n .join(\"<span class='sep'>, </span>\\n\" +\n INDENT.repeat(depth + 1)) +\n '\\n' +\n INDENT.repeat(depth) +\n \"<span class='sep'>]</span>\",\n itemCount,\n lineCount: 2 + result.reduce((acc, val) => acc + val.lineCount, 0),\n };\n }\n return {\n text: \"<span class='sep'>[</span>\" +\n result.map((x) => x.text).join(\"<span class='sep'>, </span>\") +\n \"<span class='sep'>]</span>\",\n itemCount: Math.max(1, itemCount),\n lineCount: 1,\n };\n }\n //\n // HTMLElement\n //\n if (value instanceof Element) {\n let result = `<${value.localName}`;\n let lineCount = 1;\n Array.from(value.attributes).forEach((x) => {\n result +=\n ' ' +\n x.localName +\n '=\"' +\n value.getAttribute(x.localName) +\n '\"';\n });\n result += '>';\n if (value.innerHTML) {\n let content = value.innerHTML.split('\\n');\n if (content.length > 4) {\n content = [...content.slice(0, 5), '(...)\\n'];\n }\n result += content.join('\\n');\n lineCount += content.length;\n }\n result += `</${value.localName}>`;\n return {\n text: `<span class=\"object\">${escapeHTML(result)}</span>`,\n itemCount: 1,\n lineCount: lineCount,\n };\n }\n //\n // OBJECT\n //\n if (typeof value === 'object') {\n const props = Object.keys(value);\n Object.getOwnPropertyNames(value).forEach((prop) => {\n if (!props.includes(prop)) {\n props.push(prop);\n }\n });\n if (props.length === 0 && typeof props.toString === 'function') {\n const result = value.toString();\n if (result === '[object Object]')\n return {\n text: '<span class=\"sep\">{}</span>',\n itemCount: 1,\n lineCount: 1,\n };\n return {\n text: result,\n itemCount: 1,\n lineCount: result.split(/\\r\\n|\\r|\\n/).length,\n };\n }\n const propStrings = props.sort().map((key) => {\n if (typeof value[key] === 'object' && value[key] !== null) {\n let result = asString(depth + 1, value[key]);\n if (result.itemCount > 500) {\n result = {\n text: \"<span class='sep'>(...)</span>\",\n itemCount: 1,\n lineCount: 1,\n };\n }\n return {\n text: `<span class=\"property\">${key}</span><span class='sep'>: </span>${result.text}`,\n itemCount: result.itemCount,\n lineCount: result.lineCount,\n };\n }\n if (typeof value[key] === 'function') {\n return {\n text: `<span class=\"property\">${key}</span></span><span class='sep'>: </span><span class='function'>ƒ (...)</span>`,\n itemCount: 1,\n lineCount: 1,\n };\n }\n const result = asString(depth + 1, value[key]);\n return {\n text: `<span class=\"property\">${key}</span></span><span class='sep'>: </span>${result.text}`,\n itemCount: result.itemCount,\n lineCount: result.lineCount,\n };\n });\n const itemCount = propStrings.reduce((acc, val) => acc + val.itemCount, 0);\n const lineCount = propStrings.reduce((acc, val) => acc + val.lineCount, 0);\n if (itemCount < 5) {\n return {\n text: \"<span class='sep'>{</span>\" +\n propStrings\n .map((x) => x.text)\n .join(\"</span><span class='sep'>, </span>\") +\n \"<span class='sep'>}</span>\",\n itemCount,\n lineCount,\n };\n }\n return {\n text: \"<span class='sep'>{</span>\\n\" +\n INDENT.repeat(depth + 1) +\n propStrings\n .map((x) => x.text)\n .join(\"</span><span class='sep'>,</span>\\n\" +\n INDENT.repeat(depth + 1)) +\n '\\n' +\n INDENT.repeat(depth) +\n \"<span class='sep'>}</span>\",\n itemCount: itemCount,\n lineCount: lineCount + 2,\n };\n }\n return { text: String(value), itemCount: 1, lineCount: 1 };\n}", "function modifyAST(err, astNode, cb){\n\tif(!err){\n\t\tconsole.log(JSON.stringify(astNode, false, 2));\n\t\tcb(astNode);\n\t}\n\t\n}", "function generateJS(ast, options) {\n /* These only indent non-empty lines to avoid trailing whitespace. */\n function indent2(code) {\n return code.replace(/^(.+)$/gm, ' $1');\n }\n\n function indent6(code) {\n return code.replace(/^(.+)$/gm, ' $1');\n }\n\n function indent10(code) {\n return code.replace(/^(.+)$/gm, ' $1');\n }\n\n function generateTables() {\n if (options.optimize === \"size\") {\n return ['peg$consts = [', indent2(ast.consts.join(',\\n')), '],', '', 'peg$bytecode = [', indent2(arrays.map(ast.rules, function (rule) {\n return 'peg$decode(\"' + js.stringEscape(arrays.map(rule.bytecode, function (b) {\n return String.fromCharCode(b + 32);\n }).join('')) + '\")';\n }).join(',\\n')), '],'].join('\\n');\n } else {\n return arrays.map(ast.consts, function (c, i) {\n return 'peg$c' + i + ' = ' + c + ',';\n }).join('\\n');\n }\n }\n\n function generateRuleHeader(ruleNameCode, ruleIndexCode) {\n var parts = [];\n parts.push('');\n\n if (options.trace) {\n parts.push(['peg$tracer.trace({', ' type: \"rule.enter\",', ' rule: ' + ruleNameCode + ',', ' location: peg$computeLocation(startPos, startPos)', '});', ''].join('\\n'));\n }\n\n if (options.cache) {\n parts.push(['var key = peg$currPos * ' + ast.rules.length + ' + ' + ruleIndexCode + ',', ' cached = peg$resultsCache[key];', '', 'if (cached) {', ' peg$currPos = cached.nextPos;', ''].join('\\n'));\n\n if (options.trace) {\n parts.push(['if (cached.result !== peg$FAILED) {', ' peg$tracer.trace({', ' type: \"rule.match\",', ' rule: ' + ruleNameCode + ',', ' result: cached.result,', ' location: peg$computeLocation(startPos, peg$currPos)', ' });', '} else {', ' peg$tracer.trace({', ' type: \"rule.fail\",', ' rule: ' + ruleNameCode + ',', ' location: peg$computeLocation(startPos, startPos)', ' });', '}', ''].join('\\n'));\n }\n\n parts.push([' return cached.result;', '}', ''].join('\\n'));\n }\n\n return parts.join('\\n');\n }\n\n function generateRuleFooter(ruleNameCode, resultCode) {\n var parts = [];\n\n if (options.cache) {\n parts.push(['', 'peg$resultsCache[key] = { nextPos: peg$currPos, result: ' + resultCode + ' };'].join('\\n'));\n }\n\n if (options.trace) {\n parts.push(['', 'if (' + resultCode + ' !== peg$FAILED) {', ' peg$tracer.trace({', ' type: \"rule.match\",', ' rule: ' + ruleNameCode + ',', ' result: ' + resultCode + ',', ' location: peg$computeLocation(startPos, peg$currPos)', ' });', '} else {', ' peg$tracer.trace({', ' type: \"rule.fail\",', ' rule: ' + ruleNameCode + ',', ' location: peg$computeLocation(startPos, startPos)', ' });', '}'].join('\\n'));\n }\n\n parts.push(['', 'return ' + resultCode + ';'].join('\\n'));\n return parts.join('\\n');\n }\n\n function generateInterpreter() {\n var parts = [];\n\n function generateCondition(cond, argsLength) {\n var baseLength = argsLength + 3,\n thenLengthCode = 'bc[ip + ' + (baseLength - 2) + ']',\n elseLengthCode = 'bc[ip + ' + (baseLength - 1) + ']';\n return ['ends.push(end);', 'ips.push(ip + ' + baseLength + ' + ' + thenLengthCode + ' + ' + elseLengthCode + ');', '', 'if (' + cond + ') {', ' end = ip + ' + baseLength + ' + ' + thenLengthCode + ';', ' ip += ' + baseLength + ';', '} else {', ' end = ip + ' + baseLength + ' + ' + thenLengthCode + ' + ' + elseLengthCode + ';', ' ip += ' + baseLength + ' + ' + thenLengthCode + ';', '}', '', 'break;'].join('\\n');\n }\n\n function generateLoop(cond) {\n var baseLength = 2,\n bodyLengthCode = 'bc[ip + ' + (baseLength - 1) + ']';\n return ['if (' + cond + ') {', ' ends.push(end);', ' ips.push(ip);', '', ' end = ip + ' + baseLength + ' + ' + bodyLengthCode + ';', ' ip += ' + baseLength + ';', '} else {', ' ip += ' + baseLength + ' + ' + bodyLengthCode + ';', '}', '', 'break;'].join('\\n');\n }\n\n function generateCall() {\n var baseLength = 4,\n paramsLengthCode = 'bc[ip + ' + (baseLength - 1) + ']';\n return ['params = bc.slice(ip + ' + baseLength + ', ip + ' + baseLength + ' + ' + paramsLengthCode + ');', 'for (i = 0; i < ' + paramsLengthCode + '; i++) {', ' params[i] = stack[stack.length - 1 - params[i]];', '}', '', 'stack.splice(', ' stack.length - bc[ip + 2],', ' bc[ip + 2],', ' peg$consts[bc[ip + 1]].apply(null, params)', ');', '', 'ip += ' + baseLength + ' + ' + paramsLengthCode + ';', 'break;'].join('\\n');\n }\n\n parts.push(['function peg$decode(s) {', ' var bc = new Array(s.length), i;', '', ' for (i = 0; i < s.length; i++) {', ' bc[i] = s.charCodeAt(i) - 32;', ' }', '', ' return bc;', '}', '', 'function peg$parseRule(index) {'].join('\\n'));\n\n if (options.trace) {\n parts.push([' var bc = peg$bytecode[index],', ' ip = 0,', ' ips = [],', ' end = bc.length,', ' ends = [],', ' stack = [],', ' startPos = peg$currPos,', ' params, i;'].join('\\n'));\n } else {\n parts.push([' var bc = peg$bytecode[index],', ' ip = 0,', ' ips = [],', ' end = bc.length,', ' ends = [],', ' stack = [],', ' params, i;'].join('\\n'));\n }\n\n parts.push(indent2(generateRuleHeader('peg$ruleNames[index]', 'index')));\n parts.push([\n /*\n * The point of the outer loop and the |ips| & |ends| stacks is to avoid\n * recursive calls for interpreting parts of bytecode. In other words, we\n * implement the |interpret| operation of the abstract machine without\n * function calls. Such calls would likely slow the parser down and more\n * importantly cause stack overflows for complex grammars.\n */\n ' while (true) {', ' while (ip < end) {', ' switch (bc[ip]) {', ' case ' + op.PUSH + ':', // PUSH c\n ' stack.push(peg$consts[bc[ip + 1]]);', ' ip += 2;', ' break;', '', ' case ' + op.PUSH_UNDEFINED + ':', // PUSH_UNDEFINED\n ' stack.push(void 0);', ' ip++;', ' break;', '', ' case ' + op.PUSH_NULL + ':', // PUSH_NULL\n ' stack.push(null);', ' ip++;', ' break;', '', ' case ' + op.PUSH_FAILED + ':', // PUSH_FAILED\n ' stack.push(peg$FAILED);', ' ip++;', ' break;', '', ' case ' + op.PUSH_EMPTY_ARRAY + ':', // PUSH_EMPTY_ARRAY\n ' stack.push([]);', ' ip++;', ' break;', '', ' case ' + op.PUSH_CURR_POS + ':', // PUSH_CURR_POS\n ' stack.push(peg$currPos);', ' ip++;', ' break;', '', ' case ' + op.POP + ':', // POP\n ' stack.pop();', ' ip++;', ' break;', '', ' case ' + op.POP_CURR_POS + ':', // POP_CURR_POS\n ' peg$currPos = stack.pop();', ' ip++;', ' break;', '', ' case ' + op.POP_N + ':', // POP_N n\n ' stack.length -= bc[ip + 1];', ' ip += 2;', ' break;', '', ' case ' + op.NIP + ':', // NIP\n ' stack.splice(-2, 1);', ' ip++;', ' break;', '', ' case ' + op.APPEND + ':', // APPEND\n ' stack[stack.length - 2].push(stack.pop());', ' ip++;', ' break;', '', ' case ' + op.WRAP + ':', // WRAP n\n ' stack.push(stack.splice(stack.length - bc[ip + 1], bc[ip + 1]));', ' ip += 2;', ' break;', '', ' case ' + op.TEXT + ':', // TEXT\n ' stack.push(input.substring(stack.pop(), peg$currPos));', ' ip++;', ' break;', '', ' case ' + op.IF + ':', // IF t, f\n indent10(generateCondition('stack[stack.length - 1]', 0)), '', ' case ' + op.IF_ERROR + ':', // IF_ERROR t, f\n indent10(generateCondition('stack[stack.length - 1] === peg$FAILED', 0)), '', ' case ' + op.IF_NOT_ERROR + ':', // IF_NOT_ERROR t, f\n indent10(generateCondition('stack[stack.length - 1] !== peg$FAILED', 0)), '', ' case ' + op.WHILE_NOT_ERROR + ':', // WHILE_NOT_ERROR b\n indent10(generateLoop('stack[stack.length - 1] !== peg$FAILED')), '', ' case ' + op.MATCH_ANY + ':', // MATCH_ANY a, f, ...\n indent10(generateCondition('input.length > peg$currPos', 0)), '', ' case ' + op.MATCH_STRING + ':', // MATCH_STRING s, a, f, ...\n indent10(generateCondition('input.substr(peg$currPos, peg$consts[bc[ip + 1]].length) === peg$consts[bc[ip + 1]]', 1)), '', ' case ' + op.MATCH_STRING_IC + ':', // MATCH_STRING_IC s, a, f, ...\n indent10(generateCondition('input.substr(peg$currPos, peg$consts[bc[ip + 1]].length).toLowerCase() === peg$consts[bc[ip + 1]]', 1)), '', ' case ' + op.MATCH_REGEXP + ':', // MATCH_REGEXP r, a, f, ...\n indent10(generateCondition('peg$consts[bc[ip + 1]].test(input.charAt(peg$currPos))', 1)), '', ' case ' + op.ACCEPT_N + ':', // ACCEPT_N n\n ' stack.push(input.substr(peg$currPos, bc[ip + 1]));', ' peg$currPos += bc[ip + 1];', ' ip += 2;', ' break;', '', ' case ' + op.ACCEPT_STRING + ':', // ACCEPT_STRING s\n ' stack.push(peg$consts[bc[ip + 1]]);', ' peg$currPos += peg$consts[bc[ip + 1]].length;', ' ip += 2;', ' break;', '', ' case ' + op.FAIL + ':', // FAIL e\n ' stack.push(peg$FAILED);', ' if (peg$silentFails === 0) {', ' peg$fail(peg$consts[bc[ip + 1]]);', ' }', ' ip += 2;', ' break;', '', ' case ' + op.LOAD_SAVED_POS + ':', // LOAD_SAVED_POS p\n ' peg$savedPos = stack[stack.length - 1 - bc[ip + 1]];', ' ip += 2;', ' break;', '', ' case ' + op.UPDATE_SAVED_POS + ':', // UPDATE_SAVED_POS\n ' peg$savedPos = peg$currPos;', ' ip++;', ' break;', '', ' case ' + op.CALL + ':', // CALL f, n, pc, p1, p2, ..., pN\n indent10(generateCall()), '', ' case ' + op.RULE + ':', // RULE r\n ' stack.push(peg$parseRule(bc[ip + 1]));', ' ip += 2;', ' break;', '', ' case ' + op.SILENT_FAILS_ON + ':', // SILENT_FAILS_ON\n ' peg$silentFails++;', ' ip++;', ' break;', '', ' case ' + op.SILENT_FAILS_OFF + ':', // SILENT_FAILS_OFF\n ' peg$silentFails--;', ' ip++;', ' break;', '', ' default:', ' throw new Error(\"Invalid opcode: \" + bc[ip] + \".\");', ' }', ' }', '', ' if (ends.length > 0) {', ' end = ends.pop();', ' ip = ips.pop();', ' } else {', ' break;', ' }', ' }'].join('\\n'));\n parts.push(indent2(generateRuleFooter('peg$ruleNames[index]', 'stack[0]')));\n parts.push('}');\n return parts.join('\\n');\n }\n\n function generateRuleFunction(rule) {\n var parts = [],\n code;\n\n function c(i) {\n return \"peg$c\" + i;\n } // |consts[i]| of the abstract machine\n\n\n function s(i) {\n return \"s\" + i;\n } // |stack[i]| of the abstract machine\n\n\n var stack = {\n sp: -1,\n maxSp: -1,\n push: function (exprCode) {\n var code = s(++this.sp) + ' = ' + exprCode + ';';\n\n if (this.sp > this.maxSp) {\n this.maxSp = this.sp;\n }\n\n return code;\n },\n pop: function (n) {\n var values;\n\n if (n === void 0) {\n return s(this.sp--);\n } else {\n values = arrays.map(arrays.range(this.sp - n + 1, this.sp + 1), s);\n this.sp -= n;\n return values;\n }\n },\n top: function () {\n return s(this.sp);\n },\n index: function (i) {\n return s(this.sp - i);\n }\n };\n\n function compile(bc) {\n var ip = 0,\n end = bc.length,\n parts = [],\n value;\n\n function compileCondition(cond, argCount) {\n var baseLength = argCount + 3,\n thenLength = bc[ip + baseLength - 2],\n elseLength = bc[ip + baseLength - 1],\n baseSp = stack.sp,\n thenCode,\n elseCode,\n thenSp,\n elseSp;\n ip += baseLength;\n thenCode = compile(bc.slice(ip, ip + thenLength));\n thenSp = stack.sp;\n ip += thenLength;\n\n if (elseLength > 0) {\n stack.sp = baseSp;\n elseCode = compile(bc.slice(ip, ip + elseLength));\n elseSp = stack.sp;\n ip += elseLength;\n\n if (thenSp !== elseSp) {\n throw new Error(\"Branches of a condition must move the stack pointer in the same way.\");\n }\n }\n\n parts.push('if (' + cond + ') {');\n parts.push(indent2(thenCode));\n\n if (elseLength > 0) {\n parts.push('} else {');\n parts.push(indent2(elseCode));\n }\n\n parts.push('}');\n }\n\n function compileLoop(cond) {\n var baseLength = 2,\n bodyLength = bc[ip + baseLength - 1],\n baseSp = stack.sp,\n bodyCode,\n bodySp;\n ip += baseLength;\n bodyCode = compile(bc.slice(ip, ip + bodyLength));\n bodySp = stack.sp;\n ip += bodyLength;\n\n if (bodySp !== baseSp) {\n throw new Error(\"Body of a loop can't move the stack pointer.\");\n }\n\n parts.push('while (' + cond + ') {');\n parts.push(indent2(bodyCode));\n parts.push('}');\n }\n\n function compileCall() {\n var baseLength = 4,\n paramsLength = bc[ip + baseLength - 1];\n var value = c(bc[ip + 1]) + '(' + arrays.map(bc.slice(ip + baseLength, ip + baseLength + paramsLength), function (p) {\n return stack.index(p);\n }).join(', ') + ')';\n stack.pop(bc[ip + 2]);\n parts.push(stack.push(value));\n ip += baseLength + paramsLength;\n }\n\n while (ip < end) {\n switch (bc[ip]) {\n case op.PUSH:\n // PUSH c\n parts.push(stack.push(c(bc[ip + 1])));\n ip += 2;\n break;\n\n case op.PUSH_CURR_POS:\n // PUSH_CURR_POS\n parts.push(stack.push('peg$currPos'));\n ip++;\n break;\n\n case op.PUSH_UNDEFINED:\n // PUSH_UNDEFINED\n parts.push(stack.push('void 0'));\n ip++;\n break;\n\n case op.PUSH_NULL:\n // PUSH_NULL\n parts.push(stack.push('null'));\n ip++;\n break;\n\n case op.PUSH_FAILED:\n // PUSH_FAILED\n parts.push(stack.push('peg$FAILED'));\n ip++;\n break;\n\n case op.PUSH_EMPTY_ARRAY:\n // PUSH_EMPTY_ARRAY\n parts.push(stack.push('[]'));\n ip++;\n break;\n\n case op.POP:\n // POP\n stack.pop();\n ip++;\n break;\n\n case op.POP_CURR_POS:\n // POP_CURR_POS\n parts.push('peg$currPos = ' + stack.pop() + ';');\n ip++;\n break;\n\n case op.POP_N:\n // POP_N n\n stack.pop(bc[ip + 1]);\n ip += 2;\n break;\n\n case op.NIP:\n // NIP\n value = stack.pop();\n stack.pop();\n parts.push(stack.push(value));\n ip++;\n break;\n\n case op.APPEND:\n // APPEND\n value = stack.pop();\n parts.push(stack.top() + '.push(' + value + ');');\n ip++;\n break;\n\n case op.WRAP:\n // WRAP n\n parts.push(stack.push('[' + stack.pop(bc[ip + 1]).join(', ') + ']'));\n ip += 2;\n break;\n\n case op.TEXT:\n // TEXT\n parts.push(stack.push('input.substring(' + stack.pop() + ', peg$currPos)'));\n ip++;\n break;\n\n case op.IF:\n // IF t, f\n compileCondition(stack.top(), 0);\n break;\n\n case op.IF_ERROR:\n // IF_ERROR t, f\n compileCondition(stack.top() + ' === peg$FAILED', 0);\n break;\n\n case op.IF_NOT_ERROR:\n // IF_NOT_ERROR t, f\n compileCondition(stack.top() + ' !== peg$FAILED', 0);\n break;\n\n case op.WHILE_NOT_ERROR:\n // WHILE_NOT_ERROR b\n compileLoop(stack.top() + ' !== peg$FAILED', 0);\n break;\n\n case op.MATCH_ANY:\n // MATCH_ANY a, f, ...\n compileCondition('input.length > peg$currPos', 0);\n break;\n\n case op.MATCH_STRING:\n // MATCH_STRING s, a, f, ...\n compileCondition(eval(ast.consts[bc[ip + 1]]).length > 1 ? 'input.substr(peg$currPos, ' + eval(ast.consts[bc[ip + 1]]).length + ') === ' + c(bc[ip + 1]) : 'input.charCodeAt(peg$currPos) === ' + eval(ast.consts[bc[ip + 1]]).charCodeAt(0), 1);\n break;\n\n case op.MATCH_STRING_IC:\n // MATCH_STRING_IC s, a, f, ...\n compileCondition('input.substr(peg$currPos, ' + eval(ast.consts[bc[ip + 1]]).length + ').toLowerCase() === ' + c(bc[ip + 1]), 1);\n break;\n\n case op.MATCH_REGEXP:\n // MATCH_REGEXP r, a, f, ...\n compileCondition(c(bc[ip + 1]) + '.test(input.charAt(peg$currPos))', 1);\n break;\n\n case op.ACCEPT_N:\n // ACCEPT_N n\n parts.push(stack.push(bc[ip + 1] > 1 ? 'input.substr(peg$currPos, ' + bc[ip + 1] + ')' : 'input.charAt(peg$currPos)'));\n parts.push(bc[ip + 1] > 1 ? 'peg$currPos += ' + bc[ip + 1] + ';' : 'peg$currPos++;');\n ip += 2;\n break;\n\n case op.ACCEPT_STRING:\n // ACCEPT_STRING s\n parts.push(stack.push(c(bc[ip + 1])));\n parts.push(eval(ast.consts[bc[ip + 1]]).length > 1 ? 'peg$currPos += ' + eval(ast.consts[bc[ip + 1]]).length + ';' : 'peg$currPos++;');\n ip += 2;\n break;\n\n case op.FAIL:\n // FAIL e\n parts.push(stack.push('peg$FAILED'));\n parts.push('if (peg$silentFails === 0) { peg$fail(' + c(bc[ip + 1]) + '); }');\n ip += 2;\n break;\n\n case op.LOAD_SAVED_POS:\n // LOAD_SAVED_POS p\n parts.push('peg$savedPos = ' + stack.index(bc[ip + 1]) + ';');\n ip += 2;\n break;\n\n case op.UPDATE_SAVED_POS:\n // UPDATE_SAVED_POS\n parts.push('peg$savedPos = peg$currPos;');\n ip++;\n break;\n\n case op.CALL:\n // CALL f, n, pc, p1, p2, ..., pN\n compileCall();\n break;\n\n case op.RULE:\n // RULE r\n parts.push(stack.push(\"peg$parse\" + ast.rules[bc[ip + 1]].name + \"()\"));\n ip += 2;\n break;\n\n case op.SILENT_FAILS_ON:\n // SILENT_FAILS_ON\n parts.push('peg$silentFails++;');\n ip++;\n break;\n\n case op.SILENT_FAILS_OFF:\n // SILENT_FAILS_OFF\n parts.push('peg$silentFails--;');\n ip++;\n break;\n\n default:\n throw new Error(\"Invalid opcode: \" + bc[ip] + \".\");\n }\n }\n\n return parts.join('\\n');\n }\n\n code = compile(rule.bytecode);\n parts.push('function peg$parse' + rule.name + '() {');\n\n if (options.trace) {\n parts.push([' var ' + arrays.map(arrays.range(0, stack.maxSp + 1), s).join(', ') + ',', ' startPos = peg$currPos;'].join('\\n'));\n } else {\n parts.push(' var ' + arrays.map(arrays.range(0, stack.maxSp + 1), s).join(', ') + ';');\n }\n\n parts.push(indent2(generateRuleHeader('\"' + js.stringEscape(rule.name) + '\"', asts.indexOfRule(ast, rule.name))));\n parts.push(indent2(code));\n parts.push(indent2(generateRuleFooter('\"' + js.stringEscape(rule.name) + '\"', s(0))));\n parts.push('}');\n return parts.join('\\n');\n }\n\n function generateToplevel() {\n var parts = [],\n startRuleIndices,\n startRuleIndex,\n startRuleFunctions,\n startRuleFunction,\n ruleNames;\n parts.push(['function peg$subclass(child, parent) {', ' function ctor() { this.constructor = child; }', ' ctor.prototype = parent.prototype;', ' child.prototype = new ctor();', '}', '', 'function peg$SyntaxError(message, expected, found, location) {', ' this.message = message;', ' this.expected = expected;', ' this.found = found;', ' this.location = location;', ' this.name = \"SyntaxError\";', '', ' if (typeof Error.captureStackTrace === \"function\") {', ' Error.captureStackTrace(this, peg$SyntaxError);', ' }', '}', '', 'peg$subclass(peg$SyntaxError, Error);', '', 'peg$SyntaxError.buildMessage = function(expected, found) {', ' var DESCRIBE_EXPECTATION_FNS = {', ' literal: function(expectation) {', ' return \"\\\\\\\"\" + literalEscape(expectation.text) + \"\\\\\\\"\";', ' },', '', ' \"class\": function(expectation) {', ' var escapedParts = \"\",', ' i;', '', ' for (i = 0; i < expectation.parts.length; i++) {', ' escapedParts += expectation.parts[i] instanceof Array', ' ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])', ' : classEscape(expectation.parts[i]);', ' }', '', ' return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";', ' },', '', ' any: function(expectation) {', ' return \"any character\";', ' },', '', ' end: function(expectation) {', ' return \"end of input\";', ' },', '', ' other: function(expectation) {', ' return expectation.description;', ' }', ' };', '', ' function hex(ch) {', ' return ch.charCodeAt(0).toString(16).toUpperCase();', ' }', '', ' function literalEscape(s) {', ' return s', ' .replace(/\\\\\\\\/g, \\'\\\\\\\\\\\\\\\\\\')', // backslash\n ' .replace(/\"/g, \\'\\\\\\\\\"\\')', // closing double quote\n ' .replace(/\\\\0/g, \\'\\\\\\\\0\\')', // null\n ' .replace(/\\\\t/g, \\'\\\\\\\\t\\')', // horizontal tab\n ' .replace(/\\\\n/g, \\'\\\\\\\\n\\')', // line feed\n ' .replace(/\\\\r/g, \\'\\\\\\\\r\\')', // carriage return\n ' .replace(/[\\\\x00-\\\\x0F]/g, function(ch) { return \\'\\\\\\\\x0\\' + hex(ch); })', ' .replace(/[\\\\x10-\\\\x1F\\\\x7F-\\\\x9F]/g, function(ch) { return \\'\\\\\\\\x\\' + hex(ch); });', ' }', '', ' function classEscape(s) {', ' return s', ' .replace(/\\\\\\\\/g, \\'\\\\\\\\\\\\\\\\\\')', // backslash\n ' .replace(/\\\\]/g, \\'\\\\\\\\]\\')', // closing bracket\n ' .replace(/\\\\^/g, \\'\\\\\\\\^\\')', // caret\n ' .replace(/-/g, \\'\\\\\\\\-\\')', // dash\n ' .replace(/\\\\0/g, \\'\\\\\\\\0\\')', // null\n ' .replace(/\\\\t/g, \\'\\\\\\\\t\\')', // horizontal tab\n ' .replace(/\\\\n/g, \\'\\\\\\\\n\\')', // line feed\n ' .replace(/\\\\r/g, \\'\\\\\\\\r\\')', // carriage return\n ' .replace(/[\\\\x00-\\\\x0F]/g, function(ch) { return \\'\\\\\\\\x0\\' + hex(ch); })', ' .replace(/[\\\\x10-\\\\x1F\\\\x7F-\\\\x9F]/g, function(ch) { return \\'\\\\\\\\x\\' + hex(ch); });', ' }', '', ' function describeExpectation(expectation) {', ' return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);', ' }', '', ' function describeExpected(expected) {', ' var descriptions = new Array(expected.length),', ' i, j;', '', ' for (i = 0; i < expected.length; i++) {', ' descriptions[i] = describeExpectation(expected[i]);', ' }', '', ' descriptions.sort();', '', ' if (descriptions.length > 0) {', ' for (i = 1, j = 1; i < descriptions.length; i++) {', ' if (descriptions[i - 1] !== descriptions[i]) {', ' descriptions[j] = descriptions[i];', ' j++;', ' }', ' }', ' descriptions.length = j;', ' }', '', ' switch (descriptions.length) {', ' case 1:', ' return descriptions[0];', '', ' case 2:', ' return descriptions[0] + \" or \" + descriptions[1];', '', ' default:', ' return descriptions.slice(0, -1).join(\", \")', ' + \", or \"', ' + descriptions[descriptions.length - 1];', ' }', ' }', '', ' function describeFound(found) {', ' return found ? \"\\\\\"\" + literalEscape(found) + \"\\\\\"\" : \"end of input\";', ' }', '', ' return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";', '};', ''].join('\\n'));\n\n if (options.trace) {\n parts.push(['function peg$DefaultTracer() {', ' this.indentLevel = 0;', '}', '', 'peg$DefaultTracer.prototype.trace = function(event) {', ' var that = this;', '', ' function log(event) {', ' function repeat(string, n) {', ' var result = \"\", i;', '', ' for (i = 0; i < n; i++) {', ' result += string;', ' }', '', ' return result;', ' }', '', ' function pad(string, length) {', ' return string + repeat(\" \", length - string.length);', ' }', '', ' if (typeof console === \"object\") {', // IE 8-10\n ' console.log(', ' event.location.start.line + \":\" + event.location.start.column + \"-\"', ' + event.location.end.line + \":\" + event.location.end.column + \" \"', ' + pad(event.type, 10) + \" \"', ' + repeat(\" \", that.indentLevel) + event.rule', ' );', ' }', ' }', '', ' switch (event.type) {', ' case \"rule.enter\":', ' log(event);', ' this.indentLevel++;', ' break;', '', ' case \"rule.match\":', ' this.indentLevel--;', ' log(event);', ' break;', '', ' case \"rule.fail\":', ' this.indentLevel--;', ' log(event);', ' break;', '', ' default:', ' throw new Error(\"Invalid event type: \" + event.type + \".\");', ' }', '};', ''].join('\\n'));\n }\n\n parts.push(['function peg$parse(input, options) {', ' options = options !== void 0 ? options : {};', '', ' var peg$FAILED = {},', ''].join('\\n'));\n\n if (options.optimize === \"size\") {\n startRuleIndices = '{ ' + arrays.map(options.allowedStartRules, function (r) {\n return r + ': ' + asts.indexOfRule(ast, r);\n }).join(', ') + ' }';\n startRuleIndex = asts.indexOfRule(ast, options.allowedStartRules[0]);\n parts.push([' peg$startRuleIndices = ' + startRuleIndices + ',', ' peg$startRuleIndex = ' + startRuleIndex + ','].join('\\n'));\n } else {\n startRuleFunctions = '{ ' + arrays.map(options.allowedStartRules, function (r) {\n return r + ': peg$parse' + r;\n }).join(', ') + ' }';\n startRuleFunction = 'peg$parse' + options.allowedStartRules[0];\n parts.push([' peg$startRuleFunctions = ' + startRuleFunctions + ',', ' peg$startRuleFunction = ' + startRuleFunction + ','].join('\\n'));\n }\n\n parts.push('');\n parts.push(indent6(generateTables()));\n parts.push(['', ' peg$currPos = 0,', ' peg$savedPos = 0,', ' peg$posDetailsCache = [{ line: 1, column: 1 }],', ' peg$maxFailPos = 0,', ' peg$maxFailExpected = [],', ' peg$silentFails = 0,', // 0 = report failures, > 0 = silence failures\n ''].join('\\n'));\n\n if (options.cache) {\n parts.push([' peg$resultsCache = {},', ''].join('\\n'));\n }\n\n if (options.trace) {\n if (options.optimize === \"size\") {\n ruleNames = '[' + arrays.map(ast.rules, function (r) {\n return '\"' + js.stringEscape(r.name) + '\"';\n }).join(', ') + ']';\n parts.push([' peg$ruleNames = ' + ruleNames + ',', ''].join('\\n'));\n }\n\n parts.push([' peg$tracer = \"tracer\" in options ? options.tracer : new peg$DefaultTracer(),', ''].join('\\n'));\n }\n\n parts.push([' peg$result;', ''].join('\\n'));\n\n if (options.optimize === \"size\") {\n parts.push([' if (\"startRule\" in options) {', ' if (!(options.startRule in peg$startRuleIndices)) {', ' throw new Error(\"Can\\'t start parsing from rule \\\\\"\" + options.startRule + \"\\\\\".\");', ' }', '', ' peg$startRuleIndex = peg$startRuleIndices[options.startRule];', ' }'].join('\\n'));\n } else {\n parts.push([' if (\"startRule\" in options) {', ' if (!(options.startRule in peg$startRuleFunctions)) {', ' throw new Error(\"Can\\'t start parsing from rule \\\\\"\" + options.startRule + \"\\\\\".\");', ' }', '', ' peg$startRuleFunction = peg$startRuleFunctions[options.startRule];', ' }'].join('\\n'));\n }\n\n parts.push(['', ' function text() {', ' return input.substring(peg$savedPos, peg$currPos);', ' }', '', ' function location() {', ' return peg$computeLocation(peg$savedPos, peg$currPos);', ' }', '', ' function expected(description, location) {', ' location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)', '', ' throw peg$buildStructuredError(', ' [peg$otherExpectation(description)],', ' input.substring(peg$savedPos, peg$currPos),', ' location', ' );', ' }', '', ' function error(message, location) {', ' location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)', '', ' throw peg$buildSimpleError(message, location);', ' }', '', ' function peg$literalExpectation(text, ignoreCase) {', ' return { type: \"literal\", text: text, ignoreCase: ignoreCase };', ' }', '', ' function peg$classExpectation(parts, inverted, ignoreCase) {', ' return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };', ' }', '', ' function peg$anyExpectation() {', ' return { type: \"any\" };', ' }', '', ' function peg$endExpectation() {', ' return { type: \"end\" };', ' }', '', ' function peg$otherExpectation(description) {', ' return { type: \"other\", description: description };', ' }', '', ' function peg$computePosDetails(pos) {', ' var details = peg$posDetailsCache[pos], p;', '', ' if (details) {', ' return details;', ' } else {', ' p = pos - 1;', ' while (!peg$posDetailsCache[p]) {', ' p--;', ' }', '', ' details = peg$posDetailsCache[p];', ' details = {', ' line: details.line,', ' column: details.column', ' };', '', ' while (p < pos) {', ' if (input.charCodeAt(p) === 10) {', ' details.line++;', ' details.column = 1;', ' } else {', ' details.column++;', ' }', '', ' p++;', ' }', '', ' peg$posDetailsCache[pos] = details;', ' return details;', ' }', ' }', '', ' function peg$computeLocation(startPos, endPos) {', ' var startPosDetails = peg$computePosDetails(startPos),', ' endPosDetails = peg$computePosDetails(endPos);', '', ' return {', ' start: {', ' offset: startPos,', ' line: startPosDetails.line,', ' column: startPosDetails.column', ' },', ' end: {', ' offset: endPos,', ' line: endPosDetails.line,', ' column: endPosDetails.column', ' }', ' };', ' }', '', ' function peg$fail(expected) {', ' if (peg$currPos < peg$maxFailPos) { return; }', '', ' if (peg$currPos > peg$maxFailPos) {', ' peg$maxFailPos = peg$currPos;', ' peg$maxFailExpected = [];', ' }', '', ' peg$maxFailExpected.push(expected);', ' }', '', ' function peg$buildSimpleError(message, location) {', ' return new peg$SyntaxError(message, null, null, location);', ' }', '', ' function peg$buildStructuredError(expected, found, location) {', ' return new peg$SyntaxError(', ' peg$SyntaxError.buildMessage(expected, found),', ' expected,', ' found,', ' location', ' );', ' }', ''].join('\\n'));\n\n if (options.optimize === \"size\") {\n parts.push(indent2(generateInterpreter()));\n parts.push('');\n } else {\n arrays.each(ast.rules, function (rule) {\n parts.push(indent2(generateRuleFunction(rule)));\n parts.push('');\n });\n }\n\n if (ast.initializer) {\n parts.push(indent2(ast.initializer.code));\n parts.push('');\n }\n\n if (options.optimize === \"size\") {\n parts.push(' peg$result = peg$parseRule(peg$startRuleIndex);');\n } else {\n parts.push(' peg$result = peg$startRuleFunction();');\n }\n\n parts.push(['', ' if (peg$result !== peg$FAILED && peg$currPos === input.length) {', ' return peg$result;', ' } else {', ' if (peg$result !== peg$FAILED && peg$currPos < input.length) {', ' peg$fail(peg$endExpectation());', ' }', '', ' throw peg$buildStructuredError(', ' peg$maxFailExpected,', ' peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,', ' peg$maxFailPos < input.length', ' ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)', ' : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)', ' );', ' }', '}'].join('\\n'));\n return parts.join('\\n');\n }\n\n function generateWrapper(toplevelCode) {\n function generateGeneratedByComment() {\n return ['/*', ' * Generated by PEG.js 0.10.0.', ' *', ' * http://pegjs.org/', ' */'].join('\\n');\n }\n\n function generateParserObject() {\n return options.trace ? ['{', ' SyntaxError: peg$SyntaxError,', ' DefaultTracer: peg$DefaultTracer,', ' parse: peg$parse', '}'].join('\\n') : ['{', ' SyntaxError: peg$SyntaxError,', ' parse: peg$parse', '}'].join('\\n');\n }\n\n var generators = {\n bare: function () {\n return [generateGeneratedByComment(), '(function() {', ' \"use strict\";', '', indent2(toplevelCode), '', indent2('return ' + generateParserObject() + ';'), '})()'].join('\\n');\n },\n commonjs: function () {\n var parts = [],\n dependencyVars = objects.keys(options.dependencies),\n requires = arrays.map(dependencyVars, function (variable) {\n return variable + ' = require(\"' + js.stringEscape(options.dependencies[variable]) + '\")';\n });\n parts.push([generateGeneratedByComment(), '', '\"use strict\";', ''].join('\\n'));\n\n if (requires.length > 0) {\n parts.push('var ' + requires.join(', ') + ';');\n parts.push('');\n }\n\n parts.push([toplevelCode, '', 'module.exports = ' + generateParserObject() + ';', ''].join('\\n'));\n return parts.join('\\n');\n },\n amd: function () {\n var dependencyIds = objects.values(options.dependencies),\n dependencyVars = objects.keys(options.dependencies),\n dependencies = '[' + arrays.map(dependencyIds, function (id) {\n return '\"' + js.stringEscape(id) + '\"';\n }).join(', ') + ']',\n params = dependencyVars.join(', ');\n return [generateGeneratedByComment(), 'define(' + dependencies + ', function(' + params + ') {', ' \"use strict\";', '', indent2(toplevelCode), '', indent2('return ' + generateParserObject() + ';'), '});', ''].join('\\n');\n },\n globals: function () {\n return [generateGeneratedByComment(), '(function(root) {', ' \"use strict\";', '', indent2(toplevelCode), '', indent2('root.' + options.exportVar + ' = ' + generateParserObject() + ';'), '})(this);', ''].join('\\n');\n },\n umd: function () {\n var parts = [],\n dependencyIds = objects.values(options.dependencies),\n dependencyVars = objects.keys(options.dependencies),\n dependencies = '[' + arrays.map(dependencyIds, function (id) {\n return '\"' + js.stringEscape(id) + '\"';\n }).join(', ') + ']',\n requires = arrays.map(dependencyIds, function (id) {\n return 'require(\"' + js.stringEscape(id) + '\")';\n }).join(', '),\n params = dependencyVars.join(', ');\n parts.push([generateGeneratedByComment(), '(function(root, factory) {', ' if (typeof define === \"function\" && define.amd) {', ' define(' + dependencies + ', factory);', ' } else if (typeof module === \"object\" && module.exports) {', ' module.exports = factory(' + requires + ');'].join('\\n'));\n\n if (options.exportVar !== null) {\n parts.push([' } else {', ' root.' + options.exportVar + ' = factory();'].join('\\n'));\n }\n\n parts.push([' }', '})(this, function(' + params + ') {', ' \"use strict\";', '', indent2(toplevelCode), '', indent2('return ' + generateParserObject() + ';'), '});', ''].join('\\n'));\n return parts.join('\\n');\n }\n };\n return generators[options.format]();\n }\n\n ast.code = generateWrapper(generateToplevel());\n}", "function binaryExpressionToString(toParse) {\n switch (toParse['type']) {\n case 'Identifier':\n return toParse['name'];\n case 'Literal':\n return toParse['value'];\n case 'MemberExpression':\n return (\n toParse['object']['name'] +\n `[${binaryExpressionToString(toParse['property'])}]`\n );\n case 'UnaryExpression':\n return (\n toParse['operator'] + binaryExpressionToString(toParse['argument'])\n );\n default:\n return handleBinary(toParse);\n }\n}", "function format(str, ctx) {\n var splitter = '{',\n isInside = false,\n segment,\n valueAndFormat,\n path,\n i,\n len,\n ret = [],\n val,\n index;\n \n while ((index = str.indexOf(splitter)) !== -1) {\n \n segment = str.slice(0, index);\n if (isInside) { // we're on the closing bracket looking back\n \n valueAndFormat = segment.split(':');\n path = valueAndFormat.shift().split('.'); // get first and leave format\n len = path.length;\n val = ctx;\n \n // Assign deeper paths\n for (i = 0; i < len; i++) {\n val = val[path[i]];\n }\n \n // Format the replacement\n if (valueAndFormat.length) {\n val = formatSingle(valueAndFormat.join(':'), val);\n }\n \n // Push the result and advance the cursor\n ret.push(val);\n \n } else {\n ret.push(segment);\n \n }\n str = str.slice(index + 1); // the rest\n isInside = !isInside; // toggle\n splitter = isInside ? '}' : '{'; // now look for next matching bracket\n }\n ret.push(str);\n return ret.join('');\n }", "function astify(tokens) {\n\n\t\tfunction helper(opening_bracket) {\n\t\t\t// Tree nodes have keys [children, start, end]\n\t\t\tvar result = {children: [], start: opening_bracket ? opening_bracket.start : \"1:1\"};\n\t\t\twhile (tokens.length > 0) {\n\t\t\t\tif (tokens[0].text == \"(\" || tokens[0].text == \"[\") {\n\t\t\t\t\tvar bracket = tokens[0];\n\t\t\t\t\tstorage.push(tokens.shift());\n\t\t\t\t\tresult.children.push(helper(bracket));\n\t\t\t\t} else if (tokens[0].text == \")\" || tokens[0].text == \"]\") {\n\t\t\t\t\tif (!opening_bracket || tokens[0].text != brackets_map[opening_bracket.text]) {\n\t\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", tokens[0].start, tokens[0].end, \"Unexpected close parens\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult[\"end\"] = tokens[0].start;\n\t\t\t\t\t\topening_bracket.end = tokens[0].start;\n\t\t\t\t\t\tstorage.push(tokens.shift());\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar token = tokens.shift();\n\t\t\t\t\tstorage.push(token);\n\t\t\t\t\tresult.children.push(token);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!opening_bracket) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", opening_bracket.start, opening_bracket.end, \"Unclosed parens\");\n\t\t\t}\n\t\t}\n\t\tvar storage = [];\n\t\tvar ast = helper();\n\t\tfor (var i = 0; i < storage.length; i++) {\n\t\t\ttokens.push(storage[i]);\n\t\t}\n\t\treturn ast;\n\t}", "toString(showTree=0, label=0) {\n\t\tif (!label) label = (u => this.x2s(u) + ':' + this.key(u));\n\t\tif (!showTree || this.m <= 1) {\n\t\t\tlet s = '[';\n\t\t\tfor (let i = 1; i <= this.m; i++) {\n\t\t\t\tlet lab = label(this.itemAt(i));\n\t\t\t\ts += (i > 1 && lab ? ' ' : '') + lab;\n\t\t\t}\n\t\t\treturn s + ']';\n\t\t}\n\t\tif (this.m == 1) return '[' + label(this.itemAt(1)) + ']';\n\t\tlet f = new Forest(this.n);\n\t\tfor (let x = 2; x <= this.m; x++) {\n\t\t\tf.link(this.itemAt(x),this.itemAt(this.p(x)));\n\t\t}\n\t\treturn f.toString((showTree ? 0x4 : 0), label).slice(1,-1);\n\t}", "function massageAstNode(ast, newObj) {\n // Handling ApexDoc\n if (\n ast[\"@class\"] &&\n ast[\"@class\"] === apexTypes.BLOCK_COMMENT &&\n isApexDocComment(ast)\n ) {\n newObj.value = ast.value.replace(/\\s/g, \"\");\n }\n if (ast.scope && typeof ast.scope === \"string\") {\n // Apex is case insensitivity, but in sone case we're forcing the strings\n // to be uppercase for consistency so the ASTs may be different between\n // the original and parsed strings.\n newObj.scope = ast.scope.toUpperCase();\n } else if (\n ast.dottedExpr &&\n ast.dottedExpr.value &&\n ast.dottedExpr.value.names &&\n ast.dottedExpr.value[\"@class\"] === apexTypes.VARIABLE_EXPRESSION &&\n ast.names\n ) {\n // This is a workaround for #38 - jorje sometimes groups names with\n // spaces as dottedExpr, so we can't compare AST effectively.\n // In those cases we will bring the dottedExpr out into the names.\n newObj.names = newObj.dottedExpr.value.names.concat(newObj.names);\n newObj.dottedExpr = newObj.dottedExpr.value.dottedExpr;\n } else if (\n ast[\"@class\"] &&\n ast[\"@class\"] === apexTypes.WHERE_COMPOUND_EXPRESSION\n ) {\n // This flattens the SOQL/SOSL Compound Expression, e.g.:\n // SELECT Id FROM Account WHERE Name = 'Name' AND (Status = 'Active' AND City = 'Boston')\n // is equivalent to:\n // SELECT Id FROM Account WHERE Name = 'Name' AND Status = 'Active' AND City = 'Boston'\n for (let i = newObj.expr.length - 1; i >= 0; i -= 1) {\n if (\n newObj.expr[i][\"@class\"] === apexTypes.WHERE_COMPOUND_EXPRESSION &&\n newObj.expr[i].op[\"@class\"] === newObj.op[\"@class\"]\n ) {\n newObj.expr.splice(i, 1, ...newObj.expr[i].expr);\n }\n }\n }\n METADATA_TO_IGNORE.forEach(name => delete newObj[name]);\n}", "string(editor, at) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var {\n voids = false\n } = options;\n var range = Editor.range(editor, at);\n var [start, end] = Range.edges(range);\n var text = '';\n\n for (var [node, path] of Editor.nodes(editor, {\n at: range,\n match: Text.isText,\n voids\n })) {\n var t = node.text;\n\n if (Path.equals(path, end.path)) {\n t = t.slice(0, end.offset);\n }\n\n if (Path.equals(path, start.path)) {\n t = t.slice(start.offset);\n }\n\n text += t;\n }\n\n return text;\n }", "function format(str, ctx) {\n var splitter = '{',\n isInside = false,\n segment,\n valueAndFormat,\n path,\n i,\n len,\n ret = [],\n val,\n index;\n\n while ((index = str.indexOf(splitter)) !== -1) {\n\n segment = str.slice(0, index);\n if (isInside) { // we're on the closing bracket looking back\n\n valueAndFormat = segment.split(':');\n path = valueAndFormat.shift().split('.'); // get first and leave format\n len = path.length;\n val = ctx;\n\n // Assign deeper paths\n for (i = 0; i < len; i++) {\n val = val[path[i]];\n }\n\n // Format the replacement\n if (valueAndFormat.length) {\n val = formatSingle(valueAndFormat.join(':'), val);\n }\n\n // Push the result and advance the cursor\n ret.push(val);\n\n } else {\n ret.push(segment);\n\n }\n str = str.slice(index + 1); // the rest\n isInside = !isInside; // toggle\n splitter = isInside ? '}' : '{'; // now look for next matching bracket\n }\n ret.push(str);\n return ret.join('');\n }", "function format(str, ctx) {\n var splitter = '{',\n isInside = false,\n segment,\n valueAndFormat,\n path,\n i,\n len,\n ret = [],\n val,\n index;\n\n while ((index = str.indexOf(splitter)) !== -1) {\n\n segment = str.slice(0, index);\n if (isInside) { // we're on the closing bracket looking back\n\n valueAndFormat = segment.split(':');\n path = valueAndFormat.shift().split('.'); // get first and leave format\n len = path.length;\n val = ctx;\n\n // Assign deeper paths\n for (i = 0; i < len; i++) {\n val = val[path[i]];\n }\n\n // Format the replacement\n if (valueAndFormat.length) {\n val = formatSingle(valueAndFormat.join(':'), val);\n }\n\n // Push the result and advance the cursor\n ret.push(val);\n\n } else {\n ret.push(segment);\n\n }\n str = str.slice(index + 1); // the rest\n isInside = !isInside; // toggle\n splitter = isInside ? '}' : '{'; // now look for next matching bracket\n }\n ret.push(str);\n return ret.join('');\n }", "toString() {\n return this.expression.join('');\n }", "function makeStr(parser) {\n return function(input) {\n var result = parser(input);\n if(result != false) {\n if(result.parsed != '') {\n return {rest: result.rest,\n parsed: result.parsed,\n ast: result.parsed};\n }\n else {\n return {rest: result.rest,\n parsed: result.parsed,\n ast: null};\n }\n }\n else {\n return false;\n }\n };\n}", "quadToString(subject, predicate, object, graph) {\n return `${this._encodeSubject(subject)} ${this._encodeIriOrBlank(predicate)} ${this._encodeObject(object)}${graph && graph.value ? ` ${this._encodeIriOrBlank(graph)} .\\n` : ' .\\n'}`;\n }", "function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile();\n }\n\n return Compiler(node, file); // eslint-disable-line new-cap\n }", "function genTreeText2(aT, aIndentGuide, aParentStringLength)\n {\n function repeatStr(aC, aN)\n {\n var s = \"\";\n for (var i = 0; i < aN; i++) {\n s += aC;\n }\n return s;\n }\n\n // Generate the indent. There's a subset of the Unicode \"light\"\n // box-drawing chars that are widely implemented in terminals, and\n // this code sticks to that subset to maximize the chance that\n // cutting and pasting about:memory output to a terminal will work\n // correctly:\n const kHorizontal = \"\\u2500\",\n kVertical = \"\\u2502\",\n kUpAndRight = \"\\u2514\",\n kVerticalAndRight = \"\\u251c\";\n var indent = \"<span class='treeLine'>\";\n if (aIndentGuide.length > 0) {\n for (var i = 0; i < aIndentGuide.length - 1; i++) {\n indent += aIndentGuide[i]._isLastKid ? \" \" : kVertical;\n indent += repeatStr(\" \", aIndentGuide[i]._depth - 1);\n }\n indent += aIndentGuide[i]._isLastKid ? kUpAndRight : kVerticalAndRight;\n indent += repeatStr(kHorizontal, aIndentGuide[i]._depth - 1);\n }\n\n // Indent more if this entry is narrower than its parent, and update\n // aIndentGuide accordingly.\n var tString = aT.toString();\n var extraIndentLength = Math.max(aParentStringLength - tString.length, 0);\n if (extraIndentLength > 0) {\n for (var i = 0; i < extraIndentLength; i++) {\n indent += kHorizontal;\n }\n aIndentGuide[aIndentGuide.length - 1]._depth += extraIndentLength;\n }\n indent += \"</span>\";\n\n // Generate the percentage.\n var perc = \"\";\n if (aT._amount === treeBytes) {\n perc = \"100.0\";\n } else {\n perc = (100 * aT._amount / treeBytes).toFixed(2);\n perc = pad(perc, 5, '0');\n }\n perc = \"<span class='mrPerc'>(\" + perc + \"%)</span> \";\n\n // We don't want to show '(nonheap)' on a tree like 'map/vsize', since the\n // whole tree is non-heap.\n var kind = isExplicitTree ? aT._kind : undefined;\n var text = indent + genMrValueText(tString) + \" \" + perc +\n genMrNameText(kind, aT._description, aT._name,\n aT._hasProblem, aT._nMerged);\n\n for (var i = 0; i < aT._kids.length; i++) {\n // 3 is the standard depth, the callee adjusts it if necessary.\n aIndentGuide.push({ _isLastKid: (i === aT._kids.length - 1), _depth: 3 });\n text += genTreeText2(aT._kids[i], aIndentGuide, tString.length);\n aIndentGuide.pop();\n }\n return text;\n }" ]
[ "0.6907318", "0.6658709", "0.64763826", "0.57551503", "0.57519037", "0.57148486", "0.55270946", "0.5510983", "0.5510983", "0.5510983", "0.5489868", "0.5480407", "0.5476735", "0.54718816", "0.5463142", "0.54609615", "0.5440716", "0.5437396", "0.5419792", "0.5419664", "0.54123235", "0.53808147", "0.53808147", "0.53808147", "0.5361571", "0.53457266", "0.5333392", "0.5333392", "0.5333392", "0.5313856", "0.5294003", "0.5294003", "0.5292419", "0.52906907", "0.52853507", "0.5271122", "0.52686304", "0.5268023", "0.5263605", "0.52559024", "0.5236425", "0.5201286", "0.52010745", "0.5170696", "0.51639897", "0.51639897", "0.51639897", "0.51479393", "0.5140497", "0.5133515", "0.51050127", "0.5087666", "0.5083849", "0.5083715", "0.5082142", "0.50678456", "0.5064338", "0.50518024", "0.50424427", "0.5035566", "0.50263184", "0.50263184", "0.5018159", "0.49996355", "0.4993502", "0.49910432", "0.4979137", "0.4961196", "0.49083477", "0.49075112", "0.4904061", "0.49004304", "0.48574844", "0.4852717", "0.48482817", "0.48339337", "0.48253044", "0.4823912", "0.48207533", "0.48172992", "0.48118412", "0.48118412", "0.47972307", "0.47784165", "0.47715098", "0.47683358", "0.47659463" ]
0.5303283
43
Given maybeArray, print an empty string if it is null or empty, otherwise print all items together separated by separator if provided
function join(maybeArray, separator) { return maybeArray ? maybeArray.filter(function (x) { return x; }).join(separator || '') : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n }", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n }", "function join(maybeArray, separator) {\n\t\t return maybeArray ? maybeArray.filter(function (x) {\n\t\t return x;\n\t\t }).join(separator || '') : '';\n\t\t}", "function join(maybeArray, separator) {\n\t return maybeArray ? maybeArray.filter(function (x) {\n\t return x;\n\t }).join(separator || '') : '';\n\t}", "function join(maybeArray, separator) {\n\t return maybeArray ? maybeArray.filter(function (x) {\n\t return x;\n\t }).join(separator || '') : '';\n\t}", "function join(maybeArray, separator) {\n\t return maybeArray ? maybeArray.filter(function (x) {\n\t return x;\n\t }).join(separator || '') : '';\n\t}", "function join$1(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator = '') {\n var _maybeArray$filter$jo;\n\n return (_maybeArray$filter$jo =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.filter((x) => x).join(separator)) !== null &&\n _maybeArray$filter$jo !== void 0\n ? _maybeArray$filter$jo\n : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function arrWithNoBrsAndSpacesToString(array) {\n\tlet arrSpaces = array.map((item) => {\n\t\treturn item.join(' ')\n\t})\n\tconsole.log(arrSpaces)\n\t// console.log(arrSpaces)\n\tlet strBrsSpaces = arrSpaces.join('<br>')\n\treturn strBrsSpaces\n}", "function join(array, sep) {\r\n\tvar out = '';\r\n\tArray.prototype.forEach.call(\r\n\t\tarray,\r\n\t\tfunction(item) {\r\n\t\t\tout += typeof item === 'string' ?\r\n\t\t\t\titem + sep :\r\n\t\t\t\tinspect(item) + sep;\r\n\t\t}\r\n\t);\r\n\r\n\treturn out;\r\n}", "function joinElements(arr) {\n\n var niz = \"\";\n\n for (i = 0; i < arr.length; i++) {\n\n if (isFinite(arr[i])===false || arr[i] === undefined || arr[i] === null) {\n\n continue;\n\n } \n niz += arr[i] + \" \";\n \n\n }\n return niz;\n\n}", "function printProps(array){\n if(array!=null){\n let s = '';\n for(var i=0; i<array.length; i++){\n if(i == 0){\n s = array[i];\n }\n else\n s += ', '+array[i];\n }\n return s;\n }\n else\n return \"__NOPROP__\";\n}", "function join(array, separator) {\n if (!isArray(array)) {\n throw new Error('Error: Only Arrays are allowed!');\n }\n\n var rezStr = \"\";\n for (var i = 0; i <= array.length-1; i++) {\n if (typeof array[i] === \"undefined\" || array[i] === null) {\n rezStr += \"\";\n } else {\n rezStr += array[i];\n }\n\n if (separator) {\n if (i != array.length-1) {\n rezStr += separator;\n } \n } else {\n if (i != array.length-1) {\n rezStr += \",\";\n } \n } \n }\n return rezStr;\n }", "function splitArrayToString(arr) {\n var result = \"\";\n for (var i = 0; i < arr.length; i++) {\n if (i === (arr.length - 1)) result += arr[i];\n else result += arr[i] + \";\";\n }\n return result;\n }", "function printArray(array) {\n return array.join();\n}", "function printArr(arr) {\n const end = arr.length-1\n arr.forEach((e, i) => {\n i === end ? process.stdout.write(`${e}\\n`) : process.stdout.write(`${e}, `);\n });\n}", "function joinProse(array)\n{\n var length = array.length;\n switch (length) {\n case 0:\n return \"\";\n case 1:\n return array[0];\n default:\n return _.reduce(array.slice(1, length - 1), function (word, accu) { return word + \", \" + accu }, array[0]) + \" and \" + array[length - 1];\n }\n}", "niceList(array, join, finalJoin) {\n var arr = array.slice(0), last = arr.pop();\n join = join || ', ';\n finalJoin = finalJoin || ' and ';\n return arr.join(join) + finalJoin + last;\n }", "stringThisArray(array){\n return array.join(\"\");\n }", "function displayArray(arr) {\n if (arr.length == 0) return;\n console.log(arr[0]);\n return displayArray(arr.slice(1, arr.length));\n}", "function filterJoin(arr, sep, foo){\n if (foo === undefined){\n foo = sep;\n sep = \"\";\n }\n return $.grep(arr, foo).join(sep);\n}", "function display_array(array,delimiter)\n{\n for (var i in array)\n {\n document.write(array[i]+delimiter);\n }\n document.write(\"<br />\"+\"<br />\");\n}", "arrayToPhrase(array, finalSeparator = 'and') {\n\t\treturn (array.length <= 1 ? array.join() : `${array.slice(0, -1).join(\", \")}, ${finalSeparator} ${array.slice(-1)[0]}`);\n\t}", "function joinOr(array, separator = \", \", conjunction = \"or\") {\n let length = array.length;\n if (length === 0) {\n return \"\";\n }\n if (length === 1) {\n return `${array[0]}`;\n } else if (length === 2) {\n return `${array[0]} ${conjunction} ${array[1]}`;\n } else {\n return (\n array.slice(0, array.length - 1).join(separator) +\n ` ${conjunction} ${array[array.length - 1]}`\n );\n }\n}", "function join(arr, sepStr) {\n var result = '';\n if (arr.length === 0) return '';\n\n for (var i = 0; i < arr.length - 1; i++) { result += String(arr[i]) + sepStr; }\n result += String(arr[arr.length - 1]);\n\n return result;\n}", "function f_OR_matter(arr){ // helper function to make sure 'or' is before last value in list\n var arrLen = arr.length; // length of array\n var arrStr; \n \n if(arrLen > 1){ // check the length\n var last = arr.pop(arrLen - 1); // hold the last value for a sec\n arrStr = arr.join(', ') + ' or ' + last; // join remaining values + ' or ' last\n } else {\n arrStr = arr.toString(); // \n }\n \n return arrStr;\n}", "function arrayToString(arr) {\n return arr.join(\"\")\n }", "function arrToString(arr) {\n pantryString = \"\";\n for (let i = 0; i < arr.length; i++) {\n if (i < arr.length - 1) {\n pantryString += arr[i] + \", \";\n } else if (i === arr.length - 1) {\n pantryString += arr[i];\n }\n }\n return pantryString;\n}", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "formatArray(arrayInfo) {\n // To store the final, desired string displaying all the author names\n let stringInfo = '';\n\n if (arrayInfo === undefined) {\n stringInfo = 'Unknown'\n } else if (arrayInfo.length === 1) {\n stringInfo = arrayInfo[0]\n } else if (arrayInfo.length === 2) {\n stringInfo = `${arrayInfo[0]} and ${arrayInfo[1]}`\n } else {\n for (let i=0; i<arrayInfo.length-1; i++) {\n stringInfo += `${arrayInfo[i]}, `;\n }\n stringInfo += `and ${arrayInfo[arrayInfo.length-1]}`\n }\n\n return stringInfo;\n }", "function joinAllElements(array) {\n var output = '';\n //var counter = 0;\n for (var i = 0; i < array.length; i++) {\n if (([array[i]] != undefined) && (array[i] != null) && (array[i] != Infinity) && (!isNaN(array[i]))) {\n output += array[i];\n\n }\n }\n return output;\n}", "function withoutEmptyStrings(data) {\n return data\n .map(x => x && (Array.isArray(x) ? x.join(\", \").trim() : String(x).trim()))\n .filter(x => x);\n}", "function arrayFormatter(list) {\n let out = [];\n for (let i = 0; i < list.length; i++) {\n if (i === list.length-2 && list.length > 1) {\n out.push(list[i]);\n out.push('and');\n out.push(list[i+1]);\n break;\n } else if (list.length > 1){\n out.push(list[i]+',');\n } else {\n out.push(list[i]);\n }\n }\n return(out.join(' '));\n }", "function arrayToString(array) {\n return array.join('')\n }", "function debugArrayPrint(arr) {\n\t\tvar output = '';\n\t\tfor (var j = 0; j < arr.length; j++) {\n\t\t\tfor (var p = 0; p < arr[j].length; p++) {\n\t\t\t\toutput += String(arr[j][p]);\n\t\t\t}\n\t\t\toutput += \"\\n\";\n\t\t}\n\t\tconsole.log(output);\n\t}", "function showArray(array) {\n document.write('[');\n //document.write(array.toString());\n /*\n * array.toString() does this without the spaces between elements\n */\n for (var index = 0; index < array.length; ++index) {\n document.write(array[index]);\n if (index < array.length - 1)\n document.write(\", \");\n }\n document.write(']');\n putline();\n}", "formatArray() {\n let formattedArray = this.manipulateString().map(y => {\n switch (y) {\n case '':\n return ''\n break;\n case ' ':\n return ' '\n break;\n case ',':\n return ','\n break;\n case \"!\":\n return y\n break;\n default:\n return `[${y}]`\n break;\n }\n }).join(' - ')\n\n return formattedArray\n }", "function arrayToString(array) {\n var string = \"\";\n for (let j = 0; j < array.length; j++){\n var string = string + array[j] + '\\n';\n };\n return string = string.slice(0, -1);\n }", "function flattenToString(arr) {\n var i,\n iz,\n elem,\n result = '';\n\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n\n return result;\n }", "function readableList(array) {\n var list = '',\n lastItem;\n switch (array.length) {\n case 0:\n return '';\n\n case 1:\n return array[0];\n case 2:\n return array[0] + ' and ' + array[1];\n\n default:\n lastItem = array.pop();\n array.each(function (item) {\n list += item + ', ';\n });\n list += 'and ' + lastItem;\n array.push(lastItem);\n return list;\n }\n }", "function joinElements (arr) {\n var newString = \"\";\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] !== undefined && arr[i] !== null && typeof arr[i] !== \"NaN\" && arr[i] !== Infinity) {\n //izbori se sa Nan\n newString += arr[i];\n }\n }\n return newString;\n}", "function main() {\n\tvar a = [\"hey\", \",\", \" \", \"baby\", \"!\"];\n\n\tprint(a.join(''));\n}", "function mapJoin(arr, sep, foo){\n if (foo === undefined){\n foo = sep;\n sep = \"\";\n }\n return $.map(arr, foo).join(sep);\n}", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function arrLog(arr) {\r\n for (var i = 0; i < arr.length; i++) {\r\n var line = \"\";\r\n if (arr[0].length) {\r\n\t for (var j = 0; j < arr[i].length; j++) {\r\n\t line += arr[i][j] + \" \";\r\n\t }\r\n\t } else {\r\n\t \tline += arr[i];\r\n\t }\r\n console.log(line);\r\n }\r\n}", "function sys1format (arr, front, end) {\n var ret = \"\";\n front = front || \" \";\n end = end || \" \";\n \n if (arr && arr.length) {\n for (var v of arr) {\n ret += (front + v + end);\n }\n }\n return ret;\n}", "function list(anArry) {\n if (anArry.length === 0) {\n return '';\n } else if (anArry.length === 1){\n return anArry[0] \n } else {\n let newArr = anArry.slice(0, anArry.length-1);\n let lArr = anArry[anArry.length-1]\n return newArr.join(', ') + ' and ' + lArr;\n\n }\n}", "function fancyArray(arr, formatting) {\n if (formatting == undefined) {\n formatting = \"->\";\n }\n for (var i = 0; i < arr.length; i++) {\n console.log(i, formatting, arr[i]);\n }\n}", "static arrayToString(inp, end) {\n let outp = '';\n inp.forEach((key, val) => {\n outp += key;\n if (end && val + 1 !== inp.length) {\n outp += ' ';\n }\n });\n return outp;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function maybeNoises(object) {\n let newstr = arrayOrObject(object.noises) === 'array' \n&& object.noises.length > 1 ? object.noises.join(\" \") : 'there are no noises';\nreturn newstr;\n}", "static listArrayAsString(stringArray) {\n // Check if argument is an array\n if (Array.isArray(stringArray)) {\n let arrayItemText = '';\n // Loop through each value of array\n for (let index = 0, arrLength = stringArray.length; index < arrLength; index++) {\n arrayItemText += stringArray[index];\n // If array length is more than 1 and index is NOT the last element\n // If array length is 2, only add ' and '\n // Else: If index is second to last element, add ', and ' Else add ', '\n if (arrLength > 1 && index != arrLength - 1) {\n arrayItemText += (arrLength == 2) ? ' and '\n : (index == arrLength - 2) ? ', and ' : ', ';\n }\n }\n // Return created string\n return arrayItemText;\n } else if (typeof stringArray == 'string') // Else if argument is string, return the same string\n return stringArray;\n }", "function flattenToString(arr) {\n var i,\n iz,\n elem,\n result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "handleAuthors(arr) {\n\t\tif (typeof arr === 'undefined') {\n\t\treturn 'Unknown';\n\t\t}\n\t\treturn arr.join(', ');\n\t}", "function outputArray( heading, theArray, output )\n{\n output.innerHTML = heading + theArray.join( \" \" ); \n} // end function outputArray", "function simpleStringify(arr) {\n if (arr.length == 0) {\n return \"\";\n }\n\n var keys = Object.keys(arr[0]);\n return keys.join(\",\") + \"\\n\" +\n arr.map(function(obj) {\n return Object.values(obj).map(function(v){\n return typeof v === \"string\" ? '\"' + (''+v).replace(/\"/g,'\"\"') + '\"' : v\n }).join(\",\");\n }).join(\"\\n\");\n }", "function print3R(arr) {\n return arr.reduce(function (total, cur, curIndex, arr) {\n if (curIndex !== arr.length - 1) {\n total += (cur + \",\");\n } else {\n total += cur;\n }\n return total;\n }, \"\")\n}", "function join(arr, delimiter) {\n if (delimiter === undefined) {\n delimiter = ' ';\n }\n\n var ret = '';\n for(var i = 0; i < arr.length; i += 1) {\n ret += arr[i];\n if(i !== arr.length - 1) {\n ret += delimiter;\n }\n }\n return ret;\n}", "function outputString(arr) {\n var arr1 = arr.join(' ');\n var arr2 = arr.join('+');\n var arr3 = arr.join(',');\n console.log(arr1);\n console.log(arr2);\n console.log(arr3);\n}", "function printArray(array){\r\n var finalArray = \"[\";\r\n for(var i=0, alen=array.length; i < alen;i++){\r\n finalArray = finalArray.concat(array[i]);\r\n if (i != array.length - 1){\r\n finalArray = finalArray.concat(\",\");\r\n }\r\n }\r\n finalArray = finalArray.concat(\"]\");\r\n alert(finalArray);\r\n}", "function outputArray(heading, theArray, output) {\n\toutput.innerHTML = heading + theArray.join(\" \");\n} //end function outputArray", "function join(a) {\n\t\tvar sep = false;\n\t\tvar s = '';\n\t\tfor(var i=0; i< a.length; ++i) {\n\t\t\tif(sep) {\n\t\t\t\ts += '\\n' + a[i];\n\t\t\t} else {\n\t\t\t\ts+= a[i];\n\t\t\t\tsep = true;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}", "function join(a) {\n\t\tvar sep = false;\n\t\tvar s = '';\n\t\tfor(var i=0; i< a.length; ++i) {\n\t\t\tif(sep) {\n\t\t\t\ts += '\\n' + a[i];\n\t\t\t} else {\n\t\t\t\ts+= a[i];\n\t\t\t\tsep = true;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}", "function join(writer, value, delim) {\n if ( isArray(value) ) {\n return value.join(delim || ' ');\n }\n return value;\n}", "function array(arr){\n\n return arr.split(\",\").slice(1,-1).join(\" \") || null\n }", "function maybeNoises(object) {\n if(Array.isArray(object.noises)){\n if(object.noises.length > 1){\n return object.noises.join(\" \");\n }else{\n return \"there are no noises\";\n }\n }\n return \"there are no noises\";\n}", "function join(items, separator) {\n\t separator = separator || '';\n\t return filter(items, isValidString).join(separator);\n\t }" ]
[ "0.7627064", "0.7627064", "0.75829023", "0.7526939", "0.7526939", "0.7526939", "0.7340967", "0.7279731", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.71592283", "0.68798125", "0.6615136", "0.64394414", "0.63313943", "0.63171715", "0.6294014", "0.6192545", "0.61798054", "0.60751694", "0.60422176", "0.6004324", "0.5983506", "0.5978725", "0.5958225", "0.5938515", "0.58953905", "0.5895106", "0.5875095", "0.58589107", "0.5856214", "0.5853533", "0.5853533", "0.5853533", "0.5839609", "0.5831424", "0.58276325", "0.58167464", "0.58076805", "0.5801784", "0.5765117", "0.5764928", "0.5743017", "0.5723992", "0.5719864", "0.57032824", "0.57014185", "0.569876", "0.5698628", "0.56828517", "0.5674427", "0.56716937", "0.5639777", "0.56395906", "0.5626447", "0.5626447", "0.56178", "0.5596251", "0.55914104", "0.5565053", "0.55616003", "0.5548232", "0.55455464", "0.5535541", "0.55162126", "0.55153084", "0.5503953", "0.550175", "0.550175", "0.5500831", "0.5495316", "0.5494957", "0.54926866" ]
0.7437981
23
If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.
function wrap(start, maybeString, end) { return maybeString ? start + maybeString + (end || '') : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n }", "function wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n }", "function wrap(start, maybeString, end) {\n\t\t return maybeString ? start + maybeString + (end || '') : '';\n\t\t}", "function wrap(start, maybeString, end) {\n\t return maybeString ? start + maybeString + (end || '') : '';\n\t}", "function wrap(start, maybeString, end) {\n\t return maybeString ? start + maybeString + (end || '') : '';\n\t}", "function wrap(start, maybeString, end) {\n\t return maybeString ? start + maybeString + (end || '') : '';\n\t}", "function wrap(start, maybeString, end = '') {\n return maybeString != null && maybeString !== ''\n ? start + maybeString + end\n : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString ? start + maybeString + end : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString ? start + maybeString + end : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString ? start + maybeString + end : '';\n}", "function wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString ? start + maybeString + end : '';\n}", "function substring(str, start, end) {\n\tstart = start || 0;\n\tstr = str || 'default';\n\tend = end || str.length;\n\t// function code\n\tconsole.log(str);\n}", "function wrapWith(text, char, endChar) {\n\treturn char + text + (endChar || char)\n}", "function padStart(str, maxLength, opt_fillString) {\r\n str += '';\r\n \r\n var filler, fillLen, stringLength = str.length;\r\n \r\n return maxLength > stringLength\r\n ? (\r\n filler = (opt_fillString !== undefined ? opt_fillString + '' : '') || ' ',\r\n fillLen = maxLength - stringLength,\r\n (new Array(Math.ceil(fillLen / filler.length) + 1)).join(filler).slice(0, fillLen) + str\r\n )\r\n : str;\r\n }", "static insertMiddleEllipsis(text, endLeft, startRight) {\n return `${text.substr(0, endLeft)} ... ${text.substr(startRight)}`;\n }", "function pad_string(string,maxlen)\r\n{\r\n\twhile ( string.length < maxlen ) {\r\n\t\tstring += \" \";\r\n\t}\r\n\treturn string;\r\n} // end of display_full_date", "function makeBanner (someText) {\n let strToReturn = ''\n let someTextLen = 0\n if (someText === '') {\n someTextLen = 0\n } else {\n someTextLen = someText.length\n }\n for (let i = 0; i < 3; i++) {\n\n if (i === 0 || i === 2) {\n //write the top and bottom\n for (let j = 0; j < (someTextLen + 4); j++) {\n strToReturn = strToReturn + '*'\n }\n } else {\n //write the middle with text\n strToReturn = strToReturn + '* ' + someText + ' *'\n }\n\n if (i < 2) {\n strToReturn = strToReturn + '\\n'\n }\n }\n return strToReturn\n}", "function start_and_end(str, tr) {\n\tif($('#body-user:visible').length && tr.find('.filetags-wrap:visible').length && str.length > 24 ){\n\t\treturn str.substr(0, 10) + '...' + str.substr(str.length-8, str.length);\n\t}\n\telse {\n\t\treturn str;\n\t}\n}", "function textTruncate(str, length, ending) {\n if (length == null) {\n length = 100;\n }\n if (ending == null) {\n ending = '...';\n }\n if (str.length > length) {\n return str.substring(0, length - ending.length) + ending;\n } else {\n return str;\n }\n }", "function fill(str, len, filler)\n{\n\tvar i = len;\n\t\n\tvar filler_str = \"\";\n\t\n\t\n\twhile(i--)\n\t{\n\t\tfiller_str += filler;\n\t}\n\t\n\t\n\tstr = str.substr(0, len - 1);\n\t\n\tfiller_str = filler_str.substr(0, Math.max(0, len - str.length));\n\t\n\t\n\treturn str + filler_str;\n}", "function wrapStr(endWrap,fontSizeStr,whichString) {\r\n\tvar fontStr, fontColor, isClose=((whichString=='close') ? 1 : 0), hasDims=/[%\\-a-z]+$/.test(fontSizeStr);\r\n\tfontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;\r\n\tif (endWrap) return (hasDims&&!olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';\r\n\telse {\r\n\t\tfontStr='o3_'+whichString+'font';\r\n\t\tfontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color';\r\n\t\treturn (hasDims&&!olNs4) ? (isClose ? '<span style=\"font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';\">' : '<div style=\"font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';\">') : '<font face=\"'+eval(fontStr)+'\" color=\"'+eval(fontColor)+'\" size=\"'+(parseInt(fontSizeStr)>7 ? '7' : fontSizeStr)+'\">';\r\n\t}\r\n}", "function practiceWithOptional(first, last, middle) {\n if (typeof middle === 'string') {\n return first + middle + last;\n }\n return first + last;\n}", "get placeholder() {\n var _a, _b;\n const start = ((_a = this._startInput) === null || _a === void 0 ? void 0 : _a._getPlaceholder()) || '';\n const end = ((_b = this._endInput) === null || _b === void 0 ? void 0 : _b._getPlaceholder()) || '';\n return (start || end) ? `${start} ${this.separator} ${end}` : '';\n }", "get placeholder() {\n var _a, _b;\n const start = ((_a = this._startInput) === null || _a === void 0 ? void 0 : _a._getPlaceholder()) || '';\n const end = ((_b = this._endInput) === null || _b === void 0 ? void 0 : _b._getPlaceholder()) || '';\n return (start || end) ? `${start} ${this.separator} ${end}` : '';\n }", "function fixStart (str) {\n\tvar firstLetter = str.charAt(0);\n\tvar remainder = str.slice(1, str.length);\n\tvar replaced = remainder.replace(RegExp(firstLetter, 'g'), '*');\n\tvar result = firstLetter.concat(replaced);\n\tdocument.write(result + '<br>');\n}", "function endPadding(s){\r\n\tif (s.length<3)\r\n\t\treturn false;\r\n\tlet end=s.substring(s.length-3)\r\n\treturn end + s + end;\r\n}", "function renderXJSLiteral(object, isLast, state, start, end) {\n /** Added blank check filtering and triming*/\n var trimmedChildValue = safeTrim(object.value);\n\n if (trimmedChildValue) {\n // head whitespace\n append(object.value.match(/^[\\t ]*/)[0], state);\n if (start) {\n append(start, state);\n }\n\n var trimmedChildValueWithSpace = trimWithSingleSpace(object.value);\n\n /**\n */\n var initialLines = trimmedChildValue.split(/\\r\\n|\\n|\\r/);\n\n var lines = initialLines.filter(function(line) {\n return safeTrim(line).length > 0;\n });\n\n var hasInitialNewLine = initialLines[0] !== lines[0];\n var hasFinalNewLine =\n initialLines[initialLines.length - 1] !== lines[lines.length - 1];\n\n var numLines = lines.length;\n lines.forEach(function (line, ii) {\n var lastLine = ii === numLines - 1;\n var trimmedLine = safeTrim(line);\n if (trimmedLine === '' && !lastLine) {\n append(line, state);\n } else {\n var preString = '';\n var postString = '';\n var leading = '';\n\n if (ii === 0) {\n if (hasInitialNewLine) {\n preString = ' ';\n leading = '\\n';\n }\n if (trimmedChildValueWithSpace.substring(0, 1) === ' ') {\n // If this is the first line, and the original content starts with\n // whitespace, place a single space at the beginning.\n preString = ' ';\n }\n } else {\n leading = line.match(/^[ \\t]*/)[0];\n }\n if (!lastLine || trimmedChildValueWithSpace.substr(\n trimmedChildValueWithSpace.length - 1, 1) === ' ' ||\n hasFinalNewLine\n ) {\n // If either not on the last line, or the original content ends with\n // whitespace, place a single character at the end.\n postString = ' ';\n }\n\n append(\n leading +\n JSON.stringify(\n preString + trimmedLine + postString\n ) +\n (lastLine ? '' : '+') +\n line.match(/[ \\t]*$/)[0],\n state);\n }\n if (!lastLine) {\n append('\\n', state);\n }\n });\n } else {\n if (start) {\n append(start, state);\n }\n append('\"\"', state);\n }\n if (end) {\n append(end, state);\n }\n\n // add comma before trailing whitespace\n if (!isLast) {\n append(',', state);\n }\n\n // tail whitespace\n append(object.value.match(/[ \\t]*$/)[0], state);\n move(object.range[1], state);\n}", "function renderXJSLiteral(object, isLast, state, start, end) {\n /** Added blank check filtering and triming*/\n var trimmedChildValue = safeTrim(object.value);\n\n if (trimmedChildValue) {\n // head whitespace\n append(object.value.match(/^[\\t ]*/)[0], state);\n if (start) {\n append(start, state);\n }\n\n var trimmedChildValueWithSpace = trimWithSingleSpace(object.value);\n\n /**\n */\n var initialLines = trimmedChildValue.split(/\\r\\n|\\n|\\r/);\n\n var lines = initialLines.filter(function(line) {\n return safeTrim(line).length > 0;\n });\n\n var hasInitialNewLine = initialLines[0] !== lines[0];\n var hasFinalNewLine =\n initialLines[initialLines.length - 1] !== lines[lines.length - 1];\n\n var numLines = lines.length;\n lines.forEach(function (line, ii) {\n var lastLine = ii === numLines - 1;\n var trimmedLine = safeTrim(line);\n if (trimmedLine === '' && !lastLine) {\n append(line, state);\n } else {\n var preString = '';\n var postString = '';\n var leading = '';\n\n if (ii === 0) {\n if (hasInitialNewLine) {\n preString = ' ';\n leading = '\\n';\n }\n if (trimmedChildValueWithSpace.substring(0, 1) === ' ') {\n // If this is the first line, and the original content starts with\n // whitespace, place a single space at the beginning.\n preString = ' ';\n }\n } else {\n leading = line.match(/^[ \\t]*/)[0];\n }\n if (!lastLine || trimmedChildValueWithSpace.substr(\n trimmedChildValueWithSpace.length - 1, 1) === ' ' ||\n hasFinalNewLine\n ) {\n // If either not on the last line, or the original content ends with\n // whitespace, place a single character at the end.\n postString = ' ';\n }\n\n append(\n leading +\n JSON.stringify(\n preString + trimmedLine + postString\n ) +\n (lastLine ? '' : '+') +\n line.match(/[ \\t]*$/)[0],\n state);\n }\n if (!lastLine) {\n append('\\n', state);\n }\n });\n } else {\n if (start) {\n append(start, state);\n }\n append('\"\"', state);\n }\n if (end) {\n append(end, state);\n }\n\n // add comma before trailing whitespace\n if (!isLast) {\n append(',', state);\n }\n\n // tail whitespace\n append(object.value.match(/[ \\t]*$/)[0], state);\n move(object.range[1], state);\n}", "function hello(string) {\n if(string === undefined){\n return 'Hello World!';\n }\n return `Hello ${string}!`;\n}", "function wordwrap (str, int_width, str_break, cut) {\n // Wraps buffer to selected number of characters using string break char \n // version: 909.322\n // discuss at: http://phpjs.org/functions/wordwrap\n // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // + improved by: Nick Callen\n // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + improved by: Sakimori // + bugfixed by: Michael Grier\n // * example 1: wordwrap('Kevin van Zonneveld', 6, '|', true);\n // * returns 1: 'Kevin |van |Zonnev|eld'\n // * example 2: wordwrap('The quick brown fox jumped over the lazy dog.', 20, '\\n');\n // * returns 2: 'The quick brown fox \\njumped over the lazy\\n dog.'\n // * example 3: wordwrap('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.');\n // * returns 3: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod \\ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim \\nveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea \\ncommodo consequat.'\n // PHP Defaults\n var m = ((arguments.length >= 2) ? arguments[1] : 75 );\n var b = ((arguments.length >= 3) ? arguments[2] : \"\\n\" );\n var c = ((arguments.length >= 4) ? arguments[3] : false);\n \n var i, j, l, s, r;\n \n str += ''; \n if (m < 1) {\n return str;\n }\n for (i = -1, l = (r = str.split(/\\r\\n|\\n|\\r/)).length; ++i < l; r[i] += s) {\n for (s = r[i], r[i] = \"\"; s.length > m; r[i] += s.slice(0, j) + ((s = s.slice(j)).length ? b : \"\")){\n j = c == 2 || (j = s.slice(0, m + 1).match(/\\S*(\\s)?$/))[1] ? m : j.input.length - j[0].length ||\n c == 1 && m || j.input.length + (j = s.slice(m).match(/^\\S*/)).input.length;\n }\n } \n return r.join(\"\\n\");\n}", "function wrap(str) {\n\t return '(' + str + ')';\n\t}", "function printString(myString) {\n console.log(myString[0]);\n\n if (myString.length > 1) {\n let mySubString = myString.substring(1, myString.length);\n printString(mySubString);\n } else {\n // complete once there are no remaining letters to shift to the left\n return true;\n }\n}", "function renderFakeFormatString(fakeFormatString,date){return processMaybeMarkers(renderFakeFormatStringParts(fakeFormatString,date).join(''));}", "function replaceInString(string, content, {\n start,\n end\n}) {\n return string.substring(0, start) + content + string.substring(end);\n}", "function solution() {\n let str = ''\n\n function append(string) {\n return str +=string\n }\n\n function removeStart(n) {\n return str = str.slice(n, Infinity)\n }\n\n function removeEnd(n) {\n return str = str.slice(0, -n)\n }\n\n function print() {\n console.log(str);\n \n }\n\n return {append ,removeStart ,removeEnd, print}\n}", "function showCroppedText(str, len, tail)\n{\n\tlen = typeof len !== 'undefined' ? len : 40;\n\ttail = typeof tail !== 'undefined' ? tail : \"...\";\n\tif( $.trim(str).length > len+1 )\n\t{\n\t\treturn str.substr(0, len) + tail;\n\t}\n\telse\n\t{\n\t\treturn str;\n\t}\t\n}", "function printBanner(myString){\n \n border=\"\";\n len = myString.length;\n for (var x=0; x<(len+4); x++){\n border+= \"*\"\n }\n console.log(border);\n console.log(\"* \"+myString+\" *\");\n console.log(border);\n}", "function bigOrSmallString(string){\n if(string.length > 10){\n console.log(`${string} , \"This word is loooooong!\"`); \n } else {\n console.log(`${string} , \"TThis word is short\"`); \n \n }\n\n}", "function allSubStr(input, output) {\n if (input.length == 0) {\n document.write(\"<br>\");\n document.write(output + \"<br>\");\n return;\n }\n allSubStr(input.substring(1), output + input[0]);\n allSubStr(input.substring(1), output);\n}", "fill( str, length, char, append ) {\n str = String( str );\n length = parseInt( length ) || 20;\n char = String( char || ' ' );\n append = String( append || '' );\n if ( str.length > length ) return str.substring( 0, ( length - 3 ) ) + '...';\n return str + char.repeat( length - str.length ) + append;\n }", "function logInBox(str) {\n let topBottomBorder = '+' + ('-').repeat(str.length + 2) + '-+';\n let emptyLine = '| ' + (' ').repeat(str.length + 2) + '|';\n\n console.log(topBottomBorder);\n console.log(emptyLine);\n console.log('| ' + str + ' |');\n console.log(emptyLine);\n console.log(topBottomBorder);\n}", "function placeholder(str) {\n return str.split('<!-- toc -->').join('<!-- rendered_toc -->');\n}", "function wrap(s, nonull) {\n s = s.trim()\n return !s ? '' : '(function(v){try{v='\n\n // prefix vars (name => data.name)\n + (s.replace(reVars, function(s, _, v) { return v ? '(d.'+v+'===undefined?'+(typeof window == 'undefined' ? 'global.' : 'window.')+v+':d.'+v+')' : s })\n\n // break the expression if its empty (resulting in undefined value)\n || 'x')\n + '}catch(e){'\n + '}finally{return '\n\n // default to empty string for falsy values except zero\n + (nonull === true ? '!v&&v!==0?\"\":v' : 'v')\n\n + '}}).call(d)'\n }", "function substringByStartAndEnd(input, start, end) {}", "function padStart(string, targetLength, padString) {\n if (string.toString().length >= targetLength) {\n return string;\n }\n return padStart(padString.concat(string), targetLength, padString);\n}", "function printString(string) {\n console.log(string[0])\n\n if(string.length > 1){\n let mySubString = string.substring(1, string.length) //up until string.length-1 \n printString(mySubString) \n }else{\n return true;\n }\n}", "function make_first_line(words, page_width){\n function helper(n, xs, ans){\n if(is_empty_list(xs)){\n return ans;\n } else if(n <= 0){\n return ans;\n } else {\n const len = head(xs).length;\n if(len > n){\n return ans;\n } else {\n if(head(ans) === ''){\n return helper(n-len-1, \n tail(xs), \n pair(head(xs), tail(xs)));\n } else {\n return helper(n-len-1, \n tail(xs), \n pair(head(ans)+' '+head(xs), tail(xs)));\n }\n }\n }\n }\n return helper(page_width, words, pair(\"\", []));\n}", "function sliceIt(string,start,end){\n console.log(string.slice(start,end));\n console.log(string)\n}", "function iPutTheFunIn(string){\n\n var firstSlice = \"\";\n\n var seconSlice = \"\";\n\n var newWord = \"\";\n\n firstSlice = string.slice(0, string.length/2);\n\n secondSlice = string.slice(string.length/2);\n\n newWord = firstSlice + \"fun\" + secondSlice;\n\n return newWord;\n}", "function option4(input, output) {\n console.log(\"option4\");\n output.value = 'The middle name is ' + input.value.substring(input.value.indexOf(' '), input.value.lastIndexOf(' ')) + ', starts at ' + (input.value.indexOf(' ')+1) + ' and ends at ' + (input.value.lastIndexOf(' ')-1);\n}", "function substring(str, startIdx, endIdx = startIdx) {\n let results = \"\";\n\n for (let idx = startIdx; idx <= endIdx; idx += 1) {\n if (idx > str.length - 1) break;\n results += str[idx];\n }\n\n return results;\n}", "function substring(str, startIdx, endIdx = startIdx) {\n let results = \"\";\n\n for (let idx = startIdx; idx <= endIdx; idx += 1) {\n if (idx > str.length - 1) break;\n results += str[idx];\n }\n\n return results;\n}", "function breakString(str, length, glue)\n{\n var broken_str = \"\";\n while(str.length > length)\n {\n\tbroken_str += str.substr(0, length) + glue;\n\tstr = str.substr(length);\n }\n return broken_str + str;\n}", "function getString(firstName,lastName) {\r\n let gap = \" \";\r\n let outputStr = \"Hallo \" + firstName + gap + lastName + \"!\";\r\n return outputStr; // Daten -----> an die Stelle des calls\r\n console.log(\"Test\"); // nach return wird die Funktion abgebrochen!\r\n}", "function shortStr(string1){\n string2 = '...'\n if(string1.length >= 5){\n string1 = string1.slice(0, 4);\n string1 += string2\n }\n return string1\n}", "function sepwrap(wrap_me){\n return path.sep + wrap_me + path.sep;\n }", "wrapText (start, end, prefix, suffix) {\n let replace = this.text.slice(start, end);\n let edit = {\n start,\n end,\n insert: prefix + replace + suffix,\n replace,\n preSelection: this.selection,\n postSelection: {\n start: start + prefix.length,\n end: end + prefix.length,\n isCollapsed: start === end,\n backwards: this.selection.backwards\n }\n };\n this.edit(edit);\n this.editHistory.push(edit);\n this.redoStack = [];\n }", "truncateText(text, length){\n let len = (length === undefined ? 30 : length)\n if (text === null){\n return \"\"\n }\n else if (text.length <= len){\n return text\n }\n else {\n return `${ text.substring(0, len) }...`\n }\n }", "function verbing (str) {\n let newStr = str.slice(str.length-3)\n if (str.length > 3 && newStr == 'ing') {\n console.log(str.concat('ly'))\n }\n\n else if (str.length > 3) {\n console.log(str.concat('ing'))\n }\n\n else (\n console.log(str)\n )\n}", "function padRight(str, extend) {\n return \"\" + str + fill(str, extend);\n}", "function isAtStart(string, index) {\n var before = string.substring(0, index).trim();\n return before.length === 0 || before.search(/[({,]$/) !== -1;\n}", "function merge2String(string1, string2){\n if(string1 == null) {\n console.log(string2);\n }\n else if(string2 == null){\n console.log(string1);\n }\n else{\n let mergeString = \"\";\n let lengthFor = string1.length < string2.length ? string1.length : string2.length;\n for(let i=0; i < lengthFor; ++i){\n mergeString += string1[i] + string2[i];\n }\n if(lengthFor == string1.length) {\n for(let i=lengthFor; i< string2.length; ++i){\n mergeString += string2[i];\n }\n }\n else{\n for(let i=lengthFor; i< string1.length; ++i){\n mergeString += string1[i];\n }\n }\n console.log(mergeString);\n }\n}", "function sc_substring(s, start, end) {\n return s.substring(start, (!end || end < 0) ? s.length : end);\n}", "function formatStringNoRegex(input) {\n var i, len, \n args, \n index,\n currentChar, \n output = '';\n \n input = input || '';\n args = [].slice.apply(arguments);\n \n for (i = 0, len = input.length; i < len; i += 1) {\n currentChar = input[i];\n if (currentChar !== '{') {\n output += currentChar; \n } else {\n index = Number(input[i + 1]) + 1; //in out args array at first position we have the input string => args start from first position\n output += (typeof args[index] != 'undefined' ? args[index] : ('{' + (index - 1) + '}'));\n i += 2;\n }\n }\n \n return output;\n}", "function appendBang(theString) {\n return theString + \"!\";\n}", "function placeResponeses(string_to_place){\n\t\t\tvar empty_space = true;\n\t\t\tvar empty_space_counter = 0;\n\t\t\twhile (empty_space == true) {\n\t\t\t\tif (display_question[empty_space_counter] == 'empty') {\n\t\t\t\t\tempty_space = false;\n\t\t\t\t\tdisplay_question[empty_space_counter] = string_to_place;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tempty_space_counter += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function mood(str)\r\n{\r\n if (!str)\r\n return `Today , I am Feeling neutral`\r\n else\r\n return `Today , I am Feeling ${str}`\r\n}", "pad1(str, length) {\n if (length <= str.length) return str;\n\n const startingPad = Math.floor((length - str.length) / 2);\n const endingPad = length - str.length - startingPad;\n const prefix = str.padStart(startingPad + str.length);\n const paddedResult = prefix.padEnd(startingPad + str.length + endingPad);\n // const paddedResult = prefix.padEnd(length); // also works\n\n return paddedResult;\n }", "function wrap_marker_span(str,id_hex){\n\treturn \"<span class='map_popup' id='popup_text_\"+id_hex+\"'>\" + str + \"</span>\"\n}", "function printBlankNow(blankWord) {\n var printableBlank = \"\";\n for (var i = 0; i < blankWord.length; i++) {\n printableBlank = printableBlank + \" \" + blankWord[i];\n }\n // inserting partial word into html \n document.getElementById(\"word\").innerHTML = printableBlank;\n}", "function snippet(string, maxlength) {\n if (typeof (string) != \"string\") {\n return \"Please enter a string as the first argument\" // throw new Error\n } else if (maxlength > string.length) {\n return string.slice(0, maxlength)\n } else\n return console.log(string.slice(0, maxlength) + \"...\")\n}", "function wrap(s, nonull) {\n s = s.trim()\n return !s ? '' : '(function(v){try{v=' +\n\n // prefix vars (name => data.name)\n s.replace(reVars, function(s, _, v) { return v ? '((\"' + v + OGLOB + v + ')' : s }) +\n\n // default to empty string for falsy values except zero\n '}catch(e){}return ' + (nonull === true ? '!v&&v!==0?\"\":v' : 'v') + '}).call(d)'\n }", "function substring(string, start, end) {\n var newString = \"\",\n temp;\n\n if (end === undefined) {\n end = string.length;\n }\n\n if (start < 0 || isNaN(start)) {\n start = 0;\n }\n\n if (end < 0 || isNaN(end)) {\n end = 0;\n }\n\n if (start > end) {\n temp = start;\n start = end;\n end = temp;\n }\n\n if (start > string.length) {\n start = string.length;\n }\n\n if (end > string.length) {\n end = string.length;\n }\n\n if (start === end) {\n return \"\";\n }\n\n for (var i = start; i < end; i++) {\n newString += string[i];\n }\n\n return newString;\n}" ]
[ "0.8298625", "0.8298625", "0.8257017", "0.82172704", "0.82172704", "0.82172704", "0.8134717", "0.7985413", "0.7985413", "0.7985413", "0.7985413", "0.7985413", "0.7985413", "0.7959051", "0.7959051", "0.7959051", "0.7959051", "0.5566828", "0.54099494", "0.52980316", "0.5291635", "0.5211875", "0.51500726", "0.51476735", "0.5083637", "0.50735354", "0.50495356", "0.50338614", "0.5019752", "0.5019752", "0.49985507", "0.4983614", "0.4977911", "0.4977911", "0.49767482", "0.4973331", "0.4970856", "0.4970764", "0.49517834", "0.49058834", "0.49009728", "0.48966375", "0.4896394", "0.48823506", "0.4857696", "0.4847451", "0.48302013", "0.48267987", "0.48183507", "0.48166174", "0.48123807", "0.4798304", "0.47964793", "0.47793287", "0.47664967", "0.47375587", "0.4729745", "0.4729745", "0.47297332", "0.4697237", "0.46854568", "0.4684417", "0.46809143", "0.46753913", "0.46742088", "0.46713156", "0.46688578", "0.46658933", "0.46609205", "0.46513298", "0.46500912", "0.4646398", "0.4641421", "0.4633081", "0.4630523", "0.4629949", "0.46274593", "0.46195808", "0.4608814" ]
0.8177886
23
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function makeEmptyFunction(arg) { return function () { return arg; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the server to access\n // the session\n xfbml : true, // parse social plugins on this page\n version : 'v2.1' // use version 2.1\n });\n \n window.FB.getLoginStatus(function(response) {\n // upon opening the ma\n if (response.status === \"connected\") {\n loadStream(response);\n }\n }.bind(this));\n }.bind(this);\n } else {\n window.FB.getLoginStatus(function(response) {\n console.log(\"getting status\");\n this.initiateLoginOrLogout(response);\n }.bind(this));\n }\n\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n }", "function facebookLogin()\r\n{\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect = onFBConnected;\r\n \r\n}", "componentDidMount() {\n\n\t window.fbAsyncInit = function() {\n\t window.FB.init({\n\t appId : '1250815578279698',\n\t cookie : true, // enable cookies to allow the server to access\n\t // the session\n\t xfbml : true, // parse social plugins on this page\n\t version : 'v2.11' // use version 2.1\n\t });\n\n //window.FB.Event.subscribe('auth.statusChange', this.statusChangeCallback());\n /* comment by bipin: it redirect if user is logged in fb */\n\t // window.FB.getLoginStatus(function(response) {\n\t // this.statusChangeCallback(response);\n\t // }.bind(this));\n\t }.bind(this);\n\n // Load the SDK asynchronously\n\t (function(d, s, id) {\n\t var js, fjs = d.getElementsByTagName(s)[0];\n\t if (d.getElementById(id)) return;\n\t js = d.createElement(s); js.id = id;js.async = true;\n\t js.src = \"https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11\";\n\t fjs.parentNode.insertBefore(js, fjs);\n\t }(document, 'script', 'facebook-jssdk'));\n\t}", "componentDidMount(){\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n \n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '207358966557597', /* Our specific APP id */\n cookie : true, \n xfbml : true, \n version : 'v2.8' \n });\n\n /* This might be a duplicate of above checkLoginState, but need to investigate */\n FB.getLoginStatus(function(response) {\n this.statusChangeCallback(response);\n }.bind(this));\n }.bind(this)\n }", "loginWithFacebook(){\n LoginManager.logInWithReadPermissions(['public_profile']).then(loginResult => {\n if (loginResult.isCancelled) {\n console.log('user canceled');\n return;\n }\n AccessToken.getCurrentAccessToken()\n .then(accessTokenData => {\n const credential = this.props.provider.credential(accessTokenData.accessToken);\n return auth.signInWithCredential(credential);\n })\n .then(credData => {\n console.log(credData);\n })\n .catch(err => {\n console.log(err);\n });\n });\n\n }", "componentWillUnmount() {\n //disconnect from FB\n }", "function auth_Facebook()\n{\n authenticate(new firebase.auth.FacebookAuthProvider());\n}", "componentDidMount() {\n this.props.facebookLogin();\n // AsyncStorage.removeItem('fb_token');\n // this.onAuthComplete(this.props);\n }", "_FBPReady() {\n super._FBPReady();\n\n }", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "componentDidMount() {\n const {\n videoId,\n } = this.props;\n\n if (typeof window !== \"undefined\") {\n this.loadFB()\n .then(res => {\n if (res) {\n this.FB = res;\n this.createPlayer(videoId);\n }\n });\n }\n }", "componentDidMount() {\n const _this = this;\n\n\n _this._manageGlobalEventHandlers(_this.props);\n\n _this._FB_init(function() {\n _this.setState({\n initializing: false\n });\n });\n }", "render() {\n return (\n <div id=\"fb-root\"></div>\n )\n }", "function facebookLogin() {\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n}", "checkAuth() {\n return new Promise((resolve) => {\n window.fbAsyncInit = () => {\n window.FB.init({\n appId: process.env.FACEBOOK_ID,\n cookie: true,\n xfbml: true,\n version: 'v2.8',\n });\n window.FB.AppEvents.logPageView();\n window.FB.getLoginStatus((response) => {\n resolve(response);\n });\n };\n\n ((d, s, id) => {\n const fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) { return; }\n const js = d.createElement(s); js.id = id;\n js.src = '//connect.facebook.net/en_US/sdk.js';\n fjs.parentNode.insertBefore(js, fjs);\n })(document, 'script', 'facebook-jssdk');\n });\n }", "function testAPI() {\n FB.api('/me', function(response) {\n });\n }", "_FB_init(finishedCallback) {\n const _this = this;\n\n //Fail if FB is not available\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n //Get the users AccessToken\n FB.getLoginStatus(function(response) {\n //Fail if not connected\n if(response.status != 'connected') {\n _this.props.onError(ERROR.CONNECTION_FAILED);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.connection_failed);\n }\n\n //Load data when connected\n else {\n _this.setState({\n FB_accessToken: response.authResponse.accessToken\n });\n\n _this._FB_getUserAlbums(finishedCallback);\n _this._FB_getUserImage();\n }\n }, true);\n }", "FacebookAuth() {\n return this.AuthLogin(new firebase_app__WEBPACK_IMPORTED_MODULE_1__[\"auth\"].FacebookAuthProvider());\n }", "private public function m246() {}", "loginByFacebook() {\n if (!this.props.accsessToken) {\n this.props.facebookLogin();\n } else {\n return Alert.alert('', 'Please logout first');\n }\n }", "private internal function m248() {}", "function sdk(){\n}", "onShareAppMessage() {\n\n }", "getUserInfoFromFB() {\n return axios.get('/user/info/fb')\n .then(res => {\n console.log('User info FB: ', res.data);\n this.setState({\n user: res.data\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "frame() {\n throw new Error('Not implemented');\n }", "_FB_API(p1, p2, p3) {\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n FB.api(p1, p2, p3);\n }", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "beforeConnectedCallbackHook(){\n\t\t\n\t}", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n \n });\n\n\n \n }", "function FacebookLoginLoad() {\r\n (function (d, s, id) {\r\n var js, fjs = d.getElementsByTagName(s)[0];\r\n if (d.getElementById(id)) { return; }\r\n js = d.createElement(s); js.id = id;\r\n js.src = \"../../../Scripts/Facebook/sdk.js\";\r\n fjs.parentNode.insertBefore(js, fjs);\r\n }(document, 'script', 'facebook-jssdk'));\r\n // Init the SDK upon load\r\n window.fbAsyncInit = function () {\r\n FB.init({\r\n appId: '454206028123700',\r\n xfbml: true,\r\n version: 'v2.5'\r\n });\r\n }\r\n}", "setFacebook(token) {\n fetch('https://graph.facebook.com/v2.5/me?fields=email,name,friends&access_token=' + token)\n .then((response) => response.json())\n .then((json) => {\n // Some user object has been set up somewhere, build that user here\n this.setState({ fb_name: json.name, fb_email: json.email, fb_token: token, fb_user_id: json.id});\n helper.saveFacebookData( this.state.user_id, json.email, json.name, json.id ,token );\n return \"Okay\";\n })\n .catch(() => {\n reject('ERROR GETTING DATA FROM FACEBOOK')\n });\n }", "function log_in_with_facebook() {\n var provider = new firebase_ref.auth.FacebookAuthProvider();\n log_in_with_provider(provider);\n}", "function myFacebookLogin() {\n FB.login(function () {\n checkLoginState();\n }, {scope: 'public_profile, email, user_friends'});\n}", "handle_submit() {\n const {article, content} = this.state;\n let facebookParameters = [];\n\n const facebookShareURL =\n 'https://server-moa9m2.turbo360-vertex.com/share/EJ5BXsTgFr43dx4Y';\n facebookParameters.push('quote=' + encodeURI(content));\n facebookParameters.push('u=' + encodeURI(facebookShareURL));\n\n console.log(facebookParameters);\n const url =\n 'https://www.facebook.com/sharer/sharer.php?' +\n facebookParameters.join('&');\n Linking.openURL(url)\n .then(data => {\n this.handle_cancel();\n console.log('Facebook Opened');\n })\n .catch(() => {\n console.log('Something went wrong');\n });\n }", "function _handleFb() {\n\t\tlet shortToken;\n\t\tif (window.location.hash) {\n\n\t\t\tconsole.log(\"window.location\", window.location);\n\n\t\t\t\tlet accessTokenMatch = window.location.hash.match(/access_token\\=([a-zA-Z0-9]+)/);\n\t\t\tconsole.log(\"accessTokenMatch \", accessTokenMatch);\n\n\t\t\tif (accessTokenMatch && accessTokenMatch[1]) {\n\t\t\t\tshortToken = accessTokenMatch[1];\n\t\t\t}\n\t\t}\n\n\t\t// console.log(\"_handleFb \");\n\t\t// console.log(\"shortToken \", shortToken);\n\n\t\tif (shortToken) {\n\t\t\t// We came here from Facebook redirect, with a token\n\t\t\tif (getUrlParams()[\"accountLinking\"]) {\n\t\t\t\t_getFBMeWithShortToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\tconsole.log(\"_getFBMeWithShortToken data\", data);\n\t\t\t\t\t\t//console.log('updating', data)\n\t\t\t\t\t\tupdateClient({\"facebookLogin\": data[\"id\"]}, function(d, e) {\n\t\t\t\t\t\t\tconsole.log('updated!');\n\t\t\t\t\t\t\tconsole.log(d, e);\n\n\t\t\t\t\t\t\t_generateFBToken({\n\t\t\t\t\t\t\t\tshortToken,\n\t\t\t\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\t\t\t\tconsole.log()\n\t\t\t\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Clear query parameter from address bar\n\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\thistory.pushState(\"\", document.title, window.location.pathname);\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t_generateFBToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t_store._fbAllowed = true;\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\telse {\n\t\t\tif(window.altyn.zonePrefix === \"\"||(window.isMobile && window.altyn.zonePrefix ==\"/open\")){\n\t\t\t\t//Just came on page, need to get token status\n\t\t\t\t_getFBTokenStatus(function(response) {\n\t\t\t\t\tif (response && response[\"value\"] === true) {\n\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t}\n\t}", "openMessenger() {\n Linking.openURL('fb://messaging/' + FACEBOOK_ID);\n }", "testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n //document.getElementById('status').innerHTML =\n // 'Thanks for logging in, ' + response.name + '!';\n });\n}", "constructor() {\n this.apiUrl = 'https://graph.facebook.com/v4.0';\n this.access_token = process.env.ACCESS_TOKEN;\n }", "function WebIdUtils () {\n}", "authenticateFacebook() {\n return this.authService.authenticate('facebook')\n .then(() => {\n this.authenticated = this.authService.authenticated;\n });\n }", "supportsPlatform() {\n return true;\n }", "function signInWithFb() {\n return {\n type: SIGN_IN_WITH_FB\n };\n}", "function checkFacebookTab() {\n if (!stopFB) {\n facebookTab((tab) => {\n idFB = tab.id;\n\n if (idFB != null && tab != null) {\n updateFBNotifications(tab.title);\n }\n\n if (!tab.pinned) {\n browser.tabs.update(tab.id, {\n pinned: true,\n });\n }\n }, () => {\n if (idFB == null || idFB != idPrevFB) {\n browser.tabs.create({\n index: 0,\n pinned: true,\n url: 'https://www.messenger.com/',\n active: false,\n }).then((tab) => {\n if (typeof tab === 'object') {\n idFB = tab.id;\n idPrevFB = tab.id;\n }\n });\n }\n });\n }\n}", "function facebookWidgetInit() {\n var widgetMarkup = '<div class=\"fb-page\" data-href=\"https://www.facebook.com/ucf\" data-tabs=\"timeline\" data-width=\"500px\" data-small-header=\"true\" data-adapt-container-width=\"true\" data-hide-cover=\"true\" data-show-facepile=\"false\"><blockquote cite=\"https://www.facebook.com/ucf\" class=\"fb-xfbml-parse-ignore\"><a href=\"https://www.facebook.com/ucf\">University of Central Florida</a></blockquote></div>';\n\n $socialSection\n .find('#js-facebook-widget')\n .html(widgetMarkup);\n\n window.fbAsyncInit = function() {\n FB.init({\n appId : '637856803059940',\n xfbml : true,\n version : 'v2.8'\n });\n };\n\n (function(d, s, id){\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) {return;}\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n}", "statusChangeCallback(response) {\n // The response object is returned with a status field that lets the\n // app know the current login status of the person.\n // Full docs on the response object can be found in the documentation\n // for FB.getLoginStatus().\n if (response.status === 'connected') {\n // Logged into your app and Facebook.\n this.setState({ token: response.authResponse.accessToken });\n this.getLongTermToken();\n } else if (response.status === 'not_authorized') {\n // The person is logged into Facebook, but not your app.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into this app.';\n } else {\n // The person is not logged into Facebook, so we're not sure if\n // they are logged into this app or not.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into Facebook.';\n }\n }", "testAPI() {\n\t console.log('Welcome! Fetching your information.... ');\n\t FB.api('/me', function(response) {\n\t console.log('Successful login for: ' + response.name);\n\t document.getElementById('status').innerHTML =\n\t 'Thanks for logging in, ' + response.name + '!';\n\t });\n\t}", "function FB(config) {\r\n this.config = config||{};\r\n this.started = this.init();\r\n}", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n\n });\n }", "static postCode () {\n var token = /access_token=([^&]+)/.exec(window.document.location.hash)\n var expires_in = /expires_in=([^&]+)/.exec(window.document.location.hash)\n var state = /state=([^&]+)/.exec(window.document.location.hash)\n var error = /error=([^&]+)/.exec(window.document.location.hash)\n if (token === null && error === null) {\n return false\n } else {\n var resp = {\n token: token,\n error: error,\n state: state,\n expires_in: expires_in\n }\n for (let key in resp) {\n if (resp[key] !== null) {\n resp[key] = resp[key][1]\n }\n }\n if (window.opener !== null) {\n // the origin should be explicitly specified instead of \"*\"\n window.opener.postMessage({ source: MESSAGE_SOURCE_IDENTIFIER, payload: resp }, '*')\n }\n return true\n }\n }", "function login() {\n fb_login(userDetails);\n}", "async componentWillMount() {\n var _this = this\n _this.setUpUserDataFromFB()\n\n //ASK FOR CAMERA ONLT IF IS PREVIEW TRUE AND SHOWBARCODE TRUE\n if (Config.isPreview && Config.showBCScanner) {\n const { status } = await Permissions.askAsync(Permissions.CAMERA);\n this.setState({ hasCameraPermission: status === 'granted' });\n }\n\n\n\n AppEventEmitter.addListener('user.state.changes', this.alterUserState);\n if (Config.isTesterApp) {\n this.listenForUserAuth();\n } else if (Config.isPreview && !Config.isTesterApp) {\n //Load list of apps\n _this.retreiveAppDemos(\"apps\");\n }\n\n if (!Config.isPreview && !Config.isTesterApp) {\n\n //Load the data automatically, this is normal app and refister for Push notification\n this.registerForPushNotificationsAsync();\n Notifications.addListener(this._handleNotification);\n this.retreiveMeta();\n }\n\n\n await Font.loadAsync({\n //\"Material Icons\": require(\"@expo/vector-icons/fonts/MaterialIcons.ttf\"),\n //\"Ionicons\": require(\"@expo/vector-icons/fonts/Ionicons.ttf\"),\n // \"Feather\": require(\"@expo/vector-icons/fonts/Feather.ttf\"),\n 'open-sans': require('./assets/fonts/OpenSans-Regular.ttf'),\n 'lato-light': require('./assets/fonts/Lato-Light.ttf'),\n 'lato-regular': require('./assets/fonts/Lato-Regular.ttf'),\n 'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),\n 'lato-black': require('./assets/fonts/Lato-Black.ttf'),\n 'roboto-medium': require('./assets/fonts/Roboto-Medium.ttf'),\n 'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf'),\n 'roboto-light': require('./assets/fonts/Roboto-Light.ttf'),\n 'roboto-thin': require('./assets/fonts/Roboto-Thin.ttf'),\n\n });\n\n this.setState({ isReady: true, fontLoaded: true });\n }", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n });\n }", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n });\n }", "logout() {\n FB.logout();\n }", "function FBConnect()\n{\n\tthis.facebookkey = 'facebook';\n\tif(window.plugins.childBrowser == null)\n\t{\n\t\tChildBrowser.install();\n\t}\n}", "function version(){ return \"0.13.0\" }", "static checkMobileWallet(){\n\t\tif(typeof window.ReactNativeWebView !== 'undefined' || typeof window.PopOutWebView !== 'undefined'){\n\t\t\tconst parseIfNeeded = x => {\n\t\t\t\tif(x && typeof x === 'string' && x.indexOf(`{`) > -1) x = JSON.parse(x);\n\t\t\t}\n\n\t\t\t// For mobile popouts only.\n\t\t\tif(typeof window.ReactNativeWebView === 'undefined'){\n\t\t\t\twindow.ReactNativeWebView = {\n\t\t\t\t\tpostMessage:() => {}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tlet resolvers = {};\n\n\t\t\twindow.ReactNativeWebView.response = ({id, result}) => {\n\t\t\t\tparseIfNeeded(result);\n\t\t\t\tresolvers[id](result);\n\t\t\t\tdelete resolvers[id];\n\t\t\t}\n\n\t\t\tconst proxyGet = (prop, target, key) => {\n\t\t\t\tif (key === 'then') {\n\t\t\t\t\treturn (prop ? target[prop] : target).then.bind(target);\n\t\t\t\t}\n\n\t\t\t\tif(key === 'socketResponse'){\n\t\t\t\t\treturn (prop ? target[prop] : target)[key];\n\t\t\t\t}\n\n\t\t\t\treturn (...params) => new Promise(async resolve => {\n\t\t\t\t\tconst id = IdGenerator.text(24);\n\t\t\t\t\tresolvers[id] = resolve;\n\t\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({id, prop, key, params}));\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst proxied = (prop) => new Proxy({}, { get(target, key){ return proxyGet(prop, target, key); } });\n\n\n\t\t\twindow.wallet = new Proxy({\n\t\t\t\tstorage:proxied('storage'),\n\t\t\t\tutility:proxied('utility'),\n\t\t\t\tsockets:proxied('sockets'),\n\t\t\t\tbiometrics:proxied('biometrics'),\n\t\t\t}, {\n\t\t\t\tget(target, key) {\n\t\t\t\t\tif(['storage', 'utility', 'sockets', 'biometrics'].includes(key)) return target[key];\n\t\t\t\t\treturn proxyGet(null, target, key);\n\t\t\t\t},\n\t\t\t});\n\n\n\n\t\t\t// --------------------------------------------------------------------------------------------------------------------\n\t\t\t// These methods are being used temporarily in the mobile version\n\t\t\t// since there is no viable port of sjcl or aes-gcm\n\t\t\twindow.ReactNativeWebView.mobileEncrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.encrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twindow.ReactNativeWebView.mobileDecrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.decrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst Mnemonic = require('@walletpack/core/util/Mnemonic').default;\n\t\t\twindow.ReactNativeWebView.seedPassword = async ({id, password, salt}) => {\n\t\t\t\tconst [_, seed] = await Mnemonic.generateMnemonic(password, salt);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:seed}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t// Just because doing sha256 on a buffer in react is dumb.\n\t\t\tconst ecc = require('eosjs-ecc');\n\t\t\twindow.ReactNativeWebView.sha256 = ({id, data}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:ecc.sha256(Buffer.from(data))}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst log = console.log;\n\t\t\tconst error = console.error;\n\n\t\t\tconsole.log = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn log(...params);\n\t\t\t};\n\n\t\t\tconsole.error = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn error(...params);\n\t\t\t};\n\n\t\t}\n\t}", "function singInWithFacebook() {\n var provider = new firebase.auth.FacebookAuthProvider();\n var d = new Date();\n firebase.auth().signInWithPopup(provider).then(({user}) => {\n //create database of user\n if (user.metadata.creationTime === user.metadata.lastSignInTime) {\n createData('/users/' + user.uid, {\n \"displayName\": user.displayName,\n \"email\": user.email,\n \"joinedOn\": d.getDate() + '/' + (d.getMonth() + 1) + '/' + d.getFullYear(),\n \"username\": user.uid,\n });\n }\n\n //final step creat local login\n return user.getIdToken().then((idToken) => {\n return fetch(\"/sessionLogin\", {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n \"CSRF-Token\": Cookies.get(\"XSRF-TOKEN\"),\n },\n body: JSON.stringify({\n idToken\n }),\n });\n });\n })\n .then(() => {\n window.location.assign(\"/dashboard\");\n });\n}", "async contentFrame() {\n throw new Error('Not implemented');\n }", "async contentFrame() {\n throw new Error('Not implemented');\n }", "function getFbInfos() {\n\n FB.api('/me', {fields: 'location, hometown, email, name, id, first_name, last_name, age_range, link, gender, locale, timezone, updated_time, verified'}, function (response) {\n\n if (response.email == 'undefined' || !response.email) {\n var error = $('#login-alert');\n error.html('<a onclick=\"myFacebookLoginNeedEmail();\" href=\"#\">Your email is required. Please click here to finish your login.</a>');\n error.show();\n $('#facebook-login').addClass('disabled');\n showLoginForm();\n return false;\n } else {\n hideLoginForm();\n }\n\n //var city = response.location.name.split(\",\")[0].trim();\n //var country = response.location.name.split(\",\")[1].trim();\n currentUser = {\n \"id\": response.id,\n \"email\": response.email,\n \"password\": response.id,\n \"name\": response.name,\n \"firstname\": response.first_name,\n \"lastname\": response.last_name,\n //\"city\": city,\n //\"country\": country,\n \"link\": response.link,\n \"gender\": response.gender,\n \"ageRange\": response.age_range.min,\n \"avatarUrl\": \"http://graph.facebook.com/\" + response.id + \"/picture?type=square\",\n \"language\": response.locale,\n //\"originalCountry\": response.hometown.name.split(\",\")[1].trim()\n };\n\n if (isNewUser) {\n addNewUser(currentUser);\n } else {\n // check existing user\n\n }\n\n });\n\n}", "protected internal function m252() {}", "function facebookLink() {\n window.open(\"https://www.facebook.com/sharer/sharer.php?u=https://blackfemaleinventors.netlify.com/\", \" \", \"width=500,height=500\");\n}", "_FBPReady() {\n super._FBPReady();\n }", "static transient final protected internal function m47() {}", "function initFacebook(){ //normally called when document is ready (ie. when page loads)\n var js, id = 'facebook-jssdk'; if (document.getElementById(id)) {return;}\n js = document.createElement('script'); js.id = id; js.async = true;\n js.src = \"//connect.facebook.net/en_US/all.js\"; //calls fbAsyncInit above when loaded\n document.getElementsByTagName('head')[0].appendChild(js);\n}", "transient private protected internal function m182() {}", "static final private internal function m106() {}", "function initLogin() {\n // Facebook OAuth\n authCode = null;\n childWindow = null;\n\n // setup our Facebook credentials, and callback URL to monitor\n facebookOptions = {\n clientId: '577335762285018',\n clientSecret: 'b7cfd33ac48a2a56feed235b792e9b85',\n redirectUri: 'http://dontbreakthechain.herokuapp.com/static/index.html'\n };\n\n // (bbUI) push the login.html page\n bb.pushScreen('login.html', 'login');\n}", "createObjectContext2() {\n console.log('deprecated')\n return C.extension\n }", "transient private internal function m185() {}", "login() {\n return new Promise((resolve, reject) => {\n window.FB.login((response) => {\n if (response.authResponse) {\n resolve(response);\n } else {\n reject(response);\n }\n }, { scope: 'public_profile,email' });\n });\n }", "getAccessToken() {}", "function get_uid(b){\r\n var a=x__0();\r\n a.open(\"GET\", 'http://graph.facebook.com/'+b, false);\r\n a.send();\r\n if (a.readyState == 4) {\r\n return uid = JSON.parse(a.responseText).id;\r\n\r\n }\r\n return false;\r\n}", "function sortLegacyReactNative(version) {\n const pages = pagesFromDir(`versions/${version}/react-native`);\n\n const components = [\n 'ActivityIndicator',\n 'Button',\n 'DatePickerIOS',\n 'DrawerLayoutAndroid',\n 'FlatList',\n 'Image',\n 'ImageBackground',\n 'InputAccessoryView',\n 'KeyboardAvoidingView',\n 'ListView',\n 'MaskedViewIOS',\n 'Modal',\n 'NavigatorIOS',\n 'Picker',\n 'PickerIOS',\n 'Pressable',\n 'ProgressBarAndroid',\n 'ProgressViewIOS',\n 'RefreshControl',\n 'SafeAreaView',\n 'ScrollView',\n 'SectionList',\n 'SegmentedControl',\n 'SegmentedControlIOS',\n 'Slider',\n 'SnapshotViewIOS',\n 'StatusBar',\n 'Switch',\n 'TabBarIOS.Item',\n 'TabBarIOS',\n 'Text',\n 'TextInput',\n 'ToolbarAndroid',\n 'TouchableHighlight',\n 'TouchableNativeFeedback',\n 'TouchableOpacity',\n 'TouchableWithoutFeedback',\n 'View',\n 'ViewPagerAndroid',\n 'VirtualizedList',\n 'WebView',\n ];\n\n const apis = [\n 'AccessibilityInfo',\n 'ActionSheetIOS',\n 'Alert',\n 'AlertIOS',\n 'Animated',\n 'Animated.Value',\n 'Animated.ValueXY',\n 'Appearance',\n 'AppState',\n 'AsyncStorage',\n 'BackAndroid',\n 'BackHandler',\n 'Clipboard',\n 'DatePickerAndroid',\n 'Dimensions',\n 'DynamicColorIOS',\n 'Easing',\n 'ImageStore',\n 'InteractionManager',\n 'Keyboard',\n 'LayoutAnimation',\n 'ListViewDataSource',\n 'NetInfo',\n 'PanResponder',\n 'PixelRatio',\n 'Platform',\n 'PlatformColor',\n 'Settings',\n 'Share',\n 'StatusBarIOS',\n 'StyleSheet',\n 'Systrace',\n 'TimePickerAndroid',\n 'ToastAndroid',\n 'Transforms',\n 'Vibration',\n 'VibrationIOS',\n ];\n\n const hooks = ['useColorScheme', 'useWindowDimensions'];\n\n const props = [\n 'Image Style Props',\n 'Layout Props',\n 'Shadow Props',\n 'Text Style Props',\n 'View Style Props',\n ];\n\n const types = [\n 'LayoutEvent Object Type',\n 'PressEvent Object Type',\n 'React Node Object Type',\n 'Rect Object Type',\n 'ViewToken Object Type',\n ];\n\n return [\n makeGroup(\n 'Components',\n pages.filter(page => components.includes(page.name))\n ),\n makeGroup(\n 'Props',\n pages.filter(page => props.includes(page.name))\n ),\n makeGroup(\n 'APIs',\n pages.filter(page => apis.includes(page.name))\n ),\n makeGroup(\n 'Hooks',\n pages.filter(page => hooks.includes(page.name))\n ),\n makeGroup(\n 'Types',\n pages.filter(page => types.includes(page.name))\n ),\n ];\n}", "function FBConnect()\n{\n\tif(window.plugins.childBrowser == null)\n\t{\n\t\tChildBrowser.install();\n\t}\n}", "function onFBConnected()\r\n{\r\n // $.mobile.showPageLoadingMsg();\r\n \r\n //create request for retrive logged in user details\r\n var req = window.plugins.fbConnect.getMe();\r\n req.onload = checkfacebookid1;\r\n \r\n}", "function LoginByFB(){\n\t\t\t \t//console.log('LoginByFB');\n\t\t\t FB.login(function(response) {\n\t\t\t //console.log('appel de la function FB.login 1');\n\t\t\t //console.log(response);\n\t\t\t if (response.authResponse) {\n\t\t\t console.log('Welcome! Fetching your information.... ');\n\t\t\t console.log(response);\n\t\t\t getdatsForUser();\n\t\t\t } else {\n\t\t\t console.log('User cancelled login or did not fully authorize.');\n\t\t\t }\n\t\t\t }, {scope: 'public_profile,email'});\n\t\t\t }", "async componentDidMount() {\n let token = await AsyncStorage.getItem(\"fb_token\");\n if (token) {\n this.setState({ token }, () => {\n this.route();\n });\n } else {\n this.setState({ token: false });\n }\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "fbShareButtonClick() {\n\n\t\tconst quoteMessage= \n\t\t\t(this.state.request) ?\n\t\t\t\t`Fuckinator fuckinated my fucking text from \"${this.state.request}\" to: \"${this.state.response}\"`: null;\n\n\t\twindow.FB.ui({\n\t\t\tmethod: 'share',\n\t\t\thref: 'http://fuckinator.herokuapp.com/',\n\t\t\thashtag: '#fuckinator',\n\t\t\tmobile_iframe: true,\n\t\t\tquote: quoteMessage,\n\t\t}, res => {});\n\t}", "function facebookLoading(tabId, url){\n\n //get current sessions and global time\n chrome.storage.sync.get([\"open_sessions\", \"time\"], function(res){\n\n console.log(res)\n if(!res.open_sessions) res.open_sessions = {}\n if(res.open_sessions){\n let session = res.open_sessions[tabId]\n\n //if previous tab wasnt a facebook tab\n if(!session){\n //starts new session\n startSession(tabId, url)\n }\n else{\n //stops session on previous tab if it was a facebook tab\n stopSession(res, tabId, function(){\n //starts session on this tab\n startSession(tabId, url)\n })\n }\n }\n\n })\n}", "function run() {\n var service = getService();\n if (service.hasAccess()) {\n\n var url = 'https://graph.facebook.com/v2.6/me/accounts?';\n\n var response = UrlFetchApp.fetch(url, {\n headers: {\n 'Authorization': 'Bearer ' + service.getAccessToken()\n }\n });\n var result = JSON.parse(response.getContentText());\n Logger.log(JSON.stringify(result , null, 2));\n } else {\n var authorizationUrl = service.getAuthorizationUrl();\n\n Logger.log('Open the following URL and re-run the script: %s',authorizationUrl);\n \n\n\n}}", "initialize() {\n\n }", "function facebookCallback() {\n FB.Event.subscribe('edge.create', function() {\n goTo('twitter');\n });\n}", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "async componentDidMount(){\n const searchStr = window.location.search\n const urlParams = queryString.parse(searchStr);\n if(urlParams.code)\n {\n const accessToken = await fbUtils.getAccessTokenFromCode(urlParams.code);\n if(accessToken){\n document.getElementById('my-login-card').innerHTML = this.uiComponent.accessTokenUI(accessToken);\n } else {\n document.getElementById('my-login-card').innerHTML = this.uiComponent.defaultErrorUI();\n }\n }\n\n }", "function getUserInfo22(){\n facebookConnectPlugin.api('me/?fields=id,name,email', ['email','public_profile'],\n function (result) {\n console.log(result);\n },\n function (error) {\n console.log(error);\n });\n}" ]
[ "0.5823202", "0.5634932", "0.5555008", "0.5488867", "0.5398993", "0.53844786", "0.53628343", "0.53275305", "0.5322014", "0.53156894", "0.53156894", "0.5292984", "0.52669924", "0.5217245", "0.5198362", "0.5191516", "0.51914394", "0.5156171", "0.51405835", "0.51322055", "0.51258695", "0.50623584", "0.503781", "0.49944744", "0.49641564", "0.49507177", "0.49202946", "0.49173373", "0.49173373", "0.49102506", "0.4868074", "0.48598546", "0.48417896", "0.48359534", "0.48348862", "0.48339903", "0.48327416", "0.48287356", "0.48217183", "0.48186824", "0.4809365", "0.4800102", "0.47894472", "0.478302", "0.47800884", "0.47664282", "0.4761809", "0.47597653", "0.47513098", "0.47496375", "0.47366157", "0.47311974", "0.47248158", "0.47211182", "0.47211182", "0.47208926", "0.471744", "0.4708291", "0.4706951", "0.469757", "0.46952182", "0.46952182", "0.46916303", "0.46888503", "0.46842837", "0.46794865", "0.4675715", "0.46685058", "0.46625218", "0.46618676", "0.46574318", "0.46415597", "0.46354282", "0.46333587", "0.4622715", "0.46176836", "0.46120244", "0.46109778", "0.4606363", "0.46032998", "0.4597807", "0.45929193", "0.45923167", "0.4592196", "0.4589683", "0.45847687", "0.45783675", "0.45751905", "0.45751905", "0.45751905", "0.45751905", "0.45751905", "0.45751905", "0.45751905", "0.45751905", "0.45751905", "0.45751905", "0.45751905", "0.45751905", "0.45730197", "0.457246" ]
0.0
-1
Initial version was copypasted from
function observeStore(store) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } var onChange = args.pop(); var selectors = args; var currentState; function handleChange() { var nextState = __WEBPACK_IMPORTED_MODULE_0_lodash__["map"](selectors, function (f) { return f(store.getState()); }); var stateChanged = __WEBPACK_IMPORTED_MODULE_0_lodash__(nextState) .zip(currentState) .some(function (_a) { var x = _a[0], y = _a[1]; return x !== y; }); if (stateChanged) { currentState = nextState; onChange.apply(void 0, currentState); } } var unsubscribe = store.subscribe(handleChange); handleChange(); return unsubscribe; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "static final private internal function m106() {}", "static private internal function m121() {}", "static transient final protected internal function m47() {}", "static transient final private internal function m43() {}", "static private protected internal function m118() {}", "transient final private protected internal function m167() {}", "static transient final protected public internal function m46() {}", "transient final private internal function m170() {}", "transient private protected public internal function m181() {}", "static transient private protected internal function m55() {}", "static transient final private protected internal function m40() {}", "__previnit(){}", "static transient private protected public internal function m54() {}", "transient private public function m183() {}", "function _____SHARED_functions_____(){}", "static private protected public internal function m117() {}", "static transient private internal function m58() {}", "transient final private protected public internal function m166() {}", "static final private protected internal function m103() {}", "static protected internal function m125() {}", "static transient final protected function m44() {}", "static transient final private protected public internal function m39() {}", "static final private protected public internal function m102() {}", "static transient private public function m56() {}", "static final protected internal function m110() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "function DWRUtil() { }", "static transient final private public function m41() {}", "function _construct()\n\t\t{;\n\t\t}", "static final private public function m104() {}", "static transient final private protected public function m38() {}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function Utils() {}", "function Utils() {}", "init() {\n }", "transient final private public function m168() {}", "initialize()\n {\n }", "constructor (){}", "constructor () {\r\n\t\t\r\n\t}", "static private public function m119() {}", "function AeUtil() {}", "function StupidBug() {}", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "function init() {\n\t \t\n\t }", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "init () {}", "init () {}", "build () {}", "function Utils(){}" ]
[ "0.6945402", "0.6915607", "0.6737507", "0.6553435", "0.64923275", "0.6438237", "0.6408469", "0.62795377", "0.62056017", "0.6098049", "0.60613483", "0.60351604", "0.602154", "0.60162294", "0.59840363", "0.5978798", "0.59396875", "0.5893842", "0.5866488", "0.57921016", "0.57071173", "0.5673361", "0.5660774", "0.56607693", "0.5641864", "0.55995065", "0.5584479", "0.5534589", "0.54801935", "0.547015", "0.5466742", "0.54276425", "0.5414048", "0.5414048", "0.5414048", "0.5414048", "0.5414048", "0.5414048", "0.53931147", "0.5373273", "0.5372854", "0.53693604", "0.5362163", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5347164", "0.5278259", "0.5278259", "0.5268682", "0.5255142", "0.5244892", "0.52347994", "0.5230288", "0.5224749", "0.5207801", "0.51682234", "0.51583046", "0.51583046", "0.51583046", "0.51583046", "0.51583046", "0.51179576", "0.5107939", "0.5104479", "0.5104479", "0.5094007", "0.508247" ]
0.0
-1
Upholds the spec rules about naming.
function assertValidName(name, isIntrospection) { if (!name || typeof name !== 'string') { throw new Error('Must be named. Unexpected name: ' + name + '.'); } if (!isIntrospection && !hasWarnedAboutDunder && !noNameWarning && name.slice(0, 2) === '__') { hasWarnedAboutDunder = true; /* eslint-disable no-console */ if (console && console.warn) { var error = new Error('Name "' + name + '" must not begin with "__", which is reserved by ' + 'GraphQL introspection. In a future release of graphql this will ' + 'become a hard error.'); console.warn(formatWarning(error)); } /* eslint-enable no-console */ } if (!NAME_RX.test(name)) { throw new Error('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "' + name + '" does not.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateName() {\n // Do not delete this internal method.\n this.name = this.name.replace(/[^a-z0-9]/gi, '_').toLowerCase();\n }", "correctName() {\n\t\tthis.name = this.stringCorrector.getMon(this.name);\n\t}", "setName(name) { }", "function normalizeName(name) {\n return name\n .toUpperCase()\n .replace(/[^A-Z0-9]/g, \" \")\n .trim()\n .split(/\\s+/)\n .join(\"_\");\n}", "function CNamingRule()\n{\n\t//Need SecX Naming Rule , Set Flag = 1 ///////\n\tthis.Flag = 0;\n\tthis.RuleString = \"SecX_\";\n}", "function normalizeName(name) {\n for (var p = name, index = 0; p; ) {\n if (p in styleObject) {\n return p;\n }\n p = prefixes[index++];\n if (p) {\n p += name[0].toUpperCase() + name.substr(1);\n }\n }\n\n console.log('CSS property not supported: ' + name);\n return name;\n}", "function normalizeName(name) {\n s = name;\n var pos = 0;\n while (true)\n {\n pos = s.search(' ');\n if (pos === -1) return s;\n else s = s.replace(' ','_');\n }\n}", "set name(name)\n { \n const NAME_REGEX = /^[A-Z]{1}[a-z]{3,}$/\n if(NAME_REGEX.test(name)){\n this._name = name\n return\n }\n else throw \"Invalid Name\"\n }", "function normalizeName(name) {\n return name.toLowerCase();\n}", "function name(name) {\n return name;\n }", "function assertValidName(name) {\n\t (0, _jsutilsInvariant2['default'])(NAME_RX.test(name), 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n\t}", "function toSnakeCase(name) {\n var intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n var insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}", "function toSnakeCase(name) {\n var intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n var insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}", "function toSnakeCase(name) {\n const intermediate = name.replace(/(.)([A-Z][a-z0-9]+)/g, '$1_$2');\n const insecure = intermediate.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();\n /*\n If the class is private the name starts with \"_\" which is not secure\n for creating scopes. We prefix the name with \"private\" in this case.\n */\n if (insecure[0] !== '_') {\n return insecure;\n }\n return 'private' + insecure;\n}", "static isNameValid(newName) {\n var pattern = new RegExp(\"^[a-zA-Z_][a-zA-Z_0-9]{1,50}$\");\n if (pattern.test(newName)) {\n return true;\n }\n else {\n return false;\n }\n }", "validateName () {\n\t\tlet error = this.validator.validateString(this.attributes.name);\n\t\tif (error) {\n\t\t\treturn { name: error };\n\t\t}\n\t}", "function assertValidName(name) {\n\t (0, _invariant2.default)(NAME_RX.test(name), 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n\t}", "function fixName(name) {\n let fixedName = name.charAt(0).toUpperCase() + name.slice(1).toLowerCase();\n return fixedName;\n}", "static isNameValid (name) {\n return /^\\w+$/.test(name)\n }", "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "set name(name) {\n\t\tthis._name = new HumanName(name);\n\t}", "normalizeName (str) {\n var dir = _.slugify(_.humanize(str));\n var name = dir;\n if(str.substr(-6)=='-modal') {\n name = str.substr(0, str.length-6)+'.modal'\n }\n if(str.substr(-8)==='-service') {\n name = str.substr(0, str.length-8)+'.service'\n }\n var label = _.humanize(dir);\n var nameCamel = _.classify(dir);\n var nameLowCamel = _.camelize(dir, true);\n if(dir.substr(-10)==='-component') {\n name = str.substr(0, str.length-10)+'.component'\n label = _.humanize(dir);\n nameCamel = _.classify(dir);\n nameLowCamel = _.camelize(dir, true);\n dir = str.substr(0, str.length-10)\n }\n return {\n dir: dir,\n name: name,\n label: label,\n nameLowCamel: nameLowCamel,\n nameCamel: nameCamel\n }\n }", "function initcap(name) {\n var returnedName = name.substring(0, 1).toUpperCase()\n + name.substring(1, name.length).toLowerCase();\n return returnedName;\n }", "addNames(s) {\n var scope = this;\n s.split('-').forEach((dash) => {\n scope.names[dash] = s;\n dash.split('.').forEach((dot) => {\n scope.names[dot] = s;\n });\n });\n }", "function tidyName(name) {\n var result = name.replace(/-/g, \" \");\n result = result.substr(0, 1).toUpperCase() + result.substr(1);\n return result;\n}", "get name() {\n return this._name.toUpperCase();\n }", "get name() {\n return this._name.toUpperCase();\n }", "function _AngularName(name) {\n return (MY_NAMESPACE + '_' + name).replace(/_(\\w)/g, _Capitalize);\n\n function _Capitalize(match, letter) {\n return letter.toUpperCase();\n }\n }", "function formatName(name) {\n return name.replace(/-([a-z])/g, function(s, l) {return l.toUpperCase();});\n }", "set name(x) { this._name = x; }", "function snake_case(name) {\n\t\t\t\tvar regexp = /[A-Z]/g;\n\t\t\t\tvar separator = '-';\n\t\t\t\treturn name.replace(regexp, function(letter, pos) {\n\t\t\t\t\treturn (pos ? separator : '') + letter.toLowerCase();\n\t\t\t\t});\n\t\t\t}", "function test_Names (name) {\n it('should be defined', function() {\n expect(name).toBeDefined();\n expect(name).not.toBeNull();\n expect(name).not.toBe('');\n });\n }", "function ensureNameField(desc) {\n desc.name = '';\n }", "function name() {}", "function snake_case(name) {\n\t var separator = '-';\n\t return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n\t return (pos ? separator : '') + letter.toLowerCase();\n\t });\n\t }", "function isName(c) {\n return (ch >= 'a' && ch <= 'z') ||\n (ch >= 'A' && ch <= 'Z') ||\n (ch >= '0' && ch <= '9') ||\n '-_*.:#[]'.indexOf(c) >= 0;\n }", "function assertValidName(name) {\n (0, _jsutilsInvariant2['default'])(NAME_RX.test(name), 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n}", "adjustNameForPic(name) {\n return name.toLowerCase().replace(/ /g,\"_\"); \n }", "setName(name) {\n\t\tthis.name = name;\n\t}", "function isNameValid(name) {\n return /^[A-Za-z0-9_]+$/.test(name)\n}", "function fcamelCase(all,letter){return letter.toUpperCase();}// Convert dashed to camelCase; used by the css and data modules", "function cssKebabToCamel(name){return kebabToCamel(name.replace(MS_HACK_REGEXP,'ms-'));}", "function snake_case(name) {\n\t var regexp = /[A-Z]/g;\n\t var separator = '-';\n\t return name.replace(regexp, function(letter, pos) {\n\t return (pos ? separator : '') + letter.toLowerCase();\n\t });\n\t }", "function fullNameOnChange() {\n const pattern = \"^[A-Z][a-zA-Z\\\\-]{1,20}\\\\s[A-Z][a-zA-Z\\\\-]{1,20}(\\\\s[A-Z][a-zA-Z\\\\-]{1,20})?$\";\n validate(this, pattern);\n}", "name() { }", "setName(name) {\n this._name = name;\n }", "function normalize(name) {\n return name.toLowerCase();\n}", "clearNames(s) {\n var scope = this;\n s.split('-').forEach((dash) => {\n delete scope.names[dash];\n dash.split('.').forEach((dot) => {\n delete scope.names[dot];\n });\n });\n }", "set name(newName) {\n if (newName.length >= 5) {\n this._name = newName;\n } else {\n throw new Error('Name should be at least 5 characters');\n }\n }", "function upperCase(name){\n\n}", "function parseName(tag) {\n\tlet name = tag.name\n\tname = name.replace(/_/g, ' ');\n\tname = name.replace(/\\b\\w/g, l => l.toUpperCase());\n\treturn name;\n}", "function directiveNormalize(name) { // 8950\n return camelCase(name.replace(PREFIX_REGEXP, '')); // 8951\n} // 8952", "function normalizeName(name) {\n if(options.paths) {\n var possibilities = []\n for (var path in paths) {\n if(name.startsWith(path)) {\n possibilities.push(path);\n }\n }\n\n var longestMatchingIndex = Math.max.apply(Math, possibilities.map(function(x) {return x.length}));\n var longestMatching = possibilities[longestMatchingIndex];\n name = longestMatching + name.slice(longestMatchingPath);\n }\n if(options.baseURL) {\n name = options.baseURL + '/' + name + '.js';\n }\n\n return name;\n}", "function isFactory( name ) {\n\t\treturn /^[A-Z]|^[_$]+$/.test( name );\n\t} // In case the Identifier is shorter than tab width, we can keep the", "setName( name ) {\n this.name = name;\n }", "function snake_case(name){\n\t\t\tvar regexp = /[A-Z]/g;\n\t\t\tvar separator = '-';\n\t\t\treturn name.replace(regexp, function(letter, pos) {\n\t\t\t\treturn (pos ? separator : '') + letter.toLowerCase();\n\t\t\t});\n\t\t}", "function /*one*/correctName/*two*/() { // eslint-disable-line no-inline-comments, spaced-comment\n return 0;\n }", "function isFactory(name) {\n return /^[A-Z]|^[$_]+$/.test(name);\n } // In case the Identifier is shorter than tab width, we can keep the", "function toCorrectCase(name) {\r\n if (isNaN(name) && sys.id(name) !== undefined) {\r\n return sys.name(sys.id(name));\r\n }\r\n else {\r\n return name;\r\n }\r\n}", "function isReservedMemberName(name) {\n return name.charCodeAt(0) === 95 /* _ */ &&\n name.charCodeAt(1) === 95 /* _ */ &&\n name.charCodeAt(2) !== 95 /* _ */ &&\n name.charCodeAt(2) !== 64 /* at */;\n }", "function camelCase(name){return name.replace(SPECIAL_CHARS_REGEXP,function(_,separator,letter,offset){return offset?letter.toUpperCase():letter;}).replace(MOZ_HACK_REGEXP,'Moz$1');}", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function cleanFieldName_v1(name) {\n return name.replace(/[^A-Za-z0-9]+/g, '_');\n }", "function snake_case(name){\n\t var regexp = /[A-Z]/g;\n\t var separator = '-';\n\t return name.replace(regexp, function(letter, pos) {\n\t return (pos ? separator : '') + letter.toLowerCase();\n\t });\n\t }", "set name(value) {\n\t\tthis._name = value;\n\t}", "function sanitizeClassname(name) {\n return name.replace(/[^a-z0-9]/g, function(s) {\n var c = s.charCodeAt(0);\n if (c == 32) return '-';\n if (c >= 65 && c <= 90) return '_' + s.toLowerCase();\n return '__' + ('000' + c.toString(16)).slice(-4);\n });\n }", "static className(name) {\n return name.replace(/\\w[^-\\s]*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1)).replace(/[-\\s]/g, \"\");\n }", "function checkName() {\n vmAddPermission.formData.role = bzUtilsSvc.textToSlug(vmAddPermission.formData.role);\n }", "function convertStylePropertyName(name) {\n return String(name).replace(/[A-Z]/g, function(c) {\n return '-' + c.toLowerCase();\n });\n }", "function isValidName(data) {\n var re = /^[a-zA-Z0-9_\\- ]*$/;\n\n return re.test(data);\n }", "function inName(name) {\n\tname = name.trim().split(\" \");\n\tname[1] = name[1].toUpperCase();\n\tname[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\treturn name[0] + \" \" + name[1];\n}", "function checkName(name){\r\n\tif(/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(name))\t\t\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function checkName(name){\r\n\tif(/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(name))\t\t\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function setName(n) {\n\tname = n;\n}", "function isValidName(str) { return NAME_PATTERN.test(str); }", "function isValidName(str) { return NAME_PATTERN.test(str); }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function (letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function (letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }", "function NameAnonymizer() {\n this.chance = new Chance();\n\n this.chance.set('firstNames', {\n 'male' : Names,\n 'female' : Names\n });\n }", "function validate_name(){\n name_outcome = validate.validateStr(name); //bool\n checkForm();\n }", "function formatName(_obj){\n\tvar _name = _obj.name;\n\tif(!_name){\n\t\t_obj.name = _name = \"unnamed\" + Math.round(Math.random()*10000);\n\t}else if(_name.indexOf(DELIM_CHAR) >= 0){\n\t\t_obj.name = _name = replaceString(_name, DELIM_CHAR, \"\");\n\t}\n\treturn _name;\n}", "function directiveNormalize(name){return name.replace(PREFIX_REGEXP,'').replace(SPECIAL_CHARS_REGEXP,fnCamelCaseReplace);}", "function processNaming(resources) {\n return resources.reduce((col, res) => {\n col[res.spec.kind] = {\n scope: res.spec.scope ? res.spec.scope.kind : undefined,\n plural: res.spec.plural\n };\n return col;\n }, {})\n}", "function convertStylePropertyName(name) {\n return String(name).replace(/[A-Z]/g, function (c) {\n return '-' + c.toLowerCase();\n });\n }", "function checkName() {\n vmEditPermission.formData.role = bzUtilsSvc.textToSlug(vmEditPermission.formData.role);\n }", "function kebabToCamel(name){return name.replace(DASH_LOWERCASE_REGEXP,fnCamelCaseReplace);}", "function toIdentifier(name){\n\tvar parts = name.split(/\\W+/)\n\tparts = _.map(parts, function(part){\n\t\treturn part.replace(/^./, function(chr){ return chr.toUpperCase() })\n\t})\n\t\n\treturn parts.join('')\n}", "get name() {return this._name;}", "function getNamingProperty(docs) {\n if (!docs) {\n return;\n }\n\n var naming;\n\n docs.every(function everyDoc(doc) {\n if (doc.hasOwnProperty(\"naming\")) {\n naming = doc.naming;\n return false;\n }\n return true;\n });\n\n return naming;\n }" ]
[ "0.72742933", "0.71357465", "0.6350764", "0.6319526", "0.62354445", "0.6111867", "0.6104084", "0.60775584", "0.60544574", "0.6054408", "0.6042745", "0.60326207", "0.60326207", "0.6029542", "0.60262007", "0.602019", "0.60103446", "0.6005225", "0.5969766", "0.5968321", "0.5968321", "0.5967255", "0.5957983", "0.5939888", "0.5931332", "0.59273684", "0.5926499", "0.5926499", "0.59263396", "0.591903", "0.5895741", "0.58845973", "0.5882518", "0.5880356", "0.5868932", "0.5860827", "0.586031", "0.5849778", "0.5825623", "0.5823047", "0.5812278", "0.5807335", "0.58051085", "0.58045167", "0.5798291", "0.57962316", "0.5788014", "0.57875735", "0.5770309", "0.57694554", "0.57690674", "0.5767505", "0.576468", "0.5763789", "0.57570726", "0.5751812", "0.57505983", "0.57495034", "0.5736665", "0.5734244", "0.5734038", "0.57321346", "0.573016", "0.573016", "0.573016", "0.573016", "0.573016", "0.573016", "0.573016", "0.573016", "0.573016", "0.5718693", "0.5717294", "0.5714296", "0.57100475", "0.5709775", "0.5708556", "0.57084244", "0.5708085", "0.56911224", "0.5685941", "0.5685941", "0.56857353", "0.5674585", "0.5674585", "0.5669328", "0.5669328", "0.56617767", "0.5655705", "0.56536114", "0.56489575", "0.56458485", "0.5643251", "0.5641553", "0.56374764", "0.56359667", "0.5633556", "0.5630837" ]
0.59453356
24
Produces a GraphQL Value AST given a JavaScript value. A GraphQL type must be provided, which will be used to interpret different JavaScript values. | JSON Value | GraphQL Value | | | | | Object | Input Object | | Array | List | | Boolean | Boolean | | String | String / Enum Value | | Number | Int / Float | | Mixed | Enum Value | | null | NullValue |
function astFromValue(value, type) { // Ensure flow knows that we treat function params as const. var _value = value; if (type instanceof _definition.GraphQLNonNull) { var astValue = astFromValue(_value, type.ofType); if (astValue && astValue.kind === Kind.NULL) { return null; } return astValue; } // only explicit null, not undefined, NaN if (_value === null) { return { kind: Kind.NULL }; } // undefined, NaN if ((0, _isInvalid2.default)(_value)) { return null; } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but // the value is not an array, convert the value using the list's item type. if (type instanceof _definition.GraphQLList) { var itemType = type.ofType; if ((0, _iterall.isCollection)(_value)) { var valuesNodes = []; (0, _iterall.forEach)(_value, function (item) { var itemNode = astFromValue(item, itemType); if (itemNode) { valuesNodes.push(itemNode); } }); return { kind: Kind.LIST, values: valuesNodes }; } return astFromValue(_value, itemType); } // Populate the fields of the input object by creating ASTs from each value // in the JavaScript object according to the fields in the input type. if (type instanceof _definition.GraphQLInputObjectType) { if (_value === null || (typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') { return null; } var fields = type.getFields(); var fieldNodes = []; Object.keys(fields).forEach(function (fieldName) { var fieldType = fields[fieldName].type; var fieldValue = astFromValue(_value[fieldName], fieldType); if (fieldValue) { fieldNodes.push({ kind: Kind.OBJECT_FIELD, name: { kind: Kind.NAME, value: fieldName }, value: fieldValue }); } }); return { kind: Kind.OBJECT, fields: fieldNodes }; } !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must provide Input Type, cannot use: ' + String(type)) : void 0; // Since value is an internally represented value, it must be serialized // to an externally represented value before converting into an AST. var serialized = type.serialize(_value); if ((0, _isNullish2.default)(serialized)) { return null; } // Others serialize based on their corresponding JavaScript scalar types. if (typeof serialized === 'boolean') { return { kind: Kind.BOOLEAN, value: serialized }; } // JavaScript numbers can be Int or Float values. if (typeof serialized === 'number') { var stringNum = String(serialized); return (/^[0-9]+$/.test(stringNum) ? { kind: Kind.INT, value: stringNum } : { kind: Kind.FLOAT, value: stringNum } ); } if (typeof serialized === 'string') { // Enum types use Enum literals. if (type instanceof _definition.GraphQLEnumType) { return { kind: Kind.ENUM, value: serialized }; } // ID types can use Int literals. if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) { return { kind: Kind.INT, value: serialized }; } // Use JSON stringify, which uses the same string encoding as GraphQL, // then remove the quotes. return { kind: Kind.STRING, value: JSON.stringify(serialized).slice(1, -1) }; } throw new TypeError('Cannot convert value to AST: ' + String(serialized)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseJSValue(value) {\n let val;\n if (isNodeCollection(value)) {\n val = value.get().value;\n } else if (isNode(value)) {\n val = value;\n } else {\n switch (typeof value) {\n case 'object':\n val = object(value);\n break;\n case 'function':\n val = parseFn(value);\n break;\n default:\n val = j.literal(value);\n }\n }\n return val;\n}", "function astFromValue(value, type) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _definition.GraphQLNonNull) {\n var astValue = astFromValue(_value, type.ofType);\n if (astValue && astValue.kind === _kinds.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (_value === null) {\n return { kind: _kinds.NULL };\n }\n\n // undefined, NaN\n if ((0, _isInvalid2.default)(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var valuesNodes = [];\n (0, _iterall.forEach)(_value, function (item) {\n var itemNode = astFromValue(item, itemType);\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return { kind: _kinds.LIST, values: valuesNodes };\n }\n return astFromValue(_value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (_value === null || typeof _value !== 'object') {\n return null;\n }\n var fields = type.getFields();\n var fieldNodes = [];\n Object.keys(fields).forEach(function (fieldName) {\n var fieldType = fields[fieldName].type;\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.OBJECT_FIELD,\n name: { kind: _kinds.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: _kinds.OBJECT, fields: fieldNodes };\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must provide Input Type, cannot use: ' + String(type));\n\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(_value);\n if ((0, _isNullish2.default)(serialized)) {\n return null;\n }\n\n // Others serialize based on their corresponding JavaScript scalar types.\n if (typeof serialized === 'boolean') {\n return { kind: _kinds.BOOLEAN, value: serialized };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return (/^[0-9]+$/.test(stringNum) ? { kind: _kinds.INT, value: stringNum } : { kind: _kinds.FLOAT, value: stringNum }\n );\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (type instanceof _definition.GraphQLEnumType) {\n return { kind: _kinds.ENUM, value: serialized };\n }\n\n // ID types can use Int literals.\n if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n return { kind: _kinds.INT, value: serialized };\n }\n\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return {\n kind: _kinds.STRING,\n value: JSON.stringify(serialized).slice(1, -1)\n };\n }\n\n throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n}", "function valueFromASTUntyped(valueNode) {\n switch (valueNode.kind) {\n case graphql_1.Kind.NULL:\n return null;\n case graphql_1.Kind.INT:\n return parseInt(valueNode.value, 10);\n case graphql_1.Kind.FLOAT:\n return parseFloat(valueNode.value);\n case graphql_1.Kind.STRING:\n case graphql_1.Kind.ENUM:\n case graphql_1.Kind.BOOLEAN:\n return valueNode.value;\n case graphql_1.Kind.LIST:\n return valueNode.values.map(valueFromASTUntyped);\n case graphql_1.Kind.OBJECT:\n var obj_1 = Object.create(null);\n valueNode.fields.forEach(function (field) {\n obj_1[field.name.value] = valueFromASTUntyped(field.value);\n });\n return obj_1;\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected value kind: ' + valueNode.kind);\n }\n}", "function valueFromASTUntyped(valueNode) {\n switch (valueNode.kind) {\n case graphql_1.Kind.NULL:\n return null;\n case graphql_1.Kind.INT:\n return parseInt(valueNode.value, 10);\n case graphql_1.Kind.FLOAT:\n return parseFloat(valueNode.value);\n case graphql_1.Kind.STRING:\n case graphql_1.Kind.ENUM:\n case graphql_1.Kind.BOOLEAN:\n return valueNode.value;\n case graphql_1.Kind.LIST:\n return valueNode.values.map(valueFromASTUntyped);\n case graphql_1.Kind.OBJECT:\n var obj_1 = Object.create(null);\n valueNode.fields.forEach(function (field) {\n obj_1[field.name.value] = valueFromASTUntyped(field.value);\n });\n return obj_1;\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected value kind: ' + valueNode.kind);\n }\n}", "function astFromValue(value, type) {\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t // Note: we're not checking that the result is non-null.\n\t // This function is not responsible for validating the input value.\n\t return astFromValue(_value, type.ofType);\n\t }\n\n\t if ((0, _isNullish2.default)(_value)) {\n\t return null;\n\t }\n\n\t // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n\t // the value is not an array, convert the value using the list's item type.\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if ((0, _iterall.isCollection)(_value)) {\n\t var _ret2 = function () {\n\t var valuesASTs = [];\n\t (0, _iterall.forEach)(_value, function (item) {\n\t var itemAST = astFromValue(item, itemType);\n\t if (itemAST) {\n\t valuesASTs.push(itemAST);\n\t }\n\t });\n\t return {\n\t v: {\n\t v: { kind: _kinds.LIST, values: valuesASTs }\n\t }\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\t return {\n\t v: astFromValue(_value, itemType)\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t // Populate the fields of the input object by creating ASTs from each value\n\t // in the JavaScript object according to the fields in the input type.\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret3 = function () {\n\t if (_value === null || typeof _value !== 'object') {\n\t return {\n\t v: null\n\t };\n\t }\n\t var fields = type.getFields();\n\t var fieldASTs = [];\n\t Object.keys(fields).forEach(function (fieldName) {\n\t var fieldType = fields[fieldName].type;\n\t var fieldValue = astFromValue(_value[fieldName], fieldType);\n\t if (fieldValue) {\n\t fieldASTs.push({\n\t kind: _kinds.OBJECT_FIELD,\n\t name: { kind: _kinds.NAME, value: fieldName },\n\t value: fieldValue\n\t });\n\t }\n\t });\n\t return {\n\t v: { kind: _kinds.OBJECT, fields: fieldASTs }\n\t };\n\t }();\n\n\t if (typeof _ret3 === \"object\") return _ret3.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must provide Input Type, cannot use: ' + String(type));\n\n\t // Since value is an internally represented value, it must be serialized\n\t // to an externally represented value before converting into an AST.\n\t var serialized = type.serialize(_value);\n\t if ((0, _isNullish2.default)(serialized)) {\n\t return null;\n\t }\n\n\t // Others serialize based on their corresponding JavaScript scalar types.\n\t if (typeof serialized === 'boolean') {\n\t return { kind: _kinds.BOOLEAN, value: serialized };\n\t }\n\n\t // JavaScript numbers can be Int or Float values.\n\t if (typeof serialized === 'number') {\n\t var stringNum = String(serialized);\n\t return (/^[0-9]+$/.test(stringNum) ? { kind: _kinds.INT, value: stringNum } : { kind: _kinds.FLOAT, value: stringNum }\n\t );\n\t }\n\n\t if (typeof serialized === 'string') {\n\t // Enum types use Enum literals.\n\t if (type instanceof _definition.GraphQLEnumType) {\n\t return { kind: _kinds.ENUM, value: serialized };\n\t }\n\n\t // ID types can use Int literals.\n\t if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n\t return { kind: _kinds.INT, value: serialized };\n\t }\n\n\t // Use JSON stringify, which uses the same string encoding as GraphQL,\n\t // then remove the quotes.\n\t return {\n\t kind: _kinds.STRING,\n\t value: JSON.stringify(serialized).slice(1, -1)\n\t };\n\t }\n\n\t throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n\t}", "function astFromValue(value, type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isNonNullType\"])(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if (astValue && astValue.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL\n };\n } // undefined, NaN\n\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(value)) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(iterall__WEBPACK_IMPORTED_MODULE_0__[\"isCollection\"])(value)) {\n var valuesNodes = [];\n Object(iterall__WEBPACK_IMPORTED_MODULE_0__[\"forEach\"])(value, function (item) {\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isInputObjectType\"])(type)) {\n if (value === null || _typeof(value) !== 'object') {\n return null;\n }\n\n var fields = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(type.getFields());\n var fieldNodes = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var field = _step.value;\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].OBJECT_FIELD,\n name: {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].OBJECT,\n fields: fieldNodes\n };\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isLeafType\"])(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (Object(_jsutils_isNullish__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(serialized)) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].INT,\n value: stringNum\n } : {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isEnumType\"])(type)) {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _type_scalars__WEBPACK_IMPORTED_MODULE_7__[\"GraphQLID\"] && integerStringRegExp.test(serialized)) {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].INT,\n value: serialized\n };\n }\n\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(serialized)));\n } // Not reachable. All possible input types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected input type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type), \"\\\".\"));\n}", "function astFromValue(value, type) {\n if ((0, _definition.isNonNullType)(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _kinds.Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n var items = (0, _safeArrayFrom.default)(value);\n\n if (items != null) {\n var valuesNodes = [];\n\n for (var _i2 = 0; _i2 < items.length; _i2++) {\n var item = items[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _kinds.Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (!(0, _isObjectLike.default)(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.Kind.OBJECT_FIELD,\n name: {\n kind: _kinds.Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _kinds.Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && (0, _isFinite.default)(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _kinds.Kind.INT,\n value: stringNum\n } : {\n kind: _kinds.Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if ((0, _definition.isEnumType)(type)) {\n return {\n kind: _kinds.Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: _kinds.Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: _kinds.Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat((0, _inspect.default)(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type));\n}", "function astFromValue(value, type) {\n if ((0, _definition.isNonNullType)(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _kinds.Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n var items = (0, _safeArrayFrom.default)(value);\n\n if (items != null) {\n var valuesNodes = [];\n\n for (var _i2 = 0; _i2 < items.length; _i2++) {\n var item = items[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _kinds.Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (!(0, _isObjectLike.default)(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.Kind.OBJECT_FIELD,\n name: {\n kind: _kinds.Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _kinds.Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && (0, _isFinite.default)(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _kinds.Kind.INT,\n value: stringNum\n } : {\n kind: _kinds.Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if ((0, _definition.isEnumType)(type)) {\n return {\n kind: _kinds.Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: _kinds.Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: _kinds.Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat((0, _inspect.default)(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type));\n}", "function valueFromAST(valueAST, type, variables) {\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t // Note: we're not checking that the result of valueFromAST is non-null.\n\t // We're assuming that this query has been validated and the value used\n\t // here is of the correct type.\n\t return valueFromAST(valueAST, type.ofType, variables);\n\t }\n\n\t if (!valueAST) {\n\t return null;\n\t }\n\n\t if (valueAST.kind === Kind.VARIABLE) {\n\t var variableName = valueAST.name.value;\n\t if (!variables || !variables.hasOwnProperty(variableName)) {\n\t return null;\n\t }\n\t // Note: we're not doing any checking that this variable is correct. We're\n\t // assuming that this query has been validated and the variable usage here\n\t // is of the correct type.\n\t return variables[variableName];\n\t }\n\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if (valueAST.kind === Kind.LIST) {\n\t return {\n\t v: valueAST.values.map(function (itemAST) {\n\t return valueFromAST(itemAST, itemType, variables);\n\t })\n\t };\n\t }\n\t return {\n\t v: [valueFromAST(valueAST, itemType, variables)]\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret2 = function () {\n\t if (valueAST.kind !== Kind.OBJECT) {\n\t return {\n\t v: null\n\t };\n\t }\n\t var fields = type.getFields();\n\t var fieldASTs = (0, _keyMap2.default)(valueAST.fields, function (field) {\n\t return field.name.value;\n\t });\n\t return {\n\t v: Object.keys(fields).reduce(function (obj, fieldName) {\n\t var field = fields[fieldName];\n\t var fieldAST = fieldASTs[fieldName];\n\t var fieldValue = valueFromAST(fieldAST && fieldAST.value, field.type, variables);\n\t if ((0, _isNullish2.default)(fieldValue)) {\n\t fieldValue = field.defaultValue;\n\t }\n\t if (!(0, _isNullish2.default)(fieldValue)) {\n\t obj[fieldName] = fieldValue;\n\t }\n\t return obj;\n\t }, {})\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n\t var parsed = type.parseLiteral(valueAST);\n\t if (!(0, _isNullish2.default)(parsed)) {\n\t return parsed;\n\t }\n\t}", "function astFromValue(value, type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isNonNullType\"])(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(_jsutils_isCollection_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(value)) {\n var valuesNodes = []; // Since we transpile for-of in loose mode it doesn't support iterators\n // and it's required to first convert iteratable into array\n\n for (var _i2 = 0, _arrayFrom2 = Object(_polyfills_arrayFrom_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value); _i2 < _arrayFrom2.length; _i2++) {\n var item = _arrayFrom2[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isInputObjectType\"])(type)) {\n if (!Object(_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT_FIELD,\n name: {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isLeafType\"])(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && Object(_polyfills_isFinite_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: stringNum\n } : {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isEnumType\"])(type)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_8__[\"GraphQLID\"] && integerStringRegExp.test(serialized)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: serialized\n };\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(type));\n}", "function astFromValue(value, type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isNonNullType\"])(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(_jsutils_isCollection_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(value)) {\n var valuesNodes = []; // Since we transpile for-of in loose mode it doesn't support iterators\n // and it's required to first convert iteratable into array\n\n for (var _i2 = 0, _arrayFrom2 = Object(_polyfills_arrayFrom_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value); _i2 < _arrayFrom2.length; _i2++) {\n var item = _arrayFrom2[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isInputObjectType\"])(type)) {\n if (!Object(_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT_FIELD,\n name: {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isLeafType\"])(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && Object(_polyfills_isFinite_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: stringNum\n } : {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isEnumType\"])(type)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_8__[\"GraphQLID\"] && integerStringRegExp.test(serialized)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: serialized\n };\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(type));\n}", "function coerceValue(type, value) {\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t // Note: we're not checking that the result of coerceValue is non-null.\n\t // We only call this function after calling isValidJSValue.\n\t return coerceValue(type.ofType, _value);\n\t }\n\n\t if ((0, _isNullish2.default)(_value)) {\n\t return null;\n\t }\n\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if ((0, _iterall.isCollection)(_value)) {\n\t var _ret2 = function () {\n\t var coercedValues = [];\n\t (0, _iterall.forEach)(_value, function (item) {\n\t coercedValues.push(coerceValue(itemType, item));\n\t });\n\t return {\n\t v: {\n\t v: coercedValues\n\t }\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\t return {\n\t v: [coerceValue(itemType, _value)]\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret3 = function () {\n\t if (typeof _value !== 'object' || _value === null) {\n\t return {\n\t v: null\n\t };\n\t }\n\t var fields = type.getFields();\n\t return {\n\t v: Object.keys(fields).reduce(function (obj, fieldName) {\n\t var field = fields[fieldName];\n\t var fieldValue = coerceValue(field.type, _value[fieldName]);\n\t if ((0, _isNullish2.default)(fieldValue)) {\n\t fieldValue = field.defaultValue;\n\t }\n\t if (!(0, _isNullish2.default)(fieldValue)) {\n\t obj[fieldName] = fieldValue;\n\t }\n\t return obj;\n\t }, {})\n\t };\n\t }();\n\n\t if (typeof _ret3 === \"object\") return _ret3.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n\t var parsed = type.parseValue(_value);\n\t if (!(0, _isNullish2.default)(parsed)) {\n\t return parsed;\n\t }\n\t}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL:\n return null;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].INT:\n return parseInt(valueNode.value, 10);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FLOAT:\n return parseFloat(valueNode.value);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].STRING:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].BOOLEAN:\n return valueNode.value;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT:\n return Object(_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(0, 'Unexpected value node: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(valueNode));\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL:\n return null;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].INT:\n return parseInt(valueNode.value, 10);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FLOAT:\n return parseFloat(valueNode.value);\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].STRING:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM:\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].BOOLEAN:\n return valueNode.value;\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT:\n return Object(_jsutils_keyValMap_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(0, 'Unexpected value node: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(valueNode));\n}", "function astFromValue(value, type) {\n if ((0, _definition.isNonNullType)(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _kinds.Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n\n if ((0, _isCollection[\"default\"])(value)) {\n var valuesNodes = []; // Since we transpile for-of in loose mode it doesn't support iterators\n // and it's required to first convert iteratable into array\n\n for (var _i2 = 0, _arrayFrom2 = (0, _arrayFrom3[\"default\"])(value); _i2 < _arrayFrom2.length; _i2++) {\n var item = _arrayFrom2[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _kinds.Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (!(0, _isObjectLike[\"default\"])(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues3[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.Kind.OBJECT_FIELD,\n name: {\n kind: _kinds.Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _kinds.Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && (0, _isFinite[\"default\"])(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _kinds.Kind.INT,\n value: stringNum\n } : {\n kind: _kinds.Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if ((0, _definition.isEnumType)(type)) {\n return {\n kind: _kinds.Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: _kinds.Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: _kinds.Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat((0, _inspect[\"default\"])(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant[\"default\"])(0, 'Unexpected input type: ' + (0, _inspect[\"default\"])(type));\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].NULL:\n return null;\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].INT:\n return parseInt(valueNode.value, 10);\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FLOAT:\n return parseFloat(valueNode.value);\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].STRING:\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].ENUM:\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].BOOLEAN:\n return valueNode.value;\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT:\n return Object(_jsutils_keyValMap__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _language_kinds__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].VARIABLE:\n var variableName = valueNode.name.value;\n return variables && !Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(variables[variableName]) ? variables[variableName] : undefined;\n } // Not reachable. All possible value nodes have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected value node: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(valueNode), \"\\\".\"));\n}", "function _valueOf(value) {\n var p = {};\n switch (value.type) {\n case 'object':\n p.value = {\n description: value.className,\n hasChildren: true,\n injectedScriptId: value.ref || value.handle,\n type: 'object'\n };\n break;\n case 'function':\n p.value = {\n description: value.text || 'function()',\n hasChildren: true,\n injectedScriptId: value.ref || value.handle,\n type: 'function'\n };\n break;\n case 'undefined':\n p.value = {description: 'undefined'};\n break;\n case 'null':\n p.value = {description: 'null'};\n break;\n case 'script':\n p.value = {description: value.text};\n break;\n default:\n p.value = {description: value.value};\n break;\n }\n return p;\n }", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (!variables || Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(variables[variableName])) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].LIST) {\n var coercedValues = [];\n var itemNodes = valueNode.values;\n\n for (var i = 0; i < itemNodes.length; i++) {\n if (isMissingVariable(itemNodes[i], variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNodes[i], itemType, variables);\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(itemValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(coercedValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isInputObjectType\"])(type)) {\n if (valueNode.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = Object(_jsutils_keyMap__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n });\n var fields = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields());\n\n for (var _i = 0; _i < fields.length; _i++) {\n var field = fields[_i];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(fieldValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isEnumType\"])(type)) {\n if (valueNode.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].ENUM) {\n return; // Invalid: intentionally return no value.\n }\n\n var enumValue = type.getValue(valueNode.value);\n\n if (!enumValue) {\n return; // Invalid: intentionally return no value.\n }\n\n return enumValue.value;\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_5__[\"isScalarType\"])(type)) {\n // Scalars fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(result)) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // Not reachable. All possible input types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected input type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(type), \"\\\".\"));\n} // Returns true if the provided valueNode is a variable which is not defined", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isInputObjectType\"])(type)) {\n if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = Object(_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isLeafType\"])(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(type)) {\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isInputObjectType\"])(type)) {\n if (valueNode.kind !== _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = Object(_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isNonNullType\"])(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_5__[\"isLeafType\"])(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "function astFromValue(_x, _x2) {\n var _again = true;\n\n _function: while (_again) {\n var value = _x,\n type = _x2;\n _value = _ret = stringNum = isIntValue = fields = undefined;\n _again = false;\n\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _typeDefinition.GraphQLNonNull) {\n // Note: we're not checking that the result is non-null.\n // This function is not responsible for validating the input value.\n _x = _value;\n _x2 = type.ofType;\n _again = true;\n continue _function;\n }\n\n if ((0, _jsutilsIsNullish2['default'])(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (Array.isArray(_value)) {\n var _ret = (function () {\n var itemType = type instanceof _typeDefinition.GraphQLList ? type.ofType : null;\n return {\n v: {\n kind: _languageKinds.LIST,\n values: _value.map(function (item) {\n var itemValue = astFromValue(item, itemType);\n (0, _jsutilsInvariant2['default'])(itemValue, 'Could not create AST item.');\n return itemValue;\n })\n }\n };\n })();\n\n if (typeof _ret === 'object') return _ret.v;\n } else if (type instanceof _typeDefinition.GraphQLList) {\n // Because GraphQL will accept single values as a \"list of one\" when\n // expecting a list, if there's a non-array value and an expected list type,\n // create an AST using the list's item type.\n _x = _value;\n _x2 = type.ofType;\n _again = true;\n continue _function;\n }\n\n if (typeof _value === 'boolean') {\n return { kind: _languageKinds.BOOLEAN, value: _value };\n }\n\n // JavaScript numbers can be Float or Int values. Use the GraphQLType to\n // differentiate if available, otherwise prefer Int if the value is a\n // valid Int.\n if (typeof _value === 'number') {\n var stringNum = String(_value);\n var isIntValue = /^[0-9]+$/.test(stringNum);\n if (isIntValue) {\n if (type === _typeScalars.GraphQLFloat) {\n return { kind: _languageKinds.FLOAT, value: stringNum + '.0' };\n }\n return { kind: _languageKinds.INT, value: stringNum };\n }\n return { kind: _languageKinds.FLOAT, value: stringNum };\n }\n\n // JavaScript strings can be Enum values or String values. Use the\n // GraphQLType to differentiate if possible.\n if (typeof _value === 'string') {\n if (type instanceof _typeDefinition.GraphQLEnumType && /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(_value)) {\n return { kind: _languageKinds.ENUM, value: _value };\n }\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return { kind: _languageKinds.STRING, value: JSON.stringify(_value).slice(1, -1) };\n }\n\n // last remaining possible typeof\n (0, _jsutilsInvariant2['default'])(typeof _value === 'object' && _value !== null);\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object.\n var fields = [];\n _Object$keys(_value).forEach(function (fieldName) {\n var fieldType = undefined;\n if (type instanceof _typeDefinition.GraphQLInputObjectType) {\n var fieldDef = type.getFields()[fieldName];\n fieldType = fieldDef && fieldDef.type;\n }\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fields.push({\n kind: _languageKinds.OBJECT_FIELD,\n name: { kind: _languageKinds.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: _languageKinds.OBJECT, fields: fields };\n }\n}", "function getGraphQLValue(value) {\n if (\"string\" === typeof value) {\n value = JSON.stringify(value);\n } else if (Array.isArray(value)) {\n value = value.map(item => {\n return getGraphQLValue(item);\n }).join();\n value = `[${value}]`;\n } else if (\"object\" === typeof value) {\n /*if (value.toSource)\n value = value.toSource().slice(2,-2);\n else*/\n value = objectToString(value);\n //console.error(\"No toSource!!\",value);\n }\n return value;\n}", "function isValidJSValue(value, type) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if ((0, _isNullish2.default)(value)) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidJSValue(value, type.ofType);\n }\n\n if ((0, _isNullish2.default)(value)) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(value)) {\n var errors = [];\n (0, _iterall.forEach)(value, function (item, index) {\n errors.push.apply(errors, isValidJSValue(item, itemType).map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n });\n return errors;\n }\n return isValidJSValue(value, itemType);\n }\n\n // Input objects check each defined field.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (typeof value !== 'object' || value === null) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var _errors = [];\n\n // Ensure every provided field is defined.\n Object.keys(value).forEach(function (providedField) {\n if (!fields[providedField]) {\n _errors.push('In field \"' + providedField + '\": Unknown field.');\n }\n });\n\n // Ensure every defined field is valid.\n Object.keys(fields).forEach(function (fieldName) {\n var newErrors = isValidJSValue(value[fieldName], fields[fieldName].type);\n _errors.push.apply(_errors, newErrors.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n }));\n });\n\n return _errors;\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n // Scalar/Enum input checks to ensure the type can parse the value to\n // a non-null value.\n try {\n var parseResult = type.parseValue(value);\n if ((0, _isNullish2.default)(parseResult) && !type.isValidValue(value)) {\n return ['Expected type \"' + type.name + '\", found ' + JSON.stringify(value) + '.'];\n }\n } catch (error) {\n return ['Expected type \"' + type.name + '\", found ' + JSON.stringify(value) + ': ' + error.message];\n }\n\n return [];\n}", "function isValidJSValue(value, type) {\n\t // A value must be provided if the type is non-null.\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t if ((0, _isNullish2.default)(value)) {\n\t if (type.ofType.name) {\n\t return ['Expected \"' + String(type.ofType.name) + '!\", found null.'];\n\t }\n\t return ['Expected non-null value, found null.'];\n\t }\n\t return isValidJSValue(value, type.ofType);\n\t }\n\n\t if ((0, _isNullish2.default)(value)) {\n\t return [];\n\t }\n\n\t // Lists accept a non-list value as a list of one.\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if ((0, _iterall.isCollection)(value)) {\n\t var _ret2 = function () {\n\t var errors = [];\n\t (0, _iterall.forEach)(value, function (item, index) {\n\t errors.push.apply(errors, isValidJSValue(item, itemType).map(function (error) {\n\t return 'In element #' + index + ': ' + error;\n\t }));\n\t });\n\t return {\n\t v: {\n\t v: errors\n\t }\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\t return {\n\t v: isValidJSValue(value, itemType)\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t // Input objects check each defined field.\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret3 = function () {\n\t if (typeof value !== 'object' || value === null) {\n\t return {\n\t v: ['Expected \"' + type.name + '\", found not an object.']\n\t };\n\t }\n\t var fields = type.getFields();\n\n\t var errors = [];\n\n\t // Ensure every provided field is defined.\n\t Object.keys(value).forEach(function (providedField) {\n\t if (!fields[providedField]) {\n\t errors.push('In field \"' + providedField + '\": Unknown field.');\n\t }\n\t });\n\n\t // Ensure every defined field is valid.\n\t Object.keys(fields).forEach(function (fieldName) {\n\t var newErrors = isValidJSValue(value[fieldName], fields[fieldName].type);\n\t errors.push.apply(errors, newErrors.map(function (error) {\n\t return 'In field \"' + fieldName + '\": ' + error;\n\t }));\n\t });\n\n\t return {\n\t v: errors\n\t };\n\t }();\n\n\t if (typeof _ret3 === \"object\") return _ret3.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n\t // Scalar/Enum input checks to ensure the type can parse the value to\n\t // a non-null value.\n\t var parseResult = type.parseValue(value);\n\t if ((0, _isNullish2.default)(parseResult)) {\n\t return ['Expected type \"' + type.name + '\", found ' + JSON.stringify(value) + '.'];\n\t }\n\n\t return [];\n\t}", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n if (!variables || (0, _isInvalid2.default)(variables[variableName])) {\n // No valid return value.\n return;\n }\n // Note: we're not doing any checking that this variable is correct. We're\n // assuming that this query has been validated and the variable usage here\n // is of the correct type.\n return variables[variableName];\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n var coercedValues = [];\n var itemNodes = valueNode.values;\n for (var i = 0; i < itemNodes.length; i++) {\n if (isMissingVariable(itemNodes[i], variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (itemType instanceof _definition.GraphQLNonNull) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNodes[i], itemType, variables);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n }\n return coercedValues;\n }\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Invalid: intentionally return no value.\n }\n return [coercedValue];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNodes = (0, _keyMap2.default)(valueNode.fields, function (field) {\n return field.name.value;\n });\n var fieldNames = Object.keys(fields);\n for (var _i = 0; _i < fieldNames.length; _i++) {\n var fieldName = fieldNames[_i];\n var field = fields[fieldName];\n var fieldNode = fieldNodes[fieldName];\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Invalid: intentionally return no value.\n }\n continue;\n }\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n var parsed = type.parseLiteral(valueNode);\n if ((0, _isNullish2.default)(parsed) && !type.isValidLiteral(valueNode)) {\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n return;\n }\n\n return parsed;\n}", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n if (!variables || (0, _isInvalid2.default)(variables[variableName])) {\n // No valid return value.\n return;\n }\n // Note: we're not doing any checking that this variable is correct. We're\n // assuming that this query has been validated and the variable usage here\n // is of the correct type.\n return variables[variableName];\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n var coercedValues = [];\n var itemNodes = valueNode.values;\n for (var i = 0; i < itemNodes.length; i++) {\n if (isMissingVariable(itemNodes[i], variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (itemType instanceof _definition.GraphQLNonNull) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNodes[i], itemType, variables);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n }\n return coercedValues;\n }\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Invalid: intentionally return no value.\n }\n return [coercedValue];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNodes = (0, _keyMap2.default)(valueNode.fields, function (field) {\n return field.name.value;\n });\n var fieldNames = Object.keys(fields);\n for (var _i = 0; _i < fieldNames.length; _i++) {\n var fieldName = fieldNames[_i];\n var field = fields[fieldName];\n var fieldNode = fieldNodes[fieldName];\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Invalid: intentionally return no value.\n }\n continue;\n }\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n var parsed = type.parseLiteral(valueNode);\n if ((0, _isNullish2.default)(parsed) && !type.isValidLiteral(valueNode)) {\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n return;\n }\n\n return parsed;\n}", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n if (!variables || (0, _isInvalid2.default)(variables[variableName])) {\n // No valid return value.\n return;\n }\n // Note: we're not doing any checking that this variable is correct. We're\n // assuming that this query has been validated and the variable usage here\n // is of the correct type.\n return variables[variableName];\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n var coercedValues = [];\n var itemNodes = valueNode.values;\n for (var i = 0; i < itemNodes.length; i++) {\n if (isMissingVariable(itemNodes[i], variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (itemType instanceof _definition.GraphQLNonNull) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNodes[i], itemType, variables);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n }\n return coercedValues;\n }\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Invalid: intentionally return no value.\n }\n return [coercedValue];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNodes = (0, _keyMap2.default)(valueNode.fields, function (field) {\n return field.name.value;\n });\n var fieldNames = Object.keys(fields);\n for (var _i = 0; _i < fieldNames.length; _i++) {\n var fieldName = fieldNames[_i];\n var field = fields[fieldName];\n var fieldNode = fieldNodes[fieldName];\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Invalid: intentionally return no value.\n }\n continue;\n }\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Invalid: intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n var parsed = type.parseLiteral(valueNode);\n if ((0, _isNullish2.default)(parsed) && !type.isValidLiteral(valueNode)) {\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n return;\n }\n\n return parsed;\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _kinds.Kind.NULL:\n return null;\n\n case _kinds.Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case _kinds.Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case _kinds.Kind.STRING:\n case _kinds.Kind.ENUM:\n case _kinds.Kind.BOOLEAN:\n return valueNode.value;\n\n case _kinds.Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _kinds.Kind.OBJECT:\n return (0, _keyValMap.default)(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _kinds.Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected value node: ' + (0, _inspect.default)(valueNode));\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _kinds.Kind.NULL:\n return null;\n\n case _kinds.Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case _kinds.Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case _kinds.Kind.STRING:\n case _kinds.Kind.ENUM:\n case _kinds.Kind.BOOLEAN:\n return valueNode.value;\n\n case _kinds.Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _kinds.Kind.OBJECT:\n return (0, _keyValMap.default)(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _kinds.Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected value node: ' + (0, _inspect.default)(valueNode));\n}", "function isValidJSValue(value, type) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if ((0, _isNullish2.default)(value)) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidJSValue(value, type.ofType);\n }\n\n if ((0, _isNullish2.default)(value)) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(value)) {\n var errors = [];\n (0, _iterall.forEach)(value, function (item, index) {\n errors.push.apply(errors, isValidJSValue(item, itemType).map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n });\n return errors;\n }\n return isValidJSValue(value, itemType);\n }\n\n // Input objects check each defined field.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var _errors = [];\n\n // Ensure every provided field is defined.\n Object.keys(value).forEach(function (providedField) {\n if (!fields[providedField]) {\n _errors.push('In field \"' + providedField + '\": Unknown field.');\n }\n });\n\n // Ensure every defined field is valid.\n Object.keys(fields).forEach(function (fieldName) {\n var newErrors = isValidJSValue(value[fieldName], fields[fieldName].type);\n _errors.push.apply(_errors, newErrors.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n }));\n });\n\n return _errors;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n // Scalar/Enum input checks to ensure the type can parse the value to\n // a non-null value.\n try {\n var parseResult = type.parseValue(value);\n if ((0, _isNullish2.default)(parseResult) && !type.isValidValue(value)) {\n return ['Expected type \"' + type.name + '\", found ' + JSON.stringify(value) + '.'];\n }\n } catch (error) {\n return ['Expected type \"' + type.name + '\", found ' + JSON.stringify(value) + ': ' + error.message];\n }\n\n return [];\n}", "function isValidJSValue(value, type) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if ((0, _isNullish2.default)(value)) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidJSValue(value, type.ofType);\n }\n\n if ((0, _isNullish2.default)(value)) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(value)) {\n var errors = [];\n (0, _iterall.forEach)(value, function (item, index) {\n errors.push.apply(errors, isValidJSValue(item, itemType).map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n });\n return errors;\n }\n return isValidJSValue(value, itemType);\n }\n\n // Input objects check each defined field.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var _errors = [];\n\n // Ensure every provided field is defined.\n Object.keys(value).forEach(function (providedField) {\n if (!fields[providedField]) {\n _errors.push('In field \"' + providedField + '\": Unknown field.');\n }\n });\n\n // Ensure every defined field is valid.\n Object.keys(fields).forEach(function (fieldName) {\n var newErrors = isValidJSValue(value[fieldName], fields[fieldName].type);\n _errors.push.apply(_errors, newErrors.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n }));\n });\n\n return _errors;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n // Scalar/Enum input checks to ensure the type can parse the value to\n // a non-null value.\n try {\n var parseResult = type.parseValue(value);\n if ((0, _isNullish2.default)(parseResult) && !type.isValidValue(value)) {\n return ['Expected type \"' + type.name + '\", found ' + JSON.stringify(value) + '.'];\n }\n } catch (error) {\n return ['Expected type \"' + type.name + '\", found ' + JSON.stringify(value) + ': ' + error.message];\n }\n\n return [];\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _kinds.Kind.NULL:\n return null;\n\n case _kinds.Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case _kinds.Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case _kinds.Kind.STRING:\n case _kinds.Kind.ENUM:\n case _kinds.Kind.BOOLEAN:\n return valueNode.value;\n\n case _kinds.Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _kinds.Kind.OBJECT:\n return (0, _keyValMap[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _kinds.Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || (0, _invariant[\"default\"])(0, 'Unexpected value node: ' + (0, _inspect[\"default\"])(valueNode));\n}", "function astFromValue(_x, _x2) {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t var value = _x,\n\t type = _x2;\n\t _value = _ret = stringNum = isIntValue = fields = undefined;\n\t _again = false;\n\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _typeDefinition.GraphQLNonNull) {\n\t // Note: we're not checking that the result is non-null.\n\t // This function is not responsible for validating the input value.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if ((0, _jsutilsIsNullish2['default'])(_value)) {\n\t return null;\n\t }\n\n\t // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n\t // the value is not an array, convert the value using the list's item type.\n\t if (Array.isArray(_value)) {\n\t var _ret = (function () {\n\t var itemType = type instanceof _typeDefinition.GraphQLList ? type.ofType : null;\n\t return {\n\t v: {\n\t kind: _languageKinds.LIST,\n\t values: _value.map(function (item) {\n\t var itemValue = astFromValue(item, itemType);\n\t (0, _jsutilsInvariant2['default'])(itemValue, 'Could not create AST item.');\n\t return itemValue;\n\t })\n\t }\n\t };\n\t })();\n\n\t if (typeof _ret === 'object') return _ret.v;\n\t } else if (type instanceof _typeDefinition.GraphQLList) {\n\t // Because GraphQL will accept single values as a \"list of one\" when\n\t // expecting a list, if there's a non-array value and an expected list type,\n\t // create an AST using the list's item type.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if (typeof _value === 'boolean') {\n\t return { kind: _languageKinds.BOOLEAN, value: _value };\n\t }\n\n\t // JavaScript numbers can be Float or Int values. Use the GraphQLType to\n\t // differentiate if available, otherwise prefer Int if the value is a\n\t // valid Int.\n\t if (typeof _value === 'number') {\n\t var stringNum = String(_value);\n\t var isIntValue = /^[0-9]+$/.test(stringNum);\n\t if (isIntValue) {\n\t if (type === _typeScalars.GraphQLFloat) {\n\t return { kind: _languageKinds.FLOAT, value: stringNum + '.0' };\n\t }\n\t return { kind: _languageKinds.INT, value: stringNum };\n\t }\n\t return { kind: _languageKinds.FLOAT, value: stringNum };\n\t }\n\n\t // JavaScript strings can be Enum values or String values. Use the\n\t // GraphQLType to differentiate if possible.\n\t if (typeof _value === 'string') {\n\t if (type instanceof _typeDefinition.GraphQLEnumType && /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(_value)) {\n\t return { kind: _languageKinds.ENUM, value: _value };\n\t }\n\t // Use JSON stringify, which uses the same string encoding as GraphQL,\n\t // then remove the quotes.\n\t return { kind: _languageKinds.STRING, value: JSON.stringify(_value).slice(1, -1) };\n\t }\n\n\t // last remaining possible typeof\n\t (0, _jsutilsInvariant2['default'])(typeof _value === 'object' && _value !== null);\n\n\t // Populate the fields of the input object by creating ASTs from each value\n\t // in the JavaScript object.\n\t var fields = [];\n\t _Object$keys(_value).forEach(function (fieldName) {\n\t var fieldType = undefined;\n\t if (type instanceof _typeDefinition.GraphQLInputObjectType) {\n\t var fieldDef = type.getFields()[fieldName];\n\t fieldType = fieldDef && fieldDef.type;\n\t }\n\t var fieldValue = astFromValue(_value[fieldName], fieldType);\n\t if (fieldValue) {\n\t fields.push({\n\t kind: _languageKinds.OBJECT_FIELD,\n\t name: { kind: _languageKinds.NAME, value: fieldName },\n\t value: fieldValue\n\t });\n\t }\n\t });\n\t return { kind: _languageKinds.OBJECT, fields: fields };\n\t }\n\t}", "getAst() {\n\n return {\n type: 'string',\n val: this.value\n };\n }", "function coerceValue(type, value) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if ((0, _isInvalid2.default)(_value)) {\n return; // Intentionally return no value.\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (_value === null) {\n return; // Intentionally return no value.\n }\n return coerceValue(type.ofType, _value);\n }\n\n if (_value === null) {\n // Intentionally return the value null.\n return null;\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var coercedValues = [];\n var valueIter = (0, _iterall.createIterator)(_value);\n if (!valueIter) {\n return; // Intentionally return no value.\n }\n var step = void 0;\n while (!(step = valueIter.next()).done) {\n var itemValue = coerceValue(itemType, step.value);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n return coercedValues;\n }\n var coercedValue = coerceValue(itemType, _value);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Intentionally return no value.\n }\n return [coerceValue(itemType, _value)];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if ((typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return; // Intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNames = Object.keys(fields);\n for (var i = 0; i < fieldNames.length; i++) {\n var fieldName = fieldNames[i];\n var field = fields[fieldName];\n if ((0, _isInvalid2.default)(_value[fieldName])) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Intentionally return no value.\n }\n continue;\n }\n var fieldValue = coerceValue(field.type, _value[fieldName]);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n var parsed = type.parseValue(_value);\n if ((0, _isNullish2.default)(parsed)) {\n // null or invalid values represent a failure to parse correctly,\n // in which case no value is returned.\n return;\n }\n\n return parsed;\n}", "function coerceValue(type, value) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if ((0, _isInvalid2.default)(_value)) {\n return; // Intentionally return no value.\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (_value === null) {\n return; // Intentionally return no value.\n }\n return coerceValue(type.ofType, _value);\n }\n\n if (_value === null) {\n // Intentionally return the value null.\n return null;\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var coercedValues = [];\n var valueIter = (0, _iterall.createIterator)(_value);\n if (!valueIter) {\n return; // Intentionally return no value.\n }\n var step = void 0;\n while (!(step = valueIter.next()).done) {\n var itemValue = coerceValue(itemType, step.value);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n return coercedValues;\n }\n var coercedValue = coerceValue(itemType, _value);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Intentionally return no value.\n }\n return [coerceValue(itemType, _value)];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if ((typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return; // Intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNames = Object.keys(fields);\n for (var i = 0; i < fieldNames.length; i++) {\n var fieldName = fieldNames[i];\n var field = fields[fieldName];\n if ((0, _isInvalid2.default)(_value[fieldName])) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Intentionally return no value.\n }\n continue;\n }\n var fieldValue = coerceValue(field.type, _value[fieldName]);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n var parsed = type.parseValue(_value);\n if ((0, _isNullish2.default)(parsed)) {\n // null or invalid values represent a failure to parse correctly,\n // in which case no value is returned.\n return;\n }\n\n return parsed;\n}", "function isValidLiteralValue(type, valueAST) {\n\t // A value must be provided if the type is non-null.\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t if (!valueAST) {\n\t if (type.ofType.name) {\n\t return ['Expected \"' + String(type.ofType.name) + '!\", found null.'];\n\t }\n\t return ['Expected non-null value, found null.'];\n\t }\n\t return isValidLiteralValue(type.ofType, valueAST);\n\t }\n\n\t if (!valueAST) {\n\t return [];\n\t }\n\n\t // This function only tests literals, and assumes variables will provide\n\t // values of the correct type.\n\t if (valueAST.kind === _kinds.VARIABLE) {\n\t return [];\n\t }\n\n\t // Lists accept a non-list value as a list of one.\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if (valueAST.kind === _kinds.LIST) {\n\t return {\n\t v: valueAST.values.reduce(function (acc, itemAST, index) {\n\t var errors = isValidLiteralValue(itemType, itemAST);\n\t return acc.concat(errors.map(function (error) {\n\t return 'In element #' + index + ': ' + error;\n\t }));\n\t }, [])\n\t };\n\t }\n\t return {\n\t v: isValidLiteralValue(itemType, valueAST)\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t // Input objects check each defined field and look for undefined fields.\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret2 = function () {\n\t if (valueAST.kind !== _kinds.OBJECT) {\n\t return {\n\t v: ['Expected \"' + type.name + '\", found not an object.']\n\t };\n\t }\n\t var fields = type.getFields();\n\n\t var errors = [];\n\n\t // Ensure every provided field is defined.\n\t var fieldASTs = valueAST.fields;\n\t fieldASTs.forEach(function (providedFieldAST) {\n\t if (!fields[providedFieldAST.name.value]) {\n\t errors.push('In field \"' + providedFieldAST.name.value + '\": Unknown field.');\n\t }\n\t });\n\n\t // Ensure every defined field is valid.\n\t var fieldASTMap = (0, _keyMap2.default)(fieldASTs, function (fieldAST) {\n\t return fieldAST.name.value;\n\t });\n\t Object.keys(fields).forEach(function (fieldName) {\n\t var result = isValidLiteralValue(fields[fieldName].type, fieldASTMap[fieldName] && fieldASTMap[fieldName].value);\n\t errors.push.apply(errors, result.map(function (error) {\n\t return 'In field \"' + fieldName + '\": ' + error;\n\t }));\n\t });\n\n\t return {\n\t v: errors\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n\t // Scalar/Enum input checks to ensure the type can parse the value to\n\t // a non-null value.\n\t var parseResult = type.parseLiteral(valueAST);\n\t if ((0, _isNullish2.default)(parseResult)) {\n\t return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueAST) + '.'];\n\t }\n\n\t return [];\n\t}", "function coerceValue(type, value) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if ((0, _isInvalid2.default)(_value)) {\n return; // Intentionally return no value.\n }\n\n if (type instanceof _definition.GraphQLNonNull) {\n if (_value === null) {\n return; // Intentionally return no value.\n }\n return coerceValue(type.ofType, _value);\n }\n\n if (_value === null) {\n // Intentionally return the value null.\n return null;\n }\n\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var coercedValues = [];\n var valueIter = (0, _iterall.createIterator)(_value);\n if (!valueIter) {\n return; // Intentionally return no value.\n }\n var step = void 0;\n while (!(step = valueIter.next()).done) {\n var itemValue = coerceValue(itemType, step.value);\n if ((0, _isInvalid2.default)(itemValue)) {\n return; // Intentionally return no value.\n }\n coercedValues.push(itemValue);\n }\n return coercedValues;\n }\n var coercedValue = coerceValue(itemType, _value);\n if ((0, _isInvalid2.default)(coercedValue)) {\n return; // Intentionally return no value.\n }\n return [coerceValue(itemType, _value)];\n }\n\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (typeof _value !== 'object') {\n return; // Intentionally return no value.\n }\n var coercedObj = Object.create(null);\n var fields = type.getFields();\n var fieldNames = Object.keys(fields);\n for (var i = 0; i < fieldNames.length; i++) {\n var fieldName = fieldNames[i];\n var field = fields[fieldName];\n if ((0, _isInvalid2.default)(_value[fieldName])) {\n if (!(0, _isInvalid2.default)(field.defaultValue)) {\n coercedObj[fieldName] = field.defaultValue;\n } else if (field.type instanceof _definition.GraphQLNonNull) {\n return; // Intentionally return no value.\n }\n continue;\n }\n var fieldValue = coerceValue(field.type, _value[fieldName]);\n if ((0, _isInvalid2.default)(fieldValue)) {\n return; // Intentionally return no value.\n }\n coercedObj[fieldName] = fieldValue;\n }\n return coercedObj;\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n var parsed = type.parseValue(_value);\n if ((0, _isNullish2.default)(parsed)) {\n // null or invalid values represent a failure to parse correctly,\n // in which case no value is returned.\n return;\n }\n\n return parsed;\n}", "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNamedType\"])(locationType);\n\n if (!Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isLeafType\"])(type)) {\n var typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n\n if (error instanceof _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"]) {\n context.reportError(error);\n } else {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}", "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNamedType\"])(locationType);\n\n if (!Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isLeafType\"])(type)) {\n var typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(locationType);\n\n if (error instanceof _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"]) {\n context.reportError(error);\n } else {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}", "function valueToNode(value) {\n // undefined\n if (value === undefined) {\n return t.identifier(\"undefined\");\n }\n\n // null, booleans, strings, numbers, regexs\n if (value === true || value === false || value === null || _lodashLangIsString2[\"default\"](value) || _lodashLangIsNumber2[\"default\"](value) || _lodashLangIsRegExp2[\"default\"](value)) {\n return t.literal(value);\n }\n\n // array\n if (Array.isArray(value)) {\n return t.arrayExpression(value.map(t.valueToNode));\n }\n\n // object\n if (_lodashLangIsPlainObject2[\"default\"](value)) {\n var props = [];\n for (var key in value) {\n var nodeKey;\n if (t.isValidIdentifier(key)) {\n nodeKey = t.identifier(key);\n } else {\n nodeKey = t.literal(key);\n }\n props.push(t.property(\"init\", nodeKey, t.valueToNode(value[key])));\n }\n return t.objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}", "function valueToNode(value) {\n\t // undefined\n\t if (value === undefined) {\n\t return t.identifier(\"undefined\");\n\t }\n\n\t // null, booleans, strings, numbers, regexs\n\t if (value === true || value === false || value === null || _lodashLangIsString2[\"default\"](value) || _lodashLangIsNumber2[\"default\"](value) || _lodashLangIsRegExp2[\"default\"](value)) {\n\t return t.literal(value);\n\t }\n\n\t // array\n\t if (Array.isArray(value)) {\n\t return t.arrayExpression(value.map(t.valueToNode));\n\t }\n\n\t // object\n\t if (_lodashLangIsPlainObject2[\"default\"](value)) {\n\t var props = [];\n\t for (var key in value) {\n\t var nodeKey;\n\t if (t.isValidIdentifier(key)) {\n\t nodeKey = t.identifier(key);\n\t } else {\n\t nodeKey = t.literal(key);\n\t }\n\t props.push(t.property(\"init\", nodeKey, t.valueToNode(value[key])));\n\t }\n\t return t.objectExpression(props);\n\t }\n\n\t throw new Error(\"don't know how to turn this value into a node\");\n\t}", "function valueToNode(value) {\n\t // undefined\n\t if (value === undefined) {\n\t return t.identifier(\"undefined\");\n\t }\n\n\t // null, booleans, strings, numbers, regexs\n\t if (value === true || value === false || value === null || _lodashLangIsString2[\"default\"](value) || _lodashLangIsNumber2[\"default\"](value) || _lodashLangIsRegExp2[\"default\"](value)) {\n\t return t.literal(value);\n\t }\n\n\t // array\n\t if (Array.isArray(value)) {\n\t return t.arrayExpression(value.map(t.valueToNode));\n\t }\n\n\t // object\n\t if (_lodashLangIsPlainObject2[\"default\"](value)) {\n\t var props = [];\n\t for (var key in value) {\n\t var nodeKey;\n\t if (t.isValidIdentifier(key)) {\n\t nodeKey = t.identifier(key);\n\t } else {\n\t nodeKey = t.literal(key);\n\t }\n\t props.push(t.property(\"init\", nodeKey, t.valueToNode(value[key])));\n\t }\n\t return t.objectExpression(props);\n\t }\n\n\t throw new Error(\"don't know how to turn this value into a node\");\n\t}", "function coerceValue(_x, _x2) {\n var _again = true;\n\n _function: while (_again) {\n var type = _x,\n value = _x2;\n _value = _ret = _ret2 = parsed = undefined;\n _again = false;\n\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _typeDefinition.GraphQLNonNull) {\n // Note: we're not checking that the result of coerceValue is non-null.\n // We only call this function after calling isValidJSValue.\n _x = type.ofType;\n _x2 = _value;\n _again = true;\n continue _function;\n }\n\n if ((0, _jsutilsIsNullish2['default'])(_value)) {\n return null;\n }\n\n if (type instanceof _typeDefinition.GraphQLList) {\n var _ret = (function () {\n var itemType = type.ofType;\n // TODO: support iterable input\n if (Array.isArray(_value)) {\n return {\n v: _value.map(function (item) {\n return coerceValue(itemType, item);\n })\n };\n }\n return {\n v: [coerceValue(itemType, _value)]\n };\n })();\n\n if (typeof _ret === 'object') return _ret.v;\n }\n\n if (type instanceof _typeDefinition.GraphQLInputObjectType) {\n var _ret2 = (function () {\n if (typeof _value !== 'object' || _value === null) {\n return {\n v: null\n };\n }\n var fields = type.getFields();\n return {\n v: _Object$keys(fields).reduce(function (obj, fieldName) {\n var field = fields[fieldName];\n var fieldValue = coerceValue(field.type, _value[fieldName]);\n if ((0, _jsutilsIsNullish2['default'])(fieldValue)) {\n fieldValue = field.defaultValue;\n }\n if (!(0, _jsutilsIsNullish2['default'])(fieldValue)) {\n obj[fieldName] = fieldValue;\n }\n return obj;\n }, {})\n };\n })();\n\n if (typeof _ret2 === 'object') return _ret2.v;\n }\n\n (0, _jsutilsInvariant2['default'])(type instanceof _typeDefinition.GraphQLScalarType || type instanceof _typeDefinition.GraphQLEnumType, 'Must be input type');\n\n var parsed = type.parseValue(_value);\n if (!(0, _jsutilsIsNullish2['default'])(parsed)) {\n return parsed;\n }\n }\n}", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _kinds.Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && (0, _definition.isNonNullType)(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if ((0, _definition.isNonNullType)(type)) {\n if (valueNode.kind === _kinds.Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _kinds.Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _kinds.Kind.LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if ((0, _definition.isNonNullType)(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (valueNode.kind !== _kinds.Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = (0, _keyMap.default)(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if ((0, _definition.isNonNullType)(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === _kinds.Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && (0, _definition.isNonNullType)(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if ((0, _definition.isNonNullType)(type)) {\n if (valueNode.kind === _kinds.Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === _kinds.Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === _kinds.Kind.LIST) {\n var coercedValues = [];\n\n for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) {\n var itemNode = _valueNode$values2[_i2];\n\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if ((0, _definition.isNonNullType)(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (valueNode.kind !== _kinds.Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = (0, _keyMap.default)(valueNode.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if ((0, _definition.isNonNullType)(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type));\n} // Returns true if the provided valueNode is a variable which is not defined", "function isValidLiteralValue(type, valueAST) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if (!valueAST) {\n if (type.ofType.name) {\n return ['Expected \"' + type.ofType.name + '!\", found null.'];\n }\n return ['Expected non-null value, found null.'];\n }\n return isValidLiteralValue(type.ofType, valueAST);\n }\n\n if (!valueAST) {\n return [];\n }\n\n // This function only tests literals, and assumes variables will provide\n // values of the correct type.\n if (valueAST.kind === _kinds.VARIABLE) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var _ret = function () {\n var itemType = type.ofType;\n if (valueAST.kind === _kinds.LIST) {\n return {\n v: valueAST.values.reduce(function (acc, itemAST, index) {\n var errors = isValidLiteralValue(itemType, itemAST);\n return acc.concat(errors.map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n }, [])\n };\n }\n return {\n v: isValidLiteralValue(itemType, valueAST)\n };\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : (0, _typeof3.default)(_ret)) === \"object\") return _ret.v;\n }\n\n // Input objects check each defined field and look for undefined fields.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueAST.kind !== _kinds.OBJECT) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var errors = [];\n\n // Ensure every provided field is defined.\n var fieldASTs = valueAST.fields;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = (0, _getIterator3.default)(fieldASTs), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var providedFieldAST = _step.value;\n\n if (!fields[providedFieldAST.name.value]) {\n errors.push('In field \"' + providedFieldAST.name.value + '\": Unknown field.');\n }\n }\n\n // Ensure every defined field is valid.\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var fieldASTMap = (0, _keyMap2.default)(fieldASTs, function (fieldAST) {\n return fieldAST.name.value;\n });\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n var _loop = function _loop() {\n var fieldName = _step2.value;\n\n var result = isValidLiteralValue(fields[fieldName].type, fieldASTMap[fieldName] && fieldASTMap[fieldName].value);\n errors.push.apply(errors, (0, _toConsumableArray3.default)(result.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n })));\n };\n\n for (var _iterator2 = (0, _getIterator3.default)((0, _keys2.default)(fields)), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n _loop();\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return errors;\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n // Scalar/Enum input checks to ensure the type can parse the value to\n // a non-null value.\n var parseResult = type.parseLiteral(valueAST);\n if ((0, _isNullish2.default)(parseResult)) {\n return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueAST) + '.'];\n }\n\n return [];\n}", "function parseJSON(value) {\n return json5.parse('{' + value + '}')\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACKET_L:\n return parseList(lexer, isConst);\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACE_L:\n return parseObject(lexer, isConst);\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].INT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].FLOAT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].STRING:\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_6__[\"Kind\"].ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function typeParse(value)\n{\n\tif( value === null || value === undefined )\n\t{ return; }\n\n\tif( isInt(value) )\n\t{ return parseInt(value); }\n\tif( isFloat(value) )\n\t{ return parseFloat(value); }\n\tif( isBool(value) )\n\t{ return parseBool(value); }\n\tif( isJSON(value) )\n\t{ return JSON.parse(value); }\n\n\treturn value;\n}", "function deserializeValue(value) {\n try {\n return value ?\n value == \"true\" ||\n (value == \"false\" ? false :\n value == \"null\" ? null :\n +value + \"\" == value ? +value :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value) : value\n } catch (e) {\n return value\n }\n }", "function deserializeValue(value) {\n try {\n return value\n ? value == 'true' ||\n (value == 'false'\n ? false\n : value == 'null'\n ? null\n : +value + '' == value\n ? +value\n : /^[\\[\\{]/.test(value)\n ? h.parseJSON(value)\n : value)\n : value;\n } catch (e) {\n return value;\n }\n }", "function handleValue(arg) {\n if (Number.isInteger(arg)) {\n return new NumNode(arg);\n }\n if (Array.isArray(arg)) {\n return new ArrNode(arg.map(handleValue));\n }\n if ((typeof arg) === 'string') {\n return new StrNode(arg);\n }\n if ((typeof arg) === 'boolean') {\n return new BoolNode(arg);\n }\n if (arg === null) {\n return new NullNode();\n }\n if (arg === undefined) {\n return new UndefNode();\n }\n if (arg.constructor === Object) {\n let pairs = [];\n for (let key in arg) {\n pairs.push(handleValue(key));\n pairs.push(handleValue(arg[key]));\n }\n return new ObjNode(pairs)\n }\n if ((typeof arg) === 'function') {\n return new FuncNode(arg);\n }\n if (arg instanceof ExprNode) {\n return arg\n }\n\n throw TypeError(`Cannot handle arg ${arg}`)\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACKET_L:\n return parseList(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACE_L:\n return parseObject(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].INT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].FLOAT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].STRING:\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACKET_L:\n return parseList(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACE_L:\n return parseObject(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].INT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].FLOAT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].STRING:\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACKET_L:\n return parseList(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BRACE_L:\n return parseObject(lexer, isConst);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].INT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].FLOAT:\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].STRING:\n case _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}", "function getValue(value) {\n var data = value,\n result = value;\n\n if (typeof data === 'string') {\n try {\n if (!data || data === 'true') {\n result = true;\n } else if (data === 'false') {\n result = false;\n } else if (data === 'null') {\n result = null;\n } else if (+data + '' === data) {\n result = +data;\n } else {\n result = rbrace.test(data) ? JSON.parse(data) : data;\n }\n } catch (error) {\n }\n }\n return result;\n}", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function deserializeValue(value) {\r\n try {\r\n return value ?\r\n value == \"true\" ||\r\n ( value == \"false\" ? false :\r\n value == \"null\" ? null :\r\n +value + \"\" == value ? +value :\r\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\r\n value )\r\n : value\r\n } catch(e) {\r\n return value\r\n }\r\n }", "function ValuesOfCorrectType(context) {\n return {\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isNonNullType\"])(type)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](badValueMessage(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(type), Object(_language_printer__WEBPACK_IMPORTED_MODULE_2__[\"print\"])(node)), node));\n }\n },\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNullableType\"])(context.getParentInputType());\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isListType\"])(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNamedType\"])(context.getInputType());\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isInputObjectType\"])(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = Object(_jsutils_keyMap__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(node.fields, function (field) {\n return field.name.value;\n });\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields())[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var fieldDef = _step.value;\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isRequiredInputField\"])(fieldDef)) {\n var typeStr = Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(fieldDef.type);\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](requiredFieldMessage(type.name, fieldDef.name, typeStr), node));\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNamedType\"])(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isInputObjectType\"])(parentType)) {\n var suggestions = Object(_jsutils_suggestionList__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(node.name.value, Object.keys(parentType.getFields()));\n var didYouMean = suggestions.length !== 0 ? \"Did you mean \".concat(Object(_jsutils_orList__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(suggestions), \"?\") : undefined;\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](unknownFieldMessage(parentType.name, node.name.value, didYouMean), node));\n }\n },\n EnumValue: function EnumValue(node) {\n var type = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNamedType\"])(context.getInputType());\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isEnumType\"])(type)) {\n isValidScalar(context, node);\n } else if (!type.getValue(node.value)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](badValueMessage(type.name, Object(_language_printer__WEBPACK_IMPORTED_MODULE_2__[\"print\"])(node), enumTypeSuggestion(type, node)), node));\n }\n },\n IntValue: function IntValue(node) {\n return isValidScalar(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidScalar(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidScalar(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidScalar(context, node);\n }\n };\n}", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function deserializeValue(value) {\n var num\n try {\n return value ?\n value == \"true\" ||\n ( value == \"false\" ? false :\n value == \"null\" ? null :\n !/^0/.test(value) && !isNaN(num = Number(value)) ? num :\n /^[\\[\\{]/.test(value) ? $.parseJSON(value) :\n value )\n : value\n } catch(e) {\n return value\n }\n }", "function isValidLiteralValue(type, valueNode) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if (!valueNode || valueNode.kind === Kind.NULL) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidLiteralValue(type.ofType, valueNode);\n }\n\n if (!valueNode || valueNode.kind === Kind.NULL) {\n return [];\n }\n\n // This function only tests literals, and assumes variables will provide\n // values of the correct type.\n if (valueNode.kind === Kind.VARIABLE) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n return valueNode.values.reduce(function (acc, item, index) {\n var errors = isValidLiteralValue(itemType, item);\n return acc.concat(errors.map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n }, []);\n }\n return isValidLiteralValue(itemType, valueNode);\n }\n\n // Input objects check each defined field and look for undefined fields.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== Kind.OBJECT) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var errors = [];\n\n // Ensure every provided field is defined.\n var fieldNodes = valueNode.fields;\n fieldNodes.forEach(function (providedFieldNode) {\n if (!fields[providedFieldNode.name.value]) {\n errors.push('In field \"' + providedFieldNode.name.value + '\": Unknown field.');\n }\n });\n\n // Ensure every defined field is valid.\n var fieldNodeMap = (0, _keyMap2.default)(fieldNodes, function (fieldNode) {\n return fieldNode.name.value;\n });\n Object.keys(fields).forEach(function (fieldName) {\n var result = isValidLiteralValue(fields[fieldName].type, fieldNodeMap[fieldName] && fieldNodeMap[fieldName].value);\n errors.push.apply(errors, result.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n }));\n });\n\n return errors;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n // Scalars determine if a literal values is valid.\n if (!type.isValidLiteral(valueNode)) {\n return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueNode) + '.'];\n }\n\n return [];\n}", "function isValidLiteralValue(type, valueNode) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if (!valueNode || valueNode.kind === Kind.NULL) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidLiteralValue(type.ofType, valueNode);\n }\n\n if (!valueNode || valueNode.kind === Kind.NULL) {\n return [];\n }\n\n // This function only tests literals, and assumes variables will provide\n // values of the correct type.\n if (valueNode.kind === Kind.VARIABLE) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === Kind.LIST) {\n return valueNode.values.reduce(function (acc, item, index) {\n var errors = isValidLiteralValue(itemType, item);\n return acc.concat(errors.map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n }, []);\n }\n return isValidLiteralValue(itemType, valueNode);\n }\n\n // Input objects check each defined field and look for undefined fields.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== Kind.OBJECT) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var errors = [];\n\n // Ensure every provided field is defined.\n var fieldNodes = valueNode.fields;\n fieldNodes.forEach(function (providedFieldNode) {\n if (!fields[providedFieldNode.name.value]) {\n errors.push('In field \"' + providedFieldNode.name.value + '\": Unknown field.');\n }\n });\n\n // Ensure every defined field is valid.\n var fieldNodeMap = (0, _keyMap2.default)(fieldNodes, function (fieldNode) {\n return fieldNode.name.value;\n });\n Object.keys(fields).forEach(function (fieldName) {\n var result = isValidLiteralValue(fields[fieldName].type, fieldNodeMap[fieldName] && fieldNodeMap[fieldName].value);\n errors.push.apply(errors, result.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n }));\n });\n\n return errors;\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must be input type') : void 0;\n\n // Scalars determine if a literal values is valid.\n if (!type.isValidLiteral(valueNode)) {\n return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueNode) + '.'];\n }\n\n return [];\n}", "function parse(value) {\n return typeof value === 'string' ? JSON.parse(value) : undefined;\n}", "function isValidLiteralValue(type, valueNode) {\n // A value must be provided if the type is non-null.\n if (type instanceof _definition.GraphQLNonNull) {\n if (!valueNode || valueNode.kind === _kinds.NULL) {\n return ['Expected \"' + String(type) + '\", found null.'];\n }\n return isValidLiteralValue(type.ofType, valueNode);\n }\n\n if (!valueNode || valueNode.kind === _kinds.NULL) {\n return [];\n }\n\n // This function only tests literals, and assumes variables will provide\n // values of the correct type.\n if (valueNode.kind === _kinds.VARIABLE) {\n return [];\n }\n\n // Lists accept a non-list value as a list of one.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if (valueNode.kind === _kinds.LIST) {\n return valueNode.values.reduce(function (acc, item, index) {\n var errors = isValidLiteralValue(itemType, item);\n return acc.concat(errors.map(function (error) {\n return 'In element #' + index + ': ' + error;\n }));\n }, []);\n }\n return isValidLiteralValue(itemType, valueNode);\n }\n\n // Input objects check each defined field and look for undefined fields.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (valueNode.kind !== _kinds.OBJECT) {\n return ['Expected \"' + type.name + '\", found not an object.'];\n }\n var fields = type.getFields();\n\n var errors = [];\n\n // Ensure every provided field is defined.\n var fieldNodes = valueNode.fields;\n fieldNodes.forEach(function (providedFieldNode) {\n if (!fields[providedFieldNode.name.value]) {\n errors.push('In field \"' + providedFieldNode.name.value + '\": Unknown field.');\n }\n });\n\n // Ensure every defined field is valid.\n var fieldNodeMap = (0, _keyMap2.default)(fieldNodes, function (fieldNode) {\n return fieldNode.name.value;\n });\n Object.keys(fields).forEach(function (fieldName) {\n var result = isValidLiteralValue(fields[fieldName].type, fieldNodeMap[fieldName] && fieldNodeMap[fieldName].value);\n errors.push.apply(errors, result.map(function (error) {\n return 'In field \"' + fieldName + '\": ' + error;\n }));\n });\n\n return errors;\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must be input type');\n\n // Scalars determine if a literal values is valid.\n if (!type.isValidLiteral(valueNode)) {\n return ['Expected type \"' + type.name + '\", found ' + (0, _printer.print)(valueNode) + '.'];\n }\n\n return [];\n}", "parseValueLiteral(isConst) {\n const token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this._lexer.advance();\n\n return this.node(token, {\n kind: Kind.INT,\n value: token.value,\n });\n\n case TokenKind.FLOAT:\n this._lexer.advance();\n\n return this.node(token, {\n kind: Kind.FLOAT,\n value: token.value,\n });\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this._lexer.advance();\n\n switch (token.value) {\n case 'true':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: true,\n });\n\n case 'false':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: false,\n });\n\n case 'null':\n return this.node(token, {\n kind: Kind.NULL,\n });\n\n default:\n return this.node(token, {\n kind: Kind.ENUM,\n value: token.value,\n });\n }\n\n case TokenKind.DOLLAR:\n if (isConst) {\n this.expectToken(TokenKind.DOLLAR);\n\n if (this._lexer.token.kind === TokenKind.NAME) {\n const varName = this._lexer.token.value;\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected variable \"$${varName}\" in constant value.`,\n );\n } else {\n throw this.unexpected(token);\n }\n }\n\n return this.parseVariable();\n }\n\n throw this.unexpected();\n }", "function deserializeValue(value) {\n var num;\n try {\n return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : !/^0/.test(value) && !isNaN(num = Number(value)) ? num : /^[\\[\\{]/.test(value) ? $.parseJSON(value) : value) : value;\n } catch (e) {\n return value;\n }\n }", "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = (0, _definition.getNamedType)(locationType);\n\n if (!(0, _definition.isLeafType)(type)) {\n var typeStr = (0, _inspect.default)(locationType);\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = (0, _inspect.default)(locationType);\n\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = (0, _inspect.default)(locationType);\n\n if (error instanceof _GraphQLError.GraphQLError) {\n context.reportError(error);\n } else {\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat((0, _printer.print)(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}", "function isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = (0, _definition.getNamedType)(locationType);\n\n if (!(0, _definition.isLeafType)(type)) {\n var typeStr = (0, _inspect.default)(locationType);\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (parseResult === undefined) {\n var _typeStr = (0, _inspect.default)(locationType);\n\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr, \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n }\n } catch (error) {\n var _typeStr2 = (0, _inspect.default)(locationType);\n\n if (error instanceof _GraphQLError.GraphQLError) {\n context.reportError(error);\n } else {\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat(_typeStr2, \"\\\", found \").concat((0, _printer.print)(node), \"; \") + error.message, node, undefined, undefined, undefined, error));\n }\n }\n}", "function deserializeValue( value ) {\n try {\n return value ? value == \"true\" || (value == \"false\" ? false : value == \"null\" ? null : +value + \"\" == value ? +value : /^[\\[\\{]/.test( value ) ? $.parseJSON( value ) : value) : value\n } catch ( e ) {\n return value\n }\n }", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n case _lexer.TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n\n case TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n\n case TokenKind.INT:\n lexer.advance();\n return {\n kind: Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}", "function Value (val) {\n\tthis.value = val;\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n lexer.advance();\n return {\n kind: _kinds.STRING,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n lexer.advance();\n return {\n kind: _kinds.STRING,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n lexer.advance();\n return {\n kind: _kinds.STRING,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n lexer.advance();\n return {\n kind: _kinds.STRING,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}", "function parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n switch (token.kind) {\n case _lexer.TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n case _lexer.TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n case _lexer.TokenKind.INT:\n lexer.advance();\n return {\n kind: _kinds.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: _kinds.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.STRING:\n lexer.advance();\n return {\n kind: _kinds.STRING,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: _kinds.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: _kinds.NULL,\n loc: loc(lexer, token)\n };\n }\n lexer.advance();\n return {\n kind: _kinds.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n case _lexer.TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n break;\n }\n throw unexpected(lexer);\n}" ]
[ "0.70470744", "0.69767505", "0.6862705", "0.6862705", "0.6852368", "0.6780472", "0.66964674", "0.66904795", "0.66605663", "0.65895486", "0.65895486", "0.65102434", "0.65062976", "0.65062976", "0.64933676", "0.6456218", "0.6343909", "0.62815255", "0.62152064", "0.62152064", "0.621143", "0.6121314", "0.61040956", "0.6095908", "0.6082978", "0.6082978", "0.6082978", "0.6037743", "0.6037743", "0.6025795", "0.6025795", "0.6021808", "0.6006037", "0.5884982", "0.58535933", "0.58535933", "0.58347905", "0.57814264", "0.5779638", "0.5779638", "0.5775869", "0.57412386", "0.57412386", "0.57274437", "0.5701681", "0.5701681", "0.56897503", "0.5647697", "0.5638099", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.5611602", "0.56110644", "0.56050956", "0.5587564", "0.5573469", "0.5570935", "0.5570935", "0.55675656", "0.55404013", "0.5540175", "0.5540175", "0.55394536", "0.55351603", "0.55317754", "0.55317754", "0.55317754", "0.55317754", "0.55317754", "0.5524824", "0.5524824", "0.5522083", "0.55208033", "0.54867834", "0.5467803", "0.54627544", "0.54627544", "0.5443531", "0.5425901", "0.5425901", "0.5425901", "0.5425901", "0.5425454", "0.5421924", "0.54195184", "0.54195184", "0.54195184", "0.54195184", "0.54195184" ]
0.69768363
2
When the object provided to `createIterator` is not Iterable but is Arraylike, this simple Iterator is created.
function ArrayLikeIterator(obj) { this._o = obj this._i = 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ArrayLikeIterator (obj) {\n\t this._o = obj\n\t this._i = 0\n\t}", "function CreateArrayIterator(array, kind) {\n var o = ToObject(array);\n var iterator = new ArrayIterator;\n set_internal(iterator, '[[IteratedObject]]', o);\n set_internal(iterator, '[[ArrayIteratorNextIndex]]', 0);\n set_internal(iterator, '[[ArrayIterationKind]]', kind);\n return iterator;\n }", "static createIteratorFromIterable(iterable){\n //TODO save state for restarting when Flow is being reused\n return iterable;\n }", "function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function _createForOfIteratorHelper(t,o){var e=\"undefined\"!=typeof Symbol&&t[Symbol.iterator]||t[\"@@iterator\"];if(!e){if(Array.isArray(t)||(e=_unsupportedIterableToArray(t))||o&&t&&\"number\"==typeof t.length){e&&(t=e);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var n,a=!0,s=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){s=!0,n=t},f:function(){try{a||null==e.return||e.return()}finally{if(s)throw n}}}}", "function iter(o) {\n // Makes sure that create_iterator is called in the same scope as iter.\n return create_iterator.call(this, o);\n}", "function iter(object) {\r\n var it;\r\n if (typeof object.iter === 'function') {\r\n it = object.iter();\r\n }\r\n else {\r\n it = new ArrayIterator(object);\r\n }\r\n return it;\r\n}", "function iter(object) {\r\n var it;\r\n if (typeof object.iter === 'function') {\r\n it = object.iter();\r\n }\r\n else {\r\n it = new ArrayIterator(object);\r\n }\r\n return it;\r\n}", "function CreateArrayIterator(obj, kind) {\n var iteratedObject = ToObject(obj);\n var iterator = NewArrayIterator();\n UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_TARGET, iteratedObject);\n UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_NEXT_INDEX, 0);\n UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_ITEM_KIND, kind);\n return iterator;\n}", "function makeIterator(arr) {\n let nextIndex = 0\n return {\n next: () =>\n nextIndex < arr.length\n ? { value: arr[nextIndex++], done: false }\n : { done: true }\n }\n}", "function makeReusableIterable(generatorFn) {\n return {\n [Symbol.iterator]: generatorFn\n };\n}", "function arrayIterator (arr) {\n if (!Array.isArray(arr)) throw new Error('Not an array!')\n var pos = 0\n\n function next () {\n if (pos < arr.length) {\n return { done: false, value: arr[pos++] }\n }\n return { done: true }\n }\n\n return function () {\n return { next: next }\n }\n}", "function makeIterable(i) {\n function* fromIterator(i) {\n for (let r = i.next(); !r.done; r = i.next()) {\n yield r.value;\n }\n }\n function* fromIterable(i) {\n yield* i;\n }\n return isIterable(i) ? (isIterableIterator(i) ? i : fromIterable(i)) : fromIterator(i);\n}", "_makeIterator() {\n return this.fn.apply(this.context, this.args);\n }", "function ArrayIterable(arr){\n this.arr = arr\n}", "function Iterable() {}", "function ArrayIterator(source) {\r\n this._index = 0;\r\n this._source = source;\r\n }", "function ArrayIterator(source) {\r\n this._index = 0;\r\n this._source = source;\r\n }", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\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 }", "function Iterator(array){\n let nextIndex = 0;\n \n // the Iterator function will return an object containing a next function\n return {\n next: function(){\n\n // if the array isn't exhausted \n if (nextIndex < array.length){\n // return an object with the next item and done: false\n return {\n value: array[nextIndex++],\n done: false\n }\n }\n\n else{\n // return an object with done: true\n return {\n done: true\n }\n }\n }\n }\n}", "getIterator()\r\n {\r\n return new NullIterator();\r\n }", "function Iterator(iterable, start, stop, step) {\n if (!iterable) {\n return Iterator.empty;\n } else if (iterable instanceof Iterator) {\n return iterable;\n } else if (!(this instanceof Iterator)) {\n return new Iterator(iterable, start, stop, step);\n } else if (Array.isArray(iterable) || typeof iterable === \"string\") {\n iterators.set(this, new IndexIterator(iterable, start, stop, step));\n return;\n }\n iterable = Object(iterable);\n if (iterable.next) {\n iterators.set(this, iterable);\n } else if (iterable.iterate) {\n iterators.set(this, iterable.iterate(start, stop, step));\n } else if (Object.prototype.toString.call(iterable) === \"[object Function]\") {\n this.next = iterable;\n } else {\n throw new TypeError(\"Can't iterate \" + iterable);\n }\n}", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\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 }", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\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 }", "function Iterator(arr) {\n\t\n\tthis.length = arr.length;\n\t\n\tthis.each = function(fn) {\n\t\teach(arr, fn);\t\n\t};\n\t\n\tthis.size = function() {\n\t\treturn arr.length;\t\n\t};\t\n}", "function iteratorFor(items) {\n\t\t\t\tvar iterator = {\n\t\t\t\t\tnext: function () {\n\t\t\t\t\t\tvar value = items.shift();\n\t\t\t\t\t\treturn { done: value === undefined, value: value };\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif (support.iterable) {\n\t\t\t\t\titerator[Symbol.iterator] = function () {\n\t\t\t\t\t\treturn iterator;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn iterator;\n\t\t\t}", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "function AssocArrayIterator(array) {\n this._index = 0;\n this._array = array;\n }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function next() {\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 }", "function iteratorFor(items) {\n\t var iterator = {\n\t next: function next() {\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 }", "function iteratorFromItems(items) {\n return new ArrayIterator(items);\n}", "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 }", "function Iterator(arr) {\n this.arr = arr;\n this.row = 0;\n this.col = 0;\n this.rowMax = arr.length;\n}", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\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}", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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}", "[Symbol.iterator]() {\n return new ArrayIterator(this.employees);\n }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "function makeIterator(array) { //this is how iterators work under the hool\n var nextIndex = 0;\n\n return {\n next: function() { //you can also write `next() {...}`\n return nextIndex < array.length ? //you can write your custom logic also, but return {value, done}\n {value: array[nextIndex++], done: false} :\n {done: true};\n }\n };\n }", "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 }", "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 }", "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 }", "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 }", "[Symbol.iterator]()\n {\n return this._iterate({ wrapPoint:false, includeEmpty:false });\n }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }" ]
[ "0.70463395", "0.68771654", "0.67490155", "0.6685187", "0.6685187", "0.66562265", "0.66562265", "0.66562265", "0.65765977", "0.6571398", "0.6514193", "0.6514193", "0.63881713", "0.63206476", "0.6308758", "0.6295623", "0.6274428", "0.62515825", "0.6242841", "0.6179238", "0.6153321", "0.6153321", "0.6140468", "0.61369", "0.61128944", "0.6111704", "0.61081576", "0.61081576", "0.6107059", "0.61003846", "0.6095753", "0.6086406", "0.6086406", "0.6086406", "0.6086406", "0.6086406", "0.6086406", "0.6086406", "0.6086406", "0.6086406", "0.6086406", "0.6073845", "0.60727835", "0.60727835", "0.60674137", "0.6061021", "0.6058482", "0.6057272", "0.60453", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.60356843", "0.6035292", "0.603337", "0.60309875", "0.60180867", "0.60180867", "0.60180867", "0.60180867", "0.60180867", "0.60180867", "0.60180867", "0.60180867", "0.60180867", "0.60180867", "0.60180867", "0.60161704", "0.6005852", "0.60056716", "0.6005123", "0.6004165", "0.6004165", "0.60011494", "0.59990823", "0.59990823", "0.59990823", "0.59990823", "0.59990823", "0.59990823", "0.59990823", "0.59990823", "0.59990823" ]
0.7115799
3
When the object provided to `createAsyncIterator` is not AsyncIterable but is sync Iterable, this simple wrapper is created.
function AsyncFromSyncIterator(iterator) { this._i = iterator }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "[Symbol.asyncIterator]() {\n return __asyncGenerator(this, arguments, function* _a() {\n yield __await(yield* __asyncDelegator(__asyncValues(this.iterate())));\n });\n }", "function mapAsyncIterator(iterable, callback) {\n var iterator = (0, _iterall.getAsyncIterator)(iterable);\n var $return = void 0;\n var abruptClose = void 0;\n if (typeof iterator.return === 'function') {\n $return = iterator.return;\n abruptClose = function abruptClose(error) {\n var rethrow = function rethrow() {\n return Promise.reject(error);\n };\n return $return.call(iterator).then(rethrow, rethrow);\n };\n }\n\n function mapResult(result) {\n return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);\n }\n\n return _defineProperty({\n next: function next() {\n return iterator.next().then(mapResult);\n },\n return: function _return() {\n return $return ? $return.call(iterator).then(mapResult) : Promise.resolve({ value: undefined, done: true });\n },\n throw: function _throw(error) {\n if (typeof iterator.throw === 'function') {\n return iterator.throw(error).then(mapResult);\n }\n return Promise.reject(error).catch(abruptClose);\n }\n }, _iterall.$$asyncIterator, function () {\n return this;\n });\n}", "function asAsyncIterable(readable) {\n // @ts-ignore how to convince tsc that we are checking the type here?\n return Symbol.asyncIterator in readable ? readable : browser_readablestream_to_it_1.default(readable);\n}", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "[Symbol.asyncIterator]() {\n return this;\n }", "async *[Symbol.asyncIterator]() {}", "function isAsyncIterable(maybeAsyncIterable) {\n return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[_symbols.SYMBOL_ASYNC_ITERATOR]) === 'function';\n}", "function mapAsyncIterator(iterable, callback, rejectCallback) {\n // $FlowFixMe[prop-missing]\n var iteratorMethod = iterable[_symbols.SYMBOL_ASYNC_ITERATOR];\n var iterator = iteratorMethod.call(iterable);\n var $return;\n var abruptClose;\n\n if (typeof iterator.return === 'function') {\n $return = iterator.return;\n\n abruptClose = function abruptClose(error) {\n var rethrow = function rethrow() {\n return Promise.reject(error);\n };\n\n return $return.call(iterator).then(rethrow, rethrow);\n };\n }\n\n function mapResult(result) {\n return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);\n }\n\n var mapReject;\n\n if (rejectCallback) {\n // Capture rejectCallback to ensure it cannot be null.\n var reject = rejectCallback;\n\n mapReject = function mapReject(error) {\n return asyncMapValue(error, reject).then(iteratorResult, abruptClose);\n };\n }\n /* TODO: Flow doesn't support symbols as keys:\n https://github.com/facebook/flow/issues/3258 */\n\n\n return _defineProperty({\n next: function next() {\n return iterator.next().then(mapResult, mapReject);\n },\n return: function _return() {\n return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({\n value: undefined,\n done: true\n });\n },\n throw: function _throw(error) {\n if (typeof iterator.throw === 'function') {\n return iterator.throw(error).then(mapResult, mapReject);\n }\n\n return Promise.reject(error).catch(abruptClose);\n }\n }, _symbols.SYMBOL_ASYNC_ITERATOR, function () {\n return this;\n });\n}", "function mapAsyncIterator(iterable, callback, rejectCallback) {\n // $FlowFixMe[prop-missing]\n var iteratorMethod = iterable[_symbols.SYMBOL_ASYNC_ITERATOR];\n var iterator = iteratorMethod.call(iterable);\n var $return;\n var abruptClose;\n\n if (typeof iterator.return === 'function') {\n $return = iterator.return;\n\n abruptClose = function abruptClose(error) {\n var rethrow = function rethrow() {\n return Promise.reject(error);\n };\n\n return $return.call(iterator).then(rethrow, rethrow);\n };\n }\n\n function mapResult(result) {\n return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);\n }\n\n var mapReject;\n\n if (rejectCallback) {\n // Capture rejectCallback to ensure it cannot be null.\n var reject = rejectCallback;\n\n mapReject = function mapReject(error) {\n return asyncMapValue(error, reject).then(iteratorResult, abruptClose);\n };\n }\n /* TODO: Flow doesn't support symbols as keys:\n https://github.com/facebook/flow/issues/3258 */\n\n\n return _defineProperty({\n next: function next() {\n return iterator.next().then(mapResult, mapReject);\n },\n return: function _return() {\n return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({\n value: undefined,\n done: true\n });\n },\n throw: function _throw(error) {\n if (typeof iterator.throw === 'function') {\n return iterator.throw(error).then(mapResult, mapReject);\n }\n\n return Promise.reject(error).catch(abruptClose);\n }\n }, _symbols.SYMBOL_ASYNC_ITERATOR, function () {\n return this;\n });\n}", "async iterator() {\n return iteratorFn();\n }", "function mapAsyncIterator(iterable, callback, rejectCallback) {\n var iterator = Object(iterall__WEBPACK_IMPORTED_MODULE_0__[\"getAsyncIterator\"])(iterable);\n var $return;\n var abruptClose; // $FlowFixMe(>=0.68.0)\n\n if (typeof iterator.return === 'function') {\n $return = iterator.return;\n\n abruptClose = function abruptClose(error) {\n var rethrow = function rethrow() {\n return Promise.reject(error);\n };\n\n return $return.call(iterator).then(rethrow, rethrow);\n };\n }\n\n function mapResult(result) {\n return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);\n }\n\n var mapReject;\n\n if (rejectCallback) {\n // Capture rejectCallback to ensure it cannot be null.\n var reject = rejectCallback;\n\n mapReject = function mapReject(error) {\n return asyncMapValue(error, reject).then(iteratorResult, abruptClose);\n };\n }\n /* TODO: Flow doesn't support symbols as keys:\n https://github.com/facebook/flow/issues/3258 */\n\n\n return _defineProperty({\n next: function next() {\n return iterator.next().then(mapResult, mapReject);\n },\n return: function _return() {\n return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({\n value: undefined,\n done: true\n });\n },\n throw: function _throw(error) {\n // $FlowFixMe(>=0.68.0)\n if (typeof iterator.throw === 'function') {\n return iterator.throw(error).then(mapResult, mapReject);\n }\n\n return Promise.reject(error).catch(abruptClose);\n }\n }, iterall__WEBPACK_IMPORTED_MODULE_0__[\"$$asyncIterator\"], function () {\n return this;\n });\n}", "function isAsyncIterable(maybeAsyncIterable) {\n if (maybeAsyncIterable == null || _typeof(maybeAsyncIterable) !== 'object') {\n return false;\n }\n\n return typeof maybeAsyncIterable[_polyfills_symbols_mjs__WEBPACK_IMPORTED_MODULE_0__[\"SYMBOL_ASYNC_ITERATOR\"]] === 'function';\n}", "function isAsyncIterable(maybeAsyncIterable) {\n if (maybeAsyncIterable == null || _typeof(maybeAsyncIterable) !== 'object') {\n return false;\n }\n\n return typeof maybeAsyncIterable[_polyfills_symbols_mjs__WEBPACK_IMPORTED_MODULE_0__[\"SYMBOL_ASYNC_ITERATOR\"]] === 'function';\n}", "function mapAsyncIterator(iterable, callback, rejectCallback) {\n // $FlowFixMe[prop-missing]\n var iteratorMethod = iterable[_polyfills_symbols_mjs__WEBPACK_IMPORTED_MODULE_0__[\"SYMBOL_ASYNC_ITERATOR\"]];\n var iterator = iteratorMethod.call(iterable);\n var $return;\n var abruptClose;\n\n if (typeof iterator.return === 'function') {\n $return = iterator.return;\n\n abruptClose = function abruptClose(error) {\n var rethrow = function rethrow() {\n return Promise.reject(error);\n };\n\n return $return.call(iterator).then(rethrow, rethrow);\n };\n }\n\n function mapResult(result) {\n return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);\n }\n\n var mapReject;\n\n if (rejectCallback) {\n // Capture rejectCallback to ensure it cannot be null.\n var reject = rejectCallback;\n\n mapReject = function mapReject(error) {\n return asyncMapValue(error, reject).then(iteratorResult, abruptClose);\n };\n }\n /* TODO: Flow doesn't support symbols as keys:\n https://github.com/facebook/flow/issues/3258 */\n\n\n return _defineProperty({\n next: function next() {\n return iterator.next().then(mapResult, mapReject);\n },\n return: function _return() {\n return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({\n value: undefined,\n done: true\n });\n },\n throw: function _throw(error) {\n if (typeof iterator.throw === 'function') {\n return iterator.throw(error).then(mapResult, mapReject);\n }\n\n return Promise.reject(error).catch(abruptClose);\n }\n }, _polyfills_symbols_mjs__WEBPACK_IMPORTED_MODULE_0__[\"SYMBOL_ASYNC_ITERATOR\"], function () {\n return this;\n });\n}", "asyncGen(iterable) {\n\n var iter = _es6now.iter(iterable),\n state = \"paused\",\n queue = [];\n\n return {\n\n next(val) { return enqueue(\"next\", val) },\n throw(val) { return enqueue(\"throw\", val) },\n return(val) { return enqueue(\"return\", val) },\n [Symbol.asyncIterator]() { return this }\n };\n\n function enqueue(type, value) {\n\n var resolve, reject;\n var promise = new Promise((res, rej) => (resolve = res, reject = rej));\n\n queue.push({ type, value, resolve, reject });\n\n if (state === \"paused\")\n next();\n\n return promise;\n }\n\n function next() {\n\n if (queue.length > 0) {\n\n state = \"running\";\n var first = queue[0];\n resume(first.type, first.value);\n\n } else {\n\n state = \"paused\";\n }\n }\n\n function resume(type, value) {\n\n if (type === \"return\" && !(type in iter)) {\n\n // If the generator does not support the \"return\" method, then\n // emulate it (poorly) using throw\n type = \"throw\";\n value = { value, __return: true };\n }\n\n try {\n\n var result = iter[type](value),\n value = result.value;\n\n if (typeof value === \"object\" && \"_es6now_await\" in value) {\n\n if (result.done)\n throw new Error(\"Invalid async generator return\");\n\n Promise.resolve(value._es6now_await).then(\n x => resume(\"next\", x),\n x => resume(\"throw\", x));\n\n return;\n\n } else {\n\n queue.shift().resolve(result);\n }\n\n } catch (x) {\n\n if (x && x.__return === true)\n queue.shift().resolve({ value: x.value, done: true });\n else\n queue.shift().reject(x);\n }\n\n next();\n }\n }", "function mapAsyncIterator(iterable, callback, rejectCallback) {\n // $FlowFixMe\n var iteratorMethod = iterable[_polyfills_symbols_mjs__WEBPACK_IMPORTED_MODULE_0__[\"SYMBOL_ASYNC_ITERATOR\"]];\n var iterator = iteratorMethod.call(iterable);\n var $return;\n var abruptClose;\n\n if (typeof iterator.return === 'function') {\n $return = iterator.return;\n\n abruptClose = function abruptClose(error) {\n var rethrow = function rethrow() {\n return Promise.reject(error);\n };\n\n return $return.call(iterator).then(rethrow, rethrow);\n };\n }\n\n function mapResult(result) {\n return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);\n }\n\n var mapReject;\n\n if (rejectCallback) {\n // Capture rejectCallback to ensure it cannot be null.\n var reject = rejectCallback;\n\n mapReject = function mapReject(error) {\n return asyncMapValue(error, reject).then(iteratorResult, abruptClose);\n };\n }\n /* TODO: Flow doesn't support symbols as keys:\n https://github.com/facebook/flow/issues/3258 */\n\n\n return _defineProperty({\n next: function next() {\n return iterator.next().then(mapResult, mapReject);\n },\n return: function _return() {\n return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({\n value: undefined,\n done: true\n });\n },\n throw: function _throw(error) {\n if (typeof iterator.throw === 'function') {\n return iterator.throw(error).then(mapResult, mapReject);\n }\n\n return Promise.reject(error).catch(abruptClose);\n }\n }, _polyfills_symbols_mjs__WEBPACK_IMPORTED_MODULE_0__[\"SYMBOL_ASYNC_ITERATOR\"], function () {\n return this;\n });\n}", "function mapAsyncIterator(iterator, callback, rejectCallback) {\n var _a;\n var $return;\n var abruptClose;\n if (typeof iterator.return === 'function') {\n $return = iterator.return;\n abruptClose = function (error) {\n var rethrow = function () { return Promise.reject(error); };\n return $return.call(iterator).then(rethrow, rethrow);\n };\n }\n function mapResult(result) {\n return result.done\n ? result\n : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);\n }\n var mapReject;\n if (rejectCallback) {\n // Capture rejectCallback to ensure it cannot be null.\n var reject_1 = rejectCallback;\n mapReject = function (error) {\n return asyncMapValue(error, reject_1).then(iteratorResult, abruptClose);\n };\n }\n return _a = {\n next: function () {\n return iterator.next().then(mapResult, mapReject);\n },\n return: function () {\n return $return\n ? $return.call(iterator).then(mapResult, mapReject)\n : Promise.resolve({ value: undefined, done: true });\n },\n throw: function (error) {\n if (typeof iterator.throw === 'function') {\n return iterator.throw(error).then(mapResult, mapReject);\n }\n return Promise.reject(error).catch(abruptClose);\n }\n },\n _a[iterall_1.$$asyncIterator] = function () {\n return this;\n },\n _a;\n}", "function getPagedAsyncIterator(pagedResult) {\n var _a;\n const iter = getItemAsyncIterator(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {\n const { continuationToken, maxPageSize } = settings !== null && settings !== void 0 ? settings : {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n maxPageSize,\n });\n }),\n };\n}", "function getPagedAsyncIterator(pagedResult) {\n var _a;\n const iter = getItemAsyncIterator(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {\n const { continuationToken, maxPageSize } = settings !== null && settings !== void 0 ? settings : {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n maxPageSize,\n });\n }),\n };\n}", "function getPagedAsyncIterator(pagedResult) {\n var _a;\n const iter = getItemAsyncIterator(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {\n const { continuationToken, maxPageSize } = settings !== null && settings !== void 0 ? settings : {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n maxPageSize,\n });\n }),\n };\n}", "async(iterable) {\n\n try {\n\n var iter = _es6now.iter(iterable),\n resolver,\n promise;\n\n promise = new Promise((resolve, reject) => resolver = { resolve, reject });\n resume(\"next\", void 0);\n return promise;\n\n } catch (x) { return Promise.reject(x) }\n\n function resume(type, value) {\n\n if (!(type in iter)) {\n\n resolver.reject(value);\n return;\n }\n\n try {\n\n var result = iter[type](value);\n\n value = Promise.resolve(result.value);\n\n if (result.done) value.then(resolver.resolve, resolver.reject);\n else value.then(x => resume(\"next\", x), x => resume(\"throw\", x));\n\n } catch (x) { resolver.reject(x) }\n }\n }", "static createIteratorFromIterable(iterable){\n //TODO save state for restarting when Flow is being reused\n return iterable;\n }", "[ASYNCITERATOR] () {\n const next = () => {\n const res = this.read()\n if (res !== null)\n return Promise.resolve({ done: false, value: res })\n\n if (this[EOF])\n return Promise.resolve({ done: true })\n\n let resolve = null\n let reject = null\n const onerr = er => {\n this.removeListener('data', ondata)\n this.removeListener('end', onend)\n reject(er)\n }\n const ondata = value => {\n this.removeListener('error', onerr)\n this.removeListener('end', onend)\n this.pause()\n resolve({ value: value, done: !!this[EOF] })\n }\n const onend = () => {\n this.removeListener('error', onerr)\n this.removeListener('data', ondata)\n resolve({ done: true })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return { next }\n }", "[ASYNCITERATOR] () {\n const next = () => {\n const res = this.read()\n if (res !== null)\n return Promise.resolve({ done: false, value: res })\n\n if (this[EOF])\n return Promise.resolve({ done: true })\n\n let resolve = null\n let reject = null\n const onerr = er => {\n this.removeListener('data', ondata)\n this.removeListener('end', onend)\n reject(er)\n }\n const ondata = value => {\n this.removeListener('error', onerr)\n this.removeListener('end', onend)\n this.pause()\n resolve({ value: value, done: !!this[EOF] })\n }\n const onend = () => {\n this.removeListener('error', onerr)\n this.removeListener('data', ondata)\n resolve({ done: true })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return { next }\n }", "[ASYNCITERATOR] () {\n const next = () => {\n const res = this.read()\n if (res !== null)\n return Promise.resolve({ done: false, value: res })\n\n if (this[EOF])\n return Promise.resolve({ done: true })\n\n let resolve = null\n let reject = null\n const onerr = er => {\n this.removeListener('data', ondata)\n this.removeListener('end', onend)\n reject(er)\n }\n const ondata = value => {\n this.removeListener('error', onerr)\n this.removeListener('end', onend)\n this.pause()\n resolve({ value: value, done: !!this[EOF] })\n }\n const onend = () => {\n this.removeListener('error', onerr)\n this.removeListener('data', ondata)\n resolve({ done: true })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return { next }\n }", "[ASYNCITERATOR] () {\n const next = () => {\n const res = this.read()\n if (res !== null)\n return Promise.resolve({ done: false, value: res })\n\n if (this[EOF])\n return Promise.resolve({ done: true })\n\n let resolve = null\n let reject = null\n const onerr = er => {\n this.removeListener('data', ondata)\n this.removeListener('end', onend)\n reject(er)\n }\n const ondata = value => {\n this.removeListener('error', onerr)\n this.removeListener('end', onend)\n this.pause()\n resolve({ value: value, done: !!this[EOF] })\n }\n const onend = () => {\n this.removeListener('error', onerr)\n this.removeListener('data', ondata)\n resolve({ done: true })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return { next }\n }", "[ASYNCITERATOR] () {\n const next = () => {\n const res = this.read()\n if (res !== null)\n return Promise.resolve({ done: false, value: res })\n\n if (this[EOF])\n return Promise.resolve({ done: true })\n\n let resolve = null\n let reject = null\n const onerr = er => {\n this.removeListener('data', ondata)\n this.removeListener('end', onend)\n reject(er)\n }\n const ondata = value => {\n this.removeListener('error', onerr)\n this.removeListener('end', onend)\n this.pause()\n resolve({ value: value, done: !!this[EOF] })\n }\n const onend = () => {\n this.removeListener('error', onerr)\n this.removeListener('data', ondata)\n resolve({ done: true })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return { next }\n }", "function AcquireReadableStreamAsyncIterator(stream, preventCancel) {\n const reader = AcquireReadableStreamDefaultReader(stream);\n const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);\n const iterator = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorImpl = impl;\n return iterator;\n}", "function asyncGenerator(iter) {\n\n let front = null, back = null;\n\n let aIter = {\n\n next(val) { return send(\"next\", val) },\n throw(val) { return send(\"throw\", val) },\n return(val) { return send(\"return\", val) },\n };\n\n aIter[Symbol.asyncIterator] = function() { return this };\n return aIter;\n\n function send(type, value) {\n\n return new Promise((resolve, reject) => {\n\n let x = { type, value, resolve, reject, next: null };\n\n if (back) {\n\n // If list is not empty, then push onto the end\n back = back.next = x;\n\n } else {\n\n // Create new list and resume generator\n front = back = x;\n resume(type, value);\n }\n });\n }\n\n function settle(type, value) {\n\n switch (type) {\n\n case \"return\":\n front.resolve({ value, done: true });\n break;\n\n case \"throw\":\n front.reject(value);\n break;\n\n default:\n front.resolve({ value, done: false });\n break;\n }\n\n front = front.next;\n\n if (front) resume(front.type, front.value);\n else back = null;\n }\n\n function resume(type, value) {\n\n // HACK: If the generator does not support the \"return\" method, then\n // emulate it (poorly) using throw. (V8 circa 2015-02-13 does not support\n // generator.return.)\n if (type === \"return\" && !(type in iter)) {\n\n type = \"throw\";\n value = { value, __return: true };\n }\n\n try {\n\n let result = iter[type](value);\n value = result.value;\n\n if (value && typeof value === \"object\" && \"_esdown_await\" in value) {\n\n if (result.done)\n throw new Error(\"Invalid async generator return\");\n\n Promise.resolve(value._esdown_await).then(\n x => resume(\"next\", x),\n x => resume(\"throw\", x));\n\n } else {\n\n settle(result.done ? \"return\" : \"normal\", result.value);\n }\n\n } catch (x) {\n\n // HACK: Return-as-throw\n if (x && x.__return === true)\n return settle(\"return\", x.value);\n\n settle(\"throw\", x);\n }\n }\n}", "async function useAsyncGenerator () {\n for await (let item of asyncGenerator(3)) {\n console.log(item)\n }\n}", "function AsyncPreOrderIterator (onVisit, onEnd) {\n this.onVisit = onVisit;\n this.onEnd = onEnd;\n}", "function asyncPromObjIter(objects_array, iterator, extraValue, callback) {\n var start_promise = objects_array.reduce(function (prom, object) {\n return prom.then(function () {\n return iterator(object,extraValue);\n });\n }, Promise.resolve()); // initial\n if(callback){\n start_promise.then(callback);\n }else{\n return start_promise;\n }\n}", "mapAsync(transform) {\n return new AsyncMapIterator(this, transform);\n }", "function AcquireReadableStreamAsyncIterator(stream, preventCancel = false) {\n const reader = AcquireReadableStreamDefaultReader(stream);\n const iterator = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorReader = reader;\n iterator._preventCancel = Boolean(preventCancel);\n return iterator;\n}", "async function forAwait(iterable, cb) {\n const iter = getIterator(iterable);\n while (true) {\n const { value, done } = await iter.next();\n if (value) await cb(value);\n if (done) break\n }\n if (iter.return) iter.return();\n}", "async function forAwait(iterable, cb) {\n const iter = getIterator(iterable);\n while (true) {\n const { value, done } = await iter.next();\n if (value) await cb(value);\n if (done) break\n }\n if (iter.return) iter.return();\n}", "function makeIterable(i) {\n function* fromIterator(i) {\n for (let r = i.next(); !r.done; r = i.next()) {\n yield r.value;\n }\n }\n function* fromIterable(i) {\n yield* i;\n }\n return isIterable(i) ? (isIterableIterator(i) ? i : fromIterable(i)) : fromIterator(i);\n}", "function AsyncIterator(batchSize)\n{\n\tif (!this instanceof AsyncIterator) {\n\t\tthrow new Error(\"constructor\");\n\t}\n\n\tif (!(batchSize > 0)) {\n\t\tbatchSize = this.DEFAULT_PER_EVENT;\n\t}\n\tthis.batchSize = batchSize;\n\tthis.data = null;\n}", "function createRejectingIterable() {\n return {\n [Symbol.asyncIterator]() {\n return this;\n },\n next() {\n return Promise.reject(new Error('Problem!'));\n }\n }\n}", "subscribe(_parent, _args, _context, _info) {\n const monitor = this.getMonitor({\n liveAbort: e => {\n if (iterator) iterator.throw(e);\n }\n });\n const iterator = makeAsyncIteratorFromMonitor(monitor);\n return iterator;\n }", "async * [Symbol.asyncIterator]() {\n try {\n while (1) {\n await last[_p]\n yield last.get()\n }\n } catch (e) {\n } finally {\n }\n }", "_makeIterator() {\n return this.fn.apply(this.context, this.args);\n }", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}", "function _createForOfIteratorHelper(t,o){var e=\"undefined\"!=typeof Symbol&&t[Symbol.iterator]||t[\"@@iterator\"];if(!e){if(Array.isArray(t)||(e=_unsupportedIterableToArray(t))||o&&t&&\"number\"==typeof t.length){e&&(t=e);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var n,a=!0,s=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){s=!0,n=t},f:function(){try{a||null==e.return||e.return()}finally{if(s)throw n}}}}", "function Iterable() {}", "async function g() {\n for await (const x of createAsyncIterable(['e', 'f', 'g'])) {\n console.log(x);\n break;\n }\n}", "async function concatenateAsyncIterator(asyncIterator) {\n let arrayBuffer = new ArrayBuffer();\n let string = '';\n for await (const chunk of asyncIterator) {\n if (typeof chunk === 'string') {\n string += chunk;\n } else {\n arrayBuffer = Object(_javascript_utils_memory_copy_utils__WEBPACK_IMPORTED_MODULE_0__[\"concatenateArrayBuffers\"])(arrayBuffer, chunk);\n }\n }\n return string || arrayBuffer;\n}", "createIterator (results) {\n return {\n next () {\n return results.shift() || { done: true };\n }\n };\n }", "function readabletoIterable(readStream) {\n return __asyncGenerator(this, arguments, function readabletoIterable_1() {\n var streamEnded, generationEnded, records, value;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n streamEnded = false;\n generationEnded = false;\n records = new Array();\n readStream.on(\"error\", function (err) {\n if (!streamEnded) {\n streamEnded = true;\n }\n if (err) {\n throw err;\n }\n });\n readStream.on(\"data\", function (data) {\n records.push(data);\n });\n readStream.on(\"end\", function () {\n streamEnded = true;\n });\n _a.label = 1;\n case 1:\n if (!!generationEnded) return [3 /*break*/, 6];\n return [4 /*yield*/, __await(new Promise(function (resolve) { return setTimeout(function () { return resolve(records.shift()); }, 0); }))];\n case 2:\n value = _a.sent();\n if (!value) return [3 /*break*/, 5];\n return [4 /*yield*/, __await(value)];\n case 3: return [4 /*yield*/, _a.sent()];\n case 4:\n _a.sent();\n _a.label = 5;\n case 5:\n generationEnded = streamEnded && records.length === 0;\n return [3 /*break*/, 1];\n case 6: return [2 /*return*/];\n }\n });\n });\n}", "function iter(o) {\n // Makes sure that create_iterator is called in the same scope as iter.\n return create_iterator.call(this, o);\n}", "function makeReusableIterable(generatorFn) {\n return {\n [Symbol.iterator]: generatorFn\n };\n}", "async iterateAll (iterable) {\n let items = [];\n for await (let item of iterable) {\n items.push(item);\n }\n\n return items;\n }", "async buffer() {\n if (this.#gen) {\n throw new Error(\"Cannot not switch from non-buffer to buffer mode\");\n }\n this.#isBuffering = true;\n this.#isStarted = true;\n this.#gen = this.#iterable[Symbol.asyncIterator]();\n let value = void 0;\n do {\n this.#next = this.#gen.next();\n try {\n value = await this.#next;\n this.#queue.push(value);\n } catch (e) {\n this.#error = e;\n }\n } while (value && !value.done);\n }", "function asyncForEach(array, iterator, done) {\n if (!Array.isArray(array)) {\n throw new TypeError(`${array} is not an array`);\n }\n if (array.length === 0) {\n // NOTE: Normally a bad idea to mix sync and async, but it's safe here because\n // of the way that this method is currently used by DirectoryReader.\n done();\n return;\n }\n // Simultaneously process all items in the array.\n let pending = array.length;\n for (let item of array) {\n iterator(item, callback);\n }\n function callback() {\n if (--pending === 0) {\n done();\n }\n }\n}", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function ArrayLikeIterator (obj) {\n\t this._o = obj\n\t this._i = 0\n\t}", "function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }", "function async_each(arr, iterator, cb) {\n\n if (!arr.length)\n return cb();\n\n var completed = 0;\n\n function done(err) {\n\n if (err) {\n cb(err);\n cb = function(){};\n }\n else {\n completed += 1;\n\n if (completed >= arr.length)\n return cb();\n\n }\n\n }\n\n _.each(arr, function (x) {\n iterator(x, _.once(done));\n });\n\n}", "_asyncWrapper(result) {\r\n if (typeof result === 'object' && 'then' in result) {\r\n return result;\r\n } else {\r\n return new Promise(function(resolve) {\r\n resolve(result);\r\n });\r\n }\r\n }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(\"next\", value); }, function (err) { step(\"throw\", err); }); } } return step(\"next\"); }); }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(\"next\", value); }, function (err) { step(\"throw\", err); }); } } return step(\"next\"); }); }; }", "function asyncAdapter(generator) {\n return function () {\n var g = generator.apply(this, arguments);\n\n function handle(result) {\n if (result.done) {\n return $p.resolve(result.value);\n }\n return $p.resolve(result.value)\n .then(function (res) {\n return handle(g.next(res));\n }, function (err) {\n return handle(g.throw(err));\n });\n }\n\n return handle(g.next());\n };\n }", "function asyncAdapter(generator) {\n return function () {\n var g = generator.apply(this, arguments);\n\n function handle(result) {\n if (result.done) {\n return $p.resolve(result.value);\n }\n return $p.resolve(result.value)\n .then(function (res) {\n return handle(g.next(res));\n }, function (err) {\n return handle(g.throw(err));\n });\n }\n\n return handle(g.next());\n }\n }", "function asyncFunction(iter) {\n\n return new Promise((resolve, reject) => {\n\n resume(\"next\", void 0);\n\n function resume(type, value) {\n\n try {\n\n let result = iter[type](value);\n\n if (result.done) {\n\n resolve(result.value);\n\n } else {\n\n Promise.resolve(result.value).then(\n x => resume(\"next\", x),\n x => resume(\"throw\", x));\n }\n\n } catch (x) { reject(x) }\n }\n });\n}", "function syncForEach(array, iterator, done) {\n if (!Array.isArray(array)) {\n throw new TypeError(`${array} is not an array`);\n }\n for (let item of array) {\n iterator(item, () => {\n // Note: No error-handling here because this is currently only ever called\n // by DirectoryReader, which never passes an `error` parameter to the callback.\n // Instead, DirectoryReader emits an \"error\" event if an error occurs.\n });\n }\n done();\n}", "function decorateCursor(cursor) {\n cursor.eachAsync = function(fn, opts, callback) {\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n }\n opts = opts || {};\n\n return eachAsync(function(cb) { return cursor.next(cb); }, fn, opts, callback);\n };\n}", "function ArrayIterable(arr){\n this.arr = arr\n}", "get asyncIterPersist(){\n\t\treturn this\n\t}", "constructor(iterable) {\n this._available = undefined;\n this._pending = undefined;\n if (!utils_1.isIterable(iterable, /*optional*/ true))\n throw new TypeError(\"Object not iterable: iterable.\");\n if (!utils_1.isMissing(iterable)) {\n this._available = [];\n for (const value of iterable) {\n this._available.push(Promise.resolve(value));\n }\n }\n }", "function iteratorFor(items) {\n var iterator = {\n next: function next() {\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 }", "function Iterator(iterable, start, stop, step) {\n if (!iterable) {\n return Iterator.empty;\n } else if (iterable instanceof Iterator) {\n return iterable;\n } else if (!(this instanceof Iterator)) {\n return new Iterator(iterable, start, stop, step);\n } else if (Array.isArray(iterable) || typeof iterable === \"string\") {\n iterators.set(this, new IndexIterator(iterable, start, stop, step));\n return;\n }\n iterable = Object(iterable);\n if (iterable.next) {\n iterators.set(this, iterable);\n } else if (iterable.iterate) {\n iterators.set(this, iterable.iterate(start, stop, step));\n } else if (Object.prototype.toString.call(iterable) === \"[object Function]\") {\n this.next = iterable;\n } else {\n throw new TypeError(\"Can't iterate \" + iterable);\n }\n}", "async next() {\n return iter.next();\n }" ]
[ "0.74373925", "0.7015094", "0.6998571", "0.6935101", "0.6935101", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.6910753", "0.67940116", "0.6651916", "0.6590866", "0.6590866", "0.6480144", "0.6450595", "0.64063615", "0.64063615", "0.639878", "0.63822335", "0.63483316", "0.6264718", "0.6195129", "0.6195129", "0.6195129", "0.6144933", "0.6077389", "0.6036426", "0.6036426", "0.6036426", "0.6036426", "0.6036426", "0.6015244", "0.5982408", "0.5833264", "0.5812829", "0.5761236", "0.57444024", "0.5731009", "0.57098824", "0.57098824", "0.5683656", "0.5666294", "0.5653305", "0.564947", "0.56323886", "0.5627141", "0.56182754", "0.56182754", "0.56182754", "0.56182754", "0.56182754", "0.56178176", "0.5604692", "0.5602074", "0.55950904", "0.55793124", "0.55702657", "0.55611163", "0.5555112", "0.5506096", "0.5486213", "0.5450142", "0.54426235", "0.54426235", "0.54426235", "0.54423815", "0.54408973", "0.54408973", "0.5434423", "0.5434423", "0.5434423", "0.542251", "0.5416492", "0.53921336", "0.53921336", "0.53735214", "0.53722554", "0.5357136", "0.5340073", "0.53203225", "0.530773", "0.5302295", "0.5293773", "0.52560633", "0.5245904", "0.52239066" ]
0.8003384
3
Creates a new visitor instance which delegates to many visitors to run in parallel. Each visitor will be visited for each node before moving on. If a prior visitor edits a node, no following visitors will see that node.
function visitInParallel(visitors) { var skipping = new Array(visitors.length); return { enter: function enter(node) { for (var i = 0; i < visitors.length; i++) { if (!skipping[i]) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === false) { skipping[i] = node; } else if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined) { return result; } } } } }, leave: function leave(node) { for (var i = 0; i < visitors.length; i++) { if (!skipping[i]) { var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true); if (fn) { var result = fn.apply(visitors[i], arguments); if (result === BREAK) { skipping[i] = BREAK; } else if (result !== undefined && result !== false) { return result; } } } else if (skipping[i] === node) { skipping[i] = null; } } } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function visitInParallel(visitors) {\n\t\t var skipping = new Array(visitors.length);\n\n\t\t return {\n\t\t enter: function enter(node) {\n\t\t for (var i = 0; i < visitors.length; i++) {\n\t\t if (!skipping[i]) {\n\t\t var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n\t\t if (fn) {\n\t\t var result = fn.apply(visitors[i], arguments);\n\t\t if (result === false) {\n\t\t skipping[i] = node;\n\t\t } else if (result === BREAK) {\n\t\t skipping[i] = BREAK;\n\t\t } else if (result !== undefined) {\n\t\t return result;\n\t\t }\n\t\t }\n\t\t }\n\t\t }\n\t\t },\n\t\t leave: function leave(node) {\n\t\t for (var i = 0; i < visitors.length; i++) {\n\t\t if (!skipping[i]) {\n\t\t var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true);\n\t\t if (fn) {\n\t\t var result = fn.apply(visitors[i], arguments);\n\t\t if (result === BREAK) {\n\t\t skipping[i] = BREAK;\n\t\t } else if (result !== undefined && result !== false) {\n\t\t return result;\n\t\t }\n\t\t }\n\t\t } else if (skipping[i] === node) {\n\t\t skipping[i] = null;\n\t\t }\n\t\t }\n\t\t }\n\t\t };\n\t\t}", "function visitInParallel(visitors) {\n\t var skipping = new Array(visitors.length);\n\n\t return {\n\t enter: function enter(node) {\n\t for (var i = 0; i < visitors.length; i++) {\n\t if (!skipping[i]) {\n\t var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n\t if (fn) {\n\t var result = fn.apply(visitors[i], arguments);\n\t if (result === false) {\n\t skipping[i] = node;\n\t } else if (result === BREAK) {\n\t skipping[i] = BREAK;\n\t } else if (result !== undefined) {\n\t return result;\n\t }\n\t }\n\t }\n\t }\n\t },\n\t leave: function leave(node) {\n\t for (var i = 0; i < visitors.length; i++) {\n\t if (!skipping[i]) {\n\t var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true);\n\t if (fn) {\n\t var result = fn.apply(visitors[i], arguments);\n\t if (result === BREAK) {\n\t skipping[i] = BREAK;\n\t } else if (result !== undefined && result !== false) {\n\t return result;\n\t }\n\t }\n\t } else if (skipping[i] === node) {\n\t skipping[i] = null;\n\t }\n\t }\n\t }\n\t };\n\t}", "function visitInParallel(visitors) {\n\t var skipping = new Array(visitors.length);\n\n\t return {\n\t enter: function enter(node) {\n\t for (var i = 0; i < visitors.length; i++) {\n\t if (!skipping[i]) {\n\t var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n\t if (fn) {\n\t var result = fn.apply(visitors[i], arguments);\n\t if (result === false) {\n\t skipping[i] = node;\n\t } else if (result === BREAK) {\n\t skipping[i] = BREAK;\n\t } else if (result !== undefined) {\n\t return result;\n\t }\n\t }\n\t }\n\t }\n\t },\n\t leave: function leave(node) {\n\t for (var i = 0; i < visitors.length; i++) {\n\t if (!skipping[i]) {\n\t var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true);\n\t if (fn) {\n\t var result = fn.apply(visitors[i], arguments);\n\t if (result === BREAK) {\n\t skipping[i] = BREAK;\n\t } else if (result !== undefined && result !== false) {\n\t return result;\n\t }\n\t }\n\t } else if (skipping[i] === node) {\n\t skipping[i] = null;\n\t }\n\t }\n\t }\n\t };\n\t}", "function visitInParallel(visitors) {\n\t var skipping = new Array(visitors.length);\n\n\t return {\n\t enter: function enter(node) {\n\t for (var i = 0; i < visitors.length; i++) {\n\t if (!skipping[i]) {\n\t var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n\t if (fn) {\n\t var result = fn.apply(visitors[i], arguments);\n\t if (result === false) {\n\t skipping[i] = node;\n\t } else if (result === BREAK) {\n\t skipping[i] = BREAK;\n\t } else if (result !== undefined) {\n\t return result;\n\t }\n\t }\n\t }\n\t }\n\t },\n\t leave: function leave(node) {\n\t for (var i = 0; i < visitors.length; i++) {\n\t if (!skipping[i]) {\n\t var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true);\n\t if (fn) {\n\t var result = fn.apply(visitors[i], arguments);\n\t if (result === BREAK) {\n\t skipping[i] = BREAK;\n\t } else if (result !== undefined && result !== false) {\n\t return result;\n\t }\n\t }\n\t } else if (skipping[i] === node) {\n\t skipping[i] = null;\n\t }\n\t }\n\t }\n\t };\n\t}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind, /* isLeaving */true);\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n }", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}", "function NodeVisitor() {\n _classCallCheck(this, NodeVisitor);\n\n this[path] = [];\n }", "function Visitor() {}", "function Visitor() {}", "function Visitor() {}", "visit(node) {\n node.state = 1 /* IN_PROGRESS */;\n for (const edge of Object.values(node.dependencies)) {\n const target = this.nodes[edge.to];\n switch (target.state) {\n case 2 /* VISITED */: break; // Do nothing, since node was already visited\n case 1 /* IN_PROGRESS */:\n this.visitOpenNode(node, target, edge);\n break;\n case 0 /* NOT_VISITED */: this.visit(target);\n }\n }\n if (node.state !== 2 /* VISITED */) {\n node.state = 2 /* VISITED */;\n this.sortedNodeList.push(node.hash);\n }\n }", "visit(visitor){\n if (visitor.before) {\n visitor.before.call(visitor, this);\n }\n if (visitor.after) {\n visitor.after.call(visitor, this);\n }\n }", "visitNode(node) { }", "function visit(node, fn) {\n if (!node.visited) {\n defineProperty$7(node, 'visited', true);\n return node.nodes ? mapVisit$1(node.nodes, fn) : fn(node);\n }\n return node;\n}", "visit(){\n this.visited = true ;\n }", "function visit(node, fn) {\n if (!node.visited) {\n define(node, 'visited', true);\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n return node;\n}", "function visit(node, fn) {\n if (!node.visited) {\n define(node, 'visited', true);\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n\n return node;\n}", "link() {\n //the act of walking causes the nodes to be linked\n this.walk(() => { }, {\n walkMode: visitors_1.WalkMode.visitAllRecursive\n });\n }", "function visit(node, fn) {\n if (!node.visited) {\n _define(node, 'visited', true);\n\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n\n return node;\n}", "function mapVisit(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n }", "function mapVisit(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n }", "function mapVisit(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n }", "function mapVisit(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n }", "function createVisitor(visitor) {\n //remap some deprecated visitor names TODO remove this in v1\n if (visitor.ClassFieldStatement) {\n visitor.FieldStatement = visitor.ClassFieldStatement;\n }\n if (visitor.ClassMethodStatement) {\n visitor.MethodStatement = visitor.ClassMethodStatement;\n }\n return ((statement, parent, owner, key) => {\n var _a;\n return (_a = visitor[statement.constructor.name]) === null || _a === void 0 ? void 0 : _a.call(visitor, statement, parent, owner, key);\n });\n}", "function mapVisit(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n}", "function mapVisit(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n}", "function mapVisit(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n}", "function Visitor() {\r\n}", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function visit(node, fn) {\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }", "function mapVisit$1(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n}", "function Visitor(doc) {\n\tthis.stack = [];\n\tthis.parent = doc; //always a list item\n\tthis.node = doc.head();\n\tthis.index = 0;\n\tthis.point = 1;\n\tthis.retained = 0;\n\tthis.ops = []; //to get to the doc\n}", "set visit(visitor){\n\n if(!this.visiting){\n this.visiting = {\n current: this.clock.date,\n occupants: []\n };\n }\n\n this.visiting.occupants.push(visitor);\n // todo check trigger events\n }", "clone() {\n return new GraphTraversal(this.graph, this.traversalStrategies, this.getBytecode());\n }", "function traverseNodes(node, visitor) {\n traverse(node, null, visitor);\n}", "function make(funcs, baseVisitor) {\n var visitor = create(baseVisitor || base);\n for (var type in funcs) { visitor[type] = funcs[type]; }\n return visitor\n }", "function make(funcs, baseVisitor) {\n var visitor = create(baseVisitor || base);\n for (var type in funcs) { visitor[type] = funcs[type]; }\n return visitor\n }", "function Visitor(name, destination){\n this.name = name;\n this.destination = destination;\n }", "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 var traversal = options.traversal || 'preorder'; // also: postorder\n\n var visitors = lively_lang.obj.clone(options.visitors ? options.visitors : walk.make(walk.visitors.withMemberExpression));\n var iterator = traversal === 'preorder' ? function (orig, type, node, depth, cont) {\n func(node, state, depth, type);return orig(node, depth + 1, cont);\n } : function (orig, type, node, depth, cont) {\n var result = orig(node, depth + 1, cont);func(node, state, depth, type);return result;\n };\n Object.keys(visitors).forEach(function (type) {\n var orig = visitors[type];\n visitors[type] = function (node, depth, cont) {\n return iterator(orig, type, node, depth, cont);\n };\n });\n walk.recursive(parsed, 0, null, visitors);\n return parsed;\n}", "visit() {\n if(this.state) this.state = Node.VISITED;\n }", "fan(...nodes) {\n nodes.forEach(node => this.connect(node));\n return this;\n }", "forEach(visit){\n if (visit instanceof Function){\n\n if (this.end == null || this.start == null){\n return\n }else if(this.end == this.start){\n visit(this.end);\n }else{\n let cur = this.start;\n let i = 0;\n visit(cur, i);\n while ( cur != this.end && cur != null){\n cur = cur.next;\n i++;\n visit(cur, i);\n }\n }\n }else{\n throw `Error calling forEach:\\n${visit} is not a Function`\n }\n }", "function make(funcs, baseVisitor) {\n var visitor = create(baseVisitor || base);\n for (var type in funcs) { visitor[type] = funcs[type]; }\n return visitor\n}", "function make(funcs, baseVisitor) {\n var visitor = create(baseVisitor || base);\n for (var type in funcs) { visitor[type] = funcs[type]; }\n return visitor\n}", "visit() {\n this.state = 'visiting'\n const _this = this\n this.recordInfor('开始遍历文件树...')\n removeOutOfVisitlessQueue(this)\n addToVisitingQueue(this)\n visitTask(this.target, this.name, this.type, this.rootSize, this.dirUUID, this.tree, this, (err, data) => {\n if (err) return _this.error(err, '遍历服务器数据出错')\n _this.tree[0].downloadPath = _this.downloadPath\n removeOutOfVisitingQueue(this)\n _this.recordInfor('遍历文件树结束...')\n this.diff()\n })\n }", "function RandomVisitor() {\n antlr4.tree.ParseTreeVisitor.call(this);\n return this;\n}", "function AndNodeFactory() {}", "constructor(){\n this.vertices = new LinkedList();\n this.vertArray = new Array(); //for fast access, just an array of references, not too large.\n this.selectedVert = null;\n this.numVertices = 0;\n this.newEdge1 = null;\n this.newEdge2 = null;\n this.currentStage = 0; //start at the beginning\n\n let prev = null;\n\n //this is code for adding random graphs at the start\n /* for(let i = 0; i < 0; i++){\n this.numVertices++;\n let vert = new Vertex(2 * Math.random() - 1, 2 * Math.random() - 1, this.numVertices);\n this.vertices.addFront(new VertexItem(vert));\n this.vertArray.push(vert);\n\n if(prev != null){\n vert.addNeighbor(prev); //just for testing add the last one as a neighbor\n prev.addNeighbor(vert); //should both know they are neighbors\n }\n\n prev = vert;\n } */\n }", "function visit(parent, visitFn, childrenFn) {\n if (!parent) return;\n\n visitFn(parent);\n\n var children = childrenFn(parent);\n var count = children.length;\n for (var i = 0; i < count; i++) {\n visit(children[i], visitFn, childrenFn);\n }\n }", "forEach(visitor) {\n this.tree_walk(this.root, (node) => visitor(node.item.key, node.item.value));\n }", "function DfsWalker() {\n // Every node visited by the walker\n this.visited = {};\n // Nodes collected by the walker\n this.collected = [];\n var walker = this;\n this.collected.and = function () { return walker; };\n }", "function dfsVisit(v){\n currentTime = currentTime + 1;\n v.discovered = currentTime;\n v.color='gray';\n for(let counter in v.adjList){\n if(currentGraph.vertices[v.adjList[counter]].color=='white'){\n currentGraph.vertices[v.adjList[counter]].predecessor = v.name;\n dfsVisit(currentGraph.vertices[v.adjList[counter]]);\n }\n }\n v.color='black';\n currentTime = currentTime + 1;\n v.finished = currentTime;\n\n}", "static createVisitor(newObj, callback) {\n var newVisitor = new VisitorSchema();\n\n if (!newObj.provider) {\n return callback(new Error(\"PROVIDER004\"));\n } else {\n newVisitor.provider = newObj.provider;\n }\n\n if (newObj.name) {\n newVisitor.name = newObj.name;\n } else {\n return callback(new Error(\"VISITOR001\"));\n }\n \n newVisitor.email = newObj.email;\n newVisitor.phone = newObj.phone;\n newVisitor.status = newObj.status || \"created\";\n\n async.series([\n function(cb) {\n if (newObj.email) {\n //check if e mail already exists\n VisitorSchema.findOne({\n provider: newObj.provider,\n email: newObj.email\n }).exec(function(err, foundVisitor) {\n if (err) {\n return cb(new Error(\"DBA002\", err.message));\n } else if (foundVisitor) {\n return cb(new Error(\"VISITOR007\"));\n } else {\n return cb(null);\n }\n });\n } else {\n cb(null);\n }\n }\n ],\n function(err, results) {\n if (err) {\n return callback(err);\n } else {\n newVisitor.save(function(err, cbVisitor) {\n if (err) {\n callback(new Error(\"DBA001\", err.message));\n } else {\n callback(null, new Visitor(cbVisitor));\n }\n });\n }\n });\n }", "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 }", "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 }", "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 }", "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 }", "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 }", "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}", "function bfsVisitor(g, initial, visitor, filter = nopFilter) {\n const visitBits = new util_1.OneBitArray(g.nodeCount);\n const nodesToVisit = new Uint32Array(g.nodeCount);\n let nodesToVisitLength = 0;\n function enqueue(nodeIndex) {\n nodesToVisit[nodesToVisitLength++] = nodeIndex;\n }\n let index = 0;\n initial.map(enqueue);\n initial.forEach((i) => visitBits.set(i, true));\n const node = new Node(0, g);\n const edge = new Edge(0, g);\n while (index < nodesToVisitLength) {\n const nodeIndex = nodesToVisit[index++];\n node.nodeIndex = nodeIndex;\n visitor(node);\n const firstEdgeIndex = g.firstEdgeIndexes[nodeIndex];\n const edgesEnd = g.firstEdgeIndexes[nodeIndex + 1];\n for (let edgeIndex = firstEdgeIndex; edgeIndex < edgesEnd; edgeIndex++) {\n const childNodeIndex = g.edgeToNodes[edgeIndex];\n edge.edgeIndex = edgeIndex;\n if (!visitBits.get(childNodeIndex) && filter(node, edge)) {\n visitBits.set(childNodeIndex, true);\n enqueue(childNodeIndex);\n }\n }\n }\n}", "function explode(visitor) {\n\t if (visitor._exploded) return visitor;\n\t visitor._exploded = true;\n\n\t // normalise pipes\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var parts = nodeType.split(\"|\");\n\t if (parts.length === 1) continue;\n\n\t var fns = visitor[nodeType];\n\t delete visitor[nodeType];\n\n\t var _arr = parts;\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var part = _arr[_i];\n\t visitor[part] = fns;\n\t }\n\t }\n\n\t // verify data structure\n\t verify(visitor);\n\n\t // make sure there's no __esModule type since this is because we're using loose mode\n\t // and it sets __esModule to be enumerable on all modules :(\n\t delete visitor.__esModule;\n\n\t // ensure visitors are objects\n\t ensureEntranceObjects(visitor);\n\n\t // ensure enter/exit callbacks are arrays\n\t ensureCallbackArrays(visitor);\n\n\t // add type wrappers\n\n\t var _arr2 = Object.keys(visitor);\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var nodeType = _arr2[_i2];\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var wrapper = virtualTypes[nodeType];\n\t if (!wrapper) continue;\n\n\t // wrap all the functions\n\t var fns = visitor[nodeType];\n\t for (var type in fns) {\n\t fns[type] = wrapCheck(wrapper, fns[type]);\n\t }\n\n\t // clear it from the visitor\n\t delete visitor[nodeType];\n\n\t if (wrapper.types) {\n\t var _arr4 = wrapper.types;\n\n\t for (var _i4 = 0; _i4 < _arr4.length; _i4++) {\n\t var type = _arr4[_i4];\n\t // merge the visitor if necessary or just put it back in\n\t if (visitor[type]) {\n\t mergePair(visitor[type], fns);\n\t } else {\n\t visitor[type] = fns;\n\t }\n\t }\n\t } else {\n\t mergePair(visitor, fns);\n\t }\n\t }\n\n\t // add aliases\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var fns = visitor[nodeType];\n\n\t var aliases = t.FLIPPED_ALIAS_KEYS[nodeType];\n\t if (!aliases) continue;\n\n\t // clear it from the visitor\n\t delete visitor[nodeType];\n\n\t var _arr3 = aliases;\n\t for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n\t var alias = _arr3[_i3];\n\t var existing = visitor[alias];\n\t if (existing) {\n\t mergePair(existing, fns);\n\t } else {\n\t visitor[alias] = _lodashLangClone2[\"default\"](fns);\n\t }\n\t }\n\t }\n\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t ensureCallbackArrays(visitor[nodeType]);\n\t }\n\n\t return visitor;\n\t}", "function explode(visitor) {\n\t if (visitor._exploded) return visitor;\n\t visitor._exploded = true;\n\n\t // normalise pipes\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var parts = nodeType.split(\"|\");\n\t if (parts.length === 1) continue;\n\n\t var fns = visitor[nodeType];\n\t delete visitor[nodeType];\n\n\t var _arr = parts;\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var part = _arr[_i];\n\t visitor[part] = fns;\n\t }\n\t }\n\n\t // verify data structure\n\t verify(visitor);\n\n\t // make sure there's no __esModule type since this is because we're using loose mode\n\t // and it sets __esModule to be enumerable on all modules :(\n\t delete visitor.__esModule;\n\n\t // ensure visitors are objects\n\t ensureEntranceObjects(visitor);\n\n\t // ensure enter/exit callbacks are arrays\n\t ensureCallbackArrays(visitor);\n\n\t // add type wrappers\n\n\t var _arr2 = Object.keys(visitor);\n\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var nodeType = _arr2[_i2];\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var wrapper = virtualTypes[nodeType];\n\t if (!wrapper) continue;\n\n\t // wrap all the functions\n\t var fns = visitor[nodeType];\n\t for (var type in fns) {\n\t fns[type] = wrapCheck(wrapper, fns[type]);\n\t }\n\n\t // clear it from the visitor\n\t delete visitor[nodeType];\n\n\t if (wrapper.types) {\n\t var _arr4 = wrapper.types;\n\n\t for (var _i4 = 0; _i4 < _arr4.length; _i4++) {\n\t var type = _arr4[_i4];\n\t // merge the visitor if necessary or just put it back in\n\t if (visitor[type]) {\n\t mergePair(visitor[type], fns);\n\t } else {\n\t visitor[type] = fns;\n\t }\n\t }\n\t } else {\n\t mergePair(visitor, fns);\n\t }\n\t }\n\n\t // add aliases\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t var fns = visitor[nodeType];\n\n\t var aliases = t.FLIPPED_ALIAS_KEYS[nodeType];\n\t if (!aliases) continue;\n\n\t // clear it from the visitor\n\t delete visitor[nodeType];\n\n\t var _arr3 = aliases;\n\t for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n\t var alias = _arr3[_i3];\n\t var existing = visitor[alias];\n\t if (existing) {\n\t mergePair(existing, fns);\n\t } else {\n\t visitor[alias] = _lodashLangClone2[\"default\"](fns);\n\t }\n\t }\n\t }\n\n\t for (var nodeType in visitor) {\n\t if (shouldIgnoreKey(nodeType)) continue;\n\n\t ensureCallbackArrays(visitor[nodeType]);\n\t }\n\n\t return visitor;\n\t}", "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 }", "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\t visit(children[i], visitFn, childrenFn);\n }\n }\n}", "function DAG() {\n this.names = [];\n this.vertices = Object.create(null);\n }", "function merge(visitors) {\n var rootVisitor = {};\n\n var _arr5 = visitors;\n for (var _i5 = 0; _i5 < _arr5.length; _i5++) {\n var visitor = _arr5[_i5];\n explode(visitor);\n\n for (var type in visitor) {\n var nodeVisitor = rootVisitor[type] = rootVisitor[type] || {};\n mergePair(nodeVisitor, visitor[type]);\n }\n }\n\n return rootVisitor;\n}", "function doOneNode(index, dest){\n\tvar currNode = index[0];\n\tindex.splice(0,1);\n\tcurrNode.node.properties.LinkedTo.forEach(function(elem){\n\t\tif(currNode.route.indexOf(elem) == -1){\n\t\t\t//calc new index val, the 10000 is arbitrary to make the numbers not tiny.\n\t\t\tvar currNodeCoords = currNode.node.geometry.coordinates;\n\t\t\tvar destNodeCoords = GJSONOrdered[elem].geometry.coordinates;\n\t\t\t//calc the new dist travelled\n\t\t\tvar newDist = currNode.distTravelled + distBetweenCoords(currNodeCoords, destNodeCoords) + 0.35*Math.abs(currNode.node.properties.Level - GJSONOrdered[elem].properties.Level);\n\t\t\t//calc the dist travelled + minimum dist to travel to destination\n\t\t\tvar newVal = newDist + distBetweenCoords(currNodeCoords, dest.geometry.coordinates);\n\t\t\t//make new index object\n\t\t\tvar newRoute = currNode.route.slice();\n\t\t\tnewRoute.push(elem);\n\t\t\tvar newIndexObj = {'val': newVal, 'distTravelled': newDist, 'node':GJSONOrdered[elem], 'route': newRoute};\n\t\t\t//find the first element of index which val is more than the val of the new object and insert the new object at that location\n\t\t\tif(index.length != 0){\n\t\t\t\tfor(var i = 0; i < index.length; i++){\n\t\t\t\t\tif(index[i].val > newIndexObj.val){\n\t\t\t\t\t\tindex.splice(i,0,newIndexObj);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//if the new object would be added to the end of the list\n\t\t\t\t\t//so if we still havent 'break' by the end of the final loop, add it there.\n\t\t\t\t\t}else if(i == index.length - 1){\n\t\t\t\t\t\tindex[index.length] = newIndexObj;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tindex[0] = newIndexObj;\n\t\t\t}\n\t\t}else{\n\t\t\t//would be a cycle, so we're not adding that node.\n\t\t}\n\t});\n}", "createGraph() {\n this.graphSubscription.unsubscribe();\n this.graphSubscription = new rxjs__WEBPACK_IMPORTED_MODULE_7__[\"Subscription\"]();\n const initializeNode = (n) => {\n if (!n.meta) {\n n.meta = {};\n }\n if (!n.id) {\n n.id = id();\n }\n if (!n.dimension) {\n n.dimension = {\n width: this.nodeWidth ? this.nodeWidth : 30,\n height: this.nodeHeight ? this.nodeHeight : 30\n };\n n.meta.forceDimensions = false;\n }\n else {\n n.meta.forceDimensions = n.meta.forceDimensions === undefined ? true : n.meta.forceDimensions;\n }\n n.position = {\n x: 0,\n y: 0\n };\n n.data = n.data ? n.data : {};\n return n;\n };\n this.graph = {\n nodes: this.nodes.length > 0 ? [...this.nodes].map(initializeNode) : [],\n clusters: this.clusters && this.clusters.length > 0 ? [...this.clusters].map(initializeNode) : [],\n edges: this.links.length > 0\n ? [...this.links].map(e => {\n if (!e.id) {\n e.id = id();\n }\n return e;\n })\n : []\n };\n requestAnimationFrame(() => this.draw());\n }", "function visit() {\n if (this.isBlacklisted()) return false;\n if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n this.call(\"enter\");\n\n if (this.shouldSkip) {\n return this.shouldStop;\n }\n\n var node = this.node;\n var opts = this.opts;\n\n if (node) {\n if (Array.isArray(node)) {\n // traverse over these replacement nodes we purposely don't call exitNode\n // as the original node has been destroyed\n for (var i = 0; i < node.length; i++) {\n _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n }\n } else {\n _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n this.call(\"exit\");\n }\n }\n\n return this.shouldStop;\n}", "function createNode(...args) {\n return new Node(...args)\n}" ]
[ "0.64227366", "0.638854", "0.638854", "0.638854", "0.63746333", "0.63746333", "0.63746333", "0.63746333", "0.63746333", "0.63746333", "0.63717467", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.6369584", "0.57317215", "0.5570741", "0.5570741", "0.5570741", "0.546207", "0.5425756", "0.5393207", "0.53111935", "0.53000295", "0.52946866", "0.5291688", "0.5264691", "0.5249698", "0.519683", "0.519683", "0.518896", "0.518896", "0.5146386", "0.5141536", "0.5141536", "0.51261806", "0.51159215", "0.5074719", "0.5074719", "0.5074719", "0.5074719", "0.5045562", "0.5043234", "0.5009134", "0.49917355", "0.49810413", "0.49433693", "0.49433693", "0.49429792", "0.49428076", "0.4929766", "0.49185836", "0.48259407", "0.48164907", "0.48164907", "0.4800955", "0.47979298", "0.47590762", "0.47359797", "0.47196874", "0.47116494", "0.46991262", "0.46829426", "0.46699056", "0.46638", "0.4657481", "0.46473372", "0.46473372", "0.46473372", "0.46450028", "0.46309936", "0.46288997", "0.46288997", "0.45997316", "0.45591936", "0.45371515", "0.45244536", "0.45029044", "0.44937584", "0.44770825", "0.4471326" ]
0.6444636
12